diff options
author | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-05 10:31:15 +0800 |
---|---|---|
committer | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-05 10:31:15 +0800 |
commit | cef41c30dd562e129b864b87c85f59bf038423a2 (patch) | |
tree | b698f3898ac3600263df76a36933ca27ec7606b0 /svtools/source/brwbox | |
parent | 1fa45c8a636ff3e4732cfdf5dd0dc8e833707bc5 (diff) |
removetooltypes01: #i112600# remove tooltypes from toolkit, svtools and framework
Diffstat (limited to 'svtools/source/brwbox')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 376 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 350 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox3.cxx | 12 | ||||
-rw-r--r-- | svtools/source/brwbox/brwhead.cxx | 4 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 98 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.hxx | 92 | ||||
-rw-r--r-- | svtools/source/brwbox/ebbcontrols.cxx | 30 | ||||
-rw-r--r-- | svtools/source/brwbox/editbrowsebox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/brwbox/editbrowsebox2.cxx | 8 |
9 files changed, 486 insertions, 486 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 3a29c4ae63fa..496ed17ffbe2 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_uIntPtr BrowseBox::GetDefaultColumnWidth( const String& _rText ) const { return GetDataWindow().GetTextWidth( _rText ) + GetDataWindow().GetTextWidth( '0' ) * 4; } //------------------------------------------------------------------- -void BrowseBox::InsertHandleColumn( ULONG nWidth ) +void BrowseBox::InsertHandleColumn( sal_uIntPtr 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_uIntPtr) 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_uIntPtr) nItemPos ); nItemPos = nFirstScrollable; - pCols->Insert( pColumn, (ULONG) nItemPos ); + pCols->Insert( pColumn, (sal_uIntPtr) 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_uIntPtr) nItemPos ); nItemPos = nFirstScrollable; - pCols->Insert( pColumn, (ULONG) nItemPos ); + pCols->Insert( pColumn, (sal_uIntPtr) 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_uIntPtr 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_uIntPtr)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_uIntPtr)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_uIntPtr)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_uIntPtr)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_uIntPtr) 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_uIntPtr) 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 68cf316e813b..b174c16779c5 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_uIntPtr) 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_uIntPtr 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,17 +601,17 @@ 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_uIntPtr nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize(); if (IsZoom()) - nSBSize = (ULONG)(nSBSize * (double)GetZoom()); + nSBSize = (sal_uIntPtr)(nSBSize * (double)GetZoom()); long nSize = pDataWin->GetPosPixel().Y(); if( !getDataWindow()->bNoHScroll ) @@ -621,8 +621,8 @@ void BrowseBox::Resize() return; 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 && @@ -645,8 +645,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 @@ -688,8 +688,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 ) @@ -716,7 +716,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 ) @@ -736,7 +736,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 ); @@ -781,9 +781,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_uIntPtr 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); @@ -827,7 +827,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); @@ -872,7 +872,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 ); @@ -895,7 +895,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 ); @@ -903,7 +903,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; @@ -924,7 +924,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(); @@ -933,8 +933,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_uIntPtr nRelTopRow = _bForeignDevice ? 0 : ((sal_uIntPtr)_rRect.Top() / nDataRowHeigt); + sal_uIntPtr nRelBottomRow = (sal_uIntPtr)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt; // cache frequently used values Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() ); @@ -954,19 +954,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_uIntPtr nRelRow = nRelTopRow; + nRelRow <= nRelBottomRow && (sal_uIntPtr)nTopRow+nRelRow < (sal_uIntPtr)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_uIntPtr nRow = nTopRow+nRelRow; if ( !SeekRow( nRow) ) { DBG_ERROR("BrowseBox::ImplPaintData: SeekRow gescheitert"); } @@ -980,7 +980,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 ) @@ -992,7 +992,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 @@ -1016,7 +1016,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 ) @@ -1030,7 +1030,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_uIntPtr)GetCurRow())) DrawCursor(); // draw a single field @@ -1056,7 +1056,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(); } @@ -1074,7 +1074,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL } if ( nCol == pCols->Count() ) - bRetouching = TRUE; + bRetouching = sal_True; // reset auto-highlight if ( bRowSelected ) @@ -1136,7 +1136,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); @@ -1184,7 +1184,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); } //------------------------------------------------------------------- @@ -1200,19 +1200,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_uIntPtr nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize(); if (IsZoom()) - nCornerSize = (ULONG)(nCornerSize * (double)GetZoom()); + nCornerSize = (sal_uIntPtr)(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(); @@ -1234,10 +1234,10 @@ void BrowseBox::UpdateScrollbars() } // needs HScroll? - ULONG nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 ); + sal_uIntPtr 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 ) @@ -1258,7 +1258,7 @@ void BrowseBox::UpdateScrollbars() } // adjust position and Width of horizontal scrollbar - ULONG nHScrX = nControlAreaWidth == USHRT_MAX + sal_uIntPtr nHScrX = nControlAreaWidth == USHRT_MAX ? 0 : nControlAreaWidth; @@ -1317,7 +1317,7 @@ void BrowseBox::UpdateScrollbars() // needs corner-window? // (do that AFTER positioning BOTH scrollbars) - ULONG nActualCorderWidth = 0; + sal_uIntPtr nActualCorderWidth = 0; if (aHScroll.IsVisible() && pVScroll && pVScroll->IsVisible() ) { // if we have both scrollbars, the corner window fills the point of intersection of these two @@ -1345,7 +1345,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 ) { @@ -1357,21 +1357,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; @@ -1399,7 +1399,7 @@ void BrowseBox::SetUpdateMode( BOOL bUpdate ) //------------------------------------------------------------------- -BOOL BrowseBox::GetUpdateMode() const +sal_Bool BrowseBox::GetUpdateMode() const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1413,7 +1413,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(); @@ -1422,7 +1422,7 @@ long BrowseBox::GetFrozenWidth() const //------------------------------------------------------------------- -void BrowseBox::ColumnInserted( USHORT nPos ) +void BrowseBox::ColumnInserted( sal_uInt16 nPos ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1433,10 +1433,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 ) @@ -1513,7 +1513,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); @@ -1526,7 +1526,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 ) ); @@ -1549,7 +1549,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(); } @@ -1567,17 +1567,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() && @@ -1592,8 +1592,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_uIntPtr nOldWidth = GetColumnWidth(nId); nDragX = QueryColumnResize( GetColumnId(nResizeCol), nOldWidth + nDeltaX ) + nResizeX - nOldWidth; @@ -1631,7 +1631,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 ); } @@ -1639,7 +1639,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) // end action SetPointer( Pointer() ); ReleaseMouse(); - bResizing = FALSE; + bResizing = sal_False; } else MouseButtonUp( BrowserMouseEvent( (BrowserDataWin*)pDataWin, @@ -1651,8 +1651,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 ) { @@ -1667,14 +1667,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 ); @@ -1686,7 +1686,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) if ( rEvt.GetClicks() == 1 ) { // initialise flags - bHit = FALSE; + bHit = sal_False; a1stPoint = a2ndPoint = PixelToLogic( rEvt.GetPosPixel() ); @@ -1699,7 +1699,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) } // while selecting, no cursor - bSelecting = TRUE; + bSelecting = sal_True; DoHideCursor( "MouseButtonDown" ); // DataRow? @@ -1715,19 +1715,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; } @@ -1736,7 +1736,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; @@ -1750,7 +1750,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; } } @@ -1758,9 +1758,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 { @@ -1768,14 +1768,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 @@ -1789,11 +1789,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(); @@ -1819,7 +1819,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(); @@ -1828,19 +1828,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(); @@ -1857,16 +1857,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 ) { @@ -1928,12 +1928,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 ) { @@ -1944,11 +1944,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() ) @@ -1956,7 +1956,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; @@ -1967,7 +1967,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; @@ -1978,12 +1978,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; @@ -1995,40 +1995,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() ) @@ -2041,18 +2041,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 @@ -2068,13 +2068,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: @@ -2082,20 +2082,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); } @@ -2126,7 +2126,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 ) @@ -2150,14 +2150,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(); @@ -2166,7 +2166,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..c62a377dc4e3 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_uIntPtr 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_uIntPtr 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_uIntPtr nPos = GetThumbPos(); if ( nPos != _nLastPos ) { if ( _nTip ) diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index 1deb8aeb5b56..010d86efc249 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_uIntPtr _nOriginalWidth; + sal_uIntPtr _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_uIntPtr nWidthPixel, const Fraction& rCurrentZoom, HeaderBarItemBits nFlags ); virtual ~BrowserColumn(); - USHORT GetId() const { return _nId; } + sal_uInt16 GetId() const { return _nId; } - ULONG Width() { return _nWidth; } + sal_uIntPtr 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_uIntPtr 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,22 +133,22 @@ 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 bNoScrollBack; // nur vorwaerts scrollen - FASTBOOL bNoHScroll; // kein horizontaler Scrollbar - FASTBOOL bNoVScroll; // no vertical scrollbar - FASTBOOL bAutoHScroll; // autohide horizontaler Scrollbar - FASTBOOL bAutoVScroll; // autohide horizontaler Scrollbar - FASTBOOL bUpdateMode; // nicht SV-UpdateMode wegen Invalidate() - FASTBOOL bAutoSizeLastCol;// last column always fills up window - FASTBOOL bResizeOnPaint; // outstanding resize-event - FASTBOOL bUpdateOnUnlock; // Update() while locked - FASTBOOL bInUpdateScrollbars; // Rekursionsschutz - 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()! + int bInPaint; // sal_True while in Paint + int bInCommand; // sal_True while in Command + int bNoScrollBack; // nur vorwaerts scrollen + int bNoHScroll; // kein horizontaler Scrollbar + int bNoVScroll; // no vertical scrollbar + int bAutoHScroll; // autohide horizontaler Scrollbar + int bAutoVScroll; // autohide horizontaler Scrollbar + int bUpdateMode; // nicht SV-UpdateMode wegen Invalidate() + int bAutoSizeLastCol;// last column always fills up window + int bResizeOnPaint; // outstanding resize-event + int bUpdateOnUnlock; // Update() while locked + int bInUpdateScrollbars; // Rekursionsschutz + int bHadRecursion; // Rekursion war aufgetreten + int bOwnDataChangedHdl; // dont change colors in DataChanged + int bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop curently + 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 ); - FASTBOOL GetUpdateMode() const { return bUpdateMode; } + void SetUpdateMode( sal_Bool bMode ); + int 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_uIntPtr _nTip; + sal_uIntPtr _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..c6854bbeab0f 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_uIntPtr 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,36 +552,36 @@ 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(); if ( bHandled ) // the view claimed it handled the key input { - // unfortunately, KeyInput also returns <TRUE/> (means "I handled this key input") + // unfortunately, KeyInput also returns <sal_True/> (means "I handled this key input") // when nothing really changed. Let's care for this. Selection aNewSelection( GetSelection() ); 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); } |