diff options
author | ka <kai.ahrens@oracle.com> | 2011-02-17 21:55:54 +0100 |
---|---|---|
committer | ka <kai.ahrens@oracle.com> | 2011-02-17 21:55:54 +0100 |
commit | 66cf579511eac065ad1f75022537f9a2d4cb7252 (patch) | |
tree | a9782c30cada38ad172d12b746229d6364f42579 /svtools/source | |
parent | 3621ebea13a7c5fe00ac340be48b899ff83ad563 (diff) | |
parent | ce5f1dd187c3a7d8113c7653fa887b98fd50aaf6 (diff) |
ka102: rebased to DEV300_m100
Diffstat (limited to 'svtools/source')
160 files changed, 7190 insertions, 7173 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 3a29c4ae63fa..09fe2880fec0 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -99,7 +99,7 @@ namespace void BrowseBox::ConstructImpl( BrowserMode nMode ) { DBG_TRACE1( "BrowseBox: %p->ConstructImpl", this ); - bMultiSelection = FALSE; + bMultiSelection = sal_False; pColSel = 0; pDataWin = 0; pVScroll = 0; @@ -112,26 +112,26 @@ void BrowseBox::ConstructImpl( BrowserMode nMode ) InitSettings_Impl( this ); InitSettings_Impl( pDataWin ); - bBootstrapped = FALSE; + bBootstrapped = sal_False; nDataRowHeight = 0; nTitleLines = 1; nFirstCol = 0; nTopRow = 0; nCurRow = BROWSER_ENDOFSELECTION; nCurColId = 0; - bResizing = FALSE; - bSelect = FALSE; - bSelecting = FALSE; - bScrolling = FALSE; - bSelectionIsVisible = FALSE; - bNotToggleSel = FALSE; - bRowDividerDrag = FALSE; - bHit = FALSE; - mbInteractiveRowHeight = FALSE; - bHideSelect = FALSE; + bResizing = sal_False; + bSelect = sal_False; + bSelecting = sal_False; + bScrolling = sal_False; + bSelectionIsVisible = sal_False; + bNotToggleSel = sal_False; + bRowDividerDrag = sal_False; + bHit = sal_False; + mbInteractiveRowHeight = sal_False; + bHideSelect = sal_False; bHideCursor = NO_CURSOR_HIDE; nRowCount = 0; - m_bFocusOnlyCursor = TRUE; + m_bFocusOnlyCursor = sal_True; m_aCursorColor = COL_TRANSPARENT; m_nCurrentMode = 0; nControlAreaWidth = USHRT_MAX; @@ -194,7 +194,7 @@ BrowseBox::~BrowseBox() delete pVScroll; // free columns-space - for ( USHORT n = 0; n < pCols->Count(); ++n ) + for ( sal_uInt16 n = 0; n < pCols->Count(); ++n ) delete pCols->GetObject(n); delete pCols; delete pColSel; @@ -271,18 +271,18 @@ void BrowseBox::SetFont( const Font& rNewFont ) //------------------------------------------------------------------- -ULONG BrowseBox::GetDefaultColumnWidth( const String& _rText ) const +sal_uLong BrowseBox::GetDefaultColumnWidth( const String& _rText ) const { return GetDataWindow().GetTextWidth( _rText ) + GetDataWindow().GetTextWidth( '0' ) * 4; } //------------------------------------------------------------------- -void BrowseBox::InsertHandleColumn( ULONG nWidth ) +void BrowseBox::InsertHandleColumn( sal_uLong nWidth ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - pCols->Insert( new BrowserColumn( 0, Image(), String(), nWidth, GetZoom(), 0 ), (ULONG) 0 ); + pCols->Insert( new BrowserColumn( 0, Image(), String(), nWidth, GetZoom(), 0 ), (sal_uLong) 0 ); FreezeColumn( 0 ); // Headerbar anpassen @@ -301,19 +301,19 @@ void BrowseBox::InsertHandleColumn( ULONG nWidth ) } //------------------------------------------------------------------- -void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage, - long nWidth, HeaderBarItemBits nBits, USHORT nPos ) +void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const Image& rImage, + long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); pCols->Insert( new BrowserColumn( nItemId, rImage, String(), nWidth, GetZoom(), nBits ), - Min( nPos, (USHORT)(pCols->Count()) ) ); + Min( nPos, (sal_uInt16)(pCols->Count()) ) ); if ( nCurColId == 0 ) nCurColId = nItemId; if ( getDataWindow()->pHeaderBar ) { // Handlecolumn nicht in der Headerbar - USHORT nHeaderPos = nPos; + sal_uInt16 nHeaderPos = nPos; if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0)) nHeaderPos--; getDataWindow()->pHeaderBar->InsertItem( @@ -324,20 +324,20 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage, //------------------------------------------------------------------- -void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText, - long nWidth, HeaderBarItemBits nBits, USHORT nPos ) +void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const XubString& rText, + long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); pCols->Insert( new BrowserColumn( nItemId, Image(), rText, nWidth, GetZoom(), nBits ), - Min( nPos, (USHORT)(pCols->Count()) ) ); + Min( nPos, (sal_uInt16)(pCols->Count()) ) ); if ( nCurColId == 0 ) nCurColId = nItemId; if ( getDataWindow()->pHeaderBar ) { // Handlecolumn nicht in der Headerbar - USHORT nHeaderPos = nPos; + sal_uInt16 nHeaderPos = nPos; if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0)) nHeaderPos--; getDataWindow()->pHeaderBar->InsertItem( @@ -348,21 +348,21 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText, //------------------------------------------------------------------- -void BrowseBox::InsertDataColumn( USHORT nItemId, +void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const Image& rImage, const XubString& rText, - long nWidth, HeaderBarItemBits nBits, USHORT nPos, + long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos, const String* pHelpText ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); pCols->Insert( new BrowserColumn( nItemId, rImage, rText, nWidth, GetZoom(), nBits ), - Min( nPos, (USHORT)(pCols->Count()) ) ); + Min( nPos, (sal_uInt16)(pCols->Count()) ) ); if ( nCurColId == 0 ) nCurColId = nItemId; if ( getDataWindow()->pHeaderBar ) { // Handlecolumn nicht in der Headerbar - USHORT nHeaderPos = nPos; + sal_uInt16 nHeaderPos = nPos; if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0)) nHeaderPos--; @@ -377,20 +377,20 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, ColumnInserted( nPos ); } //------------------------------------------------------------------- -USHORT BrowseBox::ToggleSelectedColumn() +sal_uInt16 BrowseBox::ToggleSelectedColumn() { - USHORT nSelectedColId = USHRT_MAX; + sal_uInt16 nSelectedColId = USHRT_MAX; if ( pColSel && pColSel->GetSelectCount() ) { DoHideCursor( "ToggleSelectedColumn" ); ToggleSelection(); nSelectedColId = pCols->GetObject(pColSel->FirstSelected())->GetId(); - pColSel->SelectAll(FALSE); + pColSel->SelectAll(sal_False); } return nSelectedColId; } // ----------------------------------------------------------------------------- -void BrowseBox::SetToggledSelectedColumn(USHORT _nSelectedColumnId) +void BrowseBox::SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId) { if ( pColSel && _nSelectedColumnId != USHRT_MAX ) { @@ -401,7 +401,7 @@ void BrowseBox::SetToggledSelectedColumn(USHORT _nSelectedColumnId) } } // ----------------------------------------------------------------------------- -void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze ) +void BrowseBox::FreezeColumn( sal_uInt16 nItemId, sal_Bool bFreeze ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -410,7 +410,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze ) return; // get the position in the current array - USHORT nItemPos = GetColumnPos( nItemId ); + sal_uInt16 nItemPos = GetColumnPos( nItemId ); if ( nItemPos >= pCols->Count() ) // not available! return; @@ -420,7 +420,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze ) return; // remark the column selection - USHORT nSelectedColId = ToggleSelectedColumn(); + sal_uInt16 nSelectedColId = ToggleSelectedColumn(); // freeze or unfreeze? if ( bFreeze ) @@ -429,11 +429,11 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze ) if ( nItemPos != 0 && !pCols->GetObject(nItemPos-1)->IsFrozen() ) { // move to the right of the last frozen column - USHORT nFirstScrollable = FrozenColCount(); + sal_uInt16 nFirstScrollable = FrozenColCount(); BrowserColumn *pColumn = pCols->GetObject(nItemPos); - pCols->Remove( (ULONG) nItemPos ); + pCols->Remove( (sal_uLong) nItemPos ); nItemPos = nFirstScrollable; - pCols->Insert( pColumn, (ULONG) nItemPos ); + pCols->Insert( pColumn, (sal_uLong) nItemPos ); } // adjust the number of the first scrollable and visible column @@ -446,11 +446,11 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze ) if ( nItemPos != FrozenColCount()-1 ) { // move to the leftmost scrollable colum - USHORT nFirstScrollable = FrozenColCount(); + sal_uInt16 nFirstScrollable = FrozenColCount(); BrowserColumn *pColumn = pCols->GetObject(nItemPos); - pCols->Remove( (ULONG) nItemPos ); + pCols->Remove( (sal_uLong) nItemPos ); nItemPos = nFirstScrollable; - pCols->Insert( pColumn, (ULONG) nItemPos ); + pCols->Insert( pColumn, (sal_uLong) nItemPos ); } // adjust the number of the first scrollable and visible column @@ -473,7 +473,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze ) //------------------------------------------------------------------- -void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos ) +void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) { // never set pos of the handle-column if ( nColumnId == 0 ) @@ -484,7 +484,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos ) return; // get the position in the current array - USHORT nOldPos = GetColumnPos( nColumnId ); + sal_uInt16 nOldPos = GetColumnPos( nColumnId ); if ( nOldPos >= pCols->Count() ) // not available! return; @@ -493,7 +493,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos ) if (nOldPos != nPos) { // remark the column selection - USHORT nSelectedColId = ToggleSelectedColumn(); + sal_uInt16 nSelectedColId = ToggleSelectedColumn(); // determine old column area Size aDataWinSize( pDataWin->GetSizePixel() ); @@ -503,7 +503,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos ) Rectangle aFromRect( GetFieldRect( nColumnId) ); aFromRect.Right() += 2*MIN_COLUMNWIDTH; - USHORT nNextPos = nOldPos + 1; + sal_uInt16 nNextPos = nOldPos + 1; if ( nOldPos > nPos ) nNextPos = nOldPos - 1; @@ -546,7 +546,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos ) // adjust header bar positions if ( getDataWindow()->pHeaderBar ) { - USHORT nNewPos = nPos; + sal_uInt16 nNewPos = nPos; if ( !GetColumnId(0) ) --nNewPos; getDataWindow()->pHeaderBar->MoveItem(nColumnId,nNewPos); @@ -588,7 +588,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos ) //------------------------------------------------------------------- -void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags ) +void BrowseBox::SetColumnMode( sal_uInt16 nColumnId, BrowserColumnMode nFlags ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -597,7 +597,7 @@ void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags ) return; // get the position in the current array - USHORT nColumnPos = GetColumnPos( nColumnId ); + sal_uInt16 nColumnPos = GetColumnPos( nColumnId ); if ( nColumnPos >= pCols->Count() ) // not available! return; @@ -617,7 +617,7 @@ void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags ) //------------------------------------------------------------------- -void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle ) +void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const String& rTitle ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -626,7 +626,7 @@ void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle ) return; // get the position in the current array - USHORT nItemPos = GetColumnPos( nItemId ); + sal_uInt16 nItemPos = GetColumnPos( nItemId ); if ( nItemPos >= pCols->Count() ) // not available! return; @@ -664,12 +664,12 @@ void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle ) //------------------------------------------------------------------- -void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth ) +void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // get the position in the current array - USHORT nItemPos = GetColumnPos( nItemId ); + sal_uInt16 nItemPos = GetColumnPos( nItemId ); if ( nItemPos >= pCols->Count() ) return; @@ -686,7 +686,7 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth ) nMaxWidth -= getDataWindow()->bAutoSizeLastCol ? GetFieldRect(nItemId).Left() : GetFrozenWidth(); - if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (ULONG)nMaxWidth ) + if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth ) { nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth; nWidth = QueryColumnResize( nItemId, nWidth ); @@ -697,11 +697,11 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth ) // In AutoSizeLastColumn() wird SetColumnWidth mit nWidth==0xffff // gerufen. Deshalb muss hier nochmal geprueft werden, ob sich die // Breite tatsaechlich geaendert hat. - if( (ULONG)nOldWidth == nWidth ) + if( (sal_uLong)nOldWidth == nWidth ) return; // soll die Aenderung sofort dargestellt werden? - BOOL bUpdate = GetUpdateMode() && + sal_Bool bUpdate = GetUpdateMode() && ( pCols->GetObject(nItemPos)->IsFrozen() || nItemPos >= nFirstCol ); if ( bUpdate ) @@ -729,7 +729,7 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth ) { // X-Pos der veraenderten Spalte ermitteln long nX = 0; - for ( USHORT nCol = 0; nCol < nItemPos; ++nCol ) + for ( sal_uInt16 nCol = 0; nCol < nItemPos; ++nCol ) { BrowserColumn *pCol = pCols->GetObject(nCol); if ( pCol->IsFrozen() || nCol >= nFirstCol ) @@ -738,18 +738,18 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth ) // eigentliches scroll+invalidate pDataWin->SetClipRegion(); - BOOL bSelVis = bSelectionIsVisible; - bSelectionIsVisible = FALSE; + sal_Bool bSelVis = bSelectionIsVisible; + bSelectionIsVisible = sal_False; if( GetBackground().IsScrollable() ) { - Rectangle aScrRect( nX + std::min( (ULONG)nOldWidth, nWidth ), 0, + Rectangle aScrRect( nX + std::min( (sal_uLong)nOldWidth, nWidth ), 0, GetSizePixel().Width() , // the header is longer than the datawin pDataWin->GetPosPixel().Y() - 1 ); Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); aScrRect.Bottom() = pDataWin->GetSizePixel().Height(); getDataWindow()->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); - Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (ULONG)nOldWidth ), USHRT_MAX ); + Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (sal_uLong)nOldWidth ), USHRT_MAX ); Control::Invalidate( aInvRect, INVALIDATE_NOCHILDREN ); ( (BrowserDataWin*)pDataWin )->Invalidate( aInvRect ); } @@ -787,7 +787,7 @@ void BrowseBox::AutoSizeLastColumn() if ( getDataWindow()->bAutoSizeLastCol && getDataWindow()->GetUpdateMode() ) { - USHORT nId = GetColumnId( (USHORT)pCols->Count() - 1 ); + sal_uInt16 nId = GetColumnId( (sal_uInt16)pCols->Count() - 1 ); SetColumnWidth( nId, LONG_MAX ); ColumnResized( nId ); } @@ -795,12 +795,12 @@ void BrowseBox::AutoSizeLastColumn() //------------------------------------------------------------------- -void BrowseBox::RemoveColumn( USHORT nItemId ) +void BrowseBox::RemoveColumn( sal_uInt16 nItemId ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // Spaltenposition ermitteln - USHORT nPos = GetColumnPos(nItemId); + sal_uInt16 nPos = GetColumnPos(nItemId); if ( nPos >= ColCount() ) // nicht vorhanden return; @@ -814,7 +814,7 @@ void BrowseBox::RemoveColumn( USHORT nItemId ) nCurColId = 0; // Spalte entfernen - delete( pCols->Remove( (ULONG) nPos )); + delete( pCols->Remove( (sal_uLong) nPos )); // OJ #93534# if ( nFirstCol >= nPos && nFirstCol > FrozenColCount() ) { @@ -884,12 +884,12 @@ void BrowseBox::RemoveColumns() unsigned int nOldCount = pCols->Count(); // alle Spalten entfernen while ( pCols->Count() ) - delete ( pCols->Remove( (ULONG) 0 )); + delete ( pCols->Remove( (sal_uLong) 0 )); // Spaltenselektion korrigieren if ( pColSel ) { - pColSel->SelectAll(FALSE); + pColSel->SelectAll(sal_False); pColSel->SetTotalRange( Range( 0, 0 ) ); } @@ -947,11 +947,11 @@ void BrowseBox::RemoveColumns() //------------------------------------------------------------------- -String BrowseBox::GetColumnTitle( USHORT nId ) const +String BrowseBox::GetColumnTitle( sal_uInt16 nId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - USHORT nItemPos = GetColumnPos( nId ); + sal_uInt16 nItemPos = GetColumnPos( nId ); if ( nItemPos >= pCols->Count() ) return String(); return pCols->GetObject(nItemPos)->Title(); @@ -966,11 +966,11 @@ long BrowseBox::GetRowCount() const //------------------------------------------------------------------- -USHORT BrowseBox::ColCount() const +sal_uInt16 BrowseBox::ColCount() const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - return (USHORT) pCols->Count(); + return (sal_uInt16) pCols->Count(); } //------------------------------------------------------------------- @@ -999,7 +999,7 @@ void BrowseBox::SetDataRowHeight( long nPixel ) //------------------------------------------------------------------- -void BrowseBox::SetTitleLines( USHORT nLines ) +void BrowseBox::SetTitleLines( sal_uInt16 nLines ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1019,9 +1019,9 @@ long BrowseBox::ScrollColumns( long nCols ) // implicitly hides cursor while scrolling StartScroll(); - bScrolling = TRUE; - BOOL bScrollable = pDataWin->GetBackground().IsScrollable(); - BOOL bInvalidateView = FALSE; + bScrolling = sal_True; + sal_Bool bScrollable = pDataWin->GetBackground().IsScrollable(); + sal_Bool bInvalidateView = sal_False; // scrolling one column to the right? if ( nCols == 1 ) @@ -1032,7 +1032,7 @@ long BrowseBox::ScrollColumns( long nCols ) if ( !bScrollable ) { - bInvalidateView = TRUE; + bInvalidateView = sal_True; } else { @@ -1078,7 +1078,7 @@ long BrowseBox::ScrollColumns( long nCols ) if ( !bScrollable ) { - bInvalidateView = TRUE; + bInvalidateView = sal_True; } else { @@ -1113,7 +1113,7 @@ long BrowseBox::ScrollColumns( long nCols ) pDataWin->GetSizePixel() ) ); } - nFirstCol = nFirstCol + (USHORT)nCols; + nFirstCol = nFirstCol + (sal_uInt16)nCols; aHScroll.SetThumbPos( nFirstCol - FrozenColCount() ); } @@ -1121,7 +1121,7 @@ long BrowseBox::ScrollColumns( long nCols ) if ( getDataWindow()->pHeaderBar ) { long nWidth = 0; - for ( USHORT nCol = 0; + for ( sal_uInt16 nCol = 0; nCol < pCols->Count() && nCol < nFirstCol; ++nCol ) { @@ -1145,7 +1145,7 @@ long BrowseBox::ScrollColumns( long nCols ) getDataWindow()->Update(); Update(); } - bScrolling = FALSE; + bScrolling = sal_False; EndScroll(); return nCols; @@ -1169,8 +1169,8 @@ long BrowseBox::ScrollRows( long nRows ) if ( nNewTopRow == nTopRow ) return 0; - USHORT nVisibleRows = - (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); + sal_uInt16 nVisibleRows = + (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); VisibleRowsChanged(nNewTopRow, nVisibleRows); @@ -1220,7 +1220,7 @@ long BrowseBox::ScrollPages( long ) //------------------------------------------------------------------- -void BrowseBox::RowModified( long nRow, USHORT nColId ) +void BrowseBox::RowModified( long nRow, sal_uInt16 nColId ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1235,7 +1235,7 @@ void BrowseBox::RowModified( long nRow, USHORT nColId ) else { // invalidate the specific field - aRect = GetFieldRectPixel( nRow, nColId, FALSE ); + aRect = GetFieldRectPixel( nRow, nColId, sal_False ); } getDataWindow()->Invalidate( aRect ); } @@ -1301,7 +1301,7 @@ void BrowseBox::Clear() } } // ----------------------------------------------------------------------------- -void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeepSelection ) +void BrowseBox::RowInserted( long nRow, long nNumRows, sal_Bool bDoPaint, sal_Bool bKeepSelection ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1324,7 +1324,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep #endif // adjust total row count - BOOL bLastRow = nRow >= nRowCount; + sal_Bool bLastRow = nRow >= nRowCount; nRowCount += nNumRows; DoHideCursor( "RowInserted" ); @@ -1368,9 +1368,9 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep // adjust the cursor if ( nCurRow == BROWSER_ENDOFSELECTION ) - GoToRow( 0, FALSE, bKeepSelection ); + GoToRow( 0, sal_False, bKeepSelection ); else if ( nRow <= nCurRow ) - GoToRow( nCurRow += nNumRows, FALSE, bKeepSelection ); + GoToRow( nCurRow += nNumRows, sal_False, bKeepSelection ); // adjust the vertical scrollbar if ( bDoPaint ) @@ -1417,7 +1417,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep //------------------------------------------------------------------- -void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint ) +void BrowseBox::RowRemoved( long nRow, long nNumRows, sal_Bool bDoPaint ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1590,20 +1590,20 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint ) //------------------------------------------------------------------- -BOOL BrowseBox::GoToRow( long nRow) +sal_Bool BrowseBox::GoToRow( long nRow) { - return GoToRow(nRow, FALSE, FALSE); + return GoToRow(nRow, sal_False, sal_False); } //------------------------------------------------------------------- -BOOL BrowseBox::GoToRowAndDoNotModifySelection( long nRow ) +sal_Bool BrowseBox::GoToRowAndDoNotModifySelection( long nRow ) { - return GoToRow( nRow, FALSE, TRUE ); + return GoToRow( nRow, sal_False, sal_True ); } //------------------------------------------------------------------- -BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection ) +sal_Bool BrowseBox::GoToRow( long nRow, sal_Bool bRowColMove, sal_Bool bKeepSelection ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1611,22 +1611,22 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection ) // nothing to do? if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) ) - return TRUE; + return sal_True; // out of range? if ( nRow < 0 || nRow >= nRowCount ) - return FALSE; + return sal_False; // nicht erlaubt? if ( ( !bRowColMove && !IsCursorMoveAllowed( nRow, nCurColId ) ) ) - return FALSE; + return sal_False; if ( getDataWindow()->bNoScrollBack && nRow < nTopRow ) nRow = nTopRow; // compute the last visible row Size aSz( pDataWin->GetSizePixel() ); - USHORT nVisibleRows = USHORT( aSz.Height() / GetDataRowHeight() - 1 ); + sal_uInt16 nVisibleRows = sal_uInt16( aSz.Height() / GetDataRowHeight() - 1 ); long nLastRow = nTopRow + nVisibleRows; // suspend Updates @@ -1638,11 +1638,11 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection ) DoHideCursor( "GoToRow" ); // must we scroll? - BOOL bWasVisible = bSelectionIsVisible; + sal_Bool bWasVisible = bSelectionIsVisible; if (! bMultiSelection) { if( !bKeepSelection ) - bSelectionIsVisible = FALSE; + bSelectionIsVisible = sal_False; } if ( nRow < nTopRow ) ScrollRows( nRow - nTopRow ); @@ -1684,46 +1684,46 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection ) if ( !bSelecting ) Select(); else - bSelect = TRUE; + bSelect = sal_True; } - return TRUE; + return sal_True; } //------------------------------------------------------------------- -BOOL BrowseBox::GoToColumnId( USHORT nColId) +sal_Bool BrowseBox::GoToColumnId( sal_uInt16 nColId) { - return GoToColumnId(nColId,TRUE,FALSE); + return GoToColumnId(nColId,sal_True,sal_False); } -BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove) +sal_Bool BrowseBox::GoToColumnId( sal_uInt16 nColId, sal_Bool bMakeVisible, sal_Bool bRowColMove) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); if (!bColumnCursor) - return FALSE; + return sal_False; // erlaubt? if (!bRowColMove && !IsCursorMoveAllowed( nCurRow, nColId ) ) - return FALSE; + return sal_False; - if ( nColId != nCurColId || (bMakeVisible && !IsFieldVisible(nCurRow, nColId, TRUE))) + if ( nColId != nCurColId || (bMakeVisible && !IsFieldVisible(nCurRow, nColId, sal_True))) { - USHORT nNewPos = GetColumnPos(nColId); + sal_uInt16 nNewPos = GetColumnPos(nColId); BrowserColumn* pColumn = pCols->GetObject( nNewPos ); DBG_ASSERT( pColumn, "no column object - invalid id?" ); if ( !pColumn ) - return FALSE; + return sal_False; DoHideCursor( "GoToColumnId" ); nCurColId = nColId; - USHORT nFirstPos = nFirstCol; - USHORT nWidth = (USHORT)pColumn->Width(); - USHORT nLastPos = GetColumnAtXPosPixel( - pDataWin->GetSizePixel().Width()-nWidth, FALSE ); - USHORT nFrozen = FrozenColCount(); + sal_uInt16 nFirstPos = nFirstCol; + sal_uInt16 nWidth = (sal_uInt16)pColumn->Width(); + sal_uInt16 nLastPos = GetColumnAtXPosPixel( + pDataWin->GetSizePixel().Width()-nWidth, sal_False ); + sal_uInt16 nFrozen = FrozenColCount(); if ( bMakeVisible && nLastPos && nNewPos >= nFrozen && ( nNewPos < nFirstPos || nNewPos > nLastPos ) ) { @@ -1736,35 +1736,35 @@ BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove DoShowCursor( "GoToColumnId" ); if (!bRowColMove) CursorMoved(); - return TRUE; + return sal_True; } - return TRUE; + return sal_True; } //------------------------------------------------------------------- -BOOL BrowseBox::GoToRowColumnId( long nRow, USHORT nColId ) +sal_Bool BrowseBox::GoToRowColumnId( long nRow, sal_uInt16 nColId ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // out of range? if ( nRow < 0 || nRow >= nRowCount ) - return FALSE; + return sal_False; if (!bColumnCursor) - return FALSE; + return sal_False; // nothing to do ? if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) && - nColId == nCurColId && IsFieldVisible(nCurRow, nColId, TRUE)) - return TRUE; + nColId == nCurColId && IsFieldVisible(nCurRow, nColId, sal_True)) + return sal_True; // erlaubt? if (!IsCursorMoveAllowed(nRow, nColId)) - return FALSE; + return sal_False; DoHideCursor( "GoToRowColumnId" ); - BOOL bMoved = GoToRow(nRow, TRUE) && GoToColumnId(nColId, TRUE, TRUE); + sal_Bool bMoved = GoToRow(nRow, sal_True) && GoToColumnId(nColId, sal_True, sal_True); DoShowCursor( "GoToRowColumnId" ); if (bMoved) @@ -1791,15 +1791,15 @@ void BrowseBox::SetNoSelection() // unselect all if ( bMultiSelection ) - uRow.pSel->SelectAll(FALSE); + uRow.pSel->SelectAll(sal_False); else uRow.nSel = BROWSER_ENDOFSELECTION; if ( pColSel ) - pColSel->SelectAll(FALSE); + pColSel->SelectAll(sal_False); if ( !bSelecting ) Select(); else - bSelect = TRUE; + bSelect = sal_True; // restore screen DBG_TRACE1( "BrowseBox: %p->ShowCursor", this ); @@ -1835,7 +1835,7 @@ void BrowseBox::SetSelection( const MultiSelection &rSel ) if ( !bSelecting ) Select(); else - bSelect = TRUE; + bSelect = sal_True; // restore screen ToggleSelection(); @@ -1865,8 +1865,8 @@ void BrowseBox::SelectAll() // select all rows if ( pColSel ) - pColSel->SelectAll(FALSE); - uRow.pSel->SelectAll(TRUE); + pColSel->SelectAll(sal_False); + uRow.pSel->SelectAll(sal_True); // Handle-Column nicht highlighten BrowserColumn *pFirstCol = pCols->GetObject(0); @@ -1876,8 +1876,8 @@ void BrowseBox::SelectAll() if ( !bHideSelect ) { Rectangle aHighlightRect; - USHORT nVisibleRows = - (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); + sal_uInt16 nVisibleRows = + (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); for ( long nRow = Max( nTopRow, uRow.pSel->FirstSelected() ); nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows; nRow = uRow.pSel->NextSelected() ) @@ -1890,7 +1890,7 @@ void BrowseBox::SelectAll() if ( !bSelecting ) Select(); else - bSelect = TRUE; + bSelect = sal_True; // restore screen DBG_TRACE1( "BrowseBox: %p->ShowCursor", this ); @@ -1920,7 +1920,7 @@ void BrowseBox::SelectAll() //------------------------------------------------------------------- -void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand ) +void BrowseBox::SelectRow( long nRow, sal_Bool _bSelect, sal_Bool bExpand ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1928,7 +1928,7 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand ) { // deselecting is impossible, selecting via cursor if ( _bSelect ) - GoToRow(nRow, FALSE); + GoToRow(nRow, sal_False); return; } @@ -1939,11 +1939,11 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand ) { ToggleSelection(); if ( bMultiSelection ) - uRow.pSel->SelectAll(FALSE); + uRow.pSel->SelectAll(sal_False); else uRow.nSel = BROWSER_ENDOFSELECTION; if ( pColSel ) - pColSel->SelectAll(FALSE); + pColSel->SelectAll(sal_False); } // set new selection @@ -1971,7 +1971,7 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand ) if ( !bSelecting ) Select(); else - bSelect = TRUE; + bSelect = sal_True; // restore screen DBG_TRACE1( "BrowseBox: %p->ShowCursor", this ); @@ -2004,7 +2004,7 @@ long BrowseBox::GetSelectRowCount() const //------------------------------------------------------------------- -void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVisible ) +void BrowseBox::SelectColumnPos( sal_uInt16 nNewColPos, sal_Bool _bSelect, sal_Bool bMakeVisible ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2026,10 +2026,10 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis DBG_TRACE1( "BrowseBox: %p->HideCursor", this ); ToggleSelection(); if ( bMultiSelection ) - uRow.pSel->SelectAll(FALSE); + uRow.pSel->SelectAll(sal_False); else uRow.nSel = BROWSER_ENDOFSELECTION; - pColSel->SelectAll(FALSE); + pColSel->SelectAll(sal_False); if ( pColSel->Select( nNewColPos, _bSelect ) ) { @@ -2037,7 +2037,7 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis // only highlight painted areas pDataWin->Update(); - Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, FALSE ) ); + Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, sal_False ) ); Rectangle aRect( Point( aFieldRectPix.Left() - MIN_COLUMNWIDTH, 0 ), Size( pCols->GetObject(nNewColPos)->Width(), @@ -2046,7 +2046,7 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis if ( !bSelecting ) Select(); else - bSelect = TRUE; + bSelect = sal_True; if ( isAccessibleAlive() ) { @@ -2070,12 +2070,12 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis //------------------------------------------------------------------- -USHORT BrowseBox::GetSelectColumnCount() const +sal_uInt16 BrowseBox::GetSelectColumnCount() const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // while bAutoSelect (==!pColSel), 1 if any rows (yes rows!) else none - return pColSel ? (USHORT) pColSel->GetSelectCount() : + return pColSel ? (sal_uInt16) pColSel->GetSelectCount() : nCurRow >= 0 ? 1 : 0; } @@ -2093,7 +2093,7 @@ long BrowseBox::NextSelectedColumn( ) const //------------------------------------------------------------------- -long BrowseBox::FirstSelectedRow( BOOL bInverse ) +long BrowseBox::FirstSelectedRow( sal_Bool bInverse ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2138,7 +2138,7 @@ bool BrowseBox::IsRowSelected( long nRow ) const //------------------------------------------------------------------- -bool BrowseBox::IsColumnSelected( USHORT nColumnId ) const +bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2157,11 +2157,11 @@ sal_Bool BrowseBox::IsAllSelected() const //------------------------------------------------------------------- -BOOL BrowseBox::MakeFieldVisible +sal_Bool BrowseBox::MakeFieldVisible ( long nRow, // Zeilen-Nr des Feldes (beginnend mit 0) - USHORT nColId, // Spalten-Id des Feldes - BOOL bComplete // (== FALSE), TRUE => vollst"andig sichtbar machen + sal_uInt16 nColId, // Spalten-Id des Feldes + sal_Bool bComplete // (== sal_False), sal_True => vollst"andig sichtbar machen ) /* [Beschreibung] @@ -2172,11 +2172,11 @@ BOOL BrowseBox::MakeFieldVisible [R"uckgabewert] - BOOL TRUE + sal_Bool sal_True Das angegebene Feld wurde sichtbar gemacht, bzw. war bereits sichtbar. - FALSE + sal_False Das angegebene Feld konnte nicht sichtbar bzw. bei 'bComplete' nicht vollst"andig sichtbar gemacht werden. */ @@ -2186,16 +2186,16 @@ BOOL BrowseBox::MakeFieldVisible if ( !bBootstrapped || ( aTestSize.Width() == 0 && aTestSize.Height() == 0 ) ) - return FALSE; + return sal_False; // ist es schon sichtbar? - BOOL bVisible = IsFieldVisible( nRow, nColId, bComplete ); + sal_Bool bVisible = IsFieldVisible( nRow, nColId, bComplete ); if ( bVisible ) - return TRUE; + return sal_True; // Spaltenposition und Feld-Rechteck und Ausgabebereich berechnen - USHORT nColPos = GetColumnPos( nColId ); - Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE ); + sal_uInt16 nColPos = GetColumnPos( nColId ); + Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, sal_False ); Rectangle aDataRect = Rectangle( Point(0, 0), pDataWin->GetSizePixel() ); // links au\serhalb? @@ -2212,7 +2212,7 @@ BOOL BrowseBox::MakeFieldVisible if ( ScrollColumns( 1 ) != 1 ) // nichts mehr zu scrollen break; - aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE ); + aFieldRect = GetFieldRectPixel( nRow, nColId, sal_False ); } // oben au\serhalb? @@ -2238,19 +2238,19 @@ BOOL BrowseBox::MakeFieldVisible //------------------------------------------------------------------- -BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId, - BOOL bCompletely ) const +sal_Bool BrowseBox::IsFieldVisible( long nRow, sal_uInt16 nColumnId, + sal_Bool bCompletely ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // durch frozen-Column verdeckt? - USHORT nColPos = GetColumnPos( nColumnId ); + sal_uInt16 nColPos = GetColumnPos( nColumnId ); if ( nColPos >= FrozenColCount() && nColPos < nFirstCol ) - return FALSE; + return sal_False; Rectangle aRect( ImplFieldRectPixel( nRow, nColumnId ) ); if ( aRect.IsEmpty() ) - return FALSE; + return sal_False; // get the visible area Rectangle aOutRect( Point(0, 0), pDataWin->GetOutputSizePixel() ); @@ -2265,8 +2265,8 @@ BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId, //------------------------------------------------------------------- -Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId, - BOOL bRelToBrowser) const +Rectangle BrowseBox::GetFieldRectPixel( long nRow, sal_uInt16 nColumnId, + sal_Bool bRelToBrowser) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2288,7 +2288,7 @@ Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId, //------------------------------------------------------------------- -Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const +Rectangle BrowseBox::GetRowRectPixel( long nRow, sal_Bool bRelToBrowser ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2317,14 +2317,14 @@ Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const //------------------------------------------------------------------- -Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const +Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // compute the X-coordinte realtiv to DataWin by accumulation long nColX = 0; - USHORT nFrozenCols = FrozenColCount(); - USHORT nCol; + sal_uInt16 nFrozenCols = FrozenColCount(); + sal_uInt16 nCol; for ( nCol = 0; nCol < pCols->Count() && pCols->GetObject(nCol)->GetId() != nColumnId; ++nCol ) @@ -2348,7 +2348,7 @@ Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const //------------------------------------------------------------------- -long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const +long BrowseBox::GetRowAtYPosPixel( long nY, sal_Bool bRelToBrowser ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2369,7 +2369,7 @@ long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const //------------------------------------------------------------------- -Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const +Rectangle BrowseBox::GetFieldRect( sal_uInt16 nColumnId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2378,14 +2378,14 @@ Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const //------------------------------------------------------------------- -USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const +sal_uInt16 BrowseBox::GetColumnAtXPosPixel( long nX, sal_Bool ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // accumulate the withds of the visible columns long nColX = 0; - USHORT nCol; - for ( nCol = 0; nCol < USHORT(pCols->Count()); ++nCol ) + sal_uInt16 nCol; + for ( nCol = 0; nCol < sal_uInt16(pCols->Count()); ++nCol ) { BrowserColumn *pCol = pCols->GetObject(nCol); if ( pCol->IsFrozen() || nCol >= nFirstCol ) @@ -2400,7 +2400,7 @@ USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const //------------------------------------------------------------------- -void BrowseBox::ReserveControlArea( USHORT nWidth ) +void BrowseBox::ReserveControlArea( sal_uInt16 nWidth ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2461,9 +2461,9 @@ void BrowseBox::SetMode( BrowserMode nMode ) DBG_ASSERT( !( getDataWindow()->bAutoVScroll && getDataWindow()->bNoVScroll ), "BrowseBox::SetMode: AutoVScroll *and* NoVScroll?" ); if ( getDataWindow()->bAutoHScroll ) - getDataWindow()->bNoHScroll = FALSE; + getDataWindow()->bNoHScroll = sal_False; if ( getDataWindow()->bAutoVScroll ) - getDataWindow()->bNoVScroll = FALSE; + getDataWindow()->bNoVScroll = sal_False; if ( getDataWindow()->bNoHScroll ) aHScroll.Hide(); @@ -2577,40 +2577,40 @@ void BrowseBox::SetMode( BrowserMode nMode ) //------------------------------------------------------------------- -void BrowseBox::VisibleRowsChanged( long, USHORT ) +void BrowseBox::VisibleRowsChanged( long, sal_uInt16 ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); // Das alte Verhalten: NumRows automatisch korrigieren: if ( nRowCount < GetRowCount() ) { - RowInserted(nRowCount,GetRowCount() - nRowCount,FALSE); + RowInserted(nRowCount,GetRowCount() - nRowCount,sal_False); } else if ( nRowCount > GetRowCount() ) { - RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),FALSE); + RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),sal_False); } } //------------------------------------------------------------------- -BOOL BrowseBox::IsCursorMoveAllowed( long, USHORT ) const +sal_Bool BrowseBox::IsCursorMoveAllowed( long, sal_uInt16 ) const /* [Beschreibung] Diese virtuelle Methode wird immer gerufen bevor der Cursor direkt - bewegt werden soll. Durch 'return FALSE' kann verhindert werden, da\s + bewegt werden soll. Durch 'return sal_False' kann verhindert werden, da\s dies geschieht, wenn z.B. ein Datensatz irgendwelchen Rules widerspricht. Diese Methode wird nicht gerufen, wenn die Cursorbewegung durch ein L"oschen oder Einf"ugen (einer Zeile/Spalte) ausgel"ost wird, also genaugenommen nur eine Cursor-Korrektur vorliegt. - Die Basisimplementierung liefert derzeit immer TRUE. + Die Basisimplementierung liefert derzeit immer sal_True. */ { - return TRUE; + return sal_True; } //------------------------------------------------------------------- @@ -2728,10 +2728,10 @@ void BrowseBox::LoseFocus() if ( !bKeepHighlight ) { ToggleSelection(); - bSelectionIsVisible = FALSE; + bSelectionIsVisible = sal_False; } - bHasFocus = FALSE; + bHasFocus = sal_False; } Control::LoseFocus(); } @@ -2747,12 +2747,12 @@ void BrowseBox::GetFocus() { if ( !bSelectionIsVisible ) { - bSelectionIsVisible = TRUE; + bSelectionIsVisible = sal_True; if ( bBootstrapped ) ToggleSelection(); } - bHasFocus = TRUE; + bHasFocus = sal_True; DoShowCursor( "GetFocus" ); } Control::GetFocus(); diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 53c2a5ac86f6..c37fb6915725 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -177,7 +177,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange ) } else if ( STATE_CHANGE_INITSHOW == nStateChange ) { - bBootstrapped = TRUE; // muss zuerst gesetzt werden! + bBootstrapped = sal_True; // muss zuerst gesetzt werden! Resize(); if ( bMultiSelection ) @@ -190,8 +190,8 @@ void BrowseBox::StateChanged( StateChangedType nStateChange ) if ( HasFocus() ) { - bSelectionIsVisible = TRUE; - bHasFocus = TRUE; + bSelectionIsVisible = sal_True; + bHasFocus = sal_True; } UpdateScrollbars(); AutoSizeLastColumn(); @@ -205,7 +205,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange ) pHeaderBar->SetZoom(GetZoom()); // let the cols calc their new widths and adjust the header bar - for ( USHORT nPos = 0; nPos < pCols->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pCols->Count(); ++nPos ) { pCols->GetObject(nPos)->ZoomChanged(GetZoom()); if ( pHeaderBar ) @@ -285,7 +285,7 @@ void BrowseBox::RowHeightChanged() //------------------------------------------------------------------- -long BrowseBox::QueryColumnResize( USHORT, long nWidth ) +long BrowseBox::QueryColumnResize( sal_uInt16, long nWidth ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); return nWidth; @@ -293,14 +293,14 @@ long BrowseBox::QueryColumnResize( USHORT, long nWidth ) //------------------------------------------------------------------- -void BrowseBox::ColumnResized( USHORT ) +void BrowseBox::ColumnResized( sal_uInt16 ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); } //------------------------------------------------------------------- -void BrowseBox::ColumnMoved( USHORT ) +void BrowseBox::ColumnMoved( sal_uInt16 ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); } @@ -330,7 +330,7 @@ void BrowseBox::EndScroll() #pragma optimize( "", off ) #endif -void BrowseBox::ToggleSelection( BOOL bForce ) +void BrowseBox::ToggleSelection( sal_Bool bForce ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -342,8 +342,8 @@ void BrowseBox::ToggleSelection( BOOL bForce ) return; // only highlight painted areas! - bNotToggleSel = TRUE; - if ( FALSE && !getDataWindow()->bInPaint ) + bNotToggleSel = sal_True; + if ( sal_False && !getDataWindow()->bInPaint ) pDataWin->Update(); // accumulate areas of rows to highlight @@ -372,7 +372,7 @@ void BrowseBox::ToggleSelection( BOOL bForce ) if ( aHighlightList.Count() && nLastRowInRect == ( nRow - 1 ) ) aHighlightList.First()->Union( aAddRect ); else - aHighlightList.Insert( new Rectangle( aAddRect ), (ULONG) 0 ); + aHighlightList.Insert( new Rectangle( aAddRect ), (sal_uLong) 0 ); nLastRowInRect = nRow; } @@ -391,7 +391,7 @@ void BrowseBox::ToggleSelection( BOOL bForce ) { Rectangle aRect( GetFieldRectPixel(nCurRow, pCols->GetObject(nColId)->GetId(), - FALSE ) ); + sal_False ) ); aRect.Left() -= MIN_COLUMNWIDTH; aRect.Right() += MIN_COLUMNWIDTH; aRect.Top() = 0; @@ -399,7 +399,7 @@ void BrowseBox::ToggleSelection( BOOL bForce ) pDataWin->Invalidate( aRect ); } - bNotToggleSel = FALSE; + bNotToggleSel = sal_False; } #ifdef _MSC_VER @@ -410,15 +410,15 @@ void BrowseBox::ToggleSelection( BOOL bForce ) void BrowseBox::DrawCursor() { - BOOL bReallyHide = FALSE; + sal_Bool bReallyHide = sal_False; if ( SMART_CURSOR_HIDE == bHideCursor ) { if ( !GetSelectRowCount() && !GetSelectColumnCount() ) - bReallyHide = TRUE; + bReallyHide = sal_True; } else if ( HARD_CURSOR_HIDE == bHideCursor ) { - bReallyHide = TRUE; + bReallyHide = sal_True; } bReallyHide |= !bSelectionIsVisible || !IsUpdateMode() || bScrolling || nCurRow < 0; @@ -436,7 +436,7 @@ void BrowseBox::DrawCursor() Rectangle aCursor; if ( bColumnCursor ) { - aCursor = GetFieldRectPixel( nCurRow, nCurColId, FALSE ); + aCursor = GetFieldRectPixel( nCurRow, nCurColId, sal_False ); //! --aCursor.Bottom(); aCursor.Left() -= MIN_COLUMNWIDTH; aCursor.Right() += 1; @@ -481,11 +481,11 @@ void BrowseBox::DrawCursor() //------------------------------------------------------------------- -ULONG BrowseBox::GetColumnWidth( USHORT nId ) const +sal_uLong BrowseBox::GetColumnWidth( sal_uInt16 nId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - USHORT nItemPos = GetColumnPos( nId ); + sal_uInt16 nItemPos = GetColumnPos( nId ); if ( nItemPos >= pCols->Count() ) return 0; return pCols->GetObject(nItemPos)->Width(); @@ -493,7 +493,7 @@ ULONG BrowseBox::GetColumnWidth( USHORT nId ) const //------------------------------------------------------------------- -USHORT BrowseBox::GetColumnId( USHORT nPos ) const +sal_uInt16 BrowseBox::GetColumnId( sal_uInt16 nPos ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -504,11 +504,11 @@ USHORT BrowseBox::GetColumnId( USHORT nPos ) const //------------------------------------------------------------------- -USHORT BrowseBox::GetColumnPos( USHORT nId ) const +sal_uInt16 BrowseBox::GetColumnPos( sal_uInt16 nId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - for ( USHORT nPos = 0; nPos < pCols->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pCols->Count(); ++nPos ) if ( pCols->GetObject(nPos)->GetId() == nId ) return nPos; return BROWSER_INVALIDID; @@ -516,14 +516,14 @@ USHORT BrowseBox::GetColumnPos( USHORT nId ) const //------------------------------------------------------------------- -BOOL BrowseBox::IsFrozen( USHORT nColumnId ) const +sal_Bool BrowseBox::IsFrozen( sal_uInt16 nColumnId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - for ( USHORT nPos = 0; nPos < pCols->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pCols->Count(); ++nPos ) if ( pCols->GetObject(nPos)->GetId() == nColumnId ) return pCols->GetObject(nPos)->IsFrozen(); - return FALSE; + return sal_False; } //------------------------------------------------------------------- @@ -540,34 +540,34 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt ) Range aJustifiedRange( aSelRange ); aJustifiedRange.Justify(); - BOOL bSelectThis = ( bSelect != aJustifiedRange.IsInside( rEvt.GetRow() ) ); + sal_Bool bSelectThis = ( bSelect != aJustifiedRange.IsInside( rEvt.GetRow() ) ); if ( aJustifiedRange.IsInside( rEvt.GetRow() ) ) { // down and up while ( rEvt.GetRow() < aSelRange.Max() ) { // ZTC/Mac bug - dont put these statemants together! - SelectRow( aSelRange.Max(), bSelectThis, TRUE ); + SelectRow( aSelRange.Max(), bSelectThis, sal_True ); --aSelRange.Max(); } while ( rEvt.GetRow() > aSelRange.Max() ) { // ZTC/Mac bug - dont put these statemants together! - SelectRow( aSelRange.Max(), bSelectThis, TRUE ); + SelectRow( aSelRange.Max(), bSelectThis, sal_True ); ++aSelRange.Max(); } } else { // up and down - BOOL bOldSelecting = bSelecting; - bSelecting = TRUE; + sal_Bool bOldSelecting = bSelecting; + bSelecting = sal_True; while ( rEvt.GetRow() < aSelRange.Max() ) { // ZTC/Mac bug - dont put these statemants together! --aSelRange.Max(); if ( !IsRowSelected( aSelRange.Max() ) ) { - SelectRow( aSelRange.Max(), bSelectThis, TRUE ); - bSelect = TRUE; + SelectRow( aSelRange.Max(), bSelectThis, sal_True ); + bSelect = sal_True; } } while ( rEvt.GetRow() > aSelRange.Max() ) @@ -575,8 +575,8 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt ) ++aSelRange.Max(); if ( !IsRowSelected( aSelRange.Max() ) ) { - SelectRow( aSelRange.Max(), bSelectThis, TRUE ); - bSelect = TRUE; + SelectRow( aSelRange.Max(), bSelectThis, sal_True ); + bSelect = sal_True; } } bSelecting = bOldSelecting; @@ -586,9 +586,9 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt ) } else if ( !bMultiSelection || !IsRowSelected( rEvt.GetRow() ) ) - SelectRow( rEvt.GetRow(), TRUE ); + SelectRow( rEvt.GetRow(), sal_True ); - GoToRow( rEvt.GetRow(), FALSE ); + GoToRow( rEvt.GetRow(), sal_False ); DoShowCursor( "ExpandRowSelection" ); } @@ -601,21 +601,21 @@ void BrowseBox::Resize() BrowseBox::StateChanged( STATE_CHANGE_INITSHOW ); if ( !pCols->Count() ) { - getDataWindow()->bResizeOnPaint = TRUE; + getDataWindow()->bResizeOnPaint = sal_True; return; } - getDataWindow()->bResizeOnPaint = FALSE; + getDataWindow()->bResizeOnPaint = sal_False; // calc the size of the scrollbars // (we can't ask the scrollbars for their widths cause if we're zoomed they still have to be // resized - which is done in UpdateScrollbars) - ULONG nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize(); + sal_uLong nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize(); if (IsZoom()) - nSBSize = (ULONG)(nSBSize * (double)GetZoom()); + nSBSize = (sal_uLong)(nSBSize * (double)GetZoom()); DoHideCursor( "Resize" ); - USHORT nOldVisibleRows = - (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); + sal_uInt16 nOldVisibleRows = + (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); // did we need a horiz. scroll bar oder gibt es eine Control Area? if ( !getDataWindow()->bNoHScroll && @@ -638,8 +638,8 @@ void BrowseBox::Resize() Point( 0, GetTitleHeight() ), Size( nDataWidth, nDataHeight ) ); - USHORT nVisibleRows = - (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); + sal_uInt16 nVisibleRows = + (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); // TopRow ist unveraendert, aber die Anzahl sichtbarer Zeilen hat sich // geaendert @@ -681,8 +681,8 @@ void BrowseBox::Paint( const Rectangle& rRect ) return; BrowserColumn *pFirstCol = pCols->GetObject(0); - BOOL bHandleCol = pFirstCol && pFirstCol->GetId() == 0; - BOOL bHeaderBar = getDataWindow()->pHeaderBar != NULL; + sal_Bool bHandleCol = pFirstCol && pFirstCol->GetId() == 0; + sal_Bool bHeaderBar = getDataWindow()->pHeaderBar != NULL; // draw delimitational lines if ( !getDataWindow()->bNoHScroll ) @@ -709,7 +709,7 @@ void BrowseBox::Paint( const Rectangle& rRect ) { // iterate through columns to redraw long nX = 0; - USHORT nCol; + sal_uInt16 nCol; for ( nCol = 0; nCol < pCols->Count() && nX < rRect.Right(); ++nCol ) @@ -729,7 +729,7 @@ void BrowseBox::Paint( const Rectangle& rRect ) { ButtonFrame aButtonFrame( Point( nX, 0 ), Size( pCol->Width()-1, GetTitleHeight()-1 ), - pCol->Title(), FALSE, FALSE, + pCol->Title(), sal_False, sal_False, 0 != (BROWSER_COLUMN_TITLEABBREVATION&pCol->Flags()), !IsEnabled()); aButtonFrame.Draw( *this ); @@ -774,9 +774,9 @@ void BrowseBox::PaintRow( OutputDevice&, const Rectangle& ) //------------------------------------------------------------------- -void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags ) +void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) { - BOOL bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0; + sal_Bool bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0; // we need pixel coordinates Size aRealSize = pDev->LogicToPixel(rSize); @@ -820,7 +820,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, nDataRowHeight = nForeignHeightPixel; // this counts for the column widths, too - USHORT nPos; + sal_uInt16 nPos; for ( nPos = 0; nPos < pCols->Count(); ++nPos ) { BrowserColumn* pCurrent = pCols->GetObject(nPos); @@ -865,7 +865,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, { ButtonFrame aButtonFrame( aRealPos, Size( pFirstCol->Width()-1, nTitleHeight-1 ), - pFirstCol->Title(), FALSE, FALSE, FALSE, !IsEnabled()); + pFirstCol->Title(), sal_False, sal_False, sal_False, !IsEnabled()); aButtonFrame.Draw( *pDev ); pDev->Push( PUSH_LINECOLOR ); @@ -888,7 +888,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->SetClipRegion( pDev->PixelToLogic( aRegion ) ); // do we have to paint the background - BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground(); + sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground(); if ( bBackground ) { Rectangle aRect( aRealPos, aRealSize ); @@ -896,7 +896,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->DrawRect( aRect ); } - ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), TRUE, bDrawSelection ); + ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), sal_True, bDrawSelection ); // restore the column widths/data row height nDataRowHeight = nOriginalHeight; @@ -917,7 +917,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, //------------------------------------------------------------------- -void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _bForeignDevice, BOOL _bDrawSelections) +void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_Bool _bForeignDevice, sal_Bool _bDrawSelections) { Point aOverallAreaPos = _bForeignDevice ? _rRect.TopLeft() : Point(0,0); Size aOverallAreaSize = _bForeignDevice ? _rRect.GetSize() : GetDataWindow().GetOutputSizePixel(); @@ -926,8 +926,8 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL long nDataRowHeigt = GetDataRowHeight(); // compute relative rows to redraw - ULONG nRelTopRow = _bForeignDevice ? 0 : ((ULONG)_rRect.Top() / nDataRowHeigt); - ULONG nRelBottomRow = (ULONG)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt; + sal_uLong nRelTopRow = _bForeignDevice ? 0 : ((sal_uLong)_rRect.Top() / nDataRowHeigt); + sal_uLong nRelBottomRow = (sal_uLong)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt; // cache frequently used values Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() ); @@ -947,19 +947,19 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL Color aDelimiterLineColor( ::svtools::ColorConfig().GetColorValue( ::svtools::CALCGRID ).nColor ); // redraw the invalid fields - BOOL bRetouching = FALSE; - for ( ULONG nRelRow = nRelTopRow; - nRelRow <= nRelBottomRow && (ULONG)nTopRow+nRelRow < (ULONG)nRowCount; + sal_Bool bRetouching = sal_False; + for ( sal_uLong nRelRow = nRelTopRow; + nRelRow <= nRelBottomRow && (sal_uLong)nTopRow+nRelRow < (sal_uLong)nRowCount; ++nRelRow, aPos.Y() += nDataRowHeigt ) { // get row // Zur Sicherheit auf zul"assigen Bereich abfragen: - DBG_ASSERT( (USHORT)(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" ); - if ( (nTopRow+long(nRelRow)) < 0 || (USHORT)(nTopRow+nRelRow) >= nRowCount ) + DBG_ASSERT( (sal_uInt16)(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" ); + if ( (nTopRow+long(nRelRow)) < 0 || (sal_uInt16)(nTopRow+nRelRow) >= nRowCount ) continue; // prepare row - ULONG nRow = nTopRow+nRelRow; + sal_uLong nRow = nTopRow+nRelRow; if ( !SeekRow( nRow) ) { DBG_ERROR("BrowseBox::ImplPaintData: SeekRow gescheitert"); } @@ -973,7 +973,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL Size( _rRect.GetSize().Width(), nDataRowHeigt ) ); PaintRow( _rOut, aRowRect ); - BOOL bRowSelected = _bDrawSelections + sal_Bool bRowSelected = _bDrawSelections && !bHideSelect && IsRowSelected( nRow ); if ( bRowSelected ) @@ -985,7 +985,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL } // iterate through columns to redraw - USHORT nCol; + sal_uInt16 nCol; for ( nCol = 0; nCol < pCols->Count(); ++nCol ) { // get column @@ -1009,7 +1009,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL } // prepare Column-AutoHighlight - BOOL bColAutoHighlight = _bDrawSelections + sal_Bool bColAutoHighlight = _bDrawSelections && bColumnCursor && IsColumnSelected( pCol->GetId() ); if ( bColAutoHighlight ) @@ -1023,7 +1023,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _rOut.DrawRect( aFieldRect ); } - if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nRow == (ULONG)GetCurRow())) + if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nRow == (sal_uLong)GetCurRow())) DrawCursor(); // draw a single field @@ -1049,7 +1049,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL Region aClipToField(Rectangle(aPos, aFieldSize)); _rOut.SetClipRegion(aClipToField); } - pCol->Draw( *this, _rOut, aPos, FALSE ); + pCol->Draw( *this, _rOut, aPos, sal_False ); if (_bForeignDevice) _rOut.SetClipRegion(); } @@ -1067,7 +1067,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL } if ( nCol == pCols->Count() ) - bRetouching = TRUE; + bRetouching = sal_True; // reset auto-highlight if ( bRowSelected ) @@ -1129,7 +1129,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _rOut.SetLineColor( aDelimiterLineColor ); Point aVertPos( aOverallAreaPos.X() - 1, aOverallAreaPos.Y() ); long nDeltaY = aOverallAreaBRPos.Y(); - for ( USHORT nCol = 0; nCol < pCols->Count(); ++nCol ) + for ( sal_uInt16 nCol = 0; nCol < pCols->Count(); ++nCol ) { // get column BrowserColumn *pCol = pCols->GetObject(nCol); @@ -1177,7 +1177,7 @@ void BrowseBox::PaintData( Window& rWin, const Rectangle& rRect ) Resize(); // MI: wer war das denn? Window::Update(); - ImplPaintData(rWin, rRect, FALSE, TRUE); + ImplPaintData(rWin, rRect, sal_False, sal_True); } //------------------------------------------------------------------- @@ -1193,19 +1193,19 @@ void BrowseBox::UpdateScrollbars() BrowserDataWin *pBDW = (BrowserDataWin*) pDataWin; if ( pBDW->bInUpdateScrollbars ) { - pBDW->bHadRecursion = TRUE; + pBDW->bHadRecursion = sal_True; return; } - pBDW->bInUpdateScrollbars = TRUE; + pBDW->bInUpdateScrollbars = sal_True; // the size of the corner window (and the width of the VSB/height of the HSB) - ULONG nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize(); + sal_uLong nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize(); if (IsZoom()) - nCornerSize = (ULONG)(nCornerSize * (double)GetZoom()); + nCornerSize = (sal_uLong)(nCornerSize * (double)GetZoom()); // needs VScroll? long nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight(); - BOOL bNeedsVScroll = getDataWindow()->bAutoVScroll + sal_Bool bNeedsVScroll = getDataWindow()->bAutoVScroll ? nTopRow || ( nRowCount > nMaxRows ) : !getDataWindow()->bNoVScroll; Size aDataWinSize = pDataWin->GetSizePixel(); @@ -1227,10 +1227,10 @@ void BrowseBox::UpdateScrollbars() } // needs HScroll? - ULONG nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 ); + sal_uLong nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 ); - USHORT nFrozenCols = FrozenColCount(); - BOOL bNeedsHScroll = getDataWindow()->bAutoHScroll + sal_uInt16 nFrozenCols = FrozenColCount(); + sal_Bool bNeedsHScroll = getDataWindow()->bAutoHScroll ? ( nFirstCol > nFrozenCols ) || ( nLastCol <= pCols->Count() ) : !getDataWindow()->bNoHScroll; if ( !bNeedsHScroll ) @@ -1251,7 +1251,7 @@ void BrowseBox::UpdateScrollbars() } // adjust position and Width of horizontal scrollbar - ULONG nHScrX = nControlAreaWidth == USHRT_MAX + sal_uLong nHScrX = nControlAreaWidth == USHRT_MAX ? 0 : nControlAreaWidth; @@ -1310,7 +1310,7 @@ void BrowseBox::UpdateScrollbars() // needs corner-window? // (do that AFTER positioning BOTH scrollbars) - ULONG nActualCorderWidth = 0; + sal_uLong nActualCorderWidth = 0; if (aHScroll.IsVisible() && pVScroll && pVScroll->IsVisible() ) { // if we have both scrollbars, the corner window fills the point of intersection of these two @@ -1338,7 +1338,7 @@ void BrowseBox::UpdateScrollbars() if ( getDataWindow()->pHeaderBar ) { long nWidth = 0; - for ( USHORT nCol = 0; + for ( sal_uInt16 nCol = 0; nCol < pCols->Count() && nCol < nFirstCol; ++nCol ) { @@ -1350,21 +1350,21 @@ void BrowseBox::UpdateScrollbars() getDataWindow()->pHeaderBar->SetOffset( nWidth ); } - pBDW->bInUpdateScrollbars = FALSE; + pBDW->bInUpdateScrollbars = sal_False; if ( pBDW->bHadRecursion ) { - pBDW->bHadRecursion = FALSE; + pBDW->bHadRecursion = sal_False; UpdateScrollbars(); } } //------------------------------------------------------------------- -void BrowseBox::SetUpdateMode( BOOL bUpdate ) +void BrowseBox::SetUpdateMode( sal_Bool bUpdate ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - BOOL bWasUpdate = IsUpdateMode(); + sal_Bool bWasUpdate = IsUpdateMode(); if ( bWasUpdate == bUpdate ) return; @@ -1392,7 +1392,7 @@ void BrowseBox::SetUpdateMode( BOOL bUpdate ) //------------------------------------------------------------------- -BOOL BrowseBox::GetUpdateMode() const +sal_Bool BrowseBox::GetUpdateMode() const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1406,7 +1406,7 @@ long BrowseBox::GetFrozenWidth() const DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); long nWidth = 0; - for ( USHORT nCol = 0; + for ( sal_uInt16 nCol = 0; nCol < pCols->Count() && pCols->GetObject(nCol)->IsFrozen(); ++nCol ) nWidth += pCols->GetObject(nCol)->Width(); @@ -1415,7 +1415,7 @@ long BrowseBox::GetFrozenWidth() const //------------------------------------------------------------------- -void BrowseBox::ColumnInserted( USHORT nPos ) +void BrowseBox::ColumnInserted( sal_uInt16 nPos ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1426,10 +1426,10 @@ void BrowseBox::ColumnInserted( USHORT nPos ) //------------------------------------------------------------------- -USHORT BrowseBox::FrozenColCount() const +sal_uInt16 BrowseBox::FrozenColCount() const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - USHORT nCol; + sal_uInt16 nCol; for ( nCol = 0; nCol < pCols->Count() && pCols->GetObject(nCol)->IsFrozen(); ++nCol ) @@ -1506,7 +1506,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) long nX = 0; long nWidth = GetOutputSizePixel().Width(); - for ( USHORT nCol = 0; nCol < pCols->Count() && nX < nWidth; ++nCol ) + for ( sal_uInt16 nCol = 0; nCol < pCols->Count() && nX < nWidth; ++nCol ) { // is this column visible? BrowserColumn *pCol = pCols->GetObject(nCol); @@ -1519,7 +1519,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) if ( pCol->GetId() && Abs( nR - rEvtPos.X() ) < 2 ) { // start resizing the column - bResizing = TRUE; + bResizing = sal_True; nResizeCol = nCol; nDragX = nResizeX = rEvtPos.X(); SetPointer( Pointer( POINTER_HSPLIT ) ); @@ -1542,7 +1542,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) // event occured out of data area if ( rEvt.IsRight() ) pDataWin->Command( - CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, TRUE ) ); + CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, sal_True ) ); else SetNoSelection(); } @@ -1560,17 +1560,17 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) Pointer aNewPointer; - USHORT nX = 0; - for ( USHORT nCol = 0; - nCol < USHORT(pCols->Count()) && - ( nX + pCols->GetObject(nCol)->Width() ) < USHORT(GetOutputSizePixel().Width()); + sal_uInt16 nX = 0; + for ( sal_uInt16 nCol = 0; + nCol < sal_uInt16(pCols->Count()) && + ( nX + pCols->GetObject(nCol)->Width() ) < sal_uInt16(GetOutputSizePixel().Width()); ++nCol ) // is this column visible? if ( pCols->GetObject(nCol)->IsFrozen() || nCol >= nFirstCol ) { // compute right end of column BrowserColumn *pCol = pCols->GetObject(nCol); - USHORT nR = (USHORT)(nX + pCol->Width() - 1); + sal_uInt16 nR = (sal_uInt16)(nX + pCol->Width() - 1); // show resize-pointer? if ( bResizing || ( pCol->GetId() && @@ -1585,8 +1585,8 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) // erlaubte breite abholen und neues Delta nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX ); long nDeltaX = nDragX - nResizeX; - USHORT nId = GetColumnId(nResizeCol); - ULONG nOldWidth = GetColumnWidth(nId); + sal_uInt16 nId = GetColumnId(nResizeCol); + sal_uLong nOldWidth = GetColumnWidth(nId); nDragX = QueryColumnResize( GetColumnId(nResizeCol), nOldWidth + nDeltaX ) + nResizeX - nOldWidth; @@ -1624,7 +1624,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) long nMaxX = pDataWin->GetSizePixel().Width(); nDragX = Min( nDragX, nMaxX ); long nDeltaX = nDragX - nResizeX; - USHORT nId = GetColumnId(nResizeCol); + sal_uInt16 nId = GetColumnId(nResizeCol); SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX ); ColumnResized( nId ); } @@ -1632,7 +1632,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) // end action SetPointer( Pointer() ); ReleaseMouse(); - bResizing = FALSE; + bResizing = sal_False; } else MouseButtonUp( BrowserMouseEvent( (BrowserDataWin*)pDataWin, @@ -1644,8 +1644,8 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) //------------------------------------------------------------------- -BOOL bExtendedMode = FALSE; -BOOL bFieldMode = FALSE; +sal_Bool bExtendedMode = sal_False; +sal_Bool bFieldMode = sal_False; void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) { @@ -1660,14 +1660,14 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) if ( rEvt.GetRow() >= 0 ) { GoToRow( rEvt.GetRow() ); - SelectRow( rEvt.GetRow(), TRUE, FALSE ); + SelectRow( rEvt.GetRow(), sal_True, sal_False ); } else { if ( bColumnCursor && rEvt.GetColumn() != 0 ) { if ( rEvt.GetColumn() < pCols->Count() ) - SelectColumnPos( rEvt.GetColumn(), TRUE, FALSE); + SelectColumnPos( rEvt.GetColumn(), sal_True, sal_False); } } DoubleClick( rEvt ); @@ -1679,7 +1679,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) if ( rEvt.GetClicks() == 1 ) { // initialise flags - bHit = FALSE; + bHit = sal_False; a1stPoint = a2ndPoint = PixelToLogic( rEvt.GetPosPixel() ); @@ -1692,7 +1692,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) } // while selecting, no cursor - bSelecting = TRUE; + bSelecting = sal_True; DoHideCursor( "MouseButtonDown" ); // DataRow? @@ -1708,19 +1708,19 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) { ToggleSelection(); if ( bMultiSelection ) - uRow.pSel->SelectAll(FALSE); + uRow.pSel->SelectAll(sal_False); else uRow.nSel = BROWSER_ENDOFSELECTION; if ( pColSel ) - pColSel->SelectAll(FALSE); - bSelect = TRUE; + pColSel->SelectAll(sal_False); + bSelect = sal_True; } // expanding mode? if ( rEvt.GetMode() & MOUSE_RANGESELECT ) { // select the further touched rows too - bSelect = TRUE; + bSelect = sal_True; ExpandRowSelection( rEvt ); return; } @@ -1729,7 +1729,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) else if ( IsRowSelected( rEvt.GetRow() ) ) { // auf Drag&Drop warten - bHit = TRUE; + bHit = sal_True; bExtendedMode = MOUSE_MULTISELECT == ( rEvt.GetMode() & MOUSE_MULTISELECT ); return; @@ -1743,7 +1743,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() ); SelectRow( rEvt.GetRow(), !uRow.pSel->IsSelected( rEvt.GetRow() ) ); - bSelect = TRUE; + bSelect = sal_True; return; } } @@ -1751,9 +1751,9 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) // select directly SetNoSelection(); GoToRow( rEvt.GetRow() ); - SelectRow( rEvt.GetRow(), TRUE ); + SelectRow( rEvt.GetRow(), sal_True ); aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() ); - bSelect = TRUE; + bSelect = sal_True; } else // Column/Field-Selection { @@ -1761,14 +1761,14 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) if ( IsColumnSelected( rEvt.GetColumn() ) || IsRowSelected( rEvt.GetRow() ) ) { - bHit = TRUE; - bFieldMode = TRUE; + bHit = sal_True; + bFieldMode = sal_True; return; } SetNoSelection(); GoToRowColumnId( rEvt.GetRow(), rEvt.GetColumnId() ); - bSelect = TRUE; + bSelect = sal_True; } } else @@ -1782,11 +1782,11 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) SelectAll(); } else - SelectColumnId( rEvt.GetColumnId(), TRUE, FALSE ); + SelectColumnId( rEvt.GetColumnId(), sal_True, sal_False ); } // ggf. Cursor wieder an - bSelecting = FALSE; + bSelecting = sal_False; DoShowCursor( "MouseButtonDown" ); if ( bSelect ) Select(); @@ -1812,7 +1812,7 @@ void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt ) { aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() ); if ( bExtendedMode ) - SelectRow( rEvt.GetRow(), FALSE ); + SelectRow( rEvt.GetRow(), sal_False ); else { SetNoSelection(); @@ -1821,19 +1821,19 @@ void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt ) else { GoToRow( rEvt.GetRow() ); - SelectRow( rEvt.GetRow(), TRUE ); + SelectRow( rEvt.GetRow(), sal_True ); } } - bSelect = TRUE; - bExtendedMode = FALSE; - bFieldMode = FALSE; - bHit = FALSE; + bSelect = sal_True; + bExtendedMode = sal_False; + bFieldMode = sal_False; + bHit = sal_False; } // activate cursor if ( bSelecting ) { - bSelecting = FALSE; + bSelecting = sal_False; DoShowCursor( "MouseButtonUp" ); if ( bSelect ) Select(); @@ -1850,16 +1850,16 @@ void BrowseBox::KeyInput( const KeyEvent& rEvt ) //------------------------------------------------------------------- -BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt ) +sal_Bool BrowseBox::ProcessKey( const KeyEvent& rEvt ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - USHORT nCode = rEvt.GetKeyCode().GetCode(); - BOOL bShift = rEvt.GetKeyCode().IsShift(); - BOOL bCtrl = rEvt.GetKeyCode().IsMod1(); - BOOL bAlt = rEvt.GetKeyCode().IsMod2(); + sal_uInt16 nCode = rEvt.GetKeyCode().GetCode(); + sal_Bool bShift = rEvt.GetKeyCode().IsShift(); + sal_Bool bCtrl = rEvt.GetKeyCode().IsMod1(); + sal_Bool bAlt = rEvt.GetKeyCode().IsMod2(); - USHORT nId = BROWSER_NONE; + sal_uInt16 nId = BROWSER_NONE; if ( !bAlt && !bCtrl && !bShift ) { @@ -1921,12 +1921,12 @@ BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt ) //------------------------------------------------------------------- -void BrowseBox::Dispatch( USHORT nId ) +void BrowseBox::Dispatch( sal_uInt16 nId ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); long nRowsOnPage = pDataWin->GetSizePixel().Height() / GetDataRowHeight(); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; switch ( nId ) { @@ -1937,11 +1937,11 @@ void BrowseBox::Dispatch( USHORT nId ) case BROWSER_CURSORDOWN: if ( ( GetCurRow() + 1 ) < nRowCount ) - bDone = GoToRow( GetCurRow() + 1, FALSE ); + bDone = GoToRow( GetCurRow() + 1, sal_False ); break; case BROWSER_CURSORUP: if ( GetCurRow() > 0 ) - bDone = GoToRow( GetCurRow() - 1, FALSE ); + bDone = GoToRow( GetCurRow() - 1, sal_False ); break; case BROWSER_SELECTHOME: if ( GetRowCount() ) @@ -1949,7 +1949,7 @@ void BrowseBox::Dispatch( USHORT nId ) DoHideCursor( "BROWSER_SELECTHOME" ); for ( long nRow = GetCurRow(); nRow >= 0; --nRow ) SelectRow( nRow ); - GoToRow( 0, TRUE ); + GoToRow( 0, sal_True ); DoShowCursor( "BROWSER_SELECTHOME" ); } break; @@ -1960,7 +1960,7 @@ void BrowseBox::Dispatch( USHORT nId ) long nRows = GetRowCount(); for ( long nRow = GetCurRow(); nRow < nRows; ++nRow ) SelectRow( nRow ); - GoToRow( GetRowCount() - 1, TRUE ); + GoToRow( GetRowCount() - 1, sal_True ); DoShowCursor( "BROWSER_SELECTEND" ); } break; @@ -1971,12 +1971,12 @@ void BrowseBox::Dispatch( USHORT nId ) // deselect the current row, if it isn't the first // and there is no other selected row above long nRow = GetCurRow(); - BOOL bLocalSelect = ( !IsRowSelected( nRow ) || + sal_Bool bLocalSelect = ( !IsRowSelected( nRow ) || GetSelectRowCount() == 1 || IsRowSelected( nRow - 1 ) ); - SelectRow( nRow, bLocalSelect, TRUE ); - bDone = GoToRow( GetCurRow() + 1 , FALSE ); + SelectRow( nRow, bLocalSelect, sal_True ); + bDone = GoToRow( GetCurRow() + 1 , sal_False ); if ( bDone ) - SelectRow( GetCurRow(), TRUE, TRUE ); + SelectRow( GetCurRow(), sal_True, sal_True ); } else bDone = ScrollRows( 1 ) != 0; @@ -1988,40 +1988,40 @@ void BrowseBox::Dispatch( USHORT nId ) // deselect the current row, if it isn't the first // and there is no other selected row under long nRow = GetCurRow(); - BOOL bLocalSelect = ( !IsRowSelected( nRow ) || + sal_Bool bLocalSelect = ( !IsRowSelected( nRow ) || GetSelectRowCount() == 1 || IsRowSelected( nRow + 1 ) ); - SelectRow( nCurRow, bLocalSelect, TRUE ); - bDone = GoToRow( nRow - 1 , FALSE ); + SelectRow( nCurRow, bLocalSelect, sal_True ); + bDone = GoToRow( nRow - 1 , sal_False ); if ( bDone ) - SelectRow( GetCurRow(), TRUE, TRUE ); + SelectRow( GetCurRow(), sal_True, sal_True ); } break; case BROWSER_CURSORPAGEDOWN: - bDone = (BOOL)ScrollRows( nRowsOnPage ); + bDone = (sal_Bool)ScrollRows( nRowsOnPage ); break; case BROWSER_CURSORPAGEUP: - bDone = (BOOL)ScrollRows( -nRowsOnPage ); + bDone = (sal_Bool)ScrollRows( -nRowsOnPage ); break; case BROWSER_CURSOREND: if ( bColumnCursor ) { - USHORT nNewId = GetColumnId(ColCount() -1); + sal_uInt16 nNewId = GetColumnId(ColCount() -1); bDone = (nNewId != 0) && GoToColumnId( nNewId ); break; } case BROWSER_CURSORENDOFFILE: - bDone = GoToRow( nRowCount - 1, FALSE ); + bDone = GoToRow( nRowCount - 1, sal_False ); break; case BROWSER_CURSORRIGHT: if ( bColumnCursor ) { - USHORT nNewPos = GetColumnPos( GetCurColumnId() ) + 1; - USHORT nNewId = GetColumnId( nNewPos ); + sal_uInt16 nNewPos = GetColumnPos( GetCurColumnId() ) + 1; + sal_uInt16 nNewId = GetColumnId( nNewPos ); if (nNewId != 0) // Am Zeilenende ? bDone = GoToColumnId( nNewId ); else { - USHORT nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0); + sal_uInt16 nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0); if ( GetRowCount() ) bDone = ( nCurRow < GetRowCount() - 1 ) && GoToRowColumnId( nCurRow + 1, nColId ); else if ( ColCount() ) @@ -2034,18 +2034,18 @@ void BrowseBox::Dispatch( USHORT nId ) case BROWSER_CURSORHOME: if ( bColumnCursor ) { - USHORT nNewId = GetColumnId(1); + sal_uInt16 nNewId = GetColumnId(1); bDone = (nNewId != 0) && GoToColumnId( nNewId ); break; } case BROWSER_CURSORTOPOFFILE: - bDone = GoToRow( 0, FALSE ); + bDone = GoToRow( 0, sal_False ); break; case BROWSER_CURSORLEFT: if ( bColumnCursor ) { - USHORT nNewPos = GetColumnPos( GetCurColumnId() ) - 1; - USHORT nNewId = GetColumnId( nNewPos ); + sal_uInt16 nNewPos = GetColumnPos( GetCurColumnId() ) - 1; + sal_uInt16 nNewId = GetColumnId( nNewPos ); if (nNewId != 0) bDone = GoToColumnId( nNewId ); else @@ -2061,13 +2061,13 @@ void BrowseBox::Dispatch( USHORT nId ) break; case BROWSER_ENHANCESELECTION: if ( GetRowCount() ) - SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), TRUE ); - bDone = TRUE; + SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), sal_True ); + bDone = sal_True; break; case BROWSER_SELECT: if ( GetRowCount() ) - SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), FALSE ); - bDone = TRUE; + SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), sal_False ); + bDone = sal_True; break; case BROWSER_MOVECOLUMNLEFT: case BROWSER_MOVECOLUMNRIGHT: @@ -2075,20 +2075,20 @@ void BrowseBox::Dispatch( USHORT nId ) BrowserHeader* pHeaderBar = getDataWindow()->pHeaderBar; if ( pHeaderBar && pHeaderBar->IsDragable() ) { - USHORT nColId = GetCurColumnId(); - BOOL bColumnSelected = IsColumnSelected(nColId); - USHORT nNewPos = GetColumnPos(nColId); - BOOL bMoveAllowed = FALSE; + sal_uInt16 nColId = GetCurColumnId(); + sal_Bool bColumnSelected = IsColumnSelected(nColId); + sal_uInt16 nNewPos = GetColumnPos(nColId); + sal_Bool bMoveAllowed = sal_False; if ( BROWSER_MOVECOLUMNLEFT == nId && nNewPos > 1 ) - --nNewPos,bMoveAllowed = TRUE; + --nNewPos,bMoveAllowed = sal_True; else if ( BROWSER_MOVECOLUMNRIGHT == nId && nNewPos < (ColCount()-1) ) - ++nNewPos,bMoveAllowed = TRUE; + ++nNewPos,bMoveAllowed = sal_True; if ( bMoveAllowed ) { SetColumnPos( nColId, nNewPos ); ColumnMoved( nColId ); - MakeFieldVisible(GetCurRow(),nColId,TRUE); + MakeFieldVisible(GetCurRow(),nColId,sal_True); if ( bColumnSelected ) SelectColumnId(nColId); } @@ -2119,7 +2119,7 @@ void BrowseBox::SetCursorColor(const Color& _rCol) DoShowCursor("SetCursorColor"); } // ----------------------------------------------------------------------------- -Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen) +Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen) { Window* pParent = NULL; if ( !_bOnScreen ) @@ -2143,14 +2143,14 @@ Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen) return Rectangle(aTopLeft,Size(nWidth,nHeight)); } // ----------------------------------------------------------------------------- -Rectangle BrowseBox::calcTableRect(BOOL _bOnScreen) +Rectangle BrowseBox::calcTableRect(sal_Bool _bOnScreen) { Window* pParent = NULL; if ( !_bOnScreen ) pParent = GetAccessibleParentWindow(); Rectangle aRect( GetWindowExtentsRelative( pParent ) ); - Rectangle aRowBar = calcHeaderRect(FALSE,pParent == NULL); + Rectangle aRowBar = calcHeaderRect(sal_False,pParent == NULL); long nX = aRowBar.Right() - aRect.Left(); long nY = aRowBar.Top() - aRect.Top(); @@ -2159,7 +2159,7 @@ Rectangle BrowseBox::calcTableRect(BOOL _bOnScreen) return Rectangle(aRowBar.TopRight(), Size(aSize.A() - nX, aSize.B() - nY - aHScroll.GetSizePixel().Height()) ); } // ----------------------------------------------------------------------------- -Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, BOOL /*_bIsHeader*/, BOOL _bOnScreen ) +Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, sal_Bool /*_bIsHeader*/, sal_Bool _bOnScreen ) { Window* pParent = NULL; if ( !_bOnScreen ) diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 102af1b6e1a1..966f8e8596fc 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -172,7 +172,7 @@ sal_Int32 BrowseBox::GetAccessibleControlCount() const Reference< XAccessible > BrowseBox::CreateAccessibleControl( sal_Int32 ) { - DBG_ASSERT( FALSE, "BrowseBox::CreateAccessibleControl: to be overwritten!" ); + DBG_ASSERT( sal_False, "BrowseBox::CreateAccessibleControl: to be overwritten!" ); return NULL; } // ----------------------------------------------------------------------------- @@ -192,7 +192,7 @@ sal_Bool BrowseBox::ConvertPointToCellAddress( sal_Bool BrowseBox::ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint ) { rnRow = GetRowAtYPosPixel(rPoint.Y()); - // USHORT nColumnId = GetColumnAtXPosPixel(rPoint.X()); + // sal_uInt16 nColumnId = GetColumnAtXPosPixel(rPoint.X()); return rnRow != BROWSER_INVALIDID;// && nColumnId == 0; } // ----------------------------------------------------------------------------- @@ -397,7 +397,7 @@ void BrowseBox::GrabTableFocus() GrabFocus(); } // ----------------------------------------------------------------------------- -String BrowseBox::GetCellText(long, USHORT ) const +String BrowseBox::GetCellText(long, sal_uInt16 ) const { DBG_ASSERT(0,"This method has to be implemented by the derived classes! BUG!!"); return String(); @@ -531,13 +531,13 @@ sal_Bool BrowseBox::IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) con return IsFieldVisible( _nRow, GetColumnId( _nColumnPos ) ); } // ----------------------------------------------------------------------------- -String BrowseBox::GetAccessibleCellText(long _nRow, USHORT _nColPos) const +String BrowseBox::GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const { return GetCellText( _nRow, GetColumnId( _nColPos ) ); } // ----------------------------------------------------------------------------- -BOOL BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) +sal_Bool BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) { return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector ); } @@ -552,7 +552,7 @@ void BrowseBox::GrabFocus() Control::GrabFocus(); } // ----------------------------------------------------------------------------- -Reference< XAccessible > BrowseBox::GetAccessible( BOOL bCreate ) +Reference< XAccessible > BrowseBox::GetAccessible( sal_Bool bCreate ) { return Control::GetAccessible( bCreate ); } diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx index 39845b84f7e0..b517f6d931e5 100644 --- a/svtools/source/brwbox/brwhead.cxx +++ b/svtools/source/brwbox/brwhead.cxx @@ -79,7 +79,7 @@ void BrowserHeader::EndDrag() Update(); // not aborted? - USHORT nId = GetCurItemId(); + sal_uInt16 nId = GetCurItemId(); if ( nId ) { // Handle-Column? @@ -98,7 +98,7 @@ void BrowserHeader::EndDrag() // column drag // Hat sich die Position eigentlich veraendert // Handlecolumn beruecksichtigen - USHORT nOldPos = _pBrowseBox->GetColumnPos(nId), + sal_uInt16 nOldPos = _pBrowseBox->GetColumnPos(nId), nNewPos = GetItemPos( nId ); if (!_pBrowseBox->GetColumnId(0)) // Handle diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index cb43e4989355..c13eabd2314e 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -67,7 +67,7 @@ void ButtonFrame::Draw( OutputDevice& rDev ) { Window *pWin = (Window*) &rDev; if( bPressed ) - pWin->DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE ); + pWin->DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False ); } else { @@ -84,10 +84,10 @@ void ButtonFrame::Draw( OutputDevice& rDev ) String aVal = rDev.GetEllipsisString(aText,aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH); Font aFont( rDev.GetFont() ); - BOOL bOldTransp = aFont.IsTransparent(); + sal_Bool bOldTransp = aFont.IsTransparent(); if ( !bOldTransp ) { - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); rDev.SetFont( aFont ); } @@ -102,7 +102,7 @@ void ButtonFrame::Draw( OutputDevice& rDev ) // restore settings if ( !bOldTransp ) { - aFont.SetTransparent(FALSE); + aFont.SetTransparent(sal_False); rDev.SetFont( aFont ); } if (m_bDrawDisabled) @@ -123,14 +123,14 @@ void ButtonFrame::Draw( OutputDevice& rDev ) //------------------------------------------------------------------- -BrowserColumn::BrowserColumn( USHORT nItemId, const class Image &rImage, - const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom, +BrowserColumn::BrowserColumn( sal_uInt16 nItemId, const class Image &rImage, + const String& rTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom, HeaderBarItemBits nFlags ) : _nId( nItemId ), _nWidth( nWidthPixel ), _aImage( rImage ), _aTitle( rTitle ), - _bFrozen( FALSE ), + _bFrozen( sal_False ), _nFlags( nFlags ) { double n = (double)_nWidth; @@ -145,7 +145,7 @@ BrowserColumn::~BrowserColumn() //------------------------------------------------------------------- -void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom) +void BrowserColumn::SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom) { _nWidth = nNewWidthPixel; double n = (double)_nWidth; @@ -156,13 +156,13 @@ void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom) //------------------------------------------------------------------- -void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, BOOL bCurs ) +void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, sal_Bool bCurs ) { if ( _nId == 0 ) { // paint handle column ButtonFrame( rPos, Size( Width()-1, rBox.GetDataRowHeight()-1 ), - String(), FALSE, bCurs, + String(), sal_False, bCurs, 0 != (BROWSER_COLUMN_TITLEABBREVATION&_nFlags) ).Draw( rDev ); Color aOldLineColor = rDev.GetLineColor(); rDev.SetLineColor( Color( COL_BLACK ) ); @@ -216,18 +216,18 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent ) ,pEventWin( pParent ) ,pCornerWin( 0 ) ,pDtorNotify( 0 ) - ,bInPaint( FALSE ) - ,bInCommand( FALSE ) - ,bNoScrollBack( FALSE ) - ,bNoHScroll( FALSE ) - ,bNoVScroll( FALSE ) - ,bUpdateMode( TRUE ) - ,bResizeOnPaint( FALSE ) - ,bUpdateOnUnlock( FALSE ) - ,bInUpdateScrollbars( FALSE ) - ,bHadRecursion( FALSE ) - ,bOwnDataChangedHdl( FALSE ) - ,bCallingDropCallback( FALSE ) + ,bInPaint( sal_False ) + ,bInCommand( sal_False ) + ,bNoScrollBack( sal_False ) + ,bNoHScroll( sal_False ) + ,bNoVScroll( sal_False ) + ,bUpdateMode( sal_True ) + ,bResizeOnPaint( sal_False ) + ,bUpdateOnUnlock( sal_False ) + ,bInUpdateScrollbars( sal_False ) + ,bHadRecursion( sal_False ) + ,bOwnDataChangedHdl( sal_False ) + ,bCallingDropCallback( sal_False ) ,nUpdateLock( 0 ) ,nCursorHidden( 0 ) ,m_nDragRowDividerLimit( 0 ) @@ -241,7 +241,7 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent ) BrowserDataWin::~BrowserDataWin() { if( pDtorNotify ) - *pDtorNotify = TRUE; + *pDtorNotify = sal_True; } //------------------------------------------------------------------- @@ -253,14 +253,14 @@ void BrowserDataWin::LeaveUpdateLock() if (bUpdateOnUnlock ) { Control::Update(); - bUpdateOnUnlock = FALSE; + bUpdateOnUnlock = sal_False; } } } //------------------------------------------------------------------- void InitSettings_Impl( Window *pWin, - BOOL bFont, BOOL bForeground, BOOL bBackground ) + sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings(); @@ -296,7 +296,7 @@ void BrowserDataWin::Update() if ( !nUpdateLock ) Control::Update(); else - bUpdateOnUnlock = TRUE; + bUpdateOnUnlock = sal_True; } //------------------------------------------------------------------- @@ -307,9 +307,9 @@ void BrowserDataWin::DataChanged( const DataChangedEvent& rDCEvt ) { if( !bOwnDataChangedHdl ) { - InitSettings_Impl( this, TRUE, TRUE, TRUE ); + InitSettings_Impl( this, sal_True, sal_True, sal_True ); Invalidate(); - InitSettings_Impl( GetParent(), TRUE, TRUE, TRUE ); + InitSettings_Impl( GetParent(), sal_True, sal_True, sal_True ); GetParent()->Invalidate(); GetParent()->Resize(); } @@ -328,9 +328,9 @@ void BrowserDataWin::Paint( const Rectangle& rRect ) aInvalidRegion.Insert( new Rectangle( rRect ) ); return; } - bInPaint = TRUE; + bInPaint = sal_True; ( (BrowseBox*) GetParent() )->PaintData( *this, rRect ); - bInPaint = FALSE; + bInPaint = sal_False; DoOutstandingInvalidations(); } else @@ -352,7 +352,7 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel ) // find column under mouse long nMouseX = rPosPixel.X(); long nColX = 0; - USHORT nCol; + sal_uInt16 nCol; for ( nCol = 0; nCol < pBox->pCols->Count() && nColX < GetSizePixel().Width(); ++nCol ) @@ -362,7 +362,7 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel ) if ( nMouseX < nColX ) break; } - USHORT nColId = BROWSER_INVALIDID; + sal_uInt16 nColId = BROWSER_INVALIDID; if ( nCol < pBox->pCols->Count() ) nColId = pBox->pCols->GetObject(nCol)->GetId(); @@ -424,14 +424,14 @@ void BrowserDataWin::Command( const CommandEvent& rEvt ) return; Point aEventPos( rEvt.GetMousePosPixel() ); - long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), FALSE); + long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), sal_False); MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() && nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) ) { - BOOL bDeleted = FALSE; + sal_Bool bDeleted = sal_False; pDtorNotify = &bDeleted; - bInCommand = TRUE; + bInCommand = sal_True; MouseButtonDown( aMouseEvt ); if( bDeleted ) return; @@ -439,20 +439,20 @@ void BrowserDataWin::Command( const CommandEvent& rEvt ) if( bDeleted ) return; pDtorNotify = 0; - bInCommand = FALSE; + bInCommand = sal_False; } aEventPos.Y() += GetParent()->GetTitleHeight(); CommandEvent aEvt( aEventPos, rEvt.GetCommand(), rEvt.IsMouseEvent(), rEvt.GetData() ); - bInCommand = TRUE; - BOOL bDeleted = FALSE; + bInCommand = sal_True; + sal_Bool bDeleted = sal_False; pDtorNotify = &bDeleted; GetParent()->Command( aEvt ); if( bDeleted ) return; pDtorNotify = 0; - bInCommand = FALSE; + bInCommand = sal_False; if ( COMMAND_STARTDRAG == rEvt.GetCommand() ) MouseButtonUp( aMouseEvt ); @@ -462,7 +462,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt ) //------------------------------------------------------------------- -BOOL BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent ) +sal_Bool BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent ) { if ( ! ( GetParent()->IsInteractiveRowHeightEnabled() && ( _rEvent.GetRow() >= 0 ) @@ -470,7 +470,7 @@ BOOL BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent ) && ( _rEvent.GetColumnId() == 0 ) ) ) - return FALSE; + return sal_False; long nDividerDistance = GetParent()->GetDataRowHeight() - ( _rEvent.GetPosPixel().Y() % GetParent()->GetDataRowHeight() ); return ( nDividerDistance <= 4 ); @@ -570,7 +570,7 @@ void BrowserDataWin::StartRowDividerDrag( const Point& _rStartPos ) m_nDragRowDividerLimit = nDragRowDividerCurrentPos - nDataRowHeight; - GetParent()->bRowDividerDrag = TRUE; + GetParent()->bRowDividerDrag = sal_True; GetParent()->ImplStartTracking(); Rectangle aDragSplitRect( 0, m_nDragRowDividerLimit, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos ); @@ -594,7 +594,7 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt ) if ( rTEvt.IsTrackingEnded() ) { HideTracking(); - GetParent()->bRowDividerDrag = FALSE; + GetParent()->bRowDividerDrag = sal_False; GetParent()->ImplEndTracking(); if ( !rTEvt.IsTrackingCanceled() ) @@ -645,7 +645,7 @@ void BrowserDataWin::RequestHelp( const HelpEvent& rHEvt ) //=================================================================== BrowseEvent::BrowseEvent( Window* pWindow, - long nAbsRow, USHORT nColumn, USHORT nColumnId, + long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, const Rectangle& rRect ): pWin(pWindow), nRow(nAbsRow), @@ -666,7 +666,7 @@ BrowserMouseEvent::BrowserMouseEvent( BrowserDataWin *pWindow, //------------------------------------------------------------------- BrowserMouseEvent::BrowserMouseEvent( Window *pWindow, const MouseEvent& rEvt, - long nAbsRow, USHORT nColumn, USHORT nColumnId, + long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, const Rectangle& rRect ): MouseEvent(rEvt), BrowseEvent( pWindow, nAbsRow, nColumn, nColumnId, rRect ) @@ -693,7 +693,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const //------------------------------------------------------------------- -void BrowserDataWin::SetUpdateMode( BOOL bMode ) +void BrowserDataWin::SetUpdateMode( sal_Bool bMode ) { DBG_ASSERT( !bUpdateMode || aInvalidRegion.Count() == 0, "invalid region not empty" ); @@ -720,7 +720,7 @@ void BrowserDataWin::DoOutstandingInvalidations() //------------------------------------------------------------------- -void BrowserDataWin::Invalidate( USHORT nFlags ) +void BrowserDataWin::Invalidate( sal_uInt16 nFlags ) { if ( !GetUpdateMode() ) { @@ -737,7 +737,7 @@ void BrowserDataWin::Invalidate( USHORT nFlags ) //------------------------------------------------------------------- -void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags ) +void BrowserDataWin::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags ) { if ( !GetUpdateMode() ) aInvalidRegion.Insert( new Rectangle( rRect ) ); @@ -749,7 +749,7 @@ void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags ) void BrowserScrollBar::Tracking( const TrackingEvent& rTEvt ) { - ULONG nPos = GetThumbPos(); + sal_uLong nPos = GetThumbPos(); if ( nPos != _nLastPos ) { if ( _nTip ) diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index 1deb8aeb5b56..91b22d764bb0 100644 --- a/svtools/source/brwbox/datwin.hxx +++ b/svtools/source/brwbox/datwin.hxx @@ -53,18 +53,18 @@ class ButtonFrame Rectangle aRect; Rectangle aInnerRect; String aText; - BOOL bPressed; - BOOL bCurs; - BOOL bAbbr; - BOOL m_bDrawDisabled; + sal_Bool bPressed; + sal_Bool bCurs; + sal_Bool bAbbr; + sal_Bool m_bDrawDisabled; public: ButtonFrame( const Point& rPt, const Size& rSz, const String &rText, - BOOL bPress = FALSE, - BOOL bCursor = FALSE, - BOOL bAbbreviate = TRUE, - BOOL _bDrawDisabled = FALSE) + sal_Bool bPress = sal_False, + sal_Bool bCursor = sal_False, + sal_Bool bAbbreviate = sal_True, + sal_Bool _bDrawDisabled = sal_False) :aRect( rPt, rSz ) ,aInnerRect( Point( aRect.Left()+1, aRect.Top()+1 ), Size( aRect.GetWidth()-2, aRect.GetHeight()-2 ) ) @@ -83,34 +83,34 @@ public: class BrowserColumn { - USHORT _nId; - ULONG _nOriginalWidth; - ULONG _nWidth; + sal_uInt16 _nId; + sal_uLong _nOriginalWidth; + sal_uLong _nWidth; Image _aImage; String _aTitle; - BOOL _bFrozen; + sal_Bool _bFrozen; HeaderBarItemBits _nFlags; public: - BrowserColumn( USHORT nItemId, const Image &rImage, - const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom, + BrowserColumn( sal_uInt16 nItemId, const Image &rImage, + const String& rTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom, HeaderBarItemBits nFlags ); virtual ~BrowserColumn(); - USHORT GetId() const { return _nId; } + sal_uInt16 GetId() const { return _nId; } - ULONG Width() { return _nWidth; } + sal_uLong Width() { return _nWidth; } Image& GetImage() { return _aImage; } String& Title() { return _aTitle; } HeaderBarItemBits& Flags() { return _nFlags; } - BOOL IsFrozen() const { return _bFrozen; } - void Freeze( BOOL bFreeze = TRUE ) { _bFrozen = bFreeze; } + sal_Bool IsFrozen() const { return _bFrozen; } + void Freeze( sal_Bool bFreeze = sal_True ) { _bFrozen = bFreeze; } virtual void Draw( BrowseBox& rBox, OutputDevice& rDev, - const Point& rPos, BOOL bCurs ); + const Point& rPos, sal_Bool bCurs ); - void SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom); + void SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom); void ZoomChanged(const Fraction& rNewZoom); }; @@ -125,7 +125,7 @@ public: BrowserHeader* pHeaderBar; // only for BROWSER_HEADERBAR_NEW Window* pEventWin; // Window of forwarded events ScrollBarBox* pCornerWin; // Window in the corner btw the ScrollBars - BOOL* pDtorNotify; + sal_Bool* pDtorNotify; AutoTimer aMouseTimer; // recalls MouseMove on dragging out MouseEvent aRepeatEvt; // a MouseEvent to repeat Point aLastMousePos; // verhindert pseudo-MouseMoves @@ -133,8 +133,8 @@ public: String aRealRowCount; // zur Anzeige im VScrollBar RectangleList aInvalidRegion; // invalidated Rectangles during !UpdateMode - FASTBOOL bInPaint; // TRUE while in Paint - FASTBOOL bInCommand; // TRUE while in Command + FASTBOOL bInPaint; // sal_True while in Paint + FASTBOOL bInCommand; // sal_True while in Command FASTBOOL bNoScrollBack; // nur vorwaerts scrollen FASTBOOL bNoHScroll; // kein horizontaler Scrollbar FASTBOOL bNoVScroll; // no vertical scrollbar @@ -148,7 +148,7 @@ public: FASTBOOL bHadRecursion; // Rekursion war aufgetreten FASTBOOL bOwnDataChangedHdl; // dont change colors in DataChanged FASTBOOL bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop curently - USHORT nUpdateLock; // lock count, dont call Control::Update()! + sal_uInt16 nUpdateLock; // lock count, dont call Control::Update()! short nCursorHidden; // new conuter for DoHide/ShowCursor long m_nDragRowDividerLimit; @@ -184,20 +184,20 @@ public: { return (BrowseBox*) Window::GetParent(); } const String& GetRealRowCount() const { return aRealRowCount; } - void SetUpdateMode( BOOL bMode ); + void SetUpdateMode( sal_Bool bMode ); FASTBOOL GetUpdateMode() const { return bUpdateMode; } void EnterUpdateLock() { ++nUpdateLock; } void LeaveUpdateLock(); void Update(); void DoOutstandingInvalidations(); - void Invalidate( USHORT nFlags = 0 ); - void Invalidate( const Rectangle& rRect, USHORT nFlags = 0 ); - void Invalidate( const Region& rRegion, USHORT nFlags = 0 ) + void Invalidate( sal_uInt16 nFlags = 0 ); + void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); + void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 ) { Control::Invalidate( rRegion, nFlags ); } protected: void StartRowDividerDrag( const Point& _rStartPos ); - BOOL ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent ); + sal_Bool ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent ); }; //------------------------------------------------------------------- @@ -213,8 +213,8 @@ inline void BrowserDataWin::Repaint() class BrowserScrollBar: public ScrollBar { - ULONG _nTip; - ULONG _nLastPos; + sal_uLong _nTip; + sal_uLong _nLastPos; BrowserDataWin* _pDataWin; public: @@ -234,7 +234,7 @@ public: //=================================================================== void InitSettings_Impl( Window *pWin, - BOOL bFont = TRUE, BOOL bForeground = TRUE, BOOL bBackground = TRUE ); + sal_Bool bFont = sal_True, sal_Bool bForeground = sal_True, sal_Bool bBackground = sal_True ); //=================================================================== diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index edf56f0b9b34..9f870a9f0681 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -80,7 +80,7 @@ namespace svt nPos = 0; if (nPos >= GetEntryCount()) nPos = GetEntryCount() - 1; - SetText(GetEntry(sal::static_int_cast< USHORT >(nPos))); + SetText(GetEntry(sal::static_int_cast< sal_uInt16 >(nPos))); return 1; } } @@ -187,7 +187,7 @@ namespace svt nPos = 0; if (nPos >= GetEntryCount()) nPos = GetEntryCount() - 1; - SelectEntryPos(sal::static_int_cast< USHORT >(nPos)); + SelectEntryPos(sal::static_int_cast< sal_uInt16 >(nPos)); Select(); // for calling Modify return 1; } @@ -311,7 +311,7 @@ namespace svt } //------------------------------------------------------------------ - void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags ) + void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) { pBox->Draw(pDev,rPos,rSize,nFlags); } @@ -399,7 +399,7 @@ namespace svt EditCellController::EditCellController( Edit* _pEdit ) :CellController( _pEdit ) ,m_pEditImplementation( new EditImplementation( *_pEdit ) ) - ,m_bOwnImplementation( TRUE ) + ,m_bOwnImplementation( sal_True ) { } @@ -407,7 +407,7 @@ namespace svt EditCellController::EditCellController( MultiLineTextCell* _pEdit ) :CellController( _pEdit ) ,m_pEditImplementation( new MultiLineEditImplementation( *_pEdit ) ) - ,m_bOwnImplementation( TRUE ) + ,m_bOwnImplementation( sal_True ) { } @@ -415,7 +415,7 @@ namespace svt EditCellController::EditCellController( IEditImplementation* _pImplementation ) :CellController( &_pImplementation->GetControl() ) ,m_pEditImplementation( _pImplementation ) - ,m_bOwnImplementation( FALSE ) + ,m_bOwnImplementation( sal_False ) { } @@ -552,21 +552,21 @@ namespace svt //------------------------------------------------------------------ void MultiLineTextCell::Modify() { - GetTextEngine()->SetModified( TRUE ); + GetTextEngine()->SetModified( sal_True ); MultiLineEdit::Modify(); } //------------------------------------------------------------------ - BOOL MultiLineTextCell::dispatchKeyEvent( const KeyEvent& _rEvent ) + sal_Bool MultiLineTextCell::dispatchKeyEvent( const KeyEvent& _rEvent ) { Selection aOldSelection( GetSelection() ); - BOOL bWasModified = IsModified(); + sal_Bool bWasModified = IsModified(); ClearModifyFlag( ); - BOOL bHandled = GetTextView()->KeyInput( _rEvent ); + sal_Bool bHandled = GetTextView()->KeyInput( _rEvent ); - BOOL bIsModified = IsModified(); + sal_Bool bIsModified = IsModified(); if ( bWasModified && !bIsModified ) // not sure whether this can really happen SetModifyFlag(); @@ -579,9 +579,9 @@ namespace svt if ( aNewSelection != aOldSelection // selection changed || bIsModified // or some other modification ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } //------------------------------------------------------------------ @@ -599,7 +599,7 @@ namespace svt const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); const KeyCode& rKeyCode = pKeyEvent->GetKeyCode(); - USHORT nCode = rKeyCode.GetCode(); + sal_uInt16 nCode = rKeyCode.GetCode(); if ( ( nCode == KEY_RETURN ) && ( rKeyCode.GetModifier() == KEY_MOD1 ) ) { diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 4f0afbaf5d2d..04bb47c2ab3e 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -629,7 +629,7 @@ namespace svt { while ( GetSelectColumnCount( ) ) SelectColumnPos( - sal::static_int_cast< USHORT >(FirstSelectedColumn()), + sal::static_int_cast< sal_uInt16 >(FirstSelectedColumn()), sal_False ); Select(); } diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx index ed62b2cb1520..9f247a580fc9 100644 --- a/svtools/source/brwbox/editbrowsebox2.cxx +++ b/svtools/source/brwbox/editbrowsebox2.cxx @@ -42,7 +42,7 @@ namespace svt using namespace ::com::sun::star::accessibility::AccessibleEventId; // ----------------------------------------------------------------------------- -Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, USHORT _nColumnPos,const TriState& eState,sal_Bool _bEnabled) +Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState,sal_Bool _bEnabled) { Reference< XAccessible > xAccessible( GetAccessible() ); Reference< XAccessibleContext > xAccContext; @@ -163,7 +163,7 @@ void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags ) ) { long nRows = GetRowCount(); - USHORT nCols = ColCount(); + sal_uInt16 nCols = ColCount(); if ( ( nRows > 0 ) && ( nCols > 0 ) ) { @@ -195,7 +195,7 @@ Rectangle EditBrowseBox::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nCol if ( SeekRow(_nRow) ) { CellController* pController = GetController( - _nRow, GetColumnId( sal::static_int_cast< USHORT >(_nColumnPos) ) ); + _nRow, GetColumnId( sal::static_int_cast< sal_uInt16 >(_nColumnPos) ) ); if ( pController ) aRect = pController->GetWindow().GetCharacterBounds(_nIndex); } @@ -208,7 +208,7 @@ sal_Int32 EditBrowseBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumn if ( SeekRow(_nRow) ) { CellController* pController = GetController( - _nRow, GetColumnId( sal::static_int_cast< USHORT >(_nColumnPos) ) ); + _nRow, GetColumnId( sal::static_int_cast< sal_uInt16 >(_nColumnPos) ) ); if ( pController ) nRet = pController->GetWindow().GetIndexForPoint(_rPoint); } diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx index b2d2c54232b0..1cd368df0f5f 100644 --- a/svtools/source/config/accessibilityoptions.cxx +++ b/svtools/source/config/accessibilityoptions.cxx @@ -515,14 +515,14 @@ SvtAccessibilityOptions::SvtAccessibilityOptions() } ++sm_nAccessibilityRefCount; } - //StartListening( *sm_pSingleImplConfig, TRUE ); + //StartListening( *sm_pSingleImplConfig, sal_True ); } // ----------------------------------------------------------------------- SvtAccessibilityOptions::~SvtAccessibilityOptions() { - //EndListening( *sm_pSingleImplConfig, TRUE ); + //EndListening( *sm_pSingleImplConfig, sal_True ); ::osl::MutexGuard aGuard( SingletonMutex::get() ); if( !--sm_nAccessibilityRefCount ) { diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index 4a95d0c03dcd..1c581dbf8f53 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -59,9 +59,9 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) ,nAAMinPixelHeight ( DEFAULT_AAMINHEIGHT ) #endif - ,bMenuMouseFollow(FALSE) + ,bMenuMouseFollow(sal_False) #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) - ,bFontAntialiasing ( TRUE ) + ,bFontAntialiasing ( sal_True ) #endif { RTL_LOGFILE_CONTEXT(aLog, "svtools SvtTabAppearanceCfg::SvtTabAppearanceCfg()"); @@ -165,7 +165,7 @@ void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUSt Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet ) +void SvtTabAppearanceCfg::SetDragMode ( sal_uInt16 nSet ) { nDragMode = nSet; SetModified(); @@ -175,7 +175,7 @@ void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet ) Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetScaleFactor ( USHORT nSet ) +void SvtTabAppearanceCfg::SetScaleFactor ( sal_uInt16 nSet ) { nScaleFactor = nSet; SetModified(); @@ -185,7 +185,7 @@ void SvtTabAppearanceCfg::SetScaleFactor ( USHORT nSet ) Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetSnapMode ( USHORT nSet ) +void SvtTabAppearanceCfg::SetSnapMode ( sal_uInt16 nSet ) { nSnapMode = nSet; SetModified(); @@ -193,7 +193,7 @@ void SvtTabAppearanceCfg::SetSnapMode ( USHORT nSet ) /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetMiddleMouseButton ( USHORT nSet ) +void SvtTabAppearanceCfg::SetMiddleMouseButton ( sal_uInt16 nSet ) { nMiddleMouse = nSet; SetModified(); @@ -211,7 +211,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // SetStandard...Styles() resets the UseSystemUIFonts flag, // but we don't want to change it now, so save the flag before ... - BOOL bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts(); + sal_Bool bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts(); hAppStyle.SetStandardStyles(); // and set it here hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts ); @@ -230,7 +230,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // Mouse Snap MouseSettings hMouseSettings = hAppSettings.GetMouseSettings(); - ULONG nMouseOptions = hMouseSettings.GetOptions(); + sal_uLong nMouseOptions = hMouseSettings.GetOptions(); nMouseOptions &= ! (MOUSE_OPTION_AUTOCENTERPOS | MOUSE_OPTION_AUTODEFBTNPOS); @@ -251,7 +251,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // Merge and Publish Settings - ULONG nFollow = hMouseSettings.GetFollow(); + sal_uLong nFollow = hMouseSettings.GetFollow(); if(bMenuMouseFollow) nFollow |= MOUSE_FOLLOW_MENU; else diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 7a151d609e6e..91e93cc65998 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -550,7 +550,7 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bS if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor)) aRet.nColor = ColorConfig::GetDefaultColor(eEntry).GetColor(); //#103495# don't allow grey between 40% and 60% as application background - const UINT8 nRed = COLORDATA_RED( aRet.nColor); + const sal_uInt8 nRed = COLORDATA_RED( aRet.nColor); if(eEntry == APPBACKGROUND && (nRed == COLORDATA_GREEN( aRet.nColor)) && (nRed == COLORDATA_BLUE( aRet.nColor)) && @@ -569,14 +569,14 @@ EditableColorConfig::EditableColorConfig() : m_pImpl(new ColorConfig_Impl), m_bModified(sal_False) { - m_pImpl->BlockBroadcasts(TRUE); + m_pImpl->BlockBroadcasts(sal_True); } /*-- 25.03.2002 12:03:08--------------------------------------------------- -----------------------------------------------------------------------*/ EditableColorConfig::~EditableColorConfig() { - m_pImpl->BlockBroadcasts(FALSE); + m_pImpl->BlockBroadcasts(sal_False); if(m_bModified) m_pImpl->SetModified(); if(m_pImpl->IsModified()) @@ -674,12 +674,12 @@ void EditableColorConfig::Commit() // ----------------------------------------------------------------------------- void EditableColorConfig::DisableBroadcast() { - m_pImpl->BlockBroadcasts(TRUE); + m_pImpl->BlockBroadcasts(sal_True); } // ----------------------------------------------------------------------------- void EditableColorConfig::EnableBroadcast() { - m_pImpl->BlockBroadcasts(FALSE); + m_pImpl->BlockBroadcasts(sal_False); } // ----------------------------------------------------------------------------- diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx index b8a9660ee8dc..1be097f17ab5 100644 --- a/svtools/source/config/htmlcfg.cxx +++ b/svtools/source/config/htmlcfg.cxx @@ -276,7 +276,7 @@ void SvxHtmlOptions::AddListenerLink( const Link& rLink ) void SvxHtmlOptions::RemoveListenerLink( const Link& rLink ) { - for ( USHORT n=0; n<pImp->aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<pImp->aList.Count(); n++ ) { if ( (*pImp->aList.GetObject(n) ) == rLink ) { @@ -288,7 +288,7 @@ void SvxHtmlOptions::RemoveListenerLink( const Link& rLink ) void SvxHtmlOptions::CallListeners() { - for ( USHORT n = 0; n < pImp->aList.Count(); ++n ) + for ( sal_uInt16 n = 0; n < pImp->aList.Count(); ++n ) pImp->aList.GetObject(n)->Call( this ); } @@ -300,14 +300,14 @@ void SvxHtmlOptions::Notify( const com::sun::star::uno::Sequence< rtl::OUString } // ----------------------------------------------------------------------- -USHORT SvxHtmlOptions::GetFontSize(USHORT nPos) const +sal_uInt16 SvxHtmlOptions::GetFontSize(sal_uInt16 nPos) const { if(nPos < HTML_FONT_COUNT) - return (USHORT)pImp->aFontSizeArr[nPos]; + return (sal_uInt16)pImp->aFontSizeArr[nPos]; return 0; } // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize) +void SvxHtmlOptions::SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize) { if(nPos < HTML_FONT_COUNT) { @@ -321,7 +321,7 @@ void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize) // ----------------------------------------------------------------------- -BOOL SvxHtmlOptions::IsImportUnknown() const +sal_Bool SvxHtmlOptions::IsImportUnknown() const { return 0 != (pImp->nFlags & HTMLCFG_UNKNOWN_TAGS) ; } @@ -329,7 +329,7 @@ BOOL SvxHtmlOptions::IsImportUnknown() const // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetImportUnknown(BOOL bSet) +void SvxHtmlOptions::SetImportUnknown(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_UNKNOWN_TAGS; @@ -341,15 +341,15 @@ void SvxHtmlOptions::SetImportUnknown(BOOL bSet) // ----------------------------------------------------------------------- -USHORT SvxHtmlOptions::GetExportMode() const +sal_uInt16 SvxHtmlOptions::GetExportMode() const { - return (USHORT)pImp->nExportMode; + return (sal_uInt16)pImp->nExportMode; } // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetExportMode(USHORT nSet) +void SvxHtmlOptions::SetExportMode(sal_uInt16 nSet) { if(nSet <= HTML_CFG_MAX ) { @@ -362,7 +362,7 @@ void SvxHtmlOptions::SetExportMode(USHORT nSet) // ----------------------------------------------------------------------- -BOOL SvxHtmlOptions::IsStarBasic() const +sal_Bool SvxHtmlOptions::IsStarBasic() const { return 0 != (pImp->nFlags & HTMLCFG_STAR_BASIC) ; } @@ -370,7 +370,7 @@ BOOL SvxHtmlOptions::IsStarBasic() const // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetStarBasic(BOOL bSet) +void SvxHtmlOptions::SetStarBasic(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_STAR_BASIC; @@ -383,14 +383,14 @@ void SvxHtmlOptions::SetStarBasic(BOOL bSet) --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsSaveGraphicsLocal() const +sal_Bool SvxHtmlOptions::IsSaveGraphicsLocal() const { return 0 != (pImp->nFlags & HTMLCFG_LOCAL_GRF) ; } /*-----------------14.02.97 08.34------------------- --------------------------------------------------*/ -void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet) +void SvxHtmlOptions::SetSaveGraphicsLocal(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_LOCAL_GRF; @@ -403,9 +403,9 @@ void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet) --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsPrintLayoutExtension() const +sal_Bool SvxHtmlOptions::IsPrintLayoutExtension() const { - BOOL bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION); + sal_Bool bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION); switch( pImp->nExportMode ) { case HTML_CFG_MSIE_40: @@ -413,14 +413,14 @@ BOOL SvxHtmlOptions::IsPrintLayoutExtension() const case HTML_CFG_WRITER : break; default: - bRet = FALSE; + bRet = sal_False; } return bRet; } /*-----------------10/21/97 08:34am----------------- --------------------------------------------------*/ -void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet) +void SvxHtmlOptions::SetPrintLayoutExtension(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_PRINT_LAYOUT_EXTENSION; @@ -433,14 +433,14 @@ void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet) --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsIgnoreFontFamily() const +sal_Bool SvxHtmlOptions::IsIgnoreFontFamily() const { return 0 != (pImp->nFlags & HTMLCFG_IGNORE_FONT_FAMILY) ; } /*-----------------10.07.98 10.02------------------- --------------------------------------------------*/ -void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet) +void SvxHtmlOptions::SetIgnoreFontFamily(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY; @@ -451,14 +451,14 @@ void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet) /* -----------------05.02.99 09:03------------------- * * --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsStarBasicWarning() const +sal_Bool SvxHtmlOptions::IsStarBasicWarning() const { return 0 != (pImp->nFlags & HTMLCFG_IS_BASIC_WARNING) ; } /* -----------------05.02.99 09:03------------------- * * --------------------------------------------------*/ -void SvxHtmlOptions::SetStarBasicWarning(BOOL bSet) +void SvxHtmlOptions::SetStarBasicWarning(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_IS_BASIC_WARNING; @@ -506,14 +506,14 @@ SvxHtmlOptions* SvxHtmlOptions::Get() /* ---------------------- 2006-06-07T21:02+0200 ---------------------- */ -BOOL SvxHtmlOptions::IsNumbersEnglishUS() const +sal_Bool SvxHtmlOptions::IsNumbersEnglishUS() const { return 0 != (pImp->nFlags & HTMLCFG_NUMBERS_ENGLISH_US) ; } /* ---------------------- 2006-06-07T21:02+0200 ---------------------- */ -void SvxHtmlOptions::SetNumbersEnglishUS(BOOL bSet) +void SvxHtmlOptions::SetNumbersEnglishUS(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_NUMBERS_ENGLISH_US; diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index e33251050b81..28f52fe2b23b 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -176,7 +176,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_bDontHideDisabledEntries = bState; SetModified(); - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); Commit(); } @@ -185,7 +185,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_bFollowMouse = bState; SetModified(); - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); Commit(); } @@ -194,7 +194,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_nMenuIcons = bState; SetModified(); - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); Commit(); } @@ -299,7 +299,7 @@ SvtMenuOptions_Impl::~SvtMenuOptions_Impl() Commit(); } - for ( USHORT n=0; n<aList.Count(); ) + for ( sal_uInt16 n=0; n<aList.Count(); ) delete aList.Remove(n); } @@ -358,7 +358,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) if ( bMenuSettingsChanged ) m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); } @@ -427,7 +427,7 @@ void SvtMenuOptions_Impl::AddListenerLink( const Link& rLink ) void SvtMenuOptions_Impl::RemoveListenerLink( const Link& rLink ) { - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) { if ( (*aList.GetObject(n) ) == rLink ) { diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index 2f455734a01d..9668a2144ebf 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -81,7 +81,7 @@ using namespace ::com::sun::star; #define PROPERTYCOUNT 6 -#define VCL_TOOLBOX_STYLE_FLAT ((USHORT)0x0004) // from <vcl/toolbox.hxx> +#define VCL_TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx> DECLARE_LIST( LinkList, Link * ) @@ -374,7 +374,7 @@ SvtMiscOptions_Impl::~SvtMiscOptions_Impl() Commit(); } - for ( USHORT n=0; n<aList.Count(); ) + for ( sal_uInt16 n=0; n<aList.Count(); ) delete aList.Remove(n); } @@ -467,7 +467,7 @@ void SvtMiscOptions_Impl::AddListenerLink( const Link& rLink ) void SvtMiscOptions_Impl::RemoveListenerLink( const Link& rLink ) { - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) { if ( (*aList.GetObject(n) ) == rLink ) { @@ -479,7 +479,7 @@ void SvtMiscOptions_Impl::RemoveListenerLink( const Link& rLink ) void SvtMiscOptions_Impl::CallListeners() { - for ( USHORT n = 0; n < aList.Count(); ++n ) + for ( sal_uInt16 n = 0; n < aList.Count(); ++n ) aList.GetObject(n)->Call( this ); } @@ -725,7 +725,7 @@ sal_Int16 SvtMiscOptions::GetCurrentSymbolsSize() const { // Use system settings, we have to retrieve the toolbar icon size from the // Application class - ULONG nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize(); + sal_uLong nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize(); if ( nStyleIconSize == STYLE_TOOLBAR_ICONSIZE_LARGE ) eOptSymbolsSize = SFX_SYMBOLS_SIZE_LARGE; else diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index 46e1f737d347..237d7f79a1c1 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -75,7 +75,7 @@ // - statics - // ----------- -static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; +static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; #define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ])) @@ -748,7 +748,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() ); rOptions.SetReduceBitmaps( IsReduceBitmaps() ); rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() ); - rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) GetReducedBitmapResolution(), (USHORT)( DPI_COUNT - 1 ) ) ] ); + rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] ); rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() ); rOptions.SetConvertToGreyscales( IsConvertToGreyscales() ); } @@ -771,7 +771,7 @@ void SvtBasePrintOptions::SetPrinterOptions( const PrinterOptions& rOptions ) SetReducedBitmapIncludesTransparency( rOptions.IsReducedBitmapIncludesTransparency() ); SetConvertToGreyscales( rOptions.IsConvertToGreyscales() ); - const USHORT nDPI = rOptions.GetReducedBitmapResolution(); + const sal_uInt16 nDPI = rOptions.GetReducedBitmapResolution(); if( nDPI < aDPIArray[ 0 ] ) SetReducedBitmapResolution( 0 ); diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index c9b9b23786b4..4ea086ad7580 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -113,7 +113,7 @@ namespace struct ReleaseSolarMutex { private: - ULONG m_nCount; + sal_uLong m_nCount; public: inline ReleaseSolarMutex() @@ -219,7 +219,7 @@ private: sal_Bool Kill( const OUString& rURL ); protected: - virtual BOOL DoubleClickHdl(); + virtual sal_Bool DoubleClickHdl(); virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos ) const; public: @@ -228,7 +228,7 @@ public: virtual void Resize(); virtual void KeyInput( const KeyEvent& rKEvt ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); void ClearAll(); HeaderBar* GetHeaderBar() const { return mpHeaderBar; } @@ -243,7 +243,7 @@ public: DECL_LINK( ResetQuickSearch_Impl, Timer * ); virtual PopupMenu* CreateContextMenu( void ); - virtual void ExcecuteContextMenuAction( USHORT nSelectedPopentry ); + virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopentry ); }; // class HashedEntry -------------------------------------------------- @@ -473,9 +473,9 @@ void NameTranslationList::Init() aConfig.SetGroup( ByteString( pSection ) ); - USHORT nKeyCnt = aConfig.GetKeyCount(); + sal_uInt16 nKeyCnt = aConfig.GetKeyCount(); - for( USHORT nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt ) + for( sal_uInt16 nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt ) Insert( new NameTranslationEntry( aConfig.GetKeyName( nCnt ), aConfig.ReadKey( nCnt ) ) ); } } @@ -615,7 +615,7 @@ public: String FolderInserted( const OUString& rURL, const OUString& rTitle ); - ULONG GetEntryPos( const OUString& rURL ); + sal_uLong GetEntryPos( const OUString& rURL ); inline void EnableContextMenu( sal_Bool bEnable ); inline void EnableDelete( sal_Bool bEnable ); @@ -965,7 +965,7 @@ PopupMenu* ViewTabListBox_Impl::CreateContextMenu( void ) // ----------------------------------------------------------------------- -void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) +void ViewTabListBox_Impl::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { switch ( nSelectedPopupEntry ) { @@ -983,7 +983,7 @@ void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry void ViewTabListBox_Impl::ClearAll() { - for ( USHORT i = 0; i < GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < GetEntryCount(); ++i ) delete (SvtContentEntry*)GetEntry(i)->GetUserData(); Clear(); } @@ -1059,10 +1059,10 @@ void ViewTabListBox_Impl::DeleteEntries() } // ----------------------------------------------------------------------- -BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, +sal_Bool ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; OUString aURL; SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData(); @@ -1107,7 +1107,7 @@ BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, pData->maURL = aURL; pEntry->SetUserData( pData ); - bRet = TRUE; + bRet = sal_True; } } catch( Exception const & ) @@ -1145,7 +1145,7 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar ) SvLBoxEntry* pEntry = GetEntry( mnSearchIndex ); if ( pEntry ) { - SelectAll( FALSE ); + SelectAll( sal_False ); Select( pEntry ); SetCurEntry( pEntry ); MakeVisible( pEntry ); @@ -1161,10 +1161,10 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar ) } // ----------------------------------------------------------------------- -BOOL ViewTabListBox_Impl::DoubleClickHdl() +sal_Bool ViewTabListBox_Impl::DoubleClickHdl() { SvHeaderTabListBox::DoubleClickHdl(); - return FALSE; + return sal_False; // this means "do no additional handling". Especially this means that the SvImpLBox does not // recognize that the entry at the double click position change after the handler call (which is // the case if in the handler, our content was replaced) @@ -1311,7 +1311,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents ) { mpImp->mpView->ClearAll(); const OUString* pFileProperties = aContents.getConstArray(); - UINT32 i, nCount = aContents.getLength(); + sal_uInt32 i, nCount = aContents.getLength(); for ( i = 0; i < nCount; ++i ) { String aRow( pFileProperties[i] ); @@ -1343,7 +1343,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents ) // detect image sal_Bool bDoInsert = sal_True; INetURLObject aObj( aImageURL.Len() > 0 ? aImageURL : aURL ); - Image aImage = SvFileInformationManager::GetImage( aObj, FALSE, isHighContrast( this ) ); + Image aImage = SvFileInformationManager::GetImage( aObj, sal_False, isHighContrast( this ) ); if ( bDoInsert ) { @@ -1391,7 +1391,7 @@ sal_Bool SvtFileView::CreateNewFolder( const String& rNewFolder ) String sTitle = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); String sEntry = mpImp->FolderInserted( sURL, sTitle ); SvLBoxEntry* pEntry = mpImp->mpView->InsertEntry( sEntry, mpImp->maFolderImage, mpImp->maFolderImage ); - SvtContentEntry* pUserData = new SvtContentEntry( sURL, TRUE ); + SvtContentEntry* pUserData = new SvtContentEntry( sURL, sal_True ); pEntry->SetUserData( pUserData ); mpImp->mpView->MakeVisible( pEntry ); bRet = sal_True; @@ -1577,7 +1577,7 @@ void SvtFileView::CancelRunningAsyncAction() void SvtFileView::SetNoSelection() { - mpImp->mpView->SelectAll( FALSE ); + mpImp->mpView->SelectAll( sal_False ); } // ----------------------------------------------------------------------- @@ -1612,7 +1612,7 @@ void SvtFileView::SetDoubleClickHdl( const Link& rHdl ) // ----------------------------------------------------------------------- -ULONG SvtFileView::GetSelectionCount() const +sal_uLong SvtFileView::GetSelectionCount() const { return mpImp->mpView->GetSelectionCount(); } @@ -1684,7 +1684,7 @@ void SvtFileView::EndInplaceEditing( bool _bCancel ) IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar ) { DBG_ASSERT( pBar, "no headerbar" ); - USHORT nItemID = pBar->GetCurItemId(); + sal_uInt16 nItemID = pBar->GetCurItemId(); HeaderBarItemBits nBits; @@ -1705,7 +1705,7 @@ IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar ) nBits = pBar->GetItemBits( nItemID ); - BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); + sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); if ( bUp ) { @@ -1729,10 +1729,10 @@ IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar ) if ( !pBar->IsItemMode() ) { Size aSize; - USHORT nTabs = pBar->GetItemCount(); + sal_uInt16 nTabs = pBar->GetItemCount(); long nTmpSize = 0; - for ( USHORT i = 1; i <= nTabs; ++i ) + for ( sal_uInt16 i = 1; i <= nTabs; ++i ) { long nWidth = pBar->GetItemSize(i); aSize.Width() = nWidth + nTmpSize; @@ -1755,14 +1755,14 @@ String SvtFileView::GetConfigString() const sRet += String::CreateFromInt32( mpImp->mnSortColumn ); sRet += ';'; HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn ); - BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); + sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); sRet += bUp ? '1' : '0'; sRet += ';'; - USHORT nCount = pBar->GetItemCount(); - for ( USHORT i = 0; i < nCount; ++i ) + sal_uInt16 nCount = pBar->GetItemCount(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) { - USHORT nId = pBar->GetItemId(i); + sal_uInt16 nId = pBar->GetItemId(i); sRet += String::CreateFromInt32( nId ); sRet += ';'; sRet += String::CreateFromInt32( pBar->GetItemSize( nId ) ); @@ -1779,9 +1779,9 @@ void SvtFileView::SetConfigString( const String& rCfgStr ) HeaderBar* pBar = mpImp->mpView->GetHeaderBar(); DBG_ASSERT( pBar, "invalid headerbar" ); - USHORT nIdx = 0; - mpImp->mnSortColumn = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); - BOOL bUp = (BOOL)(USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); + sal_uInt16 nIdx = 0; + mpImp->mnSortColumn = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); + sal_Bool bUp = (sal_Bool)(sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn ); if ( bUp ) @@ -1798,7 +1798,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr ) while ( nIdx != STRING_NOTFOUND ) { - USHORT nItemId = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); + sal_uInt16 nItemId = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); pBar->SetItemSize( nItemId, rCfgStr.GetToken( 0, ';', nIdx ).ToInt32() ); } @@ -2192,7 +2192,7 @@ void SvtFileView_Impl::OpenFolder_Impl() { ::osl::MutexGuard aGuard( maMutex ); - mpView->SetUpdateMode( FALSE ); + mpView->SetUpdateMode( sal_False ); mpView->ClearAll(); std::vector< SortingData_Impl* >::iterator aIt; @@ -2215,7 +2215,7 @@ void SvtFileView_Impl::OpenFolder_Impl() InitSelection(); ++mnSuspendSelectCallback; - mpView->SetUpdateMode( TRUE ); + mpView->SetUpdateMode( sal_True ); --mnSuspendSelectCallback; ResetCursor(); @@ -2227,9 +2227,9 @@ void SvtFileView_Impl::ResetCursor() // deselect SvLBoxEntry* pEntry = mpView->FirstSelected(); if ( pEntry ) - mpView->Select( pEntry, FALSE ); + mpView->Select( pEntry, sal_False ); // set cursor to the first entry - mpView->SetCursor( mpView->First(), TRUE ); + mpView->SetCursor( mpView->First(), sal_True ); mpView->Update(); } @@ -2361,10 +2361,10 @@ void SvtFileView_Impl::CreateDisplayText_Impl() ::svtools::VolumeInfo aVolInfo( (*aIt)->mbIsVolume, (*aIt)->mbIsRemote, (*aIt)->mbIsRemoveable, (*aIt)->mbIsFloppy, (*aIt)->mbIsCompactDisc ); - (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE, isHighContrast( mpView ) ); + (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False, isHighContrast( mpView ) ); } else - (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), FALSE, isHighContrast( mpView )); + (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), sal_False, isHighContrast( mpView )); } } @@ -2449,7 +2449,7 @@ void SvtFileView_Impl::CreateVector_Impl( const Sequence < OUString > &rList ) // detect the image INetURLObject aObj( pEntry->maImageURL.getLength() ? pEntry->maImageURL : pEntry->maTargetURL ); - pEntry->maImage = SvFileInformationManager::GetImage( aObj, FALSE, isHighContrast( mpView ) ); + pEntry->maImage = SvFileInformationManager::GetImage( aObj, sal_False, isHighContrast( mpView ) ); maContent.push_back( pEntry ); } @@ -2480,7 +2480,7 @@ void SvtFileView_Impl::Resort_Impl( sal_Int16 nColumn, sal_Bool bAscending ) if ( !mbIsFirstResort ) { - ULONG nPos = GetEntryPos( aEntryURL ); + sal_uLong nPos = GetEntryPos( aEntryURL ); if ( nPos < mpView->GetEntryCount() ) { pEntry = mpView->GetEntry( nPos ); @@ -2569,7 +2569,7 @@ sal_Bool CompareSortingData_Impl( SortingData_Impl* const aOne, SortingData_Impl } } - // when the two elements are equal, we must not return TRUE (which would + // when the two elements are equal, we must not return sal_True (which would // happen if we just return ! ( a < b ) when not sorting ascending ) if ( bEqual ) return sal_False; @@ -2659,7 +2659,7 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r ::svtools::VolumeInfo aVolInfo; pData->maType = SvFileInformationManager::GetFolderDescription( aVolInfo ); - pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE, isHighContrast( mpView ) ); + pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False, isHighContrast( mpView ) ); OUString aValue; OUString aTab = OUString::createFromAscii( "\t" ); @@ -2688,12 +2688,12 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r } // ----------------------------------------------------------------------- -ULONG SvtFileView_Impl::GetEntryPos( const OUString& rURL ) +sal_uLong SvtFileView_Impl::GetEntryPos( const OUString& rURL ) { ::osl::MutexGuard aGuard( maMutex ); std::vector< SortingData_Impl* >::iterator aIt; - ULONG nPos = 0; + sal_uLong nPos = 0; for ( aIt = maContent.begin(); aIt != maContent.end(); aIt++ ) { diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 6b0f2cdccdd8..a54d578593cd 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -59,7 +59,7 @@ class IcnGridMap_Impl; #define F_VER_SBARSIZE_WITH_HBAR 0x0001 #define F_HOR_SBARSIZE_WITH_VBAR 0x0002 -#define F_PAINTED 0x0004 // TRUE nach erstem Paint +#define F_PAINTED 0x0004 // sal_True nach erstem Paint #define F_ADD_MODE 0x0008 #define F_SELECTING_RECT 0x0020 #define F_DOWN_CTRL 0x0080 @@ -108,11 +108,11 @@ enum IcnViewFieldType // struct LocalFocus { - BOOL bOn; + sal_Bool bOn; Rectangle aRect; Color aPenColor; - LocalFocus() { bOn = FALSE; } + LocalFocus() { bOn = sal_False; } }; /////////////////////////////////////////////////////////////////////////////// @@ -132,18 +132,18 @@ private: public: EntryList_Impl( SvxIconChoiceCtrl_Impl*, - USHORT _nInitSize = 1024, - USHORT _nReSize = 1024 ); + sal_uInt16 _nInitSize = 1024, + sal_uInt16 _nReSize = 1024 ); EntryList_Impl( SvxIconChoiceCtrl_Impl*, - USHORT _nBlockSize, - USHORT _nInitSize, - USHORT _nReSize ); + sal_uInt16 _nBlockSize, + sal_uInt16 _nInitSize, + sal_uInt16 _nReSize ); ~EntryList_Impl(); void Clear(); - void Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos ); - SvxIconChoiceCtrlEntry* Remove( ULONG nPos ); + void Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos ); + SvxIconChoiceCtrlEntry* Remove( sal_uLong nPos ); void Remove( SvxIconChoiceCtrlEntry* pEntry ); }; @@ -158,7 +158,7 @@ class SvxIconChoiceCtrl_Impl friend class EntryList_Impl; friend class IcnGridMap_Impl; - BOOL bChooseWithCursor; + sal_Bool bChooseWithCursor; EntryList_Impl aEntries; ScrollBar aVerSBar; ScrollBar aHorSBar; @@ -188,12 +188,12 @@ class SvxIconChoiceCtrl_Impl IcnViewEdit_Impl* pEdit; WinBits nWinBits; long nMaxBoundHeight; // Hoehe des hoechsten BoundRects - USHORT nFlags; - USHORT nCurTextDrawFlags; - ULONG nUserEventAdjustScrBars; - ULONG nUserEventShowCursor; + sal_uInt16 nFlags; + sal_uInt16 nCurTextDrawFlags; + sal_uLong nUserEventAdjustScrBars; + sal_uLong nUserEventShowCursor; SvxIconChoiceCtrlEntry* pCurHighlightFrame; - BOOL bHighlightFramePressed; + sal_Bool bHighlightFramePressed; SvxIconChoiceCtrlEntry* pHead; // Eintrag oben links SvxIconChoiceCtrlEntry* pCursor; SvxIconChoiceCtrlEntry* pPrevDropTarget; @@ -211,16 +211,16 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlEntry* pCurEditedEntry; SvxIconChoiceCtrlTextMode eTextMode; SelectionMode eSelectionMode; - ULONG nSelectionCount; + sal_uLong nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; - BOOL bBoundRectsDirty; - BOOL bUpdateMode; - BOOL bEntryEditingEnabled; - BOOL bInDragDrop; + sal_Bool bBoundRectsDirty; + sal_Bool bUpdateMode; + sal_Bool bEntryEditingEnabled; + sal_Bool bInDragDrop; - void ShowCursor( BOOL bShow ); + void ShowCursor( sal_Bool bShow ); - void ImpArrange( BOOL bKeepPredecessors = FALSE ); + void ImpArrange( sal_Bool bKeepPredecessors = sal_False ); void AdjustVirtSize( const Rectangle& ); void ResetVirtSize(); void CheckScrollBars(); @@ -235,16 +235,16 @@ class SvxIconChoiceCtrl_Impl DECL_LINK( VisRectChangedHdl, void* ); DECL_LINK( CallSelectHdlHdl, void* ); - void AdjustScrollBars( BOOL bVirtSizeGrowedOnly = FALSE); + void AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False); void PositionScrollBars( long nRealWidth, long nRealHeight ); long GetScrollBarPageSize( long nVisibleRange ) const { return ((nVisibleRange*75)/100); } long GetScrollBarLineSize() const { return nMaxBoundHeight / 2; } - BOOL HandleScrollCommand( const CommandEvent& rCmd ); + sal_Bool HandleScrollCommand( const CommandEvent& rCmd ); void ToDocPos( Point& rPosPixel ) { rPosPixel -= pView->GetMapMode().GetOrigin(); } void InitScrollBarBox(); SvxIconChoiceCtrlEntry* FindNewCursor(); void ToggleSelection( SvxIconChoiceCtrlEntry* ); - void DeselectAllBut( SvxIconChoiceCtrlEntry*, BOOL bPaintSync=FALSE ); + void DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False ); void Center( SvxIconChoiceCtrlEntry* pEntry ) const; void StopEditTimer() { aEditTimer.Stop(); } void StartEditTimer() { aEditTimer.Start(); } @@ -253,13 +253,13 @@ class SvxIconChoiceCtrl_Impl void SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, - BOOL bAdd = TRUE, + sal_Bool bAdd = sal_True, SvPtrarr* pOtherRects = 0 ); void SelectRange( SvxIconChoiceCtrlEntry* pStart, SvxIconChoiceCtrlEntry* pEnd, - BOOL bAdd = TRUE ); + sal_Bool bAdd = sal_True ); void AddSelectedRect( const Rectangle& ); void AddSelectedRect( @@ -275,27 +275,27 @@ class SvxIconChoiceCtrl_Impl Point AdjustAtGrid( const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) const Rectangle& rBoundRect ) const; - ULONG GetPredecessorGrid( const Point& rDocPos) const; + sal_uLong GetPredecessorGrid( const Point& rDocPos) const; void InitPredecessors(); void ClearPredecessors(); - BOOL CheckVerScrollBar(); - BOOL CheckHorScrollBar(); + sal_Bool CheckVerScrollBar(); + sal_Bool CheckHorScrollBar(); void CancelUserEvents(); - void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect, - BOOL bSyncPaint ); + void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, + sal_Bool bSyncPaint ); void SaveSelection( List** ); - void RepaintEntries( USHORT nEntryFlagsMask ); + void RepaintEntries( sal_uInt16 nEntryFlagsMask ); void SetListPositions(); void SetDefaultTextSize(); - BOOL IsAutoArrange() const { - return (BOOL)(ePositionMode == IcnViewPositionModeAutoArrange); } - BOOL IsAutoAdjust() const { - return (BOOL)(ePositionMode == IcnViewPositionModeAutoAdjust); } + sal_Bool IsAutoArrange() const { + return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); } + sal_Bool IsAutoAdjust() const { + return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); } void DocRectChanged() { aDocRectChangedTimer.Start(); } void VisRectChanged() { aVisRectChangedTimer.Start(); } - void SetOrigin( const Point&, BOOL bDoNotUpdateWallpaper = FALSE ); + void SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False ); DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* ); @@ -303,7 +303,7 @@ class SvxIconChoiceCtrl_Impl void HideFocus (); void DrawFocusRect ( OutputDevice* pOut ); - BOOL IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const; + sal_Bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const; public: @@ -315,52 +315,52 @@ public: SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle ); ~SvxIconChoiceCtrl_Impl(); - BOOL SetChoiceWithCursor ( BOOL bDo = TRUE ) { BOOL bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; } - void Clear( BOOL bInCtor = FALSE ); + sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True ) { sal_Bool bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; } + void Clear( sal_Bool bInCtor = sal_False ); void SetStyle( WinBits nWinStyle ); WinBits GetStyle() const { return nWinBits; } - void InsertEntry( SvxIconChoiceCtrlEntry*, ULONG nPos, const Point* pPos=0 ); + void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 ); void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL ); void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ); void FontModified(); - void SelectAll( BOOL bSelect = TRUE, BOOL bPaint = TRUE ); + void SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True ); void SelectEntry( SvxIconChoiceCtrlEntry*, - BOOL bSelect, - BOOL bCallHdl = TRUE, - BOOL bAddToSelection = FALSE, - BOOL bSyncPaint = FALSE ); + sal_Bool bSelect, + sal_Bool bCallHdl = sal_True, + sal_Bool bAddToSelection = sal_False, + sal_Bool bSyncPaint = sal_False ); void Paint( const Rectangle& rRect ); - BOOL MouseButtonDown( const MouseEvent& ); - BOOL MouseButtonUp( const MouseEvent& ); - BOOL MouseMove( const MouseEvent&); - BOOL RequestHelp( const HelpEvent& rHEvt ); + sal_Bool MouseButtonDown( const MouseEvent& ); + sal_Bool MouseButtonUp( const MouseEvent& ); + sal_Bool MouseMove( const MouseEvent&); + sal_Bool RequestHelp( const HelpEvent& rHEvt ); void SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, SvxIconChoiceCtrlEntry* pNewCursor, - BOOL bMod1, - BOOL bShift, - BOOL bPaintSync = FALSE); - BOOL KeyInput( const KeyEvent& ); + sal_Bool bMod1, + sal_Bool bShift, + sal_Bool bPaintSync = sal_False); + sal_Bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); void LoseFocus(); - void SetUpdateMode( BOOL bUpdate ); - BOOL GetUpdateMode() const { return bUpdateMode; } - void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted=FALSE ); + void SetUpdateMode( sal_Bool bUpdate ); + sal_Bool GetUpdateMode() const { return bUpdateMode; } + void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted=sal_False ); void PaintEntry( SvxIconChoiceCtrlEntry*, const Point&, OutputDevice* pOut = 0, - BOOL bIsBackgroundPainted = FALSE); + sal_Bool bIsBackgroundPainted = sal_False); void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* ); void SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, - BOOL bAdjustRow = FALSE, - BOOL bCheckScrollBars = FALSE, - BOOL bKeepGridMap = FALSE ); + sal_Bool bAdjustRow = sal_False, + sal_Bool bCheckScrollBars = sal_False, + sal_Bool bKeepGridMap = sal_False ); void InvalidateEntry( SvxIconChoiceCtrlEntry* ); IcnViewFieldType GetItem( SvxIconChoiceCtrlEntry*, const Point& rAbsPos ); @@ -370,25 +370,25 @@ public: SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; } void SetCursor( SvxIconChoiceCtrlEntry*, - // TRUE == bei Single-Selection die Sel. mitfuehren - BOOL bSyncSingleSelection = TRUE, - BOOL bShowFocusAsync = FALSE ); + // sal_True == bei Single-Selection die Sel. mitfuehren + sal_Bool bSyncSingleSelection = sal_True, + sal_Bool bShowFocusAsync = sal_False ); - SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, BOOL bHit = FALSE ); + SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False ); SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); Point GetEntryPos( SvxIconChoiceCtrlEntry* ); - void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound = TRUE ); + void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True ); - void Arrange(BOOL bKeepPredecessors = FALSE, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 ); + void Arrange(sal_Bool bKeepPredecessors = sal_False, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 ); Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* ); Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 ); Rectangle CalcTextRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0, - BOOL bForInplaceEdit = FALSE, + sal_Bool bForInplaceEdit = sal_False, const String* pStr = 0 ); long CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const; @@ -405,44 +405,44 @@ public: void RecalcAllBoundingRectsSmart(); const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* ); void InvalidateBoundingRect( SvxIconChoiceCtrlEntry* ); - void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = TRUE; } - BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } + void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; } + sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); } void PaintEmphasis( const Rectangle& rRect1, const Rectangle& rRect2, - BOOL bSelected, - BOOL bDropTarget, - BOOL bCursored, + sal_Bool bSelected, + sal_Bool bDropTarget, + sal_Bool bCursored, OutputDevice* pOut, - BOOL bIsBackgroundPainted = FALSE); + sal_Bool bIsBackgroundPainted = sal_False); void PaintItem( const Rectangle& rRect, IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, - USHORT nPaintFlags, + sal_uInt16 nPaintFlags, OutputDevice* pOut, const String* pStr = 0, ::vcl::ControlLayoutData* _pLayoutData = NULL ); - // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE + // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); } // berechnet alle invalidierten BoundingRects neu void UpdateBoundingRects(); - void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, BOOL bShow ); + void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow ); void PrepareCommandEvent( const CommandEvent& ); void Command( const CommandEvent& rCEvt ); void ToTop( SvxIconChoiceCtrlEntry* ); - ULONG GetSelectionCount() const; + sal_uLong GetSelectionCount() const; void SetGrid( const Size& ); Size GetMinGrid() const; - ULONG GetGridCount( + sal_uLong GetGridCount( const Size& rSize, - BOOL bCheckScrBars, - BOOL bSmartScrBar ) const; - void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); + sal_Bool bCheckScrBars, + sal_Bool bSmartScrBar ) const; + void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False ); const Size& GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const; void HideDDIcon(); @@ -451,67 +451,67 @@ public: SvxIconChoiceCtrlEntry* pRefEntry, const Point& rPos ); - BOOL IsOver( + sal_Bool IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; void SelectRect( const Rectangle&, - BOOL bAdd = TRUE, + sal_Bool bAdd = sal_True, SvPtrarr* pOtherRects = 0 ); void CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY, - BOOL bDragDrop = FALSE, - USHORT nBorderWidth = 10 ); + sal_Bool bDragDrop = sal_False, + sal_uInt16 nBorderWidth = 10 ); - BOOL IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ); + sal_Bool IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ); void MakeVisible( const Rectangle& rDocPos, - BOOL bInScrollBarEvent=FALSE, - BOOL bCallRectChangedHdl = TRUE ); + sal_Bool bInScrollBarEvent=sal_False, + sal_Bool bCallRectChangedHdl = sal_True ); void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 ); void SetEntryTextMode( SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry* pEntry = 0 ); SvxIconChoiceCtrlTextMode GetTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const; void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry ); - void EnableEntryEditing( BOOL bEnable ) { bEntryEditingEnabled = bEnable; } - BOOL IsEntryEditingEnabled() const { return bEntryEditingEnabled; } - BOOL IsEntryEditing() const { return (BOOL)(pCurEditedEntry!=0); } + void EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; } + sal_Bool IsEntryEditingEnabled() const { return bEntryEditingEnabled; } + sal_Bool IsEntryEditing() const { return (sal_Bool)(pCurEditedEntry!=0); } void EditEntry( SvxIconChoiceCtrlEntry* pEntry ); - void StopEntryEditing( BOOL bCancel ); - void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock ); - ULONG GetEntryCount() const { return aEntries.Count(); } - SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); } - SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( ULONG& ) const; - SvxIconChoiceCtrlEntry* GetNextSelectedEntry( ULONG& ) const; + void StopEntryEditing( sal_Bool bCancel ); + void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock ); + sal_uLong GetEntryCount() const { return aEntries.Count(); } + SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); } + SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( sal_uLong& ) const; + SvxIconChoiceCtrlEntry* GetNextSelectedEntry( sal_uLong& ) const; SvxIconChoiceCtrlEntry* GetHdlEntry() const { return pHdlEntry; } void SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; } SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const; void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; } SelectionMode GetSelectionMode() const { return eSelectionMode; } - BOOL AreEntriesMoved() const { return (BOOL)((nFlags & F_MOVED_ENTRIES)!=0); } - void SetEntriesMoved( BOOL bMoved ) + sal_Bool AreEntriesMoved() const { return (sal_Bool)((nFlags & F_MOVED_ENTRIES)!=0); } + void SetEntriesMoved( sal_Bool bMoved ) { if( bMoved ) nFlags |= F_MOVED_ENTRIES; else nFlags &= ~(F_MOVED_ENTRIES); } - ULONG GetEntryListPos( SvxIconChoiceCtrlEntry* ) const; - void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, ULONG nNewPos ); + sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* ) const; + void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nNewPos ); void SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; } - void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nFlags ); - SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight ); - SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown ); + void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags ); + SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); + SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); void InitSettings(); Rectangle GetOutputRect() const; - BOOL ArePredecessorsSet() const { return (BOOL)(pHead != 0); } + sal_Bool ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); } SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; } void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor); - BOOL GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor); + sal_Bool GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor); // liefert gueltige Ergebnisse nur im AutoArrange-Modus! SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& ); @@ -519,24 +519,24 @@ public: SvxIconChoiceCtrlPositionMode GetPositionMode() const { return ePositionMode;} void Flush(); - void SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& ); - const SvxIconChoiceCtrlColumnInfo* GetColumn( USHORT nIndex ) const; - const SvxIconChoiceCtrlColumnInfo* GetItemColumn( USHORT nSubItem, long& rLeft ) const; + void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& ); + const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const; + const SvxIconChoiceCtrlColumnInfo* GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const; Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); } Rectangle GetVisibleRect() const { return GetOutputRect(); } - void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,BOOL bKeepHighlightFlags=FALSE ); + void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,sal_Bool bKeepHighlightFlags=sal_False ); void HideEntryHighlightFrame(); void DrawHighlightFrame( OutputDevice* pOut, - const Rectangle& rBmpRect, BOOL bHide ); + const Rectangle& rBmpRect, sal_Bool bHide ); void StopSelectTimer() { aCallSelectHdlTimer.Stop(); } void Tracking( const TrackingEvent& rTEvt ); Point GetPopupMenuPosPixel() const; - BOOL HandleShortCutKey( const KeyEvent& rKeyEvent ); + sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent ); - void CallEventListeners( ULONG nEvent, void* pData = NULL ); + void CallEventListeners( sal_uLong nEvent, void* pData = NULL ); inline ::svt::IAccessibleFactory& GetAccessibleFactory() { return aAccFactory.getFactory(); } @@ -558,12 +558,12 @@ class IcnCursor_Impl void ImplCreate(); void Create() { if( !pColumns ) ImplCreate(); } - USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); - SvxIconChoiceCtrlEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref, - BOOL bDown, BOOL bSimple ); + sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); + SvxIconChoiceCtrlEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref, + sal_Bool bDown, sal_Bool bSimple ); - SvxIconChoiceCtrlEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref, - BOOL bRight, BOOL bSimple ); + SvxIconChoiceCtrlEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref, + sal_Bool bRight, sal_Bool bSimple ); public: IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner ); @@ -571,9 +571,9 @@ public: void Clear(); // fuer Cursortravelling usw. - SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight ); - SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown ); - SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown ); + SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); + SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); + SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left() // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann @@ -585,7 +585,7 @@ public: // ---------------------------------------------------------------------------------------------- -typedef ULONG GridId; +typedef sal_uLong GridId; #define GRID_NOT_FOUND ((GridId)ULONG_MAX) @@ -593,14 +593,14 @@ class IcnGridMap_Impl { Rectangle _aLastOccupiedGrid; SvxIconChoiceCtrl_Impl* _pView; - BOOL* _pGridMap; - USHORT _nGridCols, _nGridRows; + sal_Bool* _pGridMap; + sal_uInt16 _nGridCols, _nGridRows; void Expand(); void Create_Impl(); void Create() { if(!_pGridMap) Create_Impl(); } - void GetMinMapSize( USHORT& rDX, USHORT& rDY ) const; + void GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const; public: IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView); @@ -608,22 +608,22 @@ public: void Clear(); - GridId GetGrid( const Point& rDocPos, BOOL* pbClipped = 0 ); - GridId GetGrid( USHORT nGridX, USHORT nGridY ); - GridId GetUnoccupiedGrid( BOOL bOccupyFound=TRUE ); + GridId GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 ); + GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ); + GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True ); - void OccupyGrids( const Rectangle&, BOOL bOccupy = TRUE ); - void OccupyGrids( const SvxIconChoiceCtrlEntry*, BOOL bOccupy = TRUE ); - void OccupyGrid( GridId nId, BOOL bOccupy = TRUE ) + void OccupyGrids( const Rectangle&, sal_Bool bOccupy = sal_True ); + void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True ); + void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True ) { - DBG_ASSERT(!_pGridMap || nId<(ULONG)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId"); - if(_pGridMap && nId < (ULONG)(_nGridCols *_nGridRows) ) + DBG_ASSERT(!_pGridMap || nId<(sal_uLong)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId"); + if(_pGridMap && nId < (sal_uLong)(_nGridCols *_nGridRows) ) _pGridMap[ nId ] = bOccupy; } Rectangle GetGridRect( GridId ); - void GetGridCoord( GridId, USHORT& rGridX, USHORT& rGridY ); - static ULONG GetGridCount( const Size& rSizePixel, USHORT nGridWidth, USHORT nGridHeight ); + void GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY ); + static sal_uLong GetGridCount( const Size& rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight ); void OutputSizeChanged(); }; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index ff7c42e9309a..3963ce48c255 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -68,7 +68,7 @@ struct SvxIconChoiceCtrlEntry_Impl : _pEntry( pEntry), _aPos( rBoundRect.TopLeft()) {} }; -static BOOL bEndScrollInvalidate = TRUE; +static sal_Bool bEndScrollInvalidate = sal_True; // ---------------------------------------------------------------------------------------------- @@ -78,9 +78,9 @@ class IcnViewEdit_Impl : public MultiLineEdit Accelerator aAccReturn; Accelerator aAccEscape; Timer aTimer; - BOOL bCanceled; - BOOL bAlreadyInCallback; - BOOL bGrabFocus; + sal_Bool bCanceled; + sal_Bool bAlreadyInCallback; + sal_Bool bGrabFocus; void CallCallBackHdl_Impl(); DECL_LINK( Timeout_Impl, Timer * ); @@ -99,9 +99,9 @@ public: ~IcnViewEdit_Impl(); virtual void KeyInput( const KeyEvent& rKEvt ); virtual long PreNotify( NotifyEvent& rNEvt ); - BOOL EditingCanceled() const { return bCanceled; } - void StopEditing( BOOL bCancel = FALSE ); - BOOL IsGrabFocus() const { return bGrabFocus; } + sal_Bool EditingCanceled() const { return bCanceled; } + void StopEditing( sal_Bool bCancel = sal_False ); + sal_Bool IsGrabFocus() const { return bGrabFocus; } }; // ---------------------------------------------------------------------------------------------- @@ -117,7 +117,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, aImageSize( 32, 32 ), pColumns( 0 ) { - bChooseWithCursor=FALSE; + bChooseWithCursor=sal_False; pEntryPaintDev = 0; pCurEditedEntry = 0; pCurHighlightFrame = 0; @@ -128,10 +128,10 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, pHdlEntry = 0; pHead = NULL; pCursor = NULL; - bUpdateMode = TRUE; - bEntryEditingEnabled = FALSE; - bInDragDrop = FALSE; - bHighlightFramePressed = FALSE; + bUpdateMode = sal_True; + bEntryEditingEnabled = sal_False; + bInDragDrop = sal_False; + bHighlightFramePressed = sal_False; eSelectionMode = MULTIPLE_SELECTION; pView = pCurView; pZOrderList = new List; //SvPtrarr; @@ -171,7 +171,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, aVisRectChangedTimer.SetTimeout( 50 ); aVisRectChangedTimer.SetTimeoutHdl(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl)); - Clear( TRUE ); + Clear( sal_True ); SetGrid( Size(100, 70) ); } @@ -195,17 +195,17 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() ClearColumnList(); } -void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor ) +void SvxIconChoiceCtrl_Impl::Clear( sal_Bool bInCtor ) { - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); nSelectionCount = 0; DELETEZ(pDraggedSelection); - bInDragDrop = FALSE; + bInDragDrop = sal_False; pCurHighlightFrame = 0; StopEditTimer(); CancelUserEvents(); - ShowCursor( FALSE ); - bBoundRectsDirty = FALSE; + ShowCursor( sal_False ); + bBoundRectsDirty = sal_False; nMaxBoundHeight = 0; nFlags &= ~(F_PAINTED | F_MOVED_ENTRIES); @@ -229,8 +229,8 @@ void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor ) pView->Invalidate(INVALIDATE_NOCHILDREN); } AdjustScrollBars(); - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); delete pCur; @@ -259,19 +259,19 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle ) IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar ) { - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); // Pfeil hoch: delta=-1; Pfeil runter: delta=+1 - Scroll( 0, pScrollBar->GetDelta(), TRUE ); - bEndScrollInvalidate = TRUE; + Scroll( 0, pScrollBar->GetDelta(), sal_True ); + bEndScrollInvalidate = sal_True; return 0; } IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar ) { - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); // Pfeil links: delta=-1; Pfeil rechts: delta=+1 - Scroll( pScrollBar->GetDelta(), 0, TRUE ); - bEndScrollInvalidate = TRUE; + Scroll( pScrollBar->GetDelta(), 0, sal_True ); + bEndScrollInvalidate = sal_True; return 0; } @@ -293,11 +293,11 @@ void SvxIconChoiceCtrl_Impl::FontModified() DELETEZ(pDDTempDev); DELETEZ(pEntryPaintDev); SetDefaultTextSize(); - ShowCursor( FALSE ); - ShowCursor( TRUE ); + ShowCursor( sal_False ); + ShowCursor( sal_True ); } -void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos, +void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos, const Point* pPos ) { StopEditTimer(); @@ -314,13 +314,13 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG { Size aSize( CalcBoundingSize( pEntry ) ); SetBoundingRect_Impl( pEntry, *pPos, aSize ); - SetEntryPos( pEntry, *pPos, FALSE, TRUE, TRUE /*keep grid map*/ ); + SetEntryPos( pEntry, *pPos, sal_False, sal_True, sal_True /*keep grid map*/ ); pEntry->nFlags |= ICNVIEW_FLAG_POS_MOVED; - SetEntriesMoved( TRUE ); + SetEntriesMoved( sal_True ); } else { - // wenn der UpdateMode TRUE ist, wollen wir nicht pauschal alle + // wenn der UpdateMode sal_True ist, wollen wir nicht pauschal alle // BoundRects auf 'zu ueberpruefen' setzen, sondern nur das des // neuen Eintrags. Deshalb kein InvalidateBoundingRect aufrufen! pEntry->aRect.Right() = LONG_MAX; @@ -347,8 +347,8 @@ void SvxIconChoiceCtrl_Impl::CreateAutoMnemonics( MnemonicGenerator* _pGenerator pAutoDeleteOwnGenerator.reset( _pGenerator ); } - ULONG nEntryCount = GetEntryCount(); - ULONG i; + sal_uLong nEntryCount = GetEntryCount(); + sal_uLong i; // insert texts in generator for( i = 0; i < nEntryCount; ++i ) @@ -381,8 +381,8 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() if( nFlags & F_ENTRYLISTPOS_VALID ) return; - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); pEntry->nPos = nCur; @@ -392,14 +392,14 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) { - BOOL bSyncSingleSelection; + sal_Bool bSyncSingleSelection; // bei Single-Selection wird die Selektion beim Umsetzen des Cursors // mitgefuehrt. Das soll aber nur erfolgen, wenn ueberhaupt ein // Eintrag selektiert ist. if( GetSelectionCount() ) - bSyncSingleSelection = TRUE; + bSyncSingleSelection = sal_True; else - bSyncSingleSelection = FALSE; + bSyncSingleSelection = sal_False; if( pEntry == pCurHighlightFrame ) pCurHighlightFrame = 0; @@ -407,7 +407,7 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) if( bInDragDrop ) { DELETEZ(pDraggedSelection); - bInDragDrop = FALSE; + bInDragDrop = sal_False; } if( pEntry->IsSelected() ) @@ -424,25 +424,25 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) pAnchor = 0; if( pEntry->IsSelected() ) nSelectionCount--; - BOOL bEntryBoundValid = IsBoundingRectValid( pEntry->aRect ); + sal_Bool bEntryBoundValid = IsBoundingRectValid( pEntry->aRect ); if( bEntryBoundValid ) pView->Invalidate( pEntry->aRect ); - BOOL bSetNewCursor = FALSE; + sal_Bool bSetNewCursor = sal_False; SvxIconChoiceCtrlEntry* pNewCursor = NULL; if( pEntry == pCursor ) { - bSetNewCursor = TRUE; + bSetNewCursor = sal_True; pNewCursor = FindNewCursor(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pCursor = 0; } - BOOL bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? TRUE : FALSE; + sal_Bool bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? sal_True : sal_False; if( bCurEntryPosValid && aEntries.GetObject(aEntries.Count()-1) != pEntry ) nFlags &= ~F_ENTRYLISTPOS_VALID; - ULONG nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos ); if( bCurEntryPosValid ) { @@ -460,12 +460,12 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) { // Fokusrechteck asynchron einblenden, um das Loeschen einer // Multiselektion zu beschleunigen. - SetCursor( pNewCursor, bSyncSingleSelection, TRUE ); + SetCursor( pNewCursor, bSyncSingleSelection, sal_True ); } } -void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect, - BOOL bCallHdl, BOOL bAdd, BOOL bSyncPaint ) +void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, + sal_Bool bCallHdl, sal_Bool bAdd, sal_Bool bSyncPaint ) { if( eSelectionMode == NO_SELECTION ) return; @@ -482,7 +482,7 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b if( pEntry->IsSelected() != bSelect ) { pHdlEntry = pEntry; - USHORT nEntryFlags = pEntry->GetFlags(); + sal_uInt16 nEntryFlags = pEntry->GetFlags(); if( bSelect ) { nEntryFlags |= ICNVIEW_FLAG_SELECTED; @@ -503,8 +503,8 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b } } -void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect, - BOOL bSyncPaint ) +void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, + sal_Bool bSyncPaint ) { // bei SingleSelection dafuer sorgen, dass der Cursor immer // auf dem (einzigen) selektierten Eintrag steht. Aber nur, @@ -524,7 +524,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL if( bUpdateMode ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( pView->IsTracking() && (bSelect || !pView->HasBackground()) ) // beim Tracken immer synchron PaintEntry( pEntry ); else if( bSyncPaint ) // synchron & mit virtuellem OutDev! @@ -534,7 +534,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL pView->Invalidate( CalcFocusRect( pEntry ) ); } if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } // if( bUpdateMode ) // --> OD 2009-05-27 #i101012# @@ -551,9 +551,9 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() StopEditTimer(); aVirtOutputSize.Width() = 0; aVirtOutputSize.Height() = 0; - BOOL bLockedEntryFound = FALSE; - const ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_Bool bLockedEntryFound = sal_False; + const sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); pCur->ClearFlags( ICNVIEW_FLAG_POS_MOVED ); @@ -564,7 +564,7 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() FindBoundingRect( pCur ); else AdjustVirtSize( pCur->aRect ); - bLockedEntryFound = TRUE; + bLockedEntryFound = sal_True; } else InvalidateBoundingRect( pCur->aRect ); @@ -576,8 +576,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() if( aVirtOutputSize.Width() < aRealOutputSize.Width() || aVirtOutputSize.Height() < aRealOutputSize.Height() ) { - ULONG nGridCount = IcnGridMap_Impl::GetGridCount( - aRealOutputSize, (USHORT)nGridDX, (USHORT)nGridDY ); + sal_uLong nGridCount = IcnGridMap_Impl::GetGridCount( + aRealOutputSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY ); if( nGridCount < nCount ) { if( nWinBits & WB_ALIGN_TOP ) @@ -625,11 +625,11 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const Rectangle& rRect ) void SvxIconChoiceCtrl_Impl::InitPredecessors() { DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized"); - ULONG nCount = aEntries.Count(); + sal_uLong nCount = aEntries.Count(); if( nCount ) { SvxIconChoiceCtrlEntry* pPrev = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); - for( ULONG nCur = 1; nCur <= nCount; nCur++ ) + for( sal_uLong nCur = 1; nCur <= nCount; nCur++ ) { pPrev->ClearFlags( ICNVIEW_FLAG_POS_LOCKED | ICNVIEW_FLAG_POS_MOVED | ICNVIEW_FLAG_PRED_SET); @@ -654,8 +654,8 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors() { if( pHead ) { - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); pCur->pflink = 0; @@ -666,7 +666,7 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors() } } -void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight ) +void SvxIconChoiceCtrl_Impl::Arrange( sal_Bool bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight ) { if ( nSetMaxVirtWidth != 0 ) nMaxVirtWidth = nSetMaxVirtWidth; @@ -681,23 +681,23 @@ void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWi ImpArrange( bKeepPredecessors ); } -void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors ) +void SvxIconChoiceCtrl_Impl::ImpArrange( sal_Bool bKeepPredecessors ) { static Point aEmptyPoint; - BOOL bOldUpdate = bUpdateMode; + sal_Bool bOldUpdate = bUpdateMode; Rectangle aCurOutputArea( GetOutputRect() ); if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint ) - bUpdateMode = FALSE; + bUpdateMode = sal_False; aAutoArrangeTimer.Stop(); nFlags &= ~F_MOVED_ENTRIES; nFlags |= F_ARRANGING; StopEditTimer(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); ResetVirtSize(); if( !bKeepPredecessors ) ClearPredecessors(); - bBoundRectsDirty = FALSE; + bBoundRectsDirty = sal_False; SetOrigin( Point() ); VisRectChanged(); RecalcAllBoundingRectsSmart(); @@ -710,12 +710,12 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors ) MakeVisible( aCurOutputArea ); SetUpdateMode( bOldUpdate ); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) { - bEndScrollInvalidate = FALSE; + bEndScrollInvalidate = sal_False; #if defined(OV_DRAWGRID) Color aOldColor ( pView->GetLineColor() ); @@ -764,14 +764,14 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) if( !pCursor ) { // set cursor to item with focus-flag - BOOL bfound = FALSE; - for ( ULONG i = 0; i < pView->GetEntryCount() && !bfound; i++) + sal_Bool bfound = sal_False; + for ( sal_uLong i = 0; i < pView->GetEntryCount() && !bfound; i++) { SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry ( i ); if( pEntry->IsFocused() ) { pCursor = pEntry; - bfound=TRUE; + bfound=sal_True; } } @@ -783,31 +783,31 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) if ( pView->HasFocus() ) GetFocus(); - ULONG nCount = pZOrderList->Count(); + sal_uLong nCount = pZOrderList->Count(); if( !nCount ) return; - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() ) { Rectangle aOutputArea( GetOutputRect() ); - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; pView->SetClipRegion( aOutputArea ); } - const USHORT nListInitSize = aEntries.Count() > USHRT_MAX ? - USHRT_MAX : (USHORT)aEntries.Count(); + const sal_uInt16 nListInitSize = aEntries.Count() > USHRT_MAX ? + USHRT_MAX : (sal_uInt16)aEntries.Count(); List* pNewZOrderList = new List( nListInitSize ); List* pPaintedEntries = new List( nListInitSize ); - ULONG nPos = 0; + sal_uLong nPos = 0; while( nCount ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos )); const Rectangle& rBoundRect = GetEntryBoundRect( pEntry ); if( rRect.IsOver( rBoundRect ) ) { - PaintEntry( pEntry, rBoundRect.TopLeft(), pView, TRUE ); + PaintEntry( pEntry, rBoundRect.TopLeft(), pView, sal_True ); // Eintraege, die neu gezeichnet werden, auf Top setzen pPaintedEntries->Insert( pEntry, LIST_APPEND ); } @@ -822,7 +822,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) nCount = pPaintedEntries->Count(); if( nCount ) { - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) pZOrderList->Insert( pPaintedEntries->GetObject(nCur), LIST_APPEND); } delete pPaintedEntries; @@ -831,20 +831,20 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) pView->SetClipRegion(); } -void SvxIconChoiceCtrl_Impl::RepaintEntries( USHORT nEntryFlagsMask ) +void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask ) { - const ULONG nCount = pZOrderList->Count(); + const sal_uLong nCount = pZOrderList->Count(); if( !nCount ) return; - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; Rectangle aOutRect( GetOutputRect() ); if( !pView->IsClipRegion() ) { - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; pView->SetClipRegion( aOutRect ); } - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur)); if( pEntry->GetFlags() & nEntryFlagsMask ) @@ -880,28 +880,28 @@ IcnViewFieldType SvxIconChoiceCtrl_Impl::GetItem( SvxIconChoiceCtrlEntry* pEntry return IcnViewFieldTypeDontknow; } -BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) +sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { - BOOL bHandled = TRUE; - bHighlightFramePressed = FALSE; + sal_Bool bHandled = sal_True; + bHighlightFramePressed = sal_False; StopEditTimer(); - BOOL bGotFocus = (BOOL)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS)); + sal_Bool bGotFocus = (sal_Bool)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS)); if( !(nWinBits & WB_NOPOINTERFOCUS) ) pView->GrabFocus(); Point aDocPos( rMEvt.GetPosPixel() ); if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height()) - return FALSE; + return sal_False; ToDocPos( aDocPos ); - SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE ); + SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True ); if( pEntry ) - MakeEntryVisible( pEntry, FALSE ); + MakeEntryVisible( pEntry, sal_False ); if( rMEvt.IsShift() && eSelectionMode != SINGLE_SELECTION ) { if( pEntry ) - SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), TRUE); - return TRUE; + SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), sal_True); + return sal_True; } if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // Tastaturselektion? @@ -932,7 +932,7 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( !pEntry && !(nWinBits & WB_NODRAGSELECTION)) pView->StartTracking( STARTTRACK_SCROLLREPEAT ); - return TRUE; + return sal_True; } else { @@ -954,17 +954,17 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) pView->StartTracking( STARTTRACK_SCROLLREPEAT ); } else - bHandled = FALSE; + bHandled = sal_False; return bHandled; } } - BOOL bSelected = pEntry->IsSelected(); - BOOL bEditingEnabled = IsEntryEditingEnabled(); + sal_Bool bSelected = pEntry->IsSelected(); + sal_Bool bEditingEnabled = IsEntryEditingEnabled(); if( rMEvt.GetClicks() == 2 ) { DeselectAllBut( pEntry ); - SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True ); pHdlEntry = pEntry; pView->ClickIcon(); } @@ -995,8 +995,8 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) ) { pCurHighlightFrame = 0; // Neues painten des Frames erzwingen - bHighlightFramePressed = TRUE; - SetEntryHighlightFrame( pEntry, TRUE ); + bHighlightFramePressed = sal_True; + SetEntryHighlightFrame( pEntry, sal_True ); } } else @@ -1005,9 +1005,9 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { if( !bSelected ) { - DeselectAllBut( pEntry, TRUE /* Synchron painten */ ); + DeselectAllBut( pEntry, sal_True /* Synchron painten */ ); SetCursor( pEntry ); - SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True ); } else { @@ -1027,13 +1027,13 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) return bHandled; } -BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) )) { nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); - bHandled = TRUE; + bHandled = sal_True; } Point aDocPos( rMEvt.GetPosPixel() ); @@ -1046,32 +1046,32 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) // Ctrl & MultiSelection ToggleSelection( pDocEntry ); SetCursor( pDocEntry ); - bHandled = TRUE; + bHandled = sal_True; } else if( nFlags & F_DOWN_DESELECT ) { DeselectAllBut( pDocEntry ); SetCursor( pDocEntry ); - SelectEntry( pDocEntry, TRUE, TRUE, FALSE, TRUE ); - bHandled = TRUE; + SelectEntry( pDocEntry, sal_True, sal_True, sal_False, sal_True ); + bHandled = sal_True; } } nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); if( nFlags & F_START_EDITTIMER_IN_MOUSEUP ) { - bHandled = TRUE; + bHandled = sal_True; StartEditTimer(); nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP; } if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame) { - bHandled = TRUE; + bHandled = sal_True; SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; pCurHighlightFrame = 0; // Neues painten des Frames erzwingen - bHighlightFramePressed = FALSE; - SetEntryHighlightFrame( pEntry, TRUE ); + bHighlightFramePressed = sal_False; + SetEntryHighlightFrame( pEntry, sal_True ); #if 0 CallSelectHandler( pCurHighlightFrame ); #else @@ -1080,27 +1080,27 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) // set focus on Icon SvxIconChoiceCtrlEntry* pOldCursor = pCursor; - SetCursor_Impl( pOldCursor, pHdlEntry, FALSE, FALSE, TRUE ); + SetCursor_Impl( pOldCursor, pHdlEntry, sal_False, sal_False, sal_True ); #endif pHdlEntry = 0; } return bHandled; } -BOOL SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) { const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) ); if( pView->IsTracking() ) - return FALSE; + return sal_False; else if( nWinBits & WB_HIGHLIGHTFRAME ) { - SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE ); + SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True ); SetEntryHighlightFrame( pEntry ); } else - return FALSE; - return TRUE; + return sal_False; + return sal_True; } void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) @@ -1124,7 +1124,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) long nScrollDX, nScrollDY; - CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, FALSE ); + CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, sal_False ); if( nScrollDX || nScrollDY ) { pView->HideTracking(); @@ -1134,7 +1134,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) if( aRect != aCurSelectionRect ) { pView->HideTracking(); - BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE; + sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False; SelectRect( aRect, bAdd, &aSelectedRectList ); } pView->ShowTracking( aRect, SHOWTRACK_SMALL | SHOWTRACK_CLIP ); @@ -1142,25 +1142,25 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) } void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, - SvxIconChoiceCtrlEntry* pNewCursor, BOOL bMod1, BOOL bShift, BOOL bPaintSync ) + SvxIconChoiceCtrlEntry* pNewCursor, sal_Bool bMod1, sal_Bool bShift, sal_Bool bPaintSync ) { if( pNewCursor ) { SvxIconChoiceCtrlEntry* pFilterEntry = 0; - BOOL bDeselectAll = FALSE; + sal_Bool bDeselectAll = sal_False; if( eSelectionMode != SINGLE_SELECTION ) { if( !bMod1 && !bShift ) - bDeselectAll = TRUE; + bDeselectAll = sal_True; else if( bShift && !bMod1 && !pAnchor ) { - bDeselectAll = TRUE; + bDeselectAll = sal_True; pFilterEntry = pOldCursor; } } if( bDeselectAll ) DeselectAllBut( pFilterEntry, bPaintSync ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); MakeEntryVisible( pNewCursor ); SetCursor( pNewCursor ); if( bMod1 && !bShift ) @@ -1182,58 +1182,58 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, } else { - SelectEntry( pCursor, TRUE, TRUE, FALSE, bPaintSync ); + SelectEntry( pCursor, sal_True, sal_True, sal_False, bPaintSync ); aCurSelectionRect = GetEntryBoundRect( pCursor ); } } } -BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { StopEditTimer(); - BOOL bMod2 = rKEvt.GetKeyCode().IsMod2(); + sal_Bool bMod2 = rKEvt.GetKeyCode().IsMod2(); sal_Unicode cChar = rKEvt.GetCharCode(); - ULONG nPos = (ULONG)-1; + sal_uLong nPos = (sal_uLong)-1; if ( bMod2 && cChar && IsMnemonicChar( cChar, nPos ) ) { // shortcut is clicked SvxIconChoiceCtrlEntry* pNewCursor = GetEntry( nPos ); SvxIconChoiceCtrlEntry* pOldCursor = pCursor; if ( pNewCursor != pOldCursor ) - SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE ); - return TRUE; + SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False ); + return sal_True; } if ( bMod2 ) // no actions with <ALT> - return FALSE; + return sal_False; - BOOL bKeyUsed = TRUE; - BOOL bMod1 = rKEvt.GetKeyCode().IsMod1(); - BOOL bShift = rKEvt.GetKeyCode().IsShift(); + sal_Bool bKeyUsed = sal_True; + sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1(); + sal_Bool bShift = rKEvt.GetKeyCode().IsShift(); if( eSelectionMode == SINGLE_SELECTION || eSelectionMode == NO_SELECTION) { - bShift = FALSE; - bMod1 = FALSE; + bShift = sal_False; + bMod1 = sal_False; } if( bMod1 ) nFlags |= F_ADD_MODE; - BOOL bDeselectAll = FALSE; + sal_Bool bDeselectAll = sal_False; if( eSelectionMode != SINGLE_SELECTION ) { if( !bMod1 && !bShift ) - bDeselectAll = TRUE; + bDeselectAll = sal_True; if( bShift && !bMod1 && !pAnchor ) - bDeselectAll = TRUE; + bDeselectAll = sal_True; } SvxIconChoiceCtrlEntry* pNewCursor; SvxIconChoiceCtrlEntry* pOldCursor = pCursor; - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch( nCode ) { case KEY_UP: @@ -1242,10 +1242,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { MakeEntryVisible( pCursor ); if( nCode == KEY_UP ) - pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE); + pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False); else - pNewCursor = pImpCursor->GoPageUpDown(pCursor,FALSE); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor = pImpCursor->GoPageUpDown(pCursor,sal_False); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); if( !pNewCursor ) { Rectangle aRect( GetEntryBoundRect( pCursor ) ); @@ -1272,10 +1272,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { if( nCode == KEY_DOWN ) - pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE ); + pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True ); else - pNewCursor=pImpCursor->GoPageUpDown( pCursor,TRUE ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor=pImpCursor->GoPageUpDown( pCursor,sal_True ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); if ( bChooseWithCursor && pNewCursor != NULL) { @@ -1290,8 +1290,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_RIGHT: if( pCursor ) { - pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; @@ -1299,8 +1299,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { MakeEntryVisible( pCursor ); - pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); if( !pNewCursor ) { Rectangle aRect( GetEntryBoundRect(pCursor)); @@ -1320,13 +1320,13 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pView->IsTracking() ) { HideSelectionRect(); - //SelectAll( FALSE ); + //SelectAll( sal_False ); SetNoSelection(); ClearSelectedRectList(); nFlags &= ~F_TRACKING; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; #endif @@ -1335,7 +1335,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( !bMod1 && !bShift ) EditTimeoutHdl( 0 ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_F8: @@ -1347,7 +1347,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) nFlags |= F_ADD_MODE; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SPACE: @@ -1355,12 +1355,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { if( !bMod1 ) { - //SelectAll( FALSE ); + //SelectAll( sal_False ); SetNoSelection(); ClearSelectedRectList(); // click Icon with spacebar - SetEntryHighlightFrame( GetCurEntry(), TRUE ); + SetEntryHighlightFrame( GetCurEntry(), sal_True ); pView->ClickIcon(); pHdlEntry = pCurHighlightFrame; pCurHighlightFrame=0; @@ -1389,9 +1389,9 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_DIVIDE : case KEY_A: if( bMod1 && (eSelectionMode != SINGLE_SELECTION)) - SelectAll( TRUE ); + SelectAll( sal_True ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SUBTRACT: @@ -1399,7 +1399,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( bMod1 ) SetNoSelection(); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_RETURN: @@ -1409,14 +1409,14 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) /*pView->*/EditEntry( pCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_END: if( pCursor ) { pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( aEntries.Count() - 1 ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; @@ -1424,12 +1424,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; default: - bKeyUsed = FALSE; + bKeyUsed = sal_False; } return bKeyUsed; @@ -1455,7 +1455,7 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig aVerSBar.SetPosPixel( aPos ); } -void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL ) +void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) { Rectangle aOldOutRect( GetOutputRect() ); long nVirtHeight = aVirtOutputSize.Height(); @@ -1487,7 +1487,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL ) sal_Bool bNoVerSBar = ( nWinBits & WB_NOVSCROLL ) != 0; sal_Bool bNoHorSBar = ( nWinBits & WB_NOHSCROLL ) != 0; - USHORT nResult = 0; + sal_uInt16 nResult = 0; if( nVirtHeight ) { // activate ver scrollbar ? @@ -1625,23 +1625,23 @@ void SvxIconChoiceCtrl_Impl::Resize() VisRectChanged(); } -BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar() +sal_Bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar() { if( !pZOrderList || !aHorSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); - const ULONG nCount = pZOrderList->Count(); + const sal_uLong nCount = pZOrderList->Count(); long nMostRight = 0; - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur); long nRight = GetEntryBoundRect(pEntry).Right(); if( nRight > nWidth ) - return FALSE; + return sal_False; if( nRight > nMostRight ) nMostRight = nRight; } @@ -1658,28 +1658,28 @@ BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar() aSize.Height() += nHorSBarHeight; aVerSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar() +sal_Bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() { if( !pZOrderList || !aVerSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!( nWinBits & WB_VSCROLL) && !aOrigin.Y() ) { long nDeepest = 0; long nHeight = aOutputSize.Height(); - const ULONG nCount = pZOrderList->Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + const sal_uLong nCount = pZOrderList->Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur); long nBottom = GetEntryBoundRect(pEntry).Bottom(); if( nBottom > nHeight ) - return FALSE; + return sal_False; if( nBottom > nDeepest ) nDeepest = nBottom; } @@ -1696,9 +1696,9 @@ BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar() aSize.Width() += nVerSBarWidth; aHorSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -1721,7 +1721,7 @@ void SvxIconChoiceCtrl_Impl::GetFocus() if( pCursor ) { pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -1730,7 +1730,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus() StopEditTimer(); if( pCursor ) pCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); // HideFocus (); // pView->Invalidate ( aFocus.aRect ); @@ -1738,7 +1738,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus() RepaintEntries( ICNVIEW_FLAG_SELECTED ); } -void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate ) +void SvxIconChoiceCtrl_Impl::SetUpdateMode( sal_Bool bUpdate ) { if( bUpdate != bUpdateMode ) { @@ -1753,7 +1753,7 @@ void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate ) } } -void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted ) +void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted ) { Point aPos( GetEntryPos( pEntry ) ); PaintEntry( pEntry, aPos, 0, bIsBackgroundPainted ); @@ -1762,8 +1762,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bI // Prios der Emphasis: bDropTarget => bCursored => bSelected void SvxIconChoiceCtrl_Impl::PaintEmphasis( const Rectangle& rTextRect, const Rectangle& rImageRect, - BOOL bSelected, BOOL bDropTarget, BOOL bCursored, OutputDevice* pOut, - BOOL bIsBackgroundPainted ) + sal_Bool bSelected, sal_Bool bDropTarget, sal_Bool bCursored, OutputDevice* pOut, + sal_Bool bIsBackgroundPainted ) { static Color aTransparent( COL_TRANSPARENT ); @@ -1783,14 +1783,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( const StyleSettings& rSettings = pOut->GetSettings().GetStyleSettings(); Color aOldFillColor( pOut->GetFillColor() ); - BOOL bSolidTextRect = FALSE; - BOOL bSolidImageRect = FALSE; + sal_Bool bSolidTextRect = sal_False; + sal_Bool bSolidImageRect = sal_False; if( bDropTarget && ( eSelectionMode != NO_SELECTION ) ) { pOut->SetFillColor( rSettings.GetHighlightColor() ); - bSolidTextRect = TRUE; - bSolidImageRect = TRUE; + bSolidTextRect = sal_True; + bSolidImageRect = sal_True; } else { @@ -1803,7 +1803,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( const Color& rFillColor = pView->GetFont().GetFillColor(); pOut->SetFillColor( rFillColor ); if( rFillColor != aTransparent ) - bSolidTextRect = TRUE; + bSolidTextRect = sal_True; } } } @@ -1843,14 +1843,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect, - IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, USHORT nPaintFlags, + IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut, const String* pStr, ::vcl::ControlLayoutData* _pLayoutData ) { if( eItem == IcnViewFieldTypeText ) { String aText; if( !pStr ) - aText = pView->GetEntryText( pEntry, FALSE ); + aText = pView->GetEntryText( pEntry, sal_False ); else aText = *pStr; @@ -1866,7 +1866,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect, { Color aBkgColor( pOut->GetBackground().GetColor() ); Color aFontColor; - USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; + sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; if ( nColor > 127 ) aFontColor.SetColor ( COL_BLACK ); else @@ -1944,19 +1944,19 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, - OutputDevice* pOut, BOOL bIsBackgroundPainted ) + OutputDevice* pOut, sal_Bool bIsBackgroundPainted ) { if( !pOut ) pOut = pView; - BOOL bSelected = FALSE; + sal_Bool bSelected = sal_False; if( eSelectionMode != NO_SELECTION ) bSelected = pEntry->IsSelected(); - BOOL bCursored = pEntry->IsCursored(); - BOOL bDropTarget = pEntry->IsDropTarget(); - BOOL bNoEmphasis = pEntry->IsBlockingEmphasis(); + sal_Bool bCursored = pEntry->IsCursored(); + sal_Bool bDropTarget = pEntry->IsDropTarget(); + sal_Bool bNoEmphasis = pEntry->IsBlockingEmphasis(); Font aTempFont( pOut->GetFont() ); @@ -1968,8 +1968,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P } */ - String aEntryText( pView->GetEntryText( pEntry, FALSE ) ); - Rectangle aTextRect( CalcTextRect(pEntry,&rPos,FALSE,&aEntryText)); + String aEntryText( pView->GetEntryText( pEntry, sal_False ) ); + Rectangle aTextRect( CalcTextRect(pEntry,&rPos,sal_False,&aEntryText)); Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos ) ); sal_Bool bShowSelection = @@ -2009,14 +2009,14 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P pOut->SetFillColor( ); } - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() && (aVerSBar.IsVisible() || aHorSBar.IsVisible()) ) { Rectangle aOutputArea( GetOutputRect() ); if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) ) { pView->SetClipRegion( aOutputArea ); - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; } } @@ -2032,10 +2032,10 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P #endif sal_Bool bLargeIconMode = WB_ICON == ( nWinBits & (VIEWMODE_MASK) ); - USHORT nBmpPaintFlags = PAINTFLAG_VER_CENTERED; + sal_uInt16 nBmpPaintFlags = PAINTFLAG_VER_CENTERED; if ( bLargeIconMode ) nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED; - USHORT nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED; + sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED; if( !bNoEmphasis ) PaintEmphasis(aTextRect,aBmpRect,bSelected,bDropTarget,bCursored,pOut,bIsBackgroundPainted); @@ -2051,7 +2051,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P // Highlight-Frame zeichnen if( pEntry == pCurHighlightFrame && !bNoEmphasis ) - DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), FALSE ); + DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), sal_False ); pOut->SetFont( aTempFont ); if( bResetClipRegion ) @@ -2059,15 +2059,15 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P } void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, - BOOL bAdjustAtGrid, BOOL bCheckScrollBars, BOOL bKeepGridMap ) + sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars, sal_Bool bKeepGridMap ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); Rectangle aBoundRect( GetEntryBoundRect( pEntry )); pView->Invalidate( aBoundRect ); ToTop( pEntry ); if( !IsAutoArrange() ) { - BOOL bAdjustVirtSize = FALSE; + sal_Bool bAdjustVirtSize = sal_False; if( rPos != aBoundRect.TopLeft() ) { Point aGridOffs( @@ -2078,7 +2078,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const aBoundRect.SetPos( rPos ); pEntry->aRect = aBoundRect; pEntry->aGridRect.SetPos( rPos + aGridOffs ); - bAdjustVirtSize = TRUE; + bAdjustVirtSize = sal_True; } if( bAdjustAtGrid ) { @@ -2097,7 +2097,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) ); Rectangle aNewBoundRect( aNewPos, pEntry->aRect.GetSize()); AdjustVirtSize( aNewBoundRect ); - bAdjustVirtSize = FALSE; + bAdjustVirtSize = sal_False; } AdjustEntryAtGrid( pEntry ); ToTop( pEntry ); @@ -2117,7 +2117,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const SetEntryPredecessor( pEntry, pPrev ); aAutoArrangeTimer.Start(); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvxIconChoiceCtrl_Impl::SetNoSelection() @@ -2126,16 +2126,16 @@ void SvxIconChoiceCtrl_Impl::SetNoSelection() if( !(nFlags & F_CLEARING_SELECTION )) { nFlags |= F_CLEARING_SELECTION; - DeselectAllBut( 0, TRUE ); + DeselectAllBut( 0, sal_True ); nFlags &= ~F_CLEARING_SELECTION; } } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, BOOL bHit ) +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, sal_Bool bHit ) { CheckBoundingRects(); // Z-Order-Liste vom Ende her absuchen - ULONG nCount = pZOrderList->Count(); + sal_uLong nCount = pZOrderList->Count(); while( nCount ) { nCount--; @@ -2166,11 +2166,11 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextEntry( const Point& rDocP { CheckBoundingRects(); SvxIconChoiceCtrlEntry* pTarget = 0; - const ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + const sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != LIST_ENTRY_NOTFOUND ) { - const ULONG nCount = pZOrderList->Count(); - for( ULONG nCur = nStartPos+1; nCur < nCount; nCur++ ) + const sal_uLong nCount = pZOrderList->Count(); + for( sal_uLong nCur = nStartPos+1; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur)); if( pEntry->aRect.IsInside( rDocPos ) ) @@ -2187,7 +2187,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetPrevEntry( const Point& rDocP { CheckBoundingRects(); SvxIconChoiceCtrlEntry* pTarget = 0; - ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != LIST_ENTRY_NOTFOUND && nStartPos != 0 ) { nStartPos--; @@ -2209,7 +2209,7 @@ Point SvxIconChoiceCtrl_Impl::GetEntryPos( SvxIconChoiceCtrlEntry* pEntry ) return pEntry->aRect.TopLeft(); } -void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound ) +void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound ) { if ( bBound ) { @@ -2263,7 +2263,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pEntry, c } Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry, - const Point* pEntryPos, BOOL bEdit, const String* pStr ) + const Point* pEntryPos, sal_Bool bEdit, const String* pStr ) { String aEntryText; if( !pStr ) @@ -2381,8 +2381,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() { nMaxBoundHeight = 0; pZOrderList->Clear(); - ULONG nCount = aEntries.Count(); - ULONG nCur; + sal_uLong nCount = aEntries.Count(); + sal_uLong nCur; SvxIconChoiceCtrlEntry* pEntry; if( !IsAutoArrange() || !pHead ) @@ -2407,7 +2407,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() nCur++; } } - bBoundRectsDirty = FALSE; + bBoundRectsDirty = sal_False; AdjustScrollBars(); } @@ -2415,9 +2415,9 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() { nMaxBoundHeight = 0; pZOrderList->Clear(); - ULONG nCur; + sal_uLong nCur; SvxIconChoiceCtrlEntry* pEntry; - const ULONG nCount = aEntries.Count(); + const sal_uLong nCount = aEntries.Count(); if( !IsAutoArrange() || !pHead ) { @@ -2460,8 +2460,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() void SvxIconChoiceCtrl_Impl::UpdateBoundingRects() { - const ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + const sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); GetEntryBoundRect( pEntry ); @@ -2477,7 +2477,7 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry ) return; } Size aSize( CalcBoundingSize( pEntry ) ); - Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(TRUE)).TopLeft()); + Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(sal_True)).TopLeft()); SetBoundingRect_Impl( pEntry, aPos, aSize ); } @@ -2492,33 +2492,33 @@ void SvxIconChoiceCtrl_Impl::SetBoundingRect_Impl( SvxIconChoiceCtrlEntry* pEntr } -void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSyncSingleSelection, - BOOL bShowFocusAsync ) +void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSyncSingleSelection, + sal_Bool bShowFocusAsync ) { if( pEntry == pCursor ) { if( pCursor && eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection && !pCursor->IsSelected() ) - SelectEntry( pCursor, TRUE, TRUE ); + SelectEntry( pCursor, sal_True, sal_True ); return; } - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvxIconChoiceCtrlEntry* pOldCursor = pCursor; pCursor = pEntry; if( pOldCursor ) { pOldCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED ); if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection ) - SelectEntry( pOldCursor, FALSE, TRUE ); // alten Cursor deselektieren + SelectEntry( pOldCursor, sal_False, sal_True ); // alten Cursor deselektieren } if( pCursor ) { ToTop( pCursor ); pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED ); if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection ) - SelectEntry( pCursor, TRUE, TRUE ); + SelectEntry( pCursor, sal_True, sal_True ); if( !bShowFocusAsync ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); else { if( !nUserEventShowCursor ) @@ -2530,7 +2530,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSy } -void SvxIconChoiceCtrl_Impl::ShowCursor( BOOL bShow ) +void SvxIconChoiceCtrl_Impl::ShowCursor( sal_Bool bShow ) { if( !pCursor || !bShow || !pView->HasFocus() ) { @@ -2569,7 +2569,7 @@ void SvxIconChoiceCtrl_Impl::ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, cons DELETEZ(pDDDev); DELETEZ(pDDBufDev); } - BOOL bSelected = pRefEntry->IsSelected(); + sal_Bool bSelected = pRefEntry->IsSelected(); pRefEntry->ClearFlags( ICNVIEW_FLAG_SELECTED ); if( !pDDDev ) { @@ -2706,16 +2706,16 @@ void SvxIconChoiceCtrl_Impl::InvalidateBoundingRect( SvxIconChoiceCtrlEntry* pEn } -BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) +sal_Bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) { Rectangle aDocRect( GetDocumentRect() ); Rectangle aVisRect( GetVisibleRect() ); if( aVisRect.IsInside( aDocRect )) - return FALSE; + return sal_False; Size aDocSize( aDocRect.GetSize() ); Size aVisSize( aVisRect.GetSize() ); - BOOL bHor = aDocSize.Width() > aVisSize.Width(); - BOOL bVer = aDocSize.Height() > aVisSize.Height(); + sal_Bool bHor = aDocSize.Width() > aVisSize.Width(); + sal_Bool bVer = aDocSize.Height() > aVisSize.Height(); long nScrollDX = 0, nScrollDY = 0; @@ -2724,7 +2724,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) case COMMAND_STARTAUTOSCROLL: { pView->EndTracking(); - USHORT nScrollFlags = 0; + sal_uInt16 nScrollFlags = 0; if( bHor ) nScrollFlags |= AUTOSCROLL_HORZ; if( bVer ) @@ -2732,7 +2732,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) if( nScrollFlags ) { pView->StartAutoScroll( nScrollFlags ); - return TRUE; + return sal_True; } } break; @@ -2742,7 +2742,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) const CommandWheelData* pData = rCmd.GetWheelData(); if( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) && !pData->IsHorz() ) { - ULONG nScrollLines = pData->GetScrollLines(); + sal_uLong nScrollLines = pData->GetScrollLines(); if( nScrollLines == COMMAND_WHEEL_PAGESCROLL ) { nScrollDY = GetScrollBarPageSize( aVisSize.Width() ); @@ -2777,9 +2777,9 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) aVisRect.Left() -= nScrollDX; aVisRect.Right() -= nScrollDX; MakeVisible( aVisRect ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -2806,7 +2806,7 @@ void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry ) { if( pZOrderList->GetObject( pZOrderList->Count() - 1 ) != pEntry ) { - ULONG nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos ); pZOrderList->Insert( pEntry, LIST_APPEND ); } @@ -2826,10 +2826,10 @@ void SvxIconChoiceCtrl_Impl::ClipAtVirtOutRect( Rectangle& rRect ) const // rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der // sichtbar gemacht werden soll. -// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet +// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet -void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, - BOOL bCallRectChangedHdl ) +void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar, + sal_Bool bCallRectChangedHdl ) { Rectangle aVirtRect( rRect ); ClipAtVirtOutRect( aVirtRect ); @@ -2875,7 +2875,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, { HideDDIcon(); pView->Update(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); } // Origin fuer SV invertieren (damit wir in @@ -2883,7 +2883,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, aOrigin *= -1; SetOrigin( aOrigin ); - BOOL bScrollable = pView->GetBackground().IsScrollable(); + sal_Bool bScrollable = pView->GetBackground().IsScrollable(); if( pView->HasBackground() && !bScrollable ) { Rectangle aRect( GetOutputRect()); @@ -2915,7 +2915,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, } if( GetUpdateMode() ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); // pruefen, ob ScrollBars noch benoetigt werden CheckScrollBars(); @@ -2936,15 +2936,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor() SvxIconChoiceCtrlEntry* pNewCursor; if( pCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False ); if( !pNewCursor ) - pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True ); } } } @@ -2954,7 +2954,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor() return pNewCursor; } -ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const +sal_uLong SvxIconChoiceCtrl_Impl::GetSelectionCount() const { if( (nWinBits & WB_HIGHLIGHTFRAME) && pCurHighlightFrame ) return 1; @@ -2963,27 +2963,27 @@ ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry ) { - BOOL bSel; + sal_Bool bSel; if( pEntry->IsSelected() ) - bSel = FALSE; + bSel = sal_False; else - bSel = TRUE; - SelectEntry( pEntry, bSel, TRUE, TRUE ); + bSel = sal_True; + SelectEntry( pEntry, bSel, sal_True, sal_True ); } void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryNot, - BOOL bPaintSync ) + sal_Bool bPaintSync ) { ClearSelectedRectList(); // // !!!!!!! Todo: Evtl. Z-Orderlist abarbeiten !!!!!!! // - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); if( pEntry != pThisEntryNot && pEntry->IsSelected() ) - SelectEntry( pEntry, FALSE, TRUE, TRUE, bPaintSync ); + SelectEntry( pEntry, sal_False, sal_True, sal_True, bPaintSync ); } pAnchor = 0; nFlags &= (~F_ADD_MODE); @@ -3119,7 +3119,7 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const // Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird // links, hoch: Offsets < 0 // rechts, runter: Offsets > 0 -void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar ) +void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar ) { const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); @@ -3172,7 +3172,7 @@ static Rectangle GetHotSpot( const Rectangle& rRect ) } void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, - BOOL bAdd, SvPtrarr* pOtherRects ) + sal_Bool bAdd, SvPtrarr* pOtherRects ) { DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr"); Rectangle aRect( GetEntryBoundRect( pEntry1 ) ); @@ -3180,7 +3180,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIco SelectRect( aRect, bAdd, pOtherRects ); } -void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, +void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pOtherRects ) { aCurSelectionRect = rRect; @@ -3188,53 +3188,53 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, return; // Flag setzen, damit im Select kein ToTop gerufen wird - BOOL bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? TRUE : FALSE; + sal_Bool bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? sal_True : sal_False; nFlags |= F_SELECTING_RECT; CheckBoundingRects(); pView->Update(); - const ULONG nCount = pZOrderList->Count(); + const sal_uLong nCount = pZOrderList->Count(); Rectangle aRect( rRect ); aRect.Justify(); - BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE; + sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False; - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() ) { - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; pView->SetClipRegion( GetOutputRect() ); } - for( ULONG nPos = 0; nPos < nCount; nPos++ ) + for( sal_uLong nPos = 0; nPos < nCount; nPos++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos )); if( !IsBoundingRectValid( pEntry->aRect )) FindBoundingRect( pEntry ); Rectangle aBoundRect( GetHotSpot( pEntry->aRect ) ); - BOOL bSelected = pEntry->IsSelected(); + sal_Bool bSelected = pEntry->IsSelected(); - BOOL bOverlaps; + sal_Bool bOverlaps; if( bCalcOverlap ) bOverlaps = IsOver( pOtherRects, aBoundRect ); else - bOverlaps = FALSE; - BOOL bOver = aRect.IsOver( aBoundRect ); + bOverlaps = sal_False; + sal_Bool bOver = aRect.IsOver( aBoundRect ); if( bOver && !bOverlaps ) { // Ist im neuen Selektionsrechteck und in keinem alten // => selektieren if( !bSelected ) - SelectEntry( pEntry, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_True ); } else if( !bAdd ) { // ist ausserhalb des Selektionsrechtecks // => Selektion entfernen if( bSelected ) - SelectEntry( pEntry, FALSE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True ); } else if( bAdd && bOverlaps ) { @@ -3254,19 +3254,19 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, { // Schnittmenge zwischen alten Rects & aktuellem Rect desel. if( bSelected ) - SelectEntry( pEntry, FALSE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True ); } else { // Eintrag eines alten Rects selektieren if( !bSelected ) - SelectEntry( pEntry, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_True ); } } else if( !bOver && bSelected ) { // Der Eintrag liegt voellig ausserhalb und wird deshalb desel. - SelectEntry( pEntry, FALSE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True ); } } @@ -3281,13 +3281,13 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, void SvxIconChoiceCtrl_Impl::SelectRange( SvxIconChoiceCtrlEntry* pStart, SvxIconChoiceCtrlEntry* pEnd, - BOOL bAdd ) + sal_Bool bAdd ) { - ULONG nFront = GetEntryListPos( pStart ); - ULONG nBack = GetEntryListPos( pEnd ); - ULONG nFirst = std::min( nFront, nBack ); - ULONG nLast = std::max( nFront, nBack ); - ULONG i; + sal_uLong nFront = GetEntryListPos( pStart ); + sal_uLong nBack = GetEntryListPos( pEnd ); + sal_uLong nFirst = std::min( nFront, nBack ); + sal_uLong nLast = std::max( nFront, nBack ); + sal_uLong i; SvxIconChoiceCtrlEntry* pEntry; if ( ! bAdd ) @@ -3298,7 +3298,7 @@ void SvxIconChoiceCtrl_Impl::SelectRange( { pEntry = GetEntry( i ); if( pEntry->IsSelected() ) - SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True ); } } @@ -3307,33 +3307,33 @@ void SvxIconChoiceCtrl_Impl::SelectRange( { pEntry = GetEntry( i ); if( ! pEntry->IsSelected() ) - SelectEntry( pEntry, TRUE, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_True, sal_True ); } if ( ! bAdd ) { // deselect everything behind the last entry if not in // adding mode - ULONG nEnd = GetEntryCount(); + sal_uLong nEnd = GetEntryCount(); for ( ; i<nEnd; i++ ) { pEntry = GetEntry( i ); if( pEntry->IsSelected() ) - SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True ); } } } -BOOL SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const +sal_Bool SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const { - const USHORT nCount = pRectList->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = pRectList->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur ); if( rBoundRect.IsOver( *pRect )) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1, @@ -3354,8 +3354,8 @@ void SvxIconChoiceCtrl_Impl::AddSelectedRect( const Rectangle& rRect ) void SvxIconChoiceCtrl_Impl::ClearSelectedRectList() { - const USHORT nCount = aSelectedRectList.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = aSelectedRectList.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur ); delete pRect; @@ -3364,7 +3364,7 @@ void SvxIconChoiceCtrl_Impl::ClearSelectedRectList() } void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel, - long& rX, long& rY, BOOL isInDragDrop, USHORT nBorderWidth) + long& rX, long& rY, sal_Bool isInDragDrop, sal_uInt16 nBorderWidth) { // Scrolling der View, falls sich der Mauszeiger im Grenzbereich des // Fensters befindet @@ -3372,8 +3372,8 @@ void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel, long nPixelToScrollY = 0; Size aWndSize = aOutputSize; - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); if ( rPosPixel.X() < nBorderWidth ) { @@ -3434,16 +3434,16 @@ void SvxIconChoiceCtrl_Impl::PrepareCommandEvent( const CommandEvent& rCEvt ) StopEditTimer(); SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry( rCEvt.GetMousePosPixel() ); if( (nFlags & F_DOWN_CTRL) && pEntry && !pEntry->IsSelected() ) - SelectEntry( pEntry, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True ); nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); } -BOOL SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ) +sal_Bool SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ) { Rectangle aRect( CalcTextRect( pEntry )); if( aRect.IsInside( rDocPos ) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } IMPL_LINK(SvxIconChoiceCtrl_Impl, EditTimeoutHdl, Timer*, EMPTYARG ) @@ -3469,8 +3469,8 @@ void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart ) { SvPtrarr aLists; pImpCursor->CreateGridAjustData( aLists, pStart ); - const USHORT nCount = aLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = aLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart ); IcnCursor_Impl::DestroyGridAdjustData( aLists ); CheckScrollBars(); @@ -3482,18 +3482,18 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCt if( !rRow.Count() ) return; - BOOL bGo; + sal_Bool bGo; if( !pStart ) - bGo = TRUE; + bGo = sal_True; else - bGo = FALSE; + bGo = sal_False; long nCurRight = 0; - for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ ) + for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)rRow[ nCur ]; if( !bGo && pCur == pStart ) - bGo = TRUE; + bGo = sal_True; //SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); // Massgebend (fuer unser Auge) ist die Bitmap, da sonst @@ -3557,7 +3557,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, if( eTextMode == IcnShowTextDontKnow ) eTextMode = IcnShowTextShort; eTextMode = eMode; - Arrange( TRUE ); + Arrange( sal_True ); } } else @@ -3611,20 +3611,20 @@ void SvxIconChoiceCtrl_Impl::ShowFocus ( Rectangle& rRect ) { Color aBkgColor ( pView->GetBackground().GetColor() ); Color aPenColor; - USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; + sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; if ( nColor > 128 ) aPenColor.SetColor ( COL_BLACK ); else aPenColor.SetColor( COL_WHITE ); - aFocus.bOn = TRUE; + aFocus.bOn = sal_True; aFocus.aPenColor = aPenColor; aFocus.aRect = rRect; } void SvxIconChoiceCtrl_Impl::HideFocus () { - aFocus.bOn = FALSE; + aFocus.bOn = sal_False; } void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut ) @@ -3644,12 +3644,12 @@ void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut ) pOut->DrawPolyLine ( aPolygon, aLineInfo ); } -sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const +sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const { sal_Bool bRet = sal_False; const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - ULONG nEntryCount = GetEntryCount(); - for ( ULONG i = 0; i < nEntryCount; ++i ) + sal_uLong nEntryCount = GetEntryCount(); + for ( sal_uLong i = 0; i < nEntryCount; ++i ) { if ( rI18nHelper.MatchMnemonic( GetEntry( i )->GetText(), cChar ) ) { @@ -3675,7 +3675,7 @@ IMPL_LINK(SvxIconChoiceCtrl_Impl, UserEventHdl, void*, nId ) else if( nId == EVENTID_SHOW_CURSOR ) { nUserEventShowCursor = 0; - ShowCursor( TRUE ); + ShowCursor( sal_True ); } return 0; } @@ -3697,12 +3697,12 @@ void SvxIconChoiceCtrl_Impl::CancelUserEvents() void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Invalidate( pEntry->aRect ); Center( pEntry ); pView->Invalidate( pEntry->aRect ); if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry ) @@ -3711,13 +3711,13 @@ void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry ) if( !pEntry ) return; - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); DELETEZ(pEdit); SetNoSelection(); pCurEditedEntry = pEntry; - String aEntryText( pView->GetEntryText( pEntry, TRUE ) ); - Rectangle aRect( CalcTextRect( pEntry, 0, TRUE, &aEntryText ) ); + String aEntryText( pView->GetEntryText( pEntry, sal_True ) ); + Rectangle aRect( CalcTextRect( pEntry, 0, sal_True, &aEntryText ) ); MakeVisible( aRect ); Point aPos( aRect.TopLeft() ); aPos = pView->GetPixelPos( aPos ); @@ -3758,7 +3758,7 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG if( pView->EditedEntry( pCurEditedEntry, aText, pEdit->EditingCanceled() ) ) InvalidateEntry( pCurEditedEntry ); if( !GetSelectionCount() ) - SelectEntry( pCurEditedEntry, TRUE ); + SelectEntry( pCurEditedEntry, sal_True ); pEdit->Hide(); if( pEdit->IsGrabFocus() ) @@ -3769,13 +3769,13 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG return 0; } -void SvxIconChoiceCtrl_Impl::StopEntryEditing( BOOL bCancel ) +void SvxIconChoiceCtrl_Impl::StopEntryEditing( sal_Bool bCancel ) { if( pEdit ) pEdit->StopEditing( bCancel ); } -void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock ) +void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock ) { if( bLock ) pEntry->SetFlags( ICNVIEW_FLAG_POS_LOCKED ); @@ -3783,7 +3783,7 @@ void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL pEntry->ClearFlags( ICNVIEW_FLAG_POS_LOCKED ); } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rPos ) const +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uLong& rPos ) const { if( !GetSelectionCount() ) return 0; @@ -3794,10 +3794,10 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP return pCurHighlightFrame; } - ULONG nCount = aEntries.Count(); + sal_uLong nCount = aEntries.Count(); if( !pHead ) { - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); if( pEntry->IsSelected() ) @@ -3829,14 +3829,14 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP } // kein Round Robin! -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rStartPos ) const +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( sal_uLong& rStartPos ) const { - ULONG nCount = aEntries.Count(); + sal_uLong nCount = aEntries.Count(); if( rStartPos > nCount || !GetSelectionCount() ) return 0; if( !pHead ) { - for( ULONG nCur = rStartPos+1; nCur < nCount; nCur++ ) + for( sal_uLong nCur = rStartPos+1; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); if( pEntry->IsSelected() ) @@ -3865,15 +3865,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rSt return 0; } -void SvxIconChoiceCtrl_Impl::SelectAll( BOOL bSelect, BOOL bPaint ) +void SvxIconChoiceCtrl_Impl::SelectAll( sal_Bool bSelect, sal_Bool bPaint ) { - bPaint = TRUE; + bPaint = sal_True; - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ ) + sal_uLong nCount = aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); - SelectEntry( pEntry, bSelect, TRUE, TRUE, bPaint ); + SelectEntry( pEntry, bSelect, sal_True, sal_True, bPaint ); } nFlags &= (~F_ADD_MODE); pAnchor = 0; @@ -3883,7 +3883,7 @@ void SvxIconChoiceCtrl_Impl::SaveSelection( List** ppList ) { if( !*ppList ) *ppList = new List; - ULONG nPos; + sal_uLong nPos; SvxIconChoiceCtrlEntry* pEntry = GetFirstSelectedEntry( nPos ); while( pEntry && GetSelectionCount() != (*ppList)->Count() ) { @@ -3896,12 +3896,12 @@ IcnViewEdit_Impl::IcnViewEdit_Impl( SvtIconChoiceCtrl* pParent, const Point& rPo const Size& rSize, const XubString& rData, const Link& rNotifyEditEnd ) : MultiLineEdit( pParent, (pParent->GetStyle() & WB_ICON) ? WB_CENTER : WB_LEFT), aCallBackHdl( rNotifyEditEnd ), - bCanceled( FALSE ), - bAlreadyInCallback( FALSE ), - bGrabFocus( FALSE ) + bCanceled( sal_False ), + bAlreadyInCallback( sal_False ), + bGrabFocus( sal_False ) { Font aFont( pParent->GetPointFont() ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); SetControlFont( aFont ); if( !pParent->HasFontFillColor() ) { @@ -3941,7 +3941,7 @@ void IcnViewEdit_Impl::CallCallBackHdl_Impl() aTimer.Stop(); if ( !bAlreadyInCallback ) { - bAlreadyInCallback = TRUE; + bAlreadyInCallback = sal_True; GetpApp()->RemoveAccel( &aAccReturn ); GetpApp()->RemoveAccel( &aAccEscape ); Hide(); @@ -3957,16 +3957,16 @@ IMPL_LINK( IcnViewEdit_Impl, Timeout_Impl, Timer*, EMPTYARG ) IMPL_LINK( IcnViewEdit_Impl, ReturnHdl_Impl, Accelerator*, EMPTYARG ) { - bCanceled = FALSE; - bGrabFocus = TRUE; + bCanceled = sal_False; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); return 1; } IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG ) { - bCanceled = TRUE; - bGrabFocus = TRUE; + bCanceled = sal_True; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); return 1; } @@ -3974,19 +3974,19 @@ IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG ) void IcnViewEdit_Impl::KeyInput( const KeyEvent& rKEvt ) { KeyCode aCode = rKEvt.GetKeyCode(); - USHORT nCode = aCode.GetCode(); + sal_uInt16 nCode = aCode.GetCode(); switch ( nCode ) { case KEY_ESCAPE: - bCanceled = TRUE; - bGrabFocus = TRUE; + bCanceled = sal_True; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); break; case KEY_RETURN: - bCanceled = FALSE; - bGrabFocus = TRUE; + bCanceled = sal_False; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); break; @@ -4002,7 +4002,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt ) if ( !bAlreadyInCallback && ((!Application::GetFocusWindow()) || !IsChild(Application::GetFocusWindow()))) { - bCanceled = FALSE; + bCanceled = sal_False; aTimer.SetTimeout(10); aTimer.SetTimeoutHdl(LINK(this,IcnViewEdit_Impl,Timeout_Impl)); aTimer.Start(); @@ -4011,7 +4011,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt ) return 0; } -void IcnViewEdit_Impl::StopEditing( BOOL bCancel ) +void IcnViewEdit_Impl::StopEditing( sal_Bool bCancel ) { if ( !bAlreadyInCallback ) { @@ -4020,22 +4020,22 @@ void IcnViewEdit_Impl::StopEditing( BOOL bCancel ) } } -ULONG SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const +sal_uLong SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const { if( !(nFlags & F_ENTRYLISTPOS_VALID )) ((SvxIconChoiceCtrl_Impl*)this)->SetListPositions(); return pEntry->nPos; } -void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, ULONG nNewPos ) +void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, sal_uLong nNewPos ) { - ULONG nCurPos = GetEntryListPos( pListEntry ); + sal_uLong nCurPos = GetEntryListPos( pListEntry ); if( nCurPos == nNewPos ) return; aEntries.List::Remove( nCurPos ); aEntries.List::Insert( (void*)pListEntry, nNewPos ); // Eintragspositionen anpassen - ULONG nStart, nEnd; + sal_uLong nStart, nEnd; if( nNewPos < nCurPos ) { nStart = nNewPos; @@ -4053,19 +4053,19 @@ void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry } } -void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nEntryFlags ) +void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nEntryFlags ) { pEntry->nFlags = nEntryFlags; if( nEntryFlags & ICNVIEW_FLAG_POS_MOVED ) nFlags |= F_MOVED_ENTRIES; } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, BOOL bRight ) +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, sal_Bool bRight ) { return pImpCursor->GoLeftRight( pStart, bRight ); } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown ) +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown ) { return pImpCursor->GoUpDown( pStart, bDown ); } @@ -4116,14 +4116,14 @@ void SvxIconChoiceCtrl_Impl::InitSettings() } } -EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nInitSize , USHORT _nReSize ) : +EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nInitSize , sal_uInt16 _nReSize ) : List( _nInitSize, _nReSize ), _pOwner( pOwner ) { _pOwner->pHead = 0; } -EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) : +EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) : List( _nBlockSize, _nInitSize, _nReSize ), _pOwner( pOwner ) { @@ -4141,14 +4141,14 @@ void EntryList_Impl::Clear() List::Clear(); } -void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos ) +void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos ) { List::Insert( pEntry, nPos ); if( _pOwner->pHead ) pEntry->SetBacklink( _pOwner->pHead->pblink ); } -SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( ULONG nPos ) +SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( sal_uLong nPos ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)List::Remove( nPos ); DBG_ASSERT(pEntry,"EntryList_Impl::Remove > Entry not found"); @@ -4182,14 +4182,14 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ) void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMode ) { - ULONG nCur; + sal_uLong nCur; if( eMode == ePositionMode ) return; SvxIconChoiceCtrlPositionMode eOldMode = ePositionMode; ePositionMode = eMode; - ULONG nCount = aEntries.Count(); + sal_uLong nCount = aEntries.Count(); if( eOldMode == IcnViewPositionModeAutoArrange ) { @@ -4258,12 +4258,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry if( pEntry == pPredecessor ) return; - ULONG nPos1 = GetEntryListPos( pEntry ); + sal_uLong nPos1 = GetEntryListPos( pEntry ); if( !pHead ) { if( pPredecessor ) { - ULONG nPos2 = GetEntryListPos( pPredecessor ); + sal_uLong nPos2 = GetEntryListPos( pPredecessor ); if( nPos1 == (nPos2 + 1) ) return; // ist schon Vorgaenger } @@ -4277,16 +4277,16 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry if( !pPredecessor && pHead == pEntry ) return; // ist schon der Erste - BOOL bSetHead = FALSE; + sal_Bool bSetHead = sal_False; if( !pPredecessor ) { - bSetHead = TRUE; + bSetHead = sal_True; pPredecessor = pHead->pblink; } if( pEntry == pHead ) { pHead = pHead->pflink; - bSetHead = FALSE; + bSetHead = sal_False; } if( pEntry != pPredecessor ) { @@ -4299,12 +4299,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry aAutoArrangeTimer.Start(); } -BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, +sal_Bool SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, SvxIconChoiceCtrlEntry** ppPredecessor ) { *ppPredecessor = 0; if( !pHead ) - return FALSE; + return sal_False; DBG_ASSERT(pEntry->pblink,"GetEntryPredecessor: Backward link not set"); DBG_ASSERT(pEntry->pflink,"GetEntryPredecessor: Forward link not set"); @@ -4312,14 +4312,14 @@ BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry { SvxIconChoiceCtrlEntry* pFirst = (SvxIconChoiceCtrlEntry*)aEntries.GetObject(0); if( pFirst != pEntry ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } *ppPredecessor = pEntry->pblink; if( !(pEntry->nFlags & ICNVIEW_FLAG_PRED_SET) && (GetEntryListPos( *ppPredecessor ) + 1) == GetEntryListPos( pEntry )) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, @@ -4328,8 +4328,8 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho Point aPos( rPosTopLeft ); //TopLeft Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos )); Point aNewPos( aCenterRect.Center() ); - ULONG nGrid = GetPredecessorGrid( aNewPos ); - ULONG nCount = aEntries.Count(); + sal_uLong nGrid = GetPredecessorGrid( aNewPos ); + sal_uLong nCount = aEntries.Count(); if( nGrid == ULONG_MAX ) return 0; if( nGrid >= nCount ) @@ -4339,26 +4339,26 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0 // todo: Liste von hinten aufrollen wenn nGrid > nCount/2 - for( ULONG nCur = 0; nCur < nGrid; nCur++ ) + for( sal_uLong nCur = 0; nCur < nGrid; nCur++ ) pCur = pCur->pflink; return pCur; } -ULONG SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const +sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const { Point aPos( rPos ); aPos.X() -= LROFFS_WINBORDER; aPos.Y() -= TBOFFS_WINBORDER; - USHORT nMaxCol = (USHORT)(aVirtOutputSize.Width() / nGridDX); + sal_uInt16 nMaxCol = (sal_uInt16)(aVirtOutputSize.Width() / nGridDX); if( nMaxCol ) nMaxCol--; - USHORT nGridX = (USHORT)(aPos.X() / nGridDX); + sal_uInt16 nGridX = (sal_uInt16)(aPos.X() / nGridDX); if( nGridX > nMaxCol ) nGridX = nMaxCol; - USHORT nGridY = (USHORT)(aPos.Y() / nGridDY); - USHORT nGridsX = (USHORT)(aOutputSize.Width() / nGridDX); - ULONG nGrid = (nGridY * nGridsX) + nGridX; + sal_uInt16 nGridY = (sal_uInt16)(aPos.Y() / nGridDY); + sal_uInt16 nGridsX = (sal_uInt16)(aOutputSize.Width() / nGridDX); + sal_uLong nGrid = (nGridY * nGridsX) + nGridX; long nMiddle = (nGridX * nGridDX) + (nGridDX / 2); if( rPos.X() < nMiddle ) { @@ -4378,27 +4378,27 @@ void SvxIconChoiceCtrl_Impl::Flush() } } -BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) { if ( !(rHEvt.GetMode() & HELPMODE_QUICK ) ) - return FALSE; + return sal_False; Point aPos( pView->ScreenToOutputPixel(rHEvt.GetMousePosPixel() ) ); aPos -= pView->GetMapMode().GetOrigin(); - SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, TRUE ); + SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, sal_True ); if ( !pEntry ) - return FALSE; + return sal_False; String sQuickHelpText = pEntry->GetQuickHelpText(); - String aEntryText( pView->GetEntryText( pEntry, FALSE ) ); - Rectangle aTextRect( CalcTextRect( pEntry, 0, FALSE, &aEntryText ) ); + String aEntryText( pView->GetEntryText( pEntry, sal_False ) ); + Rectangle aTextRect( CalcTextRect( pEntry, 0, sal_False, &aEntryText ) ); if ( ( !aTextRect.IsInside( aPos ) || !aEntryText.Len() ) && !sQuickHelpText.Len() ) - return FALSE; + return sal_False; Rectangle aOptTextRect( aTextRect ); aOptTextRect.Bottom() = LONG_MAX; - USHORT nNewFlags = nCurTextDrawFlags; + sal_uInt16 nNewFlags = nCurTextDrawFlags; nNewFlags &= ~( TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS ); aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags ); if ( aOptTextRect != aTextRect || sQuickHelpText.Len() > 0 ) @@ -4419,7 +4419,7 @@ BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) Help::ShowQuickHelp( (Window*)pView, aOptTextRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER ); } - return TRUE; + return sal_True; } void SvxIconChoiceCtrl_Impl::ClearColumnList() @@ -4427,8 +4427,8 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList() if( !pColumns ) return; - const USHORT nCount = pColumns->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = pColumns->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlColumnInfo* pInfo = (SvxIconChoiceCtrlColumnInfo*) pColumns->GetObject( nCur ); @@ -4437,7 +4437,7 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList() DELETEZ(pColumns); } -void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo) +void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo) { if( !pColumns ) pColumns = new SvPtrarr; @@ -4467,22 +4467,22 @@ void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlCo Arrange( IsAutoArrange() ); } -const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( USHORT nIndex ) const +const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const { if( !pColumns || nIndex >= pColumns->Count() ) return 0; return (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nIndex ); } -const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT nSubItem, +const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const { rLeft = 0; if( !pColumns ) return 0; - const USHORT nCount = pColumns->Count(); + const sal_uInt16 nCount = pColumns->Count(); const SvxIconChoiceCtrlColumnInfo* pCol = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { pCol = (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nCur ); if( !pCol || pCol->GetSubItem() == nSubItem ) @@ -4493,7 +4493,7 @@ const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT } void SvxIconChoiceCtrl_Impl::DrawHighlightFrame( - OutputDevice* pOut, const Rectangle& rBmpRect, BOOL bHide ) + OutputDevice* pOut, const Rectangle& rBmpRect, sal_Bool bHide ) { Rectangle aBmpRect( rBmpRect ); long nBorder = 2; @@ -4509,7 +4509,7 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame( else { DecorationView aDecoView( pOut ); - USHORT nDecoFlags; + sal_uInt16 nDecoFlags; if ( bHighlightFramePressed ) nDecoFlags = FRAME_HIGHLIGHT_TESTBACKGROUND | FRAME_HIGHLIGHT_IN; else @@ -4519,20 +4519,20 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame( } void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry, - BOOL bKeepHighlightFlags ) + sal_Bool bKeepHighlightFlags ) { if( pEntry == pCurHighlightFrame ) return; if( !bKeepHighlightFlags ) - bHighlightFramePressed = FALSE; + bHighlightFramePressed = sal_False; HideEntryHighlightFrame(); pCurHighlightFrame = pEntry; if( pEntry ) { Rectangle aBmpRect( CalcFocusRect(pEntry) ); - DrawHighlightFrame( pView, aBmpRect, FALSE ); + DrawHighlightFrame( pView, aBmpRect, sal_False ); } } @@ -4544,7 +4544,7 @@ void SvxIconChoiceCtrl_Impl::HideEntryHighlightFrame() SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; pCurHighlightFrame = 0; Rectangle aBmpRect( CalcFocusRect(pEntry) ); - DrawHighlightFrame( pView, aBmpRect, TRUE ); + DrawHighlightFrame( pView, aBmpRect, sal_True ); } void SvxIconChoiceCtrl_Impl::CallSelectHandler( SvxIconChoiceCtrlEntry* ) @@ -4585,7 +4585,7 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const SvxIconChoiceCtrlEntry* pEntry = GetCurEntry(); if( !pEntry || !pEntry->IsSelected() ) { - ULONG nNext; + sal_uLong nNext; pEntry = GetFirstSelectedEntry( nNext ); } if( pEntry ) @@ -4597,14 +4597,14 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const return aResult; } -void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWallpaper ) +void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, sal_Bool bDoNotUpdateWallpaper ) { MapMode aMapMode( pView->GetMapMode() ); aMapMode.SetOrigin( rPos ); pView->SetMapMode( aMapMode ); if( !bDoNotUpdateWallpaper ) { - BOOL bScrollable = pView->GetBackground().IsScrollable(); + sal_Bool bScrollable = pView->GetBackground().IsScrollable(); if( pView->HasBackground() && !bScrollable ) { Rectangle aRect( GetOutputRect()); @@ -4615,8 +4615,8 @@ void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWall } } -ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBars, - BOOL bSmartScrBar ) const +sal_uLong SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, sal_Bool bCheckScrBars, + sal_Bool bSmartScrBar ) const { Size aSize( rSize ); if( bCheckScrBars && aHorSBar.IsVisible() ) @@ -4634,19 +4634,19 @@ ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBar if( aSize.Height() < 0 ) aSize.Height() = 0; - return IcnGridMap_Impl::GetGridCount( aSize, (USHORT)nGridDX, (USHORT)nGridDY ); + return IcnGridMap_Impl::GetGridCount( aSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY ); } -BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) { StopEditTimer(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; DBG_ASSERT( rKEvt.GetKeyCode().IsMod2(), "*SvxIconChoiceCtrl_Impl::HandleShortCutKey(): no <ALT> pressed!?" ); sal_Unicode cChar = rKEvt.GetCharCode(); - ULONG nPos = (ULONG)-1; + sal_uLong nPos = (sal_uLong)-1; if( cChar && IsMnemonicChar( cChar, nPos ) ) { @@ -4655,7 +4655,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) SvxIconChoiceCtrlEntry* pOldCursor = pCursor; if( pNewCursor != pOldCursor ) { - SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE ); + SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False ); if( pNewCursor != NULL ) { @@ -4665,7 +4665,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) pCurHighlightFrame = NULL; } } - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -4673,7 +4673,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) // ----------------------------------------------------------------------- -void SvxIconChoiceCtrl_Impl::CallEventListeners( ULONG nEvent, void* pData ) +void SvxIconChoiceCtrl_Impl::CallEventListeners( sal_uLong nEvent, void* pData ) { pView->CallImplEventListeners( nEvent, pData ); } diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index 7cb92e8cef07..539477c03599 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -47,14 +47,14 @@ IcnCursor_Impl::~IcnCursor_Impl() delete[] pRows; } -USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue, +sal_uInt16 IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue, int bVertical ) { - USHORT nCount = (USHORT)pList->Count(); + sal_uInt16 nCount = (sal_uInt16)pList->Count(); if( !nCount ) return 0; - USHORT nCurPos = 0; + sal_uInt16 nCurPos = 0; long nPrevValue = LONG_MIN; while( nCount ) { @@ -66,7 +66,7 @@ USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue, else nCurValue = rRect.Left(); if( nValue >= nPrevValue && nValue <= nCurValue ) - return (USHORT)nCurPos; + return (sal_uInt16)nCurPos; nPrevValue = nCurValue; nCount--; nCurPos++; @@ -84,8 +84,8 @@ void IcnCursor_Impl::ImplCreate() pColumns = new SvPtrarr[ nCols ]; pRows = new SvPtrarr[ nRows ]; - ULONG nCount = pView->aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = pView->aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); // const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); @@ -99,10 +99,10 @@ void IcnCursor_Impl::ImplCreate() if( nX >= nCols ) nX = sal::static_int_cast< short >(nCols - 1); - USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE ); + sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True ); pColumns[ nX ].Insert( pEntry, nIns ); - nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE ); + nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False ); pRows[ nY ].Insert( pEntry, nIns ); pEntry->nX = nX; @@ -127,12 +127,12 @@ void IcnCursor_Impl::Clear() } } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, - USHORT, BOOL bDown, BOOL bSimple ) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom, + sal_uInt16, sal_Bool bDown, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchCol: No reference entry"); SvPtrarr* pList = &(pColumns[ nCol ]); - const USHORT nCount = pList->Count(); + const sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -140,7 +140,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List"); if( bDown ) { @@ -173,18 +173,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT if( nTop > nBottom ) { - USHORT nTemp = nTop; + sal_uInt16 nTemp = nTop; nTop = nBottom; nBottom = nTemp; } long nMinDistance = LONG_MAX; SvxIconChoiceCtrlEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { - USHORT nY = pEntry->nY; + sal_uInt16 nY = pEntry->nY; if( nY >= nTop && nY <= nBottom ) { const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); @@ -202,12 +202,12 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT return pResult; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, - USHORT, BOOL bRight, BOOL bSimple ) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight, + sal_uInt16, sal_Bool bRight, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchRow: No reference entry"); SvPtrarr* pList = &(pRows[ nRow ]); - const USHORT nCount = pList->Count(); + const sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -215,7 +215,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List"); if( bRight ) { @@ -248,18 +248,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR } if( nRight < nLeft ) { - USHORT nTemp = nRight; + sal_uInt16 nTemp = nRight; nRight = nLeft; nLeft = nTemp; } long nMinDistance = LONG_MAX; SvxIconChoiceCtrlEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { - USHORT nX = pEntry->nX; + sal_uInt16 nX = pEntry->nX; if( nX >= nLeft && nX <= nRight ) { const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); @@ -281,7 +281,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR /* Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw. - linksstehenden. Suchverfahren am Beispiel bRight = TRUE: + linksstehenden. Suchverfahren am Beispiel bRight = sal_True: c b c @@ -296,21 +296,21 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR a,b,c : 2., 3., 4. Suchrechteck */ -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bRight ) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bRight ) { SvxIconChoiceCtrlEntry* pResult; pCurEntry = pCtrlEntry; Create(); - USHORT nY = pCtrlEntry->nY; - USHORT nX = pCtrlEntry->nX; + sal_uInt16 nY = pCtrlEntry->nY; + sal_uInt16 nX = pCtrlEntry->nX; DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column"); DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row"); // Nachbar auf gleicher Zeile ? if( bRight ) pResult = SearchRow( - nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE ); + nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True ); else - pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE ); + pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True ); if( pResult ) return pResult; @@ -328,11 +328,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt nLastCol = -1; // 0-1 } - USHORT nRowMin = nY; - USHORT nRowMax = nY; + sal_uInt16 nRowMin = nY; + sal_uInt16 nRowMax = nY; do { - SvxIconChoiceCtrlEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE); + SvxIconChoiceCtrlEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False); if( pEntry ) return pEntry; if( nRowMin ) @@ -344,7 +344,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt return 0; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown) { if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) ) { @@ -366,7 +366,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS nNewPos = 0; } if( nPos != nNewPos ) - return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (ULONG)nNewPos ); + return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (sal_uLong)nNewPos ); return 0; } long nOpt = pView->GetEntryBoundRect( pStart ).Top(); @@ -404,11 +404,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS return 0; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bDown) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bDown) { if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) ) { - ULONG nPos = pView->GetEntryListPos( pCtrlEntry ); + sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry ); if( bDown && nPos < (pView->aEntries.Count() - 1) ) return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nPos + 1 ); else if( !bDown && nPos > 0 ) @@ -419,17 +419,17 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE SvxIconChoiceCtrlEntry* pResult; pCurEntry = pCtrlEntry; Create(); - USHORT nY = pCtrlEntry->nY; - USHORT nX = pCtrlEntry->nX; + sal_uInt16 nY = pCtrlEntry->nY; + sal_uInt16 nX = pCtrlEntry->nX; DBG_ASSERT(nY<nRows,"GoUpDown:Bad column"); DBG_ASSERT(nX<nCols,"GoUpDown:Bad row"); // Nachbar in gleicher Spalte ? if( bDown ) pResult = SearchCol( - nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE ); + nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True ); else - pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE ); + pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True ); if( pResult ) return pResult; @@ -447,11 +447,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE nLastRow = -1; // 0-1 } - USHORT nColMin = nX; - USHORT nColMax = nX; + sal_uInt16 nColMin = nX; + sal_uInt16 nColMax = nX; do { - SvxIconChoiceCtrlEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE); + SvxIconChoiceCtrlEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False); if( pEntry ) return pEntry; if( nColMin ) @@ -493,23 +493,23 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt { if( !pRefEntry ) { - USHORT nGridRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY); + sal_uInt16 nGridRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY); nGridRows++; // wg. Abrundung! if( !nGridRows ) return; - for( USHORT nCurList = 0; nCurList < nGridRows; nCurList++ ) + for( sal_uInt16 nCurList = 0; nCurList < nGridRows; nCurList++ ) { SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, nCurList ); } - const ULONG nCount = pView->aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + const sal_uLong nCount = pView->aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); - USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE); + sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False); ((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns ); } } @@ -522,8 +522,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY ); SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, 0 ); - ULONG nCount = pView->aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = pView->aEntries.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); Rectangle rRect( pView->CalcBmpRect(pEntry) ); @@ -531,7 +531,7 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); if( nY == nRefRow ) { - USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE ); + sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False ); pRow->Insert( pEntry, nIns ); } } @@ -541,8 +541,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt //static void IcnCursor_Impl::DestroyGridAdjustData( SvPtrarr& rLists ) { - const USHORT nCount = rLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = rLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ]; delete pArr; @@ -569,16 +569,16 @@ void IcnGridMap_Impl::Expand() Create_Impl(); else { - USHORT nNewGridRows = _nGridRows; - USHORT nNewGridCols = _nGridCols; + sal_uInt16 nNewGridRows = _nGridRows; + sal_uInt16 nNewGridCols = _nGridCols; if( _pView->nWinBits & WB_ALIGN_TOP ) nNewGridRows += 50; else nNewGridCols += 50; - BOOL* pNewGridMap = new BOOL[nNewGridRows*nNewGridCols]; - memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(BOOL) ); - memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(BOOL) ); + sal_Bool* pNewGridMap = new sal_Bool[nNewGridRows*nNewGridCols]; + memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(sal_Bool) ); + memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(sal_Bool) ); delete[] _pGridMap; _pGridMap = pNewGridMap; _nGridRows = nNewGridRows; @@ -597,15 +597,15 @@ void IcnGridMap_Impl::Create_Impl() else _nGridCols += 50; - _pGridMap = new BOOL[ _nGridRows * _nGridCols]; + _pGridMap = new sal_Bool[ _nGridRows * _nGridCols]; memset( (void*)_pGridMap, 0, _nGridRows * _nGridCols ); - const ULONG nCount = _pView->aEntries.Count(); - for( ULONG nCur=0; nCur < nCount; nCur++ ) + const sal_uLong nCount = _pView->aEntries.Count(); + for( sal_uLong nCur=0; nCur < nCount; nCur++ ) OccupyGrids( (SvxIconChoiceCtrlEntry*)_pView->aEntries.GetObject( nCur )); } -void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const +void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const { long nX, nY; if( _pView->nWinBits & WB_ALIGN_TOP ) @@ -643,11 +643,11 @@ void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const if( !nDY ) nDY++; - rDX = (USHORT)nDX; - rDY = (USHORT)nDY; + rDX = (sal_uInt16)nDX; + rDY = (sal_uInt16)nDY; } -GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY ) +GridId IcnGridMap_Impl::GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ) { Create(); if( _pView->nWinBits & WB_ALIGN_TOP ) @@ -656,7 +656,7 @@ GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY ) return nGridY + ( nGridX * _nGridRows ); } -GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped ) +GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, sal_Bool* pbClipped ) { Create(); @@ -666,28 +666,28 @@ GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped ) nY -= TBOFFS_WINBORDER; nX /= _pView->nGridDX; nY /= _pView->nGridDY; - BOOL bClipped = FALSE; + sal_Bool bClipped = sal_False; if( nX >= _nGridCols ) { nX = _nGridCols - 1; - bClipped = TRUE; + bClipped = sal_True; } if( nY >= _nGridRows ) { nY = _nGridRows - 1; - bClipped = TRUE; + bClipped = sal_True; } - GridId nId = GetGrid( (USHORT)nX, (USHORT)nY ); + GridId nId = GetGrid( (sal_uInt16)nX, (sal_uInt16)nY ); if( pbClipped ) *pbClipped = bClipped; - DBG_ASSERT(nId <(ULONG)(_nGridCols*_nGridRows),"GetGrid failed"); + DBG_ASSERT(nId <(sal_uLong)(_nGridCols*_nGridRows),"GetGrid failed"); return nId; } Rectangle IcnGridMap_Impl::GetGridRect( GridId nId ) { Create(); - USHORT nGridX, nGridY; + sal_uInt16 nGridX, nGridY; GetGridCoord( nId, nGridX, nGridY ); const long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER; const long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER; @@ -697,28 +697,28 @@ Rectangle IcnGridMap_Impl::GetGridRect( GridId nId ) nTop + _pView->nGridDY ); } -GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound ) +GridId IcnGridMap_Impl::GetUnoccupiedGrid( sal_Bool bOccupyFound ) { Create(); - ULONG nStart = 0; - BOOL bExpanded = FALSE; + sal_uLong nStart = 0; + sal_Bool bExpanded = sal_False; while( 1 ) { - const ULONG nCount = (USHORT)(_nGridCols * _nGridRows); - for( ULONG nCur = nStart; nCur < nCount; nCur++ ) + const sal_uLong nCount = (sal_uInt16)(_nGridCols * _nGridRows); + for( sal_uLong nCur = nStart; nCur < nCount; nCur++ ) { if( !_pGridMap[ nCur ] ) { if( bOccupyFound ) - _pGridMap[ nCur ] = TRUE; + _pGridMap[ nCur ] = sal_True; return (GridId)nCur; } } DBG_ASSERT(!bExpanded,"ExpandGrid failed"); if( bExpanded ) return 0; // prevent never ending loop - bExpanded = TRUE; + bExpanded = sal_True; Expand(); nStart = nCount; } @@ -729,7 +729,7 @@ GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound ) // Bounding-Rect, kann aber zu kleinen Ueberlappungen fuehren #define OCCUPY_CENTER -void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bOccupy ) +void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, sal_Bool bOccupy ) { if( !_pGridMap || !_pView->IsBoundingRectValid( pEntry->aRect )) return; @@ -741,7 +741,7 @@ void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bO } -void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed ) +void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, sal_Bool bUsed ) { if( !_pGridMap ) return; @@ -755,17 +755,17 @@ void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed ) else _aLastOccupiedGrid.SetEmpty(); - BOOL bTopLeftClipped, bBottomRightClipped; + sal_Bool bTopLeftClipped, bBottomRightClipped; GridId nIdTL = GetGrid( rRect.TopLeft(), &bTopLeftClipped ); GridId nIdBR = GetGrid( rRect.BottomRight(), &bBottomRightClipped ); if( bTopLeftClipped && bBottomRightClipped ) return; - USHORT nX1,nX2,nY1,nY2; + sal_uInt16 nX1,nX2,nY1,nY2; GetGridCoord( nIdTL, nX1, nY1 ); GetGridCoord( nIdBR, nX2, nY2 ); - USHORT nTemp; + sal_uInt16 nTemp; if( nX1 > nX2 ) { nTemp = nX1; @@ -794,20 +794,20 @@ void IcnGridMap_Impl::Clear() } } -ULONG IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, USHORT nDX, USHORT nDY) +sal_uLong IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, sal_uInt16 nDY) { long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX; if( ndx < 0 ) ndx *= -1; long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY; if( ndy < 0 ) ndy *= -1; - return (ULONG)(ndx * ndy); + return (sal_uLong)(ndx * ndy); } void IcnGridMap_Impl::OutputSizeChanged() { if( _pGridMap ) { - USHORT nCols, nRows; + sal_uInt16 nCols, nRows; GetMinMapSize( nCols, nRows ); if( _pView->nWinBits & WB_ALIGN_TOP ) { @@ -829,18 +829,18 @@ void IcnGridMap_Impl::OutputSizeChanged() // Independendly of the views alignment (TOP or LEFT) the gridmap // should contain the data in a continues region, to make it possible // to copy the whole block if the gridmap needs to be expanded. -void IcnGridMap_Impl::GetGridCoord( GridId nId, USHORT& rGridX, USHORT& rGridY ) +void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY ) { Create(); if( _pView->nWinBits & WB_ALIGN_TOP ) { - rGridX = (USHORT)(nId % _nGridCols); - rGridY = (USHORT)(nId / _nGridCols); + rGridX = (sal_uInt16)(nId % _nGridCols); + rGridY = (sal_uInt16)(nId / _nGridCols); } else { - rGridX = (USHORT)(nId / _nGridRows); - rGridY = (USHORT)(nId % _nGridRows); + rGridX = (sal_uInt16)(nId / _nGridRows); + rGridY = (sal_uInt16)(nId % _nGridRows); } } diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 9d494e5c32db..8a94d3ff086b 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -41,7 +41,7 @@ using namespace ::com::sun::star::accessibility; | \*****************************************************************************/ -SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, USHORT _nFlags ) +SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 _nFlags ) { aText = rText; aImage = rImage; @@ -54,7 +54,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image pflink = 0; } -SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, const Image& rImageHC, USHORT _nFlags ) +SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, const Image& rImageHC, sal_uInt16 _nFlags ) { aText = rText; aImage = rImage; @@ -67,7 +67,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image pflink = 0; } -SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags ) +SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( sal_uInt16 _nFlags ) { pUserData = NULL; @@ -77,7 +77,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags ) pflink = 0; } -void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved ) +void SvxIconChoiceCtrlEntry::SetMoved( sal_Bool bMoved ) { if( bMoved ) nFlags |= ICNVIEW_FLAG_POS_MOVED; @@ -85,7 +85,7 @@ void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved ) nFlags &= ~ICNVIEW_FLAG_POS_MOVED; } -void SvxIconChoiceCtrlEntry::LockPos( BOOL bLock ) +void SvxIconChoiceCtrlEntry::LockPos( sal_Bool bLock ) { if( bLock ) nFlags |= ICNVIEW_FLAG_POS_LOCKED; @@ -130,7 +130,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle ) : _pCurKeyEvent ( NULL ), _pImp ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ), - _bAutoFontColor ( FALSE ) + _bAutoFontColor ( sal_False ) { SetLineColor(); @@ -145,7 +145,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, const ResId& rResId ) : _pCurKeyEvent ( NULL ), _pImp ( new SvxIconChoiceCtrl_Impl( this, WB_BORDER ) ), - _bAutoFontColor ( FALSE ) + _bAutoFontColor ( sal_False ) { SetLineColor(); @@ -160,14 +160,14 @@ SvtIconChoiceCtrl::~SvtIconChoiceCtrl() delete _pImp; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( ULONG nPos, const Point* pPos, USHORT nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( nFlags ); _pImp->InsertEntry( pEntry, nPos, pPos ); return pEntry; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, ULONG nPos, const Point* pPos, USHORT nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, nFlags); @@ -176,7 +176,7 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con return pEntry; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, const Image& rImageHC, ULONG nPos, const Point* pPos, USHORT nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, const Image& rImageHC, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, rImageHC, nFlags); @@ -185,37 +185,37 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con return pEntry; } -BOOL SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, BOOL ) +sal_Bool SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, sal_Bool ) { - return TRUE; + return sal_True; } -BOOL SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* ) +sal_Bool SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* ) { - return TRUE; + return sal_True; } void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, OutputDevice& rDev ) { rDev.DrawImage( rPos, GetSettings().GetStyleSettings().GetHighContrastMode() ? pEntry->GetImageHC() : pEntry->GetImage() ); } -String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, BOOL ) +String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, sal_Bool ) { return pEntry->GetText(); } -BOOL SvtIconChoiceCtrl::HasBackground() const +sal_Bool SvtIconChoiceCtrl::HasBackground() const { - return FALSE; + return sal_False; } -BOOL SvtIconChoiceCtrl::HasFont() const +sal_Bool SvtIconChoiceCtrl::HasFont() const { - return FALSE; + return sal_False; } -BOOL SvtIconChoiceCtrl::HasFontTextColor() const +sal_Bool SvtIconChoiceCtrl::HasFontTextColor() const { - return TRUE; + return sal_True; } -BOOL SvtIconChoiceCtrl::HasFontFillColor() const +sal_Bool SvtIconChoiceCtrl::HasFontFillColor() const { - return TRUE; + return sal_True; } void SvtIconChoiceCtrl::Paint( const Rectangle& rRect ) @@ -247,7 +247,7 @@ void SvtIconChoiceCtrl::ArrangeIcons() Size aFullSize; Rectangle aEntryRect; - for ( ULONG i = 0; i < GetEntryCount(); i++ ) + for ( sal_uLong i = 0; i < GetEntryCount(); i++ ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i ); aEntryRect = _pImp->GetEntryBoundRect ( pEntry ); @@ -255,14 +255,14 @@ void SvtIconChoiceCtrl::ArrangeIcons() aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() ); } - _pImp->Arrange ( FALSE, aFullSize.getWidth() ); + _pImp->Arrange ( sal_False, aFullSize.getWidth() ); } else if ( GetStyle() & WB_ALIGN_LEFT ) { Size aFullSize; Rectangle aEntryRect; - for ( ULONG i = 0; i < GetEntryCount(); i++ ) + for ( sal_uLong i = 0; i < GetEntryCount(); i++ ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i ); aEntryRect = _pImp->GetEntryBoundRect ( pEntry ); @@ -270,13 +270,13 @@ void SvtIconChoiceCtrl::ArrangeIcons() aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() ); } - _pImp->Arrange ( FALSE, 0, aFullSize.getHeight() ); + _pImp->Arrange ( sal_False, 0, aFullSize.getHeight() ); } else { _pImp->Arrange(); } - _pImp->Arrange( FALSE, 0, 1000 ); + _pImp->Arrange( sal_False, 0, 1000 ); } void SvtIconChoiceCtrl::Resize() { @@ -312,7 +312,7 @@ void SvtIconChoiceCtrl::GetFocus() { _pImp->GetFocus(); Control::GetFocus(); - ULONG nPos; + sal_uLong nPos; SvxIconChoiceCtrlEntry* pSelectedEntry = GetSelectedEntry ( nPos ); if ( pSelectedEntry ) _pImp->CallEventListeners( VCLEVENT_LISTBOX_SELECT, pSelectedEntry ); @@ -324,7 +324,7 @@ void SvtIconChoiceCtrl::LoseFocus() Control::LoseFocus(); } -void SvtIconChoiceCtrl::SetUpdateMode( BOOL bUpdate ) +void SvtIconChoiceCtrl::SetUpdateMode( sal_Bool bUpdate ) { Control::SetUpdateMode( bUpdate ); _pImp->SetUpdateMode( bUpdate ); @@ -346,7 +346,7 @@ void SvtIconChoiceCtrl::SetPointFont( const Font& rFont ) _pImp->FontModified(); } } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, BOOL bHit ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, sal_Bool bHit ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); @@ -377,25 +377,25 @@ SvxIconChoiceCtrlTextMode SvtIconChoiceCtrl::GetEntryTextMode( const SvxIconChoi return _pImp->GetEntryTextModeSmart( pEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); return ((SvtIconChoiceCtrl*)this)->_pImp->GetNextEntry( aPos, pCurEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); return ((SvtIconChoiceCtrl*)this)->_pImp->GetPrevEntry( aPos, pCurEntry ); } -ULONG SvtIconChoiceCtrl::GetEntryCount() const +sal_uLong SvtIconChoiceCtrl::GetEntryCount() const { return _pImp->GetEntryCount(); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( ULONG nPos ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uLong nPos ) const { return _pImp->GetEntry( nPos ); } @@ -415,30 +415,30 @@ void SvtIconChoiceCtrl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) _pImp->RemoveEntry( pEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( ULONG& rPos ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uLong& rPos ) const { return _pImp->GetFirstSelectedEntry( rPos ); } void SvtIconChoiceCtrl::ClickIcon() { - ULONG nPos; + sal_uLong nPos; GetSelectedEntry ( nPos ); _aClickIconHdl.Call( this ); } -BOOL SvtIconChoiceCtrl::IsEntryEditing() const +sal_Bool SvtIconChoiceCtrl::IsEntryEditing() const { return _pImp->IsEntryEditing(); } -BOOL SvtIconChoiceCtrl::SetChoiceWithCursor ( BOOL bDo ) +sal_Bool SvtIconChoiceCtrl::SetChoiceWithCursor ( sal_Bool bDo ) { return _pImp->SetChoiceWithCursor (bDo); } void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) { - BOOL bKeyUsed = DoKeyInput( rKEvt ); + sal_Bool bKeyUsed = DoKeyInput( rKEvt ); if ( !bKeyUsed ) { _pCurKeyEvent = (KeyEvent*)&rKEvt; @@ -446,17 +446,17 @@ void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) _pCurKeyEvent = NULL; } } -BOOL SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt ) +sal_Bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt ) { // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down if( IsEntryEditing() ) - return TRUE; + return sal_True; _pCurKeyEvent = (KeyEvent*)&rKEvt; - BOOL bHandled = _pImp->KeyInput( rKEvt ); + sal_Bool bHandled = _pImp->KeyInput( rKEvt ); _pCurKeyEvent = NULL; return bHandled; } -ULONG SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const +sal_uLong SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const { return _pImp->GetEntryListPos( pEntry ); } @@ -561,7 +561,7 @@ void SvtIconChoiceCtrl::SetSelectionMode( SelectionMode eMode ) _pImp->SetSelectionMode( eMode ); } -BOOL SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r ) +sal_Bool SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r ) { return _pImp->HandleShortCutKey( r ); } @@ -615,7 +615,7 @@ void SvtIconChoiceCtrl::SetNoSelection() _pImp->SetNoSelection(); } -void SvtIconChoiceCtrl::CallImplEventListeners(ULONG nEvent, void* pData) +void SvtIconChoiceCtrl::CallImplEventListeners(sal_uLong nEvent, void* pData) { CallEventListeners(nEvent, pData); } diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx index 6fd0f5bf0c9c..72768dd01746 100644 --- a/svtools/source/contnr/svicnvw.cxx +++ b/svtools/source/contnr/svicnvw.cxx @@ -106,7 +106,7 @@ void SvIconView::DisconnectFromModel() SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos ) + SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos ) { SvLBoxEntry* pEntry = CreateEntry( rText, aCollapsedEntryBmp, aExpandedEntryBmp ); @@ -122,7 +122,7 @@ SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, const Image& rExpEntryBmp, const Image& rCollEntryBmp, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos) + SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos) { SvLBoxEntry* pEntry = CreateEntry( rText, rCollEntryBmp, rExpEntryBmp ); @@ -218,7 +218,7 @@ SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource ) } -USHORT SvIconView::IsA() +sal_uInt16 SvIconView::IsA() { return SV_LISTBOX_ID_ICONVIEW; } @@ -226,7 +226,7 @@ USHORT SvIconView::IsA() void SvIconView::RequestingChilds( SvLBoxEntry* pParent ) { if ( !pParent->HasChilds() ) - InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND ); + InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND ); } void __EXPORT SvIconView::Paint( const Rectangle& rRect ) @@ -256,7 +256,7 @@ void __EXPORT SvIconView::KeyInput( const KeyEvent& rKEvt ) return; nImpFlags |= SVLBOX_IS_TRAVELSELECT; - BOOL bKeyUsed = pImp->KeyInput( rKEvt ); + sal_Bool bKeyUsed = pImp->KeyInput( rKEvt ); if ( !bKeyUsed ) SvLBox::KeyInput( rKEvt ); nImpFlags &= ~SVLBOX_IS_TRAVELSELECT; @@ -280,7 +280,7 @@ void __EXPORT SvIconView::LoseFocus() SvLBox::LoseFocus(); } -void SvIconView::SetUpdateMode( BOOL bUpdate ) +void SvIconView::SetUpdateMode( sal_Bool bUpdate ) { Control::SetUpdateMode( bUpdate ); if ( bUpdate ) @@ -319,7 +319,7 @@ void __EXPORT SvIconView::ModelHasInsertedTree( SvListEntry* pEntry ) } void __EXPORT SvIconView::ModelIsMoving(SvListEntry* pSource, - SvListEntry* /* pTargetParent */ , ULONG /* nChildPos */ ) + SvListEntry* /* pTargetParent */ , sal_uLong /* nChildPos */ ) { pImp->MovingEntry( (SvLBoxEntry*)pSource ); } @@ -348,7 +348,7 @@ void __EXPORT SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) pImp->ModelHasEntryInvalidated( pEntry ); } -void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ) +void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow ) { pImp->ShowTargetEmphasis( pEntry, bShow ); } @@ -360,10 +360,10 @@ Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos) { - pImp->SetEntryPosition( pEntry, rPos, FALSE, TRUE ); + pImp->SetEntryPosition( pEntry, rPos, sal_False, sal_True ); } -void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustAtGrid ) +void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, sal_Bool bAdjustAtGrid ) { pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid ); } @@ -371,7 +371,7 @@ void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL void SvIconView::SetFont( const Font& rFont ) { Font aTempFont( rFont ); - aTempFont.SetTransparent( TRUE ); + aTempFont.SetTransparent( sal_True ); SvLBox::SetFont( aTempFont ); RecalcViewData(); pImp->ChangedFont(); @@ -387,7 +387,7 @@ SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos ) return pImp->GetDropTarget( rPos ); } -SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, BOOL ) const +SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); @@ -440,10 +440,10 @@ void SvIconView::SetSelectionMode( SelectionMode eSelectMode ) pImp->SetSelectionMode( eSelectMode ); } -BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect ) +sal_Bool SvIconView::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) { EndEditing(); - BOOL bRetVal = SvListView::Select( pEntry, bSelect ); + sal_Bool bRetVal = SvListView::Select( pEntry, bSelect ); if( bRetVal ) { pImp->EntrySelected( pEntry, bSelect ); @@ -453,7 +453,7 @@ BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect ) return bRetVal; } -void SvIconView::SelectAll( BOOL bSelect, BOOL ) +void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool ) { SvLBoxEntry* pEntry = pImp->GetCurParent(); pEntry = FirstChild( pEntry ); @@ -478,7 +478,7 @@ SvLBoxEntry* SvIconView::GetCurEntry() const void SvIconView::Arrange() { #ifdef DBG_UTIL - USHORT n=1; + sal_uInt16 n=1; if( n == 1 && n-1 == 0 ) { pImp->Arrange(); @@ -498,20 +498,20 @@ void SvIconView::SetSpaceBetweenEntries( long nX, long nY ) pImp->SetSpaceBetweenEntries( nX, nY ); } -BOOL SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +sal_Bool SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ) { return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos); } -BOOL SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +sal_Bool SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ) { return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos); } -void SvIconView::EnableInplaceEditing( BOOL bEnable ) +void SvIconView::EnableInplaceEditing( sal_Bool bEnable ) { SvLBox::EnableInplaceEditing( bEnable ); } @@ -524,7 +524,7 @@ void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem, Selection aSel( SELECTION_MIN, SELECTION_MAX ); if ( EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); EditItemText( pEntry, (SvLBoxString*)pItem, aSel ); } } @@ -537,7 +537,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?"); pCurEdEntry = pEntry; pCurEdItem = pItem; - Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,TRUE )); + Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,sal_True )); aRect.Bottom() += 4; pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen! @@ -564,7 +564,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, #endif #endif // OS2 - EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, TRUE ); + EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, sal_True ); } void SvIconView::EditEntry( SvLBoxEntry* pEntry ) @@ -579,7 +579,7 @@ void SvIconView::EditEntry( SvLBoxEntry* pEntry ) Selection aSel( SELECTION_MIN, SELECTION_MAX ); if( EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); EditItemText( pEntry, pItem, aSel ); } } @@ -599,14 +599,14 @@ void SvIconView::EditedText( const XubString& rStr ) } -BOOL SvIconView::EditingEntry( SvLBoxEntry*, Selection& ) +sal_Bool SvIconView::EditingEntry( SvLBoxEntry*, Selection& ) { - return TRUE; + return sal_True; } -BOOL SvIconView::EditedEntry( SvLBoxEntry*, const XubString& ) +sal_Bool SvIconView::EditedEntry( SvLBoxEntry*, const XubString& ) { - return TRUE; + return sal_True; } @@ -659,9 +659,9 @@ Region SvIconView::GetDragRegion() const return aRegion; } -ULONG SvIconView::GetSelectionCount() const +sal_uLong SvIconView::GetSelectionCount() const { - return (ULONG)(pImp->GetSelectionCount()); + return (sal_uLong)(pImp->GetSelectionCount()); } void SvIconView::SetGrid( long nDX, long nDY ) @@ -669,18 +669,18 @@ void SvIconView::SetGrid( long nDX, long nDY ) pImp->SetGrid( nDX, nDY ); } -void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvIconView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uLong nPos ) { SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos ); switch( nActionId ) { case LISTACTION_RESORTING: - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); break; case LISTACTION_RESORTED: - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); Arrange(); break; @@ -692,9 +692,9 @@ void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, } -void SvIconView::Scroll( long nDeltaX, long nDeltaY, USHORT ) +void SvIconView::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 ) { - pImp->Scroll( nDeltaX, nDeltaY, FALSE ); + pImp->Scroll( nDeltaX, nDeltaY, sal_False ); } void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt ) @@ -705,7 +705,7 @@ void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt ) void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos ) { pImp->SttDrag( rPos ); - SvLBoxEntry* pEntry = GetEntry( rPos, TRUE ); + SvLBoxEntry* pEntry = GetEntry( rPos, sal_True ); pImp->mpViewData = pEntry; SvLBox::StartDrag( nAction, rPos ); } @@ -751,14 +751,14 @@ void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ) pImp->HideShowDDIcon( pRefEntry, rPos ); } -void SvIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, +void SvIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pRects, short nOffs ) { pImp->SelectRect( rRect, bAdd, pRects, nOffs ); } void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY, - BOOL b, USHORT nBorderWidth ) + sal_Bool b, sal_uInt16 nBorderWidth ) { pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth ); } @@ -782,7 +782,7 @@ void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry ) pImp->AdjustAtGrid( pEntry ); } -void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock ) +void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock ) { SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry ); if( bLock ) @@ -791,7 +791,7 @@ void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock ) pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED ); } -BOOL SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const +sal_Bool SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const { const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry ); return pViewData->IsEntryPosLocked(); @@ -807,14 +807,14 @@ SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const return pImp->GetTextMode( pEntry ); } -SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const +SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry ); } -SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const +SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 74c6bb163797..7d63304203cd 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -71,7 +71,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pView = pLBView; pTree = pLBTree; aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet ); - aSelEng.ExpandSelectionOnMouseMove( FALSE ); + aSelEng.ExpandSelectionOnMouseMove( sal_False ); SetStyle( nWinStyle ); SetSelectionMode( SINGLE_SELECTION ); SetDragDropMode( 0 ); @@ -97,7 +97,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n nYoffsNodeBmp = 0; nNodeBmpWidth = 0; - bAsyncBeginDrag = FALSE; + bAsyncBeginDrag = sal_False; aAsyncBeginDragTimer.SetTimeout( 0 ); aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl)); // Button-Animation in Listbox @@ -115,11 +115,11 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pMostRightEntry = 0; nCurUserEvent = 0xffffffff; - bUpdateMode = TRUE; - bInVScrollHdl = FALSE; + bUpdateMode = sal_True; + bInVScrollHdl = sal_False; nFlags |= F_FILLING; - bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = FALSE; + bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = sal_False; } SvImpLBox::~SvImpLBox() @@ -163,7 +163,7 @@ short SvImpLBox::UpdateContextBmpWidthVector( SvLBoxEntry* pEntry, short nWidth { DBG_ASSERT( pView->pModel, "View and Model aren't valid!" ); - USHORT nDepth = pView->pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry ); // initialize vector if necessary std::vector< short >::size_type nSize = aContextBmpWidthVector.size(); while ( nDepth > nSize ) @@ -211,7 +211,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvLBoxEntry* pEntry ) void SvImpLBox::UpdateContextBmpWidthMax( SvLBoxEntry* pEntry ) { - USHORT nDepth = pView->pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry ); if( aContextBmpWidthVector.size() < 1 ) return; short nWidth = aContextBmpWidthVector[ nDepth ]; @@ -246,7 +246,7 @@ void SvImpLBox::SetStyle( WinBits i_nWinStyle ) { m_nStyle = i_nWinStyle; if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) ) - aSelEng.AddAlways( TRUE ); + aSelEng.AddAlways( sal_True ); } void SvImpLBox::SetExtendedWindowBits( ExtendedWinBits _nBits ) @@ -333,11 +333,11 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) nFlags &= (~F_FILLING); - bInVScrollHdl = TRUE; + bInVScrollHdl = sal_True; if( pView->IsEditingActive() ) { - pView->EndEditing( TRUE ); // Cancel + pView->EndEditing( sal_True ); // Cancel pView->Update(); } BeginScroll(); @@ -347,7 +347,7 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) if( nDelta == 1 ) CursorDown(); else - PageDown( (USHORT) nDelta ); + PageDown( (sal_uInt16) nDelta ); } else { @@ -355,9 +355,9 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) if( nDelta == 1 ) CursorUp(); else - PageUp( (USHORT) nDelta ); + PageUp( (sal_uInt16) nDelta ); } - bInVScrollHdl = FALSE; + bInVScrollHdl = sal_False; return 0; } @@ -369,13 +369,13 @@ void SvImpLBox::CursorDown() { nFlags &= (~F_FILLING); pView->NotifyScrolling( -1 ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Update(); pStartEntry = pNextFirstToDraw; Rectangle aArea( GetVisibleArea() ); pView->Scroll( 0, -(pView->GetEntryHeight()), aArea, SCROLL_NOCHILDREN ); pView->Update(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->NotifyScrolled(); } } @@ -388,31 +388,31 @@ void SvImpLBox::CursorUp() nFlags &= (~F_FILLING); long nEntryHeight = pView->GetEntryHeight(); pView->NotifyScrolling( 1 ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Update(); pStartEntry = pPrevFirstToDraw; Rectangle aArea( GetVisibleArea() ); aArea.Bottom() -= nEntryHeight; pView->Scroll( 0, nEntryHeight, aArea, SCROLL_NOCHILDREN ); pView->Update(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->NotifyScrolled(); } } -void SvImpLBox::PageDown( USHORT nDelta ) +void SvImpLBox::PageDown( sal_uInt16 nDelta ) { - USHORT nRealDelta = nDelta; + sal_uInt16 nRealDelta = nDelta; if( !nDelta ) return; SvLBoxEntry* pNext; pNext = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nRealDelta )); - if( (ULONG)pNext == (ULONG)pStartEntry ) + if( (sal_uLong)pNext == (sal_uLong)pStartEntry ) return; - ShowCursor( FALSE ); + ShowCursor( sal_False ); nFlags &= (~F_FILLING); pView->Update(); @@ -436,21 +436,21 @@ void SvImpLBox::PageDown( USHORT nDelta ) pView->NotifyScrolled(); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } -void SvImpLBox::PageUp( USHORT nDelta ) +void SvImpLBox::PageUp( sal_uInt16 nDelta ) { - USHORT nRealDelta = nDelta; + sal_uInt16 nRealDelta = nDelta; if( !nDelta ) return; SvLBoxEntry* pPrev = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry, nRealDelta )); - if( (ULONG)pPrev == (ULONG)pStartEntry ) + if( (sal_uLong)pPrev == (sal_uLong)pStartEntry ) return; nFlags &= (~F_FILLING); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Update(); pStartEntry = pPrev; @@ -470,10 +470,10 @@ void SvImpLBox::PageUp( USHORT nDelta ) pView->NotifyScrolled(); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } -void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll ) +void SvImpLBox::KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll ) { if( !aVerSBar.IsVisible() ) return; @@ -507,7 +507,7 @@ void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll ) } -void SvImpLBox::KeyDown( BOOL bPageDown, BOOL bNotifyScroll ) +void SvImpLBox::KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll ) { if( !aVerSBar.IsVisible() ) return; @@ -582,15 +582,15 @@ void SvImpLBox::InvalidateEntry( SvLBoxEntry* pEntry ) } if( !(nFlags & F_IN_PAINT )) { - BOOL bHasFocusRect = FALSE; + sal_Bool bHasFocusRect = sal_False; if( pEntry==pCursor && pView->HasFocus() ) { - bHasFocusRect = TRUE; - ShowCursor( FALSE ); + bHasFocusRect = sal_True; + ShowCursor( sal_False ); } InvalidateEntry( GetEntryLine( pEntry ) ); if( bHasFocusRect ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -615,7 +615,7 @@ void SvImpLBox::RecalcFocusRect() // Setzt Cursor. Passt bei SingleSelection die Selektion an // -void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) +void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) { SvViewDataEntry* pViewDataNewCur = 0; if( pEntry ) @@ -638,18 +638,18 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) SvLBoxEntry* pOldCursor = pCursor; if( pCursor && pEntry != pCursor ) { - pView->SetEntryFocus( pCursor, FALSE ); + pView->SetEntryFocus( pCursor, sal_False ); if( bSimpleTravel ) - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); pView->HideFocus(); } pCursor = pEntry; if( pCursor ) { - pViewDataNewCur->SetFocus( TRUE ); + pViewDataNewCur->SetFocus( sal_True ); if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode()) { - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } // Mehrfachselektion: Im Cursor-Move selektieren, wenn // nicht im Add-Mode (Ctrl-F8) @@ -658,11 +658,11 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) !(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() && !bForceNoSelect ) { - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } else { - ShowCursor( TRUE ); + ShowCursor( sal_True ); } if( pAnchor ) @@ -676,7 +676,7 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) pView->OnCurrentEntryChanged(); } -void SvImpLBox::ShowCursor( BOOL bShow ) +void SvImpLBox::ShowCursor( sal_Bool bShow ) { if( !bShow || !pCursor || !pView->HasFocus() ) { @@ -701,8 +701,8 @@ void SvImpLBox::ShowCursor( BOOL bShow ) -void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView, - BOOL bUpdateVerScrollBar ) +void SvImpLBox::UpdateAll( sal_Bool bInvalidateCompleteView, + sal_Bool bUpdateVerScrollBar ) { if( bUpdateVerScrollBar ) FindMostRight(0); @@ -711,8 +711,8 @@ void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView, FillView(); ShowVerSBar(); if( bSimpleTravel && pCursor && pView->HasFocus() ) - pView->Select( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->Select( pCursor, sal_True ); + ShowCursor( sal_True ); if( bInvalidateCompleteView ) pView->Invalidate(); else @@ -726,7 +726,7 @@ IMPL_LINK_INLINE_START( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar ) { if( pView->IsEditingActive() ) { - pView->EndEditing( TRUE ); // Cancel + pView->EndEditing( sal_True ); // Cancel pView->Update(); } pView->nFocusWidth = -1; @@ -743,7 +743,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) BeginScroll(); nFlags &= (~F_FILLING); pView->NotifyScrolling( 0 ); // 0 == horizontales Scrolling - ShowCursor( FALSE ); + ShowCursor( sal_False ); // neuen Origin berechnen long nPos = aHorSBar.GetThumbPos(); @@ -761,7 +761,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) else pView->Invalidate(); RecalcFocusRect(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->NotifyScrolled(); } @@ -780,8 +780,8 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const if( pView->GetEntryCount() == 0 || !pStartEntry || !pView->GetEntryHeight()) return 0; - USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() ); - USHORT nTemp = nClickedEntry; + sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() ); + sal_uInt16 nTemp = nClickedEntry; SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp )); return pEntry; } @@ -790,13 +790,13 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const // prueft, ob der Eintrag "richtig" getroffen wurde // (Focusrect+ ContextBitmap bei TreeListBox) // -BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine) +sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine) { - BOOL bRet; + sal_Bool bRet; // bei "besonderen" Entries (mit CheckButtons usw.) sind wir // nicht so pingelig if( pEntry->ItemCount() >= 3 ) - return TRUE; + return sal_True; Rectangle aRect( pView->GetFocusRect( pEntry, nLine )); aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X(); @@ -809,9 +809,9 @@ BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long n Point aPos( rPosPixel ); aPos -= pView->GetMapMode().GetOrigin(); if( aRect.IsInside( aPos ) ) - bRet = TRUE; + bRet = sal_True; else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -824,8 +824,8 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const || !pView->GetEntryHeight()) return 0; - USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() ); - USHORT nTemp = nClickedEntry; + sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() ); + sal_uInt16 nTemp = nClickedEntry; SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp )); if( nTemp != nClickedEntry ) pEntry = 0; @@ -833,7 +833,7 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const } -SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll) +SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,sal_Bool bNotifyScroll) { if( !pCursor ) return 0; @@ -848,19 +848,19 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll) pEntry = (SvLBoxEntry*)(pView->NextVisible( pCursor )); if( pEntry && pEntry != pCursor ) - pView->SetEntryFocus( pCursor, FALSE ); + pView->SetEntryFocus( pCursor, sal_False ); if( nY < 0 ) - KeyUp( FALSE, bNotifyScroll ); + KeyUp( sal_False, bNotifyScroll ); else - KeyDown( FALSE, bNotifyScroll ); + KeyDown( sal_False, bNotifyScroll ); } else { pEntry = GetClickedEntry( rPoint ); if( !pEntry ) { - USHORT nSteps = 0xFFFF; + sal_uInt16 nSteps = 0xFFFF; // LastVisible ist noch nicht implementiert! pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nSteps )); } @@ -869,7 +869,7 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll) if( pEntry != pCursor && aSelEng.GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); } } return pEntry; @@ -897,11 +897,11 @@ void SvImpLBox::Paint( const Rectangle& rRect ) SvLBoxEntry* pFirst = pView->First(); if( pFirst != pStartEntry ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); pStartEntry = pView->First(); aVerSBar.SetThumbPos( 0 ); StopUserEvent(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)1); return; } @@ -913,8 +913,8 @@ void SvImpLBox::Paint( const Rectangle& rRect ) } #ifdef XX_OV - ULONG nXAbsPos = (USHORT)pTree->GetAbsPos( pStartEntry ); - ULONG nXVisPos = pView->GetVisiblePos( pStartEntry ); + sal_uLong nXAbsPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry ); + sal_uLong nXVisPos = pView->GetVisiblePos( pStartEntry ); SvLBoxString* pXStr = (SvLBoxString*)pStartEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING); #endif @@ -927,8 +927,8 @@ void SvImpLBox::Paint( const Rectangle& rRect ) long nEntryHeight = pView->GetEntryHeight(); // Bereich der zu zeichnenden Entries berechnen - USHORT nStartLine = (USHORT)( rRect.Top() / nEntryHeight ); - USHORT nCount = (USHORT)( nRectHeight / nEntryHeight ); + sal_uInt16 nStartLine = (sal_uInt16)( rRect.Top() / nEntryHeight ); + sal_uInt16 nCount = (sal_uInt16)( nRectHeight / nEntryHeight ); nCount += 2; // keine Zeile vergessen long nY = nStartLine * nEntryHeight; @@ -948,10 +948,10 @@ void SvImpLBox::Paint( const Rectangle& rRect ) pView->SetClipRegion( aClipRegion ); - for( USHORT n=0; n< nCount && pEntry; n++ ) + for( sal_uInt16 n=0; n< nCount && pEntry; n++ ) { /*long nMaxRight=*/ - pView->PaintEntry1( pEntry, nY, 0xffff, TRUE ); + pView->PaintEntry1( pEntry, nY, 0xffff, sal_True ); nY += nEntryHeight; pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } @@ -959,7 +959,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) if ( !pCursor && ( ( nExtendedWinBits & EWB_NO_AUTO_CURENTRY ) == 0 ) ) { // do not select if multiselection or explicit set - BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) + sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION ); SetCursor( pStartEntry, bNotSelect ); } @@ -975,12 +975,12 @@ void SvImpLBox::Paint( const Rectangle& rRect ) nFlags &= (~F_IN_PAINT); } -void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) +void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) { if( !pEntry ) return; - BOOL bInView = IsEntryInView( pEntry ); + sal_Bool bInView = IsEntryInView( pEntry ); if( bInView && (!bMoveToTop || pStartEntry == pEntry) ) return; // ist schon sichtbar @@ -997,7 +997,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) if( !pView->IsExpanded( pParent ) ) { #ifdef DBG_UTIL - BOOL bRet = + sal_Bool bRet = #endif pView->Expand( pParent ); DBG_ASSERT(bRet,"Not expanded!"); @@ -1011,10 +1011,10 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) } pStartEntry = pEntry; - ShowCursor( FALSE ); + ShowCursor( sal_False ); FillView(); aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->Invalidate(); } @@ -1030,21 +1030,21 @@ void SvImpLBox::RepaintSelectionItems() if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID ) SetNodeBmpTabDistance(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); long nEntryHeight = pView->GetEntryHeight(); - ULONG nCount = nVisibleCount; + sal_uLong nCount = nVisibleCount; long nY = 0; SvLBoxEntry* pEntry = pStartEntry; - for( ULONG n=0; n< nCount && pEntry; n++ ) + for( sal_uLong n=0; n< nCount && pEntry; n++ ) { pView->PaintEntry1( pEntry, nY, 0xffff ); //wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); nY += nEntryHeight; pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } @@ -1080,7 +1080,7 @@ void SvImpLBox::DrawNet() SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab(); while( pTree->GetDepth( pEntry ) > 0 ) pEntry = pView->GetParent( pEntry ); - USHORT nOffs = (USHORT)(pView->GetVisiblePos( pStartEntry ) - + sal_uInt16 nOffs = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ) - pView->GetVisiblePos( pEntry )); long nY = 0; nY -= ( nOffs * nEntryHeight ); @@ -1095,12 +1095,12 @@ void SvImpLBox::DrawNet() aCol = rStyleSettings.GetShadowColor(); pView->SetLineColor( aCol ); Point aPos1, aPos2; - USHORT nDistance; - ULONG nMax = nVisibleCount + nOffs + 1; + sal_uInt16 nDistance; + sal_uLong nMax = nVisibleCount + nOffs + 1; const Image& rExpandedNodeBitmap = GetExpandedNodeBmp(); - for( ULONG n=0; n< nMax && pEntry; n++ ) + for( sal_uLong n=0; n< nMax && pEntry; n++ ) { if( pView->IsExpanded(pEntry) ) { @@ -1116,7 +1116,7 @@ void SvImpLBox::DrawNet() pChild = pView->FirstChild( pEntry ); DBG_ASSERT(pChild,"Child?"); pChild = pTree->LastSibling( pChild ); - nDistance = (USHORT)(pView->GetVisiblePos(pChild) - + nDistance = (sal_uInt16)(pView->GetVisiblePos(pChild) - pView->GetVisiblePos(pEntry)); aPos2 = aPos1; aPos2.Y() += nDistance * nEntryHeight; @@ -1171,7 +1171,7 @@ static long GetOptSize( TabBar* pTabBar ) return pTabBar->CalcWindowSizePixel().Width(); } -void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask ) +void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask ) { long nOverlap = 0; @@ -1229,19 +1229,19 @@ void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask ) } // nResult: Bit0 == VerSBar Bit1 == HorSBar -USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) +sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) { long nEntryHeight = pView->GetEntryHeight(); if( !nEntryHeight ) return 0; - USHORT nResult = 0; + sal_uInt16 nResult = 0; Size aOSize( pView->Control::GetOutputSizePixel() ); const WinBits nWindowStyle = pView->GetStyle(); - BOOL bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0; - BOOL bHorBar = FALSE; + sal_Bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0; + sal_Bool bHorBar = sal_False; long nMaxRight = aOSize.Width(); //GetOutputSize().Width(); Point aOrigin( pView->GetMapMode().GetOrigin() ); aOrigin.X() *= -1; @@ -1250,10 +1250,10 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) if( pTabBar || ( (nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) )) - bHorBar = TRUE; + bHorBar = sal_True; // Anzahl aller nicht eingeklappten Eintraege - ULONG nTotalCount = pView->GetVisibleCount(); + sal_uLong nTotalCount = pView->GetVisibleCount(); // Anzahl in der View sichtbarer Eintraege nVisibleCount = aOSize.Height() / nEntryHeight; @@ -1268,7 +1268,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) { if( (nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) ) - bHorBar = TRUE; + bHorBar = sal_True; } } @@ -1331,7 +1331,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) nTemp = nNewThumbPos - nTemp; if( pView->IsEditingActive() ) { - pView->EndEditing( TRUE ); // Cancel + pView->EndEditing( sal_True ); // Cancel pView->Update(); } pView->nFocusWidth = -1; @@ -1387,23 +1387,23 @@ void SvImpLBox::FillView() { if( !pStartEntry ) { - USHORT nVisibleViewCount = (USHORT)(pView->GetVisibleCount()); - USHORT nTempThumb = (USHORT)aVerSBar.GetThumbPos(); + sal_uInt16 nVisibleViewCount = (sal_uInt16)(pView->GetVisibleCount()); + sal_uInt16 nTempThumb = (sal_uInt16)aVerSBar.GetThumbPos(); if( nTempThumb >= nVisibleViewCount ) nTempThumb = nVisibleViewCount - 1; pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb)); } if( pStartEntry ) { - USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); - USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry )); - USHORT nCurDispEntries = nLast-nThumb+1; + sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); + sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); + sal_uInt16 nCurDispEntries = nLast-nThumb+1; if( nCurDispEntries < nVisibleCount ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); // Fenster fuellen, indem der Thumb schrittweise // nach oben bewegt wird - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; SvLBoxEntry* pTemp = pStartEntry; while( nCurDispEntries < nVisibleCount && pTemp ) { @@ -1413,13 +1413,13 @@ void SvImpLBox::FillView() nThumb--; pStartEntry = pTemp; nCurDispEntries++; - bFound = TRUE; + bFound = sal_True; } } if( bFound ) { aVerSBar.SetThumbPos( nThumb ); - ShowCursor( TRUE ); // Focusrect neu berechnen + ShowCursor( sal_True ); // Focusrect neu berechnen pView->Invalidate(); } } @@ -1431,11 +1431,11 @@ void SvImpLBox::FillView() void SvImpLBox::ShowVerSBar() { - BOOL bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0; - ULONG nVis = 0; + sal_Bool bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0; + sal_uLong nVis = 0; if( !bVerBar ) nVis = pView->GetVisibleCount(); - if( bVerBar || (nVisibleCount && nVis > (ULONG)(nVisibleCount-1)) ) + if( bVerBar || (nVisibleCount && nVis > (sal_uLong)(nVisibleCount-1)) ) { if( !aVerSBar.IsVisible() ) { @@ -1504,18 +1504,18 @@ void SvImpLBox::SyncVerThumb() aVerSBar.SetThumbPos( 0 ); } -BOOL SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const +sal_Bool SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const { // Parent eingeklappt if( !pView->IsEntryVisible(pEntry) ) - return FALSE; + return sal_False; long nY = GetEntryLine( pEntry ); if( nY < 0 ) - return FALSE; + return sal_False; long nMax = nVisibleCount * pView->GetEntryHeight(); if( nY >= nMax ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } @@ -1558,10 +1558,10 @@ void SvImpLBox::IndentChanged( short /* nIndentPixel */ ) {} void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry ) { - // SelAllDestrAnch( FALSE, TRUE ); //DeselectAll(); + // SelAllDestrAnch( sal_False, sal_True ); //DeselectAll(); if( GetUpdateMode() ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); long nY = GetEntryLine( pEntry ); if( IsLineVisible(nY) ) { @@ -1573,7 +1573,7 @@ void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry ) // die Thumb-Position korrigiert werden. SyncVerThumb(); ShowVerSBar(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -1582,7 +1582,7 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) ) return; - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) ) { @@ -1592,13 +1592,13 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) if( pStartEntry ) { long nOldThumbPos = aVerSBar.GetThumbPos(); - ULONG nVisList = pView->GetVisibleCount(); + sal_uLong nVisList = pView->GetVisibleCount(); aVerSBar.SetRange( Range(0, nVisList-1) ); long nNewThumbPos = aVerSBar.GetThumbPos(); if( nNewThumbPos != nOldThumbPos ) { pStartEntry = pView->First(); - USHORT nDistance = (USHORT)nNewThumbPos; + sal_uInt16 nDistance = (sal_uInt16)nNewThumbPos; if( nDistance ) pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nDistance)); @@ -1614,9 +1614,9 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) SetCursor( pEntry ); if( GetUpdateMode() ) ShowVerSBar(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); if( GetUpdateMode() && pCursor ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry ) @@ -1624,7 +1624,7 @@ void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) || !pStartEntry ) return; - SelAllDestrAnch( FALSE, TRUE ); // deselectall + SelAllDestrAnch( sal_False, sal_True ); // deselectall // ist der eingeklappte Parent sichtbar ? long nY = GetEntryLine( pEntry ); @@ -1667,7 +1667,7 @@ void SvImpLBox::SetNodeBmpTabDistance() // // korrigiert bei SingleSelection den Cursor // -void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) +void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) { if( nFlags & F_IGNORE_SELECT ) return; @@ -1694,9 +1694,9 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) long nY = GetEntryLine( pEntry ); if( IsLineVisible( nY ) ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } } @@ -1740,14 +1740,14 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry ) if( pCursor && pCursor == pEntry ) { if( bSimpleTravel ) - pView->Select( pCursor, FALSE ); - ShowCursor( FALSE ); // Focus-Rect weg + pView->Select( pCursor, sal_False ); + ShowCursor( sal_False ); // Focus-Rect weg // NextSibling, weil auch Childs des Cursors geloescht werden pTemp = pView->NextSibling( pCursor ); if( !pTemp ) pTemp = (SvLBoxEntry*)(pView->PrevVisible( pCursor )); - SetCursor( pTemp, TRUE ); + SetCursor( pTemp, sal_True ); } if( pStartEntry && pStartEntry == pEntry ) { @@ -1780,10 +1780,10 @@ void SvImpLBox::EntryRemoved() if( !pStartEntry ) pStartEntry = pTree->First(); if( !pCursor ) - SetCursor( pStartEntry, TRUE ); + SetCursor( pStartEntry, sal_True ); if( pCursor && (bSimpleTravel || !pView->GetSelectionCount() )) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); if( GetUpdateMode()) { @@ -1811,9 +1811,9 @@ void SvImpLBox::EntryRemoved() MakeVisible( pCursor ); } else - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT); } @@ -1822,12 +1822,12 @@ void SvImpLBox::EntryRemoved() void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry ) { int bDeselAll = nFlags & F_DESEL_ALL; - SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); + SelAllDestrAnch( sal_False, sal_True ); // DeselectAll(); if( !bDeselAll ) nFlags &= (~F_DESEL_ALL); if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( IsEntryInView( pEntry ) ) pView->Invalidate(); if( pEntry == pStartEntry ) @@ -1860,8 +1860,8 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) pStartEntry = pView->First(); aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1)); - USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry ); - USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry ); + sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry ); + sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry ); FindMostRight(0); if( nNewPos < nFirstPos ) //!!!Notloesung pStartEntry = pEntry; @@ -1870,7 +1870,7 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) if( pEntry == pCursor ) { if( pView->IsEntryVisible( pCursor ) ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); else { SvLBoxEntry* pParent = pEntry; @@ -1900,16 +1900,16 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) return; int bDeselAll = nFlags & F_DESEL_ALL; if( bDeselAll ) - SelAllDestrAnch( FALSE, TRUE ); + SelAllDestrAnch( sal_False, sal_True ); else DestroyAnchor(); // nFlags &= (~F_DESEL_ALL); -// ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt +// ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt long nY = GetEntryLine( pEntry ); - BOOL bEntryVisible = IsLineVisible( nY ); + sal_Bool bEntryVisible = IsLineVisible( nY ); if( bEntryVisible ) { - ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt + ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt nY -= pView->GetEntryHeight(); // wg. Linien InvalidateEntriesFrom( nY ); } @@ -1918,9 +1918,9 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // pruefen, ob die View komplett gefuellt ist. Wenn // nicht, dann pStartEntry und den Cursor anpassen // (automatisches scrollen) - USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); - USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry )); - USHORT nCurDispEntries = nLast-nThumb+1; + sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); + sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); + sal_uInt16 nCurDispEntries = nLast-nThumb+1; if( nCurDispEntries < nVisibleCount ) { // beim naechsten Paint-Event setzen @@ -1953,7 +1953,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1)); SyncVerThumb(); // falls vor Thumb eingefuegt wurde ShowVerSBar(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); if( pStartEntry != pView->First() && (nFlags & F_FILLING) ) pView->Update(); } @@ -1968,7 +1968,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // ****** Steuerung der Controlanimation -BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry, +sal_Bool SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long nY ) { SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab); @@ -1979,18 +1979,18 @@ BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry if( pCursor == pActiveEntry ) pView->HideFocus(); pView->CaptureMouse(); - pActiveButton->SetStateHilighted( TRUE ); + pActiveButton->SetStateHilighted( sal_True ); pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_RIGHT ); - return TRUE; + return sal_True; } else pActiveButton = 0; - return FALSE; + return sal_False; } -BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry) +sal_Bool SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry) { if( pActiveButton ) { @@ -2001,7 +2001,7 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry { if( !pActiveButton->IsStateHilighted() ) { - pActiveButton->SetStateHilighted(TRUE ); + pActiveButton->SetStateHilighted(sal_True ); nY = GetEntryLine( pActiveEntry ); pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | @@ -2012,24 +2012,24 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry { if( pActiveButton->IsStateHilighted() ) { - pActiveButton->SetStateHilighted(FALSE ); + pActiveButton->SetStateHilighted(sal_False ); nY = GetEntryLine( pActiveEntry ); pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE ); } } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) +sal_Bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) { if( pActiveButton ) { pView->ReleaseMouse(); SvLBoxEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() ); long nY = GetEntryLine( pActiveEntry ); - pActiveButton->SetStateHilighted( FALSE ); + pActiveButton->SetStateHilighted( sal_False ); long nMouseX = rMEvt.GetPosPixel().X(); if( pEntry == pActiveEntry && pView->GetItem( pActiveEntry, nMouseX ) == pActiveButton ) @@ -2038,26 +2038,26 @@ BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_RIGHT ); if( pCursor == pActiveEntry ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); pActiveButton = 0; pActiveEntry = 0; pActiveTab = 0; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ******* Steuerung Plus/Minus-Button zum Expandieren/Kollabieren -// FALSE == kein Expand/Collapse-Button getroffen -BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const +// sal_False == kein Expand/Collapse-Button getroffen +sal_Bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const { if( !pEntry->HasChilds() && !pEntry->HasChildsOnDemand() ) - return FALSE; + return sal_False; SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab(); if( !pFirstDynamicTab ) - return FALSE; + return sal_False; long nMouseX = rPosPixel.X(); // in Doc-Koords umrechnen @@ -2067,26 +2067,26 @@ BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) cons long nX = pView->GetTabPos( pEntry, pFirstDynamicTab); nX += nNodeBmpTabDistance; if( nMouseX < nX ) - return FALSE; + return sal_False; nX += nNodeBmpWidth; if( nMouseX > nX ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -// FALSE == hit no node button -BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ ) +// sal_False == hit no node button +sal_Bool SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( pView->IsEditingActive() && pEntry == pView->pEdEntry ) // inplace editing -> nothing to do - bRet = TRUE; + bRet = sal_True; else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) ) { if ( pView->IsExpanded( pEntry ) ) { - pView->EndEditing( TRUE ); + pView->EndEditing( sal_True ); pView->Collapse( pEntry ); } else @@ -2094,7 +2094,7 @@ BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEn // you can expand an entry, which is in editing pView->Expand( pEntry ); } - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -2161,7 +2161,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) { // neu selektieren & tschuess if( !bSimpleTravel && !aSelEng.IsAlwaysAdding()) - SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); + SelAllDestrAnch( sal_False, sal_True ); // DeselectAll(); SetCursor( pEntry ); return; @@ -2174,7 +2174,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) pView->Expand( pEntry ); if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde // (Nodebutton ist kein Entryitem!) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); return; } } @@ -2182,7 +2182,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) else { // CheckButton? (TreeListBox: Check + Info) - if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == TRUE) + if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == sal_True) return; // Inplace-Editing? #if 0 @@ -2232,28 +2232,28 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt) return; } -BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) +sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) { aEditTimer.Stop(); const KeyCode& rKeyCode = rKEvt.GetKeyCode(); if( rKeyCode.IsMod2() ) - return FALSE; // Alt-Taste nicht auswerten + return sal_False; // Alt-Taste nicht auswerten nFlags &= (~F_FILLING); if( !pCursor ) pCursor = pStartEntry; if( !pCursor ) - return FALSE; + return sal_False; - BOOL bKeyUsed = TRUE; + sal_Bool bKeyUsed = sal_True; - USHORT nDelta = (USHORT)aVerSBar.GetPageSize(); - USHORT aCode = rKeyCode.GetCode(); + sal_uInt16 nDelta = (sal_uInt16)aVerSBar.GetPageSize(); + sal_uInt16 aCode = rKeyCode.GetCode(); - BOOL bShift = rKeyCode.IsShift(); - BOOL bMod1 = rKeyCode.IsMod1(); + sal_Bool bShift = rKeyCode.IsShift(); + sal_Bool bMod1 = rKeyCode.IsMod1(); SvLBoxEntry* pNewCursor; @@ -2285,7 +2285,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) aSelEng.CursorPosChanging( bShift, bMod1 ); SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on if( !IsEntryInView( pNewCursor ) ) - KeyUp( FALSE ); + KeyUp( sal_False ); } break; @@ -2318,13 +2318,13 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) else { if( pCursor ) - pView->Select( pCursor, FALSE ); - KeyDown( FALSE ); + pView->Select( pCursor, sal_False ); + KeyDown( sal_False ); SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on } } else - KeyDown( FALSE ); // weil ScrollBar-Range evtl. noch + KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch // scrollen erlaubt break; @@ -2337,7 +2337,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) ) { ++nCurTabPos; - ShowCursor( TRUE ); + ShowCursor( sal_True ); CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } @@ -2357,7 +2357,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; } @@ -2368,7 +2368,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if ( nCurTabPos > FIRST_ENTRY_TAB ) { --nCurTabPos; - ShowCursor( TRUE ); + ShowCursor( sal_True ); CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } @@ -2400,7 +2400,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) else if( bSubLstOpLR && IsExpandable() ) pView->Collapse( pCursor ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; } @@ -2417,19 +2417,19 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( nDelta ) { - DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?"); + DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?"); aSelEng.CursorPosChanging( bShift, bMod1 ); if( IsEntryInView( pNewCursor ) ) SetCursor( pNewCursor ); else { SetCursor( pNewCursor ); - KeyUp( TRUE ); + KeyUp( sal_True ); } } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_PAGEDOWN: @@ -2445,21 +2445,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( nDelta ) { - DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?"); + DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?"); aSelEng.CursorPosChanging( bShift, bMod1 ); if( IsEntryInView( pNewCursor ) ) SetCursor( pNewCursor ); else { SetCursor( pNewCursor ); - KeyDown( TRUE ); + KeyDown( sal_True ); } } else - KeyDown( FALSE ); // siehe KEY_DOWN + KeyDown( sal_False ); // siehe KEY_DOWN } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SPACE: @@ -2480,17 +2480,17 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } else if ( !pView->IsSelected( pCursor ) ) { - SelAllDestrAnch( FALSE ); - pView->Select( pCursor, TRUE ); + SelAllDestrAnch( sal_False ); + pView->Select( pCursor, sal_True ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_RETURN: @@ -2502,7 +2502,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) pView->Expand( pCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_F2: @@ -2512,7 +2512,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) EditTimerCall( 0 ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_F8: @@ -2520,12 +2520,12 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) !(m_nStyle & WB_SIMPLEMODE)) { if( aSelEng.IsAlwaysAdding() ) - aSelEng.AddAlways( FALSE ); + aSelEng.AddAlways( sal_False ); else - aSelEng.AddAlways( TRUE ); + aSelEng.AddAlways( sal_True ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; @@ -2548,7 +2548,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) pView->Expand( pCursor ); if( bMod1 ) { - USHORT nRefDepth = pTree->GetDepth( pCursor ); + sal_uInt16 nRefDepth = pTree->GetDepth( pCursor ); SvLBoxEntry* pCur = pTree->Next( pCursor ); while( pCur && pTree->GetDepth(pCur) > nRefDepth ) { @@ -2559,14 +2559,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_A: if( bMod1 ) - SelAllDestrAnch( TRUE ); + SelAllDestrAnch( sal_True ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SUBTRACT: @@ -2580,7 +2580,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) SvLBoxEntry* pParentToCollapse = (SvLBoxEntry*)pTree->GetRootLevelParent(pCursor); if( pParentToCollapse ) { - USHORT nRefDepth; + sal_uInt16 nRefDepth; // Sonderbehandlung Explorer: Befindet sich auf der // Root nur ein Eintrag,dann den Root-Entry nicht // einklappen @@ -2610,21 +2610,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_DIVIDE : if( bMod1 ) - SelAllDestrAnch( TRUE ); + SelAllDestrAnch( sal_True ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_COMMA : if( bMod1 ) - SelAllDestrAnch( FALSE ); + SelAllDestrAnch( sal_False ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_HOME : @@ -2637,14 +2637,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( pNewCursor && pNewCursor != pCursor ) { -// SelAllDestrAnch( FALSE ); +// SelAllDestrAnch( sal_False ); aSelEng.CursorPosChanging( bShift, bMod1 ); SetCursor( pNewCursor ); if( !IsEntryInView( pNewCursor ) ) MakeVisible( pNewCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_END : @@ -2657,14 +2657,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( pNewCursor && pNewCursor != pCursor) { -// SelAllDestrAnch( FALSE ); +// SelAllDestrAnch( sal_False ); aSelEng.CursorPosChanging( bShift, bMod1 ); SetCursor( pNewCursor ); if( !IsEntryInView( pNewCursor ) ) MakeVisible( pNewCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_ESCAPE: @@ -2673,18 +2673,18 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_BACKSPACE: // #105907# must not be handled because this quits dialogs and does other magic things... // if there are other single keys which should not be handled, they can be added here - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; default: // is there any reason why we should eat the events here? The only place where this is called - // is from SvTreeListBox::KeyInput. If we set bKeyUsed to TRUE here, then the key input + // is from SvTreeListBox::KeyInput. If we set bKeyUsed to sal_True here, then the key input // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection // handling. // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search" // handling, but actually there was no quick search handling anymore. We just re-implemented it.) // #i31275# / 2009-06-16 / frank.schoenheit@sun.com - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; } return bKeyUsed; @@ -2694,11 +2694,11 @@ void __EXPORT SvImpLBox::GetFocus() { if( pCursor ) { - pView->SetEntryFocus( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->SetEntryFocus( pCursor, sal_True ); + ShowCursor( sal_True ); // auskommentiert wg. deselectall // if( bSimpleTravel && !pView->IsSelected(pCursor) ) -// pView->Select( pCursor, TRUE ); +// pView->Select( pCursor, sal_True ); } if( m_nStyle & WB_HIDESELECTION ) { @@ -2715,7 +2715,7 @@ void __EXPORT SvImpLBox::GetFocus() SvViewData* pViewData = pView->GetViewData( pEntry ); if( pViewData->IsCursored() ) { - pViewData->SetCursored( FALSE ); + pViewData->SetCursored( sal_False ); InvalidateEntry( pEntry ); } pEntry = pView->GetModel()->Next( pEntry ); @@ -2730,8 +2730,8 @@ void __EXPORT SvImpLBox::LoseFocus() { aEditTimer.Stop(); if( pCursor ) - pView->SetEntryFocus( pCursor,FALSE ); - ShowCursor( FALSE ); + pView->SetEntryFocus( pCursor,sal_False ); + ShowCursor( sal_False ); if( m_nStyle & WB_HIDESELECTION ) { @@ -2739,7 +2739,7 @@ void __EXPORT SvImpLBox::LoseFocus() while( pEntry ) { //SvViewData* pViewData = pView->GetViewData( pEntry ); - //pViewData->SetCursored( TRUE ); + //pViewData->SetCursored( sal_True ); InvalidateEntry( pEntry ); pEntry = pView->NextSelected( pEntry ); } @@ -2751,7 +2751,7 @@ void __EXPORT SvImpLBox::LoseFocus() // SelectionEngine // ******************************************************************** -inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect ) +inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect ) { pView->Select( pEntry, bSelect ); } @@ -2797,7 +2797,7 @@ void __EXPORT ImpLBSelEng::CreateCursor() */ -BOOL __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor) +sal_Bool __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor) { SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint ); if( pNewCursor != pImp->pCursor ) @@ -2808,19 +2808,19 @@ BOOL __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelec // bei SimpleTravel wird in SetCursor selektiert und // der Select-Handler gerufen //if( !bDontSelectAtCursor && !pImp->bSimpleTravel ) - // pImp->SelectEntry( pNewCursor, TRUE ); + // pImp->SelectEntry( pNewCursor, sal_True ); pImp->SetCursor( pNewCursor, bDontSelectAtCursor ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL __EXPORT ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint ) +sal_Bool __EXPORT ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint ) { SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint ); if( pEntry ) return pView->IsSelected(pEntry); - return FALSE; + return sal_False; } void __EXPORT ImpLBSelEng::DeselectAtPoint( const Point& rPoint ) @@ -2828,7 +2828,7 @@ void __EXPORT ImpLBSelEng::DeselectAtPoint( const Point& rPoint ) SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint ); if( !pEntry ) return; - pImp->SelectEntry( pEntry, FALSE ); + pImp->SelectEntry( pEntry, sal_False ); } /* @@ -2837,13 +2837,13 @@ void __EXPORT ImpLBSelEng::SelectAtPoint( const Point& rPoint ) SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint ); if( !pEntry ) return; - pImp->SelectEntry( pEntry, TRUE ); + pImp->SelectEntry( pEntry, sal_True ); } */ void __EXPORT ImpLBSelEng::DeselectAll() { - pImp->SelAllDestrAnch( FALSE, FALSE ); // SelectionEngine nicht resetten! + pImp->SelAllDestrAnch( sal_False, sal_False ); // SelectionEngine nicht resetten! pImp->nFlags &= (~F_DESEL_ALL); } @@ -2854,9 +2854,9 @@ void __EXPORT ImpLBSelEng::DeselectAll() void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCursor) { SvLBoxEntry* pEntry; - ULONG nAnchorVisPos = pView->GetVisiblePos( pAnchor ); - ULONG nOldVisPos = pView->GetVisiblePos( pOldCursor ); - ULONG nNewVisPos = pView->GetVisiblePos( pNewCursor ); + sal_uLong nAnchorVisPos = pView->GetVisiblePos( pAnchor ); + sal_uLong nOldVisPos = pView->GetVisiblePos( pOldCursor ); + sal_uLong nNewVisPos = pView->GetVisiblePos( pNewCursor ); if( nOldVisPos > nAnchorVisPos || ( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) ) @@ -2866,11 +2866,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pOldCursor; while( pEntry && pEntry != pNewCursor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2879,20 +2879,20 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pAnchor; while( pEntry && pEntry != pOldCursor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = pNewCursor; while( pEntry && pEntry != pAnchor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2902,11 +2902,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); while( pEntry && pEntry != pOldCursor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); return; } } @@ -2917,11 +2917,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pNewCursor; while( pEntry && pEntry != pOldCursor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2930,19 +2930,19 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pOldCursor; while( pEntry && pEntry != pAnchor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = pAnchor; while( pEntry && pEntry != pNewCursor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2951,7 +2951,7 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pOldCursor; while( pEntry && pEntry != pNewCursor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } return; @@ -2959,8 +2959,8 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs } } -void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, - BOOL bSingleSelToo ) +void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor, + sal_Bool bSingleSelToo ) { SvLBoxEntry* pEntry; nFlags &= (~F_DESEL_ALL); @@ -2968,7 +2968,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, { if( pCursor && !pView->IsSelected( pCursor )) { - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } return; } @@ -2986,7 +2986,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, if( !bSelect && pView->GetSelectionCount()==1 && pCursor && pView->IsSelected( pCursor )) { - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); if( bDestroyAnchor ) DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen else @@ -2997,8 +2997,8 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, if( bSimpleTravel && !pCursor && !GetUpdateMode() ) nFlags |= F_DESEL_ALL; - ShowCursor( FALSE ); - BOOL bUpdate = GetUpdateMode(); + ShowCursor( sal_False ); + sal_Bool bUpdate = GetUpdateMode(); nFlags |= F_IGNORE_SELECT; // EntryInserted soll nix tun pEntry = pTree->First(); @@ -3021,18 +3021,18 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen else pAnchor = 0; // internen Anker immer loeschen - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvImpLBox::SetSelectionMode( SelectionMode eSelMode ) { aSelEng.SetSelectionMode( eSelMode); if( eSelMode == SINGLE_SELECTION ) - bSimpleTravel = TRUE; + bSimpleTravel = sal_True; else - bSimpleTravel = FALSE; + bSimpleTravel = sal_False; if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) - aSelEng.AddAlways( TRUE ); + aSelEng.AddAlways( sal_True ); } // *********************************************************************** @@ -3043,13 +3043,13 @@ void SvImpLBox::SetDragDropMode( DragDropMode eDDMode ) { if( eDDMode && eDDMode != SV_DRAGDROP_APP_DROP ) { - aSelEng.ExpandSelectionOnMouseMove( FALSE ); - aSelEng.EnableDrag( TRUE ); + aSelEng.ExpandSelectionOnMouseMove( sal_False ); + aSelEng.EnableDrag( sal_True ); } else { - aSelEng.ExpandSelectionOnMouseMove( TRUE ); - aSelEng.EnableDrag( FALSE ); + aSelEng.ExpandSelectionOnMouseMove( sal_True ); + aSelEng.EnableDrag( sal_False ); } } @@ -3098,7 +3098,7 @@ void SvImpLBox::PaintDDCursor( SvLBoxEntry* pInsertionPos ) --------------------------------------------------*/ void lcl_DeleteSubPopups(PopupMenu* pPopup) { - for(USHORT i = 0; i < pPopup->GetItemCount(); i++) + for(sal_uInt16 i = 0; i < pPopup->GetItemCount(); i++) { PopupMenu* pSubPopup = pPopup->GetPopupMenu( pPopup->GetItemId( i )); if(pSubPopup) @@ -3111,7 +3111,7 @@ void lcl_DeleteSubPopups(PopupMenu* pPopup) void SvImpLBox::Command( const CommandEvent& rCEvt ) { - USHORT nCommand = rCEvt.GetCommand(); + sal_uInt16 nCommand = rCEvt.GetCommand(); if( nCommand == COMMAND_CONTEXTMENU ) aEditTimer.Stop(); @@ -3124,7 +3124,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU ) { Point aPopupPos; - BOOL bClickedIsFreePlace = FALSE; + sal_Bool bClickedIsFreePlace = sal_False; std::stack<SvLBoxEntry*> aSelRestore; if( rCEvt.IsMouseEvent() ) @@ -3135,7 +3135,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) SvLBoxEntry* pClickedEntry = GetEntry( aPopupPos ); if( pClickedEntry ) { // mouse in non empty area - BOOL bClickedIsSelected = FALSE; + sal_Bool bClickedIsSelected = sal_False; // collect the currently selected entries SvLBoxEntry* pSelected = pView->FirstSelected(); @@ -3148,32 +3148,32 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) // if the entry which the user clicked at is not selected if( !bClickedIsSelected ) { // deselect all other and select the clicked one - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); pView->SetCursor( pClickedEntry ); } } else if( aSelEng.GetSelectionMode() == SINGLE_SELECTION ) {//modified by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time) - bClickedIsFreePlace = TRUE; - INT32 nSelectedEntries = pView->GetSelectionCount(); + bClickedIsFreePlace = sal_True; + sal_Int32 nSelectedEntries = pView->GetSelectionCount(); SvLBoxEntry* pSelected = pView->FirstSelected(); - for(USHORT nSel = 0; nSel < nSelectedEntries; nSel++ ) + for(sal_uInt16 nSel = 0; nSel < nSelectedEntries; nSel++ ) { aSelRestore.push(pSelected); pSelected = pView->NextSelected( pSelected ); } - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); } else { // deselect all - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); } } else { // key event (or at least no mouse event) - INT32 nSelectionCount = pView->GetSelectionCount(); + sal_Int32 nSelectionCount = pView->GetSelectionCount(); if( nSelectionCount ) { // now allways take first visible as base for positioning the menu @@ -3204,7 +3204,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) if( pPopup ) { // do action for selected entry in popup menu - USHORT nMenuAction = pPopup->Execute( pView, aPopupPos ); + sal_uInt16 nMenuAction = pPopup->Execute( pView, aPopupPos ); if ( nMenuAction ) pView->ExcecuteContextMenuAction( nMenuAction ); lcl_DeleteSubPopups(pPopup); @@ -3218,7 +3218,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) SvLBoxEntry* pEntry = aSelRestore.top(); //#i19717# the entry is maybe already deleted bool bFound = false; - for(ULONG nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++) + for(sal_uLong nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++) if(pEntry == pView->GetEntry(nEntry)) { bFound = true; @@ -3277,12 +3277,12 @@ void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry ) if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) - SelAllDestrAnch( FALSE, TRUE, FALSE ); + SelAllDestrAnch( sal_False, sal_True, sal_False ); if ( pEntry ) MakeVisible( pEntry ); SetCursor( pEntry ); if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG ) @@ -3304,21 +3304,21 @@ IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG ) SvLBoxEntry* pEntry = GetCurEntry(); if( pEntry ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->ImplEditEntry( pEntry ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } return 0; } -BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) +sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) { if( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( pView->ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); if( !GetVisibleArea().IsInside( aPos )) - return FALSE; + return sal_False; SvLBoxEntry* pEntry = GetEntry( aPos ); if( pEntry ) @@ -3327,18 +3327,18 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) SvLBoxTab* pTab; SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab )); if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING ) - return FALSE; + return sal_False; aPos = GetEntryPosition( pEntry ); aPos.X() = pView->GetTabPos( pEntry, pTab ); //pTab->GetPos(); Size aSize( pItem->GetSize( pView, pEntry ) ); SvLBoxTab* pNextTab = NextTab( pTab ); - BOOL bItemClipped = FALSE; + sal_Bool bItemClipped = sal_False; // wurde das Item von seinem rechten Nachbarn abgeschnitten? if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() ) { aSize.Width() = pNextTab->GetPos() - pTab->GetPos(); - bItemClipped = TRUE; + bItemClipped = sal_True; } Rectangle aItemRect( aPos, aSize ); @@ -3359,19 +3359,19 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) Help::ShowQuickHelp( pView, aItemRect, pItem->GetText(), QUICKHELP_LEFT | QUICKHELP_VCENTER ); - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } SvLBoxTab* SvImpLBox::NextTab( SvLBoxTab* pTab ) { - USHORT nTabCount = pView->TabCount(); + sal_uInt16 nTabCount = pView->TabCount(); if( nTabCount <= 1 ) return 0; - for( USHORT nTab=0; nTab < (nTabCount-1); nTab++) + for( sal_uInt16 nTab=0; nTab < (nTabCount-1); nTab++) { if( pView->aTabs[nTab]==pTab ) return (SvLBoxTab*)(pView->aTabs[nTab+1]); @@ -3389,28 +3389,28 @@ void SvImpLBox::RepaintScrollBars() { } -void SvImpLBox::SetUpdateMode( BOOL bMode ) +void SvImpLBox::SetUpdateMode( sal_Bool bMode ) { if( bUpdateMode != bMode ) { bUpdateMode = bMode; if( bUpdateMode ) - UpdateAll( FALSE ); + UpdateAll( sal_False ); } } -void SvImpLBox::SetUpdateModeFast( BOOL bMode ) +void SvImpLBox::SetUpdateModeFast( sal_Bool bMode ) { if( bUpdateMode != bMode ) { bUpdateMode = bMode; if( bUpdateMode ) - UpdateAll( FALSE, FALSE ); + UpdateAll( sal_False, sal_False ); } } -BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) +sal_Bool SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) { if( pView->nTreeFlags & TREEFLAG_RECALCTABS ) { @@ -3419,8 +3419,8 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) nFlags &= ~F_IGNORE_CHANGED_TABS; } - USHORT nLastTab = pView->aTabs.Count() - 1; - USHORT nLastItem = pEntry->ItemCount() - 1; + sal_uInt16 nLastTab = pView->aTabs.Count() - 1; + sal_uInt16 nLastItem = pEntry->ItemCount() - 1; if( nLastTab != USHRT_MAX && nLastItem != USHRT_MAX ) { if( nLastItem < nLastTab ) @@ -3446,10 +3446,10 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) { nMostRight = nRight; pMostRightEntry = pEntry; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } void SvImpLBox::FindMostRight( SvLBoxEntry* pEntryToIgnore ) @@ -3483,8 +3483,8 @@ void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToI if( !pList ) return; - ULONG nCount = pList->Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = pList->Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pChild = (SvLBoxEntry*)pList->GetObject( nCur ); if( pChild != pEntryToIgnore ) @@ -3591,7 +3591,7 @@ const Image& SvImpLBox::GetDefaultCollapsedNodeImage( BmpColorMode _eMode ) } // ----------------------------------------------------------------------- -void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData ) +void SvImpLBox::CallEventListeners( sal_uLong nEvent, void* pData ) { if ( pView ) pView->CallImplEventListeners( nEvent, pData); @@ -3599,14 +3599,14 @@ void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData ) // ----------------------------------------------------------------------- -bool SvImpLBox::SetCurrentTabPos( USHORT _nNewPos ) +bool SvImpLBox::SetCurrentTabPos( sal_uInt16 _nNewPos ) { bool bRet = false; if ( pView && _nNewPos < ( pView->TabCount() - 2 ) ) { nCurTabPos = _nNewPos; - ShowCursor( TRUE ); + ShowCursor( sal_True ); bRet = true; } diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx index 0d335429d564..420c0fcd2162 100644 --- a/svtools/source/contnr/svimpicn.cxx +++ b/svtools/source/contnr/svimpicn.cxx @@ -100,30 +100,30 @@ #undef TEXT_DRAW_WORDBREAK #endif -// #define TEXT_DRAW_DISABLE ((USHORT)0x0001) -// #define TEXT_DRAW_3DLOOK ((USHORT)0x0002) -// #define TEXT_DRAW_MNEMONIC ((USHORT)0x0004) -#define TEXT_DRAW_LEFT ((USHORT)0x0010) -#define TEXT_DRAW_CENTER ((USHORT)0x0020) -#define TEXT_DRAW_RIGHT ((USHORT)0x0040) -#define TEXT_DRAW_TOP ((USHORT)0x0080) -#define TEXT_DRAW_VCENTER ((USHORT)0x0100) -#define TEXT_DRAW_BOTTOM ((USHORT)0x0200) -#define TEXT_DRAW_ENDELLIPSIS ((USHORT)0x0400) -#define TEXT_DRAW_PATHELLIPSIS ((USHORT)0x0800) -#define TEXT_DRAW_CLIP ((USHORT)0x1000) -#define TEXT_DRAW_MULTILINE ((USHORT)0x2000) -#define TEXT_DRAW_WORDBREAK ((USHORT)0x4000) +// #define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001) +// #define TEXT_DRAW_3DLOOK ((sal_uInt16)0x0002) +// #define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0004) +#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010) +#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020) +#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040) +#define TEXT_DRAW_TOP ((sal_uInt16)0x0080) +#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100) +#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200) +#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400) +#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800) +#define TEXT_DRAW_CLIP ((sal_uInt16)0x1000) +#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x2000) +#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x4000) XubString GetEllipsisString( OutputDevice* pDev, const XubString& rStr, long nMaxWidth, - USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) + sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) { XubString aStr = rStr; if ( nStyle & TEXT_DRAW_ENDELLIPSIS ) { - USHORT nIndex = pDev->GetTextBreak( rStr, nMaxWidth ); + sal_uInt16 nIndex = pDev->GetTextBreak( rStr, nMaxWidth ); if ( nIndex != STRING_LEN ) { aStr.Erase( nIndex ); @@ -151,11 +151,11 @@ class TextLineInfo { private: long mnWidth; - USHORT mnIndex; - USHORT mnLen; + sal_uInt16 mnIndex; + sal_uInt16 mnLen; public: - TextLineInfo( long nWidth, USHORT nIndex, USHORT nLen ) + TextLineInfo( long nWidth, sal_uInt16 nIndex, sal_uInt16 nLen ) { mnWidth = nWidth; mnIndex = nIndex; @@ -163,8 +163,8 @@ public: } long GetWidth() const { return mnWidth; } - USHORT GetIndex() const { return mnIndex; } - USHORT GetLen() const { return mnLen; } + sal_uInt16 GetIndex() const { return mnIndex; } + sal_uInt16 GetLen() const { return mnLen; } }; #define MULTITEXTLINEINFO_RESIZE 16 @@ -174,8 +174,8 @@ class MultiTextLineInfo { private: PTextLineInfo* mpLines; - USHORT mnLines; - USHORT mnSize; + sal_uInt16 mnLines; + sal_uInt16 mnSize; public: MultiTextLineInfo(); @@ -184,9 +184,9 @@ public: void AddLine( TextLineInfo* pLine ); void Clear(); - TextLineInfo* GetLine( USHORT nLine ) const + TextLineInfo* GetLine( sal_uInt16 nLine ) const { return mpLines[nLine]; } - USHORT Count() const { return mnLines; } + sal_uInt16 Count() const { return mnLines; } private: MultiTextLineInfo( const MultiTextLineInfo& ); @@ -202,7 +202,7 @@ MultiTextLineInfo::MultiTextLineInfo() MultiTextLineInfo::~MultiTextLineInfo() { - for ( USHORT i = 0; i < mnLines; i++ ) + for ( sal_uInt16 i = 0; i < mnLines; i++ ) delete mpLines[i]; delete [] mpLines; } @@ -223,7 +223,7 @@ void MultiTextLineInfo::AddLine( TextLineInfo* pLine ) void MultiTextLineInfo::Clear() { - for ( USHORT i = 0; i < mnLines; i++ ) + for ( sal_uInt16 i = 0; i < mnLines; i++ ) delete mpLines[i]; mnLines = 0; } @@ -232,7 +232,7 @@ void MultiTextLineInfo::Clear() long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, - USHORT nStyle = TEXT_DRAW_WORDBREAK ) + sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK ) { rLineInfo.Clear(); if ( !rStr.Len() ) @@ -240,20 +240,20 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, if ( nWidth <= 0 ) nWidth = 1; - USHORT nStartPos = 0; // Start-Position der Zeile - USHORT nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort - USHORT nLastWordPos = 0; // Position des letzten Wortanfangs - USHORT i = 0; - USHORT nPos; // StartPositon der Zeile (nur Temp) - USHORT nLen; // Laenge der Zeile (nur Temp) - USHORT nStrLen = rStr.Len(); + sal_uInt16 nStartPos = 0; // Start-Position der Zeile + sal_uInt16 nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort + sal_uInt16 nLastWordPos = 0; // Position des letzten Wortanfangs + sal_uInt16 i = 0; + sal_uInt16 nPos; // StartPositon der Zeile (nur Temp) + sal_uInt16 nLen; // Laenge der Zeile (nur Temp) + sal_uInt16 nStrLen = rStr.Len(); long nMaxLineWidth = 0; // Maximale Zeilenlaenge long nLineWidth; // Aktuelle Zeilenlaenge long nLastLineWidth = 0; // Zeilenlaenge der letzten Zeile xub_Unicode c; xub_Unicode c2; const xub_Unicode* pStr = rStr.GetBuffer(); - BOOL bHardBreak = FALSE; + sal_Bool bHardBreak = sal_False; do { @@ -261,9 +261,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, // Auf Zeilenende ermitteln if ( (c == _CR) || (c == _LF) ) - bHardBreak = TRUE; + bHardBreak = sal_True; else - bHardBreak = FALSE; + bHardBreak = sal_False; // Testen, ob ein Wortende erreicht ist if ( bHardBreak || (i == nStrLen) || @@ -378,9 +378,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, // ----------------------------------------------------------------------- -USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect, +sal_uInt16 GetTextLines( OutputDevice* pDev, const Rectangle& rRect, const XubString& rStr, - USHORT nStyle = TEXT_DRAW_WORDBREAK, + sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK, long* pMaxWidth = NULL ) { MultiTextLineInfo aMultiLineInfo; @@ -395,10 +395,10 @@ USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect, Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, const XubString& rStr, - USHORT nStyle = TEXT_DRAW_WORDBREAK ) + sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK ) { Rectangle aRect = rRect; - USHORT nLines; + sal_uInt16 nLines; long nWidth = rRect.GetWidth(); long nMaxWidth; long nTextHeight; @@ -407,13 +407,13 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, { MultiTextLineInfo aMultiLineInfo; TextLineInfo* pLineInfo; - USHORT nFormatLines; + sal_uInt16 nFormatLines; nMaxWidth = 0; GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle ); nFormatLines = aMultiLineInfo.Count(); nTextHeight = pDev->GetTextHeight(); - nLines = (USHORT)(aRect.GetHeight()/nTextHeight); + nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight); if ( nFormatLines <= nLines ) nLines = nFormatLines; else @@ -423,7 +423,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, else nMaxWidth = nWidth; } - for ( USHORT i = 0; i < nLines; i++ ) + for ( sal_uInt16 i = 0; i < nLines; i++ ) { pLineInfo = aMultiLineInfo.GetLine( i ); if ( pLineInfo->GetWidth() > nMaxWidth ) @@ -465,7 +465,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, // ----------------------------------------------------------------------- void DrawText( OutputDevice* pDev, const Rectangle& rRect, - const XubString& rStr, USHORT nStyle = 0 ) + const XubString& rStr, sal_uInt16 nStyle = 0 ) { if ( !rStr.Len() || rRect.IsEmpty() ) return; @@ -487,10 +487,10 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect, TextLineInfo* pLineInfo; long nTextHeight = pDev->GetTextHeight(); long nMaxTextWidth; - USHORT i; - USHORT nLines = (USHORT)(nHeight/nTextHeight); - USHORT nFormatLines; - BOOL bIsClipRegion = FALSE; + sal_uInt16 i; + sal_uInt16 nLines = (sal_uInt16)(nHeight/nTextHeight); + sal_uInt16 nFormatLines; + sal_Bool bIsClipRegion = sal_False; nMaxTextWidth = GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle ); nFormatLines = aMultiLineInfo.Count(); @@ -611,7 +611,7 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect, if ( nStyle & TEXT_DRAW_CLIP ) { - BOOL bIsClipRegion = pDev->IsClipRegion(); + sal_Bool bIsClipRegion = pDev->IsClipRegion(); if ( bIsClipRegion ) { Region aOldRegion = pDev->GetClipRegion(); @@ -649,7 +649,7 @@ class ImpIcnCursor SvImpIconView* pView; SvPtrarr* pColumns; SvPtrarr* pRows; - BOOL* pGridMap; + sal_Bool* pGridMap; long nGridDX, nGridDY; long nGridCols, nGridRows; long nCols; @@ -661,39 +661,39 @@ class ImpIcnCursor void ImplCreate(); void Create() { if( !pColumns ) ImplCreate(); } - USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); - SvLBoxEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref, - BOOL bDown, BOOL bSimple ); - SvLBoxEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref, - BOOL bRight, BOOL bSimple ); + sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); + SvLBoxEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref, + sal_Bool bDown, sal_Bool bSimple ); + SvLBoxEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref, + sal_Bool bRight, sal_Bool bSimple ); void ExpandGrid(); void CreateGridMap(); - // Rueckgabe FALSE: Eintrag liegt nicht in der GridMap. rGridx,y werden + // Rueckgabe sal_False: Eintrag liegt nicht in der GridMap. rGridx,y werden // dann an nGridCols, nGridRows geclippt - BOOL GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const; - void SetGridUsed( USHORT nDX, USHORT nDY, BOOL bUsed ) + sal_Bool GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const; + void SetGridUsed( sal_uInt16 nDX, sal_uInt16 nDY, sal_Bool bUsed ) { pGridMap[ (nDY * nGridCols) + nDX ] = bUsed; } - BOOL IsGridUsed( USHORT nDX, USHORT nDY ) + sal_Bool IsGridUsed( sal_uInt16 nDX, sal_uInt16 nDY ) { return pGridMap[ (nDY * nGridCols) + nDX ]; } public: ImpIcnCursor( SvImpIconView* pOwner ); ~ImpIcnCursor(); - void Clear( BOOL bGridToo = TRUE ); + void Clear( sal_Bool bGridToo = sal_True ); // fuer Cursortravelling usw. - SvLBoxEntry* GoLeftRight( SvLBoxEntry*, BOOL bRight ); - SvLBoxEntry* GoUpDown( SvLBoxEntry*, BOOL bDown ); + SvLBoxEntry* GoLeftRight( SvLBoxEntry*, sal_Bool bRight ); + SvLBoxEntry* GoUpDown( SvLBoxEntry*, sal_Bool bDown ); - // Rueckgaebe: FALSE == Das leere Rect steht hinter dem letzten + // Rueckgaebe: sal_False == Das leere Rect steht hinter dem letzten // Eintrag; d.h. beim naechsten Einfuegen ergibt sich das naechste // leere Rechteck durch Addition. Hinweis: Das Rechteck kann dann // ausserhalb des View-Space liegen - BOOL FindEmptyGridRect( Rectangle& rRect ); + sal_Bool FindEmptyGridRect( Rectangle& rRect ); // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left() // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann @@ -701,7 +701,7 @@ public: // muessen mit DestroyGridAdjustData geloescht werden void CreateGridAjustData( SvPtrarr& pLists, SvLBoxEntry* pRow=0); static void DestroyGridAdjustData( SvPtrarr& rLists ); - void SetGridUsed( const Rectangle&, BOOL bUsed = TRUE ); + void SetGridUsed( const Rectangle&, sal_Bool bUsed = sal_True ); }; @@ -740,7 +740,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, aEditTimer.SetTimeout( 800 ); aEditTimer.SetTimeoutHdl(LINK(this,SvImpIconView,EditTimeoutHdl)); - Clear( TRUE ); + Clear( sal_True ); } SvImpIconView::~SvImpIconView() @@ -755,14 +755,14 @@ SvImpIconView::~SvImpIconView() ClearSelectedRectList(); } -void SvImpIconView::Clear( BOOL bInCtor ) +void SvImpIconView::Clear( sal_Bool bInCtor ) { StopEditTimer(); CancelUserEvent(); nMaxBmpWidth = 0; nMaxBmpHeight = 0; nMaxTextWidth = 0; - bMustRecalcBoundingRects = FALSE; + bMustRecalcBoundingRects = sal_False; nMaxBoundHeight = 0; //XXX @@ -797,17 +797,17 @@ void SvImpIconView::SetStyle( const WinBits i_nWinStyle ) IMPL_LINK( SvImpIconView, ScrollUpDownHdl, ScrollBar *, pScrollBar ) { - pView->EndEditing( TRUE ); + pView->EndEditing( sal_True ); // Pfeil hoch: delta=-1; Pfeil runter: delta=+1 - Scroll( 0, pScrollBar->GetDelta(), TRUE ); + Scroll( 0, pScrollBar->GetDelta(), sal_True ); return 0; } IMPL_LINK( SvImpIconView, ScrollLeftRightHdl, ScrollBar *, pScrollBar ) { - pView->EndEditing( TRUE ); + pView->EndEditing( sal_True ); // Pfeil links: delta=-1; Pfeil rechts: delta=+1 - Scroll( pScrollBar->GetDelta(), 0, TRUE ); + Scroll( pScrollBar->GetDelta(), 0, sal_True ); return 0; } @@ -847,7 +847,7 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry, { nMaxTextWidth = aSize.Width(); if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = TRUE; + bMustRecalcBoundingRects = sal_True; } } SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); @@ -859,14 +859,14 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry, nMaxBmpWidth = aSize.Width(); nMaxBmpWidth += (2*LROFFS_ICON); if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = TRUE; + bMustRecalcBoundingRects = sal_True; } if( aSize.Height() > nMaxBmpHeight ) { nMaxBmpHeight = aSize.Height(); nMaxBmpHeight += (2*TBOFFS_ICON);; if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = TRUE; + bMustRecalcBoundingRects = sal_True; } } } @@ -879,9 +879,9 @@ void SvImpIconView::EntryInserted( SvLBoxEntry* pEntry ) DBG_ASSERT(pZOrderList->GetPos(pEntry)==0xffff,"EntryInserted:ZOrder?"); pZOrderList->Insert( pEntry, pZOrderList->Count() ); if( nFlags & F_GRIDMODE ) - pImpCursor->Clear( FALSE ); + pImpCursor->Clear( sal_False ); else - pImpCursor->Clear( TRUE ); + pImpCursor->Clear( sal_True ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); CheckSizes( pEntry, pViewData ); if( pView->IsUpdateMode() ) @@ -911,11 +911,11 @@ void SvImpIconView::RemovingEntry( SvLBoxEntry* pEntry ) if( pEntry == pCursor ) { SvLBoxEntry* pNewCursor = GetNewCursor(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pCursor = 0; // damit er nicht deselektiert wird SetCursor( pNewCursor ); } - USHORT nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos, 1 ); pImpCursor->Clear(); } @@ -958,7 +958,7 @@ void SvImpIconView::MovingEntry( SvLBoxEntry* pEntry ) void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); if( pModel->GetParent(pEntry)==pCurParent ) { @@ -986,9 +986,9 @@ void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry ) SetCursor( pNextCursor ); } pImpCursor->Clear(); - USHORT nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos, 1 ); - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); // wenn er nochmal in dieser View auftaucht, muss sein // Bounding-Rect neu berechnet werden InvalidateBoundingRect( pViewData->aRect ); @@ -1013,7 +1013,7 @@ void SvImpIconView::CollapsingEntry( SvLBoxEntry* ) { } -void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) +void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) { if( pModel->GetParent(pEntry) != pCurParent ) return; @@ -1033,13 +1033,13 @@ void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) if( pView->IsUpdateMode() ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( nFlags & F_RUBBERING ) PaintEntry( pEntry ); else pView->Invalidate( GetBoundingRect( pEntry ) ); if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -1131,7 +1131,7 @@ void SvImpIconView::ResetVirtSize() StopEditTimer(); aVirtOutputSize.Width() = 0; aVirtOutputSize.Height() = 0; - BOOL bLockedEntryFound = FALSE; + sal_Bool bLockedEntryFound = sal_False; nFlags &= (~F_GRID_INSERT); SvLBoxEntry* pCur = pModel->FirstChild( pCurParent ); while( pCur ) @@ -1144,7 +1144,7 @@ void SvImpIconView::ResetVirtSize() FindBoundingRect( pCur, pViewData ); else AdjustVirtSize( pViewData->aRect ); - bLockedEntryFound = TRUE; + bLockedEntryFound = sal_True; } else InvalidateBoundingRect( pViewData->aRect ); @@ -1198,16 +1198,16 @@ void SvImpIconView::Arrange() void SvImpIconView::ImpArrange() { StopEditTimer(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); ResetVirtSize(); - bMustRecalcBoundingRects = FALSE; + bMustRecalcBoundingRects = sal_False; MapMode aMapMode( pView->GetMapMode()); aMapMode.SetOrigin( Point() ); pView->SetMapMode( aMapMode ); CheckAllSizes(); RecalcAllBoundingRectsSmart(); pView->Invalidate(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvImpIconView::Paint( const Rectangle& rRect ) @@ -1249,14 +1249,14 @@ void SvImpIconView::Paint( const Rectangle& rRect ) if( !pCursor ) pCursor = pModel->FirstChild( pCurParent ); - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); if( !nCount ) return; SvPtrarr* pNewZOrderList = new SvPtrarr; SvPtrarr* pPaintedEntries = new SvPtrarr; - USHORT nPos = 0; + sal_uInt16 nPos = 0; while( nCount ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos )); @@ -1279,7 +1279,7 @@ void SvImpIconView::Paint( const Rectangle& rRect ) nCount = pPaintedEntries->Count(); if( nCount ) { - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) pZOrderList->Insert( pPaintedEntries->GetObject( nCur ),pZOrderList->Count()); } delete pPaintedEntries; @@ -1289,7 +1289,7 @@ void SvImpIconView::Paint( const Rectangle& rRect ) PaintResizeRect( aRect ); } -BOOL SvImpIconView::GetResizeRect( Rectangle& rRect ) +sal_Bool SvImpIconView::GetResizeRect( Rectangle& rRect ) { if( aHorSBar.IsVisible() && aVerSBar.IsVisible() ) { @@ -1300,9 +1300,9 @@ BOOL SvImpIconView::GetResizeRect( Rectangle& rRect ) aOrigin.Y() += aOutputSize.Height(); rRect.SetPos( aOrigin ); rRect.SetSize( Size( nVerSBarWidth, nHorSBarHeight)); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SvImpIconView::PaintResizeRect( const Rectangle& rRect ) @@ -1362,7 +1362,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) { if( !rMEvt.IsMod1() ) // Ctrl { - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); ClearSelectedRectList(); } else @@ -1374,8 +1374,8 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) return; } - BOOL bSelected = pView->IsSelected( pEntry ); - BOOL bEditingEnabled = pView->IsInplaceEditingEnabled(); + sal_Bool bSelected = pView->IsSelected( pEntry ); + sal_Bool bEditingEnabled = pView->IsInplaceEditingEnabled(); if( rMEvt.GetClicks() == 2 ) { @@ -1399,7 +1399,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) { DeselectAllBut( pEntry ); SetCursor( pEntry ); - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); if( bEditingEnabled && bSelected && !rMEvt.GetModifier() && rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) ) { @@ -1414,7 +1414,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) { DeselectAllBut( pEntry ); SetCursor( pEntry ); - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } else { @@ -1449,7 +1449,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt ) nFlags &= ~(F_RUBBERING | F_ADD_MODE); } - SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), TRUE ); + SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), sal_True ); if( pEntry ) { if( nFlags & F_DOWN_CTRL ) @@ -1462,7 +1462,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt ) { DeselectAllBut( pEntry ); SetCursor( pEntry ); - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } } @@ -1498,12 +1498,12 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) long nScrollDX, nScrollDY; - CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,FALSE ); - BOOL bSelRectHidden = FALSE; + CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,sal_False ); + sal_Bool bSelRectHidden = sal_False; if( nScrollDX || nScrollDY ) { HideSelectionRect(); - bSelRectHidden = TRUE; + bSelRectHidden = sal_True; pView->Scroll( nScrollDX, nScrollDY ); } Point aDocPos( rMEvt.GetPosPixel() ); @@ -1512,8 +1512,8 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) if( aRect != aCurSelectionRect ) { HideSelectionRect(); - bSelRectHidden = TRUE; - BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE; + bSelRectHidden = sal_True; + sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False; SelectRect( aRect, bAdd, &aSelectedRectList ); } if( bSelRectHidden ) @@ -1521,32 +1521,32 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) } } -BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) +sal_Bool SvImpIconView::KeyInput( const KeyEvent& rKEvt ) { StopEditTimer(); - BOOL bKeyUsed = TRUE; - BOOL bMod1 = rKEvt.GetKeyCode().IsMod1(); - BOOL bInAddMode = (BOOL)((nFlags & F_ADD_MODE) != 0); + sal_Bool bKeyUsed = sal_True; + sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1(); + sal_Bool bInAddMode = (sal_Bool)((nFlags & F_ADD_MODE) != 0); int bDeselAll = (pView->GetSelectionMode() != SINGLE_SELECTION) && !bInAddMode; SvLBoxEntry* pNewCursor; - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch( nCode ) { case KEY_UP: if( pCursor ) { MakeVisible( pCursor ); - pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE); + pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False); if( pNewCursor ) { if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } else { @@ -1564,17 +1564,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) case KEY_DOWN: if( pCursor ) { - pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE ); + pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True ); if( pNewCursor ) { MakeVisible( pCursor ); if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } } break; @@ -1582,17 +1582,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) case KEY_RIGHT: if( pCursor ) { - pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE ); + pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True ); if( pNewCursor ) { MakeVisible( pCursor ); if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } } break; @@ -1601,16 +1601,16 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { MakeVisible( pCursor ); - pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE ); + pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False ); if( pNewCursor ) { if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } else { @@ -1629,7 +1629,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) if( nFlags & F_RUBBERING ) { HideSelectionRect(); - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); nFlags &= ~F_RUBBERING; } break; @@ -1670,13 +1670,13 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) case KEY_ADD: case KEY_DIVIDE : if( bMod1 ) - pView->SelectAll( TRUE ); + pView->SelectAll( sal_True ); break; case KEY_SUBTRACT: case KEY_COMMA : if( bMod1 ) - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); break; case KEY_RETURN: @@ -1688,7 +1688,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) break; default: - bKeyUsed = FALSE; + bKeyUsed = sal_False; } return bKeyUsed; @@ -1756,7 +1756,7 @@ void SvImpIconView::AdjustScrollBars() bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false; bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false; - USHORT nResult = 0; + sal_uInt16 nResult = 0; if( nVirtHeight ) { // activate ver scrollbar ? @@ -1896,23 +1896,23 @@ void __EXPORT SvImpIconView::Resize() #endif } -BOOL SvImpIconView::CheckHorScrollBar() +sal_Bool SvImpIconView::CheckHorScrollBar() { if( !pZOrderList || !aHorSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); long nMostRight = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur); long nRight = GetBoundingRect(pEntry).Right(); if( nRight > nWidth ) - return FALSE; + return sal_False; if( nRight > nMostRight ) nMostRight = nRight; } @@ -1929,28 +1929,28 @@ BOOL SvImpIconView::CheckHorScrollBar() aSize.Height() += nHorSBarHeight; aVerSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvImpIconView::CheckVerScrollBar() +sal_Bool SvImpIconView::CheckVerScrollBar() { if( !pZOrderList || !aVerSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() ) { long nDeepest = 0; long nHeight = aOutputSize.Height(); - USHORT nCount = pZOrderList->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = pZOrderList->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur); long nBottom = GetBoundingRect(pEntry).Bottom(); if( nBottom > nHeight ) - return FALSE; + return sal_False; if( nBottom > nDeepest ) nDeepest = nBottom; } @@ -1967,9 +1967,9 @@ BOOL SvImpIconView::CheckVerScrollBar() aSize.Width() += nVerSBarWidth; aHorSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -1986,8 +1986,8 @@ void __EXPORT SvImpIconView::GetFocus() { if( pCursor ) { - pView->SetEntryFocus( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->SetEntryFocus( pCursor, sal_True ); + ShowCursor( sal_True ); } } @@ -1995,8 +1995,8 @@ void __EXPORT SvImpIconView::LoseFocus() { StopEditTimer(); if( pCursor ) - pView->SetEntryFocus( pCursor,FALSE ); - ShowCursor( FALSE ); + pView->SetEntryFocus( pCursor,sal_False ); + ShowCursor( sal_False ); } void SvImpIconView::UpdateAll() @@ -2012,8 +2012,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData PaintEntry( pEntry, aPos, pViewData ); } -void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected, - BOOL bCursored, OutputDevice* pOut ) +void SvImpIconView::PaintEmphasis( const Rectangle& rRect, sal_Bool bSelected, + sal_Bool bCursored, OutputDevice* pOut ) { // HACK fuer D&D if( nFlags & F_NO_EMPHASIS ) @@ -2051,7 +2051,7 @@ void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected, } void SvImpIconView::PaintItem( const Rectangle& rRect, - SvLBoxItem* pItem, SvLBoxEntry* pEntry, USHORT nPaintFlags, + SvLBoxItem* pItem, SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut ) { if( nViewMode == VIEWMODE_ICON && pItem->IsA() == SV_ITEM_ID_LBOXSTRING ) @@ -2089,8 +2089,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - BOOL bSelected = pViewData->IsSelected(); - BOOL bCursored = pViewData->IsCursored(); + sal_Bool bSelected = pViewData->IsSelected(); + sal_Bool bCursored = pViewData->IsCursored(); Font aTempFont( pOut->GetFont() ); // waehrend D&D nicht die Fontfarbe wechseln, da sonst auch die @@ -2102,7 +2102,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, aNewFont.SetColor( rStyleSettings.GetHighlightTextColor() ); pOut->SetFont( aNewFont ); } - Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,FALSE,pViewData)); + Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,sal_False,pViewData)); Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos, pViewData ) ); switch( nViewMode ) @@ -2112,7 +2112,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, PaintEmphasis( aBmpRect, bSelected, bCursored, pOut ); PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_HOR_CENTERED | PAINTFLAG_VER_CENTERED, pOut ); - PaintEmphasis( aTextRect, bSelected, FALSE, pOut ); + PaintEmphasis( aTextRect, bSelected, sal_False, pOut ); PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_HOR_CENTERED, pOut ); break; @@ -2120,7 +2120,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); PaintEmphasis( aBmpRect, bSelected, bCursored, pOut ); PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_VER_CENTERED, pOut ); - PaintEmphasis( aTextRect, bSelected, FALSE, pOut ); + PaintEmphasis( aTextRect, bSelected, sal_False, pOut ); PaintItem( aTextRect, pStringItem, pEntry,PAINTFLAG_VER_CENTERED, pOut ); break; @@ -2133,11 +2133,11 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, } void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, - BOOL bAdjustAtGrid, BOOL bCheckScrollBars ) + sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars ) { if( pModel->GetParent(pEntry) == pCurParent ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); Rectangle aBoundRect( GetBoundingRect( pEntry, pViewData )); pView->Invalidate( aBoundRect ); @@ -2163,7 +2163,7 @@ void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, CheckScrollBars(); PaintEntry( pEntry, pViewData ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -2174,7 +2174,7 @@ void SvImpIconView::ViewDataInitialized( SvLBoxEntry*) void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); pView->Invalidate( pViewData->aRect ); @@ -2187,7 +2187,7 @@ void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) ViewDataInitialized( (SvLBoxEntry*)pEntry ); pView->Invalidate( pViewData->aRect ); if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } @@ -2209,9 +2209,9 @@ void SvImpIconView::SetSelectionMode( SelectionMode ) { } -BOOL SvImpIconView::IsEntryInView( SvLBoxEntry* ) +sal_Bool SvImpIconView::IsEntryInView( SvLBoxEntry* ) { - return FALSE; + return sal_False; } SvLBoxEntry* SvImpIconView::GetDropTarget( const Point& rPos ) @@ -2229,7 +2229,7 @@ SvLBoxEntry* SvImpIconView::GetEntry( const Point& rDocPos ) CheckBoundingRects(); SvLBoxEntry* pTarget = 0; // Z-Order-Liste vom Ende her absuchen - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); while( nCount ) { nCount--; @@ -2248,11 +2248,11 @@ SvLBoxEntry* SvImpIconView::GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCu { CheckBoundingRects(); SvLBoxEntry* pTarget = 0; - USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != USHRT_MAX ) { - USHORT nCount = pZOrderList->Count(); - for( USHORT nCur = nStartPos+1; nCur < nCount; nCur++ ) + sal_uInt16 nCount = pZOrderList->Count(); + for( sal_uInt16 nCur = nStartPos+1; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCur)); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); @@ -2270,7 +2270,7 @@ SvLBoxEntry* SvImpIconView::GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCu { CheckBoundingRects(); SvLBoxEntry* pTarget = 0; - USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != USHRT_MAX && nStartPos != 0 ) { nStartPos--; @@ -2350,7 +2350,7 @@ Rectangle SvImpIconView::CalcBmpRect( SvLBoxEntry* pEntry, const Point* pPos, } Rectangle SvImpIconView::CalcTextRect( SvLBoxEntry* pEntry, - SvLBoxString* pItem, const Point* pPos, BOOL bForInplaceEdit, + SvLBoxString* pItem, const Point* pPos, sal_Bool bForInplaceEdit, SvIcnVwDataEntry* pViewData ) { long nBmpHeight, nBmpWidth; @@ -2503,7 +2503,7 @@ void SvImpIconView::RecalcAllBoundingRects() pZOrderList->Insert( pEntry, pZOrderList->Count() ); pEntry = pModel->NextSibling( pEntry ); } - bMustRecalcBoundingRects = FALSE; + bMustRecalcBoundingRects = sal_False; AdjustScrollBars(); } @@ -2582,26 +2582,26 @@ void SvImpIconView::SetCursor( SvLBoxEntry* pEntry ) if( pEntry == pCursor ) return; - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( pCursor ) { - pView->SetEntryFocus( pCursor, FALSE ); + pView->SetEntryFocus( pCursor, sal_False ); if( pView->GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); } pCursor = pEntry; ToTop( pCursor ); if( pCursor ) { - pView->SetEntryFocus(pCursor, TRUE ); + pView->SetEntryFocus(pCursor, sal_True ); if( pView->GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->Select( pCursor, sal_True ); + ShowCursor( sal_True ); } } -void SvImpIconView::ShowCursor( BOOL bShow ) +void SvImpIconView::ShowCursor( sal_Bool bShow ) { if( !pCursor || !bShow || !pView->HasFocus() ) { @@ -2640,7 +2640,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) DELETEZ(pDDDev); DELETEZ(pDDBufDev); } - BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE ); + sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False ); if( !pDDDev ) { if( pDDBufDev ) @@ -2678,7 +2678,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) PaintEntry( pRefEntry, aPos ); nFlags &= ~F_NO_EMPHASIS; if( bSelected ) - pView->SvListView::Select( pRefEntry, TRUE ); + pView->SvListView::Select( pRefEntry, sal_True ); } void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) @@ -2769,12 +2769,12 @@ void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix pDDDev->GetOutputSizePixel(), *pDDTempDev ); - BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE ); + sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False ); if( bSelected ) - pView->SvListView::Select( pRefEntry, TRUE ); + pView->SvListView::Select( pRefEntry, sal_True ); } -void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL ) +void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool ) { CheckBoundingRects(); Rectangle aRect; @@ -2794,8 +2794,8 @@ void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL ) ImpDrawXORRect( aRect ); } -BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewPar, ULONG& rNewChildPos ) +sal_Bool SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewPar, sal_uLong& rNewChildPos ) { if( pTarget == pCurParent && pModel->GetParent(pEntry) == pCurParent ) { @@ -2805,14 +2805,14 @@ BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, Size aSize( pViewData->aRect.GetSize() ); Point aNewPos = FindNextEntryPos( aSize ); AdjustVirtSize( Rectangle( aNewPos, aSize ) ); - SetEntryPosition( pEntry, aNewPos, FALSE, TRUE ); - return FALSE; + SetEntryPosition( pEntry, aNewPos, sal_False, sal_True ); + return sal_False; } return pView->SvLBox::NotifyMoving(pTarget,pEntry,rpNewPar,rNewChildPos); } -BOOL SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +sal_Bool SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ) { return pView->SvLBox::NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos); } @@ -2849,9 +2849,9 @@ void SvImpIconView::PrepareCommandEvent( const Point& rPt ) aMouseMoveTimer.Stop(); StopEditTimer(); nFlags |= F_CMD_ARRIVED; - SvLBoxEntry* pEntry = pView->GetEntry( rPt, TRUE ); + SvLBoxEntry* pEntry = pView->GetEntry( rPt, sal_True ); if( (nFlags & F_DOWN_CTRL) && pEntry && !pView->IsSelected(pEntry) ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); } @@ -2860,12 +2860,12 @@ void SvImpIconView::SttDrag( const Point& rPos ) PrepareCommandEvent( rPos ); nFlags |= F_DRAG_SOURCE; - ShowCursor( FALSE ); + ShowCursor( sal_False ); } void SvImpIconView::EndDrag() { - ShowCursor( TRUE ); + ShowCursor( sal_True ); nFlags &= (~F_DRAG_SOURCE); } @@ -2874,7 +2874,7 @@ void SvImpIconView::ToTop( SvLBoxEntry* pEntry ) DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"ToTop:ZOrder?"); if( pZOrderList->GetObject( pZOrderList->Count() -1 ) != pEntry ) { - USHORT nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos, 1 ); pZOrderList->Insert( pEntry, pZOrderList->Count() ); } @@ -2901,9 +2901,9 @@ void SvImpIconView::ClipAtVirtOutRect( Rectangle& rRect ) const // rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der // sichtbar gemacht werden soll. -// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet +// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet -void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar ) +void SvImpIconView::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar ) { Rectangle aRect( rRect ); ClipAtVirtOutRect( aRect ); @@ -2957,7 +2957,7 @@ void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar ) pView->SetMapMode( aMapMode ); // in umgekehrte Richtung scrollen! - pView->Control::Scroll( -nDx, -nDy, aOutputArea, TRUE ); + pView->Control::Scroll( -nDx, -nDy, aOutputArea, sal_True ); if( aHorSBar.IsVisible() || aVerSBar.IsVisible() ) { if( !bScrBar ) @@ -2981,15 +2981,15 @@ SvLBoxEntry* SvImpIconView::GetNewCursor() SvLBoxEntry* pNewCursor; if( pCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False ); if( !pNewCursor ) - pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True ); } } } @@ -3000,9 +3000,9 @@ SvLBoxEntry* SvImpIconView::GetNewCursor() } -USHORT SvImpIconView:: GetSelectionCount() const +sal_uInt16 SvImpIconView:: GetSelectionCount() const { - USHORT nSelected = 0; + sal_uInt16 nSelected = 0; SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent); while( pEntry ) { @@ -3016,11 +3016,11 @@ USHORT SvImpIconView:: GetSelectionCount() const void SvImpIconView::ToggleSelection( SvLBoxEntry* pEntry ) { - BOOL bSel; + sal_Bool bSel; if( pView->IsSelected( pEntry ) ) - bSel = FALSE; + bSel = sal_False; else - bSel = TRUE; + bSel = sal_True; pView->Select( pEntry, bSel ); } @@ -3031,7 +3031,7 @@ void SvImpIconView::DeselectAllBut( SvLBoxEntry* pThisEntryNot ) while( pEntry ) { if( pEntry != pThisEntryNot && pView->IsSelected( pEntry )) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = pModel->NextSibling( pEntry ); } } @@ -3061,14 +3061,14 @@ ImpIcnCursor::~ImpIcnCursor() delete pGridMap; } -USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, +sal_uInt16 ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, int bVertical ) { - USHORT nCount = (USHORT)pList->Count(); + sal_uInt16 nCount = (sal_uInt16)pList->Count(); if( !nCount ) return 0; - USHORT nCurPos = 0; + sal_uInt16 nCurPos = 0; long nPrevValue = LONG_MIN; while( nCount ) { @@ -3080,7 +3080,7 @@ USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, else nCurValue = rRect.Left(); if( nValue >= nPrevValue && nValue <= nCurValue ) - return (USHORT)nCurPos; + return (sal_uInt16)nCurPos; nPrevValue = nCurValue; nCount--; nCurPos++; @@ -3116,10 +3116,10 @@ void ImpIcnCursor::ImplCreate() if( nX >= nCols ) nX = sal::static_int_cast< short >(nCols - 1); - USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE ); + sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True ); pColumns[ nX ].Insert( pEntry, nIns ); - nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE ); + nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False ); pRows[ nY ].Insert( pEntry, nIns ); pViewData->nX = nX; @@ -3163,7 +3163,7 @@ void ImpIcnCursor::CreateGridMap() //XXX //nGridRows += 50; // in fuenfziger-Schritten - pGridMap = new BOOL[ nGridRows*nGridCols]; + pGridMap = new sal_Bool[ nGridRows*nGridCols]; memset( (void*)pGridMap, 0, nGridRows*nGridCols ); SvLBoxTreeList* pModel = pView->pModel; @@ -3182,49 +3182,49 @@ void ImpIcnCursor::CreateGridMap() } } -BOOL ImpIcnCursor::GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const +sal_Bool ImpIcnCursor::GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const { Point aPos( rDocPos ); aPos.X() -= LROFFS_WINBORDER; aPos.Y() -= TBOFFS_WINBORDER; - rGridX = (USHORT)(aPos.X() / nGridDX); - rGridY = (USHORT)(aPos.Y() / nGridDY); - BOOL bInGrid = TRUE; + rGridX = (sal_uInt16)(aPos.X() / nGridDX); + rGridY = (sal_uInt16)(aPos.Y() / nGridDY); + sal_Bool bInGrid = sal_True; if( rGridX >= nGridCols ) { - rGridX = sal::static_int_cast< USHORT >(nGridCols - 1); - bInGrid = FALSE; + rGridX = sal::static_int_cast< sal_uInt16 >(nGridCols - 1); + bInGrid = sal_False; } if( rGridY >= nGridRows ) { - rGridY = sal::static_int_cast< USHORT >(nGridRows - 1); + rGridY = sal::static_int_cast< sal_uInt16 >(nGridRows - 1); if( !bInGrid ) - return FALSE; // beide Koordinaten nicht im Grid + return sal_False; // beide Koordinaten nicht im Grid } - return TRUE; + return sal_True; } -void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, BOOL bUsed ) +void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, sal_Bool bUsed ) { CreateGridMap(); - USHORT nTLX, nTLY, nBRX, nBRY; + sal_uInt16 nTLX, nTLY, nBRX, nBRY; - BOOL bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY ); - BOOL bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY ); + sal_Bool bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY ); + sal_Bool bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY ); if( !bTLInGrid && !bBRInGrid ) return; - for( USHORT nCurY = nTLY; nCurY <= nBRY; nCurY++ ) + for( sal_uInt16 nCurY = nTLY; nCurY <= nBRY; nCurY++ ) { - for( USHORT nCurX = nTLX; nCurX <= nBRX; nCurX++ ) + for( sal_uInt16 nCurX = nTLX; nCurX <= nBRX; nCurX++ ) { SetGridUsed( nCurX, nCurY, bUsed ); } } } -void ImpIcnCursor::Clear( BOOL bGridToo ) +void ImpIcnCursor::Clear( sal_Bool bGridToo ) { if( pColumns ) { @@ -3244,12 +3244,12 @@ void ImpIcnCursor::Clear( BOOL bGridToo ) } } -SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, - USHORT, BOOL bDown, BOOL bSimple ) +SvLBoxEntry* ImpIcnCursor::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom, + sal_uInt16, sal_Bool bDown, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchCol: No reference entry"); SvPtrarr* pList = &(pColumns[ nCol ]); - USHORT nCount = pList->Count(); + sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -3257,7 +3257,7 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List"); if( bDown ) { @@ -3290,19 +3290,19 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, if( nTop > nBottom ) { - USHORT nTemp = nTop; + sal_uInt16 nTemp = nTop; nTop = nBottom; nBottom = nTemp; } long nMinDistance = LONG_MAX; SvLBoxEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - USHORT nY = pViewData->nY; + sal_uInt16 nY = pViewData->nY; if( nY >= nTop && nY <= nBottom ) { const Rectangle& rRect = pView->GetBoundingRect( pEntry ); @@ -3320,12 +3320,12 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, return pResult; } -SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, - USHORT, BOOL bRight, BOOL bSimple ) +SvLBoxEntry* ImpIcnCursor::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight, + sal_uInt16, sal_Bool bRight, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchRow: No reference entry"); SvPtrarr* pList = &(pRows[ nRow ]); - USHORT nCount = pList->Count(); + sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -3333,7 +3333,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List"); if( bRight ) { @@ -3366,19 +3366,19 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, } if( nRight < nLeft ) { - USHORT nTemp = nRight; + sal_uInt16 nTemp = nRight; nRight = nLeft; nLeft = nTemp; } long nMinDistance = LONG_MAX; SvLBoxEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - USHORT nX = pViewData->nX; + sal_uInt16 nX = pViewData->nX; if( nX >= nLeft && nX <= nRight ) { const Rectangle& rRect = pView->GetBoundingRect( pEntry ); @@ -3400,7 +3400,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, /* Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw. - linksstehenden. Suchverfahren am Beispiel bRight = TRUE: + linksstehenden. Suchverfahren am Beispiel bRight = sal_True: c b c @@ -3415,22 +3415,22 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, a,b,c : 2., 3., 4. Suchrechteck */ -SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight ) +SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, sal_Bool bRight ) { SvLBoxEntry* pResult; pCurEntry = pIcnEntry; Create(); SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry); - USHORT nY = pViewData->nY; - USHORT nX = pViewData->nX; + sal_uInt16 nY = pViewData->nY; + sal_uInt16 nX = pViewData->nX; DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column"); DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row"); // Nachbar auf gleicher Zeile ? if( bRight ) pResult = SearchRow( - nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE ); + nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True ); else - pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE ); + pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True ); if( pResult ) return pResult; @@ -3448,11 +3448,11 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight ) nLastCol = -1; // 0-1 } - USHORT nRowMin = nY; - USHORT nRowMax = nY; + sal_uInt16 nRowMin = nY; + sal_uInt16 nRowMax = nY; do { - SvLBoxEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE); + SvLBoxEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False); if( pEntry ) return pEntry; if( nRowMin ) @@ -3464,23 +3464,23 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight ) return 0; } -SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown) +SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, sal_Bool bDown) { SvLBoxEntry* pResult; pCurEntry = pIcnEntry; Create(); SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry); - USHORT nY = pViewData->nY; - USHORT nX = pViewData->nX; + sal_uInt16 nY = pViewData->nY; + sal_uInt16 nX = pViewData->nX; DBG_ASSERT(nY<nRows,"GoUpDown:Bad column"); DBG_ASSERT(nX<nCols,"GoUpDown:Bad row"); // Nachbar in gleicher Spalte ? if( bDown ) pResult = SearchCol( - nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE ); + nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True ); else - pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE ); + pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True ); if( pResult ) return pResult; @@ -3498,11 +3498,11 @@ SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown) nLastRow = -1; // 0-1 } - USHORT nColMin = nX; - USHORT nColMax = nX; + sal_uInt16 nColMin = nX; + sal_uInt16 nColMax = nX; do { - SvLBoxEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE); + SvLBoxEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False); if( pEntry ) return pEntry; if( nColMin ) @@ -3564,29 +3564,29 @@ void ImpIcnCursor::ExpandGrid() } } -BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) +sal_Bool ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) { CreateGridMap(); - USHORT nCount = (USHORT)(nGridCols * nGridRows); + sal_uInt16 nCount = (sal_uInt16)(nGridCols * nGridRows); if( !nCount ) - return FALSE; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + return sal_False; + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { if( !pGridMap[ nCur ] ) { - USHORT nCol = (USHORT)(nCur % nGridCols); - USHORT nRow = (USHORT)(nCur / nGridCols); + sal_uInt16 nCol = (sal_uInt16)(nCur % nGridCols); + sal_uInt16 nRow = (sal_uInt16)(nCur / nGridCols); rRect.Top() = nRow * nGridDY + TBOFFS_WINBORDER; rRect.Bottom() = rRect.Top() + nGridDY; rRect.Left() = nCol * nGridDX+ LROFFS_WINBORDER; rRect.Right() = rRect.Left() + nGridDX; - SetGridUsed( nCol, nRow, TRUE ); + SetGridUsed( nCol, nRow, sal_True ); //XXX //if( nRow + 5 > nGridRows ) // ExpandGrid(); DBG_ASSERT(pGridMap[nCur],"SetGridUsed failed"); - return TRUE; + return sal_True; } } // Gridmap ist voll: Um eine Zeile erweitern @@ -3594,22 +3594,22 @@ BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) rRect.Bottom() = rRect.Top() + nGridDY; rRect.Left() = LROFFS_WINBORDER; rRect.Right() = rRect.Left() + nGridDX; - return FALSE; + return sal_False; //XXX //ExpandGrid(); - //return TRUE; + //return sal_True; } void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry) { if( !pRefEntry ) { - USHORT nAdjustRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY); + sal_uInt16 nAdjustRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY); nAdjustRows++; // wg. Abrundung! if( !nAdjustRows ) return; - for( USHORT nCurList = 0; nCurList < nAdjustRows; nCurList++ ) + for( sal_uInt16 nCurList = 0; nCurList < nAdjustRows; nCurList++ ) { SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, nCurList ); @@ -3619,7 +3619,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry { const Rectangle& rRect = pView->GetBoundingRect( pEntry ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); - USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE); + sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False); ((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns ); pEntry = pView->pModel->NextSibling( pEntry ); } @@ -3643,7 +3643,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); if( nY == nRefRow ) { - USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE ); + sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False ); pRow->Insert( pEntry, nIns ); } pEntry = pView->pModel->NextSibling( pEntry ); @@ -3654,8 +3654,8 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry //static void ImpIcnCursor::DestroyGridAdjustData( SvPtrarr& rLists ) { - USHORT nCount = rLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = rLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ]; delete pArr; @@ -3712,7 +3712,7 @@ void SvImpIconView::Center( SvLBoxEntry* pEntry, // Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird // links, hoch: Offsets < 0 // rechts, runter: Offsets > 0 -void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar ) +void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar ) { const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); @@ -3750,7 +3750,7 @@ Rectangle SvImpIconView::CalcFocusRect( SvLBoxEntry* pEntry ) } -void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, +void SvImpIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pOtherRects, short nBorderOffs ) { if( !pZOrderList || !pZOrderList->Count() ) @@ -3758,7 +3758,7 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, CheckBoundingRects(); pView->Update(); - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); Rectangle aRect( rRect ); aRect.Justify(); @@ -3769,9 +3769,9 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, aRect.Top() -= nBorderOffs; aRect.Bottom() += nBorderOffs; } - BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE; + sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False; - for( USHORT nPos = 0; nPos < nCount; nPos++ ) + for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos )); @@ -3780,28 +3780,28 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, if( !IsBoundingRectValid( pViewData->aRect )) FindBoundingRect( pEntry, pViewData ); const Rectangle& rBoundRect = pViewData->aRect; - BOOL bSelected = pViewData->IsSelected(); + sal_Bool bSelected = pViewData->IsSelected(); - BOOL bOverlaps; + sal_Bool bOverlaps; if( bCalcOverlap ) bOverlaps = IsOver( pOtherRects, rBoundRect ); else - bOverlaps = FALSE; - BOOL bOver = aRect.IsOver( rBoundRect ); + bOverlaps = sal_False; + sal_Bool bOver = aRect.IsOver( rBoundRect ); if( bOver && !bOverlaps ) { // Ist im neuen Selektionsrechteck und in keinem alten // => selektieren if( !bSelected ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } else if( !bAdd ) { // ist ausserhalb des Selektionsrechtecks // => Selektion entfernen if( bSelected ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); } else if( bAdd && bOverlaps ) { @@ -3821,34 +3821,34 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, { // Schnittmenge zwischen alten Rects & aktuellem Rect desel. if( bSelected ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); } else { // Eintrag eines alten Rects selektieren if( !bSelected ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } } else if( !bOver && bSelected ) { // Der Eintrag liegt voellig ausserhalb und wird deshalb desel. - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); } } pView->Update(); } -BOOL SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const +sal_Bool SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const { - USHORT nCount = pRectList->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = pRectList->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur ); if( rBoundRect.IsOver( *pRect )) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs ) @@ -3867,8 +3867,8 @@ void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs ) void SvImpIconView::ClearSelectedRectList() { - USHORT nCount = aSelectedRectList.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = aSelectedRectList.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur ); delete pRect; @@ -3906,7 +3906,7 @@ void SvImpIconView::ImpDrawXORRect( const Rectangle& rRect ) } void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel, - long& rX, long& rY, BOOL bInDragDrop, USHORT nBorderWidth) + long& rX, long& rY, sal_Bool bInDragDrop, sal_uInt16 nBorderWidth) { // Scrolling der View, falls sich der Mauszeiger im Grenzbereich des // Fensters befindet @@ -3914,8 +3914,8 @@ void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel, long nPixelToScrollY = 0; Size aWndSize = aOutputSize; - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); if ( rPosPixel.X() < nBorderWidth ) { @@ -3967,16 +3967,16 @@ void SvImpIconView::EndTracking() } } -BOOL SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ) +sal_Bool SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ) { SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); if( pItem ) { Rectangle aRect( CalcTextRect( pEntry, pItem )); if( aRect.IsInside( rDocPos ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } IMPL_LINK(SvImpIconView, EditTimeoutHdl, Timer*, EMPTYARG ) @@ -4001,8 +4001,8 @@ void SvImpIconView::AdjustAtGrid( SvLBoxEntry* pStart ) { SvPtrarr aLists; pImpCursor->CreateGridAjustData( aLists, pStart ); - USHORT nCount = aLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = aLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart ); } @@ -4016,18 +4016,18 @@ void SvImpIconView::AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart ) if( !rRow.Count() ) return; - BOOL bGo; + sal_Bool bGo; if( !pStart ) - bGo = TRUE; + bGo = sal_True; else - bGo = FALSE; + bGo = sal_False; long nCurRight = 0; - for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ ) + for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ ) { SvLBoxEntry* pCur = (SvLBoxEntry*)rRow[ nCur ]; if( !bGo && pCur == pStart ) - bGo = TRUE; + bGo = sal_True; SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); // Massgebend (fuer das menschliche Auge) ist die Bitmap, da sonst diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index d260f984c2b0..89e888de0318 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -44,20 +44,20 @@ struct SvLBoxButtonData_Impl { SvLBoxEntry* pEntry; - BOOL bDefaultImages; - BOOL bShowRadioButton; + sal_Bool bDefaultImages; + sal_Bool bShowRadioButton; - SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( FALSE ), bShowRadioButton( FALSE ) {} + SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( sal_False ), bShowRadioButton( sal_False ) {} }; DBG_NAME(SvLBoxButtonData) -void SvLBoxButtonData::InitData( BOOL bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl ) +void SvLBoxButtonData::InitData( sal_Bool bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl ) { pImpl = new SvLBoxButtonData_Impl; - bDataOk = FALSE; + bDataOk = sal_False; eState = SV_BUTTON_UNCHECKED; pImpl->bDefaultImages = bImagesFromDefault; pImpl->bShowRadioButton = ( _bRadioBtn != false ); @@ -70,21 +70,21 @@ SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings ) { DBG_CTOR(SvLBoxButtonData,0); - InitData( TRUE, false, pControlForSettings ); + InitData( sal_True, false, pControlForSettings ); } SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn ) { DBG_CTOR(SvLBoxButtonData,0); - InitData( TRUE, _bRadioBtn, pControlForSettings ); + InitData( sal_True, _bRadioBtn, pControlForSettings ); } SvLBoxButtonData::SvLBoxButtonData() { DBG_CTOR(SvLBoxButtonData,0); - InitData( FALSE, false ); + InitData( sal_False, false ); } SvLBoxButtonData::~SvLBoxButtonData() @@ -103,11 +103,11 @@ void SvLBoxButtonData::CallLink() aLink.Call( this ); } -USHORT SvLBoxButtonData::GetIndex( USHORT nItemState ) +sal_uInt16 SvLBoxButtonData::GetIndex( sal_uInt16 nItemState ) { DBG_CHKTHIS(SvLBoxButtonData,0); nItemState &= 0x000F; - USHORT nIdx; + sal_uInt16 nIdx; switch( nItemState ) { case SV_ITEMSTATE_UNCHECKED: @@ -134,18 +134,18 @@ void SvLBoxButtonData::SetWidthAndHeight() Size aSize = aBmps[0].GetSizePixel(); nWidth = aSize.Width(); nHeight = aSize.Height(); - bDataOk = TRUE; + bDataOk = sal_True; } -void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, USHORT nItemFlags ) +void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, sal_uInt16 nItemFlags ) { DBG_CHKTHIS(SvLBoxButtonData,0); pImpl->pEntry = pActEntry; eState = ConvertToButtonState( nItemFlags ); } -SvButtonState SvLBoxButtonData::ConvertToButtonState( USHORT nItemFlags ) const +SvButtonState SvLBoxButtonData::ConvertToButtonState( sal_uInt16 nItemFlags ) const { DBG_CHKTHIS(SvLBoxButtonData,0); nItemFlags &= (SV_ITEMSTATE_UNCHECKED | @@ -196,12 +196,12 @@ void SvLBoxButtonData::SetDefaultImages( const Control* pCtrl ) } } -BOOL SvLBoxButtonData::HasDefaultImages( void ) const +sal_Bool SvLBoxButtonData::HasDefaultImages( void ) const { return pImpl->bDefaultImages; } -BOOL SvLBoxButtonData::IsRadio() { +sal_Bool SvLBoxButtonData::IsRadio() { return pImpl->bShowRadioButton; } @@ -211,7 +211,7 @@ BOOL SvLBoxButtonData::IsRadio() { DBG_NAME(SvLBoxString); -SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,USHORT nFlags,const XubString& rStr) : +SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,sal_uInt16 nFlags,const XubString& rStr) : SvLBoxItem( pEntry, nFlags ) { DBG_CTOR(SvLBoxString,0); @@ -228,19 +228,19 @@ SvLBoxString::~SvLBoxString() DBG_DTOR(SvLBoxString,0); } -USHORT SvLBoxString::IsA() +sal_uInt16 SvLBoxString::IsA() { DBG_CHKTHIS(SvLBoxString,0); return SV_ITEM_ID_LBOXSTRING; } -void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, +void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry) { DBG_CHKTHIS(SvLBoxString,0); if ( _pEntry ) { - USHORT nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE; + sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE; if ( rDev.IsEntryMnemonicsEnabled() ) nStyle |= TEXT_DRAW_MNEMONIC; rDev.DrawText( Rectangle(rPos,GetSize(&rDev,_pEntry)),aStr,nStyle); @@ -283,7 +283,7 @@ void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, DBG_NAME(SvLBoxBmp); -SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, USHORT nFlags, Image aBitmap ) : +SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image aBitmap ) : SvLBoxItem( pEntry, nFlags ) { DBG_CTOR(SvLBoxBmp,0); @@ -300,7 +300,7 @@ SvLBoxBmp::~SvLBoxBmp() DBG_DTOR(SvLBoxBmp,0); } -USHORT SvLBoxBmp::IsA() +sal_uInt16 SvLBoxBmp::IsA() { DBG_CHKTHIS(SvLBoxBmp,0); return SV_ITEM_ID_LBOXBMP; @@ -321,11 +321,11 @@ void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, pViewData->aSize = aBmp.GetSizePixel(); } -void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, +void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* ) { DBG_CHKTHIS(SvLBoxBmp,0); - USHORT nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; + sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; rDev.DrawImage( rPos, aBmp ,nStyle); } @@ -348,7 +348,7 @@ void SvLBoxBmp::Clone( SvLBoxItem* pSource ) DBG_NAME(SvLBoxButton); SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry, SvLBoxButtonKind eTheKind, - USHORT nFlags, SvLBoxButtonData* pBData ) + sal_uInt16 nFlags, SvLBoxButtonData* pBData ) : SvLBoxItem( pEntry, nFlags ) { DBG_CTOR(SvLBoxButton,0); @@ -372,13 +372,13 @@ SvLBoxButton::~SvLBoxButton() DBG_DTOR(SvLBoxButton,0); } -USHORT SvLBoxButton::IsA() +sal_uInt16 SvLBoxButton::IsA() { DBG_CHKTHIS(SvLBoxButton,0); return SV_ITEM_ID_LBOXBUTTON; } -void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn) +void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, sal_Bool bOn) { DBG_CHKTHIS(SvLBoxButton,0); if ( bOn != IsStateChecked() ) @@ -390,7 +390,7 @@ void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn) } } -BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) +sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) { DBG_CHKTHIS(SvLBoxButton,0); if ( CheckModification() ) @@ -402,22 +402,22 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) pData->StoreButtonState( pEntry, nItemFlags ); pData->CallLink(); } - return FALSE; + return sal_False; } -void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, +void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* /*pEntry*/ ) { DBG_CHKTHIS(SvLBoxButton,0); - USHORT nIndex = eKind == SvLBoxButtonKind_staticImage + sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage ? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags ); - USHORT nStyle = eKind != SvLBoxButtonKind_disabledCheckbox && + sal_uInt16 nStyle = eKind != SvLBoxButtonKind_disabledCheckbox && rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; /// //Native drawing /// - BOOL bNativeOK = FALSE; + sal_Bool bNativeOK = sal_False; ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) ) { @@ -520,14 +520,14 @@ struct SvLBoxContextBmp_Impl Image m_aImage1_hc; Image m_aImage2_hc; - USHORT m_nB2IndicatorFlags; + sal_uInt16 m_nB2IndicatorFlags; }; // *************************************************************** DBG_NAME(SvLBoxContextBmp) -SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, USHORT nItemFlags, - Image aBmp1, Image aBmp2, USHORT nEntryFlags ) +SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, sal_uInt16 nItemFlags, + Image aBmp1, Image aBmp2, sal_uInt16 nEntryFlags ) :SvLBoxItem( pEntry, nItemFlags ) ,m_pImpl( new SvLBoxContextBmp_Impl ) { @@ -551,13 +551,13 @@ SvLBoxContextBmp::~SvLBoxContextBmp() DBG_DTOR(SvLBoxContextBmp,0); } -USHORT SvLBoxContextBmp::IsA() +sal_uInt16 SvLBoxContextBmp::IsA() { DBG_CHKTHIS(SvLBoxContextBmp,0); return SV_ITEM_ID_LBOXCONTEXTBMP; } -BOOL SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode ) +sal_Bool SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode ) { DBG_CHKTHIS(SvLBoxContextBmp,0); @@ -612,7 +612,7 @@ void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, } void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev, - USHORT _nViewDataEntryFlags, SvLBoxEntry* _pEntry ) + sal_uInt16 _nViewDataEntryFlags, SvLBoxEntry* _pEntry ) { DBG_CHKTHIS(SvLBoxContextBmp,0); @@ -629,7 +629,7 @@ void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev, sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT & _pEntry->GetFlags( ) ) ); // draw - USHORT nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; + sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; if ( _bSemiTransparent ) nStyle |= IMAGE_DRAW_SEMITRANSPARENT; _rDev.DrawImage( _rPos, rImage, nStyle); diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index 11e19c6bab3c..e34ed061cd69 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -31,7 +31,7 @@ /* Todo: - Anker loeschen in SelectionEngine bei manuellem Selektieren - - SelectAll( FALSE ), nur die deselektierten Entries repainten + - SelectAll( sal_False ), nur die deselektierten Entries repainten */ #include <string.h> @@ -77,14 +77,14 @@ SvInplaceEdit::SvInplaceEdit Edit( pParent, WB_LEFT ), aCallBackHdl ( rNotifyEditEnd ), - bCanceled ( FALSE ), - bAlreadyInCallBack ( FALSE ) + bCanceled ( sal_False ), + bAlreadyInCallBack ( sal_False ) { DBG_CTOR(SvInplaceEdit,0); Font aFont( pParent->GetFont() ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aColor( pParent->GetBackground().GetColor() ); aFont.SetFillColor(aColor ); SetFont( aFont ); @@ -120,7 +120,7 @@ SvInplaceEdit::~SvInplaceEdit() IMPL_LINK_INLINE_START( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit,0); - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); return 1; } @@ -129,7 +129,7 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG ) IMPL_LINK_INLINE_START( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit,0); - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); return 1; } @@ -138,16 +138,16 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG ) void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt ) { DBG_CHKTHIS(SvInplaceEdit,0); - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch ( nCode ) { case KEY_ESCAPE: - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); break; case KEY_RETURN: - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); break; @@ -156,7 +156,7 @@ void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt ) } } -void SvInplaceEdit::StopEditing( BOOL bCancel ) +void SvInplaceEdit::StopEditing( sal_Bool bCancel ) { DBG_CHKTHIS(SvInplaceEdit,0); if ( !bAlreadyInCallBack ) @@ -171,7 +171,7 @@ void SvInplaceEdit::LoseFocus() DBG_CHKTHIS(SvInplaceEdit,0); if ( !bAlreadyInCallBack ) { - bCanceled = FALSE; + bCanceled = sal_False; aTimer.SetTimeout(10); aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit,Timeout_Impl)); aTimer.Start(); @@ -192,12 +192,12 @@ void SvInplaceEdit::CallCallBackHdl_Impl() aTimer.Stop(); if ( !bAlreadyInCallBack ) { - bAlreadyInCallBack = TRUE; + bAlreadyInCallBack = sal_True; GetpApp()->RemoveAccel( &aAccReturn ); GetpApp()->RemoveAccel( &aAccEscape ); Hide(); aCallBackHdl.Call( this ); - // bAlreadyInCallBack = FALSE; + // bAlreadyInCallBack = sal_False; } } @@ -268,12 +268,12 @@ SvInplaceEdit2::SvInplaceEdit2 const String& rData, const Link& rNotifyEditEnd, const Selection& rSelection, - BOOL bMulti + sal_Bool bMulti ) : aCallBackHdl ( rNotifyEditEnd ), - bCanceled ( FALSE ), - bAlreadyInCallBack ( FALSE ), + bCanceled ( sal_False ), + bAlreadyInCallBack ( sal_False ), bMultiLine ( bMulti ) { @@ -285,7 +285,7 @@ SvInplaceEdit2::SvInplaceEdit2 pEdit = new MyEdit_Impl( pParent, this ); Font aFont( pParent->GetFont() ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aColor( pParent->GetBackground().GetColor() ); aFont.SetFillColor(aColor ); pEdit->SetFont( aFont ); @@ -333,7 +333,7 @@ void SvInplaceEdit2::Hide() IMPL_LINK_INLINE_START( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit2,0); - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); return 1; } @@ -342,35 +342,35 @@ IMPL_LINK_INLINE_END( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG ) IMPL_LINK_INLINE_START( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit2,0); - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); return 1; } IMPL_LINK_INLINE_END( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG ) -BOOL SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt ) +sal_Bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt ) { DBG_CHKTHIS(SvInplaceEdit2,0); KeyCode aCode = rKEvt.GetKeyCode(); - USHORT nCode = aCode.GetCode(); + sal_uInt16 nCode = aCode.GetCode(); switch ( nCode ) { case KEY_ESCAPE: - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); - return TRUE; + return sal_True; case KEY_RETURN: - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -void SvInplaceEdit2::StopEditing( BOOL bCancel ) +void SvInplaceEdit2::StopEditing( sal_Bool bCancel ) { DBG_CHKTHIS(SvInplaceEdit2,0); if ( !bAlreadyInCallBack ) @@ -387,7 +387,7 @@ void SvInplaceEdit2::LoseFocus() && ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) ) ) { - bCanceled = FALSE; + bCanceled = sal_False; aTimer.SetTimeout(10); aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl)); aTimer.Start(); @@ -408,7 +408,7 @@ void SvInplaceEdit2::CallCallBackHdl_Impl() aTimer.Stop(); if ( !bAlreadyInCallBack ) { - bAlreadyInCallBack = TRUE; + bAlreadyInCallBack = sal_True; GetpApp()->RemoveAccel( &aAccReturn ); GetpApp()->RemoveAccel( &aAccEscape ); pEdit->Hide(); @@ -435,7 +435,7 @@ SvLBoxTab::SvLBoxTab() nFlags = 0; } -SvLBoxTab::SvLBoxTab( long nPosition, USHORT nTabFlags ) +SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags ) { DBG_CTOR(SvLBoxTab,0); nPos = nPosition; @@ -494,7 +494,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev ) long nWidth; if ( nFlags & SV_LBOXTAB_ADJUST_NUMERIC ) { - USHORT nPos = rStr.Search( '.' ); + sal_uInt16 nPos = rStr.Search( '.' ); if ( nPos == STRING_NOTFOUND ) nPos = rStr.Search( ',' ); if ( nPos == STRING_NOTFOUND ) @@ -518,7 +518,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev ) DBG_NAME(SvLBoxItem); -SvLBoxItem::SvLBoxItem( SvLBoxEntry*, USHORT ) +SvLBoxItem::SvLBoxItem( SvLBoxEntry*, sal_uInt16 ) { DBG_CTOR(SvLBoxItem,0); } @@ -543,7 +543,7 @@ const Size& SvLBoxItem::GetSize( SvLBox* pView,SvLBoxEntry* pEntry ) const Size& SvLBoxItem::GetSize( SvLBoxEntry* pEntry, SvViewDataEntry* pViewData) { DBG_CHKTHIS(SvLBoxItem,0); - USHORT nItemPos = pEntry->GetPos( this ); + sal_uInt16 nItemPos = pEntry->GetPos( this ); SvViewDataItem* pItemData = pViewData->pItemData+nItemPos; return pItemData->aSize; } @@ -584,7 +584,7 @@ SvLBoxEntry::~SvLBoxEntry() void SvLBoxEntry::DeleteItems_Impl() { DBG_CHKTHIS(SvLBoxEntry,0); - USHORT nCount = aItems.Count(); + sal_uInt16 nCount = aItems.Count(); while( nCount ) { nCount--; @@ -607,8 +607,8 @@ void SvLBoxEntry::Clone( SvListEntry* pSource ) SvListEntry::Clone( pSource ); SvLBoxItem* pNewItem; DeleteItems_Impl(); - USHORT nCount = ((SvLBoxEntry*)pSource)->ItemCount(); - USHORT nCurPos = 0; + sal_uInt16 nCount = ((SvLBoxEntry*)pSource)->ItemCount(); + sal_uInt16 nCurPos = 0; while( nCurPos < nCount ) { SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos ); @@ -621,7 +621,7 @@ void SvLBoxEntry::Clone( SvListEntry* pSource ) nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags; } -void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable ) +void SvLBoxEntry::EnableChildsOnDemand( sal_Bool bEnable ) { DBG_CHKTHIS(SvLBoxEntry,0); if ( bEnable ) @@ -630,7 +630,7 @@ void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable ) nEntryFlags &= (~SV_ENTRYFLAG_CHILDS_ON_DEMAND); } -void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos ) +void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos ) { DBG_CHKTHIS(SvLBoxEntry,0); DBG_ASSERT(pNewItem,"ReplaceItem:No Item"); @@ -643,10 +643,10 @@ void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos ) } } -SvLBoxItem* SvLBoxEntry::GetFirstItem( USHORT nId ) +SvLBoxItem* SvLBoxEntry::GetFirstItem( sal_uInt16 nId ) { - USHORT nCount = aItems.Count(); - USHORT nCur = 0; + sal_uInt16 nCount = aItems.Count(); + sal_uInt16 nCur = 0; SvLBoxItem* pItem; while( nCur < nCount ) { @@ -801,7 +801,7 @@ bool SvLBox::IsEntryMnemonicsEnabled() const return pLBoxImpl->m_bEntryMnemonicsEnabled; } -USHORT SvLBox::IsA() +sal_uInt16 SvLBox::IsA() { DBG_CHKTHIS(SvLBox,0); return SVLISTBOX_ID_LBOX; @@ -814,17 +814,17 @@ IMPL_LINK_INLINE_START( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry ) } IMPL_LINK_INLINE_END( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry ) -ULONG SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, ULONG nPos ) +sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, sal_uLong nPos ) { DBG_CHKTHIS(SvLBox,0); - ULONG nInsPos = pModel->Insert( pEntry, pParent, nPos ); + sal_uLong nInsPos = pModel->Insert( pEntry, pParent, nPos ); return nInsPos; } -ULONG SvLBox::Insert( SvLBoxEntry* pEntry,ULONG nRootPos ) +sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos ) { DBG_CHKTHIS(SvLBox,0); - ULONG nInsPos = pModel->Insert( pEntry, nRootPos ); + sal_uLong nInsPos = pModel->Insert( pEntry, nRootPos ); return nInsPos; } @@ -852,48 +852,48 @@ void SvLBox::DeselectHdl() aDeselectHdl.Call( this ); } -BOOL SvLBox::DoubleClickHdl() +sal_Bool SvLBox::DoubleClickHdl() { DBG_CHKTHIS(SvLBox,0); aDoubleClickHdl.Call( this ); - return TRUE; + return sal_True; } -BOOL SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction ) +sal_Bool SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction ) { DBG_CHKTHIS(SvLBox,0); if ( pSource == this ) { if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) ) - return FALSE; // D&D innerhalb der Liste gesperrt + return sal_False; // D&D innerhalb der Liste gesperrt if( DND_ACTION_MOVE == nAction ) { if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) ) - return FALSE; // kein lokales Move + return sal_False; // kein lokales Move } else { if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY)) - return FALSE; // kein lokales Copy + return sal_False; // kein lokales Copy } } else { if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) ) - return FALSE; // kein Drop + return sal_False; // kein Drop if ( DND_ACTION_MOVE == nAction ) { if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) ) - return FALSE; // kein globales Move + return sal_False; // kein globales Move } else { if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY)) - return FALSE; // kein globales Copy + return sal_False; // kein globales Copy } } - return TRUE; + return sal_True; } @@ -919,19 +919,19 @@ void SvLBox::NotifyRemoving( SvLBoxEntry* ) - Entry wird an das Ende der Target-Childlist gehaengt */ #ifdef DBG_UTIL -BOOL SvLBox::NotifyMoving( +sal_Bool SvLBox::NotifyMoving( SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() SvLBoxEntry* pEntry, // Zu verschiebender Entry aus // GetSourceListBox()->GetModel() SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - ULONG& rNewChildPos) // Position in Childlist des Target-Parents + sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents #else -BOOL SvLBox::NotifyMoving( +sal_Bool SvLBox::NotifyMoving( SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() SvLBoxEntry*, // Zu verschiebender Entry aus // GetSourceListBox()->GetModel() SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - ULONG& rNewChildPos) // Position in Childlist des Target-Parents + sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents #endif { DBG_CHKTHIS(SvLBox,0); @@ -940,7 +940,7 @@ BOOL SvLBox::NotifyMoving( { rpNewParent = 0; rNewChildPos = 0; - return TRUE; + return sal_True; } if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() ) { @@ -959,15 +959,15 @@ BOOL SvLBox::NotifyMoving( else rNewChildPos = LIST_APPEND; } - return TRUE; + return sal_True; } -BOOL SvLBox::NotifyCopying( +sal_Bool SvLBox::NotifyCopying( SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() SvLBoxEntry* pEntry, // Zu kopierender Entry aus // GetSourceListBox()->GetModel() SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - ULONG& rNewChildPos) // Position in Childlist des Target-Parents + sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents { DBG_CHKTHIS(SvLBox,0); return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos); @@ -977,7 +977,7 @@ BOOL SvLBox::NotifyCopying( { rpNewParent = 0; rNewChildPos = 0; - return TRUE; + return sal_True; } if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() ) { @@ -994,7 +994,7 @@ BOOL SvLBox::NotifyCopying( else rNewChildPos = LIST_APPEND; } - return TRUE; + return sal_True; */ } @@ -1008,13 +1008,13 @@ SvLBoxEntry* SvLBox::CloneEntry( SvLBoxEntry* pSource ) // Rueckgabe: Alle Entries wurden kopiert -BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) +sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) { DBG_CHKTHIS(SvLBox,0); nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; SvTreeEntryList aList; - BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() ); + sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() ); Link aCloneLink( pModel->GetCloneLink() ); pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl )); @@ -1025,7 +1025,7 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) while ( pSourceEntry ) { // Childs werden automatisch mitkopiert - pSource->SelectChilds( pSourceEntry, FALSE ); + pSource->SelectChilds( pSourceEntry, sal_False ); aList.Insert( pSourceEntry, LIST_APPEND ); pSourceEntry = pSource->NextSelected( pSourceEntry ); } @@ -1034,13 +1034,13 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) while ( pSourceEntry ) { SvLBoxEntry* pNewParent = 0; - ULONG nInsertionPos = LIST_APPEND; - BOOL bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos); + sal_uLong nInsertionPos = LIST_APPEND; + sal_Bool bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos); if ( bOk ) { if ( bClone ) { - ULONG nCloneCount = 0; + sal_uLong nCloneCount = 0; pSourceEntry = (SvLBoxEntry*) pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount ); pModel->InsertTree( (SvListEntry*)pSourceEntry, @@ -1048,15 +1048,15 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) } else { - ULONG nListPos = pModel->Copy( (SvListEntry*)pSourceEntry, + sal_uLong nListPos = pModel->Copy( (SvListEntry*)pSourceEntry, (SvListEntry*)pNewParent, nInsertionPos ); pSourceEntry = GetEntry( pNewParent, nListPos ); } } else - bSuccess = FALSE; + bSuccess = sal_False; - if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen? + if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen? MakeVisible( pSourceEntry ); pSourceEntry = (SvLBoxEntry*)aList.Next(); @@ -1066,18 +1066,18 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) } // Rueckgabe: Alle Entries wurden verschoben -BOOL SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget ) +sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget ) { return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False ); } -BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback ) +sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback ) { DBG_CHKTHIS(SvLBox,0); nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; SvTreeEntryList aList; - BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() ); + sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() ); Link aCloneLink( pModel->GetCloneLink() ); if ( bClone ) pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl )); @@ -1086,7 +1086,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT while ( pSourceEntry ) { // Childs werden automatisch mitbewegt - pSource->SelectChilds( pSourceEntry, FALSE ); + pSource->SelectChilds( pSourceEntry, sal_False ); aList.Insert( pSourceEntry, LIST_APPEND ); pSourceEntry = pSource->NextSelected( pSourceEntry ); } @@ -1095,7 +1095,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT while ( pSourceEntry ) { SvLBoxEntry* pNewParent = 0; - ULONG nInsertionPos = LIST_APPEND; + sal_uLong nInsertionPos = LIST_APPEND; sal_Bool bOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos); sal_Bool bCopyOk = bOk; if ( !bOk && bAllowCopyFallback ) @@ -1108,7 +1108,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT { if ( bClone ) { - ULONG nCloneCount = 0; + sal_uLong nCloneCount = 0; pSourceEntry = (SvLBoxEntry*) pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount ); pModel->InsertTree( (SvListEntry*)pSourceEntry, @@ -1125,9 +1125,9 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT } } else - bSuccess = FALSE; + bSuccess = sal_False; - if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen? + if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen? MakeVisible( pSourceEntry ); pSourceEntry = (SvLBoxEntry*)aList.Next(); @@ -1148,7 +1148,7 @@ void SvLBox::RemoveSelection() aList.Insert( pEntry ); if ( pEntry->HasChilds() ) // Remove loescht Childs automatisch - SelectChilds( pEntry, FALSE ); + SelectChilds( pEntry, sal_False ); pEntry = NextSelected( pEntry ); } pEntry = (SvLBoxEntry*)aList.First(); @@ -1181,8 +1181,8 @@ void SvLBox::RecalcViewData() SvLBoxEntry* pEntry = First(); while( pEntry ) { - USHORT nCount = pEntry->ItemCount(); - USHORT nCurPos = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCurPos = 0; while ( nCurPos < nCount ) { SvLBoxItem* pItem = pEntry->GetItem( nCurPos ); @@ -1206,7 +1206,7 @@ void SvLBox::StateChanged( StateChangedType eType ) Control::StateChanged( eType ); } -void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow) +void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow) { DBG_CHKTHIS(SvLBox,0); if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) ) @@ -1220,31 +1220,31 @@ void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow) nImpFlags &= ~SVLBOX_TARGEMPH_VIS; } -void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, BOOL /* bShow */ ) +void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, sal_Bool /* bShow */ ) { DBG_CHKTHIS(SvLBox,0); } -BOOL SvLBox::Expand( SvLBoxEntry* ) +sal_Bool SvLBox::Expand( SvLBoxEntry* ) { DBG_CHKTHIS(SvLBox,0); - return TRUE; + return sal_True; } -BOOL SvLBox::Collapse( SvLBoxEntry* ) +sal_Bool SvLBox::Collapse( SvLBoxEntry* ) { DBG_CHKTHIS(SvLBox,0); - return TRUE; + return sal_True; } -BOOL SvLBox::Select( SvLBoxEntry*, BOOL ) +sal_Bool SvLBox::Select( SvLBoxEntry*, sal_Bool ) { DBG_CHKTHIS(SvLBox,0); - return FALSE; + return sal_False; } -ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL ) +sal_uLong SvLBox::SelectChilds( SvLBoxEntry* , sal_Bool ) { DBG_CHKTHIS(SvLBox,0); return 0; @@ -1256,7 +1256,7 @@ void SvLBox::OnCurrentEntryChanged() pLBoxImpl->m_aQuickSelectionEngine.Reset(); } -void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ ) +void SvLBox::SelectAll( sal_Bool /* bSelect */ , sal_Bool /* bPaint */ ) { DBG_CHKTHIS(SvLBox,0); } @@ -1285,9 +1285,9 @@ void SvLBox::FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPa if ( pEntry ) { SvLBoxEntry* pParentEntry = GetParent( pEntry ); - while ( TRUE ) + while ( sal_True ) { - ULONG i, nCount = GetLevelChildCount( pParentEntry ); + sal_uLong i, nCount = GetLevelChildCount( pParentEntry ); for ( i = 0; i < nCount; ++i ) { SvLBoxEntry* pTemp = GetEntry( pParentEntry, i ); @@ -1317,11 +1317,11 @@ String SvLBox::GetEntryText( SvLBoxEntry* ) const return String(); } -ULONG SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const +sal_uLong SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const { DBG_CHKTHIS(SvLBox,0); - ULONG nCount = 0; + sal_uLong nCount = 0; SvLBoxEntry* pEntry = FirstChild( _pParent ); while ( pEntry ) { @@ -1360,8 +1360,8 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry ) pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ]; SvViewDataItem* pItemData = pEntryData->pItemData; pEntryData->nItmCnt = pInhEntry->ItemCount(); // Anzahl Items fuer delete - USHORT nCount = pInhEntry->ItemCount(); - USHORT nCurPos = 0; + sal_uInt16 nCount = pInhEntry->ItemCount(); + sal_uInt16 nCurPos = 0; while( nCurPos < nCount ) { SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos ); @@ -1373,10 +1373,10 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry ) -void SvLBox::EnableSelectionAsDropTarget( BOOL bEnable, BOOL bWithChilds ) +void SvLBox::EnableSelectionAsDropTarget( sal_Bool bEnable, sal_Bool bWithChilds ) { DBG_CHKTHIS(SvLBox,0); - USHORT nRefDepth; + sal_uInt16 nRefDepth; SvLBoxEntry* pTemp; SvLBoxEntry* pSelEntry = FirstSelected(); @@ -1427,11 +1427,11 @@ SvLBoxEntry* SvLBox::GetDropTarget( const Point& ) void SvLBox::EditText( const String& rStr, const Rectangle& rRect, const Selection& rSel ) { - EditText( rStr, rRect, rSel, FALSE ); + EditText( rStr, rRect, rSel, sal_False ); } void SvLBox::EditText( const String& rStr, const Rectangle& rRect, - const Selection& rSel, BOOL bMulti ) + const Selection& rSel, sal_Bool bMulti ) { DBG_CHKTHIS(SvLBox,0); if( pEdCtrl ) @@ -1473,11 +1473,11 @@ void SvLBox::CancelTextEditing() { DBG_CHKTHIS(SvLBox,0); if ( pEdCtrl ) - pEdCtrl->StopEditing( TRUE ); + pEdCtrl->StopEditing( sal_True ); nImpFlags &= (~SVLBOX_IN_EDT); } -void SvLBox::EndEditing( BOOL bCancel ) +void SvLBox::EndEditing( sal_Bool bCancel ) { DBG_CHKTHIS(SvLBox,0); if( pEdCtrl ) @@ -1591,7 +1591,7 @@ void SvLBox::SelectSearchEntry( const void* _pEntry ) if ( !pEntry ) return; - SelectAll( FALSE ); + SelectAll( sal_False ); SetCurEntry( pEntry ); Select( pEntry ); } @@ -1642,7 +1642,7 @@ bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt ) return false; } -SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const +SvLBoxEntry* SvLBox::GetEntry( const Point&, sal_Bool ) const { DBG_CHKTHIS(SvLBox,0); return 0; @@ -1651,15 +1651,15 @@ SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const void SvLBox::ModelHasEntryInvalidated( SvListEntry* pEntry ) { DBG_CHKTHIS(SvLBox,0); - USHORT nCount = ((SvLBoxEntry*)pEntry)->ItemCount(); - for( USHORT nIdx = 0; nIdx < nCount; nIdx++ ) + sal_uInt16 nCount = ((SvLBoxEntry*)pEntry)->ItemCount(); + for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ ) { SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx ); pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 ); } } -void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse ) +void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, sal_Bool bInUse ) { DBG_CHKTHIS(SvLBox,0); DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry"); @@ -1681,7 +1681,7 @@ void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse ) } } -void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored ) +void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, sal_Bool bCursored ) { DBG_CHKTHIS(SvLBox,0); DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry"); @@ -1696,7 +1696,7 @@ void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored ) } } -BOOL SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const +sal_Bool SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const { DBG_CHKTHIS(SvLBox,0); DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry"); @@ -1715,11 +1715,11 @@ void SvLBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* ) DBG_CHKTHIS(SvLBox,0); } -BOOL SvLBox::EditingCanceled() const +sal_Bool SvLBox::EditingCanceled() const { if( pEdCtrl && pEdCtrl->EditingCanceled() ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } @@ -1731,7 +1731,7 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt ) if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) ) { - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); } else if( !nDragDropMode ) { @@ -1758,12 +1758,12 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt ) // **** Emphasis zeichnen **** if( DND_ACTION_NONE == nRet ) - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) ) { - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); pTargetEntry = pEntry; - ImplShowTargetEmphasis( pTargetEntry, TRUE ); + ImplShowTargetEmphasis( pTargetEntry, sal_True ); } } return nRet; @@ -1775,9 +1775,9 @@ sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView sal_Int8 nRet = DND_ACTION_NONE; DBG_ASSERT( pSourceView, "SvLBox::ExecuteDrop(): no source view" ); - pSourceView->EnableSelectionAsDropTarget( TRUE, TRUE ); + pSourceView->EnableSelectionAsDropTarget( sal_True, sal_True ); - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); pDDTarget = this; SvLBoxDDInfo aDDInfo; @@ -1873,8 +1873,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) pDDSource = this; pDDTarget = 0; - BOOL bOldUpdateMode = Control::IsUpdateMode(); - Control::SetUpdateMode( TRUE ); + sal_Bool bOldUpdateMode = Control::IsUpdateMode(); + Control::SetUpdateMode( sal_True ); Update(); Control::SetUpdateMode( bOldUpdateMode ); @@ -1882,8 +1882,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) // Wichtig: Wenn im DropHandler die Selektion der // SourceListBox veraendert wird, muessen vorher die Eintraege // als DropTargets wieder freigeschaltet werden: - // (GetSourceListBox()->EnableSelectionAsDropTarget( TRUE, TRUE );) - EnableSelectionAsDropTarget( FALSE, TRUE /* with Childs */ ); + // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );) + EnableSelectionAsDropTarget( sal_False, sal_True /* with Childs */ ); pContainer->StartDrag( this, nDragOptions, GetDragFinishedHdl() ); } @@ -1894,18 +1894,18 @@ nAction #endif ) { - EnableSelectionAsDropTarget( TRUE, TRUE ); + EnableSelectionAsDropTarget( sal_True, sal_True ); #ifndef UNX if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget && - ((ULONG)(pDDTarget->GetModel())!=(ULONG)(this->GetModel()))) || + ((sal_uLong)(pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) || !pDDTarget )) { RemoveSelection(); } #endif - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); pDDSource = 0; pDDTarget = 0; pTargetEntry = 0; @@ -1918,10 +1918,10 @@ DragDropMode SvLBox::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* ) return (DragDropMode)0xffff; } -BOOL SvLBox::NotifyAcceptDrop( SvLBoxEntry* ) +sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* ) { DBG_CHKTHIS(SvLBox,0); - return TRUE; + return sal_True; } // handler and methods for Drag - finished handler. @@ -1938,20 +1938,20 @@ namespace void SvLBox::AddBoxToDDList_Impl( const SvLBox& rB ) { - ULONG nVal = (ULONG)&rB; + sal_uLong nVal = (sal_uLong)&rB; SortLBoxes::get().Insert( nVal ); } void SvLBox::RemoveBoxFromDDList_Impl( const SvLBox& rB ) { - ULONG nVal = (ULONG)&rB; + sal_uLong nVal = (sal_uLong)&rB; SortLBoxes::get().Remove( nVal ); } IMPL_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8*, pAction ) { - ULONG nVal = (ULONG)pThis; - USHORT nFnd; + sal_uLong nVal = (sal_uLong)pThis; + sal_uInt16 nFnd; SvULongsSort &rSortLBoxes = SortLBoxes::get(); if( rSortLBoxes.Seek_Entry( nVal, &nFnd ) ) { diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 53fbded59f11..ed48f9fc6352 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -75,7 +75,7 @@ void SvTabListBox::SetTabs() */ // alle anderen Tabs an Liste haengen - for( USHORT nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) + for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) { SvLBoxTab* pTab = pTabList+nCurTab; AddTab( pTab->GetPos(), pTab->nFlags ); @@ -90,10 +90,10 @@ void SvTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr, XubString aToken; const xub_Unicode* pCurToken = aCurEntry.GetBuffer(); - USHORT nCurTokenLen; + sal_uInt16 nCurTokenLen; const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen ); - USHORT nCount = nTabCount; nCount--; - for( USHORT nToken = 0; nToken < nCount; nToken++ ) + sal_uInt16 nCount = nTabCount; nCount--; + for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ ) { if( pCurToken && nCurTokenLen ) // aToken.Assign( pCurToken, nCurTokenLen ); @@ -147,7 +147,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit ) return; delete [] pTabList; - USHORT nCount = (USHORT)(*pTabs); + sal_uInt16 nCount = (sal_uInt16)(*pTabs); pTabList = new SvLBoxTab[ nCount ]; nTabCount = nCount; @@ -155,7 +155,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit ) MapMode aMMDest( MAP_PIXEL ); pTabs++; - for( USHORT nIdx = 0; nIdx < nCount; nIdx++, pTabs++ ) + for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabs++ ) { Size aSize( *pTabs, 0 ); aSize = LogicToLogic( aSize, &aMMSource, &aMMDest ); @@ -168,7 +168,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit ) Invalidate(); } -void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit ) +void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit ) { DBG_ASSERT(nTab<nTabCount,"Invalid Tab-Pos"); if( nTab < nTabCount ) @@ -187,8 +187,8 @@ void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit ) } SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText, SvLBoxEntry* pParent, - BOOL /*bChildsOnDemand*/, - ULONG nPos, void* pUserData, + sal_Bool /*bChildsOnDemand*/, + sal_uLong nPos, void* pUserData, SvLBoxButtonKind ) { return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData ); @@ -198,15 +198,15 @@ SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, SvLBoxEntry* pParent, - BOOL /*bChildsOnDemand*/, - ULONG nPos, void* pUserData, + sal_Bool /*bChildsOnDemand*/, + sal_uLong nPos, void* pUserData, SvLBoxButtonKind ) { return InsertEntryToColumn( rText, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, 0xffff, pUserData ); } -SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, +SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser ) { XubString aStr; @@ -220,7 +220,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry } aStr += rStr; XubString aFirstStr( aStr ); - USHORT nEnd = aFirstStr.Search( '\t' ); + sal_uInt16 nEnd = aFirstStr.Search( '\t' ); if( nEnd != STRING_NOTFOUND ) { aFirstStr.Erase( nEnd ); @@ -229,12 +229,12 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry } else aCurEntry.Erase(); - return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos, pUser ); + return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUser ); } SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, - SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, void* pUser ) + SvLBoxEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser ) { XubString aStr; if( nCol != 0xffff ) @@ -247,7 +247,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, } aStr += rStr; XubString aFirstStr( aStr ); - USHORT nEnd = aFirstStr.Search( '\t' ); + sal_uInt16 nEnd = aFirstStr.Search( '\t' ); if( nEnd != STRING_NOTFOUND ) { aFirstStr.Erase( nEnd ); @@ -260,11 +260,11 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, return SvTreeListBox::InsertEntry( aFirstStr, rExpandedEntryBmp, rCollapsedEntryBmp, - pParent, FALSE, nPos, pUser ); + pParent, sal_False, nPos, pUser ); } -SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, ULONG nPos, - USHORT nCol, void* pUser ) +SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, sal_uLong nPos, + sal_uInt16 nCol, void* pUser ) { return InsertEntryToColumn( rStr,0,nPos, nCol, pUser ); } @@ -274,14 +274,14 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry ) const return GetEntryText( pEntry, 0xffff ); } -String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const +String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const { DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry"); XubString aResult; if( pEntry ) { - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); @@ -306,19 +306,19 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const return aResult; } -String SvTabListBox::GetEntryText( ULONG nPos, USHORT nCol ) const +String SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const { SvLBoxEntry* pEntry = GetEntryOnPos( nPos ); return GetEntryText( pEntry, nCol ); } -void SvTabListBox::SetEntryText( const XubString& rStr, ULONG nPos, USHORT nCol ) +void SvTabListBox::SetEntryText( const XubString& rStr, sal_uLong nPos, sal_uInt16 nCol ) { SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos ); SetEntryText( rStr, pEntry, nCol ); } -void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USHORT nCol ) +void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal_uInt16 nCol ) { DBG_ASSERT(pEntry,"SetEntryText:Invalid Entry"); if( !pEntry ) @@ -328,14 +328,14 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH if ( sOldText == rStr ) return; - USHORT nTextColumn = nCol; + sal_uInt16 nTextColumn = nCol; const xub_Unicode* pCurToken = rStr.GetBuffer(); - USHORT nCurTokenLen; + sal_uInt16 nCurTokenLen; const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen ); XubString aTemp; - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); @@ -375,7 +375,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH delete pData; } -String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const +String SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const { SvLBoxEntry* pEntry = GetEntryOnPos( nPos ); DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" ); @@ -389,9 +389,9 @@ String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const return aResult; } -ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol ) +sal_uLong SvTabListBox::GetEntryPos( const XubString& rStr, sal_uInt16 nCol ) { - ULONG nPos = 0; + sal_uLong nPos = 0; SvLBoxEntry* pEntry = First(); while( pEntry ) { @@ -404,9 +404,9 @@ ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol ) return 0xffffffff; } -ULONG SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const +sal_uLong SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const { - ULONG nPos = 0; + sal_uLong nPos = 0; SvLBoxEntry* pTmpEntry = First(); while( pTmpEntry ) { @@ -424,7 +424,7 @@ void __EXPORT SvTabListBox::Resize() } // static -const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen ) +const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, sal_uInt16& rLen ) { if( !pPtr || *pPtr == 0 ) { @@ -432,7 +432,7 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen return 0; } xub_Unicode c = *pPtr; - USHORT nLen = 0; + sal_uInt16 nLen = 0; while( c != '\t' && c != 0 ) { pPtr++; @@ -447,15 +447,15 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen return pPtr; } -String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const +String SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const { SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos ); DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " ); XubString aResult; if ( pEntry ) { - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0; while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); @@ -485,10 +485,10 @@ String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const return aResult; } -SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const +SvLBoxEntry* SvTabListBox::GetEntryOnPos( sal_uLong _nEntryPos ) const { SvLBoxEntry* pEntry = NULL; - ULONG i, nPos = 0, nCount = GetLevelChildCount( NULL ); + sal_uLong i, nPos = 0, nCount = GetLevelChildCount( NULL ); for ( i = 0; i < nCount; ++i ) { SvLBoxEntry* pParent = GetEntry(i); @@ -509,9 +509,9 @@ SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const return pEntry; } -SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPos, ULONG& _rPos ) const +SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const { - ULONG i, nCount = GetLevelChildCount( _pParent ); + sal_uLong i, nCount = GetLevelChildCount( _pParent ); for ( i = 0; i < nCount; ++i ) { SvLBoxEntry* pParent = GetEntry( _pParent, i ); @@ -529,33 +529,33 @@ SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPo return NULL; } -void SvTabListBox::SetTabJustify( USHORT nTab, SvTabJustify eJustify) +void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify) { if( nTab >= nTabCount ) return; SvLBoxTab* pTab = &(pTabList[ nTab ]); - USHORT nFlags = pTab->nFlags; + sal_uInt16 nFlags = pTab->nFlags; nFlags &= (~MYTABMASK); - nFlags |= (USHORT)eJustify; + nFlags |= (sal_uInt16)eJustify; pTab->nFlags = nFlags; SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS; if( IsUpdateMode() ) Invalidate(); } -SvTabJustify SvTabListBox::GetTabJustify( USHORT nTab ) const +SvTabJustify SvTabListBox::GetTabJustify( sal_uInt16 nTab ) const { SvTabJustify eResult = AdjustLeft; if( nTab >= nTabCount ) return eResult; SvLBoxTab* pTab = &(pTabList[ nTab ]); - USHORT nFlags = pTab->nFlags; + sal_uInt16 nFlags = pTab->nFlags; nFlags &= MYTABMASK; eResult = (SvTabJustify)nFlags; return eResult; } -long SvTabListBox::GetLogicTab( USHORT nTab ) +long SvTabListBox::GetLogicTab( sal_uInt16 nTab ) { if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS ) ((SvTabListBox*)this)->SetTabs(); @@ -583,7 +583,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, WinBits nWinStyle ) : SvTabListBox( pParent, nWinStyle ), - m_bFirstPaint ( TRUE ), + m_bFirstPaint ( sal_True ), m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ), m_pAccessible ( NULL ) { @@ -595,7 +595,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, const ResId& rResId ) : SvTabListBox( pParent, rResId ), - m_bFirstPaint ( TRUE ), + m_bFirstPaint ( sal_True ), m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ), m_pAccessible ( NULL ) { @@ -614,7 +614,7 @@ void SvHeaderTabListBox::Paint( const Rectangle& rRect ) { if ( m_bFirstPaint ) { - m_bFirstPaint = FALSE; + m_bFirstPaint = sal_False; RepaintScrollBars(); } SvTabListBox::Paint( rRect ); @@ -633,14 +633,14 @@ void SvHeaderTabListBox::InitHeaderBar( HeaderBar* pHeaderBar ) // ----------------------------------------------------------------------- -sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) const +sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const { SvButtonState eState = SV_BUTTON_UNCHECKED; SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( nCol + 1 ) ); if ( pItem && ( (SvLBoxItem*)pItem )->IsA() == SV_ITEM_ID_LBOXBUTTON ) { - USHORT nButtonFlags = pItem->GetButtonFlags(); + sal_uInt16 nButtonFlags = pItem->GetButtonFlags(); eState = pCheckButtonData->ConvertToButtonState( nButtonFlags ); } @@ -650,7 +650,7 @@ sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) c // ----------------------------------------------------------------------- SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( - const XubString& rStr, ULONG nPos, USHORT nCol, void* pUserData ) + const XubString& rStr, sal_uLong nPos, sal_uInt16 nCol, void* pUserData ) { SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, nPos, nCol, pUserData ); RecalculateAccessibleChildren(); @@ -660,7 +660,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( // ----------------------------------------------------------------------- SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( - const XubString& rStr, SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData ) + const XubString& rStr, SvLBoxEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData ) { SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, pParent, nPos, nCol, pUserData ); RecalculateAccessibleChildren(); @@ -671,7 +671,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( const XubString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, - SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData ) + SvLBoxEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData ) { SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, nCol, pUserData ); @@ -681,19 +681,19 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( // ----------------------------------------------------------------------- -ULONG SvHeaderTabListBox::Insert( - SvLBoxEntry* pEnt, SvLBoxEntry* pPar, ULONG nPos ) +sal_uLong SvHeaderTabListBox::Insert( + SvLBoxEntry* pEnt, SvLBoxEntry* pPar, sal_uLong nPos ) { - ULONG n = SvTabListBox::Insert( pEnt, pPar, nPos ); + sal_uLong n = SvTabListBox::Insert( pEnt, pPar, nPos ); RecalculateAccessibleChildren(); return n; } // ----------------------------------------------------------------------- -ULONG SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, ULONG nRootPos ) +sal_uLong SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, sal_uLong nRootPos ) { - ULONG nPos = SvTabListBox::Insert( pEntry, nRootPos ); + sal_uLong nPos = SvTabListBox::Insert( pEntry, nRootPos ); RecalculateAccessibleChildren(); return nPos; } @@ -765,7 +765,7 @@ sal_Bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, Tr SvLBoxEntry* pEntry = GetEntry( _nRow ); if ( pEntry ) { - USHORT nItemCount = pEntry->ItemCount(); + sal_uInt16 nItemCount = pEntry->ItemCount(); if ( nItemCount > ( _nColumn + 1 ) ) { SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( _nColumn + 1 ) ); @@ -801,8 +801,8 @@ sal_Int32 SvHeaderTabListBox::GetCurrRow() const SvLBoxEntry* pEntry = GetCurEntry(); if ( pEntry ) { - ULONG nCount = GetEntryCount(); - for ( ULONG i = 0; i < nCount; ++i ) + sal_uLong nCount = GetEntryCount(); + for ( sal_uLong i = 0; i < nCount; ++i ) { if ( pEntry == GetEntry(i) ) { @@ -843,11 +843,11 @@ sal_Bool SvHeaderTabListBox::IsCellFocusable() const // ----------------------------------------------------------------------- sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) { - sal_Bool bRet = ( IsCellFocusEnabled() == TRUE ); + sal_Bool bRet = ( IsCellFocusEnabled() == sal_True ); if ( bRet ) { // first set cursor to _nRow - SetCursor( GetEntry( _nRow ), TRUE ); + SetCursor( GetEntry( _nRow ), sal_True ); // then set the focus into _nColumn bRet = ( SetCurrentTabPos( _nColumn ) == true ); } @@ -856,22 +856,22 @@ sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) // ----------------------------------------------------------------------- void SvHeaderTabListBox::SetNoSelection() { - SvLBox::SelectAll( FALSE ); + SvLBox::SelectAll( sal_False ); } // ----------------------------------------------------------------------- void SvHeaderTabListBox::SelectAll() { - SvLBox::SelectAll( TRUE ); + SvLBox::SelectAll( sal_True ); } // ----------------------------------------------------------------------- -void SvHeaderTabListBox::SelectAll( BOOL bSelect, BOOL bPaint ) +void SvHeaderTabListBox::SelectAll( sal_Bool bSelect, sal_Bool bPaint ) { - // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, BOOL ) + // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, sal_Bool ) SvTabListBox::SelectAll( bSelect, bPaint ); } // ----------------------------------------------------------------------- -void SvHeaderTabListBox::SelectRow( long _nRow, BOOL _bSelect, BOOL ) +void SvHeaderTabListBox::SelectRow( long _nRow, sal_Bool _bSelect, sal_Bool ) { Select( GetEntry( _nRow ), _bSelect ); } @@ -898,7 +898,7 @@ bool SvHeaderTabListBox::IsRowSelected( long _nRow ) const // ----------------------------------------------------------------------- sal_Bool SvHeaderTabListBox::IsColumnSelected( long ) const { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- void SvHeaderTabListBox::GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& ) const @@ -914,12 +914,12 @@ sal_Bool SvHeaderTabListBox::IsCellVisible( sal_Int32, sal_uInt16 ) const return sal_True; } // ----------------------------------------------------------------------- -String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const +String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const { return ::rtl::OUString( GetTabEntryText( _nRow, _nColumnPos ) ); } // ----------------------------------------------------------------------- -Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen ) +Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen ) { Rectangle aRect; if ( _bIsColumnBar ) @@ -933,7 +933,7 @@ Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnS return aRect; } // ----------------------------------------------------------------------- -Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen ) +Rectangle SvHeaderTabListBox::calcTableRect( sal_Bool _bOnScreen ) { Window* pParent = NULL; if ( !_bOnScreen ) @@ -943,14 +943,14 @@ Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen ) return aRect; } // ----------------------------------------------------------------------- -Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, BOOL _bIsHeader, BOOL _bOnScreen ) +Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen ) { DBG_ASSERT( !_bIsHeader || 0 == _nRow, "invalid parameters" ); Rectangle aRect; SvLBoxEntry* pEntry = GetEntry( _nRow ); if ( pEntry ) { - aRect = _bIsHeader ? calcHeaderRect( sal_True, FALSE ) : GetBoundingRect( pEntry ); + aRect = _bIsHeader ? calcHeaderRect( sal_True, sal_False ) : GetBoundingRect( pEntry ); Point aTopLeft = aRect.TopLeft(); DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" ); Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) ); @@ -1108,7 +1108,7 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin } case ::svt::BBTYPE_COLUMNHEADERCELL: { - aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (USHORT)_nPos ) ); + aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (sal_uInt16)_nPos ) ); break; } @@ -1227,7 +1227,7 @@ void SvHeaderTabListBox::GrabTableFocus() GrabFocus(); } // ----------------------------------------------------------------------- -BOOL SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) +sal_Bool SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) { return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector ); } @@ -1242,7 +1242,7 @@ void SvHeaderTabListBox::GrabFocus() Control::GrabFocus(); } // ----------------------------------------------------------------------- -Reference< XAccessible > SvHeaderTabListBox::GetAccessible( BOOL bCreate ) +Reference< XAccessible > SvHeaderTabListBox::GetAccessible( sal_Bool bCreate ) { return Control::GetAccessible( bCreate ); } @@ -1286,7 +1286,7 @@ Rectangle SvHeaderTabListBox::GetFieldCharacterBounds(sal_Int32,sal_Int32,sal_In // ----------------------------------------------------------------------------- sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) { - String sText = GetAccessibleCellText( _nRow, static_cast< USHORT >( _nColumnPos ) ); + String sText = GetAccessibleCellText( _nRow, static_cast< sal_uInt16 >( _nColumnPos ) ); MetricVector aRects; if ( GetGlyphBoundRects(Point(0,0),sText,0,STRING_LEN,0,aRects) ) { diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 5a59dcc3900f..b48bcb0910ee 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -109,7 +109,7 @@ void SvTreeListBox::InitTreeView() SetFont( GetFont() ); SetSpaceBetweenEntries( 0 ); SetLineColor(); - InitSettings( TRUE, TRUE, TRUE ); + InitSettings( sal_True, sal_True, sal_True ); ImplInitStyle(); SetTabs(); } @@ -149,28 +149,28 @@ void SvTreeListBox::DisconnectFromModel() } -USHORT SvTreeListBox::IsA() +sal_uInt16 SvTreeListBox::IsA() { DBG_CHKTHIS(SvTreeListBox,0); return SV_LISTBOX_ID_TREEBOX; } -void SvTreeListBox::SetSublistOpenWithReturn( BOOL b ) +void SvTreeListBox::SetSublistOpenWithReturn( sal_Bool b ) { pImp->bSubLstOpRet = b; } -BOOL SvTreeListBox::IsSublistOpenWithReturn() const +sal_Bool SvTreeListBox::IsSublistOpenWithReturn() const { return pImp->bSubLstOpRet; } -void SvTreeListBox::SetSublistOpenWithLeftRight( BOOL b ) +void SvTreeListBox::SetSublistOpenWithLeftRight( sal_Bool b ) { pImp->bSubLstOpLR = b; } -BOOL SvTreeListBox::IsSublistOpenWithLeftRight() const +sal_Bool SvTreeListBox::IsSublistOpenWithLeftRight() const { return pImp->bSubLstOpLR; } @@ -179,12 +179,12 @@ void SvTreeListBox::Resize() { DBG_CHKTHIS(SvTreeListBox,0); if( IsEditingActive() ) - EndEditing( TRUE ); + EndEditing( sal_True ); SvLBox::Resize(); pImp->Resize(); nFocusWidth = -1; - pImp->ShowCursor( FALSE ); - pImp->ShowCursor( TRUE ); + pImp->ShowCursor( sal_False ); + pImp->ShowCursor( sal_True ); } /* Faelle: @@ -224,12 +224,12 @@ void SvTreeListBox::SetTabs() { DBG_CHKTHIS(SvTreeListBox,0); if( IsEditingActive() ) - EndEditing( TRUE ); + EndEditing( sal_True ); nTreeFlags &= (~TREEFLAG_RECALCTABS); nFocusWidth = -1; const WinBits nStyle( GetStyle() ); - BOOL bHasButtons = (nStyle & WB_HASBUTTONS)!=0; - BOOL bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT | + sal_Bool bHasButtons = (nStyle & WB_HASBUTTONS)!=0; + sal_Bool bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; long nStartPos = TAB_STARTPOS; long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); @@ -354,8 +354,8 @@ String SvTreeListBox::SearchEntryText( SvLBoxEntry* pEntry ) const DBG_CHKTHIS(SvTreeListBox,0); DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" ); String sRet; - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; SvLBoxItem* pItem; while( nCur < nCount ) { @@ -399,7 +399,7 @@ IMPL_LINK_INLINE_START( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pDa IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData ) SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,SvLBoxEntry* pParent, - BOOL bChildsOnDemand, ULONG nPos, void* pUser, + sal_Bool bChildsOnDemand, sal_uLong nPos, void* pUser, SvLBoxButtonKind eButtonKind ) { DBG_CHKTHIS(SvTreeListBox,0); @@ -439,7 +439,7 @@ SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,SvLBoxEntry* pPa SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText, const Image& aExpEntryBmp, const Image& aCollEntryBmp, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos, void* pUser, + SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos, void* pUser, SvLBoxButtonKind eButtonKind ) { DBG_CHKTHIS(SvTreeListBox,0); @@ -524,7 +524,7 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry ) SvLBoxEntry* pParent = (SvLBoxEntry*)pModel->GetParent( pEntry ); if( pParent ) { - USHORT nFlags = pParent->GetFlags(); + sal_uInt16 nFlags = pParent->GetFlags(); nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP; pParent->SetFlags( nFlags ); } @@ -586,7 +586,7 @@ SvButtonState SvTreeListBox::GetCheckButtonState( SvLBoxEntry* pEntry ) const SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON)); if(!pItem) return SV_BUTTON_TRISTATE; - USHORT nButtonFlags = pItem->GetButtonFlags(); + sal_uInt16 nButtonFlags = pItem->GetButtonFlags(); eState = pCheckButtonData->ConvertToButtonState( nButtonFlags ); } return eState; @@ -654,7 +654,7 @@ SvLBoxEntry* SvTreeListBox::CloneEntry( SvLBoxEntry* pSource ) // ********************************************************************* -void SvTreeListBox::ShowExpandBitmapOnCursor( BOOL bYes ) +void SvTreeListBox::ShowExpandBitmapOnCursor( sal_Bool bYes ) { DBG_CHKTHIS(SvTreeListBox,0); if( bYes ) @@ -752,19 +752,19 @@ void SvTreeListBox::SetDontKnowNodeBitmap( const Image& rDontKnowBmp, BmpColorMo pImp->SetDontKnowNodeBmp( rDontKnowBmp, _eMode ); } -BOOL SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& ) +sal_Bool SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& ) { DBG_CHKTHIS(SvTreeListBox,0); - return TRUE; + return sal_True; } -BOOL SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/) +sal_Bool SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/) { DBG_CHKTHIS(SvTreeListBox,0); - return TRUE; + return sal_True; } -void SvTreeListBox::EnableInplaceEditing( BOOL bOn ) +void SvTreeListBox::EnableInplaceEditing( sal_Bool bOn ) { DBG_CHKTHIS(SvTreeListBox,0); SvLBox::EnableInplaceEditing( bOn ); @@ -780,7 +780,7 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt ) nImpFlags |= SVLBOX_IS_TRAVELSELECT; #ifdef OVDEBUG - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch ( nCode ) { case KEY_F1: @@ -804,7 +804,7 @@ void SvTreeListBox::RequestingChilds( SvLBoxEntry* pParent ) { DBG_CHKTHIS(SvTreeListBox,0); if( !pParent->HasChilds() ) - InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND ); + InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND ); } void SvTreeListBox::GetFocus() @@ -850,7 +850,7 @@ void SvTreeListBox::ModelHasCleared() // Invalidate(); } -void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL /* bShow */ ) +void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool /* bShow */ ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->PaintDDCursor( pEntry ); @@ -874,13 +874,13 @@ void SvTreeListBox::ScrollOutputArea( short nDeltaEntries ) long nTemp = nThumb + nVis; if( nDeltaEntries > (nMax - nTemp) ) nDeltaEntries = (short)(nMax - nTemp); - pImp->PageDown( (USHORT)nDeltaEntries ); + pImp->PageDown( (sal_uInt16)nDeltaEntries ); } else { if( nDeltaEntries > nThumb ) nDeltaEntries = (short)nThumb; - pImp->PageUp( (USHORT)nDeltaEntries ); + pImp->PageUp( (sal_uInt16)nDeltaEntries ); } pImp->SyncVerThumb(); NotifyEndScroll(); @@ -924,8 +924,8 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry ) { DBG_CHKTHIS(SvTreeListBox,0); short nHeight, nHeightMax=0; - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; SvViewDataEntry* pViewData = GetViewDataEntry( pEntry ); while( nCur < nCount ) { @@ -944,7 +944,7 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry ) } } -void SvTreeListBox::SetEntryHeight( short nHeight, BOOL bAlways ) +void SvTreeListBox::SetEntryHeight( short nHeight, sal_Bool bAlways ) { DBG_CHKTHIS(SvTreeListBox,0); @@ -985,12 +985,12 @@ void SvTreeListBox::AdjustEntryHeight( const Font& rFont ) } } -BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) +sal_Bool SvTreeListBox::Expand( SvLBoxEntry* pParent ) { DBG_CHKTHIS(SvTreeListBox,0); pHdlEntry = pParent; - BOOL bExpanded = FALSE; - USHORT nFlags; + sal_Bool bExpanded = sal_False; + sal_uInt16 nFlags; if( pParent->HasChildsOnDemand() ) RequestingChilds( pParent ); @@ -999,7 +999,7 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) nImpFlags |= SVLBOX_IS_EXPANDING; if( ExpandingHdl() ) { - bExpanded = TRUE; + bExpanded = sal_True; SvListView::Expand( pParent ); pImp->EntryExpanded( pParent ); pHdlEntry = pParent; @@ -1028,16 +1028,16 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) return bExpanded; } -BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent ) +sal_Bool SvTreeListBox::Collapse( SvLBoxEntry* pParent ) { DBG_CHKTHIS(SvTreeListBox,0); nImpFlags &= ~SVLBOX_IS_EXPANDING; pHdlEntry = pParent; - BOOL bCollapsed = FALSE; + sal_Bool bCollapsed = sal_False; if( ExpandingHdl() ) { - bCollapsed = TRUE; + bCollapsed = sal_True; pImp->CollapsingEntry( pParent ); SvListView::Collapse( pParent ); pImp->EntryCollapsed( pParent ); @@ -1055,11 +1055,11 @@ BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent ) return bCollapsed; } -BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect ) +sal_Bool SvTreeListBox::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) { DBG_CHKTHIS(SvTreeListBox,0); DBG_ASSERT(pEntry,"Select: Null-Ptr"); - BOOL bRetVal = SvListView::Select( pEntry, bSelect ); + sal_Bool bRetVal = SvListView::Select( pEntry, bSelect ); DBG_ASSERT(IsSelected(pEntry)==bSelect,"Select failed"); if( bRetVal ) { @@ -1076,14 +1076,14 @@ BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect ) return bRetVal; } -ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect ) +sal_uLong SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->DestroyAnchor(); - ULONG nRet = 0; + sal_uLong nRet = 0; if( !pParent->HasChilds() ) return 0; - USHORT nRefDepth = pModel->GetDepth( pParent ); + sal_uInt16 nRefDepth = pModel->GetDepth( pParent ); SvLBoxEntry* pChild = FirstChild( pParent ); do { nRet++; @@ -1093,19 +1093,19 @@ ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect ) return nRet; } -void SvTreeListBox::SelectAll( BOOL bSelect, BOOL ) +void SvTreeListBox::SelectAll( sal_Bool bSelect, sal_Bool ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SelAllDestrAnch( bSelect, - TRUE, // Anker loeschen, - TRUE ); // auch bei SINGLE_SELECTION den Cursor deselektieren + sal_True, // Anker loeschen, + sal_True ); // auch bei SINGLE_SELECTION den Cursor deselektieren } void SvTreeListBox::ModelHasInsertedTree( SvListEntry* pEntry ) { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry ); + sal_uInt16 nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry ); SvLBoxEntry* pTmp = (SvLBoxEntry*)pEntry; do { @@ -1124,7 +1124,7 @@ void SvTreeListBox::ModelHasInserted( SvListEntry* pEntry ) void SvTreeListBox::ModelIsMoving(SvListEntry* pSource, SvListEntry* /* pTargetParent */, - ULONG /* nChildPos */ ) + sal_uLong /* nChildPos */ ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->MovingEntry( (SvLBoxEntry*)pSource ); @@ -1173,7 +1173,7 @@ void SvTreeListBox::SetFont( const Font& rFont ) { DBG_CHKTHIS(SvTreeListBox,0); Font aTempFont( rFont ); - aTempFont.SetTransparent( TRUE ); + aTempFont.SetTransparent( sal_True ); Control::SetFont( aTempFont ); AdjustEntryHeight( aTempFont ); // immer Invalidieren, sonst fallen wir @@ -1210,13 +1210,13 @@ void SvTreeListBox::MouseMove( const MouseEvent& rMEvt ) } -void SvTreeListBox::SetUpdateMode( BOOL bUpdate ) +void SvTreeListBox::SetUpdateMode( sal_Bool bUpdate ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SetUpdateMode( bUpdate ); } -void SvTreeListBox::SetUpdateModeFast( BOOL bUpdate ) +void SvTreeListBox::SetUpdateModeFast( sal_Bool bUpdate ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SetUpdateModeFast( bUpdate ); @@ -1236,7 +1236,7 @@ void SvTreeListBox::SetSpaceBetweenEntries( short nOffsLogic ) } } -void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) +void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SetCursor(pEntry, bForceNoSelect); @@ -1273,7 +1273,7 @@ void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry ) pImp->MakeVisible(pEntry); } -void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) +void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) { pImp->MakeVisible( pEntry, bMoveToTop ); } @@ -1294,11 +1294,11 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem, DBG_ASSERT(pEntry&&pItem,"EditItemText: Bad params"); if( IsSelected( pEntry )) { - pImp->ShowCursor( FALSE ); - SvListView::Select( pEntry, FALSE ); + pImp->ShowCursor( sal_False ); + SvListView::Select( pEntry, sal_False ); PaintEntry( pEntry ); - SvListView::Select( pEntry, TRUE ); - pImp->ShowCursor( TRUE ); + SvListView::Select( pEntry, sal_True ); + pImp->ShowCursor( sal_True ); } pEdEntry = pEntry; pEdItem = pItem; @@ -1311,7 +1311,7 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem, aPos.X() = GetTabPos( pEntry, pTab ); long nOutputWidth = pImp->GetOutputSize().Width(); Size aSize( nOutputWidth - aPos.X(), aItemSize.Height() ); - USHORT nPos = aTabs.GetPos( pTab ); + sal_uInt16 nPos = aTabs.GetPos( pTab ); if( nPos+1 < aTabs.Count() ) { SvLBoxTab* pRightTab = (SvLBoxTab*)aTabs.GetObject( nPos + 1 ); @@ -1357,8 +1357,8 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry ) bool bIsMouseTriggered = nClickX >= 0; SvLBoxString* pItem = NULL; - USHORT nCount = pEntry->ItemCount(); - for( USHORT i = 0 ; i < nCount ; i++ ) + sal_uInt16 nCount = pEntry->ItemCount(); + for( sal_uInt16 i = 0 ; i < nCount ; i++ ) { SvLBoxItem* pTmpItem = pEntry->GetItem( i ); if( pTmpItem->IsA() != SV_ITEM_ID_LBOXSTRING ) @@ -1387,7 +1387,7 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry ) Selection aSel( SELECTION_MIN, SELECTION_MAX ); if( pItem && EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); MakeVisible( pEntry ); EditItemText( pEntry, pItem, aSel ); } @@ -1437,7 +1437,7 @@ void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem, Selection aSel( SELECTION_MIN, SELECTION_MAX ); if( EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); EditItemText( pEntry, (SvLBoxString*)pItem, aSel ); } } @@ -1451,7 +1451,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) // Scrollen if( rPos.Y() < 12 ) { - SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE ); + SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False ); ScrollOutputArea( +1 ); } else @@ -1459,7 +1459,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) Size aSize( pImp->GetOutputSize() ); if( rPos.Y() > aSize.Height() - 12 ) { - SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE ); + SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False ); ScrollOutputArea( -1 ); } } @@ -1476,7 +1476,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) } -SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, BOOL bHit ) const +SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, sal_Bool bHit ) const { DBG_CHKTHIS(SvTreeListBox,0); SvLBoxEntry* pEntry = pImp->GetEntry( rPos ); @@ -1540,21 +1540,21 @@ void SvTreeListBox::InvalidateEntry( SvLBoxEntry* pEntry ) } -long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags) +long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags) { return PaintEntry1(pEntry,nLine,nTabFlags); } #define SV_TAB_BORDER 8 -long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, - BOOL bHasClipRegion ) +long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags, + sal_Bool bHasClipRegion ) { DBG_CHKTHIS(SvTreeListBox,0); Rectangle aRect; // multi purpose - BOOL bHorSBar = pImp->HasHorScrollBar(); + sal_Bool bHorSBar = pImp->HasHorScrollBar(); PreparePaint( pEntry ); // #97680# ------------------ @@ -1580,12 +1580,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, Color aBackupColor = GetFillColor(); bool bCurFontIsSel = false; - BOOL bInUse = pEntry->HasInUseEmphasis(); + sal_Bool bInUse = pEntry->HasInUseEmphasis(); // wenn eine ClipRegion von aussen gesetzt wird, dann // diese nicht zuruecksetzen const WinBits nWindowStyle = GetStyle(); - const BOOL bResetClipRegion = !bHasClipRegion; - const BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; + const sal_Bool bResetClipRegion = !bHasClipRegion; + const sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Font aHighlightFont( GetFont() ); @@ -1597,24 +1597,24 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, if( !bHasClipRegion && nWindowStyle & WB_HSCROLL ) { SetClipRegion( Region(pImp->GetClipRegionRect()) ); - bHasClipRegion = TRUE; + bHasClipRegion = sal_True; } SvViewDataEntry* pViewDataEntry = GetViewDataEntry( pEntry ); - USHORT nTabCount = aTabs.Count(); - USHORT nItemCount = pEntry->ItemCount(); - USHORT nCurTab = 0; - USHORT nCurItem = 0; + sal_uInt16 nTabCount = aTabs.Count(); + sal_uInt16 nItemCount = pEntry->ItemCount(); + sal_uInt16 nCurTab = 0; + sal_uInt16 nCurItem = 0; while( nCurTab < nTabCount && nCurItem < nItemCount ) { SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nCurTab ); - USHORT nNextTab = nCurTab + 1; + sal_uInt16 nNextTab = nCurTab + 1; SvLBoxTab* pNextTab = nNextTab < nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextTab) : 0; SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0; - USHORT nFlags = pTab->nFlags; + sal_uInt16 nFlags = pTab->nFlags; Size aSize( pItem->GetSize( pViewDataEntry, nCurItem )); long nTabPos = GetTabPos( pEntry, pTab ); @@ -1640,7 +1640,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, if( !bHasClipRegion && nX + aSize.Width() >= nMaxRight ) { SetClipRegion( Region(pImp->GetClipRegionRect()) ); - bHasClipRegion = TRUE; + bHasClipRegion = sal_True; } aEntryPos.X() = nX; aEntryPos.Y() = nLine; @@ -1650,7 +1650,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, Wallpaper aWallpaper = GetBackground(); int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION; - USHORT nItemType = pItem->IsA(); + sal_uInt16 nItemType = pItem->IsA(); if ( pViewDataEntry->IsSelected() && bSelTab && !pViewDataEntry->IsCursored() ) { @@ -1764,7 +1764,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, SetFont( aBackupFont ); } - USHORT nFirstDynTabPos; + sal_uInt16 nFirstDynTabPos; SvLBoxTab* pFirstDynamicTab = GetFirstDynamicTab( nFirstDynTabPos ); long nDynTabPos = GetTabPos( pEntry, pFirstDynamicTab ); nDynTabPos += pImp->nNodeBmpTabDistance; @@ -1778,7 +1778,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, { // ersten festen Tab suchen, und pruefen ob die Node-Bitmap // in ihn hineinragt - USHORT nNextTab = nFirstDynTabPos; + sal_uInt16 nNextTab = nFirstDynTabPos; SvLBoxTab* pNextTab; do { @@ -1811,12 +1811,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, } aPos.Y() += (nTempEntryHeight - pImg->GetSizePixel().Height()) / 2; - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( !IsEnabled() ) nStyle |= IMAGE_DRAW_DISABLE; //native - BOOL bNativeOK = FALSE; + sal_Bool bNativeOK = sal_False; if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) ) { ImplControlValue aControlValue; @@ -1870,7 +1870,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) long nRealWidth = pImp->GetOutputSize().Width(); nRealWidth -= GetMapMode().GetOrigin().X(); - USHORT nCurTab; + sal_uInt16 nCurTab; SvLBoxTab* pTab = GetFirstTab( SV_LBOXTAB_SHOW_SELECTION, nCurTab ); long nTabPos = 0; if( pTab ) @@ -1888,7 +1888,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) nNextTabPos += 50; } - BOOL bUserSelection = (BOOL)( nTreeFlags & TREEFLAG_USESEL ) != 0; + sal_Bool bUserSelection = (sal_Bool)( nTreeFlags & TREEFLAG_USESEL ) != 0; if( !bUserSelection ) { if( pTab && nCurTab < pEntry->ItemCount() ) @@ -1913,7 +1913,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) // wenn erster SelTab != 0, dann muessen wir auch rechnen if( nFocusWidth == -1 || nFirstSelTab ) { - USHORT nLastTab; + sal_uInt16 nLastTab; SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab); nLastTab++; if( nLastTab < aTabs.Count() ) // gibts noch einen ? @@ -1961,23 +1961,23 @@ long SvTreeListBox::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) long nPos = pTab->GetPos(); if( pTab->IsDynamic() ) { - USHORT nDepth = pModel->GetDepth( pEntry ); - nDepth = nDepth * (USHORT)nIndent; + sal_uInt16 nDepth = pModel->GetDepth( pEntry ); + nDepth = nDepth * (sal_uInt16)nIndent; nPos += (long)nDepth; } return nPos; } SvLBoxItem* SvTreeListBox::GetItem_Impl( SvLBoxEntry* pEntry, long nX, - SvLBoxTab** ppTab, USHORT nEmptyWidth ) + SvLBoxTab** ppTab, sal_uInt16 nEmptyWidth ) { DBG_CHKTHIS(SvTreeListBox,0); SvLBoxItem* pItemClicked = 0; - USHORT nTabCount = aTabs.Count(); - USHORT nItemCount = pEntry->ItemCount(); + sal_uInt16 nTabCount = aTabs.Count(); + sal_uInt16 nItemCount = pEntry->ItemCount(); SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0); SvLBoxItem* pItem = pEntry->GetItem(0); - USHORT nNextItem = 1; + sal_uInt16 nNextItem = 1; nX -= GetMapMode().GetOrigin().X(); long nRealWidth = pImp->GetOutputSize().Width(); nRealWidth -= GetMapMode().GetOrigin().X(); @@ -2046,9 +2046,9 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry ) SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0); SvLBoxItem* pItem = pEntry->GetItem(0); - USHORT nTabCount = aTabs.Count(); + sal_uInt16 nTabCount = aTabs.Count(); - USHORT nNext = 1; + sal_uInt16 nNext = 1; while ( !pTab->IsDynamic() && nNext < nTabCount ) { pItem = pEntry->GetItem( nNext ); @@ -2058,7 +2058,7 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry ) return pItem; } -void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData ) +void SvTreeListBox::AddTab(long nTabPos,sal_uInt16 nFlags,void* pUserData ) { DBG_CHKTHIS(SvTreeListBox,0); nFocusWidth = -1; @@ -2067,7 +2067,7 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData ) aTabs.Insert( pTab, aTabs.Count() ); if( nTreeFlags & TREEFLAG_USESEL ) { - USHORT nPos = aTabs.Count() - 1; + sal_uInt16 nPos = aTabs.Count() - 1; if( nPos >= nFirstSelTab && nPos <= nLastSelTab ) pTab->nFlags |= SV_LBOXTAB_SHOW_SELECTION; else @@ -2079,11 +2079,11 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData ) -SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const +SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( sal_uInt16& rPos ) const { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nCurTab = 0; - USHORT nTabCount = aTabs.Count(); + sal_uInt16 nCurTab = 0; + sal_uInt16 nTabCount = aTabs.Count(); while( nCurTab < nTabCount ) { SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(nCurTab); @@ -2099,21 +2099,21 @@ SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const SvLBoxTab* SvTreeListBox::GetFirstDynamicTab() const { - USHORT nDummy; + sal_uInt16 nDummy; return GetFirstDynamicTab( nDummy ); } SvLBoxTab* SvTreeListBox::GetTab( SvLBoxEntry* pEntry, SvLBoxItem* pItem) const { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nPos = pEntry->GetPos( pItem ); + sal_uInt16 nPos = pEntry->GetPos( pItem ); return (SvLBoxTab*)aTabs.GetObject( nPos ); } void SvTreeListBox::ClearTabList() { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nTabCount = aTabs.Count(); + sal_uInt16 nTabCount = aTabs.Count(); while( nTabCount ) { nTabCount--; @@ -2157,7 +2157,7 @@ void SvTreeListBox::NotifyInvalidating() DBG_CHKTHIS(SvTreeListBox,0); } -void SvTreeListBox::Invalidate( USHORT nInvalidateFlags ) +void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags ) { DBG_CHKTHIS(SvTreeListBox,0); if( nFocusWidth == -1 ) @@ -2168,7 +2168,7 @@ void SvTreeListBox::Invalidate( USHORT nInvalidateFlags ) pImp->Invalidate(); } -void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags ) +void SvTreeListBox::Invalidate( const Rectangle& rRect, sal_uInt16 nInvalidateFlags ) { DBG_CHKTHIS(SvTreeListBox,0); if( nFocusWidth == -1 ) @@ -2179,11 +2179,11 @@ void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags } -void SvTreeListBox::SetHighlightRange( USHORT nStart, USHORT nEnd) +void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd) { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nTemp; + sal_uInt16 nTemp; nTreeFlags |= TREEFLAG_USESEL; if( nStart > nEnd ) { @@ -2206,12 +2206,12 @@ void SvTreeListBox::RemoveHighlightRange() Invalidate(); } -ULONG SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*) +sal_uLong SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*) { return LIST_APPEND; } -ULONG SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*) +sal_uLong SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*) { DBG_CHKTHIS(SvTreeListBox,0); return LIST_APPEND; @@ -2257,10 +2257,10 @@ void SvTreeListBox::RemoveParentKeepChilds( SvLBoxEntry* pParent ) pModel->Remove( pParent ); } -SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos ) +SvLBoxTab* SvTreeListBox::GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rPos ) { - USHORT nTabCount = aTabs.Count(); - for( USHORT nPos = 0; nPos < nTabCount; nPos++ ) + sal_uInt16 nTabCount = aTabs.Count(); + for( sal_uInt16 nPos = 0; nPos < nTabCount; nPos++ ) { SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nPos ); if( (pTab->nFlags & nFlagMask) ) @@ -2273,17 +2273,17 @@ SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos ) return 0; } -SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos ) +SvLBoxTab* SvTreeListBox::GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos ) { short nTabCount = (short)aTabs.Count(); if( nTabCount ) { for( short nPos = nTabCount-1; nPos >= 0; nPos-- ) { - SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (USHORT)nPos ); + SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (sal_uInt16)nPos ); if( (pTab->nFlags & nFlagMask) ) { - rTabPos = (USHORT)nPos; + rTabPos = (sal_uInt16)nPos; return pTab; } } @@ -2292,12 +2292,12 @@ SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos ) return 0; } -void SvTreeListBox::SetAddMode( BOOL bAdd ) +void SvTreeListBox::SetAddMode( sal_Bool bAdd ) { pImp->SetAddMode( bAdd ); } -BOOL SvTreeListBox::IsAddMode() const +sal_Bool SvTreeListBox::IsAddMode() const { return pImp->IsAddMode(); } @@ -2323,8 +2323,8 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData ) return pImp->pIntlWrapper->getCaseCollator()->compareString( aLeft, aRight ); } -void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uLong nPos ) { if( nActionId == LISTACTION_CLEARING ) CancelTextEditing(); @@ -2352,14 +2352,14 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, break; case LISTACTION_RESORTING: - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); break; case LISTACTION_RESORTED: // nach Sortierung den ersten Eintrag anzeigen, dabei die // Selektion erhalten. - MakeVisible( (SvLBoxEntry*)pModel->First(), TRUE ); - SetUpdateMode( TRUE ); + MakeVisible( (SvLBoxEntry*)pModel->First(), sal_True ); + SetUpdateMode( sal_True ); break; case LISTACTION_CLEARED: @@ -2374,8 +2374,8 @@ long SvTreeListBox::GetTextOffset() const { DBG_CHKTHIS(SvTreeListBox,0); const WinBits nWindowStyle = GetStyle(); - BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; - BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | + sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; + sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; long nStartPos = TAB_STARTPOS; long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); @@ -2453,12 +2453,12 @@ void SvTreeListBox::EndSelection() pImp->EndSelection(); } -BOOL SvTreeListBox::IsNodeButton( const Point& rPos ) const +sal_Bool SvTreeListBox::IsNodeButton( const Point& rPos ) const { SvLBoxEntry* pEntry = GetEntry( rPos ); if( pEntry ) return pImp->IsNodeButton( rPos, pEntry ); - return FALSE; + return sal_False; } void SvTreeListBox::RepaintScrollBars() const @@ -2476,7 +2476,7 @@ ScrollBar *SvTreeListBox::GetHScroll() return &((SvTreeListBox*)this)->pImp->aHorSBar; } -void SvTreeListBox::EnableAsyncDrag( BOOL b ) +void SvTreeListBox::EnableAsyncDrag( sal_Bool b ) { pImp->EnableAsyncDrag( b ); } @@ -2514,9 +2514,9 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) { if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - nEntryHeight = 0; // _together_ with TRUE of 1. par (bFont) of InitSettings() a zero-height + nEntryHeight = 0; // _together_ with sal_True of 1. par (bFont) of InitSettings() a zero-height // forces complete recalc of heights! - InitSettings( TRUE, TRUE, TRUE ); + InitSettings( sal_True, sal_True, sal_True ); Invalidate(); } else @@ -2530,7 +2530,7 @@ void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) ImplInitStyle(); } -void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) +void SvTreeListBox::InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); if( bFont ) @@ -2557,17 +2557,17 @@ void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) pCheckButtonData->SetDefaultImages( this ); } -BOOL SvTreeListBox::IsCellFocusEnabled() const +sal_Bool SvTreeListBox::IsCellFocusEnabled() const { return pImp->IsCellFocusEnabled(); } -bool SvTreeListBox::SetCurrentTabPos( USHORT _nNewPos ) +bool SvTreeListBox::SetCurrentTabPos( sal_uInt16 _nNewPos ) { return pImp->SetCurrentTabPos( _nNewPos ); } -USHORT SvTreeListBox::GetCurrentTabPos() const +sal_uInt16 SvTreeListBox::GetCurrentTabPos() const { return pImp->GetCurrentTabPos(); } @@ -2589,7 +2589,7 @@ PopupMenu* SvTreeListBox::CreateContextMenu( void ) return NULL; } -void SvTreeListBox::ExcecuteContextMenuAction( USHORT ) +void SvTreeListBox::ExcecuteContextMenuAction( sal_uInt16 ) { DBG_WARNING( "SvTreeListBox::ExcecuteContextMenuAction(): now there's happening nothing!" ); } @@ -2598,17 +2598,17 @@ void SvTreeListBox::EnableContextMenuHandling( void ) { DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" ); - pImp->bContextMenuHandling = TRUE; + pImp->bContextMenuHandling = sal_True; } -void SvTreeListBox::EnableContextMenuHandling( BOOL b ) +void SvTreeListBox::EnableContextMenuHandling( sal_Bool b ) { DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" ); pImp->bContextMenuHandling = b; } -BOOL SvTreeListBox::IsContextMenuHandlingEnabled( void ) const +sal_Bool SvTreeListBox::IsContextMenuHandlingEnabled( void ) const { DBG_ASSERT( pImp, "-SvTreeListBox::IsContextMenuHandlingEnabled(): No implementation!" ); @@ -2673,7 +2673,7 @@ void SvTreeListBox::EnableCellFocus() pImp->EnableCellFocus(); } -void SvTreeListBox::CallImplEventListeners(ULONG nEvent, void* pData) +void SvTreeListBox::CallImplEventListeners(sal_uLong nEvent, void* pData) { CallEventListeners(nEvent, pData); } diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 86bab5b8e42a..2959d8e0460f 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -121,7 +121,7 @@ extern ::rtl::OUString CreateExactSizeText_Impl( sal_Int64 nSize ); // fileview. struct FolderHistory { String m_sURL; - ULONG m_nGroup; + sal_uLong m_nGroup; FolderHistory( const String& _rURL, sal_Int32 _nGroup ) : m_sURL( _rURL ), m_nGroup( _nGroup ) {} @@ -134,7 +134,7 @@ ODocumentInfoPreview::ODocumentInfoPreview( Window* pParent ,WinBits _nBits) : W { m_pEditWin = new SvtExtendedMultiLineEdit_Impl(this,_nBits); m_pEditWin->Show(); - m_pEditWin->EnableCursor( FALSE ); + m_pEditWin->EnableCursor( sal_False ); m_pInfoTable = new SvtDocInfoTable_Impl(); // detect application language m_aLocale = SvtPathOptions().GetLocale(); @@ -183,7 +183,7 @@ void ODocumentInfoPreview::fill( if (!i_xDocProps.is()) throw RuntimeException(); ::rtl::OUString aStr; - m_pEditWin->SetAutoScroll( FALSE ); + m_pEditWin->SetAutoScroll( sal_False ); aStr = i_xDocProps->getTitle(); if (aStr.getLength()) { @@ -237,7 +237,7 @@ void ODocumentInfoPreview::fill( // size if ( i_rURL.Len() > 0 ) { - ULONG nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL ); + sal_uLong nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL ); m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_SIZE ), CreateExactSizeText_Impl( nDocSize ) ); @@ -285,7 +285,7 @@ void ODocumentInfoPreview::fill( } m_pEditWin->SetSelection( Selection( 0, 0 ) ); - m_pEditWin->SetAutoScroll( TRUE ); + m_pEditWin->SetAutoScroll( sal_True ); } // ----------------------------------------------------------------------------- @@ -340,7 +340,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) : aIconCtrl.SetAccessibleName( String( RTL_CONSTASCII_USTRINGPARAM("Groups") ) ); aIconCtrl.SetHelpId( HID_TEMPLATEDLG_ICONCTRL ); - aIconCtrl.SetChoiceWithCursor( TRUE ); + aIconCtrl.SetChoiceWithCursor( sal_True ); aIconCtrl.SetSelectionMode( SINGLE_SELECTION ); aIconCtrl.Show(); @@ -413,7 +413,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) : SvtIconWindow_Impl::~SvtIconWindow_Impl() { - for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i ) + for ( sal_uLong i = 0; i < aIconCtrl.GetEntryCount(); ++i ) { SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( i ); delete (String*)pEntry->GetUserData(); @@ -423,7 +423,7 @@ SvtIconWindow_Impl::~SvtIconWindow_Impl() SvxIconChoiceCtrlEntry* SvtIconWindow_Impl::GetEntry( const String& rURL ) const { SvxIconChoiceCtrlEntry* pEntry = NULL; - for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i ) + for ( sal_uLong i = 0; i < aIconCtrl.GetEntryCount(); ++i ) { SvxIconChoiceCtrlEntry* pTemp = aIconCtrl.GetEntry( i ); String aURL( *( (String*)pTemp->GetUserData() ) ); @@ -461,7 +461,7 @@ String SvtIconWindow_Impl::GetCursorPosIconURL() const String SvtIconWindow_Impl::GetSelectedIconURL() const { - ULONG nPos; + sal_uLong nPos; SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetSelectedEntry( nPos ); String aURL; if ( pEntry ) @@ -471,7 +471,7 @@ String SvtIconWindow_Impl::GetSelectedIconURL() const String SvtIconWindow_Impl::GetSelectedIconText() const { - ULONG nPos; + sal_uLong nPos; return MnemonicGenerator::EraseAllMnemonicChars( aIconCtrl.GetSelectedEntry( nPos )->GetText() ); } @@ -489,9 +489,9 @@ void SvtIconWindow_Impl::InvalidateIconControl() aIconCtrl.Invalidate(); } -ULONG SvtIconWindow_Impl::GetCursorPos() const +sal_uLong SvtIconWindow_Impl::GetCursorPos() const { - ULONG nPos = ~ULONG(0); + sal_uLong nPos = ~sal_uLong(0); SvxIconChoiceCtrlEntry* pCursorEntry = aIconCtrl.GetCursor( ); if ( pCursorEntry ) @@ -500,15 +500,15 @@ ULONG SvtIconWindow_Impl::GetCursorPos() const return nPos; } -ULONG SvtIconWindow_Impl::GetSelectEntryPos() const +sal_uLong SvtIconWindow_Impl::GetSelectEntryPos() const { - ULONG nPos; + sal_uLong nPos; if ( !aIconCtrl.GetSelectedEntry( nPos ) ) - nPos = ~ULONG(0); + nPos = ~sal_uLong(0); return nPos; } -void SvtIconWindow_Impl::SetCursorPos( ULONG nPos ) +void SvtIconWindow_Impl::SetCursorPos( sal_uLong nPos ) { SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( nPos ); aIconCtrl.SetCursor( pEntry ); @@ -525,7 +525,7 @@ long SvtIconWindow_Impl::CalcHeight() const { // calculate the required height of the IconControl long nHeight = 0; - ULONG nCount = aIconCtrl.GetEntryCount(); + sal_uLong nCount = aIconCtrl.GetEntryCount(); if ( nCount > 0 ) // bottom of the last icon nHeight = aIconCtrl.GetEntry(nCount-1)->GetBoundRect().Bottom(); @@ -544,9 +544,9 @@ sal_Bool SvtIconWindow_Impl::IsRootURL( const String& rURL ) const rURL == aSamplesFolderRootURL; } -ULONG SvtIconWindow_Impl::GetRootPos( const String& rURL ) const +sal_uLong SvtIconWindow_Impl::GetRootPos( const String& rURL ) const { - ULONG nPos = ~ULONG(0); + sal_uLong nPos = ~sal_uLong(0); if ( aNewDocumentRootURL.Match( rURL ) == STRING_MATCH ) nPos = 0; else if ( aTemplateRootURL.Match( rURL ) == STRING_MATCH ) @@ -646,7 +646,7 @@ Sequence< ::rtl::OUString > SvtFileViewWindow_Impl::GetNewDocContents() const ::rtl::OUString aImageURL; ::rtl::OUString aTargetFrame; - UINT32 i, nCount = aDynamicMenuEntries.getLength(); + sal_uInt32 i, nCount = aDynamicMenuEntries.getLength(); ::rtl::OUString sSeparator( ASCII_STR("private:separator") ); ::rtl::OUString sSlotURL( ASCII_STR("slot:5500") ); @@ -788,7 +788,7 @@ void SvtExtendedMultiLineEdit_Impl::InsertEntry( const String& rTitle, const Str aText += rTitle; aText += ':'; InsertText( aText ); - ULONG nPara = GetParagraphCount() - 1; + sal_uLong nPara = GetParagraphCount() - 1; SetAttrib( TextAttribFontWeight( WEIGHT_BOLD ), nPara, 0, aText.Len() ); aText = '\n'; @@ -968,7 +968,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B // disabling must be done here, does not work in ctor because // execute of the dialog will overwrite it // ( own execute method would help ) - pTextWin->EnableInput( FALSE, TRUE ); + pTextWin->EnableInput( sal_False, sal_True ); if ( pTextWin->IsReallyVisible() ) { sal_Bool b = sal_True; @@ -1106,7 +1106,7 @@ SvtTemplateWindow::~SvtTemplateWindow() delete pFrameWin; if ( pHistoryList ) { - for ( UINT32 i = 0; i < pHistoryList->Count(); ++i ) + for ( sal_uInt32 i = 0; i < pHistoryList->Count(); ++i ) delete pHistoryList->GetObject(i); delete pHistoryList; } @@ -1123,7 +1123,7 @@ IMPL_LINK ( SvtTemplateWindow , IconClickHdl_Impl, SvtIconChoiceCtrl *, EMPTYARG { pFileWin->OpenRoot( aURL ); pIconWin->InvalidateIconControl(); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False ); } return 0; } @@ -1160,10 +1160,10 @@ IMPL_LINK ( SvtTemplateWindow , FileDblClickHdl_Impl, SvtFileView *, EMPTYARG ) IMPL_LINK ( SvtTemplateWindow , NewFolderHdl_Impl, SvtFileView *, EMPTYARG ) { pFrameWin->OpenFile( String(), sal_True, sal_False, sal_False ); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False ); String sURL = pFileWin->GetFolderURL(); - ULONG nPos = pIconWin->GetRootPos( sURL ); + sal_uLong nPos = pIconWin->GetRootPos( sURL ); AppendHistoryURL( sURL, nPos ); aNewFolderHdl.Call( this ); @@ -1234,7 +1234,7 @@ void SvtTemplateWindow::PrintFile( const String& rURL ) // ------------------------------------------------------------------------ -void SvtTemplateWindow::AppendHistoryURL( const String& rURL, ULONG nGroup ) +void SvtTemplateWindow::AppendHistoryURL( const String& rURL, sal_uLong nGroup ) { sal_Bool bInsert = sal_True; if ( !pHistoryList ) @@ -1267,7 +1267,7 @@ void SvtTemplateWindow::OpenHistory() // ------------------------------------------------------------------------ -void SvtTemplateWindow::DoAction( USHORT nAction ) +void SvtTemplateWindow::DoAction( sal_uInt16 nAction ) { switch( nAction ) { @@ -1316,16 +1316,16 @@ void SvtTemplateWindow::InitToolBoxes() aSize.Height() += 4; aFrameWinTB.SetPosSizePixel( Point( pFrameWin->GetPosPixel().X() + 2, 2 ), aSize ); - BOOL bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT ); + sal_Bool bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT ); if ( bFlat ) { aFileViewTB.SetOutStyle( TOOLBOX_STYLE_FLAT ); aFrameWinTB.SetOutStyle( TOOLBOX_STYLE_FLAT ); } - aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, FALSE ); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, FALSE ); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, sal_False ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, sal_False ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False ); Link aLink = LINK( this, SvtTemplateWindow, ClickHdl_Impl ); aFileViewTB.SetClickHdl( aLink ); @@ -1337,7 +1337,7 @@ void SvtTemplateWindow::InitToolBoxes() void SvtTemplateWindow::InitToolBoxImages() { SvtMiscOptions aMiscOpt; - BOOL bLarge = aMiscOpt.AreCurrentSymbolsLarge(); + sal_Bool bLarge = aMiscOpt.AreCurrentSymbolsLarge(); sal_Bool bHiContrast = aFileViewTB.GetSettings().GetStyleSettings().GetHighContrastMode(); aFileViewTB.SetItemImage( TI_DOCTEMPLATE_BACK, Image( SvtResId( @@ -1369,13 +1369,13 @@ void SvtTemplateWindow::UpdateIcons() long SvtTemplateWindow::PreNotify( NotifyEvent& rNEvt ) { - USHORT nType = rNEvt.GetType(); + sal_uInt16 nType = rNEvt.GetType(); long nRet = 0; if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() ) { const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode(); - USHORT nCode = rKeyCode.GetCode(); + sal_uInt16 nCode = rKeyCode.GetCode(); if ( KEY_BACKSPACE == nCode && !rKeyCode.GetModifier() && pFileWin->HasChildPathFocus() ) { @@ -1574,7 +1574,7 @@ void SvtTemplateWindow::ReadViewSettings() // the selected view (details or preview) pFrameWin->ToggleView( TI_DOCTEMPLATE_DOCINFO == nSelectedView ); - aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, TRUE ); + aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, sal_True ); // the split ratio sal_Int32 nSplitFileAndFrameSize = aSplitWin.GetItemSize( FILEWIN_ID ) + aSplitWin.GetItemSize( FRAMEWIN_ID ); diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx index d8ec12224f60..c6100ba5bc20 100644 --- a/svtools/source/contnr/templwin.hxx +++ b/svtools/source/contnr/templwin.hxx @@ -94,13 +94,13 @@ public: String GetCursorPosIconURL() const; String GetIconText( const String& rURL ) const; void InvalidateIconControl(); - void SetCursorPos( ULONG nPos ); - ULONG GetCursorPos() const; - ULONG GetSelectEntryPos() const; + void SetCursorPos( sal_uLong nPos ); + sal_uLong GetCursorPos() const; + sal_uLong GetSelectEntryPos() const; void SetFocus(); long CalcHeight() const; sal_Bool IsRootURL( const String& rURL ) const; - ULONG GetRootPos( const String& rURL ) const; + sal_uLong GetRootPos( const String& rURL ) const; void UpdateIcons( sal_Bool _bHiContrast ); inline sal_Bool ProcessKeyEvent( const KeyEvent& rKEvt ); @@ -267,9 +267,9 @@ private: DECL_LINK( ResizeHdl_Impl, SplitWindow* ); // used for split and initial setting of toolbar pos void PrintFile( const String& rURL ); - void AppendHistoryURL( const String& rURL, ULONG nGroup ); + void AppendHistoryURL( const String& rURL, sal_uLong nGroup ); void OpenHistory(); - void DoAction( USHORT nAction ); + void DoAction( sal_uInt16 nAction ); void InitToolBoxes(); void InitToolBoxImages(); void UpdateIcons(); diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 1b96f1ac89e4..c4ec516a735b 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -89,7 +89,7 @@ void SvListEntry::SetListPositions() if( pChilds ) { SvListEntry *pEntry = (SvListEntry*)pChilds->First(); - ULONG nCur = 0; + sal_uLong nCur = 0; while ( pEntry ) { pEntry->nListPos &= 0x80000000; @@ -152,7 +152,7 @@ void SvTreeEntryList::DestroyAll() SvTreeList::SvTreeList() { nEntryCount = 0; - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; nRefCount = 1; pRootItem = new SvListEntry; eSortMode = SortNone; @@ -188,11 +188,11 @@ SvTreeList::~SvTreeList() |* *************************************************************************/ -void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvTreeList::Broadcast( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uLong nPos ) { - ULONG nViewCount = aViewList.Count(); - for( ULONG nCurView = 0; nCurView < nViewCount; nCurView++ ) + sal_uLong nViewCount = aViewList.Count(); + for( sal_uLong nCurView = 0; nCurView < nViewCount; nCurView++ ) { SvListView* pView = (SvListView*)aViewList.GetObject( nCurView ); if( pView ) @@ -202,7 +202,7 @@ void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1, void SvTreeList::InsertView( SvListView* pView) { - ULONG nPos = aViewList.GetPos( pView ); + sal_uLong nPos = aViewList.GetPos( pView ); if ( nPos == LIST_ENTRY_NOTFOUND ) { aViewList.Insert( pView, LIST_APPEND ); @@ -212,7 +212,7 @@ void SvTreeList::InsertView( SvListView* pView) void SvTreeList::RemoveView( SvListView* pView ) { - ULONG nPos = aViewList.GetPos( pView ); + sal_uLong nPos = aViewList.GetPos( pView ); if ( nPos != LIST_ENTRY_NOTFOUND ) { aViewList.Remove( pView ); @@ -222,15 +222,15 @@ void SvTreeList::RemoveView( SvListView* pView ) // Ein Entry ist sichtbar, wenn alle Parents expandiert sind -BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const +sal_Bool SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params"); - BOOL bRetVal=FALSE; + sal_Bool bRetVal=sal_False; do { if ( pEntry == pRootItem ) { - bRetVal=TRUE; + bRetVal=sal_True; break; } pEntry = pEntry->pParent; @@ -238,10 +238,10 @@ BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) return bRetVal; } -USHORT SvTreeList::GetDepth( SvListEntry* pEntry ) const +sal_uInt16 SvTreeList::GetDepth( SvListEntry* pEntry ) const { DBG_ASSERT(pEntry&&pEntry!=pRootItem,"GetDepth:Bad Entry"); - USHORT nDepth = 0; + sal_uInt16 nDepth = 0; while( pEntry->pParent != pRootItem ) { nDepth++; @@ -290,20 +290,20 @@ void SvTreeList::Clear() |* *************************************************************************/ -BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const +sal_Bool SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const { if ( !pParent ) pParent = pRootItem; - BOOL bIsChild = FALSE; + sal_Bool bIsChild = sal_False; SvTreeEntryList* pList = pParent->pChilds; if ( !pList ) - return FALSE; + return sal_False; SvListEntry* pActualChild = (SvListEntry*)(pList->First()); while( !bIsChild && pActualChild ) { if ( pActualChild == pChild ) - bIsChild = TRUE; + bIsChild = sal_True; else { if ( pActualChild->pChilds ) @@ -314,7 +314,7 @@ BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const return bIsChild; } -ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos) +sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos) { // pDest darf Null sein! DBG_ASSERT(pSrcEntry,"Entry?"); @@ -329,7 +329,7 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n if ( pSrcEntry == pTargetParent ) return pSrcEntry->GetChildListPos(); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; SvTreeEntryList* pDstList = pTargetParent->pChilds; SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChilds; @@ -358,20 +358,20 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n // Listenpositionen in Zielliste korrigieren SetListPositions( pDstList ); - if ( pSrcList && (ULONG)pSrcList != (ULONG)pDstList ) + if ( pSrcList && (sal_uLong)pSrcList != (sal_uLong)pDstList ) SetListPositions( pSrcList ); #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif - ULONG nRetVal = pDstList->GetPos( pSrcEntry ); + sal_uLong nRetVal = pDstList->GetPos( pSrcEntry ); DBG_ASSERT(nRetVal==pSrcEntry->GetChildListPos(),"ListPos not valid"); Broadcast( LISTACTION_MOVED,pSrcEntry,pTargetParent,nRetVal); return nRetVal; } -ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos) +sal_uLong SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos) { // pDest darf Null sein! DBG_ASSERT(pSrcEntry,"Entry?"); @@ -380,9 +380,9 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n if ( !pTargetParent->pChilds ) pTargetParent->pChilds = new SvTreeEntryList; - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; - ULONG nCloneCount = 0; + sal_uLong nCloneCount = 0; SvListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount ); nEntryCount += nCloneCount; @@ -395,7 +395,7 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n CheckIntegrity(); #endif Broadcast( LISTACTION_INSERTED_TREE, pClonedEntry ); - ULONG nRetVal = pDstList->GetPos( pClonedEntry ); + sal_uLong nRetVal = pDstList->GetPos( pClonedEntry ); return nRetVal; } @@ -414,7 +414,7 @@ CheckIntegrity(); void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { SvListEntry* pParent; - ULONG nPos; + sal_uLong nPos; if ( !pDstEntry ) { @@ -443,7 +443,7 @@ void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { SvListEntry* pParent; - ULONG nPos; + sal_uLong nPos; if ( !pDstEntry ) { @@ -470,7 +470,7 @@ void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry) { SvListEntry* pParent; - ULONG nPos; + sal_uLong nPos; if ( !pDstEntry ) { @@ -487,7 +487,7 @@ void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry) void SvTreeList::InsertTree(SvListEntry* pSrcEntry, - SvListEntry* pTargetParent,ULONG nListPos) + SvListEntry* pTargetParent,sal_uLong nListPos) { DBG_ASSERT(pSrcEntry,"InsertTree:Entry?"); if ( !pSrcEntry ) @@ -501,7 +501,7 @@ void SvTreeList::InsertTree(SvListEntry* pSrcEntry, // Sortierung beruecksichtigen GetInsertionPos( pSrcEntry, pTargetParent, nListPos ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; pSrcEntry->pParent = pTargetParent; // Parent umsetzen SvTreeEntryList* pDstList = pTargetParent->pChilds; @@ -540,7 +540,7 @@ SvListEntry* SvTreeList::CreateEntry() const |* *************************************************************************/ -SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const +SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const { SvListEntry* pClonedEntry = CloneEntry( pEntry ); nCloneCount = 1; @@ -562,7 +562,7 @@ SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds, SvListEntry* pNewParent, - ULONG& nCloneCount ) const + sal_uLong& nCloneCount ) const { DBG_ASSERT(pChilds->Count(),"Childs?"); SvTreeEntryList* pClonedChilds = new SvTreeEntryList; @@ -596,16 +596,16 @@ SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds, |* *************************************************************************/ -ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const +sal_uLong SvTreeList::GetChildCount( SvListEntry* pParent ) const { if ( !pParent ) return GetEntryCount(); if ( !pParent || !pParent->pChilds) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uLong nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = Next( pParent, &nActDepth ); @@ -625,16 +625,16 @@ ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const |* *************************************************************************/ -ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const +sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const { DBG_ASSERT(pView,"GetVisChildCount:No View"); if ( !pParent ) pParent = pRootItem; if ( !pParent || !pView->IsExpanded(pParent) || !pParent->pChilds ) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uLong nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = NextVisible( pView, pParent, &nActDepth ); @@ -644,16 +644,16 @@ ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pPa return nCount; } -ULONG SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const +sal_uLong SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const { DBG_ASSERT(pView,"GetChildSelCount:No View"); if ( !pParent ) pParent = pRootItem; if ( !pParent || !pParent->pChilds) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uLong nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = Next( pParent, &nActDepth ); @@ -692,22 +692,22 @@ SvListEntry* SvTreeList::First() const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const +SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, sal_uInt16* pDepth ) const { DBG_ASSERT( pActEntry && pActEntry->pParent, "SvTreeList::Next: invalid entry/parent!" ); if ( !pActEntry || !pActEntry->pParent ) return NULL; - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pDepth ) { nDepth = *pDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ ) { @@ -756,20 +756,20 @@ SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const +SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, sal_uInt16* pDepth ) const { DBG_ASSERT(pActEntry!=0,"Entry?"); - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pDepth ) { nDepth = *pDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( nActualPos > 0 ) { @@ -809,7 +809,7 @@ SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const |* *************************************************************************/ -SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const +SvListEntry* SvTreeList::Last( sal_uInt16* /* nDepth */ ) const { SvTreeEntryList* pActList = pRootItem->pChilds; // if ( pActList->Count() == 0 ) @@ -835,7 +835,7 @@ SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const |* *************************************************************************/ -ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const +sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"View/Entry?"); @@ -859,7 +859,7 @@ ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) |* *************************************************************************/ -ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const +sal_uLong SvTreeList::GetVisibleCount( const SvListView* pView ) const { DBG_ASSERT(pView,"GetVisCount:No View"); if( !pView->HasViewData() ) @@ -867,7 +867,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const if ( pView->nVisibleCount ) return pView->nVisibleCount; - ULONG nPos = 0; + sal_uLong nPos = 0; SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar while ( pEntry ) { @@ -883,7 +883,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const } #endif ((SvListView*)pView)->nVisibleCount = nPos; - ((SvListView*)pView)->bVisPositionsValid = TRUE; + ((SvListView*)pView)->bVisPositionsValid = sal_True; return nPos; } @@ -901,22 +901,22 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const // Funktion geht aus Geschwindigkeitsgruenden davon aus, // das der uebergebene Eintrag bereits sichtbar ist -SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,USHORT* pActDepth) const +SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,sal_uInt16* pActDepth) const { DBG_ASSERT(pView,"NextVisible:No View"); if ( !pActEntry ) return 0; - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pActDepth ) { nDepth = *pActDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( pView->IsExpanded(pActEntry) ) { @@ -971,20 +971,20 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEn // Funktion geht aus Geschwindigkeitsgruenden davon aus, // das der uebergebene Eintrag bereits sichtbar ist -SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, USHORT* pActDepth) const +SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, sal_uInt16* pActDepth) const { DBG_ASSERT(pView&&pActEntry,"PrevVis:View/Entry?"); - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pActDepth ) { nDepth = *pActDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( nActualPos > 0 ) { @@ -1024,7 +1024,7 @@ SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActE |* *************************************************************************/ -SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) const +SvListEntry* SvTreeList::LastVisible( const SvListView* pView, sal_uInt16* pDepth) const { DBG_ASSERT(pView,"LastVis:No View"); SvListEntry* pEntry = Last(); @@ -1045,20 +1045,20 @@ SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) c |* *************************************************************************/ -SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,USHORT& nDelta) const +SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,sal_uInt16& nDelta) const { DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis"); - ULONG nVisPos = GetVisiblePos( pView, pEntry ); + sal_uLong nVisPos = GetVisiblePos( pView, pEntry ); // nDelta Eintraege vorhanden ? // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7 // nNewDelta = 10-nVisPos-1 == 4 if ( nVisPos+nDelta >= pView->nVisibleCount ) { - nDelta = (USHORT)(pView->nVisibleCount-nVisPos); + nDelta = (sal_uInt16)(pView->nVisibleCount-nVisPos); nDelta--; } - USHORT nDeltaTmp = nDelta; + sal_uInt16 nDeltaTmp = nDelta; while( nDeltaTmp ) { pEntry = NextVisible( pView, pEntry ); @@ -1078,17 +1078,17 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry |* *************************************************************************/ -SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, USHORT& nDelta ) const +SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, sal_uInt16& nDelta ) const { DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis"); - ULONG nVisPos = GetVisiblePos( pView, pEntry ); + sal_uLong nVisPos = GetVisiblePos( pView, pEntry ); // nDelta Eintraege vorhanden ? // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20 // nNewDelta = nNewVisPos if ( nDelta > nVisPos ) - nDelta = (USHORT)nVisPos; - USHORT nDeltaTmp = nDelta; + nDelta = (sal_uInt16)nVisPos; + sal_uInt16 nDeltaTmp = nDelta; while( nDeltaTmp ) { pEntry = PrevVisible( pView, pEntry ); @@ -1138,8 +1138,8 @@ SvListEntry* SvTreeList::NextSibling( SvListEntry* pEntry ) const if( !pEntry ) return 0; SvTreeEntryList* pList = pEntry->pParent->pChilds; -// ULONG nPos = pList->GetPos( pEntry ); - ULONG nPos = pEntry->GetChildListPos(); +// sal_uLong nPos = pList->GetPos( pEntry ); + sal_uLong nPos = pEntry->GetChildListPos(); nPos++; pEntry = (SvListEntry*)(pList->GetObject( nPos )); return pEntry; @@ -1152,8 +1152,8 @@ SvListEntry* SvTreeList::PrevSibling( SvListEntry* pEntry ) const return 0; SvTreeEntryList* pList = pEntry->pParent->pChilds; - // ULONG nPos = pList->GetPos( pEntry ); - ULONG nPos = pEntry->GetChildListPos(); + // sal_uLong nPos = pList->GetPos( pEntry ); + sal_uLong nPos = pEntry->GetChildListPos(); if ( nPos == 0 ) return 0; nPos--; @@ -1243,7 +1243,7 @@ SvListEntry* SvTreeList::LastSelected( const SvListView* pView ) const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos ) +sal_uLong SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,sal_uLong nPos ) { DBG_ASSERT( pEntry,"Entry?"); @@ -1262,7 +1262,7 @@ ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos ) // Sortierung beruecksichtigen GetInsertionPos( pEntry, pParent, nPos ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; pEntry->pParent = pParent; pList->Insert( pEntry, nPos ); @@ -1289,7 +1289,7 @@ CheckIntegrity(); |* *************************************************************************/ -ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const +sal_uLong SvTreeList::GetAbsPos( SvListEntry* pEntry) const { if ( !bAbsPositionsValid ) ((SvTreeList*)this)->SetAbsolutePositions(); @@ -1308,7 +1308,7 @@ ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const void SvTreeList::SetAbsolutePositions() { - ULONG nPos = 0; + sal_uLong nPos = 0; SvListEntry* pEntry = First(); while ( pEntry ) { @@ -1316,7 +1316,7 @@ void SvTreeList::SetAbsolutePositions() nPos++; pEntry = Next( pEntry ); } - bAbsPositionsValid = TRUE; + bAbsPositionsValid = sal_True; #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif @@ -1347,7 +1347,7 @@ void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry ) // wenn Parent sichtbar dann Statusdaten invalidieren if ( pView->IsExpanded( pParent ) ) { - pView->bVisPositionsValid = FALSE; + pView->bVisPositionsValid = sal_False; pView->nVisibleCount = 0; } #ifdef CHECK_INTEGRITY @@ -1380,7 +1380,7 @@ void SvTreeList::Collapse( SvListView* pView, SvListEntry* pEntry ) if ( pView->IsExpanded(pParent) ) { pView->nVisibleCount = 0; - pView->bVisPositionsValid = FALSE; + pView->bVisPositionsValid = sal_False; } #ifdef CHECK_INTEGRITY CheckIntegrity(); @@ -1398,14 +1398,14 @@ CheckIntegrity(); |* *************************************************************************/ -BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) +sal_Bool SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, sal_Bool bSelect ) { DBG_ASSERT(pView&&pEntry,"Select:View/Entry?"); SvViewData* pViewData = pView->GetViewData( pEntry ); if ( bSelect ) { if ( pViewData->IsSelected() || !pViewData->IsSelectable() ) - return FALSE; + return sal_False; else { pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED; @@ -1415,7 +1415,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) else { if ( !pViewData->IsSelected() ) - return FALSE; + return sal_False; else { pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED ); @@ -1425,7 +1425,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif - return TRUE; + return sal_True; } /************************************************************************* @@ -1437,7 +1437,7 @@ CheckIntegrity(); |* Letzte Aenderung 05.04.01 |* *************************************************************************/ -BOOL SvTreeList::Remove( SvListEntry* pEntry ) +sal_Bool SvTreeList::Remove( SvListEntry* pEntry ) { DBG_ASSERT(pEntry,"Cannot remove root, use clear"); @@ -1448,22 +1448,22 @@ BOOL SvTreeList::Remove( SvListEntry* pEntry ) // Explorer aus der View Eintraege, die er nicht in die View // eingefuegt hat. Da sich der Kunde fuer ein platzendes // Office nichts kaufen kann, fange ich diesen Fall ab. - return FALSE; + return sal_False; } Broadcast( LISTACTION_REMOVING, pEntry ); - ULONG nRemoved = 1 + GetChildCount(pEntry); - bAbsPositionsValid = FALSE; + sal_uLong nRemoved = 1 + GetChildCount(pEntry); + bAbsPositionsValid = sal_False; SvListEntry* pParent = pEntry->pParent; SvTreeEntryList* pList = pParent->pChilds; DBG_ASSERT(pList,"Remove:No Childlist"); - BOOL bLastEntry = FALSE; + sal_Bool bLastEntry = sal_False; if ( pEntry->HasChildListPos() ) { - ULONG nListPos = pEntry->GetChildListPos(); - bLastEntry = (nListPos == (pList->Count()-1) ) ? TRUE : FALSE; + sal_uLong nListPos = pEntry->GetChildListPos(); + bLastEntry = (nListPos == (pList->Count()-1) ) ? sal_True : sal_False; pList->Remove( nListPos ); } else @@ -1493,7 +1493,7 @@ CheckIntegrity(); Broadcast( LISTACTION_REMOVED, pEntry ); delete pEntry; // loescht auch alle Childs - return TRUE; + return sal_True; } /************************************************************************* @@ -1506,7 +1506,7 @@ CheckIntegrity(); |* *************************************************************************/ -ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSelect ) +sal_uLong SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,sal_Bool bSelect ) { DBG_ASSERT(pView&&pParent,"SelChilds:View/Parent?"); if ( !pParent->pChilds ) @@ -1514,9 +1514,9 @@ ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSel if ( pParent->pChilds->Count() == 0 ) return 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nDepth = nRefDepth; - ULONG nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nDepth = nRefDepth; + sal_uLong nCount = 0; pParent = Next( pParent ); do { @@ -1531,7 +1531,7 @@ CheckIntegrity(); return nCount; } -void SvTreeList::SelectAll( SvListView* pView, BOOL bSelect ) +void SvTreeList::SelectAll( SvListView* pView, sal_Bool bSelect ) { DBG_ASSERT(pView,"SelectAll:NoView"); SvListEntry* pEntry = First(); @@ -1555,7 +1555,7 @@ CheckIntegrity(); } -SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const +SvListEntry* SvTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const { SvListEntry* pEntry = First(); while ( nAbsPos && pEntry ) @@ -1566,7 +1566,7 @@ SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const return pEntry; } -SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, ULONG nVisPos ) const +SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uLong nVisPos ) const { DBG_ASSERT(pView,"GetEntryAtVisPos:No View"); SvListEntry* pEntry = First(); @@ -1587,7 +1587,7 @@ void SvTreeList::SetListPositions( SvTreeEntryList* pList ) pEntry->pParent->InvalidateChildrensListPositions(); } /* - ULONG nListPos = 0; + sal_uLong nListPos = 0; SvListEntry* pEntry = (SvListEntry*)(pList->First()); while( pEntry ) { @@ -1604,13 +1604,13 @@ void SvTreeList::InvalidateEntry( SvListEntry* pEntry ) Broadcast( LISTACTION_INVALIDATE_ENTRY, pEntry ); } -BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const +sal_Bool SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const { if ( !pParent ) pParent = pRootItem; - BOOL bIsChild = FALSE; + sal_Bool bIsChild = sal_False; if ( pParent->pChilds ) - bIsChild = (BOOL)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND); + bIsChild = (sal_Bool)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND); return bIsChild; } @@ -1618,7 +1618,7 @@ BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const void lcl_CheckList( SvTreeEntryList* pList ) { SvListEntry* pEntry = (SvListEntry*)(pList->First()); - ULONG nPos = 0; + sal_uLong nPos = 0; while ( pEntry ) { DBG_ASSERT(pEntry->GetChildListPos()==nPos,"Wrong ListPos"); @@ -1629,7 +1629,7 @@ void lcl_CheckList( SvTreeEntryList* pList ) void SvTreeList::CheckIntegrity() const { - ULONG nMyEntryCount = 0; + sal_uLong nMyEntryCount = 0; if ( pRootItem->pChilds ) { lcl_CheckList( pRootItem->pChilds ); @@ -1680,7 +1680,7 @@ SvListView::SvListView( SvTreeList* pModell ) pModel = 0; nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; SetModel( pModell ); } @@ -1690,7 +1690,7 @@ SvListView::SvListView() pModel = 0; nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } @@ -1724,7 +1724,7 @@ void SvListView::InitTable() pEntry = pModel->pRootItem; pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pEntry, pViewData ); // Jetzt alle anderen Entries pEntry = pModel->First(); while( pEntry ) @@ -1732,7 +1732,7 @@ void SvListView::InitTable() pViewData = CreateViewData( pEntry ); DBG_ASSERT(pViewData,"InitTable:No ViewData"); InitViewData( pViewData, pEntry ); - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pEntry, pViewData ); pEntry = pModel->Next( pEntry ); } } @@ -1760,25 +1760,25 @@ void SvListView::Clear() ClearTable(); nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; if( pModel ) { // RootEntry einfuegen SvListEntry* pEntry = pModel->pRootItem; SvViewData* pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pEntry, pViewData ); } } void SvListView::SetModel( SvTreeList* pNewModel ) { DBG_CHKTHIS(SvListView,0); - BOOL bBroadcastCleared = FALSE; + sal_Bool bBroadcastCleared = sal_False; if ( pModel ) { pModel->RemoveView( this ); - bBroadcastCleared = TRUE; + bBroadcastCleared = sal_True; ModelNotification( LISTACTION_CLEARING,0,0,0 ); if ( pModel->GetRefCount() == 0 ) delete pModel; @@ -1807,7 +1807,7 @@ void SvListView::ModelHasInsertedTree( SvListEntry* ) } void SvListView::ModelIsMoving( SvListEntry* /* pSource */ , - SvListEntry* /* pTargetParent */ , ULONG /* nPos */ ) + SvListEntry* /* pTargetParent */ , sal_uLong /* nPos */ ) { DBG_CHKTHIS(SvListView,0); } @@ -1833,28 +1833,28 @@ void SvListView::ModelHasEntryInvalidated( SvListEntry*) DBG_CHKTHIS(SvListView,0); } -void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,ULONG) +void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,sal_uLong) { DBG_CHKTHIS(SvListView,0); SvListEntry* pParent = pEntry->pParent; DBG_ASSERT(pParent,"Model not consistent"); if( pParent != pModel->pRootItem && pParent->pChilds->Count() == 1 ) { - SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pParent ); + SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pParent ); pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED); } // vorlaeufig nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } void SvListView::ActionMoved( SvListEntry* /* pEntry */ , SvListEntry* /* pTargetPrnt */ , - ULONG /* nChildPos */ ) + sal_uLong /* nChildPos */ ) { DBG_CHKTHIS(SvListView,0); nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } void SvListView::ActionInserted( SvListEntry* pEntry ) @@ -1864,14 +1864,14 @@ void SvListView::ActionInserted( SvListEntry* pEntry ) SvViewData* pData = CreateViewData( pEntry ); InitViewData( pData, pEntry ); #ifdef DBG_UTIL - BOOL bSuccess = + sal_Bool bSuccess = #endif - aDataTable.Insert( (ULONG)pEntry, pData ); + aDataTable.Insert( (sal_uLong)pEntry, pData ); DBG_ASSERT(bSuccess,"Entry already in View"); if ( nVisibleCount && pModel->IsEntryVisible( this, pEntry )) { nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } } @@ -1881,18 +1881,18 @@ void SvListView::ActionInsertedTree( SvListEntry* pEntry ) if ( pModel->IsEntryVisible( this, pEntry )) { nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } // ueber Entry und seine Childs iterieren SvListEntry* pCurEntry = pEntry; - USHORT nRefDepth = pModel->GetDepth( pCurEntry ); + sal_uInt16 nRefDepth = pModel->GetDepth( pCurEntry ); while( pCurEntry ) { - DBG_ASSERT(aDataTable.Get((ULONG)pCurEntry)==0,"Entry already in Table"); + DBG_ASSERT(aDataTable.Get((sal_uLong)pCurEntry)==0,"Entry already in Table"); SvViewData* pViewData = CreateViewData( pCurEntry ); DBG_ASSERT(pViewData,"No ViewData"); InitViewData( pViewData, pEntry ); - aDataTable.Insert( (ULONG)pCurEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pCurEntry, pViewData ); pCurEntry = pModel->Next( pCurEntry ); if ( pCurEntry && pModel->GetDepth(pCurEntry) <= nRefDepth) pCurEntry = 0; @@ -1907,9 +1907,9 @@ void SvListView::RemoveViewData( SvListEntry* pParent ) SvListEntry* pCur = (SvListEntry*)pChilds->First(); while( pCur ) { - SvViewData* pViewData = (SvViewData*)aDataTable.Get((ULONG)pCur); + SvViewData* pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCur); delete pViewData; - aDataTable.Remove( (ULONG)pCur ); + aDataTable.Remove( (sal_uLong)pCur ); if( pCur->HasChilds()) RemoveViewData( pCur ); pCur = (SvListEntry*)pChilds->Next(); @@ -1924,12 +1924,12 @@ void SvListView::ActionRemoving( SvListEntry* pEntry ) DBG_CHKTHIS(SvListView,0); DBG_ASSERT(pEntry,"Remove:No Entry"); - SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pEntry ); - ULONG nSelRemoved = 0; + SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry ); + sal_uLong nSelRemoved = 0; if ( pViewData->IsSelected() ) nSelRemoved = 1 + pModel->GetChildSelectionCount( this, pEntry ); nSelectionCount -= nSelRemoved; - ULONG nVisibleRemoved = 0; + sal_uLong nVisibleRemoved = 0; if ( pModel->IsEntryVisible( this, pEntry ) ) nVisibleRemoved = 1 + pModel->GetVisibleChildCount( this, pEntry ); if( nVisibleCount ) @@ -1942,18 +1942,18 @@ void SvListView::ActionRemoving( SvListEntry* pEntry ) #endif nVisibleCount -= nVisibleRemoved; } - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; - pViewData = (SvViewData*)aDataTable.Get((ULONG)pEntry); + pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pEntry); delete pViewData; - aDataTable.Remove( (ULONG)pEntry ); + aDataTable.Remove( (sal_uLong)pEntry ); RemoveViewData( pEntry ); SvListEntry* pCurEntry = pEntry->pParent; if ( pCurEntry && pCurEntry != pModel->pRootItem && pCurEntry->pChilds->Count() == 1 ) { - pViewData = (SvViewData*)aDataTable.Get((ULONG)pCurEntry); + pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCurEntry); pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED); } } @@ -1969,8 +1969,8 @@ void SvListView::ActionClear() Clear(); } -void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvListView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uLong nPos ) { DBG_CHKTHIS(SvListView,0); switch( nActionId ) @@ -2010,7 +2010,7 @@ void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, ModelHasEntryInvalidated( pEntry1 ); break; case LISTACTION_RESORTED: - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; break; case LISTACTION_RESORTING: break; @@ -2038,7 +2038,7 @@ StringCompare SvTreeList::Compare( SvListEntry* pLeft, SvListEntry* pRight) cons void SvTreeList::Resort() { Broadcast( LISTACTION_RESORTING ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; ResortChilds( pRootItem ); Broadcast( LISTACTION_RESORTED ); } @@ -2052,11 +2052,11 @@ void SvTreeList::ResortChilds( SvListEntry* pParent ) List aList( *pChildList ); pChildList->Clear(); - ULONG nCount = aList.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = aList.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvListEntry* pCurEntry = (SvListEntry*)aList.GetObject( nCur ); - ULONG nListPos = LIST_APPEND; + sal_uLong nListPos = LIST_APPEND; GetInsertionPos( pCurEntry, pParent, nListPos ); pChildList->Insert( pCurEntry, nListPos ); if( pCurEntry->pChilds ) @@ -2066,7 +2066,7 @@ void SvTreeList::ResortChilds( SvListEntry* pParent ) } void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent, - ULONG& rPos ) + sal_uLong& rPos ) { DBG_ASSERT(pEntry,"No Entry"); diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx index d3ef0c349f08..7231470528d5 100755 --- a/svtools/source/control/asynclink.cxx +++ b/svtools/source/control/asynclink.cxx @@ -42,11 +42,11 @@ void AsynchronLink::CreateMutex() if( !_pMutex ) _pMutex = new vos::OMutex; } -void AsynchronLink::Call( void* pObj, BOOL +void AsynchronLink::Call( void* pObj, sal_Bool #ifdef DBG_UTIL bAllowDoubles #endif -, BOOL bUseTimer ) +, sal_Bool bUseTimer ) { #ifdef DBG_UTIL if ( bUseTimer || !_bInCall ) @@ -92,7 +92,7 @@ AsynchronLink::~AsynchronLink() Application::RemoveUserEvent( _nEventId ); } delete _pTimer; - if( _pDeleted ) *_pDeleted = TRUE; + if( _pDeleted ) *_pDeleted = sal_True; delete _pMutex; } @@ -125,13 +125,13 @@ void AsynchronLink::ClearPendingCall() void AsynchronLink::Call_Impl( void* pArg ) { - _bInCall = TRUE; - BOOL bDeleted = FALSE; + _bInCall = sal_True; + sal_Bool bDeleted = sal_False; _pDeleted = &bDeleted; _aLink.Call( pArg ); if( !bDeleted ) { - _bInCall = FALSE; + _bInCall = sal_False; _pDeleted = 0; } } diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 043d7023508b..17790d1ad4c8 100755 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -62,12 +62,12 @@ #define WEEKNUMBER_HEIGHT 85 -#define CALENDAR_HITTEST_DAY ((USHORT)0x0001) -#define CALENDAR_HITTEST_WEEK ((USHORT)0x0002) -#define CALENDAR_HITTEST_MONTHTITLE ((USHORT)0x0004) -#define CALENDAR_HITTEST_PREV ((USHORT)0x0008) -#define CALENDAR_HITTEST_NEXT ((USHORT)0x0010) -#define CALENDAR_HITTEST_OUTSIDE ((USHORT)0x1000) +#define CALENDAR_HITTEST_DAY ((sal_uInt16)0x0001) +#define CALENDAR_HITTEST_WEEK ((sal_uInt16)0x0002) +#define CALENDAR_HITTEST_MONTHTITLE ((sal_uInt16)0x0004) +#define CALENDAR_HITTEST_PREV ((sal_uInt16)0x0008) +#define CALENDAR_HITTEST_NEXT ((sal_uInt16)0x0010) +#define CALENDAR_HITTEST_OUTSIDE ((sal_uInt16)0x1000) #define MENU_YEAR_COUNT 3 @@ -82,7 +82,7 @@ struct ImplDateInfo XubString maText; Color* mpTextColor; Color* mpFrameColor; - USHORT mnFlags; + sal_uInt16 mnFlags; ImplDateInfo( const XubString& rText ) : maText( rText ) @@ -94,7 +94,7 @@ DECLARE_TABLE( ImplDateTable, ImplDateInfo* ) // ======================================================================= -static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSelect ) +static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, sal_Bool bSelect ) { if ( bSelect ) pTable->Insert( rDate.GetDate(), TABLE_DATE_SELECTED ); @@ -107,7 +107,7 @@ static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSele static void ImplCalendarSelectDateRange( Table* pTable, const Date& rStartDate, const Date& rEndDate, - BOOL bSelect ) + sal_Bool bSelect ) { Date aStartDate = rStartDate; Date aEndDate = rEndDate; @@ -208,24 +208,24 @@ void Calendar::ImplInit( WinBits nWinStyle ) mnFirstYear = 0; mnLastYear = 0; mnRequestYear = 0; - mbCalc = TRUE; - mbFormat = TRUE; - mbDrag = FALSE; - mbSelection = FALSE; - mbMultiSelection = FALSE; - mbWeekSel = FALSE; - mbUnSel = FALSE; - mbMenuDown = FALSE; - mbSpinDown = FALSE; - mbPrevIn = FALSE; - mbNextIn = FALSE; - mbDirect = FALSE; - mbInSelChange = FALSE; - mbTravelSelect = FALSE; - mbScrollDateRange = FALSE; - mbSelLeft = FALSE; - mbAllSel = FALSE; - mbDropPos = FALSE; + mbCalc = sal_True; + mbFormat = sal_True; + mbDrag = sal_False; + mbSelection = sal_False; + mbMultiSelection = sal_False; + mbWeekSel = sal_False; + mbUnSel = sal_False; + mbMenuDown = sal_False; + mbSpinDown = sal_False; + mbPrevIn = sal_False; + mbNextIn = sal_False; + mbDirect = sal_False; + mbInSelChange = sal_False; + mbTravelSelect = sal_False; + mbScrollDateRange = sal_False; + mbSelLeft = sal_False; + mbAllSel = sal_False; + mbDropPos = sal_False; ::rtl::OUString aGregorian( RTL_CONSTASCII_USTRINGPARAM( "gregorian")); maCalendarWrapper.loadCalendar( aGregorian, @@ -252,14 +252,14 @@ void Calendar::ImplInit( WinBits nWinStyle ) } SetFirstDate( maCurDate ); - ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True ); // Sonstige Strings erzeugen maDayText = XubString( SvtResId( STR_SVT_CALENDAR_DAY ) ); maWeekText = XubString( SvtResId( STR_SVT_CALENDAR_WEEK ) ); // Tagestexte anlegen - for ( USHORT i = 0; i < 31; i++ ) + for ( sal_uInt16 i = 0; i < 31; i++ ) mpDayText[i] = new UniString( UniString::CreateFromInt32( i+1 ) ); maDragScrollTimer.SetTimeoutHdl( STATIC_LINK( this, Calendar, ScrollHdl ) ); @@ -338,7 +338,7 @@ Calendar::~Calendar() if ( mpRestoreSelectTable ) delete mpRestoreSelectTable; - for ( USHORT i = 0; i < 31; i++ ) + for ( sal_uInt16 i = 0; i < 31; i++ ) delete mpDayText[i]; } @@ -346,7 +346,7 @@ Calendar::~Calendar() void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays ) { - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); maCalendarWrapper.setMinimumNumberOfDaysForFirstWeek( nDays); } @@ -354,7 +354,7 @@ void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays ) void Calendar::SetWeekStart( sal_Int16 nDay ) { - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); switch (nDay) { case i18n::Weekdays::SUNDAY : @@ -529,23 +529,23 @@ void Calendar::ImplFormat() nDay %= 7; } - mbCalc = FALSE; + mbCalc = sal_False; } // Anzahl Tage berechnen DayOfWeek eStartDay = ImplGetWeekStart(); - USHORT nWeekDay; + sal_uInt16 nWeekDay; Date aTempDate = GetFirstMonth(); maFirstDate = aTempDate; - nWeekDay = (USHORT)aTempDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; - maFirstDate -= (ULONG)nWeekDay; + nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; + maFirstDate -= (sal_uLong)nWeekDay; mnDayCount = nWeekDay; - USHORT nDaysInMonth; - USHORT nMonthCount = (USHORT)(mnMonthPerLine*mnLines); - for ( USHORT i = 0; i < nMonthCount; i++ ) + sal_uInt16 nDaysInMonth; + sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines); + for ( sal_uInt16 i = 0; i < nMonthCount; i++ ) { nDaysInMonth = aTempDate.GetDaysInMonth(); mnDayCount += nDaysInMonth; @@ -555,8 +555,8 @@ void Calendar::ImplFormat() aTempDate2--; nDaysInMonth = aTempDate2.GetDaysInMonth(); aTempDate2 -= nDaysInMonth-1; - nWeekDay = (USHORT)aTempDate2.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; + nWeekDay = (sal_uInt16)aTempDate2.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; mnDayCount += 42-nDaysInMonth-nWeekDay; // Farben festlegen @@ -574,8 +574,8 @@ void Calendar::ImplFormat() } // DateInfo besorgen - USHORT nNewFirstYear = maFirstDate.GetYear(); - USHORT nNewLastYear = GetLastDate().GetYear(); + sal_uInt16 nNewFirstYear = maFirstDate.GetYear(); + sal_uInt16 nNewLastYear = GetLastDate().GetYear(); if ( mnFirstYear ) { if ( nNewFirstYear < mnFirstYear ) @@ -600,12 +600,12 @@ void Calendar::ImplFormat() } mnRequestYear = 0; - mbFormat = FALSE; + mbFormat = sal_False; } // ----------------------------------------------------------------------- -USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const +sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const { if ( mbFormat ) return 0; @@ -619,7 +619,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const long nY; long nOffX; long nYMonth; - USHORT nDay; + sal_uInt16 nDay; DayOfWeek eStartDay = ImplGetWeekStart(); rDate = GetFirstMonth(); @@ -636,7 +636,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const if ( (rPos.X() < nX) && (rPos.Y() < nYMonth) ) return 0; - USHORT nDaysInMonth = rDate.GetDaysInMonth(); + sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth(); // Entsprechender Monat gefunden if ( (rPos.X() > nX) && (rPos.Y() < nYMonth) && @@ -650,8 +650,8 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const long nDayY = nY+mnDaysOffY; if ( rPos.Y() < nDayY ) return 0; - USHORT nDayIndex = (USHORT)rDate.GetDayOfWeek(); - nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7; + sal_uInt16 nDayIndex = (sal_uInt16)rDate.GetDayOfWeek(); + nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7; if ( (i == 0) && (j == 0) ) { Date aTempDate = rDate; @@ -692,9 +692,9 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const } if ( (i == mnLines-1) && (j == mnMonthPerLine-1) ) { - USHORT nWeekDay = (USHORT)rDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; - USHORT nDayCount = 42-nDaysInMonth-nWeekDay; + sal_uInt16 nWeekDay = (sal_uInt16)rDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; + sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay; Date aTempDate = rDate; aTempDate += nDaysInMonth; for ( nDay = 1; nDay <= nDayCount; nDay++ ) @@ -737,7 +737,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const // ----------------------------------------------------------------------- static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect, - BOOL bPrev ) + sal_Bool bPrev ) { long i; long n; @@ -782,7 +782,7 @@ static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect, // ----------------------------------------------------------------------- -void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext ) +void Calendar::ImplDrawSpin( sal_Bool bDrawPrev, sal_Bool bDrawNext ) { if ( !bDrawPrev && !bDrawNext ) return; @@ -796,7 +796,7 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext ) aOutRect.Top() += 3; aOutRect.Right() -= 3; aOutRect.Bottom() -= 3; - ImplDrawSpinArrow( this, aOutRect, TRUE ); + ImplDrawSpinArrow( this, aOutRect, sal_True ); } if ( bDrawNext ) { @@ -805,33 +805,33 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext ) aOutRect.Top() += 3; aOutRect.Right() -= 3; aOutRect.Bottom() -= 3; - ImplDrawSpinArrow( this, aOutRect, FALSE ); + ImplDrawSpinArrow( this, aOutRect, sal_False ); } } // ----------------------------------------------------------------------- void Calendar::ImplDrawDate( long nX, long nY, - USHORT nDay, USHORT nMonth, USHORT nYear, + sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear, DayOfWeek eDayOfWeek, - BOOL bBack, BOOL bOther, ULONG nToday ) + sal_Bool bBack, sal_Bool bOther, sal_uLong nToday ) { ImplDateInfo* pDateInfo; Color* pTextColor = NULL; const String& rDay = *(mpDayText[nDay-1]); Rectangle aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 ); - BOOL bSel = FALSE; - BOOL bFocus = FALSE; + sal_Bool bSel = sal_False; + sal_Bool bFocus = sal_False; // Aktueller Tag if ( (nDay == maCurDate.GetDay()) && (nMonth == maCurDate.GetMonth()) && (nYear == maCurDate.GetYear()) ) - bFocus = TRUE; + bFocus = sal_True; if ( mpSelectTable ) { if ( mpSelectTable->IsKeyValid( Date( nDay, nMonth, nYear ).GetDate() ) ) - bSel = TRUE; + bSel = sal_True; } // Dateinfo ermitteln @@ -869,11 +869,11 @@ void Calendar::ImplDrawDate( long nX, long nY, // Font ermitteln Font aOldFont = GetFont(); - BOOL bBoldFont = FALSE; + sal_Bool bBoldFont = sal_False; if ( (mnWinStyle & WB_BOLDTEXT) && pDateInfo && (pDateInfo->mnFlags & DIB_BOLD) ) { - bBoldFont = TRUE; + bBoldFont = sal_True; Font aFont = aOldFont; if ( aFont.GetWeight() < WEIGHT_BOLD ) aFont.SetWeight( WEIGHT_BOLD ); @@ -965,7 +965,7 @@ void Calendar::ImplDrawDate( long nX, long nY, // ----------------------------------------------------------------------- -void Calendar::ImplDraw( BOOL bPaint ) +void Calendar::ImplDraw( sal_Bool bPaint ) { ImplFormat(); @@ -979,10 +979,10 @@ void Calendar::ImplDraw( BOOL bPaint ) long nDeltaY; long nDayX; long nDayY; - ULONG nToday = Date().GetDate(); - USHORT nDay; - USHORT nMonth; - USHORT nYear; + sal_uLong nToday = Date().GetDate(); + sal_uInt16 nDay; + sal_uInt16 nMonth; + sal_uInt16 nYear; Date aDate = GetFirstMonth(); DayOfWeek eStartDay = ImplGetWeekStart(); @@ -1119,7 +1119,7 @@ void Calendar::ImplDraw( BOOL bPaint ) nDayX -= mnWeekWidth; nDayY = nY+mnDaysOffY; maCalendarWrapper.setGregorianDateTime( aDate); - for ( USHORT nWeekCount = 0; nWeekCount < 6; nWeekCount++ ) + for ( sal_uInt16 nWeekCount = 0; nWeekCount < 6; nWeekCount++ ) { sal_Int16 nWeek = maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); String aWeekText( String::CreateFromInt32( nWeek)); @@ -1133,7 +1133,7 @@ void Calendar::ImplDraw( BOOL bPaint ) } // Tage ausgeben - USHORT nDaysInMonth = aDate.GetDaysInMonth(); + sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); nDayX = nX+mnDaysOffX; nDayY = nY+mnDaysOffY; if ( !bPaint ) @@ -1142,8 +1142,8 @@ void Calendar::ImplDraw( BOOL bPaint ) nDayX+(7*mnDayWidth)-1, nDayY+(6*mnDayHeight)-1 ); Erase( aClearRect ); } - USHORT nDayIndex = (USHORT)aDate.GetDayOfWeek(); - nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7; + sal_uInt16 nDayIndex = (sal_uInt16)aDate.GetDayOfWeek(); + nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7; if ( (i == 0) && (j == 0) ) { Date aTempDate = aDate; @@ -1153,15 +1153,15 @@ void Calendar::ImplDraw( BOOL bPaint ) nDeltaX = nDayX + (nDay*mnDayWidth); ImplDrawDate( nDeltaX, nDayY, nDay+aTempDate.GetDay(), aTempDate.GetMonth(), aTempDate.GetYear(), - (DayOfWeek)((nDay+(USHORT)eStartDay)%7), FALSE, TRUE, nToday ); + (DayOfWeek)((nDay+(sal_uInt16)eStartDay)%7), sal_False, sal_True, nToday ); } } for ( nDay = 1; nDay <= nDaysInMonth; nDay++ ) { nDeltaX = nDayX + (nDayIndex*mnDayWidth); ImplDrawDate( nDeltaX, nDayY, nDay, nMonth, nYear, - (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7), - FALSE, FALSE, nToday ); + (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7), + sal_False, sal_False, nToday ); if ( nDayIndex == 6 ) { nDayIndex = 0; @@ -1172,9 +1172,9 @@ void Calendar::ImplDraw( BOOL bPaint ) } if ( (i == mnLines-1) && (j == mnMonthPerLine-1) ) { - USHORT nWeekDay = (USHORT)aDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; - USHORT nDayCount = 42-nDaysInMonth-nWeekDay; + sal_uInt16 nWeekDay = (sal_uInt16)aDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; + sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay; Date aTempDate = aDate; aTempDate += nDaysInMonth; for ( nDay = 1; nDay <= nDayCount; nDay++ ) @@ -1182,8 +1182,8 @@ void Calendar::ImplDraw( BOOL bPaint ) nDeltaX = nDayX + (nDayIndex*mnDayWidth); ImplDrawDate( nDeltaX, nDayY, nDay, aTempDate.GetMonth(), aTempDate.GetYear(), - (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7), - FALSE, TRUE, nToday ); + (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7), + sal_False, sal_True, nToday ); if ( nDayIndex == 6 ) { nDayIndex = 0; @@ -1215,10 +1215,10 @@ void Calendar::ImplUpdateDate( const Date& rDate ) Rectangle aDateRect( GetDateRect( rDate ) ); if ( !aDateRect.IsEmpty() ) { - BOOL bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth()); + sal_Bool bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth()); ImplDrawDate( aDateRect.Left(), aDateRect.Top(), rDate.GetDay(), rDate.GetMonth(), rDate.GetYear(), - rDate.GetDayOfWeek(), TRUE, bOther ); + rDate.GetDayOfWeek(), sal_True, bOther ); } } } @@ -1229,7 +1229,7 @@ void Calendar::ImplUpdateSelection( Table* pOld ) { Table* pNew = mpSelectTable; void* p; - ULONG nKey; + sal_uLong nKey; p = pOld->First(); while ( p ) @@ -1260,8 +1260,8 @@ void Calendar::ImplUpdateSelection( Table* pOld ) // ----------------------------------------------------------------------- -void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, - BOOL bMove, BOOL bExpand, BOOL bExtended ) +void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest, + sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended ) { Table* pOldSel = new Table( *mpSelectTable ); Date aOldDate = maCurDate; @@ -1297,35 +1297,35 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, { if ( mbSelLeft ) { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False ); } else { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), sal_False ); } } - ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, TRUE ); + ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, sal_True ); } else if ( bExtended && !(mnWinStyle & WB_RANGESELECT) ) { maAnchorDate = aTempDate; if ( IsDateSelected( aTempDate ) ) { - mbUnSel = TRUE; - ImplCalendarSelectDate( mpSelectTable, aTempDate, FALSE ); + mbUnSel = sal_True; + ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_False ); } else { - ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True ); } } else { maAnchorDate = aTempDate; ImplCalendarClearSelectDate( mpSelectTable ); - ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True ); } mpRestoreSelectTable = new Table( *mpSelectTable ); @@ -1334,9 +1334,9 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, else { if ( aTempDate < maCurDate ) - mbSelLeft = TRUE; + mbSelLeft = sal_True; else - mbSelLeft = FALSE; + mbSelLeft = sal_False; if ( !(nHitTest & CALENDAR_HITTEST_DAY) ) aTempDate = maOldCurDate; if ( !bMove ) @@ -1344,19 +1344,19 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, if ( aTempDate != maCurDate ) { maCurDate = aTempDate; - ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE ); - ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False ); + ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True ); } } - BOOL bNewSel = *pOldSel != *mpSelectTable; + sal_Bool bNewSel = *pOldSel != *mpSelectTable; if ( (maCurDate != aOldDate) || bNewSel ) { if ( bNewSel ) { - mbInSelChange = TRUE; + mbInSelChange = sal_True; SelectionChanging(); - mbInSelChange = FALSE; + mbInSelChange = sal_False; } HideFocus(); if ( bNewSel ) @@ -1372,7 +1372,7 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, // ----------------------------------------------------------------------- -void Calendar::ImplUpdate( BOOL bCalcNew ) +void Calendar::ImplUpdate( sal_Bool bCalcNew ) { if ( IsReallyVisible() && IsUpdateMode() ) { @@ -1382,8 +1382,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew ) { if ( mbDirect ) { - mbFormat = TRUE; - ImplDraw( FALSE ); + mbFormat = sal_True; + ImplDraw( sal_False ); return; } else @@ -1392,8 +1392,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew ) } if ( bCalcNew ) - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; } // ----------------------------------------------------------------------- @@ -1408,7 +1408,7 @@ void Calendar::ImplInvertDropPos() // ----------------------------------------------------------------------- -void Calendar::ImplScroll( BOOL bPrev ) +void Calendar::ImplScroll( sal_Bool bPrev ) { Date aNewFirstMonth = GetFirstMonth(); if ( bPrev ) @@ -1418,9 +1418,9 @@ void Calendar::ImplScroll( BOOL bPrev ) } else aNewFirstMonth += aNewFirstMonth.GetDaysInMonth(); - mbDirect = TRUE; + mbDirect = sal_True; SetFirstDate( aNewFirstMonth ); - mbDirect = FALSE; + mbDirect = sal_False; } // ----------------------------------------------------------------------- @@ -1432,12 +1432,12 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) Date aOldFirstDate = GetFirstMonth(); PopupMenu aPopupMenu; PopupMenu* pYearPopupMenus[MENU_YEAR_COUNT]; - USHORT nMonthOff; - USHORT nCurItemId; - USHORT nYear = rDate.GetYear()-1; - USHORT i; - USHORT j; - USHORT nYearIdCount = 1000; + sal_uInt16 nMonthOff; + sal_uInt16 nCurItemId; + sal_uInt16 nYear = rDate.GetYear()-1; + sal_uInt16 i; + sal_uInt16 j; + sal_uInt16 nYearIdCount = 1000; nMonthOff = (rDate.GetYear()-aOldFirstDate.GetYear())*12; if ( aOldFirstDate.GetMonth() < rDate.GetMonth() ) @@ -1458,9 +1458,9 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) nYearIdCount += 1000; } - mbMenuDown = TRUE; + mbMenuDown = sal_True; nCurItemId = aPopupMenu.Execute( this, rPos ); - mbMenuDown = FALSE; + mbMenuDown = sal_False; // Menu zerstoeren aPopupMenu.SetPopupMenu( 2, NULL ); @@ -1472,10 +1472,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) if ( nCurItemId ) { - USHORT nTempMonthOff = nMonthOff % 12; - USHORT nTempYearOff = nMonthOff / 12; - USHORT nNewMonth = nCurItemId % 1000; - USHORT nNewYear = nYear+((nCurItemId-1000)/1000); + sal_uInt16 nTempMonthOff = nMonthOff % 12; + sal_uInt16 nTempYearOff = nMonthOff / 12; + sal_uInt16 nNewMonth = nCurItemId % 1000; + sal_uInt16 nNewYear = nYear+((nCurItemId-1000)/1000); if ( nTempMonthOff < nNewMonth ) nNewMonth = nNewMonth - nTempMonthOff; else @@ -1490,10 +1490,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) // ----------------------------------------------------------------------- -void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat ) +void Calendar::ImplTracking( const Point& rPos, sal_Bool bRepeat ) { Date aTempDate = maCurDate; - USHORT nHitTest = ImplHitTest( rPos, aTempDate ); + sal_uInt16 nHitTest = ImplHitTest( rPos, aTempDate ); if ( mbSpinDown ) { @@ -1502,29 +1502,29 @@ void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat ) if ( bRepeat && (mbPrevIn || mbNextIn) ) { - mbScrollDateRange = TRUE; + mbScrollDateRange = sal_True; ImplScroll( mbPrevIn ); - mbScrollDateRange = FALSE; + mbScrollDateRange = sal_False; } } else - ImplMouseSelect( aTempDate, nHitTest, TRUE, FALSE, FALSE ); + ImplMouseSelect( aTempDate, nHitTest, sal_True, sal_False, sal_False ); } // ----------------------------------------------------------------------- -void Calendar::ImplEndTracking( BOOL bCancel ) +void Calendar::ImplEndTracking( sal_Bool bCancel ) { - BOOL bSelection = mbSelection; - BOOL bSpinDown = mbSpinDown; + sal_Bool bSelection = mbSelection; + sal_Bool bSpinDown = mbSpinDown; - mbDrag = FALSE; - mbSelection = FALSE; - mbMultiSelection = FALSE; - mbUnSel = FALSE; - mbSpinDown = FALSE; - mbPrevIn = FALSE; - mbNextIn = FALSE; + mbDrag = sal_False; + mbSelection = sal_False; + mbMultiSelection = sal_False; + mbUnSel = sal_False; + mbSpinDown = sal_False; + mbPrevIn = sal_False; + mbNextIn = sal_False; if ( bCancel ) { @@ -1553,15 +1553,15 @@ void Calendar::ImplEndTracking( BOOL bCancel ) if ( !bCancel ) { // Feststellen, ob wir sichtbaren Bereich scrollen sollen - ULONG nSelCount = mpSelectTable->Count(); + sal_uLong nSelCount = mpSelectTable->Count(); if ( nSelCount ) { Date aFirstSelDate( mpSelectTable->GetObjectKey( 0 ) ); Date aLastSelDate( mpSelectTable->GetObjectKey( nSelCount-1 ) ); if ( aLastSelDate < GetFirstMonth() ) - ImplScroll( TRUE ); + ImplScroll( sal_True ); else if ( GetLastMonth() < aFirstSelDate ) - ImplScroll( FALSE ); + ImplScroll( sal_False ); } } @@ -1583,13 +1583,13 @@ void Calendar::ImplEndTracking( BOOL bCancel ) IMPL_STATIC_LINK( Calendar, ScrollHdl, Timer*, EMPTYARG ) { - BOOL bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; - BOOL bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0; + sal_Bool bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; + sal_Bool bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0; if( bNextIn || bPrevIn ) { - pThis->mbScrollDateRange = TRUE; + pThis->mbScrollDateRange = sal_True; pThis->ImplScroll( bPrevIn ); - pThis->mbScrollDateRange = FALSE; + pThis->mbScrollDateRange = sal_False; } return 0; } @@ -1601,7 +1601,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.IsLeft() && !mbMenuDown ) { Date aTempDate = maCurDate; - USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate ); + sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate ); if ( nHitTest ) { if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE ) @@ -1614,10 +1614,10 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) mbNextIn = (nHitTest & CALENDAR_HITTEST_NEXT) != 0; if ( mbPrevIn || mbNextIn ) { - mbSpinDown = TRUE; - mbScrollDateRange = TRUE; + mbSpinDown = sal_True; + mbScrollDateRange = sal_True; ImplScroll( mbPrevIn ); - mbScrollDateRange = FALSE; + mbScrollDateRange = sal_False; // Hier muss BUTTONREPEAT stehen, also nicht wieder // auf SCROLLREPEAT aendern, sondern mit TH abklaeren, // warum es evtl. anders sein sollte (71775) @@ -1636,16 +1636,16 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) if ( !mbSelection ) { - mbDrag = TRUE; + mbDrag = sal_True; StartTracking(); } mbMultiSelection = (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT)) != 0; if ( (nHitTest & CALENDAR_HITTEST_DAY) && mbMultiSelection ) - mbWeekSel = TRUE; + mbWeekSel = sal_True; else - mbWeekSel = FALSE; - ImplMouseSelect( aTempDate, nHitTest, FALSE, rMEvt.IsShift(), rMEvt.IsMod1() ); + mbWeekSel = sal_False; + ImplMouseSelect( aTempDate, nHitTest, sal_False, rMEvt.IsShift(), rMEvt.IsMod1() ); } } } @@ -1662,7 +1662,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() && mbSelection ) - ImplEndTracking( FALSE ); + ImplEndTracking( sal_False ); else Control::MouseButtonUp( rMEvt ); } @@ -1672,7 +1672,7 @@ void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) void Calendar::MouseMove( const MouseEvent& rMEvt ) { if ( mbSelection && rMEvt.GetButtons() ) - ImplTracking( rMEvt.GetPosPixel(), FALSE ); + ImplTracking( rMEvt.GetPosPixel(), sal_False ); else Control::MouseMove( rMEvt ); } @@ -1694,9 +1694,9 @@ void Calendar::Tracking( const TrackingEvent& rTEvt ) void Calendar::KeyInput( const KeyEvent& rKEvt ) { Date aNewDate = maCurDate; - BOOL bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0; - BOOL bExpand = rKEvt.GetKeyCode().IsShift(); - BOOL bExtended = rKEvt.GetKeyCode().IsMod1(); + sal_Bool bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0; + sal_Bool bExpand = rKEvt.GetKeyCode().IsShift(); + sal_Bool bExtended = rKEvt.GetKeyCode().IsMod1(); switch ( rKEvt.GetKeyCode().GetCode() ) { @@ -1741,13 +1741,13 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) { if ( !bExpand ) { - BOOL bDateSel = IsDateSelected( maCurDate ); + sal_Bool bDateSel = IsDateSelected( maCurDate ); SelectDate( maCurDate, !bDateSel ); - mbSelLeft = FALSE; + mbSelLeft = sal_False; SelectionChanging(); - mbTravelSelect = TRUE; + mbTravelSelect = sal_True; Select(); - mbTravelSelect = FALSE; + mbTravelSelect = sal_False; } } else @@ -1770,23 +1770,23 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) { if ( mbSelLeft ) { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False ); } else { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), sal_False ); } } - ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, TRUE ); - mbDirect = TRUE; + ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, sal_True ); + mbDirect = sal_True; SetCurDate( aNewDate ); - mbDirect = FALSE; + mbDirect = sal_False; maAnchorDate = aOldAnchorDate; - mbInSelChange = TRUE; + mbInSelChange = sal_True; SelectionChanging(); - mbInSelChange = FALSE; + mbInSelChange = sal_False; ImplUpdateSelection( pOldSel ); delete pOldSel; } @@ -1795,15 +1795,15 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) if ( mnWinStyle & WB_RANGESELECT ) { SetNoSelection(); - SelectDate( aNewDate, TRUE ); + SelectDate( aNewDate, sal_True ); } - mbDirect = TRUE; + mbDirect = sal_True; SetCurDate( aNewDate ); - mbDirect = FALSE; + mbDirect = sal_False; } - mbTravelSelect = TRUE; + mbTravelSelect = sal_True; Select(); - mbTravelSelect = FALSE; + mbTravelSelect = sal_False; } } @@ -1811,7 +1811,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) void Calendar::Paint( const Rectangle& ) { - ImplDraw( TRUE ); + ImplDraw( sal_True ); } // ----------------------------------------------------------------------- @@ -1834,7 +1834,7 @@ void Calendar::LoseFocus() void Calendar::Resize() { - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); Control::Resize(); } @@ -1880,8 +1880,8 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt ) if ( rHEvt.GetMode() & HELPMODE_QUICK ) { maCalendarWrapper.setGregorianDateTime( aDate); - USHORT nWeek = (USHORT) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); - USHORT nMonth = aDate.GetMonth(); + sal_uInt16 nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); + sal_uInt16 nMonth = aDate.GetMonth(); XubString aStr( maDayText ); aStr.AppendAscii( ": " ); aStr.Append( XubString::CreateFromInt32( aDate.GetDayOfYear() ) ); @@ -1918,7 +1918,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) if ( !mbSelection && rCEvt.IsMouseEvent() ) { Date aTempDate = maCurDate; - USHORT nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate ); + sal_uInt16 nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate ); if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE ) { ImplShowMenu( rCEvt.GetMousePosPixel(), aTempDate ); @@ -1936,7 +1936,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) { while ( nNotchDelta < 0 ) { - ImplScroll( TRUE ); + ImplScroll( sal_True ); nNotchDelta++; } } @@ -1944,7 +1944,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) { while ( nNotchDelta > 0 ) { - ImplScroll( FALSE ); + ImplScroll( sal_False ); nNotchDelta--; } } @@ -2019,7 +2019,7 @@ void Calendar::Select() // ----------------------------------------------------------------------- -void Calendar::SelectDate( const Date& rDate, BOOL bSelect ) +void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect ) { if ( !rDate.IsValid() ) return; @@ -2043,7 +2043,7 @@ void Calendar::SelectDate( const Date& rDate, BOOL bSelect ) // ----------------------------------------------------------------------- void Calendar::SelectDateRange( const Date& rStartDate, const Date& rEndDate, - BOOL bSelect ) + sal_Bool bSelect ) { if ( !rStartDate.IsValid() || !rEndDate.IsValid() ) return; @@ -2086,21 +2086,21 @@ void Calendar::SetNoSelection() // ----------------------------------------------------------------------- -BOOL Calendar::IsDateSelected( const Date& rDate ) const +sal_Bool Calendar::IsDateSelected( const Date& rDate ) const { return mpSelectTable->IsKeyValid( rDate.GetDate() ); } // ----------------------------------------------------------------------- -ULONG Calendar::GetSelectDateCount() const +sal_uLong Calendar::GetSelectDateCount() const { return mpSelectTable->Count(); } // ----------------------------------------------------------------------- -Date Calendar::GetSelectDate( ULONG nIndex ) const +Date Calendar::GetSelectDate( sal_uLong nIndex ) const { if ( nIndex < mpSelectTable->Count() ) return Date( mpSelectTable->GetObjectKey( nIndex ) ); @@ -2120,18 +2120,18 @@ void Calendar::SetCurDate( const Date& rNewDate ) if ( maCurDate != rNewDate ) { - BOOL bUpdate = IsVisible() && IsUpdateMode(); + sal_Bool bUpdate = IsVisible() && IsUpdateMode(); Date aOldDate = maCurDate; maCurDate = rNewDate; maAnchorDate = maCurDate; if ( !(mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) ) { - ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE ); - ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False ); + ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True ); } else if ( !HasFocus() ) - bUpdate = FALSE; + bUpdate = sal_False; // Aktuelles Datum noch in den sichtbaren Bereich verschieben if ( mbFormat || (maCurDate < GetFirstMonth()) ) @@ -2176,7 +2176,7 @@ void Calendar::SetFirstDate( const Date& rNewFirstDate ) if ( maFirstDate != rNewFirstDate ) { maFirstDate = Date( 1, rNewFirstDate.GetMonth(), rNewFirstDate.GetYear() ); - mbDropPos = FALSE; + mbDropPos = sal_False; ImplUpdate(); } } @@ -2201,8 +2201,8 @@ Date Calendar::GetFirstMonth() const Date Calendar::GetLastMonth() const { Date aDate = GetFirstMonth(); - USHORT nMonthCount = GetMonthCount(); - for ( USHORT i = 0; i < nMonthCount; i++ ) + sal_uInt16 nMonthCount = GetMonthCount(); + for ( sal_uInt16 i = 0; i < nMonthCount; i++ ) aDate += aDate.GetDaysInMonth(); aDate--; return aDate; @@ -2210,39 +2210,39 @@ Date Calendar::GetLastMonth() const // ----------------------------------------------------------------------- -USHORT Calendar::GetMonthCount() const +sal_uInt16 Calendar::GetMonthCount() const { if ( mbFormat ) return 1; else - return (USHORT)(mnMonthPerLine*mnLines); + return (sal_uInt16)(mnMonthPerLine*mnLines); } // ----------------------------------------------------------------------- -BOOL Calendar::GetDropDate( Date& rDate ) const +sal_Bool Calendar::GetDropDate( Date& rDate ) const { if( mbDropPos ) { rDate = maDropDate; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Calendar::GetDate( const Point& rPos, Date& rDate ) const +sal_Bool Calendar::GetDate( const Point& rPos, Date& rDate ) const { Date aDate = maCurDate; - USHORT nHitTest = ImplHitTest( rPos, aDate ); + sal_uInt16 nHitTest = ImplHitTest( rPos, aDate ); if ( nHitTest & CALENDAR_HITTEST_DAY ) { rDate = aDate; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2256,8 +2256,8 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const long nX; long nY; - ULONG nDaysOff; - USHORT nDayIndex; + sal_uLong nDaysOff; + sal_uInt16 nDayIndex; Date aDate = GetFirstMonth(); if ( rDate < aDate ) @@ -2274,13 +2274,13 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const Date aLastDate = GetLastMonth(); if ( rDate > aLastDate ) { - USHORT nWeekDay = (USHORT)aLastDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)ImplGetWeekStart())) % 7; + sal_uInt16 nWeekDay = (sal_uInt16)aLastDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)ImplGetWeekStart())) % 7; aLastDate -= nWeekDay; aRect = GetDateRect( aLastDate ); nDaysOff = rDate-aLastDate; nDayIndex = 0; - for ( USHORT i = 0; i <= nDaysOff; i++ ) + for ( sal_uInt16 i = 0; i <= nDaysOff; i++ ) { if ( aLastDate == rDate ) { @@ -2307,7 +2307,7 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const nX = 0; for ( long j = 0; j < mnMonthPerLine; j++ ) { - USHORT nDaysInMonth = aDate.GetDaysInMonth(); + sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); // Monat gerufen if ( (aDate.GetMonth() == rDate.GetMonth()) && @@ -2315,9 +2315,9 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const { long nDayX = nX+mnDaysOffX; long nDayY = nY+mnDaysOffY; - nDayIndex = (USHORT)aDate.GetDayOfWeek(); - nDayIndex = (nDayIndex+(7-(USHORT)ImplGetWeekStart())) % 7; - for ( USHORT nDay = 1; nDay <= nDaysInMonth; nDay++ ) + nDayIndex = (sal_uInt16)aDate.GetDayOfWeek(); + nDayIndex = (nDayIndex+(7-(sal_uInt16)ImplGetWeekStart())) % 7; + for ( sal_uInt16 nDay = 1; nDay <= nDaysInMonth; nDay++ ) { if ( nDay == rDate.GetDay() ) { @@ -2384,13 +2384,13 @@ void Calendar::SetSundayColor( const Color& rColor ) void Calendar::AddDateInfo( const Date& rDate, const String& rText, const Color* pTextColor, const Color* pFrameColor, - USHORT nFlags ) + sal_uInt16 nFlags ) { if ( !mpDateTable ) mpDateTable = new ImplDateTable( 256, 256 ); - BOOL bChanged = FALSE; - ULONG nKey = rDate.GetDate(); + sal_Bool bChanged = sal_False; + sal_uLong nKey = rDate.GetDate(); ImplDateInfo* pDateInfo = mpDateTable->Get( nKey ); if ( pDateInfo ) pDateInfo->maText = rText; @@ -2406,13 +2406,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, if ( *(pDateInfo->mpTextColor) != *pTextColor ) { *(pDateInfo->mpTextColor) = *pTextColor; - bChanged = TRUE; + bChanged = sal_True; } } else { pDateInfo->mpTextColor = new Color( *pTextColor ); - bChanged = TRUE; + bChanged = sal_True; } } else @@ -2421,7 +2421,7 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, { delete pDateInfo->mpTextColor; pDateInfo->mpTextColor = NULL; - bChanged = TRUE; + bChanged = sal_True; } } if ( pFrameColor ) @@ -2431,13 +2431,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, if ( *(pDateInfo->mpFrameColor) != *pFrameColor ) { *(pDateInfo->mpFrameColor) = *pFrameColor; - bChanged = TRUE; + bChanged = sal_True; } } else { pDateInfo->mpFrameColor = new Color( *pFrameColor ); - bChanged = TRUE; + bChanged = sal_True; } } else @@ -2446,13 +2446,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, { delete pDateInfo->mpFrameColor; pDateInfo->mpFrameColor = NULL; - bChanged = TRUE; + bChanged = sal_True; } } if ( pDateInfo->mnFlags != nFlags ) { pDateInfo->mnFlags = nFlags; - bChanged = TRUE; + bChanged = sal_True; } if ( bChanged ) @@ -2483,7 +2483,7 @@ void Calendar::ClearDateInfo() ImplDateInfo* pDateInfo = mpDateTable->First(); while ( pDateInfo ) { - ULONG nKey = mpDateTable->GetCurKey(); + sal_uLong nKey = mpDateTable->GetCurKey(); mpDateTable->Remove( nKey ); Date aDate( nKey ); ImplUpdateDate( aDate ); @@ -2502,7 +2502,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate ) XubString aRet; if ( mpDateTable ) { - ULONG nKey = rDate.GetDate(); + sal_uLong nKey = rDate.GetDate(); ImplDateInfo* pDateInfo = mpDateTable->Get( nKey ); if ( pDateInfo ) aRet = pDateInfo->maText; @@ -2512,7 +2512,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate ) // ----------------------------------------------------------------------- -BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate ) +sal_Bool Calendar::ShowDropPos( const Point& rPos, Date& rDate ) { Date aTempDate = maCurDate; mnDragScrollHitTest = ImplHitTest( rPos, aTempDate ); @@ -2534,12 +2534,12 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate ) if( mbDropPos ) ImplInvertDropPos(); maDropDate = aTempDate; - mbDropPos = TRUE; + mbDropPos = sal_True; ImplInvertDropPos(); } rDate = maDropDate; - return TRUE; + return sal_True; } } } @@ -2547,7 +2547,7 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate ) maDragScrollTimer.Stop(); HideDropPos(); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2557,7 +2557,7 @@ void Calendar::HideDropPos() if ( mbDropPos ) { ImplInvertDropPos(); - mbDropPos = FALSE; + mbDropPos = sal_False; } } @@ -2570,7 +2570,7 @@ void Calendar::StartSelection() maOldCurDate = maCurDate; mpOldSelectTable = new Table( *mpSelectTable ); - mbSelection = TRUE; + mbSelection = sal_True; } // ----------------------------------------------------------------------- @@ -2582,12 +2582,12 @@ void Calendar::EndSelection() if ( !mbSelection ) ReleaseMouse(); - mbDrag = FALSE; - mbSelection = FALSE; - mbMultiSelection = FALSE; - mbSpinDown = FALSE; - mbPrevIn = FALSE; - mbNextIn = FALSE; + mbDrag = sal_False; + mbSelection = sal_False; + mbMultiSelection = sal_False; + mbSpinDown = sal_False; + mbPrevIn = sal_False; + mbNextIn = sal_False; } } @@ -2668,8 +2668,8 @@ public: void SetCalendar( Calendar* pCalendar ) { mpCalendar = pCalendar; } - PushButton* EnableTodayBtn( BOOL bEnable ); - PushButton* EnableNoneBtn( BOOL bEnable ); + PushButton* EnableTodayBtn( sal_Bool bEnable ); + PushButton* EnableNoneBtn( sal_Bool bEnable ); void ArrangeButtons(); long Notify( NotifyEvent& rNEvt ); @@ -2697,7 +2697,7 @@ ImplCFieldFloatWin::~ImplCFieldFloatWin() // ----------------------------------------------------------------------- -PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable ) +PushButton* ImplCFieldFloatWin::EnableTodayBtn( sal_Bool bEnable ) { if ( bEnable ) { @@ -2729,7 +2729,7 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable ) // ----------------------------------------------------------------------- -PushButton* ImplCFieldFloatWin::EnableNoneBtn( BOOL bEnable ) +PushButton* ImplCFieldFloatWin::EnableNoneBtn( sal_Bool bEnable ) { if ( bEnable ) { @@ -2848,8 +2848,8 @@ CalendarField::CalendarField( Window* pParent, WinBits nWinStyle ) : mpFloatWin = NULL; mpCalendar = NULL; mnCalendarStyle = 0; - mbToday = FALSE; - mbNone = FALSE; + mbToday = sal_False; + mbNone = sal_False; } // ----------------------------------------------------------------------- @@ -2861,8 +2861,8 @@ CalendarField::CalendarField( Window* pParent, const ResId& rResId ) : mpFloatWin = NULL; mpCalendar = NULL; mnCalendarStyle = 0; - mbToday = FALSE; - mbNone = FALSE; + mbToday = sal_False; + mbNone = sal_False; } // ----------------------------------------------------------------------- @@ -2948,7 +2948,7 @@ void CalendarField::Select() // ----------------------------------------------------------------------- -BOOL CalendarField::ShowDropDown( BOOL bShow ) +sal_Bool CalendarField::ShowDropDown( sal_Bool bShow ) { if ( bShow ) { @@ -2993,7 +2993,7 @@ BOOL CalendarField::ShowDropDown( BOOL bShow ) mpCalendar->EndSelection(); EndDropDown(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 91c446a880a9..219b5428edeb 100755 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -59,10 +59,10 @@ static sal_Unicode aImplStarSymbolText[] = {0x2706,0x2704,0x270D,0xE033,0x2211,0 struct ImplColorListData { Color aColor; - BOOL bColor; + sal_Bool bColor; - ImplColorListData() : aColor( COL_BLACK ) { bColor = FALSE; } - ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = TRUE; } + ImplColorListData() : aColor( COL_BLACK ) { bColor = sal_False; } + ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = sal_True; } }; DECLARE_LIST( ImpColorList, ImplColorListData* ) @@ -76,7 +76,7 @@ void ColorListBox::ImplInit() aImageSize.Height() = GetTextHeight(); aImageSize.Height() -= 2; - EnableUserDraw( TRUE ); + EnableUserDraw( sal_True ); SetUserItemSize( aImageSize ); } @@ -84,7 +84,7 @@ void ColorListBox::ImplInit() void ColorListBox::ImplDestroyColorEntries() { - for ( USHORT n = (USHORT) pColorList->Count(); n; ) + for ( sal_uInt16 n = (sal_uInt16) pColorList->Count(); n; ) { ImplColorListData* pData = pColorList->GetObject( --n ); delete pData; @@ -118,7 +118,7 @@ ColorListBox::~ColorListBox() // ----------------------------------------------------------------------- -USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos ) +sal_uInt16 ColorListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos ) { nPos = ListBox::InsertEntry( rStr, nPos ); if ( nPos != LISTBOX_ERROR ) @@ -131,8 +131,8 @@ USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos ) // ----------------------------------------------------------------------- -USHORT ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr, - USHORT nPos ) +sal_uInt16 ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr, + sal_uInt16 nPos ) { nPos = ListBox::InsertEntry( rStr, nPos ); if ( nPos != LISTBOX_ERROR ) @@ -153,7 +153,7 @@ void ColorListBox::InsertAutomaticEntry() // ----------------------------------------------------------------------- -void ColorListBox::RemoveEntry( USHORT nPos ) +void ColorListBox::RemoveEntry( sal_uInt16 nPos ) { ListBox::RemoveEntry( nPos ); delete pColorList->Remove( nPos ); @@ -175,11 +175,11 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox ) ImplDestroyColorEntries(); // Daten kopieren - USHORT nCount = (USHORT) rBox.pColorList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16) rBox.pColorList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { ImplColorListData* pData = rBox.pColorList->GetObject( n ); - USHORT nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND ); + sal_uInt16 nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND ); if ( nPos != LISTBOX_ERROR ) pColorList->Insert( new ImplColorListData( *pData ), nPos ); } @@ -187,9 +187,9 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox ) // ----------------------------------------------------------------------- -USHORT ColorListBox::GetEntryPos( const Color& rColor ) const +sal_uInt16 ColorListBox::GetEntryPos( const Color& rColor ) const { - for( USHORT n = (USHORT) pColorList->Count(); n; ) + for( sal_uInt16 n = (sal_uInt16) pColorList->Count(); n; ) { ImplColorListData* pData = pColorList->GetObject( --n ); if ( pData->bColor && ( pData->aColor == rColor ) ) @@ -200,7 +200,7 @@ USHORT ColorListBox::GetEntryPos( const Color& rColor ) const // ----------------------------------------------------------------------- -Color ColorListBox::GetEntryColor( USHORT nPos ) const +Color ColorListBox::GetEntryColor( sal_uInt16 nPos ) const { Color aColor; ImplColorListData* pData = pColorList->GetObject( nPos ); @@ -226,13 +226,13 @@ void ColorListBox::UserDraw( const UserDrawEvent& rUDEvt ) rUDEvt.GetDevice()->SetLineColor( rUDEvt.GetDevice()->GetTextColor() ); rUDEvt.GetDevice()->DrawRect( Rectangle( aPos, aImageSize ) ); rUDEvt.GetDevice()->Pop(); - ListBox::DrawEntry( rUDEvt, FALSE, TRUE, FALSE ); + ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_False ); } else - ListBox::DrawEntry( rUDEvt, FALSE, TRUE, TRUE ); + ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_True ); } else - ListBox::DrawEntry( rUDEvt, TRUE, TRUE, FALSE ); + ListBox::DrawEntry( rUDEvt, sal_True, sal_True, sal_False ); } // ======================================================================= @@ -385,8 +385,8 @@ LineListBox::LineListBox( Window* pParent, const ResId& rResId ) : LineListBox::~LineListBox() { - ULONG n = 0; - ULONG nCount = pLineList->Count(); + sal_uLong n = 0; + sal_uLong nCount = pLineList->Count(); while ( n < nCount ) { ImpLineListData* pData = pLineList->GetObject( n ); @@ -399,7 +399,7 @@ LineListBox::~LineListBox() // ----------------------------------------------------------------------- -USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos ) +sal_uInt16 LineListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos ) { nPos = ListBox::InsertEntry( rStr, nPos ); if ( nPos != LISTBOX_ERROR ) @@ -409,8 +409,8 @@ USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos ) // ----------------------------------------------------------------------- -USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance, - USHORT nPos ) +sal_uInt16 LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance, + sal_uInt16 nPos ) { XubString aStr; Bitmap aBmp; @@ -430,7 +430,7 @@ USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance, // ----------------------------------------------------------------------- -void LineListBox::RemoveEntry( USHORT nPos ) +void LineListBox::RemoveEntry( sal_uInt16 nPos ) { ListBox::RemoveEntry( nPos ); ImpLineListData* pData = pLineList->Remove( nPos ); @@ -442,8 +442,8 @@ void LineListBox::RemoveEntry( USHORT nPos ) void LineListBox::Clear() { - ULONG n = 0; - ULONG nCount = pLineList->Count(); + sal_uLong n = 0; + sal_uLong nCount = pLineList->Count(); while ( n < nCount ) { ImpLineListData* pData = pLineList->GetObject( n ); @@ -458,11 +458,11 @@ void LineListBox::Clear() // ----------------------------------------------------------------------- -USHORT LineListBox::GetEntryPos( long nLine1, long nLine2, +sal_uInt16 LineListBox::GetEntryPos( long nLine1, long nLine2, long nDistance ) const { - ULONG n = 0; - ULONG nCount = pLineList->Count(); + sal_uLong n = 0; + sal_uLong nCount = pLineList->Count(); while ( n < nCount ) { ImpLineListData* pData = pLineList->GetObject( n ); @@ -471,7 +471,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2, if ( (pData->nLine1 == nLine1) && (pData->nLine2 == nLine2) && (pData->nDistance == nDistance) ) - return (USHORT)n; + return (sal_uInt16)n; } n++; @@ -482,7 +482,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2, // ----------------------------------------------------------------------- -long LineListBox::GetEntryLine1( USHORT nPos ) const +long LineListBox::GetEntryLine1( sal_uInt16 nPos ) const { ImpLineListData* pData = pLineList->GetObject( nPos ); if ( pData ) @@ -493,7 +493,7 @@ long LineListBox::GetEntryLine1( USHORT nPos ) const // ----------------------------------------------------------------------- -long LineListBox::GetEntryLine2( USHORT nPos ) const +long LineListBox::GetEntryLine2( sal_uInt16 nPos ) const { ImpLineListData* pData = pLineList->GetObject( nPos ); if ( pData ) @@ -504,7 +504,7 @@ long LineListBox::GetEntryLine2( USHORT nPos ) const // ----------------------------------------------------------------------- -long LineListBox::GetEntryDistance( USHORT nPos ) const +long LineListBox::GetEntryDistance( sal_uInt16 nPos ) const { ImpLineListData* pData = pLineList->GetObject( nPos ); if ( pData ) @@ -519,7 +519,7 @@ void LineListBox::UpdateLineColors( void ) { if( UpdatePaintLineColor() ) { - ULONG nCount = pLineList->Count(); + sal_uLong nCount = pLineList->Count(); if( !nCount ) return; @@ -527,34 +527,34 @@ void LineListBox::UpdateLineColors( void ) Bitmap aBmp; // exchange entries which containing lines - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); - USHORT nSelEntry = GetSelectEntryPos(); - for( ULONG n = 0 ; n < nCount ; ++n ) + sal_uInt16 nSelEntry = GetSelectEntryPos(); + for( sal_uLong n = 0 ; n < nCount ; ++n ) { ImpLineListData* pData = pLineList->GetObject( n ); if( pData ) { // exchange listbox data - ListBox::RemoveEntry( USHORT( n ) ); + ListBox::RemoveEntry( sal_uInt16( n ) ); ImpGetLine( pData->nLine1, pData->nLine2, pData->nDistance, aBmp, aStr ); - ListBox::InsertEntry( aStr, aBmp, USHORT( n ) ); + ListBox::InsertEntry( aStr, aBmp, sal_uInt16( n ) ); } } if( nSelEntry != LISTBOX_ENTRY_NOTFOUND ) SelectEntryPos( nSelEntry ); - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); Invalidate(); } } // ----------------------------------------------------------------------- -BOOL LineListBox::UpdatePaintLineColor( void ) +sal_Bool LineListBox::UpdatePaintLineColor( void ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Color aNewCol( rSettings.GetWindowColor().IsDark()? rSettings.GetLabelTextColor() : aColor ); @@ -583,10 +583,10 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt ) struct ImplFontNameListData { FontInfo maInfo; - USHORT mnType; + sal_uInt16 mnType; ImplFontNameListData( const FontInfo& rInfo, - USHORT nType ) : + sal_uInt16 nType ) : maInfo( rInfo ), mnType( nType ) {} @@ -601,8 +601,8 @@ FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) : { InitBitmaps(); mpFontList = NULL; - mbWYSIWYG = FALSE; - mbSymbols = FALSE; + mbWYSIWYG = sal_False; + mbSymbols = sal_False; } // ------------------------------------------------------------------- @@ -612,8 +612,8 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) : { InitBitmaps(); mpFontList = NULL; - mbWYSIWYG = FALSE; - mbSymbols = FALSE; + mbWYSIWYG = sal_False; + mbSymbols = sal_False; } // ------------------------------------------------------------------- @@ -637,7 +637,7 @@ void FontNameBox::DataChanged( const DataChangedEvent& rDCEvt ) void FontNameBox::InitBitmaps( void ) { - BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); maImagePrinterFont = Image( SvtResId( bHC? RID_IMG_PRINTERFONT_HC : RID_IMG_PRINTERFONT ) ); maImageBitmapFont = Image( SvtResId( bHC? RID_IMG_BITMAPFONT_HC : RID_IMG_BITMAPFONT ) ); @@ -672,14 +672,14 @@ void FontNameBox::Fill( const FontList* pList ) mpFontList = new ImplFontList; // insert fonts - USHORT nFontCount = pList->GetFontNameCount(); - for ( USHORT i = 0; i < nFontCount; i++ ) + sal_uInt16 nFontCount = pList->GetFontNameCount(); + for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { const FontInfo& rFontInfo = pList->GetFontName( i ); - ULONG nIndex = InsertEntry( rFontInfo.GetName() ); + sal_uLong nIndex = InsertEntry( rFontInfo.GetName() ); if ( nIndex != LISTBOX_ERROR ) { - USHORT nType = pList->GetFontNameType( i ); + sal_uInt16 nType = pList->GetFontNameType( i ); ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType ); mpFontList->Insert( pData, nIndex ); } @@ -694,7 +694,7 @@ void FontNameBox::Fill( const FontList* pList ) // ------------------------------------------------------------------- -void FontNameBox::EnableWYSIWYG( BOOL bEnable ) +void FontNameBox::EnableWYSIWYG( sal_Bool bEnable ) { if ( bEnable != mbWYSIWYG ) { @@ -706,7 +706,7 @@ void FontNameBox::EnableWYSIWYG( BOOL bEnable ) // ------------------------------------------------------------------- -void FontNameBox::EnableSymbols( BOOL bEnable ) +void FontNameBox::EnableSymbols( sal_Bool bEnable ) { if ( bEnable != mbSymbols ) { @@ -723,21 +723,21 @@ void FontNameBox::ImplCalcUserItemSize() Size aUserItemSz; if ( mbWYSIWYG && mpFontList ) { - USHORT nMaxLen = 0; - BOOL bSymbolFont = FALSE; - BOOL bStarSymbol = FALSE; - for ( USHORT n = GetEntryCount(); n; ) + sal_uInt16 nMaxLen = 0; + sal_Bool bSymbolFont = sal_False; + sal_Bool bStarSymbol = sal_False; + for ( sal_uInt16 n = GetEntryCount(); n; ) { ImplFontNameListData* pData = mpFontList->GetObject( --n ); XubString aFontName = pData->maInfo.GetName(); if ( aFontName.Len() > nMaxLen ) nMaxLen = aFontName.Len(); if ( pData->maInfo.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) - bSymbolFont = TRUE; + bSymbolFont = sal_True; // starsymbol is a unicode font, but gets WYSIWIG symbols if( aFontName.EqualsIgnoreCaseAscii( "starsymbol" ) || aFontName.EqualsIgnoreCaseAscii( "opensymbol" ) ) - bSymbolFont = bStarSymbol = TRUE; + bSymbolFont = bStarSymbol = sal_True; } // guess maximimum width @@ -775,7 +775,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) { ImplFontNameListData* pData = mpFontList->GetObject( rUDEvt.GetItemId() ); const FontInfo& rInfo = pData->maInfo; - USHORT nType = pData->mnType; + sal_uInt16 nType = pData->mnType; Point aTopLeft = rUDEvt.GetRect().TopLeft(); long nX = aTopLeft.X(); long nH = rUDEvt.GetRect().GetHeight(); @@ -887,11 +887,11 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) rUDEvt.GetDevice()->DrawText( aPos, aString ); rUDEvt.GetDevice()->SetFont( aOldFont ); - DrawEntry( rUDEvt, FALSE, FALSE); // draw seperator + DrawEntry( rUDEvt, sal_False, sal_False); // draw seperator } else { - DrawEntry( rUDEvt, TRUE, TRUE ); + DrawEntry( rUDEvt, sal_True, sal_True ); } } @@ -943,12 +943,12 @@ void FontStyleBox::Modify() CharClass aChrCls( ::comphelper::getProcessServiceFactory(), GetSettings().GetLocale() ); XubString aStr = GetText(); - USHORT nEntryCount = GetEntryCount(); + sal_uInt16 nEntryCount = GetEntryCount(); if ( GetEntryPos( aStr ) == COMBOBOX_ENTRY_NOTFOUND ) { aChrCls.toUpper( aStr ); - for ( USHORT i = 0; i < nEntryCount; i++ ) + for ( sal_uInt16 i = 0; i < nEntryCount; i++ ) { XubString aEntryText = GetEntry( i ); aChrCls.toUpper( aEntryText ); @@ -972,7 +972,7 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) // else aLastStyle will overwritten // store prior selection position and clear box XubString aOldText = GetText(); - USHORT nPos = GetEntryPos( aOldText ); + sal_uInt16 nPos = GetEntryPos( aOldText ); Clear(); // does a font with this name already exist? @@ -983,11 +983,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) FontWeight eLastWeight = WEIGHT_DONTKNOW; FontItalic eLastItalic = ITALIC_NONE; FontWidth eLastWidth = WIDTH_DONTKNOW; - BOOL bNormal = FALSE; - BOOL bItalic = FALSE; - BOOL bBold = FALSE; - BOOL bBoldItalic = FALSE; - BOOL bInsert = FALSE; + sal_Bool bNormal = sal_False; + sal_Bool bItalic = sal_False; + sal_Bool bBold = sal_False; + sal_Bool bBoldItalic = sal_False; + sal_Bool bInsert = sal_False; FontInfo aInfo; while ( hFontInfo ) { @@ -1007,16 +1007,16 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) if ( eWeight <= WEIGHT_NORMAL ) { if ( eItalic != ITALIC_NONE ) - bItalic = TRUE; + bItalic = sal_True; else - bNormal = TRUE; + bNormal = sal_True; } else { if ( eItalic != ITALIC_NONE ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; else - bBold = TRUE; + bBold = sal_True; } // For wrong StyleNames we replace this with the correct once @@ -1050,11 +1050,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) } if ( !bItalic && (aStyleText == pList->GetItalicStr()) ) - bItalic = TRUE; + bItalic = sal_True; else if ( !bBold && (aStyleText == pList->GetBoldStr()) ) - bBold = TRUE; + bBold = sal_True; else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; hFontInfo = pList->GetNextFontInfo( hFontInfo ); } @@ -1133,15 +1133,15 @@ FontSizeBox::~FontSizeBox() void FontSizeBox::ImplInit() { - EnableAutocomplete( FALSE ); + EnableAutocomplete( sal_False ); - bRelativeMode = FALSE; - bPtRelative = FALSE; - bRelative = FALSE; - bStdSize = FALSE; + bRelativeMode = sal_False; + bPtRelative = sal_False; + bRelative = sal_False; + bStdSize = sal_False; pFontList = NULL; - SetShowTrailingZeros( FALSE ); + SetShowTrailingZeros( sal_False ); SetDecimalDigits( 1 ); SetMin( 20 ); SetMax( 9999 ); @@ -1177,24 +1177,24 @@ void FontSizeBox::Modify() XubString aStr = GetText(); aStr.EraseLeadingChars(); - BOOL bNewMode = bRelative; - BOOL bOldPtRelMode = bPtRelative; + sal_Bool bNewMode = bRelative; + sal_Bool bOldPtRelMode = bPtRelative; if ( bRelative ) { - bPtRelative = FALSE; + bPtRelative = sal_False; const xub_Unicode* pStr = aStr.GetBuffer(); while ( *pStr ) { if ( ((*pStr < '0') || (*pStr > '9')) && (*pStr != '%') ) { if ( ('-' == *pStr || '+' == *pStr) && !bPtRelative ) - bPtRelative = TRUE; + bPtRelative = sal_True; else if ( bPtRelative && 'p' == *pStr && 't' == *++pStr ) ; else { - bNewMode = FALSE; + bNewMode = sal_False; break; } } @@ -1205,14 +1205,14 @@ void FontSizeBox::Modify() { if ( STRING_NOTFOUND != aStr.Search( '%' ) ) { - bNewMode = TRUE; - bPtRelative = FALSE; + bNewMode = sal_True; + bPtRelative = sal_False; } if ( '-' == aStr.GetChar( 0 ) || '+' == aStr.GetChar( 0 ) ) { - bNewMode = TRUE; - bPtRelative = TRUE; + bNewMode = sal_True; + bPtRelative = sal_True; } } @@ -1253,24 +1253,24 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) // for standard sizes we don't need to bother if ( bStdSize && GetEntryCount() && aFontSizeNames.IsEmpty() ) return; - bStdSize = TRUE; + bStdSize = sal_True; } else - bStdSize = FALSE; + bStdSize = sal_False; Selection aSelection = GetSelection(); XubString aStr = GetText(); Clear(); - USHORT nPos = 0; + sal_uInt16 nPos = 0; if ( !aFontSizeNames.IsEmpty() ) { if ( pAry == pList->GetStdSizeAry() ) { // for scalable fonts all font size names - ULONG nCount = aFontSizeNames.Count(); - for( ULONG i = 0; i < nCount; i++ ) + sal_uLong nCount = aFontSizeNames.Count(); + for( sal_uLong i = 0; i < nCount; i++ ) { String aSizeName = aFontSizeNames.GetIndexName( i ); long nSize = aFontSizeNames.GetIndexSize( i ); @@ -1313,9 +1313,9 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) // ----------------------------------------------------------------------- -void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep ) +void FontSizeBox::EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep ) { - bRelativeMode = TRUE; + bRelativeMode = sal_True; nRelMin = nMin; nRelMax = nMax; nRelStep = nStep; @@ -1326,7 +1326,7 @@ void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep ) void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep ) { - bRelativeMode = TRUE; + bRelativeMode = sal_True; nPtRelMin = nMin; nPtRelMax = nMax; nPtRelStep = nStep; @@ -1335,7 +1335,7 @@ void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep ) // ----------------------------------------------------------------------- -void FontSizeBox::SetRelative( BOOL bNewRelative ) +void FontSizeBox::SetRelative( sal_Bool bNewRelative ) { if ( bRelativeMode ) { @@ -1345,8 +1345,8 @@ void FontSizeBox::SetRelative( BOOL bNewRelative ) if ( bNewRelative ) { - bRelative = TRUE; - bStdSize = FALSE; + bRelative = sal_True; + bStdSize = sal_False; if ( bPtRelative ) { @@ -1374,7 +1374,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative ) SetUnit( FUNIT_CUSTOM ); Clear(); - USHORT i = nRelMin; + sal_uInt16 i = nRelMin; while ( i <= nRelMax ) { InsertValue( i ); @@ -1384,7 +1384,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative ) } else { - bRelative = bPtRelative = FALSE; + bRelative = bPtRelative = sal_False; SetDecimalDigits( 1 ); SetMin( 20 ); SetMax( 9999 ); @@ -1424,7 +1424,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit ) mnLastValue = nTempValue; SetText( aName ); mnFieldValue = mnLastValue; - SetEmptyFieldValueData( FALSE ); + SetEmptyFieldValueData( sal_False ); return; } } @@ -1441,7 +1441,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue ) // ----------------------------------------------------------------------- -sal_Int64 FontSizeBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const +sal_Int64 FontSizeBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const { if ( !bRelative ) { diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index 979a8a3a3d32..1314f416eec6 100755 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -115,7 +115,7 @@ class ImplFontListNameInfo private: XubString maSearchName; ImplFontListFontInfo* mpFirst; - USHORT mnType; + sal_uInt16 mnType; ImplFontListNameInfo( const XubString& rSearchName ) : maSearchName( rSearchName ) @@ -163,7 +163,7 @@ static void ImplMakeSearchStringFromName( XubString& rStr ) // ----------------------------------------------------------------------- -ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* pIndex ) const +ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const { // Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als // der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem @@ -171,7 +171,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p // und somit die Wahrscheinlichkeit das hinten angehaengt werden muss // sehr gross ist. StringCompare eComp; - ULONG nCnt = Count(); + sal_uLong nCnt = Count(); if ( !nCnt ) { if ( pIndex ) @@ -195,9 +195,9 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p // Fonts in der Liste suchen ImplFontListNameInfo* pCompareData; ImplFontListNameInfo* pFoundData = NULL; - ULONG nLow = 0; - ULONG nHigh = nCnt-1; - ULONG nMid; + sal_uLong nLow = 0; + sal_uLong nHigh = nCnt-1; + sal_uLong nMid; do { @@ -246,12 +246,12 @@ ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const // ----------------------------------------------------------------------- -void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, - BOOL bInsertData ) +void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll, + sal_Bool bInsertData ) { rtl_TextEncoding eSystemEncoding = gsl_getSystemTextEncoding(); - USHORT nType; + sal_uInt16 nType; if ( pDevice->GetOutDevType() != OUTDEV_PRINTER ) nType = FONTLIST_FONTNAMETYPE_SCREEN; else @@ -259,7 +259,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, // Alle Fonts vom Device abfragen int n = pDevice->GetDevFontCount(); - USHORT i; + sal_uInt16 i; for( i = 0; i < n; i++ ) { FontInfo aFontInfo = pDevice->GetDevFont( i ); @@ -271,7 +271,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, XubString aSearchName = aFontInfo.GetName(); ImplFontListNameInfo* pData; - ULONG nIndex; + sal_uLong nIndex; ImplMakeSearchString( aSearchName ); pData = ImplFind( aSearchName, &nIndex ); @@ -291,7 +291,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, { if ( bInsertData ) { - BOOL bInsert = TRUE; + sal_Bool bInsert = sal_True; ImplFontListFontInfo* pPrev = NULL; ImplFontListFontInfo* pTemp = pData->mpFirst; ImplFontListFontInfo* pNewInfo = new ImplFontListFontInfo( aFontInfo, pDevice ); @@ -312,7 +312,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, pTemp->mpNext = pTemp2; } delete pNewInfo; - bInsert = FALSE; + bInsert = sal_False; } break; @@ -344,8 +344,8 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, // ======================================================================= -FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) : - List( 4096, sal::static_int_cast< USHORT >(pDevice->GetDevFontCount()), 32 ) +FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, sal_Bool bAll ) : + List( 4096, sal::static_int_cast< sal_uInt16 >(pDevice->GetDevFontCount()), 32 ) { // Variablen initialisieren mpDev = pDevice; @@ -362,14 +362,14 @@ FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) : maBlack = XubString( SvtResId( STR_SVT_STYLE_BLACK ) ); maBlackItalic = XubString( SvtResId( STR_SVT_STYLE_BLACK_ITALIC ) ); - ImplInsertFonts( pDevice, bAll, TRUE ); + ImplInsertFonts( pDevice, bAll, sal_True ); // Gegebenenfalls muessen wir mit den Bildschirmfonts vergleichen, // damit dort die eigentlich doppelten auf Equal mappen koennen - BOOL bCompareWindow = FALSE; + sal_Bool bCompareWindow = sal_False; if ( !pDevice2 && (pDevice->GetOutDevType() == OUTDEV_PRINTER) ) { - bCompareWindow = TRUE; + bCompareWindow = sal_True; pDevice2 = Application::GetDefaultDevice(); } @@ -527,12 +527,12 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const } // search for synthetic style - USHORT nType = pData->mnType; + sal_uInt16 nType = pData->mnType; const XubString& rStyleName = rInfo.GetStyleName(); if ( rStyleName.Len() ) { - BOOL bNotSynthetic = FALSE; - BOOL bNoneAvailable = FALSE; + sal_Bool bNotSynthetic = sal_False; + sal_Bool bNoneAvailable = sal_False; FontWeight eWeight = rInfo.GetWeight(); FontItalic eItalic = rInfo.GetItalic(); ImplFontListFontInfo* pFontInfo = pData->mpFirst; @@ -541,7 +541,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const if ( (eWeight == pFontInfo->GetWeight()) && (eItalic == pFontInfo->GetItalic()) ) { - bNotSynthetic = TRUE; + bNotSynthetic = sal_True; break; } @@ -598,7 +598,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const // ----------------------------------------------------------------------- -USHORT FontList::GetFontNameType( const XubString& rFontName ) const +sal_uInt16 FontList::GetFontNameType( const XubString& rFontName ) const { ImplFontListNameInfo* pData = ImplFindByName( rFontName ); if ( pData ) @@ -746,14 +746,14 @@ FontInfo FontList::Get( const XubString& rName, // ----------------------------------------------------------------------- -BOOL FontList::IsAvailable( const XubString& rName ) const +sal_Bool FontList::IsAvailable( const XubString& rName ) const { return (ImplFindByName( rName ) != 0); } // ----------------------------------------------------------------------- -const FontInfo& FontList::GetFontName( USHORT nFont ) const +const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const { DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" ); @@ -763,7 +763,7 @@ const FontInfo& FontList::GetFontName( USHORT nFont ) const // ----------------------------------------------------------------------- -USHORT FontList::GetFontNameType( USHORT nFont ) const +sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const { DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" ); @@ -829,8 +829,8 @@ const long* FontList::GetSizeAry( const FontInfo& rInfo ) const MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) ); pDevice->SetMapMode( aMap ); - USHORT i; - USHORT nRealCount = 0; + sal_uInt16 i; + sal_uInt16 nRealCount = 0; long nOldHeight = 0; ((FontList*)this)->mpSizeAry = new long[nDevSizeCount+1]; for ( i = 0; i < nDevSizeCount; i++ ) @@ -991,7 +991,7 @@ String FontSizeNames::Size2Name( long nValue ) const //------------------------------------------------------------------------ -String FontSizeNames::GetIndexName( ULONG nIndex ) const +String FontSizeNames::GetIndexName( sal_uLong nIndex ) const { String aStr; @@ -1003,7 +1003,7 @@ String FontSizeNames::GetIndexName( ULONG nIndex ) const //------------------------------------------------------------------------ -long FontSizeNames::GetIndexSize( ULONG nIndex ) const +long FontSizeNames::GetIndexSize( sal_uLong nIndex ) const { if ( nIndex >= mnElem ) return 0; diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx index 3541a43effc1..eff46b78b2a2 100755 --- a/svtools/source/control/filectrl.cxx +++ b/svtools/source/control/filectrl.cxx @@ -45,12 +45,12 @@ FileControl::FileControl( Window* pParent, WinBits nStyle, FileControlMode nFlag mnInternalFlags( FILECTRL_ORIGINALBUTTONTEXT ) { maButton.SetClickHdl( LINK( this, FileControl, ButtonHdl ) ); - mbOpenDlg = TRUE; + mbOpenDlg = sal_True; maButton.Show(); maEdit.Show(); - SetCompoundControl( TRUE ); + SetCompoundControl( sal_True ); SetStyle( ImplInitStyle( GetStyle() ) ); } @@ -154,7 +154,7 @@ void FileControl::Resize() if( mnInternalFlags & FILECTRL_INRESIZE ) return; - mnInternalFlags |= FILECTRL_INRESIZE;//InResize = TRUE + mnInternalFlags |= FILECTRL_INRESIZE;//InResize = sal_True Size aOutSz = GetOutputSizePixel(); long nButtonTextWidth = maButton.GetTextWidth( maButtonText ); @@ -163,7 +163,7 @@ void FileControl::Resize() ( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN ? ( maEdit.GetTextWidth( maEdit.GetText() ) <= aOutSz.Width() - nButtonTextWidth - ButtonBorder ) - : TRUE ) ) + : sal_True ) ) ) { maButton.SetText( maButtonText ); @@ -179,7 +179,7 @@ void FileControl::Resize() maEdit.SetPosSizePixel( 0, 0, aOutSz.Width()-nButtonWidth, aOutSz.Height() ); maButton.SetPosSizePixel( aOutSz.Width()-nButtonWidth, 0, nButtonWidth, aOutSz.Height() ); - mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = FALSE + mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = sal_False } // ----------------------------------------------------------------------- @@ -200,7 +200,7 @@ void FileControl::GetFocus() // ----------------------------------------------------------------------- -void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags ) +void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) { WinBits nOldEditStyle = GetEdit().GetStyle(); if ( GetStyle() & WB_BORDER ) diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index 5b986dc10f9d..f123af14d510 100644..100755 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -305,7 +305,7 @@ namespace validation //============================================================================== SvNumberFormatter* FormattedField::StaticFormatter::s_cFormatter = NULL; -ULONG FormattedField::StaticFormatter::s_nReferences = 0; +sal_uLong FormattedField::StaticFormatter::s_nReferences = 0; //------------------------------------------------------------------------------ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter() @@ -345,13 +345,13 @@ DBG_NAME(FormattedField); m_aLastSelection(0,0) \ ,m_dMinValue(0) \ ,m_dMaxValue(0) \ - ,m_bHasMin(FALSE) \ - ,m_bHasMax(FALSE) \ - ,m_bStrictFormat(TRUE) \ - ,m_bValueDirty(TRUE) \ - ,m_bEnableEmptyField(TRUE) \ - ,m_bAutoColor(FALSE) \ - ,m_bEnableNaN(FALSE) \ + ,m_bHasMin(sal_False) \ + ,m_bHasMax(sal_False) \ + ,m_bStrictFormat(sal_True) \ + ,m_bValueDirty(sal_True) \ + ,m_bEnableEmptyField(sal_True) \ + ,m_bAutoColor(sal_False) \ + ,m_bEnableNaN(sal_False) \ ,m_dCurrentValue(0) \ ,m_dDefaultValue(0) \ ,m_nFormatKey(0) \ @@ -359,12 +359,12 @@ DBG_NAME(FormattedField); ,m_dSpinSize(1) \ ,m_dSpinFirst(-1000000) \ ,m_dSpinLast(1000000) \ - ,m_bTreatAsNumber(TRUE) \ + ,m_bTreatAsNumber(sal_True) \ ,m_pLastOutputColor(NULL) \ ,m_bUseInputStringForFormatting(false) //------------------------------------------------------------------------------ -FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey) +FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey) :SpinField(pParent, nStyle) ,INIT_MEMBERS() { @@ -378,7 +378,7 @@ FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatte } //------------------------------------------------------------------------------ -FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey) +FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey) :SpinField(pParent, rResId) ,INIT_MEMBERS() { @@ -408,7 +408,7 @@ void FormattedField::SetValidateText(const XubString& rText, const String* pErro if (pErrorText) ImplSetTextImpl(*pErrorText, NULL); else - ImplSetValue(m_dDefaultValue, TRUE); + ImplSetValue(m_dDefaultValue, sal_True); } //------------------------------------------------------------------------------ @@ -417,7 +417,7 @@ void FormattedField::SetText(const XubString& rStr) DBG_CHKTHIS(FormattedField, NULL); SpinField::SetText(rStr); - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; } //------------------------------------------------------------------------------ @@ -426,7 +426,7 @@ void FormattedField::SetText( const XubString& rStr, const Selection& rNewSelect DBG_CHKTHIS(FormattedField, NULL); SpinField::SetText( rStr, rNewSelection ); - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; } //------------------------------------------------------------------------------ @@ -455,8 +455,8 @@ void FormattedField::SetTextFormatted(const XubString& rStr) Selection aSel(GetSelection()); Selection aNewSel(aSel); aNewSel.Justify(); - USHORT nNewLen = sFormatted.Len(); - USHORT nCurrentLen = GetText().Len(); + sal_uInt16 nNewLen = sFormatted.Len(); + sal_uInt16 nCurrentLen = GetText().Len(); if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen)) { // the new text is longer and the cursor was behind the last char (of the old text) if (aNewSel.Min() == 0) @@ -464,7 +464,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr) aNewSel.Max() = nNewLen; if (!nCurrentLen) { // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options - ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); + sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); if (nSelOptions & SELECTION_OPTION_SHOWFIRST) { // selection should be from right to left -> swap min and max aNewSel.Min() = aNewSel.Max(); @@ -483,7 +483,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr) else aNewSel = aSel; // don't use the justified version SpinField::SetText(sFormatted, aNewSel); - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; } //------------------------------------------------------------------------------ @@ -492,13 +492,13 @@ String FormattedField::GetTextValue() const if (m_bValueDirty) { ((FormattedField*)this)->m_sCurrentTextValue = GetText(); - ((FormattedField*)this)->m_bValueDirty = FALSE; + ((FormattedField*)this)->m_bValueDirty = sal_False; } return m_sCurrentTextValue; } //------------------------------------------------------------------------------ -void FormattedField::EnableNotANumber( BOOL _bEnable ) +void FormattedField::EnableNotANumber( sal_Bool _bEnable ) { if ( m_bEnableNaN == _bEnable ) return; @@ -507,7 +507,7 @@ void FormattedField::EnableNotANumber( BOOL _bEnable ) } //------------------------------------------------------------------------------ -void FormattedField::SetAutoColor(BOOL _bAutomatic) +void FormattedField::SetAutoColor(sal_Bool _bAutomatic) { if (_bAutomatic == m_bAutoColor) return; @@ -529,7 +529,7 @@ void FormattedField::Modify() if (!IsStrictFormat()) { - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; SpinField::Modify(); return; } @@ -539,7 +539,7 @@ void FormattedField::Modify() { m_sLastValidText = sCheck; m_aLastSelection = GetSelection(); - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; } else { @@ -569,8 +569,8 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel) Selection aSel(GetSelection()); aSel.Justify(); - USHORT nNewLen = rNew.Len(); - USHORT nCurrentLen = GetText().Len(); + sal_uInt16 nNewLen = rNew.Len(); + sal_uInt16 nCurrentLen = GetText().Len(); if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen)) { // new new text is longer and the cursor is behind the last char @@ -579,7 +579,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel) aSel.Max() = nNewLen; if (!nCurrentLen) { // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options - ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); + sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); if (nSelOptions & SELECTION_OPTION_SHOWFIRST) { // selection should be from right to left -> swap min and max aSel.Min() = aSel.Max(); @@ -598,7 +598,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel) SpinField::SetText(rNew, aSel); } - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; // muss nicht stimmen, aber sicherheitshalber ... } @@ -612,12 +612,12 @@ long FormattedField::PreNotify(NotifyEvent& rNEvt) } //------------------------------------------------------------------------------ -void FormattedField::ImplSetFormatKey(ULONG nFormatKey) +void FormattedField::ImplSetFormatKey(sal_uLong nFormatKey) { DBG_CHKTHIS(FormattedField, NULL); m_nFormatKey = nFormatKey; - BOOL bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0); + sal_Bool bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0); if (bNeedFormatter) { ImplGetFormatter(); // damit wird ein Standard-Formatter angelegt @@ -632,16 +632,16 @@ void FormattedField::ImplSetFormatKey(ULONG nFormatKey) } //------------------------------------------------------------------------------ -void FormattedField::SetFormatKey(ULONG nFormatKey) +void FormattedField::SetFormatKey(sal_uLong nFormatKey) { DBG_CHKTHIS(FormattedField, NULL); - BOOL bNoFormatter = (m_pFormatter == NULL); + sal_Bool bNoFormatter = (m_pFormatter == NULL); ImplSetFormatKey(nFormatKey); FormatChanged((bNoFormatter && (m_pFormatter != NULL)) ? FCT_FORMATTER : FCT_KEYONLY); } //------------------------------------------------------------------------------ -void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat) +void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat) { DBG_CHKTHIS(FormattedField, NULL); @@ -675,7 +675,7 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetForm LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW; // den alten Format-String in die neue Sprache konvertieren - USHORT nCheckPos; + sal_uInt16 nCheckPos; short nType; pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang); m_nFormatKey = nDestKey; @@ -697,47 +697,47 @@ void FormattedField::GetFormat(XubString& rFormatString, LanguageType& eLang) co } //------------------------------------------------------------------------------ -BOOL FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang) +sal_Bool FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang) { DBG_CHKTHIS(FormattedField, NULL); sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang); if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND) { - USHORT nCheckPos; + sal_uInt16 nCheckPos; short nType; XubString rFormat(rFormatString); if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey, eLang)) - return FALSE; + return sal_False; DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !"); } if (nNewKey != m_nFormatKey) SetFormatKey(nNewKey); - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ -BOOL FormattedField::GetThousandsSep() const +sal_Bool FormattedField::GetThousandsSep() const { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::GetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?"); - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); return bThousand; } //------------------------------------------------------------------------------ -void FormattedField::SetThousandsSep(BOOL _bUseSeparator) +void FormattedField::SetThousandsSep(sal_Bool _bUseSeparator) { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::SetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?"); // get the current settings - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); if (bThousand == _bUseSeparator) return; @@ -750,7 +750,7 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator) // generate a new format ... ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, _bUseSeparator, IsRed, nPrecision, nAnzLeading); // ... and introduce it to the formatter - USHORT nCheckPos; + sal_uInt16 nCheckPos; sal_uInt32 nNewKey; short nType; ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang); @@ -761,27 +761,27 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator) } //------------------------------------------------------------------------------ -USHORT FormattedField::GetDecimalDigits() const +sal_uInt16 FormattedField::GetDecimalDigits() const { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::GetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?"); - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); return nPrecision; } //------------------------------------------------------------------------------ -void FormattedField::SetDecimalDigits(USHORT _nPrecision) +void FormattedField::SetDecimalDigits(sal_uInt16 _nPrecision) { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::SetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?"); // get the current settings - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); if (nPrecision == _nPrecision) return; @@ -794,7 +794,7 @@ void FormattedField::SetDecimalDigits(USHORT _nPrecision) // generate a new format ... ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, bThousand, IsRed, _nPrecision, nAnzLeading); // ... and introduce it to the formatter - USHORT nCheckPos; + sal_uInt16 nCheckPos; sal_uInt32 nNewKey; short nType; ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang); @@ -831,7 +831,7 @@ void FormattedField::Commit() { // consider the field as modified Modify(); // but we have the most recent value now - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; } } @@ -845,7 +845,7 @@ void FormattedField::ReFormat() double dValue = GetValue(); if ( m_bEnableNaN && ::rtl::math::isNan( dValue ) ) return; - ImplSetValue( dValue, TRUE ); + ImplSetValue( dValue, sal_True ); } else SetTextFormatted(GetTextValue()); @@ -860,7 +860,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt) if ((rNEvt.GetType() == EVENT_KEYINPUT) && !IsReadOnly()) { const KeyEvent& rKEvt = *rNEvt.GetKeyEvent(); - USHORT nMod = rKEvt.GetKeyCode().GetModifier(); + sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier(); switch ( rKEvt.GetKeyCode().GetCode() ) { case KEY_UP: @@ -901,7 +901,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt) { if (TreatingAsNumber()) { - ImplSetValue(m_dCurrentValue, TRUE); + ImplSetValue(m_dCurrentValue, sal_True); Modify(); } else @@ -912,7 +912,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt) else SetTextFormatted(m_sDefaultText); } - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; } } else @@ -931,7 +931,7 @@ void FormattedField::SetMinValue(double dMin) DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMinValue : only to be used in numeric mode !"); m_dMinValue = dMin; - m_bHasMin = TRUE; + m_bHasMin = sal_True; // fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue ReFormat(); } @@ -943,7 +943,7 @@ void FormattedField::SetMaxValue(double dMax) DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMaxValue : only to be used in numeric mode !"); m_dMaxValue = dMax; - m_bHasMax = TRUE; + m_bHasMax = sal_True; // fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue ReFormat(); } @@ -957,7 +957,7 @@ void FormattedField::SetTextValue(const XubString& rText) } //------------------------------------------------------------------------------ -void FormattedField::EnableEmptyField(BOOL bEnable) +void FormattedField::EnableEmptyField(sal_Bool bEnable) { DBG_CHKTHIS(FormattedField, NULL); if (bEnable == m_bEnableEmptyField) @@ -965,11 +965,11 @@ void FormattedField::EnableEmptyField(BOOL bEnable) m_bEnableEmptyField = bEnable; if (!m_bEnableEmptyField && GetText().Len()==0) - ImplSetValue(m_dCurrentValue, TRUE); + ImplSetValue(m_dCurrentValue, sal_True); } //------------------------------------------------------------------------------ -void FormattedField::ImplSetValue(double dVal, BOOL bForce) +void FormattedField::ImplSetValue(double dVal, sal_Bool bForce) { DBG_CHKTHIS(FormattedField, NULL); @@ -982,7 +982,7 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce) DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplSetValue : can't set a value without a formatter !"); - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; m_dCurrentValue = dVal; String sNewText; @@ -1003,23 +1003,23 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce) } ImplSetTextImpl(sNewText, NULL); - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; DBG_ASSERT(CheckText(sNewText), "FormattedField::ImplSetValue : formatted string doesn't match the criteria !"); } //------------------------------------------------------------------------------ -BOOL FormattedField::ImplGetValue(double& dNewVal) +sal_Bool FormattedField::ImplGetValue(double& dNewVal) { DBG_CHKTHIS(FormattedField, NULL); dNewVal = m_dCurrentValue; if (!m_bValueDirty) - return TRUE; + return sal_True; dNewVal = m_dDefaultValue; String sText(GetText()); if (!sText.Len()) - return TRUE; + return sal_True; DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !"); @@ -1035,7 +1035,7 @@ BOOL FormattedField::ImplGetValue(double& dNewVal) // the language of our format LanguageType eLanguage = m_pFormatter->GetEntry(m_nFormatKey)->GetLanguage(); // the default number format for this language - ULONG nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage); + sal_uLong nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage); sal_uInt32 nTempFormat = nStandardNumericFormat; double dTemp; @@ -1049,14 +1049,14 @@ BOOL FormattedField::ImplGetValue(double& dNewVal) // which equals 300 percent. } if (!ImplGetFormatter()->IsNumberFormat(sText, nFormatKey, dNewVal)) - return FALSE; + return sal_False; if (m_bHasMin && (dNewVal<m_dMinValue)) dNewVal = m_dMinValue; if (m_bHasMax && (dNewVal>m_dMaxValue)) dNewVal = m_dMaxValue; - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ @@ -1079,7 +1079,7 @@ double FormattedField::GetValue() m_dCurrentValue = m_dDefaultValue; } - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; return m_dCurrentValue; } @@ -1166,7 +1166,7 @@ void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat) } //------------------------------------------------------------------------------ -BOOL DoubleNumericField::CheckText(const XubString& sText) const +sal_Bool DoubleNumericField::CheckText(const XubString& sText) const { // We'd like to implement this using the NumberFormatter::IsNumberFormat, but unfortunately, this doesn't // recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10") @@ -1174,19 +1174,19 @@ BOOL DoubleNumericField::CheckText(const XubString& sText) const #ifdef REGEXP_SUPPORT if (!sText.Len()) - return TRUE; + return sal_True; String sForceComplete = '_'; sForceComplete += sText; sForceComplete += '_'; - USHORT nStart = 0, nEnd = sForceComplete.Len(); - BOOL bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd); + sal_uInt16 nStart = 0, nEnd = sForceComplete.Len(); + sal_Bool bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd); if (bFound && (nStart == 0) && (nEnd == sForceComplete.Len())) - return TRUE; + return sal_True; - return FALSE; + return sal_False; #else return m_pNumberValidator->isValidNumericFragment( sText ); #endif @@ -1252,9 +1252,9 @@ void DoubleNumericField::ResetConformanceTester() //------------------------------------------------------------------------------ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle) :FormattedField(pParent, nStyle) - ,m_bChangingFormat(FALSE) + ,m_bChangingFormat(sal_False) { - m_bPrependCurrSym = FALSE; + m_bPrependCurrSym = sal_False; // initialize with a system currency format m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol(); @@ -1264,9 +1264,9 @@ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle) //------------------------------------------------------------------------------ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, const ResId& rResId) :FormattedField(pParent, rResId) - ,m_bChangingFormat(FALSE) + ,m_bChangingFormat(sal_False) { - m_bPrependCurrSym = FALSE; + m_bPrependCurrSym = sal_False; // initialize with a system currency format m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol(); @@ -1313,7 +1313,7 @@ void DoubleCurrencyField::setCurrencySymbol(const String& _sSymbol) } //------------------------------------------------------------------------------ -void DoubleCurrencyField::setPrependCurrSym(BOOL _bPrepend) +void DoubleCurrencyField::setPrependCurrSym(sal_Bool _bPrepend) { if (m_bPrependCurrSym == _bPrepend) return; @@ -1330,8 +1330,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat() XubString sOldFormat; LanguageType eLanguage; GetFormat(sOldFormat, eLanguage); - BOOL bThSep = GetThousandsSep(); - USHORT nDigits = GetDecimalDigits(); + sal_Bool bThSep = GetThousandsSep(); + sal_uInt16 nDigits = GetDecimalDigits(); // build a new format string with the base class' and my own settings Locale aLocale; @@ -1391,8 +1391,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat() } // set this new basic format - m_bChangingFormat = TRUE; + m_bChangingFormat = sal_True; SetFormat(sNewFormat, eLanguage); - m_bChangingFormat = FALSE; + m_bChangingFormat = sal_False; } diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 7b1f2ad87108..06886339fda5 100755 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -50,7 +50,7 @@ struct ImplHeadItem { - USHORT mnId; + sal_uInt16 mnId; HeaderBarItemBits mnBits; long mnSize; rtl::OString maHelpId; @@ -75,8 +75,8 @@ DECLARE_LIST( ImplHeadItemList, ImplHeadItem* ) #define HEADERBAR_DRAGOFF 4 #define HEADERBAR_DRAGOUTOFF 15 -#define HEAD_HITTEST_ITEM ((USHORT)0x0001) -#define HEAD_HITTEST_DIVIDER ((USHORT)0x0002) +#define HEAD_HITTEST_ITEM ((sal_uInt16)0x0001) +#define HEAD_HITTEST_DIVIDER ((sal_uInt16)0x0002) // ======================================================================= @@ -94,20 +94,20 @@ void HeaderBar::ImplInit( WinBits nWinStyle ) mnMouseOff = 0; mnCurItemId = 0; mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; - mbDrag = FALSE; - mbItemDrag = FALSE; - mbOutDrag = FALSE; - mbItemMode = FALSE; + mbDrag = sal_False; + mbItemDrag = sal_False; + mbOutDrag = sal_False; + mbItemMode = sal_False; // StyleBits auswerten if ( nWinStyle & WB_DRAG ) - mbDragable = TRUE; + mbDragable = sal_True; else - mbDragable = FALSE; + mbDragable = sal_False; if ( nWinStyle & WB_BUTTONSTYLE ) - mbButtonStyle = TRUE; + mbButtonStyle = sal_True; else - mbButtonStyle = FALSE; + mbButtonStyle = sal_False; if ( nWinStyle & WB_BORDER ) { mnBorderOff1 = 1; @@ -119,7 +119,7 @@ void HeaderBar::ImplInit( WinBits nWinStyle ) mnBorderOff2 = 1; } - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -156,8 +156,8 @@ HeaderBar::~HeaderBar() // ----------------------------------------------------------------------- -void HeaderBar::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void HeaderBar::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -194,17 +194,17 @@ void HeaderBar::ImplInitSettings( BOOL bFont, // ----------------------------------------------------------------------- -long HeaderBar::ImplGetItemPos( USHORT nPos ) const +long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const { long nX = -mnOffset; - for ( USHORT i = 0; i < nPos; i++ ) + for ( sal_uInt16 i = 0; i < nPos; i++ ) nX += mpItemList->GetObject( i )->mnSize; return nX; } // ----------------------------------------------------------------------- -Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const +Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const { Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 ); aRect.Right() = aRect.Left() + mpItemList->GetObject( nPos )->mnSize - 1; @@ -216,21 +216,21 @@ Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT HeaderBar::ImplHitTest( const Point& rPos, - long& nMouseOff, USHORT& nPos ) const +sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos, + long& nMouseOff, sal_uInt16& nPos ) const { ImplHeadItem* pItem; - USHORT nCount = (USHORT)mpItemList->Count(); - BOOL bLastFixed = TRUE; + sal_uInt16 nCount = (sal_uInt16)mpItemList->Count(); + sal_Bool bLastFixed = sal_True; long nX = -mnOffset; - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pItem = mpItemList->GetObject( i ); if ( rPos.X() < (nX+pItem->mnSize) ) { - USHORT nMode; + sal_uInt16 nMode; if ( !bLastFixed && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) ) { @@ -258,9 +258,9 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos, } if ( pItem->mnBits & HIB_FIXED ) - bLastFixed = TRUE; + bLastFixed = sal_True; else - bLastFixed = FALSE; + bLastFixed = sal_False; nX += pItem->mnSize; } @@ -281,7 +281,7 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos, // ----------------------------------------------------------------------- -void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos ) +void HeaderBar::ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) { Rectangle aRect1 = ImplGetItemRect( nStartPos ); Rectangle aRect2 = ImplGetItemRect( nEndPos ); @@ -330,10 +330,10 @@ void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos ) // ----------------------------------------------------------------------- void HeaderBar::ImplDrawItem( OutputDevice* pDev, - USHORT nPos, BOOL bHigh, BOOL bDrag, + sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag, const Rectangle& rItemRect, const Rectangle* pRect, - ULONG ) + sal_uLong ) { Rectangle aRect = rItemRect; @@ -387,9 +387,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, // avoid 3D borders Color aSelectionTextColor( COL_TRANSPARENT ); if( bHigh ) - DrawSelectionBackground( aRect, 1, TRUE, FALSE, FALSE, &aSelectionTextColor ); + DrawSelectionBackground( aRect, 1, sal_True, sal_False, sal_False, &aSelectionTextColor ); else if ( !mbButtonStyle || (nBits & HIB_FLAT) ) - DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE, &aSelectionTextColor ); + DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False, &aSelectionTextColor ); // Wenn kein Platz, dann brauchen wir auch nichts ausgeben if ( aRect.GetWidth() < 1 ) @@ -416,14 +416,14 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, } // Text auf entsprechende Laenge kuerzen - BOOL bLeftText = FALSE; + sal_Bool bLeftText = sal_False; long nMaxTxtWidth = aRect.GetWidth()-(HEADERBAR_TEXTOFF*2)-nArrowWidth; if ( nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE) ) nMaxTxtWidth -= aImageSize.Width(); long nTxtWidth = aTxtSize.Width(); if ( nTxtWidth > nMaxTxtWidth ) { - bLeftText = TRUE; + bLeftText = sal_True; // 3 == Len of "..." pItem->maOutText.AppendAscii( "..." ); do @@ -557,7 +557,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, } if ( nImagePos+aImageSize.Width() <= aRect.Right() ) { - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( !IsEnabled() ) nStyle |= IMAGE_DRAW_DISABLE; pDev->DrawImage( Point( nImagePos, nImagePosY ), pItem->maImage, nStyle ); @@ -580,11 +580,11 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, } // Feststellen, ob Platz genug ist, das Item zu malen - BOOL bDraw = TRUE; + sal_Bool bDraw = sal_True; if ( nArrowX < aRect.Left()+HEADERBAR_TEXTOFF ) - bDraw = FALSE; + bDraw = sal_False; else if ( nArrowX+HEAD_ARROWSIZE2 > aRect.Right() ) - bDraw = FALSE; + bDraw = sal_False; if ( bDraw ) { @@ -643,7 +643,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, // ----------------------------------------------------------------------- -void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag, +void HeaderBar::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag, const Rectangle* pRect ) { Rectangle aRect = ImplGetItemRect( nPos ); @@ -652,14 +652,14 @@ void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag, // ----------------------------------------------------------------------- -void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect ) +void HeaderBar::ImplUpdate( sal_uInt16 nPos, sal_Bool bEnd, sal_Bool bDirect ) { if ( IsVisible() && IsUpdateMode() ) { if ( !bDirect ) { Rectangle aRect; - USHORT nItemCount = (USHORT)(mpItemList->Count()); + sal_uInt16 nItemCount = (sal_uInt16)(mpItemList->Count()); if ( nPos < nItemCount ) aRect = ImplGetItemRect( nPos ); else @@ -676,11 +676,11 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect ) } else { - for ( USHORT i = nPos; i < mpItemList->Count(); i++ ) + for ( sal_uInt16 i = nPos; i < mpItemList->Count(); i++ ) ImplDrawItem( i ); if ( bEnd ) { - Rectangle aRect = ImplGetItemRect( (USHORT)mpItemList->Count() ); + Rectangle aRect = ImplGetItemRect( (sal_uInt16)mpItemList->Count() ); aRect.Left() = aRect.Right(); aRect.Right() = mnDX-1; if ( aRect.Left() < aRect.Right() ) @@ -696,31 +696,31 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect ) // ----------------------------------------------------------------------- -void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) +void HeaderBar::ImplStartDrag( const Point& rMousePos, sal_Bool bCommand ) { - USHORT nPos; - USHORT nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos ); + sal_uInt16 nPos; + sal_uInt16 nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos ); if ( nHitTest ) { - mbDrag = FALSE; + mbDrag = sal_False; ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( nHitTest & HEAD_HITTEST_DIVIDER ) - mbDrag = TRUE; + mbDrag = sal_True; else { if ( ((pItem->mnBits & HIB_CLICKABLE) && !(pItem->mnBits & HIB_FLAT)) || (mbDragable && !(pItem->mnBits & HIB_FIXEDPOS)) ) { - mbItemMode = TRUE; - mbDrag = TRUE; + mbItemMode = sal_True; + mbDrag = sal_True; if ( bCommand ) { if ( mbDragable ) - mbItemDrag = TRUE; + mbItemDrag = sal_True; else { - mbItemMode = FALSE; - mbDrag = FALSE; + mbItemMode = sal_False; + mbDrag = sal_False; } } } @@ -737,7 +737,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) if ( mbDrag ) { - mbOutDrag = FALSE; + mbOutDrag = sal_False; mnCurItemId = pItem->mnId; mnItemDragPos = nPos; StartTracking(); @@ -745,7 +745,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) mnDragPos = mnStartPos; StartDrag(); if ( mbItemMode ) - ImplDrawItem( nPos, TRUE, mbItemDrag ); + ImplDrawItem( nPos, sal_True, mbItemDrag ); else { Rectangle aSizeRect( mnDragPos, 0, mnDragPos, mnDragSize+mnDY ); @@ -761,17 +761,17 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) void HeaderBar::ImplDrag( const Point& rMousePos ) { - BOOL bNewOutDrag; - USHORT nPos = GetItemPos( mnCurItemId ); + sal_Bool bNewOutDrag; + sal_uInt16 nPos = GetItemPos( mnCurItemId ); mnDragPos = rMousePos.X()-mnMouseOff; if ( mbItemMode ) { Rectangle aItemRect = ImplGetItemRect( nPos ); if ( aItemRect.IsInside( rMousePos ) ) - bNewOutDrag = FALSE; + bNewOutDrag = sal_False; else - bNewOutDrag = TRUE; + bNewOutDrag = sal_True; // Evt. ItemDrag anschalten if ( bNewOutDrag && mbDragable && !mbItemDrag && @@ -779,24 +779,24 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) { if ( (rMousePos.Y() >= aItemRect.Top()) && (rMousePos.Y() <= aItemRect.Bottom()) ) { - mbItemDrag = TRUE; - ImplDrawItem( nPos, TRUE, mbItemDrag ); + mbItemDrag = sal_True; + ImplDrawItem( nPos, sal_True, mbItemDrag ); } } - USHORT nOldItemDragPos = mnItemDragPos; + sal_uInt16 nOldItemDragPos = mnItemDragPos; if ( mbItemDrag ) { if ( (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF) ) - bNewOutDrag = TRUE; + bNewOutDrag = sal_True; else - bNewOutDrag = FALSE; + bNewOutDrag = sal_False; if ( bNewOutDrag ) mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; else { - USHORT nTempId = GetItemId( Point( rMousePos.X(), 2 ) ); + sal_uInt16 nTempId = GetItemId( Point( rMousePos.X(), 2 ) ); if ( nTempId ) mnItemDragPos = GetItemPos( nTempId ); else @@ -840,7 +840,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) (mnItemDragPos != nPos) && (mnItemDragPos != HEADERBAR_ITEM_NOTFOUND) ) { - ImplDrawItem( mnItemDragPos, FALSE, TRUE ); + ImplDrawItem( mnItemDragPos, sal_False, sal_True ); ImplInvertDrag( nPos, mnItemDragPos ); } } @@ -866,7 +866,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) // ----------------------------------------------------------------------- -void HeaderBar::ImplEndDrag( BOOL bCancel ) +void HeaderBar::ImplEndDrag( sal_Bool bCancel ) { HideTracking(); @@ -874,7 +874,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel ) { if ( mbItemMode && (!mbOutDrag || mbItemDrag) ) { - USHORT nPos = GetItemPos( mnCurItemId ); + sal_uInt16 nPos = GetItemPos( mnCurItemId ); ImplDrawItem( nPos ); } @@ -882,7 +882,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel ) } else { - USHORT nPos = GetItemPos( mnCurItemId ); + sal_uInt16 nPos = GetItemPos( mnCurItemId ); if ( mbItemMode ) { if ( mbItemDrag ) @@ -911,18 +911,18 @@ void HeaderBar::ImplEndDrag( BOOL bCancel ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); pItem->mnSize += nDelta; - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } } - mbDrag = FALSE; + mbDrag = sal_False; EndDrag(); mnCurItemId = 0; mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; - mbOutDrag = FALSE; - mbItemMode = FALSE; - mbItemDrag = FALSE; + mbOutDrag = sal_False; + mbItemMode = sal_False; + mbItemDrag = sal_False; } // ----------------------------------------------------------------------- @@ -934,23 +934,23 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() == 2 ) { long nTemp; - USHORT nPos; - USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos ); + sal_uInt16 nPos; + sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos ); if ( nHitTest ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( nHitTest & HEAD_HITTEST_DIVIDER ) - mbItemMode = FALSE; + mbItemMode = sal_False; else - mbItemMode = TRUE; + mbItemMode = sal_True; mnCurItemId = pItem->mnId; DoubleClick(); - mbItemMode = FALSE; + mbItemMode = sal_False; mnCurItemId = 0; } } else - ImplStartDrag( rMEvt.GetPosPixel(), FALSE ); + ImplStartDrag( rMEvt.GetPosPixel(), sal_False ); } } @@ -959,9 +959,9 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt ) void HeaderBar::MouseMove( const MouseEvent& rMEvt ) { long nTemp1; - USHORT nTemp2; + sal_uInt16 nTemp2; PointerStyle eStyle = POINTER_ARROW; - USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 ); + sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 ); if ( nHitTest & HEAD_HITTEST_DIVIDER ) eStyle = POINTER_HSIZEBAR; @@ -1000,20 +1000,20 @@ void HeaderBar::Paint( const Rectangle& rRect ) } } - USHORT nCurItemPos; + sal_uInt16 nCurItemPos; if ( mbDrag ) nCurItemPos = GetItemPos( mnCurItemId ); else nCurItemPos = HEADERBAR_ITEM_NOTFOUND; - USHORT nItemCount = (USHORT)mpItemList->Count(); - for ( USHORT i = 0; i < nItemCount; i++ ) - ImplDrawItem( i, (i == nCurItemPos) ? TRUE : FALSE, FALSE, &rRect ); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); + for ( sal_uInt16 i = 0; i < nItemCount; i++ ) + ImplDrawItem( i, (i == nCurItemPos) ? sal_True : sal_False, sal_False, &rRect ); } // ----------------------------------------------------------------------- void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, - ULONG nFlags ) + sal_uLong nFlags ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); @@ -1050,8 +1050,8 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Rectangle aItemRect( aRect ); // aItemRect.Bottom()--; - USHORT nItemCount = (USHORT)mpItemList->Count(); - for ( USHORT i = 0; i < nItemCount; i++ ) + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); + for ( sal_uInt16 i = 0; i < nItemCount; i++ ) { aItemRect.Left() = aRect.Left()+ImplGetItemPos( i ); aItemRect.Right() = aItemRect.Left() + mpItemList->GetObject( i )->mnSize - 1; @@ -1060,7 +1060,7 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, aItemRect.Right() = 16000; Region aRegion( aRect ); pDev->SetClipRegion( aRegion ); - ImplDrawItem( pDev, i, FALSE, FALSE, aItemRect, &aRect, nFlags ); + ImplDrawItem( pDev, i, sal_False, sal_False, aItemRect, &aRect, nFlags ); pDev->SetClipRegion(); } @@ -1084,7 +1084,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt ) { if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == COMMAND_STARTDRAG) && !mbDrag ) { - ImplStartDrag( rCEvt.GetMousePosPixel(), TRUE ); + ImplStartDrag( rCEvt.GetMousePosPixel(), sal_True ); return; } @@ -1095,7 +1095,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt ) void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) @@ -1158,17 +1158,17 @@ void HeaderBar::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -1184,7 +1184,7 @@ void HeaderBar::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } @@ -1232,8 +1232,8 @@ void HeaderBar::DoubleClick() // ----------------------------------------------------------------------- -void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage, - long nSize, HeaderBarItemBits nBits, USHORT nPos ) +void HeaderBar::InsertItem( sal_uInt16 nItemId, const Image& rImage, + long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND, @@ -1249,13 +1249,13 @@ void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage, mpItemList->Insert( pItem, nPos ); // Ausgabe updaten - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } // ----------------------------------------------------------------------- -void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText, - long nSize, HeaderBarItemBits nBits, USHORT nPos ) +void HeaderBar::InsertItem( sal_uInt16 nItemId, const XubString& rText, + long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND, @@ -1271,15 +1271,15 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText, mpItemList->Insert( pItem, nPos ); // Ausgabe updaten - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } // ----------------------------------------------------------------------- -void HeaderBar::InsertItem( USHORT nItemId, +void HeaderBar::InsertItem( sal_uInt16 nItemId, const Image& rImage, const XubString& rText, long nSize, HeaderBarItemBits nBits, - USHORT nPos ) + sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND, @@ -1296,27 +1296,27 @@ void HeaderBar::InsertItem( USHORT nItemId, mpItemList->Insert( pItem, nPos ); // Ausgabe updaten - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } // ----------------------------------------------------------------------- -void HeaderBar::RemoveItem( USHORT nItemId ) +void HeaderBar::RemoveItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->Remove( nPos ); delete pItem; - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } // ----------------------------------------------------------------------- -void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos ) +void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { if ( nPos != nNewPos ) @@ -1325,7 +1325,7 @@ void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos ) if ( nNewPos < nPos ) nPos = nNewPos; mpItemList->Insert( pItem, nNewPos ); - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } } @@ -1343,7 +1343,7 @@ void HeaderBar::Clear() } mpItemList->Clear(); - ImplUpdate( 0, TRUE ); + ImplUpdate( 0, sal_True ); } // ----------------------------------------------------------------------- @@ -1363,20 +1363,20 @@ void HeaderBar::SetOffset( long nNewOffset ) // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemCount() const +sal_uInt16 HeaderBar::GetItemCount() const { - return (USHORT)mpItemList->Count(); + return (sal_uInt16)mpItemList->Count(); } // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemPos( USHORT nItemId ) const +sal_uInt16 HeaderBar::GetItemPos( sal_uInt16 nItemId ) const { ImplHeadItem* pItem = mpItemList->First(); while ( pItem ) { if ( pItem->mnId == nItemId ) - return (USHORT)mpItemList->GetCurPos(); + return (sal_uInt16)mpItemList->GetCurPos(); pItem = mpItemList->Next(); } @@ -1385,7 +1385,7 @@ USHORT HeaderBar::GetItemPos( USHORT nItemId ) const // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemId( USHORT nPos ) const +sal_uInt16 HeaderBar::GetItemId( sal_uInt16 nPos ) const { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( pItem ) @@ -1396,9 +1396,9 @@ USHORT HeaderBar::GetItemId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemId( const Point& rPos ) const +sal_uInt16 HeaderBar::GetItemId( const Point& rPos ) const { - USHORT nPos = 0; + sal_uInt16 nPos = 0; while ( nPos < mpItemList->Count() ) { if ( ImplGetItemRect( nPos ).IsInside( rPos ) ) @@ -1412,10 +1412,10 @@ USHORT HeaderBar::GetItemId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const +Rectangle HeaderBar::GetItemRect( sal_uInt16 nItemId ) const { Rectangle aRect; - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) aRect = ImplGetItemRect( nPos ); return aRect; @@ -1423,25 +1423,25 @@ Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemSize( USHORT nItemId, long nNewSize ) +void HeaderBar::SetItemSize( sal_uInt16 nItemId, long nNewSize ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( pItem->mnSize != nNewSize ) { pItem->mnSize = nNewSize; - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } } // ----------------------------------------------------------------------- -long HeaderBar::GetItemSize( USHORT nItemId ) const +long HeaderBar::GetItemSize( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mnSize; else @@ -1450,9 +1450,9 @@ long HeaderBar::GetItemSize( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits ) +void HeaderBar::SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); @@ -1466,9 +1466,9 @@ void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits ) // ----------------------------------------------------------------------- -HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const +HeaderBarItemBits HeaderBar::GetItemBits( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mnBits; else @@ -1477,9 +1477,9 @@ HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemData( USHORT nItemId, void* pNewData ) +void HeaderBar::SetItemData( sal_uInt16 nItemId, void* pNewData ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { mpItemList->GetObject( nPos )->mpUserData = pNewData; @@ -1489,9 +1489,9 @@ void HeaderBar::SetItemData( USHORT nItemId, void* pNewData ) // ----------------------------------------------------------------------- -void* HeaderBar::GetItemData( USHORT nItemId ) const +void* HeaderBar::GetItemData( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mpUserData; else @@ -1500,9 +1500,9 @@ void* HeaderBar::GetItemData( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage ) +void HeaderBar::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { mpItemList->GetObject( nPos )->maImage = rImage; @@ -1512,9 +1512,9 @@ void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage ) // ----------------------------------------------------------------------- -Image HeaderBar::GetItemImage( USHORT nItemId ) const +Image HeaderBar::GetItemImage( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->maImage; else @@ -1523,9 +1523,9 @@ Image HeaderBar::GetItemImage( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText ) +void HeaderBar::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { mpItemList->GetObject( nPos )->maText = rText; @@ -1535,9 +1535,9 @@ void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -XubString HeaderBar::GetItemText( USHORT nItemId ) const +XubString HeaderBar::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->maText; else @@ -1546,18 +1546,18 @@ XubString HeaderBar::GetItemText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetHelpText( USHORT nItemId, const XubString& rText ) +void HeaderBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) mpItemList->GetObject( nPos )->maHelpText = rText; } // ----------------------------------------------------------------------- -XubString HeaderBar::GetHelpText( USHORT nItemId ) const +XubString HeaderBar::GetHelpText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); @@ -1576,18 +1576,18 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId ) +void HeaderBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) mpItemList->GetObject( nPos )->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -rtl::OString HeaderBar::GetHelpId( USHORT nItemId ) const +rtl::OString HeaderBar::GetHelpId( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); rtl::OString aRet; if ( nPos != HEADERBAR_ITEM_NOTFOUND ) aRet = mpItemList->GetObject( nPos )->maHelpId; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 593065c0ac0c..94db99a66194 100755 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -116,17 +116,17 @@ class SvtMatchContext_Impl : public ::vos::OThread String aBaseURL; String aText; SvtURLBox* pBox; - BOOL bStop; - BOOL bOnlyDirectories; - BOOL bNoSelection; + sal_Bool bStop; + sal_Bool bOnlyDirectories; + sal_Bool bNoSelection; DECL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void* ); virtual void SAL_CALL onTerminated( ); virtual void SAL_CALL run(); virtual void SAL_CALL Cancel(); - void Insert( const String& rCompletion, const String& rURL, BOOL bForce = FALSE); - void ReadFolder( const String& rURL, const String& rMatch, BOOL bSmart ); + void Insert( const String& rCompletion, const String& rURL, sal_Bool bForce = sal_False); + void ReadFolder( const String& rURL, const String& rMatch, sal_Bool bSmart ); void FillPicklist( SvStringsDtor& rPickList ); public: @@ -154,7 +154,7 @@ SvtMatchContext_Impl::SvtMatchContext_Impl( , aBaseURL( pBoxP->aBaseURL ) , aText( rText ) , pBox( pBoxP ) - , bStop( FALSE ) + , bStop( sal_False ) , bOnlyDirectories( pBoxP->bOnlyDirectories ) , bNoSelection( pBoxP->bNoSelection ) { @@ -199,7 +199,7 @@ void SvtMatchContext_Impl::FillPicklist( SvStringsDtor& rPickList ) seqPropertySet[nProperty].Value >>= sTitle; aURL.SetURL( sTitle ); const StringPtr pStr = new String( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) ); - rPickList.Insert( pStr, (USHORT) nItem ); + rPickList.Insert( pStr, (sal_uInt16) nItem ); break; } } @@ -216,7 +216,7 @@ void SAL_CALL SvtMatchContext_Impl::Cancel() //------------------------------------------------------------------------- void SvtMatchContext_Impl::Stop() { - bStop = TRUE; + bStop = sal_True; if( isRunning() ) terminate(); @@ -246,7 +246,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) } SvtURLBox* pBox = pThis->pBox; - pBox->bAutoCompleteMode = TRUE; + pBox->bAutoCompleteMode = sal_True; // did we filter completions which otherwise would have been valid? // (to be filled below) @@ -255,7 +255,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) // insert all completed strings into the listbox pBox->Clear(); - for( USHORT nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ ) + for( sal_uInt16 nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ ) { String sCompletion( *(*pThis->pCompletions)[nPos] ); @@ -325,12 +325,12 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) //------------------------------------------------------------------------- void SvtMatchContext_Impl::Insert( const String& rCompletion, const String& rURL, - BOOL bForce ) + sal_Bool bForce ) { if( !bForce ) { // avoid doubles - for( USHORT nPos = pCompletions->Count(); nPos--; ) + for( sal_uInt16 nPos = pCompletions->Count(); nPos--; ) if( *(*pCompletions)[ nPos ] == rCompletion ) return; } @@ -344,7 +344,7 @@ void SvtMatchContext_Impl::Insert( const String& rCompletion, //------------------------------------------------------------------------- void SvtMatchContext_Impl::ReadFolder( const String& rURL, const String& rMatch, - BOOL bSmart ) + sal_Bool bSmart ) { // check folder to scan if( !UCBContentHelper::IsFolder( rURL ) ) @@ -369,7 +369,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL, String aNewText( aText ); aNewText += '/'; - Insert( aNewText, rURL, TRUE ); + Insert( aNewText, rURL, sal_True ); return; } @@ -495,7 +495,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL, if ( bIsFolder ) aInput += aDelimiter; - Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), TRUE ); + Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), sal_True ); } } } @@ -564,7 +564,7 @@ String SvtURLBox::ParseSmart( String aText, String aBaseURL, String aWorkDir ) aObj.setFinalSlash(); // take base URL and append current input - bool bWasAbsolute = FALSE; + bool bWasAbsolute = sal_False; #ifdef UNX // don't support FSYS_MAC under Unix, because here ':' is a valid character for a filename INetURLObject::FSysStyle eStyle = static_cast< INetURLObject::FSysStyle >( INetURLObject::FSYS_VOS | INetURLObject::FSYS_UNX | INetURLObject::FSYS_DOS ); @@ -605,7 +605,7 @@ void SvtMatchContext_Impl::run() pURLs->Remove( 0, pURLs->Count() ); // check for input - USHORT nTextLen = aText.Len(); + sal_uInt16 nTextLen = aText.Len(); if ( !nTextLen ) return; @@ -657,7 +657,7 @@ void SvtMatchContext_Impl::run() // don't scan history picklist if only directories are allowed, picklist contains only files return; - BOOL bFull = FALSE; + sal_Bool bFull = sal_False; int nCount = aPickList.Count(); INetURLObject aCurObj; @@ -666,7 +666,7 @@ void SvtMatchContext_Impl::run() aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt ); for( ;; ) { - for( USHORT nPos = 0; schedule() && nPos < nCount; nPos++ ) + for( sal_uInt16 nPos = 0; schedule() && nPos < nCount; nPos++ ) { aCurObj.SetURL( *aPickList.GetObject( nPos ) ); aCurObj.SetSmartURL( aCurObj.GetURLNoPass()); @@ -756,7 +756,7 @@ void SvtMatchContext_Impl::run() } if( !bFull ) - bFull = TRUE; + bFull = sal_True; else break; } @@ -767,7 +767,7 @@ void SvtMatchContext_Impl::run() //------------------------------------------------------------------------- //------------------------------------------------------------------------- //------------------------------------------------------------------------- -void SvtURLBox::TryAutoComplete( BOOL bForce ) +void SvtURLBox::TryAutoComplete( sal_Bool bForce ) { if( Application::AnyInput( INPUT_KEYBOARD ) ) return; @@ -776,7 +776,7 @@ void SvtURLBox::TryAutoComplete( BOOL bForce ) Selection aSelection( GetSelection() ); if( aSelection.Max() != aCurText.Len() && !bForce ) return; - USHORT nLen = (USHORT)aSelection.Min(); + sal_uInt16 nLen = (sal_uInt16)aSelection.Min(); aCurText.Erase( nLen ); if( aCurText.Len() && bIsAutoCompleteEnabled ) { @@ -794,13 +794,13 @@ SvtURLBox::SvtURLBox( Window* pParent, INetProtocol eSmart ) : ComboBox( pParent , WB_DROPDOWN | WB_AUTOSIZE | WB_AUTOHSCROLL ), pCtx( 0 ), eSmartProtocol( eSmart ), - bAutoCompleteMode( FALSE ), - bOnlyDirectories( FALSE ), - bTryAutoComplete( FALSE ), - bCtrlClick( FALSE ), - bHistoryDisabled( FALSE ), - bNoSelection( FALSE ), - bIsAutoCompleteEnabled( TRUE ) + bAutoCompleteMode( sal_False ), + bOnlyDirectories( sal_False ), + bTryAutoComplete( sal_False ), + bCtrlClick( sal_False ), + bHistoryDisabled( sal_False ), + bNoSelection( sal_False ), + bIsAutoCompleteEnabled( sal_True ) { ImplInit(); @@ -815,13 +815,13 @@ SvtURLBox::SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart ) : ComboBox( pParent, _nStyle ), pCtx( 0 ), eSmartProtocol( eSmart ), - bAutoCompleteMode( FALSE ), - bOnlyDirectories( FALSE ), - bTryAutoComplete( FALSE ), - bCtrlClick( FALSE ), - bHistoryDisabled( FALSE ), - bNoSelection( FALSE ), - bIsAutoCompleteEnabled( TRUE ) + bAutoCompleteMode( sal_False ), + bOnlyDirectories( sal_False ), + bTryAutoComplete( sal_False ), + bCtrlClick( sal_False ), + bHistoryDisabled( sal_False ), + bNoSelection( sal_False ), + bIsAutoCompleteEnabled( sal_True ) { ImplInit(); } @@ -831,13 +831,13 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart : ComboBox( pParent , _rResId ), pCtx( 0 ), eSmartProtocol( eSmart ), - bAutoCompleteMode( FALSE ), - bOnlyDirectories( FALSE ), - bTryAutoComplete( FALSE ), - bCtrlClick( FALSE ), - bHistoryDisabled( FALSE ), - bNoSelection( FALSE ), - bIsAutoCompleteEnabled( TRUE ) + bAutoCompleteMode( sal_False ), + bOnlyDirectories( sal_False ), + bTryAutoComplete( sal_False ), + bCtrlClick( sal_False ), + bHistoryDisabled( sal_False ), + bNoSelection( sal_False ), + bIsAutoCompleteEnabled( sal_True ) { ImplInit(); } @@ -849,7 +849,7 @@ void SvtURLBox::ImplInit() if ( GetHelpId().getLength() == 0 ) SetHelpId( ".uno:OpenURL" ); - EnableAutocomplete( FALSE ); + EnableAutocomplete( sal_False ); SetText( String() ); @@ -931,7 +931,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() if ( aURL.Len() && ( !pImp->pUrlFilter || pImp->pUrlFilter->isUrlAllowed( aURL ) ) ) { - BOOL bFound = (aURL.GetChar(aURL.Len()-1) == '/' ); + sal_Bool bFound = (aURL.GetChar(aURL.Len()-1) == '/' ); if ( !bFound ) { String aUpperURL( aURL ); @@ -961,7 +961,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() } //------------------------------------------------------------------------- -BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) +sal_Bool SvtURLBox::ProcessKey( const KeyCode& rKey ) { // every key input stops the current matching thread if( pCtx ) @@ -979,7 +979,7 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) if ( bAutoCompleteMode ) { // reset picklist - bAutoCompleteMode = FALSE; + bAutoCompleteMode = sal_False; Selection aSelection( GetSelection() ); SetSelection( Selection( aSelection.Min(), aSelection.Min() ) ); if ( bOnlyDirectories ) @@ -990,19 +990,19 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) } bCtrlClick = rKey.IsMod1(); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if ( GetOpenHdl().IsSet() ) { - bHandled = TRUE; + bHandled = sal_True; GetOpenHdl().Call(this); } else if ( GetSelectHdl().IsSet() ) { - bHandled = TRUE; + bHandled = sal_True; GetSelectHdl().Call(this); } - bCtrlClick = FALSE; + bCtrlClick = sal_False; ClearModifyFlag(); return bHandled; @@ -1010,9 +1010,9 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) else if ( aCode == KEY_RETURN && !GetText().Len() && GetOpenHdl().IsSet() ) { // for file dialog - bAutoCompleteMode = FALSE; + bAutoCompleteMode = sal_False; GetOpenHdl().Call(this); - return TRUE; + return sal_True; } else if( aCode == KEY_ESCAPE ) { @@ -1028,15 +1028,15 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) } else { - return FALSE; + return sal_False; } - bAutoCompleteMode = FALSE; - return TRUE; + bAutoCompleteMode = sal_False; + return sal_True; } else { - return FALSE; + return sal_False; } } @@ -1057,15 +1057,15 @@ long SvtURLBox::PreNotify( NotifyEvent& rNEvt ) KeyCode aCode( rKey.GetCode() ); if( ProcessKey( rKey ) ) { - return TRUE; + return sal_True; } else if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() ) { Selection aSelection( GetSelection() ); - USHORT nLen = (USHORT)aSelection.Min(); + sal_uInt16 nLen = (sal_uInt16)aSelection.Min(); GetSubEdit()->KeyInput( rEvent ); SetSelection( Selection( nLen, GetText().Len() ) ); - return TRUE; + return sal_True; } if ( MatchesPlaceHolder( GetText() ) ) @@ -1084,7 +1084,7 @@ IMPL_LINK( SvtURLBox, AutoCompleteHdl_Impl, void*, EMPTYARG ) { if ( GetSubEdit()->GetAutocompleteAction() == AUTOCOMPLETE_KEYINPUT ) { - TryAutoComplete( FALSE ); + TryAutoComplete( sal_False ); return 1L; } @@ -1123,7 +1123,7 @@ void SvtURLBox::Select() } //------------------------------------------------------------------------- -void SvtURLBox::SetOnlyDirectories( BOOL bDir ) +void SvtURLBox::SetOnlyDirectories( sal_Bool bDir ) { bOnlyDirectories = bDir; if ( bOnlyDirectories ) @@ -1131,7 +1131,7 @@ void SvtURLBox::SetOnlyDirectories( BOOL bDir ) } //------------------------------------------------------------------------- -void SvtURLBox::SetNoURLSelection( BOOL bSet ) +void SvtURLBox::SetNoURLSelection( sal_Bool bSet ) { bNoSelection = bSet; } @@ -1148,7 +1148,7 @@ String SvtURLBox::GetURL() // try to get the right case preserving URL from the list of URLs if ( pImp->pCompletions && pImp->pURLs ) { - for( USHORT nPos=0; nPos<pImp->pCompletions->Count(); nPos++ ) + for( sal_uInt16 nPos=0; nPos<pImp->pCompletions->Count(); nPos++ ) { #ifdef DBG_UTIL String aTmp( *(*pImp->pCompletions)[ nPos ] ); @@ -1229,7 +1229,7 @@ String SvtURLBox::GetURL() //------------------------------------------------------------------------- void SvtURLBox::DisableHistory() { - bHistoryDisabled = TRUE; + bHistoryDisabled = sal_True; UpdatePicklistForSmartProtocol_Impl(); } diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx index bb57d043b11d..86b49c782398 100755 --- a/svtools/source/control/prgsbar.cxx +++ b/svtools/source/control/prgsbar.cxx @@ -44,9 +44,9 @@ void ProgressBar::ImplInit() { mnPercent = 0; - mbCalcNew = TRUE; + mbCalcNew = sal_True; - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle ) @@ -85,8 +85,8 @@ ProgressBar::~ProgressBar() // ----------------------------------------------------------------------- -void ProgressBar::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void ProgressBar::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -108,8 +108,8 @@ void ProgressBar::ImplInitSettings( BOOL bFont, { if( (GetStyle() & WB_BORDER) ) SetBorderStyle( WINDOW_BORDER_REMOVEBORDER ); - EnableChildTransparentMode( TRUE ); - SetPaintTransparent( TRUE ); + EnableChildTransparentMode( sal_True ); + SetPaintTransparent( sal_True ); SetBackground(); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); } @@ -147,18 +147,18 @@ void ProgressBar::ImplInitSettings( BOOL bFont, // ----------------------------------------------------------------------- -void ProgressBar::ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc ) +void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc ) { if ( mbCalcNew ) { - mbCalcNew = FALSE; + mbCalcNew = sal_False; Size aSize = GetOutputSizePixel(); mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2); mnPrgsWidth = (mnPrgsHeight*2)/3; maPos.Y() = PROGRESSBAR_WIN_OFFSET; long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET); - USHORT nMaxCount = (USHORT)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET)); + sal_uInt16 nMaxCount = (sal_uInt16)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET)); if ( nMaxCount <= 1 ) nMaxCount = 1; else @@ -187,20 +187,20 @@ void ProgressBar::Paint( const Rectangle& ) void ProgressBar::Resize() { - mbCalcNew = TRUE; + mbCalcNew = sal_True; if ( IsReallyVisible() ) Invalidate(); } // ----------------------------------------------------------------------- -void ProgressBar::SetValue( USHORT nNewPercent ) +void ProgressBar::SetValue( sal_uInt16 nNewPercent ) { DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" ); if ( nNewPercent < mnPercent ) { - mbCalcNew = TRUE; + mbCalcNew = sal_True; mnPercent = nNewPercent; if ( IsReallyVisible() ) { @@ -223,19 +223,19 @@ void ProgressBar::StateChanged( StateChangedType nType ) if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else */ if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } @@ -249,7 +249,7 @@ void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx index f4c04a7000af..118c16c3a4dc 100755 --- a/svtools/source/control/roadmap.cxx +++ b/svtools/source/control/roadmap.cxx @@ -120,9 +120,9 @@ namespace svt void SetClickHdl( const Link& rLink ); const Link& GetClickHdl() const; - void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags ); - void Enable( BOOL bEnable = TRUE); - BOOL IsEnabled() const; + void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags ); + void Enable( sal_Bool bEnable = sal_True); + sal_Bool IsEnabled() const; void GrabFocus(); bool Contains( const Window* _pWindow ) const; @@ -884,7 +884,7 @@ namespace svt } //--------------------------------------------------------------------- - void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags ) + void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags ) { if (pRefRoadmapHyperLabel == NULL) mpDescription->SetZOrder( NULL, nFlags); //WINDOW_ZORDER_FIRST ); @@ -893,14 +893,14 @@ namespace svt } //--------------------------------------------------------------------- - void RoadmapItem::Enable( BOOL _bEnable) + void RoadmapItem::Enable( sal_Bool _bEnable) { mpID->Enable(_bEnable); mpDescription->Enable(_bEnable); } //--------------------------------------------------------------------- - BOOL RoadmapItem::IsEnabled() const + sal_Bool RoadmapItem::IsEnabled() const { return mpID->IsEnabled(); } diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index bdbcd253c198..164118d12ef9 100755 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -103,15 +103,15 @@ private: long nNullOff; long nMargin1; long nMargin2; - USHORT nLines; - USHORT nArrows; - USHORT nBorders; - USHORT nIndents; - USHORT nTabs; - USHORT nMargin1Style; - USHORT nMargin2Style; - BOOL bAutoPageWidth; - BOOL bTextRTL; + sal_uInt16 nLines; + sal_uInt16 nArrows; + sal_uInt16 nBorders; + sal_uInt16 nIndents; + sal_uInt16 nTabs; + sal_uInt16 nMargin1Style; + sal_uInt16 nMargin2Style; + sal_Bool bAutoPageWidth; + sal_Bool bTextRTL; #ifdef _SV_RULER_CXX public: @@ -130,7 +130,7 @@ struct ImplRulerUnitData long nTick2; // Tick fuer halbe Werte long nTick3; // Tick fuer Zahlenausgabe long n100THMM; // Teiler fuer Einheit - USHORT nUnitDigits; // Anzahl Nachkommastellen + sal_uInt16 nUnitDigits; // Anzahl Nachkommastellen sal_Char aUnitStr[8]; // Einheiten-String }; @@ -153,13 +153,13 @@ struct ImplRulerHitTest { long nPos; RulerType eType; - USHORT nAryPos; - USHORT mnDragSize; - BOOL bSize; - BOOL bSizeBar; - BOOL bExpandTest; + sal_uInt16 nAryPos; + sal_uInt16 mnDragSize; + sal_Bool bSize; + sal_Bool bSizeBar; + sal_Bool bExpandTest; ImplRulerHitTest() : - bExpandTest( FALSE ) {} + bExpandTest( sal_False ) {} }; // ======================================================================= @@ -169,7 +169,7 @@ ImplRulerData::ImplRulerData() memset( this, 0, sizeof( ImplRulerData ) ); // PageBreite == EditWinBreite - bAutoPageWidth = TRUE; + bAutoPageWidth = sal_True; } // ----------------------------------------------------------------------- @@ -241,7 +241,7 @@ void Ruler::ImplInit( WinBits nWinBits ) // --- RTL --- no UI mirroring for horizontal rulers, because // the document is also not mirrored - EnableRTL( FALSE ); + EnableRTL( sal_False ); } // Variablen initialisieren @@ -263,13 +263,13 @@ void Ruler::ImplInit( WinBits nWinBits ) mnExtraStyle = 0; // Style des Extra-Feldes mnExtraClicks = 0; // Click-Anzahl fuer Extra-Feld mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld - mbCalc = TRUE; // Muessen Pagebreiten neu berechnet werden - mbFormat = TRUE; // Muss neu ausgegeben werden - mbDrag = FALSE; // Sind wir im Drag-Modus - mbDragDelete = FALSE; // Wird Maus beim Draggen unten rausgezogen - mbDragCanceled = FALSE; // Wurde Dragging abgebrochen - mbAutoWinWidth = TRUE; // EditWinBreite == RulerBreite - mbActive = TRUE; // Ist Lineal aktiv + mbCalc = sal_True; // Muessen Pagebreiten neu berechnet werden + mbFormat = sal_True; // Muss neu ausgegeben werden + mbDrag = sal_False; // Sind wir im Drag-Modus + mbDragDelete = sal_False; // Wird Maus beim Draggen unten rausgezogen + mbDragCanceled = sal_False; // Wurde Dragging abgebrochen + mbAutoWinWidth = sal_True; // EditWinBreite == RulerBreite + mbActive = sal_True; // Ist Lineal aktiv mnUpdateFlags = 0; // Was soll im Update-Handler upgedatet werden mpData = mpSaveData; // Wir zeigen auf die normalen Daten meExtraType = RULER_EXTRA_DONTKNOW; // Was im ExtraFeld dargestellt wird @@ -293,7 +293,7 @@ void Ruler::ImplInit( WinBits nWinBits ) mnBorderWidth = 0; // Einstellungen setzen - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); // Default-Groesse setzen long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth; @@ -391,7 +391,7 @@ void Ruler::ImplVDrawText( long nX, long nY, const String& rText ) // ----------------------------------------------------------------------- -void Ruler::ImplInvertLines( BOOL bErase ) +void Ruler::ImplInvertLines( sal_Bool bErase ) { // Positionslinien if ( mpData->nLines && mbActive && !mbDrag && !mbFormat && @@ -411,7 +411,7 @@ void Ruler::ImplInvertLines( BOOL bErase ) aRect.Right() = nY; // Linien ausgeben - for ( USHORT i = 0; i < mpData->nLines; i++ ) + for ( sal_uInt16 i = 0; i < mpData->nLines; i++ ) { n = mpData->pLines[i].nPos+nNullWinOff; if ( (n >= nRulX1) && (n < nRulX2) ) @@ -464,11 +464,11 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) long nTickWidth; long nX; long nY; - BOOL bNoTicks = FALSE; + sal_Bool bNoTicks = sal_False; // Groessenvorberechnung // Sizes calculation - BOOL bVertRight = FALSE; + sal_Bool bVertRight = sal_False; if ( mnWinStyle & WB_HORZ ) nTickWidth = aPixSize.Width(); else @@ -477,7 +477,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) if ( mnWinStyle & WB_RIGHT_ALIGNED ) { aFont.SetOrientation( 2700 ); - bVertRight = TRUE; + bVertRight = sal_True; } else aFont.SetOrientation( 900 ); @@ -515,7 +515,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) // koennen if ( nMulti < nOldMulti ) { - bNoTicks = TRUE; + bNoTicks = sal_True; break; } @@ -614,7 +614,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) } } // #i49017# with some zoom factors the value nTick can overflow - if( ((ULONG)nTick + (ULONG)nTickCount) > (ULONG)LONG_MAX) + if( ((sal_uLong)nTick + (sal_uLong)nTickCount) > (sal_uLong)LONG_MAX) break; nTick += nTickCount; } @@ -625,7 +625,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) void Ruler::ImplDrawArrows( long nCenter ) { - USHORT i; + sal_uInt16 i; long n1; long n2; long n3; @@ -633,7 +633,7 @@ void Ruler::ImplDrawArrows( long nCenter ) long nLogWidth; String aStr; String aStr2; - BOOL bDrawUnit; + sal_Bool bDrawUnit; long nTxtWidth; long nTxtHeight2 = GetTextHeight()/2; @@ -658,14 +658,14 @@ void Ruler::ImplDrawArrows( long nCenter ) nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000; else nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM; - aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, TRUE, FALSE ); + aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, sal_True, sal_False ); // Einheit an den String haengen aStr2 = aStr; aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr ); // Textbreite ermitteln - bDrawUnit = TRUE; + bDrawUnit = sal_True; nTxtWidth = GetTextWidth( aStr2 ); if ( nTxtWidth < mpData->pArrows[i].nWidth-10 ) aStr = aStr2; @@ -673,7 +673,7 @@ void Ruler::ImplDrawArrows( long nCenter ) { nTxtWidth = GetTextWidth( aStr ); if ( nTxtWidth > mpData->pArrows[i].nWidth-10 ) - bDrawUnit = FALSE; + bDrawUnit = sal_False; } // Ist genuegen Platz fuer Einheiten-String vorhanden @@ -717,7 +717,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom long n2; long nTemp1; long nTemp2; - USHORT i; + sal_uInt16 i; for ( i = 0; i < mpData->nBorders; i++ ) { @@ -835,12 +835,12 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom // ----------------------------------------------------------------------- -void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle ) +void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Point aPos1; Point aPos2; - USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE; + sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE; if ( nStyle & RULER_STYLE_INVISIBLE ) return; @@ -924,7 +924,7 @@ void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle ) void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom ) { - USHORT j; + sal_uInt16 j; long n; long nIndentHeight = (mnVirHeight/2) - 1; long nIndentWidth2 = nIndentHeight-3; @@ -935,8 +935,8 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom if ( mpData->pIndents[j].nStyle & RULER_STYLE_INVISIBLE ) continue; - USHORT nStyle = mpData->pIndents[j].nStyle; - USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE; + sal_uInt16 nStyle = mpData->pIndents[j].nStyle; + sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE; n = mpData->pIndents[j].nPos+mpData->nNullVirOff; @@ -968,7 +968,7 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom if(0 == (mnWinStyle & WB_HORZ)) { Point aTmp; - for(USHORT i = 0; i < 5; i++) + for(sal_uInt16 i = 0; i < 5; i++) { aTmp = aPoly[i]; Point aSet(nVirBottom - aTmp.Y(), aTmp.X()); @@ -983,9 +983,9 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom // ----------------------------------------------------------------------- -static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle ) +static void ImplCenterTabPos( Point& rPos, sal_uInt16 nTabStyle ) { - BOOL bRTL = 0 != (nTabStyle & RULER_TAB_RTL); + sal_Bool bRTL = 0 != (nTabStyle & RULER_TAB_RTL); nTabStyle &= RULER_TAB_STYLE; rPos.Y() += RULER_TAB_HEIGHT/2; if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) ||( bRTL && nTabStyle == RULER_TAB_RIGHT)) @@ -995,7 +995,7 @@ static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle ) } // ----------------------------------------------------------------------- -void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAligned) +void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, sal_Bool bRightAligned) { if(!rRect.IsEmpty()) { @@ -1015,13 +1015,13 @@ void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAli // ----------------------------------------------------------------------- static void ImplDrawRulerTab( OutputDevice* pDevice, - const Point& rPos, USHORT nStyle, WinBits nWinBits ) + const Point& rPos, sal_uInt16 nStyle, WinBits nWinBits ) { if ( nStyle & RULER_STYLE_INVISIBLE ) return; - USHORT nTabStyle = nStyle & RULER_TAB_STYLE; - BOOL bRTL = 0 != (nStyle & RULER_TAB_RTL); + sal_uInt16 nTabStyle = nStyle & RULER_TAB_STYLE; + sal_Bool bRTL = 0 != (nStyle & RULER_TAB_RTL); Rectangle aRect1, aRect2, aRect3; aRect3.SetEmpty(); if ( nTabStyle == RULER_TAB_DEFAULT ) @@ -1079,7 +1079,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice, } if( 0 == (nWinBits&WB_HORZ) ) { - BOOL bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED); + sal_Bool bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED); lcl_RotateRect_Impl(aRect1, rPos.Y(), bRightAligned); lcl_RotateRect_Impl(aRect2, rPos.Y(), bRightAligned); lcl_RotateRect_Impl(aRect3, rPos.Y(), bRightAligned); @@ -1093,7 +1093,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice, // ----------------------------------------------------------------------- -void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle ) +void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ) { if ( nStyle & RULER_STYLE_INVISIBLE ) return; @@ -1113,7 +1113,7 @@ void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) { - for ( USHORT i = 0; i < mpData->nTabs; i++ ) + for ( sal_uInt16 i = 0; i < mpData->nTabs; i++ ) { if ( mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE ) continue; @@ -1129,8 +1129,8 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) // ----------------------------------------------------------------------- -void Ruler::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void Ruler::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -1219,7 +1219,7 @@ void Ruler::ImplCalc() mpData->nRulWidth = mnHeight-nRulWinOff; } - mbCalc = FALSE; + mbCalc = sal_False; } // ----------------------------------------------------------------------- @@ -1259,7 +1259,7 @@ void Ruler::ImplFormat() return; Size aVirDevSize; - BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO); + sal_Bool b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO); // VirtualDevice initialize if ( mnWinStyle & WB_HORZ ) @@ -1273,7 +1273,7 @@ void Ruler::ImplFormat() aVirDevSize.Width() = mnVirHeight; } if ( aVirDevSize != maVirDev.GetOutputSizePixel() ) - maVirDev.SetOutputSizePixel( aVirDevSize, TRUE ); + maVirDev.SetOutputSizePixel( aVirDevSize, sal_True ); else maVirDev.Erase(); @@ -1413,12 +1413,12 @@ void Ruler::ImplFormat() ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) ); // Wir haben formatiert - mbFormat = FALSE; + mbFormat = sal_False; } // ----------------------------------------------------------------------- -void Ruler::ImplInitExtraField( BOOL bUpdate ) +void Ruler::ImplInitExtraField( sal_Bool bUpdate ) { // Extra-Field beruecksichtigen if ( mnWinStyle & WB_EXTRAFIELD ) @@ -1448,8 +1448,8 @@ void Ruler::ImplInitExtraField( BOOL bUpdate ) if ( bUpdate ) { - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; Invalidate(); } } @@ -1487,17 +1487,17 @@ void Ruler::ImplDraw() DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev ); // Positionslinien neu malen - ImplInvertLines( TRUE ); + ImplInvertLines( sal_True ); } } // ----------------------------------------------------------------------- -void Ruler::ImplDrawExtra( BOOL bPaint ) +void Ruler::ImplDrawExtra( sal_Bool bPaint ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Rectangle aRect = maExtraRect; - BOOL bEraseRect = FALSE; + sal_Bool bEraseRect = sal_False; if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { @@ -1520,14 +1520,14 @@ void Ruler::ImplDrawExtra( BOOL bPaint ) SetFillColor( rStyleSettings.GetFaceColor() ); else SetFillColor( rStyleSettings.GetWindowColor() ); - bEraseRect = TRUE; + bEraseRect = sal_True; } else { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) ) { SetFillColor( rStyleSettings.GetCheckedColor() ); - bEraseRect = TRUE; + bEraseRect = sal_True; } } @@ -1551,7 +1551,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint ) } else if ( meExtraType == RULER_EXTRA_TAB ) { - USHORT nTabStyle = mnExtraStyle & RULER_TAB_STYLE; + sal_uInt16 nTabStyle = mnExtraStyle & RULER_TAB_STYLE; if(mpData->bTextRTL) nTabStyle |= RULER_TAB_RTL; Point aCenter = aRect.Center(); @@ -1578,7 +1578,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint ) // ----------------------------------------------------------------------- -void Ruler::ImplUpdate( BOOL bMustCalc ) +void Ruler::ImplUpdate( sal_Bool bMustCalc ) { // Hier schon Linien loeschen, damit Sie vor dem Neuberechnen schon // geloscht sind, da danach die alten Positionen nicht mehr bestimmt @@ -1588,8 +1588,8 @@ void Ruler::ImplUpdate( BOOL bMustCalc ) // Flags setzen if ( bMustCalc ) - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; // Wenn wir am Draggen sind, wird nach dem Drag-Handler automatisch // das Lineal neu upgedatet @@ -1607,11 +1607,11 @@ void Ruler::ImplUpdate( BOOL bMustCalc ) // ----------------------------------------------------------------------- -BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, - BOOL bRequireStyle, USHORT nRequiredStyle ) const +sal_Bool Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, + sal_Bool bRequireStyle, sal_uInt16 nRequiredStyle ) const { - USHORT i; - USHORT nStyle; + sal_uInt16 i; + sal_uInt16 nStyle; long nHitBottom; long nX; long nY; @@ -1619,10 +1619,10 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, long n2; if ( !mbActive ) - return FALSE; + return sal_False; // Position ermitteln - BOOL bIsHori = 0 != (mnWinStyle & WB_HORZ); + sal_Bool bIsHori = 0 != (mnWinStyle & WB_HORZ); if ( bIsHori ) { nX = rPos.X(); @@ -1638,8 +1638,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, // --> FME 2004-08-05 #i32608# pHitTest->nAryPos = 0; pHitTest->mnDragSize = 0; - pHitTest->bSize = FALSE; - pHitTest->bSizeBar = FALSE; + pHitTest->bSize = sal_False; + pHitTest->bSizeBar = sal_False; // <-- // Damit ueberstehende Tabs und Einzuege mit beruecksichtigt werden @@ -1657,7 +1657,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->nPos = 0; pHitTest->eType = RULER_TYPE_OUTSIDE; - return FALSE; + return sal_False; } nX -= mpData->nNullVirOff; @@ -1703,7 +1703,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->eType = RULER_TYPE_TAB; pHitTest->nAryPos = i-1; - return TRUE; + return sal_True; } } } @@ -1744,7 +1744,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->eType = RULER_TYPE_INDENT; pHitTest->nAryPos = i-1; - return TRUE; + return sal_True; } } } @@ -1755,7 +1755,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->nPos = 0; pHitTest->eType = RULER_TYPE_OUTSIDE; - return FALSE; + return sal_False; } // Danach die Spalten testen @@ -1790,7 +1790,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { if ( nStyle & RULER_BORDER_MOVEABLE ) { - pHitTest->bSizeBar = TRUE; + pHitTest->bSizeBar = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE; } } @@ -1810,25 +1810,25 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, if ( nX <= n1+nMOff ) { - pHitTest->bSize = TRUE; + pHitTest->bSize = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_1; } else if ( nX >= n2-nMOff ) { - pHitTest->bSize = TRUE; + pHitTest->bSize = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_2; } else { if ( nStyle & RULER_BORDER_MOVEABLE ) { - pHitTest->bSizeBar = TRUE; + pHitTest->bSizeBar = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE; } } } - return TRUE; + return sal_True; } } } @@ -1842,8 +1842,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) ) { pHitTest->eType = RULER_TYPE_MARGIN1; - pHitTest->bSize = TRUE; - return TRUE; + pHitTest->bSize = sal_True; + return sal_True; } } if ( (mpData->nMargin2Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE ) @@ -1852,8 +1852,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) ) { pHitTest->eType = RULER_TYPE_MARGIN2; - pHitTest->bSize = TRUE; - return TRUE; + pHitTest->bSize = sal_True; + return sal_True; } } @@ -1898,28 +1898,28 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->eType = RULER_TYPE_TAB; pHitTest->nAryPos = i-1; - return TRUE; + return sal_True; } } } } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, +sal_Bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const { Point aPos = rPos; - BOOL bRequiredStyle = FALSE; - USHORT nRequiredStyle = 0; + sal_Bool bRequiredStyle = sal_False; + sal_uInt16 nRequiredStyle = 0; if (eDragType == RULER_TYPE_INDENT) { - bRequiredStyle = TRUE; + bRequiredStyle = sal_True; nRequiredStyle = RULER_INDENT_BOTTOM; } @@ -1939,7 +1939,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) - return TRUE; + return sal_True; } } @@ -1955,7 +1955,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) - return TRUE; + return sal_True; } } @@ -1971,25 +1971,25 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, if ( ImplHitTest( aPos, pHitTest ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) - return TRUE; + return sal_True; } } // Auf DontKnow setzen pHitTest->eType = RULER_TYPE_DONTKNOW; - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier ) +sal_Bool Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier ) { // Wenn eine Spalte angeklick wurde, die weder verschiebar noch // in der Groesse aenderbar ist, brauchen wir auch kein Drag ausloesen if ( (pHitTest->eType == RULER_TYPE_BORDER) && !pHitTest->bSize && !pHitTest->bSizeBar ) - return FALSE; + return sal_False; // Dragdaten setzen meDragType = pHitTest->eType; @@ -2006,10 +2006,10 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier ) // Wenn der Handler das Draggen erlaubt, dann das Draggen // initialisieren ImplInvertLines(); - mbDrag = TRUE; + mbDrag = sal_True; mnStartDragPos = mnDragPos; StartTracking(); - return TRUE; + return sal_True; } else { @@ -2022,7 +2022,7 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier ) mpData = mpSaveData; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2061,18 +2061,18 @@ void Ruler::ImplDrag( const Point& rPos ) nX -= mpData->nNullVirOff; // Wenn oberhalb oder links vom Lineal, dann alte Werte - mbDragDelete = FALSE; + mbDragDelete = sal_False; if ( nY < 0 ) { if ( !mbDragCanceled ) { // Daten wiederherstellen - mbDragCanceled = TRUE; + mbDragCanceled = sal_True; ImplRulerData aTempData; aTempData = *mpDragData; *mpDragData = *mpSaveData; - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; // Handler rufen mnDragPos = mnStartDragPos; @@ -2093,11 +2093,11 @@ void Ruler::ImplDrag( const Point& rPos ) } else { - mbDragCanceled = FALSE; + mbDragCanceled = sal_False; // +2, damit nicht so schnell die Tabs geloescht werden if ( nY > nOutHeight+2 ) - mbDragDelete = TRUE; + mbDragDelete = sal_True; mnDragPos = nX; @@ -2122,7 +2122,7 @@ void Ruler::ImplEndDrag() else *mpSaveData = *mpDragData; mpData = mpSaveData; - mbDrag = FALSE; + mbDrag = sal_False; // Handler rufen EndDrag(); @@ -2132,8 +2132,8 @@ void Ruler::ImplEndDrag() mnDragPos = 0; mnDragAryPos = 0; mnDragSize = 0; - mbDragCanceled = FALSE; - mbDragDelete = FALSE; + mbDragCanceled = sal_False; + mbDragDelete = sal_False; mnDragModifier = 0; mnDragScroll = 0; mnStartDragPos = 0; @@ -2170,8 +2170,8 @@ void Ruler::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.IsLeft() && !IsTracking() ) { Point aMousePos = rMEvt.GetPosPixel(); - USHORT nMouseClicks = rMEvt.GetClicks(); - USHORT nMouseModifier = rMEvt.GetModifier(); + sal_uInt16 nMouseClicks = rMEvt.GetClicks(); + sal_uInt16 nMouseModifier = rMEvt.GetModifier(); // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) @@ -2277,8 +2277,8 @@ void Ruler::Tracking( const TrackingEvent& rTEvt ) // Bei Abbruch, den alten Status wieder herstellen if ( rTEvt.IsTrackingCanceled() ) { - mbDragCanceled = TRUE; - mbFormat = TRUE; + mbDragCanceled = sal_True; + mbFormat = sal_True; } ImplEndDrag(); @@ -2327,7 +2327,7 @@ void Ruler::Paint( const Rectangle& ) } // Imhalt vom Extrafeld ausgeben - ImplDrawExtra( TRUE ); + ImplDrawExtra( sal_True ); } if ( mnWinStyle & WB_BORDER ) @@ -2392,7 +2392,7 @@ void Ruler::Resize() } // Hier schon Linien loeschen - BOOL bVisible = IsReallyVisible(); + sal_Bool bVisible = IsReallyVisible(); if ( bVisible && mpData->nLines ) { ImplInvertLines(); @@ -2400,7 +2400,7 @@ void Ruler::Resize() if ( !mnUpdateEvtId ) mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL ); } - mbFormat = TRUE; + mbFormat = sal_True; // Wenn sich die Hoehe bzw. Breite aendert, dann muessen besimmte Werte // neu berechnet werden @@ -2408,15 +2408,15 @@ void Ruler::Resize() ImplInitExtraField( mpData->bTextRTL ); if ( nNewHeight ) { - mbCalc = TRUE; + mbCalc = sal_True; mnVirHeight = nNewHeight - mnBorderWidth - (RULER_OFF*2); } else { if ( mpData->bAutoPageWidth ) - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); else if ( mbAutoWinWidth ) - mbCalc = TRUE; + mbCalc = sal_True; } // Wenn Ruler eine Groesse hat, dann Groesse vom VirtualDevice setzen @@ -2490,17 +2490,17 @@ void Ruler::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -2517,8 +2517,8 @@ void Ruler::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - mbFormat = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } @@ -2530,7 +2530,7 @@ long Ruler::StartDrag() if ( maStartDragHdl.IsSet() ) return maStartDragHdl.Call( this ); else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2572,9 +2572,9 @@ void Ruler::ExtraDown() void Ruler::Activate() { - mbActive = TRUE; + mbActive = sal_True; - // Positionslinien wieder anzeigen (erst hinter mbActive=TRUE rufen, da + // Positionslinien wieder anzeigen (erst hinter mbActive=sal_True rufen, da // von ImplInvertLines() ausgewertet wird). Das Zeichnen der Linien // wird verzoegert, damit im vermutlich noch nicht gepainteten Zustand // Linien gezeichnet werden. @@ -2587,25 +2587,25 @@ void Ruler::Activate() void Ruler::Deactivate() { - // Positionslinien loeschen (schon vor mbActive=FALSE rufen, da + // Positionslinien loeschen (schon vor mbActive=sal_False rufen, da // von ImplInvertLines() ausgewertet wird) ImplInvertLines(); - mbActive = FALSE; + mbActive = sal_False; } // ----------------------------------------------------------------------- -BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) +sal_Bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) { if ( !mbDrag ) { Point aMousePos = rMEvt.GetPosPixel(); - USHORT nMouseClicks = rMEvt.GetClicks(); - USHORT nMouseModifier = rMEvt.GetModifier(); + sal_uInt16 nMouseClicks = rMEvt.GetClicks(); + sal_uInt16 nMouseModifier = rMEvt.GetModifier(); ImplRulerHitTest aHitTest; if(eDragType != RULER_TYPE_DONTKNOW) - aHitTest.bExpandTest = TRUE; + aHitTest.bExpandTest = sal_True; // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) @@ -2654,17 +2654,17 @@ BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) mnDragPos = 0; mnDragAryPos = 0; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType, - USHORT* pAryPos ) const + sal_uInt16* pAryPos ) const { ImplRulerHitTest aHitTest; @@ -2698,7 +2698,7 @@ void Ruler::CancelDrag() // ----------------------------------------------------------------------- -RulerType Ruler::GetType( const Point& rPos, USHORT* pAryPos ) const +RulerType Ruler::GetType( const Point& rPos, sal_uInt16* pAryPos ) const { ImplRulerHitTest aHitTest; @@ -2725,14 +2725,14 @@ void Ruler::SetWinPos( long nNewOff, long nNewWidth ) { // Gegebenenfalls werden die Breiten automatisch berechnet if ( !nNewWidth ) - mbAutoWinWidth = TRUE; + mbAutoWinWidth = sal_True; else - mbAutoWinWidth = FALSE; + mbAutoWinWidth = sal_False; // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet) mnWinOff = nNewOff; mnWinWidth = nNewWidth; - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); } // ----------------------------------------------------------------------- @@ -2745,14 +2745,14 @@ void Ruler::SetPagePos( long nNewOff, long nNewWidth ) // Gegebenenfalls werden die Breiten automatisch berechnet if ( !nNewWidth ) - mpData->bAutoPageWidth = TRUE; + mpData->bAutoPageWidth = sal_True; else - mpData->bAutoPageWidth = FALSE; + mpData->bAutoPageWidth = sal_False; // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet) mpData->nPageOff = nNewOff; mpData->nPageWidth = nNewWidth; - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); } // ----------------------------------------------------------------------- @@ -2836,14 +2836,14 @@ void Ruler::SetZoom( const Fraction& rNewZoom ) // ----------------------------------------------------------------------- -void Ruler::SetExtraType( RulerExtra eNewExtraType, USHORT nStyle ) +void Ruler::SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle ) { if ( mnWinStyle & WB_EXTRAFIELD ) { meExtraType = eNewExtraType; mnExtraStyle = nStyle; if ( IsReallyVisible() && IsUpdateMode() ) - ImplDrawExtra( FALSE ); + ImplDrawExtra( sal_False ); } } @@ -2860,7 +2860,7 @@ void Ruler::SetNullOffset( long nPos ) // ----------------------------------------------------------------------- -void Ruler::SetMargin1( long nPos, USHORT nMarginStyle ) +void Ruler::SetMargin1( long nPos, sal_uInt16 nMarginStyle ) { if ( (mpData->nMargin1 != nPos) || (mpData->nMargin1Style != nMarginStyle) ) { @@ -2872,7 +2872,7 @@ void Ruler::SetMargin1( long nPos, USHORT nMarginStyle ) // ----------------------------------------------------------------------- -void Ruler::SetMargin2( long nPos, USHORT nMarginStyle ) +void Ruler::SetMargin2( long nPos, sal_uInt16 nMarginStyle ) { DBG_ASSERT( (nPos >= mpData->nMargin1) || (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || @@ -2889,12 +2889,12 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle ) // ----------------------------------------------------------------------- -void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) +void Ruler::SetLines( sal_uInt16 n, const RulerLine* pLineAry ) { // To determine if what has changed if ( mpData->nLines == n ) { - USHORT i = n; + sal_uInt16 i = n; const RulerLine* pAry1 = mpData->pLines; const RulerLine* pAry2 = pLineAry; while ( i ) @@ -2911,11 +2911,11 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) } // New values and new share issue - BOOL bMustUpdate; + sal_Bool bMustUpdate; if ( IsReallyVisible() && IsUpdateMode() ) - bMustUpdate = TRUE; + bMustUpdate = sal_True; else - bMustUpdate = FALSE; + bMustUpdate = sal_False; // Delete old lines if ( bMustUpdate ) @@ -2949,7 +2949,7 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) // ----------------------------------------------------------------------- -void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry ) +void Ruler::SetArrows( sal_uInt16 n, const RulerArrow* pArrowAry ) { if ( !n || !pArrowAry ) { @@ -2969,7 +2969,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerArrow* pAry1 = mpData->pArrows; const RulerArrow* pAry2 = pArrowAry; while ( i ) @@ -2995,7 +2995,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry ) // ----------------------------------------------------------------------- -void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry ) +void Ruler::SetBorders( sal_uInt16 n, const RulerBorder* pBrdAry ) { if ( !n || !pBrdAry ) { @@ -3015,7 +3015,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerBorder* pAry1 = mpData->pBorders; const RulerBorder* pAry2 = pBrdAry; while ( i ) @@ -3040,7 +3040,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry ) // ----------------------------------------------------------------------- -void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry ) +void Ruler::SetIndents( sal_uInt16 n, const RulerIndent* pIndentAry ) { if ( !n || !pIndentAry ) @@ -3061,7 +3061,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerIndent* pAry1 = mpData->pIndents; const RulerIndent* pAry2 = pIndentAry; while ( i ) @@ -3085,7 +3085,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry ) // ----------------------------------------------------------------------- -void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry ) +void Ruler::SetTabs( sal_uInt16 n, const RulerTab* pTabAry ) { if ( !n || !pTabAry ) { @@ -3105,7 +3105,7 @@ void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerTab* pAry1 = mpData->pTabs; const RulerTab* pAry2 = pTabAry; while ( i ) @@ -3134,17 +3134,17 @@ void Ruler::SetStyle( WinBits nStyle ) if ( mnWinStyle != nStyle ) { mnWinStyle = nStyle; - ImplInitExtraField( TRUE ); + ImplInitExtraField( sal_True ); } } // ----------------------------------------------------------------------- -void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle ) +void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ) { /*const StyleSettings& rStyleSettings =*/ pDevice->GetSettings().GetStyleSettings(); Point aPos( rPos ); - USHORT nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL); + sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL); pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); pDevice->SetLineColor(); @@ -3156,13 +3156,13 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle ) /* -----------------16.10.2002 15:17----------------- * * --------------------------------------------------*/ -void Ruler::SetTextRTL(BOOL bRTL) +void Ruler::SetTextRTL(sal_Bool bRTL) { if(mpData->bTextRTL != bRTL) { mpData->bTextRTL = bRTL; if ( IsReallyVisible() && IsUpdateMode() ) - ImplInitExtraField( TRUE ); + ImplInitExtraField( sal_True ); } } @@ -3170,15 +3170,15 @@ long Ruler::GetPageOffset() const { return mpData->nPageOff; } long Ruler::GetPageWidth() const { return mpData->nPageWidth; } long Ruler::GetNullOffset() const { return mpData->nNullOff; } long Ruler::GetMargin1() const { return mpData->nMargin1; } -USHORT Ruler::GetMargin1Style() const { return mpData->nMargin1Style; } +sal_uInt16 Ruler::GetMargin1Style() const { return mpData->nMargin1Style; } long Ruler::GetMargin2() const { return mpData->nMargin2; } -USHORT Ruler::GetMargin2Style() const { return mpData->nMargin2Style; } -USHORT Ruler::GetLineCount() const { return mpData->nLines; } +sal_uInt16 Ruler::GetMargin2Style() const { return mpData->nMargin2Style; } +sal_uInt16 Ruler::GetLineCount() const { return mpData->nLines; } const RulerLine* Ruler::GetLines() const { return mpData->pLines; } -USHORT Ruler::GetArrowCount() const { return mpData->nArrows; } +sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; } const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; } -USHORT Ruler::GetBorderCount() const { return mpData->nBorders; } +sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; } const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; } -USHORT Ruler::GetIndentCount() const { return mpData->nIndents; } +sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; } const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; } diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx index 191dedfabe98..7e657ba56ce8 100755 --- a/svtools/source/control/scriptedtext.cxx +++ b/svtools/source/control/scriptedtext.cxx @@ -233,7 +233,7 @@ void SvtScriptedTextHelper_Impl::CalculateBreaks( const uno::Reference< i18n::XB nScript = i18n::ScriptType::LATIN; while( (nScript != i18n::ScriptType::WEAK) && (nCharIx == nNextCharIx) ) { - nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< USHORT >(nCharIx), sal::static_int_cast< USHORT >(nNextPos - nCharIx) ); + nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< sal_uInt16 >(nCharIx), sal::static_int_cast< sal_uInt16 >(nNextPos - nCharIx) ); if( nCharIx == nNextCharIx ) ++nScript; } diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx index 364c938f3f65..ab4946a8400b 100755 --- a/svtools/source/control/scrwin.cxx +++ b/svtools/source/control/scrwin.cxx @@ -35,10 +35,10 @@ void ScrollableWindow::ImpInitialize( ScrollableWindowFlags nFlags ) { - bHandleDragging = (BOOL) ( nFlags & SCRWIN_THUMBDRAGGING ); + bHandleDragging = (sal_Bool) ( nFlags & SCRWIN_THUMBDRAGGING ); bVCenter = (nFlags & SCRWIN_VCENTER) == SCRWIN_VCENTER; bHCenter = (nFlags & SCRWIN_HCENTER) == SCRWIN_HCENTER; - bScrolling = FALSE; + bScrolling = sal_False; // set the handlers for the scrollbars aVScroll.SetScrollHdl( LINK(this, ScrollableWindow, ScrollHdl) ); @@ -139,7 +139,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll ) { // notify the start of scrolling, if not already scrolling if ( !bScrolling ) - StartScroll(), bScrolling = TRUE; + StartScroll(), bScrolling = sal_True; // get the delta in logic coordinates Size aDelta( PixelToLogic( Size( aHScroll.GetDelta(), aVScroll.GetDelta() ) ) ); @@ -154,7 +154,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll ) } // notify the end of scrolling - bScrolling = FALSE; + bScrolling = sal_False; EndScroll( aDelta.Width(), aDelta.Height() ); return 0; } @@ -165,7 +165,7 @@ IMPL_LINK( ScrollableWindow, ScrollHdl, ScrollBar *, pScroll ) { // notify the start of scrolling, if not already scrolling if ( !bScrolling ) - StartScroll(), bScrolling = TRUE; + StartScroll(), bScrolling = sal_True; if ( bHandleDragging ) { @@ -189,25 +189,25 @@ void __EXPORT ScrollableWindow::Resize() // determine the size of the output-area and if we need scrollbars const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); - BOOL bVVisible = FALSE; // by default no vertical-ScrollBar - BOOL bHVisible = FALSE; // by default no horizontal-ScrollBar - BOOL bChanged; // determines if a visiblility was changed + sal_Bool bVVisible = sal_False; // by default no vertical-ScrollBar + sal_Bool bHVisible = sal_False; // by default no horizontal-ScrollBar + sal_Bool bChanged; // determines if a visiblility was changed do { - bChanged = FALSE; + bChanged = sal_False; // does we need a vertical ScrollBar if ( aOutPixSz.Width() < aTotPixSz.Width() && !bHVisible ) - { bHVisible = TRUE; + { bHVisible = sal_True; aOutPixSz.Height() -= nScrSize; - bChanged = TRUE; + bChanged = sal_True; } // does we need a horizontal ScrollBar if ( aOutPixSz.Height() < aTotPixSz.Height() && !bVVisible ) - { bVVisible = TRUE; + { bVVisible = sal_True; aOutPixSz.Width() -= nScrSize; - bChanged = TRUE; + bChanged = sal_True; } } @@ -355,10 +355,10 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize ) Window::GetOutputSizePixel().Height()); Size aWill( aWish.GetIntersection(aMax).GetSize() ); - BOOL bHScroll = FALSE; + sal_Bool bHScroll = sal_False; const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); if ( aWill.Width() < aWish.GetSize().Width() ) - { bHScroll = TRUE; + { bHScroll = sal_True; aWill.Height() = Min( aWill.Height()+nScrSize, aMax.GetSize().Height() ); } @@ -373,7 +373,7 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize ) //------------------------------------------------------------------- -BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy ) +sal_Bool ScrollableWindow::MakeVisible( const Rectangle& rTarget, sal_Bool bSloppy ) { Rectangle aTarget; Rectangle aTotRect( Point(0, 0), PixelToLogic( aTotPixSz ) ); @@ -436,7 +436,7 @@ BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy ) // is the area already visible? Rectangle aVisArea( GetVisibleArea() ); if ( aVisArea.IsInside(rTarget) ) - return TRUE; + return sal_True; // is there somewhat to scroll? if ( aVisArea.TopLeft() != aTarget.TopLeft() ) @@ -465,7 +465,7 @@ Rectangle ScrollableWindow::GetVisibleArea() const //------------------------------------------------------------------- -void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert ) +void ScrollableWindow::SetLineSize( sal_uLong nHorz, sal_uLong nVert ) { Size aPixSz( LogicToPixel( Size(nHorz, nVert) ) ); nColumnPixW = aPixSz.Width(); @@ -476,7 +476,7 @@ void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert ) //------------------------------------------------------------------- -void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, USHORT ) +void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 ) { if ( !bScrolling ) StartScroll(); @@ -561,8 +561,8 @@ void ScrollableWindow::ScrollLines( long nLinesX, long nLinesY ) //------------------------------------------------------------------- -void ScrollableWindow::ScrollPages( long nPagesX, ULONG nOverlapX, - long nPagesY, ULONG nOverlapY ) +void ScrollableWindow::ScrollPages( long nPagesX, sal_uLong nOverlapX, + long nPagesY, sal_uLong nOverlapY ) { Size aOutSz( GetVisibleArea().GetSize() ); Scroll( nPagesX * aOutSz.Width() + (nPagesX>0 ? 1 : -1) * nOverlapX, diff --git a/svtools/source/control/stdctrl.cxx b/svtools/source/control/stdctrl.cxx index 14c8cade3092..fb42b42dc7f3 100644..100755 --- a/svtools/source/control/stdctrl.cxx +++ b/svtools/source/control/stdctrl.cxx @@ -80,7 +80,7 @@ namespace svt // make it transparent SetControlBackground(); SetBackground(); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); } // ----------------------------------------------------------------------- diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index 9df32d74fc59..94c15a8604d2 100755 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -76,13 +76,13 @@ void FontNameMenu::Fill( const FontList* pList ) const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); // more than 100 fonts reduces the speed of opening the menu. // So only the first 100 fonts will be displayed. - USHORT nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< USHORT >(100) ); - for ( USHORT i = 0; i < nFontCount; i++ ) + sal_uInt16 nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< sal_uInt16 >(100) ); + for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { const XubString& rName = pList->GetFontName( i ).GetName(); // sort with the I18nHelper - USHORT j = GetItemCount(); + sal_uInt16 j = GetItemCount(); while ( j ) { XubString aText = GetItemText( GetItemId( j-1 ) ); @@ -103,11 +103,11 @@ void FontNameMenu::SetCurName( const XubString& rName ) maCurName = rName; // Menueintrag checken - USHORT nChecked = 0; - USHORT nItemCount = GetItemCount(); - for( USHORT i = 0; i < nItemCount; i++ ) + sal_uInt16 nChecked = 0; + sal_uInt16 nItemCount = GetItemCount(); + for( sal_uInt16 i = 0; i < nItemCount; i++ ) { - USHORT nItemId = GetItemId( i ); + sal_uInt16 nItemId = GetItemId( i ); if ( IsItemChecked( nItemId ) ) nChecked = nItemId; @@ -115,13 +115,13 @@ void FontNameMenu::SetCurName( const XubString& rName ) XubString aText = GetItemText( nItemId ); if ( aText == maCurName ) { - CheckItem( nItemId, TRUE ); + CheckItem( nItemId, sal_True ); return; } } if ( nChecked ) - CheckItem( nChecked, FALSE ); + CheckItem( nChecked, sal_False ); } // ======================================================================== @@ -141,7 +141,7 @@ FontStyleMenu::~FontStyleMenu() void FontStyleMenu::Select() { - USHORT nCurId = GetCurItemId(); + sal_uInt16 nCurId = GetCurItemId(); if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) ) { @@ -156,7 +156,7 @@ void FontStyleMenu::Select() void FontStyleMenu::Highlight() { - USHORT nCurId = GetCurItemId(); + sal_uInt16 nCurId = GetCurItemId(); if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) ) { @@ -171,22 +171,22 @@ void FontStyleMenu::Highlight() // ----------------------------------------------------------------------- -BOOL FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, USHORT nCount ) +sal_Bool FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, sal_uInt16 nCount ) { - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { if ( GetItemText( i+FONTSTYLEMENU_FIRSTID ) == rStyleName ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) { - USHORT nItemId = GetItemId( 0 ); + sal_uInt16 nItemId = GetItemId( 0 ); while ( (nItemId >= FONTSTYLEMENU_FIRSTID) && (nItemId <= FONTSTYLEMENU_LASTID) ) { @@ -199,16 +199,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) if ( hFontInfo ) { XubString aStyleText; - USHORT nPos = 0; - USHORT nId = FONTSTYLEMENU_FIRSTID; + sal_uInt16 nPos = 0; + sal_uInt16 nId = FONTSTYLEMENU_FIRSTID; FontWeight eLastWeight = WEIGHT_DONTKNOW; FontItalic eLastItalic = ITALIC_NONE; FontWidth eLastWidth = WIDTH_DONTKNOW; - BOOL bNormal = FALSE; - BOOL bItalic = FALSE; - BOOL bBold = FALSE; - BOOL bBoldItalic = FALSE; - BOOL bInsert = FALSE; + sal_Bool bNormal = sal_False; + sal_Bool bItalic = sal_False; + sal_Bool bBold = sal_False; + sal_Bool bBoldItalic = sal_False; + sal_Bool bInsert = sal_False; FontInfo aInfo; while ( hFontInfo ) { @@ -233,16 +233,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) if ( eWeight <= WEIGHT_NORMAL ) { if ( eItalic != ITALIC_NONE ) - bItalic = TRUE; + bItalic = sal_True; else - bNormal = TRUE; + bNormal = sal_True; } else { if ( eItalic != ITALIC_NONE ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; else - bBold = TRUE; + bBold = sal_True; } // For wrong StyleNames we replace this with the correct once @@ -276,11 +276,11 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) } if ( !bItalic && (aStyleText == pList->GetItalicStr()) ) - bItalic = TRUE; + bItalic = sal_True; else if ( !bBold && (aStyleText == pList->GetBoldStr()) ) - bBold = TRUE; + bBold = sal_True; else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; hFontInfo = pList->GetNextFontInfo( hFontInfo ); } @@ -345,11 +345,11 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle ) maCurStyle = rStyle; // Menueintrag checken - USHORT nChecked = 0; - USHORT nItemCount = GetItemCount(); - for( USHORT i = 0; i < nItemCount; i++ ) + sal_uInt16 nChecked = 0; + sal_uInt16 nItemCount = GetItemCount(); + for( sal_uInt16 i = 0; i < nItemCount; i++ ) { - USHORT nItemId = GetItemId( i ); + sal_uInt16 nItemId = GetItemId( i ); if ( (nItemId < FONTSTYLEMENU_FIRSTID) || (nItemId > FONTSTYLEMENU_LASTID) ) @@ -361,13 +361,13 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle ) XubString aText = GetItemText( nItemId ); if ( aText == maCurStyle ) { - CheckItem( nItemId, TRUE ); + CheckItem( nItemId, sal_True ); return; } } if ( nChecked ) - CheckItem( nChecked, FALSE ); + CheckItem( nChecked, sal_False ); } // ======================================================================== @@ -391,7 +391,7 @@ FontSizeMenu::~FontSizeMenu() void FontSizeMenu::Select() { - const USHORT nCurItemId = GetCurItemId(); + const sal_uInt16 nCurItemId = GetCurItemId(); mnCurHeight = mpHeightAry[ nCurItemId - 1 ]; maSelectHdl.Call( this ); } @@ -401,7 +401,7 @@ void FontSizeMenu::Select() void FontSizeMenu::Highlight() { const long nTempHeight = mnCurHeight; - const USHORT nCurItemId = GetCurItemId(); + const sal_uInt16 nCurItemId = GetCurItemId(); if ( !nCurItemId ) mnCurHeight = 0; else @@ -425,11 +425,11 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) const long* pTempAry; const long* pAry = pList->GetSizeAry( rInfo ); - USHORT nSizeCount = 0; + sal_uInt16 nSizeCount = 0; while ( pAry[nSizeCount] ) nSizeCount++; - USHORT nPos = 0; + sal_uInt16 nPos = 0; // first insert font size names (for simplified/traditional chinese) FontSizeNames aFontSizeNames( Application::GetSettings().GetUILanguage() ); @@ -439,8 +439,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) if ( pAry == pList->GetStdSizeAry() ) { // for scalable fonts all font size names - ULONG nCount = aFontSizeNames.Count(); - for( ULONG i = 0; i < nCount; i++ ) + sal_uLong nCount = aFontSizeNames.Count(); + for( sal_uLong i = 0; i < nCount; i++ ) { String aSizeName = aFontSizeNames.GetIndexName( i ); long nSize = aFontSizeNames.GetIndexSize( i ); @@ -474,7 +474,7 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) { mpHeightAry[nPos] = *pTempAry; nPos++; // Id is nPos+1 - InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, TRUE, FALSE ), MIB_RADIOCHECK | MIB_AUTOCHECK ); + InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, sal_True, sal_False ), MIB_RADIOCHECK | MIB_AUTOCHECK ); pTempAry++; } @@ -488,16 +488,16 @@ void FontSizeMenu::SetCurHeight( long nHeight ) mnCurHeight = nHeight; // check menue item - XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, TRUE, FALSE ); - USHORT nChecked = 0; - USHORT nItemCount = GetItemCount(); - for( USHORT i = 0; i < nItemCount; i++ ) + XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, sal_True, sal_False ); + sal_uInt16 nChecked = 0; + sal_uInt16 nItemCount = GetItemCount(); + for( sal_uInt16 i = 0; i < nItemCount; i++ ) { - USHORT nItemId = GetItemId( i ); + sal_uInt16 nItemId = GetItemId( i ); if ( mpHeightAry[i] == nHeight ) { - CheckItem( nItemId, TRUE ); + CheckItem( nItemId, sal_True ); return; } @@ -506,5 +506,5 @@ void FontSizeMenu::SetCurHeight( long nHeight ) } if ( nChecked ) - CheckItem( nChecked, FALSE ); + CheckItem( nChecked, sal_False ); } diff --git a/svtools/source/control/svxbox.cxx b/svtools/source/control/svxbox.cxx index d1ea47d110cd..451837026dbe 100644..100755 --- a/svtools/source/control/svxbox.cxx +++ b/svtools/source/control/svxbox.cxx @@ -42,17 +42,17 @@ SV_IMPL_PTRARR(SvxEntryLst, SvxBoxEntry*) SvxBoxEntry::SvxBoxEntry() : nId(LISTBOX_ENTRY_NOTFOUND), - bModified(FALSE), - bNew(FALSE) + bModified(sal_False), + bNew(sal_False) { } -SvxBoxEntry::SvxBoxEntry(const String& aNam, USHORT nIdx) : +SvxBoxEntry::SvxBoxEntry(const String& aNam, sal_uInt16 nIdx) : aName(aNam), nId(nIdx), - bModified(FALSE), - bNew(FALSE) + bModified(sal_False), + bNew(sal_False) { } @@ -99,8 +99,8 @@ __EXPORT SvxListBox::~SvxListBox() void SvxListBox::InitListBox() { // Verwaltung fuer die Stringlist aus der Resource aufbauen - USHORT nSize = GetEntryCount(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = GetEntryCount(); + for(sal_uInt16 i=0; i < nSize; ++i) { const SvxBoxEntry* pTmp = new SvxBoxEntry(ListBox::GetEntry(i), i); const SvxBoxEntry* &rpTmp = pTmp; aEntryLst.Insert(rpTmp, aEntryLst.Count()); @@ -114,7 +114,7 @@ void SvxListBox::InitListBox() void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry) { SvxBoxEntry* pNew = new SvxBoxEntry(rEntry); - pNew->bNew = TRUE; + pNew->bNew = sal_True; InsertSorted(pNew); } @@ -122,7 +122,7 @@ void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry) Beschreibung: Eintrag in die ListBox aufnehmen --------------------------------------------------------------------*/ -void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos) +void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, sal_uInt16 nPos) { if(nPos != LISTBOX_ENTRY_NOTFOUND) { @@ -139,7 +139,7 @@ void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos) Beschreibung: Eintrag aus der Liste loeschen --------------------------------------------------------------------*/ -void SvxListBox::RemoveEntry(USHORT nPos) +void SvxListBox::RemoveEntry(sal_uInt16 nPos) { if(nPos >= aEntryLst.Count()) return; @@ -163,7 +163,7 @@ void SvxListBox::RemoveEntry(USHORT nPos) void SvxListBox::RemoveEntry(const SvxBoxEntry& rEntry) { - USHORT nPos = ListBox::GetEntryPos(rEntry.aName); + sal_uInt16 nPos = ListBox::GetEntryPos(rEntry.aName); RemoveEntry(nPos); } @@ -182,7 +182,7 @@ void SvxListBox::Clear() Beschreibung: Position by Name --------------------------------------------------------------------*/ -USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const +sal_uInt16 SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const { return ListBox::GetEntryPos(rEntry.aName); } @@ -191,7 +191,7 @@ USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const Beschreibung: Rund um die Entries --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(sal_uInt16 nPos) const { if(nPos < aEntryLst.Count()) return *aEntryLst[nPos]; @@ -203,13 +203,13 @@ const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const Beschreibung: aktullen Eintrag zurueckgeben --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const +const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(sal_uInt16 nSelId) const { String aName(ListBox::GetSelectEntry(nSelId)); if(aName.Len() > 0) { - for (USHORT i=0; i < aEntryLst.Count(); i++) + for (sal_uInt16 i=0; i < aEntryLst.Count(); i++) { if(aEntryLst[i]->aName == aName ) return *aEntryLst[i]; @@ -222,11 +222,11 @@ const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const Beschreibung: modifizierte Eintraege --------------------------------------------------------------------*/ -USHORT SvxListBox::GetModifiedCount() const +sal_uInt16 SvxListBox::GetModifiedCount() const { - USHORT nMod = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nMod = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) nMod++; } @@ -237,7 +237,7 @@ USHORT SvxListBox::GetModifiedCount() const Beschreibung: Modifizierte Eintraege behandeln --------------------------------------------------------------------*/ -void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) +void SvxListBox::ModifyEntry(sal_uInt16 nPos, const String& rName) { if(nPos >= aEntryLst.Count()) return; @@ -245,7 +245,7 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) SvxBoxEntry* pEntry = aEntryLst[nPos]; aEntryLst.Remove(nPos, 1); aEntryLst[nPos]->aName = rName; - aEntryLst[nPos]->bModified = TRUE; + aEntryLst[nPos]->bModified = sal_True; ListBox::RemoveEntry(nPos); InsertSorted(pEntry); @@ -255,11 +255,11 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) Beschreibung: alle modifizierten Eintraege bahandeln --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetModifiedEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nMod = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nMod = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) { if(nMod == nPos) return *aEntryLst[i]; @@ -273,13 +273,13 @@ const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const Beschreibung: geloeschte Eintraege --------------------------------------------------------------------*/ -USHORT SvxListBox::GetRemovedCount() const +sal_uInt16 SvxListBox::GetRemovedCount() const { return aDelEntryLst.Count(); } -const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetRemovedEntry(sal_uInt16 nPos) const { if(nPos < aDelEntryLst.Count()) return *aDelEntryLst[nPos]; @@ -291,11 +291,11 @@ const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const Beschreibung: Neue Entries begutachten --------------------------------------------------------------------*/ -USHORT SvxListBox::GetNewCount() const +sal_uInt16 SvxListBox::GetNewCount() const { - USHORT nNew = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nNew = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) nNew++; } @@ -306,11 +306,11 @@ USHORT SvxListBox::GetNewCount() const Beschreibung: Alle neuen Eintraege ueberpruefen --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetNewEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nNew = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nNew = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) { if(nNew == nPos) return *aEntryLst[i]; @@ -327,7 +327,7 @@ const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const void SvxListBox::InsertSorted(SvxBoxEntry* pEntry) { ListBox::InsertEntry(pEntry->aName); - USHORT nPos = ListBox::GetEntryPos(pEntry->aName); + sal_uInt16 nPos = ListBox::GetEntryPos(pEntry->aName); aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); } @@ -335,7 +335,7 @@ void SvxListBox::InsertSorted(SvxBoxEntry* pEntry) Beschreibung: ComboBoxen mit Verwaltungseinheit --------------------------------------------------------------------*/ -SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) : +SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, sal_uInt16 nStyleBits) : ComboBox(pParent, nBits), nStyle(nStyleBits) { @@ -343,7 +343,7 @@ SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) : } -SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, USHORT nStyleBits ): +SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits ): ComboBox(pParent, rId), nStyle(nStyleBits) { @@ -367,8 +367,8 @@ __EXPORT SvxComboBox::~SvxComboBox() void SvxComboBox::InitComboBox() { // Verwaltung fuer die Stringlist aus der Resource aufbauen - USHORT nSize = GetEntryCount(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = GetEntryCount(); + for(sal_uInt16 i=0; i < nSize; ++i) { const SvxBoxEntry* pTmp = new SvxBoxEntry(ComboBox::GetEntry(i), i); const SvxBoxEntry* &rpTmp = pTmp; aEntryLst.Insert(rpTmp, aEntryLst.Count()); @@ -382,7 +382,7 @@ void SvxComboBox::InitComboBox() void SvxComboBox::InsertNewEntry(const SvxBoxEntry& rEntry) { SvxBoxEntry* pNew = new SvxBoxEntry(rEntry); - pNew->bNew = TRUE; + pNew->bNew = sal_True; InsertSorted(pNew); } @@ -399,7 +399,7 @@ void SvxComboBox::InsertEntry(const SvxBoxEntry& rEntry) Beschreibung: Eintrag aus der Liste loeschen --------------------------------------------------------------------*/ -void SvxComboBox::RemoveEntry(USHORT nPos) +void SvxComboBox::RemoveEntry(sal_uInt16 nPos) { if(nPos >= aEntryLst.Count()) return; @@ -423,7 +423,7 @@ void SvxComboBox::RemoveEntry(USHORT nPos) void SvxComboBox::RemoveEntry(const SvxBoxEntry& rEntry) { - USHORT nPos = ComboBox::GetEntryPos(rEntry.aName); + sal_uInt16 nPos = ComboBox::GetEntryPos(rEntry.aName); RemoveEntry(nPos); } @@ -443,7 +443,7 @@ void SvxComboBox::Clear() Beschreibung: Position by Name --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const +sal_uInt16 SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const { return ComboBox::GetEntryPos(rEntry.aName); } @@ -452,7 +452,7 @@ USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const Beschreibung: Rund um die Entries --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetEntry(sal_uInt16 nPos) const { if(nPos < aEntryLst.Count()) return *aEntryLst[nPos]; @@ -464,11 +464,11 @@ const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const Beschreibung: modifizierte Eintraege --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetModifiedCount() const +sal_uInt16 SvxComboBox::GetModifiedCount() const { - USHORT nMod = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nMod = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) nMod++; } @@ -479,7 +479,7 @@ USHORT SvxComboBox::GetModifiedCount() const Beschreibung: Modifizierte Eintraege behandeln --------------------------------------------------------------------*/ -void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) +void SvxComboBox::ModifyEntry(sal_uInt16 nPos, const String& rName) { if(nPos >= aEntryLst.Count()) return; @@ -487,7 +487,7 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) SvxBoxEntry* pEntry = aEntryLst[nPos]; aEntryLst.Remove(nPos, 1); aEntryLst[nPos]->aName = rName; - aEntryLst[nPos]->bModified = TRUE; + aEntryLst[nPos]->bModified = sal_True; ComboBox::RemoveEntry(nPos); InsertSorted(pEntry); @@ -497,11 +497,11 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) Beschreibung: alle modifizierten Eintraege bahandeln --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetModifiedEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nMod = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nMod = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) { if(nMod == nPos) return *aEntryLst[i]; @@ -515,13 +515,13 @@ const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const Beschreibung: geloeschte Eintraege --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetRemovedCount() const +sal_uInt16 SvxComboBox::GetRemovedCount() const { return aDelEntryLst.Count(); } -const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetRemovedEntry(sal_uInt16 nPos) const { if(nPos < aDelEntryLst.Count()) return *aDelEntryLst[nPos]; @@ -533,11 +533,11 @@ const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const Beschreibung: Neue Entries begutachten --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetNewCount() const +sal_uInt16 SvxComboBox::GetNewCount() const { - USHORT nNew = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nNew = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) nNew++; } @@ -548,11 +548,11 @@ USHORT SvxComboBox::GetNewCount() const Beschreibung: Alle neuen Eintraege ueberpruefen --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetNewEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nNew = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nNew = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) { if(nNew == nPos) return *aEntryLst[i]; @@ -569,7 +569,7 @@ const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const void SvxComboBox::InsertSorted(SvxBoxEntry* pEntry) { ComboBox::InsertEntry(pEntry->aName); - USHORT nPos = ComboBox::GetEntryPos(pEntry->aName); + sal_uInt16 nPos = ComboBox::GetEntryPos(pEntry->aName); aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); } diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 0c2800246061..033ae63e8a0a 100755 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -48,37 +48,37 @@ #define TABBAR_DRAG_SCROLLOFF 5 #define TABBAR_MINSIZE 5 -const USHORT ADDNEWPAGE_AREAWIDTH = 10; +const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10; // ======================================================================= struct ImplTabBarItem { - USHORT mnId; + sal_uInt16 mnId; TabBarPageBits mnBits; XubString maText; XubString maHelpText; Rectangle maRect; long mnWidth; rtl::OString maHelpId; - BOOL mbShort; - BOOL mbSelect; - BOOL mbEnable; + sal_Bool mbShort; + sal_Bool mbSelect; + sal_Bool mbEnable; Color maTabBgColor; - bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? sal_True : sal_False; }; Color maTabTextColor; - bool IsDefaultTabTextColor() const { return maTabTextColor == Color(COL_AUTO) ? TRUE : FALSE; }; + bool IsDefaultTabTextColor() const { return maTabTextColor == Color(COL_AUTO) ? sal_True : sal_False; }; - ImplTabBarItem( USHORT nItemId, const XubString& rText, + ImplTabBarItem( sal_uInt16 nItemId, const XubString& rText, TabBarPageBits nPageBits ) : maText( rText ) { mnId = nItemId; mnBits = nPageBits; mnWidth = 0; - mbShort = FALSE; - mbSelect = FALSE; - mbEnable = TRUE; + mbShort = sal_False; + mbSelect = sal_False; + mbEnable = sal_True; maTabBgColor = Color( COL_AUTO ); maTabTextColor = Color( COL_AUTO ); } @@ -112,7 +112,7 @@ long ImplTabButton::PreNotify( NotifyEvent& rNEvt ) if ( GetParent()->IsInEditMode() ) { GetParent()->EndEditMode(); - return TRUE; + return sal_True; } } @@ -228,7 +228,7 @@ class TabBarEdit : public Edit { private: Timer maLoseFocusTimer; - BOOL mbPostEvt; + sal_Bool mbPostEvt; DECL_LINK( ImplEndEditHdl, void* ); DECL_LINK( ImplEndTimerHdl, void* ); @@ -238,8 +238,8 @@ public: TabBar* GetParent() const { return (TabBar*)Window::GetParent(); } - void SetPostEvent() { mbPostEvt = TRUE; } - void ResetPostEvent() { mbPostEvt = FALSE; } + void SetPostEvent() { mbPostEvt = sal_True; } + void ResetPostEvent() { mbPostEvt = sal_False; } virtual long PreNotify( NotifyEvent& rNEvt ); virtual void LoseFocus(); @@ -250,7 +250,7 @@ public: TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) : Edit( pParent, nWinStyle ) { - mbPostEvt = FALSE; + mbPostEvt = sal_False; } // ----------------------------------------------------------------------- @@ -266,19 +266,19 @@ long TabBarEdit::PreNotify( NotifyEvent& rNEvt ) { if ( !mbPostEvt ) { - if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) ) - mbPostEvt = TRUE; + if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) ) + mbPostEvt = sal_True; } - return TRUE; + return sal_True; } else if ( pKEvt->GetKeyCode().GetCode() == KEY_ESCAPE ) { if ( !mbPostEvt ) { - if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)TRUE ) ) - mbPostEvt = TRUE; + if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_True ) ) + mbPostEvt = sal_True; } - return TRUE; + return sal_True; } } } @@ -292,8 +292,8 @@ void TabBarEdit::LoseFocus() { if ( !mbPostEvt ) { - if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) ) - mbPostEvt = TRUE; + if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) ) + mbPostEvt = sal_True; } Edit::LoseFocus(); @@ -308,7 +308,7 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel ) // We need this query, because the edit get a losefous event, // when it shows the context menu or the insert symbol dialog - if ( !HasFocus() && HasChildPathFocus( TRUE ) ) + if ( !HasFocus() && HasChildPathFocus( sal_True ) ) { maLoseFocusTimer.SetTimeout( 30 ); maLoseFocusTimer.SetTimeoutHdl( LINK( this, TabBarEdit, ImplEndTimerHdl ) ); @@ -329,10 +329,10 @@ IMPL_LINK( TabBarEdit, ImplEndTimerHdl, void*, EMPTYARG ) // We need this query, because the edit get a losefous event, // when it shows the context menu or the insert symbol dialog - if ( HasChildPathFocus( TRUE ) ) + if ( HasChildPathFocus( sal_True ) ) maLoseFocusTimer.Start(); else - GetParent()->EndEditMode( TRUE ); + GetParent()->EndEditMode( sal_True ); return 0; } @@ -380,25 +380,25 @@ void TabBar::ImplInit( WinBits nWinStyle ) mnDropPos = 0; mnSwitchId = 0; mnEditId = 0; - mbFormat = TRUE; - mbFirstFormat = TRUE; - mbSizeFormat = TRUE; - mbAutoMaxWidth = TRUE; - mbInSwitching = FALSE; - mbAutoEditMode = FALSE; - mbEditCanceled = FALSE; - mbDropPos = FALSE; - mbInSelect = FALSE; - mbSelColor = FALSE; - mbSelTextColor = FALSE; - mbMirrored = FALSE; + mbFormat = sal_True; + mbFirstFormat = sal_True; + mbSizeFormat = sal_True; + mbAutoMaxWidth = sal_True; + mbInSwitching = sal_False; + mbAutoEditMode = sal_False; + mbEditCanceled = sal_False; + mbDropPos = sal_False; + mbInSelect = sal_False; + mbSelColor = sal_False; + mbSelTextColor = sal_False; + mbMirrored = sal_False; if ( nWinStyle & WB_3DTAB ) mnOffY++; ImplInitControls(); SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) ); - ImplInitSettings( TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -413,7 +413,7 @@ TabBar::TabBar( Window* pParent, WinBits nWinStyle ) : TabBar::~TabBar() { - EndEditMode( TRUE ); + EndEditMode( sal_True ); // Controls loeschen if ( mpPrevBtn ) @@ -440,7 +440,7 @@ TabBar::~TabBar() // ----------------------------------------------------------------------- -void TabBar::ImplInitSettings( BOOL bFont, BOOL bBackground ) +void TabBar::ImplInitSettings( sal_Bool bFont, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -514,12 +514,12 @@ void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor, // ----------------------------------------------------------------------- -BOOL TabBar::ImplCalcWidth() +sal_Bool TabBar::ImplCalcWidth() { // Groessen muessen nur ermittelt werden, wenn sich Text aendert oder // wenn der Font geaendert wurde if ( !mbSizeFormat ) - return FALSE; + return sal_False; // Breiten der Tabs mit dem fetten Font ermitteln Font aFont = GetFont(); @@ -542,29 +542,29 @@ BOOL TabBar::ImplCalcWidth() else mnCurMaxWidth = 0; - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { long nNewWidth = GetTextWidth( pItem->maText ); if ( mnCurMaxWidth && (nNewWidth > mnCurMaxWidth) ) { - pItem->mbShort = TRUE; + pItem->mbShort = sal_True; nNewWidth = mnCurMaxWidth; } else - pItem->mbShort = FALSE; + pItem->mbShort = sal_False; nNewWidth += TABBAR_OFFSET_X+TABBAR_OFFSET_X2; if ( pItem->mnWidth != nNewWidth ) { pItem->mnWidth = nNewWidth; if ( !pItem->maRect.IsEmpty() ) - bChanged = TRUE; + bChanged = sal_True; } pItem = mpItemList->Next(); } - mbSizeFormat = FALSE; - mbFormat = TRUE; + mbSizeFormat = sal_False; + mbFormat = sal_True; return bChanged; } @@ -577,7 +577,7 @@ void TabBar::ImplFormat() if ( !mbFormat ) return; - USHORT n = 0; + sal_uInt16 n = 0; long x = mnOffX; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) @@ -612,7 +612,7 @@ void TabBar::ImplFormat() pItem = mpItemList->Next(); } - mbFormat = FALSE; + mbFormat = sal_False; // Button enablen/disablen ImplEnableControls(); @@ -620,13 +620,13 @@ void TabBar::ImplFormat() // ----------------------------------------------------------------------- -USHORT TabBar::ImplGetLastFirstPos() +sal_uInt16 TabBar::ImplGetLastFirstPos() { - USHORT nCount = (USHORT)(mpItemList->Count()); + sal_uInt16 nCount = (sal_uInt16)(mpItemList->Count()); if ( !nCount || mbSizeFormat || mbFormat ) return 0; - USHORT nLastFirstPos = nCount-1; + sal_uInt16 nLastFirstPos = nCount-1; long nWinWidth = mnLastOffX-mnOffX-TABBAR_OFFSET_X-ADDNEWPAGE_AREAWIDTH; long nWidth = mpItemList->GetObject( nLastFirstPos )->mnWidth; while ( nLastFirstPos && (nWidth < nWinWidth) ) @@ -634,7 +634,7 @@ USHORT TabBar::ImplGetLastFirstPos() nLastFirstPos--; nWidth += mpItemList->GetObject( nLastFirstPos )->mnWidth; } - if ( (nLastFirstPos != (USHORT)(mpItemList->Count()-1)) && + if ( (nLastFirstPos != (sal_uInt16)(mpItemList->Count()-1)) && (nWidth > nWinWidth) ) nLastFirstPos++; return nLastFirstPos; @@ -714,7 +714,7 @@ void TabBar::ImplEnableControls() return; // Buttons enablen/disblen - BOOL bEnableBtn = mnFirstPos > 0; + sal_Bool bEnableBtn = mnFirstPos > 0; if ( mpFirstBtn ) mpFirstBtn->Enable( bEnableBtn ); if ( mpPrevBtn ) @@ -729,7 +729,7 @@ void TabBar::ImplEnableControls() // ----------------------------------------------------------------------- -void TabBar::ImplShowPage( USHORT nPos ) +void TabBar::ImplShowPage( sal_uInt16 nPos ) { // Breite berechnen long nWidth = GetOutputSizePixel().Width(); @@ -742,7 +742,7 @@ void TabBar::ImplShowPage( USHORT nPos ) { while ( pItem->maRect.Right() > nWidth ) { - USHORT nNewPos = mnFirstPos+1; + sal_uInt16 nNewPos = mnFirstPos+1; SetFirstPageId( GetPageId( nNewPos ) ); ImplFormat(); if ( nNewPos != mnFirstPos ) @@ -757,7 +757,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn ) { EndEditMode(); - USHORT nNewPos = mnFirstPos; + sal_uInt16 nNewPos = mnFirstPos; if ( pBtn == mpFirstBtn ) nNewPos = 0; @@ -768,13 +768,13 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn ) } else if ( pBtn == mpNextBtn ) { - USHORT nCount = GetPageCount(); + sal_uInt16 nCount = GetPageCount(); if ( mnFirstPos < nCount ) nNewPos = mnFirstPos+1; } else { - USHORT nCount = GetPageCount(); + sal_uInt16 nCount = GetPageCount(); if ( nCount ) nNewPos = nCount-1; } @@ -789,7 +789,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn ) void TabBar::MouseMove( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeaveWindow() ) - mbInSelect = FALSE; + mbInSelect = sal_False; Window::MouseMove( rMEvt ); } @@ -807,14 +807,14 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) } ImplTabBarItem* pItem; - USHORT nSelId = GetPageId( rMEvt.GetPosPixel() ); + sal_uInt16 nSelId = GetPageId( rMEvt.GetPosPixel() ); if ( !rMEvt.IsLeft() ) { Window::MouseButtonDown( rMEvt ); if ( (nSelId > 0) && (nSelId != mnCurPageId) ) { - USHORT nPos = GetPagePos( nSelId ); + sal_uInt16 nPos = GetPagePos( nSelId ); pItem = mpItemList->GetObject( nPos ); if ( pItem->mbEnable ) @@ -826,7 +826,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) ImplActivatePage(); ImplSelect(); } - mbInSelect = TRUE; + mbInSelect = sal_True; } } return; @@ -842,8 +842,8 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) { if ( nSelId ) { - USHORT nPos = GetPagePos( nSelId ); - BOOL bSelectTab = FALSE; + sal_uInt16 nPos = GetPagePos( nSelId ); + sal_Bool bSelectTab = sal_False; pItem = mpItemList->GetObject( nPos ); if ( pItem->mbEnable ) @@ -853,15 +853,15 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( nSelId != mnCurPageId ) { SelectPage( nSelId, !IsPageSelected( nSelId ) ); - bSelectTab = TRUE; + bSelectTab = sal_True; } } else if ( mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT) ) { - bSelectTab = TRUE; - USHORT n; - BOOL bSelect; - USHORT nCurPos = GetPagePos( mnCurPageId ); + bSelectTab = sal_True; + sal_uInt16 n; + sal_Bool bSelect; + sal_uInt16 nCurPos = GetPagePos( mnCurPageId ); if ( nPos <= nCurPos ) { // Alle Tabs bis zur angeklickten Tab deselektieren @@ -872,9 +872,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) { pItem = mpItemList->GetObject( n ); if ( n < nPos ) - bSelect = FALSE; + bSelect = sal_False; else - bSelect = TRUE; + bSelect = sal_True; if ( pItem->mbSelect != bSelect ) { @@ -892,16 +892,16 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) // Alle Tabs von der aktuellen bis zur angeklickten // Tab selektieren und alle Tabs von der angeklickten // Tab bis zur letzten Tab deselektieren - USHORT nCount = (USHORT)mpItemList->Count(); + sal_uInt16 nCount = (sal_uInt16)mpItemList->Count(); n = nCurPos; while ( n < nCount ) { pItem = mpItemList->GetObject( n ); if ( n <= nPos ) - bSelect = TRUE; + bSelect = sal_True; else - bSelect = FALSE; + bSelect = sal_False; if ( pItem->mbSelect != bSelect ) { @@ -925,7 +925,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) } else ImplShowPage( nPos ); - mbInSelect = TRUE; + mbInSelect = sal_True; return; } @@ -935,7 +935,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) // Gegebenenfalls den Double-Click-Handler rufen if ( !rMEvt.GetModifier() && (!nSelId || (nSelId == mnCurPageId)) ) { - USHORT nOldCurId = mnCurPageId; + sal_uInt16 nOldCurId = mnCurPageId; mnCurPageId = nSelId; DoubleClick(); // Abfrage, da im DoubleClick-Handler die aktuelle Seite @@ -953,7 +953,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) // Nur Select ausfuehren, wenn noch nicht aktuelle Page if ( nSelId != mnCurPageId ) { - USHORT nPos = GetPagePos( nSelId ); + sal_uInt16 nPos = GetPagePos( nSelId ); pItem = mpItemList->GetObject( nPos ); if ( pItem->mbEnable ) @@ -961,9 +961,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( !pItem->mbSelect ) { // Muss invalidiert werden - BOOL bUpdate = FALSE; + sal_Bool bUpdate = sal_False; if ( IsReallyVisible() && IsUpdateMode() ) - bUpdate = TRUE; + bUpdate = sal_True; // Alle selektierten Items deselektieren pItem = mpItemList->First(); @@ -971,7 +971,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) { if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { - pItem->mbSelect = FALSE; + pItem->mbSelect = sal_False; if ( bUpdate ) Invalidate( pItem->maRect ); } @@ -990,7 +990,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) } else ImplShowPage( nPos ); - mbInSelect = TRUE; + mbInSelect = sal_True; } return; @@ -1004,7 +1004,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) void TabBar::MouseButtonUp( const MouseEvent& rMEvt ) { - mbInSelect = FALSE; + mbInSelect = sal_False; Window::MouseButtonUp( rMEvt ); } @@ -1013,7 +1013,7 @@ void TabBar::MouseButtonUp( const MouseEvent& rMEvt ) void TabBar::Paint( const Rectangle& ) { // Items berechnen und ausgeben - USHORT nItemCount = (USHORT)mpItemList->Count(); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); ImplTabBarItem* pItem; // kein Item, dann auch nichts zu tun @@ -1026,7 +1026,7 @@ void TabBar::Paint( const Rectangle& ) // sichtbar wird if ( mbFirstFormat ) { - mbFirstFormat = FALSE; + mbFirstFormat = sal_False; if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos ) { @@ -1035,9 +1035,9 @@ void TabBar::Paint( const Rectangle& ) { // mbDropPos setzen (bzw. misbrauchen) um Invalidate() // zu unterbinden - mbDropPos = TRUE; + mbDropPos = sal_True; SetFirstPageId( mnCurPageId ); - mbDropPos = FALSE; + mbDropPos = sal_False; if ( mnFirstPos != 0 ) ImplFormat(); } @@ -1086,7 +1086,7 @@ void TabBar::Paint( const Rectangle& ) if ( nItemCount ) { // letzten sichtbaren Eintrag suchen - USHORT n = mnFirstPos+1; + sal_uInt16 n = mnFirstPos+1; if ( n >= nItemCount ) n = nItemCount-1; pItem = mpItemList->Seek( n ); @@ -1310,7 +1310,7 @@ void TabBar::Resize() // Scroll-Buttons anordnen long nHeight = aNewSize.Height(); // Font in der groesse Anpassen? - ImplInitSettings( TRUE, FALSE ); + ImplInitSettings( sal_True, sal_False ); long nX = mbMirrored ? (aNewSize.Width()-nHeight) : 0; long nXDiff = mbMirrored ? -nHeight : nHeight; @@ -1356,7 +1356,7 @@ void TabBar::Resize() } // Neu formatieren - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; if ( IsReallyVisible() ) { if ( ImplCalcWidth() ) @@ -1372,7 +1372,7 @@ void TabBar::Resize() void TabBar::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { if ( rHEvt.GetMode() & HELPMODE_BALLOON ) @@ -1408,7 +1408,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) // wenn dieser abgeschnitten oder nicht voll sichtbar ist if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) { - USHORT nPos = GetPagePos( nItemId ); + sal_uInt16 nPos = GetPagePos( nItemId ); ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); if ( pItem->mbShort || (pItem->maRect.Right()-TABBAR_OFFSET_X-5 > mnLastOffX) ) @@ -1450,14 +1450,14 @@ void TabBar::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE ); + ImplInitSettings( sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) Invalidate(); else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, TRUE ); + ImplInitSettings( sal_False, sal_True ); Invalidate(); } else if ( nType == STATE_CHANGE_MIRRORING ) @@ -1483,7 +1483,7 @@ void TabBar::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - ImplInitSettings( TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True ); Invalidate(); } } @@ -1552,7 +1552,7 @@ long TabBar::DeactivatePage() if ( maDeactivatePageHdl.IsSet() ) return maDeactivatePageHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1562,7 +1562,7 @@ long TabBar::StartRenaming() if ( maStartRenamingHdl.IsSet() ) return maStartRenamingHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1572,7 +1572,7 @@ long TabBar::AllowRenaming() if ( maAllowRenamingHdl.IsSet() ) return maAllowRenamingHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1591,8 +1591,8 @@ void TabBar::Mirror() // ----------------------------------------------------------------------- -void TabBar::InsertPage( USHORT nPageId, const XubString& rText, - TabBarPageBits nBits, USHORT nPos ) +void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText, + TabBarPageBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" ); DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND, @@ -1602,7 +1602,7 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, // PageItem anlegen und in die Item-Liste eintragen ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits ); mpItemList->Insert( pItem, nPos ); - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; // CurPageId gegebenenfalls setzen if ( !mnCurPageId ) @@ -1617,9 +1617,9 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, // ----------------------------------------------------------------------- -Color TabBar::GetTabBgColor( USHORT nPageId ) const +Color TabBar::GetTabBgColor( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maTabBgColor; @@ -1627,9 +1627,9 @@ Color TabBar::GetTabBgColor( USHORT nPageId ) const return Color( COL_AUTO ); } -void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor ) +void TabBar::SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); ImplTabBarItem* pItem; if ( nPos != PAGE_NOT_FOUND ) { @@ -1652,9 +1652,9 @@ void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor ) // ----------------------------------------------------------------------- -void TabBar::RemovePage( USHORT nPageId ) +void TabBar::RemovePage( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); // Existiert Item if ( nPos != PAGE_NOT_FOUND ) @@ -1668,7 +1668,7 @@ void TabBar::RemovePage( USHORT nPageId ) // Item-Daten loeschen delete mpItemList->Remove( nPos ); - mbFormat = TRUE; + mbFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -1680,9 +1680,9 @@ void TabBar::RemovePage( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::MovePage( USHORT nPageId, USHORT nNewPos ) +void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); Pair aPair( nPos, nNewPos ); if ( nPos < nNewPos ) @@ -1697,7 +1697,7 @@ void TabBar::MovePage( USHORT nPageId, USHORT nNewPos ) // TabBar-Item in der Liste verschieben ImplTabBarItem* pItem = mpItemList->Remove( nPos ); mpItemList->Insert( pItem, nNewPos ); - mbFormat = TRUE; + mbFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -1722,7 +1722,7 @@ void TabBar::Clear() // Items aus der Liste loeschen mpItemList->Clear(); - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; mnCurPageId = 0; mnFirstPos = 0; @@ -1735,9 +1735,9 @@ void TabBar::Clear() // ----------------------------------------------------------------------- -void TabBar::EnablePage( USHORT nPageId, BOOL bEnable ) +void TabBar::EnablePage( sal_uInt16 nPageId, sal_Bool bEnable ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) { @@ -1758,21 +1758,21 @@ void TabBar::EnablePage( USHORT nPageId, BOOL bEnable ) // ----------------------------------------------------------------------- -BOOL TabBar::IsPageEnabled( USHORT nPageId ) const +sal_Bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mbEnable; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits ) +void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) { @@ -1791,26 +1791,26 @@ void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits ) // ----------------------------------------------------------------------- -TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const +TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mnBits; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -USHORT TabBar::GetPageCount() const +sal_uInt16 TabBar::GetPageCount() const { - return (USHORT)mpItemList->Count(); + return (sal_uInt16)mpItemList->Count(); } // ----------------------------------------------------------------------- -USHORT TabBar::GetPageId( USHORT nPos ) const +sal_uInt16 TabBar::GetPageId( sal_uInt16 nPos ) const { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); if ( pItem ) @@ -1821,13 +1821,13 @@ USHORT TabBar::GetPageId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT TabBar::GetPagePos( USHORT nPageId ) const +sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const { ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { if ( pItem->mnId == nPageId ) - return (USHORT)mpItemList->GetCurPos(); + return (sal_uInt16)mpItemList->GetCurPos(); pItem = mpItemList->Next(); } @@ -1837,7 +1837,7 @@ USHORT TabBar::GetPagePos( USHORT nPageId ) const // ----------------------------------------------------------------------- -USHORT TabBar::GetPageId( const Point& rPos ) const +sal_uInt16 TabBar::GetPageId( const Point& rPos ) const { ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) @@ -1853,9 +1853,9 @@ USHORT TabBar::GetPageId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle TabBar::GetPageRect( USHORT nPageId ) const +Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maRect; @@ -1865,9 +1865,9 @@ Rectangle TabBar::GetPageRect( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetCurPageId( USHORT nPageId ) +void TabBar::SetCurPageId( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen if ( nPos != PAGE_NOT_FOUND ) @@ -1878,9 +1878,9 @@ void TabBar::SetCurPageId( USHORT nPageId ) return; // Muss invalidiert werden - BOOL bUpdate = FALSE; + sal_Bool bUpdate = sal_False; if ( IsReallyVisible() && IsUpdateMode() ) - bUpdate = TRUE; + bUpdate = sal_True; ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); ImplTabBarItem* pOldItem; @@ -1894,14 +1894,14 @@ void TabBar::SetCurPageId( USHORT nPageId ) // deselktieren, wenn dies die einzige selektierte Seite ist if ( !pItem->mbSelect && pOldItem ) { - USHORT nSelPageCount = GetSelectPageCount(); + sal_uInt16 nSelPageCount = GetSelectPageCount(); if ( nSelPageCount == 1 ) - pOldItem->mbSelect = FALSE; - pItem->mbSelect = TRUE; + pOldItem->mbSelect = sal_False; + pItem->mbSelect = sal_True; } mnCurPageId = nPageId; - mbFormat = TRUE; + mbFormat = sal_True; // Dafuer sorgen, das aktuelle Page sichtbar wird if ( IsReallyVisible() ) @@ -1923,7 +1923,7 @@ void TabBar::SetCurPageId( USHORT nPageId ) while ( (mbMirrored ? (pItem->maRect.Left() < mnOffX) : (pItem->maRect.Right() > nWidth)) || pItem->maRect.IsEmpty() ) { - USHORT nNewPos = mnFirstPos+1; + sal_uInt16 nNewPos = mnFirstPos+1; // Dafuer sorgen, das min. die aktuelle TabPages als // erste TabPage sichtbar ist if ( nNewPos >= nPos ) @@ -1954,12 +1954,12 @@ void TabBar::SetCurPageId( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::MakeVisible( USHORT nPageId ) +void TabBar::MakeVisible( sal_uInt16 nPageId ) { if ( !IsReallyVisible() ) return; - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen if ( nPos != PAGE_NOT_FOUND ) @@ -1977,14 +1977,14 @@ void TabBar::MakeVisible( USHORT nPageId ) if ( mbFormat || pItem->maRect.IsEmpty() ) { - mbFormat = TRUE; + mbFormat = sal_True; ImplFormat(); } while ( (pItem->maRect.Right() > nWidth) || pItem->maRect.IsEmpty() ) { - USHORT nNewPos = mnFirstPos+1; + sal_uInt16 nNewPos = mnFirstPos+1; // Dafuer sorgen, das min. die aktuelle TabPages als // erste TabPage sichtbar ist if ( nNewPos >= nPos ) @@ -2006,11 +2006,11 @@ void TabBar::MakeVisible( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::SetFirstPageId( USHORT nPageId ) +void TabBar::SetFirstPageId( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); - // Wenn Item nicht existiert, dann FALSE zurueckgeben + // Wenn Item nicht existiert, dann sal_False zurueckgeben if ( nPos != PAGE_NOT_FOUND ) { if ( nPos != mnFirstPos ) @@ -2018,8 +2018,8 @@ void TabBar::SetFirstPageId( USHORT nPageId ) // Dafuer sorgen, das nach Moeglichkteit soviele Pages wie // moeglich sichtbar sind ImplFormat(); - USHORT nLastFirstPos = ImplGetLastFirstPos(); - USHORT nNewPos; + sal_uInt16 nLastFirstPos = ImplGetLastFirstPos(); + sal_uInt16 nNewPos; if ( nPos > nLastFirstPos ) nNewPos = nLastFirstPos; else @@ -2028,7 +2028,7 @@ void TabBar::SetFirstPageId( USHORT nPageId ) if ( nNewPos != mnFirstPos ) { mnFirstPos = nNewPos; - mbFormat = TRUE; + mbFormat = sal_True; // Leiste neu ausgeben (Achtung: mbDropPos beachten, da wenn // dieses Flag gesetzt ist, wird direkt gepaintet) @@ -2041,9 +2041,9 @@ void TabBar::SetFirstPageId( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::SelectPage( USHORT nPageId, BOOL bSelect ) +void TabBar::SelectPage( sal_uInt16 nPageId, sal_Bool bSelect ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) { @@ -2062,10 +2062,10 @@ void TabBar::SelectPage( USHORT nPageId, BOOL bSelect ) // ----------------------------------------------------------------------- -void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos ) +void TabBar::SelectPageRange( sal_Bool bSelect, sal_uInt16 nStartPos, sal_uInt16 nEndPos ) { Rectangle aPaintRect; - USHORT nPos = nStartPos; + sal_uInt16 nPos = nStartPos; ImplTabBarItem* pItem = mpItemList->Seek( nPos ); while ( pItem && (nPos <= nEndPos) ) { @@ -2086,9 +2086,9 @@ void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos ) // ----------------------------------------------------------------------- -USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const +sal_uInt16 TabBar::GetSelectPage( sal_uInt16 nSelIndex ) const { - USHORT nSelected = 0; + sal_uInt16 nSelected = 0; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { @@ -2106,9 +2106,9 @@ USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const // ----------------------------------------------------------------------- -USHORT TabBar::GetSelectPageCount() const +sal_uInt16 TabBar::GetSelectPageCount() const { - USHORT nSelected = 0; + sal_uInt16 nSelected = 0; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { @@ -2123,22 +2123,22 @@ USHORT TabBar::GetSelectPageCount() const // ----------------------------------------------------------------------- -BOOL TabBar::IsPageSelected( USHORT nPageId ) const +sal_Bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mbSelect; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL TabBar::StartEditMode( USHORT nPageId ) +sal_Bool TabBar::StartEditMode( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8) ) - return FALSE; + return sal_False; mnEditId = nPageId; if ( StartRenaming() ) @@ -2190,23 +2190,23 @@ BOOL TabBar::StartEditMode( USHORT nPageId ) mpEdit->GrabFocus(); mpEdit->SetSelection( Selection( 0, mpEdit->GetText().Len() ) ); mpEdit->Show(); - return TRUE; + return sal_True; } else { mnEditId = 0; - return FALSE; + return sal_False; } } // ----------------------------------------------------------------------- -void TabBar::EndEditMode( BOOL bCancel ) +void TabBar::EndEditMode( sal_Bool bCancel ) { if ( mpEdit ) { // call hdl - BOOL bEnd = TRUE; + sal_Bool bEnd = sal_True; mbEditCanceled = bCancel; maEditText = mpEdit->GetText(); mpEdit->SetPostEvent(); @@ -2216,9 +2216,9 @@ void TabBar::EndEditMode( BOOL bCancel ) if ( nAllowRenaming == TABBAR_RENAMING_YES ) SetPageText( mnEditId, maEditText ); else if ( nAllowRenaming == TABBAR_RENAMING_NO ) - bEnd = FALSE; + bEnd = sal_False; else // nAllowRenaming == TABBAR_RENAMING_CANCEL - mbEditCanceled = TRUE; + mbEditCanceled = sal_True; } // renaming not allowed, than reset edit data @@ -2238,30 +2238,30 @@ void TabBar::EndEditMode( BOOL bCancel ) // reset maEditText.Erase(); - mbEditCanceled = FALSE; + mbEditCanceled = sal_False; } } // ----------------------------------------------------------------------- -void TabBar::SetMirrored( BOOL bMirrored ) +void TabBar::SetMirrored( sal_Bool bMirrored ) { if( mbMirrored != bMirrored ) { mbMirrored = bMirrored; - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; ImplInitControls(); // for button images Resize(); // recalculates control positions Mirror(); } } -void TabBar::SetEffectiveRTL( BOOL bRTL ) +void TabBar::SetEffectiveRTL( sal_Bool bRTL ) { SetMirrored( bRTL != Application::GetSettings().GetLayoutRTL() ); } -BOOL TabBar::IsEffectiveRTL() const +sal_Bool TabBar::IsEffectiveRTL() const { return IsMirrored() != Application::GetSettings().GetLayoutRTL(); } @@ -2273,7 +2273,7 @@ void TabBar::SetMaxPageWidth( long nMaxWidth ) if ( mnMaxPageWidth != nMaxWidth ) { mnMaxPageWidth = nMaxWidth; - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -2288,7 +2288,7 @@ void TabBar::SetSelectColor() if ( mbSelColor ) { maSelColor = Color( COL_TRANSPARENT ); - mbSelColor = FALSE; + mbSelColor = sal_False; Invalidate(); } } @@ -2302,7 +2302,7 @@ void TabBar::SetSelectColor( const Color& rColor ) if ( mbSelColor ) { maSelColor = Color( COL_TRANSPARENT ); - mbSelColor = FALSE; + mbSelColor = sal_False; Invalidate(); } } @@ -2311,7 +2311,7 @@ void TabBar::SetSelectColor( const Color& rColor ) if ( maSelColor != rColor ) { maSelColor = rColor; - mbSelColor = TRUE; + mbSelColor = sal_True; Invalidate(); } } @@ -2324,7 +2324,7 @@ void TabBar::SetSelectTextColor() if ( mbSelTextColor ) { maSelTextColor = Color( COL_TRANSPARENT ); - mbSelTextColor = FALSE; + mbSelTextColor = sal_False; Invalidate(); } } @@ -2338,7 +2338,7 @@ void TabBar::SetSelectTextColor( const Color& rColor ) if ( mbSelTextColor ) { maSelTextColor = Color( COL_TRANSPARENT ); - mbSelTextColor = FALSE; + mbSelTextColor = sal_False; Invalidate(); } } @@ -2347,7 +2347,7 @@ void TabBar::SetSelectTextColor( const Color& rColor ) if ( maSelTextColor != rColor ) { maSelTextColor = rColor; - mbSelTextColor = TRUE; + mbSelTextColor = sal_True; Invalidate(); } } @@ -2355,13 +2355,13 @@ void TabBar::SetSelectTextColor( const Color& rColor ) // ----------------------------------------------------------------------- -void TabBar::SetPageText( USHORT nPageId, const XubString& rText ) +void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) { mpItemList->GetObject( nPos )->maText = rText; - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -2373,9 +2373,9 @@ void TabBar::SetPageText( USHORT nPageId, const XubString& rText ) // ----------------------------------------------------------------------- -XubString TabBar::GetPageText( USHORT nPageId ) const +XubString TabBar::GetPageText( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maText; else @@ -2384,18 +2384,18 @@ XubString TabBar::GetPageText( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpText( USHORT nPageId, const XubString& rText ) +void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) mpItemList->GetObject( nPos )->maHelpText = rText; } // ----------------------------------------------------------------------- -XubString TabBar::GetHelpText( USHORT nPageId ) const +XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -2414,18 +2414,18 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId ) +void TabBar::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) mpItemList->GetObject( nPos )->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -rtl::OString TabBar::GetHelpId( USHORT nPageId ) const +rtl::OString TabBar::GetHelpId( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); rtl::OString aRet; if ( nPos != PAGE_NOT_FOUND ) aRet = mpItemList->GetObject( nPos )->maHelpId; @@ -2446,10 +2446,10 @@ long TabBar::GetMinSize() const // ----------------------------------------------------------------------- -BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) +sal_Bool TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) ) - return FALSE; + return sal_False; // Testen, ob angeklickte Seite selektiert ist. Falls dies nicht // der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and @@ -2459,11 +2459,11 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // da der Select schon den Bereich gescrollt haben kann if ( rCEvt.IsMouseEvent() && !mbInSelect ) { - USHORT nSelId = GetPageId( rCEvt.GetMousePosPixel() ); + sal_uInt16 nSelId = GetPageId( rCEvt.GetMousePosPixel() ); // Falls kein Eintrag angeklickt wurde, starten wir kein Dragging if ( !nSelId ) - return FALSE; + return sal_False; // Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle // Seite setzen und Select rufen. @@ -2477,34 +2477,34 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) ImplSelect(); } else - return FALSE; + return sal_False; } } - mbInSelect = FALSE; + mbInSelect = sal_False; Region aRegion; // Region zuweisen rRegion = aRegion; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -USHORT TabBar::ShowDropPos( const Point& rPos ) +sal_uInt16 TabBar::ShowDropPos( const Point& rPos ) { ImplTabBarItem* pItem; - USHORT nDropId; - USHORT nNewDropPos; - USHORT nItemCount = (USHORT)mpItemList->Count(); + sal_uInt16 nDropId; + sal_uInt16 nNewDropPos; + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); short nScroll = 0; if ( rPos.X() > mnLastOffX-TABBAR_DRAG_SCROLLOFF ) { pItem = mpItemList->GetObject( mpItemList->Count()-1 ); if ( !pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()) ) - nNewDropPos = (USHORT)mpItemList->Count(); + nNewDropPos = (sal_uInt16)mpItemList->Count(); else { nNewDropPos = mnFirstPos+1; @@ -2540,12 +2540,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) if ( mbDropPos ) HideDropPos(); - mbDropPos = TRUE; + mbDropPos = sal_True; mnDropPos = nNewDropPos; if ( nScroll ) { - USHORT nOldFirstPos = mnFirstPos; + sal_uInt16 nOldFirstPos = mnFirstPos; SetFirstPageId( GetPageId( mnFirstPos+nScroll ) ); // Direkt ausgeben, da kein Paint bei Drag and Drop moeglich @@ -2562,7 +2562,7 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) Color aBlackColor( COL_BLACK ); long nX; long nY = (maWinSize.Height()/2)-1; - USHORT nCurPos = GetPagePos( mnCurPageId ); + sal_uInt16 nCurPos = GetPagePos( mnCurPageId ); SetLineColor( aBlackColor ); if ( mnDropPos < nItemCount ) @@ -2606,7 +2606,7 @@ void TabBar::HideDropPos() long nX; long nY1 = (maWinSize.Height()/2)-3; long nY2 = nY1 + 5; - USHORT nItemCount = (USHORT)mpItemList->Count(); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); if ( mnDropPos < nItemCount ) { @@ -2633,17 +2633,17 @@ void TabBar::HideDropPos() SetClipRegion(); } - mbDropPos = FALSE; + mbDropPos = sal_False; mnDropPos = 0; } } // ----------------------------------------------------------------------- -BOOL TabBar::SwitchPage( const Point& rPos ) +sal_Bool TabBar::SwitchPage( const Point& rPos ) { - BOOL bSwitch = FALSE; - USHORT nSwitchId = GetPageId( rPos ); + sal_Bool bSwitch = sal_False; + sal_uInt16 nSwitchId = GetPageId( rPos ); if ( !nSwitchId ) EndSwitchPage(); else @@ -2660,16 +2660,16 @@ BOOL TabBar::SwitchPage( const Point& rPos ) { if ( Time::GetSystemTicks() > mnSwitchTime+500 ) { - mbInSwitching = TRUE; + mbInSwitching = sal_True; if ( ImplDeactivatePage() ) { SetCurPageId( mnSwitchId ); Update(); ImplActivatePage(); ImplSelect(); - bSwitch = TRUE; + bSwitch = sal_True; } - mbInSwitching = FALSE; + mbInSwitching = sal_False; } } } diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx index 232727951281..06c90818b13e 100755 --- a/svtools/source/control/taskbar.cxx +++ b/svtools/source/control/taskbar.cxx @@ -76,9 +76,9 @@ TaskBar::TaskBar( Window* pParent, WinBits nWinStyle ) : mnOldStatusWidth = 0; mnLines = 1; mnWinBits = nWinStyle; - mbStatusText = FALSE; - mbShowItems = FALSE; - mbAutoHide = FALSE; + mbStatusText = sal_False; + mbShowItems = sal_False; + mbAutoHide = sal_False; ImplInitSettings(); } @@ -309,13 +309,13 @@ void TaskBar::Resize() if ( pTempButtonBar ) { - USHORT i = 0; - BOOL bVisibleItems = FALSE; + sal_uInt16 i = 0; + sal_Bool bVisibleItems = sal_False; while ( i < pTempButtonBar->GetItemCount() ) { if ( pTempButtonBar->IsItemVisible( pTempButtonBar->GetItemId( i ) ) ) { - bVisibleItems = TRUE; + bVisibleItems = sal_True; break; } i++; @@ -464,14 +464,14 @@ void TaskBar::Format() // ----------------------------------------------------------------------- -void TaskBar::SetLines( USHORT nLines ) +void TaskBar::SetLines( sal_uInt16 nLines ) { mnLines = nLines; } // ----------------------------------------------------------------------- -void TaskBar::EnableAutoHide( BOOL bAutoHide ) +void TaskBar::EnableAutoHide( sal_Bool bAutoHide ) { mbAutoHide = bAutoHide; @@ -493,14 +493,14 @@ void TaskBar::ShowStatusText( const String& rText ) { if ( !mbStatusText ) { - mbStatusText = TRUE; + mbStatusText = sal_True; if ( mpStatusBar->AreItemsVisible() ) { - mbShowItems = TRUE; + mbShowItems = sal_True; mpStatusBar->HideItems(); } else - mbShowItems = TRUE; + mbShowItems = sal_True; maOldText = mpStatusBar->GetText(); Resize(); mpStatusBar->SetText( rText ); @@ -518,7 +518,7 @@ void TaskBar::HideStatusText() { if ( mbStatusText && mpStatusBar ) { - mbStatusText = FALSE; + mbStatusText = sal_False; mpStatusBar->SetText( maOldText ); Resize(); if ( mbShowItems ) diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx index 3f05d077b7c5..798126ae37af 100755 --- a/svtools/source/control/taskbox.cxx +++ b/svtools/source/control/taskbox.cxx @@ -60,7 +60,7 @@ TaskToolBox::TaskToolBox( Window* pParent, WinBits nWinStyle ) : mnActiveItemId = 0; mnTaskItem = 0; mnSmallItem = TOOLBOX_ITEM_NOTFOUND; - mbMinActivate = FALSE; + mbMinActivate = sal_False; SetAlign( WINDOWALIGN_BOTTOM ); SetButtonType( BUTTON_SYMBOLTEXT ); @@ -82,14 +82,14 @@ TaskToolBox::~TaskToolBox() // ----------------------------------------------------------------------- -void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate ) +void TaskToolBox::ActivateTaskItem( sal_uInt16 nItemId, sal_Bool bMinActivate ) { if ( nItemId ) { if ( nItemId != mnActiveItemId ) { if ( mnActiveItemId ) - CheckItem( mnActiveItemId, FALSE ); + CheckItem( mnActiveItemId, sal_False ); CheckItem( nItemId ); mnActiveItemId = nItemId; } @@ -98,13 +98,13 @@ void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate ) if ( !bMinActivate ) return; - mbMinActivate = TRUE; + mbMinActivate = sal_True; } mnTaskItem = nItemId-1; ActivateTask(); mnTaskItem = 0; - mbMinActivate = FALSE; + mbMinActivate = sal_False; } } @@ -135,7 +135,7 @@ void TaskToolBox::MouseButtonDown( const MouseEvent& rMEvt ) void TaskToolBox::Resize() { mnOldItemCount = mpItemList->Count(); - mnUpdatePos = (USHORT)mnOldItemCount; + mnUpdatePos = (sal_uInt16)mnOldItemCount; mnUpdateNewPos = TOOLBOX_ITEM_NOTFOUND; ImplFormatTaskToolBox(); ToolBox::Resize(); @@ -147,7 +147,7 @@ void TaskToolBox::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) { - USHORT nItemId = GetItemId( rCEvt.GetMousePosPixel() ); + sal_uInt16 nItemId = GetItemId( rCEvt.GetMousePosPixel() ); // Dies machen wir nicht mehr, da es von zu vielen als stoerend empfunden wurde // ActivateTaskItem( nItemId ); mnTaskItem = nItemId-1; @@ -167,7 +167,7 @@ void TaskToolBox::RequestHelp( const HelpEvent& rHEvt ) { if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) ) { - USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { @@ -196,8 +196,8 @@ void TaskToolBox::RequestHelp( const HelpEvent& rHEvt ) void TaskToolBox::Select() { - USHORT nItemId = GetCurItemId(); - ActivateTaskItem( nItemId, TRUE ); + sal_uInt16 nItemId = GetCurItemId(); + ActivateTaskItem( nItemId, sal_True ); } // ----------------------------------------------------------------------- @@ -208,7 +208,7 @@ void TaskToolBox::ImplFormatTaskToolBox() { // Eintraege aus der Liste entfernen while ( mpItemList->Count() > mnUpdatePos ) - delete mpItemList->Remove( (ULONG)mnUpdatePos ); + delete mpItemList->Remove( (sal_uLong)mnUpdatePos ); mnUpdateNewPos = mnUpdatePos; } @@ -236,14 +236,14 @@ void TaskToolBox::ImplFormatTaskToolBox() } // Eintraege aus der ToolBox entfernen, die ersetzt werden - USHORT nBtnPos = (mnUpdateNewPos*2); + sal_uInt16 nBtnPos = (mnUpdateNewPos*2); while ( nBtnPos < GetItemCount() ) RemoveItem( nBtnPos ); if ( mnUpdateNewPos <= (mnActiveItemId-1) ) mnActiveItemId = 0; // Neue Eintrage einfuegen - USHORT i = mnUpdateNewPos; + sal_uInt16 i = mnUpdateNewPos; while ( i < mpItemList->Count() ) { ImplTaskItem* pItem = mpItemList->GetObject( i ); @@ -267,7 +267,7 @@ void TaskToolBox::ImplFormatTaskToolBox() while ( (nTxtWidth > mnMaxTextWidth) && (aText.Len() > 3) ); } - USHORT nItemId = i+1; + sal_uInt16 nItemId = i+1; if ( aText.EqualsAscii( "..." ) ) InsertItem( nItemId, pItem->maImage, TIB_LEFT ); else @@ -282,7 +282,7 @@ void TaskToolBox::ImplFormatTaskToolBox() if ( mnNewActivePos+1 != mnActiveItemId ) { if ( mnActiveItemId ) - CheckItem( mnActiveItemId, FALSE ); + CheckItem( mnActiveItemId, sal_False ); mnActiveItemId = mnNewActivePos+1; CheckItem( mnActiveItemId ); } @@ -301,7 +301,7 @@ void TaskToolBox::StartUpdateTask() // ----------------------------------------------------------------------- void TaskToolBox::UpdateTask( const Image& rImage, const String& rText, - BOOL bActive ) + sal_Bool bActive ) { ImplTaskItem* pItem = mpItemList->GetObject( mnUpdatePos ); if ( pItem ) @@ -310,7 +310,7 @@ void TaskToolBox::UpdateTask( const Image& rImage, const String& rText, { // Eintraege aus der Liste entfernen while ( mpItemList->Count() > mnUpdatePos ) - delete mpItemList->Remove( (ULONG)mnUpdatePos ); + delete mpItemList->Remove( (sal_uLong)mnUpdatePos ); pItem = NULL; } } @@ -340,7 +340,7 @@ void TaskToolBox::EndUpdateTask() { // Eintraege aus der Liste entfernen while ( mpItemList->Count() > mnUpdatePos ) - delete mpItemList->Remove( (ULONG)mnUpdatePos ); + delete mpItemList->Remove( (sal_uLong)mnUpdatePos ); mnUpdateNewPos = mnUpdatePos; } diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx index 62eaf020c8f0..35d5d8997624 100755 --- a/svtools/source/control/taskmisc.cxx +++ b/svtools/source/control/taskmisc.cxx @@ -73,9 +73,9 @@ WindowArrange::~WindowArrange() // ----------------------------------------------------------------------- -static USHORT ImplCeilSqareRoot( USHORT nVal ) +static sal_uInt16 ImplCeilSqareRoot( sal_uInt16 nVal ) { - USHORT i; + sal_uInt16 i; // Ueberlauf verhindern if ( nVal > 0xFE * 0xFE ) @@ -103,19 +103,19 @@ static void ImplPosSizeWindow( Window* pWindow, void WindowArrange::ImplTile( const Rectangle& rRect ) { - USHORT nCount = (USHORT)mpWinList->Count(); + sal_uInt16 nCount = (sal_uInt16)mpWinList->Count(); if ( nCount < 3 ) { ImplVert( rRect ); return; } - USHORT i; - USHORT j; - USHORT nCols; - USHORT nRows; - USHORT nActRows; - USHORT nOffset; + sal_uInt16 i; + sal_uInt16 j; + sal_uInt16 nCols; + sal_uInt16 nRows; + sal_uInt16 nActRows; + sal_uInt16 nOffset; long nOverWidth; long nOverHeight; Window* pWindow; @@ -353,7 +353,7 @@ void WindowArrange::ImplCascade( const Rectangle& rRect ) // ----------------------------------------------------------------------- -void WindowArrange::Arrange( USHORT nType, const Rectangle& rRect ) +void WindowArrange::Arrange( sal_uInt16 nType, const Rectangle& rRect ) { if ( !mpWinList->Count() ) return; diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index 2e1cffcaac10..7792fe32bff8 100755 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -50,7 +50,7 @@ struct ImplTaskSBFldItem { TaskStatusFieldItem maItem; - USHORT mnId; + sal_uInt16 mnId; long mnOffX; }; @@ -58,37 +58,37 @@ DECLARE_LIST( ImplTaskSBItemList, ImplTaskSBFldItem* ) // ======================================================================= -BOOL ITaskStatusNotify::MouseButtonDown( USHORT, const MouseEvent& ) +sal_Bool ITaskStatusNotify::MouseButtonDown( sal_uInt16, const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::MouseButtonUp( USHORT, const MouseEvent& ) +sal_Bool ITaskStatusNotify::MouseButtonUp( sal_uInt16, const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::MouseMove( USHORT, const MouseEvent& ) +sal_Bool ITaskStatusNotify::MouseMove( sal_uInt16, const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::Command( USHORT, const CommandEvent& ) +sal_Bool ITaskStatusNotify::Command( sal_uInt16, const CommandEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::UpdateHelp( USHORT ) +sal_Bool ITaskStatusNotify::UpdateHelp( sal_uInt16 ) { - return FALSE; + return sal_False; } // ======================================================================= @@ -116,7 +116,7 @@ TaskStatusFieldItem::TaskStatusFieldItem( ITaskStatusNotify* pNotify, const Image& rImage, const XubString& rQuickHelpText, const XubString& rHelpText, - USHORT nFlags ) : + sal_uInt16 nFlags ) : mpNotify( pNotify ), maImage( rImage ), maQuickHelpText( rQuickHelpText ), @@ -156,8 +156,8 @@ TaskStatusBar::TaskStatusBar( Window* pParent, WinBits nWinStyle ) : mnItemWidth = 0; mnFieldWidth = 0; mnFieldFlags = 0; - mbFlashItems = FALSE; - mbOutInterval = FALSE; + mbFlashItems = sal_False; + mbOutInterval = sal_False; maTimer.SetTimeoutHdl( LINK( this, TaskStatusBar, ImplTimerHdl ) ); } @@ -183,9 +183,9 @@ TaskStatusBar::~TaskStatusBar() IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG ) { - BOOL bUpdate = ImplUpdateClock(); + sal_Bool bUpdate = ImplUpdateClock(); if ( ImplUpdateFlashItems() ) - bUpdate = TRUE; + bUpdate = sal_True; if ( bUpdate ) SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL ); @@ -194,7 +194,7 @@ IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG ) // ----------------------------------------------------------------------- -ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const +ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( sal_uInt16 nItemId ) const { if ( !mpFieldItemList ) return NULL; @@ -213,11 +213,11 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const // ----------------------------------------------------------------------- -ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const +ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, sal_Bool& rFieldRect ) const { if ( GetItemId( rPos ) == TASKSTATUSBAR_STATUSFIELDID ) { - rFieldRect = TRUE; + rFieldRect = sal_True; if ( mpFieldItemList ) { @@ -233,14 +233,14 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFi } } else - rFieldRect = FALSE; + rFieldRect = sal_False; return NULL; } // ----------------------------------------------------------------------- -BOOL TaskStatusBar::ImplUpdateClock() +sal_Bool TaskStatusBar::ImplUpdateClock() { if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) { @@ -250,40 +250,40 @@ BOOL TaskStatusBar::ImplUpdateClock() (aTime.GetHour() != maTime.GetHour()) ) { maTime = aTime; - maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, FALSE, FALSE ); - return TRUE; + maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, sal_False, sal_False ); + return sal_True; } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL TaskStatusBar::ImplUpdateFlashItems() +sal_Bool TaskStatusBar::ImplUpdateFlashItems() { if ( mbFlashItems ) { if ( mbOutInterval ) { maTimer.SetTimeout( 900 ); - mbOutInterval = FALSE; + mbOutInterval = sal_False; } else { maTimer.SetTimeout( 700 ); - mbOutInterval = TRUE; + mbOutInterval = sal_True; } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void TaskStatusBar::ImplUpdateField( BOOL bItems ) +void TaskStatusBar::ImplUpdateField( sal_Bool bItems ) { maTimer.Stop(); @@ -291,15 +291,15 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) { ImplTaskSBFldItem* pItem = mpFieldItemList->First(); mnItemWidth = 0; - mbFlashItems = FALSE; - mbOutInterval = FALSE; + mbFlashItems = sal_False; + mbOutInterval = sal_False; while ( pItem ) { mnItemWidth += TASKSTATUSBAR_IMAGEOFFX; pItem->mnOffX = mnItemWidth; mnItemWidth += pItem->maItem.GetImage().GetSizePixel().Width(); if ( pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH ) - mbFlashItems = TRUE; + mbFlashItems = sal_True; pItem = mpFieldItemList->Next(); } @@ -308,7 +308,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) { if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) { - XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), FALSE, FALSE ); + XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), sal_False, sal_False ); mnClockWidth = GetTextWidth( aStr )+(TASKSTATUSBAR_CLOCXOFFX*2); } else @@ -326,7 +326,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) { mnFieldWidth = nNewWidth; long nOffset = GetItemOffset( TASKSTATUSBAR_STATUSFIELDID ); - USHORT nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID ); + sal_uInt16 nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID ); InsertItem( TASKSTATUSBAR_STATUSFIELDID, nNewWidth, SIB_RIGHT | SIB_IN | SIB_USERDRAW, nOffset, nItemPos ); } else @@ -341,7 +341,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) if ( mbFlashItems || (mnFieldFlags & TASKSTATUSFIELD_CLOCK) ) { ImplUpdateClock(); - mbOutInterval = TRUE; + mbOutInterval = sal_True; ImplUpdateFlashItems(); maTimer.Start(); } @@ -351,12 +351,12 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -378,12 +378,12 @@ void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt ) void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -405,12 +405,12 @@ void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt ) void TaskStatusBar::MouseMove( const MouseEvent& rMEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -432,12 +432,12 @@ void TaskStatusBar::MouseMove( const MouseEvent& rMEvt ) void TaskStatusBar::Command( const CommandEvent& rCEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rCEvt.GetMousePosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -459,12 +459,12 @@ void TaskStatusBar::Command( const CommandEvent& rCEvt ) void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) { - BOOL bFieldRect; + sal_Bool bFieldRect; ImplTaskSBFldItem* pItem = ImplGetFieldItem( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), bFieldRect ); if ( bFieldRect ) { ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( pItem ) { @@ -571,28 +571,28 @@ void TaskStatusBar::UserDraw( const UserDrawEvent& rUDEvt ) // ----------------------------------------------------------------------- -void TaskStatusBar::InsertStatusField( long, USHORT, - USHORT nFlags ) +void TaskStatusBar::InsertStatusField( long, sal_uInt16, + sal_uInt16 nFlags ) { mnFieldFlags = nFlags; - ImplUpdateField( FALSE ); + ImplUpdateField( sal_False ); } // ----------------------------------------------------------------------- -void TaskStatusBar::SetFieldFlags( USHORT nFlags ) +void TaskStatusBar::SetFieldFlags( sal_uInt16 nFlags ) { if ( mnFieldFlags != nFlags ) { mnFieldFlags = nFlags; - ImplUpdateField( FALSE ); + ImplUpdateField( sal_False ); } } // ----------------------------------------------------------------------- -void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem, - USHORT nPos ) +void TaskStatusBar::AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem, + sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "TaskStatusBar::AddStatusFieldItem() - Item is 0" ); DBG_ASSERT( !ImplGetFieldItem( nItemId ), "TaskStatusBar::AddStatusFieldItem() - Item-Id already exist" ); @@ -604,50 +604,50 @@ void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldIte pItem->maItem = rItem; pItem->mnId = nItemId; pItem->mnOffX = 0; - mpFieldItemList->Insert( pItem, (ULONG)nPos ); + mpFieldItemList->Insert( pItem, (sal_uLong)nPos ); - ImplUpdateField( TRUE ); + ImplUpdateField( sal_True ); } // ----------------------------------------------------------------------- -void TaskStatusBar::ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem ) +void TaskStatusBar::ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem ) { ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); if ( pItem ) { - BOOL bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) || + sal_Bool bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) || (pItem->maItem.GetFlags() != rItem.GetFlags()); pItem->maItem = rItem; if ( bUpdate ) - ImplUpdateField( TRUE ); + ImplUpdateField( sal_True ); } } // ----------------------------------------------------------------------- -void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId ) +void TaskStatusBar::RemoveStatusFieldItem( sal_uInt16 nItemId ) { ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); if ( pItem ) { mpFieldItemList->Remove( pItem ); delete pItem; - ImplUpdateField( TRUE ); + ImplUpdateField( sal_True ); } } // ----------------------------------------------------------------------- -BOOL TaskStatusBar::GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const +sal_Bool TaskStatusBar::GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const { ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); if ( pItem ) { rItem = pItem->maItem; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index f0bd192fc02c..c84eb17afecc 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -163,7 +163,7 @@ const Reference< XAccessibleContext >& ToolbarMenuEntry::GetAccessible( bool bCr { if( mpControl ) { - mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( TRUE ), UNO_QUERY ); + mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( sal_True ), UNO_QUERY ); } else { @@ -843,7 +843,7 @@ void ToolbarMenu::appendSeparator() ValueSet* ToolbarMenu::createEmptyValueSetControl() { ValueSet* pSet = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); - pSet->EnableFullItemMode( FALSE ); + pSet->EnableFullItemMode( sal_False ); pSet->SetColor( GetControlBackground() ); pSet->SetHighlightHdl( LINK( this, ToolbarMenu, HighlightHdl ) ); return pSet; @@ -927,7 +927,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) { bDrawItemRect = false; - if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, + if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ), ImplControlValue(), @@ -1017,7 +1017,7 @@ void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown ) Size aOutSz = GetOutputSizePixel(); if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) ) { - bool bHighlighted = FALSE; + bool bHighlighted = sal_False; const int nEntryCount = mpImpl->maEntryVector.size(); int nEntry; @@ -1092,11 +1092,11 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl ); if( pValueSet ) { - USHORT nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() ); + sal_uInt16 nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() ); if( nItemPos != VALUESET_ITEM_NOTFOUND ) { - const USHORT nColCount = pValueSet->GetColCount(); - const USHORT nLine = nItemPos / nColCount; + const sal_uInt16 nColCount = pValueSet->GetColCount(); + const sal_uInt16 nLine = nItemPos / nColCount; nLastColumn = nItemPos - (nLine * nColCount); @@ -1106,7 +1106,7 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa } else { - const USHORT nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount; + const sal_uInt16 nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount; return (nLine+1) < nLineCount; } } @@ -1195,19 +1195,19 @@ ToolbarMenuEntry* ToolbarMenu::implCursorUpDown( bool bUp, bool bHomeEnd ) // -------------------------------------------------------------------- -void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl ) +void ToolbarMenu_Impl::implHighlightControl( sal_uInt16 nCode, Control* pControl ) { ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl ); if( pValueSet ) { - const USHORT nItemCount = pValueSet->GetItemCount(); - USHORT nItemPos = VALUESET_ITEM_NOTFOUND; + const sal_uInt16 nItemCount = pValueSet->GetItemCount(); + sal_uInt16 nItemPos = VALUESET_ITEM_NOTFOUND; switch( nCode ) { case KEY_UP: { - const USHORT nColCount = pValueSet->GetColCount(); - const USHORT nLastLine = nItemCount / nColCount; + const sal_uInt16 nColCount = pValueSet->GetColCount(); + const sal_uInt16 nLastLine = nItemCount / nColCount; nItemPos = std::min( ((nLastLine-1) * nColCount) + mnLastColumn, nItemCount-1 ); break; } @@ -1231,7 +1231,7 @@ void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl ) void ToolbarMenu::KeyInput( const KeyEvent& rKEvent ) { Control* pForwardControl = 0; - USHORT nCode = rKEvent.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); switch ( nCode ) { case KEY_UP: @@ -1308,7 +1308,7 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent ) // -------------------------------------------------------------------- static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight ) { - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; @@ -1325,7 +1325,7 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec { const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings(); Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() ); - i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor ); + i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor ); } } @@ -1375,7 +1375,7 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) { - USHORT nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu + sal_uInt16 nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu long nFontHeight = GetTextHeight(); // long nExtra = nFontHeight/4; @@ -1425,9 +1425,9 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) { long nTextOffsetY = ((pEntry->maSize.Height()-nFontHeight)/2); - USHORT nTextStyle = 0; - USHORT nSymbolStyle = 0; - USHORT nImageStyle = 0; + sal_uInt16 nTextStyle = 0; + sal_uInt16 nSymbolStyle = 0; + sal_uInt16 nImageStyle = 0; if( !pEntry->mbEnabled ) { @@ -1538,7 +1538,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) aTmpPos.X() = aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos); aTmpPos.Y() = aPos.Y(); aTmpPos.Y() += nTextOffsetY; - USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; + sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; DrawCtrlText( aTmpPos, pEntry->maText, 0, pEntry->maText.Len(), nStyle, NULL, NULL ); // pVector, pDisplayText ); } diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 020467084748..9ffc4fc55f04 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -213,7 +213,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getAccessibleIndexInParent() throw (RuntimeEx Window* pParent = mpParent->mrMenu.GetParent(); if( pParent ) { - for( USHORT i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ ) + for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ ) { if( pParent->GetChild( i ) == &mpParent->mrMenu ) return i; @@ -473,7 +473,7 @@ Any SAL_CALL ToolbarMenuAcc::getAccessibleKeyBinding() throw (RuntimeException) sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -482,7 +482,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException) sal_Int32 SAL_CALL ToolbarMenuAcc::getBackground() throw (RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor(); return static_cast<sal_Int32>(nColor); } diff --git a/svtools/source/control/toolbarmenuimp.hxx b/svtools/source/control/toolbarmenuimp.hxx index d1de4f704b76..a190fd9f205d 100644 --- a/svtools/source/control/toolbarmenuimp.hxx +++ b/svtools/source/control/toolbarmenuimp.hxx @@ -308,7 +308,7 @@ struct ToolbarMenu_Impl ToolbarMenuEntry* implGetEntry( int nEntry ) const; void notifyHighlightedEntry(); - void implHighlightControl( USHORT nCode, Control* pControl ); + void implHighlightControl( sal_uInt16 nCode, Control* pControl ); }; } diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 66da5636d89c..848ef4c3e10e 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -225,7 +225,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); uno::Reference< accessibility::XAccessible > xRet; - ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(i)); + ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(i)); if( pItem ) xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled ); @@ -265,7 +265,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getAccessibleIndexInParent() { sal_Bool bFound = sal_False; - for( USHORT i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ ) + for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ ) { if( pParent->GetChild( i ) == mpParent ) { @@ -450,12 +450,12 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible { ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - const USHORT nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) ); + const sal_uInt16 nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) ); uno::Reference< accessibility::XAccessible > xRet; if( VALUESET_ITEM_NOTFOUND != nItemId ) { - const USHORT nItemPos = mpParent->GetItemPos( nItemId ); + const sal_uInt16 nItemPos = mpParent->GetItemPos( nItemId ); if( VALUESET_ITEM_NONEITEM != nItemPos ) { @@ -559,7 +559,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getForeground( ) throw (uno::RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -569,7 +569,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getBackground( ) throw (uno::RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -580,7 +580,7 @@ void SAL_CALL ValueSetAcc::selectAccessibleChild( sal_Int32 nChildIndex ) { ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex)); + ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex)); if(pItem != NULL) { @@ -598,7 +598,7 @@ sal_Bool SAL_CALL ValueSetAcc::isAccessibleChildSelected( sal_Int32 nChildIndex { ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex)); + ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex)); sal_Bool bRet = sal_False; if (pItem != NULL) @@ -637,7 +637,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getSelectedAccessibleChildCount() const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); sal_Int32 nRet = 0; - for( USHORT i = 0, nCount = getItemCount(); i < nCount; i++ ) + for( sal_uInt16 i = 0, nCount = getItemCount(); i < nCount; i++ ) { ValueSetItem* pItem = getItem (i); @@ -657,7 +657,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getSelectedAc const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); uno::Reference< accessibility::XAccessible > xRet; - for( USHORT i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ ) + for( sal_uInt16 i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ ) { ValueSetItem* pItem = getItem(i); @@ -734,9 +734,9 @@ void SAL_CALL ValueSetAcc::disposing (void) } -USHORT ValueSetAcc::getItemCount (void) const +sal_uInt16 ValueSetAcc::getItemCount (void) const { - USHORT nCount = mpParent->ImplGetVisibleItemCount(); + sal_uInt16 nCount = mpParent->ImplGetVisibleItemCount(); // When the None-Item is visible then increase the number of items by // one. if (HasNoneField()) @@ -745,7 +745,7 @@ USHORT ValueSetAcc::getItemCount (void) const } -ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const +ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) const { ValueSetItem* pItem = NULL; @@ -759,7 +759,7 @@ ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const nIndex -= 1; } if (pItem == NULL) - pItem = mpParent->ImplGetVisibleItem (static_cast<USHORT>(nIndex)); + pItem = mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex)); return pItem; } @@ -935,9 +935,9 @@ sal_Int32 SAL_CALL ValueItemAcc::getAccessibleIndexInParent() { bool bDone = false; - USHORT nCount = mpParent->mrParent.ImplGetVisibleItemCount(); + sal_uInt16 nCount = mpParent->mrParent.ImplGetVisibleItemCount(); ValueSetItem* pItem; - for (USHORT i=0; i<nCount && !bDone; i++) + for (sal_uInt16 i=0; i<nCount && !bDone; i++) { // Guard the retrieval of the i-th child with a try/catch block // just in case the number of children changes in the mean time. @@ -1226,7 +1226,7 @@ uno::Any SAL_CALL ValueItemAcc::getAccessibleKeyBinding() sal_Int32 SAL_CALL ValueItemAcc::getForeground( ) throw (uno::RuntimeException) { - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -1235,7 +1235,7 @@ sal_Int32 SAL_CALL ValueItemAcc::getForeground( ) sal_Int32 SAL_CALL ValueItemAcc::getBackground( ) throw (uno::RuntimeException) { - UINT32 nColor; + sal_uInt32 nColor; if (mpParent && mpParent->meType == VALUESETITEM_COLOR) nColor = mpParent->maColor.GetColor(); else diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx index abde4a015ab8..bc5252372be9 100755 --- a/svtools/source/control/valueimp.hxx +++ b/svtools/source/control/valueimp.hxx @@ -83,8 +83,8 @@ class ValueSet; struct ValueSetItem { ValueSet& mrParent; - USHORT mnId; - USHORT mnBits; + sal_uInt16 mnId; + sal_uInt16 mnBits; ValueSetItemType meType; Image maImage; Color maColor; @@ -142,7 +142,7 @@ public: ~ValueSetAcc(); void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ); - BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } + sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } static ValueSetAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw(); @@ -222,7 +222,7 @@ private: /** Return the number of items. This takes the None-Item into account. */ - USHORT getItemCount (void) const; + sal_uInt16 getItemCount (void) const; /** Return the item associated with the given index. The None-Item is taken into account which, when present, is taken to be the first @@ -233,7 +233,7 @@ private: @return Returns NULL when the given index is out of range. */ - ValueSetItem* getItem (USHORT nIndex) const; + ValueSetItem* getItem (sal_uInt16 nIndex) const; /** Check whether or not the object has been disposed (or is in the state of beeing disposed). If that is the case then @@ -288,7 +288,7 @@ public: void ParentDestroyed(); void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ); - BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } + sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } static ValueItemAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw(); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 62193eadf735..8875ce66354c 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -74,21 +74,21 @@ void ValueSet::ImplInit() mnUserVisLines = 0; mnSpacing = 0; mnFrameStyle = 0; - mbFormat = TRUE; - mbHighlight = FALSE ; - mbSelection = FALSE; - mbNoSelection = TRUE; - mbDrawSelection = TRUE; - mbBlackSel = FALSE; - mbDoubleSel = FALSE; - mbScroll = FALSE; - mbDropPos = FALSE; - mbFullMode = TRUE; + mbFormat = sal_True; + mbHighlight = sal_False ; + mbSelection = sal_False; + mbNoSelection = sal_True; + mbDrawSelection = sal_True; + mbBlackSel = sal_False; + mbDoubleSel = sal_False; + mbScroll = sal_False; + mbDropPos = sal_False; + mbFullMode = sal_True; // #106446#, #106601# force mirroring of virtual device maVirDev.EnableRTL( GetParent()->IsRTLEnabled() ); - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -120,7 +120,7 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient ValueSet::~ValueSet() { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> - xComponent (GetAccessible(FALSE), ::com::sun::star::uno::UNO_QUERY); + xComponent (GetAccessible(sal_False), ::com::sun::star::uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose (); @@ -156,8 +156,8 @@ void ValueSet::ImplDeleteItems() // ----------------------------------------------------------------------- -void ValueSet::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void ValueSet::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -315,7 +315,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem ) aPos.X() += (aRectSize.Width()-aImageSize.Width())/2; aPos.Y() += (aRectSize.Height()-aImageSize.Height())/2; - USHORT nImageStyle = 0; + sal_uInt16 nImageStyle = 0; if( !IsEnabled() ) nImageStyle |= IMAGE_DRAW_DISABLE; @@ -345,7 +345,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem ) void ValueSet::Format() { Size aWinSize = GetOutputSizePixel(); - ULONG nItemCount = mpImpl->mpItemList->Count(); + sal_uLong nItemCount = mpImpl->mpItemList->Count(); WinBits nStyle = GetStyle(); long nTxtHeight = GetTextHeight(); long nOff; @@ -425,7 +425,7 @@ void ValueSet::Format() { if ( mnUserItemWidth ) { - mnCols = (USHORT)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace)); + mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace)); if ( !mnCols ) mnCols = 1; } @@ -436,7 +436,7 @@ void ValueSet::Format() mnCols = mnUserCols; // Zeilenanzahl berechnen - mbScroll = FALSE; + mbScroll = sal_False; mnLines = (long)mpImpl->mpItemList->Count() / mnCols; if ( mpImpl->mpItemList->Count() % mnCols ) mnLines++; @@ -455,13 +455,13 @@ void ValueSet::Format() else mnVisLines = mnLines; if ( mnLines > mnVisLines ) - mbScroll = TRUE; + mbScroll = sal_True; if ( mnLines <= mnVisLines ) mnFirstLine = 0; else { - if ( mnFirstLine > (USHORT)(mnLines-mnVisLines) ) - mnFirstLine = (USHORT)(mnLines-mnVisLines); + if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) ) + mnFirstLine = (sal_uInt16)(mnLines-mnVisLines); } // Itemgroessen berechnen @@ -492,7 +492,7 @@ void ValueSet::Format() // Init VirDev maVirDev.SetSettings( GetSettings() ); maVirDev.SetBackground( GetBackground() ); - maVirDev.SetOutputSizePixel( aWinSize, TRUE ); + maVirDev.SetOutputSizePixel( aWinSize, sal_True ); // Bei zu kleinen Items machen wir nichts long nMinHeight = 2; @@ -509,7 +509,7 @@ void ValueSet::Format() } } - for ( ULONG i = 0; i < nItemCount; i++ ) + for ( sal_uLong i = 0; i < nItemCount; i++ ) { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( i ); pItem->maRect.SetEmpty(); @@ -535,17 +535,17 @@ void ValueSet::Format() (aHighColor.GetBlue() > 0x80)) || ((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) && (aHighColor.GetBlue() == 0x80)) ) - mbBlackSel = TRUE; + mbBlackSel = sal_True; else - mbBlackSel = FALSE; + mbBlackSel = sal_False; // Wenn die Items groesser sind, dann die Selektion doppelt so breit // zeichnen if ( (nStyle & WB_DOUBLEBORDER) && ((nItemWidth >= 25) && (nItemHeight >= 20)) ) - mbDoubleSel = TRUE; + mbDoubleSel = sal_True; else - mbDoubleSel = FALSE; + mbDoubleSel = sal_False; // Calculate offsets long nStartX; @@ -587,8 +587,8 @@ void ValueSet::Format() } // draw items - ULONG nFirstItem = mnFirstLine * mnCols; - ULONG nLastItem = nFirstItem + (mnVisLines * mnCols); + sal_uLong nFirstItem = mnFirstLine * mnCols; + sal_uLong nLastItem = nFirstItem + (mnVisLines * mnCols); if ( !mbFullMode ) { @@ -598,13 +598,13 @@ void ValueSet::Format() if ( y+(mnVisLines*(nItemHeight+nSpace)) < aWinSize.Height() ) nLastItem += mnCols; } - for ( ULONG i = 0; i < nItemCount; i++ ) + for ( sal_uLong i = 0; i < nItemCount; i++ ) { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( i ); if ( (i >= nFirstItem) && (i < nLastItem) ) { - const BOOL bWasEmpty = pItem->maRect.IsEmpty(); + const sal_Bool bWasEmpty = pItem->maRect.IsEmpty(); pItem->maRect.Left() = x; pItem->maRect.Top() = y; @@ -667,7 +667,7 @@ void ValueSet::Format() } // Jetzt haben wir formatiert und warten auf das naechste - mbFormat = FALSE; + mbFormat = sal_False; // ScrollBar loeschen if ( pDelScrBar ) @@ -709,13 +709,13 @@ void ValueSet::ImplDrawSelect() if ( !IsReallyVisible() ) return; - BOOL bFocus = HasFocus(); - BOOL bDrawSel; + sal_Bool bFocus = HasFocus(); + sal_Bool bDrawSel; if ( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) ) - bDrawSel = FALSE; + bDrawSel = sal_False; else - bDrawSel = TRUE; + bDrawSel = sal_True; if ( !bFocus && ((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight)) ) @@ -725,7 +725,7 @@ void ValueSet::ImplDrawSelect() return; } - USHORT nItemId = mnSelItemId; + sal_uInt16 nItemId = mnSelItemId; for( int stage = 0; stage < 2; stage++ ) { @@ -898,12 +898,12 @@ void ValueSet::ImplDrawSelect() // ----------------------------------------------------------------------- -void ValueSet::ImplHideSelect( USHORT nItemId ) +void ValueSet::ImplHideSelect( sal_uInt16 nItemId ) { Rectangle aRect; - USHORT nItemPos = GetItemPos( nItemId ); - if ( nItemPos != sal::static_int_cast<USHORT>(LIST_ENTRY_NOTFOUND) ) + sal_uInt16 nItemPos = GetItemPos( nItemId ); + if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) ) aRect = mpImpl->mpItemList->GetObject( nItemPos )->maRect; else { @@ -922,42 +922,42 @@ void ValueSet::ImplHideSelect( USHORT nItemId ) // ----------------------------------------------------------------------- -void ValueSet::ImplHighlightItem( USHORT nItemId, BOOL bIsSelection ) +void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection ) { if ( mnHighItemId != nItemId ) { // Alten merken, um vorherige Selektion zu entfernen - USHORT nOldItem = mnHighItemId; + sal_uInt16 nOldItem = mnHighItemId; mnHighItemId = nItemId; // Wenn keiner selektiert ist, dann Selektion nicht malen if ( !bIsSelection && mbNoSelection ) - mbDrawSelection = FALSE; + mbDrawSelection = sal_False; // Neu ausgeben und alte Selection wegnehmen ImplHideSelect( nOldItem ); ImplDrawSelect(); - mbDrawSelection = TRUE; + mbDrawSelection = sal_True; } } // ----------------------------------------------------------------------- -void ValueSet::ImplDrawDropPos( BOOL bShow ) +void ValueSet::ImplDrawDropPos( sal_Bool bShow ) { if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && mpImpl->mpItemList->Count() ) { - USHORT nItemPos = mnDropPos; - USHORT nItemId1; - USHORT nItemId2 = 0; - BOOL bRight; + sal_uInt16 nItemPos = mnDropPos; + sal_uInt16 nItemId1; + sal_uInt16 nItemId2 = 0; + sal_Bool bRight; if ( nItemPos >= mpImpl->mpItemList->Count() ) { - nItemPos = (USHORT)(mpImpl->mpItemList->Count()-1); - bRight = TRUE; + nItemPos = (sal_uInt16)(mpImpl->mpItemList->Count()-1); + bRight = sal_True; } else - bRight = FALSE; + bRight = sal_False; nItemId1 = GetItemId( nItemPos ); if ( (nItemId1 != mnSelItemId) && (nItemId1 != mnHighItemId) ) @@ -996,7 +996,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow ) Point aPos = aRect1.RightCenter(); nX = aPos.X()-2; nY = aPos.Y(); - for ( USHORT i = 0; i < 4; i++ ) + for ( sal_uInt16 i = 0; i < 4; i++ ) DrawLine( Point( nX-i, nY-i ), Point( nX-i, nY+i ) ); } if ( !aRect2.IsEmpty() ) @@ -1004,7 +1004,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow ) Point aPos = aRect2.LeftCenter(); nX = aPos.X()+2; nY = aPos.Y(); - for ( USHORT i = 0; i < 4; i++ ) + for ( sal_uInt16 i = 0; i < 4; i++ ) DrawLine( Point( nX+i, nY-i ), Point( nX+i, nY+i ) ); } } @@ -1089,7 +1089,7 @@ void ValueSet::ImplDraw() // ----------------------------------------------------------------------- -BOOL ValueSet::ImplScroll( const Point& rPos ) +sal_Bool ValueSet::ImplScroll( const Point& rPos ) { Size aOutSize = GetOutputSizePixel(); long nScrBarWidth; @@ -1100,10 +1100,10 @@ BOOL ValueSet::ImplScroll( const Point& rPos ) nScrBarWidth = 0; if ( !mbScroll || (rPos.X() < 0) || (rPos.X() > aOutSize.Width()-nScrBarWidth) ) - return FALSE; + return sal_False; long nScrollOffset; - USHORT nOldLine = mnFirstLine; + sal_uInt16 nOldLine = mnFirstLine; const Rectangle& rTopRect = mpImpl->mpItemList->GetObject( mnFirstLine*mnCols )->maRect; if ( rTopRect.GetHeight() <= 16 ) nScrollOffset = VALUESET_SCROLL_OFFSET/2; @@ -1116,7 +1116,7 @@ BOOL ValueSet::ImplScroll( const Point& rPos ) mnFirstLine--; } if ( (mnFirstLine == nOldLine) && - (mnFirstLine < (USHORT)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) ) + (mnFirstLine < (sal_uInt16)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) ) { long nBottomPos = mpImpl->mpItemList->GetObject( (mnFirstLine+mnVisLines-1)*mnCols )->maRect.Bottom(); if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) ) @@ -1125,17 +1125,17 @@ BOOL ValueSet::ImplScroll( const Point& rPos ) if ( mnFirstLine != nOldLine ) { - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const +sal_uInt16 ValueSet::ImplGetItem( const Point& rPos, sal_Bool bMove ) const { if ( mpNoneItem ) { @@ -1146,14 +1146,14 @@ USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const Point aDefPos; Rectangle aWinRect( aDefPos, maVirDev.GetOutputSizePixel() ); - ULONG nItemCount = mpImpl->mpItemList->Count(); - for ( ULONG i = 0; i < nItemCount; i++ ) + sal_uLong nItemCount = mpImpl->mpItemList->Count(); + for ( sal_uLong i = 0; i < nItemCount; i++ ) { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( i ); if ( pItem->maRect.IsInside( rPos ) ) { if ( aWinRect.IsInside( rPos ) ) - return (USHORT)i; + return (sal_uInt16)i; else return VALUESET_ITEM_NOTFOUND; } @@ -1173,7 +1173,7 @@ USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const // ----------------------------------------------------------------------- -ValueSetItem* ValueSet::ImplGetItem( USHORT nPos ) +ValueSetItem* ValueSet::ImplGetItem( sal_uInt16 nPos ) { if ( nPos == VALUESET_ITEM_NONEITEM ) return mpNoneItem; @@ -1185,8 +1185,8 @@ ValueSetItem* ValueSet::ImplGetItem( USHORT nPos ) ValueSetItem* ValueSet::ImplGetFirstItem() { - USHORT nItemCount = (USHORT)mpImpl->mpItemList->Count(); - USHORT i = 0; + sal_uInt16 nItemCount = (sal_uInt16)mpImpl->mpItemList->Count(); + sal_uInt16 i = 0; while ( i < nItemCount ) { @@ -1201,9 +1201,9 @@ ValueSetItem* ValueSet::ImplGetFirstItem() // ----------------------------------------------------------------------- -USHORT ValueSet::ImplGetVisibleItemCount() const +sal_uInt16 ValueSet::ImplGetVisibleItemCount() const { - USHORT nRet = 0; + sal_uInt16 nRet = 0; for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->Count(); n < nItemCount; n++ ) { @@ -1218,10 +1218,10 @@ USHORT ValueSet::ImplGetVisibleItemCount() const // ----------------------------------------------------------------------- -ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos ) +ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 nVisiblePos ) { ValueSetItem* pRet = NULL; - USHORT nFoundPos = 0; + sal_uInt16 nFoundPos = 0; for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->Count(); ( n < nItemCount ) && !pRet; n++ ) { @@ -1238,7 +1238,7 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos ) void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ) { - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); if( pAcc ) pAcc->FireAccessibleEvent( nEventId, rOldValue, rNewValue ); @@ -1246,9 +1246,9 @@ void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star:: // ----------------------------------------------------------------------- -BOOL ValueSet::ImplHasAccessibleListeners() +sal_Bool ValueSet::ImplHasAccessibleListeners() { - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); return( pAcc && pAcc->HasAccessibleListeners() ); } @@ -1256,11 +1256,11 @@ BOOL ValueSet::ImplHasAccessibleListeners() IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar ) { - USHORT nNewFirstLine = (USHORT)pScrollBar->GetThumbPos(); + sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos(); if ( nNewFirstLine != mnFirstLine ) { mnFirstLine = nNewFirstLine; - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); } return 0; @@ -1270,13 +1270,13 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar ) IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG ) { - ImplTracking( GetPointerPosPixel(), TRUE ); + ImplTracking( GetPointerPosPixel(), sal_True ); return 0; } // ----------------------------------------------------------------------- -void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat ) +void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat ) { if ( bRepeat || mbSelection ) { @@ -1295,22 +1295,22 @@ void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat ) if ( pItem && (pItem->meType != VALUESETITEM_SPACE) ) { if( GetStyle() & WB_MENUSTYLEVALUESET ) - mbHighlight = TRUE; + mbHighlight = sal_True; ImplHighlightItem( pItem->mnId ); } else { if( GetStyle() & WB_MENUSTYLEVALUESET ) - mbHighlight = TRUE; + mbHighlight = sal_True; - ImplHighlightItem( mnSelItemId, FALSE ); + ImplHighlightItem( mnSelItemId, sal_False ); } } // ----------------------------------------------------------------------- -void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel ) +void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel ) { ValueSetItem* pItem; @@ -1325,15 +1325,15 @@ void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel ) SelectItem( pItem->mnId ); if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) ) GrabFocus(); - mbHighlight = FALSE; - mbSelection = FALSE; + mbHighlight = sal_False; + mbSelection = sal_False; Select(); } else { - ImplHighlightItem( mnSelItemId, FALSE ); - mbHighlight = FALSE; - mbSelection = FALSE; + ImplHighlightItem( mnSelItemId, sal_False ); + mbHighlight = sal_False; + mbSelection = sal_False; } } @@ -1346,7 +1346,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt ) ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) ); if ( mbSelection ) { - mbHighlight = TRUE; + mbHighlight = sal_True; if ( pItem && (pItem->meType != VALUESETITEM_SPACE) ) { mnOldItemId = mnSelItemId; @@ -1363,7 +1363,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt ) if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) ) { mnOldItemId = mnSelItemId; - mbHighlight = TRUE; + mbHighlight = sal_True; mnHighItemId = mnSelItemId; ImplHighlightItem( pItem->mnId ); StartTracking( STARTTRACK_SCROLLREPEAT ); @@ -1385,7 +1385,7 @@ void ValueSet::MouseButtonUp( const MouseEvent& rMEvt ) { // Wegen SelectionMode if ( rMEvt.IsLeft() && mbSelection ) - ImplEndTracking( rMEvt.GetPosPixel(), FALSE ); + ImplEndTracking( rMEvt.GetPosPixel(), sal_False ); else Control::MouseButtonUp( rMEvt ); } @@ -1396,7 +1396,7 @@ void ValueSet::MouseMove( const MouseEvent& rMEvt ) { // Wegen SelectionMode if ( mbSelection || (GetStyle() & WB_MENUSTYLEVALUESET) ) - ImplTracking( rMEvt.GetPosPixel(), FALSE ); + ImplTracking( rMEvt.GetPosPixel(), sal_False ); Control::MouseMove( rMEvt ); } @@ -1416,10 +1416,10 @@ void ValueSet::Tracking( const TrackingEvent& rTEvt ) void ValueSet::KeyInput( const KeyEvent& rKEvt ) { - USHORT nLastItem = (USHORT)mpImpl->mpItemList->Count(); - USHORT nItemPos = VALUESET_ITEM_NOTFOUND; - USHORT nCurPos = VALUESET_ITEM_NONEITEM; - USHORT nCalcPos; + sal_uInt16 nLastItem = (sal_uInt16)mpImpl->mpItemList->Count(); + sal_uInt16 nItemPos = VALUESET_ITEM_NOTFOUND; + sal_uInt16 nCurPos = VALUESET_ITEM_NONEITEM; + sal_uInt16 nCalcPos; if ( !nLastItem || !ImplGetFirstItem() ) { @@ -1434,7 +1434,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) nCalcPos = nCurPos; //switch off selection mode if key travelling is used - BOOL bDefault = FALSE; + sal_Bool bDefault = sal_False; switch ( rKEvt.GetKeyCode().GetCode() ) { case KEY_HOME: @@ -1522,7 +1522,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) } } else if ( nCalcPos >= ( nLineCount * mnCols ) ) - nItemPos = sal::static_int_cast< USHORT >( + nItemPos = sal::static_int_cast< sal_uInt16 >( nCalcPos - ( nLineCount * mnCols )); else { @@ -1564,7 +1564,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) if ( nCalcPos == VALUESET_ITEM_NONEITEM ) nItemPos = mnCurCol; else if ( nCalcPos + ( nLineCount * mnCols ) <= nLastItem ) - nItemPos = sal::static_int_cast< USHORT >( + nItemPos = sal::static_int_cast< sal_uInt16 >( nCalcPos + ( nLineCount * mnCols )); else { @@ -1607,14 +1607,14 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) //no break; default: Control::KeyInput( rKEvt ); - bDefault = TRUE; + bDefault = sal_True; break; } if(!bDefault) EndSelection(); if ( nItemPos != VALUESET_ITEM_NOTFOUND ) { - USHORT nItemId; + sal_uInt16 nItemId; if ( nItemPos != VALUESET_ITEM_NONEITEM ) nItemId = GetItemId( nItemPos ); else @@ -1671,7 +1671,7 @@ void ValueSet::GetFocus() Control::GetFocus(); // Tell the accessible object that we got the focus. - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); if( pAcc ) pAcc->GetFocus(); } @@ -1688,7 +1688,7 @@ void ValueSet::LoseFocus() Control::LoseFocus(); // Tell the accessible object that we lost the focus. - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); if( pAcc ) pAcc->LoseFocus(); } @@ -1697,7 +1697,7 @@ void ValueSet::LoseFocus() void ValueSet::Resize() { - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); Control::Resize(); @@ -1710,7 +1710,7 @@ void ValueSet::RequestHelp( const HelpEvent& rHEvt ) if ( (rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON)) == HELPMODE_QUICK ) { Point aPos = ScreenToOutputPixel( rHEvt.GetMousePosPixel() ); - USHORT nItemPos = ImplGetItem( aPos ); + sal_uInt16 nItemPos = ImplGetItem( aPos ); if ( nItemPos != VALUESET_ITEM_NOTFOUND ) { ValueSetItem* pItem = ImplGetItem( nItemPos ); @@ -1756,23 +1756,23 @@ void ValueSet::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) ) { - mbFormat = TRUE; - ImplInitSettings( FALSE, FALSE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -1789,8 +1789,8 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - mbFormat = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } @@ -1817,7 +1817,7 @@ void ValueSet::UserDraw( const UserDrawEvent& ) // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1827,16 +1827,16 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, USHORT nPos ) pItem->mnId = nItemId; pItem->meType = VALUESETITEM_IMAGE; pItem->maImage = rImage; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1846,17 +1846,17 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, USHORT nPos ) pItem->mnId = nItemId; pItem->meType = VALUESETITEM_COLOR; pItem->maColor = rColor; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, - const XubString& rText, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, + const XubString& rText, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1867,17 +1867,17 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, pItem->meType = VALUESETITEM_IMAGE; pItem->maImage = rImage; pItem->maText = rText; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, - const XubString& rText, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, + const XubString& rText, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1888,16 +1888,16 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, pItem->meType = VALUESETITEM_COLOR; pItem->maColor = rColor; pItem->maText = rText; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1906,16 +1906,16 @@ void ValueSet::InsertItem( USHORT nItemId, USHORT nPos ) ValueSetItem* pItem = new ValueSetItem( *this ); pItem->mnId = nItemId; pItem->meType = VALUESETITEM_USERDRAW; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertSpace( USHORT nItemId, USHORT nPos ) +void ValueSet::InsertSpace( sal_uInt16 nItemId, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1924,18 +1924,18 @@ void ValueSet::InsertSpace( USHORT nItemId, USHORT nPos ) ValueSetItem* pItem = new ValueSetItem( *this ); pItem->mnId = nItemId; pItem->meType = VALUESETITEM_SPACE; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::RemoveItem( USHORT nItemId ) +void ValueSet::RemoveItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -1949,10 +1949,10 @@ void ValueSet::RemoveItem( USHORT nItemId ) mnOldItemId = 0; mnHighItemId = 0; mnSelItemId = 0; - mbNoSelection = TRUE; + mbNoSelection = sal_True; } - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -1988,9 +1988,9 @@ void ValueSet::CopyItems( const ValueSet& rValueSet ) mnOldItemId = 0; mnHighItemId = 0; mnSelItemId = 0; - mbNoSelection = TRUE; + mbNoSelection = sal_True; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2007,29 +2007,29 @@ void ValueSet::Clear() mnOldItemId = 0; mnHighItemId = 0; mnSelItemId = 0; - mbNoSelection = TRUE; + mbNoSelection = sal_True; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemCount() const +sal_uInt16 ValueSet::GetItemCount() const { - return (USHORT)mpImpl->mpItemList->Count(); + return (sal_uInt16)mpImpl->mpItemList->Count(); } // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemPos( USHORT nItemId ) const +sal_uInt16 ValueSet::GetItemPos( sal_uInt16 nItemId ) const { ValueSetItem* pItem = mpImpl->mpItemList->First(); while ( pItem ) { if ( pItem->mnId == nItemId ) - return (USHORT)mpImpl->mpItemList->GetCurPos(); + return (sal_uInt16)mpImpl->mpItemList->GetCurPos(); pItem = mpImpl->mpItemList->Next(); } @@ -2038,7 +2038,7 @@ USHORT ValueSet::GetItemPos( USHORT nItemId ) const // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemId( USHORT nPos ) const +sal_uInt16 ValueSet::GetItemId( sal_uInt16 nPos ) const { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( nPos ); @@ -2050,9 +2050,9 @@ USHORT ValueSet::GetItemId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemId( const Point& rPos ) const +sal_uInt16 ValueSet::GetItemId( const Point& rPos ) const { - USHORT nItemPos = ImplGetItem( rPos ); + sal_uInt16 nItemPos = ImplGetItem( rPos ); if ( nItemPos != VALUESET_ITEM_NOTFOUND ) return GetItemId( nItemPos ); @@ -2061,9 +2061,9 @@ USHORT ValueSet::GetItemId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle ValueSet::GetItemRect( USHORT nItemId ) const +Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maRect; @@ -2073,19 +2073,19 @@ Rectangle ValueSet::GetItemRect( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::EnableFullItemMode( BOOL bFullMode ) +void ValueSet::EnableFullItemMode( sal_Bool bFullMode ) { mbFullMode = bFullMode; } // ----------------------------------------------------------------------- -void ValueSet::SetColCount( USHORT nNewCols ) +void ValueSet::SetColCount( sal_uInt16 nNewCols ) { if ( mnUserCols != nNewCols ) { mnUserCols = nNewCols; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2093,12 +2093,12 @@ void ValueSet::SetColCount( USHORT nNewCols ) // ----------------------------------------------------------------------- -void ValueSet::SetLineCount( USHORT nNewLines ) +void ValueSet::SetLineCount( sal_uInt16 nNewLines ) { if ( mnUserVisLines != nNewLines ) { mnUserVisLines = nNewLines; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2111,7 +2111,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth ) if ( mnUserItemWidth != nNewItemWidth ) { mnUserItemWidth = nNewItemWidth; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2124,7 +2124,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight ) if ( mnUserItemHeight != nNewItemHeight ) { mnUserItemHeight = nNewItemHeight; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2132,12 +2132,12 @@ void ValueSet::SetItemHeight( long nNewItemHeight ) // ----------------------------------------------------------------------- -void ValueSet::SetFirstLine( USHORT nNewLine ) +void ValueSet::SetFirstLine( sal_uInt16 nNewLine ) { if ( mnFirstLine != nNewLine ) { mnFirstLine = nNewLine; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2145,9 +2145,9 @@ void ValueSet::SetFirstLine( USHORT nNewLine ) // ----------------------------------------------------------------------- -void ValueSet::SelectItem( USHORT nItemId ) +void ValueSet::SelectItem( sal_uInt16 nItemId ) { - USHORT nItemPos = 0; + sal_uInt16 nItemPos = 0; if ( nItemId ) { @@ -2160,31 +2160,31 @@ void ValueSet::SelectItem( USHORT nItemId ) if ( (mnSelItemId != nItemId) || mbNoSelection ) { - USHORT nOldItem = mnSelItemId ? mnSelItemId : 1; + sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1; mnSelItemId = nItemId; - mbNoSelection = FALSE; + mbNoSelection = sal_False; - BOOL bNewOut; - BOOL bNewLine; + sal_Bool bNewOut; + sal_Bool bNewLine; if ( !mbFormat && IsReallyVisible() && IsUpdateMode() ) - bNewOut = TRUE; + bNewOut = sal_True; else - bNewOut = FALSE; - bNewLine = FALSE; + bNewOut = sal_False; + bNewLine = sal_False; // Gegebenenfalls in den sichtbaren Bereich scrollen if ( mbScroll && nItemId ) { - USHORT nNewLine = (USHORT)(nItemPos / mnCols); + sal_uInt16 nNewLine = (sal_uInt16)(nItemPos / mnCols); if ( nNewLine < mnFirstLine ) { mnFirstLine = nNewLine; - bNewLine = TRUE; + bNewLine = sal_True; } - else if ( nNewLine > (USHORT)(mnFirstLine+mnVisLines-1) ) + else if ( nNewLine > (sal_uInt16)(mnFirstLine+mnVisLines-1) ) { - mnFirstLine = (USHORT)(nNewLine-mnVisLines+1); - bNewLine = TRUE; + mnFirstLine = (sal_uInt16)(nNewLine-mnVisLines+1); + bNewLine = sal_True; } } @@ -2194,7 +2194,7 @@ void ValueSet::SelectItem( USHORT nItemId ) { // Falls sich der sichtbare Bereich geaendert hat, // alles neu ausgeben - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); } else @@ -2210,7 +2210,7 @@ void ValueSet::SelectItem( USHORT nItemId ) // focus event (deselect) if( nOldItem ) { - const USHORT nPos = GetItemPos( nItemId ); + const sal_uInt16 nPos = GetItemPos( nItemId ); if( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -2236,7 +2236,7 @@ void ValueSet::SelectItem( USHORT nItemId ) } // focus event (select) - const USHORT nPos = GetItemPos( mnSelItemId ); + const sal_uInt16 nPos = GetItemPos( mnSelItemId ); ValueSetItem* pItem; if( nPos != VALUESET_ITEM_NOTFOUND ) @@ -2276,9 +2276,9 @@ void ValueSet::SelectItem( USHORT nItemId ) void ValueSet::SetNoSelection() { - mbNoSelection = TRUE; - mbHighlight = FALSE; - mbSelection = FALSE; + mbNoSelection = sal_True; + mbHighlight = sal_False; + mbSelection = sal_False; if ( IsReallyVisible() && IsUpdateMode() ) ImplDraw(); @@ -2286,9 +2286,9 @@ void ValueSet::SetNoSelection() // ----------------------------------------------------------------------- -void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits ) +void ValueSet::SetItemBits( sal_uInt16 nItemId, sal_uInt16 nItemBits ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) mpImpl->mpItemList->GetObject( nPos )->mnBits = nItemBits; @@ -2296,9 +2296,9 @@ void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits ) // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemBits( USHORT nItemId ) const +sal_uInt16 ValueSet::GetItemBits( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->mnBits; @@ -2308,9 +2308,9 @@ USHORT ValueSet::GetItemBits( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage ) +void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2325,14 +2325,14 @@ void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage ) Invalidate( pItem->maRect ); } else - mbFormat = TRUE; + mbFormat = sal_True; } // ----------------------------------------------------------------------- -Image ValueSet::GetItemImage( USHORT nItemId ) const +Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maImage; @@ -2342,9 +2342,9 @@ Image ValueSet::GetItemImage( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor ) +void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2359,14 +2359,14 @@ void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor ) Invalidate( pItem->maRect ); } else - mbFormat = TRUE; + mbFormat = sal_True; } // ----------------------------------------------------------------------- -Color ValueSet::GetItemColor( USHORT nItemId ) const +Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maColor; @@ -2376,9 +2376,9 @@ Color ValueSet::GetItemColor( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemData( USHORT nItemId, void* pData ) +void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2394,15 +2394,15 @@ void ValueSet::SetItemData( USHORT nItemId, void* pData ) Invalidate( pItem->maRect ); } else - mbFormat = TRUE; + mbFormat = sal_True; } } // ----------------------------------------------------------------------- -void* ValueSet::GetItemData( USHORT nItemId ) const +void* ValueSet::GetItemData( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->mpData; @@ -2412,9 +2412,9 @@ void* ValueSet::GetItemData( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemText( USHORT nItemId, const XubString& rText ) +void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2433,7 +2433,7 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText ) if ( !mbFormat && IsReallyVisible() && IsUpdateMode() ) { - USHORT nTempId = mnSelItemId; + sal_uInt16 nTempId = mnSelItemId; if ( mbHighlight ) nTempId = mnHighItemId; @@ -2455,9 +2455,9 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -XubString ValueSet::GetItemText( USHORT nItemId ) const +XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maText; @@ -2470,20 +2470,20 @@ XubString ValueSet::GetItemText( USHORT nItemId ) const void ValueSet::SetColor( const Color& rColor ) { maColor = rColor; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) ImplDraw(); } // ----------------------------------------------------------------------- -void ValueSet::SetExtraSpacing( USHORT nNewSpacing ) +void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing ) { if ( GetStyle() & WB_ITEMBORDER ) { mnSpacing = nNewSpacing; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2494,8 +2494,8 @@ void ValueSet::SetExtraSpacing( USHORT nNewSpacing ) void ValueSet::StartSelection() { mnOldItemId = mnSelItemId; - mbHighlight = TRUE; - mbSelection = TRUE; + mbHighlight = sal_True; + mbSelection = sal_True; mnHighItemId = mnSelItemId; } @@ -2509,17 +2509,17 @@ void ValueSet::EndSelection() EndTracking( ENDTRACK_CANCEL ); ImplHighlightItem( mnSelItemId ); - mbHighlight = FALSE; + mbHighlight = sal_False; } - mbSelection = FALSE; + mbSelection = sal_False; } // ----------------------------------------------------------------------- -BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) +sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( rCEvt.GetCommand() != COMMAND_STARTDRAG ) - return FALSE; + return sal_False; // Gegebenenfalls eine vorhandene Aktion abbrechen EndSelection(); @@ -2528,7 +2528,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and // Drop auch mal ueber Tastatur ausgeloest werden kann, testen wir // dies nur bei einer Mausaktion. - USHORT nSelId; + sal_uInt16 nSelId; if ( rCEvt.IsMouseEvent() ) nSelId = GetItemId( rCEvt.GetMousePosPixel() ); else @@ -2536,7 +2536,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // Falls kein Eintrag angeklickt wurde, starten wir kein Dragging if ( !nSelId ) - return FALSE; + return sal_False; // Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle // Seite setzen und Select rufen. @@ -2552,13 +2552,13 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // Region zuweisen rRegion = aRegion; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols, - USHORT nDesireLines ) +Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCols, + sal_uInt16 nDesireLines ) { long nCalcCols = (long)nDesireCols; long nCalcLines = (long)nDesireLines; @@ -2640,7 +2640,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols, // ----------------------------------------------------------------------- -Size ValueSet::CalcItemSizePixel( const Size& rItemSize, BOOL bOut ) const +Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const { Size aSize = rItemSize; @@ -2684,15 +2684,15 @@ long ValueSet::GetScrollWidth() const // ----------------------------------------------------------------------- -USHORT ValueSet::ShowDropPos( const Point& rPos ) +sal_uInt16 ValueSet::ShowDropPos( const Point& rPos ) { - mbDropPos = TRUE; + mbDropPos = sal_True; // Gegebenenfalls scrollen ImplScroll( rPos ); // DropPosition ermitteln - USHORT nPos = ImplGetItem( rPos, TRUE ); + sal_uInt16 nPos = ImplGetItem( rPos, sal_True ); if ( nPos == VALUESET_ITEM_NONEITEM ) nPos = 0; else if ( nPos == VALUESET_ITEM_NOTFOUND ) @@ -2702,7 +2702,7 @@ USHORT ValueSet::ShowDropPos( const Point& rPos ) aOutSize.Height() = mnTextOffset; if ( (rPos.X() >= 0) && (rPos.X() < aOutSize.Width()) && (rPos.Y() >= 0) && (rPos.Y() < aOutSize.Height()) ) - nPos = (USHORT)mpImpl->mpItemList->Count(); + nPos = (sal_uInt16)mpImpl->mpItemList->Count(); } else { @@ -2714,9 +2714,9 @@ USHORT ValueSet::ShowDropPos( const Point& rPos ) if ( nPos != mnDropPos ) { - ImplDrawDropPos( FALSE ); + ImplDrawDropPos( sal_False ); mnDropPos = nPos; - ImplDrawDropPos( TRUE ); + ImplDrawDropPos( sal_True ); } return mnDropPos; @@ -2728,8 +2728,8 @@ void ValueSet::HideDropPos() { if ( mbDropPos ) { - ImplDrawDropPos( FALSE ); - mbDropPos = FALSE; + ImplDrawDropPos( sal_False ); + mbDropPos = sal_False; } } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index bfcdfe98ea5a..27d1d1a6b239 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -41,7 +41,7 @@ #include <vcl/waitobj.hxx> #include <vcl/msgbox.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/awt/XWindow.hpp> @@ -590,9 +590,9 @@ void AssignmentPersistentData::Commit() for (sal_Int32 column=0; column<2; ++column) { // the label - m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((USHORT)(FT_FIELD_BASE + row * 2 + column))); + m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((sal_uInt16)(FT_FIELD_BASE + row * 2 + column))); // the listbox - m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((USHORT)(LB_FIELD_BASE + row * 2 + column))); + m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((sal_uInt16)(LB_FIELD_BASE + row * 2 + column))); m_pImpl->pFields[row * 2 + column]->SetDropDownLineCount(15); m_pImpl->pFields[row * 2 + column]->SetSelectHdl(LINK(this, AddressBookSourceDialog, OnFieldSelect)); diff --git a/svtools/source/dialogs/colctrl.cxx b/svtools/source/dialogs/colctrl.cxx index 4456fe2f1268..2aa1b5b10675 100644 --- a/svtools/source/dialogs/colctrl.cxx +++ b/svtools/source/dialogs/colctrl.cxx @@ -85,19 +85,19 @@ void SvColorControl::CreateBitmap() if( pWriteAccess ) { - USHORT nX = (USHORT) aSize.Width(); - USHORT nY = (USHORT) aSize.Height(); + sal_uInt16 nX = (sal_uInt16) aSize.Width(); + sal_uInt16 nY = (sal_uInt16) aSize.Height(); - UINT16 nHue, nSat; + sal_uInt16 nHue, nSat; ColorHSB aColHSB( 0, 0, mnLuminance ); - for( USHORT i = 0; i < nY; i++ ) + for( sal_uInt16 i = 0; i < nY; i++ ) { - nSat = (UINT16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY ); + nSat = (sal_uInt16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY ); - for( USHORT j = 0; j < nX; j++ ) + for( sal_uInt16 j = 0; j < nX; j++ ) { - nHue = (UINT16) FRound( ( 360.0 * j + 0.5 ) / nX ); + nHue = (sal_uInt16) FRound( ( 360.0 * j + 0.5 ) / nX ); aColHSB.SetHue( nHue ); aColHSB.SetSat( nSat ); @@ -161,7 +161,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt ) { if( rMEvt.IsLeft() && !rMEvt.IsShift() ) { - //ShowPointer( FALSE ); + //ShowPointer( sal_False ); CaptureMouse(); ShowPosition( rMEvt.GetPosPixel() ); Modify(); @@ -171,7 +171,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt ) // ----------------------------------------------------------------------- void SvColorControl::MouseButtonUp( const MouseEvent& ) { - //ShowPointer( TRUE ); + //ShowPointer( sal_True ); if( IsMouseCaptured() ) ReleaseMouse(); } @@ -219,16 +219,16 @@ void SvColorControl::Modify() } // ----------------------------------------------------------------------- -void SvColorControl::SetColor( const ColorHSB& rCol, BOOL bSetColor ) +void SvColorControl::SetColor( const ColorHSB& rCol, sal_Bool bSetColor ) { if( bSetColor ) maColor = rCol.GetRGB(); if( mpBitmap ) { - USHORT nX = (USHORT) mpBitmap->GetSizePixel().Width(); - USHORT nY = (USHORT) mpBitmap->GetSizePixel().Height(); - INT16 nZ = rCol.GetBri(); + sal_uInt16 nX = (sal_uInt16) mpBitmap->GetSizePixel().Width(); + sal_uInt16 nY = (sal_uInt16) mpBitmap->GetSizePixel().Height(); + sal_Int16 nZ = rCol.GetBri(); SetLuminance( nZ ); nX = rCol.GetHue() * nX / 360; // Farbe @@ -245,7 +245,7 @@ void SvColorControl::SetColor( const Color& rCol ) if( mpBitmap ) { ColorHSB aColHsb( rCol ); - SetColor( aColHsb, FALSE ); + SetColor( aColHsb, sal_False ); } } @@ -332,7 +332,7 @@ void ColorPreviewControl::SetColor( const Color& rCol ) // ----------------------------------------------------------------------- ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle, - USHORT nRows, USHORT nColumns ) : + sal_uInt16 nRows, sal_uInt16 nColumns ) : ValueSet ( pParent, nStyle ), mnRows ( nRows ), mnColumns ( nColumns ) @@ -342,7 +342,7 @@ ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle, // ----------------------------------------------------------------------- ColorMixingControl::ColorMixingControl( Window* pParent, const ResId& rResId, - USHORT nRows, USHORT nColumns ) : + sal_uInt16 nRows, sal_uInt16 nColumns ) : ValueSet ( pParent, rResId ), mnRows ( nRows ), mnColumns ( nColumns ) @@ -363,7 +363,7 @@ void ColorMixingControl::Initialize() Color aColor; String aStr; - for( USHORT i = 1; i <= mnRows * mnColumns; i++ ) + for( sal_uInt16 i = 1; i <= mnRows * mnColumns; i++ ) { InsertItem( i, aColor, aStr ); } @@ -386,30 +386,30 @@ void ColorMixingControl::Initialize() } // ----------------------------------------------------------------------- -Color ColorMixingControl::CalcDifferenceColor( USHORT nCol1, USHORT nCol2, - USHORT nSteps ) +Color ColorMixingControl::CalcDifferenceColor( sal_uInt16 nCol1, sal_uInt16 nCol2, + sal_uInt16 nSteps ) { // Die Berechnung ist noch etwas ungenau, daher sollte besser mit floats // gearbeitet werden... (muss !!!) Color aColor( GetItemColor( nCol1 ) ); Color aColor2( GetItemColor( nCol2 ) ); - aColor.SetRed( (UINT8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) ); - aColor.SetGreen( (UINT8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) ); - aColor.SetBlue( (UINT8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) ); + aColor.SetRed( (sal_uInt8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) ); + aColor.SetGreen( (sal_uInt8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) ); + aColor.SetBlue( (sal_uInt8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) ); return( aColor ); } // ----------------------------------------------------------------------- -void ColorMixingControl::FillRow( USHORT nRow ) +void ColorMixingControl::FillRow( sal_uInt16 nRow ) { - USHORT nCol1 = nRow * mnColumns + 1; - USHORT nCol2 = ( nRow + 1 ) * mnColumns; + sal_uInt16 nCol1 = nRow * mnColumns + 1; + sal_uInt16 nCol2 = ( nRow + 1 ) * mnColumns; Color aColor( GetItemColor( nCol1 ) ); Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnColumns - 1 ) ); - for( USHORT i = nCol1 + 1; i < nCol2; i++ ) + for( sal_uInt16 i = nCol1 + 1; i < nCol2; i++ ) { aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() ); aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() ); @@ -421,14 +421,14 @@ void ColorMixingControl::FillRow( USHORT nRow ) } // ----------------------------------------------------------------------- -void ColorMixingControl::FillColumn( USHORT nColumn ) +void ColorMixingControl::FillColumn( sal_uInt16 nColumn ) { - USHORT nCol1 = nColumn + 1; - USHORT nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1; + sal_uInt16 nCol1 = nColumn + 1; + sal_uInt16 nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1; Color aColor( GetItemColor( nCol1 ) ); Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnRows - 1 ) ); - for( USHORT i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns ) + for( sal_uInt16 i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns ) { aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() ); aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() ); @@ -440,13 +440,13 @@ void ColorMixingControl::FillColumn( USHORT nColumn ) } // ----------------------------------------------------------------------- -void ColorMixingControl::SetRows( USHORT nRows ) +void ColorMixingControl::SetRows( sal_uInt16 nRows ) { mnRows = nRows; } // ----------------------------------------------------------------------- -void ColorMixingControl::SetColumns( USHORT nColumns ) +void ColorMixingControl::SetColumns( sal_uInt16 nColumns ) { mnColumns = nColumns; } @@ -457,8 +457,8 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol ) if( rCol != maColor[ ePos ] ) { maColor[ ePos ] = rCol; - USHORT nPos = 0; - USHORT nColumn = 0; + sal_uInt16 nPos = 0; + sal_uInt16 nColumn = 0; String aStr( GetRGBString( rCol ) ); switch( ePos ) @@ -489,7 +489,7 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol ) SetItemText( nPos, aStr ); FillColumn( nColumn ); - for( USHORT i = 0; i < mnRows; i++ ) + for( sal_uInt16 i = 0; i < mnRows; i++ ) FillRow( i ); } } @@ -509,7 +509,7 @@ String ColorMixingControl::GetRGBString( const Color& rColor ) CMCPosition ColorMixingControl::GetCMCPosition() const { CMCPosition ePos = CMC_OTHER; - USHORT nPos = GetSelectItemId(); + sal_uInt16 nPos = GetSelectItemId(); if( nPos == 1 ) ePos = CMC_TOPLEFT; @@ -543,8 +543,8 @@ CMCPosition ColorMixingControl::GetCMCPosition() const ColorHSB::ColorHSB( const Color& rColor ) { - UINT8 c[3]; - UINT8 cMax, cMin; + sal_uInt8 c[3]; + sal_uInt8 cMax, cMin; c[0] = rColor.GetRed(); c[1] = rColor.GetGreen(); @@ -565,7 +565,7 @@ ColorHSB::ColorHSB( const Color& rColor ) if( c[2] < cMin ) cMin = c[2]; - UINT8 cDelta = cMax - cMin; + sal_uInt8 cDelta = cMax - cMin; // Saturation = max - min / max if( mnBri > 0 ) @@ -597,7 +597,7 @@ ColorHSB::ColorHSB( const Color& rColor ) if( dHue < 0.0 ) dHue += 360.0; - mnHue = (UINT16) dHue; + mnHue = (sal_uInt16) dHue; } } @@ -612,8 +612,8 @@ ColorHSB::ColorHSB( const Color& rColor ) Color ColorHSB::GetRGB() const { - UINT8 cR,cG,cB; - UINT8 nB = (UINT8) ( mnBri * 255 / 100 ); + sal_uInt8 cR,cG,cB; + sal_uInt8 nB = (sal_uInt8) ( mnBri * 255 / 100 ); if( mnSat == 0 ) { @@ -625,20 +625,20 @@ Color ColorHSB::GetRGB() const { double dH = mnHue; double f; - UINT16 n; + sal_uInt16 n; if( dH == 360.0 ) dH = 0.0; dH /= 60.0; - n = (UINT16) dH; + n = (sal_uInt16) dH; f = dH - n; // #107375# Doing the calculation completely in floating // point, the former optimization gave sometimes negative // results for c and was pointless anyway - UINT8 a = static_cast<UINT8>( nB * ( 100.0 - mnSat ) / 100.0 ); - UINT8 b = static_cast<UINT8>( nB * ( 100.0 - mnSat * f ) / 100.0 ); - UINT8 c = static_cast<UINT8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 ); + sal_uInt8 a = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat ) / 100.0 ); + sal_uInt8 b = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * f ) / 100.0 ); + sal_uInt8 c = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 ); switch( n ) { @@ -678,11 +678,11 @@ ColorCMYK::ColorCMYK( const Color& rColor ) Color ColorCMYK::GetRGB() const { int nTmp = Max( 0, 255 - ( mnCyan + mnKey ) ); - UINT8 cR = (UINT8) nTmp; + sal_uInt8 cR = (sal_uInt8) nTmp; nTmp = Max( 0, 255 - ( mnMagenta + mnKey ) ); - UINT8 cG = (UINT8) nTmp; + sal_uInt8 cG = (sal_uInt8) nTmp; nTmp = Max( 0, 255 - ( mnYellow + mnKey ) ); - UINT8 cB = (UINT8) nTmp; + sal_uInt8 cB = (sal_uInt8) nTmp; return( Color( cR, cG, cB ) ); } diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx index a52cc4b0834c..fa494b05b2ab 100644 --- a/svtools/source/dialogs/colrdlg.cxx +++ b/svtools/source/dialogs/colrdlg.cxx @@ -160,7 +160,7 @@ const Color& SvColorDialog::GetColor() const // ----------------------------------------------------------------------- IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) { - UINT16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB + sal_uInt16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB if( p == &maCtlColor ) { @@ -173,19 +173,19 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) } else if( p == &maNumRed ) { - maColor.SetRed( (UINT8)maNumRed.GetValue() ); + maColor.SetRed( (sal_uInt8)maNumRed.GetValue() ); maCtlColor.SetColor( maColor ); n = 6; } else if( p == &maNumGreen ) { - maColor.SetGreen( (UINT8)maNumGreen.GetValue() ); + maColor.SetGreen( (sal_uInt8)maNumGreen.GetValue() ); maCtlColor.SetColor( maColor ); n = 6; } else if( p == &maNumBlue ) { - maColor.SetBlue( (UINT8)maNumBlue.GetValue() ); + maColor.SetBlue( (sal_uInt8)maNumBlue.GetValue() ); maCtlColor.SetColor( maColor ); n = 6; } @@ -194,9 +194,9 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) p == &maNumLuminance ) { - ColorHSB aColorHSB( (UINT16) maNumHue.GetValue(), - (UINT16) maNumSaturation.GetValue(), - (UINT16) maNumLuminance.GetValue() ); + ColorHSB aColorHSB( (sal_uInt16) maNumHue.GetValue(), + (sal_uInt16) maNumSaturation.GetValue(), + (sal_uInt16) maNumLuminance.GetValue() ); maCtlColor.SetColor( aColorHSB ); maColor = maCtlColor.GetColor(); n = 3; @@ -211,10 +211,10 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) long aYellow = (long) ( (double)maNumYellow.GetValue() * 255.0 / 100.0 + 0.5 ); long aKey = (long) ( (double)maNumKey.GetValue() * 255.0 / 100.0 + 0.5 ); - ColorCMYK aColorCMYK( (UINT16) aCyan, - (UINT16) aMagenta, - (UINT16) aYellow, - (UINT16) aKey ); + ColorCMYK aColorCMYK( (sal_uInt16) aCyan, + (sal_uInt16) aMagenta, + (sal_uInt16) aYellow, + (sal_uInt16) aKey ); maColor = aColorCMYK.GetRGB(); maCtlColor.SetColor( maColor ); n = 5; @@ -274,7 +274,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p ) } else if( p == &maBtn2 ) { - USHORT nPos = maColMixCtrl.GetSelectItemId(); + sal_uInt16 nPos = maColMixCtrl.GetSelectItemId(); maColor = maColMixCtrl.GetItemColor( nPos ); maCtlColor.SetColor( maColor ); ColorModifyHdl( &maCtlColor ); @@ -286,7 +286,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p ) // ----------------------------------------------------------------------- IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG ) { - USHORT nPos = maColMixCtrl.GetSelectItemId(); + sal_uInt16 nPos = maColMixCtrl.GetSelectItemId(); CMCPosition ePos = maColMixCtrl.GetCMCPosition(); if( ePos != CMC_OTHER ) @@ -304,12 +304,12 @@ IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG ) // ----------------------------------------------------------------------- IMPL_LINK( SvColorDialog, SelectMixCtrlHdl, void *, EMPTYARG ) { - //USHORT nPos = maColMixCtrl.GetSelectItemId(); + //sal_uInt16 nPos = maColMixCtrl.GetSelectItemId(); //maFtRGB.SetText( maColMixCtrl.GetItemText( nPos ) ); CMCPosition ePos = maColMixCtrl.GetCMCPosition(); if( ePos == CMC_OTHER ) - maBtn1.Enable( FALSE ); + maBtn1.Enable( sal_False ); else maBtn1.Enable(); diff --git a/svtools/source/dialogs/filedlg.cxx b/svtools/source/dialogs/filedlg.cxx index de465b34e1c6..d0f86867686a 100644 --- a/svtools/source/dialogs/filedlg.cxx +++ b/svtools/source/dialogs/filedlg.cxx @@ -31,7 +31,7 @@ #include <svtools/filedlg.hxx> #include <filedlg2.hxx> -PathDialog::PathDialog( Window* _pParent, WinBits nStyle, BOOL bCreateDir ) : +PathDialog::PathDialog( Window* _pParent, WinBits nStyle, sal_Bool bCreateDir ) : ModalDialog( _pParent, WB_STDMODAL | nStyle ) { pImpFileDlg = new ImpSvFileDlg; @@ -70,7 +70,7 @@ long PathDialog::OK() if( aOKHdlLink.IsSet() ) return aOKHdlLink.Call( this ); else - return TRUE; + return sal_True; } @@ -80,7 +80,7 @@ FileDialog::FileDialog( Window* _pParent, WinBits nStyle ) : // Dadurch dass hier bei VCL nicht der CTOR mit ResType verwendet wird, // wurde im PathDialog-CTOR leider ein ImpPathDialog angelegt... // So zwar scheisse, aber der Dialog ist eh' nur ein Hack: - pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, FALSE ); + pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, sal_False ); } FileDialog::~FileDialog() @@ -122,17 +122,17 @@ void FileDialog::FilterSelect() aFilterHdlLink.Call( this ); } -USHORT FileDialog::GetFilterCount() const +sal_uInt16 FileDialog::GetFilterCount() const { return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterCount(); } -UniString FileDialog::GetFilterName( USHORT nPos ) const +UniString FileDialog::GetFilterName( sal_uInt16 nPos ) const { return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterName( nPos ); } -UniString FileDialog::GetFilterType( USHORT nPos ) const +UniString FileDialog::GetFilterType( sal_uInt16 nPos ) const { return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterType( nPos ); } diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index a2c68270ed81..6e6fd4fd2e84 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -73,9 +73,9 @@ DECLARE_LIST( UniStringList, UniString* ) p->Show(); -inline BOOL IsPrintable( sal_Unicode c ) +inline sal_Bool IsPrintable( sal_Unicode c ) { - return c >= 32 && c != 127 ? TRUE : FALSE; + return c >= 32 && c != 127 ? sal_True : sal_False; } long @@ -88,10 +88,10 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) if ( IsPrintable ( cCharCode ) ) { - USHORT nCurrentPos = GetSelectEntryPos(); - USHORT nEntries = GetEntryCount(); + sal_uInt16 nCurrentPos = GetSelectEntryPos(); + sal_uInt16 nEntries = GetEntryCount(); - for ( USHORT i = 1; i < nEntries; i++ ) + for ( sal_uInt16 i = 1; i < nEntries; i++ ) { UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries ); aEntry.EraseLeadingChars( ' ' ); @@ -116,7 +116,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) return ListBox::PreNotify ( rNEvt ); } -ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir ) +ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir ) { pSvPathDialog = pDlg; nDirCount = 0; @@ -287,14 +287,14 @@ IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p ) UniString aEntry( pDirList->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item DirEntry aNewPath; aNewPath.ToAbs(); - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wird nach oben gewechselt if( nCurPos < nDirCount ) @@ -321,7 +321,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aFile; aPath.ToAbs(); - GetPathDialog()->EndDialog( TRUE ); + GetPathDialog()->EndDialog( sal_True ); } else { @@ -338,7 +338,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) else if ( pBtn == pCancelBtn ) { - GetPathDialog()->EndDialog( FALSE ); + GetPathDialog()->EndDialog( sal_False ); } else if ( pBtn == pHomeBtn ) @@ -380,7 +380,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) UniString aEntry( pBox->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item @@ -388,7 +388,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) aNewPath.ToAbs(); if( pBox == pDirList ) { - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wenn es schon das aktuelle ist, dann mache nichts if( nCurPos == nDirCount-1 ) @@ -409,22 +409,22 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) { // Neuen Pfad setzen und Listboxen updaten aPath = aNewPath; - if( !aPath.SetCWD( TRUE ) ) + if( !aPath.SetCWD( sal_True ) ) { ErrorBox aBox( GetPathDialog(), WB_OK_CANCEL | WB_DEF_OK, UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ); if( aBox.Execute() == RET_CANCEL ) - GetPathDialog()->EndDialog( FALSE ); + GetPathDialog()->EndDialog( sal_False ); } - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); } pSvPathDialog->LeaveWait(); return 0; } -void ImpPathDialog::UpdateEntries( const BOOL ) +void ImpPathDialog::UpdateEntries( const sal_Bool ) { UniString aTabString; DirEntry aTmpPath; @@ -432,10 +432,10 @@ void ImpPathDialog::UpdateEntries( const BOOL ) nDirCount = aTmpPath.Level(); - pDirList->SetUpdateMode( FALSE ); + pDirList->SetUpdateMode( sal_False ); pDirList->Clear(); - for( USHORT i = nDirCount; i > 0; i-- ) + for( sal_uInt16 i = nDirCount; i > 0; i-- ) { UniString aName( aTabString ); aName += aTmpPath[i-1].GetName(); @@ -449,11 +449,11 @@ void ImpPathDialog::UpdateEntries( const BOOL ) Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE ); - USHORT nEntries = aDir.Count(); + sal_uInt16 nEntries = aDir.Count(); if( nEntries ) { UniStringList aSortDirList; - for ( USHORT n = 0; n < nEntries; n++ ) + for ( sal_uInt16 n = 0; n < nEntries; n++ ) { DirEntry& rEntry = aDir[n]; UniString aName( rEntry.GetName() ); @@ -461,7 +461,7 @@ void ImpPathDialog::UpdateEntries( const BOOL ) { if( FileStat( rEntry ).GetKind() & FSYS_KIND_DIR ) { - ULONG l = 0; + sal_uLong l = 0; if( xCollator.is() ) { for( l = 0; l < aSortDirList.Count(); l++ ) @@ -473,7 +473,7 @@ void ImpPathDialog::UpdateEntries( const BOOL ) } } - for( ULONG l = 0; l < aSortDirList.Count(); l++ ) + for( sal_uLong l = 0; l < aSortDirList.Count(); l++ ) { UniString aEntryStr( aTabString ); aEntryStr += *aSortDirList.GetObject(l); @@ -491,7 +491,7 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath ) pDirList->SetTopEntry( nDirCount > 1 ? nDirCount - 2 : nDirCount - 1 ); - pDirList->SetUpdateMode( TRUE ); + pDirList->SetUpdateMode( sal_True ); pDirList->Invalidate(); pDirList->Update(); @@ -502,10 +502,10 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath ) pEdit->SetText( aDirName ); } -BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) +sal_Bool ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) { if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) ) - return FALSE; + return sal_False; else { // Datei vorhanden ? @@ -519,7 +519,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) if( aQuery.Execute() == RET_YES ) rDirEntry.MakeDir(); else - return FALSE; + return sal_False; } if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) ) { @@ -529,7 +529,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) aBoxText.AppendAscii( "]" ); InfoBox aBox( GetPathDialog(), aBoxText ); aBox.Execute(); - return FALSE; + return sal_False; } } return GetPathDialog()->OK() != 0; @@ -539,8 +539,8 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) void ImpPathDialog::PreExecute() { // Neues Verzeichnis setzen und Listboxen updaten - aPath.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aPath.SetCWD( sal_True ); + UpdateEntries( sal_True ); // Zusaetzliche Buttons anordnen Point aPos; @@ -563,8 +563,8 @@ void ImpPathDialog::PreExecute() long nMaxWidth = 0; // Maximale Breite ermitteln - USHORT nChilds = GetPathDialog()->GetChildCount(); - USHORT n; + sal_uInt16 nChilds = GetPathDialog()->GetChildCount(); + sal_uInt16 n; for ( n = nOwnChilds; n < nChilds; n++ ) { Window* pChild = GetPathDialog()->GetChild( n ); @@ -624,11 +624,11 @@ void ImpPathDialog::PreExecute() DirEntry aTmpDirEntry; Dir aDir( aTmpDirEntry, FSYS_KIND_BLOCK ); - USHORT nCount = aDir.Count(), i; + sal_uInt16 nCount = aDir.Count(), i; for( i = 0; i < nCount; ++i ) { DirEntry& rEntry = aDir[i]; - UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, FALSE ); + UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, sal_False ); UniString aVolume = rEntry.GetVolume() ; aStr.ToUpperAscii(); @@ -674,8 +674,8 @@ void ImpPathDialog::SetPath( UniString const & rPath ) // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten pEdit->SetText( rPath ); - aFile.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aFile.SetCWD( sal_True ); + UpdateEntries( sal_True ); pSvPathDialog->LeaveWait(); } @@ -697,7 +697,7 @@ UniString ImpPathDialog::GetPath() const ImpFileDialog::ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType ) : - ImpPathDialog( pDlg, nType, FALSE ) + ImpPathDialog( pDlg, nType, sal_False ) { bOpen = (nWinBits & WB_SAVEAS) == 0; @@ -838,7 +838,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) UniString aEntry( pBox->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item @@ -848,7 +848,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) if( ( pDirList != pFileList ) && ( pBox == pDirList ) ) { // SVLOOK - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wenn es schon das aktuelle ist, dann mache nichts if( nCurPos == nDirCount-1 ) @@ -877,7 +877,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) { // dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aNewPath; - GetFileDialog()->EndDialog( TRUE ); + GetFileDialog()->EndDialog( sal_True ); } } @@ -890,23 +890,23 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) { // Neuen Pfad setzen und Listboxen updaten aPath = aNewPath; - if( !aPath.SetCWD( TRUE ) ) + if( !aPath.SetCWD( sal_True ) ) { if( ErrorBox( GetFileDialog(), WB_OK_CANCEL|WB_DEF_OK, UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ).Execute() == RET_CANCEL ) { - GetFileDialog()->EndDialog( FALSE ); + GetFileDialog()->EndDialog( sal_False ); } } - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); GetFileDialog()->FileSelect(); } if( pBox == pTypeList ) { // Neue Maske setzen, und Listboxen updaten - USHORT nCurPos = pTypeList->GetSelectEntryPos(); - if( nCurPos+1 > (USHORT)aFilterList.Count() ) + sal_uInt16 nCurPos = pTypeList->GetSelectEntryPos(); + if( nCurPos+1 > (sal_uInt16)aFilterList.Count() ) aMask = UniString::CreateFromAscii( ALLFILES ); else { @@ -918,7 +918,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) } pEdit->SetText( aMask() ); - UpdateEntries( FALSE ); + UpdateEntries( sal_False ); GetFileDialog()->FilterSelect(); } @@ -939,7 +939,7 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn ) // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aFile; aPath.ToAbs(); - GetFileDialog()->EndDialog( TRUE ); + GetFileDialog()->EndDialog( sal_True ); } else { @@ -954,19 +954,19 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn ) // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten pEdit->SetText( aMask() ); - aFile.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aFile.SetCWD( sal_True ); + UpdateEntries( sal_True ); GetFileDialog()->LeaveWait(); } } else if( pBtn == pCancelBtn ) - GetFileDialog()->EndDialog( FALSE ); + GetFileDialog()->EndDialog( sal_False ); return 0; } -void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) +void ImpFileDialog::UpdateEntries( const sal_Bool bWithDirs ) { GetFileDialog()->EnterWait(); @@ -977,16 +977,16 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) if( pFileList ) { - pFileList->SetUpdateMode( FALSE ); + pFileList->SetUpdateMode( sal_False ); pFileList->Clear(); } if( bWithDirs && (pDirList != pFileList) ) { - pDirList->SetUpdateMode( FALSE ); + pDirList->SetUpdateMode( sal_False ); pDirList->Clear(); - for( USHORT i = nDirCount; i > 0; i-- ) + for( sal_uInt16 i = nDirCount; i > 0; i-- ) { UniString aEntryStr( aTabString ); aEntryStr += aTmpPath[i-1].GetName(); @@ -1005,10 +1005,10 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) DirEntry aCurrent; aCurrent.ToAbs(); Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE ); - USHORT nEntries = aDir.Count(); + sal_uInt16 nEntries = aDir.Count(); // TempMask, weil Vergleich case-sensitiv - BOOL bMatchCase = FALSE; //aCurrent.IsCaseSensitive(); + sal_Bool bMatchCase = sal_False; //aCurrent.IsCaseSensitive(); UniString aWildCard( aMask.GetWildCard() ); if ( !bMatchCase ) aWildCard.ToLowerAscii(); @@ -1016,7 +1016,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) if ( nEntries ) { UniStringList aSortDirList; - for ( USHORT n = 0; n < nEntries; n++ ) + for ( sal_uInt16 n = 0; n < nEntries; n++ ) { DirEntry& rEntry = aDir[n]; UniString aName( rEntry.GetName() ); @@ -1045,7 +1045,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) } else { - ULONG l = 0; + sal_uLong l = 0; if( xCollator.is() ) { for( l = 0; l < aSortDirList.Count(); l++ ) @@ -1057,7 +1057,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) } } } - for( ULONG l = 0; l < aSortDirList.Count(); l++ ) + for( sal_uLong l = 0; l < aSortDirList.Count(); l++ ) { UniString aEntryStr( aTabString ); aEntryStr += *aSortDirList.GetObject(l); @@ -1075,7 +1075,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) pFileList->SelectEntryPos( 1 ); else pFileList->SetNoSelection(); - pFileList->SetUpdateMode( TRUE ); + pFileList->SetUpdateMode( sal_True ); pFileList->Invalidate(); pFileList->Update(); } @@ -1094,14 +1094,14 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) GetFileDialog()->LeaveWait(); } -BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) +sal_Bool ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) { if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) ) - return FALSE; + return sal_False; if( FileStat( rDirEntry ).GetKind() & FSYS_KIND_DIR ) { if( pFileList ) - return FALSE; + return sal_False; } else if( bOpen ) { @@ -1115,7 +1115,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) InfoBox aBox( GetFileDialog(), aErrorString ); aBox.Execute(); - return FALSE; + return sal_False; } } else @@ -1131,7 +1131,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) WinBits( WB_YES_NO | WB_DEF_NO ), aQueryString ); if( aBox.Execute() != RET_YES ) - return FALSE; + return sal_False; } } return GetFileDialog()->OK() != 0; @@ -1160,9 +1160,9 @@ void ImpFileDialog::SetPath( UniString const & rPath ) pEdit->SetText( rPath ); } - aFile.SetCWD( TRUE ); + aFile.SetCWD( sal_True ); - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); GetFileDialog()->LeaveWait(); } @@ -1223,7 +1223,7 @@ void ImpFileDialog::SetCurFilter( const UniString& rFilter ) pItem = aFilterList.Next(); if( pItem ) - pTypeList->SelectEntryPos( (USHORT)aFilterList.GetCurPos() ); + pTypeList->SelectEntryPos( (sal_uInt16)aFilterList.GetCurPos() ); else pTypeList->SetNoSelection(); } @@ -1254,7 +1254,7 @@ void ImpFileDialog::PreExecute() if( pTypeList ) { - USHORT nCurType = pTypeList->GetSelectEntryPos(); + sal_uInt16 nCurType = pTypeList->GetSelectEntryPos(); if( nCurType < aFilterList.Count() ) { UniString aFilterListMask = aFilterList.GetObject( nCurType )->aMask; @@ -1294,7 +1294,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const UniString aPostfix; // hier kommt die ausgesuchte Extension herein // ist ein Filter mit Extension gesetzt? - USHORT nChosenFilterPos = pTypeList->GetSelectEntryPos(); + sal_uInt16 nChosenFilterPos = pTypeList->GetSelectEntryPos(); if( nChosenFilterPos != LISTBOX_ENTRY_NOTFOUND ) { UniString aExtensionMask = GetFileDialog()->GetFilterType( nChosenFilterPos ); @@ -1347,7 +1347,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const } -void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate ) +void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate ) { delete pDlg; if ( nType == WINDOW_PATHDIALOG ) diff --git a/svtools/source/dialogs/filedlg2.hxx b/svtools/source/dialogs/filedlg2.hxx index 4d32565a2775..36214db27d33 100644 --- a/svtools/source/dialogs/filedlg2.hxx +++ b/svtools/source/dialogs/filedlg2.hxx @@ -91,10 +91,10 @@ private: PushButton* pHomeBtn; PushButton* pNewDirBtn; - USHORT nOwnChilds; + sal_uInt16 nOwnChilds; DirEntry aPath; // aktuell angewaehlter Pfad - USHORT nDirCount; // Anzahl der Verzeichnis- + sal_uInt16 nDirCount; // Anzahl der Verzeichnis- // Verschachtelungen ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > @@ -102,10 +102,10 @@ private: protected: - virtual void UpdateEntries( const BOOL bWithDirs ); + virtual void UpdateEntries( const sal_Bool bWithDirs ); void UpdateDirs( const DirEntry& rTmpPath ); - BOOL IsFileOk( const DirEntry& rDirEntry ); + sal_Bool IsFileOk( const DirEntry& rDirEntry ); void InitControls(); DECL_LINK( SelectHdl, ListBox * ); @@ -113,7 +113,7 @@ protected: DECL_LINK( ClickHdl, Button * ); public: - ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir ); + ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir ); virtual ~ImpPathDialog(); virtual void SetPath( const String& rPath ); @@ -142,9 +142,9 @@ private: WildCard aMask; // aktuelle Maske ImpFilterList aFilterList; // Filterliste - USHORT nCurFilter; // aktueller Filter + sal_uInt16 nCurFilter; // aktueller Filter - BOOL bOpen; // TRUE = Open; FALSE = SAVEAS + sal_Bool bOpen; // sal_True = Open; sal_False = SAVEAS protected: void InitControls(); @@ -155,8 +155,8 @@ protected: DECL_LINK( DblClickHdl, ListBox * ); DECL_LINK( ClickHdl, Button * ); - virtual void UpdateEntries( const BOOL bWithDirs ); - BOOL IsFileOk( const DirEntry& rDirEntry ); + virtual void UpdateEntries( const sal_Bool bWithDirs ); + sal_Bool IsFileOk( const DirEntry& rDirEntry ); public: ImpFileDialog( PathDialog* pDlg, WinBits nStyle, RESOURCE_TYPE nType ); @@ -168,9 +168,9 @@ public: void SetCurFilter( const String& rFilter ); String GetCurFilter() const; - USHORT GetFilterCount() const { return (USHORT)aFilterList.Count(); } - inline String GetFilterName( USHORT nPos ) const; - inline String GetFilterType( USHORT nPos ) const; + sal_uInt16 GetFilterCount() const { return (sal_uInt16)aFilterList.Count(); } + inline String GetFilterName( sal_uInt16 nPos ) const; + inline String GetFilterType( sal_uInt16 nPos ) const; virtual void SetPath( const String& rPath ); virtual void SetPath( const Edit& rEdit ); @@ -181,7 +181,7 @@ public: FileDialog* GetFileDialog() const { return (FileDialog*)GetPathDialog(); } }; -inline String ImpFileDialog::GetFilterName( USHORT nPos ) const +inline String ImpFileDialog::GetFilterName( sal_uInt16 nPos ) const { String aName; ImpFilterItem* pItem = aFilterList.GetObject( nPos ); @@ -190,7 +190,7 @@ inline String ImpFileDialog::GetFilterName( USHORT nPos ) const return aName; } -inline String ImpFileDialog::GetFilterType( USHORT nPos ) const +inline String ImpFileDialog::GetFilterType( sal_uInt16 nPos ) const { String aFilterMask; ImpFilterItem* pItem = aFilterList.GetObject( nPos ); @@ -209,7 +209,7 @@ public: ~ImpSvFileDlg() { delete pDlg; } ImpPathDialog* GetDialog() const { return pDlg; } - void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate ); + void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate ); void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); } diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx index 0dd30ebdab89..605f9ed5db07 100644 --- a/svtools/source/dialogs/insdlg.cxx +++ b/svtools/source/dialogs/insdlg.cxx @@ -77,7 +77,7 @@ PRV_SV_IMPL_OWNER_LIST( SvObjectServerList, SvObjectServer ) *************************************************************************/ const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) const { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uLong i = 0; i < Count(); i++ ) { if( rHumanName == GetObject( i ).GetHumanName() ) return &GetObject( i ); @@ -92,7 +92,7 @@ const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) cons *************************************************************************/ const SvObjectServer * SvObjectServerList::Get( const SvGlobalName & rName ) const { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uLong i = 0; i < Count(); i++ ) { if( rName == GetObject( i ).GetClassName() ) return &GetObject( i ); @@ -238,7 +238,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId ) struct SotResourcePair { SotFormatStringId mnSotId; - USHORT mnResId; + sal_uInt16 mnResId; }; static const SotResourcePair aSotResourcePairs[] = @@ -312,7 +312,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId ) }; String aUIName; - USHORT nResId = 0; + sal_uInt16 nResId = 0; for( sal_uInt32 i = 0, nCount = sizeof( aSotResourcePairs ) / sizeof( aSotResourcePairs[ 0 ] ); ( i < nCount ) && !nResId; i++ ) { diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index d07c41acba04..d98493114fd3 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -99,11 +99,11 @@ FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ) |* **************************************************************************/ -USHORT ImpSqrt( ULONG nRadi ) +sal_uInt16 ImpSqrt( sal_uLong nRadi ) { - register ULONG inf = 1; - register ULONG sup = nRadi; - register ULONG sqr; + register sal_uLong inf = 1; + register sal_uLong sup = nRadi; + register sal_uLong sqr; if ( !nRadi ) return 0; @@ -118,7 +118,7 @@ USHORT ImpSqrt( ULONG nRadi ) sqr = (nRadi/sqr + sqr) >> 1; // 2 Newton-Iterationen reichen fuer sqr = (nRadi/sqr + sqr) >> 1; // +- 1 Digit - return sal::static_int_cast< USHORT >(sqr); + return sal::static_int_cast< sal_uInt16 >(sqr); } /************************************************************************** @@ -133,7 +133,7 @@ USHORT ImpSqrt( ULONG nRadi ) // e**(i*nPhi), Einheit nPhi: 2**16 == 360 Grad -FixCpx ImpExPI( USHORT nPhi ) +FixCpx ImpExPI( sal_uInt16 nPhi ) { short i; FixCpx aIter(1L); // e**(0*i) @@ -165,10 +165,10 @@ FixCpx ImpExPI( USHORT nPhi ) // use for x*x+y*y==1 only -static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) +static sal_uInt16 ImpATanx2( const Fix& rX, const Fix& rY ) { - USHORT phi0 = 0; // result angel higher part - USHORT phi = 0; // dito lower part + sal_uInt16 phi0 = 0; // result angel higher part + sal_uInt16 phi = 0; // dito lower part long x = rX.x; long y = rY.x; long z; @@ -177,7 +177,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) FixCpx aTry; FixCpx aInc; FixCpx aIter(1L); - BOOL Small = FALSE; + sal_Bool Small = sal_False; if ( (x==0) && (y==0) ) return 0; @@ -225,7 +225,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) phi += (1<<i); if ( i > 11 ) - Small=TRUE; + Small=sal_True; } } } @@ -243,9 +243,9 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) |* **************************************************************************/ -USHORT ImpATan2( const short x, const short y ) +sal_uInt16 ImpATan2( const short x, const short y ) { - Fix rRad = ImpSqrt(ULONG(long(x)*x+long(y)*y)); + Fix rRad = ImpSqrt(sal_uLong(long(x)*x+long(y)*y)); if ( !rRad.x ) return 0; @@ -267,9 +267,9 @@ USHORT ImpATan2( const short x, const short y ) |* **************************************************************************/ -void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi ) +void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ) { - rRad = Fix( ImpSqrt( ULONG( long(x)*x+long(y)*y ) ) ); + rRad = Fix( ImpSqrt( sal_uLong( long(x)*x+long(y)*y ) ) ); if ( !rRad.x ) rPhi=0; @@ -294,7 +294,7 @@ void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi ) |* **************************************************************************/ -void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY ) +void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY ) { FixCpx fc = ImpExPI( Phi ); // calculate sin() & cos() fc.GetReal().MultBig( rR ); diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index 67d54fd80cf0..7708a8f1c89a 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -83,7 +83,7 @@ public: Fix() { x=0; } Fix( int i ) { x=(long(i)<<FIX_POST); } Fix( short l ) { x=(long(l)<<FIX_POST); } - Fix( USHORT l ) { x=(long(l)<<FIX_POST); } + Fix( sal_uInt16 l ) { x=(long(l)<<FIX_POST); } Fix( long l ) { x=(l<<FIX_POST); } Fix( long Z, long N ) { x=(Z<<FIX_POST)/N; } @@ -101,8 +101,8 @@ public: void DivBig( const Fix& a ) { x=((x<<FIX_P3)/a.x)<<FIX_P2; } - friend BOOL operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; } - friend BOOL operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; } + friend sal_Bool operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; } + friend sal_Bool operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; } operator long() const { return (x+FIX_ADD) >> FIX_POST; } operator double() const { return double(x)/(1<<FIX_POST); } @@ -218,11 +218,11 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b ) Fix ImpMultBig2( const Fix& a, const Fix& b ); FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ); -void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi ); -void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY ); +void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ); +void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY ); -USHORT ImpSqrt( ULONG nRadi ); -USHORT ImpATan2( const short x, const short y ); -FixCpx ImpExPI( USHORT nPhi ); +sal_uInt16 ImpSqrt( sal_uLong nRadi ); +sal_uInt16 ImpATan2( const short x, const short y ); +FixCpx ImpExPI( sal_uInt16 nPhi ); #endif // _MCVMATH_HXX diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index ceef2a88642b..12a71a706b60 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -61,7 +61,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter, // ----------------------------------------------------------------------- -void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear ) +void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear ) { if ( bClear ) pBox->Clear(); @@ -149,7 +149,7 @@ static void ImplPrnDlgAddString( XubString& rStr, const XubString& rAddStr ) // ----------------------------------------------------------------------- -static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId ) +static void ImplPrnDlgAddResString( XubString& rStr, sal_uInt16 nResId ) { SvtResId aResId( nResId ); XubString aAddStr( aResId ); @@ -161,7 +161,7 @@ static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId ) XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ) { XubString aStr; - ULONG nStatus = rInfo.GetStatus(); + sal_uLong nStatus = rInfo.GetStatus(); // Default-Printer if ( rInfo.GetPrinterName().Len() && @@ -221,7 +221,7 @@ XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ) ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_POWER_SAVE ); // Anzahl Jobs - ULONG nJobs = rInfo.GetJobs(); + sal_uLong nJobs = rInfo.GetJobs(); if ( nJobs && (nJobs != QUEUE_JOBS_DONTKNOW) ) { XubString aJobStr( SvtResId( STR_SVT_PRNDLG_JOBCOUNT ) ); @@ -273,7 +273,7 @@ PrinterSetupDialog::PrinterSetupDialog( Window* pWindow ) : PrinterSetupDialog::~PrinterSetupDialog() { - ImplFreePrnDlgListBox( &maLbName, FALSE ); + ImplFreePrnDlgListBox( &maLbName, sal_False ); delete mpTempPrinter; } @@ -378,7 +378,7 @@ short PrinterSetupDialog::Execute() if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() ) { DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" ); - return FALSE; + return sal_False; } Printer::updatePrinters(); @@ -391,7 +391,7 @@ short PrinterSetupDialog::Execute() short nRet = ModalDialog::Execute(); // Wenn Dialog mit OK beendet wurde, dann die Daten updaten - if ( nRet == TRUE ) + if ( nRet == sal_True ) { if ( mpTempPrinter ) mpPrinter->SetPrinterProps( mpTempPrinter ); diff --git a/svtools/source/dialogs/property.cxx b/svtools/source/dialogs/property.cxx index 3b081ce2f520..140d00d39bb1 100644 --- a/svtools/source/dialogs/property.cxx +++ b/svtools/source/dialogs/property.cxx @@ -108,7 +108,7 @@ void SvXPropertyEdit::SetCtrSize(const Size& rSize) aEdit.SetSizePixel(aSize); } -void SvXPropertyEdit::SetLocked(BOOL bLocked) +void SvXPropertyEdit::SetLocked(sal_Bool bLocked) { if(bLocked) Disable(); @@ -126,9 +126,9 @@ String SvXPropertyEdit::GetProperty() const return aEdit.GetText(); } -BOOL SvXPropertyEdit::HasList() +sal_Bool SvXPropertyEdit::HasList() { - return FALSE; + return sal_False; }; @@ -136,7 +136,7 @@ void SvXPropertyEdit::ClearList() { return; } -void SvXPropertyEdit::InsertEntry( const String&,USHORT ) +void SvXPropertyEdit::InsertEntry( const String&,sal_uInt16 ) { return; } @@ -236,7 +236,7 @@ void SvXPropertyListBox::SetCtrSize(const Size& rSize) aListBox.SetSizePixel(aSize); } -void SvXPropertyListBox::SetLocked(BOOL bLocked) +void SvXPropertyListBox::SetLocked(sal_Bool bLocked) { if(bLocked) Disable(); @@ -254,9 +254,9 @@ String SvXPropertyListBox::GetProperty()const return aListBox.GetSelectEntry(); } -BOOL SvXPropertyListBox::HasList() +sal_Bool SvXPropertyListBox::HasList() { - return TRUE; + return sal_True; } @@ -265,7 +265,7 @@ void SvXPropertyListBox::ClearList() aListBox.Clear(); } -void SvXPropertyListBox::InsertEntry( const String& rString,USHORT nPos) +void SvXPropertyListBox::InsertEntry( const String& rString,sal_uInt16 nPos) { aListBox.InsertEntry(rString,nPos); } @@ -345,7 +345,7 @@ SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, const ResId& rResId) aComboBox.Show(); } -void SvXPropertyComboBox::SetLocked(BOOL bLocked) +void SvXPropertyComboBox::SetLocked(sal_Bool bLocked) { if(bLocked) Disable(); @@ -384,9 +384,9 @@ String SvXPropertyComboBox::GetProperty() const return aComboBox.GetText(); } -BOOL SvXPropertyComboBox::HasList() +sal_Bool SvXPropertyComboBox::HasList() { - return TRUE; + return sal_True; } void SvXPropertyComboBox::ClearList() @@ -394,7 +394,7 @@ void SvXPropertyComboBox::ClearList() aComboBox.Clear(); } -void SvXPropertyComboBox::InsertEntry( const String& rString,USHORT nPos) +void SvXPropertyComboBox::InsertEntry( const String& rString,sal_uInt16 nPos) { aComboBox.InsertEntry(rString,nPos); } @@ -446,11 +446,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,WinBits nWinStyle) aName(this,WB_BORDER), pSvXPropertyControl(NULL), aXButton(this,WB_BORDER), - bIsLocked(FALSE), - bIsHyperlink(FALSE) + bIsLocked(sal_False), + bIsHyperlink(sal_False) { - bNeedsRepaint = TRUE; - bHasXButton = FALSE; + bNeedsRepaint = sal_True; + bHasXButton = sal_False; aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) ); aName.Show(); aXButton.Show(); @@ -465,11 +465,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,const ResId& rResId ) aName (this,WB_BORDER), pSvXPropertyControl(NULL), aXButton (this,WB_BORDER), - bIsLocked(FALSE), - bIsHyperlink(FALSE) + bIsLocked(sal_False), + bIsHyperlink(sal_False) { - bNeedsRepaint = TRUE; - bHasXButton = FALSE; + bNeedsRepaint = sal_True; + bHasXButton = sal_False; eKindOfCtr = KOC_UNDEFINED; aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) ); aName.Show(); @@ -504,11 +504,11 @@ void SvPropertyLine::Resize() aName.SetPosPixel(aPos); aName.SetSizePixel(aSize); - USHORT nXButtonWidth=0; + sal_uInt16 nXButtonWidth=0; if(bHasXButton) { - nXButtonWidth=(USHORT)aSize.Height(); + nXButtonWidth=(sal_uInt16)aSize.Height(); } a2Size.Width()=a2Size.Width()-nXButtonWidth; @@ -530,12 +530,12 @@ void SvPropertyLine::Resize() } } -void SvPropertyLine::SetNeedsRepaint(BOOL bFlag) +void SvPropertyLine::SetNeedsRepaint(sal_Bool bFlag) { bNeedsRepaint=bFlag; } -BOOL SvPropertyLine::NeedsRepaint() +sal_Bool SvPropertyLine::NeedsRepaint() { return bNeedsRepaint; } @@ -563,22 +563,22 @@ eKindOfControl SvPropertyLine::GetKindOfControl() void SvPropertyLine::ShowXButton() { - bHasXButton=TRUE; + bHasXButton=sal_True; aXButton.Show(); Resize(); } void SvPropertyLine::HideXButton() { - bHasXButton=FALSE; + bHasXButton=sal_False; aXButton.Hide(); Resize(); } -BOOL SvPropertyLine::IsVisibleXButton() +sal_Bool SvPropertyLine::IsVisibleXButton() { return bHasXButton; } -void SvPropertyLine::ShowAsHyperLink(BOOL nFlag) +void SvPropertyLine::ShowAsHyperLink(sal_Bool nFlag) { bIsHyperlink=nFlag; if(nFlag) @@ -595,24 +595,24 @@ void SvPropertyLine::ShowAsHyperLink(BOOL nFlag) } } -BOOL SvPropertyLine::IsShownAsHyperlink() +sal_Bool SvPropertyLine::IsShownAsHyperlink() { return bIsHyperlink; } -void SvPropertyLine::Locked(BOOL nFlag) +void SvPropertyLine::Locked(sal_Bool nFlag) { bIsLocked=nFlag; if(pSvXPropertyControl!=NULL) pSvXPropertyControl->SetLocked(nFlag); } -BOOL SvPropertyLine::IsLineLocked() +sal_Bool SvPropertyLine::IsLineLocked() { return bIsLocked; } -void SvPropertyLine::SetNameWidth(USHORT nWidth) +void SvPropertyLine::SetNameWidth(sal_uInt16 nWidth) { nNameWidth=nWidth; Resize(); @@ -687,7 +687,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, WinBits nWinSty nTheNameSize=0; ListBox aListBox(this,WB_DROPDOWN); aListBox.SetPosSizePixel(Point(0,0),Size(100,100)); - nRowHeight=(USHORT)aListBox.GetSizePixel().Height(); + nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height(); Wallpaper aWall = aPlayGround.GetBackground(); aWall.SetColor( Color( COL_TRANSPARENT ) ); aPlayGround.SetBackground( aWall ); @@ -709,7 +709,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, const ResId& rR nYOffset=0; ListBox aListBox(this,WB_DROPDOWN); aListBox.SetPosSizePixel(Point(0,0),Size(100,100)); - nRowHeight=(USHORT)aListBox.GetSizePixel().Height(); + nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height(); Wallpaper aWall = aPlayGround.GetBackground(); aWall.SetColor( Color( COL_TRANSPARENT ) ); aPlayGround.SetBackground( aWall ); @@ -727,7 +727,7 @@ SvListBoxForProperties::~SvListBoxForProperties() void SvListBoxForProperties::Clear() { - for(USHORT i=0;i<PLineArray.Count();i++) + for(sal_uInt16 i=0;i<PLineArray.Count();i++) { SvPropertyLine* pPropLine=PLineArray[i]; @@ -773,19 +773,19 @@ void SvListBoxForProperties::SetController( SvPropertyDataControl *pPDC) pPropDataControl=pPDC; } -USHORT SvListBoxForProperties::CalcVisibleLines() +sal_uInt16 SvListBoxForProperties::CalcVisibleLines() { Size aSize=aPlayGround.GetOutputSizePixel(); - USHORT nResult=0; + sal_uInt16 nResult=0; if(nRowHeight!=0) - nResult=(USHORT) aSize.Height()/nRowHeight; + nResult=(sal_uInt16) aSize.Height()/nRowHeight; return nResult; } void SvListBoxForProperties::UpdateVScroll() { - USHORT nLines=CalcVisibleLines(); + sal_uInt16 nLines=CalcVisibleLines(); aVScroll.SetPageSize(nLines-1); aVScroll.SetVisibleSize(nLines-1); aVScroll.SetRange(Range(0,PLineArray.Count()-1)); @@ -795,7 +795,7 @@ void SvListBoxForProperties::UpdateVScroll() } else { - BOOL bFlag=aVScroll.IsVisible(); + sal_Bool bFlag=aVScroll.IsVisible(); aVScroll.Show(); if(!bFlag)Resize(); } @@ -807,7 +807,7 @@ void SvListBoxForProperties::UpdatePosNSize() { Point aPos(0,nYOffset); - for(USHORT i=0; i<PLineArray.Count();i++) + for(sal_uInt16 i=0; i<PLineArray.Count();i++) { if((PLineArray[i])->NeedsRepaint()) { @@ -819,7 +819,7 @@ void SvListBoxForProperties::UpdatePosNSize() (PLineArray[i])->Invalidate(); (PLineArray[i])->Update(); (PLineArray[i])->Show(); - (PLineArray[i])->SetNeedsRepaint(FALSE); + (PLineArray[i])->SetNeedsRepaint(sal_False); } else { @@ -846,21 +846,21 @@ void SvListBoxForProperties::UpdatePlayGround() long nLines=aVScroll.GetPageSize(); long nDelta=aVScroll.GetDelta(); - USHORT nStart,nEnd; + sal_uInt16 nStart,nEnd; Size aSize=aPlayGround.GetOutputSizePixel(); Point aPEnd; aPEnd.X()=aSize.Width(); if(nDelta>0) { - nStart=(USHORT)(nThumbPos+nLines+1-nDelta); - nEnd=(USHORT)(nThumbPos+nLines); + nStart=(sal_uInt16)(nThumbPos+nLines+1-nDelta); + nEnd=(sal_uInt16)(nThumbPos+nLines); aPos.Y()=(nLines+1-nDelta)*nRowHeight; } else { - nStart=(USHORT)nThumbPos; - nEnd=(USHORT)(nThumbPos-nDelta); + nStart=(sal_uInt16)nThumbPos; + nEnd=(sal_uInt16)(nThumbPos-nDelta); aPEnd.Y()=(nThumbPos-nDelta)*nRowHeight;; } @@ -870,7 +870,7 @@ void SvListBoxForProperties::UpdatePlayGround() aPlayGround.Scroll(0,nDelta,SCROLL_CHILDREN); - for(USHORT i=nStart; i<=nEnd;i++) + for(sal_uInt16 i=nStart; i<=nEnd;i++) { (PLineArray[i])->SetPosSizePixel(aPos,aSize); (PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET); @@ -889,18 +889,18 @@ void SvListBoxForProperties::UpdateAll() void SvListBoxForProperties::DisableUpdate() { - bUpdate=FALSE; + bUpdate=sal_False; } void SvListBoxForProperties::EnableUpdate() { - bUpdate=TRUE; + bUpdate=sal_True; UpdateAll(); } void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const String & rValue ) { - USHORT i, iEnd = PLineArray.Count(); + sal_uInt16 i, iEnd = PLineArray.Count(); for( i = 0 ; i < iEnd ; i++ ) { SvPropertyLine* pPropLine = PLineArray[ i ]; @@ -912,14 +912,14 @@ void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const } } -USHORT SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData) +sal_uInt16 SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData) { return InsertEntry(aPropData); } -USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USHORT nPos) +sal_uInt16 SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, sal_uInt16 nPos) { - USHORT nInsPos=nPos; + sal_uInt16 nInsPos=nPos; SvPropertyLine* pPropLine=new SvPropertyLine(&aPlayGround,WB_TABSTOP | WB_DIALOGCONTROL); if(nPos==LISTBOX_APPEND) @@ -938,7 +938,7 @@ USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USH return nInsPos; } -void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHORT nPos) +void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, sal_uInt16 nPos) { if(nPos<PLineArray.Count()) { @@ -993,7 +993,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR if(pSvXPCtr->HasList()) { - for(USHORT i=0;i<aPropData.theValues.Count();i++) + for(sal_uInt16 i=0;i<aPropData.theValues.Count();i++) { pSvXPCtr->InsertEntry(*(aPropData.theValues[i])); } @@ -1002,7 +1002,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR pPropLine->SetName(aPropData.aName); - USHORT nTextWidth=(USHORT)aPlayGround.GetTextWidth(aPropData.aName); + sal_uInt16 nTextWidth=(sal_uInt16)aPlayGround.GetTextWidth(aPropData.aName); if ( nTheNameSize < nTextWidth ) nTheNameSize = nTextWidth; @@ -1022,21 +1022,21 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR } } -USHORT SvListBoxForProperties::GetFirstVisibleEntry() +sal_uInt16 SvListBoxForProperties::GetFirstVisibleEntry() { return 0; } -void SvListBoxForProperties::SetFirstVisibleEntry(USHORT) +void SvListBoxForProperties::SetFirstVisibleEntry(sal_uInt16) { return; } -void SvListBoxForProperties::SetSelectedEntry(USHORT) +void SvListBoxForProperties::SetSelectedEntry(sal_uInt16) { return; } -USHORT SvListBoxForProperties::GetSelectedEntry() +sal_uInt16 SvListBoxForProperties::GetSelectedEntry() { return 0; } @@ -1047,7 +1047,7 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB ) { long nDelta=aVScroll.GetDelta(); nYOffset=-aVScroll.GetThumbPos()*nRowHeight; - //aPlayGround.SetUpdateMode(FALSE); + //aPlayGround.SetUpdateMode(sal_False); long nThumbPos=aVScroll.GetThumbPos(); long nLines=aVScroll.GetPageSize(); @@ -1058,14 +1058,14 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB ) { if(i>=nThumbPos && i<=nThumbPos+nLines) { - (PLineArray[sal::static_int_cast< USHORT >(i)])-> - SetNeedsRepaint(TRUE); + (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])-> + SetNeedsRepaint(sal_True); } else { - (PLineArray[sal::static_int_cast< USHORT >(i)])->Hide(); - (PLineArray[sal::static_int_cast< USHORT >(i)])-> - SetNeedsRepaint(FALSE); + (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->Hide(); + (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])-> + SetNeedsRepaint(sal_False); } } } @@ -1186,9 +1186,9 @@ SvPropertyBox::~SvPropertyBox() void SvPropertyBox::ClearAll() { - USHORT nCount=aTabControl.GetPageCount(); + sal_uInt16 nCount=aTabControl.GetPageCount(); - for(USHORT i=nCount;i>=1;i--) + for(sal_uInt16 i=nCount;i>=1;i--) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(i); @@ -1207,10 +1207,10 @@ void SvPropertyBox::Resize() aTabControl.SetPosSizePixel(aPos,aSize); - USHORT nCount=aTabControl.GetPageCount(); + sal_uInt16 nCount=aTabControl.GetPageCount(); aSize=aTabControl.GetTabPageSizePixel(); - for(USHORT i=1;i<=nCount;i++) + for(sal_uInt16 i=1;i<=nCount;i++) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(i); @@ -1220,9 +1220,9 @@ void SvPropertyBox::Resize() } -USHORT SvPropertyBox::AppendPage( const String & rText ) +sal_uInt16 SvPropertyBox::AppendPage( const String & rText ) { - USHORT nId=aTabControl.GetPageCount()+1; + sal_uInt16 nId=aTabControl.GetPageCount()+1; aTabControl.InsertPage( nId,rText); SvTabPageForProperties* pPage=new SvTabPageForProperties(&aTabControl); pPage->SetSizePixel(aTabControl.GetTabPageSizePixel()); @@ -1232,17 +1232,17 @@ USHORT SvPropertyBox::AppendPage( const String & rText ) return nId; } -void SvPropertyBox::SetPage( USHORT nId) +void SvPropertyBox::SetPage( sal_uInt16 nId) { aTabControl.SetCurPageId(nId); } -USHORT SvPropertyBox::GetCurPage() +sal_uInt16 SvPropertyBox::GetCurPage() { return aTabControl.GetCurPageId(); } -USHORT SvPropertyBox::CalcVisibleLines() +sal_uInt16 SvPropertyBox::CalcVisibleLines() { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); @@ -1265,9 +1265,9 @@ void SvPropertyBox::DisableUpdate() void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr) { pThePropDataCtr=pDataCtr; - USHORT nCount=aTabControl.GetPageCount(); + sal_uInt16 nCount=aTabControl.GetPageCount(); - for(USHORT i=1;i<=nCount;i++) + for(sal_uInt16 i=1;i<=nCount;i++) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(i); @@ -1277,21 +1277,21 @@ void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr) } -USHORT SvPropertyBox::InsertEntry( const SvPropertyData& rData, USHORT nPos) +sal_uInt16 SvPropertyBox::InsertEntry( const SvPropertyData& rData, sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); return pPage->GetTheListBox()->InsertEntry(rData,nPos); } -void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, USHORT nPos) +void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); pPage->GetTheListBox()->ChangeEntry(rData,nPos); } -USHORT SvPropertyBox::AppendEntry( const SvPropertyData& rData) +sal_uInt16 SvPropertyBox::AppendEntry( const SvPropertyData& rData) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); @@ -1305,26 +1305,26 @@ void SvPropertyBox::SetPropertyValue( const String & rEntryName, const String & pPage->GetTheListBox()->SetPropertyValue( rEntryName, rValue ); } -void SvPropertyBox::SetFirstVisibleEntry(USHORT nPos) +void SvPropertyBox::SetFirstVisibleEntry(sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); pPage->GetTheListBox()->SetFirstVisibleEntry(nPos); } -USHORT SvPropertyBox::GetFirstVisibleEntry() +sal_uInt16 SvPropertyBox::GetFirstVisibleEntry() { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); return pPage->GetTheListBox()->GetFirstVisibleEntry(); } -void SvPropertyBox::SetSelectedEntry(USHORT nPos) +void SvPropertyBox::SetSelectedEntry(sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); pPage->GetTheListBox()->SetSelectedEntry(nPos); } -USHORT SvPropertyBox::GetSelectedEntry() +sal_uInt16 SvPropertyBox::GetSelectedEntry() { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); @@ -1411,7 +1411,7 @@ void SvBasicPropertyDataControl::SetTheCorrectProperty(const String& aString) aCorrectProperty=aString; } -void SvBasicPropertyDataControl::SetIsCorrect(BOOL nFlag) +void SvBasicPropertyDataControl::SetIsCorrect(sal_Bool nFlag) { bCorrectness=nFlag; } @@ -1451,15 +1451,15 @@ ScPropertyDlg::ScPropertyDlg( Window* pParent) : aPropListBox.SetController(&aBaProDatCtr); - USHORT nPageId=aPropListBox.AppendPage("YabbaDabbaDo"); + sal_uInt16 nPageId=aPropListBox.AppendPage("YabbaDabbaDo"); aPropListBox.SetPage(nPageId); aProperty.eKind=KOC_EDIT; aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); aProperty.aValue=sizeof ComboBox; - aProperty.bHasVisibleXButton=FALSE; - aProperty.bIsHyperLink=FALSE; - aProperty.bIsLocked=FALSE; + aProperty.bHasVisibleXButton=sal_False; + aProperty.bIsHyperLink=sal_False; + aProperty.bIsLocked=sal_False; aProperty.pDataPtr=NULL; aProperty.pControl=NULL; aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count()); @@ -1467,16 +1467,16 @@ ScPropertyDlg::ScPropertyDlg( Window* pParent) : aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count()); aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count()); aPropListBox.InsertEntry(aProperty); - aProperty.bHasVisibleXButton=TRUE; + aProperty.bHasVisibleXButton=sal_True; aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); aProperty.aValue="42"; aProperty.eKind=KOC_LISTBOX; aPropListBox.InsertEntry(aProperty); aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); aProperty.eKind=KOC_COMBOBOX; - aProperty.bHasVisibleXButton=FALSE; + aProperty.bHasVisibleXButton=sal_False; aPropListBox.InsertEntry(aProperty); } @@ -1494,19 +1494,19 @@ IMPL_LINK( ScPropertyDlg, ModifiedHdl, ListBox*, pLB ) { String aString("Don't know "); aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); if(nCount>20) { String aStr("Yabba "); aStr+=aPropListBox.GetCurPage(); - USHORT nPageId=aPropListBox.AppendPage(aStr); + sal_uInt16 nPageId=aPropListBox.AppendPage(aStr); aPropListBox.SetPage(nPageId); nCount=0; } aProperty.eKind=(eKindOfControl)(aKindOfListBox.GetSelectEntryPos()+1); - aProperty.bHasVisibleXButton=FALSE; - if((nCount % 5)==0) aProperty.bHasVisibleXButton=TRUE; + aProperty.bHasVisibleXButton=sal_False; + if((nCount % 5)==0) aProperty.bHasVisibleXButton=sal_True; aPropListBox.InsertEntry(aProperty); } return 0; @@ -1518,7 +1518,7 @@ IMPL_LINK( ScPropertyDlg, RowModifiedHdl, SvBasicPropertyDataControl* ,pProCtr) { aModAnswer.SetText(aBaProDatCtr.GetProperty()); aModAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } @@ -1529,7 +1529,7 @@ IMPL_LINK( ScPropertyDlg, CommitHdl, SvBasicPropertyDataControl*,pProCtr) { aCommitAnswer.SetText(aBaProDatCtr.GetProperty()); aCommitAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } @@ -1540,7 +1540,7 @@ IMPL_LINK( ScPropertyDlg, ClickHdl, SvBasicPropertyDataControl*,pProCtr) { aClickAnswer.SetText(aBaProDatCtr.GetName()); aClickAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } @@ -1551,7 +1551,7 @@ IMPL_LINK( ScPropertyDlg, SelectHdl, SvBasicPropertyDataControl*,pProCtr) { aSelectAnswer.SetText(aBaProDatCtr.GetName()); aSelectAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index f06b4f53ce7c..8787e39b1284 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -203,7 +203,7 @@ void WizardDialog::ImplPosCtrls() long nViewWidth = 0; long nViewHeight = 0; long nDlgHeight = nOffY; - USHORT nViewPosFlags = WINDOW_POSSIZE_POS; + sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS; if ( meViewAlign == WINDOWALIGN_TOP ) { nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X; @@ -338,9 +338,9 @@ void WizardDialog::ImplShowTabPage( TabPage* pTabPage ) // ----------------------------------------------------------------------- -TabPage* WizardDialog::ImplGetPage( USHORT nLevel ) const +TabPage* WizardDialog::ImplGetPage( sal_uInt16 nLevel ) const { - USHORT nTempLevel = 0; + sal_uInt16 nTempLevel = 0; ImplWizPageData* pPageData = mpFirstPage; while ( pPageData ) { @@ -447,7 +447,7 @@ long WizardDialog::Notify( NotifyEvent& rNEvt ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); KeyCode aKeyCode = pKEvt->GetKeyCode(); - USHORT nKeyCode = aKeyCode.GetCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); if ( aKeyCode.IsMod1() ) { @@ -458,11 +458,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt ) if ( mpPrevBtn->IsVisible() && mpPrevBtn->IsEnabled() && mpPrevBtn->IsInputEnabled() ) { - mpPrevBtn->SetPressed( TRUE ); - mpPrevBtn->SetPressed( FALSE ); + mpPrevBtn->SetPressed( sal_True ); + mpPrevBtn->SetPressed( sal_False ); mpPrevBtn->Click(); } - return TRUE; + return sal_True; } } else @@ -472,11 +472,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt ) if ( mpNextBtn->IsVisible() && mpNextBtn->IsEnabled() && mpNextBtn->IsInputEnabled() ) { - mpNextBtn->SetPressed( TRUE ); - mpNextBtn->SetPressed( FALSE ); + mpNextBtn->SetPressed( sal_True ); + mpNextBtn->SetPressed( sal_False ); mpNextBtn->Click(); } - return TRUE; + return sal_True; } } } @@ -499,43 +499,43 @@ long WizardDialog::DeactivatePage() if ( maDeactivateHdl.IsSet() ) return maDeactivateHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL WizardDialog::ShowNextPage() +sal_Bool WizardDialog::ShowNextPage() { return ShowPage( mnCurLevel+1 ); } // ----------------------------------------------------------------------- -BOOL WizardDialog::ShowPrevPage() +sal_Bool WizardDialog::ShowPrevPage() { if ( !mnCurLevel ) - return FALSE; + return sal_False; return ShowPage( mnCurLevel-1 ); } // ----------------------------------------------------------------------- -BOOL WizardDialog::ShowPage( USHORT nLevel ) +sal_Bool WizardDialog::ShowPage( sal_uInt16 nLevel ) { if ( DeactivatePage() ) { mnCurLevel = nLevel; ActivatePage(); ImplShowTabPage( ImplGetPage( mnCurLevel ) ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL WizardDialog::Finnish( long nResult ) +sal_Bool WizardDialog::Finnish( long nResult ) { if ( DeactivatePage() ) { @@ -546,10 +546,10 @@ BOOL WizardDialog::Finnish( long nResult ) EndDialog( nResult ); else if ( GetStyle() & WB_CLOSEABLE ) Close(); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -600,9 +600,9 @@ void WizardDialog::RemovePage( TabPage* pPage ) // ----------------------------------------------------------------------- -void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage ) +void WizardDialog::SetPage( sal_uInt16 nLevel, TabPage* pPage ) { - USHORT nTempLevel = 0; + sal_uInt16 nTempLevel = 0; ImplWizPageData* pPageData = mpFirstPage; while ( pPageData ) { @@ -623,9 +623,9 @@ void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage ) // ----------------------------------------------------------------------- -TabPage* WizardDialog::GetPage( USHORT nLevel ) const +TabPage* WizardDialog::GetPage( sal_uInt16 nLevel ) const { - USHORT nTempLevel = 0; + sal_uInt16 nTempLevel = 0; ImplWizPageData* pPageData = mpFirstPage; while ( pPageData ) { @@ -686,7 +686,7 @@ void WizardDialog::RemoveButton( Button* pButton ) // ----------------------------------------------------------------------- -void WizardDialog::ShowButtonFixedLine( BOOL bVisible ) +void WizardDialog::ShowButtonFixedLine( sal_Bool bVisible ) { if ( !mpFixedLine ) { @@ -701,7 +701,7 @@ void WizardDialog::ShowButtonFixedLine( BOOL bVisible ) // ----------------------------------------------------------------------- -BOOL WizardDialog::IsButtonFixedLineVisible() +sal_Bool WizardDialog::IsButtonFixedLineVisible() { return (mpFixedLine && mpFixedLine->IsVisible()); } diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index c211413af925..a62df6d64700 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -68,12 +68,12 @@ void MultiLineEditSyntaxHighlight::SetText(const String& rNewText) UpdateData(); } -void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey) +void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey) { TextSelection aCurrentPos = GetTextView()->GetSelection(); xub_StrLen aStartPos = aCurrentPos.GetStart().GetIndex(); - ULONG nStartPara = aCurrentPos.GetStart().GetPara(); - USHORT aCount = 0; + sal_uLong nStartPara = aCurrentPos.GetStart().GetPara(); + sal_uInt16 aCount = 0; int aChar = -1; switch (aKey) @@ -109,16 +109,16 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey) continue; String aLine( GetTextEngine()->GetText( aPara ) ); - for (USHORT i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (USHORT)(aLine.Len()-1); i>0; --i) + for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i) { if (aLine.GetChar(i)==aChar) { if (!aCount) { - GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, TRUE ); - GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, TRUE ); - GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, TRUE ); - GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, TRUE ); + GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, sal_True ); + GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, sal_True ); + GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, sal_True ); + GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, sal_True ); return; } else @@ -184,19 +184,19 @@ void MultiLineEditSyntaxHighlight::UpdateData() { // syntax highlighting // this must be possible improved by using notifychange correctly - BOOL bTempModified = GetTextEngine()->IsModified(); + sal_Bool bTempModified = GetTextEngine()->IsModified(); for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++) { String aLine( GetTextEngine()->GetText( nLine ) ); Range aChanges = aHighlighter.notifyChange( nLine, 0, &aLine, 1 ); - GetTextEngine()->RemoveAttribs( nLine, TRUE ); + GetTextEngine()->RemoveAttribs( nLine, sal_True ); HighlightPortions aPortions; aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); for ( size_t i = 0; i < aPortions.size(); i++ ) { HighlightPortion& r = aPortions[i]; - GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE ); + GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, sal_True ); } } GetTextView()->ShowCursor( false, true ); diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx index daaff472d1cc..1e9e7b7cd48b 100644 --- a/svtools/source/edit/svmedit.cxx +++ b/svtools/source/edit/svmedit.cxx @@ -65,11 +65,11 @@ private: ExtTextEngine* mpExtTextEngine; ExtTextView* mpExtTextView; - BOOL mbInMBDown; - BOOL mbFocusSelectionHide; - BOOL mbIgnoreTab; - BOOL mbActivePopup; - BOOL mbSelectOnTab; + sal_Bool mbInMBDown; + sal_Bool mbFocusSelectionHide; + sal_Bool mbIgnoreTab; + sal_Bool mbActivePopup; + sal_Bool mbSelectOnTab; public: TextWindow( Window* pParent ); @@ -91,17 +91,17 @@ public: virtual void GetFocus(); virtual void LoseFocus(); - BOOL IsAutoFocusHide() const { return mbFocusSelectionHide; } - void SetAutoFocusHide( BOOL bAutoHide ) { mbFocusSelectionHide = bAutoHide; } + sal_Bool IsAutoFocusHide() const { return mbFocusSelectionHide; } + void SetAutoFocusHide( sal_Bool bAutoHide ) { mbFocusSelectionHide = bAutoHide; } - BOOL IsIgnoreTab() const { return mbIgnoreTab; } - void SetIgnoreTab( BOOL bIgnore ) { mbIgnoreTab = bIgnore; } + sal_Bool IsIgnoreTab() const { return mbIgnoreTab; } + void SetIgnoreTab( sal_Bool bIgnore ) { mbIgnoreTab = bIgnore; } void DisableSelectionOnFocus() {mbSelectOnTab = sal_False;} virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > - GetComponentInterface(BOOL bCreate = TRUE); + GetComponentInterface(sal_Bool bCreate = sal_True); }; @@ -131,17 +131,17 @@ public: ImpSvMEdit( MultiLineEdit* pSvMultiLineEdit, WinBits nWinStyle ); ~ImpSvMEdit(); - void SetModified( BOOL bMod ); - BOOL IsModified() const; + void SetModified( sal_Bool bMod ); + sal_Bool IsModified() const; - void SetReadOnly( BOOL bRdOnly ); - BOOL IsReadOnly() const; + void SetReadOnly( sal_Bool bRdOnly ); + sal_Bool IsReadOnly() const; void SetMaxTextLen( xub_StrLen nLen ); xub_StrLen GetMaxTextLen() const; - void SetInsertMode( BOOL bInsert ); - BOOL IsInsertMode() const; + void SetInsertMode( sal_Bool bInsert ); + sal_Bool IsInsertMode() const; void InsertText( const String& rStr ); String GetSelected() const; @@ -163,13 +163,13 @@ public: void Resize(); void GetFocus(); - BOOL HandleCommand( const CommandEvent& rCEvt ); + sal_Bool HandleCommand( const CommandEvent& rCEvt ); - void Enable( BOOL bEnable ); + void Enable( sal_Bool bEnable ); Size CalcMinimumSize() const; - Size CalcSize( USHORT nColumns, USHORT nLines ) const; - void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const; + Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const; + void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const; void SetAlign( WinBits nWinStyle ); @@ -197,27 +197,27 @@ ImpSvMEdit::ImpSvMEdit( MultiLineEdit* pEdt, WinBits nWinStyle ) void ImpSvMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle ) { - const BOOL bHaveVScroll = (NULL != mpVScrollBar); - const BOOL bHaveHScroll = (NULL != mpHScrollBar); - const BOOL bHaveScrollBox = (NULL != mpScrollBox); + const sal_Bool bHaveVScroll = (NULL != mpVScrollBar); + const sal_Bool bHaveHScroll = (NULL != mpHScrollBar); + const sal_Bool bHaveScrollBox = (NULL != mpScrollBox); - BOOL bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL; - const BOOL bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL; + sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL; + const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL; - const BOOL bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL; + const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL; if ( !bNeedVScroll && bAutoVScroll ) { TextEngine& rEngine( *mpTextWindow->GetTextEngine() ); - ULONG nOverallTextHeight(0); - for ( ULONG i=0; i<rEngine.GetParagraphCount(); ++i ) + sal_uLong nOverallTextHeight(0); + for ( sal_uLong i=0; i<rEngine.GetParagraphCount(); ++i ) nOverallTextHeight += rEngine.GetTextHeight( i ); - if ( nOverallTextHeight > (ULONG)mpTextWindow->GetOutputSizePixel().Height() ) + if ( nOverallTextHeight > (sal_uLong)mpTextWindow->GetOutputSizePixel().Height() ) bNeedVScroll = true; } - const BOOL bNeedScrollBox = bNeedVScroll && bNeedHScroll; + const sal_Bool bNeedScrollBox = bNeedVScroll && bNeedHScroll; - BOOL bScrollbarsChanged = false; + sal_Bool bScrollbarsChanged = false; if ( bHaveVScroll != bNeedVScroll ) { delete mpVScrollBar; @@ -268,22 +268,22 @@ void ImpSvMEdit::InitFromStyle( WinBits nWinStyle ) SetAlign( nWinStyle ); if ( nWinStyle & WB_NOHIDESELECTION ) - mpTextWindow->SetAutoFocusHide( FALSE ); + mpTextWindow->SetAutoFocusHide( sal_False ); else - mpTextWindow->SetAutoFocusHide( TRUE ); + mpTextWindow->SetAutoFocusHide( sal_True ); if ( nWinStyle & WB_READONLY ) - mpTextWindow->GetTextView()->SetReadOnly( TRUE ); + mpTextWindow->GetTextView()->SetReadOnly( sal_True ); else - mpTextWindow->GetTextView()->SetReadOnly( FALSE ); + mpTextWindow->GetTextView()->SetReadOnly( sal_False ); if ( nWinStyle & WB_IGNORETAB ) { - mpTextWindow->SetIgnoreTab( TRUE ); + mpTextWindow->SetIgnoreTab( sal_True ); } else { - mpTextWindow->SetIgnoreTab( FALSE ); + mpTextWindow->SetIgnoreTab( sal_False ); // #103667# MultiLineEdit has the flag, but focusable window also needs this flag WinBits nStyle = mpTextWindow->GetStyle(); nStyle |= WINDOW_DLGCTRL_MOD1TAB; @@ -304,14 +304,14 @@ void ImpSvMEdit::ImpSetScrollBarRanges() { if ( mpVScrollBar ) { - ULONG nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight(); + sal_uLong nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight(); mpVScrollBar->SetRange( Range( 0, (long)nTextHeight-1 ) ); } if ( mpHScrollBar ) { -// ULONG nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); +// sal_uLong nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); // Es gibt kein Notify bei Breiten-Aenderung... -// ULONG nW = Max( (ULONG)mpTextWindow->GetOutputSizePixel().Width()*5, (ULONG)nTextWidth ); +// sal_uLong nW = Max( (sal_uLong)mpTextWindow->GetOutputSizePixel().Width()*5, (sal_uLong)nTextWidth ); // mpHScrollBar->SetRange( Range( 0, (long)nW ) ); mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth-1 ) ); } @@ -364,7 +364,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar ) nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos(); mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY ); - // mpTextWindow->GetTextView()->ShowCursor( FALSE, TRUE ); + // mpTextWindow->GetTextView()->ShowCursor( sal_False, sal_True ); return 0; } @@ -378,7 +378,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar ) void ImpSvMEdit::SetAlign( WinBits nWinStyle ) { - BOOL bRTL = Application::GetSettings().GetLayoutRTL(); + sal_Bool bRTL = Application::GetSettings().GetLayoutRTL(); mpTextWindow->GetTextEngine()->SetRightToLeft( bRTL ); if ( nWinStyle & WB_CENTER ) @@ -395,28 +395,28 @@ void ImpSvMEdit::SetTextWindowOffset( const Point& rOffset ) Resize(); } -void ImpSvMEdit::SetModified( BOOL bMod ) +void ImpSvMEdit::SetModified( sal_Bool bMod ) { mpTextWindow->GetTextEngine()->SetModified( bMod ); } -BOOL ImpSvMEdit::IsModified() const +sal_Bool ImpSvMEdit::IsModified() const { return mpTextWindow->GetTextEngine()->IsModified(); } -void ImpSvMEdit::SetInsertMode( BOOL bInsert ) +void ImpSvMEdit::SetInsertMode( sal_Bool bInsert ) { mpTextWindow->GetTextView()->SetInsertMode( bInsert ); } -void ImpSvMEdit::SetReadOnly( BOOL bRdOnly ) +void ImpSvMEdit::SetReadOnly( sal_Bool bRdOnly ) { mpTextWindow->GetTextView()->SetReadOnly( bRdOnly ); // Farbe anpassen ??????????????????????????? } -BOOL ImpSvMEdit::IsReadOnly() const +sal_Bool ImpSvMEdit::IsReadOnly() const { return mpTextWindow->GetTextView()->IsReadOnly(); } @@ -533,10 +533,10 @@ void ImpSvMEdit::Paste() void ImpSvMEdit::SetText( const String& rStr ) { - BOOL bWasModified = mpTextWindow->GetTextEngine()->IsModified(); + sal_Bool bWasModified = mpTextWindow->GetTextEngine()->IsModified(); mpTextWindow->GetTextEngine()->SetText( rStr ); if ( !bWasModified ) - mpTextWindow->GetTextEngine()->SetModified( FALSE ); + mpTextWindow->GetTextEngine()->SetModified( sal_False ); mpTextWindow->GetTextView()->SetSelection( TextSelection() ); @@ -593,7 +593,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( mpHScrollBar ) { - ULONG nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); + sal_uLong nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); if ( nWidth != mnTextWidth ) { mnTextWidth = sal::static_int_cast< xub_StrLen >(nWidth); @@ -625,9 +625,9 @@ void ImpSvMEdit::SetSelection( const Selection& rSelection ) long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() ); TextSelection aTextSel; - ULONG nPara = 0; - USHORT nChar = 0; - USHORT x = 0; + sal_uLong nPara = 0; + sal_uInt16 nChar = 0; + sal_uInt16 x = 0; while ( x <= nEnd ) { if ( x == aNewSelection.Min() ) @@ -656,7 +656,7 @@ const Selection& ImpSvMEdit::GetSelection() const ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine(); // Absaetze davor: - ULONG n; + sal_uLong n; for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ ) { maSelection.Min() += pExtTextEngine->GetTextLen( n ); @@ -691,7 +691,7 @@ Size ImpSvMEdit::CalcMinimumSize() const return aSz; } -Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const +Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const { static const sal_Unicode sampleText[] = { 'X', '\0' }; @@ -718,16 +718,16 @@ Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const return aSz; } -void ImpSvMEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const +void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { static const sal_Unicode sampleText[] = { 'x', '\0' }; Size aOutSz = mpTextWindow->GetOutputSizePixel(); Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() ); - rnCols = (USHORT) (aOutSz.Width()/aCharSz.Width()); - rnLines = (USHORT) (aOutSz.Height()/aCharSz.Height()); + rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width()); + rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height()); } -void ImpSvMEdit::Enable( BOOL bEnable ) +void ImpSvMEdit::Enable( sal_Bool bEnable ) { mpTextWindow->Enable( bEnable ); if ( mpHScrollBar ) @@ -736,15 +736,15 @@ void ImpSvMEdit::Enable( BOOL bEnable ) mpVScrollBar->Enable( bEnable ); } -BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt ) +sal_Bool ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) || ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) || ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) ) { mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar ); - bDone = TRUE; + bDone = sal_True; } return bDone; } @@ -752,12 +752,12 @@ BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt ) TextWindow::TextWindow( Window* pParent ) : Window( pParent ) { - mbInMBDown = FALSE; - mbSelectOnTab = TRUE; - mbFocusSelectionHide = FALSE; - mbIgnoreTab = FALSE; - mbActivePopup = FALSE; - mbSelectOnTab = TRUE; + mbInMBDown = sal_False; + mbSelectOnTab = sal_True; + mbFocusSelectionHide = sal_False; + mbIgnoreTab = sal_False; + mbActivePopup = sal_False; + mbSelectOnTab = sal_True; SetPointer( Pointer( POINTER_TEXT ) ); @@ -768,7 +768,7 @@ TextWindow::TextWindow( Window* pParent ) : Window( pParent ) mpExtTextEngine->SetLocale( GetSettings().GetLocale() ); mpExtTextView = new ExtTextView( mpExtTextEngine, this ); mpExtTextEngine->InsertView( mpExtTextView ); - mpExtTextEngine->EnableUndo( TRUE ); + mpExtTextEngine->EnableUndo( sal_True ); mpExtTextView->ShowCursor(); Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor(); @@ -790,11 +790,11 @@ void TextWindow::MouseMove( const MouseEvent& rMEvt ) void TextWindow::MouseButtonDown( const MouseEvent& rMEvt ) { - mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren wird + mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren wird mpExtTextView->MouseButtonDown( rMEvt ); Window::MouseButtonDown( rMEvt ); GrabFocus(); - mbInMBDown = FALSE; + mbInMBDown = sal_False; } void TextWindow::MouseButtonUp( const MouseEvent& rMEvt ) @@ -805,29 +805,29 @@ void TextWindow::MouseButtonUp( const MouseEvent& rMEvt ) void TextWindow::KeyInput( const KeyEvent& rKEvent ) { - BOOL bDone = FALSE; - USHORT nCode = rKEvent.GetKeyCode().GetCode(); + sal_Bool bDone = sal_False; + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); if ( nCode == com::sun::star::awt::Key::SELECT_ALL || ( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() ) ) { mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) ); - bDone = TRUE; + bDone = sal_True; } else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() ) { if ( Edit::GetGetSpecialCharsFunction() ) { // Damit die Selektion erhalten bleibt - mbActivePopup = TRUE; + mbActivePopup = sal_True; XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() ); if ( aChars.Len() ) { mpExtTextView->InsertText( aChars ); - mpExtTextView->GetTextEngine()->SetModified( TRUE ); + mpExtTextView->GetTextEngine()->SetModified( sal_True ); } - mbActivePopup = FALSE; - bDone = TRUE; + mbActivePopup = sal_False; + bDone = sal_True; } } else if ( nCode == KEY_TAB ) @@ -863,33 +863,33 @@ void TextWindow::Command( const CommandEvent& rCEvt ) pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES ); if ( !mpExtTextView->HasSelection() ) { - pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE ); + pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False ); } if ( mpExtTextView->IsReadOnly() ) { - pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE ); + pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False ); } if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() ) { - pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE ); + pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False ); } // if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) ) // { -// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE ); +// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False ); // } if ( !Edit::GetGetSpecialCharsFunction() ) { - USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL ); + sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL ); pPopup->RemoveItem( nPos ); pPopup->RemoveItem( nPos-1 ); } - mbActivePopup = TRUE; + mbActivePopup = sal_True; Point aPos = rCEvt.GetMousePosPixel(); if ( !rCEvt.IsMouseEvent() ) { @@ -898,26 +898,26 @@ void TextWindow::Command( const CommandEvent& rCEvt ) aPos = Point( aSize.Width()/2, aSize.Height()/2 ); } // pPopup->RemoveDisabledEntries(); - USHORT n = pPopup->Execute( this, aPos ); + sal_uInt16 n = pPopup->Execute( this, aPos ); Edit::DeletePopupMenu( pPopup ); switch ( n ) { case SV_MENU_EDIT_UNDO: mpExtTextView->Undo(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_CUT: mpExtTextView->Cut(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_COPY: mpExtTextView->Copy(); break; case SV_MENU_EDIT_PASTE: mpExtTextView->Paste(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_DELETE: mpExtTextView->DeleteSelected(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) ); @@ -928,13 +928,13 @@ void TextWindow::Command( const CommandEvent& rCEvt ) if ( aChars.Len() ) { mpExtTextView->InsertText( aChars ); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); } } break; } - mbActivePopup = FALSE; + mbActivePopup = sal_False; } else { @@ -948,19 +948,19 @@ void TextWindow::GetFocus() Window::GetFocus(); if ( !mbActivePopup ) { - BOOL bGotoCursor = !mpExtTextView->IsReadOnly(); + sal_Bool bGotoCursor = !mpExtTextView->IsReadOnly(); if ( mbFocusSelectionHide && IsReallyVisible() && !mpExtTextView->IsReadOnly() && ( mbSelectOnTab && (!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_FOCUS ) )) ) { // Alles selektieren, aber nicht scrollen - BOOL bAutoScroll = mpExtTextView->IsAutoScroll(); - mpExtTextView->SetAutoScroll( FALSE ); + sal_Bool bAutoScroll = mpExtTextView->IsAutoScroll(); + mpExtTextView->SetAutoScroll( sal_False ); mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) ); mpExtTextView->SetAutoScroll( bAutoScroll ); - bGotoCursor = FALSE; + bGotoCursor = sal_False; } - mpExtTextView->SetPaintSelection( TRUE ); + mpExtTextView->SetPaintSelection( sal_True ); mpExtTextView->ShowCursor( bGotoCursor ); } } @@ -970,12 +970,12 @@ void TextWindow::LoseFocus() Window::LoseFocus(); if ( mbFocusSelectionHide && !mbActivePopup ) - mpExtTextView->SetPaintSelection( FALSE ); + mpExtTextView->SetPaintSelection( sal_False ); } // virtual ::css::uno::Reference< ::css::awt::XWindowPeer > -TextWindow::GetComponentInterface(BOOL bCreate) +TextWindow::GetComponentInterface(sal_Bool bCreate) { ::css::uno::Reference< ::css::awt::XWindowPeer > xPeer( Window::GetComponentInterface(false)); @@ -992,10 +992,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, WinBits nWinStyle ) { SetType( WINDOW_MULTILINEEDIT ); pImpSvMEdit = new ImpSvMEdit( this, nWinStyle ); - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); pUpdateDataTimer = 0; - SetCompoundControl( TRUE ); + SetCompoundControl( sal_True ); SetStyle( ImplInitStyle( nWinStyle ) ); } @@ -1005,10 +1005,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId ) SetType( WINDOW_MULTILINEEDIT ); WinBits nWinStyle = rResId.GetWinBits(); pImpSvMEdit = new ImpSvMEdit( this, nWinStyle ); - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); pUpdateDataTimer = 0; - USHORT nMaxLen = Edit::GetMaxTextLen(); + sal_uInt16 nMaxLen = Edit::GetMaxTextLen(); if ( nMaxLen ) SetMaxTextLen( nMaxLen ); @@ -1017,7 +1017,7 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId ) if ( IsVisible() ) pImpSvMEdit->Resize(); - SetCompoundControl( TRUE ); + SetCompoundControl( sal_True ); SetStyle( ImplInitStyle( nWinStyle ) ); // Base Edit ctor could call Show already, but that would cause problems @@ -1052,7 +1052,7 @@ WinBits MultiLineEdit::ImplInitStyle( WinBits nStyle ) } -void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL bBackground ) +void MultiLineEdit::ImplInitSettings( sal_Bool /*bFont*/, sal_Bool /*bForeground*/, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -1084,7 +1084,7 @@ void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL { if( IsPaintTransparent() ) { - pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE ); + pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True ); pImpSvMEdit->GetTextWindow()->SetBackground(); pImpSvMEdit->GetTextWindow()->SetControlBackground(); SetBackground(); @@ -1126,20 +1126,20 @@ void MultiLineEdit::UpdateData() void MultiLineEdit::SetModifyFlag() { - pImpSvMEdit->SetModified( TRUE ); + pImpSvMEdit->SetModified( sal_True ); } void MultiLineEdit::ClearModifyFlag() { - pImpSvMEdit->SetModified( FALSE ); + pImpSvMEdit->SetModified( sal_False ); } -BOOL MultiLineEdit::IsModified() const +sal_Bool MultiLineEdit::IsModified() const { return pImpSvMEdit->IsModified(); } -void MultiLineEdit::EnableUpdateData( ULONG nTimeout ) +void MultiLineEdit::EnableUpdateData( sal_uLong nTimeout ) { if ( !nTimeout ) DisableUpdateData(); @@ -1154,7 +1154,7 @@ void MultiLineEdit::EnableUpdateData( ULONG nTimeout ) } } -void MultiLineEdit::SetReadOnly( BOOL bReadOnly ) +void MultiLineEdit::SetReadOnly( sal_Bool bReadOnly ) { pImpSvMEdit->SetReadOnly( bReadOnly ); Edit::SetReadOnly( bReadOnly ); @@ -1168,7 +1168,7 @@ void MultiLineEdit::SetReadOnly( BOOL bReadOnly ) SetStyle( nStyle ); } -BOOL MultiLineEdit::IsReadOnly() const +sal_Bool MultiLineEdit::IsReadOnly() const { return pImpSvMEdit->IsReadOnly(); } @@ -1299,7 +1299,7 @@ Size MultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const return aSz; } -Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const +Size MultiLineEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const { Size aSz = pImpSvMEdit->CalcSize( nColumns, nLines ); @@ -1310,7 +1310,7 @@ Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const return aSz; } -void MultiLineEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const +void MultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { pImpSvMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines ); } @@ -1320,7 +1320,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType ) if( nType == STATE_CHANGE_ENABLE ) { pImpSvMEdit->Enable( IsEnabled() ); - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); } else if( nType == STATE_CHANGE_READONLY ) { @@ -1329,23 +1329,23 @@ void MultiLineEdit::StateChanged( StateChangedType nType ) else if ( nType == STATE_CHANGE_ZOOM ) { pImpSvMEdit->GetTextWindow()->SetZoom( GetZoom() ); - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Resize(); } else if ( nType == STATE_CHANGE_CONTROLFONT ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Resize(); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } else if ( nType == STATE_CHANGE_STYLE ) @@ -1357,7 +1357,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType ) { if( IsPaintTransparent() ) { - pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE ); + pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True ); pImpSvMEdit->GetTextWindow()->SetBackground(); pImpSvMEdit->GetTextWindow()->SetControlBackground(); SetBackground(); @@ -1373,7 +1373,7 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Resize(); Invalidate(); } @@ -1381,14 +1381,14 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt ) Control::DataChanged( rDCEvt ); } -void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags ) +void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); Font aFont = pImpSvMEdit->GetTextWindow()->GetDrawPixelFont( pDev ); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); OutDevType eOutDevType = pDev->GetOutDevType(); pDev->Push(); @@ -1399,8 +1399,8 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi // Border/Background pDev->SetLineColor(); pDev->SetFillColor(); - BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER); - BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground(); + sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER); + sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground(); if ( bBorder || bBackground ) { Rectangle aRect( aPos, aSize ); @@ -1434,7 +1434,7 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi XubString aText = GetText(); Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() ); - ULONG nLines = (ULONG) (aSize.Height() / aTextSz.Height()); + sal_uLong nLines = (sal_uLong) (aSize.Height() / aTextSz.Height()); if ( !nLines ) nLines = 1; aTextSz.Height() = nLines*aTextSz.Height(); @@ -1588,24 +1588,24 @@ ScrollBar* MultiLineEdit::GetVScrollBar() const return pImpSvMEdit->GetVScrollBar(); } -void MultiLineEdit::EnableFocusSelectionHide( BOOL bHide ) +void MultiLineEdit::EnableFocusSelectionHide( sal_Bool bHide ) { pImpSvMEdit->GetTextWindow()->SetAutoFocusHide( bHide ); } -BOOL MultiLineEdit::IsFocusSelectionHideEnabled() const +sal_Bool MultiLineEdit::IsFocusSelectionHideEnabled() const { return pImpSvMEdit->GetTextWindow()->IsAutoFocusHide(); } -void MultiLineEdit::SetLeftMargin( USHORT n ) +void MultiLineEdit::SetLeftMargin( sal_uInt16 n ) { if ( GetTextEngine() ) GetTextEngine()->SetLeftMargin( n ); } -USHORT MultiLineEdit::GetLeftMargin() const +sal_uInt16 MultiLineEdit::GetLeftMargin() const { if ( GetTextEngine() ) return GetTextEngine()->GetLeftMargin(); @@ -1613,7 +1613,7 @@ USHORT MultiLineEdit::GetLeftMargin() const return 0; } -void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft ) +void MultiLineEdit::SetRightToLeft( sal_Bool bRightToLeft ) { if ( GetTextEngine() ) { @@ -1622,9 +1622,9 @@ void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft ) } } -BOOL MultiLineEdit::IsRightToLeft() const +sal_Bool MultiLineEdit::IsRightToLeft() const { - BOOL bRightToLeft = FALSE; + sal_Bool bRightToLeft = sal_False; if ( GetTextEngine() ) bRightToLeft = GetTextEngine()->IsRightToLeft(); @@ -1634,7 +1634,7 @@ BOOL MultiLineEdit::IsRightToLeft() const // virtual ::css::uno::Reference< ::css::awt::XWindowPeer > -MultiLineEdit::GetComponentInterface(BOOL bCreate) +MultiLineEdit::GetComponentInterface(sal_Bool bCreate) { ::css::uno::Reference< ::css::awt::XWindowPeer > xPeer( Edit::GetComponentInterface(false)); diff --git a/svtools/source/edit/svmedit2.cxx b/svtools/source/edit/svmedit2.cxx index 19eba618a828..2a4c0134005a 100644 --- a/svtools/source/edit/svmedit2.cxx +++ b/svtools/source/edit/svmedit2.cxx @@ -49,32 +49,32 @@ ExtMultiLineEdit::~ExtMultiLineEdit() { } -void ExtMultiLineEdit::InsertText( const String& rNew, BOOL ) +void ExtMultiLineEdit::InsertText( const String& rNew, sal_Bool ) { - GetTextView()->InsertText( rNew, FALSE ); + GetTextView()->InsertText( rNew, sal_False ); } -void ExtMultiLineEdit::SetAutoScroll( BOOL bAutoScroll ) +void ExtMultiLineEdit::SetAutoScroll( sal_Bool bAutoScroll ) { GetTextView()->SetAutoScroll( bAutoScroll ); } -void ExtMultiLineEdit::EnableCursor( BOOL bEnable ) +void ExtMultiLineEdit::EnableCursor( sal_Bool bEnable ) { GetTextView()->EnableCursor( bEnable ); } -void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd ) +void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd ) { GetTextEngine()->SetAttrib( rAttr, nPara, nStart, nEnd ); } -void ExtMultiLineEdit::SetLeftMargin( USHORT nLeftMargin ) +void ExtMultiLineEdit::SetLeftMargin( sal_uInt16 nLeftMargin ) { GetTextEngine()->SetLeftMargin( nLeftMargin ); } -ULONG ExtMultiLineEdit::GetParagraphCount() const +sal_uLong ExtMultiLineEdit::GetParagraphCount() const { return GetTextEngine()->GetParagraphCount(); } diff --git a/svtools/source/edit/sychconv.cxx b/svtools/source/edit/sychconv.cxx index d72200ac9c42..5e723815eb37 100644 --- a/svtools/source/edit/sychconv.cxx +++ b/svtools/source/edit/sychconv.cxx @@ -30,14 +30,14 @@ #include <svtools/sychconv.hxx> #include <vcl/outdev.hxx> -BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev ) +sal_Bool SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev ) { // hibyte 0 = exact matching // 1 = little differences, // 2 = the converted character does not look like the original but got the same meaning // 3 = the destination does not match looking and meaning of the original - static USHORT __READONLY_DATA aWingdingsToStarBatsTable[ 256 - 32 ] = + static sal_uInt16 __READONLY_DATA aWingdingsToStarBatsTable[ 256 - 32 ] = { 0x0020, 0x0238, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0174, 0x02BA, 0x017B, 0x017C, 0x037C, 0x037C, 0x037C, 0x037C, 0x0000, 0x0000, 0x0372, 0x0272, 0x0372, 0x0000, 0x0000, 0x0374, 0x0279, 0x0000, 0x027A, 0x0000, 0x0178, 0x0278, 0x0000, 0x0137, @@ -55,7 +55,7 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p 0x01AF, 0x01B2, 0x01B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0150, 0x0032, 0x0033, 0x0034, 0x01C8 }; - static USHORT __READONLY_DATA aMonotypeSortsToStarBatsTable[ 256 - 32 ]= + static sal_uInt16 __READONLY_DATA aMonotypeSortsToStarBatsTable[ 256 - 32 ]= { 0x0020, 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x0074, 0x00ba, 0x0021, 0x00cc, 0x007b, 0x0036, 0x007d, 0x007e, 0x0037, 0x0038, 0x0038, 0x0039, 0x0038, 0x0038, 0x0039, 0x003a, 0x004f, 0x0050, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0086, 0x0086, 0x0086, @@ -73,9 +73,9 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p 0x0000, 0x00af, 0x0035, 0x00dc, 0x00da, 0x00dc, 0x00db, 0x00da, 0x00dc, 0x00db, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00af, 0x0000 }; - const USHORT* pTransTable = NULL; + const sal_uInt16* pTransTable = NULL; - BOOL bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : FALSE; + sal_Bool bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : sal_False; if ( !bIsAvailable ) { if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Wingdings" ) ) == COMPARE_EQUAL ) @@ -86,18 +86,18 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p if ( pTransTable ) { sal_Unicode c; - for ( UINT16 i = rString.Len(); i--; ) + for ( sal_uInt16 i = rString.Len(); i--; ) { c = rString.GetChar( i ); c -= 32; - c = ( ((UINT16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ]; + c = ( ((sal_uInt16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ]; if ( !c ) // if character is out of range or not matching c = 0xA5; // we will default a StarBats-Bullet rString.SetChar( i, c ); } rFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); rFont.SetName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarBats" ) ) ); - return TRUE; + return sal_True; } - else return FALSE; + else return sal_False; }; diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 6ea9f05d78a1..8e26c58d57ae 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -256,22 +256,22 @@ class BasicSimpleCharClass static LetterTable aLetterTable; public: - static BOOL isAlpha( sal_Unicode c, bool bCompatible ) + static sal_Bool isAlpha( sal_Unicode c, bool bCompatible ) { - BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') + sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (bCompatible && aLetterTable.isLetter( c )); return bRet; } - static BOOL isDigit( sal_Unicode c ) + static sal_Bool isDigit( sal_Unicode c ) { - BOOL bRet = (c >= '0' && c <= '9'); + sal_Bool bRet = (c >= '0' && c <= '9'); return bRet; } - static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible ) + static sal_Bool isAlphaNumeric( sal_Unicode c, bool bCompatible ) { - BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible ); + sal_Bool bRet = isDigit( c ) || isAlpha( c, bCompatible ); return bRet; } }; @@ -283,68 +283,68 @@ LetterTable::LetterTable( void ) for( int i = 0 ; i < 256 ; ++i ) IsLetterTab[i] = false; - IsLetterTab[0xC0] = true; // À , CAPITAL LETTER A WITH GRAVE ACCENT - IsLetterTab[0xC1] = true; // Á , CAPITAL LETTER A WITH ACUTE ACCENT - IsLetterTab[0xC2] = true; //  , CAPITAL LETTER A WITH CIRCUMFLEX ACCENT - IsLetterTab[0xC3] = true; // à , CAPITAL LETTER A WITH TILDE - IsLetterTab[0xC4] = true; // Ä , CAPITAL LETTER A WITH DIAERESIS - IsLetterTab[0xC5] = true; // Å , CAPITAL LETTER A WITH RING ABOVE - IsLetterTab[0xC6] = true; // Æ , CAPITAL LIGATURE AE - IsLetterTab[0xC7] = true; // Ç , CAPITAL LETTER C WITH CEDILLA - IsLetterTab[0xC8] = true; // È , CAPITAL LETTER E WITH GRAVE ACCENT - IsLetterTab[0xC9] = true; // É , CAPITAL LETTER E WITH ACUTE ACCENT - IsLetterTab[0xCA] = true; // Ê , CAPITAL LETTER E WITH CIRCUMFLEX ACCENT - IsLetterTab[0xCB] = true; // Ë , CAPITAL LETTER E WITH DIAERESIS - IsLetterTab[0xCC] = true; // Ì , CAPITAL LETTER I WITH GRAVE ACCENT - IsLetterTab[0xCD] = true; // Í , CAPITAL LETTER I WITH ACUTE ACCENT - IsLetterTab[0xCE] = true; // Î , CAPITAL LETTER I WITH CIRCUMFLEX ACCENT - IsLetterTab[0xCF] = true; // Ï , CAPITAL LETTER I WITH DIAERESIS - IsLetterTab[0xD0] = true; // Ð , CAPITAL LETTER ETH - IsLetterTab[0xD1] = true; // Ñ , CAPITAL LETTER N WITH TILDE - IsLetterTab[0xD2] = true; // Ò , CAPITAL LETTER O WITH GRAVE ACCENT - IsLetterTab[0xD3] = true; // Ó , CAPITAL LETTER O WITH ACUTE ACCENT - IsLetterTab[0xD4] = true; // Ô , CAPITAL LETTER O WITH CIRCUMFLEX ACCENT - IsLetterTab[0xD5] = true; // Õ , CAPITAL LETTER O WITH TILDE - IsLetterTab[0xD6] = true; // Ö , CAPITAL LETTER O WITH DIAERESIS - IsLetterTab[0xD8] = true; // Ø , CAPITAL LETTER O WITH STROKE - IsLetterTab[0xD9] = true; // Ù , CAPITAL LETTER U WITH GRAVE ACCENT - IsLetterTab[0xDA] = true; // Ú , CAPITAL LETTER U WITH ACUTE ACCENT - IsLetterTab[0xDB] = true; // Û , CAPITAL LETTER U WITH CIRCUMFLEX ACCENT - IsLetterTab[0xDC] = true; // Ü , CAPITAL LETTER U WITH DIAERESIS - IsLetterTab[0xDD] = true; // Ý , CAPITAL LETTER Y WITH ACUTE ACCENT - IsLetterTab[0xDE] = true; // Þ , CAPITAL LETTER THORN - IsLetterTab[0xDF] = true; // ß , SMALL LETTER SHARP S - IsLetterTab[0xE0] = true; // à , SMALL LETTER A WITH GRAVE ACCENT - IsLetterTab[0xE1] = true; // á , SMALL LETTER A WITH ACUTE ACCENT - IsLetterTab[0xE2] = true; // â , SMALL LETTER A WITH CIRCUMFLEX ACCENT - IsLetterTab[0xE3] = true; // ã , SMALL LETTER A WITH TILDE - IsLetterTab[0xE4] = true; // ä , SMALL LETTER A WITH DIAERESIS - IsLetterTab[0xE5] = true; // å , SMALL LETTER A WITH RING ABOVE - IsLetterTab[0xE6] = true; // æ , SMALL LIGATURE AE - IsLetterTab[0xE7] = true; // ç , SMALL LETTER C WITH CEDILLA - IsLetterTab[0xE8] = true; // è , SMALL LETTER E WITH GRAVE ACCENT - IsLetterTab[0xE9] = true; // é , SMALL LETTER E WITH ACUTE ACCENT - IsLetterTab[0xEA] = true; // ê , SMALL LETTER E WITH CIRCUMFLEX ACCENT - IsLetterTab[0xEB] = true; // ë , SMALL LETTER E WITH DIAERESIS - IsLetterTab[0xEC] = true; // ì , SMALL LETTER I WITH GRAVE ACCENT - IsLetterTab[0xED] = true; // í , SMALL LETTER I WITH ACUTE ACCENT - IsLetterTab[0xEE] = true; // î , SMALL LETTER I WITH CIRCUMFLEX ACCENT - IsLetterTab[0xEF] = true; // ï , SMALL LETTER I WITH DIAERESIS - IsLetterTab[0xF0] = true; // ð , SMALL LETTER ETH - IsLetterTab[0xF1] = true; // ñ , SMALL LETTER N WITH TILDE - IsLetterTab[0xF2] = true; // ò , SMALL LETTER O WITH GRAVE ACCENT - IsLetterTab[0xF3] = true; // ó , SMALL LETTER O WITH ACUTE ACCENT - IsLetterTab[0xF4] = true; // ô , SMALL LETTER O WITH CIRCUMFLEX ACCENT - IsLetterTab[0xF5] = true; // õ , SMALL LETTER O WITH TILDE - IsLetterTab[0xF6] = true; // ö , SMALL LETTER O WITH DIAERESIS - IsLetterTab[0xF8] = true; // ø , SMALL LETTER O WITH OBLIQUE BAR - IsLetterTab[0xF9] = true; // ù , SMALL LETTER U WITH GRAVE ACCENT - IsLetterTab[0xFA] = true; // ú , SMALL LETTER U WITH ACUTE ACCENT - IsLetterTab[0xFB] = true; // û , SMALL LETTER U WITH CIRCUMFLEX ACCENT - IsLetterTab[0xFC] = true; // ü , SMALL LETTER U WITH DIAERESIS - IsLetterTab[0xFD] = true; // ý , SMALL LETTER Y WITH ACUTE ACCENT - IsLetterTab[0xFE] = true; // þ , SMALL LETTER THORN - IsLetterTab[0xFF] = true; // ÿ , SMALL LETTER Y WITH DIAERESIS + IsLetterTab[0xC0] = true; // ?, CAPITAL LETTER A WITH GRAVE ACCENT + IsLetterTab[0xC1] = true; // ?, CAPITAL LETTER A WITH ACUTE ACCENT + IsLetterTab[0xC2] = true; // ?, CAPITAL LETTER A WITH CIRCUMFLEX ACCENT + IsLetterTab[0xC3] = true; // ?, CAPITAL LETTER A WITH TILDE + IsLetterTab[0xC4] = true; // ?, CAPITAL LETTER A WITH DIAERESIS + IsLetterTab[0xC5] = true; // ?, CAPITAL LETTER A WITH RING ABOVE + IsLetterTab[0xC6] = true; // ?, CAPITAL LIGATURE AE + IsLetterTab[0xC7] = true; // ?, CAPITAL LETTER C WITH CEDILLA + IsLetterTab[0xC8] = true; // ?, CAPITAL LETTER E WITH GRAVE ACCENT + IsLetterTab[0xC9] = true; // ?, CAPITAL LETTER E WITH ACUTE ACCENT + IsLetterTab[0xCA] = true; // ?, CAPITAL LETTER E WITH CIRCUMFLEX ACCENT + IsLetterTab[0xCB] = true; // ?, CAPITAL LETTER E WITH DIAERESIS + IsLetterTab[0xCC] = true; // ?, CAPITAL LETTER I WITH GRAVE ACCENT + IsLetterTab[0xCD] = true; // ?, CAPITAL LETTER I WITH ACUTE ACCENT + IsLetterTab[0xCE] = true; // ?, CAPITAL LETTER I WITH CIRCUMFLEX ACCENT + IsLetterTab[0xCF] = true; // ?, CAPITAL LETTER I WITH DIAERESIS + IsLetterTab[0xD0] = true; // ?, CAPITAL LETTER ETH + IsLetterTab[0xD1] = true; // ?, CAPITAL LETTER N WITH TILDE + IsLetterTab[0xD2] = true; // ?, CAPITAL LETTER O WITH GRAVE ACCENT + IsLetterTab[0xD3] = true; // ?, CAPITAL LETTER O WITH ACUTE ACCENT + IsLetterTab[0xD4] = true; // ?, CAPITAL LETTER O WITH CIRCUMFLEX ACCENT + IsLetterTab[0xD5] = true; // ?, CAPITAL LETTER O WITH TILDE + IsLetterTab[0xD6] = true; // ?, CAPITAL LETTER O WITH DIAERESIS + IsLetterTab[0xD8] = true; // ?, CAPITAL LETTER O WITH STROKE + IsLetterTab[0xD9] = true; // ?, CAPITAL LETTER U WITH GRAVE ACCENT + IsLetterTab[0xDA] = true; // ?, CAPITAL LETTER U WITH ACUTE ACCENT + IsLetterTab[0xDB] = true; // ?, CAPITAL LETTER U WITH CIRCUMFLEX ACCENT + IsLetterTab[0xDC] = true; // ?, CAPITAL LETTER U WITH DIAERESIS + IsLetterTab[0xDD] = true; // ?, CAPITAL LETTER Y WITH ACUTE ACCENT + IsLetterTab[0xDE] = true; // ?, CAPITAL LETTER THORN + IsLetterTab[0xDF] = true; // ?, SMALL LETTER SHARP S + IsLetterTab[0xE0] = true; // ?, SMALL LETTER A WITH GRAVE ACCENT + IsLetterTab[0xE1] = true; // ?, SMALL LETTER A WITH ACUTE ACCENT + IsLetterTab[0xE2] = true; // ?, SMALL LETTER A WITH CIRCUMFLEX ACCENT + IsLetterTab[0xE3] = true; // ?, SMALL LETTER A WITH TILDE + IsLetterTab[0xE4] = true; // ?, SMALL LETTER A WITH DIAERESIS + IsLetterTab[0xE5] = true; // ?, SMALL LETTER A WITH RING ABOVE + IsLetterTab[0xE6] = true; // ?, SMALL LIGATURE AE + IsLetterTab[0xE7] = true; // ?, SMALL LETTER C WITH CEDILLA + IsLetterTab[0xE8] = true; // ?, SMALL LETTER E WITH GRAVE ACCENT + IsLetterTab[0xE9] = true; // ?, SMALL LETTER E WITH ACUTE ACCENT + IsLetterTab[0xEA] = true; // ?, SMALL LETTER E WITH CIRCUMFLEX ACCENT + IsLetterTab[0xEB] = true; // ?, SMALL LETTER E WITH DIAERESIS + IsLetterTab[0xEC] = true; // ?, SMALL LETTER I WITH GRAVE ACCENT + IsLetterTab[0xED] = true; // ?, SMALL LETTER I WITH ACUTE ACCENT + IsLetterTab[0xEE] = true; // ?, SMALL LETTER I WITH CIRCUMFLEX ACCENT + IsLetterTab[0xEF] = true; // ?, SMALL LETTER I WITH DIAERESIS + IsLetterTab[0xF0] = true; // ?, SMALL LETTER ETH + IsLetterTab[0xF1] = true; // ?, SMALL LETTER N WITH TILDE + IsLetterTab[0xF2] = true; // ?, SMALL LETTER O WITH GRAVE ACCENT + IsLetterTab[0xF3] = true; // ?, SMALL LETTER O WITH ACUTE ACCENT + IsLetterTab[0xF4] = true; // ?, SMALL LETTER O WITH CIRCUMFLEX ACCENT + IsLetterTab[0xF5] = true; // ?, SMALL LETTER O WITH TILDE + IsLetterTab[0xF6] = true; // ?, SMALL LETTER O WITH DIAERESIS + IsLetterTab[0xF8] = true; // ?, SMALL LETTER O WITH OBLIQUE BAR + IsLetterTab[0xF9] = true; // ?, SMALL LETTER U WITH GRAVE ACCENT + IsLetterTab[0xFA] = true; // ?, SMALL LETTER U WITH ACUTE ACCENT + IsLetterTab[0xFB] = true; // ?, SMALL LETTER U WITH CIRCUMFLEX ACCENT + IsLetterTab[0xFC] = true; // ?, SMALL LETTER U WITH DIAERESIS + IsLetterTab[0xFD] = true; // ?, SMALL LETTER Y WITH ACUTE ACCENT + IsLetterTab[0xFE] = true; // ?, SMALL LETTER THORN + IsLetterTab[0xFF] = true; // � , SMALL LETTER Y WITH DIAERESIS } bool LetterTable::isLetterUnicode( sal_Unicode c ) @@ -358,7 +358,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c ) } // Hilfsfunktion: Zeichen-Flag Testen -BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags ) +sal_Bool SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags ) { bool bRet = false; if( c != 0 && c <= 255 ) @@ -373,14 +373,14 @@ BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags ) return bRet; } -void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, UINT16 nCount ) +void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, sal_uInt16 nCount ) { ppListKeyWords = ppKeyWords; nKeyWordCount = nCount; } // Neues Token holen -BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, +sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, /*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos ) { reType = TT_UNKNOWN; @@ -391,25 +391,25 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Zeichen untersuchen sal_Unicode c = peekChar(); if( c == CHAR_EOF ) - return FALSE; + return sal_False; // Zeichen lesen getChar(); //*** Alle Moeglichkeiten durchgehen *** // Space? - if ( (testCharFlags( c, CHAR_SPACE ) == TRUE) ) + if ( (testCharFlags( c, CHAR_SPACE ) == sal_True) ) { - while( testCharFlags( peekChar(), CHAR_SPACE ) == TRUE ) + while( testCharFlags( peekChar(), CHAR_SPACE ) == sal_True ) getChar(); reType = TT_WHITESPACE; } // Identifier? - else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == TRUE) ) + else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == sal_True) ) { - BOOL bIdentifierChar; + sal_Bool bIdentifierChar; do { // Naechstes Zeichen holen @@ -452,7 +452,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen sal_Unicode cPeek = peekChar(); - while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) { c = getChar(); cPeek = peekChar(); @@ -467,14 +467,14 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Operator? // only for BASIC '\'' should be a comment, otherwise it is a normal string and handled there - else if ( ( testCharFlags( c, CHAR_OPERATOR ) == TRUE ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) ) + else if ( ( testCharFlags( c, CHAR_OPERATOR ) == sal_True ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) ) { // paramters for SQL view if ( (c==':') || (c=='?')) { if (c!='?') { - BOOL bIdentifierChar; + sal_Bool bIdentifierChar; do { // Naechstes Zeichen holen @@ -493,7 +493,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if (cPeekNext=='-') { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen - while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE ) + while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False ) { getChar(); cPeekNext = peekChar(); @@ -507,7 +507,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if (cPeekNext=='/') { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen - while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE ) + while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False ) { getChar(); cPeekNext = peekChar(); @@ -524,7 +524,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Alle Zeichen bis Zeilen-Ende oder EOF entfernen sal_Unicode cPeek = c; - while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) { getChar(); cPeek = peekChar(); @@ -551,7 +551,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, } // Zahl? - else if( testCharFlags( c, CHAR_START_NUMBER ) == TRUE ) + else if( testCharFlags( c, CHAR_START_NUMBER ) == sal_True ) { reType = TT_NUMBER; @@ -593,7 +593,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if( reType == TT_NUMBER && nRadix == 10 ) { // Flag, ob das letzte Zeichen ein Exponent war - BOOL bAfterExpChar = FALSE; + sal_Bool bAfterExpChar = sal_False; // Alle Ziffern einlesen while( testCharFlags( peekChar(), CHAR_IN_NUMBER ) || @@ -610,7 +610,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, } // String? - else if( testCharFlags( c, CHAR_START_STRING ) == TRUE ) + else if( testCharFlags( c, CHAR_START_STRING ) == sal_True ) { // Merken, welches Zeichen den String eroeffnet hat sal_Unicode cEndString = c; @@ -628,7 +628,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, break; } c = getChar(); - if( testCharFlags( c, CHAR_EOL ) == TRUE ) + if( testCharFlags( c, CHAR_EOL ) == sal_True ) { // ERROR: unterminated string literal reType = TT_ERROR; @@ -648,11 +648,11 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, } // Zeilenende? - else if( testCharFlags( c, CHAR_EOL ) == TRUE ) + else if( testCharFlags( c, CHAR_EOL ) == sal_True ) { // Falls ein weiteres anderes EOL-Char folgt, weg damit sal_Unicode cNext = peekChar(); - if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE ) + if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == sal_True ) getChar(); // Positions-Daten auf Zeilen-Beginn setzen @@ -667,13 +667,13 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // End-Position eintragen rpEndPos = mpActualPos; - return TRUE; + return sal_True; } String SimpleTokenizer_Impl::getTokStr ( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ) { - return String( pStartPos, (USHORT)( pEndPos - pStartPos ) ); + return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); } #ifdef DBG_UTIL @@ -698,7 +698,7 @@ String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType, } if( eType != TT_EOL ) { - aOut += String( pStartPos, (USHORT)( pEndPos - pStartPos ) ); + aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); } aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") ); return aOut; @@ -710,10 +710,10 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) ); // Zeichen-Tabelle fuellen - USHORT i; + sal_uInt16 i; // Zulaessige Zeichen fuer Identifier - USHORT nHelpMask = (USHORT)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER ); + sal_uInt16 nHelpMask = (sal_uInt16)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER ); for( i = 'a' ; i <= 'z' ; i++ ) aCharTypeTab[i] |= nHelpMask; for( i = 'A' ; i <= 'Z' ; i++ ) @@ -724,7 +724,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua aCharTypeTab[(int)'$'] |= nHelpMask; // Ziffern (Identifier und Number ist moeglich) - nHelpMask = (USHORT)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER | + nHelpMask = (sal_uInt16)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER | CHAR_IN_NUMBER | CHAR_IN_HEX_NUMBER ); for( i = '0' ; i <= '9' ; i++ ) aCharTypeTab[i] |= nHelpMask; @@ -732,7 +732,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua // e und E sowie . von Hand ergaenzen aCharTypeTab[(int)'e'] |= CHAR_IN_NUMBER; aCharTypeTab[(int)'E'] |= CHAR_IN_NUMBER; - aCharTypeTab[(int)'.'] |= (USHORT)( CHAR_IN_NUMBER | CHAR_START_NUMBER ); + aCharTypeTab[(int)'.'] |= (sal_uInt16)( CHAR_IN_NUMBER | CHAR_START_NUMBER ); aCharTypeTab[(int)'&'] |= CHAR_START_NUMBER; // Hex-Ziffern @@ -800,7 +800,7 @@ SimpleTokenizer_Impl* getSimpleTokenizer( void ) } // Heraussuchen der jeweils naechsten Funktion aus einem JavaScript-Modul -UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource ) +sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const String* aSource ) { // Position auf den Anfang des Source-Strings setzen mpStringBegin = mpActualPos = aSource->GetBuffer(); @@ -815,14 +815,14 @@ UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource const sal_Unicode* pEndPos; // Schleife ueber alle Tokens - UINT16 nTokenCount = 0; + sal_uInt16 nTokenCount = 0; while( getNextToken( eType, pStartPos, pEndPos ) ) nTokenCount++; return nTokenCount; } -void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String& rLine, +void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const String& rLine, /*out*/HighlightPortions& portions ) { // Position auf den Anfang des Source-Strings setzen @@ -842,8 +842,8 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String { HighlightPortion portion; - portion.nBegin = (UINT16)(pStartPos - mpStringBegin); - portion.nEnd = (UINT16)(pEndPos - mpStringBegin); + portion.nBegin = (sal_uInt16)(pStartPos - mpStringBegin); + portion.nEnd = (sal_uInt16)(pEndPos - mpStringBegin); portion.tokenType = eType; portions.push_back(portion); @@ -888,18 +888,18 @@ void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ ) } } -const Range SyntaxHighlighter::notifyChange( UINT32 nLine, INT32 nLineCountDifference, - const String* pChangedLines, UINT32 nArrayLength) +const Range SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference, + const String* pChangedLines, sal_uInt32 nArrayLength) { (void)nLineCountDifference; - for( UINT32 i=0 ; i < nArrayLength ; i++ ) + for( sal_uInt32 i=0 ; i < nArrayLength ; i++ ) m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]); return Range( nLine, nLine + nArrayLength-1 ); } -void SyntaxHighlighter::getHighlightPortions( UINT32 nLine, const String& rLine, +void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const String& rLine, /*out*/HighlightPortions& portions ) { m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions ); diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx index 222e8abee5a4..17b4454a109f 100644 --- a/svtools/source/edit/textdat2.hxx +++ b/svtools/source/edit/textdat2.hxx @@ -56,35 +56,35 @@ class TextView; class TETextPortion { private: - USHORT nLen; + sal_uInt16 nLen; long nWidth; - BYTE nKind; - BYTE nRightToLeft; + sal_uInt8 nKind; + sal_uInt8 nRightToLeft; TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;} public: - TETextPortion( USHORT nL ) { + TETextPortion( sal_uInt16 nL ) { nLen = nL; nKind = PORTIONKIND_TEXT; nWidth= -1; nRightToLeft = 0; } - USHORT GetLen() const { return nLen; } - USHORT& GetLen() { return nLen; } + sal_uInt16 GetLen() const { return nLen; } + sal_uInt16& GetLen() { return nLen; } long GetWidth()const { return nWidth; } long& GetWidth() { return nWidth; } - BYTE GetKind() const { return nKind; } - BYTE& GetKind() { return nKind; } + sal_uInt8 GetKind() const { return nKind; } + sal_uInt8& GetKind() { return nKind; } - BYTE GetRightToLeft() const { return nRightToLeft; } - BYTE& GetRightToLeft() { return nRightToLeft; } - BOOL IsRightToLeft() const { return (nRightToLeft&1); } + sal_uInt8 GetRightToLeft() const { return nRightToLeft; } + sal_uInt8& GetRightToLeft() { return nRightToLeft; } + sal_Bool IsRightToLeft() const { return (nRightToLeft&1); } - BOOL HasValidSize() const { return nWidth != (-1); } + sal_Bool HasValidSize() const { return nWidth != (-1); } }; @@ -99,17 +99,17 @@ public: ~TETextPortionList(); void Reset(); - USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); - USHORT GetPortionStartIndex( USHORT nPortion ); - void DeleteFromPortion( USHORT nDelFrom ); + sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False ); + sal_uInt16 GetPortionStartIndex( sal_uInt16 nPortion ); + void DeleteFromPortion( sal_uInt16 nDelFrom ); }; struct TEWritingDirectionInfo { - BYTE nType; - USHORT nStartPos; - USHORT nEndPos; - TEWritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End ) + sal_uInt8 nType; + sal_uInt16 nStartPos; + sal_uInt16 nEndPos; + TEWritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End ) { nType = _Type; nStartPos = _Start; @@ -122,65 +122,65 @@ SV_DECL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo, 0, 4 ) class TextLine { private: - USHORT mnStart; - USHORT mnEnd; - USHORT mnStartPortion; - USHORT mnEndPortion; + sal_uInt16 mnStart; + sal_uInt16 mnEnd; + sal_uInt16 mnStartPortion; + sal_uInt16 mnEndPortion; short mnStartX; - BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe + sal_Bool mbInvalid; // fuer geschickte Formatierung/Ausgabe public: TextLine() { mnStart = mnEnd = 0; mnStartPortion = mnEndPortion = 0; mnStartX = 0; - mbInvalid = TRUE; + mbInvalid = sal_True; } - BOOL IsIn( USHORT nIndex ) const + sal_Bool IsIn( sal_uInt16 nIndex ) const { return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); } - BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const + sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const { return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); } - void SetStart( USHORT n ) { mnStart = n; } - USHORT GetStart() const { return mnStart; } - USHORT& GetStart() { return mnStart; } + void SetStart( sal_uInt16 n ) { mnStart = n; } + sal_uInt16 GetStart() const { return mnStart; } + sal_uInt16& GetStart() { return mnStart; } - void SetEnd( USHORT n ) { mnEnd = n; } - USHORT GetEnd() const { return mnEnd; } - USHORT& GetEnd() { return mnEnd; } + void SetEnd( sal_uInt16 n ) { mnEnd = n; } + sal_uInt16 GetEnd() const { return mnEnd; } + sal_uInt16& GetEnd() { return mnEnd; } - void SetStartPortion( USHORT n ) { mnStartPortion = n; } - USHORT GetStartPortion() const { return mnStartPortion; } - USHORT& GetStartPortion() { return mnStartPortion; } + void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; } + sal_uInt16 GetStartPortion() const { return mnStartPortion; } + sal_uInt16& GetStartPortion() { return mnStartPortion; } - void SetEndPortion( USHORT n ) { mnEndPortion = n; } - USHORT GetEndPortion() const { return mnEndPortion; } - USHORT& GetEndPortion() { return mnEndPortion; } + void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; } + sal_uInt16 GetEndPortion() const { return mnEndPortion; } + sal_uInt16& GetEndPortion() { return mnEndPortion; } - USHORT GetLen() const { return mnEnd - mnStart; } + sal_uInt16 GetLen() const { return mnEnd - mnStart; } - BOOL IsInvalid() const { return mbInvalid; } - BOOL IsValid() const { return !mbInvalid; } - void SetInvalid() { mbInvalid = TRUE; } - void SetValid() { mbInvalid = FALSE; } + sal_Bool IsInvalid() const { return mbInvalid; } + sal_Bool IsValid() const { return !mbInvalid; } + void SetInvalid() { mbInvalid = sal_True; } + void SetValid() { mbInvalid = sal_False; } - BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; } + sal_Bool IsEmpty() const { return (mnEnd > mnStart) ? sal_False : sal_True; } short GetStartX() const { return mnStartX; } void SetStartX( short n ) { mnStartX = n; } - inline BOOL operator == ( const TextLine& rLine ) const; - inline BOOL operator != ( const TextLine& rLine ) const; + inline sal_Bool operator == ( const TextLine& rLine ) const; + inline sal_Bool operator != ( const TextLine& rLine ) const; }; typedef TextLine* TextLinePtr; SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1, 4 ) -inline BOOL TextLine::operator == ( const TextLine& rLine ) const +inline sal_Bool TextLine::operator == ( const TextLine& rLine ) const { return ( ( mnStart == rLine.mnStart ) && ( mnEnd == rLine.mnEnd ) && @@ -188,7 +188,7 @@ inline BOOL TextLine::operator == ( const TextLine& rLine ) const ( mnEndPortion == rLine.mnEndPortion ) ); } -inline BOOL TextLine::operator != ( const TextLine& rLine ) const +inline sal_Bool TextLine::operator != ( const TextLine& rLine ) const { return !( *this == rLine ); } @@ -205,11 +205,11 @@ private: TEWritingDirectionInfos maWritingDirectionInfos; - USHORT mnInvalidPosStart; + sal_uInt16 mnInvalidPosStart; short mnInvalidDiff; - BOOL mbInvalid; - BOOL mbSimple; // nur lineares Tippen + sal_Bool mbInvalid; + sal_Bool mbSimple; // nur lineares Tippen TEParaPortion( const TEParaPortion& ) {;} @@ -219,15 +219,15 @@ public: ~TEParaPortion(); - BOOL IsInvalid() const { return mbInvalid; } - BOOL IsSimpleInvalid() const { return mbSimple; } - void SetNotSimpleInvalid() { mbSimple = FALSE; } - void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;} + sal_Bool IsInvalid() const { return mbInvalid; } + sal_Bool IsSimpleInvalid() const { return mbSimple; } + void SetNotSimpleInvalid() { mbSimple = sal_False; } + void SetValid() { mbInvalid = sal_False; mbSimple = sal_True;} - void MarkInvalid( USHORT nStart, short nDiff); - void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); + void MarkInvalid( sal_uInt16 nStart, short nDiff); + void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd ); - USHORT GetInvalidPosStart() const { return mnInvalidPosStart; } + sal_uInt16 GetInvalidPosStart() const { return mnInvalidPosStart; } short GetInvalidDiff() const { return mnInvalidDiff; } TextNode* GetNode() const { return mpNode; } @@ -236,8 +236,8 @@ public: TEWritingDirectionInfos& GetWritingDirectionInfos() { return maWritingDirectionInfos; } - USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd ); - void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); + sal_uInt16 GetLineNumber( sal_uInt16 nIndex, sal_Bool bInclEnd ); + void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ); }; @@ -262,9 +262,9 @@ public: virtual void CreateAnchor(); - virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE ); + virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False ); - virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); + virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); virtual void DeselectAll(); virtual void DeselectAtPoint( const Point& ); @@ -276,13 +276,13 @@ class IdleFormatter : public Timer { private: TextView* mpView; - USHORT mnRestarts; + sal_uInt16 mnRestarts; public: IdleFormatter(); ~IdleFormatter(); - void DoIdleFormat( TextView* pV, USHORT nMaxRestarts ); + void DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts ); void ForceTimeout(); TextView* GetView() { return mpView; } }; @@ -292,14 +292,14 @@ struct TextDDInfo Cursor maCursor; TextPaM maDropPos; - BOOL mbStarterOfDD; - BOOL mbVisCursor; + sal_Bool mbStarterOfDD; + sal_Bool mbVisCursor; TextDDInfo() { maCursor.SetStyle( CURSOR_SHADOW ); - mbStarterOfDD = FALSE; - mbVisCursor = FALSE; + mbStarterOfDD = sal_False; + mbVisCursor = sal_False; } }; diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx index cb33ea7d50e6..1cefb30700df 100644 --- a/svtools/source/edit/textdata.cxx +++ b/svtools/source/edit/textdata.cxx @@ -80,24 +80,24 @@ TETextPortionList::~TETextPortionList() void TETextPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } -void TETextPortionList::DeleteFromPortion( USHORT nDelFrom ) +void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom ) { DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" ); - for ( USHORT nP = nDelFrom; nP < Count(); nP++ ) + for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ ) delete GetObject( nP ); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion ) +sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion ) { // Bei nCharPos an Portion-Grenze wird die linke Portion gefunden - USHORT nTmpPos = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + sal_uInt16 nTmpPos = 0; + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { TETextPortion* pPortion = GetObject( nPortion ); nTmpPos = nTmpPos + pPortion->GetLen(); @@ -116,10 +116,10 @@ USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, B } /* -USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion ) +sal_uInt16 TETextPortionList::GetPortionStartIndex( sal_uInt16 nPortion ) { - USHORT nPos = 0; - for ( USHORT nP = 0; nP < nPortion; nP++ ) + sal_uInt16 nPos = 0; + for ( sal_uInt16 nP = 0; nP < nPortion; nP++ ) { TETextPortion* pPortion = GetObject( nP ); nPos += pPortion->GetLen(); @@ -136,17 +136,17 @@ TEParaPortion::TEParaPortion( TextNode* pN ) { mpNode = pN; mnInvalidPosStart = mnInvalidDiff = 0; - mbInvalid = TRUE; - mbSimple = FALSE; + mbInvalid = sal_True; + mbSimple = sal_False; } TEParaPortion::~TEParaPortion() { } -void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff ) +void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) { - if ( mbInvalid == FALSE ) + if ( mbInvalid == sal_False ) { mnInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); mnInvalidDiff = nDiff; @@ -168,20 +168,20 @@ void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff ) else { DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - mnInvalidPosStart = Min( mnInvalidPosStart, (USHORT) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); + mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); mnInvalidDiff = 0; - mbSimple = FALSE; + mbSimple = sal_False; } } maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() ); - mbInvalid = TRUE; + mbInvalid = sal_True; } -void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ ) +void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ ) { - if ( mbInvalid == FALSE ) + if ( mbInvalid == sal_False ) { mnInvalidPosStart = nStart; // nInvalidPosEnd = nEnd; @@ -195,13 +195,13 @@ void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ ) maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() ); mnInvalidDiff = 0; - mbInvalid = TRUE; - mbSimple = FALSE; + mbInvalid = sal_True; + mbSimple = sal_False; } -USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd ) +sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd ) { - for ( USHORT nLine = 0; nLine < maLines.Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < maLines.Count(); nLine++ ) { TextLine* pLine = maLines.GetObject( nLine ); if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) || @@ -218,9 +218,9 @@ USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd ) } -void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ) +void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ) { - USHORT nLines = maLines.Count(); + sal_uInt16 nLines = maLines.Count(); DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { @@ -238,7 +238,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 )); if ( nPDiff || nTDiff ) { - for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ ) + for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) { TextLine* pLine = maLines[ nL ]; @@ -288,7 +288,7 @@ IdleFormatter::~IdleFormatter() mpView = 0; } -void IdleFormatter::DoIdleFormat( TextView* pV, USHORT nMaxRestarts ) +void IdleFormatter::DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts ) { mpView = pV; @@ -318,12 +318,12 @@ void IdleFormatter::ForceTimeout() TYPEINIT1( TextHint, SfxSimpleHint ); -TextHint::TextHint( ULONG Id ) : SfxSimpleHint( Id ) +TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id ) { mnValue = 0; } -TextHint::TextHint( ULONG Id, ULONG nValue ) : SfxSimpleHint( Id ) +TextHint::TextHint( sal_uLong Id, sal_uLong nValue ) : SfxSimpleHint( Id ) { mnValue = nValue; } @@ -333,9 +333,9 @@ TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos { aPos = rPos; nLen = 0; - bCursor = TRUE; + bCursor = sal_True; pAttribs = NULL; - bWasCursorOverwrite = FALSE; + bWasCursorOverwrite = sal_False; } TEIMEInfos::~TEIMEInfos() @@ -343,12 +343,12 @@ TEIMEInfos::~TEIMEInfos() delete[] pAttribs; } -void TEIMEInfos::CopyAttribs( const USHORT* pA, USHORT nL ) +void TEIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL ) { nLen = nL; delete pAttribs; - pAttribs = new USHORT[ nL ]; - memcpy( pAttribs, pA, nL*sizeof(USHORT) ); + pAttribs = new sal_uInt16[ nL ]; + memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) ); } void TEIMEInfos::DestroyAttribs() diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index 1f7fa9745c8c..2dfb014117b1 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -65,7 +65,7 @@ CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- // (+) class TextCharAttrib // ------------------------------------------------------------------------- -TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd ) +TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) { mpAttr = rAttr.Clone(); mnStart = nStart, @@ -90,7 +90,7 @@ TextCharAttrib::~TextCharAttrib() TextCharAttribList::TextCharAttribList() { - mbHasEmptyAttribs = FALSE; + mbHasEmptyAttribs = sal_False; } TextCharAttribList::~TextCharAttribList() @@ -98,7 +98,7 @@ TextCharAttribList::~TextCharAttribList() // PTRARR_DEL } -void TextCharAttribList::Clear( BOOL bDestroyAttribs ) +void TextCharAttribList::Clear( sal_Bool bDestroyAttribs ) { if ( bDestroyAttribs ) TextCharAttribs::DeleteAndDestroy( 0, Count() ); @@ -110,18 +110,18 @@ void TextCharAttribList::Clear( BOOL bDestroyAttribs ) void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib ) { if ( pAttrib->IsEmpty() ) - mbHasEmptyAttribs = TRUE; + mbHasEmptyAttribs = sal_True; - const USHORT nCount = Count(); - const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. - BOOL bInserted = FALSE; - for ( USHORT x = 0; x < nCount; x++ ) + const sal_uInt16 nCount = Count(); + const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. + sal_Bool bInserted = sal_False; + for ( sal_uInt16 x = 0; x < nCount; x++ ) { TextCharAttrib* pCurAttrib = GetObject( x ); if ( pCurAttrib->GetStart() > nStart ) { Insert( pAttrib, x ); - bInserted = TRUE; + bInserted = sal_True; break; } } @@ -135,12 +135,12 @@ void TextCharAttribList::ResortAttribs() qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart ); } -TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) +TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { TextCharAttrib* pAttr = GetObject( --nAttr ); @@ -153,11 +153,11 @@ TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) return NULL; } -TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const +TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos ) const { DBG_ASSERT( nWhich, "FindNextAttrib: Which?" ); - const USHORT nAttribs = Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( ( pAttr->GetStart() >= nFromPos ) && @@ -168,41 +168,41 @@ TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromP return NULL; } -BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const +sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const { - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { const TextCharAttrib* pAttr = GetObject( --nAttr ); if ( pAttr->Which() == nWhich ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound ) +sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { TextCharAttrib* pAttr = GetObject( --nAttr ); if ( pAttr->GetEnd() < nBound ) - return FALSE; + return sal_False; if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) +TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { if ( !mbHasEmptyAttribs ) return 0; - const USHORT nAttribs = Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->GetStart() > nPos ) @@ -216,7 +216,7 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos void TextCharAttribList::DeleteEmptyAttribs() { - for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->IsEmpty() ) @@ -226,19 +226,19 @@ void TextCharAttribList::DeleteEmptyAttribs() nAttr--; } } - mbHasEmptyAttribs = FALSE; + mbHasEmptyAttribs = sal_False; } #ifdef DBG_UTIL -BOOL TextCharAttribList::DbgCheckAttribs() +sal_Bool TextCharAttribList::DbgCheckAttribs() { - BOOL bOK = TRUE; - for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ ) + sal_Bool bOK = sal_True; + for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->GetStart() > pAttr->GetEnd() ) { - bOK = FALSE; + bOK = sal_False; DBG_ERROR( "Attr verdreht" ); } } @@ -255,14 +255,14 @@ TextNode::TextNode( const String& rText ) : { } -void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) +void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) { if ( !nNew ) return; - BOOL bResort = FALSE; - USHORT nAttribs = maCharAttribs.Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_Bool bResort = sal_False; + sal_uInt16 nAttribs = maCharAttribs.Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); if ( pAttrib->GetEnd() >= nIndex ) @@ -293,7 +293,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) pAttrib->Expand( nNew ); } else - bResort = TRUE; + bResort = sal_True; } // 2: Attribut startet davor, geht hinter Index... else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -306,7 +306,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) if ( nIndex == 0 ) { pAttrib->Expand( nNew ); -// bResort = TRUE; // es gibt ja keine Features mehr... +// bResort = sal_True; // es gibt ja keine Features mehr... } else pAttrib->MoveForward( nNew ); @@ -326,18 +326,18 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) #endif } -void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) +void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) { if ( !nDeleted ) return; - BOOL bResort = FALSE; - USHORT nEndChanges = nIndex+nDeleted; + sal_Bool bResort = sal_False; + sal_uInt16 nEndChanges = nIndex+nDeleted; - for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); - BOOL bDelAttr = FALSE; + sal_Bool bDelAttr = sal_False; if ( pAttrib->GetEnd() >= nIndex ) { // Alles Attribute hinter der Einfuegeposition verschieben... @@ -353,7 +353,7 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) pAttrib->GetEnd() = nIndex; // leer else - bDelAttr = TRUE; + bDelAttr = sal_True; } // 2. Attribut beginnt davor, endet drinnen oder dahinter... else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -376,13 +376,13 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" ); if ( bDelAttr /* || pAttrib->IsEmpty() */ ) { - bResort = TRUE; + bResort = sal_True; maCharAttribs.RemoveAttrib( nAttr ); delete pAttrib; nAttr--; } else if ( pAttrib->IsEmpty() ) - maCharAttribs.HasEmptyAttribs() = TRUE; + maCharAttribs.HasEmptyAttribs() = sal_True; } if ( bResort ) @@ -393,25 +393,25 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) #endif } -void TextNode::InsertText( USHORT nPos, const String& rText ) +void TextNode::InsertText( sal_uInt16 nPos, const String& rText ) { maText.Insert( rText, nPos ); ExpandAttribs( nPos, rText.Len() ); } -void TextNode::InsertText( USHORT nPos, sal_Unicode c ) +void TextNode::InsertText( sal_uInt16 nPos, sal_Unicode c ) { maText.Insert( c, nPos ); ExpandAttribs( nPos, 1 ); } -void TextNode::RemoveText( USHORT nPos, USHORT nChars ) +void TextNode::RemoveText( sal_uInt16 nPos, sal_uInt16 nChars ) { maText.Erase( nPos, nChars ); CollapsAttribs( nPos, nChars ); } -TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) +TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs ) { String aNewText; if ( nPos < maText.Len() ) @@ -421,7 +421,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) } TextNode* pNew = new TextNode( aNewText ); - for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); if ( pAttrib->GetEnd() < nPos ) @@ -469,7 +469,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) void TextNode::Append( const TextNode& rNode ) { - USHORT nOldLen = maText.Len(); + sal_uInt16 nOldLen = maText.Len(); maText += rNode.GetText(); @@ -477,16 +477,16 @@ void TextNode::Append( const TextNode& rNode ) DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" ); #endif - const USHORT nAttribs = rNode.GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr ); - BOOL bMelted = FALSE; + sal_Bool bMelted = sal_False; if ( pAttrib->GetStart() == 0 ) { // Evtl koennen Attribute zusammengefasst werden: - USHORT nTmpAttribs = maCharAttribs.Count(); - for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) + sal_uInt16 nTmpAttribs = maCharAttribs.Count(); + for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) { TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr ); @@ -497,7 +497,7 @@ void TextNode::Append( const TextNode& rNode ) { pTmpAttrib->GetEnd() = pTmpAttrib->GetEnd() + pAttrib->GetLen(); - bMelted = TRUE; + bMelted = sal_True; break; // es kann nur eins von der Sorte an der Stelle geben } } @@ -539,15 +539,15 @@ void TextDoc::Clear() void TextDoc::DestroyTextNodes() { - for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ ) + for ( sal_uLong nNode = 0; nNode < maTextNodes.Count(); nNode++ ) delete maTextNodes.GetObject( nNode ); maTextNodes.clear(); } String TextDoc::GetText( const sal_Unicode* pSep ) const { - ULONG nLen = GetTextLen( pSep ); - ULONG nNodes = maTextNodes.Count(); + sal_uLong nLen = GetTextLen( pSep ); + sal_uLong nNodes = maTextNodes.Count(); if ( nLen > STRING_MAXLEN ) { @@ -556,8 +556,8 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const } String aASCIIText; - ULONG nLastNode = nNodes-1; - for ( ULONG nNode = 0; nNode < nNodes; nNode++ ) + sal_uLong nLastNode = nNodes-1; + for ( sal_uLong nNode = 0; nNode < nNodes; nNode++ ) { TextNode* pNode = maTextNodes.GetObject( nNode ); String aTmp( pNode->GetText() ); @@ -569,7 +569,7 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const return aASCIIText; } -XubString TextDoc::GetText( ULONG nPara ) const +XubString TextDoc::GetText( sal_uLong nPara ) const { XubString aText; TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0; @@ -580,26 +580,26 @@ XubString TextDoc::GetText( ULONG nPara ) const } -ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const +sal_uLong TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const { - ULONG nLen = 0; - ULONG nNodes = maTextNodes.Count(); + sal_uLong nLen = 0; + sal_uLong nNodes = maTextNodes.Count(); if ( nNodes ) { - ULONG nStartNode = 0; - ULONG nEndNode = nNodes-1; + sal_uLong nStartNode = 0; + sal_uLong nEndNode = nNodes-1; if ( pSel ) { nStartNode = pSel->GetStart().GetPara(); nEndNode = pSel->GetEnd().GetPara(); } - for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uLong nNode = nStartNode; nNode <= nEndNode; nNode++ ) { TextNode* pNode = maTextNodes.GetObject( nNode ); - USHORT nS = 0; - ULONG nE = pNode->GetText().Len(); + sal_uInt16 nS = 0; + sal_uLong nE = pNode->GetText().Len(); if ( pSel && ( nNode == pSel->GetStart().GetPara() ) ) nS = pSel->GetStart().GetIndex(); if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) ) @@ -639,7 +639,7 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr ) return aPaM; } -TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) +TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ) { TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() ); TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs ); @@ -652,20 +652,20 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight ) { - USHORT nPrevLen = pLeft->GetText().Len(); + sal_uInt16 nPrevLen = pLeft->GetText().Len(); pLeft->Append( *pRight ); // der rechte verschwindet. - ULONG nRight = maTextNodes.GetPos( pRight ); + sal_uLong nRight = maTextNodes.GetPos( pRight ); maTextNodes.Remove( nRight ); delete pRight; - ULONG nLeft = maTextNodes.GetPos( pLeft ); + sal_uLong nLeft = maTextNodes.GetPos( pLeft ); TextPaM aPaM( nLeft, nPrevLen ); return aPaM; } -TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars ) +TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars ) { TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() ); pNode->RemoveText( rPaM.GetIndex(), nChars ); @@ -673,25 +673,25 @@ TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars ) return rPaM; } -BOOL TextDoc::IsValidPaM( const TextPaM& rPaM ) +sal_Bool TextDoc::IsValidPaM( const TextPaM& rPaM ) { if ( rPaM.GetPara() >= maTextNodes.Count() ) { DBG_ERROR( "PaM: Para out of range" ); - return FALSE; + return sal_False; } TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() ); if ( rPaM.GetIndex() > pNode->GetText().Len() ) { DBG_ERROR( "PaM: Index out of range" ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } /* -void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void TextDoc::InsertAttribInSelection( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -727,14 +727,14 @@ void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nE pNode->GetCharAttribs().ResortAttribs(); } -BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich ) +sal_Bool TextDoc::RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich ) { TextCharAttrib* pStarting; TextCharAttrib* pEnding; return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich ); } -BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich ) +sal_Bool TextDoc::RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -744,22 +744,22 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh // dieses startet am Ende der Selektion => kann erweitert werden rpStarting = 0; - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" ); // ueber die Attribute iterieren... - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { - BOOL bRemoveAttrib = FALSE; + sal_Bool bRemoveAttrib = sal_False; if ( !nWhich || ( pAttr->Which() == nWhich ) ) { // Attribut beginnt in Selection if ( ( pAttr->GetStart() >= nStart ) && ( pAttr->GetStart() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetEnd() > nEnd ) { pAttr->GetStart() = nEnd; // dann faengt es dahinter an @@ -769,14 +769,14 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Feature nur loeschen, wenn genau an der Stelle - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribut endet in Selection else if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetEnd() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() ) { pAttr->GetEnd() = nStart; // dann hoert es hier auf @@ -785,13 +785,13 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Feature nur loeschen, wenn genau an der Stelle - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribut ueberlappt die Selektion else if ( ( pAttr->GetStart() <= nStart ) && ( pAttr->GetEnd() >= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetStart() == nStart ) { pAttr->GetStart() = nEnd; @@ -806,10 +806,10 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh } else // Attribut muss gesplittet werden... { - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; rpEnding = pAttr; -// ULONG nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos(); +// sal_uLong nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos(); InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); // pNode->GetCharAttribs().GetStartList().Seek( nSavePos ); break; // es kann weitere Attribute geben! @@ -832,14 +832,14 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh #pragma SEG_FUNCDEF(editdoc_3f) -void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHORT nStart, USHORT nEnd ) +void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ) { // Diese Methode prueft nicht mehr, ob ein entspr. Attribut // schon an der Stelle existiert! // pruefen, ob neues Attrib oder einfach nur Ende eines Attribs... // const SfxPoolItem& rDefItem = pNode->GetContentAttribs().GetItem( rPoolItem.Which() ); -// BOOL bCreateAttrib = ( rDefItem != rPoolItem ); +// sal_Bool bCreateAttrib = ( rDefItem != rPoolItem ); // Durch den Verlust der Exclude-Liste geht es nicht mehr, dass ich // kein neues Attribut benoetige und nur das alte nicht expandiere... @@ -848,7 +848,7 @@ void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHOR // => Wenn schon Default-Item, dann wenigstens nur dann einstellen, // wenn davor wirklich ein entsprechendes Attribut. // if ( pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart ) ) -// bCreateAttrib = TRUE; +// bCreateAttrib = sal_True; // Aber kleiner Trost: // Die wenigsten schreiben, aendern das Attr, schreiben, und // stellen dann wieder das Default-Attr ein. @@ -877,7 +877,7 @@ void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHOR #pragma SEG_FUNCDEF(editdoc_40) -void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void TextDoc::InsertAttrib( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { if ( nStart != nEnd ) { @@ -903,7 +903,7 @@ void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const S // ??????????????????????????????? // eigentlich noch pruefen, ob wirklich splittet, oder return ! // ??????????????????????????????? - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; pAttr = MakeCharAttrib( *pCurPool, *(pAttr->GetItem()), nStart, nOldEnd ); pNode->GetCharAttribs().InsertAttrib( pAttr ); @@ -922,12 +922,12 @@ void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const S #pragma SEG_FUNCDEF(editdoc_41) -void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ) +void TextDoc::FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ) { DBG_ASSERT( pNode, "Wo soll ich suchen ?" ); DBG_ASSERT( nStartPos <= nEndPos, "Ungueltiger Bereich!" ); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); // keine Selection... if ( nStartPos == nEndPos ) @@ -961,7 +961,7 @@ void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, Sf if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1020,7 +1020,7 @@ void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, Sf if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx index 258f821beb19..44ae2371a181 100644 --- a/svtools/source/edit/textdoc.hxx +++ b/svtools/source/edit/textdoc.hxx @@ -42,7 +42,7 @@ SV_DECL_PTRARR_DEL( TextCharAttribs, TextCharAttribPtr, 0, 4 ) class TextCharAttribList : private TextCharAttribs { private: - BOOL mbHasEmptyAttribs; + sal_Bool mbHasEmptyAttribs; TextCharAttribList( const TextCharAttribList& ) : TextCharAttribs() {} @@ -50,28 +50,28 @@ public: TextCharAttribList(); ~TextCharAttribList(); - void Clear( BOOL bDestroyAttribs ); - USHORT Count() const { return TextCharAttribs::Count(); } + void Clear( sal_Bool bDestroyAttribs ); + sal_uInt16 Count() const { return TextCharAttribs::Count(); } - TextCharAttrib* GetAttrib( USHORT n ) const { return TextCharAttribs::GetObject( n ); } - void RemoveAttrib( USHORT n ) { TextCharAttribs::Remove( n, 1 ); } + TextCharAttrib* GetAttrib( sal_uInt16 n ) const { return TextCharAttribs::GetObject( n ); } + void RemoveAttrib( sal_uInt16 n ) { TextCharAttribs::Remove( n, 1 ); } void InsertAttrib( TextCharAttrib* pAttrib ); void DeleteEmptyAttribs(); void ResortAttribs(); - BOOL HasEmptyAttribs() const { return mbHasEmptyAttribs; } - BOOL& HasEmptyAttribs() { return mbHasEmptyAttribs; } + sal_Bool HasEmptyAttribs() const { return mbHasEmptyAttribs; } + sal_Bool& HasEmptyAttribs() { return mbHasEmptyAttribs; } - TextCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos ); - TextCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos = 0xFFFF ) const; - TextCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos ); - BOOL HasAttrib( USHORT nWhich ) const; - BOOL HasBoundingAttrib( USHORT nBound ); + TextCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + TextCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos = 0xFFFF ) const; + TextCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + sal_Bool HasAttrib( sal_uInt16 nWhich ) const; + sal_Bool HasBoundingAttrib( sal_uInt16 nBound ); #ifdef DBG_UTIL - BOOL DbgCheckAttribs(); + sal_Bool DbgCheckAttribs(); #endif }; @@ -84,8 +84,8 @@ private: TextNode( const TextNode& ) {;} protected: - void ExpandAttribs( USHORT nIndex, USHORT nNewChars ); - void CollapsAttribs( USHORT nIndex, USHORT nDelChars ); + void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars ); + void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars ); public: TextNode( const String& rText ); @@ -96,11 +96,11 @@ public: const TextCharAttribList& GetCharAttribs() const { return maCharAttribs; } TextCharAttribList& GetCharAttribs() { return maCharAttribs; } - void InsertText( USHORT nPos, const String& rText ); - void InsertText( USHORT nPos, sal_Unicode c ); - void RemoveText( USHORT nPos, USHORT nChars ); + void InsertText( sal_uInt16 nPos, const String& rText ); + void InsertText( sal_uInt16 nPos, sal_Unicode c ); + void RemoveText( sal_uInt16 nPos, sal_uInt16 nChars ); - TextNode* Split( USHORT nPos, BOOL bKeepEndigAttribs ); + TextNode* Split( sal_uInt16 nPos, sal_Bool bKeepEndigAttribs ); void Append( const TextNode& rNode ); }; @@ -108,7 +108,7 @@ class TextDoc { private: ToolsList<TextNode*> maTextNodes; - USHORT mnLeftMargin; + sal_uInt16 mnLeftMargin; protected: void DestroyTextNodes(); @@ -122,27 +122,27 @@ public: ToolsList<TextNode*>& GetNodes() { return maTextNodes; } const ToolsList<TextNode*>& GetNodes() const { return maTextNodes; } - TextPaM RemoveChars( const TextPaM& rPaM, USHORT nChars ); + TextPaM RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars ); TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c ); TextPaM InsertText( const TextPaM& rPaM, const String& rStr ); - TextPaM InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ); + TextPaM InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ); TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight ); - ULONG GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const; + sal_uLong GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const; String GetText( const sal_Unicode* pSep ) const; - String GetText( ULONG nPara ) const; + String GetText( sal_uLong nPara ) const; - void SetLeftMargin( USHORT n ) { mnLeftMargin = n; } - USHORT GetLeftMargin() const { return mnLeftMargin; } + void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; } + sal_uInt16 GetLeftMargin() const { return mnLeftMargin; } -// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd ), USHORT nWhich = 0 ); -// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich = 0 ); +// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ), sal_uInt16 nWhich = 0 ); +// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); // void InsertAttrib( const EditCharAttrib* pAttr ); // void InsertAttribInSelection( const EditCharAttrib* pAttr ); -// void FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ); +// void FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ); - BOOL IsValidPaM( const TextPaM& rPaM ); + sal_Bool IsValidPaM( const TextPaM& rPaM ); }; #endif // _TEXTDOC_HXX diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index c0afe8962009..38ff8852c777 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -81,8 +81,8 @@ typedef TextView* TextViewPtr; SV_DECL_PTRARR( TextViews, TextViewPtr, 0, 1 ) // SV_IMPL_PTRARR( TextViews, TextViewPtr ); -SV_DECL_VARARR_SORT( TESortedPositions, ULONG, 16, 8 ) -SV_IMPL_VARARR_SORT( TESortedPositions, ULONG ) +SV_DECL_VARARR_SORT( TESortedPositions, sal_uLong, 16, 8 ) +SV_IMPL_VARARR_SORT( TESortedPositions, sal_uLong ) #define RESDIFF 10 #define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop @@ -99,15 +99,15 @@ TextEngine::TextEngine() mpViews = new TextViews; mpActiveView = NULL; - mbIsFormatting = FALSE; - mbFormatted = FALSE; - mbUpdate = TRUE; - mbModified = FALSE; - mbUndoEnabled = FALSE; - mbIsInUndo = FALSE; - mbDowning = FALSE; - mbRightToLeft = FALSE; - mbHasMultiLineParas = FALSE; + mbIsFormatting = sal_False; + mbFormatted = sal_False; + mbUpdate = sal_True; + mbModified = sal_False; + mbUndoEnabled = sal_False; + mbIsInUndo = sal_False; + mbDowning = sal_False; + mbRightToLeft = sal_False; + mbHasMultiLineParas = sal_False; meAlign = TXTALIGN_LEFT; @@ -131,7 +131,7 @@ TextEngine::TextEngine() maTextColor = COL_BLACK; Font aFont; - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aFillColor( aFont.GetFillColor() ); aFillColor.SetTransparency( 0 ); aFont.SetFillColor( aFillColor ); @@ -140,7 +140,7 @@ TextEngine::TextEngine() TextEngine::~TextEngine() { - mbDowning = TRUE; + mbDowning = sal_True; delete mpIdleFormatter; delete mpDoc; @@ -163,7 +163,7 @@ void TextEngine::InsertView( TextView* pTextView ) void TextEngine::RemoveView( TextView* pTextView ) { - USHORT nPos = mpViews->GetPos( pTextView ); + sal_uInt16 nPos = mpViews->GetPos( pTextView ); if( nPos != USHRT_MAX ) { pTextView->HideCursor(); @@ -173,12 +173,12 @@ void TextEngine::RemoveView( TextView* pTextView ) } } -USHORT TextEngine::GetViewCount() const +sal_uInt16 TextEngine::GetViewCount() const { return mpViews->Count(); } -TextView* TextEngine::GetView( USHORT nView ) const +TextView* TextEngine::GetView( sal_uInt16 nView ) const { return mpViews->GetObject( nView ); } @@ -217,7 +217,7 @@ void TextEngine::SetFont( const Font& rFont ) // Wegen Selektion keinen Transparenten Font zulassen... // (Sonst spaeter in ImplPaint den Hintergrund anders loeschen...) - maFont.SetTransparent( FALSE ); + maFont.SetTransparent( sal_False ); // Tell VCL not to use the font color, use text color from OutputDevice maFont.SetColor( COL_TRANSPARENT ); Color aFillColor( maFont.GetFillColor() ); @@ -232,10 +232,10 @@ void TextEngine::SetFont( const Font& rFont ) if ( !aTextSize.Width() ) aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "XXXX" ) ) ); - mnDefTab = (USHORT)aTextSize.Width(); + mnDefTab = (sal_uInt16)aTextSize.Width(); if ( !mnDefTab ) mnDefTab = 1; - mnCharHeight = (USHORT)aTextSize.Height(); + mnCharHeight = (sal_uInt16)aTextSize.Height(); /* // #93746# Doesn't work with CJK HalfWidth/FullWidth FontMetric aRealFont( mpRefDev->GetFontMetric() ); @@ -243,7 +243,7 @@ void TextEngine::SetFont( const Font& rFont ) { String aX100; aX100.Fill( 100, 'X' ); - mnFixCharWidth100 = (USHORT)mpRefDev->GetTextWidth( aX100 ); + mnFixCharWidth100 = (sal_uInt16)mpRefDev->GetTextWidth( aX100 ); } else */ @@ -252,7 +252,7 @@ void TextEngine::SetFont( const Font& rFont ) FormatFullDoc(); UpdateViews(); - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); @@ -260,22 +260,22 @@ void TextEngine::SetFont( const Font& rFont ) } } -void TextEngine::SetDefTab( USHORT nDefTab ) +void TextEngine::SetDefTab( sal_uInt16 nDefTab ) { mnDefTab = nDefTab; // evtl neu setzen? } -void TextEngine::SetMaxTextLen( ULONG nLen ) +void TextEngine::SetMaxTextLen( sal_uLong nLen ) { mnMaxTextLen = nLen; } -void TextEngine::SetMaxTextWidth( ULONG nMaxWidth ) +void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth ) { if ( nMaxWidth != mnMaxTextWidth ) { - mnMaxTextWidth = Min( nMaxWidth, (ULONG)0x7FFFFFFF ); + mnMaxTextWidth = Min( nMaxWidth, (sal_uLong)0x7FFFFFFF ); FormatFullDoc(); UpdateViews(); } @@ -311,14 +311,14 @@ String TextEngine::GetText( LineEnd aSeparator ) const String TextEngine::GetTextLines( LineEnd aSeparator ) const { String aText; - ULONG nParas = mpTEParaPortions->Count(); + sal_uLong nParas = mpTEParaPortions->Count(); const sal_Unicode* pSep = static_getLineEndText( aSeparator ); - for ( ULONG nP = 0; nP < nParas; nP++ ) + for ( sal_uLong nP = 0; nP < nParas; nP++ ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP ); - USHORT nLines = pTEParaPortion->GetLines().Count(); - for ( USHORT nL = 0; nL < nLines; nL++ ) + sal_uInt16 nLines = pTEParaPortion->GetLines().Count(); + for ( sal_uInt16 nL = 0; nL < nLines; nL++ ) { TextLine* pLine = pTEParaPortion->GetLines()[nL]; aText += pTEParaPortion->GetNode()->GetText().Copy( pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() ); @@ -329,17 +329,17 @@ String TextEngine::GetTextLines( LineEnd aSeparator ) const return aText; } -String TextEngine::GetText( ULONG nPara ) const +String TextEngine::GetText( sal_uLong nPara ) const { return mpDoc->GetText( nPara ); } -ULONG TextEngine::GetTextLen( LineEnd aSeparator ) const +sal_uLong TextEngine::GetTextLen( LineEnd aSeparator ) const { return mpDoc->GetTextLen( static_getLineEndText( aSeparator ) ); } -ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const +sal_uLong TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const { TextSelection aSel( rSel ); aSel.Justify(); @@ -347,12 +347,12 @@ ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) co return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel ); } -USHORT TextEngine::GetTextLen( ULONG nPara ) const +sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const { return mpDoc->GetNodes().GetObject( nPara )->GetText().Len(); } -void TextEngine::SetUpdateMode( BOOL bUpdate ) +void TextEngine::SetUpdateMode( sal_Bool bUpdate ) { if ( bUpdate != mbUpdate ) { @@ -366,9 +366,9 @@ void TextEngine::SetUpdateMode( BOOL bUpdate ) } } -BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) +sal_Bool TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) { - BOOL bDoesMove = FALSE; + sal_Bool bDoesMove = sal_False; switch ( rKeyEvent.GetKeyCode().GetCode() ) { @@ -382,16 +382,16 @@ BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) case KEY_PAGEDOWN: { if ( !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesMove = TRUE; + bDoesMove = sal_True; } break; } return bDoesMove; } -BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) +sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) { - BOOL bDoesChange = FALSE; + sal_Bool bDoesChange = sal_False; KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction(); if ( eFunc != KEYFUNC_DONTKNOW ) @@ -401,7 +401,7 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) case KEYFUNC_UNDO: case KEYFUNC_REDO: case KEYFUNC_CUT: - case KEYFUNC_PASTE: bDoesChange = TRUE; + case KEYFUNC_PASTE: bDoesChange = sal_True; break; default: // wird dann evtl. unten bearbeitet. eFunc = KEYFUNC_DONTKNOW; @@ -415,14 +415,14 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) case KEY_BACKSPACE: { if ( !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesChange = TRUE; + bDoesChange = sal_True; } break; case KEY_RETURN: case KEY_TAB: { if ( !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesChange = TRUE; + bDoesChange = sal_True; } break; default: @@ -434,15 +434,15 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) return bDoesChange; } -BOOL TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent ) +sal_Bool TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent ) { if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 && KEY_MOD1 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) && // (ssa) #i45714#: KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) ) // check for Ctrl and Alt separately { - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void TextEngine::ImpInitDoc() @@ -459,9 +459,9 @@ void TextEngine::ImpInitDoc() mpDoc->GetNodes().Insert( pNode, 0 ); TEParaPortion* pIniPortion = new TEParaPortion( pNode ); - mpTEParaPortions->Insert( pIniPortion, (ULONG)0 ); + mpTEParaPortions->Insert( pIniPortion, (sal_uLong)0 ); - mbFormatted = FALSE; + mbFormatted = sal_False; ImpParagraphRemoved( TEXT_PARA_ALL ); ImpParagraphInserted( 0 ); @@ -477,15 +477,15 @@ String TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) cons TextSelection aSel( rSel ); aSel.Justify(); - ULONG nStartPara = aSel.GetStart().GetPara(); - ULONG nEndPara = aSel.GetEnd().GetPara(); + sal_uLong nStartPara = aSel.GetStart().GetPara(); + sal_uLong nEndPara = aSel.GetEnd().GetPara(); const sal_Unicode* pSep = static_getLineEndText( aSeparator ); - for ( ULONG nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ ) + for ( sal_uLong nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nNode ); - USHORT nStartPos = 0; - USHORT nEndPos = pNode->GetText().Len(); + sal_uInt16 nStartPos = 0; + sal_uInt16 nEndPos = pNode->GetText().Len(); if ( nNode == nStartPara ) nStartPos = aSel.GetStart().GetIndex(); if ( nNode == nEndPara ) // kann auch == nStart sein! @@ -504,7 +504,7 @@ void TextEngine::ImpRemoveText() TextPaM aStartPaM( 0, 0 ); TextSelection aEmptySel( aStartPaM, aStartPaM ); - for ( USHORT nView = 0; nView < mpViews->Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ ) { TextView* pView = mpViews->GetObject( nView ); pView->ImpSetSelection( aEmptySel ); @@ -516,9 +516,9 @@ void TextEngine::SetText( const XubString& rText ) { ImpRemoveText(); - BOOL bUndoCurrentlyEnabled = IsUndoEnabled(); + sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled(); // Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden. - EnableUndo( FALSE ); + EnableUndo( sal_False ); TextPaM aStartPaM( 0, 0 ); TextSelection aEmptySel( aStartPaM, aStartPaM ); @@ -527,7 +527,7 @@ void TextEngine::SetText( const XubString& rText ) if ( rText.Len() ) aPaM = ImpInsertText( aEmptySel, rText ); - for ( USHORT nView = 0; nView < mpViews->Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ ) { TextView* pView = mpViews->GetObject( nView ); pView->ImpSetSelection( aEmptySel ); @@ -548,7 +548,7 @@ void TextEngine::SetText( const XubString& rText ) } -void TextEngine::CursorMoved( ULONG nNode ) +void TextEngine::CursorMoved( sal_uLong nNode ) { // Leere Attribute loeschen, aber nur, wenn Absatz nicht leer! TextNode* pNode = mpDoc->GetNodes().GetObject( nNode ); @@ -556,7 +556,7 @@ void TextEngine::CursorMoved( ULONG nNode ) pNode->GetCharAttribs().DeleteEmptyAttribs(); } -void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* ) +void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* ) { DBG_ASSERT( nChars, "ImpRemoveChars - 0 Chars?!" ); if ( IsUndoEnabled() && !IsInUndo() ) @@ -566,9 +566,9 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) ); // Pruefen, ob Attribute geloescht oder geaendert werden: - USHORT nStart = rPaM.GetIndex(); - USHORT nEnd = nStart + nChars; - for ( USHORT nAttr = pNode->GetCharAttribs().Count(); nAttr; ) + sal_uInt16 nStart = rPaM.GetIndex(); + sal_uInt16 nEnd = nStart + nChars; + for ( sal_uInt16 nAttr = pNode->GetCharAttribs().Count(); nAttr; ) { TextCharAttrib* pAttr = pNode->GetCharAttribs().GetAttrib( --nAttr ); if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) ) @@ -590,7 +590,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars ); } -TextPaM TextEngine::ImpConnectParagraphs( ULONG nLeft, ULONG nRight ) +TextPaM TextEngine::ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight ) { DBG_ASSERT( nLeft != nRight, "Den gleichen Absatz zusammenfuegen ?" ); @@ -634,11 +634,11 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "Index im Wald in ImpDeleteText" ); DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "Index im Wald in ImpDeleteText" ); - ULONG nStartNode = aStartPaM.GetPara(); - ULONG nEndNode = aEndPaM.GetPara(); + sal_uLong nStartNode = aStartPaM.GetPara(); + sal_uLong nEndNode = aEndPaM.GetPara(); // Alle Nodes dazwischen entfernen.... - for ( ULONG z = nStartNode+1; z < nEndNode; z++ ) + for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ ) { // Immer nStartNode+1, wegen Remove()! ImpRemoveParagraph( nStartNode+1 ); @@ -648,7 +648,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) { // Den Rest des StartNodes... TextNode* pLeft = mpDoc->GetNodes().GetObject( nStartNode ); - USHORT nChars = pLeft->GetText().Len() - aStartPaM.GetIndex(); + sal_uInt16 nChars = pLeft->GetText().Len() - aStartPaM.GetIndex(); if ( nChars ) { ImpRemoveChars( aStartPaM, nChars ); @@ -675,7 +675,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) } else { - USHORT nChars; + sal_uInt16 nChars; nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex(); ImpRemoveChars( aStartPaM, nChars ); TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode ); @@ -688,7 +688,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) return aStartPaM; } -void TextEngine::ImpRemoveParagraph( ULONG nPara ) +void TextEngine::ImpRemoveParagraph( sal_uLong nPara ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); @@ -722,14 +722,14 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSeque return xISC; } -BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const +sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const { uno::Reference< i18n::XBreakIterator > xBI = ((TextEngine *) this)->GetBreakIterator(); SvtCTLOptions aCTLOptions; // get the index that really is first - USHORT nFirstPos = rCurSel.GetStart().GetIndex(); - USHORT nMaxPos = rCurSel.GetEnd().GetIndex(); + sal_uInt16 nFirstPos = rCurSel.GetStart().GetIndex(); + sal_uInt16 nMaxPos = rCurSel.GetEnd().GetIndex(); if (nMaxPos < nFirstPos) nFirstPos = nMaxPos; @@ -742,12 +742,12 @@ BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelec return bIsSequenceChecking; } -TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, BOOL bOverwrite ) +TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, sal_Bool bOverwrite ) { return ImpInsertText( c, rCurSel, bOverwrite, sal_False ); } -TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, BOOL bOverwrite, BOOL bIsUserInput ) +TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, sal_Bool bOverwrite, sal_Bool bIsUserInput ) { DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" ); DBG_ASSERT( c != '\r', "Zeilenumbruch bei InsertText ?" ); @@ -757,10 +757,10 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, if ( pNode->GetText().Len() < STRING_MAXLEN ) { - BOOL bDoOverwrite = ( bOverwrite && - ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? TRUE : FALSE; + sal_Bool bDoOverwrite = ( bOverwrite && + ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? sal_True : sal_False; - BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); + sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); if ( bUndoAction ) UndoActionStart(); @@ -810,7 +810,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, String aChgText( aNewText.copy( nChgPos ), nChgLen ); // select text from first pos to be changed to current pos - TextSelection aSel( TextPaM( aPaM.GetPara(), (USHORT) nChgPos ), aPaM ); + TextSelection aSel( TextPaM( aPaM.GetPara(), (sal_uInt16) nChgPos ), aPaM ); if (aChgText.Len()) // ImpInsertText implicitly handles undo... @@ -833,7 +833,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c ); - BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE; + sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; InsertUndo( pNewUndo, bTryMerge ); } @@ -868,21 +868,21 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString XubString aText( rStr ); aText.ConvertLineEnd( LINEEND_LF ); - USHORT nStart = 0; + sal_uInt16 nStart = 0; while ( nStart < aText.Len() ) { - USHORT nEnd = aText.Search( LINE_SEP, nStart ); + sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart ); if ( nEnd == STRING_NOTFOUND ) nEnd = aText.Len(); // nicht dereferenzieren! // Start == End => Leerzeile if ( nEnd > nStart ) { - ULONG nL = aPaM.GetIndex(); + sal_uLong nL = aPaM.GetIndex(); nL += ( nEnd-nStart ); if ( nL > STRING_MAXLEN ) { - USHORT nDiff = (USHORT) (nL-STRING_MAXLEN); + sal_uInt16 nDiff = (sal_uInt16) (nL-STRING_MAXLEN); nEnd = nEnd - nDiff; } @@ -914,7 +914,7 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString return aPaM; } -TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeepEndingAttribs ) +TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, sal_Bool bKeepEndingAttribs ) { TextPaM aPaM; if ( rCurSel.HasRange() ) @@ -925,13 +925,13 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeep return ImpInsertParaBreak( aPaM, bKeepEndingAttribs ); } -TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) +TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ) { if ( IsUndoEnabled() && !IsInUndo() ) InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) ); TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() ); - BOOL bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len(); + sal_Bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len(); TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) ); @@ -953,9 +953,9 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAtt return aPaM; } -Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial ) +Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial ) { - DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" ); + DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: PaMtoEditCursor" ); Rectangle aEditCursor; long nY = 0; @@ -966,7 +966,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial ) } else { - for ( ULONG nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ ) + for ( sal_uLong nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion); nY += pPortion->GetLines().Count() * mnCharHeight; @@ -979,7 +979,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial ) return aEditCursor; } -Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart ) +Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart ) { if ( !IsFormatted() && !IsFormatting() ) FormatAndUpdate(); @@ -1000,9 +1000,9 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP */ long nY = 0; - USHORT nCurIndex = 0; + sal_uInt16 nCurIndex = 0; TextLine* pLine = 0; - for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) ) @@ -1036,21 +1036,21 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP return aEditCursor; } -long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart ) +long TextEngine::ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart ) { DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "ImpGetXPos muss richtig gerufen werden!" ); - BOOL bDoPreferPortionStart = bPreferPortionStart; + sal_Bool bDoPreferPortionStart = bPreferPortionStart; // Assure that the portion belongs to this line: if ( nIndex == pLine->GetStart() ) - bDoPreferPortionStart = TRUE; + bDoPreferPortionStart = sal_True; else if ( nIndex == pLine->GetEnd() ) - bDoPreferPortionStart = FALSE; + bDoPreferPortionStart = sal_False; TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nTextPortionStart = 0; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); + sal_uInt16 nTextPortionStart = 0; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); DBG_ASSERT( ( nTextPortion >= pLine->GetStartPortion() ) && ( nTextPortion <= pLine->GetEndPortion() ), "GetXPos: Portion not in current line! " ); @@ -1081,7 +1081,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b // nX += pNextPortion->GetWidth(); // End of the tab portion, use start of next for cursor pos DBG_ASSERT( !bPreferPortionStart, "ImpGetXPos - How can we this tab portion here???" ); - nX = ImpGetXPos( nPara, pLine, nIndex, TRUE ); + nX = ImpGetXPos( nPara, pLine, nIndex, sal_True ); } } @@ -1117,7 +1117,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b return nX; } -const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const +const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const { const TextAttrib* pAttr = NULL; const TextCharAttrib* pCharAttr = FindCharAttrib( rPaM, nWhich ); @@ -1126,7 +1126,7 @@ const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) c return pAttr; } -const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const +const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const { const TextCharAttrib* pAttr = NULL; TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() ); @@ -1135,10 +1135,10 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nW return pAttr; } -BOOL TextEngine::HasAttrib( USHORT nWhich ) const +sal_Bool TextEngine::HasAttrib( sal_uInt16 nWhich ) const { - BOOL bAttr = FALSE; - for ( ULONG n = mpDoc->GetNodes().Count(); --n && !bAttr; ) + sal_Bool bAttr = sal_False; + for ( sal_uLong n = mpDoc->GetNodes().Count(); --n && !bAttr; ) { TextNode* pNode = mpDoc->GetNodes().GetObject( n ); bAttr = pNode->GetCharAttribs().HasAttrib( nWhich ); @@ -1146,12 +1146,12 @@ BOOL TextEngine::HasAttrib( USHORT nWhich ) const return bAttr; } -TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart ) +TextPaM TextEngine::GetPaM( const Point& rDocPos, sal_Bool bSmart ) { - DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" ); + DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: GetPaM" ); long nY = 0; - for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) + for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight; @@ -1169,21 +1169,21 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart ) } // Nicht gefunden - Dann den letzten sichtbare... - ULONG nLastNode = mpDoc->GetNodes().Count() - 1; + sal_uLong nLastNode = mpDoc->GetNodes().Count() - 1; TextNode* pLast = mpDoc->GetNodes().GetObject( nLastNode ); return TextPaM( nLastNode, pLast->GetText().Len() ); } -USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart ) +sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, sal_Bool bSmart ) { DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" ); TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); - USHORT nCurIndex = 0; + sal_uInt16 nCurIndex = 0; long nY = 0; TextLine* pLine = 0; - USHORT nLine; + sal_uInt16 nLine; for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); @@ -1203,24 +1203,24 @@ USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL b { uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator(); sal_Int32 nCount = 1; - nCurIndex = (USHORT)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); + nCurIndex = (sal_uInt16)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); } return nCurIndex; } -USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL ) +sal_uInt16 TextEngine::GetCharPos( sal_uLong nPortion, sal_uInt16 nLine, long nXPos, sal_Bool ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); TextLine* pLine = pPortion->GetLines().GetObject( nLine ); - USHORT nCurIndex = pLine->GetStart(); + sal_uInt16 nCurIndex = pLine->GetStart(); long nTmpX = pLine->GetStartX(); if ( nXPos <= nTmpX ) return nCurIndex; - for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ ) + for ( sal_uInt16 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i ); nTmpX += pTextPortion->GetWidth(); @@ -1248,9 +1248,9 @@ USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL ) } -ULONG TextEngine::GetTextHeight() const +sal_uLong TextEngine::GetTextHeight() const { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" ); if ( !IsFormatted() && !IsFormatting() ) ((TextEngine*)this)->FormatAndUpdate(); @@ -1258,9 +1258,9 @@ ULONG TextEngine::GetTextHeight() const return mnCurTextHeight; } -ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const +sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" ); if ( !IsFormatted() && !IsFormatting() ) ((TextEngine*)this)->FormatAndUpdate(); @@ -1268,15 +1268,15 @@ ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const return CalcParaHeight( nParagraph ); } -ULONG TextEngine::CalcTextWidth( ULONG nPara ) +sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara ) { - ULONG nParaWidth = 0; + sal_uLong nParaWidth = 0; TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); - for ( USHORT nLine = pPortion->GetLines().Count(); nLine; ) + for ( sal_uInt16 nLine = pPortion->GetLines().Count(); nLine; ) { - ULONG nLineWidth = 0; + sal_uLong nLineWidth = 0; TextLine* pLine = pPortion->GetLines().GetObject( --nLine ); - for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) + for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP ); nLineWidth += pTextPortion->GetWidth(); @@ -1287,7 +1287,7 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara ) return nParaWidth; } -ULONG TextEngine::CalcTextWidth() +sal_uLong TextEngine::CalcTextWidth() { if ( !IsFormatted() && !IsFormatting() ) FormatAndUpdate(); @@ -1295,9 +1295,9 @@ ULONG TextEngine::CalcTextWidth() if ( mnCurTextWidth == 0xFFFFFFFF ) { mnCurTextWidth = 0; - for ( ULONG nPara = mpTEParaPortions->Count(); nPara; ) + for ( sal_uLong nPara = mpTEParaPortions->Count(); nPara; ) { - ULONG nParaWidth = CalcTextWidth( --nPara ); + sal_uLong nParaWidth = CalcTextWidth( --nPara ); if ( nParaWidth > mnCurTextWidth ) mnCurTextWidth = nParaWidth; } @@ -1305,25 +1305,25 @@ ULONG TextEngine::CalcTextWidth() return mnCurTextWidth+1;// Ein breiter, da in CreateLines bei >= umgebrochen wird. } -ULONG TextEngine::CalcTextHeight() +sal_uLong TextEngine::CalcTextHeight() { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: CalcTextHeight" ); - ULONG nY = 0; - for ( ULONG nPortion = mpTEParaPortions->Count(); nPortion; ) + sal_uLong nY = 0; + for ( sal_uLong nPortion = mpTEParaPortions->Count(); nPortion; ) nY += CalcParaHeight( --nPortion ); return nY; } -ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, const Font* pFont ) +sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara, sal_uInt16 nPortionStart, sal_uInt16 nLen, const Font* pFont ) { // Innerhalb des Textes darf es keinen Portionwechsel (Attribut/Tab) geben! DBG_ASSERT( mpDoc->GetNodes().GetObject( nPara )->GetText().Search( '\t', nPortionStart ) >= (nPortionStart+nLen), "CalcTextWidth: Tab!" ); - ULONG nWidth; + sal_uLong nWidth; if ( mnFixCharWidth100 ) { - nWidth = (ULONG)nLen*mnFixCharWidth100/100; + nWidth = (sal_uLong)nLen*mnFixCharWidth100/100; } else { @@ -1339,14 +1339,14 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, mpRefDev->SetFont( aFont ); } TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); - nWidth = (ULONG)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); + nWidth = (sal_uLong)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); } return nWidth; } -USHORT TextEngine::GetLineCount( ULONG nParagraph ) const +sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const { DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" ); @@ -1357,7 +1357,7 @@ USHORT TextEngine::GetLineCount( ULONG nParagraph ) const return 0xFFFF; } -USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const +sal_uInt16 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const { DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" ); @@ -1371,9 +1371,9 @@ USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const return 0xFFFF; } -ULONG TextEngine::CalcParaHeight( ULONG nParagraph ) const +sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const { - ULONG nHeight = 0; + sal_uLong nHeight = 0; TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph ); DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" ); @@ -1387,12 +1387,12 @@ void TextEngine::UpdateSelections() { } -Range TextEngine::GetInvalidYOffsets( ULONG nPortion ) +Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); - USHORT nLines = pTEParaPortion->GetLines().Count(); - USHORT nLastInvalid, nFirstInvalid = 0; - USHORT nLine; + sal_uInt16 nLines = pTEParaPortion->GetLines().Count(); + sal_uInt16 nLastInvalid, nFirstInvalid = 0; + sal_uInt16 nLine; for ( nLine = 0; nLine < nLines; nLine++ ) { TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine ); @@ -1416,12 +1416,12 @@ Range TextEngine::GetInvalidYOffsets( ULONG nPortion ) return Range( nFirstInvalid*mnCharHeight, ((nLastInvalid+1)*mnCharHeight)-1 ); } -ULONG TextEngine::GetParagraphCount() const +sal_uLong TextEngine::GetParagraphCount() const { return mpDoc->GetNodes().Count(); } -void TextEngine::EnableUndo( BOOL bEnable ) +void TextEngine::EnableUndo( sal_Bool bEnable ) { // Beim Umschalten des Modus Liste loeschen: if ( bEnable != IsUndoEnabled() ) @@ -1437,7 +1437,7 @@ void TextEngine::EnableUndo( BOOL bEnable ) return *mpUndoManager; } -void TextEngine::UndoActionStart( USHORT nId ) +void TextEngine::UndoActionStart( sal_uInt16 nId ) { if ( IsUndoEnabled() && !IsInUndo() ) { @@ -1453,7 +1453,7 @@ void TextEngine::UndoActionEnd() GetUndoManager().LeaveListAction(); } -void TextEngine::InsertUndo( TextUndo* pUndo, BOOL bTryMerge ) +void TextEngine::InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge ) { DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" ); GetUndoManager().AddUndoAction( pUndo, bTryMerge ); @@ -1465,7 +1465,7 @@ void TextEngine::ResetUndo() mpUndoManager->Clear(); } -void TextEngine::InsertContent( TextNode* pNode, ULONG nPara ) +void TextEngine::InsertContent( TextNode* pNode, sal_uLong nPara ) { DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " ); DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" ); @@ -1475,7 +1475,7 @@ void TextEngine::InsertContent( TextNode* pNode, ULONG nPara ) ImpParagraphInserted( nPara ); } -TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos ) +TextPaM TextEngine::SplitContent( sal_uLong nNode, sal_uInt16 nSepPos ) { #ifdef DBG_UTIL TextNode* pNode = mpDoc->GetNodes().GetObject( nNode ); @@ -1487,21 +1487,21 @@ TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos ) return ImpInsertParaBreak( aPaM ); } -TextPaM TextEngine::ConnectContents( ULONG nLeftNode ) +TextPaM TextEngine::ConnectContents( sal_uLong nLeftNode ) { DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" ); return ImpConnectParagraphs( nLeftNode, nLeftNode+1 ); } -void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice* pOutDev ) +void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev ) { rFont = maFont; if ( pOutDev ) pOutDev->SetTextColor( maTextColor ); TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); - USHORT nAttribs = pNode->GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_uInt16 nAttribs = pNode->GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr ); if ( pAttrib->GetStart() > nPos ) @@ -1549,7 +1549,7 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); rFont.SetColor( rStyleSettings.GetHighlightTextColor() ); rFont.SetFillColor( rStyleSettings.GetHighlightColor() ); - rFont.SetTransparent( FALSE ); + rFont.SetTransparent( sal_False ); } else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE ) { @@ -1560,9 +1560,9 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice } } -void TextEngine::SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate ) +void TextEngine::SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate ) { - BOOL bChanged = ( GetUpdateMode() != bUp ); + sal_Bool bChanged = ( GetUpdateMode() != bUp ); mbUpdate = bUp; if ( mbUpdate && ( bChanged || bForceUpdate ) ) @@ -1584,15 +1584,15 @@ void TextEngine::FormatAndUpdate( TextView* pCurView ) } -void TextEngine::IdleFormatAndUpdate( TextView* pCurView, USHORT nMaxTimerRestarts ) +void TextEngine::IdleFormatAndUpdate( TextView* pCurView, sal_uInt16 nMaxTimerRestarts ) { mpIdleFormatter->DoIdleFormat( pCurView, nMaxTimerRestarts ); } void TextEngine::TextModified() { - mbFormatted = FALSE; - mbModified = TRUE; + mbFormatted = sal_False; + mbModified = sal_True; } void TextEngine::UpdateViews( TextView* pCurView ) @@ -1602,7 +1602,7 @@ void TextEngine::UpdateViews( TextView* pCurView ) DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" ); - for ( USHORT nView = 0; nView < mpViews->Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ ) { TextView* pView = mpViews->GetObject( nView ); pView->HideCursor(); @@ -1647,12 +1647,12 @@ void TextEngine::CheckIdleFormatter() void TextEngine::FormatFullDoc() { - for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) + for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) { - TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); USHORT nLen = pTEParaPortion->GetNode()->GetText().Len(); + TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); sal_uInt16 nLen = pTEParaPortion->GetNode()->GetText().Len(); pTEParaPortion->MarkSelectionInvalid( 0, nLen ); } - mbFormatted = FALSE; + mbFormatted = sal_False; FormatDoc(); } @@ -1661,26 +1661,26 @@ void TextEngine::FormatDoc() if ( IsFormatted() || !GetUpdateMode() || IsFormatting() ) return; - mbIsFormatting = TRUE; - mbHasMultiLineParas = FALSE; + mbIsFormatting = sal_True; + mbHasMultiLineParas = sal_False; long nY = 0; - BOOL bGrow = FALSE; + sal_Bool bGrow = sal_False; maInvalidRec = Rectangle(); // leermachen - for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) + for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); if ( pTEParaPortion->IsInvalid() ) { - ULONG nOldParaWidth = 0xFFFFFFFF; + sal_uLong nOldParaWidth = 0xFFFFFFFF; if ( mnCurTextWidth != 0xFFFFFFFF ) nOldParaWidth = CalcTextWidth( nPara ); ImpFormattingParagraph( nPara ); if ( CreateLines( nPara ) ) - bGrow = TRUE; + bGrow = sal_True; // InvalidRec nur einmal setzen... if ( maInvalidRec.IsEmpty() ) @@ -1700,7 +1700,7 @@ void TextEngine::FormatDoc() if ( mnCurTextWidth != 0xFFFFFFFF ) { - ULONG nNewParaWidth = CalcTextWidth( nPara ); + sal_uLong nNewParaWidth = CalcTextWidth( nPara ); if ( nNewParaWidth >= mnCurTextWidth ) mnCurTextWidth = nNewParaWidth; else if ( ( nOldParaWidth != 0xFFFFFFFF ) && ( nOldParaWidth >= mnCurTextWidth ) ) @@ -1713,12 +1713,12 @@ void TextEngine::FormatDoc() } nY += CalcParaHeight( nPara ); if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().Count() > 1 ) - mbHasMultiLineParas = TRUE; + mbHasMultiLineParas = sal_True; } if ( !maInvalidRec.IsEmpty() ) { - ULONG nNewHeight = CalcTextHeight(); + sal_uLong nNewHeight = CalcTextHeight(); long nDiff = nNewHeight - mnCurTextHeight; if ( nNewHeight < mnCurTextHeight ) { @@ -1735,18 +1735,18 @@ void TextEngine::FormatDoc() mnCurTextHeight = nNewHeight; if ( nDiff ) { - mbFormatted = TRUE; + mbFormatted = sal_True; ImpTextHeightChanged(); } } - mbIsFormatting = FALSE; - mbFormatted = TRUE; + mbIsFormatting = sal_False; + mbFormatted = sal_True; ImpTextFormatted(); } -void TextEngine::CreateAndInsertEmptyLine( ULONG nPara ) +void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); @@ -1763,31 +1763,31 @@ void TextEngine::CreateAndInsertEmptyLine( ULONG nPara ) else pTmpLine->SetStartX( mpDoc->GetLeftMargin() ); - BOOL bLineBreak = pNode->GetText().Len() ? TRUE : FALSE; + sal_Bool bLineBreak = pNode->GetText().Len() ? sal_True : sal_False; TETextPortion* pDummyPortion = new TETextPortion( 0 ); pDummyPortion->GetWidth() = 0; pTEParaPortion->GetTextPortions().Insert( pDummyPortion, pTEParaPortion->GetTextPortions().Count() ); - if ( bLineBreak == TRUE ) + if ( bLineBreak == sal_True ) { // -2: Die neue ist bereits eingefuegt. #ifdef DBG_UTIL TextLine* pLastLine = pTEParaPortion->GetLines().GetObject( pTEParaPortion->GetLines().Count()-2 ); DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" ); #endif - USHORT nPos = (USHORT) pTEParaPortion->GetTextPortions().Count() - 1 ; + sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().Count() - 1 ; pTmpLine->SetStartPortion( nPos ); pTmpLine->SetEndPortion( nPos ); } } -void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USHORT nPortionStart, long nRemainingWidth ) +void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*, sal_uInt16 nPortionStart, long nRemainingWidth ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); // Font sollte noch eingestellt sein. - USHORT nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart ); + sal_uInt16 nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart ); DBG_ASSERT( nMaxBreakPos < pNode->GetText().Len(), "Break?!" ); @@ -1806,7 +1806,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH static const com::sun::star::lang::Locale aDefLocale; i18n::LineBreakResults aLBR = xBI->getLineBreak( pNode->GetText(), nMaxBreakPos, aDefLocale, pLine->GetStart(), aHyphOptions, aUserOptions ); - USHORT nBreakPos = (USHORT)aLBR.breakIndex; + sal_uInt16 nBreakPos = (sal_uInt16)aLBR.breakIndex; if ( nBreakPos <= pLine->GetStart() ) { nBreakPos = nMaxBreakPos; @@ -1817,7 +1817,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH // die angeknackste Portion ist die End-Portion pLine->SetEnd( nBreakPos ); - USHORT nEndPortion = SplitTextPortion( nPara, nBreakPos ); + sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos ); sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) && ( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False; @@ -1832,7 +1832,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH pLine->SetEndPortion( nEndPortion ); } -USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) +sal_uInt16 TextEngine::SplitTextPortion( sal_uLong nPara, sal_uInt16 nPos ) { // Die Portion bei nPos wird geplittet, wenn bei nPos nicht @@ -1840,11 +1840,11 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) if ( nPos == 0 ) return 0; - USHORT nSplitPortion; - USHORT nTmpPos = 0; + sal_uInt16 nSplitPortion; + sal_uInt16 nTmpPos = 0; TETextPortion* pTextPortion = 0; TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nPortions = pTEParaPortion->GetTextPortions().Count(); + sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count(); for ( nSplitPortion = 0; nSplitPortion < nPortions; nSplitPortion++ ) { TETextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject(nSplitPortion); @@ -1860,7 +1860,7 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" ); - USHORT nOverlapp = nTmpPos - nPos; + sal_uInt16 nOverlapp = nTmpPos - nPos; pTextPortion->GetLen() = pTextPortion->GetLen() - nOverlapp; TETextPortion* pNewPortion = new TETextPortion( nOverlapp ); pTEParaPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 ); @@ -1869,18 +1869,18 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) return nSplitPortion; } -void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) +void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); TextNode* pNode = pTEParaPortion->GetNode(); DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" ); TESortedPositions aPositions; - ULONG nZero = 0; + sal_uLong nZero = 0; aPositions.Insert( nZero ); - USHORT nAttribs = pNode->GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_uInt16 nAttribs = pNode->GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr ); @@ -1892,7 +1892,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) aPositions.Insert( pNode->GetText().Len() ); const TEWritingDirectionInfos& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos(); - for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ ) + for ( sal_uInt16 nD = 0; nD < rWritingDirections.Count(); nD++ ) aPositions.Insert( rWritingDirections[nD].nStartPos ); if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) ) @@ -1908,7 +1908,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) } } - USHORT nTabPos = pNode->GetText().Search( '\t', 0 ); + sal_uInt16 nTabPos = pNode->GetText().Search( '\t', 0 ); while ( nTabPos != STRING_NOTFOUND ) { aPositions.Insert( nTabPos ); @@ -1919,9 +1919,9 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) // Ab ... loeschen: // Leider muss die Anzahl der TextPortions mit aPositions.Count() // nicht uebereinstimmen, da evtl. Zeilenumbrueche... - USHORT nPortionStart = 0; - USHORT nInvPortion = 0; - USHORT nP; + sal_uInt16 nPortionStart = 0; + sal_uInt16 nInvPortion = 0; + sal_uInt16 nP; for ( nP = 0; nP < pTEParaPortion->GetTextPortions().Count(); nP++ ) { TETextPortion* pTmpPortion = pTEParaPortion->GetTextPortions().GetObject(nP); @@ -1947,15 +1947,15 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) // Eine Portion kann auch durch einen Zeilenumbruch entstanden sein: aPositions.Insert( nPortionStart ); - USHORT nInvPos; + sal_uInt16 nInvPos; #ifdef DBG_UTIL - BOOL bFound = + sal_Bool bFound = #endif aPositions.Seek_Entry( nPortionStart, &nInvPos ); DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" ); - for ( USHORT i = nInvPos+1; i < aPositions.Count(); i++ ) + for ( sal_uInt16 i = nInvPos+1; i < aPositions.Count(); i++ ) { - TETextPortion* pNew = new TETextPortion( (USHORT)aPositions[i] - (USHORT)aPositions[i-1] ); + TETextPortion* pNew = new TETextPortion( (sal_uInt16)aPositions[i] - (sal_uInt16)aPositions[i-1] ); pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count()); } @@ -1965,7 +1965,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) #endif } -void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars ) +void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions!" ); @@ -1983,7 +1983,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha ( nStartPos && ( pNode->GetText().GetChar( nStartPos - 1 ) == '\t' ) ) || ( ( !nStartPos && ( nNewChars < pNode->GetText().Len() ) && pNode->GetText().GetChar( nNewChars ) == '\t' ) ) ) { - USHORT nNewPortionPos = 0; + sal_uInt16 nNewPortionPos = 0; if ( nStartPos ) nNewPortionPos = SplitTextPortion( nPara, nStartPos ) + 1; // else if ( ( pTEParaPortion->GetTextPortions().Count() == 1 ) && @@ -1996,7 +1996,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha !pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() ) { // Dann die leere Portion verwenden. - USHORT & r = + sal_uInt16 & r = pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen(); r = r + nNewChars; } @@ -2008,8 +2008,8 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha } else { - USHORT nPortionStart; - const USHORT nTP = pTEParaPortion->GetTextPortions(). + sal_uInt16 nPortionStart; + const sal_uInt16 nTP = pTEParaPortion->GetTextPortions(). FindPortion( nStartPos, nPortionStart ); TETextPortion* const pTP = pTEParaPortion->GetTextPortions()[ nTP ]; DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" ); @@ -2025,10 +2025,10 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha // Es darf keine reinragende oder im Bereich startende Portion geben, // also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein - USHORT nPortion = 0; - USHORT nPos = 0; - USHORT nEnd = nStartPos-nNewChars; - USHORT nPortions = pTEParaPortion->GetTextPortions().Count(); + sal_uInt16 nPortion = 0; + sal_uInt16 nPos = 0; + sal_uInt16 nEnd = nStartPos-nNewChars; + sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count(); TETextPortion* pTP = 0; for ( nPortion = 0; nPortion < nPortions; nPortion++ ) { @@ -2079,7 +2079,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan TextPaM const* pSelEnd = 0; if ( pSelection && pSelection->HasRange() ) { - BOOL bInvers = pSelection->GetEnd() < pSelection->GetStart(); + sal_Bool bInvers = pSelection->GetEnd() < pSelection->GetStart(); pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); } @@ -2090,23 +2090,23 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan // -------------------------------------------------- // Ueber alle Absaetze... // -------------------------------------------------- - for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) + for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); // falls beim Tippen Idle-Formatierung, asynchrones Paint. if ( pPortion->IsInvalid() ) return; - ULONG nParaHeight = CalcParaHeight( nPara ); - USHORT nIndex = 0; + sal_uLong nParaHeight = CalcParaHeight( nPara ); + sal_uInt16 nIndex = 0; if ( ( !pPaintArea || ( ( nY + (long)nParaHeight ) > pPaintArea->Top() ) ) && ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) ) { // -------------------------------------------------- // Ueber die Zeilen des Absatzes... // -------------------------------------------------- - USHORT nLines = pPortion->GetLines().Count(); - for ( USHORT nLine = 0; nLine < nLines; nLine++ ) + sal_uInt16 nLines = pPortion->GetLines().Count(); + for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { TextLine* pLine = pPortion->GetLines().GetObject(nLine); Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY ); @@ -2120,7 +2120,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan // Ueber die Portions der Zeile... // -------------------------------------------------- nIndex = pLine->GetStart(); - for ( USHORT y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ ) + for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ ) { DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" ); TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y ); @@ -2145,13 +2145,13 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan Font aFont; SeekCursor( nPara, nIndex+1, aFont, pOutDev ); if( bTransparent ) - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); else if ( pSelection ) - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); pOutDev->SetFont( aFont ); - USHORT nTmpIndex = nIndex; - USHORT nEnd = nTmpIndex + pTextPortion->GetLen(); + sal_uInt16 nTmpIndex = nIndex; + sal_uInt16 nEnd = nTmpIndex + pTextPortion->GetLen(); Point aPos = aTmpPos; if ( pPaintRange ) { @@ -2168,7 +2168,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan } } - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( pSelStart ) { // liegt ein Teil in der Selektion??? @@ -2176,7 +2176,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan TextPaM aTextEnd( nPara, nEnd ); if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) ) { - USHORT nL; + sal_uInt16 nL; // 1) Bereich vor Selektion if ( aTextStart < *pSelStart ) @@ -2211,7 +2211,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, pLine, nTmpIndex, nTmpIndex+nL ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -2229,7 +2229,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan if ( pSelStart || pPaintRange ) { Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) ); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( pSelStart ) { // liegt der Tab in der Selektion??? @@ -2241,7 +2241,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() ); pOutDev->DrawRect( aTabArea ); pOutDev->SetFillColor( aOldColor ); - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -2282,15 +2282,15 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan } } -BOOL TextEngine::CreateLines( ULONG nPara ) +sal_Bool TextEngine::CreateLines( sal_uLong nPara ) { - // BOOL: Aenderung der Hoehe des Absatzes Ja/Nein - TRUE/FALSE + // sal_Bool: Aenderung der Hoehe des Absatzes Ja/Nein - sal_True/sal_False TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" ); - USHORT nOldLineCount = pTEParaPortion->GetLines().Count(); + sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().Count(); // --------------------------------------------------------------- // Schnelle Sonderbehandlung fuer leere Absaetze... @@ -2318,9 +2318,9 @@ BOOL TextEngine::CreateLines( ULONG nPara ) } const short nInvalidDiff = pTEParaPortion->GetInvalidDiff(); - const USHORT nInvalidStart = pTEParaPortion->GetInvalidPosStart(); - const USHORT nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); - BOOL bQuickFormat = FALSE; + const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart(); + const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); + sal_Bool bQuickFormat = sal_False; if ( !pTEParaPortion->GetWritingDirectionInfos().Count() ) ImpInitWritingDirections( nPara ); @@ -2329,24 +2329,24 @@ BOOL TextEngine::CreateLines( ULONG nPara ) { if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) ) { - bQuickFormat = TRUE; + bQuickFormat = sal_True; } else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) ) { // pruefen, ob loeschen ueber Portiongrenzen erfolgte... - USHORT nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! - USHORT nEnd = nStart - nInvalidDiff; // neg. - bQuickFormat = TRUE; - USHORT nPos = 0; - USHORT nPortions = pTEParaPortion->GetTextPortions().Count(); - for ( USHORT nTP = 0; nTP < nPortions; nTP++ ) + sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! + sal_uInt16 nEnd = nStart - nInvalidDiff; // neg. + bQuickFormat = sal_True; + sal_uInt16 nPos = 0; + sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count(); + for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ ) { // Es darf kein Start/Ende im geloeschten Bereich liegen. TETextPortion* const pTP = pTEParaPortion->GetTextPortions().GetObject( nTP ); nPos = nPos + pTP->GetLen(); if ( ( nPos > nStart ) && ( nPos < nEnd ) ) { - bQuickFormat = FALSE; + bQuickFormat = sal_False; break; } } @@ -2363,8 +2363,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // Zeilen flaggen => nicht removen ! // --------------------------------------------------------------- - USHORT nLine = pTEParaPortion->GetLines().Count()-1; - for ( USHORT nL = 0; nL <= nLine; nL++ ) + sal_uInt16 nLine = pTEParaPortion->GetLines().Count()-1; + for ( sal_uInt16 nL = 0; nL <= nLine; nL++ ) { TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL ); if ( pLine->GetEnd() > nInvalidStart ) @@ -2384,25 +2384,25 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // --------------------------------------------------------------- // Ab hier alle Zeilen durchformatieren... // --------------------------------------------------------------- - USHORT nDelFromLine = 0xFFFF; - BOOL bLineBreak = FALSE; + sal_uInt16 nDelFromLine = 0xFFFF; + sal_Bool bLineBreak = sal_False; - USHORT nIndex = pLine->GetStart(); + sal_uInt16 nIndex = pLine->GetStart(); TextLine aSaveLine( *pLine ); Font aFont; - BOOL bCalcPortion = TRUE; + sal_Bool bCalcPortion = sal_True; while ( nIndex < pNode->GetText().Len() ) { - BOOL bEOL = FALSE; - BOOL bEOC = FALSE; - USHORT nPortionStart = 0; - USHORT nPortionEnd = 0; + sal_Bool bEOL = sal_False; + sal_Bool bEOC = sal_False; + sal_uInt16 nPortionStart = 0; + sal_uInt16 nPortionEnd = 0; - USHORT nTmpPos = nIndex; - USHORT nTmpPortion = pLine->GetStartPortion(); + sal_uInt16 nTmpPos = nIndex; + sal_uInt16 nTmpPortion = pLine->GetStartPortion(); long nTmpWidth = mpDoc->GetLeftMargin(); // long nXWidth = mnMaxTextWidth ? ( mnMaxTextWidth - mpDoc->GetLeftMargin() ) : 0x7FFFFFFF; // Margin nicht abziehen, ist schon in TmpWidth enthalten. @@ -2412,8 +2412,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // Portion suchen, die nicht mehr in Zeile passt.... TETextPortion* pPortion = 0; - BOOL bBrokenLine = FALSE; - bLineBreak = FALSE; + sal_Bool bBrokenLine = sal_False; + bLineBreak = sal_False; while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().Count() ) ) { @@ -2432,8 +2432,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // Aber was jetzt ? Tab passend machen! pPortion->GetWidth() = nXWidth-1; nTmpWidth = pPortion->GetWidth(); - bEOL = TRUE; - bBrokenLine = TRUE; + bEOL = sal_True; + bBrokenLine = sal_True; } pPortion->GetKind() = PORTIONKIND_TAB; } @@ -2454,30 +2454,30 @@ BOOL TextEngine::CreateLines( ULONG nPara ) } // das war evtl. eine Portion zu weit: - BOOL bFixedEnd = FALSE; + sal_Bool bFixedEnd = sal_False; if ( nTmpWidth > nXWidth ) { nPortionEnd = nTmpPos; nTmpPos = nTmpPos - pPortion->GetLen(); nPortionStart = nTmpPos; nTmpPortion--; - bEOL = FALSE; - bEOC = FALSE; + bEOL = sal_False; + bEOC = sal_False; nTmpWidth -= pPortion->GetWidth(); if ( pPortion->GetKind() == PORTIONKIND_TAB ) { - bEOL = TRUE; - bFixedEnd = TRUE; + bEOL = sal_True; + bFixedEnd = sal_True; } } else { - bEOL = TRUE; - bEOC = TRUE; + bEOL = sal_True; + bEOC = sal_True; pLine->SetEnd( nPortionEnd ); DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine TextPortions?" ); - pLine->SetEndPortion( (USHORT)pTEParaPortion->GetTextPortions().Count() - 1 ); + pLine->SetEndPortion( (sal_uInt16)pTEParaPortion->GetTextPortions().Count() - 1 ); } if ( bFixedEnd ) @@ -2489,7 +2489,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) { pLine->SetEnd( nPortionStart+1 ); pLine->SetEndPortion( nTmpPortion-1 ); - bEOC = FALSE; // wurde oben gesetzt, vielleich mal die if's umstellen? + bEOC = sal_False; // wurde oben gesetzt, vielleich mal die if's umstellen? } else if ( !bEOL ) { @@ -2502,7 +2502,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) { // Ausrichten... long nTextWidth = 0; - for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) + for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) { TETextPortion* pTextPortion = pTEParaPortion->GetTextPortions().GetObject( nTP ); nTextWidth += pTextPortion->GetWidth(); @@ -2511,9 +2511,9 @@ BOOL TextEngine::CreateLines( ULONG nPara ) if ( nSpace > 0 ) { if ( ImpGetAlign() == TXTALIGN_CENTER ) - pLine->SetStartX( (USHORT)(nSpace / 2) ); + pLine->SetStartX( (sal_uInt16)(nSpace / 2) ); else // TXTALIGN_RIGHT - pLine->SetStartX( (USHORT)nSpace ); + pLine->SetStartX( (sal_uInt16)nSpace ); } } else @@ -2542,8 +2542,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) } else { - USHORT nStart = pLine->GetStart(); - USHORT nEnd = pLine->GetEnd(); + sal_uInt16 nStart = pLine->GetStart(); + sal_uInt16 nEnd = pLine->GetEnd(); if ( nStart > nInvalidEnd ) { @@ -2553,7 +2553,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) pLine->SetValid(); if ( bCalcPortion && bQuickFormat ) { - bCalcPortion = FALSE; + bCalcPortion = sal_False; pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; } @@ -2567,7 +2567,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // textbreiten neu bestimmen: if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) ) { - bCalcPortion = FALSE; + bCalcPortion = sal_False; pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; } @@ -2578,7 +2578,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende // weil nEnd hinter das letzte Zeichen zeigt! - USHORT nEndPortion = pLine->GetEndPortion(); + sal_uInt16 nEndPortion = pLine->GetEndPortion(); // Naechste Zeile oder ggf. neue Zeile.... pLine = 0; @@ -2609,7 +2609,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" ); - if ( bLineBreak == TRUE ) + if ( bLineBreak == sal_True ) CreateAndInsertEmptyLine( nPara ); pTEParaPortion->SetValid(); @@ -2626,8 +2626,8 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord ) TextNode* pNode = mpDoc->GetNodes().GetObject( rCursorPos.GetPara() ); uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator(); i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rCursorPos.GetIndex(), GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True ); - aSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos; - aSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos; + aSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos; + aSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos; aWord = pNode->GetText().Copy( aSel.GetStart().GetIndex(), aSel.GetEnd().GetIndex() - aSel.GetStart().GetIndex() ); if ( pStartOfWord ) *pStartOfWord = aSel.GetStart(); @@ -2635,10 +2635,10 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord ) return aWord; } -BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) +sal_Bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) { - BOOL bUpdate = GetUpdateMode(); - SetUpdateMode( FALSE ); + sal_Bool bUpdate = GetUpdateMode(); + SetUpdateMode( sal_False ); UndoActionStart(); TextSelection aSel; @@ -2646,7 +2646,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) aSel = *pSel; else { - ULONG nParas = mpDoc->GetNodes().Count(); + sal_uLong nParas = mpDoc->GetNodes().Count(); TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 ); aSel = TextPaM( nParas-1 , pNode->GetText().Len() ); } @@ -2655,7 +2655,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) aSel = ImpDeleteText( aSel ); ByteString aLine; - BOOL bDone = rInput.ReadLine( aLine ); + sal_Bool bDone = rInput.ReadLine( aLine ); String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr; while ( bDone ) { @@ -2677,17 +2677,17 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) SetUpdateMode( bUpdate ); FormatAndUpdate( GetActiveView() ); - return rInput.GetError() ? FALSE : TRUE; + return rInput.GetError() ? sal_False : sal_True; } -BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML ) +sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bool bHTML ) { TextSelection aSel; if ( pSel ) aSel = *pSel; else { - ULONG nParas = mpDoc->GetNodes().Count(); + sal_uLong nParas = mpDoc->GetNodes().Count(); TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 ); aSel.GetStart() = TextPaM( 0, 0 ); aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().Len() ); @@ -2699,12 +2699,12 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML rOutput.WriteLine( "<BODY>" ); } - for ( ULONG nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ ) + for ( sal_uLong nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); - USHORT nStartPos = 0; - USHORT nEndPos = pNode->GetText().Len(); + sal_uInt16 nStartPos = 0; + sal_uInt16 nEndPos = pNode->GetText().Len(); if ( nPara == aSel.GetStart().GetPara() ) nStartPos = aSel.GetStart().GetIndex(); if ( nPara == aSel.GetEnd().GetPara() ) @@ -2726,8 +2726,8 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML } else { - USHORT nTmpStart = nStartPos; - USHORT nTmpEnd = nEndPos; + sal_uInt16 nTmpStart = nStartPos; + sal_uInt16 nTmpEnd = nEndPos; do { TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos ); @@ -2764,22 +2764,22 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML rOutput.WriteLine( "</HTML>" ); } - return rOutput.GetError() ? FALSE : TRUE; + return rOutput.GetError() ? sal_False : sal_True; } -void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate ) +void TextEngine::RemoveAttribs( sal_uLong nPara, sal_Bool bIdleFormatAndUpdate ) { if ( nPara < mpDoc->GetNodes().Count() ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); if ( pNode->GetCharAttribs().Count() ) { - pNode->GetCharAttribs().Clear( TRUE ); + pNode->GetCharAttribs().Clear( sal_True ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() ); - mbFormatted = FALSE; + mbFormatted = sal_False; if ( bIdleFormatAndUpdate ) IdleFormatAndUpdate( NULL, 0xFFFF ); @@ -2788,7 +2788,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate ) } } } -void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate ) +void TextEngine::RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate ) { if ( nPara < mpDoc->GetNodes().Count() ) { @@ -2796,15 +2796,15 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU if ( pNode->GetCharAttribs().Count() ) { TextCharAttribList& rAttribs = pNode->GetCharAttribs(); - USHORT nAttrCount = rAttribs.Count(); - for(USHORT nAttr = nAttrCount; nAttr; --nAttr) + sal_uInt16 nAttrCount = rAttribs.Count(); + for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr) { if(rAttribs.GetAttrib( nAttr - 1 )->Which() == nWhich) rAttribs.RemoveAttrib( nAttr -1 ); } TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() ); - mbFormatted = FALSE; + mbFormatted = sal_False; if(bIdleFormatAndUpdate) IdleFormatAndUpdate( NULL, 0xFFFF ); else @@ -2812,7 +2812,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU } } } -void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib ) +void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib ) { if ( nPara < mpDoc->GetNodes().Count() ) { @@ -2820,8 +2820,8 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib ) if ( pNode->GetCharAttribs().Count() ) { TextCharAttribList& rAttribs = pNode->GetCharAttribs(); - USHORT nAttrCount = rAttribs.Count(); - for(USHORT nAttr = nAttrCount; nAttr; --nAttr) + sal_uInt16 nAttrCount = rAttribs.Count(); + for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr) { if(rAttribs.GetAttrib( nAttr - 1 ) == &rAttrib) { @@ -2831,13 +2831,13 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib ) } TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() ); - mbFormatted = FALSE; + mbFormatted = sal_False; FormatAndUpdate( NULL ); } } } -void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate ) +void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate ) { // Es wird hier erstmal nicht geprueft, ob sich Attribute ueberlappen! // Diese Methode ist erstmal nur fuer einen Editor, der fuer eine Zeile @@ -2851,7 +2851,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nMax = pNode->GetText().Len(); + sal_uInt16 nMax = pNode->GetText().Len(); if ( nStart > nMax ) nStart = nMax; if ( nEnd > nMax ) @@ -2860,7 +2860,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, pNode->GetCharAttribs().InsertAttrib( new TextCharAttrib( rAttr, nStart, nEnd ) ); pTEParaPortion->MarkSelectionInvalid( nStart, nEnd ); - mbFormatted = FALSE; + mbFormatted = sal_False; if ( bIdleFormatAndUpdate ) IdleFormatAndUpdate( NULL, 0xFFFF ); else @@ -2887,14 +2887,14 @@ void TextEngine::ValidateSelection( TextSelection& rSel ) const void TextEngine::ValidatePaM( TextPaM& rPaM ) const { - ULONG nMaxPara = mpDoc->GetNodes().Count() - 1; + sal_uLong nMaxPara = mpDoc->GetNodes().Count() - 1; if ( rPaM.GetPara() > nMaxPara ) { rPaM.GetPara() = nMaxPara; rPaM.GetIndex() = 0xFFFF; } - USHORT nMaxIndex = GetTextLen( rPaM.GetPara() ); + sal_uInt16 nMaxIndex = GetTextLen( rPaM.GetPara() ); if ( rPaM.GetIndex() > nMaxIndex ) rPaM.GetIndex() = nMaxIndex; } @@ -2902,18 +2902,18 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const // Status & Selektionsanpassung -void TextEngine::ImpParagraphInserted( ULONG nPara ) +void TextEngine::ImpParagraphInserted( sal_uLong nPara ) { // Die aktive View braucht nicht angepasst werden, aber bei allen // passiven muss die Selektion angepasst werden: if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) { -// BOOL bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart(); +// sal_Bool bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart(); // TextPaM& rMin = !bInvers ? pView->maSelection.GetStart(): pView->maSelection.GetEnd(); // TextPaM& rMax = bInvers ? pView->maSelection.GetStart() : pView->maSelection.GetEnd(); // @@ -2933,16 +2933,16 @@ void TextEngine::ImpParagraphInserted( ULONG nPara ) Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) ); } -void TextEngine::ImpParagraphRemoved( ULONG nPara ) +void TextEngine::ImpParagraphRemoved( sal_uLong nPara ) { if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) { - ULONG nParas = mpDoc->GetNodes().Count(); + sal_uLong nParas = mpDoc->GetNodes().Count(); for ( int n = 0; n <= 1; n++ ) { TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd(); @@ -2961,16 +2961,16 @@ void TextEngine::ImpParagraphRemoved( ULONG nPara ) Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) ); } -void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars ) +void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars ) { if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) { - USHORT nEnd = nPos+nChars; + sal_uInt16 nEnd = nPos+nChars; for ( int n = 0; n <= 1; n++ ) { TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd(); @@ -2988,11 +2988,11 @@ void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars ) Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) ); } -void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars ) +void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars ) { if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) @@ -3012,7 +3012,7 @@ void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars ) Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) ); } -void TextEngine::ImpFormattingParagraph( ULONG nPara ) +void TextEngine::ImpFormattingParagraph( sal_uLong nPara ) { Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) ); } @@ -3032,12 +3032,12 @@ void TextEngine::Draw( OutputDevice* pDev, const Point& rPos ) ImpPaint( pDev, rPos, NULL ); } -void TextEngine::SetLeftMargin( USHORT n ) +void TextEngine::SetLeftMargin( sal_uInt16 n ) { mpDoc->SetLeftMargin( n ); } -USHORT TextEngine::GetLeftMargin() const +sal_uInt16 TextEngine::GetLeftMargin() const { return mpDoc->GetLeftMargin(); } @@ -3074,7 +3074,7 @@ LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper() return mpLocaleDataWrapper; } -void TextEngine::SetRightToLeft( BOOL bR2L ) +void TextEngine::SetRightToLeft( sal_Bool bR2L ) { if ( mbRightToLeft != bR2L ) { @@ -3085,7 +3085,7 @@ void TextEngine::SetRightToLeft( BOOL bR2L ) } } -void TextEngine::ImpInitWritingDirections( ULONG nPara ) +void TextEngine::ImpInitWritingDirections( sal_uLong nPara ) { TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara ); TEWritingDirectionInfos& rInfos = pParaPortion->GetWritingDirectionInfos(); @@ -3112,10 +3112,10 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara ) int32_t nEnd; UBiDiLevel nCurrDir; - for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx ) + for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx ) { ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir ); - rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (USHORT)nStart, (USHORT)nEnd ), rInfos.Count() ); + rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ), rInfos.Count() ); nStart = nEnd; } @@ -3124,13 +3124,13 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara ) // No infos mean no CTL and default dir is L2R... if ( !rInfos.Count() ) - rInfos.Insert( TEWritingDirectionInfo( 0, 0, (USHORT)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() ); + rInfos.Insert( TEWritingDirectionInfo( 0, 0, (sal_uInt16)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() ); } -BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd ) +sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd ) { - BYTE nRightToLeft = 0; + sal_uInt8 nRightToLeft = 0; TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); if ( pNode && pNode->GetText().Len() ) @@ -3140,7 +3140,7 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US ImpInitWritingDirections( nPara ); TEWritingDirectionInfos& rDirInfos = pParaPortion->GetWritingDirectionInfos(); - for ( USHORT n = 0; n < rDirInfos.Count(); n++ ) + for ( sal_uInt16 n = 0; n < rDirInfos.Count(); n++ ) { if ( ( rDirInfos[n].nStartPos <= nPos ) && ( rDirInfos[n].nEndPos >= nPos ) ) { @@ -3156,13 +3156,13 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US return nRightToLeft; } -long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion ) +long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion ) { long nX = pLine->GetStartX(); TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara ); - for ( USHORT i = pLine->GetStartPortion(); i < nTextPortion; i++ ) + for ( sal_uInt16 i = pLine->GetStartPortion(); i < nTextPortion; i++ ) { TETextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i ); nX += pPortion->GetWidth(); @@ -3236,9 +3236,9 @@ long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTex return nX; } -void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion ) +void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion ) { - ULONG nLayoutMode = pOutDev->GetLayoutMode(); + sal_uLong nLayoutMode = pOutDev->GetLayoutMode(); nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG ); if ( bDrawingR2LPortion ) @@ -3260,12 +3260,12 @@ TxtAlign TextEngine::ImpGetAlign() const return eAlign; } -long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 ) +long TextEngine::ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nPortionStart; - USHORT nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, TRUE ); + sal_uInt16 nPortionStart; + sal_uInt16 nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, sal_True ); TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nPortion ); @@ -3286,7 +3286,7 @@ long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex nX = ImpGetXPos( nPara, pLine, nIndex, nIndex == nPortionStart ); if ( nIndex2 != nIndex ) { - long nX2 = ImpGetXPos( nPara, pLine, nIndex2, FALSE ); + long nX2 = ImpGetXPos( nPara, pLine, nIndex2, sal_False ); if ( ( !IsRightToLeft() && ( nX2 < nX ) ) || ( IsRightToLeft() && ( nX2 > nX ) ) ) { diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx index 18cf9331328e..ba559c3dc98c 100644 --- a/svtools/source/edit/textund2.hxx +++ b/svtools/source/edit/textund2.hxx @@ -33,13 +33,13 @@ class TextUndoDelPara : public TextUndo { private: - BOOL mbDelObject; - ULONG mnPara; + sal_Bool mbDelObject; + sal_uLong mnPara; TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt! public: TYPEINFO(); - TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara ); + TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara ); ~TextUndoDelPara(); virtual void Undo(); @@ -50,12 +50,12 @@ public: class TextUndoConnectParas : public TextUndo { private: - ULONG mnPara; - USHORT mnSepPos; + sal_uLong mnPara; + sal_uInt16 mnSepPos; public: TYPEINFO(); - TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos ); + TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos ); ~TextUndoConnectParas(); virtual void Undo(); @@ -66,12 +66,12 @@ public: class TextUndoSplitPara : public TextUndo { private: - ULONG mnPara; - USHORT mnSepPos; + sal_uLong mnPara; + sal_uInt16 mnSepPos; public: TYPEINFO(); - TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos ); + TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos ); ~TextUndoSplitPara(); virtual void Undo(); @@ -95,7 +95,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); }; @@ -123,9 +123,9 @@ private: TextSelection maSelection; // SfxItemSet aNewAttribs; // TextInfoArray aPrevAttribs; -// BYTE nSpecial; -// BOOL bSetIsRemove; -// USHORT nRemoveWhich; +// sal_uInt8 nSpecial; +// sal_Bool bSetIsRemove; +// sal_uInt16 nRemoveWhich; // // void ImpSetSelection( TextView* pView ); @@ -137,9 +137,9 @@ public: // TextInfoArray& GetTextInfos() { return aPrevAttribs; } // SfxItemSet& GetNewAttribs() { return aNewAttribs; } -// void SetSpecial( BYTE n ) { nSpecial = n; } -// void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; } -// void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; } +// void SetSpecial( sal_uInt8 n ) { nSpecial = n; } +// void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; } +// void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; } virtual void Undo(); virtual void Redo(); diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx index 2ad5e318e92f..742c3ed4c707 100644 --- a/svtools/source/edit/textundo.cxx +++ b/svtools/source/edit/textundo.cxx @@ -54,33 +54,33 @@ TextUndoManager::~TextUndoManager() { } -BOOL __EXPORT TextUndoManager::Undo() +sal_Bool __EXPORT TextUndoManager::Undo() { if ( GetUndoActionCount() == 0 ) - return FALSE; + return sal_False; UndoRedoStart(); - mpTextEngine->SetIsInUndo( TRUE ); - BOOL bDone = SfxUndoManager::Undo(); - mpTextEngine->SetIsInUndo( FALSE ); + mpTextEngine->SetIsInUndo( sal_True ); + sal_Bool bDone = SfxUndoManager::Undo(); + mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); return bDone; } -BOOL __EXPORT TextUndoManager::Redo() +sal_Bool __EXPORT TextUndoManager::Redo() { if ( GetRedoActionCount() == 0 ) - return FALSE; + return sal_False; UndoRedoStart(); - mpTextEngine->SetIsInUndo( TRUE ); - BOOL bDone = SfxUndoManager::Redo(); - mpTextEngine->SetIsInUndo( FALSE ); + mpTextEngine->SetIsInUndo( sal_True ); + sal_Bool bDone = SfxUndoManager::Redo(); + mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); @@ -132,12 +132,12 @@ void TextUndo::SetSelection( const TextSelection& rSel ) } -TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara ) +TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara ) : TextUndo( pTextEngine ) { mpNode = pNode; mnPara = nPara; - mbDelObject = TRUE; + mbDelObject = sal_True; } TextUndoDelPara::~TextUndoDelPara() @@ -149,7 +149,7 @@ TextUndoDelPara::~TextUndoDelPara() void __EXPORT TextUndoDelPara::Undo() { GetTextEngine()->InsertContent( mpNode, mnPara ); - mbDelObject = FALSE; // gehoert wieder der Engine + mbDelObject = sal_False; // gehoert wieder der Engine if ( GetView() ) { @@ -171,10 +171,10 @@ void __EXPORT TextUndoDelPara::Redo() GetDoc()->GetNodes().Remove( mnPara ); GetTextEngine()->ImpParagraphRemoved( mnPara ); - mbDelObject = TRUE; // gehoert wieder dem Undo + mbDelObject = sal_True; // gehoert wieder dem Undo - ULONG nParas = GetDoc()->GetNodes().Count(); - ULONG n = mnPara < nParas ? mnPara : (nParas-1); + sal_uLong nParas = GetDoc()->GetNodes().Count(); + sal_uLong n = mnPara < nParas ? mnPara : (nParas-1); TextNode* pN = GetDoc()->GetNodes().GetObject( n ); TextPaM aPaM( n, pN->GetText().Len() ); SetSelection( aPaM ); @@ -183,7 +183,7 @@ void __EXPORT TextUndoDelPara::Redo() // ----------------------------------------------------------------------- // TextUndoConnectParas // ------------------------------------------------------------------------ -TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos ) +TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos ) : TextUndo( pTextEngine ) { mnPara = nPara; @@ -207,7 +207,7 @@ void __EXPORT TextUndoConnectParas::Redo() } -TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos ) +TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos ) : TextUndo( pTextEngine ) { mnPara = nPara; @@ -254,22 +254,22 @@ void __EXPORT TextUndoInsertChars::Redo() SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) ); } -BOOL __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) +sal_Bool __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) { if ( !pNextAction->ISA( TextUndoInsertChars ) ) - return FALSE; + return sal_False; TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction; if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() ) - return FALSE; + return sal_False; if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() ) { maText += pNext->maText; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -301,7 +301,7 @@ TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelec { maSelection.Justify(); // aNewAttribs.Set( rNewItems ); -// mbSetIsRemove = FALSE; +// mbSetIsRemove = sal_False; // mnRemoveWhich = 0; // mnSpecial = 0; } @@ -313,12 +313,12 @@ TextUndoSetAttribs::~TextUndoSetAttribs() void __EXPORT TextUndoSetAttribs::Undo() { - for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) + for ( sal_uLong nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) { -// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ]; +// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ]; // GetTextEngine()->RemoveCharAttribs( nPara ); // TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara ); -// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) +// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) // { // GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() ); // } diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx index 69b5fc393744..357331057aeb 100644 --- a/svtools/source/edit/textundo.hxx +++ b/svtools/source/edit/textundo.hxx @@ -47,9 +47,9 @@ public: ~TextUndoManager(); using SfxUndoManager::Undo; - virtual BOOL Undo(); + virtual sal_Bool Undo(); using SfxUndoManager::Redo; - virtual BOOL Redo(); + virtual sal_Bool Redo(); }; diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index 64c6470be1e8..0b4fb6ee2ca5 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -124,7 +124,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla { uno::Any aAny; - ULONG nT = SotExchange::GetFormat( rFlavor ); + sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( nT == SOT_FORMAT_STRING ) { aAny <<= (::rtl::OUString)GetText(); @@ -132,7 +132,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla else if ( nT == SOT_FORMATSTR_ID_HTML ) { GetHTMLStream().Seek( STREAM_SEEK_TO_END ); - ULONG nLen = GetHTMLStream().Tell(); + sal_uLong nLen = GetHTMLStream().Tell(); GetHTMLStream().Seek(0); uno::Sequence< sal_Int8 > aSeq( nLen ); @@ -149,7 +149,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException) { GetHTMLStream().Seek( STREAM_SEEK_TO_END ); - BOOL bHTML = GetHTMLStream().Tell() > 0; + sal_Bool bHTML = GetHTMLStream().Tell() > 0; uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 ); SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] ); if ( bHTML ) @@ -159,7 +159,7 @@ uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavo sal_Bool TETextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException) { - ULONG nT = SotExchange::GetFormat( rFlavor ); + sal_uLong nT = SotExchange::GetFormat( rFlavor ); return ( nT == SOT_FORMAT_STRING ); } @@ -186,17 +186,17 @@ struct ImpTextView ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener; - USHORT mnTravelXPos; - - BOOL mbAutoScroll : 1; - BOOL mbInsertMode : 1; - BOOL mbReadOnly : 1; - BOOL mbPaintSelection : 1; - BOOL mbAutoIndent : 1; - BOOL mbHighlightSelection : 1; - BOOL mbCursorEnabled : 1; - BOOL mbClickedInSelection : 1; - BOOL mbSupportProtectAttribute : 1; + sal_uInt16 mnTravelXPos; + + sal_Bool mbAutoScroll : 1; + sal_Bool mbInsertMode : 1; + sal_Bool mbReadOnly : 1; + sal_Bool mbPaintSelection : 1; + sal_Bool mbAutoIndent : 1; + sal_Bool mbHighlightSelection : 1; + sal_Bool mbCursorEnabled : 1; + sal_Bool mbClickedInSelection : 1; + sal_Bool mbSupportProtectAttribute : 1; bool mbCursorAtEndOfLine; }; @@ -206,30 +206,30 @@ struct ImpTextView TextView::TextView( TextEngine* pEng, Window* pWindow ) : mpImpl(new ImpTextView) { - pWindow->EnableRTL( FALSE ); + pWindow->EnableRTL( sal_False ); mpImpl->mpWindow = pWindow; mpImpl->mpTextEngine = pEng; mpImpl->mpVirtDev = NULL; - mpImpl->mbPaintSelection = TRUE; - mpImpl->mbAutoScroll = TRUE; - mpImpl->mbInsertMode = TRUE; - mpImpl->mbReadOnly = FALSE; - mpImpl->mbHighlightSelection = FALSE; - mpImpl->mbAutoIndent = FALSE; - mpImpl->mbCursorEnabled = TRUE; - mpImpl->mbClickedInSelection = FALSE; - mpImpl->mbSupportProtectAttribute = FALSE; + mpImpl->mbPaintSelection = sal_True; + mpImpl->mbAutoScroll = sal_True; + mpImpl->mbInsertMode = sal_True; + mpImpl->mbReadOnly = sal_False; + mpImpl->mbHighlightSelection = sal_False; + mpImpl->mbAutoIndent = sal_False; + mpImpl->mbCursorEnabled = sal_True; + mpImpl->mbClickedInSelection = sal_False; + mpImpl->mbSupportProtectAttribute = sal_False; mpImpl->mbCursorAtEndOfLine = false; -// mbInSelection = FALSE; +// mbInSelection = sal_False; mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW; mpImpl->mpSelFuncSet = new TextSelFunctionSet( this ); mpImpl->mpSelEngine = new SelectionEngine( mpImpl->mpWindow, mpImpl->mpSelFuncSet ); mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION ); - mpImpl->mpSelEngine->EnableDrag( TRUE ); + mpImpl->mpSelEngine->EnableDrag( sal_True ); mpImpl->mpCursor = new Cursor; mpImpl->mpCursor->Show(); @@ -237,7 +237,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) : pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) ); if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT ) - mpImpl->mbHighlightSelection = TRUE; + mpImpl->mbHighlightSelection = sal_True; pWindow->SetLineColor(); @@ -275,7 +275,7 @@ void TextView::Invalidate() mpImpl->mpWindow->Invalidate(); } -void TextView::SetSelection( const TextSelection& rTextSel, BOOL bGotoCursor ) +void TextView::SetSelection( const TextSelection& rTextSel, sal_Bool bGotoCursor ) { // Falls jemand gerade ein leeres Attribut hinterlassen hat, // und dann der Outliner die Selektion manipulitert: @@ -345,10 +345,10 @@ void TextView::ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle c void TextView::Paint( const Rectangle& rRect ) { - ImpPaint( rRect, FALSE ); + ImpPaint( rRect, sal_False ); } -void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev ) +void TextView::ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev ) { if ( !mpImpl->mpTextEngine->GetUpdateMode() || mpImpl->mpTextEngine->IsInUndo() ) return; @@ -367,7 +367,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev ) if ( pVDev->GetBackground().GetColor() != rBackgroundColor ) pVDev->SetBackground( rBackgroundColor ); - BOOL bVDevValid = TRUE; + sal_Bool bVDevValid = sal_True; Size aOutSz( pVDev->GetOutputSizePixel() ); if ( ( aOutSz.Width() < rRect.GetWidth() ) || ( aOutSz.Height() < rRect.GetHeight() ) ) @@ -390,7 +390,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev ) } if ( !bVDevValid ) { - ImpPaint( rRect, FALSE /* ohne VDev */ ); + ImpPaint( rRect, sal_False /* ohne VDev */ ); return; } @@ -428,27 +428,27 @@ void TextView::ImpHighlight( const TextSelection& rSel ) Rectangle aVisArea( mpImpl->maStartDocPos, mpImpl->mpWindow->GetOutputSizePixel() ); long nY = 0; - ULONG nStartPara = aSel.GetStart().GetPara(); - ULONG nEndPara = aSel.GetEnd().GetPara(); - for ( ULONG nPara = 0; nPara <= nEndPara; nPara++ ) + sal_uLong nStartPara = aSel.GetStart().GetPara(); + sal_uLong nEndPara = aSel.GetEnd().GetPara(); + for ( sal_uLong nPara = 0; nPara <= nEndPara; nPara++ ) { long nParaHeight = (long)mpImpl->mpTextEngine->CalcParaHeight( nPara ); if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) ) { TEParaPortion* pTEParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( nPara ); - USHORT nStartLine = 0; - USHORT nEndLine = pTEParaPortion->GetLines().Count() -1; + sal_uInt16 nStartLine = 0; + sal_uInt16 nEndLine = pTEParaPortion->GetLines().Count() -1; if ( nPara == nStartPara ) - nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), FALSE ); + nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), sal_False ); if ( nPara == nEndPara ) - nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), TRUE ); + nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), sal_True ); // ueber die Zeilen iterieren.... - for ( USHORT nLine = nStartLine; nLine <= nEndLine; nLine++ ) + for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ ) { TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine ); - USHORT nStartIndex = pLine->GetStart(); - USHORT nEndIndex = pLine->GetEnd(); + sal_uInt16 nStartIndex = pLine->GetStart(); + sal_uInt16 nEndIndex = pLine->GetEnd(); if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) ) nStartIndex = aSel.GetStart().GetIndex(); if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) ) @@ -458,12 +458,12 @@ void TextView::ImpHighlight( const TextSelection& rSel ) if ( nEndIndex < nStartIndex ) nEndIndex = nStartIndex; - Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), FALSE ) ); + Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), sal_False ) ); aTmpRec.Top() += nY; aTmpRec.Bottom() += nY; Point aTopLeft( aTmpRec.TopLeft() ); - aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), TRUE ); + aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), sal_True ); aTmpRec.Top() += nY; aTmpRec.Bottom() += nY; Point aBottomRight( aTmpRec.BottomRight() ); @@ -499,20 +499,20 @@ void TextView::ImpSetSelection( const TextSelection& rSelection ) void TextView::ShowSelection() { - ImpShowHideSelection( TRUE ); + ImpShowHideSelection( sal_True ); } void TextView::HideSelection() { - ImpShowHideSelection( FALSE ); + ImpShowHideSelection( sal_False ); } void TextView::ShowSelection( const TextSelection& rRange ) { - ImpShowHideSelection( TRUE, &rRange ); + ImpShowHideSelection( sal_True, &rRange ); } -void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange ) +void TextView::ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange ) { const TextSelection* pRangeOrSelection = pRange ? pRange : &mpImpl->maSelection; @@ -532,7 +532,7 @@ void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange ) Point aStartPos( ImpGetOutputStartPos( mpImpl->maStartDocPos ) ); TextSelection aRange( *pRangeOrSelection ); aRange.Justify(); - BOOL bVisCursor = mpImpl->mpCursor->IsVisible(); + sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible(); mpImpl->mpCursor->Hide(); ImpPaint( mpImpl->mpWindow, aStartPos, &aOutArea, &aRange, bShow ? &mpImpl->maSelection : NULL ); if ( bVisCursor ) @@ -558,24 +558,24 @@ void TextView::EraseVirtualDevice() mpImpl->mpVirtDev = 0; } -BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) +sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent ) { - BOOL bDone = TRUE; - BOOL bModified = FALSE; - BOOL bMoved = FALSE; - BOOL bEndKey = FALSE; // spezielle CursorPosition - BOOL bAllowIdle = TRUE; + sal_Bool bDone = sal_True; + sal_Bool bModified = sal_False; + sal_Bool bMoved = sal_False; + sal_Bool bEndKey = sal_False; // spezielle CursorPosition + sal_Bool bAllowIdle = sal_True; // Um zu pruefen ob durch irgendeine Aktion mModified, das lokale // bModified wird z.B. bei Cut/Paste nicht gesetzt, weil dort an anderen // Stellen das updaten erfolgt. - BOOL bWasModified = mpImpl->mpTextEngine->IsModified(); - mpImpl->mpTextEngine->SetModified( FALSE ); + sal_Bool bWasModified = mpImpl->mpTextEngine->IsModified(); + mpImpl->mpTextEngine->SetModified( sal_False ); TextSelection aCurSel( mpImpl->maSelection ); TextSelection aOldSel( aCurSel ); - USHORT nCode = rKeyEvent.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode(); KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction(); if ( eFunc != KEYFUNC_DONTKNOW ) { @@ -652,12 +652,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) uno::Reference<datatransfer::clipboard::XClipboard> aSelection(GetWindow()->GetPrimarySelection()); Copy( aSelection ); } - bMoved = TRUE; + bMoved = sal_True; if ( nCode == KEY_END ) - bEndKey = TRUE; + bEndKey = sal_True; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_BACKSPACE: @@ -669,8 +669,8 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) { if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod2() ) { - BYTE nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT; - BYTE nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE; + sal_uInt8 nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT; + sal_uInt8 nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE; if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() ) nMode = DELMODE_RESTOFCONTENT; @@ -718,11 +718,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) } aCurSel = ImpDelete( nDel, nMode ); mpImpl->mpTextEngine->UndoActionEnd(); - bModified = TRUE; - bAllowIdle = FALSE; + bModified = sal_True; + bAllowIdle = sal_False; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_TAB: @@ -732,10 +732,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) ImplCheckTextLen( 'x' ) ) { aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() ); - bModified = TRUE; + bModified = sal_True; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_RETURN: @@ -750,7 +750,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) if ( mpImpl->mbAutoIndent ) { TextNode* pPrev = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aCurSel.GetEnd().GetPara() - 1 ); - USHORT n = 0; + sal_uInt16 n = 0; while ( ( n < pPrev->GetText().Len() ) && ( ( pPrev->GetText().GetChar( n ) == ' ' ) || ( pPrev->GetText().GetChar( n ) == '\t' ) ) ) @@ -761,10 +761,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) ); } mpImpl->mpTextEngine->UndoActionEnd(); - bModified = TRUE; + bModified = sal_True; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_INSERT: @@ -781,11 +781,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) if ( !mpImpl->mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken... { aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), sal_True ); - bModified = TRUE; + bModified = sal_True; } } else - bDone = FALSE; + bDone = sal_False; } } } @@ -809,20 +809,20 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) else if ( bMoved ) { // Selection wird jetzt gezielt in ImpMoveCursor gemalt. - ImpShowCursor( mpImpl->mbAutoScroll, TRUE, bEndKey ); + ImpShowCursor( mpImpl->mbAutoScroll, sal_True, bEndKey ); } if ( mpImpl->mpTextEngine->IsModified() ) mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); else if ( bWasModified ) - mpImpl->mpTextEngine->SetModified( TRUE ); + mpImpl->mpTextEngine->SetModified( sal_True ); return bDone; } void TextView::MouseButtonUp( const MouseEvent& rMouseEvent ) { - mpImpl->mbClickedInSelection = FALSE; + mpImpl->mbClickedInSelection = sal_False; mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW; mpImpl->mpSelEngine->SelMouseButtonUp( rMouseEvent ); if ( rMouseEvent.IsMiddle() && !IsReadOnly() && @@ -876,18 +876,18 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent ) uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True ); TextSelection aNewSel( mpImpl->maSelection ); - aNewSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos; - aNewSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos; + aNewSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos; + aNewSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos; if(mpImpl->mbSupportProtectAttribute) { //expand selection to include all protected content - if there is any const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib( TextPaM(aNewSel.GetStart().GetPara(), - (USHORT)aBoundary.startPos), + (sal_uInt16)aBoundary.startPos), TEXTATTR_PROTECTED ); const TextCharAttrib* pEndAttr = mpImpl->mpTextEngine->FindCharAttrib( TextPaM(aNewSel.GetEnd().GetPara(), - (USHORT)aBoundary.endPos), + (sal_uInt16)aBoundary.endPos), TEXTATTR_PROTECTED ); if(pStartAttr && pStartAttr->GetStart() < aNewSel.GetStart().GetIndex()) { @@ -900,7 +900,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent ) } ImpSetSelection( aNewSel ); ShowSelection(); - ShowCursor( TRUE, TRUE ); + ShowCursor( sal_True, sal_True ); } } else if ( rMouseEvent.GetClicks() == 3 ) @@ -914,7 +914,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent ) aNewSel.GetEnd().GetIndex() = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( mpImpl->maSelection.GetEnd().GetPara() )->GetText().Len(); ImpSetSelection( aNewSel ); ShowSelection(); - ShowCursor( TRUE, TRUE ); + ShowCursor( sal_True, sal_True ); } } } @@ -948,7 +948,7 @@ void TextView::Command( const CommandEvent& rCEvt ) TEParaPortion* pPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetPara() ); pPortion->MarkSelectionInvalid( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex(), 0 ); - BOOL bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite; + sal_Bool bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite; delete mpImpl->mpTextEngine->mpIMEInfos; mpImpl->mpTextEngine->mpIMEInfos = NULL; @@ -977,14 +977,14 @@ void TextView::Command( const CommandEvent& rCEvt ) if ( mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite ) { - USHORT nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen; - USHORT nNewIMETextLen = pData->GetText().Len(); + sal_uInt16 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen; + sal_uInt16 nNewIMETextLen = pData->GetText().Len(); if ( ( nOldIMETextLen > nNewIMETextLen ) && ( nNewIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) ) { // restore old characters - USHORT nRestore = nOldIMETextLen - nNewIMETextLen; + sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen; TextPaM aPaM( mpImpl->mpTextEngine->mpIMEInfos->aPos ); aPaM.GetIndex() = aPaM.GetIndex() + nNewIMETextLen; mpImpl->mpTextEngine->ImpInsertText( aPaM, mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ) ); @@ -993,7 +993,7 @@ void TextView::Command( const CommandEvent& rCEvt ) ( nOldIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) ) { // overwrite - USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen; + sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen; if ( ( nOldIMETextLen + nOverwrite ) > mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) nOverwrite = mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen; DBG_ASSERT( nOverwrite && (nOverwrite < 0xFF00), "IME Overwrite?!" ); @@ -1038,13 +1038,13 @@ void TextView::Command( const CommandEvent& rCEvt ) TextPaM aPaM( GetSelection().GetEnd() ); Rectangle aR1 = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM ); - USHORT nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen; + sal_uInt16 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen; if ( !mpImpl->mpTextEngine->IsFormatted() ) mpImpl->mpTextEngine->FormatDoc(); TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ); + sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ); TextLine* pLine = pParaPortion->GetLines().GetObject( nLine ); if ( pLine && ( nInputEnd > pLine->GetEnd() ) ) nInputEnd = pLine->GetEnd(); @@ -1065,12 +1065,12 @@ void TextView::Command( const CommandEvent& rCEvt ) } } -void TextView::ShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor ) +void TextView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor ) { // Die Einstellung hat mehr Gewicht: if ( !mpImpl->mbAutoScroll ) - bGotoCursor = FALSE; - ImpShowCursor( bGotoCursor, bForceVisCursor, FALSE ); + bGotoCursor = sal_False; + ImpShowCursor( bGotoCursor, bForceVisCursor, sal_False ); } void TextView::HideCursor() @@ -1102,7 +1102,7 @@ void TextView::Scroll( long ndX, long ndY ) if ( nDiffX || nDiffY ) { - BOOL bVisCursor = mpImpl->mpCursor->IsVisible(); + sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible(); mpImpl->mpCursor->Hide(); mpImpl->mpWindow->Update(); mpImpl->maStartDocPos = aNewStartPos; @@ -1146,7 +1146,7 @@ void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxCl TETextDataObject* pDataObj = new TETextDataObject( GetSelected() ); if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML - mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE ); + mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True ); const sal_uInt32 nRef = Application::ReleaseSolarMutex(); @@ -1204,7 +1204,7 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC bool bWasTruncated = false; if( mpImpl->mpTextEngine->GetMaxTextLen() != 0 ) bWasTruncated = ImplTruncateNewText( aText ); - InsertNewText( aText, FALSE ); + InsertNewText( aText, sal_False ); mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); if( bWasTruncated ) @@ -1234,22 +1234,22 @@ String TextView::GetSelected( LineEnd aSeparator ) return mpImpl->mpTextEngine->GetText( mpImpl->maSelection, aSeparator ); } -void TextView::SetInsertMode( BOOL bInsert ) +void TextView::SetInsertMode( sal_Bool bInsert ) { if ( mpImpl->mbInsertMode != bInsert ) { mpImpl->mbInsertMode = bInsert; - ShowCursor( mpImpl->mbAutoScroll, FALSE ); + ShowCursor( mpImpl->mbAutoScroll, sal_False ); } } -void TextView::SetReadOnly( BOOL bReadOnly ) +void TextView::SetReadOnly( sal_Bool bReadOnly ) { if ( mpImpl->mbReadOnly != bReadOnly ) { mpImpl->mbReadOnly = bReadOnly; if ( !mpImpl->mbReadOnly ) - ShowCursor( mpImpl->mbAutoScroll, FALSE ); + ShowCursor( mpImpl->mbAutoScroll, sal_False ); else HideCursor(); @@ -1271,8 +1271,8 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection ); - BOOL bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE; - USHORT nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); + sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False; + sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); bool bSelect = aTranslatedKeyEvent.GetKeyCode().IsShift(); switch ( nCode ) @@ -1289,9 +1289,9 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) break; case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM ); break; - case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); break; - case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); break; case com::sun::star::awt::Key::SELECT_WORD_FORWARD: bSelect = true; // fallthrough intentional @@ -1362,12 +1362,12 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) return mpImpl->maSelection; } -void TextView::InsertText( const XubString& rStr, BOOL bSelect ) +void TextView::InsertText( const XubString& rStr, sal_Bool bSelect ) { InsertNewText( rStr, bSelect ); } -void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect ) +void TextView::InsertNewText( const rtl::OUString& rStr, sal_Bool bSelect ) { // HideSelection(); mpImpl->mpTextEngine->UndoActionStart(); @@ -1411,7 +1411,7 @@ void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect ) } /* -void TextView::InsertText( const XubString& rStr, BOOL bSelect ) +void TextView::InsertText( const XubString& rStr, sal_Bool bSelect ) { // HideSelection(); @@ -1438,22 +1438,22 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect ) */ // OLD -TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode ) +TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode ) { - return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); - // Remove (USHORT) typecasts in this file when removing this method! + // Remove (sal_uInt16) typecasts in this file when removing this method! } // OLD -TextPaM TextView::CursorRight( const TextPaM& rPaM, BOOL bWordMode ) +TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_Bool bWordMode ) { - return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); - // Remove (USHORT) typecasts in this file when removing this method! + // Remove (sal_uInt16) typecasts in this file when removing this method! } -TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode ) +TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { TextPaM aPaM( rPaM ); @@ -1462,7 +1462,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() ); uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); sal_Int32 nCount = 1; - aPaM.GetIndex() = (USHORT)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); + aPaM.GetIndex() = (sal_uInt16)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); } else if ( aPaM.GetPara() ) { @@ -1473,7 +1473,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode return aPaM; } -TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode ) +TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { TextPaM aPaM( rPaM ); @@ -1482,7 +1482,7 @@ TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMod { uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); sal_Int32 nCount = 1; - aPaM.GetIndex() = (USHORT)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); + aPaM.GetIndex() = (sal_uInt16)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); } else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) ) { @@ -1505,7 +1505,7 @@ TextPaM TextView::CursorWordLeft( const TextPaM& rPaM ) i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True ); if ( aBoundary.startPos >= rPaM.GetIndex() ) aBoundary = xBI->previousWord( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (USHORT)aBoundary.startPos : 0; + aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (sal_uInt16)aBoundary.startPos : 0; } else if ( aPaM.GetPara() ) { @@ -1526,7 +1526,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM ) { uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - aPaM.GetIndex() = (USHORT)aBoundary.startPos; + aPaM.GetIndex() = (sal_uInt16)aBoundary.startPos; } else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) ) { @@ -1537,7 +1537,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM ) return aPaM; } -TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) +TextPaM TextView::ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode ) { if ( mpImpl->maSelection.HasRange() ) // dann nur Sel. loeschen return mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection ); @@ -1548,7 +1548,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) { if ( nDelMode == DELMODE_SIMPLE ) { - aEndPaM = CursorLeft( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER ); + aEndPaM = CursorLeft( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER ); } else if ( nDelMode == DELMODE_RESTOFWORD ) { @@ -1558,7 +1558,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) if ( aBoundary.startPos == mpImpl->maSelection.GetEnd().GetIndex() ) aBoundary = xBI->previousWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); // #i63506# startPos is -1 when the paragraph starts with a tab - aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (USHORT)aBoundary.startPos : 0; + aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (sal_uInt16)aBoundary.startPos : 0; } else // DELMODE_RESTOFCONTENT { @@ -1576,14 +1576,14 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) { if ( nDelMode == DELMODE_SIMPLE ) { - aEndPaM = CursorRight( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + aEndPaM = CursorRight( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); } else if ( nDelMode == DELMODE_RESTOFWORD ) { TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() ); uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - aEndPaM.GetIndex() = (USHORT)aBoundary.startPos; + aEndPaM.GetIndex() = (sal_uInt16)aBoundary.startPos; } else // DELMODE_RESTOFCONTENT { @@ -1612,17 +1612,17 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) long nX; if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW ) { - nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left(); - mpImpl->mnTravelXPos = (USHORT)nX+1; + nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left(); + mpImpl->mnTravelXPos = (sal_uInt16)nX+1; } else nX = mpImpl->mnTravelXPos; TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False ); if ( nLine ) // gleicher Absatz { - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX ); + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX ); aPaM.GetIndex() = nCharPos; // Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das // Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang @@ -1635,8 +1635,8 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) { aPaM.GetPara()--; pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nL = pPPortion->GetLines().Count() - 1; - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 ); + sal_uInt16 nL = pPPortion->GetLines().Count() - 1; + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 ); aPaM.GetIndex() = nCharPos; } @@ -1650,17 +1650,17 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) long nX; if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW ) { - nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left(); - mpImpl->mnTravelXPos = (USHORT)nX+1; + nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left(); + mpImpl->mnTravelXPos = (sal_uInt16)nX+1; } else nX = mpImpl->mnTravelXPos; TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False ); if ( nLine < ( pPPortion->GetLines().Count() - 1 ) ) { - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX ); + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX ); aPaM.GetIndex() = nCharPos; // Sonderbehandlung siehe CursorUp... @@ -1672,7 +1672,7 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) { aPaM.GetPara()++; pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 ); + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 ); aPaM.GetIndex() = nCharPos; TextLine* pLine = pPPortion->GetLines().GetObject( 0 ); if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) ) @@ -1687,7 +1687,7 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM ) TextPaM aPaM( rPaM ); TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); aPaM.GetIndex() = pLine->GetStart(); @@ -1699,13 +1699,13 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM ) TextPaM aPaM( rPaM ); TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); aPaM.GetIndex() = pLine->GetEnd(); if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile { - xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((USHORT)(aPaM.GetIndex()-1) ); + xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((sal_uInt16)(aPaM.GetIndex()-1) ); if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().Len() ) ) { // Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn, @@ -1740,7 +1740,7 @@ TextPaM TextView::CursorStartOfDoc() TextPaM TextView::CursorEndOfDoc() { - ULONG nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1; + sal_uLong nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1; TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( nNode ); TextPaM aPaM( nNode, pNode->GetText().Len() ); return aPaM; @@ -1773,11 +1773,11 @@ TextPaM TextView::PageDown( const TextPaM& rPaM ) return aPaM; } -void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpecial ) +void TextView::ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bSpecial ) { if ( mpImpl->mpTextEngine->IsFormatting() ) return; - if ( mpImpl->mpTextEngine->GetUpdateMode() == FALSE ) + if ( mpImpl->mpTextEngine->GetUpdateMode() == sal_False ) return; if ( mpImpl->mpTextEngine->IsInUndo() ) return; @@ -1796,7 +1796,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec { TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); mpImpl->mbCursorAtEndOfLine = - pParaPortion->GetLineNumber( aPaM.GetIndex(), TRUE ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); } if ( !IsInsertMode() && !mpImpl->maSelection.HasRange() ) @@ -1805,12 +1805,12 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec if ( pNode->GetText().Len() && ( aPaM.GetIndex() < pNode->GetText().Len() ) ) { // If we are behind a portion, and the next portion has other direction, we must change position... - aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, FALSE, TRUE ).Left(); + aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, sal_False, sal_True ).Left(); TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nTextPortionStart = 0; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, TRUE ); + sal_uInt16 nTextPortionStart = 0; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, sal_True ); TETextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); if ( pTextPortion->GetKind() == PORTIONKIND_TAB ) { @@ -1822,8 +1822,8 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec } else { - TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); - aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, TRUE ).Left(); + TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); + aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, sal_True ).Left(); } } } @@ -1872,7 +1872,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec } // X kann durch das 'bischen mehr' falsch sein: -// ULONG nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth(); +// sal_uLong nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth(); // if ( !nMaxTextWidth || ( nMaxTextWidth > 0x7FFFFFFF ) ) // nMaxTextWidth = 0x7FFFFFFF; // long nMaxX = (long)nMaxTextWidth - aOutSz.Width(); @@ -1910,7 +1910,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec mpImpl->mpCursor->Show(); } -BOOL TextView::SetCursorAtPoint( const Point& rPosPixel ) +sal_Bool TextView::SetCursorAtPoint( const Point& rPosPixel ) { mpImpl->mpTextEngine->CheckIdleFormatter(); @@ -1936,50 +1936,50 @@ BOOL TextView::SetCursorAtPoint( const Point& rPosPixel ) ShowSelection( aTmpNewSel ); } - BOOL bForceCursor = mpImpl->mpDDInfo ? FALSE : TRUE; // && !mbInSelection - ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, FALSE ); - return TRUE; + sal_Bool bForceCursor = mpImpl->mpDDInfo ? sal_False : sal_True; // && !mbInSelection + ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, sal_False ); + return sal_True; } -BOOL TextView::IsSelectionAtPoint( const Point& rPosPixel ) +sal_Bool TextView::IsSelectionAtPoint( const Point& rPosPixel ) { // if ( !Rectangle( Point(), mpImpl->mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection ) -// return FALSE; +// return sal_False; Point aDocPos = GetDocPos( rPosPixel ); - TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, FALSE ); + TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, sal_False ); // Bei Hyperlinks D&D auch ohne Selektion starten. // BeginDrag wird aber nur gerufen, wenn IsSelectionAtPoint() // Problem: IsSelectionAtPoint wird bei Command() nicht gerufen, - // wenn vorher im MBDown schon FALSE returnt wurde. + // wenn vorher im MBDown schon sal_False returnt wurde. return ( IsInSelection( aPaM ) || ( /* mpImpl->mpSelEngine->IsInCommand() && */ mpImpl->mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ) ) ); } -BOOL TextView::IsInSelection( const TextPaM& rPaM ) +sal_Bool TextView::IsInSelection( const TextPaM& rPaM ) { TextSelection aSel = mpImpl->maSelection; aSel.Justify(); - ULONG nStartNode = aSel.GetStart().GetPara(); - ULONG nEndNode = aSel.GetEnd().GetPara(); - ULONG nCurNode = rPaM.GetPara(); + sal_uLong nStartNode = aSel.GetStart().GetPara(); + sal_uLong nEndNode = aSel.GetEnd().GetPara(); + sal_uLong nCurNode = rPaM.GetPara(); if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) ) - return TRUE; + return sal_True; if ( nStartNode == nEndNode ) { if ( nCurNode == nStartNode ) if ( ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) ) - return TRUE; + return sal_True; } else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) ) - return TRUE; + return sal_True; else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } void TextView::ImpHideDDCursor() @@ -1987,7 +1987,7 @@ void TextView::ImpHideDDCursor() if ( mpImpl->mpDDInfo && mpImpl->mpDDInfo->mbVisCursor ) { mpImpl->mpDDInfo->maCursor.Hide(); - mpImpl->mpDDInfo->mbVisCursor = FALSE; + mpImpl->mpDDInfo->mbVisCursor = sal_False; } } @@ -1995,7 +1995,7 @@ void TextView::ImpShowDDCursor() { if ( !mpImpl->mpDDInfo->mbVisCursor ) { - Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, TRUE ); + Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, sal_True ); aCursor.Right()++; aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) ); @@ -2003,11 +2003,11 @@ void TextView::ImpShowDDCursor() mpImpl->mpDDInfo->maCursor.SetPos( aCursor.TopLeft() ); mpImpl->mpDDInfo->maCursor.SetSize( aCursor.GetSize() ); mpImpl->mpDDInfo->maCursor.Show(); - mpImpl->mpDDInfo->mbVisCursor = TRUE; + mpImpl->mpDDInfo->mbVisCursor = sal_True; } } -void TextView::SetPaintSelection( BOOL bPaint ) +void TextView::SetPaintSelection( sal_Bool bPaint ) { if ( bPaint != mpImpl->mbPaintSelection ) { @@ -2016,7 +2016,7 @@ void TextView::SetPaintSelection( BOOL bPaint ) } } -void TextView::SetHighlightSelection( BOOL bSelectByHighlight ) +void TextView::SetHighlightSelection( sal_Bool bSelectByHighlight ) { if ( bSelectByHighlight != mpImpl->mbHighlightSelection ) { @@ -2025,14 +2025,14 @@ void TextView::SetHighlightSelection( BOOL bSelectByHighlight ) } } -BOOL TextView::Read( SvStream& rInput ) +sal_Bool TextView::Read( SvStream& rInput ) { - BOOL bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection ); + sal_Bool bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection ); ShowCursor(); return bDone; } -BOOL TextView::Write( SvStream& rOutput ) +sal_Bool TextView::Write( SvStream& rOutput ) { return mpImpl->mpTextEngine->Read( rOutput, &mpImpl->maSelection ); } @@ -2047,17 +2047,17 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const bTruncated = true; } - ULONG nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen(); + sal_uLong nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen(); // 0 means unlimited, there is just the String API limit handled above if( nMaxLen != 0 ) { - ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen(); + sal_uLong nCurLen = mpImpl->mpTextEngine->GetTextLen(); sal_uInt32 nNewLen = rNewText.getLength(); if ( nCurLen + nNewLen > nMaxLen ) { // see how much text will be replaced - ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection ); + sal_uLong nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection ); if ( nCurLen + nNewLen - nSelLen > nMaxLen ) { sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen)); @@ -2069,12 +2069,12 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const return bTruncated; } -BOOL TextView::ImplCheckTextLen( const String& rNewText ) +sal_Bool TextView::ImplCheckTextLen( const String& rNewText ) { - BOOL bOK = TRUE; + sal_Bool bOK = sal_True; if ( mpImpl->mpTextEngine->GetMaxTextLen() ) { - ULONG n = mpImpl->mpTextEngine->GetTextLen(); + sal_uLong n = mpImpl->mpTextEngine->GetTextLen(); n += rNewText.Len(); if ( n > mpImpl->mpTextEngine->GetMaxTextLen() ) { @@ -2085,7 +2085,7 @@ BOOL TextView::ImplCheckTextLen( const String& rNewText ) // Beep hat hier eigentlich nichts verloren, sondern lieber ein Hdl, // aber so funktioniert es wenigstens in ME, BasicIDE, SourceView Sound::Beep(); - bOK = FALSE; + bOK = sal_False; } } } @@ -2102,12 +2102,12 @@ void TextView::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd: delete mpImpl->mpDDInfo; mpImpl->mpDDInfo = new TextDDInfo; - mpImpl->mpDDInfo->mbStarterOfDD = TRUE; + mpImpl->mpDDInfo->mbStarterOfDD = sal_True; TETextDataObject* pDataObj = new TETextDataObject( GetSelected() ); if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML - mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE ); + mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True ); /* @@ -2151,7 +2151,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv { vos::OGuard aVclGuard( Application::GetSolarMutex() ); - BOOL bChanges = FALSE; + sal_Bool bChanges = sal_False; if ( !mpImpl->mbReadOnly && mpImpl->mpDDInfo ) { ImpHideDDCursor(); @@ -2159,12 +2159,12 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv // Daten fuer das loeschen nach einem DROP_MOVE: TextSelection aPrevSel( mpImpl->maSelection ); aPrevSel.Justify(); - ULONG nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount(); - USHORT nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ); + sal_uLong nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount(); + sal_uInt16 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ); - BOOL bStarterOfDD = FALSE; - for ( USHORT nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; ) - bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : FALSE; + sal_Bool bStarterOfDD = sal_False; + for ( sal_uInt16 nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; ) + bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : sal_False; HideSelection(); ImpSetSelection( mpImpl->mpDDInfo->maDropPos ); @@ -2198,7 +2198,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv mpImpl->mpTextEngine->SetAttrib( TextAttribProtect(), aTempStart.GetPara(), aTempStart.GetIndex(), - mpImpl->maSelection.GetEnd().GetIndex(), FALSE ); + mpImpl->maSelection.GetEnd().GetIndex(), sal_False ); } if ( aPrevSel.HasRange() && @@ -2210,7 +2210,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv ( ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() ) && ( mpImpl->mpDDInfo->maDropPos.GetIndex() < aPrevSel.GetStart().GetIndex() ) ) ) { - ULONG nNewParasBeforeSelection = + sal_uLong nNewParasBeforeSelection = mpImpl->mpTextEngine->GetParagraphCount() - nPrevParaCount; aPrevSel.GetStart().GetPara() += nNewParasBeforeSelection; @@ -2218,7 +2218,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv if ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() ) { - USHORT nNewChars = + sal_uInt16 nNewChars = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen; aPrevSel.GetStart().GetIndex() = @@ -2380,7 +2380,7 @@ sal_Int32 TextView::GetLineNumberOfCursorInSelection() const { TextPaM aPaM = GetSelection().GetEnd(); TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); if( mpImpl->mbCursorAtEndOfLine ) --nLineNo; } @@ -2411,12 +2411,12 @@ void __EXPORT TextSelFunctionSet::CreateAnchor() mpView->ImpSetSelection( mpView->mpImpl->maSelection.GetEnd() ); } -BOOL __EXPORT TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL ) +sal_Bool __EXPORT TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool ) { return mpView->SetCursorAtPoint( rPointPixel ); } -BOOL __EXPORT TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) +sal_Bool __EXPORT TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) { return mpView->IsSelectionAtPoint( rPointPixel ); } @@ -2439,31 +2439,31 @@ TextEngine* TextView::GetTextEngine() const { return mpImpl->mpTextEngine; } Window* TextView::GetWindow() const { return mpImpl->mpWindow; } -void TextView::EnableCursor( BOOL bEnable ) +void TextView::EnableCursor( sal_Bool bEnable ) { mpImpl->mbCursorEnabled = bEnable; } -BOOL TextView::IsCursorEnabled() const +sal_Bool TextView::IsCursorEnabled() const { return mpImpl->mbCursorEnabled; } void TextView::SetStartDocPos( const Point& rPos ) { mpImpl->maStartDocPos = rPos; } const Point& TextView::GetStartDocPos() const { return mpImpl->maStartDocPos; } -void TextView::SetAutoIndentMode( BOOL bAutoIndent ) +void TextView::SetAutoIndentMode( sal_Bool bAutoIndent ) { mpImpl->mbAutoIndent = bAutoIndent; } -BOOL TextView::IsAutoIndentMode() const +sal_Bool TextView::IsAutoIndentMode() const { return mpImpl->mbAutoIndent; } -BOOL TextView::IsReadOnly() const +sal_Bool TextView::IsReadOnly() const { return mpImpl->mbReadOnly; } -void TextView::SetAutoScroll( BOOL bAutoScroll ) +void TextView::SetAutoScroll( sal_Bool bAutoScroll ) { mpImpl->mbAutoScroll = bAutoScroll; } -BOOL TextView::IsAutoScroll() const +sal_Bool TextView::IsAutoScroll() const { return mpImpl->mbAutoScroll; } -BOOL TextView::IsPaintSelection() const +sal_Bool TextView::IsPaintSelection() const { return mpImpl->mbPaintSelection; } -BOOL TextView::IsHighlightSelection() const +sal_Bool TextView::IsHighlightSelection() const { return mpImpl->mbHighlightSelection; } -BOOL TextView::HasSelection() const +sal_Bool TextView::HasSelection() const { return mpImpl->maSelection.HasRange(); } -BOOL TextView::IsInsertMode() const +sal_Bool TextView::IsInsertMode() const { return mpImpl->mbInsertMode; } void TextView::SupportProtectAttribute(sal_Bool bSupport) { mpImpl->mbSupportProtectAttribute = bSupport;} diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx index 10e05a58676a..0241c7c3cbbc 100644 --- a/svtools/source/edit/xtextedt.cxx +++ b/svtools/source/edit/xtextedt.cxx @@ -52,12 +52,12 @@ ExtTextEngine::~ExtTextEngine() TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const { TextSelection aSel( rCursor ); - USHORT nPos = rCursor.GetIndex(); - ULONG nPara = rCursor.GetPara(); - ULONG nParas = GetParagraphCount(); + sal_uInt16 nPos = rCursor.GetIndex(); + sal_uLong nPara = rCursor.GetPara(); + sal_uLong nParas = GetParagraphCount(); if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) ) { - USHORT nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) ); + sal_uInt16 nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) ); if ( nMatchChar != STRING_NOTFOUND ) { if ( ( nMatchChar % 2 ) == 0 ) @@ -66,8 +66,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const sal_Unicode nSC = maGroupChars.GetChar( nMatchChar ); sal_Unicode nEC = maGroupChars.GetChar( nMatchChar+1 ); - USHORT nCur = nPos+1; - USHORT nLevel = 1; + sal_uInt16 nCur = nPos+1; + sal_uInt16 nLevel = 1; while ( nLevel && ( nPara < nParas ) ) { XubString aStr = GetText( nPara ); @@ -102,8 +102,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const xub_Unicode nEC = maGroupChars.GetChar( nMatchChar ); xub_Unicode nSC = maGroupChars.GetChar( nMatchChar-1 ); - USHORT nCur = rCursor.GetIndex()-1; - USHORT nLevel = 1; + sal_uInt16 nCur = rCursor.GetIndex()-1; + sal_uInt16 nLevel = 1; while ( nLevel ) { if ( GetTextLen( nPara ) ) @@ -148,12 +148,12 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const return aSel; } -BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, BOOL bForward ) +sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, sal_Bool bForward ) { TextSelection aSel( rSel ); aSel.Justify(); - BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); + sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); TextPaM aStartPaM( aSel.GetEnd() ); if ( aSel.HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) ) @@ -162,7 +162,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea } bool bFound = false; - ULONG nStartNode, nEndNode; + sal_uLong nStartNode, nEndNode; if ( bSearchInSelection ) nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara(); @@ -176,13 +176,13 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea utl::TextSearch aSearcher( rSearchOptions ); // ueber die Absaetze iterieren... - for ( ULONG nNode = nStartNode; + for ( sal_uLong nNode = nStartNode; bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode ); bForward ? nNode++ : nNode-- ) { String aText = GetText( nNode ); - USHORT nStartPos = 0; - USHORT nEndPos = aText.Len(); + sal_uInt16 nStartPos = 0; + sal_uInt16 nEndPos = aText.Len(); if ( nNode == nStartNode ) { if ( bForward ) @@ -212,7 +212,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea // Ueber den Absatz selektieren? // Select over the paragraph? // FIXME This should be max long... - if( nEndPos == sal::static_int_cast<USHORT>(-1) ) // USHORT for 0 and -1 ! + if( nEndPos == sal::static_int_cast<sal_uInt16>(-1) ) // sal_uInt16 for 0 and -1 ! { if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() ) { @@ -249,34 +249,34 @@ ExtTextView::~ExtTextView() { } -BOOL ExtTextView::MatchGroup() +sal_Bool ExtTextView::MatchGroup() { TextSelection aTmpSel( GetSelection() ); aTmpSel.Justify(); if ( ( aTmpSel.GetStart().GetPara() != aTmpSel.GetEnd().GetPara() ) || ( ( aTmpSel.GetEnd().GetIndex() - aTmpSel.GetStart().GetIndex() ) > 1 ) ) { - return FALSE; + return sal_False; } TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() ); if ( aMatchSel.HasRange() ) SetSelection( aMatchSel ); - return aMatchSel.HasRange() ? TRUE : FALSE; + return aMatchSel.HasRange() ? sal_True : sal_False; } -BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForward ) +sal_Bool ExtTextView::Search( const util::SearchOptions& rSearchOptions, sal_Bool bForward ) { - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; TextSelection aSel( GetSelection() ); if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchOptions, bForward ) ) { - bFound = TRUE; + bFound = sal_True; // Erstmal den Anfang des Wortes als Selektion einstellen, // damit das ganze Wort in den sichtbaren Bereich kommt. SetSelection( aSel.GetStart() ); - ShowCursor( TRUE, FALSE ); + ShowCursor( sal_True, sal_False ); } else { @@ -289,9 +289,9 @@ BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForwa return bFound; } -USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward ) +sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward ) { - USHORT nFound = 0; + sal_uInt16 nFound = 0; if ( !bAll ) { @@ -316,7 +316,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl // HideSelection(); TextSelection aSel; - BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); + sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); if ( bSearchInSelection ) { aSel = GetSelection(); @@ -325,7 +325,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl TextSelection aSearchSel( aSel ); - BOOL bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE ); + sal_Bool bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True ); if ( bFound ) pTextEngine->UndoActionStart(); while ( bFound ) @@ -335,7 +335,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchOptions.replaceString ); aSel = aSearchSel; aSel.GetStart() = aNewStart; - bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE ); + bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True ); } if ( nFound ) { @@ -347,9 +347,9 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl return nFound; } -BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) +sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; TextSelection aSel = GetSelection(); aSel.Justify(); @@ -357,20 +357,20 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) HideSelection(); GetTextEngine()->UndoActionStart(); - ULONG nStartPara = aSel.GetStart().GetPara(); - ULONG nEndPara = aSel.GetEnd().GetPara(); + sal_uLong nStartPara = aSel.GetStart().GetPara(); + sal_uLong nEndPara = aSel.GetEnd().GetPara(); if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() ) { nEndPara--; // den dann nicht einruecken... } - for ( ULONG nPara = nStartPara; nPara <= nEndPara; nPara++ ) + for ( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ ) { if ( bRight ) { // Tabs hinzufuegen GetTextEngine()->ImpInsertText( TextPaM( nPara, 0 ), '\t' ); - bDone = TRUE; + bDone = sal_True; } else { @@ -381,14 +381,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) ( aText.GetChar( 0 ) == ' ' ) ) ) { GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) ); - bDone = TRUE; + bDone = sal_True; } } } GetTextEngine()->UndoActionEnd(); - BOOL bRange = aSel.HasRange(); + sal_Bool bRange = aSel.HasRange(); if ( bRight ) { aSel.GetStart().GetIndex()++; @@ -409,13 +409,13 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) return bDone; } -BOOL ExtTextView::IndentBlock() +sal_Bool ExtTextView::IndentBlock() { - return ImpIndentBlock( TRUE ); + return ImpIndentBlock( sal_True ); } -BOOL ExtTextView::UnindentBlock() +sal_Bool ExtTextView::UnindentBlock() { - return ImpIndentBlock( FALSE ); + return ImpIndentBlock( sal_False ); } diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index 086f57061d7a..e8f6ffddc352 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -134,9 +134,9 @@ public: ~ImpFilterOutputStream() {} }; -BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj ) +sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj ) { - BOOL bExists = FALSE; + sal_Bool bExists = FALSE; try { @@ -189,11 +189,11 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl ) //-------------------------------------------------------------------------- -BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize ) +BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, sal_uLong nComp, sal_uLong nSize ) { while ( nComp-- >= nSize ) { - ULONG i; + sal_uLong i; for ( i = 0; i < nSize; i++ ) { if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) ) @@ -249,12 +249,12 @@ inline String ImpGetExtension( const String &rPath ) |* *************************************************************************/ -static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest ) +static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest ) { - USHORT i; + sal_uInt16 i; BYTE sFirstBytes[ 256 ]; - ULONG nFirstLong,nSecondLong; - ULONG nStreamPos = rStream.Tell(); + sal_uLong nFirstLong,nSecondLong; + sal_uLong nStreamPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); ULONG nStreamLen = rStream.Tell() - nStreamPos; @@ -277,7 +277,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B { rStream.Read( sFirstBytes, nStreamLen ); - for( i = (USHORT) nStreamLen; i < 256; i++ ) + for( i = (sal_uInt16) nStreamLen; i < 256; i++ ) sFirstBytes[ i ]=0; } @@ -295,7 +295,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B // Folgende Variable ist nur bei bTest==TRUE interessant. Sie // bleibt FALSE, wenn das Format (rFormatExtension) hier noch nicht // einprogrammiert wurde. - BOOL bSomethingTested = FALSE; + sal_Bool bSomethingTested = FALSE; // Nun werden die verschieden Formate ueberprueft. Dabei ist die // Reihenfolge nicht egal. Z.b. koennte eine MET-Datei auch durch @@ -317,9 +317,9 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B { rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStream.Seek( nStreamPos ); - USHORT nFieldSize; + sal_uInt16 nFieldSize; BYTE nMagic; - BOOL bOK=TRUE; + sal_Bool bOK=TRUE; rStream >> nFieldSize >> nMagic; for (i=0; i<3; i++) { if (nFieldSize<6) { bOK=FALSE; break; } @@ -556,7 +556,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 ) { short y1,x1,y2,x2; - bool bdBoxOk = true; + sal_Bool bdBoxOk = sal_True; rStream.Seek( nStreamPos + nOffset); // size of the pict in version 1 pict ( 2bytes) : ignored @@ -569,7 +569,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if (x1 > x2 || y1 > y2 || // bad bdbox (x1 == x2 && y1 == y2) || // 1 pixel picture x2-x1 > 2048 || y2-y1 > 2048 ) // picture anormaly big - bdBoxOk = false; + bdBoxOk = sal_False; // read version op rStream.Read( sBuf,3 ); @@ -654,7 +654,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- XBM ------------------------------------ if( !bTest ) { - ULONG nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; + sal_uLong nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; BYTE* pBuf = new BYTE [ nSize ]; rStream.Seek( nStreamPos ); @@ -1094,7 +1094,7 @@ void GraphicFilter::ImplInit() // ------------------------------------------------------------------------ -ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm ) +sal_uLong GraphicFilter::ImplSetError( sal_uLong nError, const SvStream* pStm ) { pErrorEx->nFilterError = nError; pErrorEx->nStreamError = pStm ? pStm->GetError() : ERRCODE_NONE; @@ -1102,28 +1102,28 @@ ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm ) } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatCount() +sal_uInt16 GraphicFilter::GetImportFormatCount() { return pConfig->GetImportFormatCount(); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumber( const String& rFormatName ) +sal_uInt16 GraphicFilter::GetImportFormatNumber( const String& rFormatName ) { return pConfig->GetImportFormatNumber( rFormatName ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType ) +sal_uInt16 GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType ) { return pConfig->GetImportFormatNumberForMediaType( rMediaType ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName ) +sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName ) { return pConfig->GetImportFormatNumberForShortName( rShortName ); } @@ -1137,35 +1137,35 @@ sal_uInt16 GraphicFilter::GetImportFormatNumberForTypeName( const String& rType // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatName( USHORT nFormat ) +String GraphicFilter::GetImportFormatName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatTypeName( USHORT nFormat ) +String GraphicFilter::GetImportFormatTypeName( sal_uInt16 nFormat ) { return pConfig->GetImportFilterTypeName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatMediaType( USHORT nFormat ) +String GraphicFilter::GetImportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetImportFormatMediaType( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatShortName( USHORT nFormat ) +String GraphicFilter::GetImportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatShortName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportOSFileType( USHORT ) +String GraphicFilter::GetImportOSFileType( sal_uInt16 ) { String aOSFileType; return aOSFileType; @@ -1173,42 +1173,42 @@ String GraphicFilter::GetImportOSFileType( USHORT ) // ------------------------------------------------------------------------ -String GraphicFilter::GetImportWildcard( USHORT nFormat, sal_Int32 nEntry ) +String GraphicFilter::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetImportWildcard( nFormat, nEntry ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::IsImportPixelFormat( USHORT nFormat ) +sal_Bool GraphicFilter::IsImportPixelFormat( sal_uInt16 nFormat ) { return pConfig->IsImportPixelFormat( nFormat ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatCount() +sal_uInt16 GraphicFilter::GetExportFormatCount() { return pConfig->GetExportFormatCount(); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumber( const String& rFormatName ) +sal_uInt16 GraphicFilter::GetExportFormatNumber( const String& rFormatName ) { return pConfig->GetExportFormatNumber( rFormatName ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType ) +sal_uInt16 GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType ) { return pConfig->GetExportFormatNumberForMediaType( rMediaType ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName ) +sal_uInt16 GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName ) { return pConfig->GetExportFormatNumberForShortName( rShortName ); } @@ -1222,35 +1222,35 @@ sal_uInt16 GraphicFilter::GetExportFormatNumberForTypeName( const String& rType // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatName( USHORT nFormat ) +String GraphicFilter::GetExportFormatName( sal_uInt16 nFormat ) { return pConfig->GetExportFormatName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatTypeName( USHORT nFormat ) +String GraphicFilter::GetExportFormatTypeName( sal_uInt16 nFormat ) { return pConfig->GetExportFilterTypeName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatMediaType( USHORT nFormat ) +String GraphicFilter::GetExportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetExportFormatMediaType( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatShortName( USHORT nFormat ) +String GraphicFilter::GetExportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetExportFormatShortName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportOSFileType( USHORT ) +String GraphicFilter::GetExportOSFileType( sal_uInt16 ) { String aOSFileType; return aOSFileType; @@ -1258,22 +1258,22 @@ String GraphicFilter::GetExportOSFileType( USHORT ) // ------------------------------------------------------------------------ -String GraphicFilter::GetExportWildcard( USHORT nFormat, sal_Int32 nEntry ) +String GraphicFilter::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetExportWildcard( nFormat, nEntry ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::IsExportPixelFormat( USHORT nFormat ) +sal_Bool GraphicFilter::IsExportPixelFormat( sal_uInt16 nFormat ) { return pConfig->IsExportPixelFormat( nFormat ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath, - USHORT nFormat, USHORT* pDeterminedFormat ) +sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); @@ -1290,10 +1290,10 @@ USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath, // ------------------------------------------------------------------------ -USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat ) +sal_uInt16 GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { - ULONG nStreamPos = rIStream.Tell(); + sal_uLong nStreamPos = rIStream.Tell(); sal_uInt16 nRes = ImpTestOrFindFormat( rMainUrl, rIStream, nFormat ); rIStream.Seek(nStreamPos); @@ -1301,13 +1301,13 @@ USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStre if( nRes==GRFILTER_OK && pDeterminedFormat!=NULL ) *pDeterminedFormat = nFormat; - return (USHORT) ImplSetError( nRes, &rIStream ); + return (sal_uInt16) ImplSetError( nRes, &rIStream ); } // ------------------------------------------------------------------------ //SJ: TODO, we need to create a GraphicImporter component -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, - USHORT nFormat, USHORT * pDeterminedFormat, sal_uInt32 nImportFlags ) +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, + sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); @@ -1322,25 +1322,25 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPa return nRetValue; } -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags ) +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags ) { return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL ); } //------------------------------------------------------------------------- -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags, +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData ) { String aFilterName; - ULONG nStmBegin; - USHORT nStatus; + sal_uLong nStmBegin; + sal_uInt16 nStatus; GraphicReader* pContext = rGraphic.GetContext(); GfxLinkType eLinkType = GFX_LINK_TYPE_NONE; - BOOL bDummyContext = ( pContext == (GraphicReader*) 1 ); - const BOOL bLinkSet = rGraphic.IsLink(); + sal_Bool bDummyContext = ( pContext == (GraphicReader*) 1 ); + const sal_Bool bLinkSet = rGraphic.IsLink(); FilterConfigItem* pFilterConfigItem = NULL; Size aPreviewSizeHint( 0, 0 ); @@ -1400,13 +1400,13 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS rGraphic.SetContext( (GraphicReader*) 1 ); rIStream.ResetError(); rIStream.Seek( nStmBegin ); - return (USHORT) ImplSetError( GRFILTER_OK ); + return (sal_uInt16) ImplSetError( GRFILTER_OK ); } rIStream.Seek( nStmBegin ); if( ( nStatus != GRFILTER_OK ) || rIStream.GetError() ) - return (USHORT) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream ); + return (sal_uInt16) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream ); if( pDeterminedFormat ) *pDeterminedFormat = nFormat; @@ -1561,7 +1561,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS else if( aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGF ) || aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGV ) ) { - USHORT nVersion; + sal_uInt16 nVersion; unsigned char nTyp = CheckSgfTyp( rIStream, nVersion ); switch( nTyp ) @@ -1673,8 +1673,8 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS if( nStatus == GRFILTER_OK && bCreateNativeLink && ( eLinkType != GFX_LINK_TYPE_NONE ) && !rGraphic.GetContext() && !bLinkSet ) { - const ULONG nStmEnd = rIStream.Tell(); - const ULONG nBufSize = nStmEnd - nStmBegin; + const sal_uLong nStmEnd = rIStream.Tell(); + const sal_uLong nBufSize = nStmEnd - nStmBegin; if( nBufSize ) { @@ -1715,12 +1715,12 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS // ------------------------------------------------------------------------ -USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, +sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INET_PROT_NOT_VALID" ); - BOOL bAlreadyExists = ImplDirEntryHelper::Exists( rPath ); + sal_Bool bAlreadyExists = ImplDirEntryHelper::Exists( rPath ); String aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_WRITE | STREAM_TRUNC ); @@ -1737,10 +1737,10 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObjec // ------------------------------------------------------------------------ -USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, +sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, SvStream& rOStm, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { - USHORT nFormatCount = GetExportFormatCount(); + sal_uInt16 nFormatCount = GetExportFormatCount(); ResetLastError(); nExpGraphHint = 0; @@ -1751,7 +1751,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat String aExt( aURL.GetFileExtension().toAsciiUpperCase() ); - for( USHORT i = 0; i < nFormatCount; i++ ) + for( sal_uInt16 i = 0; i < nFormatCount; i++ ) { if ( pConfig->GetExportFormatExtension( i ).EqualsIgnoreCaseAscii( aExt ) ) { @@ -1761,13 +1761,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat } } if( nFormat >= nFormatCount ) - return (USHORT) ImplSetError( GRFILTER_FORMATERROR ); + return (sal_uInt16) ImplSetError( GRFILTER_FORMATERROR ); FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData ); String aFilterName( pConfig->GetExportFilterName( nFormat ) ); bAbort = FALSE; - USHORT nStatus = GRFILTER_OK; + sal_uInt16 nStatus = GRFILTER_OK; GraphicType eType; Graphic aGraphic( rGraphic ); @@ -1779,7 +1779,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat if( eType != GRAPHIC_BITMAP ) { Size aSizePixel; - ULONG nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; + sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; VirtualDevice aVirDev; // Maximalen Speicherbedarf fuer das Bildes holen: @@ -1801,14 +1801,14 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat else if (nColorCount<=256) nBitsPerPixel=8; else if (nColorCount<=65536) nBitsPerPixel=16; else nBitsPerPixel=24; - nNeededMem=((ULONG)aSizePixel.Width()*(ULONG)aSizePixel.Height()*nBitsPerPixel+7)/8; + nNeededMem=((sal_uLong)aSizePixel.Width()*(sal_uLong)aSizePixel.Height()*nBitsPerPixel+7)/8; // ggf. Groesse des Bildes einschraenken: if (nMaxMem<nNeededMem) { double fFak=sqrt(((double)nMaxMem)/((double)nNeededMem)); - aSizePixel.Width()=(ULONG)(((double)aSizePixel.Width())*fFak); - aSizePixel.Height()=(ULONG)(((double)aSizePixel.Height())*fFak); + aSizePixel.Width()=(sal_uLong)(((double)aSizePixel.Width())*fFak); + aSizePixel.Height()=(sal_uLong)(((double)aSizePixel.Height())*fFak); } aVirDev.SetMapMode(MapMode(MAP_PIXEL)); @@ -1829,7 +1829,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat { Bitmap aBmp( aGraphic.GetBitmap() ); sal_Int32 nColorRes = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Colors" ) ), 0 ); - if ( nColorRes && ( nColorRes <= (USHORT)BMP_CONVERSION_24BIT) ) + if ( nColorRes && ( nColorRes <= (sal_uInt16)BMP_CONVERSION_24BIT) ) { if( !aBmp.Convert( (BmpConversion) nColorRes ) ) aBmp = aGraphic.GetBitmap(); @@ -1916,7 +1916,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat } else if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) ) { - bool bExportedGrayJPEG = false; + sal_Bool bExportedGrayJPEG = sal_False; if( !ExportJPEG( rOStm, aGraphic, pFilterData, &bExportedGrayJPEG ) ) nStatus = GRFILTER_FORMATERROR; nExpGraphHint = bExportedGrayJPEG ? GRFILTER_OUTHINT_GREY : 0; @@ -1979,7 +1979,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat } else if( aFilterName.EqualsIgnoreCaseAscii( EXP_SVG ) ) { - bool bDone = false; + sal_Bool bDone = sal_False; // do we have a native SVG RenderGraphic, whose data can be written directly? if( ( GRAPHIC_GDIMETAFILE == eType ) && aGraphic.IsRenderGraphic() ) @@ -2080,7 +2080,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat // ------------------------------------------------------------------------ -BOOL GraphicFilter::Setup( USHORT ) +sal_Bool GraphicFilter::Setup( sal_uInt16 ) { return FALSE; } @@ -2089,7 +2089,7 @@ BOOL GraphicFilter::Setup( USHORT ) No Import filter has a dialog, so the following two methods are obsolete */ -BOOL GraphicFilter::HasImportDialog( USHORT ) +sal_Bool GraphicFilter::HasImportDialog( sal_uInt16 ) { return sal_True; // return pConfig->IsImportDialog( nFormat ); @@ -2097,26 +2097,26 @@ BOOL GraphicFilter::HasImportDialog( USHORT ) // ------------------------------------------------------------------------ -BOOL GraphicFilter::DoImportDialog( Window*, USHORT ) +sal_Bool GraphicFilter::DoImportDialog( Window*, sal_uInt16 ) { return sal_True; } // ------------------------------------------------------------------------ -BOOL GraphicFilter::HasExportDialog( USHORT nFormat ) +sal_Bool GraphicFilter::HasExportDialog( sal_uInt16 nFormat ) { return pConfig->IsExportDialog( nFormat ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat ) +sal_Bool GraphicFilter::DoExportDialog( Window* pWindow, sal_uInt16 nFormat ) { return DoExportDialog( pWindow, nFormat, FUNIT_MM ); } -BOOL GraphicFilter::DoExportDialog( Window*, USHORT nFormat, FieldUnit ) +sal_Bool GraphicFilter::DoExportDialog( Window*, sal_uInt16 nFormat, FieldUnit ) { sal_Bool bRet = sal_False; com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > @@ -2174,7 +2174,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData ) if( pData ) { - USHORT nFormat = GRFILTER_FORMAT_DONTKNOW; + sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW; ByteString aShortName; switch( pData->mnFormat ) { @@ -2223,12 +2223,12 @@ GraphicFilter* GraphicFilter::GetGraphicFilter() int GraphicFilter::LoadGraphic( const String &rPath, const String &rFilterName, Graphic& rGraphic, GraphicFilter* pFilter, - USHORT* pDeterminedFormat ) + sal_uInt16* pDeterminedFormat ) { if ( !pFilter ) pFilter = GetGraphicFilter(); - const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() + const sal_uInt16 nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() ? pFilter->GetImportFormatNumber( rFilterName ) : GRFILTER_FORMAT_DONTKNOW; diff --git a/svtools/source/filter/filter2.cxx b/svtools/source/filter/filter2.cxx index 15bdc5c5d080..9bf651790003 100644 --- a/svtools/source/filter/filter2.cxx +++ b/svtools/source/filter/filter2.cxx @@ -40,7 +40,7 @@ #define DATA_SIZE 640 -BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG ); +BYTE* ImplSearchEntry( BYTE* , BYTE* , sal_uLong , sal_uLong ); /************************************************************************* |* @@ -51,7 +51,7 @@ BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG ); GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ), aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ), - bOwnStream( TRUE ) + bOwnStream( sal_True ) { ImpConstruct(); } @@ -64,7 +64,7 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) : pFileStm ( &rInStream ), - bOwnStream ( FALSE ) + bOwnStream ( sal_False ) { ImpConstruct(); @@ -93,9 +93,9 @@ GraphicDescriptor::~GraphicDescriptor() |* \************************************************************************/ -BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( pFileStm && !pFileStm->GetError() ) { SvStream& rStm = *pFileStm; @@ -143,7 +143,7 @@ void GraphicDescriptor::ImpConstruct() nFormat = GFF_NOT; nBitsPerPixel = 0; nPlanes = 0; - bCompressed = FALSE; + bCompressed = sal_False; } @@ -153,10 +153,10 @@ void GraphicDescriptor::ImpConstruct() |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo ) { UINT16 nTemp16; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -219,7 +219,7 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) ) { nFormat = GFF_NOT; - bRet = FALSE; + bRet = sal_False; } } } @@ -234,11 +234,11 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo ) { UINT32 n32; UINT16 n16; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; BYTE cByte; sal_Int32 nStmPos = rStm.Tell(); @@ -308,10 +308,10 @@ sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) return nByte; } -BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo ) { UINT32 nTemp32; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); @@ -474,9 +474,9 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -508,7 +508,7 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo ) { // ! Because 0x0a can be interpreted as LF too ... // we cant be shure that this special sign represent a PCX file only. @@ -516,7 +516,7 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) // We must detect the whole header. bExtendedInfo = TRUE; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; BYTE cByte; sal_Int32 nStmPos = rStm.Tell(); @@ -531,12 +531,12 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) if ( bExtendedInfo ) { UINT16 nTemp16; - USHORT nXmin; - USHORT nXmax; - USHORT nYmin; - USHORT nYmax; - USHORT nDPIx; - USHORT nDPIy; + sal_uInt16 nXmin; + sal_uInt16 nXmax; + sal_uInt16 nYmin; + sal_uInt16 nYmax; + sal_uInt16 nDPIx; + sal_uInt16 nDPIy; rStm.SeekRel( 1 ); @@ -597,10 +597,10 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo ) { UINT32 nTemp32; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); @@ -612,7 +612,7 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp32 == 0x0d0a1a0a ) { nFormat = GFF_PNG; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { @@ -636,7 +636,7 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) // Planes immer 1; // Kompression immer nPlanes = 1; - bCompressed = TRUE; + bCompressed = sal_True; UINT32 nLen32; @@ -655,8 +655,8 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp32 == 0x70485973 ) { - ULONG nXRes; - ULONG nYRes; + sal_uLong nXRes; + sal_uLong nYRes; // horizontale Aufloesung rStm >> nTemp32; @@ -694,10 +694,10 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bDetectOk = FALSE; - BOOL bRet = FALSE; + sal_Bool bDetectOk = sal_False; + sal_Bool bRet = sal_False; BYTE cByte1; BYTE cByte2; @@ -709,12 +709,12 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte1 == 0x49 ) { rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - bDetectOk = TRUE; + bDetectOk = sal_True; } else if ( cByte1 == 0x4d ) { rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - bDetectOk = TRUE; + bDetectOk = sal_True; } if ( bDetectOk ) @@ -725,14 +725,14 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp16 == 0x2a ) { nFormat = GFF_TIF; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - ULONG nCount; - ULONG nMax = DATA_SIZE - 48; + sal_uLong nCount; + sal_uLong nMax = DATA_SIZE - 48; UINT32 nTemp32; - BOOL bOk = FALSE; + sal_Bool bOk = sal_False; // Offset des ersten IFD einlesen rStm >> nTemp32; @@ -832,9 +832,9 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectXBM( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_XBM; @@ -848,9 +848,9 @@ BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectXPM( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_XPM; @@ -863,22 +863,22 @@ BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // erst auf Datei Extension pruefen, da diese aussagekraeftiger ist // als die 2 ID Bytes if ( aPathExt.CompareToAscii( "pbm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { sal_Int32 nStmPos = rStm.Tell(); BYTE nFirst, nSecond; rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -894,19 +894,19 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( aPathExt.CompareToAscii( "pgm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { BYTE nFirst, nSecond; sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -922,19 +922,19 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( aPathExt.CompareToAscii( "ppm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { BYTE nFirst, nSecond; sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -950,17 +950,17 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool ) { UINT32 nMagicNumber; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x59a66a95 ) { nFormat = GFF_RAS; - bRet = TRUE; + bRet = sal_True; } rStm.Seek( nStmPos ); return bRet; @@ -972,9 +972,9 @@ BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectTGA( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_TGA; @@ -987,9 +987,9 @@ BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; UINT32 nMagicNumber; sal_Int32 nStmPos = rStm.Tell(); @@ -1001,7 +1001,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) rStm >> nVersion; if ( nVersion == 1 ) { - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { UINT16 nChannels; @@ -1025,11 +1025,11 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) aPixSize.Height() = nRows; break; default: - bRet = FALSE; + bRet = sal_False; } } else - bRet = FALSE; + bRet = sal_False; } } } @@ -1046,14 +1046,14 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool ) { // es wird die EPS mit Vorschaubild Variante und die Extensionuebereinstimmung // geprueft sal_uInt32 nFirstLong; sal_uInt8 nFirstBytes[20]; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); @@ -1066,7 +1066,7 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) && ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { nFormat = GFF_EPS; - bRet = TRUE; + bRet = sal_True; } rStm.Seek( nStmPos ); return bRet; @@ -1078,9 +1078,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectDXF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_DXF; @@ -1093,9 +1093,9 @@ BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectMET( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_MET; @@ -1109,9 +1109,9 @@ BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_PCT; else @@ -1128,7 +1128,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) if ( ( sBuf[0] == 0x00 ) && ( sBuf[1] == 0x11 ) && ( ( sBuf[2] == 0x01 ) || ( sBuf[2] == 0x02 ) ) ) { - bRet = TRUE; + bRet = sal_True; nFormat = GFF_PCT; } } @@ -1145,11 +1145,11 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { sal_Int32 nStmPos = rStm.Tell(); @@ -1159,7 +1159,7 @@ BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) rStm >> nFirst >> nSecond; if( nFirst == 'J' && nSecond == 'J' ) - bRet = TRUE; + bRet = sal_True; rStm.Seek( nStmPos ); } @@ -1177,9 +1177,9 @@ BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectSGV( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_SGV; @@ -1193,10 +1193,10 @@ BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo ) { UINT32 n32; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; BYTE cByte; sal_Int32 nStmPos = rStm.Tell(); @@ -1208,7 +1208,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte == 0x49 ) { nFormat = GFF_SVM; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { @@ -1247,7 +1247,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) if( nTmp16 == 0x4654 ) { nFormat = GFF_SVM; - bRet = TRUE; + bRet = sal_True; if( bExtendedInfo ) { @@ -1272,9 +1272,9 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectWMF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_WMF; @@ -1287,9 +1287,9 @@ BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectEMF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_EMF; @@ -1302,9 +1302,9 @@ BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSVG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectSVG( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bRet = aPathExt.CompareToAscii( "svg", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "svg", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_SVG; diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index b82f4c8eb4aa..395d3dfea0de 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -458,7 +458,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** case( UNOGRAPHIC_BITSPERPIXEL ): { - USHORT nBitsPerPixel = 0; + sal_uInt16 nBitsPerPixel = 0; if( mpGraphic ) { diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx index 8f1e730b1bbc..2a8c06723eb6 100644 --- a/svtools/source/graphic/descriptor.hxx +++ b/svtools/source/graphic/descriptor.hxx @@ -123,7 +123,7 @@ private: ::rtl::OUString maMimeType; Size maSizePixel; Size maSize100thMM; - USHORT mnBitsPerPixel; + sal_uInt16 mnBitsPerPixel; bool mbTransparent; bool mbAlpha; bool mbAnimated; diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx index 757be42a104c..68c0ea9ae4a7 100644 --- a/svtools/source/graphic/grfattr.cxx +++ b/svtools/source/graphic/grfattr.cxx @@ -48,7 +48,7 @@ GraphicAttr::GraphicAttr() : mnRPercent ( 0 ), mnGPercent ( 0 ), mnBPercent ( 0 ), - mbInvert ( FALSE ), + mbInvert ( sal_False ), mcTransparency ( 0 ), meDrawMode ( GRAPHICDRAWMODE_STANDARD ) { @@ -62,7 +62,7 @@ GraphicAttr::~GraphicAttr() // ------------------------------------------------------------------------ -BOOL GraphicAttr::operator==( const GraphicAttr& rAttr ) const +sal_Bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const { return( ( mfGamma == rAttr.mfGamma ) && ( mnMirrFlags == rAttr.mnMirrFlags ) && @@ -87,7 +87,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr ) { VersionCompat aCompat( rIStm, STREAM_READ ); sal_uInt32 nTmp32; - UINT16 nTmp16; + sal_uInt16 nTmp16; rIStm >> nTmp32 >> nTmp32 >> rAttr.mfGamma >> rAttr.mnMirrFlags >> rAttr.mnRotate10; rIStm >> rAttr.mnContPercent >> rAttr.mnLumPercent >> rAttr.mnRPercent >> rAttr.mnGPercent >> rAttr.mnBPercent; @@ -111,7 +111,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr ) rOStm << nTmp32 << nTmp32 << rAttr.mfGamma << rAttr.mnMirrFlags << rAttr.mnRotate10; rOStm << rAttr.mnContPercent << rAttr.mnLumPercent << rAttr.mnRPercent << rAttr.mnGPercent << rAttr.mnBPercent; - rOStm << rAttr.mbInvert << rAttr.mcTransparency << (UINT16) rAttr.meDrawMode; + rOStm << rAttr.mbInvert << rAttr.mcTransparency << (sal_uInt16) rAttr.meDrawMode; rOStm << rAttr.mnLeftCrop << rAttr.mnTopCrop << rAttr.mnRightCrop << rAttr.mnBottomCrop; return rOStm; diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 41240c95d113..cd8125a6cc79 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -70,14 +70,14 @@ public: GraphicID( const GraphicObject& rObj ); ~GraphicID() {} - BOOL operator==( const GraphicID& rID ) const + sal_Bool operator==( const GraphicID& rID ) const { return( rID.mnID1 == mnID1 && rID.mnID2 == mnID2 && rID.mnID3 == mnID3 && rID.mnID4 == mnID4 ); } ByteString GetIDString() const; - BOOL IsEmpty() const { return( 0 == mnID4 ); } + sal_Bool IsEmpty() const { return( 0 == mnID4 ); } }; // ----------------------------------------------------------------------------- @@ -86,7 +86,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) { const Graphic& rGraphic = rObj.GetGraphic(); - mnID1 = ( (ULONG) rGraphic.GetType() ) << 28; + mnID1 = ( (sal_uLong) rGraphic.GetType() ) << 28; switch( rGraphic.GetType() ) { @@ -105,7 +105,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) { const BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - mnID1 |= ( ( ( (ULONG) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff ); + mnID1 |= ( ( ( (sal_uLong) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff ); mnID2 = aBmpEx.GetSizePixel().Width(); mnID3 = aBmpEx.GetSizePixel().Height(); mnID4 = rGraphic.GetChecksum(); @@ -167,10 +167,10 @@ private: BitmapEx* mpBmpEx; GDIMetaFile* mpMtf; Animation* mpAnimation; - BOOL mbSwappedAll; + sal_Bool mbSwappedAll; - BOOL ImplInit( const GraphicObject& rObj ); - BOOL ImplMatches( const GraphicObject& rObj ) const { return( GraphicID( rObj ) == maID ); } + sal_Bool ImplInit( const GraphicObject& rObj ); + sal_Bool ImplMatches( const GraphicObject& rObj ) const { return( GraphicID( rObj ) == maID ); } void ImplFillSubstitute( Graphic& rSubstitute ); public: @@ -181,13 +181,13 @@ public: const GraphicID& GetID() const { return maID; } void AddGraphicObjectReference( const GraphicObject& rObj, Graphic& rSubstitute ); - BOOL ReleaseGraphicObjectReference( const GraphicObject& rObj ); - ULONG GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); } - BOOL HasGraphicObjectReference( const GraphicObject& rObj ); + sal_Bool ReleaseGraphicObjectReference( const GraphicObject& rObj ); + sal_uLong GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); } + sal_Bool HasGraphicObjectReference( const GraphicObject& rObj ); void TryToSwapIn(); void GraphicObjectWasSwappedOut( const GraphicObject& rObj ); - BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); + sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); void GraphicObjectWasSwappedIn( const GraphicObject& rObj ); }; @@ -216,9 +216,9 @@ GraphicCacheEntry::~GraphicCacheEntry() // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) +sal_Bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) { - BOOL bRet; + sal_Bool bRet; if( !rObj.IsSwappedOut() ) { @@ -260,10 +260,10 @@ BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) else maGfxLink = GfxLink(); - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -277,9 +277,9 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() ); const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() ); const String aDocFileName( rSubstitute.GetDocFileName() ); - const ULONG nDocFilePos = rSubstitute.GetDocFilePos(); + const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos(); const GraphicType eOldType = rSubstitute.GetType(); - const BOOL bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); + const sal_Bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); if( rSubstitute.IsLink() && ( GFX_LINK_TYPE_NONE == maGfxLink.GetType() ) ) maGfxLink = rSubstitute.GetLink(); @@ -321,16 +321,16 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) +sal_Bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() ) { if( &rObj == (GraphicObject*) pObj ) { maGraphicObjectList.Remove( pObj ); - bRet = TRUE; + bRet = sal_True; } } @@ -339,13 +339,13 @@ BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj ) +sal_Bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() ) if( &rObj == (GraphicObject*) pObj ) - bRet = TRUE; + bRet = sal_True; return bRet; } @@ -362,11 +362,11 @@ void GraphicCacheEntry::TryToSwapIn() void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*/ ) { - mbSwappedAll = TRUE; + mbSwappedAll = sal_True; for( void* pObj = maGraphicObjectList.First(); mbSwappedAll && pObj; pObj = maGraphicObjectList.Next() ) if( !( (GraphicObject*) pObj )->IsSwappedOut() ) - mbSwappedAll = FALSE; + mbSwappedAll = sal_False; if( mbSwappedAll ) { @@ -378,17 +378,17 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj* // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +sal_Bool GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { - BOOL bRet; + sal_Bool bRet; if( !mbSwappedAll && rObj.IsSwappedOut() ) { ImplFillSubstitute( rSubstitute ); - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -415,13 +415,13 @@ private: BitmapEx* mpBmpEx; GraphicAttr maAttr; Size maOutSizePix; - ULONG mnCacheSize; - ULONG mnOutDevDrawMode; - USHORT mnOutDevBitCount; + sal_uLong mnCacheSize; + sal_uLong mnOutDevDrawMode; + sal_uInt16 mnOutDevBitCount; public: - static ULONG GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz, + static sal_uLong GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ); public: @@ -457,15 +457,15 @@ public: const GraphicAttr& GetAttr() const { return maAttr; } const Size& GetOutputSizePixel() const { return maOutSizePix; } - ULONG GetCacheSize() const { return mnCacheSize; } + sal_uLong GetCacheSize() const { return mnCacheSize; } const GraphicCacheEntry* GetReferencedCacheEntry() const { return mpRefCacheEntry; } - ULONG GetOutDevDrawMode() const { return mnOutDevDrawMode; } - USHORT GetOutDevBitCount() const { return mnOutDevBitCount; } + sal_uLong GetOutDevDrawMode() const { return mnOutDevDrawMode; } + sal_uInt16 GetOutDevBitCount() const { return mnOutDevBitCount; } void SetReleaseTime( const ::vos::TTimeValue& rReleaseTime ) { maReleaseTime = rReleaseTime; } const ::vos::TTimeValue& GetReleaseTime() const { return maReleaseTime; } - BOOL Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel, + sal_Bool Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel, const GraphicCacheEntry* pCacheEntry, const GraphicAttr& rAttr ) const { // #i46805# Additional match @@ -486,12 +486,12 @@ public: // ----------------------------------------------------------------------------- -ULONG GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz, +sal_uLong GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) { const Graphic& rGraphic = rObj.GetGraphic(); const GraphicType eType = rGraphic.GetType(); - ULONG nNeededSize; + sal_uLong nNeededSize; if( GRAPHIC_BITMAP == eType ) { @@ -560,7 +560,7 @@ void GraphicDisplayCacheEntry::Draw( OutputDevice* pOut, const Point& rPt, const // - GraphicCache - // ----------------------- -GraphicCache::GraphicCache( GraphicManager& rMgr, ULONG nDisplayCacheSize, ULONG nMaxObjDisplayCacheSize ) : +GraphicCache::GraphicCache( GraphicManager& rMgr, sal_uLong nDisplayCacheSize, sal_uLong nMaxObjDisplayCacheSize ) : mrMgr ( rMgr ), mnReleaseTimeoutSeconds ( 0UL ), mnMaxDisplaySize ( nDisplayCacheSize ), @@ -585,7 +585,7 @@ GraphicCache::~GraphicCache() void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute, const ByteString* pID, const GraphicObject* pCopyObj ) { - BOOL bInserted = FALSE; + sal_Bool bInserted = sal_False; if( !rObj.IsSwappedOut() && ( pID || ( pCopyObj && ( pCopyObj->GetType() != GRAPHIC_NONE ) ) || ( rObj.GetType() != GRAPHIC_NONE ) ) ) @@ -599,7 +599,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( pEntry->HasGraphicObjectReference( *pCopyObj ) ) { pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + bInserted = sal_True; } else { @@ -640,14 +640,14 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( rID.GetIDString() == *pID ) { pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + bInserted = sal_True; } } if( !bInserted ) { maGraphicCache.Insert( new GraphicCacheEntry( rObj ), LIST_APPEND ); - bInserted = TRUE; + bInserted = sal_True; } } } @@ -656,7 +656,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( rEntryID == *apID ) { pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + bInserted = sal_True; } } @@ -676,7 +676,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj ) { // Release cached object GraphicCacheEntry* pEntry = (GraphicCacheEntry*) maGraphicCache.First(); - BOOL bRemoved = FALSE; + sal_Bool bRemoved = sal_False; while( !bRemoved && pEntry ) { @@ -729,12 +729,12 @@ void GraphicCache::GraphicObjectWasSwappedOut( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -BOOL GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +sal_Bool GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { GraphicCacheEntry* pEntry = ImplGetCacheEntry( rObj ); if( !pEntry ) - return FALSE; + return sal_False; return pEntry->FillSwappedGraphicObject( rObj, rSubstitute ); } @@ -759,7 +759,7 @@ void GraphicCache::GraphicObjectWasSwappedIn( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize ) +void GraphicCache::SetMaxDisplayCacheSize( sal_uLong nNewCacheSize ) { mnMaxDisplaySize = nNewCacheSize; @@ -769,9 +769,9 @@ void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize ) // ----------------------------------------------------------------------------- -void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached ) +void GraphicCache::SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached ) { - const BOOL bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) ); + const sal_Bool bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) ); mnMaxObjDisplaySize = Min( nNewMaxObjSize, mnMaxDisplaySize ); @@ -796,7 +796,7 @@ void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestro // ----------------------------------------------------------------------------- -void GraphicCache::SetCacheTimeout( ULONG nTimeoutSeconds ) +void GraphicCache::SetCacheTimeout( sal_uLong nTimeoutSeconds ) { if( mnReleaseTimeoutSeconds != nTimeoutSeconds ) { @@ -830,7 +830,7 @@ void GraphicCache::ClearDisplayCache() // ----------------------------------------------------------------------------- -BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const { return( GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) <= @@ -839,20 +839,20 @@ BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, con // ----------------------------------------------------------------------------- -BOOL GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const { const Point aPtPixel( pOut->LogicToPixel( rPt ) ); const Size aSzPixel( pOut->LogicToPixel( rSz ) ); const GraphicCacheEntry* pCacheEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj ); //GraphicDisplayCacheEntry* pDisplayEntry = (GraphicDisplayCacheEntry*) ( (GraphicCache*) this )->maDisplayCache.First(); // -Wall removed .... - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; if( pCacheEntry ) { for( long i = 0, nCount = maDisplayCache.Count(); !bFound && ( i < nCount ); i++ ) if( ( (GraphicDisplayCacheEntry*) maDisplayCache.GetObject( i ) )->Matches( pOut, aPtPixel, aSzPixel, pCacheEntry, rAttr ) ) - bFound = TRUE; + bFound = sal_True; } return bFound; @@ -880,12 +880,12 @@ ByteString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const // ----------------------------------------------------------------------------- -BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const BitmapEx& rBmpEx ) { - const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); - BOOL bRet = FALSE; + const sal_uLong nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); + sal_Bool bRet = sal_False; if( nNeededSize <= GetMaxObjDisplayCacheSize() ) { @@ -906,7 +906,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, maDisplayCache.Insert( pNewEntry, LIST_APPEND ); mnUsedDisplaySize += pNewEntry->GetCacheSize(); - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -914,12 +914,12 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const GDIMetaFile& rMtf ) { - const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); - BOOL bRet = FALSE; + const sal_uLong nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); + sal_Bool bRet = sal_False; if( nNeededSize <= GetMaxObjDisplayCacheSize() ) { @@ -940,7 +940,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, maDisplayCache.Insert( pNewEntry, LIST_APPEND ); mnUsedDisplaySize += pNewEntry->GetCacheSize(); - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -948,14 +948,14 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) { const Point aPtPixel( pOut->LogicToPixel( rPt ) ); const Size aSzPixel( pOut->LogicToPixel( rSz ) ); const GraphicCacheEntry* pCacheEntry = ImplGetCacheEntry( rObj ); GraphicDisplayCacheEntry* pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.First(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; while( !bRet && pDisplayCacheEntry ) { @@ -973,7 +973,7 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co } pDisplayCacheEntry->SetReleaseTime( aReleaseTime ); - bRet = TRUE; + bRet = sal_True; } else pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.Next(); @@ -987,9 +987,9 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co // ----------------------------------------------------------------------------- -BOOL GraphicCache::ImplFreeDisplayCacheSpace( ULONG nSizeToFree ) +sal_Bool GraphicCache::ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree ) { - ULONG nFreedSize = 0UL; + sal_uLong nFreedSize = 0UL; if( nSizeToFree ) { diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx index 55309a00827d..0885667aa2b7 100644 --- a/svtools/source/graphic/grfcache.hxx +++ b/svtools/source/graphic/grfcache.hxx @@ -47,12 +47,12 @@ private: Timer maReleaseTimer; List maGraphicCache; List maDisplayCache; - ULONG mnReleaseTimeoutSeconds; - ULONG mnMaxDisplaySize; - ULONG mnMaxObjDisplaySize; - ULONG mnUsedDisplaySize; + sal_uLong mnReleaseTimeoutSeconds; + sal_uLong mnMaxDisplaySize; + sal_uLong mnMaxObjDisplaySize; + sal_uLong mnUsedDisplaySize; - BOOL ImplFreeDisplayCacheSpace( ULONG nSizeToFree ); + sal_Bool ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree ); GraphicCacheEntry* ImplGetCacheEntry( const GraphicObject& rObj ); @@ -61,8 +61,8 @@ private: public: GraphicCache( GraphicManager& rMgr, - ULONG nDisplayCacheSize = 10000000UL, - ULONG nMaxObjDisplayCacheSize = 2400000UL ); + sal_uLong nDisplayCacheSize = 10000000UL, + sal_uLong nMaxObjDisplayCacheSize = 2400000UL ); ~GraphicCache(); public: @@ -72,37 +72,37 @@ public: void ReleaseGraphicObject( const GraphicObject& rObj ); void GraphicObjectWasSwappedOut( const GraphicObject& rObj ); - BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); + sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); void GraphicObjectWasSwappedIn( const GraphicObject& rObj ); ByteString GetUniqueID( const GraphicObject& rObj ) const; public: - void SetMaxDisplayCacheSize( ULONG nNewCacheSize ); - ULONG GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; }; + void SetMaxDisplayCacheSize( sal_uLong nNewCacheSize ); + sal_uLong GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; }; - void SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE ); - ULONG GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; } + void SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached = sal_False ); + sal_uLong GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; } - ULONG GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; } - ULONG GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); } + sal_uLong GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; } + sal_uLong GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); } - void SetCacheTimeout( ULONG nTimeoutSeconds ); - ULONG GetCacheTimeout() const { return mnReleaseTimeoutSeconds; } + void SetCacheTimeout( sal_uLong nTimeoutSeconds ); + sal_uLong GetCacheTimeout() const { return mnReleaseTimeoutSeconds; } void ClearDisplayCache(); - BOOL IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const; - BOOL IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const; - BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const BitmapEx& rBmpEx ); - BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const GDIMetaFile& rMtf ); - BOOL DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ); }; diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 791caa29e421..9241cbd04d51 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -174,9 +174,9 @@ void GraphicObject::ImplConstruct() mpSwapOutTimer = NULL; mpSimpleCache = NULL; mnAnimationLoopCount = 0; - mbAutoSwapped = FALSE; - mbIsInSwapIn = FALSE; - mbIsInSwapOut = FALSE; + mbAutoSwapped = sal_False; + mbIsInSwapIn = sal_False; + mbIsInSwapOut = sal_False; } // ----------------------------------------------------------------------------- @@ -242,13 +242,13 @@ void GraphicObject::ImplAutoSwapIn() if( IsSwappedOut() ) { if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; else { - mbIsInSwapIn = TRUE; + mbIsInSwapIn = sal_True; if( maGraphic.SwapIn() ) - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; else { SvStream* pStream = GetSwapStream(); @@ -291,7 +291,7 @@ void GraphicObject::ImplAutoSwapIn() } } - mbIsInSwapIn = FALSE; + mbIsInSwapIn = sal_False; if( !mbAutoSwapped && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedIn( *this ); @@ -300,15 +300,15 @@ void GraphicObject::ImplAutoSwapIn() } // ----------------------------------------------------------------------------- -BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, - PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const +sal_Bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, + PolyPolygon& rClipPolyPoly, sal_Bool& bRectClipRegion ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( GetType() != GRAPHIC_NONE ) { Polygon aClipPoly( Rectangle( rPt, rSz ) ); - const USHORT nRot10 = pAttr->GetRotation() % 3600; + const sal_uInt16 nRot10 = pAttr->GetRotation() % 3600; const Point aOldOrigin( rPt ); // --> OD 2005-09-30 #i54875# - It's not needed to get the graphic again. // const Graphic& rGraphic = GetGraphic(); @@ -322,10 +322,10 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz if( nRot10 ) { aClipPoly.Rotate( rPt, nRot10 ); - bRectClipRegion = FALSE; + bRectClipRegion = sal_False; } else - bRectClipRegion = TRUE; + bRectClipRegion = sal_True; rClipPolyPoly = aClipPoly; @@ -374,7 +374,7 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz rPt = aOriginPoly[ 0 ]; } - bRet = TRUE; + bRet = sal_True; } } @@ -399,7 +399,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj ) mpLink = rGraphicObj.mpLink ? new String( *rGraphicObj.mpLink ) : NULL; mpUserData = rGraphicObj.mpUserData ? new String( *rGraphicObj.mpUserData ) : NULL; ImplAssignGraphicData(); - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; mpMgr = rGraphicObj.mpMgr; mpMgr->ImplRegisterObj( *this, maGraphic, NULL, &rGraphicObj ); @@ -410,7 +410,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj ) // ----------------------------------------------------------------------------- -BOOL GraphicObject::operator==( const GraphicObject& rGraphicObj ) const +sal_Bool GraphicObject::operator==( const GraphicObject& rGraphicObj ) const { return( ( rGraphicObj.maGraphic == maGraphic ) && ( rGraphicObj.maAttr == maAttr ) && @@ -455,7 +455,7 @@ ByteString GraphicObject::GetUniqueID() const // ----------------------------------------------------------------------------- -ULONG GraphicObject::GetChecksum() const +sal_uLong GraphicObject::GetChecksum() const { return( ( maGraphic.IsSupportedGraphic() && !maGraphic.IsSwapOut() ) ? maGraphic.GetChecksum() : 0 ); } @@ -470,7 +470,7 @@ SvStream* GraphicObject::GetSwapStream() const // ----------------------------------------------------------------------------- // !!! to be removed -ULONG GraphicObject::GetReleaseFromCache() const +sal_uLong GraphicObject::GetReleaseFromCache() const { return 0; } @@ -548,7 +548,7 @@ void GraphicObject::SetSwapStreamHdl() // ----------------------------------------------------------------------------- -void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout ) +void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout ) { delete mpSwapStreamHdl, mpSwapStreamHdl = new Link( rHdl ); @@ -609,10 +609,10 @@ void GraphicObject::SetGraphicManager( const GraphicManager& rMgr ) // ----------------------------------------------------------------------------- -BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr, ULONG nFlags ) const +sal_Bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr, sal_uLong nFlags ) const { - BOOL bRet; + sal_Bool bRet; if( nFlags & GRFMGR_DRAW_CACHED ) { @@ -625,13 +625,13 @@ BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& if ( pAttr->IsCropped() ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; + sal_Bool bRectClip; ImplGetCropParams( pOut, aPt, aSz, pAttr, aClipPolyPoly, bRectClip ); } bRet = mpMgr->IsInCache( pOut, aPt, aSz, *this, ( pAttr ? *pAttr : GetAttr() ) ); } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -660,16 +660,16 @@ List* GraphicObject::GetAnimationInfoList() const // ----------------------------------------------------------------------------- -BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr, ULONG nFlags ) +sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr, sal_uLong nFlags ) { GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() ); Point aPt( rPt ); Size aSz( rSz ); const sal_uInt32 nOldDrawMode = pOut->GetDrawMode(); - BOOL bCropped = aAttr.IsCropped(); - BOOL bCached = FALSE; - BOOL bRet; + sal_Bool bCropped = aAttr.IsCropped(); + sal_Bool bCached = sal_False; + sal_Bool bRet; // #i29534# Provide output rects for PDF writer Rectangle aCropRect; @@ -696,8 +696,8 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, if( bCropped ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; - const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); + sal_Bool bRectClip; + const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); pOut->Push( PUSH_CLIPREGION ); @@ -738,15 +738,15 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, } // --> OD 2010-01-04 #i105243# -BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, +sal_Bool GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, const Point& rPt, const Size& rSz, const GraphicAttr* pGrfAttr, - const ULONG nFlags ) + const sal_uLong nFlags ) { const GraphicAttr aGrfAttr( pGrfAttr ? *pGrfAttr : GetAttr() ); // Notify PDF writer about linked graphic (if any) - bool bWritingPdfLinkedGraphic( false ); + sal_Bool bWritingPdfLinkedGraphic( sal_False ); Point aPt( rPt ); Size aSz( rSz ); Rectangle aCropRect; @@ -768,8 +768,8 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, if( aGrfAttr.IsCropped() ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; - const BOOL bCrop = ImplGetCropParams( &rOutDev, + sal_Bool bRectClip; + const sal_Bool bCrop = ImplGetCropParams( &rOutDev, aPt, aSz, &aGrfAttr, aClipPolyPoly, @@ -784,7 +784,7 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, } } - BOOL bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags ); + sal_Bool bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags ); // Notify PDF writer about linked graphic (if any) if( bWritingPdfLinkedGraphic ) @@ -801,11 +801,11 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, // ----------------------------------------------------------------------------- -BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, - const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D ) +sal_Bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, + const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D ) { if( pOut == NULL || rSize.Width() == 0 || rSize.Height() == 0 ) - return FALSE; + return sal_False; const MapMode aOutMapMode( pOut->GetMapMode() ); const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() ); @@ -825,11 +825,11 @@ BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const // ----------------------------------------------------------------------------- -BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, - long nExtraData, const GraphicAttr* pAttr, ULONG /*nFlags*/, +sal_Bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, + long nExtraData, const GraphicAttr* pAttr, sal_uLong /*nFlags*/, OutputDevice* pFirstFrameOutDev ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; GetGraphic(); @@ -841,13 +841,13 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const { Point aPt( rPt ); Size aSz( rSz ); - BOOL bCropped = aAttr.IsCropped(); + sal_Bool bCropped = aAttr.IsCropped(); if( bCropped ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; - const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); + sal_Bool bRectClip; + const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); pOut->Push( PUSH_CLIPREGION ); @@ -874,7 +874,7 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const if( bCropped ) pOut->Pop(); - bRet = TRUE; + bRet = sal_True; } else bRet = Draw( pOut, rPt, rSz, &aAttr, GRFMGR_DRAW_STANDARD ); @@ -911,7 +911,7 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC mpSwapOutTimer->Stop(); maGraphic = rGraphic; - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; ImplAssignGraphicData(); delete mpLink, mpLink = NULL; delete mpSimpleCache, mpSimpleCache = NULL; @@ -1037,7 +1037,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo // #105641# Also crop animations if( aTransGraphic.IsAnimated() ) { - USHORT nFrame; + sal_uInt16 nFrame; Animation aAnim( aTransGraphic.GetAnimation() ); for( nFrame=0; nFrame<aAnim.Count(); ++nFrame ) @@ -1054,7 +1054,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo // cropping affects this frame, apply it then // do _not_ apply enlargement, this is done below ImplTransformBitmap( aAnimBmp.aBmpEx, rAttr, Size(), Size(), - aCropRectRel, rDestSize, FALSE ); + aCropRectRel, rDestSize, sal_False ); aAnim.Replace( aAnimBmp, nFrame ); } @@ -1101,7 +1101,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo BitmapEx aBmpEx( aTransGraphic.GetBitmapEx() ); ImplTransformBitmap( aBmpEx, rAttr, aCropLeftTop, aCropRightBottom, - aCropRect, rDestSize, TRUE ); + aCropRect, rDestSize, sal_True ); aTransGraphic = aBmpEx; } @@ -1183,9 +1183,9 @@ void GraphicObject::ResetAnimationLoopCount() // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapOut() +sal_Bool GraphicObject::SwapOut() { - BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : FALSE ); + sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : sal_False ); if( bRet && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedOut( *this ); @@ -1195,9 +1195,9 @@ BOOL GraphicObject::SwapOut() // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapOut( SvStream* pOStm ) +sal_Bool GraphicObject::SwapOut( SvStream* pOStm ) { - BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : FALSE ); + sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : sal_False ); if( bRet && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedOut( *this ); @@ -1207,17 +1207,17 @@ BOOL GraphicObject::SwapOut( SvStream* pOStm ) // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapIn() +sal_Bool GraphicObject::SwapIn() { - BOOL bRet; + sal_Bool bRet; if( mbAutoSwapped ) { ImplAutoSwapIn(); - bRet = TRUE; + bRet = sal_True; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) - bRet = TRUE; + bRet = sal_True; else { bRet = maGraphic.SwapIn(); @@ -1234,17 +1234,17 @@ BOOL GraphicObject::SwapIn() // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapIn( SvStream* pIStm ) +sal_Bool GraphicObject::SwapIn( SvStream* pIStm ) { - BOOL bRet; + sal_Bool bRet; if( mbAutoSwapped ) { ImplAutoSwapIn(); - bRet = TRUE; + bRet = sal_True; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) - bRet = TRUE; + bRet = sal_True; else { bRet = maGraphic.SwapIn( pIStm ); @@ -1265,7 +1265,7 @@ void GraphicObject::SetSwapState() { if( !IsSwappedOut() ) { - mbAutoSwapped = TRUE; + mbAutoSwapped = sal_True; if( mpMgr ) mpMgr->ImplGraphicObjectWasSwappedOut( *this ); @@ -1278,7 +1278,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG ) { if( !IsSwappedOut() ) { - mbIsInSwapOut = TRUE; + mbIsInSwapOut = sal_True; SvStream* pStream = GetSwapStream(); @@ -1298,7 +1298,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG ) } } - mbIsInSwapOut = FALSE; + mbIsInSwapOut = sal_False; } if( mpSwapOutTimer ) @@ -1315,7 +1315,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj ) Graphic aGraphic; GraphicAttr aAttr; ByteString aLink; - BOOL bLink; + sal_Bool bLink; rIStm >> aGraphic >> aAttr >> bLink; @@ -1340,7 +1340,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj ) SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj ) { VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); - const BOOL bLink = rGraphicObj.HasLink(); + const sal_Bool bLink = rGraphicObj.HasLink(); rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink; diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 7e459c7f44cf..4a6fb67187bc 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -47,7 +47,7 @@ // ----------- #define MAX_PRINTER_EXT 1024 -#define MAP( cVal0, cVal1, nFrac ) ((BYTE)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L)) +#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L)) #define WATERMARK_LUM_OFFSET 50 #define WATERMARK_CON_OFFSET -70 @@ -113,7 +113,7 @@ BitmapEx muckWithBitmap( const BitmapEx& rBmpEx, // - GraphicManager - // ------------------ -GraphicManager::GraphicManager( ULONG nCacheSize, ULONG nMaxObjCacheSize ) : +GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize ) : mpCache( new GraphicCache( *this, nCacheSize, nMaxObjCacheSize ) ) { } @@ -130,56 +130,56 @@ GraphicManager::~GraphicManager() // ----------------------------------------------------------------------------- -void GraphicManager::SetMaxCacheSize( ULONG nNewCacheSize ) +void GraphicManager::SetMaxCacheSize( sal_uLong nNewCacheSize ) { mpCache->SetMaxDisplayCacheSize( nNewCacheSize ); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetMaxCacheSize() const +sal_uLong GraphicManager::GetMaxCacheSize() const { return mpCache->GetMaxDisplayCacheSize(); } // ----------------------------------------------------------------------------- -void GraphicManager::SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached ) +void GraphicManager::SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached ) { mpCache->SetMaxObjDisplayCacheSize( nNewMaxObjSize, bDestroyGreaterCached ); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetMaxObjCacheSize() const +sal_uLong GraphicManager::GetMaxObjCacheSize() const { return mpCache->GetMaxObjDisplayCacheSize(); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetUsedCacheSize() const +sal_uLong GraphicManager::GetUsedCacheSize() const { return mpCache->GetUsedDisplayCacheSize(); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetFreeCacheSize() const +sal_uLong GraphicManager::GetFreeCacheSize() const { return mpCache->GetFreeDisplayCacheSize(); } // ----------------------------------------------------------------------------- -void GraphicManager::SetCacheTimeout( ULONG nTimeoutSeconds ) +void GraphicManager::SetCacheTimeout( sal_uLong nTimeoutSeconds ) { mpCache->SetCacheTimeout( nTimeoutSeconds ); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetCacheTimeout() const +sal_uLong GraphicManager::GetCacheTimeout() const { return mpCache->GetCacheTimeout(); } @@ -200,7 +200,7 @@ void GraphicManager::ReleaseFromCache( const GraphicObject& /*rObj*/ ) // ----------------------------------------------------------------------------- -BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, +sal_Bool GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const { @@ -209,15 +209,15 @@ BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const ULONG nFlags, BOOL& rCached ) + const sal_uLong nFlags, sal_Bool& rCached ) { Point aPt( rPt ); Size aSz( rSz ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - rCached = FALSE; + rCached = sal_False; if( ( rObj.GetType() == GRAPHIC_BITMAP ) || ( rObj.GetType() == GRAPHIC_GDIMETAFILE ) ) { @@ -235,7 +235,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& if( aGraphic.IsSupportedGraphic() ) { - const USHORT nRot10 = rAttr.GetRotation() % 3600; + const sal_uInt16 nRot10 = rAttr.GetRotation() % 3600; if( nRot10 ) { @@ -250,7 +250,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& aGraphic.Draw( pOut, aPt, aSz ); } - bRet = TRUE; + bRet = sal_True; } if( !bRet ) @@ -259,7 +259,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& if( !mpCache->DrawDisplayCacheObj( pOut, aPt, aSz, rObj, rAttr ) ) bRet = ImplDraw( pOut, aPt, aSz, rObj, rAttr, nFlags, rCached ); else - bRet = rCached = TRUE; + bRet = rCached = sal_True; } } @@ -299,7 +299,7 @@ ByteString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +sal_Bool GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { return( mpCache->FillSwappedGraphicObject( rObj, rSubstitute ) ); } @@ -313,13 +313,13 @@ void GraphicManager::ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, +sal_Bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const ULONG nFlags, BOOL& rCached ) + const sal_uLong nFlags, sal_Bool& rCached ) { const Graphic& rGraphic = rObj.GetGraphic(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( rGraphic.IsSupportedGraphic() && !rGraphic.IsSwapOut() ) { @@ -337,7 +337,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( ImplCreateOutput( pOut, rPt, rSz, aSrcBmpEx, rAttr, nFlags, &aDstBmpEx ) ) { rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx ); - bRet = TRUE; + bRet = sal_True; } } @@ -365,13 +365,13 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( ImplCreateOutput( pOut, rPt, rSz, aContainedBmpEx, rAttr, nFlags, &aDstBmpEx ) ) { rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx ); - bRet = TRUE; + bRet = sal_True; } } else { rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstMtf ); - bRet = TRUE; + bRet = sal_True; } } } @@ -383,7 +383,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( aGraphic.IsSupportedGraphic() ) { aGraphic.Draw( pOut, rPt, rSz ); - bRet = TRUE; + bRet = sal_True; } } } @@ -394,16 +394,16 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, +sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, const BitmapEx& rBmpEx, const GraphicAttr& rAttr, - const ULONG nFlags, BitmapEx* pBmpEx ) + const sal_uLong nFlags, BitmapEx* pBmpEx ) { - USHORT nRot10 = rAttr.GetRotation() % 3600; + sal_uInt16 nRot10 = rAttr.GetRotation() % 3600; Point aOutPtPix; Size aOutSzPix; Size aUnrotatedSzPix( pOut->LogicToPixel( rSz ) ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( nRot10 ) { @@ -438,8 +438,8 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, long* pMapFY = new long[ nNewH ]; long nStartX = -1, nStartY = -1, nEndX = -1, nEndY = -1; long nX, nY, nTmp, nTmpX, nTmpY; - BOOL bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0; - BOOL bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0; + sal_Bool bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0; + sal_Bool bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0; if( nFlags & GRFMGR_DRAW_BILINEAR ) { @@ -541,7 +541,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, // do transformation if( nStartX >= 0L ) { - const BOOL bSimple = ( 1 == nW || 1 == nH ); + const sal_Bool bSimple = ( 1 == nW || 1 == nH ); if( nRot10 ) { @@ -570,7 +570,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, aOutPt = pOut->PixelToLogic( aOutPtPix ); aOutSz = pOut->PixelToLogic( aOutSzPix ); aOutBmpEx = aBmpEx; - bRet = TRUE; + bRet = sal_True; } else { @@ -624,10 +624,10 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, +sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GDIMetaFile& rMtf, const GraphicAttr& rAttr, - const ULONG /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ) + const sal_uLong /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ) { const Size aNewSize( rMtf.GetPrefSize() ); @@ -921,12 +921,12 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, rOutBmpEx = BitmapEx(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, +sal_Bool GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, long nStartX, long nEndX, long nStartY, long nEndY, BitmapEx& rOutBmpEx ) @@ -940,8 +940,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, const long nDstH = nEndY - nStartY + 1L; long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY; long nXDst, nYDst; - BYTE cR0, cG0, cB0, cR1, cG1, cB1; - BOOL bRet = FALSE; + sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1; + sal_Bool bRet = sal_False; DBG_ASSERT( aBmp.GetSizePixel() == rBmpEx.GetSizePixel(), "GraphicManager::ImplCreateScaled(): bmp size inconsistent" ); @@ -1119,7 +1119,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, } aOutBmp.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aBmp.ReleaseAccess( pAcc ); @@ -1127,7 +1127,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, if( bRet && rBmpEx.IsTransparent() ) { - bRet = FALSE; + bRet = sal_False; if( rBmpEx.IsAlpha() ) { @@ -1200,7 +1200,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, } aOutAlpha.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aAlpha.ReleaseAccess( pAcc ); @@ -1279,7 +1279,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, { for( nX = 0L; nX < nDstW; nX++ ) { - if( pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB ) + if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB ) pWAcc->SetPixel( nY, nX, aWB ); else pWAcc->SetPixel( nY, nX, aWW ); @@ -1304,7 +1304,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, delete[] pMapLX; delete[] pMapLY; aOutMsk.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aMsk.ReleaseAccess( pAcc ); @@ -1325,8 +1325,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, - USHORT nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix, +sal_Bool GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, + sal_uInt16 nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix, long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, long nStartX, long nEndX, long nStartY, long nEndY, BitmapEx& rOutBmpEx ) @@ -1349,8 +1349,8 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, long* pCosY = new long[ nDstH ]; long* pSinY = new long[ nDstH ]; long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY, nUnRotX, nUnRotY, nSinY, nCosY; - BYTE cR0, cG0, cB0, cR1, cG1, cB1; - BOOL bRet = FALSE; + sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1; + sal_Bool bRet = sal_False; // create horizontal mapping table for( nX = 0L, nTmpX = aNewBound.Left() + nStartX; nX < nDstW; nX++ ) @@ -1455,7 +1455,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, } aOutBmp.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aBmp.ReleaseAccess( pAcc ); @@ -1464,7 +1464,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, // mask processing if( bRet && ( rBmpEx.IsTransparent() || ( nRot10 != 900 && nRot10 != 1800 && nRot10 != 2700 ) ) ) { - bRet = FALSE; + bRet = sal_False; if( rBmpEx.IsAlpha() ) { @@ -1555,7 +1555,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, } aOutAlpha.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aAlpha.ReleaseAccess( pAcc ); @@ -1628,7 +1628,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, if( pMAcc ) aMsk.ReleaseAccess( pMAcc ); - bRet = TRUE; + bRet = sal_True; } aOutMsk.ReleaseAccess( pWAcc ); @@ -1654,7 +1654,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, // ----------------------------------------------------------------------------- -void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ) +void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags ) { GraphicAttr aAttr( rAttr ); @@ -1702,7 +1702,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO if( ( nAdjustmentFlags & ADJUSTMENT_TRANSPARENCY ) && aAttr.IsTransparent() ) { AlphaMask aAlpha; - BYTE cTrans = aAttr.GetTransparency(); + sal_uInt8 cTrans = aAttr.GetTransparency(); if( !rBmpEx.IsTransparent() ) aAlpha = AlphaMask( rBmpEx.GetSizePixel(), &cTrans ); @@ -1718,7 +1718,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO if( pA ) { - ULONG nTrans = cTrans, nNewTrans; + sal_uLong nTrans = cTrans, nNewTrans; const long nWidth = pA->Width(), nHeight = pA->Height(); if( pA->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) @@ -1730,7 +1730,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO for( long nX = 0; nX < nWidth; nX++ ) { nNewTrans = nTrans + *pAScan; - *pAScan++ = (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ); + *pAScan++ = (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ); } } } @@ -1743,7 +1743,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO for( long nX = 0; nX < nWidth; nX++ ) { nNewTrans = nTrans + pA->GetPixel( nY, nX ).GetIndex(); - aAlphaValue.SetIndex( (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) ); + aAlphaValue.SetIndex( (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) ); pA->SetPixel( nY, nX, aAlphaValue ); } } @@ -1759,7 +1759,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO // ----------------------------------------------------------------------------- -void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ) +void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags ) { GraphicAttr aAttr( rAttr ); @@ -1812,7 +1812,7 @@ void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, UL // ----------------------------------------------------------------------------- -void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ) +void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags ) { GraphicAttr aAttr( rAttr ); @@ -1868,7 +1868,7 @@ void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr void GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GDIMetaFile& rMtf, const GraphicAttr& rAttr ) { - USHORT nRot10 = rAttr.GetRotation() % 3600; + sal_uInt16 nRot10 = rAttr.GetRotation() % 3600; Point aOutPt( rPt ); Size aOutSz( rSz ); @@ -1926,7 +1926,7 @@ struct ImplTileInfo bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, int nNumTilesX, int nNumTilesY, const Size& rTileSizePixel, - const GraphicAttr* pAttr, ULONG nFlags ) + const GraphicAttr* pAttr, sal_uLong nFlags ) { if( nExponent <= 1 ) return false; @@ -1946,8 +1946,8 @@ bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, // #105229# Switch off mapping (converting to logic and back to // pixel might cause roundoff errors) - BOOL bOldMap( rVDev.IsMapModeEnabled() ); - rVDev.EnableMapMode( FALSE ); + sal_Bool bOldMap( rVDev.IsMapModeEnabled() ); + rVDev.EnableMapMode( sal_False ); bool bRet( ImplRenderTileRecursive( rVDev, nExponent, nMSBFactor, nNumTilesX, nNumTilesY, nNumTilesX, nNumTilesY, rTileSizePixel, pAttr, nFlags, aTileInfo ) ); @@ -1970,7 +1970,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent int nNumOrigTilesX, int nNumOrigTilesY, int nRemainderTilesX, int nRemainderTilesY, const Size& rTileSizePixel, const GraphicAttr* pAttr, - ULONG nFlags, ImplTileInfo& rTileInfo ) + sal_uLong nFlags, ImplTileInfo& rTileInfo ) { // gets loaded with our tile bitmap GraphicObject aTmpGraphic; @@ -2145,7 +2145,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent // ----------------------------------------------------------------------------- bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel, - const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D ) + const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D ) { // how many tiles to generate per recursion step enum{ SubdivisionExponent=2 }; @@ -2256,7 +2256,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, int nNumTilesX, int nNumTilesY, - const Size& rTileSizePixel, const GraphicAttr* pAttr, ULONG nFlags ) + const Size& rTileSizePixel, const GraphicAttr* pAttr, sal_uLong nFlags ) { Point aCurrPos( rPosPixel ); Size aTileSizeLogic( rOut.PixelToLogic( rTileSizePixel ) ); @@ -2264,14 +2264,14 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, // #107607# Use logical coordinates for metafile playing, too bool bDrawInPixel( rOut.GetConnectMetaFile() == NULL && GRAPHIC_BITMAP == GetType() ); - BOOL bRet( FALSE ); + sal_Bool bRet( sal_False ); // #105229# Switch off mapping (converting to logic and back to // pixel might cause roundoff errors) - BOOL bOldMap( rOut.IsMapModeEnabled() ); + sal_Bool bOldMap( rOut.IsMapModeEnabled() ); if( bDrawInPixel ) - rOut.EnableMapMode( FALSE ); + rOut.EnableMapMode( sal_False ); for( nY=0; nY < nNumTilesY; ++nY ) { @@ -2310,7 +2310,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx, const Size& rCropRightBottom, const Rectangle& rCropRect, const Size& rDstSize, - BOOL bEnlarge ) const + sal_Bool bEnlarge ) const { // #107947# Extracted from svdograf.cxx @@ -2381,4 +2381,3 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx, } } } - diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index f1674dcd7d4a..5645f7ee9ddf 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -337,7 +337,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const : if( 0 < nImageId ) { - const Image aImage( aImageList.GetImage( sal::static_int_cast< USHORT >(nImageId) ) ); + const Image aImage( aImageList.GetImage( sal::static_int_cast< sal_uInt16 >(nImageId) ) ); aBmpEx = aImage.GetBitmapEx(); } else diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx index 1beae4a54355..65db0f444faa 100644 --- a/svtools/source/hatchwindow/ipwin.cxx +++ b/svtools/source/hatchwindow/ipwin.cxx @@ -43,7 +43,7 @@ SvResizeHelper::SvResizeHelper() : aBorder( 5, 5 ) , nGrab( -1 ) - , bResizeable( TRUE ) + , bResizeable( sal_True ) { } @@ -127,7 +127,7 @@ void SvResizeHelper::Draw( OutputDevice * pDev ) Rectangle aMoveRects[ 4 ]; FillMoveRectsPixel( aMoveRects ); - USHORT i; + sal_uInt16 i; for( i = 0; i < 4; i++ ) pDev->DrawRect( aMoveRects[ i ] ); if( bResizeable ) @@ -151,7 +151,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin ) { Rectangle aMoveRects[ 4 ]; FillMoveRectsPixel( aMoveRects ); - for( USHORT i = 0; i < 4; i++ ) + for( sal_uInt16 i = 0; i < 4; i++ ) pWin->Invalidate( aMoveRects[ i ] ); } @@ -160,7 +160,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin ) |* |* Beschreibung *************************************************************************/ -BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos ) +sal_Bool SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos ) { if( -1 == nGrab ) { @@ -169,10 +169,10 @@ BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos ) { aSelPos = rPos; // Start-Position merken pWin->CaptureMouse(); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } /************************************************************************* @@ -188,14 +188,14 @@ short SvResizeHelper::SelectMove( Window * pWin, const Point & rPos ) { Rectangle aRects[ 8 ]; FillHandleRectsPixel( aRects ); - for( USHORT i = 0; i < 8; i++ ) + for( sal_uInt16 i = 0; i < 8; i++ ) if( aRects[ i ].IsInside( rPos ) ) return i; } // Move-Rect ueberlappen Handles Rectangle aMoveRects[ 4 ]; FillMoveRectsPixel( aMoveRects ); - for( USHORT i = 0; i < 4; i++ ) + for( sal_uInt16 i = 0; i < 4; i++ ) if( aMoveRects[ i ].IsInside( rPos ) ) return 8; } @@ -420,7 +420,7 @@ void SvResizeHelper::ValidateRect( Rectangle & rValidate ) const |* |* Beschreibung *************************************************************************/ -BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos, +sal_Bool SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos, Rectangle & rOutPosSize ) { if( -1 != nGrab ) @@ -430,9 +430,9 @@ BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos, nGrab = -1; pWin->ReleaseMouse(); pWin->HideTracking(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /************************************************************************* @@ -631,7 +631,7 @@ long SvResizeWindow::Notify( NotifyEvent& rEvt ) { if ( rEvt.GetType() == EVENT_LOSEFOCUS && m_bActive ) { - BOOL bHasFocus = HasChildPathFocus(TRUE); + sal_Bool bHasFocus = HasChildPathFocus(sal_True); if ( !bHasFocus ) { m_bActive = sal_False; diff --git a/svtools/source/hatchwindow/ipwin.hxx b/svtools/source/hatchwindow/ipwin.hxx index 4c7cb6d88d36..1c58bc5b7178 100644 --- a/svtools/source/hatchwindow/ipwin.hxx +++ b/svtools/source/hatchwindow/ipwin.hxx @@ -40,11 +40,11 @@ class SvResizeHelper Rectangle aOuter; short nGrab; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle... Point aSelPos; - BOOL bResizeable; + sal_Bool bResizeable; public: SvResizeHelper(); - void SetResizeable( BOOL b ) { bResizeable = b; } + void SetResizeable( sal_Bool b ) { bResizeable = b; } short GetGrab() const { return nGrab; } void SetBorderPixel( const Size & rBorderP ) { aBorder = rBorderP; } @@ -67,12 +67,12 @@ public: void FillMoveRectsPixel( Rectangle aRects[ 4 ] ) const; void Draw( OutputDevice * ); void InvalidateBorder( Window * ); - BOOL SelectBegin( Window *, const Point & rPos ); + sal_Bool SelectBegin( Window *, const Point & rPos ); short SelectMove( Window * pWin, const Point & rPos ); Point GetTrackPosPixel( const Rectangle & rRect ) const; Rectangle GetTrackRectPixel( const Point & rTrackPos ) const; void ValidateRect( Rectangle & rValidate ) const; - BOOL SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize ); + sal_Bool SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize ); void Release( Window * pWin ); }; diff --git a/svtools/source/inc/gifread.hxx b/svtools/source/inc/gifread.hxx index de4c6935ef67..89e6c8e0df4b 100644 --- a/svtools/source/inc/gifread.hxx +++ b/svtools/source/inc/gifread.hxx @@ -88,41 +88,41 @@ class GIFReader : public GraphicReader long nLastPos; sal_uInt32 nLogWidth100; sal_uInt32 nLogHeight100; - USHORT nTimer; - USHORT nGlobalWidth; // maximale Bildbreite aus Header - USHORT nGlobalHeight; // maximale Bildhoehe aus Header - USHORT nImageWidth; // maximale Bildbreite aus Header - USHORT nImageHeight; // maximale Bildhoehe aus Header - USHORT nImagePosX; - USHORT nImagePosY; - USHORT nImageX; // maximale Bildbreite aus Header - USHORT nImageY; // maximale Bildhoehe aus Header - USHORT nLastImageY; - USHORT nLastInterCount; - USHORT nLoops; + sal_uInt16 nTimer; + sal_uInt16 nGlobalWidth; // maximale Bildbreite aus Header + sal_uInt16 nGlobalHeight; // maximale Bildhoehe aus Header + sal_uInt16 nImageWidth; // maximale Bildbreite aus Header + sal_uInt16 nImageHeight; // maximale Bildhoehe aus Header + sal_uInt16 nImagePosX; + sal_uInt16 nImagePosY; + sal_uInt16 nImageX; // maximale Bildbreite aus Header + sal_uInt16 nImageY; // maximale Bildhoehe aus Header + sal_uInt16 nLastImageY; + sal_uInt16 nLastInterCount; + sal_uInt16 nLoops; GIFAction eActAction; - BOOL bStatus; - BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja: - BOOL bInterlaced; - BOOL bOverreadBlock; - BOOL bImGraphicReady; - BOOL bGlobalPalette; - BYTE nBackgroundColor; // Hintergrundfarbe - BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig - BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku) - BYTE cTransIndex1; - BYTE cNonTransIndex1; - - void ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ); + sal_Bool bStatus; + sal_Bool bGCTransparent; // Ob das Bild Transparent ist, wenn ja: + sal_Bool bInterlaced; + sal_Bool bOverreadBlock; + sal_Bool bImGraphicReady; + sal_Bool bGlobalPalette; + sal_uInt8 nBackgroundColor; // Hintergrundfarbe + sal_uInt8 nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig + sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku) + sal_uInt8 cTransIndex1; + sal_uInt8 cNonTransIndex1; + + void ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ); void ClearImageExtensions(); - BOOL CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, BOOL bWatchForBackgroundColor ); - BOOL ReadGlobalHeader(); - BOOL ReadExtension(); - BOOL ReadLocalHeader(); - ULONG ReadNextBlock(); - void FillImages( HPBYTE pBytes, ULONG nCount ); + sal_Bool CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, sal_Bool bWatchForBackgroundColor ); + sal_Bool ReadGlobalHeader(); + sal_Bool ReadExtension(); + sal_Bool ReadLocalHeader(); + sal_uLong ReadNextBlock(); + void FillImages( HPBYTE pBytes, sal_uLong nCount ); void CreateNewBitmaps(); - BOOL ProcessGIF(); + sal_Bool ProcessGIF(); public: @@ -139,6 +139,6 @@ public: // - ImportGIF - // ------------- - BOOL ImportGIF( SvStream& rStream, Graphic& rGraphic ); + sal_Bool ImportGIF( SvStream& rStream, Graphic& rGraphic ); #endif // _GIFREAD_HXX diff --git a/svtools/source/inc/jpeg.hxx b/svtools/source/inc/jpeg.hxx index 9923190c5e21..0d8db406132a 100644 --- a/svtools/source/inc/jpeg.hxx +++ b/svtools/source/inc/jpeg.hxx @@ -93,8 +93,8 @@ class JPEGWriter SvStream& rOStm; Bitmap aBmp; BitmapReadAccess* pAcc; - BYTE* pBuffer; - BOOL bNative; + sal_uInt8* pBuffer; + sal_Bool bNative; sal_Bool bGreys; sal_Int32 nQuality; @@ -111,7 +111,7 @@ public: bool* pExportWasGrey = NULL ); ~JPEGWriter() {}; - BOOL Write( const Graphic& rGraphic ); + sal_Bool Write( const Graphic& rGraphic ); }; #endif // _JPEGPRIVATE @@ -120,9 +120,9 @@ public: // - Import/ExportJPEG - // --------------------- -BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ); +sal_Bool ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ); -BOOL ExportJPEG( SvStream& rStream, +sal_Bool ExportJPEG( SvStream& rStream, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData, bool* pExportWasGrey = NULL diff --git a/svtools/source/inc/msgrd.hxx b/svtools/source/inc/msgrd.hxx index 2d3dcccb1244..21c0460a1c0b 100644 --- a/svtools/source/inc/msgrd.hxx +++ b/svtools/source/inc/msgrd.hxx @@ -29,9 +29,9 @@ #define _MSGRD_HXX -BOOL ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile, - BOOL(*pCallback)(void *, USHORT), void * pCallerData, - ULONG nMinPercent, ULONG nMaxPercent); +sal_Bool ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile, + sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData, + sal_uLong nMinPercent, sal_uLong nMaxPercent); #endif // _MSGRD_HXX diff --git a/svtools/source/inc/msgwr.hxx b/svtools/source/inc/msgwr.hxx index 7e72e98c124c..d133031673e7 100644 --- a/svtools/source/inc/msgwr.hxx +++ b/svtools/source/inc/msgwr.hxx @@ -29,9 +29,9 @@ #define _MSGWR_HXX -BOOL ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream, - BOOL(*pCallback)(void *, USHORT), void * pCallerData, - ULONG nMinPercent, ULONG nMaxPercent); +sal_Bool ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream, + sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData, + sal_uLong nMinPercent, sal_uLong nMaxPercent); #endif // _MSGWR_HXX diff --git a/svtools/source/inc/property.hxx b/svtools/source/inc/property.hxx index 689da1faf140..aa9a721fa292 100644 --- a/svtools/source/inc/property.hxx +++ b/svtools/source/inc/property.hxx @@ -85,13 +85,13 @@ public: virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener()=0; virtual void SetProperty(const String &rString)=0; virtual String GetProperty()const=0; - virtual BOOL HasList()=0; + virtual sal_Bool HasList()=0; virtual void ClearList()=0; virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND )=0; + sal_uInt16 nPos = LISTBOX_APPEND )=0; virtual void SetCtrSize(const Size& rSize)=0; - virtual void SetLocked(BOOL bLocked=TRUE)=0; + virtual void SetLocked(sal_Bool bLocked=sal_True)=0; virtual void SetMyName(const String &rString)=0; virtual String GetMyName()const=0; @@ -135,13 +135,13 @@ public: virtual void SetProperty(const String &rString); virtual String GetProperty()const; - virtual BOOL HasList(); + virtual sal_Bool HasList(); virtual void ClearList(); virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND ); + sal_uInt16 nPos = LISTBOX_APPEND ); virtual void SetCtrSize(const Size& rSize); - virtual void SetLocked(BOOL bLocked=TRUE); + virtual void SetLocked(sal_Bool bLocked=sal_True); virtual void SetMyName(const String &rString); virtual String GetMyName()const; @@ -178,13 +178,13 @@ public: virtual void SetProperty(const String &rString); virtual String GetProperty()const; - virtual BOOL HasList(); + virtual sal_Bool HasList(); virtual void ClearList(); virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND ); + sal_uInt16 nPos = LISTBOX_APPEND ); virtual void SetCtrSize(const Size& rSize); - virtual void SetLocked(BOOL bLocked=TRUE); + virtual void SetLocked(sal_Bool bLocked=sal_True); virtual void SetMyName(const String &rString); virtual String GetMyName()const; @@ -220,13 +220,13 @@ public: virtual void SetProperty(const String &rString); virtual String GetProperty()const; - virtual BOOL HasList(); + virtual sal_Bool HasList(); virtual void ClearList(); virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND ); + sal_uInt16 nPos = LISTBOX_APPEND ); virtual void SetCtrSize(const Size& rSize); - virtual void SetLocked(BOOL bLocked=TRUE); + virtual void SetLocked(sal_Bool bLocked=sal_True); virtual void SetMyName(const String &rString); virtual String GetMyName()const; @@ -241,14 +241,14 @@ class SvPropertyLine : public Control { private: FixedText aName; - USHORT nNameWidth; - BOOL bNeedsRepaint; + sal_uInt16 nNameWidth; + sal_Bool bNeedsRepaint; SvXPropertyControl* pSvXPropertyControl; PushButton aXButton; - BOOL bIsLocked; - BOOL bHasXButton; - BOOL bIsHyperlink; + sal_Bool bIsLocked; + sal_Bool bHasXButton; + sal_Bool bIsHyperlink; eKindOfControl eKindOfCtr; protected: @@ -260,8 +260,8 @@ public: SvPropertyLine( Window* pParent, const ResId& rResId ); - BOOL NeedsRepaint(); - void SetNeedsRepaint(BOOL bFlag); + sal_Bool NeedsRepaint(); + void SetNeedsRepaint(sal_Bool bFlag); void SetSvXPropertyControl(SvXPropertyControl*); SvXPropertyControl* GetSvXPropertyControl(); @@ -270,16 +270,16 @@ public: void SetName(const String& rString ); String GetName() const; - void SetNameWidth(USHORT); + void SetNameWidth(sal_uInt16); void ShowXButton(); void HideXButton(); - BOOL IsVisibleXButton(); - void ShowAsHyperLink(BOOL nFlag=TRUE); - BOOL IsShownAsHyperlink(); + sal_Bool IsVisibleXButton(); + void ShowAsHyperLink(sal_Bool nFlag=sal_True); + sal_Bool IsShownAsHyperlink(); - void Locked(BOOL nFlag=TRUE); - BOOL IsLineLocked(); + void Locked(sal_Bool nFlag=sal_True); + sal_Bool IsLineLocked(); void SetClickHdl(const Link&); @@ -294,9 +294,9 @@ public: String aValue; SvStrings theValues; // ??? - BOOL bHasVisibleXButton; - BOOL bIsHyperLink; - BOOL bIsLocked; + sal_Bool bHasVisibleXButton; + sal_Bool bIsHyperLink; + sal_Bool bIsLocked; void* pDataPtr; SvXPropertyControl* pControl; }; @@ -378,9 +378,9 @@ private: ScrollBar aVScroll; SvPropLineArray PLineArray; SvPropertyDataControl* pPropDataControl; - USHORT nRowHeight; - BOOL bUpdate; - USHORT nTheNameSize; + sal_uInt16 nRowHeight; + sal_Bool bUpdate; + sal_uInt16 nTheNameSize; long nYOffset; DECL_LINK( ScrollHdl,ScrollBar*); @@ -405,7 +405,7 @@ public: ~SvListBoxForProperties(); - virtual USHORT CalcVisibleLines(); + virtual sal_uInt16 CalcVisibleLines(); virtual void EnableUpdate(); virtual void DisableUpdate(); @@ -413,19 +413,19 @@ public: virtual void Clear(); - virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND ); + virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND ); - virtual void ChangeEntry( const SvPropertyData&, USHORT nPos); + virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos); - virtual USHORT AppendEntry( const SvPropertyData&); + virtual sal_uInt16 AppendEntry( const SvPropertyData&); virtual void SetPropertyValue( const String & rEntryName, const String & rValue ); - virtual void SetFirstVisibleEntry(USHORT nPos); - virtual USHORT GetFirstVisibleEntry(); + virtual void SetFirstVisibleEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetFirstVisibleEntry(); - virtual void SetSelectedEntry(USHORT nPos); - virtual USHORT GetSelectedEntry(); + virtual void SetSelectedEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetSelectedEntry(); }; class SvTabPageForProperties: public TabPage @@ -450,7 +450,7 @@ class SvBasicPropertyDataControl: public SvPropertyDataControl { private: - BOOL bCorrectness; + sal_Bool bCorrectness; String aEntryName; String aEntryProperty; String aCorrectProperty; @@ -481,7 +481,7 @@ public: virtual void LinkClicked(const String& aName, void* pData); - virtual void SetIsCorrect(BOOL nFlag); + virtual void SetIsCorrect(sal_Bool nFlag); //virtual String GetTheCorrectProperty()const; virtual void SetTheCorrectProperty(const String& aName); @@ -521,30 +521,30 @@ public: ~SvPropertyBox(); - virtual USHORT CalcVisibleLines(); + virtual sal_uInt16 CalcVisibleLines(); virtual void EnableUpdate(); // auch IDL? virtual void DisableUpdate(); // auch IDL? // AB: Hier beginnt das 'offizielle' Interface, das in IDL uebernommen werden soll virtual void SetController(SvPropertyDataControl *); - virtual USHORT AppendPage( const String & r ); - virtual void SetPage( USHORT ); - virtual USHORT GetCurPage(); + virtual sal_uInt16 AppendPage( const String & r ); + virtual void SetPage( sal_uInt16 ); + virtual sal_uInt16 GetCurPage(); virtual void ClearAll(); virtual void ClearTable(); virtual void SetPropertyValue( const String & rEntryName, const String & rValue ); - virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND ); - virtual void ChangeEntry( const SvPropertyData&, USHORT nPos); - virtual USHORT AppendEntry( const SvPropertyData&); + virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND ); + virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos); + virtual sal_uInt16 AppendEntry( const SvPropertyData&); - virtual void SetFirstVisibleEntry(USHORT nPos); - virtual USHORT GetFirstVisibleEntry(); + virtual void SetFirstVisibleEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetFirstVisibleEntry(); - virtual void SetSelectedEntry(USHORT nPos); - virtual USHORT GetSelectedEntry(); + virtual void SetSelectedEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetSelectedEntry(); }; @@ -556,8 +556,8 @@ private: SvBasicPropertyDataControl aBaProDatCtr; OKButton anOk; CancelButton aCancel; - USHORT nCount; - USHORT nClickCount; + sal_uInt16 nCount; + sal_uInt16 nClickCount; SvPropertyData aProperty; SvPropertyBox aPropListBox; diff --git a/svtools/source/inc/sgfbram.hxx b/svtools/source/inc/sgfbram.hxx index 2acab5445a8c..aa4ed5836606 100644 --- a/svtools/source/inc/sgfbram.hxx +++ b/svtools/source/inc/sgfbram.hxx @@ -40,11 +40,11 @@ #define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */ // Konstanten fr SgfHeader.SwGrCol -#define SgfBlckWhit 1 /* Schwarz/Weiá Bild Ä¿ SimpVector, */ -#define SgfGrayscal 2 /* Bild mit Graustufen ³ StarDraw und */ +#define SgfBlckWhit 1 /* Schwarz/Wei?Bild Ä¿ SimpVector, */ +#define SgfGrayscal 2 /* Bild mit Graustufen ?StarDraw und */ #define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */ #define SgfVectFarb 4 /* Farben fr Linien verwenden Ä¿ */ -#define SgfVectGray 5 /* Graustufen fr Linien verwenden ³ Nur fr */ +#define SgfVectGray 5 /* Graustufen fr Linien verwenden ?Nur fr */ #define SgfVectWdth 6 /* Strichst„rken fr Linien verwenden ÄÙ SimpVector */ @@ -52,35 +52,35 @@ class SgfHeader { public: - UINT16 Magic; - UINT16 Version; - UINT16 Typ; - UINT16 Xsize; - UINT16 Ysize; - INT16 Xoffs; - INT16 Yoffs; - UINT16 Planes; // Layer - UINT16 SwGrCol; + sal_uInt16 Magic; + sal_uInt16 Version; + sal_uInt16 Typ; + sal_uInt16 Xsize; + sal_uInt16 Ysize; + sal_Int16 Xoffs; + sal_Int16 Yoffs; + sal_uInt16 Planes; // Layer + sal_uInt16 SwGrCol; char Autor[10]; char Programm[10]; - UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) ! + sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) ! - UINT32 GetOffset(); + sal_uInt32 GetOffset(); friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead); - BOOL ChkMagic(); + sal_Bool ChkMagic(); }; #define SgfEntrySize 22 class SgfEntry { public: - UINT16 Typ; - UINT16 iFrei; - UINT16 lFreiLo,lFreiHi; + sal_uInt16 Typ; + sal_uInt16 iFrei; + sal_uInt16 lFreiLo,lFreiHi; char cFrei[10]; - UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) ! + sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) ! - UINT32 GetOffset(); + sal_uInt32 GetOffset(); friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr); }; @@ -88,10 +88,10 @@ public: class SgfVector { public: - UINT16 Flag; - INT16 x; - INT16 y; - UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) ! + sal_uInt16 Flag; + sal_Int16 x; + sal_Int16 y; + sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) ! friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr); }; @@ -102,7 +102,7 @@ extern long SgfVectXmul; extern long SgfVectYmul; extern long SgfVectXdiv; extern long SgfVectYdiv; -extern BOOL SgfVectScal; +extern sal_Bool SgfVectScal; //////////////////////////////////////////////////////////////////////////////////////////////////// // Windows BMP ///////////////////////////////////////////////////////////////////////////////////// @@ -112,15 +112,15 @@ extern BOOL SgfVectScal; class BmpFileHeader { public: - UINT16 Typ; // = "BM" - UINT16 SizeLo,SizeHi; // Filesize in Bytes - UINT16 Reserve1; // Reserviert - UINT16 Reserve2; // Reserviert - UINT16 OfsLo,OfsHi; // Offset? - - void SetSize(UINT32 Size); - void SetOfs(UINT32 Size); - UINT32 GetOfs(); + sal_uInt16 Typ; // = "BM" + sal_uInt16 SizeLo,SizeHi; // Filesize in Bytes + sal_uInt16 Reserve1; // Reserviert + sal_uInt16 Reserve2; // Reserviert + sal_uInt16 OfsLo,OfsHi; // Offset? + + void SetSize(sal_uInt32 Size); + void SetOfs(sal_uInt32 Size); + sal_uInt32 GetOfs(); friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead); }; @@ -128,17 +128,17 @@ public: class BmpInfoHeader { public: - UINT32 Size; // Gr”áe des BmpInfoHeaders - INT32 Width; // Breite in Pixel - INT32 Hight; // H”he in Pixel - UINT16 Planes; // Anzahl der Planes (immer 1) - UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24) - UINT32 Compress; // Datenkompression - UINT32 ImgSize; // Gr”áe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt. - INT32 xDpmm; // Dot per Meter (0 ist erlaubt) - INT32 yDpmm; // Dot per Meter (0 ist erlaubt) - UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle) - UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle) + sal_uInt32 Size; // Gr”áe des BmpInfoHeaders + sal_Int32 Width; // Breite in Pixel + sal_Int32 Hight; // H”he in Pixel + sal_uInt16 Planes; // Anzahl der Planes (immer 1) + sal_uInt16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24) + sal_uInt32 Compress; // Datenkompression + sal_uInt32 ImgSize; // Gr”áe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt. + sal_Int32 xDpmm; // Dot per Meter (0 ist erlaubt) + sal_Int32 yDpmm; // Dot per Meter (0 ist erlaubt) + sal_uInt32 ColUsed; // Anzahl der verwendeten Farben (0=alle) + sal_uInt32 ColMust; // Anzahl der wichtigen Farben (0=alle) friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead); }; @@ -146,12 +146,12 @@ public: #define RGBQuadSize 4 class RGBQuad { private: - BYTE Red; - BYTE Grn; - BYTE Blu; - BYTE Fil; + sal_uInt8 Red; + sal_uInt8 Grn; + sal_uInt8 Blu; + sal_uInt8 Fil; public: - RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; } + RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; } }; #endif //_SGFBRAM_HXX diff --git a/svtools/source/inc/sgffilt.hxx b/svtools/source/inc/sgffilt.hxx index 1c75917b8f73..28d48fe13820 100644 --- a/svtools/source/inc/sgffilt.hxx +++ b/svtools/source/inc/sgffilt.hxx @@ -29,10 +29,10 @@ #define _SGFFILT_HXX #include <tools/urlobj.hxx> -BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion); -BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut); -BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf); -BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ); +sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion); +sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut); +sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf); +sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ); // Konstanten fr CheckSgfTyp() #define SGF_BITIMAGE 1 /* Bitmap */ diff --git a/svtools/source/inc/sgvmain.hxx b/svtools/source/inc/sgvmain.hxx index 6f69908865c5..3006a23f5f10 100644 --- a/svtools/source/inc/sgvmain.hxx +++ b/svtools/source/inc/sgvmain.hxx @@ -36,8 +36,8 @@ #define UCHAR unsigned char struct PointType { - INT16 x; - INT16 y; + sal_Int16 x; + sal_Int16 y; }; #define SgfDpmm 40 @@ -45,7 +45,7 @@ struct PointType { #define DtHdSize 256 class DtHdType { public: - BYTE Reserved[256]; + sal_uInt8 Reserved[256]; friend SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd); friend void DtHdOverSeek(SvStream& rInp); }; @@ -53,30 +53,30 @@ public: struct Seitenformat { PointType Size; // 0.00mm...819.175mm (Papiergr��e) - INT16 RandL; // links Rand auf - INT16 RandR; // rechts dem Papier - INT16 RandO; // oben Rand auf - INT16 RandU; // unten dem Papier - BYTE PColor; // Future Use - BYTE PIntens; // erst recht Future use -// BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) + sal_Int16 RandL; // links Rand auf + sal_Int16 RandR; // rechts dem Papier + sal_Int16 RandO; // oben Rand auf + sal_Int16 RandU; // unten dem Papier + sal_uInt8 PColor; // Future Use + sal_uInt8 PIntens; // erst recht Future use +// sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) }; #define PageSize 146 class PageType { public: - UINT32 Next; // N�chste Seite - UINT32 nList; // Objektdaten, erster Record - UINT32 ListEnd; // Objektdaten, letzter Record + sal_uInt32 Next; // N�chste Seite + sal_uInt32 nList; // Objektdaten, erster Record + sal_uInt32 ListEnd; // Objektdaten, letzter Record Seitenformat Paper; // Papierdaten - BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) - BYTE StdPg; // welche Standardseite einblenden ? + sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) + sal_uInt8 StdPg; // welche Standardseite einblenden ? PointType U; // Nullpunkt - INT16 HlpLnH[20]; // Hilfslinien - INT16 HlpLnV[20]; - BYTE LnAnzH; - BYTE LnAnzV; + sal_Int16 HlpLnH[20]; // Hilfslinien + sal_Int16 HlpLnV[20]; + sal_uInt8 LnAnzH; + sal_uInt8 LnAnzV; UCHAR PgName[32]; // Seitenname friend SvStream& operator>>(SvStream& rIStream, PageType& rPage); }; @@ -86,21 +86,21 @@ enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln, ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi}; struct ObjLineType { - BYTE LFarbe; // [Index] - BYTE LBFarbe; // [Index] - BYTE LIntens; // [%] - BYTE LMuster; // [Index] inkl. Transparenz - INT16 LMSize; // [Koeffizient/100] - INT16 LDicke; // Strichst�rke + sal_uInt8 LFarbe; // [Index] + sal_uInt8 LBFarbe; // [Index] + sal_uInt8 LIntens; // [%] + sal_uInt8 LMuster; // [Index] inkl. Transparenz + sal_Int16 LMSize; // [Koeffizient/100] + sal_Int16 LDicke; // Strichst�rke }; struct ObjAreaType { - BYTE FFarbe; // [Index] - BYTE FBFarbe; // [Index] - BYTE FIntens; // [%] - BYTE FDummy1; // - INT16 FDummy2; // - UINT16 FMuster; // [Index] inkl. Invers, Transparenz + sal_uInt8 FFarbe; // [Index] + sal_uInt8 FBFarbe; // [Index] + sal_uInt8 FIntens; // [%] + sal_uInt8 FDummy1; // + sal_Int16 FDummy2; // + sal_uInt16 FMuster; // [Index] inkl. Invers, Transparenz }; #define ObjTextTypeSize 64 @@ -108,24 +108,24 @@ class ObjTextType { public: ObjLineType L; // Text-Outline (future) ObjAreaType F; // Text innen - UINT16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType. - UINT16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein - UINT16 Breite; // 1..65535% bitte nicht mehr als 500% - BYTE Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo) - BYTE Kapit; // 1..255% - UINT16 Schnitt; // 8 Flags - UINT16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile - UINT16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen) - BYTE ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als - INT8 ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�) + sal_uInt16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType. + sal_uInt16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein + sal_uInt16 Breite; // 1..65535% bitte nicht mehr als 500% + sal_uInt8 Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo) + sal_uInt8 Kapit; // 1..255% + sal_uInt16 Schnitt; // 8 Flags + sal_uInt16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile + sal_uInt16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen) + sal_uInt8 ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als + sal_sChar ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�) ObjLineType ShdL; // Schatten-Outline (neu 2.0) ObjAreaType ShdF; // Schatten-innen (neu 2.0) PointType ShdVers; // Schattenversatz Max.300.00% - BOOL ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad - BOOL NoSpc; // True-> kein Zwischenraum (f�r BackArea) + sal_Bool ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad + sal_Bool NoSpc; // True-> kein Zwischenraum (f�r BackArea) ObjAreaType BackF; // Hintergrundfl�che - UINT32 GetFont(); - void SetFont(UINT32 FontID); + sal_uInt32 GetFont(); + void SetFont(sal_uInt32 FontID); }; class Obj0Type { // SuperClass f�r Apple-VMT @@ -137,16 +137,16 @@ public: #define ObjkSize 20 /* eigentlich 21. Wg. Allignment ist Flags jedoch verschoben worden*/ class ObjkType: public Obj0Type { // Grundkomponenten aller Stardraw-Objekte public: - UINT32 Last; - UINT32 Next; - UINT16 MemSize; // in Bytes + sal_uInt32 Last; + sal_uInt32 Next; + sal_uInt16 MemSize; // in Bytes PointType ObjMin; // XY-Minimum des Objekts PointType ObjMax; // XY-Maximum des Objekts - BYTE Art; - BYTE Layer; -// BYTE Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Art; + sal_uInt8 Layer; +// sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) friend SvStream& operator>>(SvStream& rIStream, ObjkType& rObjk); - friend BOOL ObjOverSeek(SvStream& rInp, ObjkType& rObjk); + friend sal_Bool ObjOverSeek(SvStream& rInp, ObjkType& rObjk); virtual void Draw(OutputDevice& rOut); }; @@ -154,8 +154,8 @@ public: #define StrkSize 38 class StrkType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // Linienenden + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // Linienenden ObjLineType L; PointType Pos1; // Anfangspunkt PointType Pos2; // Endpunkt @@ -167,15 +167,15 @@ public: #define RectSize 52 class RectType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE Reserve; + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Reserve; ObjLineType L; ObjAreaType F; PointType Pos1; // LO-Ecke = Bezugspunkt PointType Pos2; // R-Ecke - INT16 Radius; // Eckenradius - UINT16 DrehWink; // 315...<45 - UINT16 Slant; // >270...<90 + sal_Int16 Radius; // Eckenradius + sal_uInt16 DrehWink; // 315...<45 + sal_uInt16 Slant; // >270...<90 friend SvStream& operator>>(SvStream& rIStream, RectType& rRect); virtual void Draw(OutputDevice& rOut); }; @@ -184,13 +184,13 @@ public: #define PolySize 44 class PolyType: public ObjkType { // identisch mit Spline ! public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // nur f�r Polyline + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // nur f�r Polyline ObjLineType L; ObjAreaType F; // nicht f�r Polyline - BYTE nPoints; - BYTE Reserve; - UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) + sal_uInt8 nPoints; + sal_uInt8 Reserve; + sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!)) friend SvStream& operator>>(SvStream& rIStream, PolyType& rPoly); virtual void Draw(OutputDevice& rOut); @@ -201,13 +201,13 @@ public: #define SplnSize 44 class SplnType: public ObjkType { // identisch mit Poly ! public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // nur f�r nSpline + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // nur f�r nSpline ObjLineType L; ObjAreaType F; // nicht f�r nSpline - BYTE nPoints; - BYTE Reserve; - UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) + sal_uInt8 nPoints; + sal_uInt8 Reserve; + sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!)) friend SvStream& operator>>(SvStream& rIStream, SplnType& rSpln); virtual void Draw(OutputDevice& rOut); @@ -218,15 +218,15 @@ public: #define CircSize 52 class CircType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // nur Bogen (Kr & El) + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // nur Bogen (Kr & El) ObjLineType L; ObjAreaType F; // nicht f�r Bogen (Kr & El) PointType Center; // Mittelpunkt PointType Radius; // Radius - UINT16 DrehWink; // nur Ellipse - UINT16 StartWink; // � nicht f�r Vollkreis - UINT16 RelWink; // � und Vollellipse + sal_uInt16 DrehWink; // nur Ellipse + sal_uInt16 StartWink; // � nicht f�r Vollkreis + sal_uInt16 RelWink; // � und Vollellipse friend SvStream& operator>>(SvStream& rIStream, CircType& rCirc); virtual void Draw(OutputDevice& rOut); }; @@ -239,19 +239,19 @@ public: #define TextSize 116 class TextType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE Reserve; // f�r Word Allign + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Reserve; // f�r Word Allign ObjTextType T; // 64 Bytes << DWord-Allign bei FontID erforderlich PointType Pos1; // Bezugspunkt (ObenLinks) PointType Pos2; // (untenRechts) - INT16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify) - UINT16 DrehWink; // 0...<360 - UINT16 BoxSlant; // >270...<90 (nur Box) - UINT16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so - UINT16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich - UINT16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich + sal_Int16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify) + sal_uInt16 DrehWink; // 0...<360 + sal_uInt16 BoxSlant; // >270...<90 (nur Box) + sal_uInt16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so + sal_uInt16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich + sal_uInt16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich PointType FitSize; // Ursprungsgr��e f�r Fit2Size - INT16 FitBreit; // Breite zum formatieren bei Fit2Size + sal_Int16 FitBreit; // Breite zum formatieren bei Fit2Size UCHAR* Buffer; // Diese Variable wird nicht durch Lesen von Disk gef�llt, sondern explizit! friend SvStream& operator>>(SvStream& rIStream, TextType& rText); virtual void Draw(OutputDevice& rOut); @@ -268,21 +268,21 @@ enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf}; #define BmapSize 132 class BmapType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE Reserve; + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Reserve; ObjAreaType F; // Farbe und Muster der 1-Plane Bitmap PointType Pos1; PointType Pos2; - UINT16 DrehWink; // 315...<45 (Future) - UINT16 Slant; // >270...<90 (Future) + sal_uInt16 DrehWink; // 315...<45 (Future) + sal_uInt16 Slant; // >270...<90 (Future) UCHAR Filename[80]; // Pfad PointType PixSize; // Gr��e in Pixel (0 bei Vektor) GrafStat Format; // siehe GpmDef.Pas - BYTE nPlanes; // Anzahl der Bitplanes (0 bei Vektor) - BOOL RawOut; // als Raw ausgeben ? - BOOL InvOut; // invertiert ausgeben ? - BOOL LightOut; // aufhellen? (SD20) - BYTE GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp) + sal_uInt8 nPlanes; // Anzahl der Bitplanes (0 bei Vektor) + sal_Bool RawOut; // als Raw ausgeben ? + sal_Bool InvOut; // invertiert ausgeben ? + sal_Bool LightOut; // aufhellen? (SD20) + sal_uInt8 GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp) INetURLObject aFltPath; // F�r GraphicFilter friend SvStream& operator>>(SvStream& rIStream, BmapType& rBmap); @@ -294,13 +294,13 @@ public: #define GrupSize 48 class GrupType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) UCHAR Name[13]; // Name der Gruppe - UINT16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich - UINT16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich - UINT16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur - UINT32 ChartPtr; // Diagrammstruktur - UINT32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist. + sal_uInt16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich + sal_uInt16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich + sal_uInt16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur + sal_uInt32 ChartPtr; // Diagrammstruktur + sal_uInt32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist. friend SvStream& operator>>(SvStream& rIStream, GrupType& rGrup); // virtual void Draw(OutputDevice& rOut); }; @@ -308,26 +308,26 @@ public: void SetLine(ObjLineType& rLine, OutputDevice& rOut); void SetArea(ObjAreaType& rArea, OutputDevice& rOut); -Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts); -void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs); -void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs); -INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div); -UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div); +Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts); +void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs); +void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs); +sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div); +sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div); class SgfFontOne { public: SgfFontOne* Next; // Zeiger f�r Listenverkettung - UINT32 IFID; - BOOL Bold; - BOOL Ital; - BOOL Sans; - BOOL Serf; - BOOL Fixd; + sal_uInt32 IFID; + sal_Bool Bold; + sal_Bool Ital; + sal_Bool Sans; + sal_Bool Serf; + sal_Bool Fixd; FontFamily SVFamil; CharSet SVChSet; String SVFName; // z.B. "Times New Roman" = 15 Chars - USHORT SVWidth; // Durchschnittliche Zeichenbreite in % + sal_uInt16 SVWidth; // Durchschnittliche Zeichenbreite in % SgfFontOne(); void ReadOne( ByteString& ID, ByteString& Dsc); }; @@ -337,15 +337,15 @@ public: String FNam; // vollst�ndiger Filename des Inifiles SgfFontOne* pList; // Listenanfang SgfFontOne* Last; // Listenende - UINT32 LastID; // f�r schnelleren Zugriff bei Wiederholungen + sal_uInt32 LastID; // f�r schnelleren Zugriff bei Wiederholungen SgfFontOne* LastLn; // f�r schnelleren Zugriff bei Wiederholungen - BOOL Tried; + sal_Bool Tried; SgfFontLst(); ~SgfFontLst(); void AssignFN(const String& rFName); void ReadList(); void RausList(); - SgfFontOne* GetFontDesc(UINT32 ID); + SgfFontOne* GetFontDesc(sal_uInt32 ID); }; #endif //_SGVMAIN_HXX diff --git a/svtools/source/inc/sgvspln.hxx b/svtools/source/inc/sgvspln.hxx index 29df09247f22..3bb7ea85374b 100644 --- a/svtools/source/inc/sgvspln.hxx +++ b/svtools/source/inc/sgvspln.hxx @@ -38,7 +38,7 @@ |* Polygons werden als Sttzstellen angenommen. |* n liefert die Anzahl der Teilpolynome. |* Ist die Berechnung fehlerfrei verlaufen, so -|* liefert die Funktion TRUE. Nur in diesem Fall +|* liefert die Funktion sal_True. Nur in diesem Fall |* ist Speicher fr die Koeffizientenarrays |* allokiert, der dann sp„ter vom Aufrufer mittels |* delete freizugeben ist. @@ -47,7 +47,7 @@ |* *************************************************************************/ -BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, +sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n, double*& ax, double*& ay, double*& bx, double*& by, double*& cx, double*& cy, double*& dx, double*& dy, double*& T); @@ -58,9 +58,9 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Beschreibung Konvertiert einen parametrichen kubischen |* Polynomspline Spline (natrlich oder periodisch) |* in ein angen„hertes Polygon. -|* Die Funktion liefert FALSE, wenn ein Fehler bei +|* Die Funktion liefert sal_False, wenn ein Fehler bei |* der Koeffizientenberechnung aufgetreten ist oder -|* das Polygon zu groá wird (>PolyMax=16380). Im 1. +|* das Polygon zu gro?wird (>PolyMax=16380). Im 1. |* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte. |* Um Koordinatenberl„ufe zu vermeiden werden diese |* auf +/-32000 begrenzt. @@ -68,6 +68,6 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly); +sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly); #endif //_SGVSPLN_HXX diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index f9e4ee6951fb..d90329afb28d 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -64,9 +64,9 @@ public: void BeginDrag(); void CreateAnchor(); void DestroyAnchor(); - BOOL SetCursorAtPoint( const Point& rPoint, - BOOL bDontSelectAtCursor=FALSE ); - BOOL IsSelectionAtPoint( const Point& rPoint ); + sal_Bool SetCursorAtPoint( const Point& rPoint, + sal_Bool bDontSelectAtCursor=sal_False ); + sal_Bool IsSelectionAtPoint( const Point& rPoint ); void DeselectAtPoint( const Point& rPoint ); void DeselectAll(); }; @@ -147,22 +147,22 @@ private: long nNodeBmpWidth; long nNextVerVisSize; long nMostRight; - ULONG nVisibleCount; // Anzahl Zeilen im Control - ULONG nCurUserEvent; //-1 == kein Userevent amn Laufen + sal_uLong nVisibleCount; // Anzahl Zeilen im Control + sal_uLong nCurUserEvent; //-1 == kein Userevent amn Laufen short nHorSBarHeight, nVerSBarWidth; - USHORT nFlags; - USHORT nCurTabPos; + sal_uInt16 nFlags; + sal_uInt16 nCurTabPos; WinBits m_nStyle; ExtendedWinBits nExtendedWinBits; - BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION - BOOL bUpdateMode : 1; - BOOL bInVScrollHdl : 1; - BOOL bAsyncBeginDrag : 1; - BOOL bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with FALSE - BOOL bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with FALSE - BOOL bContextMenuHandling : 1; - BOOL bIsCellFocusEnabled : 1; + sal_Bool bSimpleTravel : 1; // ist sal_True bei SINGLE_SELECTION + sal_Bool bUpdateMode : 1; + sal_Bool bInVScrollHdl : 1; + sal_Bool bAsyncBeginDrag : 1; + sal_Bool bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with sal_False + sal_Bool bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with sal_False + sal_Bool bContextMenuHandling : 1; + sal_Bool bIsCellFocusEnabled : 1; sal_Bool bAreChildrenTransient; @@ -186,16 +186,16 @@ private: void ShowVerSBar(); // setzt Thumb auf FirstEntryToDraw void SyncVerThumb(); - BOOL IsLineVisible( long nY ) const; + sal_Bool IsLineVisible( long nY ) const; long GetEntryLine( SvLBoxEntry* pEntry ) const; void FillView(); void CursorDown(); void CursorUp(); void KeyLeftRight( long nDiff ); - void PageDown( USHORT nDelta ); - void PageUp( USHORT nDelta ); + void PageDown( sal_uInt16 nDelta ); + void PageUp( sal_uInt16 nDelta ); - void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE ); + void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False ); void DrawNet(); @@ -209,39 +209,39 @@ private: // Selection-Engine SvLBoxEntry* MakePointVisible( const Point& rPoint, - BOOL bNotifyScroll=TRUE ); + sal_Bool bNotifyScroll=sal_True ); void SetAnchorSelection( SvLBoxEntry* pOld, SvLBoxEntry* pNewCursor ); void BeginDrag(); - BOOL ButtonDownCheckCtrl( const MouseEvent& rMEvt, + sal_Bool ButtonDownCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long nY ); - BOOL MouseMoveCheckCtrl( const MouseEvent& rMEvt, + sal_Bool MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry ); - BOOL ButtonUpCheckCtrl( const MouseEvent& rMEvt ); - BOOL ButtonDownCheckExpand( const MouseEvent&, + sal_Bool ButtonUpCheckCtrl( const MouseEvent& rMEvt ); + sal_Bool ButtonDownCheckExpand( const MouseEvent&, SvLBoxEntry*,long nY ); - void PositionScrollBars( Size& rOSize, USHORT nMask ); - USHORT AdjustScrollBars( Size& rSize ); + void PositionScrollBars( Size& rOSize, sal_uInt16 nMask ); + sal_uInt16 AdjustScrollBars( Size& rSize ); void BeginScroll(); void EndScroll(); - BOOL InScroll() const { return (BOOL)(nFlags & F_IN_SCROLLING)!=0;} + sal_Bool InScroll() const { return (sal_Bool)(nFlags & F_IN_SCROLLING)!=0;} Rectangle GetVisibleArea() const; - BOOL EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine); + sal_Bool EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine); void InitScrollBarBox(); SvLBoxTab* NextTab( SvLBoxTab* ); - BOOL SetMostRight( SvLBoxEntry* pEntry ); + sal_Bool SetMostRight( SvLBoxEntry* pEntry ); void FindMostRight( SvLBoxEntry* EntryToIgnore ); void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore ); void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore ); void NotifyTabsChanged(); - inline BOOL IsExpandable() const // if element at cursor can be expanded in general + inline sal_Bool IsExpandable() const // if element at cursor can be expanded in general { return pCursor->HasChilds() || pCursor->HasChildsOnDemand(); } - inline BOOL IsNowExpandable() const // if element at cursor can be expanded at this moment + inline sal_Bool IsNowExpandable() const // if element at cursor can be expanded at this moment { return IsExpandable() && !pView->IsExpanded( pCursor ); } static void implInitDefaultNodeImages(); @@ -280,40 +280,40 @@ public: void EntryExpanded( SvLBoxEntry* pEntry ); void EntryCollapsed( SvLBoxEntry* pEntry ); void CollapsingEntry( SvLBoxEntry* pEntry ); - void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + void EntrySelected( SvLBoxEntry*, sal_Bool bSelect ); void Paint( const Rectangle& rRect ); void RepaintSelectionItems(); void MouseButtonDown( const MouseEvent& ); void MouseButtonUp( const MouseEvent& ); void MouseMove( const MouseEvent&); - BOOL KeyInput( const KeyEvent& ); + sal_Bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); void LoseFocus(); void UpdateAll( - BOOL bInvalidateCompleteView= TRUE, - BOOL bUpdateVerSBar = TRUE ); + sal_Bool bInvalidateCompleteView= sal_True, + sal_Bool bUpdateVerSBar = sal_True ); void SetEntryHeight( short nHeight ); void PaintEntry( SvLBoxEntry* pEntry ); void InvalidateEntry( SvLBoxEntry* ); void RecalcFocusRect(); - inline void SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect ); + inline void SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect ); void SetDragDropMode( DragDropMode eDDMode ); void SetSelectionMode( SelectionMode eSelMode ); - void SetAddMode( BOOL ) { aSelEng.AddAlways(FALSE); } - BOOL IsAddMode() const { return aSelEng.IsAlwaysAdding(); } + void SetAddMode( sal_Bool ) { aSelEng.AddAlways(sal_False); } + sal_Bool IsAddMode() const { return aSelEng.IsAlwaysAdding(); } SvLBoxEntry* GetCurrentEntry() const { return pCursor; } - BOOL IsEntryInView( SvLBoxEntry* ) const; + sal_Bool IsEntryInView( SvLBoxEntry* ) const; SvLBoxEntry* GetEntry( const Point& rPos ) const; // gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag SvLBoxEntry* GetClickedEntry( const Point& ) const; SvLBoxEntry* GetCurEntry() const { return pCursor; } void SetCurEntry( SvLBoxEntry* ); Point GetEntryPosition( SvLBoxEntry* ) const; - void MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop=FALSE ); + void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop=sal_False ); void PaintDDCursor( SvLBoxEntry* ); @@ -338,38 +338,38 @@ public: static const Image& GetDefaultCollapsedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ); const Size& GetOutputSize() const { return aOutputSize;} - void KeyUp( BOOL bPageUp, BOOL bNotifyScroll = TRUE ); - void KeyDown( BOOL bPageDown, BOOL bNotifyScroll = TRUE ); + void KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll = sal_True ); + void KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll = sal_True ); void Command( const CommandEvent& rCEvt ); void Invalidate(); void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); } - void SelAllDestrAnch( BOOL bSelect, - BOOL bDestroyAnchor = TRUE, - BOOL bSingleSelToo = FALSE ); - void ShowCursor( BOOL bShow ); + void SelAllDestrAnch( sal_Bool bSelect, + sal_Bool bDestroyAnchor = sal_True, + sal_Bool bSingleSelToo = sal_False ); + void ShowCursor( sal_Bool bShow ); - BOOL RequestHelp( const HelpEvent& rHEvt ); + sal_Bool RequestHelp( const HelpEvent& rHEvt ); void EndSelection(); - BOOL IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const; + sal_Bool IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const; void RepaintScrollBars(); - void EnableAsyncDrag( BOOL b) { bAsyncBeginDrag = b; } - void SetUpdateMode( BOOL ); - void SetUpdateModeFast( BOOL ); - BOOL GetUpdateMode() const { return bUpdateMode; } + void EnableAsyncDrag( sal_Bool b) { bAsyncBeginDrag = b; } + void SetUpdateMode( sal_Bool ); + void SetUpdateModeFast( sal_Bool ); + sal_Bool GetUpdateMode() const { return bUpdateMode; } Rectangle GetClipRegionRect() const; - BOOL HasHorScrollBar() const { return aHorSBar.IsVisible(); } + sal_Bool HasHorScrollBar() const { return aHorSBar.IsVisible(); } void ShowFocusRect( const SvLBoxEntry* pEntry ); void SetTabBar( TabBar* pTabBar ); void CancelPendingEdit(); - void CallEventListeners( ULONG nEvent, void* pData = NULL ); + void CallEventListeners( sal_uLong nEvent, void* pData = NULL ); /** Enables, that one cell of a tablistbox entry can be focused */ - inline BOOL IsCellFocusEnabled() const { return bIsCellFocusEnabled; } - inline void EnableCellFocus() { bIsCellFocusEnabled = TRUE; } - bool SetCurrentTabPos( USHORT _nNewPos ); - inline USHORT GetCurrentTabPos() const { return nCurTabPos; } + inline sal_Bool IsCellFocusEnabled() const { return bIsCellFocusEnabled; } + inline void EnableCellFocus() { bIsCellFocusEnabled = sal_True; } + bool SetCurrentTabPos( sal_uInt16 _nNewPos ); + inline sal_uInt16 GetCurrentTabPos() const { return nCurTabPos; } bool IsSelectable( const SvLBoxEntry* pEntry ); }; @@ -457,11 +457,11 @@ inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry ) pView->PaintEntry( pEntry, nY ); } -inline BOOL SvImpLBox::IsLineVisible( long nY ) const +inline sal_Bool SvImpLBox::IsLineVisible( long nY ) const { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if ( nY < 0 || nY >= aOutputSize.Height() ) - bRet = FALSE; + bRet = sal_False; return bRet; } diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx index 7d5c2b1b41e3..b516ca9bfe25 100644 --- a/svtools/source/inc/svimpicn.hxx +++ b/svtools/source/inc/svimpicn.hxx @@ -103,8 +103,8 @@ class SvImpIconView long nMaxBmpHeight; long nMaxTextWidth; long nMaxBoundHeight; // Hoehe des hoechsten BoundRects - ULONG nFlags; - ULONG nCurUserEvent; + sal_uLong nFlags; + sal_uLong nCurUserEvent; SvLBoxEntry* pCurParent; SvLBoxEntry* pCursor; SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist @@ -115,12 +115,12 @@ class SvImpIconView VirtualDevice* pDDTempDev; SvIconViewTextMode eTextMode; - BOOL bMustRecalcBoundingRects; + sal_Bool bMustRecalcBoundingRects; void CheckAllSizes(); void CheckSizes( SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData = 0 ); - void ShowCursor( BOOL bShow ); + void ShowCursor( sal_Bool bShow ); void SetNextEntryPos(const Point& rPos); Point FindNextEntryPos( const Size& rBoundSize ); @@ -137,7 +137,7 @@ class SvImpIconView void AdjustScrollBars(); void PositionScrollBars( long nRealWidth, long nRealHeight ); void CalcDocPos( Point& aMousePos ); - BOOL GetResizeRect( Rectangle& ); + sal_Bool GetResizeRect( Rectangle& ); void PaintResizeRect( const Rectangle& ); SvLBoxEntry* GetNewCursor(); void ToggleSelection( SvLBoxEntry* ); @@ -160,8 +160,8 @@ class SvImpIconView SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData ) const; - BOOL CheckVerScrollBar(); - BOOL CheckHorScrollBar(); + sal_Bool CheckVerScrollBar(); + sal_Bool CheckHorScrollBar(); void CancelUserEvent(); public: @@ -169,7 +169,7 @@ public: SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle ); ~SvImpIconView(); - void Clear( BOOL bInCtor = FALSE ); + void Clear( sal_Bool bInCtor = sal_False ); void SetStyle( const WinBits i_nWinStyle ); void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent ) { pModel = pTree; SetCurParent(pParent); } @@ -184,14 +184,14 @@ public: void EntryExpanded( SvLBoxEntry* pEntry ); void EntryCollapsed( SvLBoxEntry* pEntry ); void CollapsingEntry( SvLBoxEntry* pEntry ); - void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + void EntrySelected( SvLBoxEntry*, sal_Bool bSelect ); void Paint( const Rectangle& rRect ); void RepaintSelectionItems(); void MouseButtonDown( const MouseEvent& ); void MouseButtonUp( const MouseEvent& ); void MouseMove( const MouseEvent&); - BOOL KeyInput( const KeyEvent& ); + sal_Bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); void LoseFocus(); @@ -201,8 +201,8 @@ public: void PaintEntry( SvLBoxEntry*, const Point&, SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0); void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, - BOOL bAdjustRow = FALSE, - BOOL bCheckScrollBars = FALSE ); + sal_Bool bAdjustRow = sal_False, + sal_Bool bCheckScrollBars = sal_False ); void InvalidateEntry( SvLBoxEntry* ); void ViewDataInitialized( SvLBoxEntry* pEntry ); SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos ); @@ -217,7 +217,7 @@ public: SvLBoxEntry* GetCurEntry() const { return pCursor; } void SetCursor( SvLBoxEntry* ); - BOOL IsEntryInView( SvLBoxEntry* ); + sal_Bool IsEntryInView( SvLBoxEntry* ); SvLBoxEntry* GetEntry( const Point& rDocPos ); SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); @@ -237,7 +237,7 @@ public: SvIcnVwDataEntry* pViewData=0 ); Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0, const Point* pPos = 0, - BOOL bForInplaceEdit = FALSE, + sal_Bool bForInplaceEdit = sal_False, SvIcnVwDataEntry* pViewData = 0 ); long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const; @@ -254,22 +254,22 @@ public: SvIcnVwDataEntry* pViewData=0); void InvalidateBoundingRect( SvLBoxEntry* ); void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; } - BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } + sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); } - void PaintEmphasis( const Rectangle&, BOOL bSelected, - BOOL bCursored, OutputDevice* pOut = 0 ); + void PaintEmphasis( const Rectangle&, sal_Bool bSelected, + sal_Bool bCursored, OutputDevice* pOut = 0 ); void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem, - SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 ); - // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE + SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut = 0 ); + // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); } // berechnet alle invalidierten BoundingRects neu void UpdateBoundingRects(); - void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ); + void ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow ); SvLBoxEntry* GetDropTarget( const Point& rPosPixel ); - BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); - BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); + sal_Bool NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ); + sal_Bool NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ); void WriteDragServerInfo( const Point&, SvLBoxDDInfo* ); void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); @@ -277,9 +277,9 @@ public: void SetCurParent( SvLBoxEntry* pNewParent ); SvLBoxEntry* GetCurParent() const { return pCurParent; } - USHORT GetSelectionCount() const; + sal_uInt16 GetSelectionCount() const; void SetGrid( long nDX, long nDY ); - void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); + void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False ); const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*, const SvIcnVwDataEntry* pViewData = 0 ) const; void PrepareCommandEvent( const Point& rPt ); @@ -290,18 +290,18 @@ public: SvLBoxEntry* mpViewData; - BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; - void SelectRect( const Rectangle&, BOOL bAdd = TRUE, + sal_Bool IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; + void SelectRect( const Rectangle&, sal_Bool bAdd = sal_True, SvPtrarr* pOtherRects = 0, short nOffs = SELRECT_BORDER_OFFS ); void DrawSelectionRect( const Rectangle& ); void HideSelectionRect(); void CalcScrollOffsets( const Point& rRefPosPixel, - long& rX, long& rY, BOOL bDragDrop = FALSE, - USHORT nBorderWidth = 10 ); + long& rX, long& rY, sal_Bool bDragDrop = sal_False, + sal_uInt16 nBorderWidth = 10 ); void EndTracking(); - BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); - void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE); + sal_Bool IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); + void MakeVisible( const Rectangle& rDocPos,sal_Bool bInScrollBarEvent=sal_False); void AdjustAtGrid( SvLBoxEntry* pStart = 0 ); void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 ); SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0, diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx index aab52eeffa63..5d6db03f73a7 100644 --- a/svtools/source/inc/xbmread.hxx +++ b/svtools/source/inc/xbmread.hxx @@ -69,13 +69,13 @@ class XBMReader : public GraphicReader long nLastPos; long nWidth; long nHeight; - BOOL bStatus; + sal_Bool bStatus; void InitTable(); ByteString FindTokenLine( SvStream* pInStm, const char* pTok1, const char* pTok2 = NULL, const char* pTok3 = NULL ); long ParseDefine( const sal_Char* pDefine ); - BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ); + sal_Bool ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ); public: @@ -92,6 +92,6 @@ public: // - ImportXBM - // ------------- -BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic ); +sal_Bool ImportXBM( SvStream& rStream, Graphic& rGraphic ); #endif // _XBMREAD_HXX diff --git a/svtools/source/inc/xpmread.hxx b/svtools/source/inc/xpmread.hxx index 29edd15a3b1c..aea09db7596e 100644 --- a/svtools/source/inc/xpmread.hxx +++ b/svtools/source/inc/xpmread.hxx @@ -83,35 +83,35 @@ private: BitmapWriteAccess* mpMaskAcc; long mnLastPos; - ULONG mnWidth; - ULONG mnHeight; - ULONG mnColors; - ULONG mnCpp; // characters per pix - BOOL mbTransparent; - BOOL mbStatus; - ULONG mnStatus; - ULONG mnIdentifier; - BYTE mcThisByte; - BYTE mcLastByte; - ULONG mnTempAvail; - BYTE* mpTempBuf; - BYTE* mpTempPtr; - BYTE* mpFastColorTable; - BYTE* mpColMap; - ULONG mnStringSize; - BYTE* mpStringBuf; - ULONG mnParaSize; - BYTE* mpPara; - - BOOL ImplGetString( void ); - BOOL ImplGetColor( ULONG ); - BOOL ImplGetScanLine( ULONG ); - BOOL ImplGetColSub( BYTE* ); - BOOL ImplGetColKey( BYTE ); - void ImplGetRGBHex( BYTE*, ULONG ); - BOOL ImplGetPara( ULONG numb ); - BOOL ImplCompare( BYTE*, BYTE*, ULONG, ULONG nmode = XPMCASENONSENSITIVE ); - ULONG ImplGetULONG( ULONG nPara ); + sal_uLong mnWidth; + sal_uLong mnHeight; + sal_uLong mnColors; + sal_uLong mnCpp; // characters per pix + sal_Bool mbTransparent; + sal_Bool mbStatus; + sal_uLong mnStatus; + sal_uLong mnIdentifier; + sal_uInt8 mcThisByte; + sal_uInt8 mcLastByte; + sal_uLong mnTempAvail; + sal_uInt8* mpTempBuf; + sal_uInt8* mpTempPtr; + sal_uInt8* mpFastColorTable; + sal_uInt8* mpColMap; + sal_uLong mnStringSize; + sal_uInt8* mpStringBuf; + sal_uLong mnParaSize; + sal_uInt8* mpPara; + + sal_Bool ImplGetString( void ); + sal_Bool ImplGetColor( sal_uLong ); + sal_Bool ImplGetScanLine( sal_uLong ); + sal_Bool ImplGetColSub( sal_uInt8* ); + sal_Bool ImplGetColKey( sal_uInt8 ); + void ImplGetRGBHex( sal_uInt8*, sal_uLong ); + sal_Bool ImplGetPara( sal_uLong numb ); + sal_Bool ImplCompare( sal_uInt8*, sal_uInt8*, sal_uLong, sal_uLong nmode = XPMCASENONSENSITIVE ); + sal_uLong ImplGetULONG( sal_uLong nPara ); public: XPMReader( SvStream& rStm ); @@ -126,6 +126,6 @@ public: // - ImportXPM - // ------------- -BOOL ImportXPM( SvStream& rStream, Graphic& rGraphic ); +sal_Bool ImportXPM( SvStream& rStream, Graphic& rGraphic ); #endif // _XPMREAD_HXX diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index a7420dbc388f..1b236a1e4bee 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -137,7 +137,7 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque com::sun::star::java::RestartRequiredException e5; // Try to recover the Exception type in the any and // react accordingly. - USHORT nResult = RET_CANCEL; + sal_uInt16 nResult = RET_CANCEL; ::rtl::OUString aParameter; if ( anyExc >>= e1 ) diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index b89f30997950..59df22b580c6 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -286,7 +286,7 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey) sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 ); sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 ); sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 ); - USHORT nKey = (USHORT)aAWTKey.KeyCode; + sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode; return KeyCode(nKey, bShift, bMod1, bMod2, bMod3); } diff --git a/svtools/source/misc/cliplistener.cxx b/svtools/source/misc/cliplistener.cxx index a4e13be1d884..266950f10697 100644 --- a/svtools/source/misc/cliplistener.cxx +++ b/svtools/source/misc/cliplistener.cxx @@ -68,7 +68,7 @@ void SAL_CALL TransferableClipboardListener::changedContents( } } -void TransferableClipboardListener::AddRemoveListener( Window* pWin, BOOL bAdd ) +void TransferableClipboardListener::AddRemoveListener( Window* pWin, sal_Bool bAdd ) { try { diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 5e20e2197fb7..a8af73419271 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -47,9 +47,9 @@ //========================================================================= -static USHORT aWndFunc( +static sal_uInt16 aWndFunc( Window *pWin, // Parent des Dialoges - USHORT nFlags, + sal_uInt16 nFlags, const String &rErr, // Fehlertext const String &rAction) // Actiontext @@ -132,7 +132,7 @@ static USHORT aWndFunc( } } - USHORT nRet = RET_CANCEL; + sal_uInt16 nRet = RET_CANCEL; switch ( pBox->Execute() ) { case RET_OK: @@ -160,7 +160,7 @@ static USHORT aWndFunc( //------------------------------------------------------------------------- -SfxErrorHandler::SfxErrorHandler(USHORT nIdP, ULONG lStartP, ULONG lEndP, ResMgr *pMgrP) : +SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, sal_uLong lStartP, sal_uLong lEndP, ResMgr *pMgrP) : lStart(lStartP), lEnd(lEndP), nId(nIdP), pMgr(pMgrP), pFreeMgr( NULL ) @@ -183,8 +183,8 @@ SfxErrorHandler::~SfxErrorHandler() //------------------------------------------------------------------------- -BOOL SfxErrorHandler::CreateString( - const ErrorInfo *pErr, String &rStr, USHORT& nFlags) const +sal_Bool SfxErrorHandler::CreateString( + const ErrorInfo *pErr, String &rStr, sal_uInt16& nFlags) const /* [Beschreibung] @@ -193,9 +193,9 @@ BOOL SfxErrorHandler::CreateString( */ { - ULONG nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK; + sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK; if( nErrCode>=lEnd || nErrCode<=lStart ) - return FALSE; + return sal_False; MessageInfo *pMsgInfo=PTR_CAST(MessageInfo,pErr); if(pMsgInfo) { @@ -209,7 +209,7 @@ BOOL SfxErrorHandler::CreateString( break; i = i + pMsgInfo->GetMessageArg().Len(); } - return TRUE; + return sal_True; } } else if(GetErrorString(nErrCode, rStr, nFlags)) @@ -229,10 +229,10 @@ BOOL SfxErrorHandler::CreateString( TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo, pErr); if (pTwoStringInfo) - for (USHORT i = 0; i < rStr.Len();) + for (sal_uInt16 i = 0; i < rStr.Len();) { - USHORT nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i); - USHORT nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i); + sal_uInt16 nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i); + sal_uInt16 nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i); if (nArg1Pos < nArg2Pos) { rStr.Replace(nArg1Pos, 7, pTwoStringInfo->GetArg1()); @@ -246,9 +246,9 @@ BOOL SfxErrorHandler::CreateString( else break; } } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } //------------------------------------------------------------------------- @@ -263,9 +263,9 @@ class ResString: public String */ { - USHORT nFlags; + sal_uInt16 nFlags; public: - USHORT GetFlags() const {return nFlags;} + sal_uInt16 GetFlags() const {return nFlags;} const String & GetString() const {return *this;} ResString( ResId &rId); }; @@ -273,14 +273,14 @@ class ResString: public String //------------------------------------------------------------------------- ResString::ResString(ResId & rId): - String(rId.SetAutoRelease(FALSE)), + String(rId.SetAutoRelease(sal_False)), nFlags(0) { ResMgr * pResMgr = rId.GetResMgr(); // String ctor temporarily sets global ResManager if (pResMgr->GetRemainSize()) - nFlags = USHORT(pResMgr->ReadShort()); - rId.SetAutoRelease(TRUE); + nFlags = sal_uInt16(pResMgr->ReadShort()); + rId.SetAutoRelease(sal_True); pResMgr->PopContext(); } @@ -297,18 +297,18 @@ struct ErrorResource_Impl : private Resource ResId aResId; - ErrorResource_Impl(ResId& rErrIdP, USHORT nId) + ErrorResource_Impl(ResId& rErrIdP, sal_uInt16 nId) : Resource(rErrIdP),aResId(nId,*rErrIdP.GetResMgr()){} ~ErrorResource_Impl() { FreeResource(); } operator ResString(){ return ResString( aResId ); } - operator BOOL(){return IsAvailableRes(aResId.SetRT(RSC_STRING));} + operator sal_Bool(){return IsAvailableRes(aResId.SetRT(RSC_STRING));} }; -BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const +sal_Bool SfxErrorHandler::GetClassString(sal_uLong lClassId, String &rStr) const /* [Beschreibung] @@ -318,17 +318,17 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const */ { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILocale() ); ResMgr* pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(ofa), aLocale ); if( pResMgr ) { ResId aId(RID_ERRHDL, *pResMgr ); - ErrorResource_Impl aEr(aId, (USHORT)lClassId); + ErrorResource_Impl aEr(aId, (sal_uInt16)lClassId); if(aEr) { rStr=((ResString)aEr).GetString(); - bRet = TRUE; + bRet = sal_True; } } delete pResMgr; @@ -337,8 +337,8 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const //------------------------------------------------------------------------- -BOOL SfxErrorHandler::GetMessageString( - ULONG lErrId, String &rStr, USHORT &nFlags) const +sal_Bool SfxErrorHandler::GetMessageString( + sal_uLong lErrId, String &rStr, sal_uInt16 &nFlags) const /* [Beschreibung] @@ -347,18 +347,18 @@ BOOL SfxErrorHandler::GetMessageString( */ { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; ResId *pResId= new ResId(nId, *pMgr); - ErrorResource_Impl aEr(*pResId, (USHORT)lErrId); + ErrorResource_Impl aEr(*pResId, (sal_uInt16)lErrId); if(aEr) { ResString aErrorString(aEr); - USHORT nResFlags = aErrorString.GetFlags(); + sal_uInt16 nResFlags = aErrorString.GetFlags(); if( nResFlags ) nFlags=aErrorString.GetFlags(); rStr = aErrorString.GetString(); - bRet = TRUE; + bRet = sal_True; } delete pResId; @@ -367,8 +367,8 @@ BOOL SfxErrorHandler::GetMessageString( //------------------------------------------------------------------------- -BOOL SfxErrorHandler::GetErrorString( - ULONG lErrId, String &rStr, USHORT &nFlags) const +sal_Bool SfxErrorHandler::GetErrorString( + sal_uLong lErrId, String &rStr, sal_uInt16 &nFlags) const /* [Beschreibung] Erzeugt den Fehlerstring fuer den eigentlichen Fehler ohne @@ -379,25 +379,25 @@ BOOL SfxErrorHandler::GetErrorString( { vos:: OGuard aGuard( Application::GetSolarMutex() ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; rStr=String(SvtResId(RID_ERRHDL_CLASS)); ResId aResId(nId, *pMgr); { - ErrorResource_Impl aEr(aResId, (USHORT)lErrId); + ErrorResource_Impl aEr(aResId, (sal_uInt16)lErrId); if(aEr) { ResString aErrorString(aEr); - USHORT nResFlags = aErrorString.GetFlags(); + sal_uInt16 nResFlags = aErrorString.GetFlags(); if ( nResFlags ) nFlags = nResFlags; rStr.SearchAndReplace( String::CreateFromAscii("$(ERROR)"), aErrorString.GetString()); - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; } if( bRet ) @@ -416,7 +416,7 @@ BOOL SfxErrorHandler::GetErrorString( //------------------------------------------------------------------------- SfxErrorContext::SfxErrorContext( - USHORT nCtxIdP, Window *pWindow, USHORT nResIdP, ResMgr *pMgrP) + sal_uInt16 nCtxIdP, Window *pWindow, sal_uInt16 nResIdP, ResMgr *pMgrP) : ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP) { if( nResId==USHRT_MAX ) @@ -426,8 +426,8 @@ SfxErrorContext::SfxErrorContext( //------------------------------------------------------------------------- SfxErrorContext::SfxErrorContext( - USHORT nCtxIdP, const String &aArg1P, Window *pWindow, - USHORT nResIdP, ResMgr *pMgrP) + sal_uInt16 nCtxIdP, const String &aArg1P, Window *pWindow, + sal_uInt16 nResIdP, ResMgr *pMgrP) : ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP), aArg1(aArg1P) { @@ -437,7 +437,7 @@ SfxErrorContext::SfxErrorContext( //------------------------------------------------------------------------- -BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr) +sal_Bool SfxErrorContext::GetString(sal_uLong nErrId, String &rStr) /* [Beschreibung] @@ -473,7 +473,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr) if ( bRet ) { - USHORT nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR; + sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR; ResId aSfxResId( RID_ERRCTX, *pMgr ); ErrorResource_Impl aEr( aSfxResId, nId ); rStr.SearchAndReplace( String::CreateFromAscii( "$(ERR)" ), ( (ResString)aEr ).GetString() ); diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index a96067f95186..239e9dcfa665 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -245,7 +245,7 @@ struct EmbeddedObjectRef_Impl Graphic* pGraphic; Graphic* pHCGraphic; sal_Int64 nViewAspect; - BOOL bIsLocked; + sal_Bool bIsLocked; sal_Bool bNeedUpdate; // #i104867# @@ -260,7 +260,7 @@ void EmbeddedObjectRef::Construct_Impl() mpImp->pGraphic = 0; mpImp->pHCGraphic = 0; mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT; - mpImp->bIsLocked = FALSE; + mpImp->bIsLocked = sal_False; mpImp->bNeedUpdate = sal_False; mpImp->mnGraphicVersion = 0; mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000); @@ -398,7 +398,7 @@ void EmbeddedObjectRef::Clear() } mpImp->pContainer = 0; - mpImp->bIsLocked = FALSE; + mpImp->bIsLocked = sal_False; mpImp->bNeedUpdate = sal_False; } @@ -440,17 +440,17 @@ void EmbeddedObjectRef::SetViewAspect( sal_Int64 nAspect ) mpImp->nViewAspect = nAspect; } -void EmbeddedObjectRef::Lock( BOOL bLock ) +void EmbeddedObjectRef::Lock( sal_Bool bLock ) { mpImp->bIsLocked = bLock; } -BOOL EmbeddedObjectRef::IsLocked() const +sal_Bool EmbeddedObjectRef::IsLocked() const { return mpImp->bIsLocked; } -void EmbeddedObjectRef::GetReplacement( BOOL bUpdate ) +void EmbeddedObjectRef::GetReplacement( sal_Bool bUpdate ) { if ( bUpdate ) { @@ -489,7 +489,7 @@ Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const // bNeedUpdate will be set to false while retrieving new replacement const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True ); else if ( !mpImp->pGraphic ) - const_cast < EmbeddedObjectRef* >(this)->GetReplacement( FALSE ); + const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False ); if ( mpImp->pGraphic && pMediaType ) *pMediaType = mpImp->aMediaType; @@ -669,7 +669,7 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri mpImp->bNeedUpdate = sal_False; } -SvStream* EmbeddedObjectRef::GetGraphicStream( BOOL bUpdate ) const +SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const { RTL_LOGFILE_CONTEXT( aLog, "svtools (mv76033) svt::EmbeddedObjectRef::GetGraphicStream" ); DBG_ASSERT( bUpdate || mpImp->pContainer, "Can't retrieve current graphic!" ); @@ -723,7 +723,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri MapMode aMM( MAP_APPFONT ); Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, NULL ); Font aFnt( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Helvetica" ) ), aAppFontSz ); - aFnt.SetTransparent( TRUE ); + aFnt.SetTransparent( sal_True ); aFnt.SetColor( Color( COL_LIGHTRED ) ); aFnt.SetWeight( WEIGHT_BOLD ); aFnt.SetFamily( FAMILY_SWISS ); @@ -735,14 +735,14 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri Point aPt; // Nun den Text so skalieren, dass er in das Rect passt. // Wir fangen mit der Defaultsize an und gehen 1-AppFont runter - for( USHORT i = 8; i > 2; i-- ) + for( sal_uInt16 i = 8; i > 2; i-- ) { aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2; aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2; - BOOL bTiny = FALSE; - if( aPt.X() < 0 ) bTiny = TRUE, aPt.X() = 0; - if( aPt.Y() < 0 ) bTiny = TRUE, aPt.Y() = 0; + sal_Bool bTiny = sal_False; + if( aPt.X() < 0 ) bTiny = sal_True, aPt.X() = 0; + if( aPt.Y() < 0 ) bTiny = sal_True, aPt.Y() = 0; if( bTiny ) { // heruntergehen bei kleinen Bildern @@ -804,8 +804,8 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut aPixSize.Width() -= 1; aPixSize.Height() -= 1; Point aPixViewPos = pOut->LogicToPixel( rRect.TopLeft() ); - INT32 nMax = aPixSize.Width() + aPixSize.Height(); - for( INT32 i = 5; i < nMax; i += 5 ) + sal_Int32 nMax = aPixSize.Width() + aPixSize.Height(); + for( sal_Int32 i = 5; i < nMax; i += 5 ) { Point a1( aPixViewPos ), a2( aPixViewPos ); if( i > aPixSize.Width() ) @@ -824,15 +824,15 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut } -BOOL EmbeddedObjectRef::TryRunningState() +sal_Bool EmbeddedObjectRef::TryRunningState() { return TryRunningState( mxObj ); } -BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj ) +sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj ) { if ( !xEmbObj.is() ) - return FALSE; + return sal_False; try { @@ -841,10 +841,10 @@ BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbedded } catch ( uno::Exception& ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } void EmbeddedObjectRef::SetGraphicToContainer( const Graphic& rGraphic, @@ -907,7 +907,7 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand() } } -BOOL EmbeddedObjectRef::IsChart() const +sal_Bool EmbeddedObjectRef::IsChart() const { //todo maybe for 3.0: //if the changes work good for chart diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index e49cf0ab62cf..451eee04d814 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -110,21 +110,21 @@ sal_Bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::D // TODO/LATER: Propbably the graphic should be copied here as well // currently it is handled by the applications utl::TempFile aTmp; - aTmp.EnableKillingFile( TRUE ); + aTmp.EnableKillingFile( sal_True ); uno::Reference < embed::XEmbedPersist > xPers( m_xObj, uno::UNO_QUERY ); if ( xPers.is() ) { uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetTemporaryStorage(); ::rtl::OUString aName = ::rtl::OUString::createFromAscii("Dummy"); SvStream* pStream = NULL; - BOOL bDeleteStream = FALSE; + sal_Bool bDeleteStream = sal_False; uno::Sequence < beans::PropertyValue > aEmpty; xPers->storeToEntry( xStg, aName, aEmpty, aEmpty ); if ( xStg->isStreamElement( aName ) ) { uno::Reference < io::XStream > xStm = xStg->cloneStreamElement( aName ); pStream = utl::UcbStreamHelper::CreateStream( xStm ); - bDeleteStream = TRUE; + bDeleteStream = sal_True; } else { @@ -251,6 +251,6 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) ); rDesc.maDragStartPos = Point(); rDesc.maDisplayName = String(); - rDesc.mbCanLink = FALSE; + rDesc.mbCanLink = sal_False; } diff --git a/svtools/source/misc/helpagentwindow.cxx b/svtools/source/misc/helpagentwindow.cxx index a909c2f77ca9..a270e8b68bf9 100644 --- a/svtools/source/misc/helpagentwindow.cxx +++ b/svtools/source/misc/helpagentwindow.cxx @@ -99,7 +99,7 @@ namespace svt m_aPreferredSize.Height() += aSize.Height() - aOutputSize.Height(); SetPointer(Pointer(POINTER_REFHAND)); - AlwaysEnableInput( TRUE, TRUE ); + AlwaysEnableInput( sal_True, sal_True ); // unique id for the testtool SetUniqueId( HID_HELPAGENT_WINDOW ); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 4dbd132b9dc8..0fa861281196 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -56,160 +56,160 @@ // globals ******************************************************************* -#define NO_INDEX ((USHORT)0xFFFF) +#define NO_INDEX ((sal_uInt16)0xFFFF) #define CONTENT_HELPER ::utl::UCBContentHelper #define ASCII_STRING(s) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) ) struct SvtExtensionResIdMapping_Impl { const char* _pExt; - BOOL _bExt; - USHORT _nStrId; - USHORT _nImgId; + sal_Bool _bExt; + sal_uInt16 _nStrId; + sal_uInt16 _nImgId; }; static SvtExtensionResIdMapping_Impl __READONLY_DATA ExtensionMap_Impl[] = { - { "awk", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "bas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "bat", TRUE, STR_DESCRIPTION_BATCHFILE, 0 }, - { "bmk", FALSE, STR_DESCRIPTION_BOOKMARKFILE, 0 }, - { "bmp", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP }, - { "c", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "cfg", FALSE, STR_DESCRIPTION_CFGFILE, 0 }, - { "cmd", TRUE, STR_DESCRIPTION_BATCHFILE, 0 }, - { "cob", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "com", TRUE, STR_DESCRIPTION_APPLICATION, 0 }, - { "cxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "dbf", TRUE, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE }, - { "def", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "dll", TRUE, STR_DESCRIPTION_SYSFILE, 0 }, - { "doc", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, - { "dot", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE }, - { "docx", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, - { "dxf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF }, - { "exe", TRUE, STR_DESCRIPTION_APPLICATION, 0 }, - { "gif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF }, - { "h", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "hlp", FALSE, STR_DESCRIPTION_HELP_DOC, 0 }, - { "hrc", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "htm", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "html", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "asp", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "hxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "ini", FALSE, STR_DESCRIPTION_CFGFILE, 0 }, - { "java", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "jpeg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, - { "jpg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, - { "lha", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "awk", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "bas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "bat", sal_True, STR_DESCRIPTION_BATCHFILE, 0 }, + { "bmk", sal_False, STR_DESCRIPTION_BOOKMARKFILE, 0 }, + { "bmp", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP }, + { "c", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "cfg", sal_False, STR_DESCRIPTION_CFGFILE, 0 }, + { "cmd", sal_True, STR_DESCRIPTION_BATCHFILE, 0 }, + { "cob", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "com", sal_True, STR_DESCRIPTION_APPLICATION, 0 }, + { "cxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "dbf", sal_True, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE }, + { "def", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "dll", sal_True, STR_DESCRIPTION_SYSFILE, 0 }, + { "doc", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, + { "dot", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE }, + { "docx", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, + { "dxf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF }, + { "exe", sal_True, STR_DESCRIPTION_APPLICATION, 0 }, + { "gif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF }, + { "h", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "hlp", sal_False, STR_DESCRIPTION_HELP_DOC, 0 }, + { "hrc", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "htm", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "html", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "asp", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "hxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "ini", sal_False, STR_DESCRIPTION_CFGFILE, 0 }, + { "java", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "jpeg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, + { "jpg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, + { "lha", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, #ifdef WNT - { "lnk", FALSE, 0, 0 }, + { "lnk", sal_False, 0, 0 }, #endif - { "log", TRUE, STR_DESCRIPTION_LOGFILE, 0 }, - { "lst", TRUE, STR_DESCRIPTION_LOGFILE, 0 }, - { "met", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET }, - { "mml", FALSE, STR_DESCRIPTION_MATHML_DOC, IMG_MATH }, - { "mod", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "odb", FALSE, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC }, - { "odg", FALSE, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC }, - { "odf", FALSE, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC }, - { "odm", FALSE, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC }, - { "odp", FALSE, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC }, - { "ods", FALSE, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC }, - { "odt", FALSE, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC }, - { "otg", FALSE, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE }, - { "otp", FALSE, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE }, - { "ots", FALSE, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE }, - { "ott", FALSE, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE }, - { "pas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "pcd", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD }, - { "pct", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT }, - { "pcx", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX }, - { "pl", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "png", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG }, - { "rar", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "rtf", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, - { "sbl", FALSE, 0, 0 }, - { "sch", FALSE, 0, 0 }, - { "sda", FALSE, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW }, - { "sdb", FALSE, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE }, - { "sdc", FALSE, STR_DESCRIPTION_SCALC_DOC, IMG_CALC }, - { "sdd", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS }, - { "sdp", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, 0 }, - { "sds", FALSE, STR_DESCRIPTION_SCHART_DOC, 0 }, - { "sdw", FALSE, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER }, - { "sga", FALSE, 0, 0 }, - { "sgf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF }, - { "sgl", FALSE, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC }, - { "sgv", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV }, - { "shtml", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "sim", FALSE, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM }, - { "smf", FALSE, STR_DESCRIPTION_SMATH_DOC, IMG_MATH }, - { "src", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "svh", FALSE, STR_DESCRIPTION_HELP_DOC, 0 }, - { "svm", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM }, - { "stc", FALSE, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE }, - { "std", FALSE, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE }, - { "sti", FALSE, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE }, - { "stw", FALSE, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE }, - { "sxc", FALSE, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC }, - { "sxd", FALSE, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW }, - { "sxg", FALSE, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC }, - { "sxi", FALSE, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS }, - { "sxm", FALSE, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH }, - { "sxs", FALSE, STR_DESCRIPTION_SXCHART_DOC, 0 }, - { "sxw", FALSE, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER }, - { "sys", TRUE, STR_DESCRIPTION_SYSFILE, 0 }, - { "tif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, - { "tiff", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, - { "txt", FALSE, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE }, - { "url", FALSE, STR_DESCRIPTION_LINK, 0 }, - { "vor", FALSE, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE }, - { "vxd", TRUE, STR_DESCRIPTION_SYSFILE, 0 }, - { "wmf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF }, - { "xls", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, - { "xlt", FALSE, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE }, - { "xlsx", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, - { "uu", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "uue", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "z", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "zip", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "zoo", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "gz", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "ppt", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, - { "pot", FALSE, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE }, - { "pps", FALSE, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS }, - { "pptx", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, - { "oxt", FALSE, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION }, - { 0, FALSE, 0, 0 } + { "log", sal_True, STR_DESCRIPTION_LOGFILE, 0 }, + { "lst", sal_True, STR_DESCRIPTION_LOGFILE, 0 }, + { "met", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET }, + { "mml", sal_False, STR_DESCRIPTION_MATHML_DOC, IMG_MATH }, + { "mod", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "odb", sal_False, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC }, + { "odg", sal_False, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC }, + { "odf", sal_False, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC }, + { "odm", sal_False, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC }, + { "odp", sal_False, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC }, + { "ods", sal_False, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC }, + { "odt", sal_False, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC }, + { "otg", sal_False, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE }, + { "otp", sal_False, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE }, + { "ots", sal_False, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE }, + { "ott", sal_False, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE }, + { "pas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "pcd", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD }, + { "pct", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT }, + { "pcx", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX }, + { "pl", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "png", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG }, + { "rar", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "rtf", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, + { "sbl", sal_False, 0, 0 }, + { "sch", sal_False, 0, 0 }, + { "sda", sal_False, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW }, + { "sdb", sal_False, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE }, + { "sdc", sal_False, STR_DESCRIPTION_SCALC_DOC, IMG_CALC }, + { "sdd", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS }, + { "sdp", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, 0 }, + { "sds", sal_False, STR_DESCRIPTION_SCHART_DOC, 0 }, + { "sdw", sal_False, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER }, + { "sga", sal_False, 0, 0 }, + { "sgf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF }, + { "sgl", sal_False, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC }, + { "sgv", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV }, + { "shtml", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "sim", sal_False, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM }, + { "smf", sal_False, STR_DESCRIPTION_SMATH_DOC, IMG_MATH }, + { "src", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "svh", sal_False, STR_DESCRIPTION_HELP_DOC, 0 }, + { "svm", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM }, + { "stc", sal_False, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE }, + { "std", sal_False, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE }, + { "sti", sal_False, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE }, + { "stw", sal_False, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE }, + { "sxc", sal_False, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC }, + { "sxd", sal_False, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW }, + { "sxg", sal_False, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC }, + { "sxi", sal_False, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS }, + { "sxm", sal_False, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH }, + { "sxs", sal_False, STR_DESCRIPTION_SXCHART_DOC, 0 }, + { "sxw", sal_False, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER }, + { "sys", sal_True, STR_DESCRIPTION_SYSFILE, 0 }, + { "tif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, + { "tiff", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, + { "txt", sal_False, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE }, + { "url", sal_False, STR_DESCRIPTION_LINK, 0 }, + { "vor", sal_False, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE }, + { "vxd", sal_True, STR_DESCRIPTION_SYSFILE, 0 }, + { "wmf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF }, + { "xls", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, + { "xlt", sal_False, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE }, + { "xlsx", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, + { "uu", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "uue", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "z", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "zip", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "zoo", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "gz", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "ppt", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, + { "pot", sal_False, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE }, + { "pps", sal_False, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS }, + { "pptx", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, + { "oxt", sal_False, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION }, + { 0, sal_False, 0, 0 } }; #ifdef OS2 SvtExtensionResIdMapping_Impl Mappings[] = { - {"StarWriter 4.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, - {"StarWriter 3.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, - {"StarCalc 4.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, - {"StarCalc 3.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, - {"StarImpress 4.0", FALSE,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS}, - {"StarDraw 4.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, - {"StarDraw 3.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, - {"StarChart 3.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, - {"StarChart 4.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, - {"Bitmap", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, - {"AutoCAD", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"Gif-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF}, - {"JPEG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG}, - {"Metafile ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"Photo-CD ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD}, - {"Mac Pict", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT}, - {"PCX-File ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX}, - {"PNG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"SV-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"TIFF-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF}, - {"MS-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF}, - {"XBM-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, - {"UniformResourceLocator", FALSE,STR_DESCRIPTION_LINK, IMG_URL}, + {"StarWriter 4.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, + {"StarWriter 3.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, + {"StarCalc 4.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, + {"StarCalc 3.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, + {"StarImpress 4.0", sal_False,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS}, + {"StarDraw 4.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, + {"StarDraw 3.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, + {"StarChart 3.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, + {"StarChart 4.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, + {"Bitmap", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, + {"AutoCAD", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"Gif-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF}, + {"JPEG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG}, + {"Metafile ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"Photo-CD ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD}, + {"Mac Pict", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT}, + {"PCX-File ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX}, + {"PNG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"SV-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"TIFF-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF}, + {"MS-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF}, + {"XBM-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, + {"UniformResourceLocator", sal_False,STR_DESCRIPTION_LINK, IMG_URL}, {NULL, 0} }; #endif @@ -245,7 +245,7 @@ static String GetImageExtensionByFactory_Impl( const String& rURL ) if ( aPath.Len() ) { - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; while ( Fac2ExtMap_Impl[ nIndex ]._pFactory ) { if ( aPath.EqualsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) ) @@ -303,12 +303,12 @@ static String GetImageExtensionByFactory_Impl( const String& rURL ) return aExtension; } -static USHORT GetIndexOfExtension_Impl( const String& rExtension ) +static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension ) { - USHORT nRet = NO_INDEX; + sal_uInt16 nRet = NO_INDEX; if ( rExtension.Len() ) { - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; String aExt = rExtension; aExt.ToLowerAscii(); while ( ExtensionMap_Impl[ nIndex ]._pExt ) @@ -325,12 +325,12 @@ static USHORT GetIndexOfExtension_Impl( const String& rExtension ) return nRet; } -static USHORT GetImageId_Impl( const String& rExtension ) +static sal_uInt16 GetImageId_Impl( const String& rExtension ) { - USHORT nImage = IMG_FILE; + sal_uInt16 nImage = IMG_FILE; if ( rExtension.Len() != NO_INDEX ) { - USHORT nIndex = GetIndexOfExtension_Impl( rExtension ); + sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension ); if ( nIndex != NO_INDEX ) { nImage = ExtensionMap_Impl[ nIndex ]._nImgId; @@ -366,9 +366,9 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool return bRet; } -static USHORT GetFolderImageId_Impl( const String& rURL ) +static sal_uInt16 GetFolderImageId_Impl( const String& rURL ) { - USHORT nRet = IMG_FOLDER; + sal_uInt16 nRet = IMG_FOLDER; ::svtools::VolumeInfo aVolumeInfo; try { @@ -396,12 +396,12 @@ static USHORT GetFolderImageId_Impl( const String& rURL ) return nRet; } -static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder ) +static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder ) { RTL_LOGFILE_CONTEXT_AUTHOR( aTimeLog, "svtools", "hb93813", "SvFileInformationManager::GetImageId_Impl()" ); String aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE ); - USHORT nImage = IMG_FILE; + sal_uInt16 nImage = IMG_FILE; if ( rObject.GetProtocol() == INET_PROT_PRIVATE ) { @@ -416,7 +416,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol return nImage; } else if ( aType == String( RTL_CONSTASCII_STRINGPARAM("image") ) ) - nImage = (USHORT)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32(); + nImage = (sal_uInt16)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32(); } else { @@ -424,7 +424,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol if ( aExt.EqualsAscii( "vor" ) ) { SotStorageRef aStorage = new SotStorage( sURL, STREAM_STD_READ ); - USHORT nId = IMG_WRITERTEMPLATE; + sal_uInt16 nId = IMG_WRITERTEMPLATE; if ( !aStorage->GetError() ) { SvGlobalName aGlobalName = aStorage->GetClassName(); @@ -453,13 +453,13 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol return nImage; } -static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt ) +static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt ) { - USHORT nId = 0; + sal_uInt16 nId = 0; if ( rExtension.Len() != NO_INDEX ) { - USHORT nIndex = GetIndexOfExtension_Impl( rExtension ); + sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension ); if ( nIndex != NO_INDEX ) { nId = ExtensionMap_Impl[ nIndex ]._nStrId; @@ -472,7 +472,7 @@ static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowE static String GetDescriptionByFactory_Impl( const String& rFactory ) { - USHORT nResId = 0; + sal_uInt16 nResId = 0; if ( rFactory.EqualsIgnoreCaseAscii( "swriter", 0, 7 ) ) nResId = STR_DESCRIPTION_FACTORY_WRITER; else if ( rFactory.EqualsIgnoreCaseAscii( "scalc", 0, 5 ) ) @@ -499,9 +499,9 @@ static String GetDescriptionByFactory_Impl( const String& rFactory ) return aRet; } -static USHORT GetFolderDescriptionId_Impl( const String& rURL ) +static sal_uInt16 GetFolderDescriptionId_Impl( const String& rURL ) { - USHORT nRet = STR_DESCRIPTION_FOLDER; + sal_uInt16 nRet = STR_DESCRIPTION_FOLDER; svtools::VolumeInfo aVolumeInfo; try { @@ -529,6 +529,7 @@ static USHORT GetFolderDescriptionId_Impl( const String& rURL ) return nRet; } +/* static ResMgr* GetIsoResMgr_Impl() { static ResMgr* pIsoResMgr = NULL; @@ -550,7 +551,7 @@ static ResMgr* GetIsoResMgr_Impl() return pIsoResMgr; } -static ImageList* CreateImageList_Impl( USHORT nResId ) +static ImageList* CreateImageList_Impl( sal_uInt16 nResId ) { ImageList* pList = NULL; ResMgr* pResMgr = GetIsoResMgr_Impl(); @@ -564,7 +565,7 @@ static ImageList* CreateImageList_Impl( USHORT nResId ) return pList; } -static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContrast ) +static Image GetOfficeImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig, sal_Bool bHighContrast ) { ImageList* pList = NULL; @@ -572,7 +573,7 @@ static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHigh static ImageList* _pBigOfficeImgList = NULL; static ImageList* _pSmallHCOfficeImgList = NULL; static ImageList* _pBigHCOfficeImgList = NULL; - static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); + static sal_uLong nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); // If the style has been changed, throw away our cache of the older images if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() ) @@ -585,11 +586,11 @@ static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHigh } // #i21242# MT: For B&W we need the HC Image and must transform. - // bHiContrast is TRUE for all dark backgrounds, but we need HC Images for HC White also, + // bHiContrast is sal_True for all dark backgrounds, but we need HC Images for HC White also, // so we can't rely on bHighContrast. - BOOL bBlackAndWhite = Application::GetSettings().GetStyleSettings().IsHighContrastBlackAndWhite(); + sal_Bool bBlackAndWhite = Application::GetSettings().GetStyleSettings().IsHighContrastBlackAndWhite(); if ( bBlackAndWhite ) - bHighContrast = TRUE; + bHighContrast = sal_True; if ( bBig ) @@ -638,8 +639,9 @@ static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHigh return aImage; } +*/ -static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContrast ) +static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig, sal_Bool bHighContrast ) { if ( !bBig && IMG_FOLDER == nImageId && !bHighContrast ) // return our new small folder image (256 colors) @@ -651,7 +653,7 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContra static ImageList* _pBigImageList = NULL; static ImageList* _pSmallHCImageList = NULL; static ImageList* _pBigHCImageList = NULL; - static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); + static sal_uLong nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); // If the style has been changed, throw away our cache of the older images if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() ) @@ -697,7 +699,8 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContra if ( pList->HasImageAtPos( nImageId ) ) return pList->GetImage( nImageId ); else - return GetOfficeImageFromList_Impl( nImageId, bBig, bHighContrast ); + return Image(); + //return GetOfficeImageFromList_Impl( nImageId, bBig, bHighContrast ); } //**************************************************************************** @@ -724,7 +727,7 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje String sDescription; String sExtension( rObject.getExtension() ), sURL( rObject.GetMainURL( INetURLObject::NO_DECODE ) ); - USHORT nResId = 0; + sal_uInt16 nResId = 0; sal_Bool bShowExt = sal_False, bDetected = sal_False, bOnlyFile = sal_False; sal_Bool bFolder = bDetectFolder ? CONTENT_HELPER::IsFolder( sURL ) : sal_False; if ( !bFolder ) @@ -790,41 +793,41 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje Image SvFileInformationManager::GetImage( const INetURLObject& rObject, sal_Bool bBig ) { - return GetImage( rObject, bBig, FALSE ); + return GetImage( rObject, bBig, sal_False ); } Image SvFileInformationManager::GetFileImage( const INetURLObject& rObject, sal_Bool bBig ) { - return GetFileImage( rObject, bBig, FALSE ); + return GetFileImage( rObject, bBig, sal_False ); } Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, sal_Bool bBig ) { - return GetImageNoDefault( rObject, bBig, FALSE ); + return GetImageNoDefault( rObject, bBig, sal_False ); } Image SvFileInformationManager::GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig ) { - return GetFolderImage( rInfo, bBig, FALSE ); + return GetFolderImage( rInfo, bBig, sal_False ); } Image SvFileInformationManager::GetImage( const INetURLObject& rObject, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = GetImageId_Impl( rObject, sal_True ); + sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True ); DBG_ASSERT( nImage, "invalid ImageId" ); return GetImageFromList_Impl( nImage, bBig, bHighContrast ); } Image SvFileInformationManager::GetFileImage( const INetURLObject& rObject, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = GetImageId_Impl( rObject, sal_False ); + sal_uInt16 nImage = GetImageId_Impl( rObject, sal_False ); DBG_ASSERT( nImage, "invalid ImageId" ); return GetImageFromList_Impl( nImage, bBig, bHighContrast ); } Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = GetImageId_Impl( rObject, sal_True ); + sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True ); DBG_ASSERT( nImage, "invalid ImageId" ); if ( nImage == IMG_FILE ) @@ -835,7 +838,7 @@ Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, Image SvFileInformationManager::GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = IMG_FOLDER; + sal_uInt16 nImage = IMG_FOLDER; DBG_ASSERT( nImage, "invalid ImageId" ); if ( rInfo.m_bIsRemote ) @@ -862,7 +865,7 @@ String SvFileInformationManager::GetFileDescription( const INetURLObject& rObjec String SvFileInformationManager::GetFolderDescription( const svtools::VolumeInfo& rInfo ) { - USHORT nResId = STR_DESCRIPTION_FOLDER; + sal_uInt16 nResId = STR_DESCRIPTION_FOLDER; if ( rInfo.m_bIsRemote ) nResId = STR_DESCRIPTION_REMOTE_VOLUME; else if ( rInfo.m_bIsFloppy ) diff --git a/svtools/source/misc/imagemgr.src b/svtools/source/misc/imagemgr.src index 03e68b3b30b7..d00a8717f709 100644 --- a/svtools/source/misc/imagemgr.src +++ b/svtools/source/misc/imagemgr.src @@ -32,6 +32,21 @@ // images ******************************************************************** #define X_IMAGE_LIST \ + IMG_IMPRESS ; \ + IMG_CALC ; \ + IMG_CALCTEMPLATE ; \ + IMG_CHART ; \ + IMG_IMPRESSTEMPLATE ; \ + IMG_HTML ; \ + IMG_MATH ; \ + IMG_WRITER ; \ + IMG_WRITERTEMPLATE ; \ + IMG_MACROLIB ; \ + IMG_GLOBAL_DOC ; \ + IMG_DRAW ; \ + IMG_DRAWTEMPLATE ; \ + IMG_NEWFROMTEMPLATE ; \ + IMG_DATABASE; \ IMG_WORKPLACE ; \ IMG_BITMAP ; \ IMG_EXCEL ; \ @@ -111,7 +126,7 @@ ImageList RID_SVTOOLS_IMAGELIST_BIG }; IdCount = { - 68 ; + 83 ; }; }; @@ -125,7 +140,7 @@ ImageList RID_SVTOOLS_IMAGELIST_SMALL }; IdCount = { - 68; + 83; }; }; @@ -139,7 +154,7 @@ ImageList RID_SVTOOLS_IMAGELIST_BIG_HIGHCONTRAST }; IdCount = { - 68 ; + 83 ; }; }; @@ -153,7 +168,7 @@ ImageList RID_SVTOOLS_IMAGELIST_SMALL_HIGHCONTRAST }; IdCount = { - 68; + 83; }; }; diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 4378e0acd234..425eb0ac8481 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -52,7 +52,7 @@ DBG_NAME( ImageMap ) /******************************************************************************/ -UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW; +sal_uInt16 IMapObject::nActualTextEncoding = (sal_uInt16) RTL_TEXTENCODING_DONTKNOW; /******************************************************************************/ @@ -64,7 +64,7 @@ IMapObject::IMapObject() } IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc, - const String& rTarget, const String& rName, BOOL bURLActive ) + const String& rTarget, const String& rName, sal_Bool bURLActive ) : aURL( rURL ) , aAltText( rAltText ) , aDesc( rDesc ) @@ -82,7 +82,7 @@ IMapObject::IMapObject( const String& rURL, const String& rAltText, const String |* \******************************************************************************/ -UINT16 IMapObject::GetVersion() const +sal_uInt16 IMapObject::GetVersion() const { return IMAP_OBJ_VERSION; } @@ -101,7 +101,7 @@ void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const rOStm << GetType(); rOStm << GetVersion(); - rOStm << ( (UINT16) eEncoding ); + rOStm << ( (sal_uInt16) eEncoding ); const ByteString aRelURL = ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), eEncoding ); rOStm.WriteByteString( aRelURL ); @@ -192,7 +192,7 @@ Point IMapObject::GetLogPoint( const Point& rPixelPoint ) |* \******************************************************************************/ -BOOL IMapObject::IsEqual( const IMapObject& rEqObj ) +sal_Bool IMapObject::IsEqual( const IMapObject& rEqObj ) { return ( ( aURL == rEqObj.aURL ) && ( aAltText == rEqObj.aAltText ) && @@ -213,8 +213,8 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect, const String& rDesc, const String& rTarget, const String& rName, - BOOL bURLActive, - BOOL bPixelCoords ) : + sal_Bool bURLActive, + sal_Bool bPixelCoords ) : IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ) { ImpConstruct( rRect, bPixelCoords ); @@ -227,7 +227,7 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect, |* \******************************************************************************/ -void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, BOOL bPixel ) +void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, sal_Bool bPixel ) { if ( bPixel ) aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MAP_100TH_MM ) ); @@ -266,7 +266,7 @@ void IMapRectangleObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -UINT16 IMapRectangleObject::GetType() const +sal_uInt16 IMapRectangleObject::GetType() const { return IMAP_OBJ_RECTANGLE; } @@ -278,7 +278,7 @@ UINT16 IMapRectangleObject::GetType() const |* \******************************************************************************/ -BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const +sal_Bool IMapRectangleObject::IsHit( const Point& rPoint ) const { return aRect.IsInside( rPoint ); } @@ -290,7 +290,7 @@ BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const |* \******************************************************************************/ -Rectangle IMapRectangleObject::GetRectangle( BOOL bPixelCoords ) const +Rectangle IMapRectangleObject::GetRectangle( sal_Bool bPixelCoords ) const { Rectangle aNewRect; @@ -330,7 +330,7 @@ void IMapRectangleObject::Scale( const Fraction& rFracX, const Fraction& rFracY |* \******************************************************************************/ -BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) +sal_Bool IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) { return ( IMapObject::IsEqual( rEqObj ) && ( aRect == rEqObj.aRect ) ); } @@ -340,14 +340,14 @@ BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) /******************************************************************************/ /******************************************************************************/ -IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius, +IMapCircleObject::IMapCircleObject( const Point& rCenter, sal_uLong nCircleRadius, const String& rURL, const String& rAltText, const String& rDesc, const String& rTarget, const String& rName, - BOOL bURLActive, - BOOL bPixelCoords ) : + sal_Bool bURLActive, + sal_Bool bPixelCoords ) : IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ) { ImpConstruct( rCenter, nCircleRadius, bPixelCoords ); @@ -360,7 +360,7 @@ IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius, |* \******************************************************************************/ -void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPixel ) +void IMapCircleObject::ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel ) { if ( bPixel ) { @@ -385,7 +385,7 @@ void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPix void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const { - UINT32 nTmp = nRadius; + sal_uInt32 nTmp = nRadius; rOStm << aCenter; rOStm << nTmp; @@ -400,7 +400,7 @@ void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const void IMapCircleObject::ReadIMapObject( SvStream& rIStm ) { - UINT32 nTmp; + sal_uInt32 nTmp; rIStm >> aCenter; rIStm >> nTmp; @@ -415,7 +415,7 @@ void IMapCircleObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -UINT16 IMapCircleObject::GetType() const +sal_uInt16 IMapCircleObject::GetType() const { return IMAP_OBJ_CIRCLE; } @@ -427,15 +427,15 @@ UINT16 IMapCircleObject::GetType() const |* \******************************************************************************/ -BOOL IMapCircleObject::IsHit( const Point& rPoint ) const +sal_Bool IMapCircleObject::IsHit( const Point& rPoint ) const { const Point aPoint( aCenter - rPoint ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - if ( (ULONG) sqrt( (double) aPoint.X() * aPoint.X() + + if ( (sal_uLong) sqrt( (double) aPoint.X() * aPoint.X() + aPoint.Y() * aPoint.Y() ) <= nRadius ) { - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -448,7 +448,7 @@ BOOL IMapCircleObject::IsHit( const Point& rPoint ) const |* \******************************************************************************/ -Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const +Point IMapCircleObject::GetCenter( sal_Bool bPixelCoords ) const { Point aNewPoint; @@ -467,9 +467,9 @@ Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const |* \******************************************************************************/ -ULONG IMapCircleObject::GetRadius( BOOL bPixelCoords ) const +sal_uLong IMapCircleObject::GetRadius( sal_Bool bPixelCoords ) const { - ULONG nNewRadius; + sal_uLong nNewRadius; if ( bPixelCoords ) nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MAP_100TH_MM ) ).Width(); @@ -523,7 +523,7 @@ void IMapCircleObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) |* \******************************************************************************/ -BOOL IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj ) +sal_Bool IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj ) { return ( IMapObject::IsEqual( rEqObj ) && ( aCenter == rEqObj.aCenter ) && @@ -540,10 +540,10 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly, const String& rDesc, const String& rTarget, const String& rName, - BOOL bURLActive, - BOOL bPixelCoords ) : + sal_Bool bURLActive, + sal_Bool bPixelCoords ) : IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ), - bEllipse ( FALSE ) + bEllipse ( sal_False ) { ImpConstruct( rPoly, bPixelCoords ); } @@ -555,7 +555,7 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly, |* \******************************************************************************/ -void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, BOOL bPixel ) +void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, sal_Bool bPixel ) { if ( bPixel ) aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MAP_100TH_MM ) ); @@ -603,7 +603,7 @@ void IMapPolygonObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -UINT16 IMapPolygonObject::GetType() const +sal_uInt16 IMapPolygonObject::GetType() const { return IMAP_OBJ_POLYGON; } @@ -615,7 +615,7 @@ UINT16 IMapPolygonObject::GetType() const |* \******************************************************************************/ -BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const +sal_Bool IMapPolygonObject::IsHit( const Point& rPoint ) const { return aPoly.IsInside( rPoint ); } @@ -627,7 +627,7 @@ BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const |* \******************************************************************************/ -Polygon IMapPolygonObject::GetPolygon( BOOL bPixelCoords ) const +Polygon IMapPolygonObject::GetPolygon( sal_Bool bPixelCoords ) const { Polygon aNewPoly; @@ -650,7 +650,7 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse ) { if ( aPoly.GetSize() ) { - bEllipse = TRUE; + bEllipse = sal_True; aEllipse = rEllipse; } } @@ -664,9 +664,9 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse ) void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) { - USHORT nCount = aPoly.GetSize(); + sal_uInt16 nCount = aPoly.GetSize(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { Point aScaledPt( aPoly[ i ] ); @@ -700,30 +700,30 @@ void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) |* \******************************************************************************/ -BOOL IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj ) +sal_Bool IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( IMapObject::IsEqual( rEqObj ) ) { const Polygon& rEqPoly = rEqObj.aPoly; - const USHORT nCount = aPoly.GetSize(); - const USHORT nEqCount = rEqPoly.GetSize(); - BOOL bDifferent = FALSE; + const sal_uInt16 nCount = aPoly.GetSize(); + const sal_uInt16 nEqCount = rEqPoly.GetSize(); + sal_Bool bDifferent = sal_False; if ( nCount == nEqCount ) { - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { if ( aPoly[ i ] != rEqPoly[ i ] ) { - bDifferent = TRUE; + bDifferent = sal_True; break; } } if ( !bDifferent ) - bRet = TRUE; + bRet = sal_True; } } @@ -758,9 +758,9 @@ ImageMap::ImageMap( const ImageMap& rImageMap ) { DBG_CTOR( ImageMap, NULL ); - USHORT nCount = rImageMap.GetIMapObjectCount(); + sal_uInt16 nCount = rImageMap.GetIMapObjectCount(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { IMapObject* pCopyObj = rImageMap.GetIMapObject( i ); @@ -831,11 +831,11 @@ void ImageMap::ClearImageMap() ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) { - USHORT nCount = rImageMap.GetIMapObjectCount(); + sal_uInt16 nCount = rImageMap.GetIMapObjectCount(); ClearImageMap(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { IMapObject* pCopyObj = rImageMap.GetIMapObject( i ); @@ -870,17 +870,17 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) |* \******************************************************************************/ -BOOL ImageMap::operator==( const ImageMap& rImageMap ) +sal_Bool ImageMap::operator==( const ImageMap& rImageMap ) { - const USHORT nCount = (USHORT) maList.Count(); - const USHORT nEqCount = rImageMap.GetIMapObjectCount(); - BOOL bRet = FALSE; + const sal_uInt16 nCount = (sal_uInt16) maList.Count(); + const sal_uInt16 nEqCount = rImageMap.GetIMapObjectCount(); + sal_Bool bRet = sal_False; if ( nCount == nEqCount ) { - BOOL bDifferent = ( aName != rImageMap.aName ); + sal_Bool bDifferent = ( aName != rImageMap.aName ); - for ( USHORT i = 0; ( i < nCount ) && !bDifferent; i++ ) + for ( sal_uInt16 i = 0; ( i < nCount ) && !bDifferent; i++ ) { IMapObject* pObj = (IMapObject*) maList.GetObject( i ); IMapObject* pEqObj = rImageMap.GetIMapObject( i ); @@ -892,21 +892,21 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap ) case( IMAP_OBJ_RECTANGLE ): { if ( !( (IMapRectangleObject*) pObj )->IsEqual( *(IMapRectangleObject*) pEqObj ) ) - bDifferent = TRUE; + bDifferent = sal_True; } break; case( IMAP_OBJ_CIRCLE ): { if ( !( (IMapCircleObject*) pObj )->IsEqual( *(IMapCircleObject*) pEqObj ) ) - bDifferent = TRUE; + bDifferent = sal_True; } break; case( IMAP_OBJ_POLYGON ): { if ( !( (IMapPolygonObject*) pObj )->IsEqual( *(IMapPolygonObject*) pEqObj ) ) - bDifferent = TRUE; + bDifferent = sal_True; } break; @@ -915,11 +915,11 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap ) } } else - bDifferent = TRUE; + bDifferent = sal_True; } if ( !bDifferent ) - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -932,7 +932,7 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap ) |* \******************************************************************************/ -BOOL ImageMap::operator!=( const ImageMap& rImageMap ) +sal_Bool ImageMap::operator!=( const ImageMap& rImageMap ) { return !( *this == rImageMap ); } @@ -944,7 +944,7 @@ BOOL ImageMap::operator!=( const ImageMap& rImageMap ) |* \******************************************************************************/ -UINT16 ImageMap::GetVersion() const +sal_uInt16 ImageMap::GetVersion() const { return IMAGE_MAP_VERSION; } @@ -987,7 +987,7 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject ) IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, const Size& rDisplaySize, const Point& rRelHitPoint, - ULONG nFlags ) + sal_uLong nFlags ) { Point aRelPoint( rTotalSize.Width() * rRelHitPoint.X() / rDisplaySize.Width(), rTotalSize.Height() * rRelHitPoint.Y() / rDisplaySize.Height() ); @@ -1026,9 +1026,9 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, Rectangle ImageMap::GetBoundRect() const { Rectangle aBoundRect; - ULONG nCount = maList.Count(); + sal_uLong nCount = maList.Count(); - for ( ULONG i = 0; i < nCount; i++ ) + for ( sal_uLong i = 0; i < nCount; i++ ) aBoundRect.Union( ( (IMapObject*) maList.GetObject( i ) )->GetBoundRect() ); return aBoundRect; @@ -1043,9 +1043,9 @@ Rectangle ImageMap::GetBoundRect() const void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) { - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { IMapObject* pObj = GetIMapObject( i ); @@ -1079,9 +1079,9 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pObj = (IMapObject*) maList.GetObject( i ); pObj->Write( rOStm, rBaseURL ); @@ -1095,12 +1095,12 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const |* \******************************************************************************/ -void ImageMap::ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& rBaseURL ) +void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& rBaseURL ) { // neue Objekte einlesen - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { - UINT16 nType; + sal_uInt16 nType; rIStm >> nType; rIStm.SeekRel( -2 ); @@ -1149,8 +1149,8 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const IMapCompat* pCompat; String aImageName( GetName() ); String aDummy; - USHORT nOldFormat = rOStm.GetNumberFormatInt(); - UINT16 nCount = (UINT16) GetIMapObjectCount(); + sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); + sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount(); const rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding(); rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1185,8 +1185,8 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL ) { ByteString aString; char cMagic[6]; - USHORT nOldFormat = rIStm.GetNumberFormatInt(); - UINT16 nCount; + sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + sal_uInt16 nCount; rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rIStm.Read( cMagic, sizeof( cMagic ) ); diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 587a31d4f098..dedfb22532cb 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -212,9 +212,9 @@ void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) cons void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const { ByteString aStr( "polygon " ); - const USHORT nCount = aPoly.GetSize(); + const sal_uInt16 nCount = aPoly.GetSize(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) AppendCERNCoords( aPoly[ i ], aStr ); AppendCERNURL( aStr, rBaseURL ); @@ -232,11 +232,11 @@ void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) co void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { ByteString aStr( "poly " ); - const USHORT nCount = Min( aPoly.GetSize(), (USHORT) 100 ); + const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 ); AppendNCSAURL( aStr, rBaseURL ); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) AppendNCSACoords( aPoly[ i ], aStr ); rOStm.WriteLine( aStr ); @@ -253,7 +253,7 @@ void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) co |* \******************************************************************************/ -void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) const +void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const { switch( nFormat ) { @@ -276,9 +276,9 @@ void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) c void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pObj = GetIMapObject( i ); @@ -312,9 +312,9 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pObj = GetIMapObject( i ); @@ -345,9 +345,9 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const |* \******************************************************************************/ -ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL ) +sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL ) { - ULONG nRet = IMAP_ERR_FORMAT; + sal_uLong nRet = IMAP_ERR_FORMAT; if ( nFormat == IMAP_FORMAT_DETECT ) nFormat = ImpDetectFormat( rIStm ); @@ -375,7 +375,7 @@ ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL ) |* \******************************************************************************/ -ULONG ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) +sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) { ByteString aStr; @@ -438,11 +438,11 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL } else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) ) { - const USHORT nCount = aStr.GetTokenCount( '(' ) - 1; + const sal_uInt16 nCount = aStr.GetTokenCount( '(' ) - 1; Polygon aPoly( nCount ); String aURL; - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) aPoly[ i ] = ImpReadCERNCoords( &pStr ); aURL = ImpReadCERNURL( &pStr, rBaseURL ); @@ -553,7 +553,7 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL ) |* \******************************************************************************/ -ULONG ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) +sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) { ByteString aStr; @@ -618,11 +618,11 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL } else if ( aToken == "poly" ) { - const USHORT nCount = aStr.GetTokenCount( ',' ) - 1; + const sal_uInt16 nCount = aStr.GetTokenCount( ',' ) - 1; const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) ); Polygon aPoly( nCount ); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) aPoly[ i ] = ImpReadNCSACoords( &pStr ); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() ); @@ -708,10 +708,10 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr ) |* \******************************************************************************/ -ULONG ImageMap::ImpDetectFormat( SvStream& rIStm ) +sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm ) { - ULONG nPos = rIStm.Tell(); - ULONG nRet = IMAP_FORMAT_BIN; + sal_uLong nPos = rIStm.Tell(); + sal_uLong nRet = IMAP_FORMAT_BIN; char cMagic[6]; rIStm.Read( cMagic, sizeof( cMagic ) ); diff --git a/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx index 76763ae422f2..49d5f4c5984e 100644 --- a/svtools/source/misc/imap3.cxx +++ b/svtools/source/misc/imap3.cxx @@ -40,7 +40,7 @@ |* \******************************************************************************/ -IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) : +IMapCompat::IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode ) : pRWStm ( &rStm ), nStmMode ( nStreamMode ) { @@ -56,7 +56,7 @@ IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) : } else { - UINT32 nTotalSizeTmp; + sal_uInt32 nTotalSizeTmp; *pRWStm >> nTotalSizeTmp; nTotalSize = nTotalSizeTmp; nCompatPos = pRWStm->Tell(); @@ -77,15 +77,15 @@ IMapCompat::~IMapCompat() { if ( nStmMode == STREAM_WRITE ) { - const ULONG nEndPos = pRWStm->Tell(); + const sal_uLong nEndPos = pRWStm->Tell(); pRWStm->Seek( nCompatPos ); - *pRWStm << (UINT32) ( nEndPos - nTotalSize ); + *pRWStm << (sal_uInt32) ( nEndPos - nTotalSize ); pRWStm->Seek( nEndPos ); } else { - const ULONG nReadSize = pRWStm->Tell() - nCompatPos; + const sal_uLong nReadSize = pRWStm->Tell() - nCompatPos; if ( nTotalSize > nReadSize ) pRWStm->SeekRel( nTotalSize - nReadSize ); diff --git a/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx index a161571daae7..676ae5383e63 100644 --- a/svtools/source/misc/itemdel.cxx +++ b/svtools/source/misc/itemdel.cxx @@ -124,7 +124,7 @@ void DeleteOnIdleItems() = ImpSvtData::GetSvtData().pItemDesruptList; if ( rpList ) { - USHORT n; + sal_uInt16 n; while ( 0 != ( n = rpList->Count() ) ) // Remove ist implizit im Dtor delete rpList->GetObject( n-1 ); diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index d1ff94572a99..61d397afbec9 100644..100755 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -51,7 +51,7 @@ using namespace ::com::sun::star; SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) { - const USHORT nLen = rText.Len(); + const sal_uInt16 nLen = rText.Len(); if (nLen == 0) return String(); @@ -77,7 +77,7 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) // Thus we can avoid to check every character of the text. bool bFound = false; bool bIsRtlText = false; - for (USHORT i = 0; i < nLen && !bFound; ++i) + for (sal_uInt16 i = 0; i < nLen && !bFound; ++i) { sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i ); switch (nDirection) diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx index 495929bd89dc..f4d959ec8793 100644 --- a/svtools/source/misc/svtdata.cxx +++ b/svtools/source/misc/svtdata.cxx @@ -71,8 +71,8 @@ ImpSvtData & ImpSvtData::GetSvtData() return *static_cast<ImpSvtData *>(*pAppData); } -SvtResId::SvtResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale): +SvtResId::SvtResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr(aLocale)) {} -SvtResId::SvtResId(USHORT nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {} +SvtResId::SvtResId(sal_uInt16 nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {} diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 4e245ca50520..fcd519398c8e 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -432,7 +432,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th SvMemoryStream aDstStm( 65535, 65535 ); // taking wmf without file header - if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, FALSE ) ) + if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, sal_False ) ) { maAny <<= ( aSeq = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aDstStm.GetData() ), aDstStm.Seek( STREAM_SEEK_TO_END ) ) ); @@ -936,7 +936,7 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, rFDesc1.dwFlags = FD_LINKUI; ByteString aStr( rBmk.GetDescription(), eSysCSet ); - for( USHORT nChar = 0; nChar < aStr.Len(); ++nChar ) + for( sal_uInt16 nChar = 0; nChar < aStr.Len(); ++nChar ) if( strchr( "\\/:*?\"<>|", aStr.GetChar( nChar ) ) ) aStr.Erase( nChar--, 1 ); @@ -1844,7 +1844,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE ) { rMtf = aGraphic.GetGDIMetaFile(); - bRet = TRUE; + bRet = sal_True; } } @@ -1858,7 +1858,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE ) { rMtf = aGraphic.GetGDIMetaFile(); - bRet = TRUE; + bRet = sal_True; } } diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index ea1b0174465e..841ac4d38135 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -434,7 +434,7 @@ sal_Bool TransferDataContainer::GetData( const TDataCntnrEntryList::iterator aIter( pImpl->aFmtList.begin() ), aEnd( pImpl->aFmtList.end() ); sal_Bool bFnd = sal_False; - ULONG nFmtId = SotExchange::GetFormat( rFlavor ); + sal_uLong nFmtId = SotExchange::GetFormat( rFlavor ); // test first the list for( ; aIter != aEnd; ++aIter ) @@ -500,8 +500,8 @@ void TransferDataContainer::CopyINetBookmark( const INetBookmark& rBkmk ) // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyAnyData( ULONG nFormatId, - const sal_Char* pData, ULONG nLen ) +void TransferDataContainer::CopyAnyData( sal_uLong nFormatId, + const sal_Char* pData, sal_uLong nLen ) { if( nLen ) { @@ -518,7 +518,7 @@ void TransferDataContainer::CopyAnyData( ULONG nFormatId, // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyByteString( ULONG nFormatId, +void TransferDataContainer::CopyByteString( sal_uLong nFormatId, const ByteString& rStr ) { CopyAnyData( nFormatId, rStr.GetBuffer(), rStr.Len() ); @@ -568,7 +568,7 @@ void TransferDataContainer::CopyGraphic( const Graphic& rGrf ) // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyString( USHORT nFmt, const String& rStr ) +void TransferDataContainer::CopyString( sal_uInt16 nFmt, const String& rStr ) { if( rStr.Len() ) { @@ -590,7 +590,7 @@ void TransferDataContainer::CopyString( const String& rStr ) // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyAny( USHORT nFmt, +void TransferDataContainer::CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny ) { TDataCntnrEntry_Impl aEntry; diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 612bcb4f0221..fa92a6ecb0be 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -37,7 +37,7 @@ // ----------------------------------------------------------------------- -void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll ) +void SetFieldUnit( MetricField& rField, FieldUnit eUnit, sal_Bool bAll ) { sal_Int64 nFirst = rField.Denormalize( rField.GetFirst( FUNIT_TWIP ) ); sal_Int64 nLast = rField.Denormalize( rField.GetLast( FUNIT_TWIP ) ); @@ -94,7 +94,7 @@ void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll ) // ----------------------------------------------------------------------- -void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, BOOL bAll ) +void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, sal_Bool bAll ) { sal_Int64 nMin = rBox.Denormalize( rBox.GetMin( FUNIT_TWIP ) ); sal_Int64 nMax = rBox.Denormalize( rBox.GetMax( FUNIT_TWIP ) ); @@ -350,7 +350,7 @@ long ConvertValueToUnit( long nVal, SfxMapUnit eUnit ) // ----------------------------------------------------------------------- -long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor ) +long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor ) { DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP || eUnit == SFX_MAPUNIT_100TH_MM || @@ -722,8 +722,8 @@ long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew ) return nVal; } - USHORT nOld = 0; - USHORT nNew = 0; + sal_uInt16 nOld = 0; + sal_uInt16 nNew = 0; switch ( aOld ) { diff --git a/svtools/source/misc/xwindowitem.cxx b/svtools/source/misc/xwindowitem.cxx index a382d8293617..3f499dca0a96 100755..100644 --- a/svtools/source/misc/xwindowitem.cxx +++ b/svtools/source/misc/xwindowitem.cxx @@ -46,7 +46,7 @@ XWindowItem::XWindowItem() : } -XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) : +XWindowItem::XWindowItem( sal_uInt16 nWhichId, Window * pWin ) : SfxPoolItem( nWhichId ) { if (pWin) @@ -58,7 +58,7 @@ XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) : } -XWindowItem::XWindowItem( USHORT nWhichId, uno::Reference< awt::XWindow > & rxWin ) : +XWindowItem::XWindowItem( sal_uInt16 nWhichId, uno::Reference< awt::XWindow > & rxWin ) : SfxPoolItem( nWhichId ), m_xWin( rxWin ) { diff --git a/svtools/source/plugapp/ttprops.cxx b/svtools/source/plugapp/ttprops.cxx index 2ae41a4c50c1..d80f643cff71 100644 --- a/svtools/source/plugapp/ttprops.cxx +++ b/svtools/source/plugapp/ttprops.cxx @@ -34,7 +34,7 @@ TYPEINIT1( TTProperties, ApplicationProperty ) -BOOL TTProperties::RequestProperty( USHORT nRequest ) +sal_Bool TTProperties::RequestProperty( sal_uInt16 nRequest ) { if ( (( nRequest & TT_PR_ONCE ) == 0) || (nDonePRs & (nRequest & 0x0ff)) == 0 ) { @@ -43,17 +43,17 @@ BOOL TTProperties::RequestProperty( USHORT nRequest ) GetpApp()->Property( *this ); return nActualPR == 0; } - return TRUE; + return sal_True; } -BOOL TTProperties::GetSlots() +sal_Bool TTProperties::GetSlots() { RequestProperty( TT_PR_SLOTS ); return HasSlots(); } -USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT nMode ) +sal_uInt16 TTProperties::ExecuteFunction( sal_uInt16 nSID, SfxPoolItem** ppArgs, sal_uInt16 nMode ) { mnSID = nSID; mppArgs = ppArgs; @@ -63,16 +63,16 @@ USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT return nActualPR; } -BOOL TTProperties::Img( Bitmap *pBmp ) +sal_Bool TTProperties::Img( Bitmap *pBmp ) { - BOOL bRet; + sal_Bool bRet; mpBmp = pBmp; bRet = RequestProperty( TT_PR_IMG ); mpBmp = NULL; return bRet; } -SvtResId TTProperties::GetSvtResId( USHORT nId ) +SvtResId TTProperties::GetSvtResId( sal_uInt16 nId ) { return SvtResId( nId ); } diff --git a/svtools/source/productregistration/registrationdlg.cxx b/svtools/source/productregistration/registrationdlg.cxx index 460cedb060d1..7cface187915 100644 --- a/svtools/source/productregistration/registrationdlg.cxx +++ b/svtools/source/productregistration/registrationdlg.cxx @@ -117,7 +117,7 @@ namespace svt FreeResource(); - m_aNow.Check( TRUE ); + m_aNow.Check( sal_True ); } //-------------------------------------------------------------------- diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx index e966ccb2b5f6..2c949c1a6c4e 100644 --- a/svtools/source/svhtml/htmlkywd.cxx +++ b/svtools/source/svhtml/htmlkywd.cxx @@ -49,7 +49,7 @@ struct HTML_TokenEntry }; // Flag: RTF-Token Tabelle wurde schon sortiert -static int __FAR_DATA bSortKeyWords = FALSE; +static int __FAR_DATA bSortKeyWords = sal_False; static HTML_TokenEntry __FAR_DATA aHTMLTokenTab[] = { {{OOO_STRING_SVTOOLS_HTML_area}, HTML_AREA}, // Netscape 2.0 @@ -244,7 +244,7 @@ int GetHTMLToken( const String& rName ) sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ), sizeof( HTML_TokenEntry ), HTMLKeyCompare ); - bSortKeyWords = TRUE; + bSortKeyWords = sal_True; } int nRet = 0; @@ -279,7 +279,7 @@ struct HTML_CharEntry }; // Flag: RTF-Token Tabelle wurde schon sortiert -static int __FAR_DATA bSortCharKeyWords = FALSE; +static int __FAR_DATA bSortCharKeyWords = sal_False; static HTML_CharEntry __FAR_DATA aHTMLCharNameTab[] = { {{OOO_STRING_SVTOOLS_HTML_C_lt}, 60}, @@ -599,7 +599,7 @@ sal_Unicode GetHTMLCharName( const String& rName ) sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ), sizeof( HTML_CharEntry ), HTMLCharNameCompare ); - bSortCharKeyWords = TRUE; + bSortCharKeyWords = sal_True; } sal_Unicode cRet = 0; @@ -620,7 +620,7 @@ sal_Unicode GetHTMLCharName( const String& rName ) /**/ // Flag: Optionen-Tabelle wurde schon sortiert -static int __FAR_DATA bSortOptionKeyWords = FALSE; +static int __FAR_DATA bSortOptionKeyWords = sal_False; static HTML_TokenEntry __FAR_DATA aHTMLOptionTab[] = { @@ -832,7 +832,7 @@ int GetHTMLOption( const String& rName ) sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ), sizeof( HTML_TokenEntry ), HTMLKeyCompare ); - bSortOptionKeyWords = TRUE; + bSortOptionKeyWords = sal_True; } int nRet = HTML_O_UNKNOWN; @@ -860,10 +860,10 @@ struct HTML_ColorEntry const sal_Char* sName; const String *pUName; }; - ULONG nColor; + sal_uLong nColor; }; -static int __FAR_DATA bSortColorKeyWords = FALSE; +static int __FAR_DATA bSortColorKeyWords = sal_False; #define HTML_NO_COLOR 0xffffffffUL @@ -1052,7 +1052,7 @@ static int } -ULONG GetHTMLColor( const String& rName ) +sal_uLong GetHTMLColor( const String& rName ) { if( !bSortColorKeyWords ) { @@ -1060,10 +1060,10 @@ ULONG GetHTMLColor( const String& rName ) sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ), sizeof( HTML_ColorEntry ), HTMLColorNameCompare ); - bSortColorKeyWords = TRUE; + bSortColorKeyWords = sal_True; } - ULONG nRet = ULONG_MAX; + sal_uLong nRet = ULONG_MAX; void* pFound; HTML_ColorEntry aSrch; aSrch.pUName = &rName; diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 33b8fd91a29f..6fa096937e7b 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -528,7 +528,7 @@ void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc, } SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr, - BOOL bOn, rtl_TextEncoding ) + sal_Bool bOn, rtl_TextEncoding ) { sal_Char sStt[3] = "</"; if( bOn ) @@ -569,7 +569,7 @@ SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream, return rStream; } -SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen, +SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen, rtl_TextEncoding ) { // in einen Stream aus sal_Char aNToABuf[] = "0000000000000000"; @@ -580,7 +580,7 @@ SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen, // Pointer an das Bufferende setzen sal_Char *pStr = aNToABuf + (sizeof(aNToABuf)-1); - for( BYTE n = 0; n < nLen; ++n ) + for( sal_uInt8 n = 0; n < nLen; ++n ) { *(--pStr) = (sal_Char)(nHex & 0xf ) + 48; if( *pStr > '9' ) @@ -615,7 +615,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, const ImageMap& rIMap, const String& rName, const HTMLOutEvent *pEventTable, - BOOL bOutStarBasic, + sal_Bool bOutStarBasic, const sal_Char *pDelim, const sal_Char *pIndentArea, const sal_Char *pIndentMap, @@ -640,7 +640,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, Out_String( rStream, rOutName, eDestEnc, pNonConvertableChars ); rStream << "\">"; - for( USHORT i=0U; i<rIMap.GetIMapObjectCount(); i++ ) + for( sal_uInt16 i=0U; i<rIMap.GetIMapObjectCount(); i++ ) { const IMapObject* pObj = rIMap.GetIMapObject( i ); DBG_ASSERT( pObj, "Wo ist das ImageMap-Object?" ); @@ -683,7 +683,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, (const IMapPolygonObject *)pObj; pShape= OOO_STRING_SVTOOLS_HTML_SH_poly; Polygon aPoly( pPolyObj->GetPolygon() ); - USHORT nCount = aPoly.GetSize(); + sal_uInt16 nCount = aPoly.GetSize(); if( nCount>0 ) { const Point& rPoint = aPoly[0]; @@ -691,7 +691,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, ByteString::CreateFromInt32(rPoint.X())) += ',') += ByteString::CreateFromInt32(rPoint.Y()); } - for( USHORT j=1; j<nCount; j++ ) + for( sal_uInt16 j=1; j<nCount; j++ ) { const Point& rPoint = aPoly[j]; (((aCoords += ',') @@ -771,7 +771,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, rStream << pDelim; if( pIndentMap ) rStream << pIndentMap; - Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, FALSE ); + Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, sal_False ); return rStream; } @@ -885,7 +885,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, } } - HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, FALSE ); + HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, sal_False ); return rStrm; } @@ -894,11 +894,11 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm, const SvxMacroTableDtor& rMacroTable, const HTMLOutEvent *pEventTable, - BOOL bOutStarBasic, + sal_Bool bOutStarBasic, rtl_TextEncoding eDestEnc, String *pNonConvertableChars ) { - USHORT i=0; + sal_uInt16 i=0; while( pEventTable[i].pBasicName || pEventTable[i].pJavaName ) { const SvxMacro *pMacro = @@ -927,8 +927,8 @@ SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm, } ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD, - BOOL bValue, - double fVal, ULONG nFormat, SvNumberFormatter& rFormatter, + sal_Bool bValue, + double fVal, sal_uLong nFormat, SvNumberFormatter& rFormatter, rtl_TextEncoding eDestEnc, String* pNonConvertableChars ) { if ( bValue ) @@ -965,16 +965,16 @@ ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD, return aStrTD; } -BOOL HTMLOutFuncs::PrivateURLToInternalImg( String& rURL ) +sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( String& rURL ) { if( rURL.Len() > 14UL && rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_private_image, 14UL ) == COMPARE_EQUAL ) { rURL.Erase( 0UL, 14UL ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index 9227690c2995..4b92214d7827 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -56,7 +56,7 @@ static HTMLOptionEnum __READONLY_DATA aScriptLangOptEnums[] = { 0, 0 } }; -BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL, +sal_Bool HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL, HTMLScriptLanguage& rLang, String& rSrc, String& rLibrary, @@ -70,7 +70,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL rLibrary.Erase(); rModule.Erase(); - for( USHORT i = pScriptOptions->Count(); i; ) + for( sal_uInt16 i = pScriptOptions->Count(); i; ) { const HTMLOption *pOption = (*pScriptOptions)[ --i ]; switch( pOption->GetToken() ) @@ -78,7 +78,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL case HTML_O_LANGUAGE: { rLangString = pOption->GetString(); - USHORT nLang; + sal_uInt16 nLang; if( pOption->GetEnum( nLang, aScriptLangOptEnums ) ) rLang = (HTMLScriptLanguage)nLang; else @@ -99,10 +99,10 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL } } - return TRUE; + return sal_True; } -void HTMLParser::RemoveSGMLComment( String &rString, BOOL bFull ) +void HTMLParser::RemoveSGMLComment( String &rString, sal_Bool bFull ) { sal_Unicode c = 0; while( rString.Len() && diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 28df35a4bb2a..b31f7285b15c 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -114,9 +114,9 @@ SV_IMPL_PTRARR(HTMLOptions,HTMLOptionPtr) /* */ -USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) const +sal_uInt16 HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, sal_uInt16 nDflt ) const { - USHORT nValue = nDflt; + sal_uInt16 nValue = nDflt; while( pOptEnums->pName ) if( aValue.EqualsIgnoreCaseAscii( pOptEnums->pName ) ) @@ -130,7 +130,7 @@ USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) cons return nValue; } -BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const +sal_Bool HTMLOption::GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const { while( pOptEnums->pName ) { @@ -147,7 +147,7 @@ BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const return (pName != 0); } -HTMLOption::HTMLOption( USHORT nTok, const String& rToken, +HTMLOption::HTMLOption( sal_uInt16 nTok, const String& rToken, const String& rValue ) : aValue(rValue) , aToken(rToken) @@ -171,7 +171,7 @@ sal_uInt32 HTMLOption::GetNumber() const return nTmp >= 0 ? (sal_uInt32)nTmp : 0; } -INT32 HTMLOption::GetSNumber() const +sal_Int32 HTMLOption::GetSNumber() const { DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START && nToken<HTML_OPTION_NUMBER_END) || (nToken>=HTML_OPTION_CONTEXT_START && nToken<HTML_OPTION_CONTEXT_END), @@ -181,7 +181,7 @@ INT32 HTMLOption::GetSNumber() const return aTmp.ToInt32(); } -void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const +void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const { if( rLongs.Count() ) rLongs.Remove( 0, rLongs.Count() ); @@ -190,8 +190,8 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const { // das ist ein sehr stark vereinfachter Scanner. Er sucht einfach // alle Tiffern aus dem String - BOOL bInNum = FALSE; - ULONG nNum = 0; + sal_Bool bInNum = sal_False; + sal_uLong nNum = 0; for( xub_StrLen i=0; i<aValue.Len(); i++ ) { register sal_Unicode c = aValue.GetChar( i ); @@ -199,12 +199,12 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const { nNum *= 10; nNum += (c - '0'); - bInNum = TRUE; + bInNum = sal_True; } else if( bInNum ) { rLongs.Insert( nNum, rLongs.Count() ); - bInNum = FALSE; + bInNum = sal_False; nNum = 0; } } @@ -227,7 +227,7 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const nPos++; if( nPos==aValue.Len() ) - rLongs.Insert( ULONG(0), rLongs.Count() ); + rLongs.Insert( sal_uLong(0), rLongs.Count() ); else { xub_StrLen nEnd = aValue.Search( (sal_Unicode)',', nPos ); @@ -258,7 +258,7 @@ void HTMLOption::GetColor( Color& rColor ) const String aTmp( aValue ); aTmp.ToUpperAscii(); - ULONG nColor = ULONG_MAX; + sal_uLong nColor = ULONG_MAX; if( '#'!=aTmp.GetChar( 0 ) ) nColor = GetHTMLColor( aTmp ); @@ -288,9 +288,9 @@ void HTMLOption::GetColor( Color& rColor ) const } } - rColor.SetRed( (BYTE)((nColor & 0x00ff0000) >> 16) ); - rColor.SetGreen( (BYTE)((nColor & 0x0000ff00) >> 8)); - rColor.SetBlue( (BYTE)(nColor & 0x000000ff) ); + rColor.SetRed( (sal_uInt8)((nColor & 0x00ff0000) >> 16) ); + rColor.SetGreen( (sal_uInt8)((nColor & 0x0000ff00) >> 8)); + rColor.SetBlue( (sal_uInt8)(nColor & 0x000000ff) ); } HTMLInputType HTMLOption::GetInputType() const @@ -320,8 +320,8 @@ HTMLParser::HTMLParser( SvStream& rIn, int bReadNewDoc ) bReadListing = bReadXMP = bReadPRE = bReadTextArea = bReadScript = bReadStyle = bEndTokenFound = bIsInBody = bReadNextChar = - bReadComment = FALSE; - bIsInHeader = TRUE; + bReadComment = sal_False; + bIsInHeader = sal_True; pOptions = new HTMLOptions; } @@ -339,7 +339,7 @@ SvParserState __EXPORT HTMLParser::CallParser() SaveState( 0 ); nPre_LinePos = 0; - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; AddRef(); Continue( 0 ); @@ -378,24 +378,24 @@ int HTMLParser::FilterToken( int nToken ) break; // nicht verschicken case HTML_HEAD_OFF: - bIsInBody = TRUE; + bIsInBody = sal_True; case HTML_HEAD_ON: bIsInHeader = HTML_HEAD_ON == nToken; break; case HTML_BODY_ON: case HTML_FRAMESET_ON: - bIsInHeader = FALSE; + bIsInHeader = sal_False; bIsInBody = HTML_BODY_ON == nToken; break; case HTML_BODY_OFF: - bIsInBody = bReadPRE = bReadListing = bReadXMP = FALSE; + bIsInBody = bReadPRE = bReadListing = bReadXMP = sal_False; break; case HTML_HTML_OFF: nToken = 0; - bReadPRE = bReadListing = bReadXMP = FALSE; + bReadPRE = bReadListing = bReadXMP = sal_False; break; // HTML_ON wurde auch nicht verschickt ! case HTML_PREFORMTXT_ON: @@ -448,23 +448,23 @@ int HTMLParser::FilterToken( int nToken ) int HTMLParser::ScanText( const sal_Unicode cBreak ) { ::rtl::OUStringBuffer sTmpBuffer( MAX_LEN ); - int bWeiter = TRUE; - int bEqSignFound = FALSE; + int bWeiter = sal_True; + int bEqSignFound = sal_False; sal_Unicode cQuote = 0U; while( bWeiter && IsParserWorking() ) { - int bNextCh = TRUE; + int bNextCh = sal_True; switch( nNextCh ) { case '&': - bEqSignFound = FALSE; + bEqSignFound = sal_False; if( bReadXMP ) sTmpBuffer.append( (sal_Unicode)'&' ); else { - ULONG nStreamPos = rInput.Tell(); - ULONG nLinePos = GetLinePos(); + sal_uLong nStreamPos = rInput.Tell(); + sal_uLong nLinePos = GetLinePos(); sal_Unicode cChar = 0U; if( '#' == (nNextCh = GetNextChar()) ) @@ -545,7 +545,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( 0U == cChar && ';' != nNextCh ) { DBG_ASSERT( rInput.Tell() - nStreamPos == - (ULONG)(nPos+1L)*GetCharSize(), + (sal_uLong)(nPos+1L)*GetCharSize(), "UTF-8 geht hier schief" ); for( xub_StrLen i=nPos-1L; i>1L; i-- ) { @@ -575,10 +575,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) // rInput.SeekRel( -(long)(++nPos*GetCharSize()) ); // nlLinePos -= nPos; DBG_ASSERT( rInput.Tell()-nStreamPos == - (ULONG)(nPos+1)*GetCharSize(), + (sal_uLong)(nPos+1)*GetCharSize(), "Falsche Stream-Position" ); DBG_ASSERT( nlLinePos-nLinePos == - (ULONG)(nPos+1), + (sal_uLong)(nPos+1), "Falsche Zeilen-Position" ); rInput.Seek( nStreamPos ); nlLinePos = nLinePos; @@ -620,10 +620,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) // rInput.SeekRel( -(long)(++nPos*GetCharSize()) ); // nlLinePos -= nPos; DBG_ASSERT( rInput.Tell()-nStreamPos == - (ULONG)(nPos+1)*GetCharSize(), + (sal_uLong)(nPos+1)*GetCharSize(), "Falsche Stream-Position" ); DBG_ASSERT( nlLinePos-nLinePos == - (ULONG)(nPos+1), + (sal_uLong)(nPos+1), "Falsche Zeilen-Position" ); rInput.Seek( nStreamPos ); nlLinePos = nLinePos; @@ -655,7 +655,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) else if( IsParserWorking() ) { sTmpBuffer.append( (sal_Unicode)'&' ); - bNextCh = FALSE; + bNextCh = sal_False; break; } @@ -692,15 +692,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) rInput.Seek( nStreamPos-(sal_uInt32)GetCharSize() ); nlLinePos = nLinePos-1; ClearTxtConvContext(); - bReadNextChar = TRUE; + bReadNextChar = sal_True; } - bNextCh = FALSE; + bNextCh = sal_False; } } break; case '=': if( '>'==cBreak && !cQuote ) - bEqSignFound = TRUE; + bEqSignFound = sal_True; sTmpBuffer.append( nNextCh ); break; @@ -725,7 +725,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) cQuote = 0U; } sTmpBuffer.append( nNextCh ); - bEqSignFound = FALSE; + bEqSignFound = sal_False; break; case sal_Unicode(EOF): @@ -735,7 +735,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) // abcä<EOF> nicht angezeigt, also lassen wir das in Zukunft. // if( '>' != cBreak ) // eState = SVPAR_ACCEPTED; - bWeiter = FALSE; + bWeiter = sal_False; } else { @@ -744,11 +744,11 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) break; case '<': - bEqSignFound = FALSE; + bEqSignFound = sal_False; if( '>'==cBreak ) sTmpBuffer.append( nNextCh ); else - bWeiter = FALSE; // Abbrechen, String zusammen + bWeiter = sal_False; // Abbrechen, String zusammen break; case '\f': @@ -760,7 +760,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) else { // sonst wird es ein eigenes Token - bWeiter = FALSE; + bWeiter = sal_False; } break; @@ -774,7 +774,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) } else if( bReadListing || bReadXMP || bReadPRE || bReadTextArea ) { - bWeiter = FALSE; + bWeiter = sal_False; break; } // Bug 18984: CR-LF -> Blank @@ -784,7 +784,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( '\t'==nNextCh && bReadPRE && '>'!=cBreak ) { // In <PRE>: Tabs nach oben durchreichen - bWeiter = FALSE; + bWeiter = sal_False; break; } // kein break @@ -821,15 +821,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) } while ( ' ' == nNextCh || '\t' == nNextCh || '\r' == nNextCh || '\n' == nNextCh || '\x0b' == nNextCh ); - bNextCh = FALSE; + bNextCh = sal_False; } break; default: - bEqSignFound = FALSE; + bEqSignFound = sal_False; if( (nNextCh==cBreak && !cQuote) || - (ULONG(aToken.Len()) + MAX_LEN) > ULONG(STRING_MAXLEN & ~1 )) - bWeiter = FALSE; + (sal_uLong(aToken.Len()) + MAX_LEN) > sal_uLong(STRING_MAXLEN & ~1 )) + bWeiter = sal_False; else { do { @@ -838,8 +838,8 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( MAX_LEN == sTmpBuffer.getLength() ) { aToken += String(sTmpBuffer.makeStringAndClear()); - if( (ULONG(aToken.Len()) + MAX_LEN) > - ULONG(STRING_MAXLEN & ~1 ) ) + if( (sal_uLong(aToken.Len()) + MAX_LEN) > + sal_uLong(STRING_MAXLEN & ~1 ) ) { nNextCh = GetNextChar(); return HTML_TEXTTOKEN; @@ -854,7 +854,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) return HTML_TEXTTOKEN; } } while( HTML_ISALPHA( nNextCh ) || HTML_ISDIGIT( nNextCh ) ); - bNextCh = FALSE; + bNextCh = sal_False; } } @@ -879,21 +879,21 @@ int HTMLParser::_GetNextRawToken() { // beim letzten Aufruf haben wir das End-Token bereits gefunden, // deshalb muessen wir es nicht noch einmal suchen - bReadScript = FALSE; - bReadStyle = FALSE; + bReadScript = sal_False; + bReadStyle = sal_False; aEndToken.Erase(); - bEndTokenFound = FALSE; + bEndTokenFound = sal_False; return 0; } // per default geben wir HTML_RAWDATA zurueck - int bWeiter = TRUE; + int bWeiter = sal_True; int nToken = HTML_RAWDATA; SaveState( 0 ); while( bWeiter && IsParserWorking() ) { - int bNextCh = TRUE; + int bNextCh = sal_True; switch( nNextCh ) { case '<': @@ -904,15 +904,15 @@ int HTMLParser::_GetNextRawToken() aToken += String(sTmpBuffer.makeStringAndClear()); // und die Position im Stream merken - ULONG nStreamPos = rInput.Tell(); - ULONG nLineNr = GetLineNr(); - ULONG nLinePos = GetLinePos(); + sal_uLong nStreamPos = rInput.Tell(); + sal_uLong nLineNr = GetLineNr(); + sal_uLong nLinePos = GetLinePos(); // Start eines End-Token? - int bOffState = FALSE; + int bOffState = sal_False; if( '/' == (nNextCh = GetNextChar()) ) { - bOffState = TRUE; + bOffState = sal_True; nNextCh = GetNextChar(); } else if( '!' == nNextCh ) @@ -933,7 +933,7 @@ int HTMLParser::_GetNextRawToken() sal::static_int_cast< xub_StrLen >( sTmpBuffer.getLength()) ); aTok.ToUpperAscii(); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if( bReadScript || aEndToken.Len() ) { if( !bReadComment ) @@ -941,7 +941,7 @@ int HTMLParser::_GetNextRawToken() if( aTok.CompareToAscii( OOO_STRING_SVTOOLS_HTML_comment, 3 ) == COMPARE_EQUAL ) { - bReadComment = TRUE; + bReadComment = sal_True; } else { @@ -958,7 +958,7 @@ int HTMLParser::_GetNextRawToken() aTok.Copy( aTok.Len()-2 ).EqualsAscii( "--" ) ) { // hier ist ein Kommentar der Art <!-----> zuende - bReadComment = FALSE; + bReadComment = sal_False; } } else @@ -981,15 +981,15 @@ int HTMLParser::_GetNextRawToken() // bisher gelesenen String zurueckgeben und dnach normal // weitermachen - bWeiter = FALSE; + bWeiter = sal_False; // nToken==0 heisst, dass _GetNextToken gleich weiterliest if( !aToken.Len() && (bReadStyle || bReadScript) ) { // wir koennen sofort die Umgebung beeden und // das End-Token parsen - bReadScript = FALSE; - bReadStyle = FALSE; + bReadScript = sal_False; + bReadStyle = sal_False; aEndToken.Erase(); nToken = 0; } @@ -998,7 +998,7 @@ int HTMLParser::_GetNextRawToken() // wir muessen bReadScript/bReadStyle noch am // Leben lassen und koennen erst beim naechsten // mal das End-Token Parsen - bEndTokenFound = TRUE; + bEndTokenFound = sal_True; } // jetzt fahren wir im Stream auf das '<' zurueck @@ -1018,7 +1018,7 @@ int HTMLParser::_GetNextRawToken() if( bOffState ) aToken += (sal_Unicode)'/'; - bNextCh = FALSE; + bNextCh = sal_False; } } break; @@ -1026,11 +1026,11 @@ int HTMLParser::_GetNextRawToken() sTmpBuffer.append( nNextCh ); if( bReadComment ) { - BOOL bTwoMinus = FALSE; + sal_Bool bTwoMinus = sal_False; nNextCh = GetNextChar(); while( '-' == nNextCh && IsParserWorking() ) { - bTwoMinus = TRUE; + bTwoMinus = sal_True; if( MAX_LEN == sTmpBuffer.getLength() ) aToken += String(sTmpBuffer.makeStringAndClear()); @@ -1039,9 +1039,9 @@ int HTMLParser::_GetNextRawToken() } if( '>' == nNextCh && IsParserWorking() && bTwoMinus ) - bReadComment = FALSE; + bReadComment = sal_False; - bNextCh = FALSE; + bNextCh = sal_False; } break; @@ -1050,27 +1050,27 @@ int HTMLParser::_GetNextRawToken() nNextCh = GetNextChar(); if( nNextCh=='\n' ) nNextCh = GetNextChar(); - bWeiter = FALSE; + bWeiter = sal_False; break; case '\n': // \n beendet das aktuelle Text-Token (auch wenn es leer ist) nNextCh = GetNextChar(); - bWeiter = FALSE; + bWeiter = sal_False; break; case sal_Unicode(EOF): // eof beendet das aktuelle Text-Token und tut so, als ob // ein End-Token gelesen wurde if( rInput.IsEof() ) { - bWeiter = FALSE; + bWeiter = sal_False; if( aToken.Len() || sTmpBuffer.getLength() ) { - bEndTokenFound = TRUE; + bEndTokenFound = sal_True; } else { - bReadScript = FALSE; - bReadStyle = FALSE; + bReadScript = sal_False; + bReadStyle = sal_False; aEndToken.Erase(); nToken = 0; } @@ -1112,7 +1112,7 @@ int __EXPORT HTMLParser::_GetNextToken() if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter! return 0; - BOOL bReadNextCharSave = bReadNextChar; + sal_Bool bReadNextCharSave = bReadNextChar; if( bReadNextChar ) { DBG_ASSERT( !bEndTokenFound, @@ -1120,7 +1120,7 @@ int __EXPORT HTMLParser::_GetNextToken() nNextCh = GetNextChar(); if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter! return 0; - bReadNextChar = FALSE; + bReadNextChar = sal_False; } if( bReadScript || bReadStyle || aEndToken.Len() ) @@ -1131,19 +1131,19 @@ int __EXPORT HTMLParser::_GetNextToken() } do { - int bNextCh = TRUE; + int bNextCh = sal_True; switch( nNextCh ) { case '<': { - ULONG nStreamPos = rInput.Tell(); - ULONG nLineNr = GetLineNr(); - ULONG nLinePos = GetLinePos(); + sal_uLong nStreamPos = rInput.Tell(); + sal_uLong nLineNr = GetLineNr(); + sal_uLong nLinePos = GetLinePos(); - int bOffState = FALSE; + int bOffState = sal_False; if( '/' == (nNextCh = GetNextChar()) ) { - bOffState = TRUE; + bOffState = sal_True; nNextCh = GetNextChar(); } if( HTML_ISALPHA( nNextCh ) || '!'==nNextCh ) // fix #26984# @@ -1203,12 +1203,12 @@ int __EXPORT HTMLParser::_GetNextToken() aToken = sSaveToken; if( '>'!=nNextCh ) aToken += (sal_Unicode)' '; - ULONG nCStreamPos = 0; - ULONG nCLineNr = 0; - ULONG nCLinePos = 0; + sal_uLong nCStreamPos = 0; + sal_uLong nCLineNr = 0; + sal_uLong nCLinePos = 0; xub_StrLen nCStrLen = 0; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // bis zum schliessenden --> lesen. wenn keins gefunden // wurde beim der ersten > wieder aufsetzen while( !bDone && !rInput.IsEof() && IsParserWorking() ) @@ -1265,7 +1265,7 @@ int __EXPORT HTMLParser::_GetNextToken() aToken = '<'; nRet = HTML_TEXTTOKEN; nNextCh = GetNextChar(); - bNextCh = FALSE; + bNextCh = sal_False; break; } } @@ -1290,7 +1290,7 @@ int __EXPORT HTMLParser::_GetNextToken() aToken = '<'; nRet = HTML_TEXTTOKEN; nNextCh = GetNextChar(); - bNextCh = FALSE; + bNextCh = sal_False; break; } if( SVPAR_PENDING == eState ) @@ -1301,10 +1301,10 @@ int __EXPORT HTMLParser::_GetNextToken() { nRet = HTML_UNKNOWNCONTROL_ON; - ULONG nCStreamPos = rInput.Tell(); - ULONG nCLineNr = GetLineNr(), nCLinePos = GetLinePos(); + sal_uLong nCStreamPos = rInput.Tell(); + sal_uLong nCLineNr = GetLineNr(), nCLinePos = GetLinePos(); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // bis zum schliessenden %> lesen. wenn keins gefunden // wurde beim der ersten > wieder aufsetzen while( !bDone && !rInput.IsEof() && IsParserWorking() ) @@ -1337,7 +1337,7 @@ int __EXPORT HTMLParser::_GetNextToken() { aToken = '<'; nRet = HTML_TEXTTOKEN; - bNextCh = FALSE; + bNextCh = sal_False; break; } } @@ -1348,32 +1348,32 @@ int __EXPORT HTMLParser::_GetNextToken() switch( nRet ) { case HTML_TEXTAREA_ON: - bReadTextArea = TRUE; + bReadTextArea = sal_True; break; case HTML_TEXTAREA_OFF: - bReadTextArea = FALSE; + bReadTextArea = sal_False; break; case HTML_SCRIPT_ON: if( !bReadTextArea ) - bReadScript = TRUE; + bReadScript = sal_True; break; case HTML_SCRIPT_OFF: if( !bReadTextArea ) { - bReadScript = FALSE; + bReadScript = sal_False; // JavaScript kann den Stream veraendern // also muss das letzte Zeichen nochmals // gelesen werden - bReadNextChar = TRUE; - bNextCh = FALSE; + bReadNextChar = sal_True; + bNextCh = sal_False; } break; case HTML_STYLE_ON: - bReadStyle = TRUE; + bReadStyle = sal_True; break; case HTML_STYLE_OFF: - bReadStyle = FALSE; + bReadStyle = sal_False; break; } @@ -1407,7 +1407,7 @@ int __EXPORT HTMLParser::_GetNextToken() if( ( '\n' != nNextCh || '\r' != c ) && ( '\r' != nNextCh || '\n' != c ) ) { - bNextCh = FALSE; + bNextCh = sal_False; nNextCh = c; } nRet = HTML_NEWPARA; @@ -1434,7 +1434,7 @@ scan_text: if( !bNextCh && eState == SVPAR_PENDING ) { eState = SVPAR_WORKING; - bReadNextChar = TRUE; + bReadNextChar = sal_True; } break; @@ -1445,7 +1445,7 @@ scan_text: nNextCh = GetNextChar(); if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet ) { - bReadNextChar = TRUE; + bReadNextChar = sal_True; eState = SVPAR_WORKING; } } @@ -1462,15 +1462,15 @@ void HTMLParser::UnescapeToken() { xub_StrLen nPos=0; - BOOL bEscape = FALSE; + sal_Bool bEscape = sal_False; while( nPos < aToken.Len() ) { - BOOL bOldEscape = bEscape; - bEscape = FALSE; + sal_Bool bOldEscape = bEscape; + bEscape = sal_False; if( '\\'==aToken.GetChar(nPos) && !bOldEscape ) { aToken.Erase( nPos, 1 ); - bEscape = TRUE; + bEscape = sal_True; } else { @@ -1480,7 +1480,7 @@ void HTMLParser::UnescapeToken() } // hole die Optionen -const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const +const HTMLOptions *HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) const { // wenn die Option fuer das aktuelle Token schon einmal // geholt wurden, geben wir sie noch einmal zurueck @@ -1518,7 +1518,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const nToken = GetHTMLOption( sNameUpperCase ); // der Name ist fertig DBG_ASSERTWARNING( nToken!=HTML_O_UNKNOWN, "GetOption: unbekannte HTML-Option" ); - BOOL bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START || + sal_Bool bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START || nToken >= HTML_OPTION_SCRIPT_END) && (!pNoConvertToken || nToken != *pNoConvertToken); @@ -1545,12 +1545,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const { sal_Unicode cEnd = cChar; nPos++; nStt++; - BOOL bDone = FALSE; - BOOL bEscape = FALSE; + sal_Bool bDone = sal_False; + sal_Bool bEscape = sal_False; while( nPos < aToken.Len() && !bDone ) { - BOOL bOldEscape = bEscape; - bEscape = FALSE; + sal_Bool bOldEscape = bEscape; + bEscape = sal_False; cChar = aToken.GetChar(nPos); switch( cChar ) { @@ -1569,7 +1569,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const else { ((String &)aToken).Erase( nPos, 1 ); - bEscape = TRUE; + bEscape = sal_True; } break; case '"': @@ -1590,12 +1590,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const { // hier sind wir etwas laxer als der // Standard und erlauben alles druckbare - BOOL bEscape = FALSE; - BOOL bDone = FALSE; + sal_Bool bEscape = sal_False; + sal_Bool bDone = sal_False; while( nPos < aToken.Len() && !bDone ) { - BOOL bOldEscape = bEscape; - bEscape = FALSE; + sal_Bool bOldEscape = bEscape; + bEscape = sal_False; sal_Unicode c = aToken.GetChar(nPos); switch( c ) { @@ -1608,7 +1608,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const case '\t': case '\r': case '\n': - bDone = TRUE; + bDone = sal_True; break; case '\\': @@ -1619,7 +1619,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const else { ((String &)aToken).Erase( nPos, 1 ); - bEscape = TRUE; + bEscape = sal_True; } break; @@ -1627,7 +1627,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const if( HTML_ISPRINTABLE( c ) ) nPos++, nLen++; else - bDone = TRUE; + bDone = sal_True; break; } } @@ -1832,7 +1832,7 @@ int HTMLParser::FilterPRE( int nToken ) break; } - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; return nToken; } @@ -1873,7 +1873,7 @@ int HTMLParser::FilterXMP( int nToken ) break; } - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; return nToken; } @@ -1901,13 +1901,13 @@ int HTMLParser::FilterListing( int nToken ) break; } - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; return nToken; } FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, - BOOL bSwitchToUCS2, + sal_Bool bSwitchToUCS2, rtl_TextEncoding eEnc ) { // Einer der folgenden regulaeren Ausdrucke muss sich auf den String @@ -1921,14 +1921,14 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, // ensprechen muss ByteString sCmp; - BOOL bUCS2B = FALSE; + sal_Bool bUCS2B = sal_False; if( bSwitchToUCS2 ) { if( 0xfeU == (sal_uChar)pHeader[0] && 0xffU == (sal_uChar)pHeader[1] ) { eEnc = RTL_TEXTENCODING_UCS2; - bUCS2B = TRUE; + bUCS2B = sal_True; } else if( 0xffU == (sal_uChar)pHeader[0] && 0xfeU == (sal_uChar)pHeader[1] ) @@ -1946,7 +1946,7 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, ) { if( 0xfe == (sal_uChar)pHeader[0] ) - bUCS2B = TRUE; + bUCS2B = sal_True; xub_StrLen nLen; for( nLen = 2; @@ -1979,7 +1979,7 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, // Ein HTML-Dokument muss in der ersten Zeile ein '<' besitzen xub_StrLen nStart = sCmp.Search( '<' ); if( STRING_NOTFOUND == nStart ) - return FALSE; + return sal_False; nStart++; // danach duerfen beliebige andere Zeichen bis zu einem blank oder @@ -1994,7 +1994,7 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, // wenn das Dokeument hinter dem < aufhoert ist es wohl kein HTML if( nPos==nStart ) - return FALSE; + return sal_False; // die Zeichenkette nach dem '<' muss ausserdem ein bekanntes // HTML Token sein. Damit die Ausgabe eines DOS-dir-Befehls nicht @@ -2003,30 +2003,30 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, String sTest( sCmp.Copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US ); int nTok = GetHTMLToken( sTest ); if( 0 != nTok && HTML_DIRLIST_ON != nTok ) - return TRUE; + return sal_True; // oder es handelt sich um ein "<!" ganz am Anfang der Datei (fix #27092#) if( nStart == 1 && '!' == sCmp.GetChar( 1 ) ) - return TRUE; + return sal_True; // oder wir finden irgendwo ein <HTML> in den ersten 80 Zeichen nStart = sCmp.Search( OOO_STRING_SVTOOLS_HTML_html ); if( nStart!=STRING_NOTFOUND && nStart>0 && '<'==sCmp.GetChar(nStart-1) && nStart+4 < sCmp.Len() && '>'==sCmp.GetChar(nStart+4) ) - return TRUE; + return sal_True; // sonst ist es wohl doch eher kein HTML-Dokument - return FALSE; + return sal_False; } -BOOL HTMLParser::InternalImgToPrivateURL( String& rURL ) +sal_Bool HTMLParser::InternalImgToPrivateURL( String& rURL ) { if( rURL.Len() < 19 || 'i' != rURL.GetChar(0) || rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher, 9 ) != COMPARE_EQUAL ) - return FALSE; + return sal_False; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; if( rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher,16) == COMPARE_EQUAL ) { @@ -2147,10 +2147,10 @@ bool HTMLParser::ParseMetaOptionsImpl( rtl_TextEncoding& o_rEnc ) { String aName, aContent; - USHORT nAction = HTML_META_NONE; + sal_uInt16 nAction = HTML_META_NONE; bool bHTTPEquiv = false, bChanged = false; - for ( USHORT i = i_pOptions->Count(); i; ) + for ( sal_uInt16 i = i_pOptions->Count(); i; ) { const HTMLOption *pOption = (*i_pOptions)[ --i ]; switch ( pOption->GetToken() ) @@ -2236,8 +2236,8 @@ bool HTMLParser::ParseMetaOptionsImpl( if ( i_xDocProps.is() && aContent.Len() && aContent.GetTokenCount() == 2 ) { - Date aDate( (ULONG)aContent.GetToken(0).ToInt32() ); - Time aTime( (ULONG)aContent.GetToken(1).ToInt32() ); + Date aDate( (sal_uLong)aContent.GetToken(0).ToInt32() ); + Time aTime( (sal_uLong)aContent.GetToken(1).ToInt32() ); DateTime aDateTime( aDate, aTime ); ::util::DateTime uDT(aDateTime.Get100Sec(), aDateTime.GetSec(), aDateTime.GetMin(), @@ -2293,7 +2293,7 @@ bool HTMLParser::ParseMetaOptions( const uno::Reference<document::XDocumentProperties> & i_xDocProps, SvKeyValueIterator *i_pHeader ) { - USHORT nContentOption = HTML_O_CONTENT; + sal_uInt16 nContentOption = HTML_O_CONTENT; rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW; bool bRet = ParseMetaOptionsImpl( i_xDocProps, i_pHeader, @@ -2301,7 +2301,7 @@ bool HTMLParser::ParseMetaOptions( eEnc ); // If the encoding is set by a META tag, it may only overwrite the - // current encoding if both, the current and the new encoding, are 1-BYTE + // current encoding if both, the current and the new encoding, are 1-sal_uInt8 // encodings. Everything else cannot lead to reasonable results. if (RTL_TEXTENCODING_DONTKNOW != eEnc && rtl_isOctetTextEncoding( eEnc ) && @@ -2340,7 +2340,7 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH if( pHTTPHeader ) { SvKeyValue aKV; - for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont; + for( sal_Bool bCont = pHTTPHeader->GetFirst( aKV ); bCont; bCont = pHTTPHeader->GetNext( aKV ) ) { if( aKV.GetKey().EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_type ) ) @@ -2355,15 +2355,15 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH return eRet; } -BOOL HTMLParser::SetEncodingByHTTPHeader( +sal_Bool HTMLParser::SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; rtl_TextEncoding eEnc = HTMLParser::GetEncodingByHttpHeader( pHTTPHeader ); if(RTL_TEXTENCODING_DONTKNOW != eEnc) { SetSrcEncoding( eEnc ); - bRet = TRUE; + bRet = sal_True; } return bRet; } diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index 7e29dbc4598f..bd08a32942bf 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -44,7 +44,7 @@ const int MAX_TOKEN_LEN = 128; #define RTF_ISDIGIT( c ) (c >= '0' && c <= '9') #define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ) -SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize ) +SvRTFParser::SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize ) : SvParser( rIn, nStackSize ), eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet nUCharOverread( 1 ) @@ -170,7 +170,7 @@ int SvRTFParser::_GetNextToken() case RTF_UC: if( 0 <= nTokenValue ) { - nUCharOverread = (BYTE)nTokenValue; + nUCharOverread = (sal_uInt8)nTokenValue; #if 1 //cmc: other ifdef breaks #i3584 aParserStates.top(). @@ -208,7 +208,7 @@ int SvRTFParser::_GetNextToken() // overread the next n "RTF" characters. This // can be also \{, \}, \'88 - for( BYTE m = 0; m < nUCharOverread; ++m ) + for( sal_uInt8 m = 0; m < nUCharOverread; ++m ) { sal_Unicode cAnsi = nNextCh; while( 0xD == cAnsi ) @@ -437,7 +437,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) // overread the next n "RTF" characters. This // can be also \{, \}, \'88 - for( BYTE m = 0; m < nUCharOverread; ++m ) + for( sal_uInt8 m = 0; m < nUCharOverread; ++m ) { sal_Unicode cAnsi = nNextCh; while( 0xD == cAnsi ) diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index 7422961c6881..ac10c3982b6e 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -49,7 +49,7 @@ struct RTF_TokenEntry }; // Flag: RTF-Token Tabelle wurde schon sortiert -static int __FAR_DATA bSortKeyWords = FALSE; +static int __FAR_DATA bSortKeyWords = sal_False; static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = { {{OOO_STRING_SVTOOLS_RTF_IGNORE}, RTF_IGNOREFLAG}, @@ -1228,7 +1228,7 @@ int GetRTFToken( const String& rSearch ) sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ), sizeof( RTF_TokenEntry ), RTFKeyCompare ); - bSortKeyWords = TRUE; + bSortKeyWords = sal_True; } int nRet = 0; diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx index 670abfaf4b0c..2f00fd896168 100644 --- a/svtools/source/svrtf/rtfout.cxx +++ b/svtools/source/svrtf/rtfout.cxx @@ -45,7 +45,7 @@ const sal_Char __FAR_DATA RTFOutFuncs::sNewLine[] = "\015\012"; SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c, - int *pUCMode, rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile) + int *pUCMode, rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) { const sal_Char* pStr = 0; switch (c) @@ -164,7 +164,7 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c, } SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr, - rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile) + rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) { int nUCMode = 1; for (xub_StrLen n = 0; n < rStr.Len(); ++n) @@ -175,7 +175,7 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr, } SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr, - rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile) + rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) { //Fontnames in word have a quirk in that \uc and usage of ansi replacement //chars after a \u don't work and in wordpad \u doesn't work, so we are @@ -185,7 +185,7 @@ SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr, return rStream; } -SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen ) +SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen ) { sal_Char aNToABuf[] = "0000000000000000"; @@ -195,7 +195,7 @@ SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen ) // Pointer an das Bufferende setzen sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1); - for( BYTE n = 0; n < nLen; ++n ) + for( sal_uInt8 n = 0; n < nLen; ++n ) { *(--pStr) = (sal_Char)(nHex & 0xf ) + 48; if( *pStr > '9' ) diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 53b7ee497754..fee520714493 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -50,11 +50,11 @@ struct SvParser_Impl { String aToken; // gescanntes Token - ULONG nFilePos; // akt. Position im Stream - ULONG nlLineNr; // akt. Zeilen Nummer - ULONG nlLinePos; // akt. Spalten Nummer + sal_uLong nFilePos; // akt. Position im Stream + sal_uLong nlLineNr; // akt. Zeilen Nummer + sal_uLong nlLinePos; // akt. Spalten Nummer long nTokenValue; // zusaetzlicher Wert (RTF) - BOOL bTokenHasValue; // indicates whether nTokenValue is valid + sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid int nToken; // akt. Token sal_Unicode nNextCh; // akt. Zeichen @@ -77,7 +77,7 @@ struct SvParser_Impl // Konstruktor -SvParser::SvParser( SvStream& rIn, BYTE nStackSize ) +SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize ) : rInput( rIn ) , nlLineNr( 1 ) , nlLinePos( 1 ) @@ -86,11 +86,11 @@ SvParser::SvParser( SvStream& rIn, BYTE nStackSize ) , bTokenHasValue( false ) , eState( SVPAR_NOTSTARTED ) , eSrcEnc( RTL_TEXTENCODING_DONTKNOW ) - , bDownloadingFile( FALSE ) + , bDownloadingFile( sal_False ) , nTokenStackSize( nStackSize ) , nTokenStackPos( 0 ) { - bUCS2BSrcEnc = bSwitchToUCS2 = FALSE; + bUCS2BSrcEnc = bSwitchToUCS2 = sal_False; eState = SVPAR_NOTSTARTED; if( nTokenStackSize < 3 ) nTokenStackSize = 3; @@ -191,11 +191,11 @@ sal_Unicode SvParser::GetNextChar() // When reading muliple bytes, we don't have to care about the file // position when we run inti the pending state. The file position is // maintained by SaveState/RestoreState. - BOOL bErr; + sal_Bool bErr; if( bSwitchToUCS2 && 0 == rInput.Tell() ) { sal_uChar c1, c2; - BOOL bSeekBack = TRUE; + sal_Bool bSeekBack = sal_True; rInput >> c1; bErr = rInput.IsEof() || rInput.GetError(); @@ -210,14 +210,14 @@ sal_Unicode SvParser::GetNextChar() if( 0xfe == c1 && 0xff == c2 ) { eSrcEnc = RTL_TEXTENCODING_UCS2; - bUCS2BSrcEnc = TRUE; - bSeekBack = FALSE; + bUCS2BSrcEnc = sal_True; + bSeekBack = sal_False; } else if( 0xff == c1 && 0xfe == c2 ) { eSrcEnc = RTL_TEXTENCODING_UCS2; - bUCS2BSrcEnc = FALSE; - bSeekBack = FALSE; + bUCS2BSrcEnc = sal_False; + bSeekBack = sal_False; } } } @@ -225,7 +225,7 @@ sal_Unicode SvParser::GetNextChar() if( bSeekBack ) rInput.Seek( 0 ); - bSwitchToUCS2 = FALSE; + bSwitchToUCS2 = sal_False; } nNextChPos = rInput.Tell(); @@ -480,7 +480,7 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen" nTmp = 0; else if( nTmp > nTokenStackSize ) nTmp = nTokenStackSize; - nTokenStackPos = BYTE(nTmp); + nTokenStackPos = sal_uInt8(nTmp); // und die Werte zurueck aToken = pTokenStackPos->sToken; @@ -492,15 +492,15 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen" SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt ) { - BYTE nAktPos = BYTE(pTokenStackPos - pTokenStack ); + sal_uInt8 nAktPos = sal_uInt8(pTokenStackPos - pTokenStack ); if( nCnt > 0 ) { if( nCnt >= nTokenStackSize ) nCnt = (nTokenStackSize-1); if( nAktPos + nCnt < nTokenStackSize ) - nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt); + nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt); else - nAktPos = sal::static_int_cast< BYTE >( + nAktPos = sal::static_int_cast< sal_uInt8 >( nAktPos + (nCnt - nTokenStackSize)); } else if( nCnt < 0 ) @@ -508,9 +508,9 @@ SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt ) if( -nCnt >= nTokenStackSize ) nCnt = -nTokenStackSize+1; if( -nCnt <= nAktPos ) - nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt); + nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt); else - nAktPos = sal::static_int_cast< BYTE >( + nAktPos = sal::static_int_cast< sal_uInt8 >( nAktPos + (nCnt + nTokenStackSize)); } return pTokenStack + nAktPos; @@ -574,32 +574,32 @@ void SvParser::Continue( int ) } void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, - USHORT *pWhichIds, - USHORT nWhichIds ) + sal_uInt16 *pWhichIds, + sal_uInt16 nWhichIds ) { - USHORT aNewRange[2]; + sal_uInt16 aNewRange[2]; - for( USHORT nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds ) + for( sal_uInt16 nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds ) if( *pWhichIds ) { aNewRange[0] = aNewRange[1] = *pWhichIds; - BOOL bIns = TRUE; + sal_Bool bIns = sal_True; // Position suchen - for ( USHORT nOfs = 0; rWhichMap[nOfs]; nOfs += 2 ) + for ( sal_uInt16 nOfs = 0; rWhichMap[nOfs]; nOfs += 2 ) { if( *pWhichIds < rWhichMap[nOfs] - 1 ) { // neuen Range davor rWhichMap.Insert( aNewRange, 2, nOfs ); - bIns = FALSE; + bIns = sal_False; break; } else if( *pWhichIds == rWhichMap[nOfs] - 1 ) { // diesen Range nach unten erweitern rWhichMap[nOfs] = *pWhichIds; - bIns = FALSE; + bIns = sal_False; break; } else if( *pWhichIds == rWhichMap[nOfs+1] + 1 ) @@ -613,7 +613,7 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, else // diesen Range nach oben erweitern rWhichMap[nOfs+1] = *pWhichIds; - bIns = FALSE; + bIns = sal_False; break; } } @@ -691,7 +691,7 @@ SvKeyValueIterator::~SvKeyValueIterator (void) /* * GetFirst. */ -BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) +sal_Bool SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) { m_nPos = m_pList->Count(); return GetNext (rKeyVal); @@ -700,17 +700,17 @@ BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) /* * GetNext. */ -BOOL SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal) +sal_Bool SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal) { if (m_nPos > 0) { rKeyVal = *m_pList->GetObject(--m_nPos); - return TRUE; + return sal_True; } else { // Nothing to do. - return FALSE; + return sal_False; } } diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx index f6a58ad17efe..133575fdf8cf 100644 --- a/svtools/source/table/defaultinputhandler.cxx +++ b/svtools/source/table/defaultinputhandler.cxx @@ -137,12 +137,12 @@ namespace svt { namespace table bool bHandled = false; const KeyCode& rKeyCode = rKEvt.GetKeyCode(); - USHORT nKeyCode = rKeyCode.GetCode(); + sal_uInt16 nKeyCode = rKeyCode.GetCode(); struct _ActionMapEntry { - USHORT nKeyCode; - USHORT nKeyModifier; + sal_uInt16 nKeyCode; + sal_uInt16 nKeyModifier; TableControlAction eAction; } static aKnownActions[] = { diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 8e5bd181a583..5fb61a9f385e 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -113,8 +113,8 @@ namespace svt { namespace table _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); else _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); - ULONG nHorFlag = TEXT_DRAW_LEFT; - ULONG nVerFlag = TEXT_DRAW_TOP; + sal_uLong nHorFlag = TEXT_DRAW_LEFT; + sal_uLong nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) nVerFlag = TEXT_DRAW_VCENTER; else if(m_pImpl->rModel.getVerticalAlign() == 2) @@ -207,8 +207,8 @@ namespace svt { namespace table _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); else _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); - ULONG nHorFlag = TEXT_DRAW_LEFT; - ULONG nVerFlag = TEXT_DRAW_TOP; + sal_uLong nHorFlag = TEXT_DRAW_LEFT; + sal_uLong nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) nVerFlag = TEXT_DRAW_VCENTER; else if(m_pImpl->rModel.getVerticalAlign() == 2) @@ -342,8 +342,8 @@ namespace svt { namespace table _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); else _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); - ULONG nHorFlag = TEXT_DRAW_LEFT; - ULONG nVerFlag = TEXT_DRAW_TOP; + sal_uLong nHorFlag = TEXT_DRAW_LEFT; + sal_uLong nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) nVerFlag = TEXT_DRAW_VCENTER; else if(m_pImpl->rModel.getVerticalAlign() == 2) diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 33c80e642118..d6122e7917a0 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -285,7 +285,7 @@ namespace svt { namespace table Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 _nIndex ) { (void)_nIndex; - DBG_ASSERT( FALSE, "TableControl::CreateAccessibleControl: to be overwritten!" ); + DBG_ASSERT( sal_False, "TableControl::CreateAccessibleControl: to be overwritten!" ); return NULL; } ::rtl::OUString TableControl::GetAccessibleObjectName( AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const @@ -455,7 +455,7 @@ void TableControl::GrabFocus() Control::GrabFocus(); } // ----------------------------------------------------------------------------- -Reference< XAccessible > TableControl::GetAccessible( BOOL bCreate ) +Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate ) { return Control::GetAccessible( bCreate ); } @@ -564,13 +564,13 @@ void TableControl::commitGridControlEvent( sal_Int16 _nEventId, const Any& _rNew m_pAccessTable->m_pAccessible->commitEvent( _nEventId, _rNewValue, _rOldValue); } // ----------------------------------------------------------------------------- -Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen) +Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen) { (void)_bOnScreen; return m_pImpl->calcHeaderRect(_bIsColumnBar); } // ----------------------------------------------------------------------------- -Rectangle TableControl::calcTableRect(BOOL _bOnScreen) +Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen) { (void)_bOnScreen; return m_pImpl->calcTableRect(); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 6c58cb530330..4c109529244d 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -704,7 +704,7 @@ namespace svt { namespace table } //................................................................ - void lcl_setButtonRepeat( Window& _rWindow, ULONG _nDelay ) + void lcl_setButtonRepeat( Window& _rWindow, sal_uLong _nDelay ) { AllSettings aSettings = _rWindow.GetSettings(); MouseSettings aMouseSettings = aSettings.GetMouseSettings(); @@ -712,7 +712,7 @@ namespace svt { namespace table aMouseSettings.SetButtonRepeat( _nDelay ); aSettings.SetMouseSettings( aMouseSettings ); - _rWindow.SetSettings( aSettings, TRUE ); + _rWindow.SetSettings( aSettings, sal_True ); } //................................................................ @@ -1379,7 +1379,7 @@ namespace svt { namespace table invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); } } - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); m_nAnchor = m_nCurRow; ensureVisible(m_nCurColumn, m_nCurRow, false); m_rAntiImpl.selectionChanged(true); @@ -1464,7 +1464,7 @@ namespace svt { namespace table invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); } } - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); m_nAnchor = m_nCurRow; ensureVisible(m_nCurColumn, m_nCurRow, false); m_rAntiImpl.selectionChanged(true); @@ -1492,7 +1492,7 @@ namespace svt { namespace table } m_nCurRow = 0; m_nAnchor = m_nCurRow; - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); ensureVisible(m_nCurColumn, 0, false); m_rAntiImpl.selectionChanged(true); bSuccess = true; @@ -1517,7 +1517,7 @@ namespace svt { namespace table } m_nCurRow = m_nRowCount-1; m_nAnchor = m_nCurRow; - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); ensureVisible(m_nCurColumn, m_nRowCount-1, false); m_rAntiImpl.selectionChanged(true); bSuccess = true; @@ -1912,7 +1912,7 @@ namespace svt { namespace table return m_pVScroll; } //------------------------------------------------------------------------------- - BOOL TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current) + sal_Bool TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current) { return ::std::find(selectedRows.begin(),selectedRows.end(),current) != selectedRows.end(); } @@ -2246,19 +2246,19 @@ namespace svt { namespace table m_pTableControl->m_nAnchor = -1; } //------------------------------------------------------------------------------- - BOOL TableFunctionSet::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor) + sal_Bool TableFunctionSet::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; Rectangle rCells; //curRow is the row where the mouse click happened, m_nCurRow is the last selected row, before the mouse click RowPos curRow = m_pTableControl->getCurrentRow(rPoint); if(curRow == -2) - return FALSE; + return sal_False; if( bDontSelectAtCursor ) { if(m_pTableControl->m_nRowSelected.size()>1) - m_pTableControl->m_pSelEngine->AddAlways(TRUE); - bHandled = TRUE; + m_pTableControl->m_pSelEngine->AddAlways(sal_True); + bHandled = sal_True; } else if(m_pTableControl->m_nAnchor == m_pTableControl->m_nCurRow) { @@ -2293,7 +2293,7 @@ namespace svt { namespace table m_pTableControl->m_nAnchor--; } m_pTableControl->invalidateSelectedRegion(m_pTableControl->m_nCurRow, curRow, rCells); - bHandled = TRUE; + bHandled = sal_True; } //no region selected else @@ -2315,20 +2315,20 @@ namespace svt { namespace table } } if(m_pTableControl->m_nRowSelected.size()>1 && m_pTableControl->m_pSelEngine->GetSelectionMode()!=SINGLE_SELECTION) - m_pTableControl->m_pSelEngine->AddAlways(TRUE); + m_pTableControl->m_pSelEngine->AddAlways(sal_True); m_pTableControl->invalidateSelectedRegion(curRow, curRow, rCells); - bHandled = TRUE; + bHandled = sal_True; } m_pTableControl->m_nCurRow = curRow; m_pTableControl->ensureVisible(m_pTableControl->m_nCurColumn,m_pTableControl->m_nCurRow,false); return bHandled; } //------------------------------------------------------------------------------- - BOOL TableFunctionSet::IsSelectionAtPoint( const Point& rPoint ) + sal_Bool TableFunctionSet::IsSelectionAtPoint( const Point& rPoint ) { - m_pTableControl->m_pSelEngine->AddAlways(FALSE); + m_pTableControl->m_pSelEngine->AddAlways(sal_False); if(m_pTableControl->m_nRowSelected.empty()) - return FALSE; + return sal_False; else { RowPos curRow = m_pTableControl->getCurrentRow(rPoint); diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index 053766d92841..c0604be15cdb 100644 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -190,7 +190,7 @@ namespace svt { namespace table void setCursorAtCurrentCell(const Point& rPoint); /** checks whether the vector with the selected rows contains the current row*/ - BOOL isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current); + sal_Bool isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current); bool isRowSelected(RowPos current); /** returns the position of the current row in the selection vector */ @@ -344,8 +344,8 @@ namespace svt { namespace table virtual void BeginDrag(); virtual void CreateAnchor(); virtual void DestroyAnchor(); - virtual BOOL SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor); - virtual BOOL IsSelectionAtPoint( const Point& rPoint ); + virtual sal_Bool SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor); + virtual sal_Bool IsSelectionAtPoint( const Point& rPoint ); virtual void DeselectAtPoint( const Point& rPoint ); virtual void DeselectAll(); }; diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx index 7fc7d05ea0c9..4de76107fd20 100644 --- a/svtools/source/toolpanel/drawerlayouter.cxx +++ b/svtools/source/toolpanel/drawerlayouter.cxx @@ -147,10 +147,10 @@ namespace svt const PToolPanelDrawer pDrawer( m_aDrawers[ i_nChildIndex ] ); - Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( FALSE ); + Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( sal_False ); if ( !xItemAccessible.is() ) { - xItemAccessible = pDrawer->GetAccessible( TRUE ); + xItemAccessible = pDrawer->GetAccessible( sal_True ); ENSURE_OR_RETURN( xItemAccessible.is(), "illegal accessible provided by the drawer implementation!", NULL ); OSL_VERIFY( ::comphelper::OAccessibleImplementationAccess::setAccessibleParent( xItemAccessible->getAccessibleContext(), i_rParentAccessible ) ); diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 23067d3ee5d0..7888039d8c57 100755 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -168,8 +168,8 @@ namespace svt aSelectionRect, ( bHovered || bFocused ) ? ( bActive ? 1 : 2 ) : 0 /* hilight */, bActive /* check */, - TRUE /* border */, - FALSE /* ext border only */, + sal_True /* border */, + sal_False /* ext border only */, 0 /* corner radius */, NULL, NULL @@ -685,7 +685,7 @@ namespace svt Font aFont( m_rTabBar.GetFont() ); aFont.SetOrientation( 2700 ); - aFont.SetVertical( TRUE ); + aFont.SetVertical( sal_True ); m_rTabBar.SetFont( aFont ); aTextPos.X() += aTextSize.Height(); @@ -787,7 +787,7 @@ namespace svt return; } - m_rTabBar.SetUpdateMode( FALSE ); + m_rTabBar.SetUpdateMode( sal_False ); // the aligned bounding and content rect const Rectangle aActualBounds = m_aNormalizer.getTransformed( aNormalizedBounds, m_eTabAlignment ); @@ -805,7 +805,7 @@ namespace svt // render item "foreground" layer m_pRenderer->postRenderItem( m_rTabBar, aActualBounds, nItemFlags ); - m_rTabBar.SetUpdateMode( TRUE ); + m_rTabBar.SetUpdateMode( sal_True ); } //------------------------------------------------------------------------------------------------------------------ @@ -1338,9 +1338,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - Reference< XWindowPeer > PanelTabBar::GetComponentInterface( BOOL i_bCreate ) + Reference< XWindowPeer > PanelTabBar::GetComponentInterface( sal_Bool i_bCreate ) { - Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) ); + Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) ); if ( !xWindowPeer.is() && i_bCreate ) { xWindowPeer.set( new PanelTabBarPeer( *this ) ); diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx index f68bbc1bbd0f..e93fc9fc1357 100755 --- a/svtools/source/toolpanel/tablayouter.cxx +++ b/svtools/source/toolpanel/tablayouter.cxx @@ -254,7 +254,7 @@ namespace svt if ( lcl_checkDisposed( *m_pData ) ) return NULL; - return m_pData->pTabBar->GetAccessible( TRUE ); + return m_pData->pTabBar->GetAccessible( sal_True ); } //........................................................................ diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx index e157090bbf0e..ae69b85dfecd 100755 --- a/svtools/source/toolpanel/toolpaneldeck.cxx +++ b/svtools/source/toolpanel/toolpaneldeck.cxx @@ -544,9 +544,9 @@ namespace svt } //-------------------------------------------------------------------- - Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( BOOL i_bCreate ) + Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( sal_Bool i_bCreate ) { - Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) ); + Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) ); if ( !xWindowPeer.is() && i_bCreate ) { xWindowPeer.set( new ToolPanelDeckPeer( *this ) ); diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx index 851556bc7874..1e7f2358a125 100644 --- a/svtools/source/toolpanel/toolpaneldrawer.cxx +++ b/svtools/source/toolpanel/toolpaneldrawer.cxx @@ -57,7 +57,7 @@ namespace svt :Window( &i_rParent ) ,m_rDrawer( i_rParent ) { - SetMouseTransparent( TRUE ); + SetMouseTransparent( sal_True ); Show(); SetAccessibleRole( AccessibleRole::LABEL ); } @@ -85,7 +85,7 @@ namespace svt ,m_bFocused( false ) ,m_bExpanded( false ) { - EnableMapMode( FALSE ); + EnableMapMode( sal_False ); SetBackground( Wallpaper() ); SetPointer( POINTER_REFHAND ); @@ -162,7 +162,7 @@ namespace svt Image ToolPanelDrawer::impl_getExpansionIndicator() const { const bool bHighContrastMode( GetSettings().GetStyleSettings().GetHighContrastMode() != 0 ); - USHORT nResourceId = 0; + sal_uInt16 nResourceId = 0; if ( m_bExpanded ) if ( bHighContrastMode ) nResourceId = IMG_TRIANGLE_DOWN_HC; @@ -177,9 +177,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - USHORT ToolPanelDrawer::impl_getTextStyle() const + sal_uInt16 ToolPanelDrawer::impl_getTextStyle() const { - const USHORT nBasicStyle = TEXT_DRAW_LEFT + const sal_uInt16 nBasicStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_WORDBREAK; @@ -212,7 +212,7 @@ namespace svt { const Rectangle aTextPixelBox( m_pPaintDevice->LogicToPixel( i_rTextBox ) ); - m_pPaintDevice->EnableMapMode( FALSE ); + m_pPaintDevice->EnableMapMode( sal_False ); m_pPaintDevice->SetFillColor(); Rectangle aBox( i_rTextBox ); @@ -229,7 +229,7 @@ namespace svt m_pPaintDevice->SetLineColor( COL_BLACK ); m_pPaintDevice->DrawPolyLine( Polygon( aTextPixelBox ), aDottedStyle ); - m_pPaintDevice->EnableMapMode( FALSE ); + m_pPaintDevice->EnableMapMode( sal_False ); } else HideFocus(); @@ -306,9 +306,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( BOOL i_bCreate ) + Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( sal_Bool i_bCreate ) { - Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( FALSE ) ); + Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( sal_False ) ); if ( !xWindowPeer.is() && i_bCreate ) { xWindowPeer.set( new ToolPanelDrawerPeer() ); diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx index a465a0a6c9e1..4baf49dd17c9 100644 --- a/svtools/source/toolpanel/toolpaneldrawer.hxx +++ b/svtools/source/toolpanel/toolpaneldrawer.hxx @@ -86,13 +86,13 @@ namespace svt virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > - GetComponentInterface( BOOL i_bCreate ); + GetComponentInterface( sal_Bool i_bCreate ); private: Rectangle impl_calcTextBoundingBox() const; Rectangle impl_calcTitleBarBox( const Rectangle& i_rTextBox ) const; void impl_paintBackground( const Rectangle& i_rTitleBarBox ); - USHORT impl_getTextStyle() const; + sal_uInt16 impl_getTextStyle() const; void impl_paintFocusIndicator( const Rectangle& i_rTextBox ); Rectangle impl_paintExpansionIndicator( const Rectangle& i_rTextBox ); Image impl_getExpansionIndicator() const; diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx index 3ccf83a224f8..706afe09202f 100644 --- a/svtools/source/uno/addrtempuno.cxx +++ b/svtools/source/uno/addrtempuno.cxx @@ -29,7 +29,7 @@ #include "precompiled_svtools.hxx" #include "svtools/genericunodialog.hxx" #include <svtools/addresstemplate.hxx> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include <cppuhelper/typeprovider.hxx> #include <comphelper/property.hxx> #include <com/sun/star/sdbc/XDataSource.hpp> diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx index a58d9b784cca..33ec21a189f8 100644 --- a/svtools/source/uno/generictoolboxcontroller.cxx +++ b/svtools/source/uno/generictoolboxcontroller.cxx @@ -70,7 +70,7 @@ struct ExecuteInfo GenericToolboxController::GenericToolboxController( const Reference< XMultiServiceFactory >& rServiceManager, const Reference< XFrame >& rFrame, ToolBox* pToolbox, - USHORT nID, + sal_uInt16 nID, const ::rtl::OUString& aCommand ) : svt::ToolboxController( rServiceManager, rFrame, aCommand ) , m_pToolbox( pToolbox ) @@ -157,7 +157,7 @@ throw ( RuntimeException ) { m_pToolbox->EnableItem( m_nID, Event.IsEnabled ); - USHORT nItemBits = m_pToolbox->GetItemBits( m_nID ); + sal_uInt16 nItemBits = m_pToolbox->GetItemBits( m_nID ); nItemBits &= ~TIB_CHECKABLE; TriState eTri = STATE_NOCHECK; diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx index a7ece1acc369..a1fdc7840a55 100644 --- a/svtools/source/uno/genericunodialog.cxx +++ b/svtools/source/uno/genericunodialog.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/ucb/AlreadyInitializedException.hpp> #include <toolkit/awt/vclxwindow.hxx> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include <cppuhelper/typeprovider.hxx> #include <comphelper/property.hxx> #include <osl/diagnose.h> diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 9e4c522dc8c4..254dbae12f68 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -846,7 +846,7 @@ void ToolboxController::enable( bool bEnable ) sal_uInt16 nItemId = 0; if( getToolboxId( nItemId, &pToolBox ) ) { - pToolBox->EnableItem( nItemId, bEnable ? TRUE : FALSE ); + pToolBox->EnableItem( nItemId, bEnable ? sal_True : sal_False ); } } diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index f37d5f80ed68..d6809635e5e5 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -81,7 +81,7 @@ public: class ImplGraphicItem : public SvLBoxBmp { public: - ImplGraphicItem( SvLBoxEntry* pEntry, USHORT nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {} + ImplGraphicItem( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {} OUString msGraphicURL; }; @@ -91,7 +91,7 @@ public: class ImplContextGraphicItem : public SvLBoxContextBmp { public: - ImplContextGraphicItem( SvLBoxEntry* pEntry,USHORT nFlags,Image& rI1,Image& rI2, USHORT nEntryFlagsBmp1) + ImplContextGraphicItem( SvLBoxEntry* pEntry,sal_uInt16 nFlags,Image& rI1,Image& rI2, sal_uInt16 nEntryFlagsBmp1) : SvLBoxContextBmp( pEntry, nFlags, rI1, rI2, nEntryFlagsBmp1 ) {} OUString msExpandedGraphicURL; @@ -106,12 +106,12 @@ public: UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent, WinBits nWinStyle ); ~UnoTreeListBoxImpl(); - sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos=LIST_APPEND ); + sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uLong nPos=LIST_APPEND ); virtual void RequestingChilds( SvLBoxEntry* pParent ); - virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); + virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); DECL_LINK( OnSelectionChangeHdl, UnoTreeListBoxImpl* ); DECL_LINK( OnExpandingHdl, UnoTreeListBoxImpl* ); @@ -129,7 +129,7 @@ public: UnoTreeListItem( SvLBoxEntry* ); UnoTreeListItem(); virtual ~UnoTreeListItem(); - virtual USHORT IsA(); + virtual sal_uInt16 IsA(); void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* ); OUString GetText() const; void SetText( const OUString& rText ); @@ -137,7 +137,7 @@ public: void SetImage( const Image& rImage ); OUString GetGraphicURL() const; void SetGraphicURL( const OUString& rGraphicURL ); - void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* ); + void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* ); SvLBoxItem* Create() const; void Clone( SvLBoxItem* pSource ); @@ -259,7 +259,7 @@ void TreeControlPeer::SetWindow( Window* pWindow ) // -------------------------------------------------------------------- -UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos /* = LIST_APPEND */ ) +UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos /* = LIST_APPEND */ ) { UnoTreeListEntry* pEntry = 0; if( mpTreeImpl ) @@ -326,9 +326,9 @@ bool TreeControlPeer::updateEntry( UnoTreeListEntry* pEntry ) } } - if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == TRUE) ) + if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == sal_True) ) { - pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? TRUE : FALSE ); + pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? sal_True : sal_False ); bChanged = true; } @@ -530,14 +530,14 @@ void TreeControlPeer::ChangeNodesSelection( const Any& rSelection, bool bSelect, } if( bSetSelection ) - rTree.SelectAll( FALSE ); + rTree.SelectAll( sal_False ); if( pNodes && nCount ) { while( nCount-- ) { UnoTreeListEntry* pEntry = getEntry( *pNodes++ ); - rTree.Select( pEntry, bSelect ? TRUE : FALSE ); + rTree.Select( pEntry, bSelect ? sal_True : sal_False ); } } } @@ -563,7 +563,7 @@ Any SAL_CALL TreeControlPeer::getSelection() throw (RuntimeException) Any aRet; - ULONG nSelectionCount = rTree.GetSelectionCount(); + sal_uLong nSelectionCount = rTree.GetSelectionCount(); if( nSelectionCount == 1 ) { UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.FirstSelected() ); @@ -625,7 +625,7 @@ void SAL_CALL TreeControlPeer::removeSelection( const Any& rSelection ) throw (I void SAL_CALL TreeControlPeer::clearSelection() throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); - getTreeListBoxOrThrow().SelectAll( FALSE ); + getTreeListBoxOrThrow().SelectAll( sal_False ); } // ------------------------------------------------------------------- @@ -891,7 +891,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getNodeForLocation( sal_Int32 x Reference< XTreeNode > xNode; const Point aPos( x, y ); - UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) ); + UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) ); if( pEntry ) xNode = pEntry->mxNode; @@ -909,7 +909,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getClosestNodeForLocation( sal_ Reference< XTreeNode > xNode; const Point aPos( x, y ); - UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) ); + UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) ); if( pEntry ) xNode = pEntry->mxNode; @@ -948,7 +948,7 @@ sal_Bool SAL_CALL TreeControlPeer::stopEditing() throw (RuntimeException) UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); if( rTree.IsEditingActive() ) { - rTree.EndEditing(FALSE); + rTree.EndEditing(sal_False); return sal_True; } else @@ -964,7 +964,7 @@ void SAL_CALL TreeControlPeer::cancelEditing( ) throw (RuntimeException) ::vos::OGuard aGuard( GetMutex() ); UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); - rTree.EndEditing(FALSE); + rTree.EndEditing(sal_False); } // ------------------------------------------------------------------- @@ -1104,7 +1104,7 @@ void TreeControlPeer::updateNode( UnoTreeListBoxImpl& rTree, const Reference< XT { Reference< XTreeNode > xParentNode( xNode->getParent() ); UnoTreeListEntry* pParentEntry = 0; - ULONG nChild = LIST_APPEND; + sal_uLong nChild = LIST_APPEND; if( xParentNode.is() ) { @@ -1371,7 +1371,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An { sal_Bool bEnabled = false; if( aValue >>= bEnabled ) - rTree.EnableInplaceEditing( bEnabled ? TRUE : FALSE ); + rTree.EnableInplaceEditing( bEnabled ? sal_True : sal_False ); break; } case BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING: @@ -1581,7 +1581,7 @@ IMPL_LINK(UnoTreeListBoxImpl, OnExpandedHdl, UnoTreeListBoxImpl*, EMPTYARG ) // -------------------------------------------------------------------- -sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos ) +sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uLong nPos ) { if( pParent ) return SvTreeListBox::Insert( pEntry, pParent, nPos ); @@ -1600,14 +1600,14 @@ void UnoTreeListBoxImpl::RequestingChilds( SvLBoxEntry* pParent ) // -------------------------------------------------------------------- -BOOL UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& ) +sal_Bool UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& ) { return mxPeer.is() ? mxPeer->onEditingEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ) ) : false; } // -------------------------------------------------------------------- -BOOL UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) +sal_Bool UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) { return mxPeer.is() ? mxPeer->onEditedEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ), rNewText ) : false; } @@ -1636,14 +1636,14 @@ UnoTreeListItem::~UnoTreeListItem() // -------------------------------------------------------------------- -USHORT UnoTreeListItem::IsA() +sal_uInt16 UnoTreeListItem::IsA() { return 0; } // -------------------------------------------------------------------- -void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, SvLBoxEntry* _pEntry) +void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry) { Point aPos( rPos ); if( _pEntry ) diff --git a/svtools/source/uno/treecontrolpeer.hxx b/svtools/source/uno/treecontrolpeer.hxx index 336830804a6f..66ab96c60ff1 100644 --- a/svtools/source/uno/treecontrolpeer.hxx +++ b/svtools/source/uno/treecontrolpeer.hxx @@ -129,7 +129,7 @@ private: void fillTree( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeDataModel >& xDataModel ); void addNode( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParentEntry ); - UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos = LIST_APPEND ); + UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos = LIST_APPEND ); bool updateEntry( UnoTreeListEntry* pEntry ); void updateTree( const ::com::sun::star::awt::tree::TreeDataModelEvent& rEvent, bool bRecursive ); diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index bc5627d2fab6..a60a210e8fa7 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -121,7 +121,7 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com:: pWindow = new CalendarField( pParent, nWinBits); static_cast<CalendarField*>(pWindow)->EnableToday(); static_cast<CalendarField*>(pWindow)->EnableNone(); - static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( TRUE ); + static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( sal_True ); *ppNewComp = new SVTXDateField; ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow ); } @@ -838,7 +838,7 @@ void SVTXFormattedField::SetWindow( Window* _pWindow ) { VCLXSpinField::SetWindow(_pWindow); if (GetFormattedField()) - GetFormattedField()->SetAutoColor(TRUE); + GetFormattedField()->SetAutoColor(sal_True); } // -------------------------------------------------------------------------------------- @@ -2134,7 +2134,7 @@ void VCLXProgressBar::ImplUpdateValue() } // set progressbar value - pProgressBar->SetValue( (USHORT) nPercent ); + pProgressBar->SetValue( (sal_uInt16) nPercent ); } } diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 97482ed9d540..e6a7626b8f4a 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -92,7 +92,7 @@ class SvUnoImageMapObject : public OWeakAggObject, public XUnoTunnel { public: - SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems ); + SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ); SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems ); virtual ~SvUnoImageMapObject() throw(); @@ -125,10 +125,10 @@ public: virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw( RuntimeException ); private: - static PropertySetInfo* createPropertySetInfo( UINT16 nType ); + static PropertySetInfo* createPropertySetInfo( sal_uInt16 nType ); - UINT16 mnType; + sal_uInt16 mnType; ::rtl::OUString maURL; ::rtl::OUString maAltText; @@ -144,7 +144,7 @@ private: UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject ); -PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType ) +PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { switch( nType ) { @@ -201,7 +201,7 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType ) } } -SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems ) +SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ) : PropertySetHelper( createPropertySetInfo( nType ) ), mnType( nType ) , mbIsActive( true ) @@ -249,11 +249,11 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv { const Polygon aPoly( ((IMapPolygonObject*)&rMapObject)->GetPolygon(sal_False) ); - const USHORT nCount = aPoly.GetSize(); + const sal_uInt16 nCount = aPoly.GetSize(); maPolygon.realloc( nCount ); awt::Point* pPoints = maPolygon.getArray(); - for( USHORT nPoint = 0; nPoint < nCount; nPoint++ ) + for( sal_uInt16 nPoint = 0; nPoint < nCount; nPoint++ ) { const Point& rPoint = aPoly.GetPoint( nPoint ); pPoints->X = rPoint.X(); @@ -605,8 +605,8 @@ SvUnoImageMap::SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pS { maName = rMap.GetName(); - const UINT16 nCount = rMap.GetIMapObjectCount(); - for( UINT16 nPos = 0; nPos < nCount; nPos++ ) + const sal_uInt16 nCount = rMap.GetIMapObjectCount(); + for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ ) { IMapObject* pMapObject = rMap.GetIMapObject( nPos ); SvUnoImageMapObject* pUnoObj = new SvUnoImageMapObject( *pMapObject, pSupportedMacroItems ); diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx index d6f7029b477c..6bc01c76da4a 100644 --- a/svtools/source/uno/wizard/wizardpagecontroller.cxx +++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx @@ -75,7 +75,7 @@ namespace svt { namespace uno try { m_xWizardPage.set( m_xController->createPage( - Reference< XWindow >( i_rParent.GetComponentInterface( TRUE ), UNO_QUERY_THROW ), + Reference< XWindow >( i_rParent.GetComponentInterface( sal_True ), UNO_QUERY_THROW ), m_nPageId ), UNO_SET_THROW ); diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index 695f3993d8b8..87ff86afa7fc 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -35,7 +35,7 @@ #define TOKEN_SEPARATOR '\001' -sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const +sal_Bool INetImage::Write( SvStream& rOStm, sal_uLong nFormat ) const { sal_Bool bRet = sal_False; switch( nFormat ) @@ -65,7 +65,7 @@ sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const return bRet; } -sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat ) +sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat ) { sal_Bool bRet = sal_False; switch( nFormat ) @@ -92,12 +92,12 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat ) /* --> structure size MUST - alignment of 4! int iSize; // size of all data, including variable length strings - BOOL bIsMap; // For server side maps - INT32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct - INT32 iHeight; // and EDT_ImageData - INT32 iHSpace; - INT32 iVSpace; - INT32 iBorder; + sal_Bool bIsMap; // For server side maps + sal_Int32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct + sal_Int32 iHeight; // and EDT_ImageData + sal_Int32 iHSpace; + sal_Int32 iVSpace; + sal_Int32 iBorder; int iLowResOffset; // Offsets into string_data. If 0, string is NULL (not used) int iAltOffset; // (alternate text?) int iAnchorOffset; // HREF in image @@ -109,12 +109,12 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat ) ByteString sData; nFilePos = rIStm.Tell(); - // skip over iSize (int), bIsMao ( BOOL ) alignment of 4 !!!! + // skip over iSize (int), bIsMao ( sal_Bool ) alignment of 4 !!!! rIStm.SeekRel( 8 ); rIStm >> nVal; aSizePixel.Width() = nVal; rIStm >> nVal; aSizePixel.Height() = nVal; // skip over iHSpace, iVSpace, iBorder, iLowResOffset - rIStm.SeekRel( 3 * sizeof( INT32 ) + sizeof( int ) ); + rIStm.SeekRel( 3 * sizeof( sal_Int32 ) + sizeof( int ) ); rIStm >> nAltOffset; rIStm >> nAnchorOffset; // skip over iExtraHTML_Offset |