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 | |
parent | 1fa45c8a636ff3e4732cfdf5dd0dc8e833707bc5 (diff) |
removetooltypes01: #i112600# remove tooltypes from toolkit, svtools and framework
Diffstat (limited to 'svtools/source')
189 files changed, 8574 insertions, 8574 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); } diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx index b2d2c54232b0..1cd368df0f5f 100644 --- a/svtools/source/config/accessibilityoptions.cxx +++ b/svtools/source/config/accessibilityoptions.cxx @@ -515,14 +515,14 @@ SvtAccessibilityOptions::SvtAccessibilityOptions() } ++sm_nAccessibilityRefCount; } - //StartListening( *sm_pSingleImplConfig, TRUE ); + //StartListening( *sm_pSingleImplConfig, sal_True ); } // ----------------------------------------------------------------------- SvtAccessibilityOptions::~SvtAccessibilityOptions() { - //EndListening( *sm_pSingleImplConfig, TRUE ); + //EndListening( *sm_pSingleImplConfig, sal_True ); ::osl::MutexGuard aGuard( SingletonMutex::get() ); if( !--sm_nAccessibilityRefCount ) { diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index 316e6ab34656..10e3d5ec68b8 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -60,11 +60,11 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) ,nAAMinPixelHeight ( DEFAULT_AAMINHEIGHT ) #endif - ,bMenuMouseFollow(FALSE) - ,bSingleLineTabCtrl(FALSE) - ,bColoredTabCtrl(FALSE) + ,bMenuMouseFollow(sal_False) + ,bSingleLineTabCtrl(sal_False) + ,bColoredTabCtrl(sal_False) #if defined( UNX ) || defined ( FS_PRIV_DEBUG ) - ,bFontAntialiasing ( TRUE ) + ,bFontAntialiasing ( sal_True ) #endif { RTL_LOGFILE_CONTEXT(aLog, "svtools SvtTabAppearanceCfg::SvtTabAppearanceCfg()"); @@ -177,7 +177,7 @@ void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUSt Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetLookNFeel ( USHORT nSet ) +void SvtTabAppearanceCfg::SetLookNFeel ( sal_uInt16 nSet ) { nLookNFeel = nSet; SetModified(); @@ -187,7 +187,7 @@ void SvtTabAppearanceCfg::SetLookNFeel ( USHORT nSet ) Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet ) +void SvtTabAppearanceCfg::SetDragMode ( sal_uInt16 nSet ) { nDragMode = nSet; SetModified(); @@ -197,7 +197,7 @@ void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet ) Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetScaleFactor ( USHORT nSet ) +void SvtTabAppearanceCfg::SetScaleFactor ( sal_uInt16 nSet ) { nScaleFactor = nSet; SetModified(); @@ -207,7 +207,7 @@ void SvtTabAppearanceCfg::SetScaleFactor ( USHORT nSet ) Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetSnapMode ( USHORT nSet ) +void SvtTabAppearanceCfg::SetSnapMode ( sal_uInt16 nSet ) { nSnapMode = nSet; SetModified(); @@ -215,7 +215,7 @@ void SvtTabAppearanceCfg::SetSnapMode ( USHORT nSet ) /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ -void SvtTabAppearanceCfg::SetMiddleMouseButton ( USHORT nSet ) +void SvtTabAppearanceCfg::SetMiddleMouseButton ( sal_uInt16 nSet ) { nMiddleMouse = nSet; SetModified(); @@ -233,7 +233,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // SetStandard...Styles() resets the UseSystemUIFonts flag, // but we don't want to change it now, so save the flag before ... - BOOL bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts(); + sal_Bool bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts(); switch ( nLookNFeel ) { @@ -271,7 +271,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // Mouse Snap MouseSettings hMouseSettings = hAppSettings.GetMouseSettings(); - ULONG nMouseOptions = hMouseSettings.GetOptions(); + sal_uIntPtr nMouseOptions = hMouseSettings.GetOptions(); nMouseOptions &= ! (MOUSE_OPTION_AUTOCENTERPOS | MOUSE_OPTION_AUTODEFBTNPOS); @@ -292,7 +292,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) // Merge and Publish Settings - ULONG nFollow = hMouseSettings.GetFollow(); + sal_uIntPtr nFollow = hMouseSettings.GetFollow(); if(bMenuMouseFollow) nFollow |= MOUSE_FOLLOW_MENU; else diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 7a151d609e6e..91e93cc65998 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -550,7 +550,7 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bS if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor)) aRet.nColor = ColorConfig::GetDefaultColor(eEntry).GetColor(); //#103495# don't allow grey between 40% and 60% as application background - const UINT8 nRed = COLORDATA_RED( aRet.nColor); + const sal_uInt8 nRed = COLORDATA_RED( aRet.nColor); if(eEntry == APPBACKGROUND && (nRed == COLORDATA_GREEN( aRet.nColor)) && (nRed == COLORDATA_BLUE( aRet.nColor)) && @@ -569,14 +569,14 @@ EditableColorConfig::EditableColorConfig() : m_pImpl(new ColorConfig_Impl), m_bModified(sal_False) { - m_pImpl->BlockBroadcasts(TRUE); + m_pImpl->BlockBroadcasts(sal_True); } /*-- 25.03.2002 12:03:08--------------------------------------------------- -----------------------------------------------------------------------*/ EditableColorConfig::~EditableColorConfig() { - m_pImpl->BlockBroadcasts(FALSE); + m_pImpl->BlockBroadcasts(sal_False); if(m_bModified) m_pImpl->SetModified(); if(m_pImpl->IsModified()) @@ -674,12 +674,12 @@ void EditableColorConfig::Commit() // ----------------------------------------------------------------------------- void EditableColorConfig::DisableBroadcast() { - m_pImpl->BlockBroadcasts(TRUE); + m_pImpl->BlockBroadcasts(sal_True); } // ----------------------------------------------------------------------------- void EditableColorConfig::EnableBroadcast() { - m_pImpl->BlockBroadcasts(FALSE); + m_pImpl->BlockBroadcasts(sal_False); } // ----------------------------------------------------------------------------- diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx index b8a9660ee8dc..1be097f17ab5 100644 --- a/svtools/source/config/htmlcfg.cxx +++ b/svtools/source/config/htmlcfg.cxx @@ -276,7 +276,7 @@ void SvxHtmlOptions::AddListenerLink( const Link& rLink ) void SvxHtmlOptions::RemoveListenerLink( const Link& rLink ) { - for ( USHORT n=0; n<pImp->aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<pImp->aList.Count(); n++ ) { if ( (*pImp->aList.GetObject(n) ) == rLink ) { @@ -288,7 +288,7 @@ void SvxHtmlOptions::RemoveListenerLink( const Link& rLink ) void SvxHtmlOptions::CallListeners() { - for ( USHORT n = 0; n < pImp->aList.Count(); ++n ) + for ( sal_uInt16 n = 0; n < pImp->aList.Count(); ++n ) pImp->aList.GetObject(n)->Call( this ); } @@ -300,14 +300,14 @@ void SvxHtmlOptions::Notify( const com::sun::star::uno::Sequence< rtl::OUString } // ----------------------------------------------------------------------- -USHORT SvxHtmlOptions::GetFontSize(USHORT nPos) const +sal_uInt16 SvxHtmlOptions::GetFontSize(sal_uInt16 nPos) const { if(nPos < HTML_FONT_COUNT) - return (USHORT)pImp->aFontSizeArr[nPos]; + return (sal_uInt16)pImp->aFontSizeArr[nPos]; return 0; } // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize) +void SvxHtmlOptions::SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize) { if(nPos < HTML_FONT_COUNT) { @@ -321,7 +321,7 @@ void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize) // ----------------------------------------------------------------------- -BOOL SvxHtmlOptions::IsImportUnknown() const +sal_Bool SvxHtmlOptions::IsImportUnknown() const { return 0 != (pImp->nFlags & HTMLCFG_UNKNOWN_TAGS) ; } @@ -329,7 +329,7 @@ BOOL SvxHtmlOptions::IsImportUnknown() const // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetImportUnknown(BOOL bSet) +void SvxHtmlOptions::SetImportUnknown(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_UNKNOWN_TAGS; @@ -341,15 +341,15 @@ void SvxHtmlOptions::SetImportUnknown(BOOL bSet) // ----------------------------------------------------------------------- -USHORT SvxHtmlOptions::GetExportMode() const +sal_uInt16 SvxHtmlOptions::GetExportMode() const { - return (USHORT)pImp->nExportMode; + return (sal_uInt16)pImp->nExportMode; } // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetExportMode(USHORT nSet) +void SvxHtmlOptions::SetExportMode(sal_uInt16 nSet) { if(nSet <= HTML_CFG_MAX ) { @@ -362,7 +362,7 @@ void SvxHtmlOptions::SetExportMode(USHORT nSet) // ----------------------------------------------------------------------- -BOOL SvxHtmlOptions::IsStarBasic() const +sal_Bool SvxHtmlOptions::IsStarBasic() const { return 0 != (pImp->nFlags & HTMLCFG_STAR_BASIC) ; } @@ -370,7 +370,7 @@ BOOL SvxHtmlOptions::IsStarBasic() const // ----------------------------------------------------------------------- -void SvxHtmlOptions::SetStarBasic(BOOL bSet) +void SvxHtmlOptions::SetStarBasic(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_STAR_BASIC; @@ -383,14 +383,14 @@ void SvxHtmlOptions::SetStarBasic(BOOL bSet) --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsSaveGraphicsLocal() const +sal_Bool SvxHtmlOptions::IsSaveGraphicsLocal() const { return 0 != (pImp->nFlags & HTMLCFG_LOCAL_GRF) ; } /*-----------------14.02.97 08.34------------------- --------------------------------------------------*/ -void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet) +void SvxHtmlOptions::SetSaveGraphicsLocal(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_LOCAL_GRF; @@ -403,9 +403,9 @@ void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet) --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsPrintLayoutExtension() const +sal_Bool SvxHtmlOptions::IsPrintLayoutExtension() const { - BOOL bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION); + sal_Bool bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION); switch( pImp->nExportMode ) { case HTML_CFG_MSIE_40: @@ -413,14 +413,14 @@ BOOL SvxHtmlOptions::IsPrintLayoutExtension() const case HTML_CFG_WRITER : break; default: - bRet = FALSE; + bRet = sal_False; } return bRet; } /*-----------------10/21/97 08:34am----------------- --------------------------------------------------*/ -void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet) +void SvxHtmlOptions::SetPrintLayoutExtension(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_PRINT_LAYOUT_EXTENSION; @@ -433,14 +433,14 @@ void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet) --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsIgnoreFontFamily() const +sal_Bool SvxHtmlOptions::IsIgnoreFontFamily() const { return 0 != (pImp->nFlags & HTMLCFG_IGNORE_FONT_FAMILY) ; } /*-----------------10.07.98 10.02------------------- --------------------------------------------------*/ -void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet) +void SvxHtmlOptions::SetIgnoreFontFamily(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY; @@ -451,14 +451,14 @@ void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet) /* -----------------05.02.99 09:03------------------- * * --------------------------------------------------*/ -BOOL SvxHtmlOptions::IsStarBasicWarning() const +sal_Bool SvxHtmlOptions::IsStarBasicWarning() const { return 0 != (pImp->nFlags & HTMLCFG_IS_BASIC_WARNING) ; } /* -----------------05.02.99 09:03------------------- * * --------------------------------------------------*/ -void SvxHtmlOptions::SetStarBasicWarning(BOOL bSet) +void SvxHtmlOptions::SetStarBasicWarning(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_IS_BASIC_WARNING; @@ -506,14 +506,14 @@ SvxHtmlOptions* SvxHtmlOptions::Get() /* ---------------------- 2006-06-07T21:02+0200 ---------------------- */ -BOOL SvxHtmlOptions::IsNumbersEnglishUS() const +sal_Bool SvxHtmlOptions::IsNumbersEnglishUS() const { return 0 != (pImp->nFlags & HTMLCFG_NUMBERS_ENGLISH_US) ; } /* ---------------------- 2006-06-07T21:02+0200 ---------------------- */ -void SvxHtmlOptions::SetNumbersEnglishUS(BOOL bSet) +void SvxHtmlOptions::SetNumbersEnglishUS(sal_Bool bSet) { if(bSet) pImp->nFlags |= HTMLCFG_NUMBERS_ENGLISH_US; diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 70d9d1623ef2..7a0f59c6f925 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -176,7 +176,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_bDontHideDisabledEntries = bState; SetModified(); - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); Commit(); } @@ -185,7 +185,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_bFollowMouse = bState; SetModified(); - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); Commit(); } @@ -194,7 +194,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_nMenuIcons = bState; SetModified(); - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); Commit(); } @@ -299,7 +299,7 @@ SvtMenuOptions_Impl::~SvtMenuOptions_Impl() Commit(); } - for ( USHORT n=0; n<aList.Count(); ) + for ( sal_uInt16 n=0; n<aList.Count(); ) delete aList.Remove(n); } @@ -349,7 +349,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); } @@ -416,7 +416,7 @@ void SvtMenuOptions_Impl::AddListenerLink( const Link& rLink ) void SvtMenuOptions_Impl::RemoveListenerLink( const Link& rLink ) { - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) { if ( (*aList.GetObject(n) ) == rLink ) { diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index 7b04b56104e0..dd8c9ad24994 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -81,7 +81,7 @@ using namespace ::com::sun::star; #define PROPERTYCOUNT 6 -#define VCL_TOOLBOX_STYLE_FLAT ((USHORT)0x0004) // from <vcl/toolbox.hxx> +#define VCL_TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx> DECLARE_LIST( LinkList, Link * ) @@ -374,7 +374,7 @@ SvtMiscOptions_Impl::~SvtMiscOptions_Impl() Commit(); } - for ( USHORT n=0; n<aList.Count(); ) + for ( sal_uInt16 n=0; n<aList.Count(); ) delete aList.Remove(n); } @@ -467,7 +467,7 @@ void SvtMiscOptions_Impl::AddListenerLink( const Link& rLink ) void SvtMiscOptions_Impl::RemoveListenerLink( const Link& rLink ) { - for ( USHORT n=0; n<aList.Count(); n++ ) + for ( sal_uInt16 n=0; n<aList.Count(); n++ ) { if ( (*aList.GetObject(n) ) == rLink ) { @@ -479,7 +479,7 @@ void SvtMiscOptions_Impl::RemoveListenerLink( const Link& rLink ) void SvtMiscOptions_Impl::CallListeners() { - for ( USHORT n = 0; n < aList.Count(); ++n ) + for ( sal_uInt16 n = 0; n < aList.Count(); ++n ) aList.GetObject(n)->Call( this ); } @@ -725,7 +725,7 @@ sal_Int16 SvtMiscOptions::GetCurrentSymbolsSize() const { // Use system settings, we have to retrieve the toolbar icon size from the // Application class - ULONG nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize(); + sal_uIntPtr nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize(); if ( nStyleIconSize == STYLE_TOOLBAR_ICONSIZE_LARGE ) eOptSymbolsSize = SFX_SYMBOLS_SIZE_LARGE; else diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index 46e1f737d347..237d7f79a1c1 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -75,7 +75,7 @@ // - statics - // ----------- -static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; +static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; #define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ])) @@ -748,7 +748,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() ); rOptions.SetReduceBitmaps( IsReduceBitmaps() ); rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() ); - rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) GetReducedBitmapResolution(), (USHORT)( DPI_COUNT - 1 ) ) ] ); + rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] ); rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() ); rOptions.SetConvertToGreyscales( IsConvertToGreyscales() ); } @@ -771,7 +771,7 @@ void SvtBasePrintOptions::SetPrinterOptions( const PrinterOptions& rOptions ) SetReducedBitmapIncludesTransparency( rOptions.IsReducedBitmapIncludesTransparency() ); SetConvertToGreyscales( rOptions.IsConvertToGreyscales() ); - const USHORT nDPI = rOptions.GetReducedBitmapResolution(); + const sal_uInt16 nDPI = rOptions.GetReducedBitmapResolution(); if( nDPI < aDPIArray[ 0 ] ) SetReducedBitmapResolution( 0 ); diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx index 463c6ccc8b35..ee5e97003271 100644 --- a/svtools/source/contnr/ctrdll.cxx +++ b/svtools/source/contnr/ctrdll.cxx @@ -58,7 +58,7 @@ extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) hDLLInst = hDLL; - return TRUE; + return sal_True; } /*************************************************************************** diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 843de83f7710..a7d6c5e085db 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -111,7 +111,7 @@ namespace struct ReleaseSolarMutex { private: - ULONG m_nCount; + sal_uIntPtr m_nCount; public: inline ReleaseSolarMutex() @@ -216,7 +216,7 @@ private: sal_Bool Kill( const OUString& rURL ); protected: - virtual BOOL DoubleClickHdl(); + virtual sal_Bool DoubleClickHdl(); virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos ) const; public: @@ -225,7 +225,7 @@ public: virtual void Resize(); virtual void KeyInput( const KeyEvent& rKEvt ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); void ClearAll(); HeaderBar* GetHeaderBar() const { return mpHeaderBar; } @@ -239,7 +239,7 @@ public: DECL_LINK( ResetQuickSearch_Impl, Timer * ); virtual PopupMenu* CreateContextMenu( void ); - virtual void ExcecuteContextMenuAction( USHORT nSelectedPopentry ); + virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopentry ); }; // class HashedEntry -------------------------------------------------- @@ -469,9 +469,9 @@ void NameTranslationList::Init() aConfig.SetGroup( ByteString( pSection ) ); - USHORT nKeyCnt = aConfig.GetKeyCount(); + sal_uInt16 nKeyCnt = aConfig.GetKeyCount(); - for( USHORT nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt ) + for( sal_uInt16 nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt ) Insert( new NameTranslationEntry( aConfig.GetKeyName( nCnt ), aConfig.ReadKey( nCnt ) ) ); } } @@ -611,7 +611,7 @@ public: String FolderInserted( const OUString& rURL, const OUString& rTitle ); - ULONG GetEntryPos( const OUString& rURL ); + sal_uIntPtr GetEntryPos( const OUString& rURL ); inline void EnableContextMenu( sal_Bool bEnable ); inline void EnableDelete( sal_Bool bEnable ); @@ -888,7 +888,7 @@ PopupMenu* ViewTabListBox_Impl::CreateContextMenu( void ) // ----------------------------------------------------------------------- -void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ) +void ViewTabListBox_Impl::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { switch ( nSelectedPopupEntry ) { @@ -906,7 +906,7 @@ void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry void ViewTabListBox_Impl::ClearAll() { - for ( USHORT i = 0; i < GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < GetEntryCount(); ++i ) delete (SvtContentEntry*)GetEntry(i)->GetUserData(); Clear(); } @@ -963,10 +963,10 @@ void ViewTabListBox_Impl::DeleteEntries() } // ----------------------------------------------------------------------- -BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, +sal_Bool ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; OUString aURL; SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData(); @@ -990,7 +990,7 @@ BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, pData->maURL = aURL; pEntry->SetUserData( pData ); - bRet = TRUE; + bRet = sal_True; } catch( ::com::sun::star::ucb::ContentCreationException ) {} catch( ::com::sun::star::ucb::CommandAbortedException ) {} @@ -1027,7 +1027,7 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar ) SvLBoxEntry* pEntry = GetEntry( mnSearchIndex ); if ( pEntry ) { - SelectAll( FALSE ); + SelectAll( sal_False ); Select( pEntry ); SetCurEntry( pEntry ); MakeVisible( pEntry ); @@ -1043,10 +1043,10 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar ) } // ----------------------------------------------------------------------- -BOOL ViewTabListBox_Impl::DoubleClickHdl() +sal_Bool ViewTabListBox_Impl::DoubleClickHdl() { SvHeaderTabListBox::DoubleClickHdl(); - return FALSE; + return sal_False; // this means "do no additional handling". Especially this means that the SvImpLBox does not // recognize that the entry at the double click position change after the handler call (which is // the case if in the handler, our content was replaced) @@ -1193,7 +1193,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents ) { mpImp->mpView->ClearAll(); const OUString* pFileProperties = aContents.getConstArray(); - UINT32 i, nCount = aContents.getLength(); + sal_uInt32 i, nCount = aContents.getLength(); for ( i = 0; i < nCount; ++i ) { String aRow( pFileProperties[i] ); @@ -1225,7 +1225,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents ) // detect image sal_Bool bDoInsert = sal_True; INetURLObject aObj( aImageURL.Len() > 0 ? aImageURL : aURL ); - Image aImage = SvFileInformationManager::GetImage( aObj, FALSE, isHighContrast( this ) ); + Image aImage = SvFileInformationManager::GetImage( aObj, sal_False, isHighContrast( this ) ); if ( bDoInsert ) { @@ -1273,7 +1273,7 @@ sal_Bool SvtFileView::CreateNewFolder( const String& rNewFolder ) String sTitle = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); String sEntry = mpImp->FolderInserted( sURL, sTitle ); SvLBoxEntry* pEntry = mpImp->mpView->InsertEntry( sEntry, mpImp->maFolderImage, mpImp->maFolderImage ); - SvtContentEntry* pUserData = new SvtContentEntry( sURL, TRUE ); + SvtContentEntry* pUserData = new SvtContentEntry( sURL, sal_True ); pEntry->SetUserData( pUserData ); mpImp->mpView->MakeVisible( pEntry ); bRet = sal_True; @@ -1459,7 +1459,7 @@ void SvtFileView::CancelRunningAsyncAction() void SvtFileView::SetNoSelection() { - mpImp->mpView->SelectAll( FALSE ); + mpImp->mpView->SelectAll( sal_False ); } // ----------------------------------------------------------------------- @@ -1494,7 +1494,7 @@ void SvtFileView::SetDoubleClickHdl( const Link& rHdl ) // ----------------------------------------------------------------------- -ULONG SvtFileView::GetSelectionCount() const +sal_uIntPtr SvtFileView::GetSelectionCount() const { return mpImp->mpView->GetSelectionCount(); } @@ -1566,7 +1566,7 @@ void SvtFileView::EndInplaceEditing( bool _bCancel ) IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar ) { DBG_ASSERT( pBar, "no headerbar" ); - USHORT nItemID = pBar->GetCurItemId(); + sal_uInt16 nItemID = pBar->GetCurItemId(); HeaderBarItemBits nBits; @@ -1587,7 +1587,7 @@ IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar ) nBits = pBar->GetItemBits( nItemID ); - BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); + sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); if ( bUp ) { @@ -1611,10 +1611,10 @@ IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar ) if ( !pBar->IsItemMode() ) { Size aSize; - USHORT nTabs = pBar->GetItemCount(); + sal_uInt16 nTabs = pBar->GetItemCount(); long nTmpSize = 0; - for ( USHORT i = 1; i <= nTabs; ++i ) + for ( sal_uInt16 i = 1; i <= nTabs; ++i ) { long nWidth = pBar->GetItemSize(i); aSize.Width() = nWidth + nTmpSize; @@ -1637,14 +1637,14 @@ String SvtFileView::GetConfigString() const sRet += String::CreateFromInt32( mpImp->mnSortColumn ); sRet += ';'; HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn ); - BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); + sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); sRet += bUp ? '1' : '0'; sRet += ';'; - USHORT nCount = pBar->GetItemCount(); - for ( USHORT i = 0; i < nCount; ++i ) + sal_uInt16 nCount = pBar->GetItemCount(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) { - USHORT nId = pBar->GetItemId(i); + sal_uInt16 nId = pBar->GetItemId(i); sRet += String::CreateFromInt32( nId ); sRet += ';'; sRet += String::CreateFromInt32( pBar->GetItemSize( nId ) ); @@ -1661,9 +1661,9 @@ void SvtFileView::SetConfigString( const String& rCfgStr ) HeaderBar* pBar = mpImp->mpView->GetHeaderBar(); DBG_ASSERT( pBar, "invalid headerbar" ); - USHORT nIdx = 0; - mpImp->mnSortColumn = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); - BOOL bUp = (BOOL)(USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); + sal_uInt16 nIdx = 0; + mpImp->mnSortColumn = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); + sal_Bool bUp = (sal_Bool)(sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn ); if ( bUp ) @@ -1680,7 +1680,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr ) while ( nIdx != STRING_NOTFOUND ) { - USHORT nItemId = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); + sal_uInt16 nItemId = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); pBar->SetItemSize( nItemId, rCfgStr.GetToken( 0, ';', nIdx ).ToInt32() ); } @@ -2074,7 +2074,7 @@ void SvtFileView_Impl::OpenFolder_Impl() { ::osl::MutexGuard aGuard( maMutex ); - mpView->SetUpdateMode( FALSE ); + mpView->SetUpdateMode( sal_False ); mpView->ClearAll(); std::vector< SortingData_Impl* >::iterator aIt; @@ -2097,7 +2097,7 @@ void SvtFileView_Impl::OpenFolder_Impl() InitSelection(); ++mnSuspendSelectCallback; - mpView->SetUpdateMode( TRUE ); + mpView->SetUpdateMode( sal_True ); --mnSuspendSelectCallback; ResetCursor(); @@ -2109,9 +2109,9 @@ void SvtFileView_Impl::ResetCursor() // deselect SvLBoxEntry* pEntry = mpView->FirstSelected(); if ( pEntry ) - mpView->Select( pEntry, FALSE ); + mpView->Select( pEntry, sal_False ); // set cursor to the first entry - mpView->SetCursor( mpView->First(), TRUE ); + mpView->SetCursor( mpView->First(), sal_True ); mpView->Update(); } @@ -2243,10 +2243,10 @@ void SvtFileView_Impl::CreateDisplayText_Impl() ::svtools::VolumeInfo aVolInfo( (*aIt)->mbIsVolume, (*aIt)->mbIsRemote, (*aIt)->mbIsRemoveable, (*aIt)->mbIsFloppy, (*aIt)->mbIsCompactDisc ); - (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE, isHighContrast( mpView ) ); + (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False, isHighContrast( mpView ) ); } else - (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), FALSE, isHighContrast( mpView )); + (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), sal_False, isHighContrast( mpView )); } } @@ -2331,7 +2331,7 @@ void SvtFileView_Impl::CreateVector_Impl( const Sequence < OUString > &rList ) // detect the image INetURLObject aObj( pEntry->maImageURL.getLength() ? pEntry->maImageURL : pEntry->maTargetURL ); - pEntry->maImage = SvFileInformationManager::GetImage( aObj, FALSE, isHighContrast( mpView ) ); + pEntry->maImage = SvFileInformationManager::GetImage( aObj, sal_False, isHighContrast( mpView ) ); maContent.push_back( pEntry ); } @@ -2362,7 +2362,7 @@ void SvtFileView_Impl::Resort_Impl( sal_Int16 nColumn, sal_Bool bAscending ) if ( !mbIsFirstResort ) { - ULONG nPos = GetEntryPos( aEntryURL ); + sal_uIntPtr nPos = GetEntryPos( aEntryURL ); if ( nPos < mpView->GetEntryCount() ) { pEntry = mpView->GetEntry( nPos ); @@ -2451,7 +2451,7 @@ sal_Bool CompareSortingData_Impl( SortingData_Impl* const aOne, SortingData_Impl } } - // when the two elements are equal, we must not return TRUE (which would + // when the two elements are equal, we must not return sal_True (which would // happen if we just return ! ( a < b ) when not sorting ascending ) if ( bEqual ) return sal_False; @@ -2541,7 +2541,7 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r ::svtools::VolumeInfo aVolInfo; pData->maType = SvFileInformationManager::GetFolderDescription( aVolInfo ); - pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE, isHighContrast( mpView ) ); + pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False, isHighContrast( mpView ) ); OUString aValue; OUString aTab = OUString::createFromAscii( "\t" ); @@ -2570,12 +2570,12 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r } // ----------------------------------------------------------------------- -ULONG SvtFileView_Impl::GetEntryPos( const OUString& rURL ) +sal_uIntPtr SvtFileView_Impl::GetEntryPos( const OUString& rURL ) { ::osl::MutexGuard aGuard( maMutex ); std::vector< SortingData_Impl* >::iterator aIt; - ULONG nPos = 0; + sal_uIntPtr nPos = 0; for ( aIt = maContent.begin(); aIt != maContent.end(); aIt++ ) { diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index cc7aa4e05ee1..82cfbe4595d5 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -59,7 +59,7 @@ class IcnGridMap_Impl; #define F_VER_SBARSIZE_WITH_HBAR 0x0001 #define F_HOR_SBARSIZE_WITH_VBAR 0x0002 -#define F_PAINTED 0x0004 // TRUE nach erstem Paint +#define F_PAINTED 0x0004 // sal_True nach erstem Paint #define F_ADD_MODE 0x0008 #define F_SELECTING_RECT 0x0020 #define F_DOWN_CTRL 0x0080 @@ -108,11 +108,11 @@ enum IcnViewFieldType // struct LocalFocus { - BOOL bOn; + sal_Bool bOn; Rectangle aRect; Color aPenColor; - LocalFocus() { bOn = FALSE; } + LocalFocus() { bOn = sal_False; } }; /////////////////////////////////////////////////////////////////////////////// @@ -132,18 +132,18 @@ private: public: EntryList_Impl( SvxIconChoiceCtrl_Impl*, - USHORT _nInitSize = 1024, - USHORT _nReSize = 1024 ); + sal_uInt16 _nInitSize = 1024, + sal_uInt16 _nReSize = 1024 ); EntryList_Impl( SvxIconChoiceCtrl_Impl*, - USHORT _nBlockSize, - USHORT _nInitSize, - USHORT _nReSize ); + sal_uInt16 _nBlockSize, + sal_uInt16 _nInitSize, + sal_uInt16 _nReSize ); ~EntryList_Impl(); void Clear(); - void Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos ); - SvxIconChoiceCtrlEntry* Remove( ULONG nPos ); + void Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uIntPtr nPos ); + SvxIconChoiceCtrlEntry* Remove( sal_uIntPtr nPos ); void Remove( SvxIconChoiceCtrlEntry* pEntry ); }; @@ -158,7 +158,7 @@ class SvxIconChoiceCtrl_Impl friend class EntryList_Impl; friend class IcnGridMap_Impl; - BOOL bChooseWithCursor; + sal_Bool bChooseWithCursor; EntryList_Impl aEntries; ScrollBar aVerSBar; ScrollBar aHorSBar; @@ -188,12 +188,12 @@ class SvxIconChoiceCtrl_Impl IcnViewEdit_Impl* pEdit; WinBits nWinBits; long nMaxBoundHeight; // Hoehe des hoechsten BoundRects - USHORT nFlags; - USHORT nCurTextDrawFlags; - ULONG nUserEventAdjustScrBars; - ULONG nUserEventShowCursor; + sal_uInt16 nFlags; + sal_uInt16 nCurTextDrawFlags; + sal_uIntPtr nUserEventAdjustScrBars; + sal_uIntPtr nUserEventShowCursor; SvxIconChoiceCtrlEntry* pCurHighlightFrame; - BOOL bHighlightFramePressed; + sal_Bool bHighlightFramePressed; SvxIconChoiceCtrlEntry* pHead; // Eintrag oben links SvxIconChoiceCtrlEntry* pCursor; SvxIconChoiceCtrlEntry* pPrevDropTarget; @@ -211,16 +211,16 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlEntry* pCurEditedEntry; SvxIconChoiceCtrlTextMode eTextMode; SelectionMode eSelectionMode; - ULONG nSelectionCount; + sal_uIntPtr nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; - BOOL bBoundRectsDirty; - BOOL bUpdateMode; - BOOL bEntryEditingEnabled; - BOOL bInDragDrop; + sal_Bool bBoundRectsDirty; + sal_Bool bUpdateMode; + sal_Bool bEntryEditingEnabled; + sal_Bool bInDragDrop; - void ShowCursor( BOOL bShow ); + void ShowCursor( sal_Bool bShow ); - void ImpArrange( BOOL bKeepPredecessors = FALSE ); + void ImpArrange( sal_Bool bKeepPredecessors = sal_False ); void AdjustVirtSize( const Rectangle& ); void ResetVirtSize(); void CheckScrollBars(); @@ -235,16 +235,16 @@ class SvxIconChoiceCtrl_Impl DECL_LINK( VisRectChangedHdl, void* ); DECL_LINK( CallSelectHdlHdl, void* ); - void AdjustScrollBars( BOOL bVirtSizeGrowedOnly = FALSE); + void AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False); void PositionScrollBars( long nRealWidth, long nRealHeight ); long GetScrollBarPageSize( long nVisibleRange ) const { return ((nVisibleRange*75)/100); } long GetScrollBarLineSize() const { return nMaxBoundHeight / 2; } - BOOL HandleScrollCommand( const CommandEvent& rCmd ); + sal_Bool HandleScrollCommand( const CommandEvent& rCmd ); void ToDocPos( Point& rPosPixel ) { rPosPixel -= pView->GetMapMode().GetOrigin(); } void InitScrollBarBox(); SvxIconChoiceCtrlEntry* FindNewCursor(); void ToggleSelection( SvxIconChoiceCtrlEntry* ); - void DeselectAllBut( SvxIconChoiceCtrlEntry*, BOOL bPaintSync=FALSE ); + void DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False ); void Center( SvxIconChoiceCtrlEntry* pEntry ) const; void StopEditTimer() { aEditTimer.Stop(); } void StartEditTimer() { aEditTimer.Start(); } @@ -253,13 +253,13 @@ class SvxIconChoiceCtrl_Impl void SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, - BOOL bAdd = TRUE, + sal_Bool bAdd = sal_True, SvPtrarr* pOtherRects = 0 ); void SelectRange( SvxIconChoiceCtrlEntry* pStart, SvxIconChoiceCtrlEntry* pEnd, - BOOL bAdd = TRUE ); + sal_Bool bAdd = sal_True ); void AddSelectedRect( const Rectangle& ); void AddSelectedRect( @@ -275,27 +275,27 @@ class SvxIconChoiceCtrl_Impl Point AdjustAtGrid( const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) const Rectangle& rBoundRect ) const; - ULONG GetPredecessorGrid( const Point& rDocPos) const; + sal_uIntPtr GetPredecessorGrid( const Point& rDocPos) const; void InitPredecessors(); void ClearPredecessors(); - BOOL CheckVerScrollBar(); - BOOL CheckHorScrollBar(); + sal_Bool CheckVerScrollBar(); + sal_Bool CheckHorScrollBar(); void CancelUserEvents(); - void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect, - BOOL bSyncPaint ); + void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, + sal_Bool bSyncPaint ); void SaveSelection( List** ); - void RepaintEntries( USHORT nEntryFlagsMask ); + void RepaintEntries( sal_uInt16 nEntryFlagsMask ); void SetListPositions(); void SetDefaultTextSize(); - BOOL IsAutoArrange() const { - return (BOOL)(ePositionMode == IcnViewPositionModeAutoArrange); } - BOOL IsAutoAdjust() const { - return (BOOL)(ePositionMode == IcnViewPositionModeAutoAdjust); } + sal_Bool IsAutoArrange() const { + return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); } + sal_Bool IsAutoAdjust() const { + return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); } void DocRectChanged() { aDocRectChangedTimer.Start(); } void VisRectChanged() { aVisRectChangedTimer.Start(); } - void SetOrigin( const Point&, BOOL bDoNotUpdateWallpaper = FALSE ); + void SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False ); DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* ); @@ -303,7 +303,7 @@ class SvxIconChoiceCtrl_Impl void HideFocus (); void DrawFocusRect ( OutputDevice* pOut ); - BOOL IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const; + sal_Bool IsMnemonicChar( sal_Unicode cChar, sal_uIntPtr& rPos ) const; public: @@ -315,52 +315,52 @@ public: SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle ); ~SvxIconChoiceCtrl_Impl(); - BOOL SetChoiceWithCursor ( BOOL bDo = TRUE ) { BOOL bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; } - void Clear( BOOL bInCtor = FALSE ); + sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True ) { sal_Bool bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; } + void Clear( sal_Bool bInCtor = sal_False ); void SetStyle( WinBits nWinStyle ); WinBits GetStyle() const { return nWinBits; } - void InsertEntry( SvxIconChoiceCtrlEntry*, ULONG nPos, const Point* pPos=0 ); + void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uIntPtr nPos, const Point* pPos=0 ); void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL ); void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ); void FontModified(); - void SelectAll( BOOL bSelect = TRUE, BOOL bPaint = TRUE ); + void SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True ); void SelectEntry( SvxIconChoiceCtrlEntry*, - BOOL bSelect, - BOOL bCallHdl = TRUE, - BOOL bAddToSelection = FALSE, - BOOL bSyncPaint = FALSE ); + sal_Bool bSelect, + sal_Bool bCallHdl = sal_True, + sal_Bool bAddToSelection = sal_False, + sal_Bool bSyncPaint = sal_False ); void Paint( const Rectangle& rRect ); - BOOL MouseButtonDown( const MouseEvent& ); - BOOL MouseButtonUp( const MouseEvent& ); - BOOL MouseMove( const MouseEvent&); - BOOL RequestHelp( const HelpEvent& rHEvt ); + sal_Bool MouseButtonDown( const MouseEvent& ); + sal_Bool MouseButtonUp( const MouseEvent& ); + sal_Bool MouseMove( const MouseEvent&); + sal_Bool RequestHelp( const HelpEvent& rHEvt ); void SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, SvxIconChoiceCtrlEntry* pNewCursor, - BOOL bMod1, - BOOL bShift, - BOOL bPaintSync = FALSE); - BOOL KeyInput( const KeyEvent& ); + sal_Bool bMod1, + sal_Bool bShift, + sal_Bool bPaintSync = sal_False); + sal_Bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); void LoseFocus(); - void SetUpdateMode( BOOL bUpdate ); - BOOL GetUpdateMode() const { return bUpdateMode; } - void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted=FALSE ); + void SetUpdateMode( sal_Bool bUpdate ); + sal_Bool GetUpdateMode() const { return bUpdateMode; } + void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted=sal_False ); void PaintEntry( SvxIconChoiceCtrlEntry*, const Point&, OutputDevice* pOut = 0, - BOOL bIsBackgroundPainted = FALSE); + sal_Bool bIsBackgroundPainted = sal_False); void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* ); void SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, - BOOL bAdjustRow = FALSE, - BOOL bCheckScrollBars = FALSE, - BOOL bKeepGridMap = FALSE ); + sal_Bool bAdjustRow = sal_False, + sal_Bool bCheckScrollBars = sal_False, + sal_Bool bKeepGridMap = sal_False ); void InvalidateEntry( SvxIconChoiceCtrlEntry* ); IcnViewFieldType GetItem( SvxIconChoiceCtrlEntry*, const Point& rAbsPos ); @@ -370,25 +370,25 @@ public: SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; } void SetCursor( SvxIconChoiceCtrlEntry*, - // TRUE == bei Single-Selection die Sel. mitfuehren - BOOL bSyncSingleSelection = TRUE, - BOOL bShowFocusAsync = FALSE ); + // sal_True == bei Single-Selection die Sel. mitfuehren + sal_Bool bSyncSingleSelection = sal_True, + sal_Bool bShowFocusAsync = sal_False ); - SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, BOOL bHit = FALSE ); + SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False ); SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); Point GetEntryPos( SvxIconChoiceCtrlEntry* ); - void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound = TRUE ); + void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True ); - void Arrange(BOOL bKeepPredecessors = FALSE, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 ); + void Arrange(sal_Bool bKeepPredecessors = sal_False, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 ); Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* ); Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 ); Rectangle CalcTextRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0, - BOOL bForInplaceEdit = FALSE, + sal_Bool bForInplaceEdit = sal_False, const String* pStr = 0 ); long CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const; @@ -405,44 +405,44 @@ public: void RecalcAllBoundingRectsSmart(); const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* ); void InvalidateBoundingRect( SvxIconChoiceCtrlEntry* ); - void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = TRUE; } - BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } + void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; } + sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); } void PaintEmphasis( const Rectangle& rRect1, const Rectangle& rRect2, - BOOL bSelected, - BOOL bDropTarget, - BOOL bCursored, + sal_Bool bSelected, + sal_Bool bDropTarget, + sal_Bool bCursored, OutputDevice* pOut, - BOOL bIsBackgroundPainted = FALSE); + sal_Bool bIsBackgroundPainted = sal_False); void PaintItem( const Rectangle& rRect, IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, - USHORT nPaintFlags, + sal_uInt16 nPaintFlags, OutputDevice* pOut, const String* pStr = 0, ::vcl::ControlLayoutData* _pLayoutData = NULL ); - // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE + // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); } // berechnet alle invalidierten BoundingRects neu void UpdateBoundingRects(); - void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, BOOL bShow ); + void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow ); void PrepareCommandEvent( const CommandEvent& ); void Command( const CommandEvent& rCEvt ); void ToTop( SvxIconChoiceCtrlEntry* ); - ULONG GetSelectionCount() const; + sal_uIntPtr GetSelectionCount() const; void SetGrid( const Size& ); Size GetMinGrid() const; - ULONG GetGridCount( + sal_uIntPtr GetGridCount( const Size& rSize, - BOOL bCheckScrBars, - BOOL bSmartScrBar ) const; - void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); + sal_Bool bCheckScrBars, + sal_Bool bSmartScrBar ) const; + void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False ); const Size& GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const; void HideDDIcon(); @@ -451,67 +451,67 @@ public: SvxIconChoiceCtrlEntry* pRefEntry, const Point& rPos ); - BOOL IsOver( + sal_Bool IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; void SelectRect( const Rectangle&, - BOOL bAdd = TRUE, + sal_Bool bAdd = sal_True, SvPtrarr* pOtherRects = 0 ); void CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY, - BOOL bDragDrop = FALSE, - USHORT nBorderWidth = 10 ); + sal_Bool bDragDrop = sal_False, + sal_uInt16 nBorderWidth = 10 ); - BOOL IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ); + sal_Bool IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ); void MakeVisible( const Rectangle& rDocPos, - BOOL bInScrollBarEvent=FALSE, - BOOL bCallRectChangedHdl = TRUE ); + sal_Bool bInScrollBarEvent=sal_False, + sal_Bool bCallRectChangedHdl = sal_True ); void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 ); void SetEntryTextMode( SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry* pEntry = 0 ); SvxIconChoiceCtrlTextMode GetTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const; void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry ); - void EnableEntryEditing( BOOL bEnable ) { bEntryEditingEnabled = bEnable; } - BOOL IsEntryEditingEnabled() const { return bEntryEditingEnabled; } - BOOL IsEntryEditing() const { return (BOOL)(pCurEditedEntry!=0); } + void EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; } + sal_Bool IsEntryEditingEnabled() const { return bEntryEditingEnabled; } + sal_Bool IsEntryEditing() const { return (sal_Bool)(pCurEditedEntry!=0); } void EditEntry( SvxIconChoiceCtrlEntry* pEntry ); - void StopEntryEditing( BOOL bCancel ); - void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock ); - ULONG GetEntryCount() const { return aEntries.Count(); } - SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); } - SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( ULONG& ) const; - SvxIconChoiceCtrlEntry* GetNextSelectedEntry( ULONG& ) const; + void StopEntryEditing( sal_Bool bCancel ); + void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock ); + sal_uIntPtr GetEntryCount() const { return aEntries.Count(); } + SvxIconChoiceCtrlEntry* GetEntry( sal_uIntPtr nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); } + SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( sal_uIntPtr& ) const; + SvxIconChoiceCtrlEntry* GetNextSelectedEntry( sal_uIntPtr& ) const; SvxIconChoiceCtrlEntry* GetHdlEntry() const { return pHdlEntry; } void SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; } SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const; void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; } SelectionMode GetSelectionMode() const { return eSelectionMode; } - BOOL AreEntriesMoved() const { return (BOOL)((nFlags & F_MOVED_ENTRIES)!=0); } - void SetEntriesMoved( BOOL bMoved ) + sal_Bool AreEntriesMoved() const { return (sal_Bool)((nFlags & F_MOVED_ENTRIES)!=0); } + void SetEntriesMoved( sal_Bool bMoved ) { if( bMoved ) nFlags |= F_MOVED_ENTRIES; else nFlags &= ~(F_MOVED_ENTRIES); } - ULONG GetEntryListPos( SvxIconChoiceCtrlEntry* ) const; - void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, ULONG nNewPos ); + sal_uIntPtr GetEntryListPos( SvxIconChoiceCtrlEntry* ) const; + void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uIntPtr nNewPos ); void SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; } - void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nFlags ); - SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight ); - SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown ); + void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags ); + SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); + SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); void InitSettings(); Rectangle GetOutputRect() const; - BOOL ArePredecessorsSet() const { return (BOOL)(pHead != 0); } + sal_Bool ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); } SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; } void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor); - BOOL GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor); + sal_Bool GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor); // liefert gueltige Ergebnisse nur im AutoArrange-Modus! SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& ); @@ -519,24 +519,24 @@ public: SvxIconChoiceCtrlPositionMode GetPositionMode() const { return ePositionMode;} void Flush(); - void SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& ); - const SvxIconChoiceCtrlColumnInfo* GetColumn( USHORT nIndex ) const; - const SvxIconChoiceCtrlColumnInfo* GetItemColumn( USHORT nSubItem, long& rLeft ) const; + void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& ); + const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const; + const SvxIconChoiceCtrlColumnInfo* GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const; Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); } Rectangle GetVisibleRect() const { return GetOutputRect(); } - void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,BOOL bKeepHighlightFlags=FALSE ); + void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,sal_Bool bKeepHighlightFlags=sal_False ); void HideEntryHighlightFrame(); void DrawHighlightFrame( OutputDevice* pOut, - const Rectangle& rBmpRect, BOOL bHide ); + const Rectangle& rBmpRect, sal_Bool bHide ); void StopSelectTimer() { aCallSelectHdlTimer.Stop(); } void Tracking( const TrackingEvent& rTEvt ); Point GetPopupMenuPosPixel() const; - BOOL HandleShortCutKey( const KeyEvent& rKeyEvent ); + sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent ); - void CallEventListeners( ULONG nEvent, void* pData = NULL ); + void CallEventListeners( sal_uIntPtr nEvent, void* pData = NULL ); inline ::svt::IAccessibleFactory& GetAccessibleFactory() { return aAccFactory.getFactory(); } @@ -558,12 +558,12 @@ class IcnCursor_Impl void ImplCreate(); void Create() { if( !pColumns ) ImplCreate(); } - USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); - SvxIconChoiceCtrlEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref, - BOOL bDown, BOOL bSimple ); + sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); + SvxIconChoiceCtrlEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref, + sal_Bool bDown, sal_Bool bSimple ); - SvxIconChoiceCtrlEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref, - BOOL bRight, BOOL bSimple ); + SvxIconChoiceCtrlEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref, + sal_Bool bRight, sal_Bool bSimple ); public: IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner ); @@ -571,9 +571,9 @@ public: void Clear(); // fuer Cursortravelling usw. - SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight ); - SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown ); - SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown ); + SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); + SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); + SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left() // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann @@ -585,7 +585,7 @@ public: // ---------------------------------------------------------------------------------------------- -typedef ULONG GridId; +typedef sal_uIntPtr GridId; #define GRID_NOT_FOUND ((GridId)ULONG_MAX) @@ -593,14 +593,14 @@ class IcnGridMap_Impl { Rectangle _aLastOccupiedGrid; SvxIconChoiceCtrl_Impl* _pView; - BOOL* _pGridMap; - USHORT _nGridCols, _nGridRows; + sal_Bool* _pGridMap; + sal_uInt16 _nGridCols, _nGridRows; void Expand(); void Create_Impl(); void Create() { if(!_pGridMap) Create_Impl(); } - void GetMinMapSize( USHORT& rDX, USHORT& rDY ) const; + void GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const; public: IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView); @@ -608,22 +608,22 @@ public: void Clear(); - GridId GetGrid( const Point& rDocPos, BOOL* pbClipped = 0 ); - GridId GetGrid( USHORT nGridX, USHORT nGridY ); - GridId GetUnoccupiedGrid( BOOL bOccupyFound=TRUE ); + GridId GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 ); + GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ); + GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True ); - void OccupyGrids( const Rectangle&, BOOL bOccupy = TRUE ); - void OccupyGrids( const SvxIconChoiceCtrlEntry*, BOOL bOccupy = TRUE ); - void OccupyGrid( GridId nId, BOOL bOccupy = TRUE ) + void OccupyGrids( const Rectangle&, sal_Bool bOccupy = sal_True ); + void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True ); + void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True ) { - DBG_ASSERT(!_pGridMap || nId<(ULONG)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId"); - if(_pGridMap && nId < (ULONG)(_nGridCols *_nGridRows) ) + DBG_ASSERT(!_pGridMap || nId<(sal_uIntPtr)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId"); + if(_pGridMap && nId < (sal_uIntPtr)(_nGridCols *_nGridRows) ) _pGridMap[ nId ] = bOccupy; } Rectangle GetGridRect( GridId ); - void GetGridCoord( GridId, USHORT& rGridX, USHORT& rGridY ); - static ULONG GetGridCount( const Size& rSizePixel, USHORT nGridWidth, USHORT nGridHeight ); + void GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY ); + static sal_uIntPtr GetGridCount( const Size& rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight ); void OutputSizeChanged(); }; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index dd2ed992536e..a6686f6013ab 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -68,7 +68,7 @@ struct SvxIconChoiceCtrlEntry_Impl : _pEntry( pEntry), _aPos( rBoundRect.TopLeft()) {} }; -static BOOL bEndScrollInvalidate = TRUE; +static sal_Bool bEndScrollInvalidate = sal_True; // ---------------------------------------------------------------------------------------------- @@ -78,9 +78,9 @@ class IcnViewEdit_Impl : public MultiLineEdit Accelerator aAccReturn; Accelerator aAccEscape; Timer aTimer; - BOOL bCanceled; - BOOL bAlreadyInCallback; - BOOL bGrabFocus; + sal_Bool bCanceled; + sal_Bool bAlreadyInCallback; + sal_Bool bGrabFocus; void CallCallBackHdl_Impl(); DECL_LINK( Timeout_Impl, Timer * ); @@ -99,9 +99,9 @@ public: ~IcnViewEdit_Impl(); virtual void KeyInput( const KeyEvent& rKEvt ); virtual long PreNotify( NotifyEvent& rNEvt ); - BOOL EditingCanceled() const { return bCanceled; } - void StopEditing( BOOL bCancel = FALSE ); - BOOL IsGrabFocus() const { return bGrabFocus; } + sal_Bool EditingCanceled() const { return bCanceled; } + void StopEditing( sal_Bool bCancel = sal_False ); + sal_Bool IsGrabFocus() const { return bGrabFocus; } }; // ---------------------------------------------------------------------------------------------- @@ -117,7 +117,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, aImageSize( 32, 32 ), pColumns( 0 ) { - bChooseWithCursor=FALSE; + bChooseWithCursor=sal_False; pEntryPaintDev = 0; pCurEditedEntry = 0; pCurHighlightFrame = 0; @@ -128,10 +128,10 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, pHdlEntry = 0; pHead = NULL; pCursor = NULL; - bUpdateMode = TRUE; - bEntryEditingEnabled = FALSE; - bInDragDrop = FALSE; - bHighlightFramePressed = FALSE; + bUpdateMode = sal_True; + bEntryEditingEnabled = sal_False; + bInDragDrop = sal_False; + bHighlightFramePressed = sal_False; eSelectionMode = MULTIPLE_SELECTION; pView = pCurView; pZOrderList = new List; //SvPtrarr; @@ -171,7 +171,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, aVisRectChangedTimer.SetTimeout( 50 ); aVisRectChangedTimer.SetTimeoutHdl(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl)); - Clear( TRUE ); + Clear( sal_True ); SetGrid( Size(100, 70) ); } @@ -195,17 +195,17 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() ClearColumnList(); } -void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor ) +void SvxIconChoiceCtrl_Impl::Clear( sal_Bool bInCtor ) { - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); nSelectionCount = 0; DELETEZ(pDraggedSelection); - bInDragDrop = FALSE; + bInDragDrop = sal_False; pCurHighlightFrame = 0; StopEditTimer(); CancelUserEvents(); - ShowCursor( FALSE ); - bBoundRectsDirty = FALSE; + ShowCursor( sal_False ); + bBoundRectsDirty = sal_False; nMaxBoundHeight = 0; nFlags &= ~(F_PAINTED | F_MOVED_ENTRIES); @@ -229,8 +229,8 @@ void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor ) pView->Invalidate(INVALIDATE_NOCHILDREN); } AdjustScrollBars(); - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); delete pCur; @@ -259,19 +259,19 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle ) IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar ) { - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); // Pfeil hoch: delta=-1; Pfeil runter: delta=+1 - Scroll( 0, pScrollBar->GetDelta(), TRUE ); - bEndScrollInvalidate = TRUE; + Scroll( 0, pScrollBar->GetDelta(), sal_True ); + bEndScrollInvalidate = sal_True; return 0; } IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar ) { - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); // Pfeil links: delta=-1; Pfeil rechts: delta=+1 - Scroll( pScrollBar->GetDelta(), 0, TRUE ); - bEndScrollInvalidate = TRUE; + Scroll( pScrollBar->GetDelta(), 0, sal_True ); + bEndScrollInvalidate = sal_True; return 0; } @@ -293,11 +293,11 @@ void SvxIconChoiceCtrl_Impl::FontModified() DELETEZ(pDDTempDev); DELETEZ(pEntryPaintDev); SetDefaultTextSize(); - ShowCursor( FALSE ); - ShowCursor( TRUE ); + ShowCursor( sal_False ); + ShowCursor( sal_True ); } -void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos, +void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, sal_uIntPtr nPos, const Point* pPos ) { StopEditTimer(); @@ -314,13 +314,13 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG { Size aSize( CalcBoundingSize( pEntry ) ); SetBoundingRect_Impl( pEntry, *pPos, aSize ); - SetEntryPos( pEntry, *pPos, FALSE, TRUE, TRUE /*keep grid map*/ ); + SetEntryPos( pEntry, *pPos, sal_False, sal_True, sal_True /*keep grid map*/ ); pEntry->nFlags |= ICNVIEW_FLAG_POS_MOVED; - SetEntriesMoved( TRUE ); + SetEntriesMoved( sal_True ); } else { - // wenn der UpdateMode TRUE ist, wollen wir nicht pauschal alle + // wenn der UpdateMode sal_True ist, wollen wir nicht pauschal alle // BoundRects auf 'zu ueberpruefen' setzen, sondern nur das des // neuen Eintrags. Deshalb kein InvalidateBoundingRect aufrufen! pEntry->aRect.Right() = LONG_MAX; @@ -347,8 +347,8 @@ void SvxIconChoiceCtrl_Impl::CreateAutoMnemonics( MnemonicGenerator* _pGenerator pAutoDeleteOwnGenerator.reset( _pGenerator ); } - ULONG nEntryCount = GetEntryCount(); - ULONG i; + sal_uIntPtr nEntryCount = GetEntryCount(); + sal_uIntPtr i; // insert texts in generator for( i = 0; i < nEntryCount; ++i ) @@ -381,8 +381,8 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() if( nFlags & F_ENTRYLISTPOS_VALID ) return; - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); pEntry->nPos = nCur; @@ -392,14 +392,14 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) { - BOOL bSyncSingleSelection; + sal_Bool bSyncSingleSelection; // bei Single-Selection wird die Selektion beim Umsetzen des Cursors // mitgefuehrt. Das soll aber nur erfolgen, wenn ueberhaupt ein // Eintrag selektiert ist. if( GetSelectionCount() ) - bSyncSingleSelection = TRUE; + bSyncSingleSelection = sal_True; else - bSyncSingleSelection = FALSE; + bSyncSingleSelection = sal_False; if( pEntry == pCurHighlightFrame ) pCurHighlightFrame = 0; @@ -407,7 +407,7 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) if( bInDragDrop ) { DELETEZ(pDraggedSelection); - bInDragDrop = FALSE; + bInDragDrop = sal_False; } if( pEntry->IsSelected() ) @@ -424,25 +424,25 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) pAnchor = 0; if( pEntry->IsSelected() ) nSelectionCount--; - BOOL bEntryBoundValid = IsBoundingRectValid( pEntry->aRect ); + sal_Bool bEntryBoundValid = IsBoundingRectValid( pEntry->aRect ); if( bEntryBoundValid ) pView->Invalidate( pEntry->aRect ); - BOOL bSetNewCursor = FALSE; + sal_Bool bSetNewCursor = sal_False; SvxIconChoiceCtrlEntry* pNewCursor = NULL; if( pEntry == pCursor ) { - bSetNewCursor = TRUE; + bSetNewCursor = sal_True; pNewCursor = FindNewCursor(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pCursor = 0; } - BOOL bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? TRUE : FALSE; + sal_Bool bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? sal_True : sal_False; if( bCurEntryPosValid && aEntries.GetObject(aEntries.Count()-1) != pEntry ) nFlags &= ~F_ENTRYLISTPOS_VALID; - ULONG nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uIntPtr nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos ); if( bCurEntryPosValid ) { @@ -460,12 +460,12 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) { // Fokusrechteck asynchron einblenden, um das Loeschen einer // Multiselektion zu beschleunigen. - SetCursor( pNewCursor, bSyncSingleSelection, TRUE ); + SetCursor( pNewCursor, bSyncSingleSelection, sal_True ); } } -void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect, - BOOL bCallHdl, BOOL bAdd, BOOL bSyncPaint ) +void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, + sal_Bool bCallHdl, sal_Bool bAdd, sal_Bool bSyncPaint ) { if( eSelectionMode == NO_SELECTION ) return; @@ -482,7 +482,7 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b if( pEntry->IsSelected() != bSelect ) { pHdlEntry = pEntry; - USHORT nEntryFlags = pEntry->GetFlags(); + sal_uInt16 nEntryFlags = pEntry->GetFlags(); if( bSelect ) { nEntryFlags |= ICNVIEW_FLAG_SELECTED; @@ -503,8 +503,8 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b } } -void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect, - BOOL bSyncPaint ) +void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, + sal_Bool bSyncPaint ) { // bei SingleSelection dafuer sorgen, dass der Cursor immer // auf dem (einzigen) selektierten Eintrag steht. Aber nur, @@ -524,7 +524,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL if( bUpdateMode ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( pView->IsTracking() && (bSelect || !pView->HasBackground()) ) // beim Tracken immer synchron PaintEntry( pEntry ); else if( bSyncPaint ) // synchron & mit virtuellem OutDev! @@ -534,7 +534,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL pView->Invalidate( CalcFocusRect( pEntry ) ); } if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } // if( bUpdateMode ) // --> OD 2009-05-27 #i101012# @@ -551,9 +551,9 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() StopEditTimer(); aVirtOutputSize.Width() = 0; aVirtOutputSize.Height() = 0; - BOOL bLockedEntryFound = FALSE; - const ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_Bool bLockedEntryFound = sal_False; + const sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); pCur->ClearFlags( ICNVIEW_FLAG_POS_MOVED ); @@ -564,7 +564,7 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() FindBoundingRect( pCur ); else AdjustVirtSize( pCur->aRect ); - bLockedEntryFound = TRUE; + bLockedEntryFound = sal_True; } else InvalidateBoundingRect( pCur->aRect ); @@ -576,8 +576,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() if( aVirtOutputSize.Width() < aRealOutputSize.Width() || aVirtOutputSize.Height() < aRealOutputSize.Height() ) { - ULONG nGridCount = IcnGridMap_Impl::GetGridCount( - aRealOutputSize, (USHORT)nGridDX, (USHORT)nGridDY ); + sal_uIntPtr nGridCount = IcnGridMap_Impl::GetGridCount( + aRealOutputSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY ); if( nGridCount < nCount ) { if( nWinBits & WB_ALIGN_TOP ) @@ -625,11 +625,11 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const Rectangle& rRect ) void SvxIconChoiceCtrl_Impl::InitPredecessors() { DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized"); - ULONG nCount = aEntries.Count(); + sal_uIntPtr nCount = aEntries.Count(); if( nCount ) { SvxIconChoiceCtrlEntry* pPrev = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); - for( ULONG nCur = 1; nCur <= nCount; nCur++ ) + for( sal_uIntPtr nCur = 1; nCur <= nCount; nCur++ ) { pPrev->ClearFlags( ICNVIEW_FLAG_POS_LOCKED | ICNVIEW_FLAG_POS_MOVED | ICNVIEW_FLAG_PRED_SET); @@ -654,8 +654,8 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors() { if( pHead ) { - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); pCur->pflink = 0; @@ -666,7 +666,7 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors() } } -void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight ) +void SvxIconChoiceCtrl_Impl::Arrange( sal_Bool bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight ) { if ( nSetMaxVirtWidth != 0 ) nMaxVirtWidth = nSetMaxVirtWidth; @@ -681,23 +681,23 @@ void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWi ImpArrange( bKeepPredecessors ); } -void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors ) +void SvxIconChoiceCtrl_Impl::ImpArrange( sal_Bool bKeepPredecessors ) { static Point aEmptyPoint; - BOOL bOldUpdate = bUpdateMode; + sal_Bool bOldUpdate = bUpdateMode; Rectangle aCurOutputArea( GetOutputRect() ); if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint ) - bUpdateMode = FALSE; + bUpdateMode = sal_False; aAutoArrangeTimer.Stop(); nFlags &= ~F_MOVED_ENTRIES; nFlags |= F_ARRANGING; StopEditTimer(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); ResetVirtSize(); if( !bKeepPredecessors ) ClearPredecessors(); - bBoundRectsDirty = FALSE; + bBoundRectsDirty = sal_False; SetOrigin( Point() ); VisRectChanged(); RecalcAllBoundingRectsSmart(); @@ -710,12 +710,12 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors ) MakeVisible( aCurOutputArea ); SetUpdateMode( bOldUpdate ); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) { - bEndScrollInvalidate = FALSE; + bEndScrollInvalidate = sal_False; #if defined(OV_DRAWGRID) Color aOldColor ( pView->GetLineColor() ); @@ -764,14 +764,14 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) if( !pCursor ) { // set cursor to item with focus-flag - BOOL bfound = FALSE; - for ( ULONG i = 0; i < pView->GetEntryCount() && !bfound; i++) + sal_Bool bfound = sal_False; + for ( sal_uIntPtr i = 0; i < pView->GetEntryCount() && !bfound; i++) { SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry ( i ); if( pEntry->IsFocused() ) { pCursor = pEntry; - bfound=TRUE; + bfound=sal_True; } } @@ -783,31 +783,31 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) if ( pView->HasFocus() ) GetFocus(); - ULONG nCount = pZOrderList->Count(); + sal_uIntPtr nCount = pZOrderList->Count(); if( !nCount ) return; - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() ) { Rectangle aOutputArea( GetOutputRect() ); - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; pView->SetClipRegion( aOutputArea ); } - const USHORT nListInitSize = aEntries.Count() > USHRT_MAX ? - USHRT_MAX : (USHORT)aEntries.Count(); + const sal_uInt16 nListInitSize = aEntries.Count() > USHRT_MAX ? + USHRT_MAX : (sal_uInt16)aEntries.Count(); List* pNewZOrderList = new List( nListInitSize ); List* pPaintedEntries = new List( nListInitSize ); - ULONG nPos = 0; + sal_uIntPtr nPos = 0; while( nCount ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos )); const Rectangle& rBoundRect = GetEntryBoundRect( pEntry ); if( rRect.IsOver( rBoundRect ) ) { - PaintEntry( pEntry, rBoundRect.TopLeft(), pView, TRUE ); + PaintEntry( pEntry, rBoundRect.TopLeft(), pView, sal_True ); // Eintraege, die neu gezeichnet werden, auf Top setzen pPaintedEntries->Insert( pEntry, LIST_APPEND ); } @@ -822,7 +822,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) nCount = pPaintedEntries->Count(); if( nCount ) { - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) pZOrderList->Insert( pPaintedEntries->GetObject(nCur), LIST_APPEND); } delete pPaintedEntries; @@ -831,20 +831,20 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) pView->SetClipRegion(); } -void SvxIconChoiceCtrl_Impl::RepaintEntries( USHORT nEntryFlagsMask ) +void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask ) { - const ULONG nCount = pZOrderList->Count(); + const sal_uIntPtr nCount = pZOrderList->Count(); if( !nCount ) return; - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; Rectangle aOutRect( GetOutputRect() ); if( !pView->IsClipRegion() ) { - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; pView->SetClipRegion( aOutRect ); } - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur)); if( pEntry->GetFlags() & nEntryFlagsMask ) @@ -880,28 +880,28 @@ IcnViewFieldType SvxIconChoiceCtrl_Impl::GetItem( SvxIconChoiceCtrlEntry* pEntry return IcnViewFieldTypeDontknow; } -BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) +sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { - BOOL bHandled = TRUE; - bHighlightFramePressed = FALSE; + sal_Bool bHandled = sal_True; + bHighlightFramePressed = sal_False; StopEditTimer(); - BOOL bGotFocus = (BOOL)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS)); + sal_Bool bGotFocus = (sal_Bool)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS)); if( !(nWinBits & WB_NOPOINTERFOCUS) ) pView->GrabFocus(); Point aDocPos( rMEvt.GetPosPixel() ); if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height()) - return FALSE; + return sal_False; ToDocPos( aDocPos ); - SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE ); + SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True ); if( pEntry ) - MakeEntryVisible( pEntry, FALSE ); + MakeEntryVisible( pEntry, sal_False ); if( rMEvt.IsShift() && eSelectionMode != SINGLE_SELECTION ) { if( pEntry ) - SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), TRUE); - return TRUE; + SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), sal_True); + return sal_True; } if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // Tastaturselektion? @@ -932,7 +932,7 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( !pEntry && !(nWinBits & WB_NODRAGSELECTION)) pView->StartTracking( STARTTRACK_SCROLLREPEAT ); - return TRUE; + return sal_True; } else { @@ -954,17 +954,17 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) pView->StartTracking( STARTTRACK_SCROLLREPEAT ); } else - bHandled = FALSE; + bHandled = sal_False; return bHandled; } } - BOOL bSelected = pEntry->IsSelected(); - BOOL bEditingEnabled = IsEntryEditingEnabled(); + sal_Bool bSelected = pEntry->IsSelected(); + sal_Bool bEditingEnabled = IsEntryEditingEnabled(); if( rMEvt.GetClicks() == 2 ) { DeselectAllBut( pEntry ); - SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True ); pHdlEntry = pEntry; pView->ClickIcon(); } @@ -995,8 +995,8 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) ) { pCurHighlightFrame = 0; // Neues painten des Frames erzwingen - bHighlightFramePressed = TRUE; - SetEntryHighlightFrame( pEntry, TRUE ); + bHighlightFramePressed = sal_True; + SetEntryHighlightFrame( pEntry, sal_True ); } } else @@ -1005,9 +1005,9 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { if( !bSelected ) { - DeselectAllBut( pEntry, TRUE /* Synchron painten */ ); + DeselectAllBut( pEntry, sal_True /* Synchron painten */ ); SetCursor( pEntry ); - SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True ); } else { @@ -1027,13 +1027,13 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) return bHandled; } -BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) )) { nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); - bHandled = TRUE; + bHandled = sal_True; } Point aDocPos( rMEvt.GetPosPixel() ); @@ -1046,32 +1046,32 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) // Ctrl & MultiSelection ToggleSelection( pDocEntry ); SetCursor( pDocEntry ); - bHandled = TRUE; + bHandled = sal_True; } else if( nFlags & F_DOWN_DESELECT ) { DeselectAllBut( pDocEntry ); SetCursor( pDocEntry ); - SelectEntry( pDocEntry, TRUE, TRUE, FALSE, TRUE ); - bHandled = TRUE; + SelectEntry( pDocEntry, sal_True, sal_True, sal_False, sal_True ); + bHandled = sal_True; } } nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); if( nFlags & F_START_EDITTIMER_IN_MOUSEUP ) { - bHandled = TRUE; + bHandled = sal_True; StartEditTimer(); nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP; } if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame) { - bHandled = TRUE; + bHandled = sal_True; SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; pCurHighlightFrame = 0; // Neues painten des Frames erzwingen - bHighlightFramePressed = FALSE; - SetEntryHighlightFrame( pEntry, TRUE ); + bHighlightFramePressed = sal_False; + SetEntryHighlightFrame( pEntry, sal_True ); #if 0 CallSelectHandler( pCurHighlightFrame ); #else @@ -1080,27 +1080,27 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) // set focus on Icon SvxIconChoiceCtrlEntry* pOldCursor = pCursor; - SetCursor_Impl( pOldCursor, pHdlEntry, FALSE, FALSE, TRUE ); + SetCursor_Impl( pOldCursor, pHdlEntry, sal_False, sal_False, sal_True ); #endif pHdlEntry = 0; } return bHandled; } -BOOL SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) { const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) ); if( pView->IsTracking() ) - return FALSE; + return sal_False; else if( nWinBits & WB_HIGHLIGHTFRAME ) { - SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE ); + SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True ); SetEntryHighlightFrame( pEntry ); } else - return FALSE; - return TRUE; + return sal_False; + return sal_True; } void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) @@ -1124,7 +1124,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) long nScrollDX, nScrollDY; - CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, FALSE ); + CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, sal_False ); if( nScrollDX || nScrollDY ) { pView->HideTracking(); @@ -1134,7 +1134,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) if( aRect != aCurSelectionRect ) { pView->HideTracking(); - BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE; + sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False; SelectRect( aRect, bAdd, &aSelectedRectList ); } pView->ShowTracking( aRect, SHOWTRACK_SMALL | SHOWTRACK_CLIP ); @@ -1142,25 +1142,25 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt ) } void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, - SvxIconChoiceCtrlEntry* pNewCursor, BOOL bMod1, BOOL bShift, BOOL bPaintSync ) + SvxIconChoiceCtrlEntry* pNewCursor, sal_Bool bMod1, sal_Bool bShift, sal_Bool bPaintSync ) { if( pNewCursor ) { SvxIconChoiceCtrlEntry* pFilterEntry = 0; - BOOL bDeselectAll = FALSE; + sal_Bool bDeselectAll = sal_False; if( eSelectionMode != SINGLE_SELECTION ) { if( !bMod1 && !bShift ) - bDeselectAll = TRUE; + bDeselectAll = sal_True; else if( bShift && !bMod1 && !pAnchor ) { - bDeselectAll = TRUE; + bDeselectAll = sal_True; pFilterEntry = pOldCursor; } } if( bDeselectAll ) DeselectAllBut( pFilterEntry, bPaintSync ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); MakeEntryVisible( pNewCursor ); SetCursor( pNewCursor ); if( bMod1 && !bShift ) @@ -1182,58 +1182,58 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, } else { - SelectEntry( pCursor, TRUE, TRUE, FALSE, bPaintSync ); + SelectEntry( pCursor, sal_True, sal_True, sal_False, bPaintSync ); aCurSelectionRect = GetEntryBoundRect( pCursor ); } } } -BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { StopEditTimer(); - BOOL bMod2 = rKEvt.GetKeyCode().IsMod2(); + sal_Bool bMod2 = rKEvt.GetKeyCode().IsMod2(); sal_Unicode cChar = rKEvt.GetCharCode(); - ULONG nPos = (ULONG)-1; + sal_uIntPtr nPos = (sal_uIntPtr)-1; if ( bMod2 && cChar && IsMnemonicChar( cChar, nPos ) ) { // shortcut is clicked SvxIconChoiceCtrlEntry* pNewCursor = GetEntry( nPos ); SvxIconChoiceCtrlEntry* pOldCursor = pCursor; if ( pNewCursor != pOldCursor ) - SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE ); - return TRUE; + SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False ); + return sal_True; } if ( bMod2 ) // no actions with <ALT> - return FALSE; + return sal_False; - BOOL bKeyUsed = TRUE; - BOOL bMod1 = rKEvt.GetKeyCode().IsMod1(); - BOOL bShift = rKEvt.GetKeyCode().IsShift(); + sal_Bool bKeyUsed = sal_True; + sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1(); + sal_Bool bShift = rKEvt.GetKeyCode().IsShift(); if( eSelectionMode == SINGLE_SELECTION || eSelectionMode == NO_SELECTION) { - bShift = FALSE; - bMod1 = FALSE; + bShift = sal_False; + bMod1 = sal_False; } if( bMod1 ) nFlags |= F_ADD_MODE; - BOOL bDeselectAll = FALSE; + sal_Bool bDeselectAll = sal_False; if( eSelectionMode != SINGLE_SELECTION ) { if( !bMod1 && !bShift ) - bDeselectAll = TRUE; + bDeselectAll = sal_True; if( bShift && !bMod1 && !pAnchor ) - bDeselectAll = TRUE; + bDeselectAll = sal_True; } SvxIconChoiceCtrlEntry* pNewCursor; SvxIconChoiceCtrlEntry* pOldCursor = pCursor; - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch( nCode ) { case KEY_UP: @@ -1242,10 +1242,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { MakeEntryVisible( pCursor ); if( nCode == KEY_UP ) - pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE); + pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False); else - pNewCursor = pImpCursor->GoPageUpDown(pCursor,FALSE); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor = pImpCursor->GoPageUpDown(pCursor,sal_False); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); if( !pNewCursor ) { Rectangle aRect( GetEntryBoundRect( pCursor ) ); @@ -1272,10 +1272,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { if( nCode == KEY_DOWN ) - pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE ); + pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True ); else - pNewCursor=pImpCursor->GoPageUpDown( pCursor,TRUE ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor=pImpCursor->GoPageUpDown( pCursor,sal_True ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); if ( bChooseWithCursor && pNewCursor != NULL) { @@ -1290,8 +1290,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_RIGHT: if( pCursor ) { - pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; @@ -1299,8 +1299,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { MakeEntryVisible( pCursor ); - pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); if( !pNewCursor ) { Rectangle aRect( GetEntryBoundRect(pCursor)); @@ -1320,13 +1320,13 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pView->IsTracking() ) { HideSelectionRect(); - //SelectAll( FALSE ); + //SelectAll( sal_False ); SetNoSelection(); ClearSelectedRectList(); nFlags &= ~F_TRACKING; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; #endif @@ -1335,7 +1335,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( !bMod1 && !bShift ) EditTimeoutHdl( 0 ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_F8: @@ -1347,7 +1347,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) nFlags |= F_ADD_MODE; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SPACE: @@ -1355,12 +1355,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { if( !bMod1 ) { - //SelectAll( FALSE ); + //SelectAll( sal_False ); SetNoSelection(); ClearSelectedRectList(); // click Icon with spacebar - SetEntryHighlightFrame( GetCurEntry(), TRUE ); + SetEntryHighlightFrame( GetCurEntry(), sal_True ); pView->ClickIcon(); pHdlEntry = pCurHighlightFrame; pCurHighlightFrame=0; @@ -1389,9 +1389,9 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_DIVIDE : case KEY_A: if( bMod1 && (eSelectionMode != SINGLE_SELECTION)) - SelectAll( TRUE ); + SelectAll( sal_True ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SUBTRACT: @@ -1399,7 +1399,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( bMod1 ) SetNoSelection(); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_RETURN: @@ -1409,14 +1409,14 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) /*pView->*/EditEntry( pCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_END: if( pCursor ) { pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( aEntries.Count() - 1 ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; @@ -1424,12 +1424,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE ); + SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; default: - bKeyUsed = FALSE; + bKeyUsed = sal_False; } return bKeyUsed; @@ -1455,7 +1455,7 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig aVerSBar.SetPosPixel( aPos ); } -void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL ) +void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool ) { Rectangle aOldOutRect( GetOutputRect() ); long nVirtHeight = aVirtOutputSize.Height(); @@ -1487,7 +1487,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL ) sal_Bool bNoVerSBar = ( nWinBits & WB_NOVSCROLL ) != 0; sal_Bool bNoHorSBar = ( nWinBits & WB_NOHSCROLL ) != 0; - USHORT nResult = 0; + sal_uInt16 nResult = 0; if( nVirtHeight ) { // activate ver scrollbar ? @@ -1625,23 +1625,23 @@ void SvxIconChoiceCtrl_Impl::Resize() VisRectChanged(); } -BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar() +sal_Bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar() { if( !pZOrderList || !aHorSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); - const ULONG nCount = pZOrderList->Count(); + const sal_uIntPtr nCount = pZOrderList->Count(); long nMostRight = 0; - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur); long nRight = GetEntryBoundRect(pEntry).Right(); if( nRight > nWidth ) - return FALSE; + return sal_False; if( nRight > nMostRight ) nMostRight = nRight; } @@ -1658,28 +1658,28 @@ BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar() aSize.Height() += nHorSBarHeight; aVerSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar() +sal_Bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() { if( !pZOrderList || !aVerSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!( nWinBits & WB_VSCROLL) && !aOrigin.Y() ) { long nDeepest = 0; long nHeight = aOutputSize.Height(); - const ULONG nCount = pZOrderList->Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + const sal_uIntPtr nCount = pZOrderList->Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur); long nBottom = GetEntryBoundRect(pEntry).Bottom(); if( nBottom > nHeight ) - return FALSE; + return sal_False; if( nBottom > nDeepest ) nDeepest = nBottom; } @@ -1696,9 +1696,9 @@ BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar() aSize.Width() += nVerSBarWidth; aHorSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -1721,7 +1721,7 @@ void SvxIconChoiceCtrl_Impl::GetFocus() if( pCursor ) { pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -1730,7 +1730,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus() StopEditTimer(); if( pCursor ) pCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); // HideFocus (); // pView->Invalidate ( aFocus.aRect ); @@ -1738,7 +1738,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus() RepaintEntries( ICNVIEW_FLAG_SELECTED ); } -void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate ) +void SvxIconChoiceCtrl_Impl::SetUpdateMode( sal_Bool bUpdate ) { if( bUpdate != bUpdateMode ) { @@ -1753,7 +1753,7 @@ void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate ) } } -void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted ) +void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted ) { Point aPos( GetEntryPos( pEntry ) ); PaintEntry( pEntry, aPos, 0, bIsBackgroundPainted ); @@ -1762,8 +1762,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bI // Prios der Emphasis: bDropTarget => bCursored => bSelected void SvxIconChoiceCtrl_Impl::PaintEmphasis( const Rectangle& rTextRect, const Rectangle& rImageRect, - BOOL bSelected, BOOL bDropTarget, BOOL bCursored, OutputDevice* pOut, - BOOL bIsBackgroundPainted ) + sal_Bool bSelected, sal_Bool bDropTarget, sal_Bool bCursored, OutputDevice* pOut, + sal_Bool bIsBackgroundPainted ) { static Color aTransparent( COL_TRANSPARENT ); @@ -1783,14 +1783,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( const StyleSettings& rSettings = pOut->GetSettings().GetStyleSettings(); Color aOldFillColor( pOut->GetFillColor() ); - BOOL bSolidTextRect = FALSE; - BOOL bSolidImageRect = FALSE; + sal_Bool bSolidTextRect = sal_False; + sal_Bool bSolidImageRect = sal_False; if( bDropTarget && ( eSelectionMode != NO_SELECTION ) ) { pOut->SetFillColor( rSettings.GetHighlightColor() ); - bSolidTextRect = TRUE; - bSolidImageRect = TRUE; + bSolidTextRect = sal_True; + bSolidImageRect = sal_True; } else { @@ -1803,7 +1803,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( const Color& rFillColor = pView->GetFont().GetFillColor(); pOut->SetFillColor( rFillColor ); if( rFillColor != aTransparent ) - bSolidTextRect = TRUE; + bSolidTextRect = sal_True; } } } @@ -1843,14 +1843,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect, - IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, USHORT nPaintFlags, + IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut, const String* pStr, ::vcl::ControlLayoutData* _pLayoutData ) { if( eItem == IcnViewFieldTypeText ) { String aText; if( !pStr ) - aText = pView->GetEntryText( pEntry, FALSE ); + aText = pView->GetEntryText( pEntry, sal_False ); else aText = *pStr; @@ -1866,7 +1866,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect, { Color aBkgColor( pOut->GetBackground().GetColor() ); Color aFontColor; - USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; + sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; if ( nColor > 127 ) aFontColor.SetColor ( COL_BLACK ); else @@ -1944,19 +1944,19 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, - OutputDevice* pOut, BOOL bIsBackgroundPainted ) + OutputDevice* pOut, sal_Bool bIsBackgroundPainted ) { if( !pOut ) pOut = pView; - BOOL bSelected = FALSE; + sal_Bool bSelected = sal_False; if( eSelectionMode != NO_SELECTION ) bSelected = pEntry->IsSelected(); - BOOL bCursored = pEntry->IsCursored(); - BOOL bDropTarget = pEntry->IsDropTarget(); - BOOL bNoEmphasis = pEntry->IsBlockingEmphasis(); + sal_Bool bCursored = pEntry->IsCursored(); + sal_Bool bDropTarget = pEntry->IsDropTarget(); + sal_Bool bNoEmphasis = pEntry->IsBlockingEmphasis(); Font aTempFont( pOut->GetFont() ); @@ -1968,8 +1968,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P } */ - String aEntryText( pView->GetEntryText( pEntry, FALSE ) ); - Rectangle aTextRect( CalcTextRect(pEntry,&rPos,FALSE,&aEntryText)); + String aEntryText( pView->GetEntryText( pEntry, sal_False ) ); + Rectangle aTextRect( CalcTextRect(pEntry,&rPos,sal_False,&aEntryText)); Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos ) ); sal_Bool bShowSelection = @@ -2009,14 +2009,14 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P pOut->SetFillColor( ); } - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() && (aVerSBar.IsVisible() || aHorSBar.IsVisible()) ) { Rectangle aOutputArea( GetOutputRect() ); if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) ) { pView->SetClipRegion( aOutputArea ); - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; } } @@ -2032,10 +2032,10 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P #endif sal_Bool bLargeIconMode = WB_ICON == ( nWinBits & (VIEWMODE_MASK) ); - USHORT nBmpPaintFlags = PAINTFLAG_VER_CENTERED; + sal_uInt16 nBmpPaintFlags = PAINTFLAG_VER_CENTERED; if ( bLargeIconMode ) nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED; - USHORT nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED; + sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED; if( !bNoEmphasis ) PaintEmphasis(aTextRect,aBmpRect,bSelected,bDropTarget,bCursored,pOut,bIsBackgroundPainted); @@ -2051,7 +2051,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P // Highlight-Frame zeichnen if( pEntry == pCurHighlightFrame && !bNoEmphasis ) - DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), FALSE ); + DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), sal_False ); pOut->SetFont( aTempFont ); if( bResetClipRegion ) @@ -2059,15 +2059,15 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P } void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, - BOOL bAdjustAtGrid, BOOL bCheckScrollBars, BOOL bKeepGridMap ) + sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars, sal_Bool bKeepGridMap ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); Rectangle aBoundRect( GetEntryBoundRect( pEntry )); pView->Invalidate( aBoundRect ); ToTop( pEntry ); if( !IsAutoArrange() ) { - BOOL bAdjustVirtSize = FALSE; + sal_Bool bAdjustVirtSize = sal_False; if( rPos != aBoundRect.TopLeft() ) { Point aGridOffs( @@ -2078,7 +2078,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const aBoundRect.SetPos( rPos ); pEntry->aRect = aBoundRect; pEntry->aGridRect.SetPos( rPos + aGridOffs ); - bAdjustVirtSize = TRUE; + bAdjustVirtSize = sal_True; } if( bAdjustAtGrid ) { @@ -2097,7 +2097,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) ); Rectangle aNewBoundRect( aNewPos, pEntry->aRect.GetSize()); AdjustVirtSize( aNewBoundRect ); - bAdjustVirtSize = FALSE; + bAdjustVirtSize = sal_False; } AdjustEntryAtGrid( pEntry ); ToTop( pEntry ); @@ -2117,7 +2117,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const SetEntryPredecessor( pEntry, pPrev ); aAutoArrangeTimer.Start(); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvxIconChoiceCtrl_Impl::SetNoSelection() @@ -2126,16 +2126,16 @@ void SvxIconChoiceCtrl_Impl::SetNoSelection() if( !(nFlags & F_CLEARING_SELECTION )) { nFlags |= F_CLEARING_SELECTION; - DeselectAllBut( 0, TRUE ); + DeselectAllBut( 0, sal_True ); nFlags &= ~F_CLEARING_SELECTION; } } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, BOOL bHit ) +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, sal_Bool bHit ) { CheckBoundingRects(); // Z-Order-Liste vom Ende her absuchen - ULONG nCount = pZOrderList->Count(); + sal_uIntPtr nCount = pZOrderList->Count(); while( nCount ) { nCount--; @@ -2166,11 +2166,11 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextEntry( const Point& rDocP { CheckBoundingRects(); SvxIconChoiceCtrlEntry* pTarget = 0; - const ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + const sal_uIntPtr nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != LIST_ENTRY_NOTFOUND ) { - const ULONG nCount = pZOrderList->Count(); - for( ULONG nCur = nStartPos+1; nCur < nCount; nCur++ ) + const sal_uIntPtr nCount = pZOrderList->Count(); + for( sal_uIntPtr nCur = nStartPos+1; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur)); if( pEntry->aRect.IsInside( rDocPos ) ) @@ -2187,7 +2187,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetPrevEntry( const Point& rDocP { CheckBoundingRects(); SvxIconChoiceCtrlEntry* pTarget = 0; - ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + sal_uIntPtr nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != LIST_ENTRY_NOTFOUND && nStartPos != 0 ) { nStartPos--; @@ -2209,7 +2209,7 @@ Point SvxIconChoiceCtrl_Impl::GetEntryPos( SvxIconChoiceCtrlEntry* pEntry ) return pEntry->aRect.TopLeft(); } -void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound ) +void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound ) { if ( bBound ) { @@ -2263,7 +2263,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pEntry, c } Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry, - const Point* pEntryPos, BOOL bEdit, const String* pStr ) + const Point* pEntryPos, sal_Bool bEdit, const String* pStr ) { String aEntryText; if( !pStr ) @@ -2381,8 +2381,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() { nMaxBoundHeight = 0; pZOrderList->Clear(); - ULONG nCount = aEntries.Count(); - ULONG nCur; + sal_uIntPtr nCount = aEntries.Count(); + sal_uIntPtr nCur; SvxIconChoiceCtrlEntry* pEntry; if( !IsAutoArrange() || !pHead ) @@ -2407,7 +2407,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() nCur++; } } - bBoundRectsDirty = FALSE; + bBoundRectsDirty = sal_False; AdjustScrollBars(); } @@ -2415,9 +2415,9 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() { nMaxBoundHeight = 0; pZOrderList->Clear(); - ULONG nCur; + sal_uIntPtr nCur; SvxIconChoiceCtrlEntry* pEntry; - const ULONG nCount = aEntries.Count(); + const sal_uIntPtr nCount = aEntries.Count(); if( !IsAutoArrange() || !pHead ) { @@ -2460,8 +2460,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() void SvxIconChoiceCtrl_Impl::UpdateBoundingRects() { - const ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + const sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); GetEntryBoundRect( pEntry ); @@ -2477,7 +2477,7 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry ) return; } Size aSize( CalcBoundingSize( pEntry ) ); - Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(TRUE)).TopLeft()); + Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(sal_True)).TopLeft()); SetBoundingRect_Impl( pEntry, aPos, aSize ); } @@ -2492,33 +2492,33 @@ void SvxIconChoiceCtrl_Impl::SetBoundingRect_Impl( SvxIconChoiceCtrlEntry* pEntr } -void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSyncSingleSelection, - BOOL bShowFocusAsync ) +void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSyncSingleSelection, + sal_Bool bShowFocusAsync ) { if( pEntry == pCursor ) { if( pCursor && eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection && !pCursor->IsSelected() ) - SelectEntry( pCursor, TRUE, TRUE ); + SelectEntry( pCursor, sal_True, sal_True ); return; } - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvxIconChoiceCtrlEntry* pOldCursor = pCursor; pCursor = pEntry; if( pOldCursor ) { pOldCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED ); if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection ) - SelectEntry( pOldCursor, FALSE, TRUE ); // alten Cursor deselektieren + SelectEntry( pOldCursor, sal_False, sal_True ); // alten Cursor deselektieren } if( pCursor ) { ToTop( pCursor ); pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED ); if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection ) - SelectEntry( pCursor, TRUE, TRUE ); + SelectEntry( pCursor, sal_True, sal_True ); if( !bShowFocusAsync ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); else { if( !nUserEventShowCursor ) @@ -2530,7 +2530,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSy } -void SvxIconChoiceCtrl_Impl::ShowCursor( BOOL bShow ) +void SvxIconChoiceCtrl_Impl::ShowCursor( sal_Bool bShow ) { if( !pCursor || !bShow || !pView->HasFocus() ) { @@ -2569,7 +2569,7 @@ void SvxIconChoiceCtrl_Impl::ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, cons DELETEZ(pDDDev); DELETEZ(pDDBufDev); } - BOOL bSelected = pRefEntry->IsSelected(); + sal_Bool bSelected = pRefEntry->IsSelected(); pRefEntry->ClearFlags( ICNVIEW_FLAG_SELECTED ); if( !pDDDev ) { @@ -2706,16 +2706,16 @@ void SvxIconChoiceCtrl_Impl::InvalidateBoundingRect( SvxIconChoiceCtrlEntry* pEn } -BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) +sal_Bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) { Rectangle aDocRect( GetDocumentRect() ); Rectangle aVisRect( GetVisibleRect() ); if( aVisRect.IsInside( aDocRect )) - return FALSE; + return sal_False; Size aDocSize( aDocRect.GetSize() ); Size aVisSize( aVisRect.GetSize() ); - BOOL bHor = aDocSize.Width() > aVisSize.Width(); - BOOL bVer = aDocSize.Height() > aVisSize.Height(); + sal_Bool bHor = aDocSize.Width() > aVisSize.Width(); + sal_Bool bVer = aDocSize.Height() > aVisSize.Height(); long nScrollDX = 0, nScrollDY = 0; @@ -2724,7 +2724,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) case COMMAND_STARTAUTOSCROLL: { pView->EndTracking(); - USHORT nScrollFlags = 0; + sal_uInt16 nScrollFlags = 0; if( bHor ) nScrollFlags |= AUTOSCROLL_HORZ; if( bVer ) @@ -2732,7 +2732,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) if( nScrollFlags ) { pView->StartAutoScroll( nScrollFlags ); - return TRUE; + return sal_True; } } break; @@ -2742,7 +2742,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) const CommandWheelData* pData = rCmd.GetWheelData(); if( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) && !pData->IsHorz() ) { - ULONG nScrollLines = pData->GetScrollLines(); + sal_uIntPtr nScrollLines = pData->GetScrollLines(); if( nScrollLines == COMMAND_WHEEL_PAGESCROLL ) { nScrollDY = GetScrollBarPageSize( aVisSize.Width() ); @@ -2777,9 +2777,9 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) aVisRect.Left() -= nScrollDX; aVisRect.Right() -= nScrollDX; MakeVisible( aVisRect ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -2806,7 +2806,7 @@ void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry ) { if( pZOrderList->GetObject( pZOrderList->Count() - 1 ) != pEntry ) { - ULONG nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uIntPtr nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos ); pZOrderList->Insert( pEntry, LIST_APPEND ); } @@ -2826,10 +2826,10 @@ void SvxIconChoiceCtrl_Impl::ClipAtVirtOutRect( Rectangle& rRect ) const // rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der // sichtbar gemacht werden soll. -// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet +// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet -void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, - BOOL bCallRectChangedHdl ) +void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar, + sal_Bool bCallRectChangedHdl ) { Rectangle aVirtRect( rRect ); ClipAtVirtOutRect( aVirtRect ); @@ -2875,7 +2875,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, { HideDDIcon(); pView->Update(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); } // Origin fuer SV invertieren (damit wir in @@ -2883,7 +2883,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, aOrigin *= -1; SetOrigin( aOrigin ); - BOOL bScrollable = pView->GetBackground().IsScrollable(); + sal_Bool bScrollable = pView->GetBackground().IsScrollable(); if( pView->HasBackground() && !bScrollable ) { Rectangle aRect( GetOutputRect()); @@ -2915,7 +2915,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar, } if( GetUpdateMode() ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); // pruefen, ob ScrollBars noch benoetigt werden CheckScrollBars(); @@ -2936,15 +2936,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor() SvxIconChoiceCtrlEntry* pNewCursor; if( pCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False ); if( !pNewCursor ) - pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True ); } } } @@ -2954,7 +2954,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor() return pNewCursor; } -ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const +sal_uIntPtr SvxIconChoiceCtrl_Impl::GetSelectionCount() const { if( (nWinBits & WB_HIGHLIGHTFRAME) && pCurHighlightFrame ) return 1; @@ -2963,27 +2963,27 @@ ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry ) { - BOOL bSel; + sal_Bool bSel; if( pEntry->IsSelected() ) - bSel = FALSE; + bSel = sal_False; else - bSel = TRUE; - SelectEntry( pEntry, bSel, TRUE, TRUE ); + bSel = sal_True; + SelectEntry( pEntry, bSel, sal_True, sal_True ); } void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryNot, - BOOL bPaintSync ) + sal_Bool bPaintSync ) { ClearSelectedRectList(); // // !!!!!!! Todo: Evtl. Z-Orderlist abarbeiten !!!!!!! // - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); if( pEntry != pThisEntryNot && pEntry->IsSelected() ) - SelectEntry( pEntry, FALSE, TRUE, TRUE, bPaintSync ); + SelectEntry( pEntry, sal_False, sal_True, sal_True, bPaintSync ); } pAnchor = 0; nFlags &= (~F_ADD_MODE); @@ -3119,7 +3119,7 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const // Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird // links, hoch: Offsets < 0 // rechts, runter: Offsets > 0 -void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar ) +void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar ) { const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); @@ -3172,7 +3172,7 @@ static Rectangle GetHotSpot( const Rectangle& rRect ) } void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, - BOOL bAdd, SvPtrarr* pOtherRects ) + sal_Bool bAdd, SvPtrarr* pOtherRects ) { DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr"); Rectangle aRect( GetEntryBoundRect( pEntry1 ) ); @@ -3180,7 +3180,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIco SelectRect( aRect, bAdd, pOtherRects ); } -void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, +void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pOtherRects ) { aCurSelectionRect = rRect; @@ -3188,53 +3188,53 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, return; // Flag setzen, damit im Select kein ToTop gerufen wird - BOOL bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? TRUE : FALSE; + sal_Bool bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? sal_True : sal_False; nFlags |= F_SELECTING_RECT; CheckBoundingRects(); pView->Update(); - const ULONG nCount = pZOrderList->Count(); + const sal_uIntPtr nCount = pZOrderList->Count(); Rectangle aRect( rRect ); aRect.Justify(); - BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE; + sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False; - BOOL bResetClipRegion = FALSE; + sal_Bool bResetClipRegion = sal_False; if( !pView->IsClipRegion() ) { - bResetClipRegion = TRUE; + bResetClipRegion = sal_True; pView->SetClipRegion( GetOutputRect() ); } - for( ULONG nPos = 0; nPos < nCount; nPos++ ) + for( sal_uIntPtr nPos = 0; nPos < nCount; nPos++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos )); if( !IsBoundingRectValid( pEntry->aRect )) FindBoundingRect( pEntry ); Rectangle aBoundRect( GetHotSpot( pEntry->aRect ) ); - BOOL bSelected = pEntry->IsSelected(); + sal_Bool bSelected = pEntry->IsSelected(); - BOOL bOverlaps; + sal_Bool bOverlaps; if( bCalcOverlap ) bOverlaps = IsOver( pOtherRects, aBoundRect ); else - bOverlaps = FALSE; - BOOL bOver = aRect.IsOver( aBoundRect ); + bOverlaps = sal_False; + sal_Bool bOver = aRect.IsOver( aBoundRect ); if( bOver && !bOverlaps ) { // Ist im neuen Selektionsrechteck und in keinem alten // => selektieren if( !bSelected ) - SelectEntry( pEntry, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_True ); } else if( !bAdd ) { // ist ausserhalb des Selektionsrechtecks // => Selektion entfernen if( bSelected ) - SelectEntry( pEntry, FALSE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True ); } else if( bAdd && bOverlaps ) { @@ -3254,19 +3254,19 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, { // Schnittmenge zwischen alten Rects & aktuellem Rect desel. if( bSelected ) - SelectEntry( pEntry, FALSE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True ); } else { // Eintrag eines alten Rects selektieren if( !bSelected ) - SelectEntry( pEntry, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_True ); } } else if( !bOver && bSelected ) { // Der Eintrag liegt voellig ausserhalb und wird deshalb desel. - SelectEntry( pEntry, FALSE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True ); } } @@ -3281,13 +3281,13 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd, void SvxIconChoiceCtrl_Impl::SelectRange( SvxIconChoiceCtrlEntry* pStart, SvxIconChoiceCtrlEntry* pEnd, - BOOL bAdd ) + sal_Bool bAdd ) { - ULONG nFront = GetEntryListPos( pStart ); - ULONG nBack = GetEntryListPos( pEnd ); - ULONG nFirst = std::min( nFront, nBack ); - ULONG nLast = std::max( nFront, nBack ); - ULONG i; + sal_uIntPtr nFront = GetEntryListPos( pStart ); + sal_uIntPtr nBack = GetEntryListPos( pEnd ); + sal_uIntPtr nFirst = std::min( nFront, nBack ); + sal_uIntPtr nLast = std::max( nFront, nBack ); + sal_uIntPtr i; SvxIconChoiceCtrlEntry* pEntry; if ( ! bAdd ) @@ -3298,7 +3298,7 @@ void SvxIconChoiceCtrl_Impl::SelectRange( { pEntry = GetEntry( i ); if( pEntry->IsSelected() ) - SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True ); } } @@ -3307,33 +3307,33 @@ void SvxIconChoiceCtrl_Impl::SelectRange( { pEntry = GetEntry( i ); if( ! pEntry->IsSelected() ) - SelectEntry( pEntry, TRUE, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True, sal_True, sal_True ); } if ( ! bAdd ) { // deselect everything behind the last entry if not in // adding mode - ULONG nEnd = GetEntryCount(); + sal_uIntPtr nEnd = GetEntryCount(); for ( ; i<nEnd; i++ ) { pEntry = GetEntry( i ); if( pEntry->IsSelected() ) - SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE ); + SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True ); } } } -BOOL SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const +sal_Bool SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const { - const USHORT nCount = pRectList->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = pRectList->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur ); if( rBoundRect.IsOver( *pRect )) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1, @@ -3354,8 +3354,8 @@ void SvxIconChoiceCtrl_Impl::AddSelectedRect( const Rectangle& rRect ) void SvxIconChoiceCtrl_Impl::ClearSelectedRectList() { - const USHORT nCount = aSelectedRectList.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = aSelectedRectList.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur ); delete pRect; @@ -3364,7 +3364,7 @@ void SvxIconChoiceCtrl_Impl::ClearSelectedRectList() } void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel, - long& rX, long& rY, BOOL isInDragDrop, USHORT nBorderWidth) + long& rX, long& rY, sal_Bool isInDragDrop, sal_uInt16 nBorderWidth) { // Scrolling der View, falls sich der Mauszeiger im Grenzbereich des // Fensters befindet @@ -3372,8 +3372,8 @@ void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel, long nPixelToScrollY = 0; Size aWndSize = aOutputSize; - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); if ( rPosPixel.X() < nBorderWidth ) { @@ -3434,16 +3434,16 @@ void SvxIconChoiceCtrl_Impl::PrepareCommandEvent( const CommandEvent& rCEvt ) StopEditTimer(); SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry( rCEvt.GetMousePosPixel() ); if( (nFlags & F_DOWN_CTRL) && pEntry && !pEntry->IsSelected() ) - SelectEntry( pEntry, TRUE, TRUE ); + SelectEntry( pEntry, sal_True, sal_True ); nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); } -BOOL SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ) +sal_Bool SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ) { Rectangle aRect( CalcTextRect( pEntry )); if( aRect.IsInside( rDocPos ) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } IMPL_LINK(SvxIconChoiceCtrl_Impl, EditTimeoutHdl, Timer*, EMPTYARG ) @@ -3469,8 +3469,8 @@ void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart ) { SvPtrarr aLists; pImpCursor->CreateGridAjustData( aLists, pStart ); - const USHORT nCount = aLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = aLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart ); IcnCursor_Impl::DestroyGridAdjustData( aLists ); CheckScrollBars(); @@ -3482,18 +3482,18 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCt if( !rRow.Count() ) return; - BOOL bGo; + sal_Bool bGo; if( !pStart ) - bGo = TRUE; + bGo = sal_True; else - bGo = FALSE; + bGo = sal_False; long nCurRight = 0; - for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ ) + for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ ) { SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)rRow[ nCur ]; if( !bGo && pCur == pStart ) - bGo = TRUE; + bGo = sal_True; //SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); // Massgebend (fuer unser Auge) ist die Bitmap, da sonst @@ -3557,7 +3557,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, if( eTextMode == IcnShowTextDontKnow ) eTextMode = IcnShowTextShort; eTextMode = eMode; - Arrange( TRUE ); + Arrange( sal_True ); } } else @@ -3611,20 +3611,20 @@ void SvxIconChoiceCtrl_Impl::ShowFocus ( Rectangle& rRect ) { Color aBkgColor ( pView->GetBackground().GetColor() ); Color aPenColor; - USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; + sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; if ( nColor > 128 ) aPenColor.SetColor ( COL_BLACK ); else aPenColor.SetColor( COL_WHITE ); - aFocus.bOn = TRUE; + aFocus.bOn = sal_True; aFocus.aPenColor = aPenColor; aFocus.aRect = rRect; } void SvxIconChoiceCtrl_Impl::HideFocus () { - aFocus.bOn = FALSE; + aFocus.bOn = sal_False; } void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut ) @@ -3644,12 +3644,12 @@ void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut ) pOut->DrawPolyLine ( aPolygon, aLineInfo ); } -sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const +sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uIntPtr& rPos ) const { sal_Bool bRet = sal_False; const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - ULONG nEntryCount = GetEntryCount(); - for ( ULONG i = 0; i < nEntryCount; ++i ) + sal_uIntPtr nEntryCount = GetEntryCount(); + for ( sal_uIntPtr i = 0; i < nEntryCount; ++i ) { if ( rI18nHelper.MatchMnemonic( GetEntry( i )->GetText(), cChar ) ) { @@ -3675,7 +3675,7 @@ IMPL_LINK(SvxIconChoiceCtrl_Impl, UserEventHdl, void*, nId ) else if( nId == EVENTID_SHOW_CURSOR ) { nUserEventShowCursor = 0; - ShowCursor( TRUE ); + ShowCursor( sal_True ); } return 0; } @@ -3697,12 +3697,12 @@ void SvxIconChoiceCtrl_Impl::CancelUserEvents() void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Invalidate( pEntry->aRect ); Center( pEntry ); pView->Invalidate( pEntry->aRect ); if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry ) @@ -3711,13 +3711,13 @@ void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry ) if( !pEntry ) return; - StopEntryEditing( TRUE ); + StopEntryEditing( sal_True ); DELETEZ(pEdit); SetNoSelection(); pCurEditedEntry = pEntry; - String aEntryText( pView->GetEntryText( pEntry, TRUE ) ); - Rectangle aRect( CalcTextRect( pEntry, 0, TRUE, &aEntryText ) ); + String aEntryText( pView->GetEntryText( pEntry, sal_True ) ); + Rectangle aRect( CalcTextRect( pEntry, 0, sal_True, &aEntryText ) ); MakeVisible( aRect ); Point aPos( aRect.TopLeft() ); aPos = pView->GetPixelPos( aPos ); @@ -3758,7 +3758,7 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG if( pView->EditedEntry( pCurEditedEntry, aText, pEdit->EditingCanceled() ) ) InvalidateEntry( pCurEditedEntry ); if( !GetSelectionCount() ) - SelectEntry( pCurEditedEntry, TRUE ); + SelectEntry( pCurEditedEntry, sal_True ); pEdit->Hide(); if( pEdit->IsGrabFocus() ) @@ -3769,13 +3769,13 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG return 0; } -void SvxIconChoiceCtrl_Impl::StopEntryEditing( BOOL bCancel ) +void SvxIconChoiceCtrl_Impl::StopEntryEditing( sal_Bool bCancel ) { if( pEdit ) pEdit->StopEditing( bCancel ); } -void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock ) +void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock ) { if( bLock ) pEntry->SetFlags( ICNVIEW_FLAG_POS_LOCKED ); @@ -3783,7 +3783,7 @@ void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL pEntry->ClearFlags( ICNVIEW_FLAG_POS_LOCKED ); } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rPos ) const +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uIntPtr& rPos ) const { if( !GetSelectionCount() ) return 0; @@ -3794,10 +3794,10 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP return pCurHighlightFrame; } - ULONG nCount = aEntries.Count(); + sal_uIntPtr nCount = aEntries.Count(); if( !pHead ) { - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); if( pEntry->IsSelected() ) @@ -3829,14 +3829,14 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP } // kein Round Robin! -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rStartPos ) const +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( sal_uIntPtr& rStartPos ) const { - ULONG nCount = aEntries.Count(); + sal_uIntPtr nCount = aEntries.Count(); if( rStartPos > nCount || !GetSelectionCount() ) return 0; if( !pHead ) { - for( ULONG nCur = rStartPos+1; nCur < nCount; nCur++ ) + for( sal_uIntPtr nCur = rStartPos+1; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); if( pEntry->IsSelected() ) @@ -3865,15 +3865,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rSt return 0; } -void SvxIconChoiceCtrl_Impl::SelectAll( BOOL bSelect, BOOL bPaint ) +void SvxIconChoiceCtrl_Impl::SelectAll( sal_Bool bSelect, sal_Bool bPaint ) { - bPaint = TRUE; + bPaint = sal_True; - ULONG nCount = aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ ) + sal_uIntPtr nCount = aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); - SelectEntry( pEntry, bSelect, TRUE, TRUE, bPaint ); + SelectEntry( pEntry, bSelect, sal_True, sal_True, bPaint ); } nFlags &= (~F_ADD_MODE); pAnchor = 0; @@ -3883,7 +3883,7 @@ void SvxIconChoiceCtrl_Impl::SaveSelection( List** ppList ) { if( !*ppList ) *ppList = new List; - ULONG nPos; + sal_uIntPtr nPos; SvxIconChoiceCtrlEntry* pEntry = GetFirstSelectedEntry( nPos ); while( pEntry && GetSelectionCount() != (*ppList)->Count() ) { @@ -3896,12 +3896,12 @@ IcnViewEdit_Impl::IcnViewEdit_Impl( SvtIconChoiceCtrl* pParent, const Point& rPo const Size& rSize, const XubString& rData, const Link& rNotifyEditEnd ) : MultiLineEdit( pParent, (pParent->GetStyle() & WB_ICON) ? WB_CENTER : WB_LEFT), aCallBackHdl( rNotifyEditEnd ), - bCanceled( FALSE ), - bAlreadyInCallback( FALSE ), - bGrabFocus( FALSE ) + bCanceled( sal_False ), + bAlreadyInCallback( sal_False ), + bGrabFocus( sal_False ) { Font aFont( pParent->GetPointFont() ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); SetControlFont( aFont ); if( !pParent->HasFontFillColor() ) { @@ -3941,7 +3941,7 @@ void IcnViewEdit_Impl::CallCallBackHdl_Impl() aTimer.Stop(); if ( !bAlreadyInCallback ) { - bAlreadyInCallback = TRUE; + bAlreadyInCallback = sal_True; GetpApp()->RemoveAccel( &aAccReturn ); GetpApp()->RemoveAccel( &aAccEscape ); Hide(); @@ -3957,16 +3957,16 @@ IMPL_LINK( IcnViewEdit_Impl, Timeout_Impl, Timer*, EMPTYARG ) IMPL_LINK( IcnViewEdit_Impl, ReturnHdl_Impl, Accelerator*, EMPTYARG ) { - bCanceled = FALSE; - bGrabFocus = TRUE; + bCanceled = sal_False; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); return 1; } IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG ) { - bCanceled = TRUE; - bGrabFocus = TRUE; + bCanceled = sal_True; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); return 1; } @@ -3974,19 +3974,19 @@ IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG ) void IcnViewEdit_Impl::KeyInput( const KeyEvent& rKEvt ) { KeyCode aCode = rKEvt.GetKeyCode(); - USHORT nCode = aCode.GetCode(); + sal_uInt16 nCode = aCode.GetCode(); switch ( nCode ) { case KEY_ESCAPE: - bCanceled = TRUE; - bGrabFocus = TRUE; + bCanceled = sal_True; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); break; case KEY_RETURN: - bCanceled = FALSE; - bGrabFocus = TRUE; + bCanceled = sal_False; + bGrabFocus = sal_True; CallCallBackHdl_Impl(); break; @@ -4002,7 +4002,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt ) if ( !bAlreadyInCallback && ((!Application::GetFocusWindow()) || !IsChild(Application::GetFocusWindow()))) { - bCanceled = FALSE; + bCanceled = sal_False; aTimer.SetTimeout(10); aTimer.SetTimeoutHdl(LINK(this,IcnViewEdit_Impl,Timeout_Impl)); aTimer.Start(); @@ -4011,7 +4011,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt ) return 0; } -void IcnViewEdit_Impl::StopEditing( BOOL bCancel ) +void IcnViewEdit_Impl::StopEditing( sal_Bool bCancel ) { if ( !bAlreadyInCallback ) { @@ -4020,22 +4020,22 @@ void IcnViewEdit_Impl::StopEditing( BOOL bCancel ) } } -ULONG SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const +sal_uIntPtr SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const { if( !(nFlags & F_ENTRYLISTPOS_VALID )) ((SvxIconChoiceCtrl_Impl*)this)->SetListPositions(); return pEntry->nPos; } -void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, ULONG nNewPos ) +void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, sal_uIntPtr nNewPos ) { - ULONG nCurPos = GetEntryListPos( pListEntry ); + sal_uIntPtr nCurPos = GetEntryListPos( pListEntry ); if( nCurPos == nNewPos ) return; aEntries.List::Remove( nCurPos ); aEntries.List::Insert( (void*)pListEntry, nNewPos ); // Eintragspositionen anpassen - ULONG nStart, nEnd; + sal_uIntPtr nStart, nEnd; if( nNewPos < nCurPos ) { nStart = nNewPos; @@ -4053,19 +4053,19 @@ void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry } } -void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nEntryFlags ) +void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nEntryFlags ) { pEntry->nFlags = nEntryFlags; if( nEntryFlags & ICNVIEW_FLAG_POS_MOVED ) nFlags |= F_MOVED_ENTRIES; } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, BOOL bRight ) +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, sal_Bool bRight ) { return pImpCursor->GoLeftRight( pStart, bRight ); } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown ) +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown ) { return pImpCursor->GoUpDown( pStart, bDown ); } @@ -4116,14 +4116,14 @@ void SvxIconChoiceCtrl_Impl::InitSettings() } } -EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nInitSize , USHORT _nReSize ) : +EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nInitSize , sal_uInt16 _nReSize ) : List( _nInitSize, _nReSize ), _pOwner( pOwner ) { _pOwner->pHead = 0; } -EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) : +EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) : List( _nBlockSize, _nInitSize, _nReSize ), _pOwner( pOwner ) { @@ -4141,14 +4141,14 @@ void EntryList_Impl::Clear() List::Clear(); } -void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos ) +void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uIntPtr nPos ) { List::Insert( pEntry, nPos ); if( _pOwner->pHead ) pEntry->SetBacklink( _pOwner->pHead->pblink ); } -SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( ULONG nPos ) +SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( sal_uIntPtr nPos ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)List::Remove( nPos ); DBG_ASSERT(pEntry,"EntryList_Impl::Remove > Entry not found"); @@ -4182,14 +4182,14 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ) void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMode ) { - ULONG nCur; + sal_uIntPtr nCur; if( eMode == ePositionMode ) return; SvxIconChoiceCtrlPositionMode eOldMode = ePositionMode; ePositionMode = eMode; - ULONG nCount = aEntries.Count(); + sal_uIntPtr nCount = aEntries.Count(); if( eOldMode == IcnViewPositionModeAutoArrange ) { @@ -4258,12 +4258,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry if( pEntry == pPredecessor ) return; - ULONG nPos1 = GetEntryListPos( pEntry ); + sal_uIntPtr nPos1 = GetEntryListPos( pEntry ); if( !pHead ) { if( pPredecessor ) { - ULONG nPos2 = GetEntryListPos( pPredecessor ); + sal_uIntPtr nPos2 = GetEntryListPos( pPredecessor ); if( nPos1 == (nPos2 + 1) ) return; // ist schon Vorgaenger } @@ -4277,16 +4277,16 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry if( !pPredecessor && pHead == pEntry ) return; // ist schon der Erste - BOOL bSetHead = FALSE; + sal_Bool bSetHead = sal_False; if( !pPredecessor ) { - bSetHead = TRUE; + bSetHead = sal_True; pPredecessor = pHead->pblink; } if( pEntry == pHead ) { pHead = pHead->pflink; - bSetHead = FALSE; + bSetHead = sal_False; } if( pEntry != pPredecessor ) { @@ -4299,12 +4299,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry aAutoArrangeTimer.Start(); } -BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, +sal_Bool SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, SvxIconChoiceCtrlEntry** ppPredecessor ) { *ppPredecessor = 0; if( !pHead ) - return FALSE; + return sal_False; DBG_ASSERT(pEntry->pblink,"GetEntryPredecessor: Backward link not set"); DBG_ASSERT(pEntry->pflink,"GetEntryPredecessor: Forward link not set"); @@ -4312,14 +4312,14 @@ BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry { SvxIconChoiceCtrlEntry* pFirst = (SvxIconChoiceCtrlEntry*)aEntries.GetObject(0); if( pFirst != pEntry ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } *ppPredecessor = pEntry->pblink; if( !(pEntry->nFlags & ICNVIEW_FLAG_PRED_SET) && (GetEntryListPos( *ppPredecessor ) + 1) == GetEntryListPos( pEntry )) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, @@ -4328,8 +4328,8 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho Point aPos( rPosTopLeft ); //TopLeft Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos )); Point aNewPos( aCenterRect.Center() ); - ULONG nGrid = GetPredecessorGrid( aNewPos ); - ULONG nCount = aEntries.Count(); + sal_uIntPtr nGrid = GetPredecessorGrid( aNewPos ); + sal_uIntPtr nCount = aEntries.Count(); if( nGrid == ULONG_MAX ) return 0; if( nGrid >= nCount ) @@ -4339,26 +4339,26 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0 // todo: Liste von hinten aufrollen wenn nGrid > nCount/2 - for( ULONG nCur = 0; nCur < nGrid; nCur++ ) + for( sal_uIntPtr nCur = 0; nCur < nGrid; nCur++ ) pCur = pCur->pflink; return pCur; } -ULONG SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const +sal_uIntPtr SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const { Point aPos( rPos ); aPos.X() -= LROFFS_WINBORDER; aPos.Y() -= TBOFFS_WINBORDER; - USHORT nMaxCol = (USHORT)(aVirtOutputSize.Width() / nGridDX); + sal_uInt16 nMaxCol = (sal_uInt16)(aVirtOutputSize.Width() / nGridDX); if( nMaxCol ) nMaxCol--; - USHORT nGridX = (USHORT)(aPos.X() / nGridDX); + sal_uInt16 nGridX = (sal_uInt16)(aPos.X() / nGridDX); if( nGridX > nMaxCol ) nGridX = nMaxCol; - USHORT nGridY = (USHORT)(aPos.Y() / nGridDY); - USHORT nGridsX = (USHORT)(aOutputSize.Width() / nGridDX); - ULONG nGrid = (nGridY * nGridsX) + nGridX; + sal_uInt16 nGridY = (sal_uInt16)(aPos.Y() / nGridDY); + sal_uInt16 nGridsX = (sal_uInt16)(aOutputSize.Width() / nGridDX); + sal_uIntPtr nGrid = (nGridY * nGridsX) + nGridX; long nMiddle = (nGridX * nGridDX) + (nGridDX / 2); if( rPos.X() < nMiddle ) { @@ -4378,27 +4378,27 @@ void SvxIconChoiceCtrl_Impl::Flush() } } -BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) { if ( !(rHEvt.GetMode() & HELPMODE_QUICK ) ) - return FALSE; + return sal_False; Point aPos( pView->ScreenToOutputPixel(rHEvt.GetMousePosPixel() ) ); aPos -= pView->GetMapMode().GetOrigin(); - SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, TRUE ); + SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, sal_True ); if ( !pEntry ) - return FALSE; + return sal_False; String sQuickHelpText = pEntry->GetQuickHelpText(); - String aEntryText( pView->GetEntryText( pEntry, FALSE ) ); - Rectangle aTextRect( CalcTextRect( pEntry, 0, FALSE, &aEntryText ) ); + String aEntryText( pView->GetEntryText( pEntry, sal_False ) ); + Rectangle aTextRect( CalcTextRect( pEntry, 0, sal_False, &aEntryText ) ); if ( ( !aTextRect.IsInside( aPos ) || !aEntryText.Len() ) && !sQuickHelpText.Len() ) - return FALSE; + return sal_False; Rectangle aOptTextRect( aTextRect ); aOptTextRect.Bottom() = LONG_MAX; - USHORT nNewFlags = nCurTextDrawFlags; + sal_uInt16 nNewFlags = nCurTextDrawFlags; nNewFlags &= ~( TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS ); aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags ); if ( aOptTextRect != aTextRect || sQuickHelpText.Len() > 0 ) @@ -4419,7 +4419,7 @@ BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) Help::ShowQuickHelp( (Window*)pView, aOptTextRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER ); } - return TRUE; + return sal_True; } void SvxIconChoiceCtrl_Impl::ClearColumnList() @@ -4427,8 +4427,8 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList() if( !pColumns ) return; - const USHORT nCount = pColumns->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = pColumns->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlColumnInfo* pInfo = (SvxIconChoiceCtrlColumnInfo*) pColumns->GetObject( nCur ); @@ -4437,7 +4437,7 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList() DELETEZ(pColumns); } -void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo) +void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo) { if( !pColumns ) pColumns = new SvPtrarr; @@ -4467,22 +4467,22 @@ void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlCo Arrange( IsAutoArrange() ); } -const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( USHORT nIndex ) const +const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const { if( !pColumns || nIndex >= pColumns->Count() ) return 0; return (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nIndex ); } -const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT nSubItem, +const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const { rLeft = 0; if( !pColumns ) return 0; - const USHORT nCount = pColumns->Count(); + const sal_uInt16 nCount = pColumns->Count(); const SvxIconChoiceCtrlColumnInfo* pCol = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { pCol = (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nCur ); if( !pCol || pCol->GetSubItem() == nSubItem ) @@ -4493,7 +4493,7 @@ const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT } void SvxIconChoiceCtrl_Impl::DrawHighlightFrame( - OutputDevice* pOut, const Rectangle& rBmpRect, BOOL bHide ) + OutputDevice* pOut, const Rectangle& rBmpRect, sal_Bool bHide ) { Rectangle aBmpRect( rBmpRect ); long nBorder = 2; @@ -4509,7 +4509,7 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame( else { DecorationView aDecoView( pOut ); - USHORT nDecoFlags; + sal_uInt16 nDecoFlags; if ( bHighlightFramePressed ) nDecoFlags = FRAME_HIGHLIGHT_TESTBACKGROUND | FRAME_HIGHLIGHT_IN; else @@ -4519,20 +4519,20 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame( } void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry, - BOOL bKeepHighlightFlags ) + sal_Bool bKeepHighlightFlags ) { if( pEntry == pCurHighlightFrame ) return; if( !bKeepHighlightFlags ) - bHighlightFramePressed = FALSE; + bHighlightFramePressed = sal_False; HideEntryHighlightFrame(); pCurHighlightFrame = pEntry; if( pEntry ) { Rectangle aBmpRect( CalcFocusRect(pEntry) ); - DrawHighlightFrame( pView, aBmpRect, FALSE ); + DrawHighlightFrame( pView, aBmpRect, sal_False ); } } @@ -4544,7 +4544,7 @@ void SvxIconChoiceCtrl_Impl::HideEntryHighlightFrame() SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; pCurHighlightFrame = 0; Rectangle aBmpRect( CalcFocusRect(pEntry) ); - DrawHighlightFrame( pView, aBmpRect, TRUE ); + DrawHighlightFrame( pView, aBmpRect, sal_True ); } void SvxIconChoiceCtrl_Impl::CallSelectHandler( SvxIconChoiceCtrlEntry* ) @@ -4585,7 +4585,7 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const SvxIconChoiceCtrlEntry* pEntry = GetCurEntry(); if( !pEntry || !pEntry->IsSelected() ) { - ULONG nNext; + sal_uIntPtr nNext; pEntry = GetFirstSelectedEntry( nNext ); } if( pEntry ) @@ -4597,14 +4597,14 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const return aResult; } -void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWallpaper ) +void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, sal_Bool bDoNotUpdateWallpaper ) { MapMode aMapMode( pView->GetMapMode() ); aMapMode.SetOrigin( rPos ); pView->SetMapMode( aMapMode ); if( !bDoNotUpdateWallpaper ) { - BOOL bScrollable = pView->GetBackground().IsScrollable(); + sal_Bool bScrollable = pView->GetBackground().IsScrollable(); if( pView->HasBackground() && !bScrollable ) { Rectangle aRect( GetOutputRect()); @@ -4615,8 +4615,8 @@ void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWall } } -ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBars, - BOOL bSmartScrBar ) const +sal_uIntPtr SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, sal_Bool bCheckScrBars, + sal_Bool bSmartScrBar ) const { Size aSize( rSize ); if( bCheckScrBars && aHorSBar.IsVisible() ) @@ -4634,19 +4634,19 @@ ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBar if( aSize.Height() < 0 ) aSize.Height() = 0; - return IcnGridMap_Impl::GetGridCount( aSize, (USHORT)nGridDX, (USHORT)nGridDY ); + return IcnGridMap_Impl::GetGridCount( aSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY ); } -BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) +sal_Bool SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) { StopEditTimer(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; DBG_ASSERT( rKEvt.GetKeyCode().IsMod2(), "*SvxIconChoiceCtrl_Impl::HandleShortCutKey(): no <ALT> pressed!?" ); sal_Unicode cChar = rKEvt.GetCharCode(); - ULONG nPos = (ULONG)-1; + sal_uIntPtr nPos = (sal_uIntPtr)-1; if( cChar && IsMnemonicChar( cChar, nPos ) ) { @@ -4655,7 +4655,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) SvxIconChoiceCtrlEntry* pOldCursor = pCursor; if( pNewCursor != pOldCursor ) { - SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE ); + SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False ); if( pNewCursor != NULL ) { @@ -4665,7 +4665,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) pCurHighlightFrame = NULL; } } - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -4673,7 +4673,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt ) // ----------------------------------------------------------------------- -void SvxIconChoiceCtrl_Impl::CallEventListeners( ULONG nEvent, void* pData ) +void SvxIconChoiceCtrl_Impl::CallEventListeners( sal_uIntPtr nEvent, void* pData ) { pView->CallImplEventListeners( nEvent, pData ); } diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index 7cb92e8cef07..8b69940a428b 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -47,14 +47,14 @@ IcnCursor_Impl::~IcnCursor_Impl() delete[] pRows; } -USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue, +sal_uInt16 IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue, int bVertical ) { - USHORT nCount = (USHORT)pList->Count(); + sal_uInt16 nCount = (sal_uInt16)pList->Count(); if( !nCount ) return 0; - USHORT nCurPos = 0; + sal_uInt16 nCurPos = 0; long nPrevValue = LONG_MIN; while( nCount ) { @@ -66,7 +66,7 @@ USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue, else nCurValue = rRect.Left(); if( nValue >= nPrevValue && nValue <= nCurValue ) - return (USHORT)nCurPos; + return (sal_uInt16)nCurPos; nPrevValue = nCurValue; nCount--; nCurPos++; @@ -84,8 +84,8 @@ void IcnCursor_Impl::ImplCreate() pColumns = new SvPtrarr[ nCols ]; pRows = new SvPtrarr[ nRows ]; - ULONG nCount = pView->aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = pView->aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); // const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); @@ -99,10 +99,10 @@ void IcnCursor_Impl::ImplCreate() if( nX >= nCols ) nX = sal::static_int_cast< short >(nCols - 1); - USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE ); + sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True ); pColumns[ nX ].Insert( pEntry, nIns ); - nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE ); + nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False ); pRows[ nY ].Insert( pEntry, nIns ); pEntry->nX = nX; @@ -127,12 +127,12 @@ void IcnCursor_Impl::Clear() } } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, - USHORT, BOOL bDown, BOOL bSimple ) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom, + sal_uInt16, sal_Bool bDown, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchCol: No reference entry"); SvPtrarr* pList = &(pColumns[ nCol ]); - const USHORT nCount = pList->Count(); + const sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -140,7 +140,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List"); if( bDown ) { @@ -173,18 +173,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT if( nTop > nBottom ) { - USHORT nTemp = nTop; + sal_uInt16 nTemp = nTop; nTop = nBottom; nBottom = nTemp; } long nMinDistance = LONG_MAX; SvxIconChoiceCtrlEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { - USHORT nY = pEntry->nY; + sal_uInt16 nY = pEntry->nY; if( nY >= nTop && nY <= nBottom ) { const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); @@ -202,12 +202,12 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT return pResult; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, - USHORT, BOOL bRight, BOOL bSimple ) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight, + sal_uInt16, sal_Bool bRight, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchRow: No reference entry"); SvPtrarr* pList = &(pRows[ nRow ]); - const USHORT nCount = pList->Count(); + const sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -215,7 +215,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List"); if( bRight ) { @@ -248,18 +248,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR } if( nRight < nLeft ) { - USHORT nTemp = nRight; + sal_uInt16 nTemp = nRight; nRight = nLeft; nLeft = nTemp; } long nMinDistance = LONG_MAX; SvxIconChoiceCtrlEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { - USHORT nX = pEntry->nX; + sal_uInt16 nX = pEntry->nX; if( nX >= nLeft && nX <= nRight ) { const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); @@ -281,7 +281,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR /* Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw. - linksstehenden. Suchverfahren am Beispiel bRight = TRUE: + linksstehenden. Suchverfahren am Beispiel bRight = sal_True: c b c @@ -296,21 +296,21 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR a,b,c : 2., 3., 4. Suchrechteck */ -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bRight ) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bRight ) { SvxIconChoiceCtrlEntry* pResult; pCurEntry = pCtrlEntry; Create(); - USHORT nY = pCtrlEntry->nY; - USHORT nX = pCtrlEntry->nX; + sal_uInt16 nY = pCtrlEntry->nY; + sal_uInt16 nX = pCtrlEntry->nX; DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column"); DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row"); // Nachbar auf gleicher Zeile ? if( bRight ) pResult = SearchRow( - nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE ); + nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True ); else - pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE ); + pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True ); if( pResult ) return pResult; @@ -328,11 +328,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt nLastCol = -1; // 0-1 } - USHORT nRowMin = nY; - USHORT nRowMax = nY; + sal_uInt16 nRowMin = nY; + sal_uInt16 nRowMax = nY; do { - SvxIconChoiceCtrlEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE); + SvxIconChoiceCtrlEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False); if( pEntry ) return pEntry; if( nRowMin ) @@ -344,7 +344,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt return 0; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown) { if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) ) { @@ -366,7 +366,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS nNewPos = 0; } if( nPos != nNewPos ) - return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (ULONG)nNewPos ); + return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (sal_uIntPtr)nNewPos ); return 0; } long nOpt = pView->GetEntryBoundRect( pStart ).Top(); @@ -404,11 +404,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS return 0; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bDown) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bDown) { if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) ) { - ULONG nPos = pView->GetEntryListPos( pCtrlEntry ); + sal_uIntPtr nPos = pView->GetEntryListPos( pCtrlEntry ); if( bDown && nPos < (pView->aEntries.Count() - 1) ) return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nPos + 1 ); else if( !bDown && nPos > 0 ) @@ -419,17 +419,17 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE SvxIconChoiceCtrlEntry* pResult; pCurEntry = pCtrlEntry; Create(); - USHORT nY = pCtrlEntry->nY; - USHORT nX = pCtrlEntry->nX; + sal_uInt16 nY = pCtrlEntry->nY; + sal_uInt16 nX = pCtrlEntry->nX; DBG_ASSERT(nY<nRows,"GoUpDown:Bad column"); DBG_ASSERT(nX<nCols,"GoUpDown:Bad row"); // Nachbar in gleicher Spalte ? if( bDown ) pResult = SearchCol( - nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE ); + nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True ); else - pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE ); + pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True ); if( pResult ) return pResult; @@ -447,11 +447,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE nLastRow = -1; // 0-1 } - USHORT nColMin = nX; - USHORT nColMax = nX; + sal_uInt16 nColMin = nX; + sal_uInt16 nColMax = nX; do { - SvxIconChoiceCtrlEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE); + SvxIconChoiceCtrlEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False); if( pEntry ) return pEntry; if( nColMin ) @@ -493,23 +493,23 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt { if( !pRefEntry ) { - USHORT nGridRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY); + sal_uInt16 nGridRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY); nGridRows++; // wg. Abrundung! if( !nGridRows ) return; - for( USHORT nCurList = 0; nCurList < nGridRows; nCurList++ ) + for( sal_uInt16 nCurList = 0; nCurList < nGridRows; nCurList++ ) { SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, nCurList ); } - const ULONG nCount = pView->aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + const sal_uIntPtr nCount = pView->aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); - USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE); + sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False); ((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns ); } } @@ -522,8 +522,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY ); SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, 0 ); - ULONG nCount = pView->aEntries.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = pView->aEntries.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); Rectangle rRect( pView->CalcBmpRect(pEntry) ); @@ -531,7 +531,7 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); if( nY == nRefRow ) { - USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE ); + sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False ); pRow->Insert( pEntry, nIns ); } } @@ -541,8 +541,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt //static void IcnCursor_Impl::DestroyGridAdjustData( SvPtrarr& rLists ) { - const USHORT nCount = rLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + const sal_uInt16 nCount = rLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ]; delete pArr; @@ -569,16 +569,16 @@ void IcnGridMap_Impl::Expand() Create_Impl(); else { - USHORT nNewGridRows = _nGridRows; - USHORT nNewGridCols = _nGridCols; + sal_uInt16 nNewGridRows = _nGridRows; + sal_uInt16 nNewGridCols = _nGridCols; if( _pView->nWinBits & WB_ALIGN_TOP ) nNewGridRows += 50; else nNewGridCols += 50; - BOOL* pNewGridMap = new BOOL[nNewGridRows*nNewGridCols]; - memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(BOOL) ); - memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(BOOL) ); + sal_Bool* pNewGridMap = new sal_Bool[nNewGridRows*nNewGridCols]; + memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(sal_Bool) ); + memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(sal_Bool) ); delete[] _pGridMap; _pGridMap = pNewGridMap; _nGridRows = nNewGridRows; @@ -597,15 +597,15 @@ void IcnGridMap_Impl::Create_Impl() else _nGridCols += 50; - _pGridMap = new BOOL[ _nGridRows * _nGridCols]; + _pGridMap = new sal_Bool[ _nGridRows * _nGridCols]; memset( (void*)_pGridMap, 0, _nGridRows * _nGridCols ); - const ULONG nCount = _pView->aEntries.Count(); - for( ULONG nCur=0; nCur < nCount; nCur++ ) + const sal_uIntPtr nCount = _pView->aEntries.Count(); + for( sal_uIntPtr nCur=0; nCur < nCount; nCur++ ) OccupyGrids( (SvxIconChoiceCtrlEntry*)_pView->aEntries.GetObject( nCur )); } -void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const +void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const { long nX, nY; if( _pView->nWinBits & WB_ALIGN_TOP ) @@ -643,11 +643,11 @@ void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const if( !nDY ) nDY++; - rDX = (USHORT)nDX; - rDY = (USHORT)nDY; + rDX = (sal_uInt16)nDX; + rDY = (sal_uInt16)nDY; } -GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY ) +GridId IcnGridMap_Impl::GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ) { Create(); if( _pView->nWinBits & WB_ALIGN_TOP ) @@ -656,7 +656,7 @@ GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY ) return nGridY + ( nGridX * _nGridRows ); } -GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped ) +GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, sal_Bool* pbClipped ) { Create(); @@ -666,28 +666,28 @@ GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped ) nY -= TBOFFS_WINBORDER; nX /= _pView->nGridDX; nY /= _pView->nGridDY; - BOOL bClipped = FALSE; + sal_Bool bClipped = sal_False; if( nX >= _nGridCols ) { nX = _nGridCols - 1; - bClipped = TRUE; + bClipped = sal_True; } if( nY >= _nGridRows ) { nY = _nGridRows - 1; - bClipped = TRUE; + bClipped = sal_True; } - GridId nId = GetGrid( (USHORT)nX, (USHORT)nY ); + GridId nId = GetGrid( (sal_uInt16)nX, (sal_uInt16)nY ); if( pbClipped ) *pbClipped = bClipped; - DBG_ASSERT(nId <(ULONG)(_nGridCols*_nGridRows),"GetGrid failed"); + DBG_ASSERT(nId <(sal_uIntPtr)(_nGridCols*_nGridRows),"GetGrid failed"); return nId; } Rectangle IcnGridMap_Impl::GetGridRect( GridId nId ) { Create(); - USHORT nGridX, nGridY; + sal_uInt16 nGridX, nGridY; GetGridCoord( nId, nGridX, nGridY ); const long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER; const long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER; @@ -697,28 +697,28 @@ Rectangle IcnGridMap_Impl::GetGridRect( GridId nId ) nTop + _pView->nGridDY ); } -GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound ) +GridId IcnGridMap_Impl::GetUnoccupiedGrid( sal_Bool bOccupyFound ) { Create(); - ULONG nStart = 0; - BOOL bExpanded = FALSE; + sal_uIntPtr nStart = 0; + sal_Bool bExpanded = sal_False; while( 1 ) { - const ULONG nCount = (USHORT)(_nGridCols * _nGridRows); - for( ULONG nCur = nStart; nCur < nCount; nCur++ ) + const sal_uIntPtr nCount = (sal_uInt16)(_nGridCols * _nGridRows); + for( sal_uIntPtr nCur = nStart; nCur < nCount; nCur++ ) { if( !_pGridMap[ nCur ] ) { if( bOccupyFound ) - _pGridMap[ nCur ] = TRUE; + _pGridMap[ nCur ] = sal_True; return (GridId)nCur; } } DBG_ASSERT(!bExpanded,"ExpandGrid failed"); if( bExpanded ) return 0; // prevent never ending loop - bExpanded = TRUE; + bExpanded = sal_True; Expand(); nStart = nCount; } @@ -729,7 +729,7 @@ GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound ) // Bounding-Rect, kann aber zu kleinen Ueberlappungen fuehren #define OCCUPY_CENTER -void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bOccupy ) +void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, sal_Bool bOccupy ) { if( !_pGridMap || !_pView->IsBoundingRectValid( pEntry->aRect )) return; @@ -741,7 +741,7 @@ void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bO } -void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed ) +void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, sal_Bool bUsed ) { if( !_pGridMap ) return; @@ -755,17 +755,17 @@ void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed ) else _aLastOccupiedGrid.SetEmpty(); - BOOL bTopLeftClipped, bBottomRightClipped; + sal_Bool bTopLeftClipped, bBottomRightClipped; GridId nIdTL = GetGrid( rRect.TopLeft(), &bTopLeftClipped ); GridId nIdBR = GetGrid( rRect.BottomRight(), &bBottomRightClipped ); if( bTopLeftClipped && bBottomRightClipped ) return; - USHORT nX1,nX2,nY1,nY2; + sal_uInt16 nX1,nX2,nY1,nY2; GetGridCoord( nIdTL, nX1, nY1 ); GetGridCoord( nIdBR, nX2, nY2 ); - USHORT nTemp; + sal_uInt16 nTemp; if( nX1 > nX2 ) { nTemp = nX1; @@ -794,20 +794,20 @@ void IcnGridMap_Impl::Clear() } } -ULONG IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, USHORT nDX, USHORT nDY) +sal_uIntPtr IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, sal_uInt16 nDY) { long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX; if( ndx < 0 ) ndx *= -1; long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY; if( ndy < 0 ) ndy *= -1; - return (ULONG)(ndx * ndy); + return (sal_uIntPtr)(ndx * ndy); } void IcnGridMap_Impl::OutputSizeChanged() { if( _pGridMap ) { - USHORT nCols, nRows; + sal_uInt16 nCols, nRows; GetMinMapSize( nCols, nRows ); if( _pView->nWinBits & WB_ALIGN_TOP ) { @@ -829,18 +829,18 @@ void IcnGridMap_Impl::OutputSizeChanged() // Independendly of the views alignment (TOP or LEFT) the gridmap // should contain the data in a continues region, to make it possible // to copy the whole block if the gridmap needs to be expanded. -void IcnGridMap_Impl::GetGridCoord( GridId nId, USHORT& rGridX, USHORT& rGridY ) +void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY ) { Create(); if( _pView->nWinBits & WB_ALIGN_TOP ) { - rGridX = (USHORT)(nId % _nGridCols); - rGridY = (USHORT)(nId / _nGridCols); + rGridX = (sal_uInt16)(nId % _nGridCols); + rGridY = (sal_uInt16)(nId / _nGridCols); } else { - rGridX = (USHORT)(nId / _nGridRows); - rGridY = (USHORT)(nId % _nGridRows); + rGridX = (sal_uInt16)(nId / _nGridRows); + rGridY = (sal_uInt16)(nId % _nGridRows); } } diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index dae3abbac966..5b542b75d0aa 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -44,7 +44,7 @@ using namespace ::com::sun::star::accessibility; | \*****************************************************************************/ -SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, USHORT _nFlags ) +SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 _nFlags ) { aText = rText; aImage = rImage; @@ -57,7 +57,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image pflink = 0; } -SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, const Image& rImageHC, USHORT _nFlags ) +SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, const Image& rImageHC, sal_uInt16 _nFlags ) { aText = rText; aImage = rImage; @@ -70,7 +70,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image pflink = 0; } -SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags ) +SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( sal_uInt16 _nFlags ) { pUserData = NULL; @@ -80,7 +80,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags ) pflink = 0; } -void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved ) +void SvxIconChoiceCtrlEntry::SetMoved( sal_Bool bMoved ) { if( bMoved ) nFlags |= ICNVIEW_FLAG_POS_MOVED; @@ -88,7 +88,7 @@ void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved ) nFlags &= ~ICNVIEW_FLAG_POS_MOVED; } -void SvxIconChoiceCtrlEntry::LockPos( BOOL bLock ) +void SvxIconChoiceCtrlEntry::LockPos( sal_Bool bLock ) { if( bLock ) nFlags |= ICNVIEW_FLAG_POS_LOCKED; @@ -133,7 +133,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle ) : _pCurKeyEvent ( NULL ), _pImp ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ), - _bAutoFontColor ( FALSE ) + _bAutoFontColor ( sal_False ) { SetLineColor(); @@ -148,7 +148,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, const ResId& rResId ) : _pCurKeyEvent ( NULL ), _pImp ( new SvxIconChoiceCtrl_Impl( this, WB_BORDER ) ), - _bAutoFontColor ( FALSE ) + _bAutoFontColor ( sal_False ) { SetLineColor(); @@ -163,14 +163,14 @@ SvtIconChoiceCtrl::~SvtIconChoiceCtrl() delete _pImp; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( ULONG nPos, const Point* pPos, USHORT nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( sal_uIntPtr nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( nFlags ); _pImp->InsertEntry( pEntry, nPos, pPos ); return pEntry; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, ULONG nPos, const Point* pPos, USHORT nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, sal_uIntPtr nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, nFlags); @@ -179,7 +179,7 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con return pEntry; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, const Image& rImageHC, ULONG nPos, const Point* pPos, USHORT nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, const Image& rImageHC, sal_uIntPtr nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, rImageHC, nFlags); @@ -188,37 +188,37 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con return pEntry; } -BOOL SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, BOOL ) +sal_Bool SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, sal_Bool ) { - return TRUE; + return sal_True; } -BOOL SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* ) +sal_Bool SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* ) { - return TRUE; + return sal_True; } void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, OutputDevice& rDev ) { rDev.DrawImage( rPos, GetSettings().GetStyleSettings().GetHighContrastMode() ? pEntry->GetImageHC() : pEntry->GetImage() ); } -String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, BOOL ) +String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, sal_Bool ) { return pEntry->GetText(); } -BOOL SvtIconChoiceCtrl::HasBackground() const +sal_Bool SvtIconChoiceCtrl::HasBackground() const { - return FALSE; + return sal_False; } -BOOL SvtIconChoiceCtrl::HasFont() const +sal_Bool SvtIconChoiceCtrl::HasFont() const { - return FALSE; + return sal_False; } -BOOL SvtIconChoiceCtrl::HasFontTextColor() const +sal_Bool SvtIconChoiceCtrl::HasFontTextColor() const { - return TRUE; + return sal_True; } -BOOL SvtIconChoiceCtrl::HasFontFillColor() const +sal_Bool SvtIconChoiceCtrl::HasFontFillColor() const { - return TRUE; + return sal_True; } void SvtIconChoiceCtrl::Paint( const Rectangle& rRect ) @@ -250,7 +250,7 @@ void SvtIconChoiceCtrl::ArrangeIcons() Size aFullSize; Rectangle aEntryRect; - for ( ULONG i = 0; i < GetEntryCount(); i++ ) + for ( sal_uIntPtr i = 0; i < GetEntryCount(); i++ ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i ); aEntryRect = _pImp->GetEntryBoundRect ( pEntry ); @@ -258,14 +258,14 @@ void SvtIconChoiceCtrl::ArrangeIcons() aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() ); } - _pImp->Arrange ( FALSE, aFullSize.getWidth() ); + _pImp->Arrange ( sal_False, aFullSize.getWidth() ); } else if ( GetStyle() & WB_ALIGN_LEFT ) { Size aFullSize; Rectangle aEntryRect; - for ( ULONG i = 0; i < GetEntryCount(); i++ ) + for ( sal_uIntPtr i = 0; i < GetEntryCount(); i++ ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i ); aEntryRect = _pImp->GetEntryBoundRect ( pEntry ); @@ -273,13 +273,13 @@ void SvtIconChoiceCtrl::ArrangeIcons() aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() ); } - _pImp->Arrange ( FALSE, 0, aFullSize.getHeight() ); + _pImp->Arrange ( sal_False, 0, aFullSize.getHeight() ); } else { _pImp->Arrange(); } - _pImp->Arrange( FALSE, 0, 1000 ); + _pImp->Arrange( sal_False, 0, 1000 ); } void SvtIconChoiceCtrl::Resize() { @@ -315,7 +315,7 @@ void SvtIconChoiceCtrl::GetFocus() { _pImp->GetFocus(); Control::GetFocus(); - ULONG nPos; + sal_uIntPtr nPos; SvxIconChoiceCtrlEntry* pSelectedEntry = GetSelectedEntry ( nPos ); if ( pSelectedEntry ) _pImp->CallEventListeners( VCLEVENT_LISTBOX_SELECT, pSelectedEntry ); @@ -327,7 +327,7 @@ void SvtIconChoiceCtrl::LoseFocus() Control::LoseFocus(); } -void SvtIconChoiceCtrl::SetUpdateMode( BOOL bUpdate ) +void SvtIconChoiceCtrl::SetUpdateMode( sal_Bool bUpdate ) { Control::SetUpdateMode( bUpdate ); _pImp->SetUpdateMode( bUpdate ); @@ -349,7 +349,7 @@ void SvtIconChoiceCtrl::SetPointFont( const Font& rFont ) _pImp->FontModified(); } } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, BOOL bHit ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, sal_Bool bHit ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); @@ -380,25 +380,25 @@ SvxIconChoiceCtrlTextMode SvtIconChoiceCtrl::GetEntryTextMode( const SvxIconChoi return _pImp->GetEntryTextModeSmart( pEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); return ((SvtIconChoiceCtrl*)this)->_pImp->GetNextEntry( aPos, pCurEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); return ((SvtIconChoiceCtrl*)this)->_pImp->GetPrevEntry( aPos, pCurEntry ); } -ULONG SvtIconChoiceCtrl::GetEntryCount() const +sal_uIntPtr SvtIconChoiceCtrl::GetEntryCount() const { return _pImp->GetEntryCount(); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( ULONG nPos ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uIntPtr nPos ) const { return _pImp->GetEntry( nPos ); } @@ -418,30 +418,30 @@ void SvtIconChoiceCtrl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) _pImp->RemoveEntry( pEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( ULONG& rPos ) const +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uIntPtr& rPos ) const { return _pImp->GetFirstSelectedEntry( rPos ); } void SvtIconChoiceCtrl::ClickIcon() { - ULONG nPos; + sal_uIntPtr nPos; GetSelectedEntry ( nPos ); _aClickIconHdl.Call( this ); } -BOOL SvtIconChoiceCtrl::IsEntryEditing() const +sal_Bool SvtIconChoiceCtrl::IsEntryEditing() const { return _pImp->IsEntryEditing(); } -BOOL SvtIconChoiceCtrl::SetChoiceWithCursor ( BOOL bDo ) +sal_Bool SvtIconChoiceCtrl::SetChoiceWithCursor ( sal_Bool bDo ) { return _pImp->SetChoiceWithCursor (bDo); } void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) { - BOOL bKeyUsed = DoKeyInput( rKEvt ); + sal_Bool bKeyUsed = DoKeyInput( rKEvt ); if ( !bKeyUsed ) { _pCurKeyEvent = (KeyEvent*)&rKEvt; @@ -449,17 +449,17 @@ void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) _pCurKeyEvent = NULL; } } -BOOL SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt ) +sal_Bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt ) { // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down if( IsEntryEditing() ) - return TRUE; + return sal_True; _pCurKeyEvent = (KeyEvent*)&rKEvt; - BOOL bHandled = _pImp->KeyInput( rKEvt ); + sal_Bool bHandled = _pImp->KeyInput( rKEvt ); _pCurKeyEvent = NULL; return bHandled; } -ULONG SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const +sal_uIntPtr SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const { return _pImp->GetEntryListPos( pEntry ); } @@ -564,7 +564,7 @@ void SvtIconChoiceCtrl::SetSelectionMode( SelectionMode eMode ) _pImp->SetSelectionMode( eMode ); } -BOOL SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r ) +sal_Bool SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r ) { return _pImp->HandleShortCutKey( r ); } @@ -618,7 +618,7 @@ void SvtIconChoiceCtrl::SetNoSelection() _pImp->SetNoSelection(); } -void SvtIconChoiceCtrl::CallImplEventListeners(ULONG nEvent, void* pData) +void SvtIconChoiceCtrl::CallImplEventListeners(sal_uIntPtr nEvent, void* pData) { CallEventListeners(nEvent, pData); } diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx index 20bcfe0fe33a..04d6cc44c78e 100644 --- a/svtools/source/contnr/svicnvw.cxx +++ b/svtools/source/contnr/svicnvw.cxx @@ -109,7 +109,7 @@ void SvIconView::DisconnectFromModel() SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos ) + SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uIntPtr nPos ) { SvLBoxEntry* pEntry = CreateEntry( rText, aCollapsedEntryBmp, aExpandedEntryBmp ); @@ -125,7 +125,7 @@ SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, const Image& rExpEntryBmp, const Image& rCollEntryBmp, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos) + SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uIntPtr nPos) { SvLBoxEntry* pEntry = CreateEntry( rText, rCollEntryBmp, rExpEntryBmp ); @@ -221,7 +221,7 @@ SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource ) } -USHORT SvIconView::IsA() +sal_uInt16 SvIconView::IsA() { return SV_LISTBOX_ID_ICONVIEW; } @@ -229,7 +229,7 @@ USHORT SvIconView::IsA() void SvIconView::RequestingChilds( SvLBoxEntry* pParent ) { if ( !pParent->HasChilds() ) - InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND ); + InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND ); } void __EXPORT SvIconView::Paint( const Rectangle& rRect ) @@ -259,7 +259,7 @@ void __EXPORT SvIconView::KeyInput( const KeyEvent& rKEvt ) return; nImpFlags |= SVLBOX_IS_TRAVELSELECT; - BOOL bKeyUsed = pImp->KeyInput( rKEvt ); + sal_Bool bKeyUsed = pImp->KeyInput( rKEvt ); if ( !bKeyUsed ) SvLBox::KeyInput( rKEvt ); nImpFlags &= ~SVLBOX_IS_TRAVELSELECT; @@ -283,7 +283,7 @@ void __EXPORT SvIconView::LoseFocus() SvLBox::LoseFocus(); } -void SvIconView::SetUpdateMode( BOOL bUpdate ) +void SvIconView::SetUpdateMode( sal_Bool bUpdate ) { Control::SetUpdateMode( bUpdate ); if ( bUpdate ) @@ -322,7 +322,7 @@ void __EXPORT SvIconView::ModelHasInsertedTree( SvListEntry* pEntry ) } void __EXPORT SvIconView::ModelIsMoving(SvListEntry* pSource, - SvListEntry* /* pTargetParent */ , ULONG /* nChildPos */ ) + SvListEntry* /* pTargetParent */ , sal_uIntPtr /* nChildPos */ ) { pImp->MovingEntry( (SvLBoxEntry*)pSource ); } @@ -351,7 +351,7 @@ void __EXPORT SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) pImp->ModelHasEntryInvalidated( pEntry ); } -void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ) +void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow ) { pImp->ShowTargetEmphasis( pEntry, bShow ); } @@ -363,10 +363,10 @@ Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos) { - pImp->SetEntryPosition( pEntry, rPos, FALSE, TRUE ); + pImp->SetEntryPosition( pEntry, rPos, sal_False, sal_True ); } -void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustAtGrid ) +void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, sal_Bool bAdjustAtGrid ) { pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid ); } @@ -374,7 +374,7 @@ void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL void SvIconView::SetFont( const Font& rFont ) { Font aTempFont( rFont ); - aTempFont.SetTransparent( TRUE ); + aTempFont.SetTransparent( sal_True ); SvLBox::SetFont( aTempFont ); RecalcViewData(); pImp->ChangedFont(); @@ -390,7 +390,7 @@ SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos ) return pImp->GetDropTarget( rPos ); } -SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, BOOL ) const +SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); @@ -442,10 +442,10 @@ void SvIconView::SetSelectionMode( SelectionMode eSelectMode ) pImp->SetSelectionMode( eSelectMode ); } -BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect ) +sal_Bool SvIconView::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) { EndEditing(); - BOOL bRetVal = SvListView::Select( pEntry, bSelect ); + sal_Bool bRetVal = SvListView::Select( pEntry, bSelect ); if( bRetVal ) { pImp->EntrySelected( pEntry, bSelect ); @@ -455,7 +455,7 @@ BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect ) return bRetVal; } -void SvIconView::SelectAll( BOOL bSelect, BOOL ) +void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool ) { SvLBoxEntry* pEntry = pImp->GetCurParent(); pEntry = FirstChild( pEntry ); @@ -479,7 +479,7 @@ SvLBoxEntry* SvIconView::GetCurEntry() const void SvIconView::Arrange() { #ifdef DBG_UTIL - USHORT n=1; + sal_uInt16 n=1; if( n == 1 && n-1 == 0 ) { pImp->Arrange(); @@ -499,20 +499,20 @@ void SvIconView::SetSpaceBetweenEntries( long nX, long nY ) pImp->SetSpaceBetweenEntries( nX, nY ); } -BOOL SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +sal_Bool SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uIntPtr& rNewChildPos ) { return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos); } -BOOL SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +sal_Bool SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uIntPtr& rNewChildPos ) { return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos); } -void SvIconView::EnableInplaceEditing( BOOL bEnable ) +void SvIconView::EnableInplaceEditing( sal_Bool bEnable ) { SvLBox::EnableInplaceEditing( bEnable ); } @@ -525,7 +525,7 @@ void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem, Selection aSel( SELECTION_MIN, SELECTION_MAX ); if ( EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); EditItemText( pEntry, (SvLBoxString*)pItem, aSel ); } } @@ -538,7 +538,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?"); pCurEdEntry = pEntry; pCurEdItem = pItem; - Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,TRUE )); + Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,sal_True )); aRect.Bottom() += 4; pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen! @@ -568,7 +568,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, #endif #endif // OS2 - EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, TRUE ); + EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, sal_True ); } void SvIconView::EditEntry( SvLBoxEntry* pEntry ) @@ -583,7 +583,7 @@ void SvIconView::EditEntry( SvLBoxEntry* pEntry ) Selection aSel( SELECTION_MIN, SELECTION_MAX ); if( EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); EditItemText( pEntry, pItem, aSel ); } } @@ -603,14 +603,14 @@ void SvIconView::EditedText( const XubString& rStr ) } -BOOL SvIconView::EditingEntry( SvLBoxEntry*, Selection& ) +sal_Bool SvIconView::EditingEntry( SvLBoxEntry*, Selection& ) { - return TRUE; + return sal_True; } -BOOL SvIconView::EditedEntry( SvLBoxEntry*, const XubString& ) +sal_Bool SvIconView::EditedEntry( SvLBoxEntry*, const XubString& ) { - return TRUE; + return sal_True; } @@ -663,9 +663,9 @@ Region SvIconView::GetDragRegion() const return aRegion; } -ULONG SvIconView::GetSelectionCount() const +sal_uIntPtr SvIconView::GetSelectionCount() const { - return (ULONG)(pImp->GetSelectionCount()); + return (sal_uIntPtr)(pImp->GetSelectionCount()); } void SvIconView::SetGrid( long nDX, long nDY ) @@ -673,18 +673,18 @@ void SvIconView::SetGrid( long nDX, long nDY ) pImp->SetGrid( nDX, nDY ); } -void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvIconView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uIntPtr nPos ) { SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos ); switch( nActionId ) { case LISTACTION_RESORTING: - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); break; case LISTACTION_RESORTED: - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); Arrange(); break; @@ -696,9 +696,9 @@ void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, } -void SvIconView::Scroll( long nDeltaX, long nDeltaY, USHORT ) +void SvIconView::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 ) { - pImp->Scroll( nDeltaX, nDeltaY, FALSE ); + pImp->Scroll( nDeltaX, nDeltaY, sal_False ); } void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt ) @@ -709,7 +709,7 @@ void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt ) void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos ) { pImp->SttDrag( rPos ); - SvLBoxEntry* pEntry = GetEntry( rPos, TRUE ); + SvLBoxEntry* pEntry = GetEntry( rPos, sal_True ); pImp->mpViewData = pEntry; SvLBox::StartDrag( nAction, rPos ); } @@ -755,14 +755,14 @@ void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ) pImp->HideShowDDIcon( pRefEntry, rPos ); } -void SvIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, +void SvIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pRects, short nOffs ) { pImp->SelectRect( rRect, bAdd, pRects, nOffs ); } void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY, - BOOL b, USHORT nBorderWidth ) + sal_Bool b, sal_uInt16 nBorderWidth ) { pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth ); } @@ -786,7 +786,7 @@ void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry ) pImp->AdjustAtGrid( pEntry ); } -void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock ) +void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock ) { SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry ); if( bLock ) @@ -795,7 +795,7 @@ void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock ) pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED ); } -BOOL SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const +sal_Bool SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const { const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry ); return pViewData->IsEntryPosLocked(); @@ -811,14 +811,14 @@ SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const return pImp->GetTextMode( pEntry ); } -SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const +SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry ); } -SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const +SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const { Point aPos( rPixPos ); aPos -= GetMapMode().GetOrigin(); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 7111a29a6a8a..e7e4010852dd 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -82,7 +82,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pView = pLBView; pTree = pLBTree; aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet ); - aSelEng.ExpandSelectionOnMouseMove( FALSE ); + aSelEng.ExpandSelectionOnMouseMove( sal_False ); SetWindowBits( nWinStyle ); SetSelectionMode( SINGLE_SELECTION ); SetDragDropMode( 0 ); @@ -108,7 +108,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n nYoffsNodeBmp = 0; nNodeBmpWidth = 0; - bAsyncBeginDrag = FALSE; + bAsyncBeginDrag = sal_False; aAsyncBeginDragTimer.SetTimeout( 0 ); aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl)); // Button-Animation in Listbox @@ -126,11 +126,11 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pMostRightEntry = 0; nCurUserEvent = 0xffffffff; - bUpdateMode = TRUE; - bInVScrollHdl = FALSE; + bUpdateMode = sal_True; + bInVScrollHdl = sal_False; nFlags |= F_FILLING; - bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = FALSE; + bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = sal_False; } SvImpLBox::~SvImpLBox() @@ -174,7 +174,7 @@ short SvImpLBox::UpdateContextBmpWidthVector( SvLBoxEntry* pEntry, short nWidth { DBG_ASSERT( pView->pModel, "View and Model aren't valid!" ); - USHORT nDepth = pView->pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry ); // initialize vector if necessary std::vector< short >::size_type nSize = aContextBmpWidthVector.size(); while ( nDepth > nSize ) @@ -222,7 +222,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvLBoxEntry* pEntry ) void SvImpLBox::UpdateContextBmpWidthMax( SvLBoxEntry* pEntry ) { - USHORT nDepth = pView->pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry ); if( aContextBmpWidthVector.size() < 1 ) return; short nWidth = aContextBmpWidthVector[ nDepth ]; @@ -257,7 +257,7 @@ void SvImpLBox::SetWindowBits( WinBits nWinStyle ) { nWinBits = nWinStyle; if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION) - aSelEng.AddAlways( TRUE ); + aSelEng.AddAlways( sal_True ); } void SvImpLBox::SetExtendedWindowBits( ExtendedWinBits _nBits ) @@ -344,11 +344,11 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) nFlags &= (~F_FILLING); - bInVScrollHdl = TRUE; + bInVScrollHdl = sal_True; if( pView->IsEditingActive() ) { - pView->EndEditing( TRUE ); // Cancel + pView->EndEditing( sal_True ); // Cancel pView->Update(); } BeginScroll(); @@ -358,7 +358,7 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) if( nDelta == 1 ) CursorDown(); else - PageDown( (USHORT) nDelta ); + PageDown( (sal_uInt16) nDelta ); } else { @@ -366,9 +366,9 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar ) if( nDelta == 1 ) CursorUp(); else - PageUp( (USHORT) nDelta ); + PageUp( (sal_uInt16) nDelta ); } - bInVScrollHdl = FALSE; + bInVScrollHdl = sal_False; return 0; } @@ -380,13 +380,13 @@ void SvImpLBox::CursorDown() { nFlags &= (~F_FILLING); pView->NotifyScrolling( -1 ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Update(); pStartEntry = pNextFirstToDraw; Rectangle aArea( GetVisibleArea() ); pView->Scroll( 0, -(pView->GetEntryHeight()), aArea, SCROLL_NOCHILDREN ); pView->Update(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->NotifyScrolled(); } } @@ -399,31 +399,31 @@ void SvImpLBox::CursorUp() nFlags &= (~F_FILLING); long nEntryHeight = pView->GetEntryHeight(); pView->NotifyScrolling( 1 ); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Update(); pStartEntry = pPrevFirstToDraw; Rectangle aArea( GetVisibleArea() ); aArea.Bottom() -= nEntryHeight; pView->Scroll( 0, nEntryHeight, aArea, SCROLL_NOCHILDREN ); pView->Update(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->NotifyScrolled(); } } -void SvImpLBox::PageDown( USHORT nDelta ) +void SvImpLBox::PageDown( sal_uInt16 nDelta ) { - USHORT nRealDelta = nDelta; + sal_uInt16 nRealDelta = nDelta; if( !nDelta ) return; SvLBoxEntry* pNext; pNext = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nRealDelta )); - if( (ULONG)pNext == (ULONG)pStartEntry ) + if( (sal_uIntPtr)pNext == (sal_uIntPtr)pStartEntry ) return; - ShowCursor( FALSE ); + ShowCursor( sal_False ); nFlags &= (~F_FILLING); pView->Update(); @@ -447,21 +447,21 @@ void SvImpLBox::PageDown( USHORT nDelta ) pView->NotifyScrolled(); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } -void SvImpLBox::PageUp( USHORT nDelta ) +void SvImpLBox::PageUp( sal_uInt16 nDelta ) { - USHORT nRealDelta = nDelta; + sal_uInt16 nRealDelta = nDelta; if( !nDelta ) return; SvLBoxEntry* pPrev = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry, nRealDelta )); - if( (ULONG)pPrev == (ULONG)pStartEntry ) + if( (sal_uIntPtr)pPrev == (sal_uIntPtr)pStartEntry ) return; nFlags &= (~F_FILLING); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->Update(); pStartEntry = pPrev; @@ -481,10 +481,10 @@ void SvImpLBox::PageUp( USHORT nDelta ) pView->NotifyScrolled(); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } -void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll ) +void SvImpLBox::KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll ) { if( !aVerSBar.IsVisible() ) return; @@ -518,7 +518,7 @@ void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll ) } -void SvImpLBox::KeyDown( BOOL bPageDown, BOOL bNotifyScroll ) +void SvImpLBox::KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll ) { if( !aVerSBar.IsVisible() ) return; @@ -593,15 +593,15 @@ void SvImpLBox::InvalidateEntry( SvLBoxEntry* pEntry ) } if( !(nFlags & F_IN_PAINT )) { - BOOL bHasFocusRect = FALSE; + sal_Bool bHasFocusRect = sal_False; if( pEntry==pCursor && pView->HasFocus() ) { - bHasFocusRect = TRUE; - ShowCursor( FALSE ); + bHasFocusRect = sal_True; + ShowCursor( sal_False ); } InvalidateEntry( GetEntryLine( pEntry ) ); if( bHasFocusRect ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -626,7 +626,7 @@ void SvImpLBox::RecalcFocusRect() // Setzt Cursor. Passt bei SingleSelection die Selektion an // -void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) +void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) { SvViewDataEntry* pViewDataNewCur = 0; if( pEntry ) @@ -649,18 +649,18 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) SvLBoxEntry* pOldCursor = pCursor; if( pCursor && pEntry != pCursor ) { - pView->SetEntryFocus( pCursor, FALSE ); + pView->SetEntryFocus( pCursor, sal_False ); if( bSimpleTravel ) - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); pView->HideFocus(); } pCursor = pEntry; if( pCursor ) { - pViewDataNewCur->SetFocus( TRUE ); + pViewDataNewCur->SetFocus( sal_True ); if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode()) { - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } // Mehrfachselektion: Im Cursor-Move selektieren, wenn // nicht im Add-Mode (Ctrl-F8) @@ -669,11 +669,11 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) !(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() && !bForceNoSelect ) { - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } else { - ShowCursor( TRUE ); + ShowCursor( sal_True ); } if( pAnchor ) @@ -685,7 +685,7 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) nFlags &= (~F_DESEL_ALL); } -void SvImpLBox::ShowCursor( BOOL bShow ) +void SvImpLBox::ShowCursor( sal_Bool bShow ) { if( !bShow || !pCursor || !pView->HasFocus() ) { @@ -710,8 +710,8 @@ void SvImpLBox::ShowCursor( BOOL bShow ) -void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView, - BOOL bUpdateVerScrollBar ) +void SvImpLBox::UpdateAll( sal_Bool bInvalidateCompleteView, + sal_Bool bUpdateVerScrollBar ) { if( bUpdateVerScrollBar ) FindMostRight(0); @@ -720,8 +720,8 @@ void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView, FillView(); ShowVerSBar(); if( bSimpleTravel && pCursor && pView->HasFocus() ) - pView->Select( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->Select( pCursor, sal_True ); + ShowCursor( sal_True ); if( bInvalidateCompleteView ) pView->Invalidate(); else @@ -735,7 +735,7 @@ IMPL_LINK_INLINE_START( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar ) { if( pView->IsEditingActive() ) { - pView->EndEditing( TRUE ); // Cancel + pView->EndEditing( sal_True ); // Cancel pView->Update(); } pView->nFocusWidth = -1; @@ -752,7 +752,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) BeginScroll(); nFlags &= (~F_FILLING); pView->NotifyScrolling( 0 ); // 0 == horizontales Scrolling - ShowCursor( FALSE ); + ShowCursor( sal_False ); // neuen Origin berechnen long nPos = aHorSBar.GetThumbPos(); @@ -770,7 +770,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) else pView->Invalidate(); RecalcFocusRect(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->NotifyScrolled(); } @@ -789,8 +789,8 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const if( pView->GetEntryCount() == 0 || !pStartEntry || !pView->GetEntryHeight()) return 0; - USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() ); - USHORT nTemp = nClickedEntry; + sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() ); + sal_uInt16 nTemp = nClickedEntry; SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp )); return pEntry; } @@ -799,13 +799,13 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const // prueft, ob der Eintrag "richtig" getroffen wurde // (Focusrect+ ContextBitmap bei TreeListBox) // -BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine) +sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine) { - BOOL bRet; + sal_Bool bRet; // bei "besonderen" Entries (mit CheckButtons usw.) sind wir // nicht so pingelig if( pEntry->ItemCount() >= 3 ) - return TRUE; + return sal_True; Rectangle aRect( pView->GetFocusRect( pEntry, nLine )); aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X(); @@ -818,9 +818,9 @@ BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long n Point aPos( rPosPixel ); aPos -= pView->GetMapMode().GetOrigin(); if( aRect.IsInside( aPos ) ) - bRet = TRUE; + bRet = sal_True; else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -833,8 +833,8 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const || !pView->GetEntryHeight()) return 0; - USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() ); - USHORT nTemp = nClickedEntry; + sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() ); + sal_uInt16 nTemp = nClickedEntry; SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp )); if( nTemp != nClickedEntry ) pEntry = 0; @@ -842,7 +842,7 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const } -SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll) +SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,sal_Bool bNotifyScroll) { if( !pCursor ) return 0; @@ -857,19 +857,19 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll) pEntry = (SvLBoxEntry*)(pView->NextVisible( pCursor )); if( pEntry && pEntry != pCursor ) - pView->SetEntryFocus( pCursor, FALSE ); + pView->SetEntryFocus( pCursor, sal_False ); if( nY < 0 ) - KeyUp( FALSE, bNotifyScroll ); + KeyUp( sal_False, bNotifyScroll ); else - KeyDown( FALSE, bNotifyScroll ); + KeyDown( sal_False, bNotifyScroll ); } else { pEntry = GetClickedEntry( rPoint ); if( !pEntry ) { - USHORT nSteps = 0xFFFF; + sal_uInt16 nSteps = 0xFFFF; // LastVisible ist noch nicht implementiert! pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nSteps )); } @@ -878,7 +878,7 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll) if( pEntry != pCursor && aSelEng.GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); } } return pEntry; @@ -906,11 +906,11 @@ void SvImpLBox::Paint( const Rectangle& rRect ) SvLBoxEntry* pFirst = pView->First(); if( pFirst != pStartEntry ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); pStartEntry = pView->First(); aVerSBar.SetThumbPos( 0 ); StopUserEvent(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)1); return; } @@ -922,8 +922,8 @@ void SvImpLBox::Paint( const Rectangle& rRect ) } #ifdef XX_OV - ULONG nXAbsPos = (USHORT)pTree->GetAbsPos( pStartEntry ); - ULONG nXVisPos = pView->GetVisiblePos( pStartEntry ); + sal_uIntPtr nXAbsPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry ); + sal_uIntPtr nXVisPos = pView->GetVisiblePos( pStartEntry ); SvLBoxString* pXStr = (SvLBoxString*)pStartEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING); #endif @@ -936,8 +936,8 @@ void SvImpLBox::Paint( const Rectangle& rRect ) long nEntryHeight = pView->GetEntryHeight(); // Bereich der zu zeichnenden Entries berechnen - USHORT nStartLine = (USHORT)( rRect.Top() / nEntryHeight ); - USHORT nCount = (USHORT)( nRectHeight / nEntryHeight ); + sal_uInt16 nStartLine = (sal_uInt16)( rRect.Top() / nEntryHeight ); + sal_uInt16 nCount = (sal_uInt16)( nRectHeight / nEntryHeight ); nCount += 2; // keine Zeile vergessen long nY = nStartLine * nEntryHeight; @@ -957,10 +957,10 @@ void SvImpLBox::Paint( const Rectangle& rRect ) pView->SetClipRegion( aClipRegion ); - for( USHORT n=0; n< nCount && pEntry; n++ ) + for( sal_uInt16 n=0; n< nCount && pEntry; n++ ) { /*long nMaxRight=*/ - pView->PaintEntry1( pEntry, nY, 0xffff, TRUE ); + pView->PaintEntry1( pEntry, nY, 0xffff, sal_True ); nY += nEntryHeight; pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } @@ -968,7 +968,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) if ( !pCursor && ( ( nExtendedWinBits & EWB_NO_AUTO_CURENTRY ) == 0 ) ) { // do not select if multiselection or explicit set - BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) + sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION ); SetCursor( pStartEntry, bNotSelect ); } @@ -984,12 +984,12 @@ void SvImpLBox::Paint( const Rectangle& rRect ) nFlags &= (~F_IN_PAINT); } -void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) +void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) { if( !pEntry ) return; - BOOL bInView = IsEntryInView( pEntry ); + sal_Bool bInView = IsEntryInView( pEntry ); if( bInView && (!bMoveToTop || pStartEntry == pEntry) ) return; // ist schon sichtbar @@ -1006,7 +1006,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) if( !pView->IsExpanded( pParent ) ) { #ifdef DBG_UTIL - BOOL bRet = + sal_Bool bRet = #endif pView->Expand( pParent ); DBG_ASSERT(bRet,"Not expanded!"); @@ -1020,10 +1020,10 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) } pStartEntry = pEntry; - ShowCursor( FALSE ); + ShowCursor( sal_False ); FillView(); aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); pView->Invalidate(); } @@ -1039,21 +1039,21 @@ void SvImpLBox::RepaintSelectionItems() if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID ) SetNodeBmpTabDistance(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); long nEntryHeight = pView->GetEntryHeight(); - ULONG nCount = nVisibleCount; + sal_uIntPtr nCount = nVisibleCount; long nY = 0; SvLBoxEntry* pEntry = pStartEntry; - for( ULONG n=0; n< nCount && pEntry; n++ ) + for( sal_uIntPtr n=0; n< nCount && pEntry; n++ ) { pView->PaintEntry1( pEntry, nY, 0xffff ); //wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); nY += nEntryHeight; pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } @@ -1089,7 +1089,7 @@ void SvImpLBox::DrawNet() SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab(); while( pTree->GetDepth( pEntry ) > 0 ) pEntry = pView->GetParent( pEntry ); - USHORT nOffs = (USHORT)(pView->GetVisiblePos( pStartEntry ) - + sal_uInt16 nOffs = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ) - pView->GetVisiblePos( pEntry )); long nY = 0; nY -= ( nOffs * nEntryHeight ); @@ -1104,12 +1104,12 @@ void SvImpLBox::DrawNet() aCol = rStyleSettings.GetShadowColor(); pView->SetLineColor( aCol ); Point aPos1, aPos2; - USHORT nDistance; - ULONG nMax = nVisibleCount + nOffs + 1; + sal_uInt16 nDistance; + sal_uIntPtr nMax = nVisibleCount + nOffs + 1; const Image& rExpandedNodeBitmap = GetExpandedNodeBmp(); - for( ULONG n=0; n< nMax && pEntry; n++ ) + for( sal_uIntPtr n=0; n< nMax && pEntry; n++ ) { if( pView->IsExpanded(pEntry) ) { @@ -1125,7 +1125,7 @@ void SvImpLBox::DrawNet() pChild = pView->FirstChild( pEntry ); DBG_ASSERT(pChild,"Child?"); pChild = pTree->LastSibling( pChild ); - nDistance = (USHORT)(pView->GetVisiblePos(pChild) - + nDistance = (sal_uInt16)(pView->GetVisiblePos(pChild) - pView->GetVisiblePos(pEntry)); aPos2 = aPos1; aPos2.Y() += nDistance * nEntryHeight; @@ -1180,7 +1180,7 @@ static long GetOptSize( TabBar* pTabBar ) return pTabBar->CalcWindowSizePixel().Width(); } -void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask ) +void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask ) { long nOverlap = 0; @@ -1238,18 +1238,18 @@ void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask ) } // nResult: Bit0 == VerSBar Bit1 == HorSBar -USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) +sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) { long nEntryHeight = pView->GetEntryHeight(); if( !nEntryHeight ) return 0; - USHORT nResult = 0; + sal_uInt16 nResult = 0; Size aOSize( pView->Control::GetOutputSizePixel() ); - BOOL bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; - BOOL bHorBar = FALSE; + sal_Bool bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; + sal_Bool bHorBar = sal_False; long nMaxRight = aOSize.Width(); //GetOutputSize().Width(); Point aOrigin( pView->GetMapMode().GetOrigin() ); aOrigin.X() *= -1; @@ -1258,10 +1258,10 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) if( pTabBar || ( (pView->nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) )) - bHorBar = TRUE; + bHorBar = sal_True; // Anzahl aller nicht eingeklappten Eintraege - ULONG nTotalCount = pView->GetVisibleCount(); + sal_uIntPtr nTotalCount = pView->GetVisibleCount(); // Anzahl in der View sichtbarer Eintraege nVisibleCount = aOSize.Height() / nEntryHeight; @@ -1276,7 +1276,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) { if( (pView->nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) ) - bHorBar = TRUE; + bHorBar = sal_True; } } @@ -1339,7 +1339,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize ) nTemp = nNewThumbPos - nTemp; if( pView->IsEditingActive() ) { - pView->EndEditing( TRUE ); // Cancel + pView->EndEditing( sal_True ); // Cancel pView->Update(); } pView->nFocusWidth = -1; @@ -1395,23 +1395,23 @@ void SvImpLBox::FillView() { if( !pStartEntry ) { - USHORT nVisibleViewCount = (USHORT)(pView->GetVisibleCount()); - USHORT nTempThumb = (USHORT)aVerSBar.GetThumbPos(); + sal_uInt16 nVisibleViewCount = (sal_uInt16)(pView->GetVisibleCount()); + sal_uInt16 nTempThumb = (sal_uInt16)aVerSBar.GetThumbPos(); if( nTempThumb >= nVisibleViewCount ) nTempThumb = nVisibleViewCount - 1; pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb)); } if( pStartEntry ) { - USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); - USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry )); - USHORT nCurDispEntries = nLast-nThumb+1; + sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); + sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); + sal_uInt16 nCurDispEntries = nLast-nThumb+1; if( nCurDispEntries < nVisibleCount ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); // Fenster fuellen, indem der Thumb schrittweise // nach oben bewegt wird - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; SvLBoxEntry* pTemp = pStartEntry; while( nCurDispEntries < nVisibleCount && pTemp ) { @@ -1421,13 +1421,13 @@ void SvImpLBox::FillView() nThumb--; pStartEntry = pTemp; nCurDispEntries++; - bFound = TRUE; + bFound = sal_True; } } if( bFound ) { aVerSBar.SetThumbPos( nThumb ); - ShowCursor( TRUE ); // Focusrect neu berechnen + ShowCursor( sal_True ); // Focusrect neu berechnen pView->Invalidate(); } } @@ -1439,11 +1439,11 @@ void SvImpLBox::FillView() void SvImpLBox::ShowVerSBar() { - BOOL bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; - ULONG nVis = 0; + sal_Bool bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; + sal_uIntPtr nVis = 0; if( !bVerBar ) nVis = pView->GetVisibleCount(); - if( bVerBar || (nVisibleCount && nVis > (ULONG)(nVisibleCount-1)) ) + if( bVerBar || (nVisibleCount && nVis > (sal_uIntPtr)(nVisibleCount-1)) ) { if( !aVerSBar.IsVisible() ) { @@ -1512,18 +1512,18 @@ void SvImpLBox::SyncVerThumb() aVerSBar.SetThumbPos( 0 ); } -BOOL SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const +sal_Bool SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const { // Parent eingeklappt if( !pView->IsEntryVisible(pEntry) ) - return FALSE; + return sal_False; long nY = GetEntryLine( pEntry ); if( nY < 0 ) - return FALSE; + return sal_False; long nMax = nVisibleCount * pView->GetEntryHeight(); if( nY >= nMax ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } @@ -1566,10 +1566,10 @@ void SvImpLBox::IndentChanged( short /* nIndentPixel */ ) {} void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry ) { - // SelAllDestrAnch( FALSE, TRUE ); //DeselectAll(); + // SelAllDestrAnch( sal_False, sal_True ); //DeselectAll(); if( GetUpdateMode() ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); long nY = GetEntryLine( pEntry ); if( IsLineVisible(nY) ) { @@ -1581,7 +1581,7 @@ void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry ) // die Thumb-Position korrigiert werden. SyncVerThumb(); ShowVerSBar(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -1590,7 +1590,7 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) ) return; - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) ) { @@ -1600,13 +1600,13 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) if( pStartEntry ) { long nOldThumbPos = aVerSBar.GetThumbPos(); - ULONG nVisList = pView->GetVisibleCount(); + sal_uIntPtr nVisList = pView->GetVisibleCount(); aVerSBar.SetRange( Range(0, nVisList-1) ); long nNewThumbPos = aVerSBar.GetThumbPos(); if( nNewThumbPos != nOldThumbPos ) { pStartEntry = pView->First(); - USHORT nDistance = (USHORT)nNewThumbPos; + sal_uInt16 nDistance = (sal_uInt16)nNewThumbPos; if( nDistance ) pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nDistance)); @@ -1622,9 +1622,9 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry ) SetCursor( pEntry ); if( GetUpdateMode() ) ShowVerSBar(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); if( GetUpdateMode() && pCursor ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry ) @@ -1632,7 +1632,7 @@ void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) || !pStartEntry ) return; - SelAllDestrAnch( FALSE, TRUE ); // deselectall + SelAllDestrAnch( sal_False, sal_True ); // deselectall // ist der eingeklappte Parent sichtbar ? long nY = GetEntryLine( pEntry ); @@ -1675,7 +1675,7 @@ void SvImpLBox::SetNodeBmpTabDistance() // // korrigiert bei SingleSelection den Cursor // -void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) +void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) { if( nFlags & F_IGNORE_SELECT ) return; @@ -1702,9 +1702,9 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) long nY = GetEntryLine( pEntry ); if( IsLineVisible( nY ) ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } } @@ -1748,14 +1748,14 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry ) if( pCursor && pCursor == pEntry ) { if( bSimpleTravel ) - pView->Select( pCursor, FALSE ); - ShowCursor( FALSE ); // Focus-Rect weg + pView->Select( pCursor, sal_False ); + ShowCursor( sal_False ); // Focus-Rect weg // NextSibling, weil auch Childs des Cursors geloescht werden pTemp = pView->NextSibling( pCursor ); if( !pTemp ) pTemp = (SvLBoxEntry*)(pView->PrevVisible( pCursor )); - SetCursor( pTemp, TRUE ); + SetCursor( pTemp, sal_True ); } if( pStartEntry && pStartEntry == pEntry ) { @@ -1788,10 +1788,10 @@ void SvImpLBox::EntryRemoved() if( !pStartEntry ) pStartEntry = pTree->First(); if( !pCursor ) - SetCursor( pStartEntry, TRUE ); + SetCursor( pStartEntry, sal_True ); if( pCursor && (bSimpleTravel || !pView->GetSelectionCount() )) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); if( GetUpdateMode()) { @@ -1819,9 +1819,9 @@ void SvImpLBox::EntryRemoved() MakeVisible( pCursor ); } else - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } - ShowCursor( TRUE ); + ShowCursor( sal_True ); } nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT); } @@ -1830,12 +1830,12 @@ void SvImpLBox::EntryRemoved() void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry ) { int bDeselAll = nFlags & F_DESEL_ALL; - SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); + SelAllDestrAnch( sal_False, sal_True ); // DeselectAll(); if( !bDeselAll ) nFlags &= (~F_DESEL_ALL); if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( IsEntryInView( pEntry ) ) pView->Invalidate(); if( pEntry == pStartEntry ) @@ -1868,8 +1868,8 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) pStartEntry = pView->First(); aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1)); - USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry ); - USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry ); + sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry ); + sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry ); FindMostRight(0); if( nNewPos < nFirstPos ) //!!!Notloesung pStartEntry = pEntry; @@ -1878,7 +1878,7 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) if( pEntry == pCursor ) { if( pView->IsEntryVisible( pCursor ) ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); else { SvLBoxEntry* pParent = pEntry; @@ -1908,16 +1908,16 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) return; int bDeselAll = nFlags & F_DESEL_ALL; if( bDeselAll ) - SelAllDestrAnch( FALSE, TRUE ); + SelAllDestrAnch( sal_False, sal_True ); else DestroyAnchor(); // nFlags &= (~F_DESEL_ALL); -// ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt +// ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt long nY = GetEntryLine( pEntry ); - BOOL bEntryVisible = IsLineVisible( nY ); + sal_Bool bEntryVisible = IsLineVisible( nY ); if( bEntryVisible ) { - ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt + ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt nY -= pView->GetEntryHeight(); // wg. Linien InvalidateEntriesFrom( nY ); } @@ -1926,9 +1926,9 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // pruefen, ob die View komplett gefuellt ist. Wenn // nicht, dann pStartEntry und den Cursor anpassen // (automatisches scrollen) - USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); - USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry )); - USHORT nCurDispEntries = nLast-nThumb+1; + sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible()))); + sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); + sal_uInt16 nCurDispEntries = nLast-nThumb+1; if( nCurDispEntries < nVisibleCount ) { // beim naechsten Paint-Event setzen @@ -1961,7 +1961,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1)); SyncVerThumb(); // falls vor Thumb eingefuegt wurde ShowVerSBar(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); if( pStartEntry != pView->First() && (nFlags & F_FILLING) ) pView->Update(); } @@ -1976,7 +1976,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // ****** Steuerung der Controlanimation -BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry, +sal_Bool SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long nY ) { SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab); @@ -1987,18 +1987,18 @@ BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry if( pCursor == pActiveEntry ) pView->HideFocus(); pView->CaptureMouse(); - pActiveButton->SetStateHilighted( TRUE ); + pActiveButton->SetStateHilighted( sal_True ); pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_RIGHT ); - return TRUE; + return sal_True; } else pActiveButton = 0; - return FALSE; + return sal_False; } -BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry) +sal_Bool SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry) { if( pActiveButton ) { @@ -2009,7 +2009,7 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry { if( !pActiveButton->IsStateHilighted() ) { - pActiveButton->SetStateHilighted(TRUE ); + pActiveButton->SetStateHilighted(sal_True ); nY = GetEntryLine( pActiveEntry ); pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | @@ -2020,24 +2020,24 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry { if( pActiveButton->IsStateHilighted() ) { - pActiveButton->SetStateHilighted(FALSE ); + pActiveButton->SetStateHilighted(sal_False ); nY = GetEntryLine( pActiveEntry ); pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE ); } } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) +sal_Bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) { if( pActiveButton ) { pView->ReleaseMouse(); SvLBoxEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() ); long nY = GetEntryLine( pActiveEntry ); - pActiveButton->SetStateHilighted( FALSE ); + pActiveButton->SetStateHilighted( sal_False ); long nMouseX = rMEvt.GetPosPixel().X(); if( pEntry == pActiveEntry && pView->GetItem( pActiveEntry, nMouseX ) == pActiveButton ) @@ -2046,26 +2046,26 @@ BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt ) SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_RIGHT ); if( pCursor == pActiveEntry ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); pActiveButton = 0; pActiveEntry = 0; pActiveTab = 0; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ******* Steuerung Plus/Minus-Button zum Expandieren/Kollabieren -// FALSE == kein Expand/Collapse-Button getroffen -BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const +// sal_False == kein Expand/Collapse-Button getroffen +sal_Bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const { if( !pEntry->HasChilds() && !pEntry->HasChildsOnDemand() ) - return FALSE; + return sal_False; SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab(); if( !pFirstDynamicTab ) - return FALSE; + return sal_False; long nMouseX = rPosPixel.X(); // in Doc-Koords umrechnen @@ -2075,26 +2075,26 @@ BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) cons long nX = pView->GetTabPos( pEntry, pFirstDynamicTab); nX += nNodeBmpTabDistance; if( nMouseX < nX ) - return FALSE; + return sal_False; nX += nNodeBmpWidth; if( nMouseX > nX ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -// FALSE == hit no node button -BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ ) +// sal_False == hit no node button +sal_Bool SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( pView->IsEditingActive() && pEntry == pView->pEdEntry ) // inplace editing -> nothing to do - bRet = TRUE; + bRet = sal_True; else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) ) { if ( pView->IsExpanded( pEntry ) ) { - pView->EndEditing( TRUE ); + pView->EndEditing( sal_True ); pView->Collapse( pEntry ); } else @@ -2102,7 +2102,7 @@ BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEn // you can expand an entry, which is in editing pView->Expand( pEntry ); } - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -2169,7 +2169,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) { // neu selektieren & tschuess if( !bSimpleTravel && !aSelEng.IsAlwaysAdding()) - SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); + SelAllDestrAnch( sal_False, sal_True ); // DeselectAll(); SetCursor( pEntry ); DBG_ERROR( "Please report what you did to get this assertion to FS!" ); @@ -2190,7 +2190,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) pView->Expand( pEntry ); if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde // (Nodebutton ist kein Entryitem!) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); return; } } @@ -2198,7 +2198,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) else { // CheckButton? (TreeListBox: Check + Info) - if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == TRUE) + if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == sal_True) return; // Inplace-Editing? #if 0 @@ -2248,28 +2248,28 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt) return; } -BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) +sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) { aEditTimer.Stop(); const KeyCode& rKeyCode = rKEvt.GetKeyCode(); if( rKeyCode.IsMod2() ) - return FALSE; // Alt-Taste nicht auswerten + return sal_False; // Alt-Taste nicht auswerten nFlags &= (~F_FILLING); if( !pCursor ) pCursor = pStartEntry; if( !pCursor ) - return FALSE; + return sal_False; - BOOL bKeyUsed = TRUE; + sal_Bool bKeyUsed = sal_True; - USHORT nDelta = (USHORT)aVerSBar.GetPageSize(); - USHORT aCode = rKeyCode.GetCode(); + sal_uInt16 nDelta = (sal_uInt16)aVerSBar.GetPageSize(); + sal_uInt16 aCode = rKeyCode.GetCode(); - BOOL bShift = rKeyCode.IsShift(); - BOOL bMod1 = rKeyCode.IsMod1(); + sal_Bool bShift = rKeyCode.IsShift(); + sal_Bool bMod1 = rKeyCode.IsMod1(); SvLBoxEntry* pNewCursor; @@ -2300,7 +2300,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) aSelEng.CursorPosChanging( bShift, bMod1 ); SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on if( !IsEntryInView( pNewCursor ) ) - KeyUp( FALSE ); + KeyUp( sal_False ); } break; @@ -2333,13 +2333,13 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) else { if( pCursor ) - pView->Select( pCursor, FALSE ); - KeyDown( FALSE ); + pView->Select( pCursor, sal_False ); + KeyDown( sal_False ); SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on } } else - KeyDown( FALSE ); // weil ScrollBar-Range evtl. noch + KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch // scrollen erlaubt break; @@ -2352,7 +2352,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) ) { ++nCurTabPos; - ShowCursor( TRUE ); + ShowCursor( sal_True ); CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } @@ -2372,7 +2372,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; } @@ -2383,7 +2383,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if ( nCurTabPos > FIRST_ENTRY_TAB ) { --nCurTabPos; - ShowCursor( TRUE ); + ShowCursor( sal_True ); CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } @@ -2415,7 +2415,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) else if( bSubLstOpLR && IsExpandable() ) pView->Collapse( pCursor ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; } @@ -2432,19 +2432,19 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( nDelta ) { - DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?"); + DBG_ASSERT(pNewCursor&&(sal_uIntPtr)pNewCursor!=(sal_uIntPtr)pCursor,"Cursor?"); aSelEng.CursorPosChanging( bShift, bMod1 ); if( IsEntryInView( pNewCursor ) ) SetCursor( pNewCursor ); else { SetCursor( pNewCursor ); - KeyUp( TRUE ); + KeyUp( sal_True ); } } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_PAGEDOWN: @@ -2460,21 +2460,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( nDelta ) { - DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?"); + DBG_ASSERT(pNewCursor&&(sal_uIntPtr)pNewCursor!=(sal_uIntPtr)pCursor,"Cursor?"); aSelEng.CursorPosChanging( bShift, bMod1 ); if( IsEntryInView( pNewCursor ) ) SetCursor( pNewCursor ); else { SetCursor( pNewCursor ); - KeyDown( TRUE ); + KeyDown( sal_True ); } } else - KeyDown( FALSE ); // siehe KEY_DOWN + KeyDown( sal_False ); // siehe KEY_DOWN } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_SPACE: @@ -2493,15 +2493,15 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) pView->Select( pCursor, !pView->IsSelected( pCursor ) ); else { - SelAllDestrAnch( FALSE ); - pView->Select( pCursor, TRUE ); + SelAllDestrAnch( sal_False ); + pView->Select( pCursor, sal_True ); } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_RETURN: @@ -2513,7 +2513,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) pView->Expand( pCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_F2: @@ -2523,7 +2523,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) EditTimerCall( 0 ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_F8: @@ -2531,12 +2531,12 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) !(nWinBits & WB_SIMPLEMODE)) { if( aSelEng.IsAlwaysAdding() ) - aSelEng.AddAlways( FALSE ); + aSelEng.AddAlways( sal_False ); else - aSelEng.AddAlways( TRUE ); + aSelEng.AddAlways( sal_True ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; @@ -2559,7 +2559,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) pView->Expand( pCursor ); if( bMod1 ) { - USHORT nRefDepth = pTree->GetDepth( pCursor ); + sal_uInt16 nRefDepth = pTree->GetDepth( pCursor ); SvLBoxEntry* pCur = pTree->Next( pCursor ); while( pCur && pTree->GetDepth(pCur) > nRefDepth ) { @@ -2570,14 +2570,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_A: if( bMod1 ) - SelAllDestrAnch( TRUE ); + SelAllDestrAnch( sal_True ); // else -// bKeyUsed = FALSE; #105907# assume user wants to use quicksearch with key "a", so key is handled! +// bKeyUsed = sal_False; #105907# assume user wants to use quicksearch with key "a", so key is handled! break; case KEY_SUBTRACT: @@ -2591,7 +2591,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) SvLBoxEntry* pParentToCollapse = (SvLBoxEntry*)pTree->GetRootLevelParent(pCursor); if( pParentToCollapse ) { - USHORT nRefDepth; + sal_uInt16 nRefDepth; // Sonderbehandlung Explorer: Befindet sich auf der // Root nur ein Eintrag,dann den Root-Entry nicht // einklappen @@ -2621,21 +2621,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) } } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_DIVIDE : if( bMod1 ) - SelAllDestrAnch( TRUE ); + SelAllDestrAnch( sal_True ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_COMMA : if( bMod1 ) - SelAllDestrAnch( FALSE ); + SelAllDestrAnch( sal_False ); else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_HOME : @@ -2648,14 +2648,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( pNewCursor && pNewCursor != pCursor ) { -// SelAllDestrAnch( FALSE ); +// SelAllDestrAnch( sal_False ); aSelEng.CursorPosChanging( bShift, bMod1 ); SetCursor( pNewCursor ); if( !IsEntryInView( pNewCursor ) ) MakeVisible( pNewCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_END : @@ -2668,14 +2668,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( pNewCursor && pNewCursor != pCursor) { -// SelAllDestrAnch( FALSE ); +// SelAllDestrAnch( sal_False ); aSelEng.CursorPosChanging( bShift, bMod1 ); SetCursor( pNewCursor ); if( !IsEntryInView( pNewCursor ) ) MakeVisible( pNewCursor ); } else - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; case KEY_ESCAPE: @@ -2684,14 +2684,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_BACKSPACE: // #105907# must not be handled because this quits dialogs and does other magic things... // if there are other single keys which should not be handled, they can be added here - bKeyUsed = FALSE; + bKeyUsed = sal_False; break; default: if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS ) // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch... // if there are groups of keys which should not be handled, they can be added here - bKeyUsed = FALSE; + bKeyUsed = sal_False; } return bKeyUsed; } @@ -2700,11 +2700,11 @@ void __EXPORT SvImpLBox::GetFocus() { if( pCursor ) { - pView->SetEntryFocus( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->SetEntryFocus( pCursor, sal_True ); + ShowCursor( sal_True ); // auskommentiert wg. deselectall // if( bSimpleTravel && !pView->IsSelected(pCursor) ) -// pView->Select( pCursor, TRUE ); +// pView->Select( pCursor, sal_True ); } if( nWinBits & WB_HIDESELECTION ) { @@ -2721,7 +2721,7 @@ void __EXPORT SvImpLBox::GetFocus() SvViewData* pViewData = pView->GetViewData( pEntry ); if( pViewData->IsCursored() ) { - pViewData->SetCursored( FALSE ); + pViewData->SetCursored( sal_False ); InvalidateEntry( pEntry ); } pEntry = pView->GetModel()->Next( pEntry ); @@ -2736,8 +2736,8 @@ void __EXPORT SvImpLBox::LoseFocus() { aEditTimer.Stop(); if( pCursor ) - pView->SetEntryFocus( pCursor,FALSE ); - ShowCursor( FALSE ); + pView->SetEntryFocus( pCursor,sal_False ); + ShowCursor( sal_False ); if( nWinBits & WB_HIDESELECTION ) { @@ -2745,7 +2745,7 @@ void __EXPORT SvImpLBox::LoseFocus() while( pEntry ) { //SvViewData* pViewData = pView->GetViewData( pEntry ); - //pViewData->SetCursored( TRUE ); + //pViewData->SetCursored( sal_True ); InvalidateEntry( pEntry ); pEntry = pView->NextSelected( pEntry ); } @@ -2757,7 +2757,7 @@ void __EXPORT SvImpLBox::LoseFocus() // SelectionEngine // ******************************************************************** -inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect ) +inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect ) { pView->Select( pEntry, bSelect ); } @@ -2803,7 +2803,7 @@ void __EXPORT ImpLBSelEng::CreateCursor() */ -BOOL __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor) +sal_Bool __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor) { SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint ); if( pNewCursor != pImp->pCursor ) @@ -2814,19 +2814,19 @@ BOOL __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelec // bei SimpleTravel wird in SetCursor selektiert und // der Select-Handler gerufen //if( !bDontSelectAtCursor && !pImp->bSimpleTravel ) - // pImp->SelectEntry( pNewCursor, TRUE ); + // pImp->SelectEntry( pNewCursor, sal_True ); pImp->SetCursor( pNewCursor, bDontSelectAtCursor ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL __EXPORT ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint ) +sal_Bool __EXPORT ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint ) { SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint ); if( pEntry ) return pView->IsSelected(pEntry); - return FALSE; + return sal_False; } void __EXPORT ImpLBSelEng::DeselectAtPoint( const Point& rPoint ) @@ -2834,7 +2834,7 @@ void __EXPORT ImpLBSelEng::DeselectAtPoint( const Point& rPoint ) SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint ); if( !pEntry ) return; - pImp->SelectEntry( pEntry, FALSE ); + pImp->SelectEntry( pEntry, sal_False ); } /* @@ -2843,13 +2843,13 @@ void __EXPORT ImpLBSelEng::SelectAtPoint( const Point& rPoint ) SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint ); if( !pEntry ) return; - pImp->SelectEntry( pEntry, TRUE ); + pImp->SelectEntry( pEntry, sal_True ); } */ void __EXPORT ImpLBSelEng::DeselectAll() { - pImp->SelAllDestrAnch( FALSE, FALSE ); // SelectionEngine nicht resetten! + pImp->SelAllDestrAnch( sal_False, sal_False ); // SelectionEngine nicht resetten! pImp->nFlags &= (~F_DESEL_ALL); } @@ -2860,9 +2860,9 @@ void __EXPORT ImpLBSelEng::DeselectAll() void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCursor) { SvLBoxEntry* pEntry; - ULONG nAnchorVisPos = pView->GetVisiblePos( pAnchor ); - ULONG nOldVisPos = pView->GetVisiblePos( pOldCursor ); - ULONG nNewVisPos = pView->GetVisiblePos( pNewCursor ); + sal_uIntPtr nAnchorVisPos = pView->GetVisiblePos( pAnchor ); + sal_uIntPtr nOldVisPos = pView->GetVisiblePos( pOldCursor ); + sal_uIntPtr nNewVisPos = pView->GetVisiblePos( pNewCursor ); if( nOldVisPos > nAnchorVisPos || ( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) ) @@ -2872,11 +2872,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pOldCursor; while( pEntry && pEntry != pNewCursor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2885,20 +2885,20 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pAnchor; while( pEntry && pEntry != pOldCursor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = pNewCursor; while( pEntry && pEntry != pAnchor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2908,11 +2908,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); while( pEntry && pEntry != pOldCursor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); return; } } @@ -2923,11 +2923,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pNewCursor; while( pEntry && pEntry != pOldCursor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2936,19 +2936,19 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pOldCursor; while( pEntry && pEntry != pAnchor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = pAnchor; while( pEntry && pEntry != pNewCursor ) { - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } if( pEntry ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); return; } @@ -2957,7 +2957,7 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs pEntry = pOldCursor; while( pEntry && pEntry != pNewCursor ) { - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } return; @@ -2965,8 +2965,8 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs } } -void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, - BOOL bSingleSelToo ) +void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor, + sal_Bool bSingleSelToo ) { SvLBoxEntry* pEntry; nFlags &= (~F_DESEL_ALL); @@ -2974,7 +2974,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, { if( pCursor && !pView->IsSelected( pCursor )) { - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } return; } @@ -2992,7 +2992,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, if( !bSelect && pView->GetSelectionCount()==1 && pCursor && pView->IsSelected( pCursor )) { - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); if( bDestroyAnchor ) DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen else @@ -3003,8 +3003,8 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, if( bSimpleTravel && !pCursor && !GetUpdateMode() ) nFlags |= F_DESEL_ALL; - ShowCursor( FALSE ); - BOOL bUpdate = GetUpdateMode(); + ShowCursor( sal_False ); + sal_Bool bUpdate = GetUpdateMode(); nFlags |= F_IGNORE_SELECT; // EntryInserted soll nix tun pEntry = pTree->First(); @@ -3027,18 +3027,18 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor, DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen else pAnchor = 0; // internen Anker immer loeschen - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvImpLBox::SetSelectionMode( SelectionMode eSelMode ) { aSelEng.SetSelectionMode( eSelMode); if( eSelMode == SINGLE_SELECTION ) - bSimpleTravel = TRUE; + bSimpleTravel = sal_True; else - bSimpleTravel = FALSE; + bSimpleTravel = sal_False; if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) - aSelEng.AddAlways( TRUE ); + aSelEng.AddAlways( sal_True ); } // *********************************************************************** @@ -3049,13 +3049,13 @@ void SvImpLBox::SetDragDropMode( DragDropMode eDDMode ) { if( eDDMode && eDDMode != SV_DRAGDROP_APP_DROP ) { - aSelEng.ExpandSelectionOnMouseMove( FALSE ); - aSelEng.EnableDrag( TRUE ); + aSelEng.ExpandSelectionOnMouseMove( sal_False ); + aSelEng.EnableDrag( sal_True ); } else { - aSelEng.ExpandSelectionOnMouseMove( TRUE ); - aSelEng.EnableDrag( FALSE ); + aSelEng.ExpandSelectionOnMouseMove( sal_True ); + aSelEng.EnableDrag( sal_False ); } } @@ -3104,7 +3104,7 @@ void SvImpLBox::PaintDDCursor( SvLBoxEntry* pInsertionPos ) --------------------------------------------------*/ void lcl_DeleteSubPopups(PopupMenu* pPopup) { - for(USHORT i = 0; i < pPopup->GetItemCount(); i++) + for(sal_uInt16 i = 0; i < pPopup->GetItemCount(); i++) { PopupMenu* pSubPopup = pPopup->GetPopupMenu( pPopup->GetItemId( i )); if(pSubPopup) @@ -3117,7 +3117,7 @@ void lcl_DeleteSubPopups(PopupMenu* pPopup) bool SvImpLBox::Command( const CommandEvent& rCEvt ) { - USHORT nCommand = rCEvt.GetCommand(); + sal_uInt16 nCommand = rCEvt.GetCommand(); if( nCommand == COMMAND_CONTEXTMENU ) aEditTimer.Stop(); @@ -3143,7 +3143,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU ) { Point aPopupPos; - BOOL bClickedIsFreePlace = FALSE; + sal_Bool bClickedIsFreePlace = sal_False; std::stack<SvLBoxEntry*> aSelRestore; if( rCEvt.IsMouseEvent() ) @@ -3154,7 +3154,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) SvLBoxEntry* pClickedEntry = GetEntry( aPopupPos ); if( pClickedEntry ) { // mouse in non empty area - BOOL bClickedIsSelected = FALSE; + sal_Bool bClickedIsSelected = sal_False; // collect the currently selected entries SvLBoxEntry* pSelected = pView->FirstSelected(); @@ -3167,30 +3167,30 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) // if the entry which the user clicked at is not selected if( !bClickedIsSelected ) { // deselect all other and select the clicked one - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); pView->SetCursor( pClickedEntry ); } } else if( aSelEng.GetSelectionMode() == SINGLE_SELECTION ) {//modified by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time) - bClickedIsFreePlace = TRUE; - INT32 nSelectedEntries = pView->GetSelectionCount(); + bClickedIsFreePlace = sal_True; + sal_Int32 nSelectedEntries = pView->GetSelectionCount(); SvLBoxEntry* pSelected = pView->FirstSelected(); - for(USHORT nSel = 0; nSel < nSelectedEntries; nSel++ ) + for(sal_uInt16 nSel = 0; nSel < nSelectedEntries; nSel++ ) { aSelRestore.push(pSelected); pSelected = pView->NextSelected( pSelected ); } - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); } else { // deselect all - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); } } else { // key event (or at least no mouse event) - INT32 nSelectionCount = pView->GetSelectionCount(); + sal_Int32 nSelectionCount = pView->GetSelectionCount(); if( nSelectionCount ) { // now allways take first visible as base for positioning the menu @@ -3221,7 +3221,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) if( pPopup ) { // do action for selected entry in popup menu - USHORT nMenuAction = pPopup->Execute( pView, aPopupPos ); + sal_uInt16 nMenuAction = pPopup->Execute( pView, aPopupPos ); if ( nMenuAction ) pView->ExcecuteContextMenuAction( nMenuAction ); lcl_DeleteSubPopups(pPopup); @@ -3235,7 +3235,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) SvLBoxEntry* pEntry = aSelRestore.top(); //#i19717# the entry is maybe already deleted bool bFound = false; - for(ULONG nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++) + for(sal_uIntPtr nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++) if(pEntry == pView->GetEntry(nEntry)) { bFound = true; @@ -3297,12 +3297,12 @@ void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry ) if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) - SelAllDestrAnch( FALSE, TRUE, FALSE ); + SelAllDestrAnch( sal_False, sal_True, sal_False ); if ( pEntry ) MakeVisible( pEntry ); SetCursor( pEntry ); if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG ) @@ -3324,21 +3324,21 @@ IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG ) SvLBoxEntry* pEntry = GetCurEntry(); if( pEntry ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); pView->ImplEditEntry( pEntry ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } return 0; } -BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) +sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) { if( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( pView->ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); if( !GetVisibleArea().IsInside( aPos )) - return FALSE; + return sal_False; SvLBoxEntry* pEntry = GetEntry( aPos ); if( pEntry ) @@ -3347,18 +3347,18 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) SvLBoxTab* pTab; SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab )); if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING ) - return FALSE; + return sal_False; aPos = GetEntryPosition( pEntry ); aPos.X() = pView->GetTabPos( pEntry, pTab ); //pTab->GetPos(); Size aSize( pItem->GetSize( pView, pEntry ) ); SvLBoxTab* pNextTab = NextTab( pTab ); - BOOL bItemClipped = FALSE; + sal_Bool bItemClipped = sal_False; // wurde das Item von seinem rechten Nachbarn abgeschnitten? if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() ) { aSize.Width() = pNextTab->GetPos() - pTab->GetPos(); - bItemClipped = TRUE; + bItemClipped = sal_True; } Rectangle aItemRect( aPos, aSize ); @@ -3379,19 +3379,19 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) Help::ShowQuickHelp( pView, aItemRect, pItem->GetText(), QUICKHELP_LEFT | QUICKHELP_VCENTER ); - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } SvLBoxTab* SvImpLBox::NextTab( SvLBoxTab* pTab ) { - USHORT nTabCount = pView->TabCount(); + sal_uInt16 nTabCount = pView->TabCount(); if( nTabCount <= 1 ) return 0; - for( USHORT nTab=0; nTab < (nTabCount-1); nTab++) + for( sal_uInt16 nTab=0; nTab < (nTabCount-1); nTab++) { if( pView->aTabs[nTab]==pTab ) return (SvLBoxTab*)(pView->aTabs[nTab+1]); @@ -3409,28 +3409,28 @@ void SvImpLBox::RepaintScrollBars() { } -void SvImpLBox::SetUpdateMode( BOOL bMode ) +void SvImpLBox::SetUpdateMode( sal_Bool bMode ) { if( bUpdateMode != bMode ) { bUpdateMode = bMode; if( bUpdateMode ) - UpdateAll( FALSE ); + UpdateAll( sal_False ); } } -void SvImpLBox::SetUpdateModeFast( BOOL bMode ) +void SvImpLBox::SetUpdateModeFast( sal_Bool bMode ) { if( bUpdateMode != bMode ) { bUpdateMode = bMode; if( bUpdateMode ) - UpdateAll( FALSE, FALSE ); + UpdateAll( sal_False, sal_False ); } } -BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) +sal_Bool SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) { if( pView->nTreeFlags & TREEFLAG_RECALCTABS ) { @@ -3439,8 +3439,8 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) nFlags &= ~F_IGNORE_CHANGED_TABS; } - USHORT nLastTab = pView->aTabs.Count() - 1; - USHORT nLastItem = pEntry->ItemCount() - 1; + sal_uInt16 nLastTab = pView->aTabs.Count() - 1; + sal_uInt16 nLastItem = pEntry->ItemCount() - 1; if( nLastTab != USHRT_MAX && nLastItem != USHRT_MAX ) { if( nLastItem < nLastTab ) @@ -3466,10 +3466,10 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry ) { nMostRight = nRight; pMostRightEntry = pEntry; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } void SvImpLBox::FindMostRight( SvLBoxEntry* pEntryToIgnore ) @@ -3503,8 +3503,8 @@ void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToI if( !pList ) return; - ULONG nCount = pList->Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = pList->Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pChild = (SvLBoxEntry*)pList->GetObject( nCur ); if( pChild != pEntryToIgnore ) @@ -3611,7 +3611,7 @@ const Image& SvImpLBox::GetDefaultCollapsedNodeImage( BmpColorMode _eMode ) } // ----------------------------------------------------------------------- -void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData ) +void SvImpLBox::CallEventListeners( sal_uIntPtr nEvent, void* pData ) { if ( pView ) pView->CallImplEventListeners( nEvent, pData); @@ -3619,14 +3619,14 @@ void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData ) // ----------------------------------------------------------------------- -bool SvImpLBox::SetCurrentTabPos( USHORT _nNewPos ) +bool SvImpLBox::SetCurrentTabPos( sal_uInt16 _nNewPos ) { bool bRet = false; if ( pView && _nNewPos < ( pView->TabCount() - 2 ) ) { nCurTabPos = _nNewPos; - ShowCursor( TRUE ); + ShowCursor( sal_True ); bRet = true; } diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx index 2d4c9cf2df0e..cbdcf3aac007 100644 --- a/svtools/source/contnr/svimpicn.cxx +++ b/svtools/source/contnr/svimpicn.cxx @@ -100,30 +100,30 @@ #undef TEXT_DRAW_WORDBREAK #endif -// #define TEXT_DRAW_DISABLE ((USHORT)0x0001) -// #define TEXT_DRAW_3DLOOK ((USHORT)0x0002) -// #define TEXT_DRAW_MNEMONIC ((USHORT)0x0004) -#define TEXT_DRAW_LEFT ((USHORT)0x0010) -#define TEXT_DRAW_CENTER ((USHORT)0x0020) -#define TEXT_DRAW_RIGHT ((USHORT)0x0040) -#define TEXT_DRAW_TOP ((USHORT)0x0080) -#define TEXT_DRAW_VCENTER ((USHORT)0x0100) -#define TEXT_DRAW_BOTTOM ((USHORT)0x0200) -#define TEXT_DRAW_ENDELLIPSIS ((USHORT)0x0400) -#define TEXT_DRAW_PATHELLIPSIS ((USHORT)0x0800) -#define TEXT_DRAW_CLIP ((USHORT)0x1000) -#define TEXT_DRAW_MULTILINE ((USHORT)0x2000) -#define TEXT_DRAW_WORDBREAK ((USHORT)0x4000) +// #define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001) +// #define TEXT_DRAW_3DLOOK ((sal_uInt16)0x0002) +// #define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0004) +#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010) +#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020) +#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040) +#define TEXT_DRAW_TOP ((sal_uInt16)0x0080) +#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100) +#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200) +#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400) +#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800) +#define TEXT_DRAW_CLIP ((sal_uInt16)0x1000) +#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x2000) +#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x4000) XubString GetEllipsisString( OutputDevice* pDev, const XubString& rStr, long nMaxWidth, - USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) + sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) { XubString aStr = rStr; if ( nStyle & TEXT_DRAW_ENDELLIPSIS ) { - USHORT nIndex = pDev->GetTextBreak( rStr, nMaxWidth ); + sal_uInt16 nIndex = pDev->GetTextBreak( rStr, nMaxWidth ); if ( nIndex != STRING_LEN ) { aStr.Erase( nIndex ); @@ -151,11 +151,11 @@ class TextLineInfo { private: long mnWidth; - USHORT mnIndex; - USHORT mnLen; + sal_uInt16 mnIndex; + sal_uInt16 mnLen; public: - TextLineInfo( long nWidth, USHORT nIndex, USHORT nLen ) + TextLineInfo( long nWidth, sal_uInt16 nIndex, sal_uInt16 nLen ) { mnWidth = nWidth; mnIndex = nIndex; @@ -163,8 +163,8 @@ public: } long GetWidth() const { return mnWidth; } - USHORT GetIndex() const { return mnIndex; } - USHORT GetLen() const { return mnLen; } + sal_uInt16 GetIndex() const { return mnIndex; } + sal_uInt16 GetLen() const { return mnLen; } }; #define MULTITEXTLINEINFO_RESIZE 16 @@ -174,8 +174,8 @@ class MultiTextLineInfo { private: PTextLineInfo* mpLines; - USHORT mnLines; - USHORT mnSize; + sal_uInt16 mnLines; + sal_uInt16 mnSize; public: MultiTextLineInfo(); @@ -184,9 +184,9 @@ public: void AddLine( TextLineInfo* pLine ); void Clear(); - TextLineInfo* GetLine( USHORT nLine ) const + TextLineInfo* GetLine( sal_uInt16 nLine ) const { return mpLines[nLine]; } - USHORT Count() const { return mnLines; } + sal_uInt16 Count() const { return mnLines; } private: MultiTextLineInfo( const MultiTextLineInfo& ); @@ -202,7 +202,7 @@ MultiTextLineInfo::MultiTextLineInfo() MultiTextLineInfo::~MultiTextLineInfo() { - for ( USHORT i = 0; i < mnLines; i++ ) + for ( sal_uInt16 i = 0; i < mnLines; i++ ) delete mpLines[i]; delete [] mpLines; } @@ -223,7 +223,7 @@ void MultiTextLineInfo::AddLine( TextLineInfo* pLine ) void MultiTextLineInfo::Clear() { - for ( USHORT i = 0; i < mnLines; i++ ) + for ( sal_uInt16 i = 0; i < mnLines; i++ ) delete mpLines[i]; mnLines = 0; } @@ -232,7 +232,7 @@ void MultiTextLineInfo::Clear() long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, - USHORT nStyle = TEXT_DRAW_WORDBREAK ) + sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK ) { rLineInfo.Clear(); if ( !rStr.Len() ) @@ -240,20 +240,20 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, if ( nWidth <= 0 ) nWidth = 1; - USHORT nStartPos = 0; // Start-Position der Zeile - USHORT nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort - USHORT nLastWordPos = 0; // Position des letzten Wortanfangs - USHORT i = 0; - USHORT nPos; // StartPositon der Zeile (nur Temp) - USHORT nLen; // Laenge der Zeile (nur Temp) - USHORT nStrLen = rStr.Len(); + sal_uInt16 nStartPos = 0; // Start-Position der Zeile + sal_uInt16 nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort + sal_uInt16 nLastWordPos = 0; // Position des letzten Wortanfangs + sal_uInt16 i = 0; + sal_uInt16 nPos; // StartPositon der Zeile (nur Temp) + sal_uInt16 nLen; // Laenge der Zeile (nur Temp) + sal_uInt16 nStrLen = rStr.Len(); long nMaxLineWidth = 0; // Maximale Zeilenlaenge long nLineWidth; // Aktuelle Zeilenlaenge long nLastLineWidth = 0; // Zeilenlaenge der letzten Zeile xub_Unicode c; xub_Unicode c2; const xub_Unicode* pStr = rStr.GetBuffer(); - BOOL bHardBreak = FALSE; + sal_Bool bHardBreak = sal_False; do { @@ -261,9 +261,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, // Auf Zeilenende ermitteln if ( (c == _CR) || (c == _LF) ) - bHardBreak = TRUE; + bHardBreak = sal_True; else - bHardBreak = FALSE; + bHardBreak = sal_False; // Testen, ob ein Wortende erreicht ist if ( bHardBreak || (i == nStrLen) || @@ -378,9 +378,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, // ----------------------------------------------------------------------- -USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect, +sal_uInt16 GetTextLines( OutputDevice* pDev, const Rectangle& rRect, const XubString& rStr, - USHORT nStyle = TEXT_DRAW_WORDBREAK, + sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK, long* pMaxWidth = NULL ) { MultiTextLineInfo aMultiLineInfo; @@ -395,10 +395,10 @@ USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect, Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, const XubString& rStr, - USHORT nStyle = TEXT_DRAW_WORDBREAK ) + sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK ) { Rectangle aRect = rRect; - USHORT nLines; + sal_uInt16 nLines; long nWidth = rRect.GetWidth(); long nMaxWidth; long nTextHeight; @@ -407,13 +407,13 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, { MultiTextLineInfo aMultiLineInfo; TextLineInfo* pLineInfo; - USHORT nFormatLines; + sal_uInt16 nFormatLines; nMaxWidth = 0; GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle ); nFormatLines = aMultiLineInfo.Count(); nTextHeight = pDev->GetTextHeight(); - nLines = (USHORT)(aRect.GetHeight()/nTextHeight); + nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight); if ( nFormatLines <= nLines ) nLines = nFormatLines; else @@ -423,7 +423,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, else nMaxWidth = nWidth; } - for ( USHORT i = 0; i < nLines; i++ ) + for ( sal_uInt16 i = 0; i < nLines; i++ ) { pLineInfo = aMultiLineInfo.GetLine( i ); if ( pLineInfo->GetWidth() > nMaxWidth ) @@ -465,7 +465,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, // ----------------------------------------------------------------------- void DrawText( OutputDevice* pDev, const Rectangle& rRect, - const XubString& rStr, USHORT nStyle = 0 ) + const XubString& rStr, sal_uInt16 nStyle = 0 ) { if ( !rStr.Len() || rRect.IsEmpty() ) return; @@ -487,10 +487,10 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect, TextLineInfo* pLineInfo; long nTextHeight = pDev->GetTextHeight(); long nMaxTextWidth; - USHORT i; - USHORT nLines = (USHORT)(nHeight/nTextHeight); - USHORT nFormatLines; - BOOL bIsClipRegion = FALSE; + sal_uInt16 i; + sal_uInt16 nLines = (sal_uInt16)(nHeight/nTextHeight); + sal_uInt16 nFormatLines; + sal_Bool bIsClipRegion = sal_False; nMaxTextWidth = GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle ); nFormatLines = aMultiLineInfo.Count(); @@ -611,7 +611,7 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect, if ( nStyle & TEXT_DRAW_CLIP ) { - BOOL bIsClipRegion = pDev->IsClipRegion(); + sal_Bool bIsClipRegion = pDev->IsClipRegion(); if ( bIsClipRegion ) { Region aOldRegion = pDev->GetClipRegion(); @@ -649,7 +649,7 @@ class ImpIcnCursor SvImpIconView* pView; SvPtrarr* pColumns; SvPtrarr* pRows; - BOOL* pGridMap; + sal_Bool* pGridMap; long nGridDX, nGridDY; long nGridCols, nGridRows; long nCols; @@ -661,39 +661,39 @@ class ImpIcnCursor void ImplCreate(); void Create() { if( !pColumns ) ImplCreate(); } - USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); - SvLBoxEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref, - BOOL bDown, BOOL bSimple ); - SvLBoxEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref, - BOOL bRight, BOOL bSimple ); + sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); + SvLBoxEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref, + sal_Bool bDown, sal_Bool bSimple ); + SvLBoxEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref, + sal_Bool bRight, sal_Bool bSimple ); void ExpandGrid(); void CreateGridMap(); - // Rueckgabe FALSE: Eintrag liegt nicht in der GridMap. rGridx,y werden + // Rueckgabe sal_False: Eintrag liegt nicht in der GridMap. rGridx,y werden // dann an nGridCols, nGridRows geclippt - BOOL GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const; - void SetGridUsed( USHORT nDX, USHORT nDY, BOOL bUsed ) + sal_Bool GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const; + void SetGridUsed( sal_uInt16 nDX, sal_uInt16 nDY, sal_Bool bUsed ) { pGridMap[ (nDY * nGridCols) + nDX ] = bUsed; } - BOOL IsGridUsed( USHORT nDX, USHORT nDY ) + sal_Bool IsGridUsed( sal_uInt16 nDX, sal_uInt16 nDY ) { return pGridMap[ (nDY * nGridCols) + nDX ]; } public: ImpIcnCursor( SvImpIconView* pOwner ); ~ImpIcnCursor(); - void Clear( BOOL bGridToo = TRUE ); + void Clear( sal_Bool bGridToo = sal_True ); // fuer Cursortravelling usw. - SvLBoxEntry* GoLeftRight( SvLBoxEntry*, BOOL bRight ); - SvLBoxEntry* GoUpDown( SvLBoxEntry*, BOOL bDown ); + SvLBoxEntry* GoLeftRight( SvLBoxEntry*, sal_Bool bRight ); + SvLBoxEntry* GoUpDown( SvLBoxEntry*, sal_Bool bDown ); - // Rueckgaebe: FALSE == Das leere Rect steht hinter dem letzten + // Rueckgaebe: sal_False == Das leere Rect steht hinter dem letzten // Eintrag; d.h. beim naechsten Einfuegen ergibt sich das naechste // leere Rechteck durch Addition. Hinweis: Das Rechteck kann dann // ausserhalb des View-Space liegen - BOOL FindEmptyGridRect( Rectangle& rRect ); + sal_Bool FindEmptyGridRect( Rectangle& rRect ); // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left() // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann @@ -701,7 +701,7 @@ public: // muessen mit DestroyGridAdjustData geloescht werden void CreateGridAjustData( SvPtrarr& pLists, SvLBoxEntry* pRow=0); static void DestroyGridAdjustData( SvPtrarr& rLists ); - void SetGridUsed( const Rectangle&, BOOL bUsed = TRUE ); + void SetGridUsed( const Rectangle&, sal_Bool bUsed = sal_True ); }; @@ -740,7 +740,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, aEditTimer.SetTimeout( 800 ); aEditTimer.SetTimeoutHdl(LINK(this,SvImpIconView,EditTimeoutHdl)); - Clear( TRUE ); + Clear( sal_True ); } SvImpIconView::~SvImpIconView() @@ -755,14 +755,14 @@ SvImpIconView::~SvImpIconView() ClearSelectedRectList(); } -void SvImpIconView::Clear( BOOL bInCtor ) +void SvImpIconView::Clear( sal_Bool bInCtor ) { StopEditTimer(); CancelUserEvent(); nMaxBmpWidth = 0; nMaxBmpHeight = 0; nMaxTextWidth = 0; - bMustRecalcBoundingRects = FALSE; + bMustRecalcBoundingRects = sal_False; nMaxBoundHeight = 0; //XXX @@ -798,17 +798,17 @@ void SvImpIconView::SetWindowBits( WinBits nWinStyle ) IMPL_LINK( SvImpIconView, ScrollUpDownHdl, ScrollBar *, pScrollBar ) { - pView->EndEditing( TRUE ); + pView->EndEditing( sal_True ); // Pfeil hoch: delta=-1; Pfeil runter: delta=+1 - Scroll( 0, pScrollBar->GetDelta(), TRUE ); + Scroll( 0, pScrollBar->GetDelta(), sal_True ); return 0; } IMPL_LINK( SvImpIconView, ScrollLeftRightHdl, ScrollBar *, pScrollBar ) { - pView->EndEditing( TRUE ); + pView->EndEditing( sal_True ); // Pfeil links: delta=-1; Pfeil rechts: delta=+1 - Scroll( pScrollBar->GetDelta(), 0, TRUE ); + Scroll( pScrollBar->GetDelta(), 0, sal_True ); return 0; } @@ -848,7 +848,7 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry, { nMaxTextWidth = aSize.Width(); if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = TRUE; + bMustRecalcBoundingRects = sal_True; } } SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); @@ -860,14 +860,14 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry, nMaxBmpWidth = aSize.Width(); nMaxBmpWidth += (2*LROFFS_ICON); if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = TRUE; + bMustRecalcBoundingRects = sal_True; } if( aSize.Height() > nMaxBmpHeight ) { nMaxBmpHeight = aSize.Height(); nMaxBmpHeight += (2*TBOFFS_ICON);; if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = TRUE; + bMustRecalcBoundingRects = sal_True; } } } @@ -880,9 +880,9 @@ void SvImpIconView::EntryInserted( SvLBoxEntry* pEntry ) DBG_ASSERT(pZOrderList->GetPos(pEntry)==0xffff,"EntryInserted:ZOrder?"); pZOrderList->Insert( pEntry, pZOrderList->Count() ); if( nFlags & F_GRIDMODE ) - pImpCursor->Clear( FALSE ); + pImpCursor->Clear( sal_False ); else - pImpCursor->Clear( TRUE ); + pImpCursor->Clear( sal_True ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); CheckSizes( pEntry, pViewData ); if( pView->IsUpdateMode() ) @@ -912,11 +912,11 @@ void SvImpIconView::RemovingEntry( SvLBoxEntry* pEntry ) if( pEntry == pCursor ) { SvLBoxEntry* pNewCursor = GetNewCursor(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); pCursor = 0; // damit er nicht deselektiert wird SetCursor( pNewCursor ); } - USHORT nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos, 1 ); pImpCursor->Clear(); } @@ -959,7 +959,7 @@ void SvImpIconView::MovingEntry( SvLBoxEntry* pEntry ) void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); if( pModel->GetParent(pEntry)==pCurParent ) { @@ -987,9 +987,9 @@ void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry ) SetCursor( pNextCursor ); } pImpCursor->Clear(); - USHORT nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos, 1 ); - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); // wenn er nochmal in dieser View auftaucht, muss sein // Bounding-Rect neu berechnet werden InvalidateBoundingRect( pViewData->aRect ); @@ -1014,7 +1014,7 @@ void SvImpIconView::CollapsingEntry( SvLBoxEntry* ) { } -void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) +void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) { if( pModel->GetParent(pEntry) != pCurParent ) return; @@ -1034,13 +1034,13 @@ void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect ) if( pView->IsUpdateMode() ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( nFlags & F_RUBBERING ) PaintEntry( pEntry ); else pView->Invalidate( GetBoundingRect( pEntry ) ); if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -1132,7 +1132,7 @@ void SvImpIconView::ResetVirtSize() StopEditTimer(); aVirtOutputSize.Width() = 0; aVirtOutputSize.Height() = 0; - BOOL bLockedEntryFound = FALSE; + sal_Bool bLockedEntryFound = sal_False; nFlags &= (~F_GRID_INSERT); SvLBoxEntry* pCur = pModel->FirstChild( pCurParent ); while( pCur ) @@ -1145,7 +1145,7 @@ void SvImpIconView::ResetVirtSize() FindBoundingRect( pCur, pViewData ); else AdjustVirtSize( pViewData->aRect ); - bLockedEntryFound = TRUE; + bLockedEntryFound = sal_True; } else InvalidateBoundingRect( pViewData->aRect ); @@ -1199,16 +1199,16 @@ void SvImpIconView::Arrange() void SvImpIconView::ImpArrange() { StopEditTimer(); - ShowCursor( FALSE ); + ShowCursor( sal_False ); ResetVirtSize(); - bMustRecalcBoundingRects = FALSE; + bMustRecalcBoundingRects = sal_False; MapMode aMapMode( pView->GetMapMode()); aMapMode.SetOrigin( Point() ); pView->SetMapMode( aMapMode ); CheckAllSizes(); RecalcAllBoundingRectsSmart(); pView->Invalidate(); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } void SvImpIconView::Paint( const Rectangle& rRect ) @@ -1250,14 +1250,14 @@ void SvImpIconView::Paint( const Rectangle& rRect ) if( !pCursor ) pCursor = pModel->FirstChild( pCurParent ); - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); if( !nCount ) return; SvPtrarr* pNewZOrderList = new SvPtrarr; SvPtrarr* pPaintedEntries = new SvPtrarr; - USHORT nPos = 0; + sal_uInt16 nPos = 0; while( nCount ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos )); @@ -1280,7 +1280,7 @@ void SvImpIconView::Paint( const Rectangle& rRect ) nCount = pPaintedEntries->Count(); if( nCount ) { - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) pZOrderList->Insert( pPaintedEntries->GetObject( nCur ),pZOrderList->Count()); } delete pPaintedEntries; @@ -1290,7 +1290,7 @@ void SvImpIconView::Paint( const Rectangle& rRect ) PaintResizeRect( aRect ); } -BOOL SvImpIconView::GetResizeRect( Rectangle& rRect ) +sal_Bool SvImpIconView::GetResizeRect( Rectangle& rRect ) { if( aHorSBar.IsVisible() && aVerSBar.IsVisible() ) { @@ -1301,9 +1301,9 @@ BOOL SvImpIconView::GetResizeRect( Rectangle& rRect ) aOrigin.Y() += aOutputSize.Height(); rRect.SetPos( aOrigin ); rRect.SetSize( Size( nVerSBarWidth, nHorSBarHeight)); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SvImpIconView::PaintResizeRect( const Rectangle& rRect ) @@ -1363,7 +1363,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) { if( !rMEvt.IsMod1() ) // Ctrl { - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); ClearSelectedRectList(); } else @@ -1375,8 +1375,8 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) return; } - BOOL bSelected = pView->IsSelected( pEntry ); - BOOL bEditingEnabled = pView->IsInplaceEditingEnabled(); + sal_Bool bSelected = pView->IsSelected( pEntry ); + sal_Bool bEditingEnabled = pView->IsInplaceEditingEnabled(); if( rMEvt.GetClicks() == 2 ) { @@ -1400,7 +1400,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) { DeselectAllBut( pEntry ); SetCursor( pEntry ); - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); if( bEditingEnabled && bSelected && !rMEvt.GetModifier() && rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) ) { @@ -1415,7 +1415,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) { DeselectAllBut( pEntry ); SetCursor( pEntry ); - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } else { @@ -1450,7 +1450,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt ) nFlags &= ~(F_RUBBERING | F_ADD_MODE); } - SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), TRUE ); + SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), sal_True ); if( pEntry ) { if( nFlags & F_DOWN_CTRL ) @@ -1463,7 +1463,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt ) { DeselectAllBut( pEntry ); SetCursor( pEntry ); - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } } @@ -1499,12 +1499,12 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) long nScrollDX, nScrollDY; - CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,FALSE ); - BOOL bSelRectHidden = FALSE; + CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,sal_False ); + sal_Bool bSelRectHidden = sal_False; if( nScrollDX || nScrollDY ) { HideSelectionRect(); - bSelRectHidden = TRUE; + bSelRectHidden = sal_True; pView->Scroll( nScrollDX, nScrollDY ); } Point aDocPos( rMEvt.GetPosPixel() ); @@ -1513,8 +1513,8 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) if( aRect != aCurSelectionRect ) { HideSelectionRect(); - bSelRectHidden = TRUE; - BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE; + bSelRectHidden = sal_True; + sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False; SelectRect( aRect, bAdd, &aSelectedRectList ); } if( bSelRectHidden ) @@ -1522,32 +1522,32 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) } } -BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) +sal_Bool SvImpIconView::KeyInput( const KeyEvent& rKEvt ) { StopEditTimer(); - BOOL bKeyUsed = TRUE; - BOOL bMod1 = rKEvt.GetKeyCode().IsMod1(); - BOOL bInAddMode = (BOOL)((nFlags & F_ADD_MODE) != 0); + sal_Bool bKeyUsed = sal_True; + sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1(); + sal_Bool bInAddMode = (sal_Bool)((nFlags & F_ADD_MODE) != 0); int bDeselAll = (pView->GetSelectionMode() != SINGLE_SELECTION) && !bInAddMode; SvLBoxEntry* pNewCursor; - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch( nCode ) { case KEY_UP: if( pCursor ) { MakeVisible( pCursor ); - pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE); + pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False); if( pNewCursor ) { if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } else { @@ -1565,17 +1565,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) case KEY_DOWN: if( pCursor ) { - pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE ); + pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True ); if( pNewCursor ) { MakeVisible( pCursor ); if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } } break; @@ -1583,17 +1583,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) case KEY_RIGHT: if( pCursor ) { - pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE ); + pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True ); if( pNewCursor ) { MakeVisible( pCursor ); if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } } break; @@ -1602,16 +1602,16 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { MakeVisible( pCursor ); - pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE ); + pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False ); if( pNewCursor ) { if( bDeselAll ) - pView->SelectAll( FALSE ); - ShowCursor( FALSE ); + pView->SelectAll( sal_False ); + ShowCursor( sal_False ); MakeVisible( pNewCursor ); SetCursor( pNewCursor ); if( !bInAddMode ) - pView->Select( pCursor, TRUE ); + pView->Select( pCursor, sal_True ); } else { @@ -1630,7 +1630,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) if( nFlags & F_RUBBERING ) { HideSelectionRect(); - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); nFlags &= ~F_RUBBERING; } break; @@ -1671,13 +1671,13 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) case KEY_ADD: case KEY_DIVIDE : if( bMod1 ) - pView->SelectAll( TRUE ); + pView->SelectAll( sal_True ); break; case KEY_SUBTRACT: case KEY_COMMA : if( bMod1 ) - pView->SelectAll( FALSE ); + pView->SelectAll( sal_False ); break; case KEY_RETURN: @@ -1689,7 +1689,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt ) break; default: - bKeyUsed = FALSE; + bKeyUsed = sal_False; } return bKeyUsed; @@ -1762,7 +1762,7 @@ void SvImpIconView::AdjustScrollBars() bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false; bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false; - USHORT nResult = 0; + sal_uInt16 nResult = 0; if( nVirtHeight ) { // activate ver scrollbar ? @@ -1902,23 +1902,23 @@ void __EXPORT SvImpIconView::Resize() #endif } -BOOL SvImpIconView::CheckHorScrollBar() +sal_Bool SvImpIconView::CheckHorScrollBar() { if( !pZOrderList || !aHorSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); long nMostRight = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur); long nRight = GetBoundingRect(pEntry).Right(); if( nRight > nWidth ) - return FALSE; + return sal_False; if( nRight > nMostRight ) nMostRight = nRight; } @@ -1935,28 +1935,28 @@ BOOL SvImpIconView::CheckHorScrollBar() aSize.Height() += nHorSBarHeight; aVerSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvImpIconView::CheckVerScrollBar() +sal_Bool SvImpIconView::CheckVerScrollBar() { if( !pZOrderList || !aVerSBar.IsVisible() ) - return FALSE; + return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() ) { long nDeepest = 0; long nHeight = aOutputSize.Height(); - USHORT nCount = pZOrderList->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = pZOrderList->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur); long nBottom = GetBoundingRect(pEntry).Bottom(); if( nBottom > nHeight ) - return FALSE; + return sal_False; if( nBottom > nDeepest ) nDeepest = nBottom; } @@ -1973,9 +1973,9 @@ BOOL SvImpIconView::CheckVerScrollBar() aSize.Width() += nVerSBarWidth; aHorSBar.SetSizePixel( aSize ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -1992,8 +1992,8 @@ void __EXPORT SvImpIconView::GetFocus() { if( pCursor ) { - pView->SetEntryFocus( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->SetEntryFocus( pCursor, sal_True ); + ShowCursor( sal_True ); } } @@ -2001,8 +2001,8 @@ void __EXPORT SvImpIconView::LoseFocus() { StopEditTimer(); if( pCursor ) - pView->SetEntryFocus( pCursor,FALSE ); - ShowCursor( FALSE ); + pView->SetEntryFocus( pCursor,sal_False ); + ShowCursor( sal_False ); } void SvImpIconView::UpdateAll() @@ -2018,8 +2018,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData PaintEntry( pEntry, aPos, pViewData ); } -void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected, - BOOL bCursored, OutputDevice* pOut ) +void SvImpIconView::PaintEmphasis( const Rectangle& rRect, sal_Bool bSelected, + sal_Bool bCursored, OutputDevice* pOut ) { // HACK fuer D&D if( nFlags & F_NO_EMPHASIS ) @@ -2057,7 +2057,7 @@ void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected, } void SvImpIconView::PaintItem( const Rectangle& rRect, - SvLBoxItem* pItem, SvLBoxEntry* pEntry, USHORT nPaintFlags, + SvLBoxItem* pItem, SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut ) { if( nViewMode == VIEWMODE_ICON && pItem->IsA() == SV_ITEM_ID_LBOXSTRING ) @@ -2095,8 +2095,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - BOOL bSelected = pViewData->IsSelected(); - BOOL bCursored = pViewData->IsCursored(); + sal_Bool bSelected = pViewData->IsSelected(); + sal_Bool bCursored = pViewData->IsCursored(); Font aTempFont( pOut->GetFont() ); // waehrend D&D nicht die Fontfarbe wechseln, da sonst auch die @@ -2108,7 +2108,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, aNewFont.SetColor( rStyleSettings.GetHighlightTextColor() ); pOut->SetFont( aNewFont ); } - Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,FALSE,pViewData)); + Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,sal_False,pViewData)); Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos, pViewData ) ); switch( nViewMode ) @@ -2118,7 +2118,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, PaintEmphasis( aBmpRect, bSelected, bCursored, pOut ); PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_HOR_CENTERED | PAINTFLAG_VER_CENTERED, pOut ); - PaintEmphasis( aTextRect, bSelected, FALSE, pOut ); + PaintEmphasis( aTextRect, bSelected, sal_False, pOut ); PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_HOR_CENTERED, pOut ); break; @@ -2126,7 +2126,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); PaintEmphasis( aBmpRect, bSelected, bCursored, pOut ); PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_VER_CENTERED, pOut ); - PaintEmphasis( aTextRect, bSelected, FALSE, pOut ); + PaintEmphasis( aTextRect, bSelected, sal_False, pOut ); PaintItem( aTextRect, pStringItem, pEntry,PAINTFLAG_VER_CENTERED, pOut ); break; @@ -2139,11 +2139,11 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, } void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, - BOOL bAdjustAtGrid, BOOL bCheckScrollBars ) + sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars ) { if( pModel->GetParent(pEntry) == pCurParent ) { - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); Rectangle aBoundRect( GetBoundingRect( pEntry, pViewData )); pView->Invalidate( aBoundRect ); @@ -2169,7 +2169,7 @@ void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, CheckScrollBars(); PaintEntry( pEntry, pViewData ); - ShowCursor( TRUE ); + ShowCursor( sal_True ); } } @@ -2180,7 +2180,7 @@ void SvImpIconView::ViewDataInitialized( SvLBoxEntry*) void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) { if( pEntry == pCursor ) - ShowCursor( FALSE ); + ShowCursor( sal_False ); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); pView->Invalidate( pViewData->aRect ); @@ -2193,7 +2193,7 @@ void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) ViewDataInitialized( (SvLBoxEntry*)pEntry ); pView->Invalidate( pViewData->aRect ); if( pEntry == pCursor ) - ShowCursor( TRUE ); + ShowCursor( sal_True ); } @@ -2215,9 +2215,9 @@ void SvImpIconView::SetSelectionMode( SelectionMode ) { } -BOOL SvImpIconView::IsEntryInView( SvLBoxEntry* ) +sal_Bool SvImpIconView::IsEntryInView( SvLBoxEntry* ) { - return FALSE; + return sal_False; } SvLBoxEntry* SvImpIconView::GetDropTarget( const Point& rPos ) @@ -2235,7 +2235,7 @@ SvLBoxEntry* SvImpIconView::GetEntry( const Point& rDocPos ) CheckBoundingRects(); SvLBoxEntry* pTarget = 0; // Z-Order-Liste vom Ende her absuchen - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); while( nCount ) { nCount--; @@ -2254,11 +2254,11 @@ SvLBoxEntry* SvImpIconView::GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCu { CheckBoundingRects(); SvLBoxEntry* pTarget = 0; - USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != USHRT_MAX ) { - USHORT nCount = pZOrderList->Count(); - for( USHORT nCur = nStartPos+1; nCur < nCount; nCur++ ) + sal_uInt16 nCount = pZOrderList->Count(); + for( sal_uInt16 nCur = nStartPos+1; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCur)); SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); @@ -2276,7 +2276,7 @@ SvLBoxEntry* SvImpIconView::GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCu { CheckBoundingRects(); SvLBoxEntry* pTarget = 0; - USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); + sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); if( nStartPos != USHRT_MAX && nStartPos != 0 ) { nStartPos--; @@ -2356,7 +2356,7 @@ Rectangle SvImpIconView::CalcBmpRect( SvLBoxEntry* pEntry, const Point* pPos, } Rectangle SvImpIconView::CalcTextRect( SvLBoxEntry* pEntry, - SvLBoxString* pItem, const Point* pPos, BOOL bForInplaceEdit, + SvLBoxString* pItem, const Point* pPos, sal_Bool bForInplaceEdit, SvIcnVwDataEntry* pViewData ) { long nBmpHeight, nBmpWidth; @@ -2509,7 +2509,7 @@ void SvImpIconView::RecalcAllBoundingRects() pZOrderList->Insert( pEntry, pZOrderList->Count() ); pEntry = pModel->NextSibling( pEntry ); } - bMustRecalcBoundingRects = FALSE; + bMustRecalcBoundingRects = sal_False; AdjustScrollBars(); } @@ -2588,26 +2588,26 @@ void SvImpIconView::SetCursor( SvLBoxEntry* pEntry ) if( pEntry == pCursor ) return; - ShowCursor( FALSE ); + ShowCursor( sal_False ); if( pCursor ) { - pView->SetEntryFocus( pCursor, FALSE ); + pView->SetEntryFocus( pCursor, sal_False ); if( pView->GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, FALSE ); + pView->Select( pCursor, sal_False ); } pCursor = pEntry; ToTop( pCursor ); if( pCursor ) { - pView->SetEntryFocus(pCursor, TRUE ); + pView->SetEntryFocus(pCursor, sal_True ); if( pView->GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, TRUE ); - ShowCursor( TRUE ); + pView->Select( pCursor, sal_True ); + ShowCursor( sal_True ); } } -void SvImpIconView::ShowCursor( BOOL bShow ) +void SvImpIconView::ShowCursor( sal_Bool bShow ) { if( !pCursor || !bShow || !pView->HasFocus() ) { @@ -2646,7 +2646,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) DELETEZ(pDDDev); DELETEZ(pDDBufDev); } - BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE ); + sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False ); if( !pDDDev ) { if( pDDBufDev ) @@ -2684,7 +2684,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) PaintEntry( pRefEntry, aPos ); nFlags &= ~F_NO_EMPHASIS; if( bSelected ) - pView->SvListView::Select( pRefEntry, TRUE ); + pView->SvListView::Select( pRefEntry, sal_True ); } void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) @@ -2775,12 +2775,12 @@ void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix pDDDev->GetOutputSizePixel(), *pDDTempDev ); - BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE ); + sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False ); if( bSelected ) - pView->SvListView::Select( pRefEntry, TRUE ); + pView->SvListView::Select( pRefEntry, sal_True ); } -void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL ) +void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool ) { CheckBoundingRects(); Rectangle aRect; @@ -2800,8 +2800,8 @@ void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL ) ImpDrawXORRect( aRect ); } -BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewPar, ULONG& rNewChildPos ) +sal_Bool SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewPar, sal_uIntPtr& rNewChildPos ) { if( pTarget == pCurParent && pModel->GetParent(pEntry) == pCurParent ) { @@ -2811,14 +2811,14 @@ BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, Size aSize( pViewData->aRect.GetSize() ); Point aNewPos = FindNextEntryPos( aSize ); AdjustVirtSize( Rectangle( aNewPos, aSize ) ); - SetEntryPosition( pEntry, aNewPos, FALSE, TRUE ); - return FALSE; + SetEntryPosition( pEntry, aNewPos, sal_False, sal_True ); + return sal_False; } return pView->SvLBox::NotifyMoving(pTarget,pEntry,rpNewPar,rNewChildPos); } -BOOL SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +sal_Bool SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uIntPtr& rNewChildPos ) { return pView->SvLBox::NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos); } @@ -2855,9 +2855,9 @@ void SvImpIconView::PrepareCommandEvent( const Point& rPt ) aMouseMoveTimer.Stop(); StopEditTimer(); nFlags |= F_CMD_ARRIVED; - SvLBoxEntry* pEntry = pView->GetEntry( rPt, TRUE ); + SvLBoxEntry* pEntry = pView->GetEntry( rPt, sal_True ); if( (nFlags & F_DOWN_CTRL) && pEntry && !pView->IsSelected(pEntry) ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); } @@ -2866,12 +2866,12 @@ void SvImpIconView::SttDrag( const Point& rPos ) PrepareCommandEvent( rPos ); nFlags |= F_DRAG_SOURCE; - ShowCursor( FALSE ); + ShowCursor( sal_False ); } void SvImpIconView::EndDrag() { - ShowCursor( TRUE ); + ShowCursor( sal_True ); nFlags &= (~F_DRAG_SOURCE); } @@ -2880,7 +2880,7 @@ void SvImpIconView::ToTop( SvLBoxEntry* pEntry ) DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"ToTop:ZOrder?"); if( pZOrderList->GetObject( pZOrderList->Count() -1 ) != pEntry ) { - USHORT nPos = pZOrderList->GetPos( (void*)pEntry ); + sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos, 1 ); pZOrderList->Insert( pEntry, pZOrderList->Count() ); } @@ -2907,9 +2907,9 @@ void SvImpIconView::ClipAtVirtOutRect( Rectangle& rRect ) const // rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der // sichtbar gemacht werden soll. -// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet +// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet -void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar ) +void SvImpIconView::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar ) { Rectangle aRect( rRect ); ClipAtVirtOutRect( aRect ); @@ -2963,7 +2963,7 @@ void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar ) pView->SetMapMode( aMapMode ); // in umgekehrte Richtung scrollen! - pView->Control::Scroll( -nDx, -nDy, aOutputArea, TRUE ); + pView->Control::Scroll( -nDx, -nDy, aOutputArea, sal_True ); if( aHorSBar.IsVisible() || aVerSBar.IsVisible() ) { if( !bScrBar ) @@ -2987,15 +2987,15 @@ SvLBoxEntry* SvImpIconView::GetNewCursor() SvLBoxEntry* pNewCursor; if( pCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE ); + pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True ); if( !pNewCursor ) { - pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False ); if( !pNewCursor ) - pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE ); + pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True ); } } } @@ -3006,9 +3006,9 @@ SvLBoxEntry* SvImpIconView::GetNewCursor() } -USHORT SvImpIconView:: GetSelectionCount() const +sal_uInt16 SvImpIconView:: GetSelectionCount() const { - USHORT nSelected = 0; + sal_uInt16 nSelected = 0; SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent); while( pEntry ) { @@ -3022,11 +3022,11 @@ USHORT SvImpIconView:: GetSelectionCount() const void SvImpIconView::ToggleSelection( SvLBoxEntry* pEntry ) { - BOOL bSel; + sal_Bool bSel; if( pView->IsSelected( pEntry ) ) - bSel = FALSE; + bSel = sal_False; else - bSel = TRUE; + bSel = sal_True; pView->Select( pEntry, bSel ); } @@ -3037,7 +3037,7 @@ void SvImpIconView::DeselectAllBut( SvLBoxEntry* pThisEntryNot ) while( pEntry ) { if( pEntry != pThisEntryNot && pView->IsSelected( pEntry )) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); pEntry = pModel->NextSibling( pEntry ); } } @@ -3067,14 +3067,14 @@ ImpIcnCursor::~ImpIcnCursor() delete pGridMap; } -USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, +sal_uInt16 ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, int bVertical ) { - USHORT nCount = (USHORT)pList->Count(); + sal_uInt16 nCount = (sal_uInt16)pList->Count(); if( !nCount ) return 0; - USHORT nCurPos = 0; + sal_uInt16 nCurPos = 0; long nPrevValue = LONG_MIN; while( nCount ) { @@ -3086,7 +3086,7 @@ USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, else nCurValue = rRect.Left(); if( nValue >= nPrevValue && nValue <= nCurValue ) - return (USHORT)nCurPos; + return (sal_uInt16)nCurPos; nPrevValue = nCurValue; nCount--; nCurPos++; @@ -3122,10 +3122,10 @@ void ImpIcnCursor::ImplCreate() if( nX >= nCols ) nX = sal::static_int_cast< short >(nCols - 1); - USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE ); + sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True ); pColumns[ nX ].Insert( pEntry, nIns ); - nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE ); + nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False ); pRows[ nY ].Insert( pEntry, nIns ); pViewData->nX = nX; @@ -3169,7 +3169,7 @@ void ImpIcnCursor::CreateGridMap() //XXX //nGridRows += 50; // in fuenfziger-Schritten - pGridMap = new BOOL[ nGridRows*nGridCols]; + pGridMap = new sal_Bool[ nGridRows*nGridCols]; memset( (void*)pGridMap, 0, nGridRows*nGridCols ); SvLBoxTreeList* pModel = pView->pModel; @@ -3188,49 +3188,49 @@ void ImpIcnCursor::CreateGridMap() } } -BOOL ImpIcnCursor::GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const +sal_Bool ImpIcnCursor::GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const { Point aPos( rDocPos ); aPos.X() -= LROFFS_WINBORDER; aPos.Y() -= TBOFFS_WINBORDER; - rGridX = (USHORT)(aPos.X() / nGridDX); - rGridY = (USHORT)(aPos.Y() / nGridDY); - BOOL bInGrid = TRUE; + rGridX = (sal_uInt16)(aPos.X() / nGridDX); + rGridY = (sal_uInt16)(aPos.Y() / nGridDY); + sal_Bool bInGrid = sal_True; if( rGridX >= nGridCols ) { - rGridX = sal::static_int_cast< USHORT >(nGridCols - 1); - bInGrid = FALSE; + rGridX = sal::static_int_cast< sal_uInt16 >(nGridCols - 1); + bInGrid = sal_False; } if( rGridY >= nGridRows ) { - rGridY = sal::static_int_cast< USHORT >(nGridRows - 1); + rGridY = sal::static_int_cast< sal_uInt16 >(nGridRows - 1); if( !bInGrid ) - return FALSE; // beide Koordinaten nicht im Grid + return sal_False; // beide Koordinaten nicht im Grid } - return TRUE; + return sal_True; } -void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, BOOL bUsed ) +void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, sal_Bool bUsed ) { CreateGridMap(); - USHORT nTLX, nTLY, nBRX, nBRY; + sal_uInt16 nTLX, nTLY, nBRX, nBRY; - BOOL bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY ); - BOOL bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY ); + sal_Bool bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY ); + sal_Bool bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY ); if( !bTLInGrid && !bBRInGrid ) return; - for( USHORT nCurY = nTLY; nCurY <= nBRY; nCurY++ ) + for( sal_uInt16 nCurY = nTLY; nCurY <= nBRY; nCurY++ ) { - for( USHORT nCurX = nTLX; nCurX <= nBRX; nCurX++ ) + for( sal_uInt16 nCurX = nTLX; nCurX <= nBRX; nCurX++ ) { SetGridUsed( nCurX, nCurY, bUsed ); } } } -void ImpIcnCursor::Clear( BOOL bGridToo ) +void ImpIcnCursor::Clear( sal_Bool bGridToo ) { if( pColumns ) { @@ -3250,12 +3250,12 @@ void ImpIcnCursor::Clear( BOOL bGridToo ) } } -SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, - USHORT, BOOL bDown, BOOL bSimple ) +SvLBoxEntry* ImpIcnCursor::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom, + sal_uInt16, sal_Bool bDown, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchCol: No reference entry"); SvPtrarr* pList = &(pColumns[ nCol ]); - USHORT nCount = pList->Count(); + sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -3263,7 +3263,7 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List"); if( bDown ) { @@ -3296,19 +3296,19 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, if( nTop > nBottom ) { - USHORT nTemp = nTop; + sal_uInt16 nTemp = nTop; nTop = nBottom; nBottom = nTemp; } long nMinDistance = LONG_MAX; SvLBoxEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - USHORT nY = pViewData->nY; + sal_uInt16 nY = pViewData->nY; if( nY >= nTop && nY <= nBottom ) { const Rectangle& rRect = pView->GetBoundingRect( pEntry ); @@ -3326,12 +3326,12 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom, return pResult; } -SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, - USHORT, BOOL bRight, BOOL bSimple ) +SvLBoxEntry* ImpIcnCursor::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight, + sal_uInt16, sal_Bool bRight, sal_Bool bSimple ) { DBG_ASSERT(pCurEntry,"SearchRow: No reference entry"); SvPtrarr* pList = &(pRows[ nRow ]); - USHORT nCount = pList->Count(); + sal_uInt16 nCount = pList->Count(); if( !nCount ) return 0; @@ -3339,7 +3339,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, if( bSimple ) { - USHORT nListPos = pList->GetPos( pCurEntry ); + sal_uInt16 nListPos = pList->GetPos( pCurEntry ); DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List"); if( bRight ) { @@ -3372,19 +3372,19 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, } if( nRight < nLeft ) { - USHORT nTemp = nRight; + sal_uInt16 nTemp = nRight; nRight = nLeft; nLeft = nTemp; } long nMinDistance = LONG_MAX; SvLBoxEntry* pResult = 0; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur )); if( pEntry != pCurEntry ) { SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - USHORT nX = pViewData->nX; + sal_uInt16 nX = pViewData->nX; if( nX >= nLeft && nX <= nRight ) { const Rectangle& rRect = pView->GetBoundingRect( pEntry ); @@ -3406,7 +3406,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, /* Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw. - linksstehenden. Suchverfahren am Beispiel bRight = TRUE: + linksstehenden. Suchverfahren am Beispiel bRight = sal_True: c b c @@ -3421,22 +3421,22 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight, a,b,c : 2., 3., 4. Suchrechteck */ -SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight ) +SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, sal_Bool bRight ) { SvLBoxEntry* pResult; pCurEntry = pIcnEntry; Create(); SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry); - USHORT nY = pViewData->nY; - USHORT nX = pViewData->nX; + sal_uInt16 nY = pViewData->nY; + sal_uInt16 nX = pViewData->nX; DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column"); DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row"); // Nachbar auf gleicher Zeile ? if( bRight ) pResult = SearchRow( - nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE ); + nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True ); else - pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE ); + pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True ); if( pResult ) return pResult; @@ -3454,11 +3454,11 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight ) nLastCol = -1; // 0-1 } - USHORT nRowMin = nY; - USHORT nRowMax = nY; + sal_uInt16 nRowMin = nY; + sal_uInt16 nRowMax = nY; do { - SvLBoxEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE); + SvLBoxEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False); if( pEntry ) return pEntry; if( nRowMin ) @@ -3470,23 +3470,23 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight ) return 0; } -SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown) +SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, sal_Bool bDown) { SvLBoxEntry* pResult; pCurEntry = pIcnEntry; Create(); SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry); - USHORT nY = pViewData->nY; - USHORT nX = pViewData->nX; + sal_uInt16 nY = pViewData->nY; + sal_uInt16 nX = pViewData->nX; DBG_ASSERT(nY<nRows,"GoUpDown:Bad column"); DBG_ASSERT(nX<nCols,"GoUpDown:Bad row"); // Nachbar in gleicher Spalte ? if( bDown ) pResult = SearchCol( - nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE ); + nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True ); else - pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE ); + pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True ); if( pResult ) return pResult; @@ -3504,11 +3504,11 @@ SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown) nLastRow = -1; // 0-1 } - USHORT nColMin = nX; - USHORT nColMax = nX; + sal_uInt16 nColMin = nX; + sal_uInt16 nColMax = nX; do { - SvLBoxEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE); + SvLBoxEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False); if( pEntry ) return pEntry; if( nColMin ) @@ -3570,29 +3570,29 @@ void ImpIcnCursor::ExpandGrid() } } -BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) +sal_Bool ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) { CreateGridMap(); - USHORT nCount = (USHORT)(nGridCols * nGridRows); + sal_uInt16 nCount = (sal_uInt16)(nGridCols * nGridRows); if( !nCount ) - return FALSE; - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + return sal_False; + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { if( !pGridMap[ nCur ] ) { - USHORT nCol = (USHORT)(nCur % nGridCols); - USHORT nRow = (USHORT)(nCur / nGridCols); + sal_uInt16 nCol = (sal_uInt16)(nCur % nGridCols); + sal_uInt16 nRow = (sal_uInt16)(nCur / nGridCols); rRect.Top() = nRow * nGridDY + TBOFFS_WINBORDER; rRect.Bottom() = rRect.Top() + nGridDY; rRect.Left() = nCol * nGridDX+ LROFFS_WINBORDER; rRect.Right() = rRect.Left() + nGridDX; - SetGridUsed( nCol, nRow, TRUE ); + SetGridUsed( nCol, nRow, sal_True ); //XXX //if( nRow + 5 > nGridRows ) // ExpandGrid(); DBG_ASSERT(pGridMap[nCur],"SetGridUsed failed"); - return TRUE; + return sal_True; } } // Gridmap ist voll: Um eine Zeile erweitern @@ -3600,22 +3600,22 @@ BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) rRect.Bottom() = rRect.Top() + nGridDY; rRect.Left() = LROFFS_WINBORDER; rRect.Right() = rRect.Left() + nGridDX; - return FALSE; + return sal_False; //XXX //ExpandGrid(); - //return TRUE; + //return sal_True; } void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry) { if( !pRefEntry ) { - USHORT nAdjustRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY); + sal_uInt16 nAdjustRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY); nAdjustRows++; // wg. Abrundung! if( !nAdjustRows ) return; - for( USHORT nCurList = 0; nCurList < nAdjustRows; nCurList++ ) + for( sal_uInt16 nCurList = 0; nCurList < nAdjustRows; nCurList++ ) { SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, nCurList ); @@ -3625,7 +3625,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry { const Rectangle& rRect = pView->GetBoundingRect( pEntry ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); - USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE); + sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False); ((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns ); pEntry = pView->pModel->NextSibling( pEntry ); } @@ -3649,7 +3649,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); if( nY == nRefRow ) { - USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE ); + sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False ); pRow->Insert( pEntry, nIns ); } pEntry = pView->pModel->NextSibling( pEntry ); @@ -3660,8 +3660,8 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry //static void ImpIcnCursor::DestroyGridAdjustData( SvPtrarr& rLists ) { - USHORT nCount = rLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = rLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ]; delete pArr; @@ -3718,7 +3718,7 @@ void SvImpIconView::Center( SvLBoxEntry* pEntry, // Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird // links, hoch: Offsets < 0 // rechts, runter: Offsets > 0 -void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar ) +void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar ) { const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); @@ -3756,7 +3756,7 @@ Rectangle SvImpIconView::CalcFocusRect( SvLBoxEntry* pEntry ) } -void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, +void SvImpIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pOtherRects, short nBorderOffs ) { if( !pZOrderList || !pZOrderList->Count() ) @@ -3764,7 +3764,7 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, CheckBoundingRects(); pView->Update(); - USHORT nCount = pZOrderList->Count(); + sal_uInt16 nCount = pZOrderList->Count(); Rectangle aRect( rRect ); aRect.Justify(); @@ -3775,9 +3775,9 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, aRect.Top() -= nBorderOffs; aRect.Bottom() += nBorderOffs; } - BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE; + sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False; - for( USHORT nPos = 0; nPos < nCount; nPos++ ) + for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ ) { SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos )); @@ -3786,28 +3786,28 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, if( !IsBoundingRectValid( pViewData->aRect )) FindBoundingRect( pEntry, pViewData ); const Rectangle& rBoundRect = pViewData->aRect; - BOOL bSelected = pViewData->IsSelected(); + sal_Bool bSelected = pViewData->IsSelected(); - BOOL bOverlaps; + sal_Bool bOverlaps; if( bCalcOverlap ) bOverlaps = IsOver( pOtherRects, rBoundRect ); else - bOverlaps = FALSE; - BOOL bOver = aRect.IsOver( rBoundRect ); + bOverlaps = sal_False; + sal_Bool bOver = aRect.IsOver( rBoundRect ); if( bOver && !bOverlaps ) { // Ist im neuen Selektionsrechteck und in keinem alten // => selektieren if( !bSelected ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } else if( !bAdd ) { // ist ausserhalb des Selektionsrechtecks // => Selektion entfernen if( bSelected ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); } else if( bAdd && bOverlaps ) { @@ -3827,34 +3827,34 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd, { // Schnittmenge zwischen alten Rects & aktuellem Rect desel. if( bSelected ) - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); } else { // Eintrag eines alten Rects selektieren if( !bSelected ) - pView->Select( pEntry, TRUE ); + pView->Select( pEntry, sal_True ); } } else if( !bOver && bSelected ) { // Der Eintrag liegt voellig ausserhalb und wird deshalb desel. - pView->Select( pEntry, FALSE ); + pView->Select( pEntry, sal_False ); } } pView->Update(); } -BOOL SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const +sal_Bool SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const { - USHORT nCount = pRectList->Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = pRectList->Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur ); if( rBoundRect.IsOver( *pRect )) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs ) @@ -3873,8 +3873,8 @@ void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs ) void SvImpIconView::ClearSelectedRectList() { - USHORT nCount = aSelectedRectList.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = aSelectedRectList.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur ); delete pRect; @@ -3912,7 +3912,7 @@ void SvImpIconView::ImpDrawXORRect( const Rectangle& rRect ) } void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel, - long& rX, long& rY, BOOL bInDragDrop, USHORT nBorderWidth) + long& rX, long& rY, sal_Bool bInDragDrop, sal_uInt16 nBorderWidth) { // Scrolling der View, falls sich der Mauszeiger im Grenzbereich des // Fensters befindet @@ -3920,8 +3920,8 @@ void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel, long nPixelToScrollY = 0; Size aWndSize = aOutputSize; - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); - nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); + nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); if ( rPosPixel.X() < nBorderWidth ) { @@ -3973,16 +3973,16 @@ void SvImpIconView::EndTracking() } } -BOOL SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ) +sal_Bool SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ) { SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); if( pItem ) { Rectangle aRect( CalcTextRect( pEntry, pItem )); if( aRect.IsInside( rDocPos ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } IMPL_LINK(SvImpIconView, EditTimeoutHdl, Timer*, EMPTYARG ) @@ -4007,8 +4007,8 @@ void SvImpIconView::AdjustAtGrid( SvLBoxEntry* pStart ) { SvPtrarr aLists; pImpCursor->CreateGridAjustData( aLists, pStart ); - USHORT nCount = aLists.Count(); - for( USHORT nCur = 0; nCur < nCount; nCur++ ) + sal_uInt16 nCount = aLists.Count(); + for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart ); } @@ -4022,18 +4022,18 @@ void SvImpIconView::AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart ) if( !rRow.Count() ) return; - BOOL bGo; + sal_Bool bGo; if( !pStart ) - bGo = TRUE; + bGo = sal_True; else - bGo = FALSE; + bGo = sal_False; long nCurRight = 0; - for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ ) + for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ ) { SvLBoxEntry* pCur = (SvLBoxEntry*)rRow[ nCur ]; if( !bGo && pCur == pStart ) - bGo = TRUE; + bGo = sal_True; SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); // Massgebend (fuer das menschliche Auge) ist die Bitmap, da sonst diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 82321b53259e..61a87bc51cc4 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -44,20 +44,20 @@ struct SvLBoxButtonData_Impl { SvLBoxEntry* pEntry; - BOOL bDefaultImages; - BOOL bShowRadioButton; + sal_Bool bDefaultImages; + sal_Bool bShowRadioButton; - SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( FALSE ), bShowRadioButton( FALSE ) {} + SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( sal_False ), bShowRadioButton( sal_False ) {} }; DBG_NAME(SvLBoxButtonData) -void SvLBoxButtonData::InitData( BOOL bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl ) +void SvLBoxButtonData::InitData( sal_Bool bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl ) { pImpl = new SvLBoxButtonData_Impl; - bDataOk = FALSE; + bDataOk = sal_False; eState = SV_BUTTON_UNCHECKED; pImpl->bDefaultImages = bImagesFromDefault; pImpl->bShowRadioButton = ( _bRadioBtn != false ); @@ -70,21 +70,21 @@ SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings ) { DBG_CTOR(SvLBoxButtonData,0); - InitData( TRUE, false, pControlForSettings ); + InitData( sal_True, false, pControlForSettings ); } SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn ) { DBG_CTOR(SvLBoxButtonData,0); - InitData( TRUE, _bRadioBtn, pControlForSettings ); + InitData( sal_True, _bRadioBtn, pControlForSettings ); } SvLBoxButtonData::SvLBoxButtonData() { DBG_CTOR(SvLBoxButtonData,0); - InitData( FALSE, false ); + InitData( sal_False, false ); } SvLBoxButtonData::~SvLBoxButtonData() @@ -103,11 +103,11 @@ void SvLBoxButtonData::CallLink() aLink.Call( this ); } -USHORT SvLBoxButtonData::GetIndex( USHORT nItemState ) +sal_uInt16 SvLBoxButtonData::GetIndex( sal_uInt16 nItemState ) { DBG_CHKTHIS(SvLBoxButtonData,0); nItemState &= 0x000F; - USHORT nIdx; + sal_uInt16 nIdx; switch( nItemState ) { case SV_ITEMSTATE_UNCHECKED: @@ -134,18 +134,18 @@ void SvLBoxButtonData::SetWidthAndHeight() Size aSize = aBmps[0].GetSizePixel(); nWidth = aSize.Width(); nHeight = aSize.Height(); - bDataOk = TRUE; + bDataOk = sal_True; } -void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, USHORT nItemFlags ) +void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, sal_uInt16 nItemFlags ) { DBG_CHKTHIS(SvLBoxButtonData,0); pImpl->pEntry = pActEntry; eState = ConvertToButtonState( nItemFlags ); } -SvButtonState SvLBoxButtonData::ConvertToButtonState( USHORT nItemFlags ) const +SvButtonState SvLBoxButtonData::ConvertToButtonState( sal_uInt16 nItemFlags ) const { DBG_CHKTHIS(SvLBoxButtonData,0); nItemFlags &= (SV_ITEMSTATE_UNCHECKED | @@ -196,12 +196,12 @@ void SvLBoxButtonData::SetDefaultImages( const Control* pCtrl ) } } -BOOL SvLBoxButtonData::HasDefaultImages( void ) const +sal_Bool SvLBoxButtonData::HasDefaultImages( void ) const { return pImpl->bDefaultImages; } -BOOL SvLBoxButtonData::IsRadio() { +sal_Bool SvLBoxButtonData::IsRadio() { return pImpl->bShowRadioButton; } @@ -211,7 +211,7 @@ BOOL SvLBoxButtonData::IsRadio() { DBG_NAME(SvLBoxString); -SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,USHORT nFlags,const XubString& rStr) : +SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,sal_uInt16 nFlags,const XubString& rStr) : SvLBoxItem( pEntry, nFlags ) { DBG_CTOR(SvLBoxString,0); @@ -228,19 +228,19 @@ SvLBoxString::~SvLBoxString() DBG_DTOR(SvLBoxString,0); } -USHORT SvLBoxString::IsA() +sal_uInt16 SvLBoxString::IsA() { DBG_CHKTHIS(SvLBoxString,0); return SV_ITEM_ID_LBOXSTRING; } -void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, +void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry) { DBG_CHKTHIS(SvLBoxString,0); if ( _pEntry ) { - USHORT nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE; + sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE; if ( rDev.IsEntryMnemonicsEnabled() ) nStyle |= TEXT_DRAW_MNEMONIC; rDev.DrawText( Rectangle(rPos,GetSize(&rDev,_pEntry)),aStr,nStyle); @@ -283,7 +283,7 @@ void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, DBG_NAME(SvLBoxBmp); -SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, USHORT nFlags, Image aBitmap ) : +SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image aBitmap ) : SvLBoxItem( pEntry, nFlags ) { DBG_CTOR(SvLBoxBmp,0); @@ -300,7 +300,7 @@ SvLBoxBmp::~SvLBoxBmp() DBG_DTOR(SvLBoxBmp,0); } -USHORT SvLBoxBmp::IsA() +sal_uInt16 SvLBoxBmp::IsA() { DBG_CHKTHIS(SvLBoxBmp,0); return SV_ITEM_ID_LBOXBMP; @@ -321,11 +321,11 @@ void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, pViewData->aSize = aBmp.GetSizePixel(); } -void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, +void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* ) { DBG_CHKTHIS(SvLBoxBmp,0); - USHORT nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; + sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; rDev.DrawImage( rPos, aBmp ,nStyle); } @@ -348,7 +348,7 @@ void SvLBoxBmp::Clone( SvLBoxItem* pSource ) DBG_NAME(SvLBoxButton); SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry, SvLBoxButtonKind eTheKind, - USHORT nFlags, SvLBoxButtonData* pBData ) + sal_uInt16 nFlags, SvLBoxButtonData* pBData ) : SvLBoxItem( pEntry, nFlags ) { DBG_CTOR(SvLBoxButton,0); @@ -372,13 +372,13 @@ SvLBoxButton::~SvLBoxButton() DBG_DTOR(SvLBoxButton,0); } -USHORT SvLBoxButton::IsA() +sal_uInt16 SvLBoxButton::IsA() { DBG_CHKTHIS(SvLBoxButton,0); return SV_ITEM_ID_LBOXBUTTON; } -void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn) +void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, sal_Bool bOn) { DBG_CHKTHIS(SvLBoxButton,0); if ( bOn != IsStateChecked() ) @@ -390,7 +390,7 @@ void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn) } } -BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) +sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) { DBG_CHKTHIS(SvLBoxButton,0); if ( CheckModification() ) @@ -402,22 +402,22 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) pData->StoreButtonState( pEntry, nItemFlags ); pData->CallLink(); } - return FALSE; + return sal_False; } -void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, +void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* ) { DBG_CHKTHIS(SvLBoxButton,0); - USHORT nIndex = eKind == SvLBoxButtonKind_staticImage + sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage ? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags ); - USHORT nStyle = eKind != SvLBoxButtonKind_disabledCheckbox && + sal_uInt16 nStyle = eKind != SvLBoxButtonKind_disabledCheckbox && rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; /// //Native drawing /// - BOOL bNativeOK = FALSE; + sal_Bool bNativeOK = sal_False; Window *pWin = NULL; if( rDev.GetOutDevType() == OUTDEV_WINDOW ) pWin = (Window*) &rDev; @@ -487,14 +487,14 @@ struct SvLBoxContextBmp_Impl Image m_aImage1_hc; Image m_aImage2_hc; - USHORT m_nB2IndicatorFlags; + sal_uInt16 m_nB2IndicatorFlags; }; // *************************************************************** DBG_NAME(SvLBoxContextBmp) -SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, USHORT nItemFlags, - Image aBmp1, Image aBmp2, USHORT nEntryFlags ) +SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, sal_uInt16 nItemFlags, + Image aBmp1, Image aBmp2, sal_uInt16 nEntryFlags ) :SvLBoxItem( pEntry, nItemFlags ) ,m_pImpl( new SvLBoxContextBmp_Impl ) { @@ -518,13 +518,13 @@ SvLBoxContextBmp::~SvLBoxContextBmp() DBG_DTOR(SvLBoxContextBmp,0); } -USHORT SvLBoxContextBmp::IsA() +sal_uInt16 SvLBoxContextBmp::IsA() { DBG_CHKTHIS(SvLBoxContextBmp,0); return SV_ITEM_ID_LBOXCONTEXTBMP; } -BOOL SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode ) +sal_Bool SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode ) { DBG_CHKTHIS(SvLBoxContextBmp,0); @@ -579,7 +579,7 @@ void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, } void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev, - USHORT _nViewDataEntryFlags, SvLBoxEntry* _pEntry ) + sal_uInt16 _nViewDataEntryFlags, SvLBoxEntry* _pEntry ) { DBG_CHKTHIS(SvLBoxContextBmp,0); @@ -596,7 +596,7 @@ void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev, sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT & _pEntry->GetFlags( ) ) ); // draw - USHORT nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; + sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE; if ( _bSemiTransparent ) nStyle |= IMAGE_DRAW_SEMITRANSPARENT; _rDev.DrawImage( _rPos, rImage, nStyle); diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index fb71f64772ad..ca3cc91a1ec9 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -31,7 +31,7 @@ /* Todo: - Anker loeschen in SelectionEngine bei manuellem Selektieren - - SelectAll( FALSE ), nur die deselektierten Entries repainten + - SelectAll( sal_False ), nur die deselektierten Entries repainten */ #include <string.h> @@ -77,14 +77,14 @@ SvInplaceEdit::SvInplaceEdit Edit( pParent, WB_LEFT ), aCallBackHdl ( rNotifyEditEnd ), - bCanceled ( FALSE ), - bAlreadyInCallBack ( FALSE ) + bCanceled ( sal_False ), + bAlreadyInCallBack ( sal_False ) { DBG_CTOR(SvInplaceEdit,0); Font aFont( pParent->GetFont() ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aColor( pParent->GetBackground().GetColor() ); aFont.SetFillColor(aColor ); SetFont( aFont ); @@ -120,7 +120,7 @@ SvInplaceEdit::~SvInplaceEdit() IMPL_LINK_INLINE_START( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit,0); - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); return 1; } @@ -129,7 +129,7 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG ) IMPL_LINK_INLINE_START( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit,0); - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); return 1; } @@ -138,16 +138,16 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG ) void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt ) { DBG_CHKTHIS(SvInplaceEdit,0); - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch ( nCode ) { case KEY_ESCAPE: - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); break; case KEY_RETURN: - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); break; @@ -156,7 +156,7 @@ void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt ) } } -void SvInplaceEdit::StopEditing( BOOL bCancel ) +void SvInplaceEdit::StopEditing( sal_Bool bCancel ) { DBG_CHKTHIS(SvInplaceEdit,0); if ( !bAlreadyInCallBack ) @@ -171,7 +171,7 @@ void SvInplaceEdit::LoseFocus() DBG_CHKTHIS(SvInplaceEdit,0); if ( !bAlreadyInCallBack ) { - bCanceled = FALSE; + bCanceled = sal_False; aTimer.SetTimeout(10); aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit,Timeout_Impl)); aTimer.Start(); @@ -192,12 +192,12 @@ void SvInplaceEdit::CallCallBackHdl_Impl() aTimer.Stop(); if ( !bAlreadyInCallBack ) { - bAlreadyInCallBack = TRUE; + bAlreadyInCallBack = sal_True; GetpApp()->RemoveAccel( &aAccReturn ); GetpApp()->RemoveAccel( &aAccEscape ); Hide(); aCallBackHdl.Call( this ); - // bAlreadyInCallBack = FALSE; + // bAlreadyInCallBack = sal_False; } } @@ -268,12 +268,12 @@ SvInplaceEdit2::SvInplaceEdit2 const String& rData, const Link& rNotifyEditEnd, const Selection& rSelection, - BOOL bMulti + sal_Bool bMulti ) : aCallBackHdl ( rNotifyEditEnd ), - bCanceled ( FALSE ), - bAlreadyInCallBack ( FALSE ), + bCanceled ( sal_False ), + bAlreadyInCallBack ( sal_False ), bMultiLine ( bMulti ) { @@ -285,7 +285,7 @@ SvInplaceEdit2::SvInplaceEdit2 pEdit = new MyEdit_Impl( pParent, this ); Font aFont( pParent->GetFont() ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aColor( pParent->GetBackground().GetColor() ); aFont.SetFillColor(aColor ); pEdit->SetFont( aFont ); @@ -333,7 +333,7 @@ void SvInplaceEdit2::Hide() IMPL_LINK_INLINE_START( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit2,0); - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); return 1; } @@ -342,35 +342,35 @@ IMPL_LINK_INLINE_END( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG ) IMPL_LINK_INLINE_START( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG ) { DBG_CHKTHIS(SvInplaceEdit2,0); - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); return 1; } IMPL_LINK_INLINE_END( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG ) -BOOL SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt ) +sal_Bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt ) { DBG_CHKTHIS(SvInplaceEdit2,0); KeyCode aCode = rKEvt.GetKeyCode(); - USHORT nCode = aCode.GetCode(); + sal_uInt16 nCode = aCode.GetCode(); switch ( nCode ) { case KEY_ESCAPE: - bCanceled = TRUE; + bCanceled = sal_True; CallCallBackHdl_Impl(); - return TRUE; + return sal_True; case KEY_RETURN: - bCanceled = FALSE; + bCanceled = sal_False; CallCallBackHdl_Impl(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -void SvInplaceEdit2::StopEditing( BOOL bCancel ) +void SvInplaceEdit2::StopEditing( sal_Bool bCancel ) { DBG_CHKTHIS(SvInplaceEdit2,0); if ( !bAlreadyInCallBack ) @@ -387,7 +387,7 @@ void SvInplaceEdit2::LoseFocus() && ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) ) ) { - bCanceled = FALSE; + bCanceled = sal_False; aTimer.SetTimeout(10); aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl)); aTimer.Start(); @@ -408,7 +408,7 @@ void SvInplaceEdit2::CallCallBackHdl_Impl() aTimer.Stop(); if ( !bAlreadyInCallBack ) { - bAlreadyInCallBack = TRUE; + bAlreadyInCallBack = sal_True; GetpApp()->RemoveAccel( &aAccReturn ); GetpApp()->RemoveAccel( &aAccEscape ); pEdit->Hide(); @@ -435,7 +435,7 @@ SvLBoxTab::SvLBoxTab() nFlags = 0; } -SvLBoxTab::SvLBoxTab( long nPosition, USHORT nTabFlags ) +SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags ) { DBG_CTOR(SvLBoxTab,0); nPos = nPosition; @@ -494,7 +494,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev ) long nWidth; if ( nFlags & SV_LBOXTAB_ADJUST_NUMERIC ) { - USHORT nPos = rStr.Search( '.' ); + sal_uInt16 nPos = rStr.Search( '.' ); if ( nPos == STRING_NOTFOUND ) nPos = rStr.Search( ',' ); if ( nPos == STRING_NOTFOUND ) @@ -518,7 +518,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev ) DBG_NAME(SvLBoxItem); -SvLBoxItem::SvLBoxItem( SvLBoxEntry*, USHORT ) +SvLBoxItem::SvLBoxItem( SvLBoxEntry*, sal_uInt16 ) { DBG_CTOR(SvLBoxItem,0); } @@ -543,7 +543,7 @@ const Size& SvLBoxItem::GetSize( SvLBox* pView,SvLBoxEntry* pEntry ) const Size& SvLBoxItem::GetSize( SvLBoxEntry* pEntry, SvViewDataEntry* pViewData) { DBG_CHKTHIS(SvLBoxItem,0); - USHORT nItemPos = pEntry->GetPos( this ); + sal_uInt16 nItemPos = pEntry->GetPos( this ); SvViewDataItem* pItemData = pViewData->pItemData+nItemPos; return pItemData->aSize; } @@ -584,7 +584,7 @@ SvLBoxEntry::~SvLBoxEntry() void SvLBoxEntry::DeleteItems_Impl() { DBG_CHKTHIS(SvLBoxEntry,0); - USHORT nCount = aItems.Count(); + sal_uInt16 nCount = aItems.Count(); while( nCount ) { nCount--; @@ -607,8 +607,8 @@ void SvLBoxEntry::Clone( SvListEntry* pSource ) SvListEntry::Clone( pSource ); SvLBoxItem* pNewItem; DeleteItems_Impl(); - USHORT nCount = ((SvLBoxEntry*)pSource)->ItemCount(); - USHORT nCurPos = 0; + sal_uInt16 nCount = ((SvLBoxEntry*)pSource)->ItemCount(); + sal_uInt16 nCurPos = 0; while( nCurPos < nCount ) { SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos ); @@ -621,7 +621,7 @@ void SvLBoxEntry::Clone( SvListEntry* pSource ) nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags; } -void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable ) +void SvLBoxEntry::EnableChildsOnDemand( sal_Bool bEnable ) { DBG_CHKTHIS(SvLBoxEntry,0); if ( bEnable ) @@ -630,7 +630,7 @@ void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable ) nEntryFlags &= (~SV_ENTRYFLAG_CHILDS_ON_DEMAND); } -void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos ) +void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos ) { DBG_CHKTHIS(SvLBoxEntry,0); DBG_ASSERT(pNewItem,"ReplaceItem:No Item"); @@ -643,10 +643,10 @@ void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos ) } } -SvLBoxItem* SvLBoxEntry::GetFirstItem( USHORT nId ) +SvLBoxItem* SvLBoxEntry::GetFirstItem( sal_uInt16 nId ) { - USHORT nCount = aItems.Count(); - USHORT nCur = 0; + sal_uInt16 nCount = aItems.Count(); + sal_uInt16 nCur = 0; SvLBoxItem* pItem; while( nCur < nCount ) { @@ -802,7 +802,7 @@ bool SvLBox::IsEntryMnemonicsEnabled() const return pLBoxImpl->m_bEntryMnemonicsEnabled; } -USHORT SvLBox::IsA() +sal_uInt16 SvLBox::IsA() { DBG_CHKTHIS(SvLBox,0); return SVLISTBOX_ID_LBOX; @@ -815,17 +815,17 @@ IMPL_LINK_INLINE_START( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry ) } IMPL_LINK_INLINE_END( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry ) -ULONG SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, ULONG nPos ) +sal_uIntPtr SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, sal_uIntPtr nPos ) { DBG_CHKTHIS(SvLBox,0); - ULONG nInsPos = pModel->Insert( pEntry, pParent, nPos ); + sal_uIntPtr nInsPos = pModel->Insert( pEntry, pParent, nPos ); return nInsPos; } -ULONG SvLBox::Insert( SvLBoxEntry* pEntry,ULONG nRootPos ) +sal_uIntPtr SvLBox::Insert( SvLBoxEntry* pEntry,sal_uIntPtr nRootPos ) { DBG_CHKTHIS(SvLBox,0); - ULONG nInsPos = pModel->Insert( pEntry, nRootPos ); + sal_uIntPtr nInsPos = pModel->Insert( pEntry, nRootPos ); return nInsPos; } @@ -853,48 +853,48 @@ void SvLBox::DeselectHdl() aDeselectHdl.Call( this ); } -BOOL SvLBox::DoubleClickHdl() +sal_Bool SvLBox::DoubleClickHdl() { DBG_CHKTHIS(SvLBox,0); aDoubleClickHdl.Call( this ); - return TRUE; + return sal_True; } -BOOL SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction ) +sal_Bool SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction ) { DBG_CHKTHIS(SvLBox,0); if ( pSource == this ) { if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) ) - return FALSE; // D&D innerhalb der Liste gesperrt + return sal_False; // D&D innerhalb der Liste gesperrt if( DND_ACTION_MOVE == nAction ) { if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) ) - return FALSE; // kein lokales Move + return sal_False; // kein lokales Move } else { if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY)) - return FALSE; // kein lokales Copy + return sal_False; // kein lokales Copy } } else { if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) ) - return FALSE; // kein Drop + return sal_False; // kein Drop if ( DND_ACTION_MOVE == nAction ) { if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) ) - return FALSE; // kein globales Move + return sal_False; // kein globales Move } else { if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY)) - return FALSE; // kein globales Copy + return sal_False; // kein globales Copy } } - return TRUE; + return sal_True; } @@ -920,19 +920,19 @@ void SvLBox::NotifyRemoving( SvLBoxEntry* ) - Entry wird an das Ende der Target-Childlist gehaengt */ #ifdef DBG_UTIL -BOOL SvLBox::NotifyMoving( +sal_Bool SvLBox::NotifyMoving( SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() SvLBoxEntry* pEntry, // Zu verschiebender Entry aus // GetSourceListBox()->GetModel() SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - ULONG& rNewChildPos) // Position in Childlist des Target-Parents + sal_uIntPtr& rNewChildPos) // Position in Childlist des Target-Parents #else -BOOL SvLBox::NotifyMoving( +sal_Bool SvLBox::NotifyMoving( SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() SvLBoxEntry*, // Zu verschiebender Entry aus // GetSourceListBox()->GetModel() SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - ULONG& rNewChildPos) // Position in Childlist des Target-Parents + sal_uIntPtr& rNewChildPos) // Position in Childlist des Target-Parents #endif { DBG_CHKTHIS(SvLBox,0); @@ -941,7 +941,7 @@ BOOL SvLBox::NotifyMoving( { rpNewParent = 0; rNewChildPos = 0; - return TRUE; + return sal_True; } if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() ) { @@ -960,15 +960,15 @@ BOOL SvLBox::NotifyMoving( else rNewChildPos = LIST_APPEND; } - return TRUE; + return sal_True; } -BOOL SvLBox::NotifyCopying( +sal_Bool SvLBox::NotifyCopying( SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel() SvLBoxEntry* pEntry, // Zu kopierender Entry aus // GetSourceListBox()->GetModel() SvLBoxEntry*& rpNewParent, // Neuer Target-Parent - ULONG& rNewChildPos) // Position in Childlist des Target-Parents + sal_uIntPtr& rNewChildPos) // Position in Childlist des Target-Parents { DBG_CHKTHIS(SvLBox,0); return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos); @@ -978,7 +978,7 @@ BOOL SvLBox::NotifyCopying( { rpNewParent = 0; rNewChildPos = 0; - return TRUE; + return sal_True; } if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() ) { @@ -995,7 +995,7 @@ BOOL SvLBox::NotifyCopying( else rNewChildPos = LIST_APPEND; } - return TRUE; + return sal_True; */ } @@ -1009,13 +1009,13 @@ SvLBoxEntry* SvLBox::CloneEntry( SvLBoxEntry* pSource ) // Rueckgabe: Alle Entries wurden kopiert -BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) +sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) { DBG_CHKTHIS(SvLBox,0); nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; SvTreeEntryList aList; - BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() ); + sal_Bool bClone = (sal_Bool)( (sal_uIntPtr)(pSource->GetModel()) != (sal_uIntPtr)GetModel() ); Link aCloneLink( pModel->GetCloneLink() ); pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl )); @@ -1026,7 +1026,7 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) while ( pSourceEntry ) { // Childs werden automatisch mitkopiert - pSource->SelectChilds( pSourceEntry, FALSE ); + pSource->SelectChilds( pSourceEntry, sal_False ); aList.Insert( pSourceEntry, LIST_APPEND ); pSourceEntry = pSource->NextSelected( pSourceEntry ); } @@ -1035,13 +1035,13 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) while ( pSourceEntry ) { SvLBoxEntry* pNewParent = 0; - ULONG nInsertionPos = LIST_APPEND; - BOOL bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos); + sal_uIntPtr nInsertionPos = LIST_APPEND; + sal_Bool bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos); if ( bOk ) { if ( bClone ) { - ULONG nCloneCount = 0; + sal_uIntPtr nCloneCount = 0; pSourceEntry = (SvLBoxEntry*) pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount ); pModel->InsertTree( (SvListEntry*)pSourceEntry, @@ -1049,15 +1049,15 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) } else { - ULONG nListPos = pModel->Copy( (SvListEntry*)pSourceEntry, + sal_uIntPtr nListPos = pModel->Copy( (SvListEntry*)pSourceEntry, (SvListEntry*)pNewParent, nInsertionPos ); pSourceEntry = GetEntry( pNewParent, nListPos ); } } else - bSuccess = FALSE; + bSuccess = sal_False; - if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen? + if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen? MakeVisible( pSourceEntry ); pSourceEntry = (SvLBoxEntry*)aList.Next(); @@ -1067,18 +1067,18 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget ) } // Rueckgabe: Alle Entries wurden verschoben -BOOL SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget ) +sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget ) { return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False ); } -BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback ) +sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback ) { DBG_CHKTHIS(SvLBox,0); nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; SvTreeEntryList aList; - BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() ); + sal_Bool bClone = (sal_Bool)( (sal_uIntPtr)(pSource->GetModel()) != (sal_uIntPtr)GetModel() ); Link aCloneLink( pModel->GetCloneLink() ); if ( bClone ) pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl )); @@ -1087,7 +1087,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT while ( pSourceEntry ) { // Childs werden automatisch mitbewegt - pSource->SelectChilds( pSourceEntry, FALSE ); + pSource->SelectChilds( pSourceEntry, sal_False ); aList.Insert( pSourceEntry, LIST_APPEND ); pSourceEntry = pSource->NextSelected( pSourceEntry ); } @@ -1096,7 +1096,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT while ( pSourceEntry ) { SvLBoxEntry* pNewParent = 0; - ULONG nInsertionPos = LIST_APPEND; + sal_uIntPtr nInsertionPos = LIST_APPEND; sal_Bool bOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos); sal_Bool bCopyOk = bOk; if ( !bOk && bAllowCopyFallback ) @@ -1109,7 +1109,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT { if ( bClone ) { - ULONG nCloneCount = 0; + sal_uIntPtr nCloneCount = 0; pSourceEntry = (SvLBoxEntry*) pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount ); pModel->InsertTree( (SvListEntry*)pSourceEntry, @@ -1126,9 +1126,9 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT } } else - bSuccess = FALSE; + bSuccess = sal_False; - if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen? + if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen? MakeVisible( pSourceEntry ); pSourceEntry = (SvLBoxEntry*)aList.Next(); @@ -1149,7 +1149,7 @@ void SvLBox::RemoveSelection() aList.Insert( pEntry ); if ( pEntry->HasChilds() ) // Remove loescht Childs automatisch - SelectChilds( pEntry, FALSE ); + SelectChilds( pEntry, sal_False ); pEntry = NextSelected( pEntry ); } pEntry = (SvLBoxEntry*)aList.First(); @@ -1182,8 +1182,8 @@ void SvLBox::RecalcViewData() SvLBoxEntry* pEntry = First(); while( pEntry ) { - USHORT nCount = pEntry->ItemCount(); - USHORT nCurPos = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCurPos = 0; while ( nCurPos < nCount ) { SvLBoxItem* pItem = pEntry->GetItem( nCurPos ); @@ -1207,7 +1207,7 @@ void SvLBox::StateChanged( StateChangedType eType ) Control::StateChanged( eType ); } -void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow) +void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow) { DBG_CHKTHIS(SvLBox,0); if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) ) @@ -1221,37 +1221,37 @@ void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow) nImpFlags &= ~SVLBOX_TARGEMPH_VIS; } -void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, BOOL /* bShow */ ) +void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, sal_Bool /* bShow */ ) { DBG_CHKTHIS(SvLBox,0); } -BOOL SvLBox::Expand( SvLBoxEntry* ) +sal_Bool SvLBox::Expand( SvLBoxEntry* ) { DBG_CHKTHIS(SvLBox,0); - return TRUE; + return sal_True; } -BOOL SvLBox::Collapse( SvLBoxEntry* ) +sal_Bool SvLBox::Collapse( SvLBoxEntry* ) { DBG_CHKTHIS(SvLBox,0); - return TRUE; + return sal_True; } -BOOL SvLBox::Select( SvLBoxEntry*, BOOL ) +sal_Bool SvLBox::Select( SvLBoxEntry*, sal_Bool ) { DBG_CHKTHIS(SvLBox,0); - return FALSE; + return sal_False; } -ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL ) +sal_uIntPtr SvLBox::SelectChilds( SvLBoxEntry* , sal_Bool ) { DBG_CHKTHIS(SvLBox,0); return 0; } -void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ ) +void SvLBox::SelectAll( sal_Bool /* bSelect */ , sal_Bool /* bPaint */ ) { DBG_CHKTHIS(SvLBox,0); } @@ -1280,9 +1280,9 @@ void SvLBox::FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPa if ( pEntry ) { SvLBoxEntry* pParentEntry = GetParent( pEntry ); - while ( TRUE ) + while ( sal_True ) { - ULONG i, nCount = GetLevelChildCount( pParentEntry ); + sal_uIntPtr i, nCount = GetLevelChildCount( pParentEntry ); for ( i = 0; i < nCount; ++i ) { SvLBoxEntry* pTemp = GetEntry( pParentEntry, i ); @@ -1312,11 +1312,11 @@ String SvLBox::GetEntryText( SvLBoxEntry* ) const return String(); } -ULONG SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const +sal_uIntPtr SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const { DBG_CHKTHIS(SvLBox,0); - ULONG nCount = 0; + sal_uIntPtr nCount = 0; SvLBoxEntry* pEntry = FirstChild( _pParent ); while ( pEntry ) { @@ -1355,8 +1355,8 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry ) pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ]; SvViewDataItem* pItemData = pEntryData->pItemData; pEntryData->nItmCnt = pInhEntry->ItemCount(); // Anzahl Items fuer delete - USHORT nCount = pInhEntry->ItemCount(); - USHORT nCurPos = 0; + sal_uInt16 nCount = pInhEntry->ItemCount(); + sal_uInt16 nCurPos = 0; while( nCurPos < nCount ) { SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos ); @@ -1368,10 +1368,10 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry ) -void SvLBox::EnableSelectionAsDropTarget( BOOL bEnable, BOOL bWithChilds ) +void SvLBox::EnableSelectionAsDropTarget( sal_Bool bEnable, sal_Bool bWithChilds ) { DBG_CHKTHIS(SvLBox,0); - USHORT nRefDepth; + sal_uInt16 nRefDepth; SvLBoxEntry* pTemp; SvLBoxEntry* pSelEntry = FirstSelected(); @@ -1422,11 +1422,11 @@ SvLBoxEntry* SvLBox::GetDropTarget( const Point& ) void SvLBox::EditText( const String& rStr, const Rectangle& rRect, const Selection& rSel ) { - EditText( rStr, rRect, rSel, FALSE ); + EditText( rStr, rRect, rSel, sal_False ); } void SvLBox::EditText( const String& rStr, const Rectangle& rRect, - const Selection& rSel, BOOL bMulti ) + const Selection& rSel, sal_Bool bMulti ) { DBG_CHKTHIS(SvLBox,0); if( pEdCtrl ) @@ -1468,11 +1468,11 @@ void SvLBox::CancelTextEditing() { DBG_CHKTHIS(SvLBox,0); if ( pEdCtrl ) - pEdCtrl->StopEditing( TRUE ); + pEdCtrl->StopEditing( sal_True ); nImpFlags &= (~SVLBOX_IN_EDT); } -void SvLBox::EndEditing( BOOL bCancel ) +void SvLBox::EndEditing( sal_Bool bCancel ) { DBG_CHKTHIS(SvLBox,0); if( pEdCtrl ) @@ -1568,7 +1568,7 @@ void SvLBox::SelectSearchEntry( const void* _pEntry ) if ( pEntry ) return; - SelectAll( FALSE ); + SelectAll( sal_False ); SetCurEntry( pEntry ); Select( pEntry ); } @@ -1586,7 +1586,7 @@ bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt ) return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt ); } -SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const +SvLBoxEntry* SvLBox::GetEntry( const Point&, sal_Bool ) const { DBG_CHKTHIS(SvLBox,0); return 0; @@ -1595,15 +1595,15 @@ SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const void SvLBox::ModelHasEntryInvalidated( SvListEntry* pEntry ) { DBG_CHKTHIS(SvLBox,0); - USHORT nCount = ((SvLBoxEntry*)pEntry)->ItemCount(); - for( USHORT nIdx = 0; nIdx < nCount; nIdx++ ) + sal_uInt16 nCount = ((SvLBoxEntry*)pEntry)->ItemCount(); + for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ ) { SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx ); pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 ); } } -void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse ) +void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, sal_Bool bInUse ) { DBG_CHKTHIS(SvLBox,0); DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry"); @@ -1625,7 +1625,7 @@ void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse ) } } -void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored ) +void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, sal_Bool bCursored ) { DBG_CHKTHIS(SvLBox,0); DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry"); @@ -1640,7 +1640,7 @@ void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored ) } } -BOOL SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const +sal_Bool SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const { DBG_CHKTHIS(SvLBox,0); DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry"); @@ -1659,11 +1659,11 @@ void SvLBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* ) DBG_CHKTHIS(SvLBox,0); } -BOOL SvLBox::EditingCanceled() const +sal_Bool SvLBox::EditingCanceled() const { if( pEdCtrl && pEdCtrl->EditingCanceled() ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } @@ -1675,7 +1675,7 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt ) if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) ) { - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); } else if( !nDragDropMode ) { @@ -1702,12 +1702,12 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt ) // **** Emphasis zeichnen **** if( DND_ACTION_NONE == nRet ) - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) ) { - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); pTargetEntry = pEntry; - ImplShowTargetEmphasis( pTargetEntry, TRUE ); + ImplShowTargetEmphasis( pTargetEntry, sal_True ); } } return nRet; @@ -1719,9 +1719,9 @@ sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView sal_Int8 nRet = DND_ACTION_NONE; DBG_ASSERT( pSourceView, "SvLBox::ExecuteDrop(): no source view" ); - pSourceView->EnableSelectionAsDropTarget( TRUE, TRUE ); + pSourceView->EnableSelectionAsDropTarget( sal_True, sal_True ); - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); pDDTarget = this; SvLBoxDDInfo aDDInfo; @@ -1813,8 +1813,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) pDDSource = this; pDDTarget = 0; - BOOL bOldUpdateMode = Control::IsUpdateMode(); - Control::SetUpdateMode( TRUE ); + sal_Bool bOldUpdateMode = Control::IsUpdateMode(); + Control::SetUpdateMode( sal_True ); Update(); Control::SetUpdateMode( bOldUpdateMode ); @@ -1822,8 +1822,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) // Wichtig: Wenn im DropHandler die Selektion der // SourceListBox veraendert wird, muessen vorher die Eintraege // als DropTargets wieder freigeschaltet werden: - // (GetSourceListBox()->EnableSelectionAsDropTarget( TRUE, TRUE );) - EnableSelectionAsDropTarget( FALSE, TRUE /* with Childs */ ); + // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );) + EnableSelectionAsDropTarget( sal_False, sal_True /* with Childs */ ); pContainer->StartDrag( this, nDragOptions, GetDragFinishedHdl() ); } @@ -1834,18 +1834,18 @@ nAction #endif ) { - EnableSelectionAsDropTarget( TRUE, TRUE ); + EnableSelectionAsDropTarget( sal_True, sal_True ); #ifndef UNX if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget && - ((ULONG)(pDDTarget->GetModel())!=(ULONG)(this->GetModel()))) || + ((sal_uIntPtr)(pDDTarget->GetModel())!=(sal_uIntPtr)(this->GetModel()))) || !pDDTarget )) { RemoveSelection(); } #endif - ImplShowTargetEmphasis( pTargetEntry, FALSE ); + ImplShowTargetEmphasis( pTargetEntry, sal_False ); pDDSource = 0; pDDTarget = 0; pTargetEntry = 0; @@ -1858,10 +1858,10 @@ DragDropMode SvLBox::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* ) return (DragDropMode)0xffff; } -BOOL SvLBox::NotifyAcceptDrop( SvLBoxEntry* ) +sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* ) { DBG_CHKTHIS(SvLBox,0); - return TRUE; + return sal_True; } // handler and methods for Drag - finished handler. @@ -1878,20 +1878,20 @@ namespace void SvLBox::AddBoxToDDList_Impl( const SvLBox& rB ) { - ULONG nVal = (ULONG)&rB; + sal_uIntPtr nVal = (sal_uIntPtr)&rB; SortLBoxes::get().Insert( nVal ); } void SvLBox::RemoveBoxFromDDList_Impl( const SvLBox& rB ) { - ULONG nVal = (ULONG)&rB; + sal_uIntPtr nVal = (sal_uIntPtr)&rB; SortLBoxes::get().Remove( nVal ); } IMPL_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8*, pAction ) { - ULONG nVal = (ULONG)pThis; - USHORT nFnd; + sal_uIntPtr nVal = (sal_uIntPtr)pThis; + sal_uInt16 nFnd; SvULongsSort &rSortLBoxes = SortLBoxes::get(); if( rSortLBoxes.Seek_Entry( nVal, &nFnd ) ) { diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 53fbded59f11..5528dcc9579d 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -75,7 +75,7 @@ void SvTabListBox::SetTabs() */ // alle anderen Tabs an Liste haengen - for( USHORT nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) + for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) { SvLBoxTab* pTab = pTabList+nCurTab; AddTab( pTab->GetPos(), pTab->nFlags ); @@ -90,10 +90,10 @@ void SvTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr, XubString aToken; const xub_Unicode* pCurToken = aCurEntry.GetBuffer(); - USHORT nCurTokenLen; + sal_uInt16 nCurTokenLen; const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen ); - USHORT nCount = nTabCount; nCount--; - for( USHORT nToken = 0; nToken < nCount; nToken++ ) + sal_uInt16 nCount = nTabCount; nCount--; + for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ ) { if( pCurToken && nCurTokenLen ) // aToken.Assign( pCurToken, nCurTokenLen ); @@ -147,7 +147,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit ) return; delete [] pTabList; - USHORT nCount = (USHORT)(*pTabs); + sal_uInt16 nCount = (sal_uInt16)(*pTabs); pTabList = new SvLBoxTab[ nCount ]; nTabCount = nCount; @@ -155,7 +155,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit ) MapMode aMMDest( MAP_PIXEL ); pTabs++; - for( USHORT nIdx = 0; nIdx < nCount; nIdx++, pTabs++ ) + for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabs++ ) { Size aSize( *pTabs, 0 ); aSize = LogicToLogic( aSize, &aMMSource, &aMMDest ); @@ -168,7 +168,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit ) Invalidate(); } -void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit ) +void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit ) { DBG_ASSERT(nTab<nTabCount,"Invalid Tab-Pos"); if( nTab < nTabCount ) @@ -187,8 +187,8 @@ void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit ) } SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText, SvLBoxEntry* pParent, - BOOL /*bChildsOnDemand*/, - ULONG nPos, void* pUserData, + sal_Bool /*bChildsOnDemand*/, + sal_uIntPtr nPos, void* pUserData, SvLBoxButtonKind ) { return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData ); @@ -198,15 +198,15 @@ SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, SvLBoxEntry* pParent, - BOOL /*bChildsOnDemand*/, - ULONG nPos, void* pUserData, + sal_Bool /*bChildsOnDemand*/, + sal_uIntPtr nPos, void* pUserData, SvLBoxButtonKind ) { return InsertEntryToColumn( rText, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, 0xffff, pUserData ); } -SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, +SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,sal_uIntPtr nPos,sal_uInt16 nCol, void* pUser ) { XubString aStr; @@ -220,7 +220,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry } aStr += rStr; XubString aFirstStr( aStr ); - USHORT nEnd = aFirstStr.Search( '\t' ); + sal_uInt16 nEnd = aFirstStr.Search( '\t' ); if( nEnd != STRING_NOTFOUND ) { aFirstStr.Erase( nEnd ); @@ -229,12 +229,12 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry } else aCurEntry.Erase(); - return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos, pUser ); + return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUser ); } SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, - SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, void* pUser ) + SvLBoxEntry* pParent,sal_uIntPtr nPos,sal_uInt16 nCol, void* pUser ) { XubString aStr; if( nCol != 0xffff ) @@ -247,7 +247,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, } aStr += rStr; XubString aFirstStr( aStr ); - USHORT nEnd = aFirstStr.Search( '\t' ); + sal_uInt16 nEnd = aFirstStr.Search( '\t' ); if( nEnd != STRING_NOTFOUND ) { aFirstStr.Erase( nEnd ); @@ -260,11 +260,11 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, return SvTreeListBox::InsertEntry( aFirstStr, rExpandedEntryBmp, rCollapsedEntryBmp, - pParent, FALSE, nPos, pUser ); + pParent, sal_False, nPos, pUser ); } -SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, ULONG nPos, - USHORT nCol, void* pUser ) +SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, sal_uIntPtr nPos, + sal_uInt16 nCol, void* pUser ) { return InsertEntryToColumn( rStr,0,nPos, nCol, pUser ); } @@ -274,14 +274,14 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry ) const return GetEntryText( pEntry, 0xffff ); } -String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const +String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const { DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry"); XubString aResult; if( pEntry ) { - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); @@ -306,19 +306,19 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const return aResult; } -String SvTabListBox::GetEntryText( ULONG nPos, USHORT nCol ) const +String SvTabListBox::GetEntryText( sal_uIntPtr nPos, sal_uInt16 nCol ) const { SvLBoxEntry* pEntry = GetEntryOnPos( nPos ); return GetEntryText( pEntry, nCol ); } -void SvTabListBox::SetEntryText( const XubString& rStr, ULONG nPos, USHORT nCol ) +void SvTabListBox::SetEntryText( const XubString& rStr, sal_uIntPtr nPos, sal_uInt16 nCol ) { SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos ); SetEntryText( rStr, pEntry, nCol ); } -void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USHORT nCol ) +void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal_uInt16 nCol ) { DBG_ASSERT(pEntry,"SetEntryText:Invalid Entry"); if( !pEntry ) @@ -328,14 +328,14 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH if ( sOldText == rStr ) return; - USHORT nTextColumn = nCol; + sal_uInt16 nTextColumn = nCol; const xub_Unicode* pCurToken = rStr.GetBuffer(); - USHORT nCurTokenLen; + sal_uInt16 nCurTokenLen; const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen ); XubString aTemp; - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); @@ -375,7 +375,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH delete pData; } -String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const +String SvTabListBox::GetCellText( sal_uIntPtr nPos, sal_uInt16 nCol ) const { SvLBoxEntry* pEntry = GetEntryOnPos( nPos ); DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" ); @@ -389,9 +389,9 @@ String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const return aResult; } -ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol ) +sal_uIntPtr SvTabListBox::GetEntryPos( const XubString& rStr, sal_uInt16 nCol ) { - ULONG nPos = 0; + sal_uIntPtr nPos = 0; SvLBoxEntry* pEntry = First(); while( pEntry ) { @@ -404,9 +404,9 @@ ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol ) return 0xffffffff; } -ULONG SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const +sal_uIntPtr SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const { - ULONG nPos = 0; + sal_uIntPtr nPos = 0; SvLBoxEntry* pTmpEntry = First(); while( pTmpEntry ) { @@ -424,7 +424,7 @@ void __EXPORT SvTabListBox::Resize() } // static -const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen ) +const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, sal_uInt16& rLen ) { if( !pPtr || *pPtr == 0 ) { @@ -432,7 +432,7 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen return 0; } xub_Unicode c = *pPtr; - USHORT nLen = 0; + sal_uInt16 nLen = 0; while( c != '\t' && c != 0 ) { pPtr++; @@ -447,15 +447,15 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen return pPtr; } -String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const +String SvTabListBox::GetTabEntryText( sal_uIntPtr nPos, sal_uInt16 nCol ) const { SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos ); DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " ); XubString aResult; if ( pEntry ) { - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0; while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); @@ -485,10 +485,10 @@ String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const return aResult; } -SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const +SvLBoxEntry* SvTabListBox::GetEntryOnPos( sal_uIntPtr _nEntryPos ) const { SvLBoxEntry* pEntry = NULL; - ULONG i, nPos = 0, nCount = GetLevelChildCount( NULL ); + sal_uIntPtr i, nPos = 0, nCount = GetLevelChildCount( NULL ); for ( i = 0; i < nCount; ++i ) { SvLBoxEntry* pParent = GetEntry(i); @@ -509,9 +509,9 @@ SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const return pEntry; } -SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPos, ULONG& _rPos ) const +SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, sal_uIntPtr _nEntryPos, sal_uIntPtr& _rPos ) const { - ULONG i, nCount = GetLevelChildCount( _pParent ); + sal_uIntPtr i, nCount = GetLevelChildCount( _pParent ); for ( i = 0; i < nCount; ++i ) { SvLBoxEntry* pParent = GetEntry( _pParent, i ); @@ -529,33 +529,33 @@ SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPo return NULL; } -void SvTabListBox::SetTabJustify( USHORT nTab, SvTabJustify eJustify) +void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify) { if( nTab >= nTabCount ) return; SvLBoxTab* pTab = &(pTabList[ nTab ]); - USHORT nFlags = pTab->nFlags; + sal_uInt16 nFlags = pTab->nFlags; nFlags &= (~MYTABMASK); - nFlags |= (USHORT)eJustify; + nFlags |= (sal_uInt16)eJustify; pTab->nFlags = nFlags; SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS; if( IsUpdateMode() ) Invalidate(); } -SvTabJustify SvTabListBox::GetTabJustify( USHORT nTab ) const +SvTabJustify SvTabListBox::GetTabJustify( sal_uInt16 nTab ) const { SvTabJustify eResult = AdjustLeft; if( nTab >= nTabCount ) return eResult; SvLBoxTab* pTab = &(pTabList[ nTab ]); - USHORT nFlags = pTab->nFlags; + sal_uInt16 nFlags = pTab->nFlags; nFlags &= MYTABMASK; eResult = (SvTabJustify)nFlags; return eResult; } -long SvTabListBox::GetLogicTab( USHORT nTab ) +long SvTabListBox::GetLogicTab( sal_uInt16 nTab ) { if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS ) ((SvTabListBox*)this)->SetTabs(); @@ -583,7 +583,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, WinBits nWinStyle ) : SvTabListBox( pParent, nWinStyle ), - m_bFirstPaint ( TRUE ), + m_bFirstPaint ( sal_True ), m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ), m_pAccessible ( NULL ) { @@ -595,7 +595,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, const ResId& rResId ) : SvTabListBox( pParent, rResId ), - m_bFirstPaint ( TRUE ), + m_bFirstPaint ( sal_True ), m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ), m_pAccessible ( NULL ) { @@ -614,7 +614,7 @@ void SvHeaderTabListBox::Paint( const Rectangle& rRect ) { if ( m_bFirstPaint ) { - m_bFirstPaint = FALSE; + m_bFirstPaint = sal_False; RepaintScrollBars(); } SvTabListBox::Paint( rRect ); @@ -633,14 +633,14 @@ void SvHeaderTabListBox::InitHeaderBar( HeaderBar* pHeaderBar ) // ----------------------------------------------------------------------- -sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) const +sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const { SvButtonState eState = SV_BUTTON_UNCHECKED; SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( nCol + 1 ) ); if ( pItem && ( (SvLBoxItem*)pItem )->IsA() == SV_ITEM_ID_LBOXBUTTON ) { - USHORT nButtonFlags = pItem->GetButtonFlags(); + sal_uInt16 nButtonFlags = pItem->GetButtonFlags(); eState = pCheckButtonData->ConvertToButtonState( nButtonFlags ); } @@ -650,7 +650,7 @@ sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) c // ----------------------------------------------------------------------- SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( - const XubString& rStr, ULONG nPos, USHORT nCol, void* pUserData ) + const XubString& rStr, sal_uIntPtr nPos, sal_uInt16 nCol, void* pUserData ) { SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, nPos, nCol, pUserData ); RecalculateAccessibleChildren(); @@ -660,7 +660,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( // ----------------------------------------------------------------------- SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( - const XubString& rStr, SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData ) + const XubString& rStr, SvLBoxEntry* pParent, sal_uIntPtr nPos, sal_uInt16 nCol, void* pUserData ) { SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, pParent, nPos, nCol, pUserData ); RecalculateAccessibleChildren(); @@ -671,7 +671,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( const XubString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, - SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData ) + SvLBoxEntry* pParent, sal_uIntPtr nPos, sal_uInt16 nCol, void* pUserData ) { SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, nCol, pUserData ); @@ -681,19 +681,19 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn( // ----------------------------------------------------------------------- -ULONG SvHeaderTabListBox::Insert( - SvLBoxEntry* pEnt, SvLBoxEntry* pPar, ULONG nPos ) +sal_uIntPtr SvHeaderTabListBox::Insert( + SvLBoxEntry* pEnt, SvLBoxEntry* pPar, sal_uIntPtr nPos ) { - ULONG n = SvTabListBox::Insert( pEnt, pPar, nPos ); + sal_uIntPtr n = SvTabListBox::Insert( pEnt, pPar, nPos ); RecalculateAccessibleChildren(); return n; } // ----------------------------------------------------------------------- -ULONG SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, ULONG nRootPos ) +sal_uIntPtr SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, sal_uIntPtr nRootPos ) { - ULONG nPos = SvTabListBox::Insert( pEntry, nRootPos ); + sal_uIntPtr nPos = SvTabListBox::Insert( pEntry, nRootPos ); RecalculateAccessibleChildren(); return nPos; } @@ -765,7 +765,7 @@ sal_Bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, Tr SvLBoxEntry* pEntry = GetEntry( _nRow ); if ( pEntry ) { - USHORT nItemCount = pEntry->ItemCount(); + sal_uInt16 nItemCount = pEntry->ItemCount(); if ( nItemCount > ( _nColumn + 1 ) ) { SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( _nColumn + 1 ) ); @@ -801,8 +801,8 @@ sal_Int32 SvHeaderTabListBox::GetCurrRow() const SvLBoxEntry* pEntry = GetCurEntry(); if ( pEntry ) { - ULONG nCount = GetEntryCount(); - for ( ULONG i = 0; i < nCount; ++i ) + sal_uIntPtr nCount = GetEntryCount(); + for ( sal_uIntPtr i = 0; i < nCount; ++i ) { if ( pEntry == GetEntry(i) ) { @@ -843,11 +843,11 @@ sal_Bool SvHeaderTabListBox::IsCellFocusable() const // ----------------------------------------------------------------------- sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) { - sal_Bool bRet = ( IsCellFocusEnabled() == TRUE ); + sal_Bool bRet = ( IsCellFocusEnabled() == sal_True ); if ( bRet ) { // first set cursor to _nRow - SetCursor( GetEntry( _nRow ), TRUE ); + SetCursor( GetEntry( _nRow ), sal_True ); // then set the focus into _nColumn bRet = ( SetCurrentTabPos( _nColumn ) == true ); } @@ -856,22 +856,22 @@ sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) // ----------------------------------------------------------------------- void SvHeaderTabListBox::SetNoSelection() { - SvLBox::SelectAll( FALSE ); + SvLBox::SelectAll( sal_False ); } // ----------------------------------------------------------------------- void SvHeaderTabListBox::SelectAll() { - SvLBox::SelectAll( TRUE ); + SvLBox::SelectAll( sal_True ); } // ----------------------------------------------------------------------- -void SvHeaderTabListBox::SelectAll( BOOL bSelect, BOOL bPaint ) +void SvHeaderTabListBox::SelectAll( sal_Bool bSelect, sal_Bool bPaint ) { - // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, BOOL ) + // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, sal_Bool ) SvTabListBox::SelectAll( bSelect, bPaint ); } // ----------------------------------------------------------------------- -void SvHeaderTabListBox::SelectRow( long _nRow, BOOL _bSelect, BOOL ) +void SvHeaderTabListBox::SelectRow( long _nRow, sal_Bool _bSelect, sal_Bool ) { Select( GetEntry( _nRow ), _bSelect ); } @@ -898,7 +898,7 @@ bool SvHeaderTabListBox::IsRowSelected( long _nRow ) const // ----------------------------------------------------------------------- sal_Bool SvHeaderTabListBox::IsColumnSelected( long ) const { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- void SvHeaderTabListBox::GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& ) const @@ -914,12 +914,12 @@ sal_Bool SvHeaderTabListBox::IsCellVisible( sal_Int32, sal_uInt16 ) const return sal_True; } // ----------------------------------------------------------------------- -String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const +String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const { return ::rtl::OUString( GetTabEntryText( _nRow, _nColumnPos ) ); } // ----------------------------------------------------------------------- -Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen ) +Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen ) { Rectangle aRect; if ( _bIsColumnBar ) @@ -933,7 +933,7 @@ Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnS return aRect; } // ----------------------------------------------------------------------- -Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen ) +Rectangle SvHeaderTabListBox::calcTableRect( sal_Bool _bOnScreen ) { Window* pParent = NULL; if ( !_bOnScreen ) @@ -943,14 +943,14 @@ Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen ) return aRect; } // ----------------------------------------------------------------------- -Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, BOOL _bIsHeader, BOOL _bOnScreen ) +Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen ) { DBG_ASSERT( !_bIsHeader || 0 == _nRow, "invalid parameters" ); Rectangle aRect; SvLBoxEntry* pEntry = GetEntry( _nRow ); if ( pEntry ) { - aRect = _bIsHeader ? calcHeaderRect( sal_True, FALSE ) : GetBoundingRect( pEntry ); + aRect = _bIsHeader ? calcHeaderRect( sal_True, sal_False ) : GetBoundingRect( pEntry ); Point aTopLeft = aRect.TopLeft(); DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" ); Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) ); @@ -1108,7 +1108,7 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin } case ::svt::BBTYPE_COLUMNHEADERCELL: { - aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (USHORT)_nPos ) ); + aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (sal_uInt16)_nPos ) ); break; } @@ -1227,7 +1227,7 @@ void SvHeaderTabListBox::GrabTableFocus() GrabFocus(); } // ----------------------------------------------------------------------- -BOOL SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) +sal_Bool SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) { return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector ); } @@ -1242,7 +1242,7 @@ void SvHeaderTabListBox::GrabFocus() Control::GrabFocus(); } // ----------------------------------------------------------------------- -Reference< XAccessible > SvHeaderTabListBox::GetAccessible( BOOL bCreate ) +Reference< XAccessible > SvHeaderTabListBox::GetAccessible( sal_Bool bCreate ) { return Control::GetAccessible( bCreate ); } @@ -1286,7 +1286,7 @@ Rectangle SvHeaderTabListBox::GetFieldCharacterBounds(sal_Int32,sal_Int32,sal_In // ----------------------------------------------------------------------------- sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) { - String sText = GetAccessibleCellText( _nRow, static_cast< USHORT >( _nColumnPos ) ); + String sText = GetAccessibleCellText( _nRow, static_cast< sal_uInt16 >( _nColumnPos ) ); MetricVector aRects; if ( GetGlyphBoundRects(Point(0,0),sText,0,STRING_LEN,0,aRects) ) { diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index bf6e41f93f36..b54e674429cc 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -109,7 +109,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle ) SetFont( GetFont() ); SetSpaceBetweenEntries( 0 ); SetLineColor(); - InitSettings( TRUE, TRUE, TRUE ); + InitSettings( sal_True, sal_True, sal_True ); SetWindowBits( nWinStyle ); SetTabs(); } @@ -149,28 +149,28 @@ void SvTreeListBox::DisconnectFromModel() } -USHORT SvTreeListBox::IsA() +sal_uInt16 SvTreeListBox::IsA() { DBG_CHKTHIS(SvTreeListBox,0); return SV_LISTBOX_ID_TREEBOX; } -void SvTreeListBox::SetSublistOpenWithReturn( BOOL b ) +void SvTreeListBox::SetSublistOpenWithReturn( sal_Bool b ) { pImp->bSubLstOpRet = b; } -BOOL SvTreeListBox::IsSublistOpenWithReturn() const +sal_Bool SvTreeListBox::IsSublistOpenWithReturn() const { return pImp->bSubLstOpRet; } -void SvTreeListBox::SetSublistOpenWithLeftRight( BOOL b ) +void SvTreeListBox::SetSublistOpenWithLeftRight( sal_Bool b ) { pImp->bSubLstOpLR = b; } -BOOL SvTreeListBox::IsSublistOpenWithLeftRight() const +sal_Bool SvTreeListBox::IsSublistOpenWithLeftRight() const { return pImp->bSubLstOpLR; } @@ -179,12 +179,12 @@ void SvTreeListBox::Resize() { DBG_CHKTHIS(SvTreeListBox,0); if( IsEditingActive() ) - EndEditing( TRUE ); + EndEditing( sal_True ); SvLBox::Resize(); pImp->Resize(); nFocusWidth = -1; - pImp->ShowCursor( FALSE ); - pImp->ShowCursor( TRUE ); + pImp->ShowCursor( sal_False ); + pImp->ShowCursor( sal_True ); } /* Faelle: @@ -224,11 +224,11 @@ void SvTreeListBox::SetTabs() { DBG_CHKTHIS(SvTreeListBox,0); if( IsEditingActive() ) - EndEditing( TRUE ); + EndEditing( sal_True ); nTreeFlags &= (~TREEFLAG_RECALCTABS); nFocusWidth = -1; - BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; - BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | + sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; + sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; long nStartPos = TAB_STARTPOS; long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); @@ -353,8 +353,8 @@ String SvTreeListBox::SearchEntryText( SvLBoxEntry* pEntry ) const DBG_CHKTHIS(SvTreeListBox,0); DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" ); String sRet; - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; SvLBoxItem* pItem; while( nCur < nCount ) { @@ -398,7 +398,7 @@ IMPL_LINK_INLINE_START( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pDa IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData ) SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,SvLBoxEntry* pParent, - BOOL bChildsOnDemand, ULONG nPos, void* pUser, + sal_Bool bChildsOnDemand, sal_uIntPtr nPos, void* pUser, SvLBoxButtonKind eButtonKind ) { DBG_CHKTHIS(SvTreeListBox,0); @@ -438,7 +438,7 @@ SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,SvLBoxEntry* pPa SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText, const Image& aExpEntryBmp, const Image& aCollEntryBmp, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos, void* pUser, + SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uIntPtr nPos, void* pUser, SvLBoxButtonKind eButtonKind ) { DBG_CHKTHIS(SvTreeListBox,0); @@ -523,7 +523,7 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry ) SvLBoxEntry* pParent = (SvLBoxEntry*)pModel->GetParent( pEntry ); if( pParent ) { - USHORT nFlags = pParent->GetFlags(); + sal_uInt16 nFlags = pParent->GetFlags(); nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP; pParent->SetFlags( nFlags ); } @@ -585,7 +585,7 @@ SvButtonState SvTreeListBox::GetCheckButtonState( SvLBoxEntry* pEntry ) const SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON)); if(!pItem) return SV_BUTTON_TRISTATE; - USHORT nButtonFlags = pItem->GetButtonFlags(); + sal_uInt16 nButtonFlags = pItem->GetButtonFlags(); eState = pCheckButtonData->ConvertToButtonState( nButtonFlags ); } return eState; @@ -653,7 +653,7 @@ SvLBoxEntry* SvTreeListBox::CloneEntry( SvLBoxEntry* pSource ) // ********************************************************************* -void SvTreeListBox::ShowExpandBitmapOnCursor( BOOL bYes ) +void SvTreeListBox::ShowExpandBitmapOnCursor( sal_Bool bYes ) { DBG_CHKTHIS(SvTreeListBox,0); if( bYes ) @@ -751,19 +751,19 @@ void SvTreeListBox::SetDontKnowNodeBitmap( const Image& rDontKnowBmp, BmpColorMo pImp->SetDontKnowNodeBmp( rDontKnowBmp, _eMode ); } -BOOL SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& ) +sal_Bool SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& ) { DBG_CHKTHIS(SvTreeListBox,0); - return TRUE; + return sal_True; } -BOOL SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/) +sal_Bool SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/) { DBG_CHKTHIS(SvTreeListBox,0); - return TRUE; + return sal_True; } -void SvTreeListBox::EnableInplaceEditing( BOOL bOn ) +void SvTreeListBox::EnableInplaceEditing( sal_Bool bOn ) { DBG_CHKTHIS(SvTreeListBox,0); SvLBox::EnableInplaceEditing( bOn ); @@ -779,7 +779,7 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt ) nImpFlags |= SVLBOX_IS_TRAVELSELECT; #ifdef OVDEBUG - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch ( nCode ) { case KEY_F1: @@ -803,7 +803,7 @@ void SvTreeListBox::RequestingChilds( SvLBoxEntry* pParent ) { DBG_CHKTHIS(SvTreeListBox,0); if( !pParent->HasChilds() ) - InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND ); + InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND ); } void SvTreeListBox::GetFocus() @@ -849,7 +849,7 @@ void SvTreeListBox::ModelHasCleared() // Invalidate(); } -void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL /* bShow */ ) +void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool /* bShow */ ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->PaintDDCursor( pEntry ); @@ -873,13 +873,13 @@ void SvTreeListBox::ScrollOutputArea( short nDeltaEntries ) long nTemp = nThumb + nVis; if( nDeltaEntries > (nMax - nTemp) ) nDeltaEntries = (short)(nMax - nTemp); - pImp->PageDown( (USHORT)nDeltaEntries ); + pImp->PageDown( (sal_uInt16)nDeltaEntries ); } else { if( nDeltaEntries > nThumb ) nDeltaEntries = (short)nThumb; - pImp->PageUp( (USHORT)nDeltaEntries ); + pImp->PageUp( (sal_uInt16)nDeltaEntries ); } pImp->SyncVerThumb(); NotifyEndScroll(); @@ -923,8 +923,8 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry ) { DBG_CHKTHIS(SvTreeListBox,0); short nHeight, nHeightMax=0; - USHORT nCount = pEntry->ItemCount(); - USHORT nCur = 0; + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; SvViewDataEntry* pViewData = GetViewDataEntry( pEntry ); while( nCur < nCount ) { @@ -943,7 +943,7 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry ) } } -void SvTreeListBox::SetEntryHeight( short nHeight, BOOL bAlways ) +void SvTreeListBox::SetEntryHeight( short nHeight, sal_Bool bAlways ) { DBG_CHKTHIS(SvTreeListBox,0); @@ -984,12 +984,12 @@ void SvTreeListBox::AdjustEntryHeight( const Font& rFont ) } } -BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) +sal_Bool SvTreeListBox::Expand( SvLBoxEntry* pParent ) { DBG_CHKTHIS(SvTreeListBox,0); pHdlEntry = pParent; - BOOL bExpanded = FALSE; - USHORT nFlags; + sal_Bool bExpanded = sal_False; + sal_uInt16 nFlags; if( pParent->HasChildsOnDemand() ) RequestingChilds( pParent ); @@ -998,7 +998,7 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) nImpFlags |= SVLBOX_IS_EXPANDING; if( ExpandingHdl() ) { - bExpanded = TRUE; + bExpanded = sal_True; SvListView::Expand( pParent ); pImp->EntryExpanded( pParent ); pHdlEntry = pParent; @@ -1027,16 +1027,16 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent ) return bExpanded; } -BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent ) +sal_Bool SvTreeListBox::Collapse( SvLBoxEntry* pParent ) { DBG_CHKTHIS(SvTreeListBox,0); nImpFlags &= ~SVLBOX_IS_EXPANDING; pHdlEntry = pParent; - BOOL bCollapsed = FALSE; + sal_Bool bCollapsed = sal_False; if( ExpandingHdl() ) { - bCollapsed = TRUE; + bCollapsed = sal_True; pImp->CollapsingEntry( pParent ); SvListView::Collapse( pParent ); pImp->EntryCollapsed( pParent ); @@ -1054,11 +1054,11 @@ BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent ) return bCollapsed; } -BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect ) +sal_Bool SvTreeListBox::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) { DBG_CHKTHIS(SvTreeListBox,0); DBG_ASSERT(pEntry,"Select: Null-Ptr"); - BOOL bRetVal = SvListView::Select( pEntry, bSelect ); + sal_Bool bRetVal = SvListView::Select( pEntry, bSelect ); DBG_ASSERT(IsSelected(pEntry)==bSelect,"Select failed"); if( bRetVal ) { @@ -1075,14 +1075,14 @@ BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect ) return bRetVal; } -ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect ) +sal_uIntPtr SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->DestroyAnchor(); - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( !pParent->HasChilds() ) return 0; - USHORT nRefDepth = pModel->GetDepth( pParent ); + sal_uInt16 nRefDepth = pModel->GetDepth( pParent ); SvLBoxEntry* pChild = FirstChild( pParent ); do { nRet++; @@ -1092,19 +1092,19 @@ ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect ) return nRet; } -void SvTreeListBox::SelectAll( BOOL bSelect, BOOL ) +void SvTreeListBox::SelectAll( sal_Bool bSelect, sal_Bool ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SelAllDestrAnch( bSelect, - TRUE, // Anker loeschen, - TRUE ); // auch bei SINGLE_SELECTION den Cursor deselektieren + sal_True, // Anker loeschen, + sal_True ); // auch bei SINGLE_SELECTION den Cursor deselektieren } void SvTreeListBox::ModelHasInsertedTree( SvListEntry* pEntry ) { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry ); + sal_uInt16 nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry ); SvLBoxEntry* pTmp = (SvLBoxEntry*)pEntry; do { @@ -1123,7 +1123,7 @@ void SvTreeListBox::ModelHasInserted( SvListEntry* pEntry ) void SvTreeListBox::ModelIsMoving(SvListEntry* pSource, SvListEntry* /* pTargetParent */, - ULONG /* nChildPos */ ) + sal_uIntPtr /* nChildPos */ ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->MovingEntry( (SvLBoxEntry*)pSource ); @@ -1170,7 +1170,7 @@ void SvTreeListBox::SetFont( const Font& rFont ) { DBG_CHKTHIS(SvTreeListBox,0); Font aTempFont( rFont ); - aTempFont.SetTransparent( TRUE ); + aTempFont.SetTransparent( sal_True ); Control::SetFont( aTempFont ); AdjustEntryHeight( aTempFont ); // immer Invalidieren, sonst fallen wir @@ -1207,13 +1207,13 @@ void SvTreeListBox::MouseMove( const MouseEvent& rMEvt ) } -void SvTreeListBox::SetUpdateMode( BOOL bUpdate ) +void SvTreeListBox::SetUpdateMode( sal_Bool bUpdate ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SetUpdateMode( bUpdate ); } -void SvTreeListBox::SetUpdateModeFast( BOOL bUpdate ) +void SvTreeListBox::SetUpdateModeFast( sal_Bool bUpdate ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SetUpdateModeFast( bUpdate ); @@ -1233,7 +1233,7 @@ void SvTreeListBox::SetSpaceBetweenEntries( short nOffsLogic ) } } -void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect ) +void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) { DBG_CHKTHIS(SvTreeListBox,0); pImp->SetCursor(pEntry, bForceNoSelect); @@ -1270,7 +1270,7 @@ void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry ) pImp->MakeVisible(pEntry); } -void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop ) +void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) { pImp->MakeVisible( pEntry, bMoveToTop ); } @@ -1291,11 +1291,11 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem, DBG_ASSERT(pEntry&&pItem,"EditItemText: Bad params"); if( IsSelected( pEntry )) { - pImp->ShowCursor( FALSE ); - SvListView::Select( pEntry, FALSE ); + pImp->ShowCursor( sal_False ); + SvListView::Select( pEntry, sal_False ); PaintEntry( pEntry ); - SvListView::Select( pEntry, TRUE ); - pImp->ShowCursor( TRUE ); + SvListView::Select( pEntry, sal_True ); + pImp->ShowCursor( sal_True ); } pEdEntry = pEntry; pEdItem = pItem; @@ -1308,7 +1308,7 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem, aPos.X() = GetTabPos( pEntry, pTab ); long nOutputWidth = pImp->GetOutputSize().Width(); Size aSize( nOutputWidth - aPos.X(), aItemSize.Height() ); - USHORT nPos = aTabs.GetPos( pTab ); + sal_uInt16 nPos = aTabs.GetPos( pTab ); if( nPos+1 < aTabs.Count() ) { SvLBoxTab* pRightTab = (SvLBoxTab*)aTabs.GetObject( nPos + 1 ); @@ -1354,8 +1354,8 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry ) bool bIsMouseTriggered = nClickX >= 0; SvLBoxString* pItem = NULL; - USHORT nCount = pEntry->ItemCount(); - for( USHORT i = 0 ; i < nCount ; i++ ) + sal_uInt16 nCount = pEntry->ItemCount(); + for( sal_uInt16 i = 0 ; i < nCount ; i++ ) { SvLBoxItem* pTmpItem = pEntry->GetItem( i ); if( pTmpItem->IsA() != SV_ITEM_ID_LBOXSTRING ) @@ -1384,7 +1384,7 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry ) Selection aSel( SELECTION_MIN, SELECTION_MAX ); if( pItem && EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); MakeVisible( pEntry ); EditItemText( pEntry, pItem, aSel ); } @@ -1434,7 +1434,7 @@ void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem, Selection aSel( SELECTION_MIN, SELECTION_MAX ); if( EditingEntry( pEntry, aSel ) ) { - SelectAll( FALSE ); + SelectAll( sal_False ); EditItemText( pEntry, (SvLBoxString*)pItem, aSel ); } } @@ -1448,7 +1448,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) // Scrollen if( rPos.Y() < 12 ) { - SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE ); + SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False ); ScrollOutputArea( +1 ); } else @@ -1456,7 +1456,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) Size aSize( pImp->GetOutputSize() ); if( rPos.Y() > aSize.Height() - 12 ) { - SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE ); + SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False ); ScrollOutputArea( -1 ); } } @@ -1473,7 +1473,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos ) } -SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, BOOL bHit ) const +SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, sal_Bool bHit ) const { DBG_CHKTHIS(SvTreeListBox,0); SvLBoxEntry* pEntry = pImp->GetEntry( rPos ); @@ -1535,21 +1535,21 @@ void SvTreeListBox::InvalidateEntry( SvLBoxEntry* pEntry ) } -long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags) +long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags) { return PaintEntry1(pEntry,nLine,nTabFlags); } #define SV_TAB_BORDER 8 -long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, - BOOL bHasClipRegion ) +long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags, + sal_Bool bHasClipRegion ) { DBG_CHKTHIS(SvTreeListBox,0); Rectangle aRect; // multi purpose - BOOL bHorSBar = pImp->HasHorScrollBar(); + sal_Bool bHorSBar = pImp->HasHorScrollBar(); PreparePaint( pEntry ); // #97680# ------------------ @@ -1575,11 +1575,11 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, Color aBackupColor = GetFillColor(); bool bCurFontIsSel = false; - BOOL bInUse = pEntry->HasInUseEmphasis(); + sal_Bool bInUse = pEntry->HasInUseEmphasis(); // wenn eine ClipRegion von aussen gesetzt wird, dann // diese nicht zuruecksetzen - BOOL bResetClipRegion = !bHasClipRegion; - BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; + sal_Bool bResetClipRegion = !bHasClipRegion; + sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Font aHighlightFont( GetFont() ); @@ -1591,24 +1591,24 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, if( !bHasClipRegion && nWindowStyle & WB_HSCROLL ) { SetClipRegion( Region(pImp->GetClipRegionRect()) ); - bHasClipRegion = TRUE; + bHasClipRegion = sal_True; } SvViewDataEntry* pViewDataEntry = GetViewDataEntry( pEntry ); - USHORT nTabCount = aTabs.Count(); - USHORT nItemCount = pEntry->ItemCount(); - USHORT nCurTab = 0; - USHORT nCurItem = 0; + sal_uInt16 nTabCount = aTabs.Count(); + sal_uInt16 nItemCount = pEntry->ItemCount(); + sal_uInt16 nCurTab = 0; + sal_uInt16 nCurItem = 0; while( nCurTab < nTabCount && nCurItem < nItemCount ) { SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nCurTab ); - USHORT nNextTab = nCurTab + 1; + sal_uInt16 nNextTab = nCurTab + 1; SvLBoxTab* pNextTab = nNextTab < nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextTab) : 0; SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0; - USHORT nFlags = pTab->nFlags; + sal_uInt16 nFlags = pTab->nFlags; Size aSize( pItem->GetSize( pViewDataEntry, nCurItem )); long nTabPos = GetTabPos( pEntry, pTab ); @@ -1634,7 +1634,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, if( !bHasClipRegion && nX + aSize.Width() >= nMaxRight ) { SetClipRegion( Region(pImp->GetClipRegionRect()) ); - bHasClipRegion = TRUE; + bHasClipRegion = sal_True; } aEntryPos.X() = nX; aEntryPos.Y() = nLine; @@ -1644,7 +1644,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, Wallpaper aWallpaper = GetBackground(); int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION; - USHORT nItemType = pItem->IsA(); + sal_uInt16 nItemType = pItem->IsA(); if ( pViewDataEntry->IsSelected() && bSelTab && !pViewDataEntry->IsCursored() ) { @@ -1758,7 +1758,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, SetFont( aBackupFont ); } - USHORT nFirstDynTabPos; + sal_uInt16 nFirstDynTabPos; SvLBoxTab* pFirstDynamicTab = GetFirstDynamicTab( nFirstDynTabPos ); long nDynTabPos = GetTabPos( pEntry, pFirstDynamicTab ); nDynTabPos += pImp->nNodeBmpTabDistance; @@ -1772,7 +1772,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, { // ersten festen Tab suchen, und pruefen ob die Node-Bitmap // in ihn hineinragt - USHORT nNextTab = nFirstDynTabPos; + sal_uInt16 nNextTab = nFirstDynTabPos; SvLBoxTab* pNextTab; do { @@ -1805,12 +1805,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, } aPos.Y() += (nTempEntryHeight - pImg->GetSizePixel().Height()) / 2; - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( !IsEnabled() ) nStyle |= IMAGE_DRAW_DISABLE; //native - BOOL bNativeOK = FALSE; + sal_Bool bNativeOK = sal_False; if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) ) { ImplControlValue aControlValue; @@ -1864,7 +1864,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) long nRealWidth = pImp->GetOutputSize().Width(); nRealWidth -= GetMapMode().GetOrigin().X(); - USHORT nCurTab; + sal_uInt16 nCurTab; SvLBoxTab* pTab = GetFirstTab( SV_LBOXTAB_SHOW_SELECTION, nCurTab ); long nTabPos = 0; if( pTab ) @@ -1882,7 +1882,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) nNextTabPos += 50; } - BOOL bUserSelection = (BOOL)( nTreeFlags & TREEFLAG_USESEL ) != 0; + sal_Bool bUserSelection = (sal_Bool)( nTreeFlags & TREEFLAG_USESEL ) != 0; if( !bUserSelection ) { if( pTab && nCurTab < pEntry->ItemCount() ) @@ -1907,7 +1907,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine ) // wenn erster SelTab != 0, dann muessen wir auch rechnen if( nFocusWidth == -1 || nFirstSelTab ) { - USHORT nLastTab; + sal_uInt16 nLastTab; SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab); nLastTab++; if( nLastTab < aTabs.Count() ) // gibts noch einen ? @@ -1955,23 +1955,23 @@ long SvTreeListBox::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) long nPos = pTab->GetPos(); if( pTab->IsDynamic() ) { - USHORT nDepth = pModel->GetDepth( pEntry ); - nDepth = nDepth * (USHORT)nIndent; + sal_uInt16 nDepth = pModel->GetDepth( pEntry ); + nDepth = nDepth * (sal_uInt16)nIndent; nPos += (long)nDepth; } return nPos; } SvLBoxItem* SvTreeListBox::GetItem_Impl( SvLBoxEntry* pEntry, long nX, - SvLBoxTab** ppTab, USHORT nEmptyWidth ) + SvLBoxTab** ppTab, sal_uInt16 nEmptyWidth ) { DBG_CHKTHIS(SvTreeListBox,0); SvLBoxItem* pItemClicked = 0; - USHORT nTabCount = aTabs.Count(); - USHORT nItemCount = pEntry->ItemCount(); + sal_uInt16 nTabCount = aTabs.Count(); + sal_uInt16 nItemCount = pEntry->ItemCount(); SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0); SvLBoxItem* pItem = pEntry->GetItem(0); - USHORT nNextItem = 1; + sal_uInt16 nNextItem = 1; nX -= GetMapMode().GetOrigin().X(); long nRealWidth = pImp->GetOutputSize().Width(); nRealWidth -= GetMapMode().GetOrigin().X(); @@ -2040,9 +2040,9 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry ) SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0); SvLBoxItem* pItem = pEntry->GetItem(0); - USHORT nTabCount = aTabs.Count(); + sal_uInt16 nTabCount = aTabs.Count(); - USHORT nNext = 1; + sal_uInt16 nNext = 1; while ( !pTab->IsDynamic() && nNext < nTabCount ) { pItem = pEntry->GetItem( nNext ); @@ -2052,7 +2052,7 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry ) return pItem; } -void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData ) +void SvTreeListBox::AddTab(long nTabPos,sal_uInt16 nFlags,void* pUserData ) { DBG_CHKTHIS(SvTreeListBox,0); nFocusWidth = -1; @@ -2061,7 +2061,7 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData ) aTabs.Insert( pTab, aTabs.Count() ); if( nTreeFlags & TREEFLAG_USESEL ) { - USHORT nPos = aTabs.Count() - 1; + sal_uInt16 nPos = aTabs.Count() - 1; if( nPos >= nFirstSelTab && nPos <= nLastSelTab ) pTab->nFlags |= SV_LBOXTAB_SHOW_SELECTION; else @@ -2073,11 +2073,11 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData ) -SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const +SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( sal_uInt16& rPos ) const { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nCurTab = 0; - USHORT nTabCount = aTabs.Count(); + sal_uInt16 nCurTab = 0; + sal_uInt16 nTabCount = aTabs.Count(); while( nCurTab < nTabCount ) { SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(nCurTab); @@ -2093,21 +2093,21 @@ SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const SvLBoxTab* SvTreeListBox::GetFirstDynamicTab() const { - USHORT nDummy; + sal_uInt16 nDummy; return GetFirstDynamicTab( nDummy ); } SvLBoxTab* SvTreeListBox::GetTab( SvLBoxEntry* pEntry, SvLBoxItem* pItem) const { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nPos = pEntry->GetPos( pItem ); + sal_uInt16 nPos = pEntry->GetPos( pItem ); return (SvLBoxTab*)aTabs.GetObject( nPos ); } void SvTreeListBox::ClearTabList() { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nTabCount = aTabs.Count(); + sal_uInt16 nTabCount = aTabs.Count(); while( nTabCount ) { nTabCount--; @@ -2151,7 +2151,7 @@ void SvTreeListBox::NotifyInvalidating() DBG_CHKTHIS(SvTreeListBox,0); } -void SvTreeListBox::Invalidate( USHORT nInvalidateFlags ) +void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags ) { DBG_CHKTHIS(SvTreeListBox,0); if( nFocusWidth == -1 ) @@ -2162,7 +2162,7 @@ void SvTreeListBox::Invalidate( USHORT nInvalidateFlags ) pImp->Invalidate(); } -void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags ) +void SvTreeListBox::Invalidate( const Rectangle& rRect, sal_uInt16 nInvalidateFlags ) { DBG_CHKTHIS(SvTreeListBox,0); if( nFocusWidth == -1 ) @@ -2173,11 +2173,11 @@ void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags } -void SvTreeListBox::SetHighlightRange( USHORT nStart, USHORT nEnd) +void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd) { DBG_CHKTHIS(SvTreeListBox,0); - USHORT nTemp; + sal_uInt16 nTemp; nTreeFlags |= TREEFLAG_USESEL; if( nStart > nEnd ) { @@ -2200,12 +2200,12 @@ void SvTreeListBox::RemoveHighlightRange() Invalidate(); } -ULONG SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*) +sal_uIntPtr SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*) { return LIST_APPEND; } -ULONG SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*) +sal_uIntPtr SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*) { DBG_CHKTHIS(SvTreeListBox,0); return LIST_APPEND; @@ -2251,10 +2251,10 @@ void SvTreeListBox::RemoveParentKeepChilds( SvLBoxEntry* pParent ) pModel->Remove( pParent ); } -SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos ) +SvLBoxTab* SvTreeListBox::GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rPos ) { - USHORT nTabCount = aTabs.Count(); - for( USHORT nPos = 0; nPos < nTabCount; nPos++ ) + sal_uInt16 nTabCount = aTabs.Count(); + for( sal_uInt16 nPos = 0; nPos < nTabCount; nPos++ ) { SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nPos ); if( (pTab->nFlags & nFlagMask) ) @@ -2267,17 +2267,17 @@ SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos ) return 0; } -SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos ) +SvLBoxTab* SvTreeListBox::GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos ) { short nTabCount = (short)aTabs.Count(); if( nTabCount ) { for( short nPos = nTabCount-1; nPos >= 0; nPos-- ) { - SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (USHORT)nPos ); + SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (sal_uInt16)nPos ); if( (pTab->nFlags & nFlagMask) ) { - rTabPos = (USHORT)nPos; + rTabPos = (sal_uInt16)nPos; return pTab; } } @@ -2286,12 +2286,12 @@ SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos ) return 0; } -void SvTreeListBox::SetAddMode( BOOL bAdd ) +void SvTreeListBox::SetAddMode( sal_Bool bAdd ) { pImp->SetAddMode( bAdd ); } -BOOL SvTreeListBox::IsAddMode() const +sal_Bool SvTreeListBox::IsAddMode() const { return pImp->IsAddMode(); } @@ -2317,8 +2317,8 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData ) return pImp->pIntlWrapper->getCaseCollator()->compareString( aLeft, aRight ); } -void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uIntPtr nPos ) { if( nActionId == LISTACTION_CLEARING ) CancelTextEditing(); @@ -2346,14 +2346,14 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, break; case LISTACTION_RESORTING: - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); break; case LISTACTION_RESORTED: // nach Sortierung den ersten Eintrag anzeigen, dabei die // Selektion erhalten. - MakeVisible( (SvLBoxEntry*)pModel->First(), TRUE ); - SetUpdateMode( TRUE ); + MakeVisible( (SvLBoxEntry*)pModel->First(), sal_True ); + SetUpdateMode( sal_True ); break; case LISTACTION_CLEARED: @@ -2367,8 +2367,8 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, long SvTreeListBox::GetTextOffset() const { DBG_CHKTHIS(SvTreeListBox,0); - BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; - BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | + sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; + sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; long nStartPos = TAB_STARTPOS; long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); @@ -2446,12 +2446,12 @@ void SvTreeListBox::EndSelection() pImp->EndSelection(); } -BOOL SvTreeListBox::IsNodeButton( const Point& rPos ) const +sal_Bool SvTreeListBox::IsNodeButton( const Point& rPos ) const { SvLBoxEntry* pEntry = GetEntry( rPos ); if( pEntry ) return pImp->IsNodeButton( rPos, pEntry ); - return FALSE; + return sal_False; } void SvTreeListBox::RepaintScrollBars() const @@ -2469,7 +2469,7 @@ ScrollBar *SvTreeListBox::GetHScroll() return &((SvTreeListBox*)this)->pImp->aHorSBar; } -void SvTreeListBox::EnableAsyncDrag( BOOL b ) +void SvTreeListBox::EnableAsyncDrag( sal_Bool b ) { pImp->EnableAsyncDrag( b ); } @@ -2507,16 +2507,16 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) { if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - nEntryHeight = 0; // _together_ with TRUE of 1. par (bFont) of InitSettings() a zero-height + nEntryHeight = 0; // _together_ with sal_True of 1. par (bFont) of InitSettings() a zero-height // forces complete recalc of heights! - InitSettings( TRUE, TRUE, TRUE ); + InitSettings( sal_True, sal_True, sal_True ); Invalidate(); } else Control::DataChanged( rDCEvt ); } -void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) +void SvTreeListBox::InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); if( bFont ) @@ -2543,17 +2543,17 @@ void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) pCheckButtonData->SetDefaultImages( this ); } -BOOL SvTreeListBox::IsCellFocusEnabled() const +sal_Bool SvTreeListBox::IsCellFocusEnabled() const { return pImp->IsCellFocusEnabled(); } -bool SvTreeListBox::SetCurrentTabPos( USHORT _nNewPos ) +bool SvTreeListBox::SetCurrentTabPos( sal_uInt16 _nNewPos ) { return pImp->SetCurrentTabPos( _nNewPos ); } -USHORT SvTreeListBox::GetCurrentTabPos() const +sal_uInt16 SvTreeListBox::GetCurrentTabPos() const { return pImp->GetCurrentTabPos(); } @@ -2575,7 +2575,7 @@ PopupMenu* SvTreeListBox::CreateContextMenu( void ) return NULL; } -void SvTreeListBox::ExcecuteContextMenuAction( USHORT ) +void SvTreeListBox::ExcecuteContextMenuAction( sal_uInt16 ) { DBG_WARNING( "SvTreeListBox::ExcecuteContextMenuAction(): now there's happening nothing!" ); } @@ -2584,17 +2584,17 @@ void SvTreeListBox::EnableContextMenuHandling( void ) { DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" ); - pImp->bContextMenuHandling = TRUE; + pImp->bContextMenuHandling = sal_True; } -void SvTreeListBox::EnableContextMenuHandling( BOOL b ) +void SvTreeListBox::EnableContextMenuHandling( sal_Bool b ) { DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" ); pImp->bContextMenuHandling = b; } -BOOL SvTreeListBox::IsContextMenuHandlingEnabled( void ) const +sal_Bool SvTreeListBox::IsContextMenuHandlingEnabled( void ) const { DBG_ASSERT( pImp, "-SvTreeListBox::IsContextMenuHandlingEnabled(): No implementation!" ); @@ -2659,7 +2659,7 @@ void SvTreeListBox::EnableCellFocus() pImp->EnableCellFocus(); } -void SvTreeListBox::CallImplEventListeners(ULONG nEvent, void* pData) +void SvTreeListBox::CallImplEventListeners(sal_uIntPtr nEvent, void* pData) { CallEventListeners(nEvent, pData); } diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 61112f6669ca..fc39b771bf92 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -128,7 +128,7 @@ extern ::rtl::OUString CreateExactSizeText_Impl( sal_Int64 nSize ); // fileview. struct FolderHistory { String m_sURL; - ULONG m_nGroup; + sal_uIntPtr m_nGroup; FolderHistory( const String& _rURL, sal_Int32 _nGroup ) : m_sURL( _rURL ), m_nGroup( _nGroup ) {} @@ -141,7 +141,7 @@ ODocumentInfoPreview::ODocumentInfoPreview( Window* pParent ,WinBits _nBits) : W { m_pEditWin = new SvtExtendedMultiLineEdit_Impl(this,_nBits); m_pEditWin->Show(); - m_pEditWin->EnableCursor( FALSE ); + m_pEditWin->EnableCursor( sal_False ); m_pInfoTable = new SvtDocInfoTable_Impl(); // detect application language m_aLocale = SvtPathOptions().GetLocale(); @@ -190,7 +190,7 @@ void ODocumentInfoPreview::fill( if (!i_xDocProps.is()) throw RuntimeException(); ::rtl::OUString aStr; - m_pEditWin->SetAutoScroll( FALSE ); + m_pEditWin->SetAutoScroll( sal_False ); aStr = i_xDocProps->getTitle(); if (aStr.getLength()) { @@ -244,7 +244,7 @@ void ODocumentInfoPreview::fill( // size if ( i_rURL.Len() > 0 ) { - ULONG nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL ); + sal_uIntPtr nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL ); m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_SIZE ), CreateExactSizeText_Impl( nDocSize ) ); @@ -292,7 +292,7 @@ void ODocumentInfoPreview::fill( } m_pEditWin->SetSelection( Selection( 0, 0 ) ); - m_pEditWin->SetAutoScroll( TRUE ); + m_pEditWin->SetAutoScroll( sal_True ); } // ----------------------------------------------------------------------------- @@ -347,7 +347,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) : aIconCtrl.SetAccessibleName( String( RTL_CONSTASCII_USTRINGPARAM("Groups") ) ); aIconCtrl.SetHelpId( HID_TEMPLATEDLG_ICONCTRL ); - aIconCtrl.SetChoiceWithCursor( TRUE ); + aIconCtrl.SetChoiceWithCursor( sal_True ); aIconCtrl.SetSelectionMode( SINGLE_SELECTION ); aIconCtrl.Show(); @@ -420,7 +420,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) : SvtIconWindow_Impl::~SvtIconWindow_Impl() { - for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i ) + for ( sal_uIntPtr i = 0; i < aIconCtrl.GetEntryCount(); ++i ) { SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( i ); delete (String*)pEntry->GetUserData(); @@ -430,7 +430,7 @@ SvtIconWindow_Impl::~SvtIconWindow_Impl() SvxIconChoiceCtrlEntry* SvtIconWindow_Impl::GetEntry( const String& rURL ) const { SvxIconChoiceCtrlEntry* pEntry = NULL; - for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i ) + for ( sal_uIntPtr i = 0; i < aIconCtrl.GetEntryCount(); ++i ) { SvxIconChoiceCtrlEntry* pTemp = aIconCtrl.GetEntry( i ); String aURL( *( (String*)pTemp->GetUserData() ) ); @@ -468,7 +468,7 @@ String SvtIconWindow_Impl::GetCursorPosIconURL() const String SvtIconWindow_Impl::GetSelectedIconURL() const { - ULONG nPos; + sal_uIntPtr nPos; SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetSelectedEntry( nPos ); String aURL; if ( pEntry ) @@ -478,7 +478,7 @@ String SvtIconWindow_Impl::GetSelectedIconURL() const String SvtIconWindow_Impl::GetSelectedIconText() const { - ULONG nPos; + sal_uIntPtr nPos; return MnemonicGenerator::EraseAllMnemonicChars( aIconCtrl.GetSelectedEntry( nPos )->GetText() ); } @@ -496,9 +496,9 @@ void SvtIconWindow_Impl::InvalidateIconControl() aIconCtrl.Invalidate(); } -ULONG SvtIconWindow_Impl::GetCursorPos() const +sal_uIntPtr SvtIconWindow_Impl::GetCursorPos() const { - ULONG nPos = ~ULONG(0); + sal_uIntPtr nPos = ~sal_uIntPtr(0); SvxIconChoiceCtrlEntry* pCursorEntry = aIconCtrl.GetCursor( ); if ( pCursorEntry ) @@ -507,15 +507,15 @@ ULONG SvtIconWindow_Impl::GetCursorPos() const return nPos; } -ULONG SvtIconWindow_Impl::GetSelectEntryPos() const +sal_uIntPtr SvtIconWindow_Impl::GetSelectEntryPos() const { - ULONG nPos; + sal_uIntPtr nPos; if ( !aIconCtrl.GetSelectedEntry( nPos ) ) - nPos = ~ULONG(0); + nPos = ~sal_uIntPtr(0); return nPos; } -void SvtIconWindow_Impl::SetCursorPos( ULONG nPos ) +void SvtIconWindow_Impl::SetCursorPos( sal_uIntPtr nPos ) { SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( nPos ); aIconCtrl.SetCursor( pEntry ); @@ -532,7 +532,7 @@ long SvtIconWindow_Impl::CalcHeight() const { // calculate the required height of the IconControl long nHeight = 0; - ULONG nCount = aIconCtrl.GetEntryCount(); + sal_uIntPtr nCount = aIconCtrl.GetEntryCount(); if ( nCount > 0 ) // bottom of the last icon nHeight = aIconCtrl.GetEntry(nCount-1)->GetBoundRect().Bottom(); @@ -551,9 +551,9 @@ sal_Bool SvtIconWindow_Impl::IsRootURL( const String& rURL ) const rURL == aSamplesFolderRootURL; } -ULONG SvtIconWindow_Impl::GetRootPos( const String& rURL ) const +sal_uIntPtr SvtIconWindow_Impl::GetRootPos( const String& rURL ) const { - ULONG nPos = ~ULONG(0); + sal_uIntPtr nPos = ~sal_uIntPtr(0); if ( aNewDocumentRootURL.Match( rURL ) == STRING_MATCH ) nPos = 0; else if ( aTemplateRootURL.Match( rURL ) == STRING_MATCH ) @@ -653,7 +653,7 @@ Sequence< ::rtl::OUString > SvtFileViewWindow_Impl::GetNewDocContents() const ::rtl::OUString aImageURL; ::rtl::OUString aTargetFrame; - UINT32 i, nCount = aDynamicMenuEntries.getLength(); + sal_uInt32 i, nCount = aDynamicMenuEntries.getLength(); ::rtl::OUString sSeparator( ASCII_STR("private:separator") ); ::rtl::OUString sSlotURL( ASCII_STR("slot:5500") ); @@ -795,7 +795,7 @@ void SvtExtendedMultiLineEdit_Impl::InsertEntry( const String& rTitle, const Str aText += rTitle; aText += ':'; InsertText( aText ); - ULONG nPara = GetParagraphCount() - 1; + sal_uIntPtr nPara = GetParagraphCount() - 1; SetAttrib( TextAttribFontWeight( WEIGHT_BOLD ), nPara, 0, aText.Len() ); aText = '\n'; @@ -975,7 +975,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B // disabling must be done here, does not work in ctor because // execute of the dialog will overwrite it // ( own execute method would help ) - pTextWin->EnableInput( FALSE, TRUE ); + pTextWin->EnableInput( sal_False, sal_True ); if ( pTextWin->IsReallyVisible() ) { sal_Bool b = sal_True; @@ -1113,7 +1113,7 @@ SvtTemplateWindow::~SvtTemplateWindow() delete pFrameWin; if ( pHistoryList ) { - for ( UINT32 i = 0; i < pHistoryList->Count(); ++i ) + for ( sal_uInt32 i = 0; i < pHistoryList->Count(); ++i ) delete pHistoryList->GetObject(i); delete pHistoryList; } @@ -1130,7 +1130,7 @@ IMPL_LINK ( SvtTemplateWindow , IconClickHdl_Impl, SvtIconChoiceCtrl *, EMPTYARG { pFileWin->OpenRoot( aURL ); pIconWin->InvalidateIconControl(); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False ); } return 0; } @@ -1167,10 +1167,10 @@ IMPL_LINK ( SvtTemplateWindow , FileDblClickHdl_Impl, SvtFileView *, EMPTYARG ) IMPL_LINK ( SvtTemplateWindow , NewFolderHdl_Impl, SvtFileView *, EMPTYARG ) { pFrameWin->OpenFile( String(), sal_True, sal_False, sal_False ); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False ); String sURL = pFileWin->GetFolderURL(); - ULONG nPos = pIconWin->GetRootPos( sURL ); + sal_uIntPtr nPos = pIconWin->GetRootPos( sURL ); AppendHistoryURL( sURL, nPos ); aNewFolderHdl.Call( this ); @@ -1241,7 +1241,7 @@ void SvtTemplateWindow::PrintFile( const String& rURL ) // ------------------------------------------------------------------------ -void SvtTemplateWindow::AppendHistoryURL( const String& rURL, ULONG nGroup ) +void SvtTemplateWindow::AppendHistoryURL( const String& rURL, sal_uIntPtr nGroup ) { sal_Bool bInsert = sal_True; if ( !pHistoryList ) @@ -1274,7 +1274,7 @@ void SvtTemplateWindow::OpenHistory() // ------------------------------------------------------------------------ -void SvtTemplateWindow::DoAction( USHORT nAction ) +void SvtTemplateWindow::DoAction( sal_uInt16 nAction ) { switch( nAction ) { @@ -1323,16 +1323,16 @@ void SvtTemplateWindow::InitToolBoxes() aSize.Height() += 4; aFrameWinTB.SetPosSizePixel( Point( pFrameWin->GetPosPixel().X() + 2, 2 ), aSize ); - BOOL bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT ); + sal_Bool bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT ); if ( bFlat ) { aFileViewTB.SetOutStyle( TOOLBOX_STYLE_FLAT ); aFrameWinTB.SetOutStyle( TOOLBOX_STYLE_FLAT ); } - aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, FALSE ); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, FALSE ); - aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, sal_False ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, sal_False ); + aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False ); Link aLink = LINK( this, SvtTemplateWindow, ClickHdl_Impl ); aFileViewTB.SetClickHdl( aLink ); @@ -1344,7 +1344,7 @@ void SvtTemplateWindow::InitToolBoxes() void SvtTemplateWindow::InitToolBoxImages() { SvtMiscOptions aMiscOpt; - BOOL bLarge = aMiscOpt.AreCurrentSymbolsLarge(); + sal_Bool bLarge = aMiscOpt.AreCurrentSymbolsLarge(); sal_Bool bHiContrast = aFileViewTB.GetSettings().GetStyleSettings().GetHighContrastMode(); aFileViewTB.SetItemImage( TI_DOCTEMPLATE_BACK, Image( SvtResId( @@ -1376,13 +1376,13 @@ void SvtTemplateWindow::UpdateIcons() long SvtTemplateWindow::PreNotify( NotifyEvent& rNEvt ) { - USHORT nType = rNEvt.GetType(); + sal_uInt16 nType = rNEvt.GetType(); long nRet = 0; if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() ) { const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode(); - USHORT nCode = rKeyCode.GetCode(); + sal_uInt16 nCode = rKeyCode.GetCode(); if ( KEY_BACKSPACE == nCode && !rKeyCode.GetModifier() && pFileWin->HasChildPathFocus() ) { @@ -1581,7 +1581,7 @@ void SvtTemplateWindow::ReadViewSettings() // the selected view (details or preview) pFrameWin->ToggleView( TI_DOCTEMPLATE_DOCINFO == nSelectedView ); - aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, TRUE ); + aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, sal_True ); // the split ratio sal_Int32 nSplitFileAndFrameSize = aSplitWin.GetItemSize( FILEWIN_ID ) + aSplitWin.GetItemSize( FRAMEWIN_ID ); diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx index acb7c602ad30..42969f3ad99f 100644 --- a/svtools/source/contnr/templwin.hxx +++ b/svtools/source/contnr/templwin.hxx @@ -94,13 +94,13 @@ public: String GetCursorPosIconURL() const; String GetIconText( const String& rURL ) const; void InvalidateIconControl(); - void SetCursorPos( ULONG nPos ); - ULONG GetCursorPos() const; - ULONG GetSelectEntryPos() const; + void SetCursorPos( sal_uIntPtr nPos ); + sal_uIntPtr GetCursorPos() const; + sal_uIntPtr GetSelectEntryPos() const; void SetFocus(); long CalcHeight() const; sal_Bool IsRootURL( const String& rURL ) const; - ULONG GetRootPos( const String& rURL ) const; + sal_uIntPtr GetRootPos( const String& rURL ) const; void UpdateIcons( sal_Bool _bHiContrast ); inline sal_Bool ProcessKeyEvent( const KeyEvent& rKEvt ); @@ -267,9 +267,9 @@ private: DECL_LINK( ResizeHdl_Impl, SplitWindow* ); // used for split and initial setting of toolbar pos void PrintFile( const String& rURL ); - void AppendHistoryURL( const String& rURL, ULONG nGroup ); + void AppendHistoryURL( const String& rURL, sal_uIntPtr nGroup ); void OpenHistory(); - void DoAction( USHORT nAction ); + void DoAction( sal_uInt16 nAction ); void InitToolBoxes(); void InitToolBoxImages(); void UpdateIcons(); diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 3395dffc28f5..88fe53e2bf10 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -89,7 +89,7 @@ void SvListEntry::SetListPositions() if( pChilds ) { SvListEntry *pEntry = (SvListEntry*)pChilds->First(); - ULONG nCur = 0; + sal_uIntPtr nCur = 0; while ( pEntry ) { pEntry->nListPos &= 0x80000000; @@ -162,7 +162,7 @@ void SvTreeEntryList::DestroyAll() SvTreeList::SvTreeList() { nEntryCount = 0; - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; nRefCount = 1; pRootItem = new SvListEntry; eSortMode = SortNone; @@ -198,11 +198,11 @@ SvTreeList::~SvTreeList() |* *************************************************************************/ -void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvTreeList::Broadcast( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uIntPtr nPos ) { - ULONG nViewCount = aViewList.Count(); - for( ULONG nCurView = 0; nCurView < nViewCount; nCurView++ ) + sal_uIntPtr nViewCount = aViewList.Count(); + for( sal_uIntPtr nCurView = 0; nCurView < nViewCount; nCurView++ ) { SvListView* pView = (SvListView*)aViewList.GetObject( nCurView ); if( pView ) @@ -212,7 +212,7 @@ void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1, void SvTreeList::InsertView( SvListView* pView) { - ULONG nPos = aViewList.GetPos( pView ); + sal_uIntPtr nPos = aViewList.GetPos( pView ); if ( nPos == LIST_ENTRY_NOTFOUND ) { aViewList.Insert( pView, LIST_APPEND ); @@ -222,7 +222,7 @@ void SvTreeList::InsertView( SvListView* pView) void SvTreeList::RemoveView( SvListView* pView ) { - ULONG nPos = aViewList.GetPos( pView ); + sal_uIntPtr nPos = aViewList.GetPos( pView ); if ( nPos != LIST_ENTRY_NOTFOUND ) { aViewList.Remove( pView ); @@ -232,15 +232,15 @@ void SvTreeList::RemoveView( SvListView* pView ) // Ein Entry ist sichtbar, wenn alle Parents expandiert sind -BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const +sal_Bool SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params"); - BOOL bRetVal=FALSE; + sal_Bool bRetVal=sal_False; do { if ( pEntry == pRootItem ) { - bRetVal=TRUE; + bRetVal=sal_True; break; } pEntry = pEntry->pParent; @@ -248,10 +248,10 @@ BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) return bRetVal; } -USHORT SvTreeList::GetDepth( SvListEntry* pEntry ) const +sal_uInt16 SvTreeList::GetDepth( SvListEntry* pEntry ) const { DBG_ASSERT(pEntry&&pEntry!=pRootItem,"GetDepth:Bad Entry"); - USHORT nDepth = 0; + sal_uInt16 nDepth = 0; while( pEntry->pParent != pRootItem ) { nDepth++; @@ -300,20 +300,20 @@ void SvTreeList::Clear() |* *************************************************************************/ -BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const +sal_Bool SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const { if ( !pParent ) pParent = pRootItem; - BOOL bIsChild = FALSE; + sal_Bool bIsChild = sal_False; SvTreeEntryList* pList = pParent->pChilds; if ( !pList ) - return FALSE; + return sal_False; SvListEntry* pActualChild = (SvListEntry*)(pList->First()); while( !bIsChild && pActualChild ) { if ( pActualChild == pChild ) - bIsChild = TRUE; + bIsChild = sal_True; else { if ( pActualChild->pChilds ) @@ -324,7 +324,7 @@ BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const return bIsChild; } -ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos) +sal_uIntPtr SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uIntPtr nListPos) { // pDest darf Null sein! DBG_ASSERT(pSrcEntry,"Entry?"); @@ -339,7 +339,7 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n if ( pSrcEntry == pTargetParent ) return pSrcEntry->GetChildListPos(); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; SvTreeEntryList* pDstList = pTargetParent->pChilds; SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChilds; @@ -368,20 +368,20 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n // Listenpositionen in Zielliste korrigieren SetListPositions( pDstList ); - if ( pSrcList && (ULONG)pSrcList != (ULONG)pDstList ) + if ( pSrcList && (sal_uIntPtr)pSrcList != (sal_uIntPtr)pDstList ) SetListPositions( pSrcList ); #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif - ULONG nRetVal = pDstList->GetPos( pSrcEntry ); + sal_uIntPtr nRetVal = pDstList->GetPos( pSrcEntry ); DBG_ASSERT(nRetVal==pSrcEntry->GetChildListPos(),"ListPos not valid"); Broadcast( LISTACTION_MOVED,pSrcEntry,pTargetParent,nRetVal); return nRetVal; } -ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos) +sal_uIntPtr SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uIntPtr nListPos) { // pDest darf Null sein! DBG_ASSERT(pSrcEntry,"Entry?"); @@ -390,9 +390,9 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n if ( !pTargetParent->pChilds ) pTargetParent->pChilds = new SvTreeEntryList; - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; - ULONG nCloneCount = 0; + sal_uIntPtr nCloneCount = 0; SvListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount ); nEntryCount += nCloneCount; @@ -405,7 +405,7 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n CheckIntegrity(); #endif Broadcast( LISTACTION_INSERTED_TREE, pClonedEntry ); - ULONG nRetVal = pDstList->GetPos( pClonedEntry ); + sal_uIntPtr nRetVal = pDstList->GetPos( pClonedEntry ); return nRetVal; } @@ -424,7 +424,7 @@ CheckIntegrity(); void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { SvListEntry* pParent; - ULONG nPos; + sal_uIntPtr nPos; if ( !pDstEntry ) { @@ -453,7 +453,7 @@ void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { SvListEntry* pParent; - ULONG nPos; + sal_uIntPtr nPos; if ( !pDstEntry ) { @@ -480,7 +480,7 @@ void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry) { SvListEntry* pParent; - ULONG nPos; + sal_uIntPtr nPos; if ( !pDstEntry ) { @@ -497,7 +497,7 @@ void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry) void SvTreeList::InsertTree(SvListEntry* pSrcEntry, - SvListEntry* pTargetParent,ULONG nListPos) + SvListEntry* pTargetParent,sal_uIntPtr nListPos) { DBG_ASSERT(pSrcEntry,"InsertTree:Entry?"); if ( !pSrcEntry ) @@ -511,7 +511,7 @@ void SvTreeList::InsertTree(SvListEntry* pSrcEntry, // Sortierung beruecksichtigen GetInsertionPos( pSrcEntry, pTargetParent, nListPos ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; pSrcEntry->pParent = pTargetParent; // Parent umsetzen SvTreeEntryList* pDstList = pTargetParent->pChilds; @@ -550,7 +550,7 @@ SvListEntry* SvTreeList::CreateEntry() const |* *************************************************************************/ -SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const +SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, sal_uIntPtr& nCloneCount ) const { SvListEntry* pClonedEntry = CloneEntry( pEntry ); nCloneCount = 1; @@ -572,7 +572,7 @@ SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds, SvListEntry* pNewParent, - ULONG& nCloneCount ) const + sal_uIntPtr& nCloneCount ) const { DBG_ASSERT(pChilds->Count(),"Childs?"); SvTreeEntryList* pClonedChilds = new SvTreeEntryList; @@ -606,16 +606,16 @@ SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds, |* *************************************************************************/ -ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const +sal_uIntPtr SvTreeList::GetChildCount( SvListEntry* pParent ) const { if ( !pParent ) return GetEntryCount(); if ( !pParent || !pParent->pChilds) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uIntPtr nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = Next( pParent, &nActDepth ); @@ -635,16 +635,16 @@ ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const |* *************************************************************************/ -ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const +sal_uIntPtr SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const { DBG_ASSERT(pView,"GetVisChildCount:No View"); if ( !pParent ) pParent = pRootItem; if ( !pParent || !pView->IsExpanded(pParent) || !pParent->pChilds ) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uIntPtr nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = NextVisible( pView, pParent, &nActDepth ); @@ -654,16 +654,16 @@ ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pPa return nCount; } -ULONG SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const +sal_uIntPtr SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const { DBG_ASSERT(pView,"GetChildSelCount:No View"); if ( !pParent ) pParent = pRootItem; if ( !pParent || !pParent->pChilds) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uIntPtr nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = Next( pParent, &nActDepth ); @@ -702,22 +702,22 @@ SvListEntry* SvTreeList::First() const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const +SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, sal_uInt16* pDepth ) const { DBG_ASSERT( pActEntry && pActEntry->pParent, "SvTreeList::Next: invalid entry/parent!" ); if ( !pActEntry || !pActEntry->pParent ) return NULL; - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pDepth ) { nDepth = *pDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uIntPtr nActualPos = pActEntry->GetChildListPos(); if ( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ ) { @@ -766,20 +766,20 @@ SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const +SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, sal_uInt16* pDepth ) const { DBG_ASSERT(pActEntry!=0,"Entry?"); - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pDepth ) { nDepth = *pDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uIntPtr nActualPos = pActEntry->GetChildListPos(); if ( nActualPos > 0 ) { @@ -819,7 +819,7 @@ SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const |* *************************************************************************/ -SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const +SvListEntry* SvTreeList::Last( sal_uInt16* /* nDepth */ ) const { SvTreeEntryList* pActList = pRootItem->pChilds; // if ( pActList->Count() == 0 ) @@ -845,7 +845,7 @@ SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const |* *************************************************************************/ -ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const +sal_uIntPtr SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"View/Entry?"); @@ -869,7 +869,7 @@ ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) |* *************************************************************************/ -ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const +sal_uIntPtr SvTreeList::GetVisibleCount( const SvListView* pView ) const { DBG_ASSERT(pView,"GetVisCount:No View"); if( !pView->HasViewData() ) @@ -877,7 +877,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const if ( pView->nVisibleCount ) return pView->nVisibleCount; - ULONG nPos = 0; + sal_uIntPtr nPos = 0; SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar while ( pEntry ) { @@ -893,7 +893,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const } #endif ((SvListView*)pView)->nVisibleCount = nPos; - ((SvListView*)pView)->bVisPositionsValid = TRUE; + ((SvListView*)pView)->bVisPositionsValid = sal_True; return nPos; } @@ -911,22 +911,22 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const // Funktion geht aus Geschwindigkeitsgruenden davon aus, // das der uebergebene Eintrag bereits sichtbar ist -SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,USHORT* pActDepth) const +SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,sal_uInt16* pActDepth) const { DBG_ASSERT(pView,"NextVisible:No View"); if ( !pActEntry ) return 0; - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pActDepth ) { nDepth = *pActDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uIntPtr nActualPos = pActEntry->GetChildListPos(); if ( pView->IsExpanded(pActEntry) ) { @@ -981,20 +981,20 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEn // Funktion geht aus Geschwindigkeitsgruenden davon aus, // das der uebergebene Eintrag bereits sichtbar ist -SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, USHORT* pActDepth) const +SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, sal_uInt16* pActDepth) const { DBG_ASSERT(pView&&pActEntry,"PrevVis:View/Entry?"); - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pActDepth ) { nDepth = *pActDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uIntPtr nActualPos = pActEntry->GetChildListPos(); if ( nActualPos > 0 ) { @@ -1034,7 +1034,7 @@ SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActE |* *************************************************************************/ -SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) const +SvListEntry* SvTreeList::LastVisible( const SvListView* pView, sal_uInt16* pDepth) const { DBG_ASSERT(pView,"LastVis:No View"); SvListEntry* pEntry = Last(); @@ -1055,20 +1055,20 @@ SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) c |* *************************************************************************/ -SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,USHORT& nDelta) const +SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,sal_uInt16& nDelta) const { DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis"); - ULONG nVisPos = GetVisiblePos( pView, pEntry ); + sal_uIntPtr nVisPos = GetVisiblePos( pView, pEntry ); // nDelta Eintraege vorhanden ? // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7 // nNewDelta = 10-nVisPos-1 == 4 if ( nVisPos+nDelta >= pView->nVisibleCount ) { - nDelta = (USHORT)(pView->nVisibleCount-nVisPos); + nDelta = (sal_uInt16)(pView->nVisibleCount-nVisPos); nDelta--; } - USHORT nDeltaTmp = nDelta; + sal_uInt16 nDeltaTmp = nDelta; while( nDeltaTmp ) { pEntry = NextVisible( pView, pEntry ); @@ -1088,17 +1088,17 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry |* *************************************************************************/ -SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, USHORT& nDelta ) const +SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, sal_uInt16& nDelta ) const { DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis"); - ULONG nVisPos = GetVisiblePos( pView, pEntry ); + sal_uIntPtr nVisPos = GetVisiblePos( pView, pEntry ); // nDelta Eintraege vorhanden ? // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20 // nNewDelta = nNewVisPos if ( nDelta > nVisPos ) - nDelta = (USHORT)nVisPos; - USHORT nDeltaTmp = nDelta; + nDelta = (sal_uInt16)nVisPos; + sal_uInt16 nDeltaTmp = nDelta; while( nDeltaTmp ) { pEntry = PrevVisible( pView, pEntry ); @@ -1148,8 +1148,8 @@ SvListEntry* SvTreeList::NextSibling( SvListEntry* pEntry ) const if( !pEntry ) return 0; SvTreeEntryList* pList = pEntry->pParent->pChilds; -// ULONG nPos = pList->GetPos( pEntry ); - ULONG nPos = pEntry->GetChildListPos(); +// sal_uIntPtr nPos = pList->GetPos( pEntry ); + sal_uIntPtr nPos = pEntry->GetChildListPos(); nPos++; pEntry = (SvListEntry*)(pList->GetObject( nPos )); return pEntry; @@ -1162,8 +1162,8 @@ SvListEntry* SvTreeList::PrevSibling( SvListEntry* pEntry ) const return 0; SvTreeEntryList* pList = pEntry->pParent->pChilds; - // ULONG nPos = pList->GetPos( pEntry ); - ULONG nPos = pEntry->GetChildListPos(); + // sal_uIntPtr nPos = pList->GetPos( pEntry ); + sal_uIntPtr nPos = pEntry->GetChildListPos(); if ( nPos == 0 ) return 0; nPos--; @@ -1253,7 +1253,7 @@ SvListEntry* SvTreeList::LastSelected( const SvListView* pView ) const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos ) +sal_uIntPtr SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,sal_uIntPtr nPos ) { DBG_ASSERT( pEntry,"Entry?"); @@ -1272,7 +1272,7 @@ ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos ) // Sortierung beruecksichtigen GetInsertionPos( pEntry, pParent, nPos ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; pEntry->pParent = pParent; pList->Insert( pEntry, nPos ); @@ -1299,7 +1299,7 @@ CheckIntegrity(); |* *************************************************************************/ -ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const +sal_uIntPtr SvTreeList::GetAbsPos( SvListEntry* pEntry) const { if ( !bAbsPositionsValid ) ((SvTreeList*)this)->SetAbsolutePositions(); @@ -1318,7 +1318,7 @@ ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const void SvTreeList::SetAbsolutePositions() { - ULONG nPos = 0; + sal_uIntPtr nPos = 0; SvListEntry* pEntry = First(); while ( pEntry ) { @@ -1326,7 +1326,7 @@ void SvTreeList::SetAbsolutePositions() nPos++; pEntry = Next( pEntry ); } - bAbsPositionsValid = TRUE; + bAbsPositionsValid = sal_True; #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif @@ -1357,7 +1357,7 @@ void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry ) // wenn Parent sichtbar dann Statusdaten invalidieren if ( pView->IsExpanded( pParent ) ) { - pView->bVisPositionsValid = FALSE; + pView->bVisPositionsValid = sal_False; pView->nVisibleCount = 0; } #ifdef CHECK_INTEGRITY @@ -1390,7 +1390,7 @@ void SvTreeList::Collapse( SvListView* pView, SvListEntry* pEntry ) if ( pView->IsExpanded(pParent) ) { pView->nVisibleCount = 0; - pView->bVisPositionsValid = FALSE; + pView->bVisPositionsValid = sal_False; } #ifdef CHECK_INTEGRITY CheckIntegrity(); @@ -1408,14 +1408,14 @@ CheckIntegrity(); |* *************************************************************************/ -BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) +sal_Bool SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, sal_Bool bSelect ) { DBG_ASSERT(pView&&pEntry,"Select:View/Entry?"); SvViewData* pViewData = pView->GetViewData( pEntry ); if ( bSelect ) { if ( pViewData->IsSelected() || !pViewData->IsSelectable() ) - return FALSE; + return sal_False; else { pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED; @@ -1425,7 +1425,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) else { if ( !pViewData->IsSelected() ) - return FALSE; + return sal_False; else { pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED ); @@ -1435,7 +1435,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif - return TRUE; + return sal_True; } /************************************************************************* @@ -1447,7 +1447,7 @@ CheckIntegrity(); |* Letzte Aenderung 05.04.01 |* *************************************************************************/ -BOOL SvTreeList::Remove( SvListEntry* pEntry ) +sal_Bool SvTreeList::Remove( SvListEntry* pEntry ) { DBG_ASSERT(pEntry,"Cannot remove root, use clear"); @@ -1458,22 +1458,22 @@ BOOL SvTreeList::Remove( SvListEntry* pEntry ) // Explorer aus der View Eintraege, die er nicht in die View // eingefuegt hat. Da sich der Kunde fuer ein platzendes // Office nichts kaufen kann, fange ich diesen Fall ab. - return FALSE; + return sal_False; } Broadcast( LISTACTION_REMOVING, pEntry ); - ULONG nRemoved = 1 + GetChildCount(pEntry); - bAbsPositionsValid = FALSE; + sal_uIntPtr nRemoved = 1 + GetChildCount(pEntry); + bAbsPositionsValid = sal_False; SvListEntry* pParent = pEntry->pParent; SvTreeEntryList* pList = pParent->pChilds; DBG_ASSERT(pList,"Remove:No Childlist"); - BOOL bLastEntry = FALSE; + sal_Bool bLastEntry = sal_False; if ( pEntry->HasChildListPos() ) { - ULONG nListPos = pEntry->GetChildListPos(); - bLastEntry = (nListPos == (pList->Count()-1) ) ? TRUE : FALSE; + sal_uIntPtr nListPos = pEntry->GetChildListPos(); + bLastEntry = (nListPos == (pList->Count()-1) ) ? sal_True : sal_False; pList->Remove( nListPos ); } else @@ -1503,7 +1503,7 @@ CheckIntegrity(); Broadcast( LISTACTION_REMOVED, pEntry ); delete pEntry; // loescht auch alle Childs - return TRUE; + return sal_True; } /************************************************************************* @@ -1516,7 +1516,7 @@ CheckIntegrity(); |* *************************************************************************/ -ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSelect ) +sal_uIntPtr SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,sal_Bool bSelect ) { DBG_ASSERT(pView&&pParent,"SelChilds:View/Parent?"); if ( !pParent->pChilds ) @@ -1524,9 +1524,9 @@ ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSel if ( pParent->pChilds->Count() == 0 ) return 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nDepth = nRefDepth; - ULONG nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nDepth = nRefDepth; + sal_uIntPtr nCount = 0; pParent = Next( pParent ); do { @@ -1541,7 +1541,7 @@ CheckIntegrity(); return nCount; } -void SvTreeList::SelectAll( SvListView* pView, BOOL bSelect ) +void SvTreeList::SelectAll( SvListView* pView, sal_Bool bSelect ) { DBG_ASSERT(pView,"SelectAll:NoView"); SvListEntry* pEntry = First(); @@ -1565,7 +1565,7 @@ CheckIntegrity(); } -SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const +SvListEntry* SvTreeList::GetEntryAtAbsPos( sal_uIntPtr nAbsPos ) const { SvListEntry* pEntry = First(); while ( nAbsPos && pEntry ) @@ -1576,7 +1576,7 @@ SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const return pEntry; } -SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, ULONG nVisPos ) const +SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uIntPtr nVisPos ) const { DBG_ASSERT(pView,"GetEntryAtVisPos:No View"); SvListEntry* pEntry = First(); @@ -1597,7 +1597,7 @@ void SvTreeList::SetListPositions( SvTreeEntryList* pList ) pEntry->pParent->InvalidateChildrensListPositions(); } /* - ULONG nListPos = 0; + sal_uIntPtr nListPos = 0; SvListEntry* pEntry = (SvListEntry*)(pList->First()); while( pEntry ) { @@ -1614,13 +1614,13 @@ void SvTreeList::InvalidateEntry( SvListEntry* pEntry ) Broadcast( LISTACTION_INVALIDATE_ENTRY, pEntry ); } -BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const +sal_Bool SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const { if ( !pParent ) pParent = pRootItem; - BOOL bIsChild = FALSE; + sal_Bool bIsChild = sal_False; if ( pParent->pChilds ) - bIsChild = (BOOL)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND); + bIsChild = (sal_Bool)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND); return bIsChild; } @@ -1628,7 +1628,7 @@ BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const void lcl_CheckList( SvTreeEntryList* pList ) { SvListEntry* pEntry = (SvListEntry*)(pList->First()); - ULONG nPos = 0; + sal_uIntPtr nPos = 0; while ( pEntry ) { DBG_ASSERT(pEntry->GetChildListPos()==nPos,"Wrong ListPos"); @@ -1639,7 +1639,7 @@ void lcl_CheckList( SvTreeEntryList* pList ) void SvTreeList::CheckIntegrity() const { - ULONG nMyEntryCount = 0; + sal_uIntPtr nMyEntryCount = 0; if ( pRootItem->pChilds ) { lcl_CheckList( pRootItem->pChilds ); @@ -1690,7 +1690,7 @@ SvListView::SvListView( SvTreeList* pModell ) pModel = 0; nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; SetModel( pModell ); } @@ -1700,7 +1700,7 @@ SvListView::SvListView() pModel = 0; nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } @@ -1734,7 +1734,7 @@ void SvListView::InitTable() pEntry = pModel->pRootItem; pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uIntPtr)pEntry, pViewData ); // Jetzt alle anderen Entries pEntry = pModel->First(); while( pEntry ) @@ -1742,7 +1742,7 @@ void SvListView::InitTable() pViewData = CreateViewData( pEntry ); DBG_ASSERT(pViewData,"InitTable:No ViewData"); InitViewData( pViewData, pEntry ); - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uIntPtr)pEntry, pViewData ); pEntry = pModel->Next( pEntry ); } } @@ -1770,25 +1770,25 @@ void SvListView::Clear() ClearTable(); nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; if( pModel ) { // RootEntry einfuegen SvListEntry* pEntry = pModel->pRootItem; SvViewData* pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uIntPtr)pEntry, pViewData ); } } void SvListView::SetModel( SvTreeList* pNewModel ) { DBG_CHKTHIS(SvListView,0); - BOOL bBroadcastCleared = FALSE; + sal_Bool bBroadcastCleared = sal_False; if ( pModel ) { pModel->RemoveView( this ); - bBroadcastCleared = TRUE; + bBroadcastCleared = sal_True; ModelNotification( LISTACTION_CLEARING,0,0,0 ); if ( pModel->GetRefCount() == 0 ) delete pModel; @@ -1817,7 +1817,7 @@ void SvListView::ModelHasInsertedTree( SvListEntry* ) } void SvListView::ModelIsMoving( SvListEntry* /* pSource */ , - SvListEntry* /* pTargetParent */ , ULONG /* nPos */ ) + SvListEntry* /* pTargetParent */ , sal_uIntPtr /* nPos */ ) { DBG_CHKTHIS(SvListView,0); } @@ -1843,28 +1843,28 @@ void SvListView::ModelHasEntryInvalidated( SvListEntry*) DBG_CHKTHIS(SvListView,0); } -void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,ULONG) +void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,sal_uIntPtr) { DBG_CHKTHIS(SvListView,0); SvListEntry* pParent = pEntry->pParent; DBG_ASSERT(pParent,"Model not consistent"); if( pParent != pModel->pRootItem && pParent->pChilds->Count() == 1 ) { - SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pParent ); + SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uIntPtr)pParent ); pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED); } // vorlaeufig nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } void SvListView::ActionMoved( SvListEntry* /* pEntry */ , SvListEntry* /* pTargetPrnt */ , - ULONG /* nChildPos */ ) + sal_uIntPtr /* nChildPos */ ) { DBG_CHKTHIS(SvListView,0); nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } void SvListView::ActionInserted( SvListEntry* pEntry ) @@ -1874,14 +1874,14 @@ void SvListView::ActionInserted( SvListEntry* pEntry ) SvViewData* pData = CreateViewData( pEntry ); InitViewData( pData, pEntry ); #ifdef DBG_UTIL - BOOL bSuccess = + sal_Bool bSuccess = #endif - aDataTable.Insert( (ULONG)pEntry, pData ); + aDataTable.Insert( (sal_uIntPtr)pEntry, pData ); DBG_ASSERT(bSuccess,"Entry already in View"); if ( nVisibleCount && pModel->IsEntryVisible( this, pEntry )) { nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } } @@ -1891,18 +1891,18 @@ void SvListView::ActionInsertedTree( SvListEntry* pEntry ) if ( pModel->IsEntryVisible( this, pEntry )) { nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } // ueber Entry und seine Childs iterieren SvListEntry* pCurEntry = pEntry; - USHORT nRefDepth = pModel->GetDepth( pCurEntry ); + sal_uInt16 nRefDepth = pModel->GetDepth( pCurEntry ); while( pCurEntry ) { - DBG_ASSERT(aDataTable.Get((ULONG)pCurEntry)==0,"Entry already in Table"); + DBG_ASSERT(aDataTable.Get((sal_uIntPtr)pCurEntry)==0,"Entry already in Table"); SvViewData* pViewData = CreateViewData( pCurEntry ); DBG_ASSERT(pViewData,"No ViewData"); InitViewData( pViewData, pEntry ); - aDataTable.Insert( (ULONG)pCurEntry, pViewData ); + aDataTable.Insert( (sal_uIntPtr)pCurEntry, pViewData ); pCurEntry = pModel->Next( pCurEntry ); if ( pCurEntry && pModel->GetDepth(pCurEntry) <= nRefDepth) pCurEntry = 0; @@ -1917,9 +1917,9 @@ void SvListView::RemoveViewData( SvListEntry* pParent ) SvListEntry* pCur = (SvListEntry*)pChilds->First(); while( pCur ) { - SvViewData* pViewData = (SvViewData*)aDataTable.Get((ULONG)pCur); + SvViewData* pViewData = (SvViewData*)aDataTable.Get((sal_uIntPtr)pCur); delete pViewData; - aDataTable.Remove( (ULONG)pCur ); + aDataTable.Remove( (sal_uIntPtr)pCur ); if( pCur->HasChilds()) RemoveViewData( pCur ); pCur = (SvListEntry*)pChilds->Next(); @@ -1934,12 +1934,12 @@ void SvListView::ActionRemoving( SvListEntry* pEntry ) DBG_CHKTHIS(SvListView,0); DBG_ASSERT(pEntry,"Remove:No Entry"); - SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pEntry ); - ULONG nSelRemoved = 0; + SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uIntPtr)pEntry ); + sal_uIntPtr nSelRemoved = 0; if ( pViewData->IsSelected() ) nSelRemoved = 1 + pModel->GetChildSelectionCount( this, pEntry ); nSelectionCount -= nSelRemoved; - ULONG nVisibleRemoved = 0; + sal_uIntPtr nVisibleRemoved = 0; if ( pModel->IsEntryVisible( this, pEntry ) ) nVisibleRemoved = 1 + pModel->GetVisibleChildCount( this, pEntry ); if( nVisibleCount ) @@ -1952,18 +1952,18 @@ void SvListView::ActionRemoving( SvListEntry* pEntry ) #endif nVisibleCount -= nVisibleRemoved; } - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; - pViewData = (SvViewData*)aDataTable.Get((ULONG)pEntry); + pViewData = (SvViewData*)aDataTable.Get((sal_uIntPtr)pEntry); delete pViewData; - aDataTable.Remove( (ULONG)pEntry ); + aDataTable.Remove( (sal_uIntPtr)pEntry ); RemoveViewData( pEntry ); SvListEntry* pCurEntry = pEntry->pParent; if ( pCurEntry && pCurEntry != pModel->pRootItem && pCurEntry->pChilds->Count() == 1 ) { - pViewData = (SvViewData*)aDataTable.Get((ULONG)pCurEntry); + pViewData = (SvViewData*)aDataTable.Get((sal_uIntPtr)pCurEntry); pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED); } } @@ -1979,8 +1979,8 @@ void SvListView::ActionClear() Clear(); } -void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvListView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uIntPtr nPos ) { DBG_CHKTHIS(SvListView,0); switch( nActionId ) @@ -2020,7 +2020,7 @@ void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, ModelHasEntryInvalidated( pEntry1 ); break; case LISTACTION_RESORTED: - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; break; case LISTACTION_RESORTING: break; @@ -2048,7 +2048,7 @@ StringCompare SvTreeList::Compare( SvListEntry* pLeft, SvListEntry* pRight) cons void SvTreeList::Resort() { Broadcast( LISTACTION_RESORTING ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; ResortChilds( pRootItem ); Broadcast( LISTACTION_RESORTED ); } @@ -2062,11 +2062,11 @@ void SvTreeList::ResortChilds( SvListEntry* pParent ) List aList( *pChildList ); pChildList->Clear(); - ULONG nCount = aList.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uIntPtr nCount = aList.Count(); + for( sal_uIntPtr nCur = 0; nCur < nCount; nCur++ ) { SvListEntry* pCurEntry = (SvListEntry*)aList.GetObject( nCur ); - ULONG nListPos = LIST_APPEND; + sal_uIntPtr nListPos = LIST_APPEND; GetInsertionPos( pCurEntry, pParent, nListPos ); pChildList->Insert( pCurEntry, nListPos ); if( pCurEntry->pChilds ) @@ -2076,7 +2076,7 @@ void SvTreeList::ResortChilds( SvListEntry* pParent ) } void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent, - ULONG& rPos ) + sal_uIntPtr& rPos ) { DBG_ASSERT(pEntry,"No Entry"); diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx index 04b2b58367ee..7cc2bc2a83e7 100644..100755 --- a/svtools/source/control/asynclink.cxx +++ b/svtools/source/control/asynclink.cxx @@ -42,11 +42,11 @@ void AsynchronLink::CreateMutex() if( !_pMutex ) _pMutex = new vos::OMutex; } -void AsynchronLink::Call( void* pObj, BOOL +void AsynchronLink::Call( void* pObj, sal_Bool #ifdef DBG_UTIL bAllowDoubles #endif -, BOOL bUseTimer ) +, sal_Bool bUseTimer ) { #ifdef DBG_UTIL if ( bUseTimer || !_bInCall ) @@ -92,7 +92,7 @@ AsynchronLink::~AsynchronLink() Application::RemoveUserEvent( _nEventId ); } delete _pTimer; - if( _pDeleted ) *_pDeleted = TRUE; + if( _pDeleted ) *_pDeleted = sal_True; delete _pMutex; } @@ -125,13 +125,13 @@ void AsynchronLink::ClearPendingCall() void AsynchronLink::Call_Impl( void* pArg ) { - _bInCall = TRUE; - BOOL bDeleted = FALSE; + _bInCall = sal_True; + sal_Bool bDeleted = sal_False; _pDeleted = &bDeleted; _aLink.Call( pArg ); if( !bDeleted ) { - _bInCall = FALSE; + _bInCall = sal_False; _pDeleted = 0; } } diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index f7b49ac57eeb..0d18a3329841 100755 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -78,12 +78,12 @@ #define WEEKNUMBER_HEIGHT 85 -#define CALENDAR_HITTEST_DAY ((USHORT)0x0001) -#define CALENDAR_HITTEST_WEEK ((USHORT)0x0002) -#define CALENDAR_HITTEST_MONTHTITLE ((USHORT)0x0004) -#define CALENDAR_HITTEST_PREV ((USHORT)0x0008) -#define CALENDAR_HITTEST_NEXT ((USHORT)0x0010) -#define CALENDAR_HITTEST_OUTSIDE ((USHORT)0x1000) +#define CALENDAR_HITTEST_DAY ((sal_uInt16)0x0001) +#define CALENDAR_HITTEST_WEEK ((sal_uInt16)0x0002) +#define CALENDAR_HITTEST_MONTHTITLE ((sal_uInt16)0x0004) +#define CALENDAR_HITTEST_PREV ((sal_uInt16)0x0008) +#define CALENDAR_HITTEST_NEXT ((sal_uInt16)0x0010) +#define CALENDAR_HITTEST_OUTSIDE ((sal_uInt16)0x1000) #define MENU_YEAR_COUNT 3 @@ -98,7 +98,7 @@ struct ImplDateInfo XubString maText; Color* mpTextColor; Color* mpFrameColor; - USHORT mnFlags; + sal_uInt16 mnFlags; ImplDateInfo( const XubString& rText ) : maText( rText ) @@ -110,7 +110,7 @@ DECLARE_TABLE( ImplDateTable, ImplDateInfo* ) // ======================================================================= -static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSelect ) +static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, sal_Bool bSelect ) { if ( bSelect ) pTable->Insert( rDate.GetDate(), TABLE_DATE_SELECTED ); @@ -123,7 +123,7 @@ static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSele static void ImplCalendarSelectDateRange( Table* pTable, const Date& rStartDate, const Date& rEndDate, - BOOL bSelect ) + sal_Bool bSelect ) { Date aStartDate = rStartDate; Date aEndDate = rEndDate; @@ -224,24 +224,24 @@ void Calendar::ImplInit( WinBits nWinStyle ) mnFirstYear = 0; mnLastYear = 0; mnRequestYear = 0; - mbCalc = TRUE; - mbFormat = TRUE; - mbDrag = FALSE; - mbSelection = FALSE; - mbMultiSelection = FALSE; - mbWeekSel = FALSE; - mbUnSel = FALSE; - mbMenuDown = FALSE; - mbSpinDown = FALSE; - mbPrevIn = FALSE; - mbNextIn = FALSE; - mbDirect = FALSE; - mbInSelChange = FALSE; - mbTravelSelect = FALSE; - mbScrollDateRange = FALSE; - mbSelLeft = FALSE; - mbAllSel = FALSE; - mbDropPos = FALSE; + mbCalc = sal_True; + mbFormat = sal_True; + mbDrag = sal_False; + mbSelection = sal_False; + mbMultiSelection = sal_False; + mbWeekSel = sal_False; + mbUnSel = sal_False; + mbMenuDown = sal_False; + mbSpinDown = sal_False; + mbPrevIn = sal_False; + mbNextIn = sal_False; + mbDirect = sal_False; + mbInSelChange = sal_False; + mbTravelSelect = sal_False; + mbScrollDateRange = sal_False; + mbSelLeft = sal_False; + mbAllSel = sal_False; + mbDropPos = sal_False; ::rtl::OUString aGregorian( RTL_CONSTASCII_USTRINGPARAM( "gregorian")); maCalendarWrapper.loadCalendar( aGregorian, @@ -268,14 +268,14 @@ void Calendar::ImplInit( WinBits nWinStyle ) } SetFirstDate( maCurDate ); - ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True ); // Sonstige Strings erzeugen maDayText = XubString( SvtResId( STR_SVT_CALENDAR_DAY ) ); maWeekText = XubString( SvtResId( STR_SVT_CALENDAR_WEEK ) ); // Tagestexte anlegen - for ( USHORT i = 0; i < 31; i++ ) + for ( sal_uInt16 i = 0; i < 31; i++ ) mpDayText[i] = new UniString( UniString::CreateFromInt32( i+1 ) ); maDragScrollTimer.SetTimeoutHdl( STATIC_LINK( this, Calendar, ScrollHdl ) ); @@ -354,7 +354,7 @@ Calendar::~Calendar() if ( mpRestoreSelectTable ) delete mpRestoreSelectTable; - for ( USHORT i = 0; i < 31; i++ ) + for ( sal_uInt16 i = 0; i < 31; i++ ) delete mpDayText[i]; } @@ -362,7 +362,7 @@ Calendar::~Calendar() void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays ) { - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); maCalendarWrapper.setMinimumNumberOfDaysForFirstWeek( nDays); } @@ -370,7 +370,7 @@ void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays ) void Calendar::SetWeekStart( sal_Int16 nDay ) { - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); switch (nDay) { case i18n::Weekdays::SUNDAY : @@ -545,23 +545,23 @@ void Calendar::ImplFormat() nDay %= 7; } - mbCalc = FALSE; + mbCalc = sal_False; } // Anzahl Tage berechnen DayOfWeek eStartDay = ImplGetWeekStart(); - USHORT nWeekDay; + sal_uInt16 nWeekDay; Date aTempDate = GetFirstMonth(); maFirstDate = aTempDate; - nWeekDay = (USHORT)aTempDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; - maFirstDate -= (ULONG)nWeekDay; + nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; + maFirstDate -= (sal_uIntPtr)nWeekDay; mnDayCount = nWeekDay; - USHORT nDaysInMonth; - USHORT nMonthCount = (USHORT)(mnMonthPerLine*mnLines); - for ( USHORT i = 0; i < nMonthCount; i++ ) + sal_uInt16 nDaysInMonth; + sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines); + for ( sal_uInt16 i = 0; i < nMonthCount; i++ ) { nDaysInMonth = aTempDate.GetDaysInMonth(); mnDayCount += nDaysInMonth; @@ -571,8 +571,8 @@ void Calendar::ImplFormat() aTempDate2--; nDaysInMonth = aTempDate2.GetDaysInMonth(); aTempDate2 -= nDaysInMonth-1; - nWeekDay = (USHORT)aTempDate2.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; + nWeekDay = (sal_uInt16)aTempDate2.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; mnDayCount += 42-nDaysInMonth-nWeekDay; // Farben festlegen @@ -590,8 +590,8 @@ void Calendar::ImplFormat() } // DateInfo besorgen - USHORT nNewFirstYear = maFirstDate.GetYear(); - USHORT nNewLastYear = GetLastDate().GetYear(); + sal_uInt16 nNewFirstYear = maFirstDate.GetYear(); + sal_uInt16 nNewLastYear = GetLastDate().GetYear(); if ( mnFirstYear ) { if ( nNewFirstYear < mnFirstYear ) @@ -616,12 +616,12 @@ void Calendar::ImplFormat() } mnRequestYear = 0; - mbFormat = FALSE; + mbFormat = sal_False; } // ----------------------------------------------------------------------- -USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const +sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const { if ( mbFormat ) return 0; @@ -635,7 +635,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const long nY; long nOffX; long nYMonth; - USHORT nDay; + sal_uInt16 nDay; DayOfWeek eStartDay = ImplGetWeekStart(); rDate = GetFirstMonth(); @@ -652,7 +652,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const if ( (rPos.X() < nX) && (rPos.Y() < nYMonth) ) return 0; - USHORT nDaysInMonth = rDate.GetDaysInMonth(); + sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth(); // Entsprechender Monat gefunden if ( (rPos.X() > nX) && (rPos.Y() < nYMonth) && @@ -666,8 +666,8 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const long nDayY = nY+mnDaysOffY; if ( rPos.Y() < nDayY ) return 0; - USHORT nDayIndex = (USHORT)rDate.GetDayOfWeek(); - nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7; + sal_uInt16 nDayIndex = (sal_uInt16)rDate.GetDayOfWeek(); + nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7; if ( (i == 0) && (j == 0) ) { Date aTempDate = rDate; @@ -708,9 +708,9 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const } if ( (i == mnLines-1) && (j == mnMonthPerLine-1) ) { - USHORT nWeekDay = (USHORT)rDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; - USHORT nDayCount = 42-nDaysInMonth-nWeekDay; + sal_uInt16 nWeekDay = (sal_uInt16)rDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; + sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay; Date aTempDate = rDate; aTempDate += nDaysInMonth; for ( nDay = 1; nDay <= nDayCount; nDay++ ) @@ -753,7 +753,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const // ----------------------------------------------------------------------- static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect, - BOOL bPrev ) + sal_Bool bPrev ) { long i; long n; @@ -798,7 +798,7 @@ static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect, // ----------------------------------------------------------------------- -void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext ) +void Calendar::ImplDrawSpin( sal_Bool bDrawPrev, sal_Bool bDrawNext ) { if ( !bDrawPrev && !bDrawNext ) return; @@ -812,7 +812,7 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext ) aOutRect.Top() += 3; aOutRect.Right() -= 3; aOutRect.Bottom() -= 3; - ImplDrawSpinArrow( this, aOutRect, TRUE ); + ImplDrawSpinArrow( this, aOutRect, sal_True ); } if ( bDrawNext ) { @@ -821,33 +821,33 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext ) aOutRect.Top() += 3; aOutRect.Right() -= 3; aOutRect.Bottom() -= 3; - ImplDrawSpinArrow( this, aOutRect, FALSE ); + ImplDrawSpinArrow( this, aOutRect, sal_False ); } } // ----------------------------------------------------------------------- void Calendar::ImplDrawDate( long nX, long nY, - USHORT nDay, USHORT nMonth, USHORT nYear, + sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear, DayOfWeek eDayOfWeek, - BOOL bBack, BOOL bOther, ULONG nToday ) + sal_Bool bBack, sal_Bool bOther, sal_uIntPtr nToday ) { ImplDateInfo* pDateInfo; Color* pTextColor = NULL; const String& rDay = *(mpDayText[nDay-1]); Rectangle aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 ); - BOOL bSel = FALSE; - BOOL bFocus = FALSE; + sal_Bool bSel = sal_False; + sal_Bool bFocus = sal_False; // Aktueller Tag if ( (nDay == maCurDate.GetDay()) && (nMonth == maCurDate.GetMonth()) && (nYear == maCurDate.GetYear()) ) - bFocus = TRUE; + bFocus = sal_True; if ( mpSelectTable ) { if ( mpSelectTable->IsKeyValid( Date( nDay, nMonth, nYear ).GetDate() ) ) - bSel = TRUE; + bSel = sal_True; } // Dateinfo ermitteln @@ -885,11 +885,11 @@ void Calendar::ImplDrawDate( long nX, long nY, // Font ermitteln Font aOldFont = GetFont(); - BOOL bBoldFont = FALSE; + sal_Bool bBoldFont = sal_False; if ( (mnWinStyle & WB_BOLDTEXT) && pDateInfo && (pDateInfo->mnFlags & DIB_BOLD) ) { - bBoldFont = TRUE; + bBoldFont = sal_True; Font aFont = aOldFont; if ( aFont.GetWeight() < WEIGHT_BOLD ) aFont.SetWeight( WEIGHT_BOLD ); @@ -981,7 +981,7 @@ void Calendar::ImplDrawDate( long nX, long nY, // ----------------------------------------------------------------------- -void Calendar::ImplDraw( BOOL bPaint ) +void Calendar::ImplDraw( sal_Bool bPaint ) { ImplFormat(); @@ -995,10 +995,10 @@ void Calendar::ImplDraw( BOOL bPaint ) long nDeltaY; long nDayX; long nDayY; - ULONG nToday = Date().GetDate(); - USHORT nDay; - USHORT nMonth; - USHORT nYear; + sal_uIntPtr nToday = Date().GetDate(); + sal_uInt16 nDay; + sal_uInt16 nMonth; + sal_uInt16 nYear; Date aDate = GetFirstMonth(); DayOfWeek eStartDay = ImplGetWeekStart(); @@ -1135,7 +1135,7 @@ void Calendar::ImplDraw( BOOL bPaint ) nDayX -= mnWeekWidth; nDayY = nY+mnDaysOffY; maCalendarWrapper.setGregorianDateTime( aDate); - for ( USHORT nWeekCount = 0; nWeekCount < 6; nWeekCount++ ) + for ( sal_uInt16 nWeekCount = 0; nWeekCount < 6; nWeekCount++ ) { sal_Int16 nWeek = maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); String aWeekText( String::CreateFromInt32( nWeek)); @@ -1149,7 +1149,7 @@ void Calendar::ImplDraw( BOOL bPaint ) } // Tage ausgeben - USHORT nDaysInMonth = aDate.GetDaysInMonth(); + sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); nDayX = nX+mnDaysOffX; nDayY = nY+mnDaysOffY; if ( !bPaint ) @@ -1158,8 +1158,8 @@ void Calendar::ImplDraw( BOOL bPaint ) nDayX+(7*mnDayWidth)-1, nDayY+(6*mnDayHeight)-1 ); Erase( aClearRect ); } - USHORT nDayIndex = (USHORT)aDate.GetDayOfWeek(); - nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7; + sal_uInt16 nDayIndex = (sal_uInt16)aDate.GetDayOfWeek(); + nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7; if ( (i == 0) && (j == 0) ) { Date aTempDate = aDate; @@ -1169,15 +1169,15 @@ void Calendar::ImplDraw( BOOL bPaint ) nDeltaX = nDayX + (nDay*mnDayWidth); ImplDrawDate( nDeltaX, nDayY, nDay+aTempDate.GetDay(), aTempDate.GetMonth(), aTempDate.GetYear(), - (DayOfWeek)((nDay+(USHORT)eStartDay)%7), FALSE, TRUE, nToday ); + (DayOfWeek)((nDay+(sal_uInt16)eStartDay)%7), sal_False, sal_True, nToday ); } } for ( nDay = 1; nDay <= nDaysInMonth; nDay++ ) { nDeltaX = nDayX + (nDayIndex*mnDayWidth); ImplDrawDate( nDeltaX, nDayY, nDay, nMonth, nYear, - (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7), - FALSE, FALSE, nToday ); + (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7), + sal_False, sal_False, nToday ); if ( nDayIndex == 6 ) { nDayIndex = 0; @@ -1188,9 +1188,9 @@ void Calendar::ImplDraw( BOOL bPaint ) } if ( (i == mnLines-1) && (j == mnMonthPerLine-1) ) { - USHORT nWeekDay = (USHORT)aDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7; - USHORT nDayCount = 42-nDaysInMonth-nWeekDay; + sal_uInt16 nWeekDay = (sal_uInt16)aDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; + sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay; Date aTempDate = aDate; aTempDate += nDaysInMonth; for ( nDay = 1; nDay <= nDayCount; nDay++ ) @@ -1198,8 +1198,8 @@ void Calendar::ImplDraw( BOOL bPaint ) nDeltaX = nDayX + (nDayIndex*mnDayWidth); ImplDrawDate( nDeltaX, nDayY, nDay, aTempDate.GetMonth(), aTempDate.GetYear(), - (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7), - FALSE, TRUE, nToday ); + (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7), + sal_False, sal_True, nToday ); if ( nDayIndex == 6 ) { nDayIndex = 0; @@ -1231,10 +1231,10 @@ void Calendar::ImplUpdateDate( const Date& rDate ) Rectangle aDateRect( GetDateRect( rDate ) ); if ( !aDateRect.IsEmpty() ) { - BOOL bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth()); + sal_Bool bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth()); ImplDrawDate( aDateRect.Left(), aDateRect.Top(), rDate.GetDay(), rDate.GetMonth(), rDate.GetYear(), - rDate.GetDayOfWeek(), TRUE, bOther ); + rDate.GetDayOfWeek(), sal_True, bOther ); } } } @@ -1245,7 +1245,7 @@ void Calendar::ImplUpdateSelection( Table* pOld ) { Table* pNew = mpSelectTable; void* p; - ULONG nKey; + sal_uIntPtr nKey; p = pOld->First(); while ( p ) @@ -1276,8 +1276,8 @@ void Calendar::ImplUpdateSelection( Table* pOld ) // ----------------------------------------------------------------------- -void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, - BOOL bMove, BOOL bExpand, BOOL bExtended ) +void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest, + sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended ) { Table* pOldSel = new Table( *mpSelectTable ); Date aOldDate = maCurDate; @@ -1313,35 +1313,35 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, { if ( mbSelLeft ) { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False ); } else { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), sal_False ); } } - ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, TRUE ); + ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, sal_True ); } else if ( bExtended && !(mnWinStyle & WB_RANGESELECT) ) { maAnchorDate = aTempDate; if ( IsDateSelected( aTempDate ) ) { - mbUnSel = TRUE; - ImplCalendarSelectDate( mpSelectTable, aTempDate, FALSE ); + mbUnSel = sal_True; + ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_False ); } else { - ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True ); } } else { maAnchorDate = aTempDate; ImplCalendarClearSelectDate( mpSelectTable ); - ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True ); } mpRestoreSelectTable = new Table( *mpSelectTable ); @@ -1350,9 +1350,9 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, else { if ( aTempDate < maCurDate ) - mbSelLeft = TRUE; + mbSelLeft = sal_True; else - mbSelLeft = FALSE; + mbSelLeft = sal_False; if ( !(nHitTest & CALENDAR_HITTEST_DAY) ) aTempDate = maOldCurDate; if ( !bMove ) @@ -1360,19 +1360,19 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, if ( aTempDate != maCurDate ) { maCurDate = aTempDate; - ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE ); - ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False ); + ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True ); } } - BOOL bNewSel = *pOldSel != *mpSelectTable; + sal_Bool bNewSel = *pOldSel != *mpSelectTable; if ( (maCurDate != aOldDate) || bNewSel ) { if ( bNewSel ) { - mbInSelChange = TRUE; + mbInSelChange = sal_True; SelectionChanging(); - mbInSelChange = FALSE; + mbInSelChange = sal_False; } HideFocus(); if ( bNewSel ) @@ -1388,7 +1388,7 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest, // ----------------------------------------------------------------------- -void Calendar::ImplUpdate( BOOL bCalcNew ) +void Calendar::ImplUpdate( sal_Bool bCalcNew ) { if ( IsReallyVisible() && IsUpdateMode() ) { @@ -1398,8 +1398,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew ) { if ( mbDirect ) { - mbFormat = TRUE; - ImplDraw( FALSE ); + mbFormat = sal_True; + ImplDraw( sal_False ); return; } else @@ -1408,8 +1408,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew ) } if ( bCalcNew ) - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; } // ----------------------------------------------------------------------- @@ -1424,7 +1424,7 @@ void Calendar::ImplInvertDropPos() // ----------------------------------------------------------------------- -void Calendar::ImplScroll( BOOL bPrev ) +void Calendar::ImplScroll( sal_Bool bPrev ) { Date aNewFirstMonth = GetFirstMonth(); if ( bPrev ) @@ -1434,9 +1434,9 @@ void Calendar::ImplScroll( BOOL bPrev ) } else aNewFirstMonth += aNewFirstMonth.GetDaysInMonth(); - mbDirect = TRUE; + mbDirect = sal_True; SetFirstDate( aNewFirstMonth ); - mbDirect = FALSE; + mbDirect = sal_False; } // ----------------------------------------------------------------------- @@ -1448,12 +1448,12 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) Date aOldFirstDate = GetFirstMonth(); PopupMenu aPopupMenu; PopupMenu* pYearPopupMenus[MENU_YEAR_COUNT]; - USHORT nMonthOff; - USHORT nCurItemId; - USHORT nYear = rDate.GetYear()-1; - USHORT i; - USHORT j; - USHORT nYearIdCount = 1000; + sal_uInt16 nMonthOff; + sal_uInt16 nCurItemId; + sal_uInt16 nYear = rDate.GetYear()-1; + sal_uInt16 i; + sal_uInt16 j; + sal_uInt16 nYearIdCount = 1000; nMonthOff = (rDate.GetYear()-aOldFirstDate.GetYear())*12; if ( aOldFirstDate.GetMonth() < rDate.GetMonth() ) @@ -1474,9 +1474,9 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) nYearIdCount += 1000; } - mbMenuDown = TRUE; + mbMenuDown = sal_True; nCurItemId = aPopupMenu.Execute( this, rPos ); - mbMenuDown = FALSE; + mbMenuDown = sal_False; // Menu zerstoeren aPopupMenu.SetPopupMenu( 2, NULL ); @@ -1488,10 +1488,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) if ( nCurItemId ) { - USHORT nTempMonthOff = nMonthOff % 12; - USHORT nTempYearOff = nMonthOff / 12; - USHORT nNewMonth = nCurItemId % 1000; - USHORT nNewYear = nYear+((nCurItemId-1000)/1000); + sal_uInt16 nTempMonthOff = nMonthOff % 12; + sal_uInt16 nTempYearOff = nMonthOff / 12; + sal_uInt16 nNewMonth = nCurItemId % 1000; + sal_uInt16 nNewYear = nYear+((nCurItemId-1000)/1000); if ( nTempMonthOff < nNewMonth ) nNewMonth = nNewMonth - nTempMonthOff; else @@ -1506,10 +1506,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate ) // ----------------------------------------------------------------------- -void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat ) +void Calendar::ImplTracking( const Point& rPos, sal_Bool bRepeat ) { Date aTempDate = maCurDate; - USHORT nHitTest = ImplHitTest( rPos, aTempDate ); + sal_uInt16 nHitTest = ImplHitTest( rPos, aTempDate ); if ( mbSpinDown ) { @@ -1518,29 +1518,29 @@ void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat ) if ( bRepeat && (mbPrevIn || mbNextIn) ) { - mbScrollDateRange = TRUE; + mbScrollDateRange = sal_True; ImplScroll( mbPrevIn ); - mbScrollDateRange = FALSE; + mbScrollDateRange = sal_False; } } else - ImplMouseSelect( aTempDate, nHitTest, TRUE, FALSE, FALSE ); + ImplMouseSelect( aTempDate, nHitTest, sal_True, sal_False, sal_False ); } // ----------------------------------------------------------------------- -void Calendar::ImplEndTracking( BOOL bCancel ) +void Calendar::ImplEndTracking( sal_Bool bCancel ) { - BOOL bSelection = mbSelection; - BOOL bSpinDown = mbSpinDown; + sal_Bool bSelection = mbSelection; + sal_Bool bSpinDown = mbSpinDown; - mbDrag = FALSE; - mbSelection = FALSE; - mbMultiSelection = FALSE; - mbUnSel = FALSE; - mbSpinDown = FALSE; - mbPrevIn = FALSE; - mbNextIn = FALSE; + mbDrag = sal_False; + mbSelection = sal_False; + mbMultiSelection = sal_False; + mbUnSel = sal_False; + mbSpinDown = sal_False; + mbPrevIn = sal_False; + mbNextIn = sal_False; if ( bCancel ) { @@ -1569,15 +1569,15 @@ void Calendar::ImplEndTracking( BOOL bCancel ) if ( !bCancel ) { // Feststellen, ob wir sichtbaren Bereich scrollen sollen - ULONG nSelCount = mpSelectTable->Count(); + sal_uIntPtr nSelCount = mpSelectTable->Count(); if ( nSelCount ) { Date aFirstSelDate( mpSelectTable->GetObjectKey( 0 ) ); Date aLastSelDate( mpSelectTable->GetObjectKey( nSelCount-1 ) ); if ( aLastSelDate < GetFirstMonth() ) - ImplScroll( TRUE ); + ImplScroll( sal_True ); else if ( GetLastMonth() < aFirstSelDate ) - ImplScroll( FALSE ); + ImplScroll( sal_False ); } } @@ -1599,13 +1599,13 @@ void Calendar::ImplEndTracking( BOOL bCancel ) IMPL_STATIC_LINK( Calendar, ScrollHdl, Timer*, EMPTYARG ) { - BOOL bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; - BOOL bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0; + sal_Bool bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0; + sal_Bool bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0; if( bNextIn || bPrevIn ) { - pThis->mbScrollDateRange = TRUE; + pThis->mbScrollDateRange = sal_True; pThis->ImplScroll( bPrevIn ); - pThis->mbScrollDateRange = FALSE; + pThis->mbScrollDateRange = sal_False; } return 0; } @@ -1617,7 +1617,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.IsLeft() && !mbMenuDown ) { Date aTempDate = maCurDate; - USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate ); + sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate ); if ( nHitTest ) { if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE ) @@ -1630,10 +1630,10 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) mbNextIn = (nHitTest & CALENDAR_HITTEST_NEXT) != 0; if ( mbPrevIn || mbNextIn ) { - mbSpinDown = TRUE; - mbScrollDateRange = TRUE; + mbSpinDown = sal_True; + mbScrollDateRange = sal_True; ImplScroll( mbPrevIn ); - mbScrollDateRange = FALSE; + mbScrollDateRange = sal_False; // Hier muss BUTTONREPEAT stehen, also nicht wieder // auf SCROLLREPEAT aendern, sondern mit TH abklaeren, // warum es evtl. anders sein sollte (71775) @@ -1652,16 +1652,16 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) if ( !mbSelection ) { - mbDrag = TRUE; + mbDrag = sal_True; StartTracking(); } mbMultiSelection = (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT)) != 0; if ( (nHitTest & CALENDAR_HITTEST_DAY) && mbMultiSelection ) - mbWeekSel = TRUE; + mbWeekSel = sal_True; else - mbWeekSel = FALSE; - ImplMouseSelect( aTempDate, nHitTest, FALSE, rMEvt.IsShift(), rMEvt.IsMod1() ); + mbWeekSel = sal_False; + ImplMouseSelect( aTempDate, nHitTest, sal_False, rMEvt.IsShift(), rMEvt.IsMod1() ); } } } @@ -1678,7 +1678,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() && mbSelection ) - ImplEndTracking( FALSE ); + ImplEndTracking( sal_False ); else Control::MouseButtonUp( rMEvt ); } @@ -1688,7 +1688,7 @@ void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) void Calendar::MouseMove( const MouseEvent& rMEvt ) { if ( mbSelection && rMEvt.GetButtons() ) - ImplTracking( rMEvt.GetPosPixel(), FALSE ); + ImplTracking( rMEvt.GetPosPixel(), sal_False ); else Control::MouseMove( rMEvt ); } @@ -1710,9 +1710,9 @@ void Calendar::Tracking( const TrackingEvent& rTEvt ) void Calendar::KeyInput( const KeyEvent& rKEvt ) { Date aNewDate = maCurDate; - BOOL bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0; - BOOL bExpand = rKEvt.GetKeyCode().IsShift(); - BOOL bExtended = rKEvt.GetKeyCode().IsMod1(); + sal_Bool bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0; + sal_Bool bExpand = rKEvt.GetKeyCode().IsShift(); + sal_Bool bExtended = rKEvt.GetKeyCode().IsMod1(); switch ( rKEvt.GetKeyCode().GetCode() ) { @@ -1757,13 +1757,13 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) { if ( !bExpand ) { - BOOL bDateSel = IsDateSelected( maCurDate ); + sal_Bool bDateSel = IsDateSelected( maCurDate ); SelectDate( maCurDate, !bDateSel ); - mbSelLeft = FALSE; + mbSelLeft = sal_False; SelectionChanging(); - mbTravelSelect = TRUE; + mbTravelSelect = sal_True; Select(); - mbTravelSelect = FALSE; + mbTravelSelect = sal_False; } } else @@ -1786,23 +1786,23 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) { if ( mbSelLeft ) { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False ); } else { - ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE ); - ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), FALSE ); + ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False ); + ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), sal_False ); } } - ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, TRUE ); - mbDirect = TRUE; + ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, sal_True ); + mbDirect = sal_True; SetCurDate( aNewDate ); - mbDirect = FALSE; + mbDirect = sal_False; maAnchorDate = aOldAnchorDate; - mbInSelChange = TRUE; + mbInSelChange = sal_True; SelectionChanging(); - mbInSelChange = FALSE; + mbInSelChange = sal_False; ImplUpdateSelection( pOldSel ); delete pOldSel; } @@ -1811,15 +1811,15 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) if ( mnWinStyle & WB_RANGESELECT ) { SetNoSelection(); - SelectDate( aNewDate, TRUE ); + SelectDate( aNewDate, sal_True ); } - mbDirect = TRUE; + mbDirect = sal_True; SetCurDate( aNewDate ); - mbDirect = FALSE; + mbDirect = sal_False; } - mbTravelSelect = TRUE; + mbTravelSelect = sal_True; Select(); - mbTravelSelect = FALSE; + mbTravelSelect = sal_False; } } @@ -1827,7 +1827,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt ) void Calendar::Paint( const Rectangle& ) { - ImplDraw( TRUE ); + ImplDraw( sal_True ); } // ----------------------------------------------------------------------- @@ -1850,7 +1850,7 @@ void Calendar::LoseFocus() void Calendar::Resize() { - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); Control::Resize(); } @@ -1896,8 +1896,8 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt ) if ( rHEvt.GetMode() & HELPMODE_QUICK ) { maCalendarWrapper.setGregorianDateTime( aDate); - USHORT nWeek = (USHORT) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); - USHORT nMonth = aDate.GetMonth(); + sal_uInt16 nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); + sal_uInt16 nMonth = aDate.GetMonth(); XubString aStr( maDayText ); aStr.AppendAscii( ": " ); aStr.Append( XubString::CreateFromInt32( aDate.GetDayOfYear() ) ); @@ -1934,7 +1934,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) if ( !mbSelection && rCEvt.IsMouseEvent() ) { Date aTempDate = maCurDate; - USHORT nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate ); + sal_uInt16 nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate ); if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE ) { ImplShowMenu( rCEvt.GetMousePosPixel(), aTempDate ); @@ -1952,7 +1952,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) { while ( nNotchDelta < 0 ) { - ImplScroll( TRUE ); + ImplScroll( sal_True ); nNotchDelta++; } } @@ -1960,7 +1960,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) { while ( nNotchDelta > 0 ) { - ImplScroll( FALSE ); + ImplScroll( sal_False ); nNotchDelta--; } } @@ -2035,7 +2035,7 @@ void Calendar::Select() // ----------------------------------------------------------------------- -void Calendar::SelectDate( const Date& rDate, BOOL bSelect ) +void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect ) { if ( !rDate.IsValid() ) return; @@ -2059,7 +2059,7 @@ void Calendar::SelectDate( const Date& rDate, BOOL bSelect ) // ----------------------------------------------------------------------- void Calendar::SelectDateRange( const Date& rStartDate, const Date& rEndDate, - BOOL bSelect ) + sal_Bool bSelect ) { if ( !rStartDate.IsValid() || !rEndDate.IsValid() ) return; @@ -2102,21 +2102,21 @@ void Calendar::SetNoSelection() // ----------------------------------------------------------------------- -BOOL Calendar::IsDateSelected( const Date& rDate ) const +sal_Bool Calendar::IsDateSelected( const Date& rDate ) const { return mpSelectTable->IsKeyValid( rDate.GetDate() ); } // ----------------------------------------------------------------------- -ULONG Calendar::GetSelectDateCount() const +sal_uIntPtr Calendar::GetSelectDateCount() const { return mpSelectTable->Count(); } // ----------------------------------------------------------------------- -Date Calendar::GetSelectDate( ULONG nIndex ) const +Date Calendar::GetSelectDate( sal_uIntPtr nIndex ) const { if ( nIndex < mpSelectTable->Count() ) return Date( mpSelectTable->GetObjectKey( nIndex ) ); @@ -2136,18 +2136,18 @@ void Calendar::SetCurDate( const Date& rNewDate ) if ( maCurDate != rNewDate ) { - BOOL bUpdate = IsVisible() && IsUpdateMode(); + sal_Bool bUpdate = IsVisible() && IsUpdateMode(); Date aOldDate = maCurDate; maCurDate = rNewDate; maAnchorDate = maCurDate; if ( !(mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) ) { - ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE ); - ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE ); + ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False ); + ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True ); } else if ( !HasFocus() ) - bUpdate = FALSE; + bUpdate = sal_False; // Aktuelles Datum noch in den sichtbaren Bereich verschieben if ( mbFormat || (maCurDate < GetFirstMonth()) ) @@ -2192,7 +2192,7 @@ void Calendar::SetFirstDate( const Date& rNewFirstDate ) if ( maFirstDate != rNewFirstDate ) { maFirstDate = Date( 1, rNewFirstDate.GetMonth(), rNewFirstDate.GetYear() ); - mbDropPos = FALSE; + mbDropPos = sal_False; ImplUpdate(); } } @@ -2217,8 +2217,8 @@ Date Calendar::GetFirstMonth() const Date Calendar::GetLastMonth() const { Date aDate = GetFirstMonth(); - USHORT nMonthCount = GetMonthCount(); - for ( USHORT i = 0; i < nMonthCount; i++ ) + sal_uInt16 nMonthCount = GetMonthCount(); + for ( sal_uInt16 i = 0; i < nMonthCount; i++ ) aDate += aDate.GetDaysInMonth(); aDate--; return aDate; @@ -2226,39 +2226,39 @@ Date Calendar::GetLastMonth() const // ----------------------------------------------------------------------- -USHORT Calendar::GetMonthCount() const +sal_uInt16 Calendar::GetMonthCount() const { if ( mbFormat ) return 1; else - return (USHORT)(mnMonthPerLine*mnLines); + return (sal_uInt16)(mnMonthPerLine*mnLines); } // ----------------------------------------------------------------------- -BOOL Calendar::GetDropDate( Date& rDate ) const +sal_Bool Calendar::GetDropDate( Date& rDate ) const { if( mbDropPos ) { rDate = maDropDate; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Calendar::GetDate( const Point& rPos, Date& rDate ) const +sal_Bool Calendar::GetDate( const Point& rPos, Date& rDate ) const { Date aDate = maCurDate; - USHORT nHitTest = ImplHitTest( rPos, aDate ); + sal_uInt16 nHitTest = ImplHitTest( rPos, aDate ); if ( nHitTest & CALENDAR_HITTEST_DAY ) { rDate = aDate; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2272,8 +2272,8 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const long nX; long nY; - ULONG nDaysOff; - USHORT nDayIndex; + sal_uIntPtr nDaysOff; + sal_uInt16 nDayIndex; Date aDate = GetFirstMonth(); if ( rDate < aDate ) @@ -2290,13 +2290,13 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const Date aLastDate = GetLastMonth(); if ( rDate > aLastDate ) { - USHORT nWeekDay = (USHORT)aLastDate.GetDayOfWeek(); - nWeekDay = (nWeekDay+(7-(USHORT)ImplGetWeekStart())) % 7; + sal_uInt16 nWeekDay = (sal_uInt16)aLastDate.GetDayOfWeek(); + nWeekDay = (nWeekDay+(7-(sal_uInt16)ImplGetWeekStart())) % 7; aLastDate -= nWeekDay; aRect = GetDateRect( aLastDate ); nDaysOff = rDate-aLastDate; nDayIndex = 0; - for ( USHORT i = 0; i <= nDaysOff; i++ ) + for ( sal_uInt16 i = 0; i <= nDaysOff; i++ ) { if ( aLastDate == rDate ) { @@ -2323,7 +2323,7 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const nX = 0; for ( long j = 0; j < mnMonthPerLine; j++ ) { - USHORT nDaysInMonth = aDate.GetDaysInMonth(); + sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); // Monat gerufen if ( (aDate.GetMonth() == rDate.GetMonth()) && @@ -2331,9 +2331,9 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const { long nDayX = nX+mnDaysOffX; long nDayY = nY+mnDaysOffY; - nDayIndex = (USHORT)aDate.GetDayOfWeek(); - nDayIndex = (nDayIndex+(7-(USHORT)ImplGetWeekStart())) % 7; - for ( USHORT nDay = 1; nDay <= nDaysInMonth; nDay++ ) + nDayIndex = (sal_uInt16)aDate.GetDayOfWeek(); + nDayIndex = (nDayIndex+(7-(sal_uInt16)ImplGetWeekStart())) % 7; + for ( sal_uInt16 nDay = 1; nDay <= nDaysInMonth; nDay++ ) { if ( nDay == rDate.GetDay() ) { @@ -2400,13 +2400,13 @@ void Calendar::SetSundayColor( const Color& rColor ) void Calendar::AddDateInfo( const Date& rDate, const String& rText, const Color* pTextColor, const Color* pFrameColor, - USHORT nFlags ) + sal_uInt16 nFlags ) { if ( !mpDateTable ) mpDateTable = new ImplDateTable( 256, 256 ); - BOOL bChanged = FALSE; - ULONG nKey = rDate.GetDate(); + sal_Bool bChanged = sal_False; + sal_uIntPtr nKey = rDate.GetDate(); ImplDateInfo* pDateInfo = mpDateTable->Get( nKey ); if ( pDateInfo ) pDateInfo->maText = rText; @@ -2422,13 +2422,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, if ( *(pDateInfo->mpTextColor) != *pTextColor ) { *(pDateInfo->mpTextColor) = *pTextColor; - bChanged = TRUE; + bChanged = sal_True; } } else { pDateInfo->mpTextColor = new Color( *pTextColor ); - bChanged = TRUE; + bChanged = sal_True; } } else @@ -2437,7 +2437,7 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, { delete pDateInfo->mpTextColor; pDateInfo->mpTextColor = NULL; - bChanged = TRUE; + bChanged = sal_True; } } if ( pFrameColor ) @@ -2447,13 +2447,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, if ( *(pDateInfo->mpFrameColor) != *pFrameColor ) { *(pDateInfo->mpFrameColor) = *pFrameColor; - bChanged = TRUE; + bChanged = sal_True; } } else { pDateInfo->mpFrameColor = new Color( *pFrameColor ); - bChanged = TRUE; + bChanged = sal_True; } } else @@ -2462,13 +2462,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText, { delete pDateInfo->mpFrameColor; pDateInfo->mpFrameColor = NULL; - bChanged = TRUE; + bChanged = sal_True; } } if ( pDateInfo->mnFlags != nFlags ) { pDateInfo->mnFlags = nFlags; - bChanged = TRUE; + bChanged = sal_True; } if ( bChanged ) @@ -2499,7 +2499,7 @@ void Calendar::ClearDateInfo() ImplDateInfo* pDateInfo = mpDateTable->First(); while ( pDateInfo ) { - ULONG nKey = mpDateTable->GetCurKey(); + sal_uIntPtr nKey = mpDateTable->GetCurKey(); mpDateTable->Remove( nKey ); Date aDate( nKey ); ImplUpdateDate( aDate ); @@ -2518,7 +2518,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate ) XubString aRet; if ( mpDateTable ) { - ULONG nKey = rDate.GetDate(); + sal_uIntPtr nKey = rDate.GetDate(); ImplDateInfo* pDateInfo = mpDateTable->Get( nKey ); if ( pDateInfo ) aRet = pDateInfo->maText; @@ -2528,7 +2528,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate ) // ----------------------------------------------------------------------- -BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate ) +sal_Bool Calendar::ShowDropPos( const Point& rPos, Date& rDate ) { Date aTempDate = maCurDate; mnDragScrollHitTest = ImplHitTest( rPos, aTempDate ); @@ -2550,12 +2550,12 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate ) if( mbDropPos ) ImplInvertDropPos(); maDropDate = aTempDate; - mbDropPos = TRUE; + mbDropPos = sal_True; ImplInvertDropPos(); } rDate = maDropDate; - return TRUE; + return sal_True; } } } @@ -2563,7 +2563,7 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate ) maDragScrollTimer.Stop(); HideDropPos(); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2573,7 +2573,7 @@ void Calendar::HideDropPos() if ( mbDropPos ) { ImplInvertDropPos(); - mbDropPos = FALSE; + mbDropPos = sal_False; } } @@ -2586,7 +2586,7 @@ void Calendar::StartSelection() maOldCurDate = maCurDate; mpOldSelectTable = new Table( *mpSelectTable ); - mbSelection = TRUE; + mbSelection = sal_True; } // ----------------------------------------------------------------------- @@ -2598,12 +2598,12 @@ void Calendar::EndSelection() if ( !mbSelection ) ReleaseMouse(); - mbDrag = FALSE; - mbSelection = FALSE; - mbMultiSelection = FALSE; - mbSpinDown = FALSE; - mbPrevIn = FALSE; - mbNextIn = FALSE; + mbDrag = sal_False; + mbSelection = sal_False; + mbMultiSelection = sal_False; + mbSpinDown = sal_False; + mbPrevIn = sal_False; + mbNextIn = sal_False; } } @@ -2684,8 +2684,8 @@ public: void SetCalendar( Calendar* pCalendar ) { mpCalendar = pCalendar; } - PushButton* EnableTodayBtn( BOOL bEnable ); - PushButton* EnableNoneBtn( BOOL bEnable ); + PushButton* EnableTodayBtn( sal_Bool bEnable ); + PushButton* EnableNoneBtn( sal_Bool bEnable ); void ArrangeButtons(); long Notify( NotifyEvent& rNEvt ); @@ -2713,7 +2713,7 @@ ImplCFieldFloatWin::~ImplCFieldFloatWin() // ----------------------------------------------------------------------- -PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable ) +PushButton* ImplCFieldFloatWin::EnableTodayBtn( sal_Bool bEnable ) { if ( bEnable ) { @@ -2745,7 +2745,7 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable ) // ----------------------------------------------------------------------- -PushButton* ImplCFieldFloatWin::EnableNoneBtn( BOOL bEnable ) +PushButton* ImplCFieldFloatWin::EnableNoneBtn( sal_Bool bEnable ) { if ( bEnable ) { @@ -2864,8 +2864,8 @@ CalendarField::CalendarField( Window* pParent, WinBits nWinStyle ) : mpFloatWin = NULL; mpCalendar = NULL; mnCalendarStyle = 0; - mbToday = FALSE; - mbNone = FALSE; + mbToday = sal_False; + mbNone = sal_False; } // ----------------------------------------------------------------------- @@ -2877,8 +2877,8 @@ CalendarField::CalendarField( Window* pParent, const ResId& rResId ) : mpFloatWin = NULL; mpCalendar = NULL; mnCalendarStyle = 0; - mbToday = FALSE; - mbNone = FALSE; + mbToday = sal_False; + mbNone = sal_False; } // ----------------------------------------------------------------------- @@ -2964,7 +2964,7 @@ void CalendarField::Select() // ----------------------------------------------------------------------- -BOOL CalendarField::ShowDropDown( BOOL bShow ) +sal_Bool CalendarField::ShowDropDown( sal_Bool bShow ) { if ( bShow ) { @@ -3009,7 +3009,7 @@ BOOL CalendarField::ShowDropDown( BOOL bShow ) mpCalendar->EndSelection(); EndDropDown(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index d44b18a29ae1..fe4d28fedbc9 100755 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -63,10 +63,10 @@ static sal_Unicode aImplStarSymbolText[] = {0x2706,0x2704,0x270D,0xE033,0x2211,0 struct ImplColorListData { Color aColor; - BOOL bColor; + sal_Bool bColor; - ImplColorListData() : aColor( COL_BLACK ) { bColor = FALSE; } - ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = TRUE; } + ImplColorListData() : aColor( COL_BLACK ) { bColor = sal_False; } + ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = sal_True; } }; DECLARE_LIST( ImpColorList, ImplColorListData* ) @@ -80,7 +80,7 @@ void ColorListBox::ImplInit() aImageSize.Height() = GetTextHeight(); aImageSize.Height() -= 2; - EnableUserDraw( TRUE ); + EnableUserDraw( sal_True ); SetUserItemSize( aImageSize ); } @@ -88,7 +88,7 @@ void ColorListBox::ImplInit() void ColorListBox::ImplDestroyColorEntries() { - for ( USHORT n = (USHORT) pColorList->Count(); n; ) + for ( sal_uInt16 n = (sal_uInt16) pColorList->Count(); n; ) { ImplColorListData* pData = pColorList->GetObject( --n ); delete pData; @@ -122,7 +122,7 @@ ColorListBox::~ColorListBox() // ----------------------------------------------------------------------- -USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos ) +sal_uInt16 ColorListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos ) { nPos = ListBox::InsertEntry( rStr, nPos ); if ( nPos != LISTBOX_ERROR ) @@ -135,8 +135,8 @@ USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos ) // ----------------------------------------------------------------------- -USHORT ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr, - USHORT nPos ) +sal_uInt16 ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr, + sal_uInt16 nPos ) { nPos = ListBox::InsertEntry( rStr, nPos ); if ( nPos != LISTBOX_ERROR ) @@ -157,7 +157,7 @@ void ColorListBox::InsertAutomaticEntry() // ----------------------------------------------------------------------- -void ColorListBox::RemoveEntry( USHORT nPos ) +void ColorListBox::RemoveEntry( sal_uInt16 nPos ) { ListBox::RemoveEntry( nPos ); delete pColorList->Remove( nPos ); @@ -179,11 +179,11 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox ) ImplDestroyColorEntries(); // Daten kopieren - USHORT nCount = (USHORT) rBox.pColorList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16) rBox.pColorList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { ImplColorListData* pData = rBox.pColorList->GetObject( n ); - USHORT nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND ); + sal_uInt16 nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND ); if ( nPos != LISTBOX_ERROR ) pColorList->Insert( new ImplColorListData( *pData ), nPos ); } @@ -191,9 +191,9 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox ) // ----------------------------------------------------------------------- -USHORT ColorListBox::GetEntryPos( const Color& rColor ) const +sal_uInt16 ColorListBox::GetEntryPos( const Color& rColor ) const { - for( USHORT n = (USHORT) pColorList->Count(); n; ) + for( sal_uInt16 n = (sal_uInt16) pColorList->Count(); n; ) { ImplColorListData* pData = pColorList->GetObject( --n ); if ( pData->bColor && ( pData->aColor == rColor ) ) @@ -204,7 +204,7 @@ USHORT ColorListBox::GetEntryPos( const Color& rColor ) const // ----------------------------------------------------------------------- -Color ColorListBox::GetEntryColor( USHORT nPos ) const +Color ColorListBox::GetEntryColor( sal_uInt16 nPos ) const { Color aColor; ImplColorListData* pData = pColorList->GetObject( nPos ); @@ -230,13 +230,13 @@ void ColorListBox::UserDraw( const UserDrawEvent& rUDEvt ) rUDEvt.GetDevice()->SetLineColor( rUDEvt.GetDevice()->GetTextColor() ); rUDEvt.GetDevice()->DrawRect( Rectangle( aPos, aImageSize ) ); rUDEvt.GetDevice()->Pop(); - ListBox::DrawEntry( rUDEvt, FALSE, TRUE, FALSE ); + ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_False ); } else - ListBox::DrawEntry( rUDEvt, FALSE, TRUE, TRUE ); + ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_True ); } else - ListBox::DrawEntry( rUDEvt, TRUE, TRUE, FALSE ); + ListBox::DrawEntry( rUDEvt, sal_True, sal_True, sal_False ); } // ======================================================================= @@ -389,8 +389,8 @@ LineListBox::LineListBox( Window* pParent, const ResId& rResId ) : LineListBox::~LineListBox() { - ULONG n = 0; - ULONG nCount = pLineList->Count(); + sal_uIntPtr n = 0; + sal_uIntPtr nCount = pLineList->Count(); while ( n < nCount ) { ImpLineListData* pData = pLineList->GetObject( n ); @@ -403,7 +403,7 @@ LineListBox::~LineListBox() // ----------------------------------------------------------------------- -USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos ) +sal_uInt16 LineListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos ) { nPos = ListBox::InsertEntry( rStr, nPos ); if ( nPos != LISTBOX_ERROR ) @@ -413,8 +413,8 @@ USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos ) // ----------------------------------------------------------------------- -USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance, - USHORT nPos ) +sal_uInt16 LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance, + sal_uInt16 nPos ) { XubString aStr; Bitmap aBmp; @@ -434,7 +434,7 @@ USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance, // ----------------------------------------------------------------------- -void LineListBox::RemoveEntry( USHORT nPos ) +void LineListBox::RemoveEntry( sal_uInt16 nPos ) { ListBox::RemoveEntry( nPos ); ImpLineListData* pData = pLineList->Remove( nPos ); @@ -446,8 +446,8 @@ void LineListBox::RemoveEntry( USHORT nPos ) void LineListBox::Clear() { - ULONG n = 0; - ULONG nCount = pLineList->Count(); + sal_uIntPtr n = 0; + sal_uIntPtr nCount = pLineList->Count(); while ( n < nCount ) { ImpLineListData* pData = pLineList->GetObject( n ); @@ -462,11 +462,11 @@ void LineListBox::Clear() // ----------------------------------------------------------------------- -USHORT LineListBox::GetEntryPos( long nLine1, long nLine2, +sal_uInt16 LineListBox::GetEntryPos( long nLine1, long nLine2, long nDistance ) const { - ULONG n = 0; - ULONG nCount = pLineList->Count(); + sal_uIntPtr n = 0; + sal_uIntPtr nCount = pLineList->Count(); while ( n < nCount ) { ImpLineListData* pData = pLineList->GetObject( n ); @@ -475,7 +475,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2, if ( (pData->nLine1 == nLine1) && (pData->nLine2 == nLine2) && (pData->nDistance == nDistance) ) - return (USHORT)n; + return (sal_uInt16)n; } n++; @@ -486,7 +486,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2, // ----------------------------------------------------------------------- -long LineListBox::GetEntryLine1( USHORT nPos ) const +long LineListBox::GetEntryLine1( sal_uInt16 nPos ) const { ImpLineListData* pData = pLineList->GetObject( nPos ); if ( pData ) @@ -497,7 +497,7 @@ long LineListBox::GetEntryLine1( USHORT nPos ) const // ----------------------------------------------------------------------- -long LineListBox::GetEntryLine2( USHORT nPos ) const +long LineListBox::GetEntryLine2( sal_uInt16 nPos ) const { ImpLineListData* pData = pLineList->GetObject( nPos ); if ( pData ) @@ -508,7 +508,7 @@ long LineListBox::GetEntryLine2( USHORT nPos ) const // ----------------------------------------------------------------------- -long LineListBox::GetEntryDistance( USHORT nPos ) const +long LineListBox::GetEntryDistance( sal_uInt16 nPos ) const { ImpLineListData* pData = pLineList->GetObject( nPos ); if ( pData ) @@ -523,7 +523,7 @@ void LineListBox::UpdateLineColors( void ) { if( UpdatePaintLineColor() ) { - ULONG nCount = pLineList->Count(); + sal_uIntPtr nCount = pLineList->Count(); if( !nCount ) return; @@ -531,34 +531,34 @@ void LineListBox::UpdateLineColors( void ) Bitmap aBmp; // exchange entries which containing lines - SetUpdateMode( FALSE ); + SetUpdateMode( sal_False ); - USHORT nSelEntry = GetSelectEntryPos(); - for( ULONG n = 0 ; n < nCount ; ++n ) + sal_uInt16 nSelEntry = GetSelectEntryPos(); + for( sal_uIntPtr n = 0 ; n < nCount ; ++n ) { ImpLineListData* pData = pLineList->GetObject( n ); if( pData ) { // exchange listbox data - ListBox::RemoveEntry( USHORT( n ) ); + ListBox::RemoveEntry( sal_uInt16( n ) ); ImpGetLine( pData->nLine1, pData->nLine2, pData->nDistance, aBmp, aStr ); - ListBox::InsertEntry( aStr, aBmp, USHORT( n ) ); + ListBox::InsertEntry( aStr, aBmp, sal_uInt16( n ) ); } } if( nSelEntry != LISTBOX_ENTRY_NOTFOUND ) SelectEntryPos( nSelEntry ); - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); Invalidate(); } } // ----------------------------------------------------------------------- -BOOL LineListBox::UpdatePaintLineColor( void ) +sal_Bool LineListBox::UpdatePaintLineColor( void ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Color aNewCol( rSettings.GetWindowColor().IsDark()? rSettings.GetLabelTextColor() : aColor ); @@ -587,10 +587,10 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt ) struct ImplFontNameListData { FontInfo maInfo; - USHORT mnType; + sal_uInt16 mnType; ImplFontNameListData( const FontInfo& rInfo, - USHORT nType ) : + sal_uInt16 nType ) : maInfo( rInfo ), mnType( nType ) {} @@ -605,8 +605,8 @@ FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) : { InitBitmaps(); mpFontList = NULL; - mbWYSIWYG = FALSE; - mbSymbols = FALSE; + mbWYSIWYG = sal_False; + mbSymbols = sal_False; } // ------------------------------------------------------------------- @@ -616,8 +616,8 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) : { InitBitmaps(); mpFontList = NULL; - mbWYSIWYG = FALSE; - mbSymbols = FALSE; + mbWYSIWYG = sal_False; + mbSymbols = sal_False; } // ------------------------------------------------------------------- @@ -641,7 +641,7 @@ void FontNameBox::DataChanged( const DataChangedEvent& rDCEvt ) void FontNameBox::InitBitmaps( void ) { - BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); maImagePrinterFont = Image( SvtResId( bHC? RID_IMG_PRINTERFONT_HC : RID_IMG_PRINTERFONT ) ); maImageBitmapFont = Image( SvtResId( bHC? RID_IMG_BITMAPFONT_HC : RID_IMG_BITMAPFONT ) ); @@ -676,14 +676,14 @@ void FontNameBox::Fill( const FontList* pList ) mpFontList = new ImplFontList; // insert fonts - USHORT nFontCount = pList->GetFontNameCount(); - for ( USHORT i = 0; i < nFontCount; i++ ) + sal_uInt16 nFontCount = pList->GetFontNameCount(); + for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { const FontInfo& rFontInfo = pList->GetFontName( i ); - ULONG nIndex = InsertEntry( rFontInfo.GetName() ); + sal_uIntPtr nIndex = InsertEntry( rFontInfo.GetName() ); if ( nIndex != LISTBOX_ERROR ) { - USHORT nType = pList->GetFontNameType( i ); + sal_uInt16 nType = pList->GetFontNameType( i ); ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType ); mpFontList->Insert( pData, nIndex ); } @@ -698,7 +698,7 @@ void FontNameBox::Fill( const FontList* pList ) // ------------------------------------------------------------------- -void FontNameBox::EnableWYSIWYG( BOOL bEnable ) +void FontNameBox::EnableWYSIWYG( sal_Bool bEnable ) { if ( bEnable != mbWYSIWYG ) { @@ -710,7 +710,7 @@ void FontNameBox::EnableWYSIWYG( BOOL bEnable ) // ------------------------------------------------------------------- -void FontNameBox::EnableSymbols( BOOL bEnable ) +void FontNameBox::EnableSymbols( sal_Bool bEnable ) { if ( bEnable != mbSymbols ) { @@ -727,21 +727,21 @@ void FontNameBox::ImplCalcUserItemSize() Size aUserItemSz; if ( mbWYSIWYG && mpFontList ) { - USHORT nMaxLen = 0; - BOOL bSymbolFont = FALSE; - BOOL bStarSymbol = FALSE; - for ( USHORT n = GetEntryCount(); n; ) + sal_uInt16 nMaxLen = 0; + sal_Bool bSymbolFont = sal_False; + sal_Bool bStarSymbol = sal_False; + for ( sal_uInt16 n = GetEntryCount(); n; ) { ImplFontNameListData* pData = mpFontList->GetObject( --n ); XubString aFontName = pData->maInfo.GetName(); if ( aFontName.Len() > nMaxLen ) nMaxLen = aFontName.Len(); if ( pData->maInfo.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) - bSymbolFont = TRUE; + bSymbolFont = sal_True; // starsymbol is a unicode font, but gets WYSIWIG symbols if( aFontName.EqualsIgnoreCaseAscii( "starsymbol" ) || aFontName.EqualsIgnoreCaseAscii( "opensymbol" ) ) - bSymbolFont = bStarSymbol = TRUE; + bSymbolFont = bStarSymbol = sal_True; } // guess maximimum width @@ -779,7 +779,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) { ImplFontNameListData* pData = mpFontList->GetObject( rUDEvt.GetItemId() ); const FontInfo& rInfo = pData->maInfo; - USHORT nType = pData->mnType; + sal_uInt16 nType = pData->mnType; Point aTopLeft = rUDEvt.GetRect().TopLeft(); long nX = aTopLeft.X(); long nH = rUDEvt.GetRect().GetHeight(); @@ -891,11 +891,11 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) rUDEvt.GetDevice()->DrawText( aPos, aString ); rUDEvt.GetDevice()->SetFont( aOldFont ); - DrawEntry( rUDEvt, FALSE, FALSE); // draw seperator + DrawEntry( rUDEvt, sal_False, sal_False); // draw seperator } else { - DrawEntry( rUDEvt, TRUE, TRUE ); + DrawEntry( rUDEvt, sal_True, sal_True ); } } @@ -947,12 +947,12 @@ void FontStyleBox::Modify() CharClass aChrCls( ::comphelper::getProcessServiceFactory(), GetSettings().GetLocale() ); XubString aStr = GetText(); - USHORT nEntryCount = GetEntryCount(); + sal_uInt16 nEntryCount = GetEntryCount(); if ( GetEntryPos( aStr ) == COMBOBOX_ENTRY_NOTFOUND ) { aChrCls.toUpper( aStr ); - for ( USHORT i = 0; i < nEntryCount; i++ ) + for ( sal_uInt16 i = 0; i < nEntryCount; i++ ) { XubString aEntryText = GetEntry( i ); aChrCls.toUpper( aEntryText ); @@ -976,7 +976,7 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) // else aLastStyle will overwritten // store prior selection position and clear box XubString aOldText = GetText(); - USHORT nPos = GetEntryPos( aOldText ); + sal_uInt16 nPos = GetEntryPos( aOldText ); Clear(); // does a font with this name already exist? @@ -987,11 +987,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) FontWeight eLastWeight = WEIGHT_DONTKNOW; FontItalic eLastItalic = ITALIC_NONE; FontWidth eLastWidth = WIDTH_DONTKNOW; - BOOL bNormal = FALSE; - BOOL bItalic = FALSE; - BOOL bBold = FALSE; - BOOL bBoldItalic = FALSE; - BOOL bInsert = FALSE; + sal_Bool bNormal = sal_False; + sal_Bool bItalic = sal_False; + sal_Bool bBold = sal_False; + sal_Bool bBoldItalic = sal_False; + sal_Bool bInsert = sal_False; FontInfo aInfo; while ( hFontInfo ) { @@ -1011,16 +1011,16 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) if ( eWeight <= WEIGHT_NORMAL ) { if ( eItalic != ITALIC_NONE ) - bItalic = TRUE; + bItalic = sal_True; else - bNormal = TRUE; + bNormal = sal_True; } else { if ( eItalic != ITALIC_NONE ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; else - bBold = TRUE; + bBold = sal_True; } // For wrong StyleNames we replace this with the correct once @@ -1054,11 +1054,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList ) } if ( !bItalic && (aStyleText == pList->GetItalicStr()) ) - bItalic = TRUE; + bItalic = sal_True; else if ( !bBold && (aStyleText == pList->GetBoldStr()) ) - bBold = TRUE; + bBold = sal_True; else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; hFontInfo = pList->GetNextFontInfo( hFontInfo ); } @@ -1137,15 +1137,15 @@ FontSizeBox::~FontSizeBox() void FontSizeBox::ImplInit() { - EnableAutocomplete( FALSE ); + EnableAutocomplete( sal_False ); - bRelativeMode = FALSE; - bPtRelative = FALSE; - bRelative = FALSE; - bStdSize = FALSE; + bRelativeMode = sal_False; + bPtRelative = sal_False; + bRelative = sal_False; + bStdSize = sal_False; pFontList = NULL; - SetShowTrailingZeros( FALSE ); + SetShowTrailingZeros( sal_False ); SetDecimalDigits( 1 ); SetMin( 20 ); SetMax( 9999 ); @@ -1181,24 +1181,24 @@ void FontSizeBox::Modify() XubString aStr = GetText(); aStr.EraseLeadingChars(); - BOOL bNewMode = bRelative; - BOOL bOldPtRelMode = bPtRelative; + sal_Bool bNewMode = bRelative; + sal_Bool bOldPtRelMode = bPtRelative; if ( bRelative ) { - bPtRelative = FALSE; + bPtRelative = sal_False; const xub_Unicode* pStr = aStr.GetBuffer(); while ( *pStr ) { if ( ((*pStr < '0') || (*pStr > '9')) && (*pStr != '%') ) { if ( ('-' == *pStr || '+' == *pStr) && !bPtRelative ) - bPtRelative = TRUE; + bPtRelative = sal_True; else if ( bPtRelative && 'p' == *pStr && 't' == *++pStr ) ; else { - bNewMode = FALSE; + bNewMode = sal_False; break; } } @@ -1209,14 +1209,14 @@ void FontSizeBox::Modify() { if ( STRING_NOTFOUND != aStr.Search( '%' ) ) { - bNewMode = TRUE; - bPtRelative = FALSE; + bNewMode = sal_True; + bPtRelative = sal_False; } if ( '-' == aStr.GetChar( 0 ) || '+' == aStr.GetChar( 0 ) ) { - bNewMode = TRUE; - bPtRelative = TRUE; + bNewMode = sal_True; + bPtRelative = sal_True; } } @@ -1257,24 +1257,24 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) // for standard sizes we don't need to bother if ( bStdSize && GetEntryCount() && aFontSizeNames.IsEmpty() ) return; - bStdSize = TRUE; + bStdSize = sal_True; } else - bStdSize = FALSE; + bStdSize = sal_False; Selection aSelection = GetSelection(); XubString aStr = GetText(); Clear(); - USHORT nPos = 0; + sal_uInt16 nPos = 0; if ( !aFontSizeNames.IsEmpty() ) { if ( pAry == pList->GetStdSizeAry() ) { // for scalable fonts all font size names - ULONG nCount = aFontSizeNames.Count(); - for( ULONG i = 0; i < nCount; i++ ) + sal_uIntPtr nCount = aFontSizeNames.Count(); + for( sal_uIntPtr i = 0; i < nCount; i++ ) { String aSizeName = aFontSizeNames.GetIndexName( i ); long nSize = aFontSizeNames.GetIndexSize( i ); @@ -1317,9 +1317,9 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) // ----------------------------------------------------------------------- -void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep ) +void FontSizeBox::EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep ) { - bRelativeMode = TRUE; + bRelativeMode = sal_True; nRelMin = nMin; nRelMax = nMax; nRelStep = nStep; @@ -1330,7 +1330,7 @@ void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep ) void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep ) { - bRelativeMode = TRUE; + bRelativeMode = sal_True; nPtRelMin = nMin; nPtRelMax = nMax; nPtRelStep = nStep; @@ -1339,7 +1339,7 @@ void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep ) // ----------------------------------------------------------------------- -void FontSizeBox::SetRelative( BOOL bNewRelative ) +void FontSizeBox::SetRelative( sal_Bool bNewRelative ) { if ( bRelativeMode ) { @@ -1349,8 +1349,8 @@ void FontSizeBox::SetRelative( BOOL bNewRelative ) if ( bNewRelative ) { - bRelative = TRUE; - bStdSize = FALSE; + bRelative = sal_True; + bStdSize = sal_False; if ( bPtRelative ) { @@ -1378,7 +1378,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative ) SetUnit( FUNIT_CUSTOM ); Clear(); - USHORT i = nRelMin; + sal_uInt16 i = nRelMin; while ( i <= nRelMax ) { InsertValue( i ); @@ -1388,7 +1388,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative ) } else { - bRelative = bPtRelative = FALSE; + bRelative = bPtRelative = sal_False; SetDecimalDigits( 1 ); SetMin( 20 ); SetMax( 9999 ); @@ -1428,7 +1428,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit ) mnLastValue = nTempValue; SetText( aName ); mnFieldValue = mnLastValue; - SetEmptyFieldValueData( FALSE ); + SetEmptyFieldValueData( sal_False ); return; } } @@ -1445,7 +1445,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue ) // ----------------------------------------------------------------------- -sal_Int64 FontSizeBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const +sal_Int64 FontSizeBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const { if ( !bRelative ) { diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx index 2f3ff037be31..62489f1b83d2 100644..100755 --- a/svtools/source/control/ctrldll.cxx +++ b/svtools/source/control/ctrldll.cxx @@ -57,7 +57,7 @@ extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) hDLLInst = hDLL; - return TRUE; + return sal_True; } /*************************************************************************** diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index bd965aca66a6..76e833b6d349 100755 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -120,7 +120,7 @@ class ImplFontListNameInfo private: XubString maSearchName; ImplFontListFontInfo* mpFirst; - USHORT mnType; + sal_uInt16 mnType; ImplFontListNameInfo( const XubString& rSearchName ) : maSearchName( rSearchName ) @@ -168,7 +168,7 @@ static void ImplMakeSearchStringFromName( XubString& rStr ) // ----------------------------------------------------------------------- -ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* pIndex ) const +ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uIntPtr* pIndex ) const { // Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als // der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem @@ -176,7 +176,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p // und somit die Wahrscheinlichkeit das hinten angehaengt werden muss // sehr gross ist. StringCompare eComp; - ULONG nCnt = Count(); + sal_uIntPtr nCnt = Count(); if ( !nCnt ) { if ( pIndex ) @@ -200,9 +200,9 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p // Fonts in der Liste suchen ImplFontListNameInfo* pCompareData; ImplFontListNameInfo* pFoundData = NULL; - ULONG nLow = 0; - ULONG nHigh = nCnt-1; - ULONG nMid; + sal_uIntPtr nLow = 0; + sal_uIntPtr nHigh = nCnt-1; + sal_uIntPtr nMid; do { @@ -251,12 +251,12 @@ ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const // ----------------------------------------------------------------------- -void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, - BOOL bInsertData ) +void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll, + sal_Bool bInsertData ) { rtl_TextEncoding eSystemEncoding = gsl_getSystemTextEncoding(); - USHORT nType; + sal_uInt16 nType; if ( pDevice->GetOutDevType() != OUTDEV_PRINTER ) nType = FONTLIST_FONTNAMETYPE_SCREEN; else @@ -264,7 +264,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, // Alle Fonts vom Device abfragen int n = pDevice->GetDevFontCount(); - USHORT i; + sal_uInt16 i; for( i = 0; i < n; i++ ) { FontInfo aFontInfo = pDevice->GetDevFont( i ); @@ -276,7 +276,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, XubString aSearchName = aFontInfo.GetName(); ImplFontListNameInfo* pData; - ULONG nIndex; + sal_uIntPtr nIndex; ImplMakeSearchString( aSearchName ); pData = ImplFind( aSearchName, &nIndex ); @@ -296,7 +296,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, { if ( bInsertData ) { - BOOL bInsert = TRUE; + sal_Bool bInsert = sal_True; ImplFontListFontInfo* pPrev = NULL; ImplFontListFontInfo* pTemp = pData->mpFirst; ImplFontListFontInfo* pNewInfo = new ImplFontListFontInfo( aFontInfo, pDevice ); @@ -317,7 +317,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, pTemp->mpNext = pTemp2; } delete pNewInfo; - bInsert = FALSE; + bInsert = sal_False; } break; @@ -349,8 +349,8 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll, // ======================================================================= -FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) : - List( 4096, sal::static_int_cast< USHORT >(pDevice->GetDevFontCount()), 32 ) +FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, sal_Bool bAll ) : + List( 4096, sal::static_int_cast< sal_uInt16 >(pDevice->GetDevFontCount()), 32 ) { // Variablen initialisieren mpDev = pDevice; @@ -367,14 +367,14 @@ FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) : maBlack = XubString( SvtResId( STR_SVT_STYLE_BLACK ) ); maBlackItalic = XubString( SvtResId( STR_SVT_STYLE_BLACK_ITALIC ) ); - ImplInsertFonts( pDevice, bAll, TRUE ); + ImplInsertFonts( pDevice, bAll, sal_True ); // Gegebenenfalls muessen wir mit den Bildschirmfonts vergleichen, // damit dort die eigentlich doppelten auf Equal mappen koennen - BOOL bCompareWindow = FALSE; + sal_Bool bCompareWindow = sal_False; if ( !pDevice2 && (pDevice->GetOutDevType() == OUTDEV_PRINTER) ) { - bCompareWindow = TRUE; + bCompareWindow = sal_True; pDevice2 = Application::GetDefaultDevice(); } @@ -532,12 +532,12 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const } // search for synthetic style - USHORT nType = pData->mnType; + sal_uInt16 nType = pData->mnType; const XubString& rStyleName = rInfo.GetStyleName(); if ( rStyleName.Len() ) { - BOOL bNotSynthetic = FALSE; - BOOL bNoneAvailable = FALSE; + sal_Bool bNotSynthetic = sal_False; + sal_Bool bNoneAvailable = sal_False; FontWeight eWeight = rInfo.GetWeight(); FontItalic eItalic = rInfo.GetItalic(); ImplFontListFontInfo* pFontInfo = pData->mpFirst; @@ -546,7 +546,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const if ( (eWeight == pFontInfo->GetWeight()) && (eItalic == pFontInfo->GetItalic()) ) { - bNotSynthetic = TRUE; + bNotSynthetic = sal_True; break; } @@ -603,7 +603,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const // ----------------------------------------------------------------------- -USHORT FontList::GetFontNameType( const XubString& rFontName ) const +sal_uInt16 FontList::GetFontNameType( const XubString& rFontName ) const { ImplFontListNameInfo* pData = ImplFindByName( rFontName ); if ( pData ) @@ -751,14 +751,14 @@ FontInfo FontList::Get( const XubString& rName, // ----------------------------------------------------------------------- -BOOL FontList::IsAvailable( const XubString& rName ) const +sal_Bool FontList::IsAvailable( const XubString& rName ) const { return (ImplFindByName( rName ) != 0); } // ----------------------------------------------------------------------- -const FontInfo& FontList::GetFontName( USHORT nFont ) const +const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const { DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" ); @@ -768,7 +768,7 @@ const FontInfo& FontList::GetFontName( USHORT nFont ) const // ----------------------------------------------------------------------- -USHORT FontList::GetFontNameType( USHORT nFont ) const +sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const { DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" ); @@ -834,8 +834,8 @@ const long* FontList::GetSizeAry( const FontInfo& rInfo ) const MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) ); pDevice->SetMapMode( aMap ); - USHORT i; - USHORT nRealCount = 0; + sal_uInt16 i; + sal_uInt16 nRealCount = 0; long nOldHeight = 0; ((FontList*)this)->mpSizeAry = new long[nDevSizeCount+1]; for ( i = 0; i < nDevSizeCount; i++ ) @@ -996,7 +996,7 @@ String FontSizeNames::Size2Name( long nValue ) const //------------------------------------------------------------------------ -String FontSizeNames::GetIndexName( ULONG nIndex ) const +String FontSizeNames::GetIndexName( sal_uIntPtr nIndex ) const { String aStr; @@ -1008,7 +1008,7 @@ String FontSizeNames::GetIndexName( ULONG nIndex ) const //------------------------------------------------------------------------ -long FontSizeNames::GetIndexSize( ULONG nIndex ) const +long FontSizeNames::GetIndexSize( sal_uIntPtr nIndex ) const { if ( nIndex >= mnElem ) return 0; diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx index 14c0478f5327..1d42c89f8b7d 100644..100755 --- a/svtools/source/control/filectrl.cxx +++ b/svtools/source/control/filectrl.cxx @@ -50,12 +50,12 @@ FileControl::FileControl( Window* pParent, WinBits nStyle, FileControlMode nFlag mnInternalFlags( FILECTRL_ORIGINALBUTTONTEXT ) { maButton.SetClickHdl( LINK( this, FileControl, ButtonHdl ) ); - mbOpenDlg = TRUE; + mbOpenDlg = sal_True; maButton.Show(); maEdit.Show(); - SetCompoundControl( TRUE ); + SetCompoundControl( sal_True ); SetStyle( ImplInitStyle( GetStyle() ) ); } @@ -159,7 +159,7 @@ void FileControl::Resize() if( mnInternalFlags & FILECTRL_INRESIZE ) return; - mnInternalFlags |= FILECTRL_INRESIZE;//InResize = TRUE + mnInternalFlags |= FILECTRL_INRESIZE;//InResize = sal_True Size aOutSz = GetOutputSizePixel(); long nButtonTextWidth = maButton.GetTextWidth( maButtonText ); @@ -168,7 +168,7 @@ void FileControl::Resize() ( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN ? ( maEdit.GetTextWidth( maEdit.GetText() ) <= aOutSz.Width() - nButtonTextWidth - ButtonBorder ) - : TRUE ) ) + : sal_True ) ) ) { maButton.SetText( maButtonText ); @@ -184,7 +184,7 @@ void FileControl::Resize() maEdit.SetPosSizePixel( 0, 0, aOutSz.Width()-nButtonWidth, aOutSz.Height() ); maButton.SetPosSizePixel( aOutSz.Width()-nButtonWidth, 0, nButtonWidth, aOutSz.Height() ); - mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = FALSE + mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = sal_False } // ----------------------------------------------------------------------- @@ -205,7 +205,7 @@ void FileControl::GetFocus() // ----------------------------------------------------------------------- -void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags ) +void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uIntPtr nFlags ) { WinBits nOldEditStyle = GetEdit().GetStyle(); if ( GetStyle() & WB_BORDER ) diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index 5b986dc10f9d..3f15a9937cff 100644..100755 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -305,7 +305,7 @@ namespace validation //============================================================================== SvNumberFormatter* FormattedField::StaticFormatter::s_cFormatter = NULL; -ULONG FormattedField::StaticFormatter::s_nReferences = 0; +sal_uIntPtr FormattedField::StaticFormatter::s_nReferences = 0; //------------------------------------------------------------------------------ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter() @@ -345,13 +345,13 @@ DBG_NAME(FormattedField); m_aLastSelection(0,0) \ ,m_dMinValue(0) \ ,m_dMaxValue(0) \ - ,m_bHasMin(FALSE) \ - ,m_bHasMax(FALSE) \ - ,m_bStrictFormat(TRUE) \ - ,m_bValueDirty(TRUE) \ - ,m_bEnableEmptyField(TRUE) \ - ,m_bAutoColor(FALSE) \ - ,m_bEnableNaN(FALSE) \ + ,m_bHasMin(sal_False) \ + ,m_bHasMax(sal_False) \ + ,m_bStrictFormat(sal_True) \ + ,m_bValueDirty(sal_True) \ + ,m_bEnableEmptyField(sal_True) \ + ,m_bAutoColor(sal_False) \ + ,m_bEnableNaN(sal_False) \ ,m_dCurrentValue(0) \ ,m_dDefaultValue(0) \ ,m_nFormatKey(0) \ @@ -359,12 +359,12 @@ DBG_NAME(FormattedField); ,m_dSpinSize(1) \ ,m_dSpinFirst(-1000000) \ ,m_dSpinLast(1000000) \ - ,m_bTreatAsNumber(TRUE) \ + ,m_bTreatAsNumber(sal_True) \ ,m_pLastOutputColor(NULL) \ ,m_bUseInputStringForFormatting(false) //------------------------------------------------------------------------------ -FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey) +FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey) :SpinField(pParent, nStyle) ,INIT_MEMBERS() { @@ -378,7 +378,7 @@ FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatte } //------------------------------------------------------------------------------ -FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey) +FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey) :SpinField(pParent, rResId) ,INIT_MEMBERS() { @@ -408,7 +408,7 @@ void FormattedField::SetValidateText(const XubString& rText, const String* pErro if (pErrorText) ImplSetTextImpl(*pErrorText, NULL); else - ImplSetValue(m_dDefaultValue, TRUE); + ImplSetValue(m_dDefaultValue, sal_True); } //------------------------------------------------------------------------------ @@ -417,7 +417,7 @@ void FormattedField::SetText(const XubString& rStr) DBG_CHKTHIS(FormattedField, NULL); SpinField::SetText(rStr); - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; } //------------------------------------------------------------------------------ @@ -426,7 +426,7 @@ void FormattedField::SetText( const XubString& rStr, const Selection& rNewSelect DBG_CHKTHIS(FormattedField, NULL); SpinField::SetText( rStr, rNewSelection ); - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; } //------------------------------------------------------------------------------ @@ -455,8 +455,8 @@ void FormattedField::SetTextFormatted(const XubString& rStr) Selection aSel(GetSelection()); Selection aNewSel(aSel); aNewSel.Justify(); - USHORT nNewLen = sFormatted.Len(); - USHORT nCurrentLen = GetText().Len(); + sal_uInt16 nNewLen = sFormatted.Len(); + sal_uInt16 nCurrentLen = GetText().Len(); if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen)) { // the new text is longer and the cursor was behind the last char (of the old text) if (aNewSel.Min() == 0) @@ -464,7 +464,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr) aNewSel.Max() = nNewLen; if (!nCurrentLen) { // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options - ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); + sal_uIntPtr nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); if (nSelOptions & SELECTION_OPTION_SHOWFIRST) { // selection should be from right to left -> swap min and max aNewSel.Min() = aNewSel.Max(); @@ -483,7 +483,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr) else aNewSel = aSel; // don't use the justified version SpinField::SetText(sFormatted, aNewSel); - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; } //------------------------------------------------------------------------------ @@ -492,13 +492,13 @@ String FormattedField::GetTextValue() const if (m_bValueDirty) { ((FormattedField*)this)->m_sCurrentTextValue = GetText(); - ((FormattedField*)this)->m_bValueDirty = FALSE; + ((FormattedField*)this)->m_bValueDirty = sal_False; } return m_sCurrentTextValue; } //------------------------------------------------------------------------------ -void FormattedField::EnableNotANumber( BOOL _bEnable ) +void FormattedField::EnableNotANumber( sal_Bool _bEnable ) { if ( m_bEnableNaN == _bEnable ) return; @@ -507,7 +507,7 @@ void FormattedField::EnableNotANumber( BOOL _bEnable ) } //------------------------------------------------------------------------------ -void FormattedField::SetAutoColor(BOOL _bAutomatic) +void FormattedField::SetAutoColor(sal_Bool _bAutomatic) { if (_bAutomatic == m_bAutoColor) return; @@ -529,7 +529,7 @@ void FormattedField::Modify() if (!IsStrictFormat()) { - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; SpinField::Modify(); return; } @@ -539,7 +539,7 @@ void FormattedField::Modify() { m_sLastValidText = sCheck; m_aLastSelection = GetSelection(); - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; } else { @@ -569,8 +569,8 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel) Selection aSel(GetSelection()); aSel.Justify(); - USHORT nNewLen = rNew.Len(); - USHORT nCurrentLen = GetText().Len(); + sal_uInt16 nNewLen = rNew.Len(); + sal_uInt16 nCurrentLen = GetText().Len(); if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen)) { // new new text is longer and the cursor is behind the last char @@ -579,7 +579,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel) aSel.Max() = nNewLen; if (!nCurrentLen) { // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options - ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); + sal_uIntPtr nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); if (nSelOptions & SELECTION_OPTION_SHOWFIRST) { // selection should be from right to left -> swap min and max aSel.Min() = aSel.Max(); @@ -598,7 +598,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel) SpinField::SetText(rNew, aSel); } - m_bValueDirty = TRUE; + m_bValueDirty = sal_True; // muss nicht stimmen, aber sicherheitshalber ... } @@ -612,12 +612,12 @@ long FormattedField::PreNotify(NotifyEvent& rNEvt) } //------------------------------------------------------------------------------ -void FormattedField::ImplSetFormatKey(ULONG nFormatKey) +void FormattedField::ImplSetFormatKey(sal_uIntPtr nFormatKey) { DBG_CHKTHIS(FormattedField, NULL); m_nFormatKey = nFormatKey; - BOOL bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0); + sal_Bool bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0); if (bNeedFormatter) { ImplGetFormatter(); // damit wird ein Standard-Formatter angelegt @@ -632,16 +632,16 @@ void FormattedField::ImplSetFormatKey(ULONG nFormatKey) } //------------------------------------------------------------------------------ -void FormattedField::SetFormatKey(ULONG nFormatKey) +void FormattedField::SetFormatKey(sal_uIntPtr nFormatKey) { DBG_CHKTHIS(FormattedField, NULL); - BOOL bNoFormatter = (m_pFormatter == NULL); + sal_Bool bNoFormatter = (m_pFormatter == NULL); ImplSetFormatKey(nFormatKey); FormatChanged((bNoFormatter && (m_pFormatter != NULL)) ? FCT_FORMATTER : FCT_KEYONLY); } //------------------------------------------------------------------------------ -void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat) +void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat) { DBG_CHKTHIS(FormattedField, NULL); @@ -675,7 +675,7 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetForm LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW; // den alten Format-String in die neue Sprache konvertieren - USHORT nCheckPos; + sal_uInt16 nCheckPos; short nType; pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang); m_nFormatKey = nDestKey; @@ -697,47 +697,47 @@ void FormattedField::GetFormat(XubString& rFormatString, LanguageType& eLang) co } //------------------------------------------------------------------------------ -BOOL FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang) +sal_Bool FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang) { DBG_CHKTHIS(FormattedField, NULL); sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang); if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND) { - USHORT nCheckPos; + sal_uInt16 nCheckPos; short nType; XubString rFormat(rFormatString); if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey, eLang)) - return FALSE; + return sal_False; DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !"); } if (nNewKey != m_nFormatKey) SetFormatKey(nNewKey); - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ -BOOL FormattedField::GetThousandsSep() const +sal_Bool FormattedField::GetThousandsSep() const { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::GetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?"); - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); return bThousand; } //------------------------------------------------------------------------------ -void FormattedField::SetThousandsSep(BOOL _bUseSeparator) +void FormattedField::SetThousandsSep(sal_Bool _bUseSeparator) { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::SetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?"); // get the current settings - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); if (bThousand == _bUseSeparator) return; @@ -750,7 +750,7 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator) // generate a new format ... ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, _bUseSeparator, IsRed, nPrecision, nAnzLeading); // ... and introduce it to the formatter - USHORT nCheckPos; + sal_uInt16 nCheckPos; sal_uInt32 nNewKey; short nType; ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang); @@ -761,27 +761,27 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator) } //------------------------------------------------------------------------------ -USHORT FormattedField::GetDecimalDigits() const +sal_uInt16 FormattedField::GetDecimalDigits() const { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::GetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?"); - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); return nPrecision; } //------------------------------------------------------------------------------ -void FormattedField::SetDecimalDigits(USHORT _nPrecision) +void FormattedField::SetDecimalDigits(sal_uInt16 _nPrecision) { DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey), "FormattedField::SetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?"); // get the current settings - BOOL bThousand, IsRed; - USHORT nPrecision, nAnzLeading; + sal_Bool bThousand, IsRed; + sal_uInt16 nPrecision, nAnzLeading; ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading); if (nPrecision == _nPrecision) return; @@ -794,7 +794,7 @@ void FormattedField::SetDecimalDigits(USHORT _nPrecision) // generate a new format ... ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, bThousand, IsRed, _nPrecision, nAnzLeading); // ... and introduce it to the formatter - USHORT nCheckPos; + sal_uInt16 nCheckPos; sal_uInt32 nNewKey; short nType; ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang); @@ -831,7 +831,7 @@ void FormattedField::Commit() { // consider the field as modified Modify(); // but we have the most recent value now - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; } } @@ -845,7 +845,7 @@ void FormattedField::ReFormat() double dValue = GetValue(); if ( m_bEnableNaN && ::rtl::math::isNan( dValue ) ) return; - ImplSetValue( dValue, TRUE ); + ImplSetValue( dValue, sal_True ); } else SetTextFormatted(GetTextValue()); @@ -860,7 +860,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt) if ((rNEvt.GetType() == EVENT_KEYINPUT) && !IsReadOnly()) { const KeyEvent& rKEvt = *rNEvt.GetKeyEvent(); - USHORT nMod = rKEvt.GetKeyCode().GetModifier(); + sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier(); switch ( rKEvt.GetKeyCode().GetCode() ) { case KEY_UP: @@ -901,7 +901,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt) { if (TreatingAsNumber()) { - ImplSetValue(m_dCurrentValue, TRUE); + ImplSetValue(m_dCurrentValue, sal_True); Modify(); } else @@ -912,7 +912,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt) else SetTextFormatted(m_sDefaultText); } - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; } } else @@ -931,7 +931,7 @@ void FormattedField::SetMinValue(double dMin) DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMinValue : only to be used in numeric mode !"); m_dMinValue = dMin; - m_bHasMin = TRUE; + m_bHasMin = sal_True; // fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue ReFormat(); } @@ -943,7 +943,7 @@ void FormattedField::SetMaxValue(double dMax) DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMaxValue : only to be used in numeric mode !"); m_dMaxValue = dMax; - m_bHasMax = TRUE; + m_bHasMax = sal_True; // fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue ReFormat(); } @@ -957,7 +957,7 @@ void FormattedField::SetTextValue(const XubString& rText) } //------------------------------------------------------------------------------ -void FormattedField::EnableEmptyField(BOOL bEnable) +void FormattedField::EnableEmptyField(sal_Bool bEnable) { DBG_CHKTHIS(FormattedField, NULL); if (bEnable == m_bEnableEmptyField) @@ -965,11 +965,11 @@ void FormattedField::EnableEmptyField(BOOL bEnable) m_bEnableEmptyField = bEnable; if (!m_bEnableEmptyField && GetText().Len()==0) - ImplSetValue(m_dCurrentValue, TRUE); + ImplSetValue(m_dCurrentValue, sal_True); } //------------------------------------------------------------------------------ -void FormattedField::ImplSetValue(double dVal, BOOL bForce) +void FormattedField::ImplSetValue(double dVal, sal_Bool bForce) { DBG_CHKTHIS(FormattedField, NULL); @@ -982,7 +982,7 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce) DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplSetValue : can't set a value without a formatter !"); - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; m_dCurrentValue = dVal; String sNewText; @@ -1003,23 +1003,23 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce) } ImplSetTextImpl(sNewText, NULL); - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; DBG_ASSERT(CheckText(sNewText), "FormattedField::ImplSetValue : formatted string doesn't match the criteria !"); } //------------------------------------------------------------------------------ -BOOL FormattedField::ImplGetValue(double& dNewVal) +sal_Bool FormattedField::ImplGetValue(double& dNewVal) { DBG_CHKTHIS(FormattedField, NULL); dNewVal = m_dCurrentValue; if (!m_bValueDirty) - return TRUE; + return sal_True; dNewVal = m_dDefaultValue; String sText(GetText()); if (!sText.Len()) - return TRUE; + return sal_True; DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !"); @@ -1035,7 +1035,7 @@ BOOL FormattedField::ImplGetValue(double& dNewVal) // the language of our format LanguageType eLanguage = m_pFormatter->GetEntry(m_nFormatKey)->GetLanguage(); // the default number format for this language - ULONG nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage); + sal_uIntPtr nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage); sal_uInt32 nTempFormat = nStandardNumericFormat; double dTemp; @@ -1049,14 +1049,14 @@ BOOL FormattedField::ImplGetValue(double& dNewVal) // which equals 300 percent. } if (!ImplGetFormatter()->IsNumberFormat(sText, nFormatKey, dNewVal)) - return FALSE; + return sal_False; if (m_bHasMin && (dNewVal<m_dMinValue)) dNewVal = m_dMinValue; if (m_bHasMax && (dNewVal>m_dMaxValue)) dNewVal = m_dMaxValue; - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ @@ -1079,7 +1079,7 @@ double FormattedField::GetValue() m_dCurrentValue = m_dDefaultValue; } - m_bValueDirty = FALSE; + m_bValueDirty = sal_False; return m_dCurrentValue; } @@ -1166,7 +1166,7 @@ void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat) } //------------------------------------------------------------------------------ -BOOL DoubleNumericField::CheckText(const XubString& sText) const +sal_Bool DoubleNumericField::CheckText(const XubString& sText) const { // We'd like to implement this using the NumberFormatter::IsNumberFormat, but unfortunately, this doesn't // recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10") @@ -1174,19 +1174,19 @@ BOOL DoubleNumericField::CheckText(const XubString& sText) const #ifdef REGEXP_SUPPORT if (!sText.Len()) - return TRUE; + return sal_True; String sForceComplete = '_'; sForceComplete += sText; sForceComplete += '_'; - USHORT nStart = 0, nEnd = sForceComplete.Len(); - BOOL bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd); + sal_uInt16 nStart = 0, nEnd = sForceComplete.Len(); + sal_Bool bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd); if (bFound && (nStart == 0) && (nEnd == sForceComplete.Len())) - return TRUE; + return sal_True; - return FALSE; + return sal_False; #else return m_pNumberValidator->isValidNumericFragment( sText ); #endif @@ -1252,9 +1252,9 @@ void DoubleNumericField::ResetConformanceTester() //------------------------------------------------------------------------------ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle) :FormattedField(pParent, nStyle) - ,m_bChangingFormat(FALSE) + ,m_bChangingFormat(sal_False) { - m_bPrependCurrSym = FALSE; + m_bPrependCurrSym = sal_False; // initialize with a system currency format m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol(); @@ -1264,9 +1264,9 @@ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle) //------------------------------------------------------------------------------ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, const ResId& rResId) :FormattedField(pParent, rResId) - ,m_bChangingFormat(FALSE) + ,m_bChangingFormat(sal_False) { - m_bPrependCurrSym = FALSE; + m_bPrependCurrSym = sal_False; // initialize with a system currency format m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol(); @@ -1313,7 +1313,7 @@ void DoubleCurrencyField::setCurrencySymbol(const String& _sSymbol) } //------------------------------------------------------------------------------ -void DoubleCurrencyField::setPrependCurrSym(BOOL _bPrepend) +void DoubleCurrencyField::setPrependCurrSym(sal_Bool _bPrepend) { if (m_bPrependCurrSym == _bPrepend) return; @@ -1330,8 +1330,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat() XubString sOldFormat; LanguageType eLanguage; GetFormat(sOldFormat, eLanguage); - BOOL bThSep = GetThousandsSep(); - USHORT nDigits = GetDecimalDigits(); + sal_Bool bThSep = GetThousandsSep(); + sal_uInt16 nDigits = GetDecimalDigits(); // build a new format string with the base class' and my own settings Locale aLocale; @@ -1391,8 +1391,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat() } // set this new basic format - m_bChangingFormat = TRUE; + m_bChangingFormat = sal_True; SetFormat(sNewFormat, eLanguage); - m_bChangingFormat = FALSE; + m_bChangingFormat = sal_False; } diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 1ae223bebf06..ba4ca513dd3d 100644..100755 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -50,10 +50,10 @@ struct ImplHeadItem { - USHORT mnId; + sal_uInt16 mnId; HeaderBarItemBits mnBits; long mnSize; - ULONG mnHelpId; + sal_uIntPtr mnHelpId; Image maImage; XubString maOutText; XubString maText; @@ -75,8 +75,8 @@ DECLARE_LIST( ImplHeadItemList, ImplHeadItem* ) #define HEADERBAR_DRAGOFF 4 #define HEADERBAR_DRAGOUTOFF 15 -#define HEAD_HITTEST_ITEM ((USHORT)0x0001) -#define HEAD_HITTEST_DIVIDER ((USHORT)0x0002) +#define HEAD_HITTEST_ITEM ((sal_uInt16)0x0001) +#define HEAD_HITTEST_DIVIDER ((sal_uInt16)0x0002) // ======================================================================= @@ -94,20 +94,20 @@ void HeaderBar::ImplInit( WinBits nWinStyle ) mnMouseOff = 0; mnCurItemId = 0; mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; - mbDrag = FALSE; - mbItemDrag = FALSE; - mbOutDrag = FALSE; - mbItemMode = FALSE; + mbDrag = sal_False; + mbItemDrag = sal_False; + mbOutDrag = sal_False; + mbItemMode = sal_False; // StyleBits auswerten if ( nWinStyle & WB_DRAG ) - mbDragable = TRUE; + mbDragable = sal_True; else - mbDragable = FALSE; + mbDragable = sal_False; if ( nWinStyle & WB_BUTTONSTYLE ) - mbButtonStyle = TRUE; + mbButtonStyle = sal_True; else - mbButtonStyle = FALSE; + mbButtonStyle = sal_False; if ( nWinStyle & WB_BORDER ) { mnBorderOff1 = 1; @@ -119,7 +119,7 @@ void HeaderBar::ImplInit( WinBits nWinStyle ) mnBorderOff2 = 1; } - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -156,8 +156,8 @@ HeaderBar::~HeaderBar() // ----------------------------------------------------------------------- -void HeaderBar::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void HeaderBar::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -194,17 +194,17 @@ void HeaderBar::ImplInitSettings( BOOL bFont, // ----------------------------------------------------------------------- -long HeaderBar::ImplGetItemPos( USHORT nPos ) const +long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const { long nX = -mnOffset; - for ( USHORT i = 0; i < nPos; i++ ) + for ( sal_uInt16 i = 0; i < nPos; i++ ) nX += mpItemList->GetObject( i )->mnSize; return nX; } // ----------------------------------------------------------------------- -Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const +Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const { Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 ); aRect.Right() = aRect.Left() + mpItemList->GetObject( nPos )->mnSize - 1; @@ -216,21 +216,21 @@ Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT HeaderBar::ImplHitTest( const Point& rPos, - long& nMouseOff, USHORT& nPos ) const +sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos, + long& nMouseOff, sal_uInt16& nPos ) const { ImplHeadItem* pItem; - USHORT nCount = (USHORT)mpItemList->Count(); - BOOL bLastFixed = TRUE; + sal_uInt16 nCount = (sal_uInt16)mpItemList->Count(); + sal_Bool bLastFixed = sal_True; long nX = -mnOffset; - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pItem = mpItemList->GetObject( i ); if ( rPos.X() < (nX+pItem->mnSize) ) { - USHORT nMode; + sal_uInt16 nMode; if ( !bLastFixed && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) ) { @@ -258,9 +258,9 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos, } if ( pItem->mnBits & HIB_FIXED ) - bLastFixed = TRUE; + bLastFixed = sal_True; else - bLastFixed = FALSE; + bLastFixed = sal_False; nX += pItem->mnSize; } @@ -281,7 +281,7 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos, // ----------------------------------------------------------------------- -void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos ) +void HeaderBar::ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) { Rectangle aRect1 = ImplGetItemRect( nStartPos ); Rectangle aRect2 = ImplGetItemRect( nEndPos ); @@ -330,10 +330,10 @@ void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos ) // ----------------------------------------------------------------------- void HeaderBar::ImplDrawItem( OutputDevice* pDev, - USHORT nPos, BOOL bHigh, BOOL bDrag, + sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag, const Rectangle& rItemRect, const Rectangle* pRect, - ULONG ) + sal_uIntPtr ) { Rectangle aRect = rItemRect; @@ -387,9 +387,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, // avoid 3D borders Color aSelectionTextColor( COL_TRANSPARENT ); if( bHigh ) - DrawSelectionBackground( aRect, 1, TRUE, FALSE, FALSE, &aSelectionTextColor ); + DrawSelectionBackground( aRect, 1, sal_True, sal_False, sal_False, &aSelectionTextColor ); else if ( !mbButtonStyle || (nBits & HIB_FLAT) ) - DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE, &aSelectionTextColor ); + DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False, &aSelectionTextColor ); // Wenn kein Platz, dann brauchen wir auch nichts ausgeben if ( aRect.GetWidth() < 1 ) @@ -416,14 +416,14 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, } // Text auf entsprechende Laenge kuerzen - BOOL bLeftText = FALSE; + sal_Bool bLeftText = sal_False; long nMaxTxtWidth = aRect.GetWidth()-(HEADERBAR_TEXTOFF*2)-nArrowWidth; if ( nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE) ) nMaxTxtWidth -= aImageSize.Width(); long nTxtWidth = aTxtSize.Width(); if ( nTxtWidth > nMaxTxtWidth ) { - bLeftText = TRUE; + bLeftText = sal_True; // 3 == Len of "..." pItem->maOutText.AppendAscii( "..." ); do @@ -557,7 +557,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, } if ( nImagePos+aImageSize.Width() <= aRect.Right() ) { - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( !IsEnabled() ) nStyle |= IMAGE_DRAW_DISABLE; pDev->DrawImage( Point( nImagePos, nImagePosY ), pItem->maImage, nStyle ); @@ -580,11 +580,11 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, } // Feststellen, ob Platz genug ist, das Item zu malen - BOOL bDraw = TRUE; + sal_Bool bDraw = sal_True; if ( nArrowX < aRect.Left()+HEADERBAR_TEXTOFF ) - bDraw = FALSE; + bDraw = sal_False; else if ( nArrowX+HEAD_ARROWSIZE2 > aRect.Right() ) - bDraw = FALSE; + bDraw = sal_False; if ( bDraw ) { @@ -643,7 +643,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, // ----------------------------------------------------------------------- -void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag, +void HeaderBar::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag, const Rectangle* pRect ) { Rectangle aRect = ImplGetItemRect( nPos ); @@ -652,14 +652,14 @@ void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag, // ----------------------------------------------------------------------- -void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect ) +void HeaderBar::ImplUpdate( sal_uInt16 nPos, sal_Bool bEnd, sal_Bool bDirect ) { if ( IsVisible() && IsUpdateMode() ) { if ( !bDirect ) { Rectangle aRect; - USHORT nItemCount = (USHORT)(mpItemList->Count()); + sal_uInt16 nItemCount = (sal_uInt16)(mpItemList->Count()); if ( nPos < nItemCount ) aRect = ImplGetItemRect( nPos ); else @@ -676,11 +676,11 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect ) } else { - for ( USHORT i = nPos; i < mpItemList->Count(); i++ ) + for ( sal_uInt16 i = nPos; i < mpItemList->Count(); i++ ) ImplDrawItem( i ); if ( bEnd ) { - Rectangle aRect = ImplGetItemRect( (USHORT)mpItemList->Count() ); + Rectangle aRect = ImplGetItemRect( (sal_uInt16)mpItemList->Count() ); aRect.Left() = aRect.Right(); aRect.Right() = mnDX-1; if ( aRect.Left() < aRect.Right() ) @@ -696,31 +696,31 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect ) // ----------------------------------------------------------------------- -void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) +void HeaderBar::ImplStartDrag( const Point& rMousePos, sal_Bool bCommand ) { - USHORT nPos; - USHORT nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos ); + sal_uInt16 nPos; + sal_uInt16 nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos ); if ( nHitTest ) { - mbDrag = FALSE; + mbDrag = sal_False; ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( nHitTest & HEAD_HITTEST_DIVIDER ) - mbDrag = TRUE; + mbDrag = sal_True; else { if ( ((pItem->mnBits & HIB_CLICKABLE) && !(pItem->mnBits & HIB_FLAT)) || (mbDragable && !(pItem->mnBits & HIB_FIXEDPOS)) ) { - mbItemMode = TRUE; - mbDrag = TRUE; + mbItemMode = sal_True; + mbDrag = sal_True; if ( bCommand ) { if ( mbDragable ) - mbItemDrag = TRUE; + mbItemDrag = sal_True; else { - mbItemMode = FALSE; - mbDrag = FALSE; + mbItemMode = sal_False; + mbDrag = sal_False; } } } @@ -737,7 +737,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) if ( mbDrag ) { - mbOutDrag = FALSE; + mbOutDrag = sal_False; mnCurItemId = pItem->mnId; mnItemDragPos = nPos; StartTracking(); @@ -745,7 +745,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) mnDragPos = mnStartPos; StartDrag(); if ( mbItemMode ) - ImplDrawItem( nPos, TRUE, mbItemDrag ); + ImplDrawItem( nPos, sal_True, mbItemDrag ); else { Rectangle aSizeRect( mnDragPos, 0, mnDragPos, mnDragSize+mnDY ); @@ -761,17 +761,17 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand ) void HeaderBar::ImplDrag( const Point& rMousePos ) { - BOOL bNewOutDrag; - USHORT nPos = GetItemPos( mnCurItemId ); + sal_Bool bNewOutDrag; + sal_uInt16 nPos = GetItemPos( mnCurItemId ); mnDragPos = rMousePos.X()-mnMouseOff; if ( mbItemMode ) { Rectangle aItemRect = ImplGetItemRect( nPos ); if ( aItemRect.IsInside( rMousePos ) ) - bNewOutDrag = FALSE; + bNewOutDrag = sal_False; else - bNewOutDrag = TRUE; + bNewOutDrag = sal_True; // Evt. ItemDrag anschalten if ( bNewOutDrag && mbDragable && !mbItemDrag && @@ -779,24 +779,24 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) { if ( (rMousePos.Y() >= aItemRect.Top()) && (rMousePos.Y() <= aItemRect.Bottom()) ) { - mbItemDrag = TRUE; - ImplDrawItem( nPos, TRUE, mbItemDrag ); + mbItemDrag = sal_True; + ImplDrawItem( nPos, sal_True, mbItemDrag ); } } - USHORT nOldItemDragPos = mnItemDragPos; + sal_uInt16 nOldItemDragPos = mnItemDragPos; if ( mbItemDrag ) { if ( (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF) ) - bNewOutDrag = TRUE; + bNewOutDrag = sal_True; else - bNewOutDrag = FALSE; + bNewOutDrag = sal_False; if ( bNewOutDrag ) mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; else { - USHORT nTempId = GetItemId( Point( rMousePos.X(), 2 ) ); + sal_uInt16 nTempId = GetItemId( Point( rMousePos.X(), 2 ) ); if ( nTempId ) mnItemDragPos = GetItemPos( nTempId ); else @@ -840,7 +840,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) (mnItemDragPos != nPos) && (mnItemDragPos != HEADERBAR_ITEM_NOTFOUND) ) { - ImplDrawItem( mnItemDragPos, FALSE, TRUE ); + ImplDrawItem( mnItemDragPos, sal_False, sal_True ); ImplInvertDrag( nPos, mnItemDragPos ); } } @@ -866,7 +866,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) // ----------------------------------------------------------------------- -void HeaderBar::ImplEndDrag( BOOL bCancel ) +void HeaderBar::ImplEndDrag( sal_Bool bCancel ) { HideTracking(); @@ -874,7 +874,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel ) { if ( mbItemMode && (!mbOutDrag || mbItemDrag) ) { - USHORT nPos = GetItemPos( mnCurItemId ); + sal_uInt16 nPos = GetItemPos( mnCurItemId ); ImplDrawItem( nPos ); } @@ -882,7 +882,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel ) } else { - USHORT nPos = GetItemPos( mnCurItemId ); + sal_uInt16 nPos = GetItemPos( mnCurItemId ); if ( mbItemMode ) { if ( mbItemDrag ) @@ -911,18 +911,18 @@ void HeaderBar::ImplEndDrag( BOOL bCancel ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); pItem->mnSize += nDelta; - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } } - mbDrag = FALSE; + mbDrag = sal_False; EndDrag(); mnCurItemId = 0; mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; - mbOutDrag = FALSE; - mbItemMode = FALSE; - mbItemDrag = FALSE; + mbOutDrag = sal_False; + mbItemMode = sal_False; + mbItemDrag = sal_False; } // ----------------------------------------------------------------------- @@ -934,23 +934,23 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() == 2 ) { long nTemp; - USHORT nPos; - USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos ); + sal_uInt16 nPos; + sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos ); if ( nHitTest ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( nHitTest & HEAD_HITTEST_DIVIDER ) - mbItemMode = FALSE; + mbItemMode = sal_False; else - mbItemMode = TRUE; + mbItemMode = sal_True; mnCurItemId = pItem->mnId; DoubleClick(); - mbItemMode = FALSE; + mbItemMode = sal_False; mnCurItemId = 0; } } else - ImplStartDrag( rMEvt.GetPosPixel(), FALSE ); + ImplStartDrag( rMEvt.GetPosPixel(), sal_False ); } } @@ -959,9 +959,9 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt ) void HeaderBar::MouseMove( const MouseEvent& rMEvt ) { long nTemp1; - USHORT nTemp2; + sal_uInt16 nTemp2; PointerStyle eStyle = POINTER_ARROW; - USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 ); + sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 ); if ( nHitTest & HEAD_HITTEST_DIVIDER ) eStyle = POINTER_HSIZEBAR; @@ -1000,20 +1000,20 @@ void HeaderBar::Paint( const Rectangle& rRect ) } } - USHORT nCurItemPos; + sal_uInt16 nCurItemPos; if ( mbDrag ) nCurItemPos = GetItemPos( mnCurItemId ); else nCurItemPos = HEADERBAR_ITEM_NOTFOUND; - USHORT nItemCount = (USHORT)mpItemList->Count(); - for ( USHORT i = 0; i < nItemCount; i++ ) - ImplDrawItem( i, (i == nCurItemPos) ? TRUE : FALSE, FALSE, &rRect ); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); + for ( sal_uInt16 i = 0; i < nItemCount; i++ ) + ImplDrawItem( i, (i == nCurItemPos) ? sal_True : sal_False, sal_False, &rRect ); } // ----------------------------------------------------------------------- void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, - ULONG nFlags ) + sal_uIntPtr nFlags ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); @@ -1050,8 +1050,8 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Rectangle aItemRect( aRect ); // aItemRect.Bottom()--; - USHORT nItemCount = (USHORT)mpItemList->Count(); - for ( USHORT i = 0; i < nItemCount; i++ ) + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); + for ( sal_uInt16 i = 0; i < nItemCount; i++ ) { aItemRect.Left() = aRect.Left()+ImplGetItemPos( i ); aItemRect.Right() = aItemRect.Left() + mpItemList->GetObject( i )->mnSize - 1; @@ -1060,7 +1060,7 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, aItemRect.Right() = 16000; Region aRegion( aRect ); pDev->SetClipRegion( aRegion ); - ImplDrawItem( pDev, i, FALSE, FALSE, aItemRect, &aRect, nFlags ); + ImplDrawItem( pDev, i, sal_False, sal_False, aItemRect, &aRect, nFlags ); pDev->SetClipRegion(); } @@ -1084,7 +1084,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt ) { if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == COMMAND_STARTDRAG) && !mbDrag ) { - ImplStartDrag( rCEvt.GetMousePosPixel(), TRUE ); + ImplStartDrag( rCEvt.GetMousePosPixel(), sal_True ); return; } @@ -1095,7 +1095,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt ) void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) @@ -1132,7 +1132,7 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - ULONG nHelpId = GetHelpId( nItemId ); + sal_uIntPtr nHelpId = GetHelpId( nItemId ); if ( nHelpId ) { // Wenn eine Hilfe existiert, dann ausloesen @@ -1158,17 +1158,17 @@ void HeaderBar::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -1184,7 +1184,7 @@ void HeaderBar::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } @@ -1232,8 +1232,8 @@ void HeaderBar::DoubleClick() // ----------------------------------------------------------------------- -void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage, - long nSize, HeaderBarItemBits nBits, USHORT nPos ) +void HeaderBar::InsertItem( sal_uInt16 nItemId, const Image& rImage, + long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND, @@ -1249,13 +1249,13 @@ void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage, mpItemList->Insert( pItem, nPos ); // Ausgabe updaten - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } // ----------------------------------------------------------------------- -void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText, - long nSize, HeaderBarItemBits nBits, USHORT nPos ) +void HeaderBar::InsertItem( sal_uInt16 nItemId, const XubString& rText, + long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND, @@ -1272,15 +1272,15 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText, mpItemList->Insert( pItem, nPos ); // Ausgabe updaten - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } // ----------------------------------------------------------------------- -void HeaderBar::InsertItem( USHORT nItemId, +void HeaderBar::InsertItem( sal_uInt16 nItemId, const Image& rImage, const XubString& rText, long nSize, HeaderBarItemBits nBits, - USHORT nPos ) + sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND, @@ -1298,27 +1298,27 @@ void HeaderBar::InsertItem( USHORT nItemId, mpItemList->Insert( pItem, nPos ); // Ausgabe updaten - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } // ----------------------------------------------------------------------- -void HeaderBar::RemoveItem( USHORT nItemId ) +void HeaderBar::RemoveItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->Remove( nPos ); delete pItem; - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } // ----------------------------------------------------------------------- -void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos ) +void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { if ( nPos != nNewPos ) @@ -1327,7 +1327,7 @@ void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos ) if ( nNewPos < nPos ) nPos = nNewPos; mpItemList->Insert( pItem, nNewPos ); - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } } @@ -1345,7 +1345,7 @@ void HeaderBar::Clear() } mpItemList->Clear(); - ImplUpdate( 0, TRUE ); + ImplUpdate( 0, sal_True ); } // ----------------------------------------------------------------------- @@ -1365,20 +1365,20 @@ void HeaderBar::SetOffset( long nNewOffset ) // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemCount() const +sal_uInt16 HeaderBar::GetItemCount() const { - return (USHORT)mpItemList->Count(); + return (sal_uInt16)mpItemList->Count(); } // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemPos( USHORT nItemId ) const +sal_uInt16 HeaderBar::GetItemPos( sal_uInt16 nItemId ) const { ImplHeadItem* pItem = mpItemList->First(); while ( pItem ) { if ( pItem->mnId == nItemId ) - return (USHORT)mpItemList->GetCurPos(); + return (sal_uInt16)mpItemList->GetCurPos(); pItem = mpItemList->Next(); } @@ -1387,7 +1387,7 @@ USHORT HeaderBar::GetItemPos( USHORT nItemId ) const // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemId( USHORT nPos ) const +sal_uInt16 HeaderBar::GetItemId( sal_uInt16 nPos ) const { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( pItem ) @@ -1398,9 +1398,9 @@ USHORT HeaderBar::GetItemId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT HeaderBar::GetItemId( const Point& rPos ) const +sal_uInt16 HeaderBar::GetItemId( const Point& rPos ) const { - USHORT nPos = 0; + sal_uInt16 nPos = 0; while ( nPos < mpItemList->Count() ) { if ( ImplGetItemRect( nPos ).IsInside( rPos ) ) @@ -1414,10 +1414,10 @@ USHORT HeaderBar::GetItemId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const +Rectangle HeaderBar::GetItemRect( sal_uInt16 nItemId ) const { Rectangle aRect; - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) aRect = ImplGetItemRect( nPos ); return aRect; @@ -1425,25 +1425,25 @@ Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemSize( USHORT nItemId, long nNewSize ) +void HeaderBar::SetItemSize( sal_uInt16 nItemId, long nNewSize ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); if ( pItem->mnSize != nNewSize ) { pItem->mnSize = nNewSize; - ImplUpdate( nPos, TRUE ); + ImplUpdate( nPos, sal_True ); } } } // ----------------------------------------------------------------------- -long HeaderBar::GetItemSize( USHORT nItemId ) const +long HeaderBar::GetItemSize( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mnSize; else @@ -1452,9 +1452,9 @@ long HeaderBar::GetItemSize( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits ) +void HeaderBar::SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); @@ -1468,9 +1468,9 @@ void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits ) // ----------------------------------------------------------------------- -HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const +HeaderBarItemBits HeaderBar::GetItemBits( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mnBits; else @@ -1479,9 +1479,9 @@ HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemData( USHORT nItemId, void* pNewData ) +void HeaderBar::SetItemData( sal_uInt16 nItemId, void* pNewData ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { mpItemList->GetObject( nPos )->mpUserData = pNewData; @@ -1491,9 +1491,9 @@ void HeaderBar::SetItemData( USHORT nItemId, void* pNewData ) // ----------------------------------------------------------------------- -void* HeaderBar::GetItemData( USHORT nItemId ) const +void* HeaderBar::GetItemData( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mpUserData; else @@ -1502,9 +1502,9 @@ void* HeaderBar::GetItemData( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage ) +void HeaderBar::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { mpItemList->GetObject( nPos )->maImage = rImage; @@ -1514,9 +1514,9 @@ void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage ) // ----------------------------------------------------------------------- -Image HeaderBar::GetItemImage( USHORT nItemId ) const +Image HeaderBar::GetItemImage( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->maImage; else @@ -1525,9 +1525,9 @@ Image HeaderBar::GetItemImage( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText ) +void HeaderBar::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { mpItemList->GetObject( nPos )->maText = rText; @@ -1537,9 +1537,9 @@ void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -XubString HeaderBar::GetItemText( USHORT nItemId ) const +XubString HeaderBar::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->maText; else @@ -1548,18 +1548,18 @@ XubString HeaderBar::GetItemText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetHelpText( USHORT nItemId, const XubString& rText ) +void HeaderBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) mpItemList->GetObject( nPos )->maHelpText = rText; } // ----------------------------------------------------------------------- -XubString HeaderBar::GetHelpText( USHORT nItemId ) const +XubString HeaderBar::GetHelpText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); @@ -1578,18 +1578,18 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId ) +void HeaderBar::SetHelpId( sal_uInt16 nItemId, sal_uIntPtr nHelpId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) mpItemList->GetObject( nPos )->mnHelpId = nHelpId; } // ----------------------------------------------------------------------- -ULONG HeaderBar::GetHelpId( USHORT nItemId ) const +sal_uIntPtr HeaderBar::GetHelpId( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) return mpItemList->GetObject( nPos )->mnHelpId; else diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 02a578629039..e6b526473d35 100644..100755 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -129,17 +129,17 @@ class SvtMatchContext_Impl : public ::vos::OThread String aBaseURL; String aText; SvtURLBox* pBox; - BOOL bStop; - BOOL bOnlyDirectories; - BOOL bNoSelection; + sal_Bool bStop; + sal_Bool bOnlyDirectories; + sal_Bool bNoSelection; DECL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void* ); virtual void SAL_CALL onTerminated( ); virtual void SAL_CALL run(); virtual void SAL_CALL Cancel(); - void Insert( const String& rCompletion, const String& rURL, BOOL bForce = FALSE); - void ReadFolder( const String& rURL, const String& rMatch, BOOL bSmart ); + void Insert( const String& rCompletion, const String& rURL, sal_Bool bForce = sal_False); + void ReadFolder( const String& rURL, const String& rMatch, sal_Bool bSmart ); void FillPicklist( SvStringsDtor& rPickList ); public: @@ -167,7 +167,7 @@ SvtMatchContext_Impl::SvtMatchContext_Impl( , aBaseURL( pBoxP->aBaseURL ) , aText( rText ) , pBox( pBoxP ) - , bStop( FALSE ) + , bStop( sal_False ) , bOnlyDirectories( pBoxP->bOnlyDirectories ) , bNoSelection( pBoxP->bNoSelection ) { @@ -212,7 +212,7 @@ void SvtMatchContext_Impl::FillPicklist( SvStringsDtor& rPickList ) seqPropertySet[nProperty].Value >>= sTitle; aURL.SetURL( sTitle ); const StringPtr pStr = new String( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) ); - rPickList.Insert( pStr, (USHORT) nItem ); + rPickList.Insert( pStr, (sal_uInt16) nItem ); break; } } @@ -229,7 +229,7 @@ void SAL_CALL SvtMatchContext_Impl::Cancel() //------------------------------------------------------------------------- void SvtMatchContext_Impl::Stop() { - bStop = TRUE; + bStop = sal_True; if( isRunning() ) terminate(); @@ -259,7 +259,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) } SvtURLBox* pBox = pThis->pBox; - pBox->bAutoCompleteMode = TRUE; + pBox->bAutoCompleteMode = sal_True; // did we filter completions which otherwise would have been valid? // (to be filled below) @@ -268,7 +268,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) // insert all completed strings into the listbox pBox->Clear(); - for( USHORT nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ ) + for( sal_uInt16 nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ ) { String sCompletion( *(*pThis->pCompletions)[nPos] ); @@ -338,12 +338,12 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) //------------------------------------------------------------------------- void SvtMatchContext_Impl::Insert( const String& rCompletion, const String& rURL, - BOOL bForce ) + sal_Bool bForce ) { if( !bForce ) { // avoid doubles - for( USHORT nPos = pCompletions->Count(); nPos--; ) + for( sal_uInt16 nPos = pCompletions->Count(); nPos--; ) if( *(*pCompletions)[ nPos ] == rCompletion ) return; } @@ -357,7 +357,7 @@ void SvtMatchContext_Impl::Insert( const String& rCompletion, //------------------------------------------------------------------------- void SvtMatchContext_Impl::ReadFolder( const String& rURL, const String& rMatch, - BOOL bSmart ) + sal_Bool bSmart ) { // check folder to scan if( !UCBContentHelper::IsFolder( rURL ) ) @@ -382,7 +382,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL, String aNewText( aText ); aNewText += '/'; - Insert( aNewText, rURL, TRUE ); + Insert( aNewText, rURL, sal_True ); return; } @@ -508,7 +508,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL, if ( bIsFolder ) aInput += aDelimiter; - Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), TRUE ); + Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), sal_True ); } } } @@ -577,7 +577,7 @@ String SvtURLBox::ParseSmart( String aText, String aBaseURL, String aWorkDir ) aObj.setFinalSlash(); // take base URL and append current input - bool bWasAbsolute = FALSE; + bool bWasAbsolute = sal_False; #ifdef UNX // don't support FSYS_MAC under Unix, because here ':' is a valid character for a filename INetURLObject::FSysStyle eStyle = static_cast< INetURLObject::FSysStyle >( INetURLObject::FSYS_VOS | INetURLObject::FSYS_UNX | INetURLObject::FSYS_DOS ); @@ -618,7 +618,7 @@ void SvtMatchContext_Impl::run() pURLs->Remove( 0, pURLs->Count() ); // check for input - USHORT nTextLen = aText.Len(); + sal_uInt16 nTextLen = aText.Len(); if ( !nTextLen ) return; @@ -670,7 +670,7 @@ void SvtMatchContext_Impl::run() // don't scan history picklist if only directories are allowed, picklist contains only files return; - BOOL bFull = FALSE; + sal_Bool bFull = sal_False; int nCount = aPickList.Count(); INetURLObject aCurObj; @@ -679,7 +679,7 @@ void SvtMatchContext_Impl::run() aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt ); for( ;; ) { - for( USHORT nPos = 0; schedule() && nPos < nCount; nPos++ ) + for( sal_uInt16 nPos = 0; schedule() && nPos < nCount; nPos++ ) { aCurObj.SetURL( *aPickList.GetObject( nPos ) ); aCurObj.SetSmartURL( aCurObj.GetURLNoPass()); @@ -768,7 +768,7 @@ void SvtMatchContext_Impl::run() } if( !bFull ) - bFull = TRUE; + bFull = sal_True; else break; } @@ -779,7 +779,7 @@ void SvtMatchContext_Impl::run() //------------------------------------------------------------------------- //------------------------------------------------------------------------- //------------------------------------------------------------------------- -void SvtURLBox::TryAutoComplete( BOOL bForce ) +void SvtURLBox::TryAutoComplete( sal_Bool bForce ) { if( Application::AnyInput( INPUT_KEYBOARD ) ) return; @@ -788,7 +788,7 @@ void SvtURLBox::TryAutoComplete( BOOL bForce ) Selection aSelection( GetSelection() ); if( aSelection.Max() != aCurText.Len() && !bForce ) return; - USHORT nLen = (USHORT)aSelection.Min(); + sal_uInt16 nLen = (sal_uInt16)aSelection.Min(); aCurText.Erase( nLen ); if( aCurText.Len() && bIsAutoCompleteEnabled ) { @@ -806,13 +806,13 @@ SvtURLBox::SvtURLBox( Window* pParent, INetProtocol eSmart ) : ComboBox( pParent , WB_DROPDOWN | WB_AUTOSIZE | WB_AUTOHSCROLL ), pCtx( 0 ), eSmartProtocol( eSmart ), - bAutoCompleteMode( FALSE ), - bOnlyDirectories( FALSE ), - bTryAutoComplete( FALSE ), - bCtrlClick( FALSE ), - bHistoryDisabled( FALSE ), - bNoSelection( FALSE ), - bIsAutoCompleteEnabled( TRUE ) + bAutoCompleteMode( sal_False ), + bOnlyDirectories( sal_False ), + bTryAutoComplete( sal_False ), + bCtrlClick( sal_False ), + bHistoryDisabled( sal_False ), + bNoSelection( sal_False ), + bIsAutoCompleteEnabled( sal_True ) { ImplInit(); @@ -827,13 +827,13 @@ SvtURLBox::SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart ) : ComboBox( pParent, _nStyle ), pCtx( 0 ), eSmartProtocol( eSmart ), - bAutoCompleteMode( FALSE ), - bOnlyDirectories( FALSE ), - bTryAutoComplete( FALSE ), - bCtrlClick( FALSE ), - bHistoryDisabled( FALSE ), - bNoSelection( FALSE ), - bIsAutoCompleteEnabled( TRUE ) + bAutoCompleteMode( sal_False ), + bOnlyDirectories( sal_False ), + bTryAutoComplete( sal_False ), + bCtrlClick( sal_False ), + bHistoryDisabled( sal_False ), + bNoSelection( sal_False ), + bIsAutoCompleteEnabled( sal_True ) { ImplInit(); } @@ -843,13 +843,13 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart : ComboBox( pParent , _rResId ), pCtx( 0 ), eSmartProtocol( eSmart ), - bAutoCompleteMode( FALSE ), - bOnlyDirectories( FALSE ), - bTryAutoComplete( FALSE ), - bCtrlClick( FALSE ), - bHistoryDisabled( FALSE ), - bNoSelection( FALSE ), - bIsAutoCompleteEnabled( TRUE ) + bAutoCompleteMode( sal_False ), + bOnlyDirectories( sal_False ), + bTryAutoComplete( sal_False ), + bCtrlClick( sal_False ), + bHistoryDisabled( sal_False ), + bNoSelection( sal_False ), + bIsAutoCompleteEnabled( sal_True ) { ImplInit(); } @@ -859,7 +859,7 @@ void SvtURLBox::ImplInit() { pImp = new SvtURLBox_Impl(); SetHelpId( SID_OPENURL ); - EnableAutocomplete( FALSE ); + EnableAutocomplete( sal_False ); SetText( String() ); @@ -941,7 +941,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() if ( aURL.Len() && ( !pImp->pUrlFilter || pImp->pUrlFilter->isUrlAllowed( aURL ) ) ) { - BOOL bFound = (aURL.GetChar(aURL.Len()-1) == '/' ); + sal_Bool bFound = (aURL.GetChar(aURL.Len()-1) == '/' ); if ( !bFound ) { String aUpperURL( aURL ); @@ -971,7 +971,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() } //------------------------------------------------------------------------- -BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) +sal_Bool SvtURLBox::ProcessKey( const KeyCode& rKey ) { // every key input stops the current matching thread if( pCtx ) @@ -989,7 +989,7 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) if ( bAutoCompleteMode ) { // reset picklist - bAutoCompleteMode = FALSE; + bAutoCompleteMode = sal_False; Selection aSelection( GetSelection() ); SetSelection( Selection( aSelection.Min(), aSelection.Min() ) ); if ( bOnlyDirectories ) @@ -1000,19 +1000,19 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) } bCtrlClick = rKey.IsMod1(); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if ( GetOpenHdl().IsSet() ) { - bHandled = TRUE; + bHandled = sal_True; GetOpenHdl().Call(this); } else if ( GetSelectHdl().IsSet() ) { - bHandled = TRUE; + bHandled = sal_True; GetSelectHdl().Call(this); } - bCtrlClick = FALSE; + bCtrlClick = sal_False; ClearModifyFlag(); return bHandled; @@ -1020,9 +1020,9 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) else if ( aCode == KEY_RETURN && !GetText().Len() && GetOpenHdl().IsSet() ) { // for file dialog - bAutoCompleteMode = FALSE; + bAutoCompleteMode = sal_False; GetOpenHdl().Call(this); - return TRUE; + return sal_True; } else if( aCode == KEY_ESCAPE ) { @@ -1038,15 +1038,15 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey ) } else { - return FALSE; + return sal_False; } - bAutoCompleteMode = FALSE; - return TRUE; + bAutoCompleteMode = sal_False; + return sal_True; } else { - return FALSE; + return sal_False; } } @@ -1067,15 +1067,15 @@ long SvtURLBox::PreNotify( NotifyEvent& rNEvt ) KeyCode aCode( rKey.GetCode() ); if( ProcessKey( rKey ) ) { - return TRUE; + return sal_True; } else if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() ) { Selection aSelection( GetSelection() ); - USHORT nLen = (USHORT)aSelection.Min(); + sal_uInt16 nLen = (sal_uInt16)aSelection.Min(); GetSubEdit()->KeyInput( rEvent ); SetSelection( Selection( nLen, GetText().Len() ) ); - return TRUE; + return sal_True; } if ( MatchesPlaceHolder( GetText() ) ) @@ -1094,7 +1094,7 @@ IMPL_LINK( SvtURLBox, AutoCompleteHdl_Impl, void*, EMPTYARG ) { if ( GetSubEdit()->GetAutocompleteAction() == AUTOCOMPLETE_KEYINPUT ) { - TryAutoComplete( FALSE ); + TryAutoComplete( sal_False ); return 1L; } @@ -1133,7 +1133,7 @@ void SvtURLBox::Select() } //------------------------------------------------------------------------- -void SvtURLBox::SetOnlyDirectories( BOOL bDir ) +void SvtURLBox::SetOnlyDirectories( sal_Bool bDir ) { bOnlyDirectories = bDir; if ( bOnlyDirectories ) @@ -1141,7 +1141,7 @@ void SvtURLBox::SetOnlyDirectories( BOOL bDir ) } //------------------------------------------------------------------------- -void SvtURLBox::SetNoURLSelection( BOOL bSet ) +void SvtURLBox::SetNoURLSelection( sal_Bool bSet ) { bNoSelection = bSet; } @@ -1158,7 +1158,7 @@ String SvtURLBox::GetURL() // try to get the right case preserving URL from the list of URLs if ( pImp->pCompletions && pImp->pURLs ) { - for( USHORT nPos=0; nPos<pImp->pCompletions->Count(); nPos++ ) + for( sal_uInt16 nPos=0; nPos<pImp->pCompletions->Count(); nPos++ ) { #ifdef DBG_UTIL String aTmp( *(*pImp->pCompletions)[ nPos ] ); @@ -1239,7 +1239,7 @@ String SvtURLBox::GetURL() //------------------------------------------------------------------------- void SvtURLBox::DisableHistory() { - bHistoryDisabled = TRUE; + bHistoryDisabled = sal_True; UpdatePicklistForSmartProtocol_Impl(); } diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx index b67202e9c1fc..dc6c09f7eb8f 100644..100755 --- a/svtools/source/control/prgsbar.cxx +++ b/svtools/source/control/prgsbar.cxx @@ -48,9 +48,9 @@ void ProgressBar::ImplInit() { mnPercent = 0; - mbCalcNew = TRUE; + mbCalcNew = sal_True; - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle ) @@ -89,8 +89,8 @@ ProgressBar::~ProgressBar() // ----------------------------------------------------------------------- -void ProgressBar::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void ProgressBar::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -112,8 +112,8 @@ void ProgressBar::ImplInitSettings( BOOL bFont, { if( (GetStyle() & WB_BORDER) ) SetBorderStyle( WINDOW_BORDER_REMOVEBORDER ); - EnableChildTransparentMode( TRUE ); - SetPaintTransparent( TRUE ); + EnableChildTransparentMode( sal_True ); + SetPaintTransparent( sal_True ); SetBackground(); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); } @@ -151,18 +151,18 @@ void ProgressBar::ImplInitSettings( BOOL bFont, // ----------------------------------------------------------------------- -void ProgressBar::ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc ) +void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc ) { if ( mbCalcNew ) { - mbCalcNew = FALSE; + mbCalcNew = sal_False; Size aSize = GetOutputSizePixel(); mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2); mnPrgsWidth = (mnPrgsHeight*2)/3; maPos.Y() = PROGRESSBAR_WIN_OFFSET; long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET); - USHORT nMaxCount = (USHORT)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET)); + sal_uInt16 nMaxCount = (sal_uInt16)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET)); if ( nMaxCount <= 1 ) nMaxCount = 1; else @@ -191,20 +191,20 @@ void ProgressBar::Paint( const Rectangle& ) void ProgressBar::Resize() { - mbCalcNew = TRUE; + mbCalcNew = sal_True; if ( IsReallyVisible() ) Invalidate(); } // ----------------------------------------------------------------------- -void ProgressBar::SetValue( USHORT nNewPercent ) +void ProgressBar::SetValue( sal_uInt16 nNewPercent ) { DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" ); if ( nNewPercent < mnPercent ) { - mbCalcNew = TRUE; + mbCalcNew = sal_True; mnPercent = nNewPercent; if ( IsReallyVisible() ) { @@ -227,19 +227,19 @@ void ProgressBar::StateChanged( StateChangedType nType ) if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else */ if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } @@ -253,7 +253,7 @@ void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx index 7cf88816199f..b302a0a0fda5 100644..100755 --- a/svtools/source/control/roadmap.cxx +++ b/svtools/source/control/roadmap.cxx @@ -127,9 +127,9 @@ namespace svt void SetClickHdl( const Link& rLink ); const Link& GetClickHdl() const; - void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags ); - void Enable( BOOL bEnable = TRUE); - BOOL IsEnabled() const; + void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags ); + void Enable( sal_Bool bEnable = sal_True); + sal_Bool IsEnabled() const; void GrabFocus(); bool Contains( const Window* _pWindow ) const; @@ -891,7 +891,7 @@ namespace svt } //--------------------------------------------------------------------- - void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags ) + void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags ) { if (pRefRoadmapHyperLabel == NULL) mpDescription->SetZOrder( NULL, nFlags); //WINDOW_ZORDER_FIRST ); @@ -900,14 +900,14 @@ namespace svt } //--------------------------------------------------------------------- - void RoadmapItem::Enable( BOOL _bEnable) + void RoadmapItem::Enable( sal_Bool _bEnable) { mpID->Enable(_bEnable); mpDescription->Enable(_bEnable); } //--------------------------------------------------------------------- - BOOL RoadmapItem::IsEnabled() const + sal_Bool RoadmapItem::IsEnabled() const { return mpID->IsEnabled(); } diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 6fcbd92597ba..9732c6b3303c 100644..100755 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -104,15 +104,15 @@ private: long nNullOff; long nMargin1; long nMargin2; - USHORT nLines; - USHORT nArrows; - USHORT nBorders; - USHORT nIndents; - USHORT nTabs; - USHORT nMargin1Style; - USHORT nMargin2Style; - BOOL bAutoPageWidth; - BOOL bTextRTL; + sal_uInt16 nLines; + sal_uInt16 nArrows; + sal_uInt16 nBorders; + sal_uInt16 nIndents; + sal_uInt16 nTabs; + sal_uInt16 nMargin1Style; + sal_uInt16 nMargin2Style; + sal_Bool bAutoPageWidth; + sal_Bool bTextRTL; #ifdef _SV_RULER_CXX public: @@ -131,7 +131,7 @@ struct ImplRulerUnitData long nTick2; // Tick fuer halbe Werte long nTick3; // Tick fuer Zahlenausgabe long n100THMM; // Teiler fuer Einheit - USHORT nUnitDigits; // Anzahl Nachkommastellen + sal_uInt16 nUnitDigits; // Anzahl Nachkommastellen sal_Char aUnitStr[8]; // Einheiten-String }; @@ -154,13 +154,13 @@ struct ImplRulerHitTest { long nPos; RulerType eType; - USHORT nAryPos; - USHORT mnDragSize; - BOOL bSize; - BOOL bSizeBar; - BOOL bExpandTest; + sal_uInt16 nAryPos; + sal_uInt16 mnDragSize; + sal_Bool bSize; + sal_Bool bSizeBar; + sal_Bool bExpandTest; ImplRulerHitTest() : - bExpandTest( FALSE ) {} + bExpandTest( sal_False ) {} }; // ======================================================================= @@ -170,7 +170,7 @@ ImplRulerData::ImplRulerData() memset( this, 0, sizeof( ImplRulerData ) ); // PageBreite == EditWinBreite - bAutoPageWidth = TRUE; + bAutoPageWidth = sal_True; } // ----------------------------------------------------------------------- @@ -242,7 +242,7 @@ void Ruler::ImplInit( WinBits nWinBits ) // --- RTL --- no UI mirroring for horizontal rulers, because // the document is also not mirrored - EnableRTL( FALSE ); + EnableRTL( sal_False ); } // Variablen initialisieren @@ -264,13 +264,13 @@ void Ruler::ImplInit( WinBits nWinBits ) mnExtraStyle = 0; // Style des Extra-Feldes mnExtraClicks = 0; // Click-Anzahl fuer Extra-Feld mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld - mbCalc = TRUE; // Muessen Pagebreiten neu berechnet werden - mbFormat = TRUE; // Muss neu ausgegeben werden - mbDrag = FALSE; // Sind wir im Drag-Modus - mbDragDelete = FALSE; // Wird Maus beim Draggen unten rausgezogen - mbDragCanceled = FALSE; // Wurde Dragging abgebrochen - mbAutoWinWidth = TRUE; // EditWinBreite == RulerBreite - mbActive = TRUE; // Ist Lineal aktiv + mbCalc = sal_True; // Muessen Pagebreiten neu berechnet werden + mbFormat = sal_True; // Muss neu ausgegeben werden + mbDrag = sal_False; // Sind wir im Drag-Modus + mbDragDelete = sal_False; // Wird Maus beim Draggen unten rausgezogen + mbDragCanceled = sal_False; // Wurde Dragging abgebrochen + mbAutoWinWidth = sal_True; // EditWinBreite == RulerBreite + mbActive = sal_True; // Ist Lineal aktiv mnUpdateFlags = 0; // Was soll im Update-Handler upgedatet werden mpData = mpSaveData; // Wir zeigen auf die normalen Daten meExtraType = RULER_EXTRA_DONTKNOW; // Was im ExtraFeld dargestellt wird @@ -294,7 +294,7 @@ void Ruler::ImplInit( WinBits nWinBits ) mnBorderWidth = 0; // Einstellungen setzen - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); // Default-Groesse setzen long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth; @@ -392,7 +392,7 @@ void Ruler::ImplVDrawText( long nX, long nY, const String& rText ) // ----------------------------------------------------------------------- -void Ruler::ImplInvertLines( BOOL bErase ) +void Ruler::ImplInvertLines( sal_Bool bErase ) { // Positionslinien if ( mpData->nLines && mbActive && !mbDrag && !mbFormat && @@ -412,7 +412,7 @@ void Ruler::ImplInvertLines( BOOL bErase ) aRect.Right() = nY; // Linien ausgeben - for ( USHORT i = 0; i < mpData->nLines; i++ ) + for ( sal_uInt16 i = 0; i < mpData->nLines; i++ ) { n = mpData->pLines[i].nPos+nNullWinOff; if ( (n >= nRulX1) && (n < nRulX2) ) @@ -465,10 +465,10 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) long nTickWidth; long nX; long nY; - BOOL bNoTicks = FALSE; + sal_Bool bNoTicks = sal_False; // Groessenvorberechnung - BOOL bVertRight = FALSE; + sal_Bool bVertRight = sal_False; if ( mnWinStyle & WB_HORZ ) nTickWidth = aPixSize.Width(); else @@ -477,7 +477,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) if ( mnWinStyle & WB_RIGHT_ALIGNED ) { aFont.SetOrientation( 2700 ); - bVertRight = TRUE; + bVertRight = sal_True; } else aFont.SetOrientation( 900 ); @@ -513,7 +513,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) // koennen if ( nMulti < nOldMulti ) { - bNoTicks = TRUE; + bNoTicks = sal_True; break; } if ( nMulti >= 100 ) @@ -611,7 +611,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) } } // #i49017# with some zoom factors the value nTick can overflow - if( ((ULONG)nTick + (ULONG)nTickCount) > (ULONG)LONG_MAX) + if( ((sal_uIntPtr)nTick + (sal_uIntPtr)nTickCount) > (sal_uIntPtr)LONG_MAX) break; nTick += nTickCount; } @@ -622,7 +622,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) void Ruler::ImplDrawArrows( long nCenter ) { - USHORT i; + sal_uInt16 i; long n1; long n2; long n3; @@ -630,7 +630,7 @@ void Ruler::ImplDrawArrows( long nCenter ) long nLogWidth; String aStr; String aStr2; - BOOL bDrawUnit; + sal_Bool bDrawUnit; long nTxtWidth; long nTxtHeight2 = GetTextHeight()/2; @@ -655,14 +655,14 @@ void Ruler::ImplDrawArrows( long nCenter ) nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000; else nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM; - aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, TRUE, FALSE ); + aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, sal_True, sal_False ); // Einheit an den String haengen aStr2 = aStr; aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr ); // Textbreite ermitteln - bDrawUnit = TRUE; + bDrawUnit = sal_True; nTxtWidth = GetTextWidth( aStr2 ); if ( nTxtWidth < mpData->pArrows[i].nWidth-10 ) aStr = aStr2; @@ -670,7 +670,7 @@ void Ruler::ImplDrawArrows( long nCenter ) { nTxtWidth = GetTextWidth( aStr ); if ( nTxtWidth > mpData->pArrows[i].nWidth-10 ) - bDrawUnit = FALSE; + bDrawUnit = sal_False; } // Ist genuegen Platz fuer Einheiten-String vorhanden @@ -714,7 +714,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom long n2; long nTemp1; long nTemp2; - USHORT i; + sal_uInt16 i; for ( i = 0; i < mpData->nBorders; i++ ) { @@ -832,12 +832,12 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom // ----------------------------------------------------------------------- -void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle ) +void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Point aPos1; Point aPos2; - USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE; + sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE; if ( nStyle & RULER_STYLE_INVISIBLE ) return; @@ -921,7 +921,7 @@ void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle ) void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom ) { - USHORT j; + sal_uInt16 j; long n; long nIndentHeight = (mnVirHeight/2) - 1; long nIndentWidth2 = nIndentHeight-3; @@ -932,8 +932,8 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom if ( mpData->pIndents[j].nStyle & RULER_STYLE_INVISIBLE ) continue; - USHORT nStyle = mpData->pIndents[j].nStyle; - USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE; + sal_uInt16 nStyle = mpData->pIndents[j].nStyle; + sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE; n = mpData->pIndents[j].nPos+mpData->nNullVirOff; @@ -965,7 +965,7 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom if(0 == (mnWinStyle & WB_HORZ)) { Point aTmp; - for(USHORT i = 0; i < 5; i++) + for(sal_uInt16 i = 0; i < 5; i++) { aTmp = aPoly[i]; Point aSet(nVirBottom - aTmp.Y(), aTmp.X()); @@ -980,9 +980,9 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom // ----------------------------------------------------------------------- -static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle ) +static void ImplCenterTabPos( Point& rPos, sal_uInt16 nTabStyle ) { - BOOL bRTL = 0 != (nTabStyle & RULER_TAB_RTL); + sal_Bool bRTL = 0 != (nTabStyle & RULER_TAB_RTL); nTabStyle &= RULER_TAB_STYLE; rPos.Y() += RULER_TAB_HEIGHT/2; if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) ||( bRTL && nTabStyle == RULER_TAB_RIGHT)) @@ -992,7 +992,7 @@ static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle ) } // ----------------------------------------------------------------------- -void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAligned) +void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, sal_Bool bRightAligned) { if(!rRect.IsEmpty()) { @@ -1012,13 +1012,13 @@ void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAli // ----------------------------------------------------------------------- static void ImplDrawRulerTab( OutputDevice* pDevice, - const Point& rPos, USHORT nStyle, WinBits nWinBits ) + const Point& rPos, sal_uInt16 nStyle, WinBits nWinBits ) { if ( nStyle & RULER_STYLE_INVISIBLE ) return; - USHORT nTabStyle = nStyle & RULER_TAB_STYLE; - BOOL bRTL = 0 != (nStyle & RULER_TAB_RTL); + sal_uInt16 nTabStyle = nStyle & RULER_TAB_STYLE; + sal_Bool bRTL = 0 != (nStyle & RULER_TAB_RTL); Rectangle aRect1, aRect2, aRect3; aRect3.SetEmpty(); if ( nTabStyle == RULER_TAB_DEFAULT ) @@ -1076,7 +1076,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice, } if( 0 == (nWinBits&WB_HORZ) ) { - BOOL bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED); + sal_Bool bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED); lcl_RotateRect_Impl(aRect1, rPos.Y(), bRightAligned); lcl_RotateRect_Impl(aRect2, rPos.Y(), bRightAligned); lcl_RotateRect_Impl(aRect3, rPos.Y(), bRightAligned); @@ -1090,7 +1090,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice, // ----------------------------------------------------------------------- -void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle ) +void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ) { if ( nStyle & RULER_STYLE_INVISIBLE ) return; @@ -1110,7 +1110,7 @@ void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) { - for ( USHORT i = 0; i < mpData->nTabs; i++ ) + for ( sal_uInt16 i = 0; i < mpData->nTabs; i++ ) { if ( mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE ) continue; @@ -1126,8 +1126,8 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) // ----------------------------------------------------------------------- -void Ruler::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void Ruler::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -1216,7 +1216,7 @@ void Ruler::ImplCalc() mpData->nRulWidth = mnHeight-nRulWinOff; } - mbCalc = FALSE; + mbCalc = sal_False; } // ----------------------------------------------------------------------- @@ -1256,7 +1256,7 @@ void Ruler::ImplFormat() return; Size aVirDevSize; - BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO); + sal_Bool b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO); // VirtualDevice initialisieren if ( mnWinStyle & WB_HORZ ) @@ -1270,7 +1270,7 @@ void Ruler::ImplFormat() aVirDevSize.Width() = mnVirHeight; } if ( aVirDevSize != maVirDev.GetOutputSizePixel() ) - maVirDev.SetOutputSizePixel( aVirDevSize, TRUE ); + maVirDev.SetOutputSizePixel( aVirDevSize, sal_True ); else maVirDev.Erase(); @@ -1410,12 +1410,12 @@ void Ruler::ImplFormat() ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) ); // Wir haben formatiert - mbFormat = FALSE; + mbFormat = sal_False; } // ----------------------------------------------------------------------- -void Ruler::ImplInitExtraField( BOOL bUpdate ) +void Ruler::ImplInitExtraField( sal_Bool bUpdate ) { // Extra-Field beruecksichtigen if ( mnWinStyle & WB_EXTRAFIELD ) @@ -1445,8 +1445,8 @@ void Ruler::ImplInitExtraField( BOOL bUpdate ) if ( bUpdate ) { - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; Invalidate(); } } @@ -1484,17 +1484,17 @@ void Ruler::ImplDraw() DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev ); // Positionslinien neu malen - ImplInvertLines( TRUE ); + ImplInvertLines( sal_True ); } } // ----------------------------------------------------------------------- -void Ruler::ImplDrawExtra( BOOL bPaint ) +void Ruler::ImplDrawExtra( sal_Bool bPaint ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Rectangle aRect = maExtraRect; - BOOL bEraseRect = FALSE; + sal_Bool bEraseRect = sal_False; if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { @@ -1517,14 +1517,14 @@ void Ruler::ImplDrawExtra( BOOL bPaint ) SetFillColor( rStyleSettings.GetFaceColor() ); else SetFillColor( rStyleSettings.GetWindowColor() ); - bEraseRect = TRUE; + bEraseRect = sal_True; } else { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) ) { SetFillColor( rStyleSettings.GetCheckedColor() ); - bEraseRect = TRUE; + bEraseRect = sal_True; } } @@ -1548,7 +1548,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint ) } else if ( meExtraType == RULER_EXTRA_TAB ) { - USHORT nTabStyle = mnExtraStyle & RULER_TAB_STYLE; + sal_uInt16 nTabStyle = mnExtraStyle & RULER_TAB_STYLE; if(mpData->bTextRTL) nTabStyle |= RULER_TAB_RTL; Point aCenter = aRect.Center(); @@ -1575,7 +1575,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint ) // ----------------------------------------------------------------------- -void Ruler::ImplUpdate( BOOL bMustCalc ) +void Ruler::ImplUpdate( sal_Bool bMustCalc ) { // Hier schon Linien loeschen, damit Sie vor dem Neuberechnen schon // geloscht sind, da danach die alten Positionen nicht mehr bestimmt @@ -1585,8 +1585,8 @@ void Ruler::ImplUpdate( BOOL bMustCalc ) // Flags setzen if ( bMustCalc ) - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; // Wenn wir am Draggen sind, wird nach dem Drag-Handler automatisch // das Lineal neu upgedatet @@ -1604,11 +1604,11 @@ void Ruler::ImplUpdate( BOOL bMustCalc ) // ----------------------------------------------------------------------- -BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, - BOOL bRequireStyle, USHORT nRequiredStyle ) const +sal_Bool Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, + sal_Bool bRequireStyle, sal_uInt16 nRequiredStyle ) const { - USHORT i; - USHORT nStyle; + sal_uInt16 i; + sal_uInt16 nStyle; long nHitBottom; long nX; long nY; @@ -1616,10 +1616,10 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, long n2; if ( !mbActive ) - return FALSE; + return sal_False; // Position ermitteln - BOOL bIsHori = 0 != (mnWinStyle & WB_HORZ); + sal_Bool bIsHori = 0 != (mnWinStyle & WB_HORZ); if ( bIsHori ) { nX = rPos.X(); @@ -1635,8 +1635,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, // --> FME 2004-08-05 #i32608# pHitTest->nAryPos = 0; pHitTest->mnDragSize = 0; - pHitTest->bSize = FALSE; - pHitTest->bSizeBar = FALSE; + pHitTest->bSize = sal_False; + pHitTest->bSizeBar = sal_False; // <-- // Damit ueberstehende Tabs und Einzuege mit beruecksichtigt werden @@ -1654,7 +1654,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->nPos = 0; pHitTest->eType = RULER_TYPE_OUTSIDE; - return FALSE; + return sal_False; } nX -= mpData->nNullVirOff; @@ -1700,7 +1700,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->eType = RULER_TYPE_TAB; pHitTest->nAryPos = i-1; - return TRUE; + return sal_True; } } } @@ -1741,7 +1741,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->eType = RULER_TYPE_INDENT; pHitTest->nAryPos = i-1; - return TRUE; + return sal_True; } } } @@ -1752,7 +1752,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->nPos = 0; pHitTest->eType = RULER_TYPE_OUTSIDE; - return FALSE; + return sal_False; } // Danach die Spalten testen @@ -1787,7 +1787,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { if ( nStyle & RULER_BORDER_MOVEABLE ) { - pHitTest->bSizeBar = TRUE; + pHitTest->bSizeBar = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE; } } @@ -1807,25 +1807,25 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, if ( nX <= n1+nMOff ) { - pHitTest->bSize = TRUE; + pHitTest->bSize = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_1; } else if ( nX >= n2-nMOff ) { - pHitTest->bSize = TRUE; + pHitTest->bSize = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_2; } else { if ( nStyle & RULER_BORDER_MOVEABLE ) { - pHitTest->bSizeBar = TRUE; + pHitTest->bSizeBar = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE; } } } - return TRUE; + return sal_True; } } } @@ -1839,8 +1839,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) ) { pHitTest->eType = RULER_TYPE_MARGIN1; - pHitTest->bSize = TRUE; - return TRUE; + pHitTest->bSize = sal_True; + return sal_True; } } if ( (mpData->nMargin2Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE ) @@ -1849,8 +1849,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) ) { pHitTest->eType = RULER_TYPE_MARGIN2; - pHitTest->bSize = TRUE; - return TRUE; + pHitTest->bSize = sal_True; + return sal_True; } } @@ -1895,28 +1895,28 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, { pHitTest->eType = RULER_TYPE_TAB; pHitTest->nAryPos = i-1; - return TRUE; + return sal_True; } } } } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, +sal_Bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const { Point aPos = rPos; - BOOL bRequiredStyle = FALSE; - USHORT nRequiredStyle = 0; + sal_Bool bRequiredStyle = sal_False; + sal_uInt16 nRequiredStyle = 0; if (eDragType == RULER_TYPE_INDENT) { - bRequiredStyle = TRUE; + bRequiredStyle = sal_True; nRequiredStyle = RULER_INDENT_BOTTOM; } @@ -1936,7 +1936,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) - return TRUE; + return sal_True; } } @@ -1952,7 +1952,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) - return TRUE; + return sal_True; } } @@ -1968,25 +1968,25 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, if ( ImplHitTest( aPos, pHitTest ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) - return TRUE; + return sal_True; } } // Auf DontKnow setzen pHitTest->eType = RULER_TYPE_DONTKNOW; - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier ) +sal_Bool Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier ) { // Wenn eine Spalte angeklick wurde, die weder verschiebar noch // in der Groesse aenderbar ist, brauchen wir auch kein Drag ausloesen if ( (pHitTest->eType == RULER_TYPE_BORDER) && !pHitTest->bSize && !pHitTest->bSizeBar ) - return FALSE; + return sal_False; // Dragdaten setzen meDragType = pHitTest->eType; @@ -2003,10 +2003,10 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier ) // Wenn der Handler das Draggen erlaubt, dann das Draggen // initialisieren ImplInvertLines(); - mbDrag = TRUE; + mbDrag = sal_True; mnStartDragPos = mnDragPos; StartTracking(); - return TRUE; + return sal_True; } else { @@ -2019,7 +2019,7 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier ) mpData = mpSaveData; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2058,18 +2058,18 @@ void Ruler::ImplDrag( const Point& rPos ) nX -= mpData->nNullVirOff; // Wenn oberhalb oder links vom Lineal, dann alte Werte - mbDragDelete = FALSE; + mbDragDelete = sal_False; if ( nY < 0 ) { if ( !mbDragCanceled ) { // Daten wiederherstellen - mbDragCanceled = TRUE; + mbDragCanceled = sal_True; ImplRulerData aTempData; aTempData = *mpDragData; *mpDragData = *mpSaveData; - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; // Handler rufen mnDragPos = mnStartDragPos; @@ -2090,11 +2090,11 @@ void Ruler::ImplDrag( const Point& rPos ) } else { - mbDragCanceled = FALSE; + mbDragCanceled = sal_False; // +2, damit nicht so schnell die Tabs geloescht werden if ( nY > nOutHeight+2 ) - mbDragDelete = TRUE; + mbDragDelete = sal_True; mnDragPos = nX; @@ -2119,7 +2119,7 @@ void Ruler::ImplEndDrag() else *mpSaveData = *mpDragData; mpData = mpSaveData; - mbDrag = FALSE; + mbDrag = sal_False; // Handler rufen EndDrag(); @@ -2129,8 +2129,8 @@ void Ruler::ImplEndDrag() mnDragPos = 0; mnDragAryPos = 0; mnDragSize = 0; - mbDragCanceled = FALSE; - mbDragDelete = FALSE; + mbDragCanceled = sal_False; + mbDragDelete = sal_False; mnDragModifier = 0; mnDragScroll = 0; mnStartDragPos = 0; @@ -2167,8 +2167,8 @@ void Ruler::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.IsLeft() && !IsTracking() ) { Point aMousePos = rMEvt.GetPosPixel(); - USHORT nMouseClicks = rMEvt.GetClicks(); - USHORT nMouseModifier = rMEvt.GetModifier(); + sal_uInt16 nMouseClicks = rMEvt.GetClicks(); + sal_uInt16 nMouseModifier = rMEvt.GetModifier(); // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) @@ -2274,8 +2274,8 @@ void Ruler::Tracking( const TrackingEvent& rTEvt ) // Bei Abbruch, den alten Status wieder herstellen if ( rTEvt.IsTrackingCanceled() ) { - mbDragCanceled = TRUE; - mbFormat = TRUE; + mbDragCanceled = sal_True; + mbFormat = sal_True; } ImplEndDrag(); @@ -2324,7 +2324,7 @@ void Ruler::Paint( const Rectangle& ) } // Imhalt vom Extrafeld ausgeben - ImplDrawExtra( TRUE ); + ImplDrawExtra( sal_True ); } if ( mnWinStyle & WB_BORDER ) @@ -2389,7 +2389,7 @@ void Ruler::Resize() } // Hier schon Linien loeschen - BOOL bVisible = IsReallyVisible(); + sal_Bool bVisible = IsReallyVisible(); if ( bVisible && mpData->nLines ) { ImplInvertLines(); @@ -2397,7 +2397,7 @@ void Ruler::Resize() if ( !mnUpdateEvtId ) mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL ); } - mbFormat = TRUE; + mbFormat = sal_True; // Wenn sich die Hoehe bzw. Breite aendert, dann muessen besimmte Werte // neu berechnet werden @@ -2405,15 +2405,15 @@ void Ruler::Resize() ImplInitExtraField( mpData->bTextRTL ); if ( nNewHeight ) { - mbCalc = TRUE; + mbCalc = sal_True; mnVirHeight = nNewHeight - mnBorderWidth - (RULER_OFF*2); } else { if ( mpData->bAutoPageWidth ) - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); else if ( mbAutoWinWidth ) - mbCalc = TRUE; + mbCalc = sal_True; } // Wenn Ruler eine Groesse hat, dann Groesse vom VirtualDevice setzen @@ -2487,17 +2487,17 @@ void Ruler::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -2514,8 +2514,8 @@ void Ruler::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - mbFormat = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } @@ -2527,7 +2527,7 @@ long Ruler::StartDrag() if ( maStartDragHdl.IsSet() ) return maStartDragHdl.Call( this ); else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -2569,9 +2569,9 @@ void Ruler::ExtraDown() void Ruler::Activate() { - mbActive = TRUE; + mbActive = sal_True; - // Positionslinien wieder anzeigen (erst hinter mbActive=TRUE rufen, da + // Positionslinien wieder anzeigen (erst hinter mbActive=sal_True rufen, da // von ImplInvertLines() ausgewertet wird). Das Zeichnen der Linien // wird verzoegert, damit im vermutlich noch nicht gepainteten Zustand // Linien gezeichnet werden. @@ -2584,25 +2584,25 @@ void Ruler::Activate() void Ruler::Deactivate() { - // Positionslinien loeschen (schon vor mbActive=FALSE rufen, da + // Positionslinien loeschen (schon vor mbActive=sal_False rufen, da // von ImplInvertLines() ausgewertet wird) ImplInvertLines(); - mbActive = FALSE; + mbActive = sal_False; } // ----------------------------------------------------------------------- -BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) +sal_Bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) { if ( !mbDrag ) { Point aMousePos = rMEvt.GetPosPixel(); - USHORT nMouseClicks = rMEvt.GetClicks(); - USHORT nMouseModifier = rMEvt.GetModifier(); + sal_uInt16 nMouseClicks = rMEvt.GetClicks(); + sal_uInt16 nMouseModifier = rMEvt.GetModifier(); ImplRulerHitTest aHitTest; if(eDragType != RULER_TYPE_DONTKNOW) - aHitTest.bExpandTest = TRUE; + aHitTest.bExpandTest = sal_True; // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) @@ -2651,17 +2651,17 @@ BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) mnDragPos = 0; mnDragAryPos = 0; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType, - USHORT* pAryPos ) const + sal_uInt16* pAryPos ) const { ImplRulerHitTest aHitTest; @@ -2695,7 +2695,7 @@ void Ruler::CancelDrag() // ----------------------------------------------------------------------- -RulerType Ruler::GetType( const Point& rPos, USHORT* pAryPos ) const +RulerType Ruler::GetType( const Point& rPos, sal_uInt16* pAryPos ) const { ImplRulerHitTest aHitTest; @@ -2722,14 +2722,14 @@ void Ruler::SetWinPos( long nNewOff, long nNewWidth ) { // Gegebenenfalls werden die Breiten automatisch berechnet if ( !nNewWidth ) - mbAutoWinWidth = TRUE; + mbAutoWinWidth = sal_True; else - mbAutoWinWidth = FALSE; + mbAutoWinWidth = sal_False; // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet) mnWinOff = nNewOff; mnWinWidth = nNewWidth; - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); } // ----------------------------------------------------------------------- @@ -2742,14 +2742,14 @@ void Ruler::SetPagePos( long nNewOff, long nNewWidth ) // Gegebenenfalls werden die Breiten automatisch berechnet if ( !nNewWidth ) - mpData->bAutoPageWidth = TRUE; + mpData->bAutoPageWidth = sal_True; else - mpData->bAutoPageWidth = FALSE; + mpData->bAutoPageWidth = sal_False; // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet) mpData->nPageOff = nNewOff; mpData->nPageWidth = nNewWidth; - ImplUpdate( TRUE ); + ImplUpdate( sal_True ); } // ----------------------------------------------------------------------- @@ -2833,14 +2833,14 @@ void Ruler::SetZoom( const Fraction& rNewZoom ) // ----------------------------------------------------------------------- -void Ruler::SetExtraType( RulerExtra eNewExtraType, USHORT nStyle ) +void Ruler::SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle ) { if ( mnWinStyle & WB_EXTRAFIELD ) { meExtraType = eNewExtraType; mnExtraStyle = nStyle; if ( IsReallyVisible() && IsUpdateMode() ) - ImplDrawExtra( FALSE ); + ImplDrawExtra( sal_False ); } } @@ -2857,7 +2857,7 @@ void Ruler::SetNullOffset( long nPos ) // ----------------------------------------------------------------------- -void Ruler::SetMargin1( long nPos, USHORT nMarginStyle ) +void Ruler::SetMargin1( long nPos, sal_uInt16 nMarginStyle ) { if ( (mpData->nMargin1 != nPos) || (mpData->nMargin1Style != nMarginStyle) ) { @@ -2869,7 +2869,7 @@ void Ruler::SetMargin1( long nPos, USHORT nMarginStyle ) // ----------------------------------------------------------------------- -void Ruler::SetMargin2( long nPos, USHORT nMarginStyle ) +void Ruler::SetMargin2( long nPos, sal_uInt16 nMarginStyle ) { DBG_ASSERT( (nPos >= mpData->nMargin1) || (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || @@ -2886,12 +2886,12 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle ) // ----------------------------------------------------------------------- -void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) +void Ruler::SetLines( sal_uInt16 n, const RulerLine* pLineAry ) { // Testen, ob sich was geaendert hat if ( mpData->nLines == n ) { - USHORT i = n; + sal_uInt16 i = n; const RulerLine* pAry1 = mpData->pLines; const RulerLine* pAry2 = pLineAry; while ( i ) @@ -2908,11 +2908,11 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) } // Neue Werte setzen und neu ausgeben - BOOL bMustUpdate; + sal_Bool bMustUpdate; if ( IsReallyVisible() && IsUpdateMode() ) - bMustUpdate = TRUE; + bMustUpdate = sal_True; else - bMustUpdate = FALSE; + bMustUpdate = sal_False; // Alte Linien loeschen if ( bMustUpdate ) @@ -2946,7 +2946,7 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry ) // ----------------------------------------------------------------------- -void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry ) +void Ruler::SetArrows( sal_uInt16 n, const RulerArrow* pArrowAry ) { if ( !n || !pArrowAry ) { @@ -2966,7 +2966,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerArrow* pAry1 = mpData->pArrows; const RulerArrow* pAry2 = pArrowAry; while ( i ) @@ -2992,7 +2992,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry ) // ----------------------------------------------------------------------- -void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry ) +void Ruler::SetBorders( sal_uInt16 n, const RulerBorder* pBrdAry ) { if ( !n || !pBrdAry ) { @@ -3012,7 +3012,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerBorder* pAry1 = mpData->pBorders; const RulerBorder* pAry2 = pBrdAry; while ( i ) @@ -3037,7 +3037,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry ) // ----------------------------------------------------------------------- -void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry ) +void Ruler::SetIndents( sal_uInt16 n, const RulerIndent* pIndentAry ) { if ( !n || !pIndentAry ) @@ -3058,7 +3058,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerIndent* pAry1 = mpData->pIndents; const RulerIndent* pAry2 = pIndentAry; while ( i ) @@ -3082,7 +3082,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry ) // ----------------------------------------------------------------------- -void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry ) +void Ruler::SetTabs( sal_uInt16 n, const RulerTab* pTabAry ) { if ( !n || !pTabAry ) { @@ -3102,7 +3102,7 @@ void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry ) } else { - USHORT i = n; + sal_uInt16 i = n; const RulerTab* pAry1 = mpData->pTabs; const RulerTab* pAry2 = pTabAry; while ( i ) @@ -3131,17 +3131,17 @@ void Ruler::SetStyle( WinBits nStyle ) if ( mnWinStyle != nStyle ) { mnWinStyle = nStyle; - ImplInitExtraField( TRUE ); + ImplInitExtraField( sal_True ); } } // ----------------------------------------------------------------------- -void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle ) +void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ) { /*const StyleSettings& rStyleSettings =*/ pDevice->GetSettings().GetStyleSettings(); Point aPos( rPos ); - USHORT nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL); + sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL); pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); pDevice->SetLineColor(); @@ -3153,13 +3153,13 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle ) /* -----------------16.10.2002 15:17----------------- * * --------------------------------------------------*/ -void Ruler::SetTextRTL(BOOL bRTL) +void Ruler::SetTextRTL(sal_Bool bRTL) { if(mpData->bTextRTL != bRTL) { mpData->bTextRTL = bRTL; if ( IsReallyVisible() && IsUpdateMode() ) - ImplInitExtraField( TRUE ); + ImplInitExtraField( sal_True ); } } @@ -3167,15 +3167,15 @@ long Ruler::GetPageOffset() const { return mpData->nPageOff; } long Ruler::GetPageWidth() const { return mpData->nPageWidth; } long Ruler::GetNullOffset() const { return mpData->nNullOff; } long Ruler::GetMargin1() const { return mpData->nMargin1; } -USHORT Ruler::GetMargin1Style() const { return mpData->nMargin1Style; } +sal_uInt16 Ruler::GetMargin1Style() const { return mpData->nMargin1Style; } long Ruler::GetMargin2() const { return mpData->nMargin2; } -USHORT Ruler::GetMargin2Style() const { return mpData->nMargin2Style; } -USHORT Ruler::GetLineCount() const { return mpData->nLines; } +sal_uInt16 Ruler::GetMargin2Style() const { return mpData->nMargin2Style; } +sal_uInt16 Ruler::GetLineCount() const { return mpData->nLines; } const RulerLine* Ruler::GetLines() const { return mpData->pLines; } -USHORT Ruler::GetArrowCount() const { return mpData->nArrows; } +sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; } const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; } -USHORT Ruler::GetBorderCount() const { return mpData->nBorders; } +sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; } const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; } -USHORT Ruler::GetIndentCount() const { return mpData->nIndents; } +sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; } const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; } diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx index 2067e6d245f0..8249663f7665 100644..100755 --- a/svtools/source/control/scriptedtext.cxx +++ b/svtools/source/control/scriptedtext.cxx @@ -236,7 +236,7 @@ void SvtScriptedTextHelper_Impl::CalculateBreaks( const uno::Reference< i18n::XB nScript = i18n::ScriptType::LATIN; while( (nScript != i18n::ScriptType::WEAK) && (nCharIx == nNextCharIx) ) { - nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< USHORT >(nCharIx), sal::static_int_cast< USHORT >(nNextPos - nCharIx) ); + nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< sal_uInt16 >(nCharIx), sal::static_int_cast< sal_uInt16 >(nNextPos - nCharIx) ); if( nCharIx == nNextCharIx ) ++nScript; } diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx index eb47d2c780ad..51f6e829d6dd 100644..100755 --- a/svtools/source/control/scrwin.cxx +++ b/svtools/source/control/scrwin.cxx @@ -35,10 +35,10 @@ void ScrollableWindow::ImpInitialize( ScrollableWindowFlags nFlags ) { - bHandleDragging = (BOOL) ( nFlags & SCRWIN_THUMBDRAGGING ); + bHandleDragging = (sal_Bool) ( nFlags & SCRWIN_THUMBDRAGGING ); bVCenter = (nFlags & SCRWIN_VCENTER) == SCRWIN_VCENTER; bHCenter = (nFlags & SCRWIN_HCENTER) == SCRWIN_HCENTER; - bScrolling = FALSE; + bScrolling = sal_False; // set the handlers for the scrollbars aVScroll.SetScrollHdl( LINK(this, ScrollableWindow, ScrollHdl) ); @@ -139,7 +139,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll ) { // notify the start of scrolling, if not already scrolling if ( !bScrolling ) - StartScroll(), bScrolling = TRUE; + StartScroll(), bScrolling = sal_True; // get the delta in logic coordinates Size aDelta( PixelToLogic( Size( aHScroll.GetDelta(), aVScroll.GetDelta() ) ) ); @@ -154,7 +154,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll ) } // notify the end of scrolling - bScrolling = FALSE; + bScrolling = sal_False; EndScroll( aDelta.Width(), aDelta.Height() ); return 0; } @@ -165,7 +165,7 @@ IMPL_LINK( ScrollableWindow, ScrollHdl, ScrollBar *, pScroll ) { // notify the start of scrolling, if not already scrolling if ( !bScrolling ) - StartScroll(), bScrolling = TRUE; + StartScroll(), bScrolling = sal_True; if ( bHandleDragging ) { @@ -189,25 +189,25 @@ void __EXPORT ScrollableWindow::Resize() // determine the size of the output-area and if we need scrollbars const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); - BOOL bVVisible = FALSE; // by default no vertical-ScrollBar - BOOL bHVisible = FALSE; // by default no horizontal-ScrollBar - BOOL bChanged; // determines if a visiblility was changed + sal_Bool bVVisible = sal_False; // by default no vertical-ScrollBar + sal_Bool bHVisible = sal_False; // by default no horizontal-ScrollBar + sal_Bool bChanged; // determines if a visiblility was changed do { - bChanged = FALSE; + bChanged = sal_False; // does we need a vertical ScrollBar if ( aOutPixSz.Width() < aTotPixSz.Width() && !bHVisible ) - { bHVisible = TRUE; + { bHVisible = sal_True; aOutPixSz.Height() -= nScrSize; - bChanged = TRUE; + bChanged = sal_True; } // does we need a horizontal ScrollBar if ( aOutPixSz.Height() < aTotPixSz.Height() && !bVVisible ) - { bVVisible = TRUE; + { bVVisible = sal_True; aOutPixSz.Width() -= nScrSize; - bChanged = TRUE; + bChanged = sal_True; } } @@ -355,10 +355,10 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize ) Window::GetOutputSizePixel().Height()); Size aWill( aWish.GetIntersection(aMax).GetSize() ); - BOOL bHScroll = FALSE; + sal_Bool bHScroll = sal_False; const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); if ( aWill.Width() < aWish.GetSize().Width() ) - { bHScroll = TRUE; + { bHScroll = sal_True; aWill.Height() = Min( aWill.Height()+nScrSize, aMax.GetSize().Height() ); } @@ -373,7 +373,7 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize ) //------------------------------------------------------------------- -BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy ) +sal_Bool ScrollableWindow::MakeVisible( const Rectangle& rTarget, sal_Bool bSloppy ) { Rectangle aTarget; Rectangle aTotRect( Point(0, 0), PixelToLogic( aTotPixSz ) ); @@ -436,7 +436,7 @@ BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy ) // is the area already visible? Rectangle aVisArea( GetVisibleArea() ); if ( aVisArea.IsInside(rTarget) ) - return TRUE; + return sal_True; // is there somewhat to scroll? if ( aVisArea.TopLeft() != aTarget.TopLeft() ) @@ -465,7 +465,7 @@ Rectangle ScrollableWindow::GetVisibleArea() const //------------------------------------------------------------------- -void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert ) +void ScrollableWindow::SetLineSize( sal_uIntPtr nHorz, sal_uIntPtr nVert ) { Size aPixSz( LogicToPixel( Size(nHorz, nVert) ) ); nColumnPixW = aPixSz.Width(); @@ -476,7 +476,7 @@ void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert ) //------------------------------------------------------------------- -void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, USHORT ) +void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 ) { if ( !bScrolling ) StartScroll(); @@ -561,8 +561,8 @@ void ScrollableWindow::ScrollLines( long nLinesX, long nLinesY ) //------------------------------------------------------------------- -void ScrollableWindow::ScrollPages( long nPagesX, ULONG nOverlapX, - long nPagesY, ULONG nOverlapY ) +void ScrollableWindow::ScrollPages( long nPagesX, sal_uIntPtr nOverlapX, + long nPagesY, sal_uIntPtr nOverlapY ) { Size aOutSz( GetVisibleArea().GetSize() ); Scroll( nPagesX * aOutSz.Width() + (nPagesX>0 ? 1 : -1) * nOverlapX, diff --git a/svtools/source/control/stdctrl.cxx b/svtools/source/control/stdctrl.cxx index 14c8cade3092..fb42b42dc7f3 100644..100755 --- a/svtools/source/control/stdctrl.cxx +++ b/svtools/source/control/stdctrl.cxx @@ -80,7 +80,7 @@ namespace svt // make it transparent SetControlBackground(); SetBackground(); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); } // ----------------------------------------------------------------------- diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index 95b6d3fbd5c6..2f7dec072344 100644..100755 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -81,13 +81,13 @@ void FontNameMenu::Fill( const FontList* pList ) const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); // more than 100 fonts reduces the speed of opening the menu. // So only the first 100 fonts will be displayed. - USHORT nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< USHORT >(100) ); - for ( USHORT i = 0; i < nFontCount; i++ ) + sal_uInt16 nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< sal_uInt16 >(100) ); + for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { const XubString& rName = pList->GetFontName( i ).GetName(); // sort with the I18nHelper - USHORT j = GetItemCount(); + sal_uInt16 j = GetItemCount(); while ( j ) { XubString aText = GetItemText( GetItemId( j-1 ) ); @@ -108,11 +108,11 @@ void FontNameMenu::SetCurName( const XubString& rName ) maCurName = rName; // Menueintrag checken - USHORT nChecked = 0; - USHORT nItemCount = GetItemCount(); - for( USHORT i = 0; i < nItemCount; i++ ) + sal_uInt16 nChecked = 0; + sal_uInt16 nItemCount = GetItemCount(); + for( sal_uInt16 i = 0; i < nItemCount; i++ ) { - USHORT nItemId = GetItemId( i ); + sal_uInt16 nItemId = GetItemId( i ); if ( IsItemChecked( nItemId ) ) nChecked = nItemId; @@ -120,13 +120,13 @@ void FontNameMenu::SetCurName( const XubString& rName ) XubString aText = GetItemText( nItemId ); if ( aText == maCurName ) { - CheckItem( nItemId, TRUE ); + CheckItem( nItemId, sal_True ); return; } } if ( nChecked ) - CheckItem( nChecked, FALSE ); + CheckItem( nChecked, sal_False ); } // ======================================================================== @@ -146,7 +146,7 @@ FontStyleMenu::~FontStyleMenu() void FontStyleMenu::Select() { - USHORT nCurId = GetCurItemId(); + sal_uInt16 nCurId = GetCurItemId(); if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) ) { @@ -161,7 +161,7 @@ void FontStyleMenu::Select() void FontStyleMenu::Highlight() { - USHORT nCurId = GetCurItemId(); + sal_uInt16 nCurId = GetCurItemId(); if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) ) { @@ -176,22 +176,22 @@ void FontStyleMenu::Highlight() // ----------------------------------------------------------------------- -BOOL FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, USHORT nCount ) +sal_Bool FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, sal_uInt16 nCount ) { - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { if ( GetItemText( i+FONTSTYLEMENU_FIRSTID ) == rStyleName ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) { - USHORT nItemId = GetItemId( 0 ); + sal_uInt16 nItemId = GetItemId( 0 ); while ( (nItemId >= FONTSTYLEMENU_FIRSTID) && (nItemId <= FONTSTYLEMENU_LASTID) ) { @@ -204,16 +204,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) if ( hFontInfo ) { XubString aStyleText; - USHORT nPos = 0; - USHORT nId = FONTSTYLEMENU_FIRSTID; + sal_uInt16 nPos = 0; + sal_uInt16 nId = FONTSTYLEMENU_FIRSTID; FontWeight eLastWeight = WEIGHT_DONTKNOW; FontItalic eLastItalic = ITALIC_NONE; FontWidth eLastWidth = WIDTH_DONTKNOW; - BOOL bNormal = FALSE; - BOOL bItalic = FALSE; - BOOL bBold = FALSE; - BOOL bBoldItalic = FALSE; - BOOL bInsert = FALSE; + sal_Bool bNormal = sal_False; + sal_Bool bItalic = sal_False; + sal_Bool bBold = sal_False; + sal_Bool bBoldItalic = sal_False; + sal_Bool bInsert = sal_False; FontInfo aInfo; while ( hFontInfo ) { @@ -238,16 +238,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) if ( eWeight <= WEIGHT_NORMAL ) { if ( eItalic != ITALIC_NONE ) - bItalic = TRUE; + bItalic = sal_True; else - bNormal = TRUE; + bNormal = sal_True; } else { if ( eItalic != ITALIC_NONE ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; else - bBold = TRUE; + bBold = sal_True; } // For wrong StyleNames we replace this with the correct once @@ -281,11 +281,11 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList ) } if ( !bItalic && (aStyleText == pList->GetItalicStr()) ) - bItalic = TRUE; + bItalic = sal_True; else if ( !bBold && (aStyleText == pList->GetBoldStr()) ) - bBold = TRUE; + bBold = sal_True; else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) ) - bBoldItalic = TRUE; + bBoldItalic = sal_True; hFontInfo = pList->GetNextFontInfo( hFontInfo ); } @@ -350,11 +350,11 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle ) maCurStyle = rStyle; // Menueintrag checken - USHORT nChecked = 0; - USHORT nItemCount = GetItemCount(); - for( USHORT i = 0; i < nItemCount; i++ ) + sal_uInt16 nChecked = 0; + sal_uInt16 nItemCount = GetItemCount(); + for( sal_uInt16 i = 0; i < nItemCount; i++ ) { - USHORT nItemId = GetItemId( i ); + sal_uInt16 nItemId = GetItemId( i ); if ( (nItemId < FONTSTYLEMENU_FIRSTID) || (nItemId > FONTSTYLEMENU_LASTID) ) @@ -366,13 +366,13 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle ) XubString aText = GetItemText( nItemId ); if ( aText == maCurStyle ) { - CheckItem( nItemId, TRUE ); + CheckItem( nItemId, sal_True ); return; } } if ( nChecked ) - CheckItem( nChecked, FALSE ); + CheckItem( nChecked, sal_False ); } // ======================================================================== @@ -396,7 +396,7 @@ FontSizeMenu::~FontSizeMenu() void FontSizeMenu::Select() { - const USHORT nCurItemId = GetCurItemId(); + const sal_uInt16 nCurItemId = GetCurItemId(); mnCurHeight = mpHeightAry[ nCurItemId - 1 ]; maSelectHdl.Call( this ); } @@ -406,7 +406,7 @@ void FontSizeMenu::Select() void FontSizeMenu::Highlight() { const long nTempHeight = mnCurHeight; - const USHORT nCurItemId = GetCurItemId(); + const sal_uInt16 nCurItemId = GetCurItemId(); if ( !nCurItemId ) mnCurHeight = 0; else @@ -430,11 +430,11 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) const long* pTempAry; const long* pAry = pList->GetSizeAry( rInfo ); - USHORT nSizeCount = 0; + sal_uInt16 nSizeCount = 0; while ( pAry[nSizeCount] ) nSizeCount++; - USHORT nPos = 0; + sal_uInt16 nPos = 0; // first insert font size names (for simplified/traditional chinese) FontSizeNames aFontSizeNames( Application::GetSettings().GetUILanguage() ); @@ -444,8 +444,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) if ( pAry == pList->GetStdSizeAry() ) { // for scalable fonts all font size names - ULONG nCount = aFontSizeNames.Count(); - for( ULONG i = 0; i < nCount; i++ ) + sal_uIntPtr nCount = aFontSizeNames.Count(); + for( sal_uIntPtr i = 0; i < nCount; i++ ) { String aSizeName = aFontSizeNames.GetIndexName( i ); long nSize = aFontSizeNames.GetIndexSize( i ); @@ -479,7 +479,7 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) { mpHeightAry[nPos] = *pTempAry; nPos++; // Id is nPos+1 - InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, TRUE, FALSE ), MIB_RADIOCHECK | MIB_AUTOCHECK ); + InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, sal_True, sal_False ), MIB_RADIOCHECK | MIB_AUTOCHECK ); pTempAry++; } @@ -493,16 +493,16 @@ void FontSizeMenu::SetCurHeight( long nHeight ) mnCurHeight = nHeight; // check menue item - XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, TRUE, FALSE ); - USHORT nChecked = 0; - USHORT nItemCount = GetItemCount(); - for( USHORT i = 0; i < nItemCount; i++ ) + XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, sal_True, sal_False ); + sal_uInt16 nChecked = 0; + sal_uInt16 nItemCount = GetItemCount(); + for( sal_uInt16 i = 0; i < nItemCount; i++ ) { - USHORT nItemId = GetItemId( i ); + sal_uInt16 nItemId = GetItemId( i ); if ( mpHeightAry[i] == nHeight ) { - CheckItem( nItemId, TRUE ); + CheckItem( nItemId, sal_True ); return; } @@ -511,5 +511,5 @@ void FontSizeMenu::SetCurHeight( long nHeight ) } if ( nChecked ) - CheckItem( nChecked, FALSE ); + CheckItem( nChecked, sal_False ); } diff --git a/svtools/source/control/svxbox.cxx b/svtools/source/control/svxbox.cxx index d1ea47d110cd..451837026dbe 100644..100755 --- a/svtools/source/control/svxbox.cxx +++ b/svtools/source/control/svxbox.cxx @@ -42,17 +42,17 @@ SV_IMPL_PTRARR(SvxEntryLst, SvxBoxEntry*) SvxBoxEntry::SvxBoxEntry() : nId(LISTBOX_ENTRY_NOTFOUND), - bModified(FALSE), - bNew(FALSE) + bModified(sal_False), + bNew(sal_False) { } -SvxBoxEntry::SvxBoxEntry(const String& aNam, USHORT nIdx) : +SvxBoxEntry::SvxBoxEntry(const String& aNam, sal_uInt16 nIdx) : aName(aNam), nId(nIdx), - bModified(FALSE), - bNew(FALSE) + bModified(sal_False), + bNew(sal_False) { } @@ -99,8 +99,8 @@ __EXPORT SvxListBox::~SvxListBox() void SvxListBox::InitListBox() { // Verwaltung fuer die Stringlist aus der Resource aufbauen - USHORT nSize = GetEntryCount(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = GetEntryCount(); + for(sal_uInt16 i=0; i < nSize; ++i) { const SvxBoxEntry* pTmp = new SvxBoxEntry(ListBox::GetEntry(i), i); const SvxBoxEntry* &rpTmp = pTmp; aEntryLst.Insert(rpTmp, aEntryLst.Count()); @@ -114,7 +114,7 @@ void SvxListBox::InitListBox() void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry) { SvxBoxEntry* pNew = new SvxBoxEntry(rEntry); - pNew->bNew = TRUE; + pNew->bNew = sal_True; InsertSorted(pNew); } @@ -122,7 +122,7 @@ void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry) Beschreibung: Eintrag in die ListBox aufnehmen --------------------------------------------------------------------*/ -void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos) +void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, sal_uInt16 nPos) { if(nPos != LISTBOX_ENTRY_NOTFOUND) { @@ -139,7 +139,7 @@ void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos) Beschreibung: Eintrag aus der Liste loeschen --------------------------------------------------------------------*/ -void SvxListBox::RemoveEntry(USHORT nPos) +void SvxListBox::RemoveEntry(sal_uInt16 nPos) { if(nPos >= aEntryLst.Count()) return; @@ -163,7 +163,7 @@ void SvxListBox::RemoveEntry(USHORT nPos) void SvxListBox::RemoveEntry(const SvxBoxEntry& rEntry) { - USHORT nPos = ListBox::GetEntryPos(rEntry.aName); + sal_uInt16 nPos = ListBox::GetEntryPos(rEntry.aName); RemoveEntry(nPos); } @@ -182,7 +182,7 @@ void SvxListBox::Clear() Beschreibung: Position by Name --------------------------------------------------------------------*/ -USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const +sal_uInt16 SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const { return ListBox::GetEntryPos(rEntry.aName); } @@ -191,7 +191,7 @@ USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const Beschreibung: Rund um die Entries --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(sal_uInt16 nPos) const { if(nPos < aEntryLst.Count()) return *aEntryLst[nPos]; @@ -203,13 +203,13 @@ const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const Beschreibung: aktullen Eintrag zurueckgeben --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const +const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(sal_uInt16 nSelId) const { String aName(ListBox::GetSelectEntry(nSelId)); if(aName.Len() > 0) { - for (USHORT i=0; i < aEntryLst.Count(); i++) + for (sal_uInt16 i=0; i < aEntryLst.Count(); i++) { if(aEntryLst[i]->aName == aName ) return *aEntryLst[i]; @@ -222,11 +222,11 @@ const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const Beschreibung: modifizierte Eintraege --------------------------------------------------------------------*/ -USHORT SvxListBox::GetModifiedCount() const +sal_uInt16 SvxListBox::GetModifiedCount() const { - USHORT nMod = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nMod = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) nMod++; } @@ -237,7 +237,7 @@ USHORT SvxListBox::GetModifiedCount() const Beschreibung: Modifizierte Eintraege behandeln --------------------------------------------------------------------*/ -void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) +void SvxListBox::ModifyEntry(sal_uInt16 nPos, const String& rName) { if(nPos >= aEntryLst.Count()) return; @@ -245,7 +245,7 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) SvxBoxEntry* pEntry = aEntryLst[nPos]; aEntryLst.Remove(nPos, 1); aEntryLst[nPos]->aName = rName; - aEntryLst[nPos]->bModified = TRUE; + aEntryLst[nPos]->bModified = sal_True; ListBox::RemoveEntry(nPos); InsertSorted(pEntry); @@ -255,11 +255,11 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) Beschreibung: alle modifizierten Eintraege bahandeln --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetModifiedEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nMod = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nMod = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) { if(nMod == nPos) return *aEntryLst[i]; @@ -273,13 +273,13 @@ const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const Beschreibung: geloeschte Eintraege --------------------------------------------------------------------*/ -USHORT SvxListBox::GetRemovedCount() const +sal_uInt16 SvxListBox::GetRemovedCount() const { return aDelEntryLst.Count(); } -const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetRemovedEntry(sal_uInt16 nPos) const { if(nPos < aDelEntryLst.Count()) return *aDelEntryLst[nPos]; @@ -291,11 +291,11 @@ const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const Beschreibung: Neue Entries begutachten --------------------------------------------------------------------*/ -USHORT SvxListBox::GetNewCount() const +sal_uInt16 SvxListBox::GetNewCount() const { - USHORT nNew = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nNew = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) nNew++; } @@ -306,11 +306,11 @@ USHORT SvxListBox::GetNewCount() const Beschreibung: Alle neuen Eintraege ueberpruefen --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const +const SvxBoxEntry& SvxListBox::GetNewEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nNew = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nNew = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) { if(nNew == nPos) return *aEntryLst[i]; @@ -327,7 +327,7 @@ const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const void SvxListBox::InsertSorted(SvxBoxEntry* pEntry) { ListBox::InsertEntry(pEntry->aName); - USHORT nPos = ListBox::GetEntryPos(pEntry->aName); + sal_uInt16 nPos = ListBox::GetEntryPos(pEntry->aName); aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); } @@ -335,7 +335,7 @@ void SvxListBox::InsertSorted(SvxBoxEntry* pEntry) Beschreibung: ComboBoxen mit Verwaltungseinheit --------------------------------------------------------------------*/ -SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) : +SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, sal_uInt16 nStyleBits) : ComboBox(pParent, nBits), nStyle(nStyleBits) { @@ -343,7 +343,7 @@ SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) : } -SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, USHORT nStyleBits ): +SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits ): ComboBox(pParent, rId), nStyle(nStyleBits) { @@ -367,8 +367,8 @@ __EXPORT SvxComboBox::~SvxComboBox() void SvxComboBox::InitComboBox() { // Verwaltung fuer die Stringlist aus der Resource aufbauen - USHORT nSize = GetEntryCount(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = GetEntryCount(); + for(sal_uInt16 i=0; i < nSize; ++i) { const SvxBoxEntry* pTmp = new SvxBoxEntry(ComboBox::GetEntry(i), i); const SvxBoxEntry* &rpTmp = pTmp; aEntryLst.Insert(rpTmp, aEntryLst.Count()); @@ -382,7 +382,7 @@ void SvxComboBox::InitComboBox() void SvxComboBox::InsertNewEntry(const SvxBoxEntry& rEntry) { SvxBoxEntry* pNew = new SvxBoxEntry(rEntry); - pNew->bNew = TRUE; + pNew->bNew = sal_True; InsertSorted(pNew); } @@ -399,7 +399,7 @@ void SvxComboBox::InsertEntry(const SvxBoxEntry& rEntry) Beschreibung: Eintrag aus der Liste loeschen --------------------------------------------------------------------*/ -void SvxComboBox::RemoveEntry(USHORT nPos) +void SvxComboBox::RemoveEntry(sal_uInt16 nPos) { if(nPos >= aEntryLst.Count()) return; @@ -423,7 +423,7 @@ void SvxComboBox::RemoveEntry(USHORT nPos) void SvxComboBox::RemoveEntry(const SvxBoxEntry& rEntry) { - USHORT nPos = ComboBox::GetEntryPos(rEntry.aName); + sal_uInt16 nPos = ComboBox::GetEntryPos(rEntry.aName); RemoveEntry(nPos); } @@ -443,7 +443,7 @@ void SvxComboBox::Clear() Beschreibung: Position by Name --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const +sal_uInt16 SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const { return ComboBox::GetEntryPos(rEntry.aName); } @@ -452,7 +452,7 @@ USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const Beschreibung: Rund um die Entries --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetEntry(sal_uInt16 nPos) const { if(nPos < aEntryLst.Count()) return *aEntryLst[nPos]; @@ -464,11 +464,11 @@ const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const Beschreibung: modifizierte Eintraege --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetModifiedCount() const +sal_uInt16 SvxComboBox::GetModifiedCount() const { - USHORT nMod = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nMod = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) nMod++; } @@ -479,7 +479,7 @@ USHORT SvxComboBox::GetModifiedCount() const Beschreibung: Modifizierte Eintraege behandeln --------------------------------------------------------------------*/ -void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) +void SvxComboBox::ModifyEntry(sal_uInt16 nPos, const String& rName) { if(nPos >= aEntryLst.Count()) return; @@ -487,7 +487,7 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) SvxBoxEntry* pEntry = aEntryLst[nPos]; aEntryLst.Remove(nPos, 1); aEntryLst[nPos]->aName = rName; - aEntryLst[nPos]->bModified = TRUE; + aEntryLst[nPos]->bModified = sal_True; ComboBox::RemoveEntry(nPos); InsertSorted(pEntry); @@ -497,11 +497,11 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) Beschreibung: alle modifizierten Eintraege bahandeln --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetModifiedEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nMod = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nMod = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bModified) { if(nMod == nPos) return *aEntryLst[i]; @@ -515,13 +515,13 @@ const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const Beschreibung: geloeschte Eintraege --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetRemovedCount() const +sal_uInt16 SvxComboBox::GetRemovedCount() const { return aDelEntryLst.Count(); } -const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetRemovedEntry(sal_uInt16 nPos) const { if(nPos < aDelEntryLst.Count()) return *aDelEntryLst[nPos]; @@ -533,11 +533,11 @@ const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const Beschreibung: Neue Entries begutachten --------------------------------------------------------------------*/ -USHORT SvxComboBox::GetNewCount() const +sal_uInt16 SvxComboBox::GetNewCount() const { - USHORT nNew = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nNew = 0; + sal_uInt16 nSize = aEntryLst.Count(); + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) nNew++; } @@ -548,11 +548,11 @@ USHORT SvxComboBox::GetNewCount() const Beschreibung: Alle neuen Eintraege ueberpruefen --------------------------------------------------------------------*/ -const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const +const SvxBoxEntry& SvxComboBox::GetNewEntry(sal_uInt16 nPos) const { - USHORT nSize = aEntryLst.Count(); - USHORT nNew = 0; - for(USHORT i=0; i < nSize; ++i) + sal_uInt16 nSize = aEntryLst.Count(); + sal_uInt16 nNew = 0; + for(sal_uInt16 i=0; i < nSize; ++i) { if(aEntryLst[i]->bNew) { if(nNew == nPos) return *aEntryLst[i]; @@ -569,7 +569,7 @@ const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const void SvxComboBox::InsertSorted(SvxBoxEntry* pEntry) { ComboBox::InsertEntry(pEntry->aName); - USHORT nPos = ComboBox::GetEntryPos(pEntry->aName); + sal_uInt16 nPos = ComboBox::GetEntryPos(pEntry->aName); aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); } diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index c4896ba8b812..b93de91abf87 100644..100755 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -46,24 +46,24 @@ #define TABBAR_DRAG_SCROLLOFF 5 #define TABBAR_MINSIZE 5 -const USHORT ADDNEWPAGE_AREAWIDTH = 10; +const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10; // ======================================================================= struct ImplTabBarItem { - USHORT mnId; + sal_uInt16 mnId; TabBarPageBits mnBits; XubString maText; XubString maHelpText; Rectangle maRect; long mnWidth; - ULONG mnHelpId; - BOOL mbShort; - BOOL mbSelect; - BOOL mbEnable; + sal_uIntPtr mnHelpId; + sal_Bool mbShort; + sal_Bool mbSelect; + sal_Bool mbEnable; - ImplTabBarItem( USHORT nItemId, const XubString& rText, + ImplTabBarItem( sal_uInt16 nItemId, const XubString& rText, TabBarPageBits nPageBits ) : maText( rText ) { @@ -71,9 +71,9 @@ struct ImplTabBarItem mnBits = nPageBits; mnWidth = 0; mnHelpId = 0; - mbShort = FALSE; - mbSelect = FALSE; - mbEnable = TRUE; + mbShort = sal_False; + mbSelect = sal_False; + mbEnable = sal_True; } }; @@ -105,7 +105,7 @@ long ImplTabButton::PreNotify( NotifyEvent& rNEvt ) if ( GetParent()->IsInEditMode() ) { GetParent()->EndEditMode(); - return TRUE; + return sal_True; } } @@ -221,7 +221,7 @@ class TabBarEdit : public Edit { private: Timer maLoseFocusTimer; - BOOL mbPostEvt; + sal_Bool mbPostEvt; DECL_LINK( ImplEndEditHdl, void* ); DECL_LINK( ImplEndTimerHdl, void* ); @@ -231,8 +231,8 @@ public: TabBar* GetParent() const { return (TabBar*)Window::GetParent(); } - void SetPostEvent() { mbPostEvt = TRUE; } - void ResetPostEvent() { mbPostEvt = FALSE; } + void SetPostEvent() { mbPostEvt = sal_True; } + void ResetPostEvent() { mbPostEvt = sal_False; } virtual long PreNotify( NotifyEvent& rNEvt ); virtual void LoseFocus(); @@ -243,7 +243,7 @@ public: TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) : Edit( pParent, nWinStyle ) { - mbPostEvt = FALSE; + mbPostEvt = sal_False; } // ----------------------------------------------------------------------- @@ -259,19 +259,19 @@ long TabBarEdit::PreNotify( NotifyEvent& rNEvt ) { if ( !mbPostEvt ) { - if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) ) - mbPostEvt = TRUE; + if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) ) + mbPostEvt = sal_True; } - return TRUE; + return sal_True; } else if ( pKEvt->GetKeyCode().GetCode() == KEY_ESCAPE ) { if ( !mbPostEvt ) { - if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)TRUE ) ) - mbPostEvt = TRUE; + if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_True ) ) + mbPostEvt = sal_True; } - return TRUE; + return sal_True; } } } @@ -285,8 +285,8 @@ void TabBarEdit::LoseFocus() { if ( !mbPostEvt ) { - if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) ) - mbPostEvt = TRUE; + if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) ) + mbPostEvt = sal_True; } Edit::LoseFocus(); @@ -301,7 +301,7 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel ) // We need this query, because the edit get a losefous event, // when it shows the context menu or the insert symbol dialog - if ( !HasFocus() && HasChildPathFocus( TRUE ) ) + if ( !HasFocus() && HasChildPathFocus( sal_True ) ) { maLoseFocusTimer.SetTimeout( 30 ); maLoseFocusTimer.SetTimeoutHdl( LINK( this, TabBarEdit, ImplEndTimerHdl ) ); @@ -322,10 +322,10 @@ IMPL_LINK( TabBarEdit, ImplEndTimerHdl, void*, EMPTYARG ) // We need this query, because the edit get a losefous event, // when it shows the context menu or the insert symbol dialog - if ( HasChildPathFocus( TRUE ) ) + if ( HasChildPathFocus( sal_True ) ) maLoseFocusTimer.Start(); else - GetParent()->EndEditMode( TRUE ); + GetParent()->EndEditMode( sal_True ); return 0; } @@ -370,25 +370,25 @@ void TabBar::ImplInit( WinBits nWinStyle ) mnDropPos = 0; mnSwitchId = 0; mnEditId = 0; - mbFormat = TRUE; - mbFirstFormat = TRUE; - mbSizeFormat = TRUE; - mbAutoMaxWidth = TRUE; - mbInSwitching = FALSE; - mbAutoEditMode = FALSE; - mbEditCanceled = FALSE; - mbDropPos = FALSE; - mbInSelect = FALSE; - mbSelColor = FALSE; - mbSelTextColor = FALSE; - mbMirrored = FALSE; + mbFormat = sal_True; + mbFirstFormat = sal_True; + mbSizeFormat = sal_True; + mbAutoMaxWidth = sal_True; + mbInSwitching = sal_False; + mbAutoEditMode = sal_False; + mbEditCanceled = sal_False; + mbDropPos = sal_False; + mbInSelect = sal_False; + mbSelColor = sal_False; + mbSelTextColor = sal_False; + mbMirrored = sal_False; if ( nWinStyle & WB_3DTAB ) mnOffY++; ImplInitControls(); SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) ); - ImplInitSettings( TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -403,7 +403,7 @@ TabBar::TabBar( Window* pParent, WinBits nWinStyle ) : TabBar::~TabBar() { - EndEditMode( TRUE ); + EndEditMode( sal_True ); // Controls loeschen if ( mpPrevBtn ) @@ -430,7 +430,7 @@ TabBar::~TabBar() // ----------------------------------------------------------------------- -void TabBar::ImplInitSettings( BOOL bFont, BOOL bBackground ) +void TabBar::ImplInitSettings( sal_Bool bFont, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -504,12 +504,12 @@ void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor, // ----------------------------------------------------------------------- -BOOL TabBar::ImplCalcWidth() +sal_Bool TabBar::ImplCalcWidth() { // Groessen muessen nur ermittelt werden, wenn sich Text aendert oder // wenn der Font geaendert wurde if ( !mbSizeFormat ) - return FALSE; + return sal_False; // Breiten der Tabs mit dem fetten Font ermitteln Font aFont = GetFont(); @@ -532,29 +532,29 @@ BOOL TabBar::ImplCalcWidth() else mnCurMaxWidth = 0; - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { long nNewWidth = GetTextWidth( pItem->maText ); if ( mnCurMaxWidth && (nNewWidth > mnCurMaxWidth) ) { - pItem->mbShort = TRUE; + pItem->mbShort = sal_True; nNewWidth = mnCurMaxWidth; } else - pItem->mbShort = FALSE; + pItem->mbShort = sal_False; nNewWidth += TABBAR_OFFSET_X+TABBAR_OFFSET_X2; if ( pItem->mnWidth != nNewWidth ) { pItem->mnWidth = nNewWidth; if ( !pItem->maRect.IsEmpty() ) - bChanged = TRUE; + bChanged = sal_True; } pItem = mpItemList->Next(); } - mbSizeFormat = FALSE; - mbFormat = TRUE; + mbSizeFormat = sal_False; + mbFormat = sal_True; return bChanged; } @@ -567,7 +567,7 @@ void TabBar::ImplFormat() if ( !mbFormat ) return; - USHORT n = 0; + sal_uInt16 n = 0; long x = mnOffX; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) @@ -602,7 +602,7 @@ void TabBar::ImplFormat() pItem = mpItemList->Next(); } - mbFormat = FALSE; + mbFormat = sal_False; // Button enablen/disablen ImplEnableControls(); @@ -610,13 +610,13 @@ void TabBar::ImplFormat() // ----------------------------------------------------------------------- -USHORT TabBar::ImplGetLastFirstPos() +sal_uInt16 TabBar::ImplGetLastFirstPos() { - USHORT nCount = (USHORT)(mpItemList->Count()); + sal_uInt16 nCount = (sal_uInt16)(mpItemList->Count()); if ( !nCount || mbSizeFormat || mbFormat ) return 0; - USHORT nLastFirstPos = nCount-1; + sal_uInt16 nLastFirstPos = nCount-1; long nWinWidth = mnLastOffX-mnOffX-TABBAR_OFFSET_X-ADDNEWPAGE_AREAWIDTH; long nWidth = mpItemList->GetObject( nLastFirstPos )->mnWidth; while ( nLastFirstPos && (nWidth < nWinWidth) ) @@ -624,7 +624,7 @@ USHORT TabBar::ImplGetLastFirstPos() nLastFirstPos--; nWidth += mpItemList->GetObject( nLastFirstPos )->mnWidth; } - if ( (nLastFirstPos != (USHORT)(mpItemList->Count()-1)) && + if ( (nLastFirstPos != (sal_uInt16)(mpItemList->Count()-1)) && (nWidth > nWinWidth) ) nLastFirstPos++; return nLastFirstPos; @@ -704,7 +704,7 @@ void TabBar::ImplEnableControls() return; // Buttons enablen/disblen - BOOL bEnableBtn = mnFirstPos > 0; + sal_Bool bEnableBtn = mnFirstPos > 0; if ( mpFirstBtn ) mpFirstBtn->Enable( bEnableBtn ); if ( mpPrevBtn ) @@ -719,7 +719,7 @@ void TabBar::ImplEnableControls() // ----------------------------------------------------------------------- -void TabBar::ImplShowPage( USHORT nPos ) +void TabBar::ImplShowPage( sal_uInt16 nPos ) { // Breite berechnen long nWidth = GetOutputSizePixel().Width(); @@ -732,7 +732,7 @@ void TabBar::ImplShowPage( USHORT nPos ) { while ( pItem->maRect.Right() > nWidth ) { - USHORT nNewPos = mnFirstPos+1; + sal_uInt16 nNewPos = mnFirstPos+1; SetFirstPageId( GetPageId( nNewPos ) ); ImplFormat(); if ( nNewPos != mnFirstPos ) @@ -747,7 +747,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn ) { EndEditMode(); - USHORT nNewPos = mnFirstPos; + sal_uInt16 nNewPos = mnFirstPos; if ( pBtn == mpFirstBtn ) nNewPos = 0; @@ -758,13 +758,13 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn ) } else if ( pBtn == mpNextBtn ) { - USHORT nCount = GetPageCount(); + sal_uInt16 nCount = GetPageCount(); if ( mnFirstPos < nCount ) nNewPos = mnFirstPos+1; } else { - USHORT nCount = GetPageCount(); + sal_uInt16 nCount = GetPageCount(); if ( nCount ) nNewPos = nCount-1; } @@ -779,7 +779,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn ) void TabBar::MouseMove( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeaveWindow() ) - mbInSelect = FALSE; + mbInSelect = sal_False; Window::MouseMove( rMEvt ); } @@ -797,14 +797,14 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) } ImplTabBarItem* pItem; - USHORT nSelId = GetPageId( rMEvt.GetPosPixel() ); + sal_uInt16 nSelId = GetPageId( rMEvt.GetPosPixel() ); if ( !rMEvt.IsLeft() ) { Window::MouseButtonDown( rMEvt ); if ( (nSelId > 0) && (nSelId != mnCurPageId) ) { - USHORT nPos = GetPagePos( nSelId ); + sal_uInt16 nPos = GetPagePos( nSelId ); pItem = mpItemList->GetObject( nPos ); if ( pItem->mbEnable ) @@ -816,7 +816,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) ImplActivatePage(); ImplSelect(); } - mbInSelect = TRUE; + mbInSelect = sal_True; } } return; @@ -832,8 +832,8 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) { if ( nSelId ) { - USHORT nPos = GetPagePos( nSelId ); - BOOL bSelectTab = FALSE; + sal_uInt16 nPos = GetPagePos( nSelId ); + sal_Bool bSelectTab = sal_False; pItem = mpItemList->GetObject( nPos ); if ( pItem->mbEnable ) @@ -843,15 +843,15 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( nSelId != mnCurPageId ) { SelectPage( nSelId, !IsPageSelected( nSelId ) ); - bSelectTab = TRUE; + bSelectTab = sal_True; } } else if ( mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT) ) { - bSelectTab = TRUE; - USHORT n; - BOOL bSelect; - USHORT nCurPos = GetPagePos( mnCurPageId ); + bSelectTab = sal_True; + sal_uInt16 n; + sal_Bool bSelect; + sal_uInt16 nCurPos = GetPagePos( mnCurPageId ); if ( nPos <= nCurPos ) { // Alle Tabs bis zur angeklickten Tab deselektieren @@ -862,9 +862,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) { pItem = mpItemList->GetObject( n ); if ( n < nPos ) - bSelect = FALSE; + bSelect = sal_False; else - bSelect = TRUE; + bSelect = sal_True; if ( pItem->mbSelect != bSelect ) { @@ -882,16 +882,16 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) // Alle Tabs von der aktuellen bis zur angeklickten // Tab selektieren und alle Tabs von der angeklickten // Tab bis zur letzten Tab deselektieren - USHORT nCount = (USHORT)mpItemList->Count(); + sal_uInt16 nCount = (sal_uInt16)mpItemList->Count(); n = nCurPos; while ( n < nCount ) { pItem = mpItemList->GetObject( n ); if ( n <= nPos ) - bSelect = TRUE; + bSelect = sal_True; else - bSelect = FALSE; + bSelect = sal_False; if ( pItem->mbSelect != bSelect ) { @@ -915,7 +915,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) } else ImplShowPage( nPos ); - mbInSelect = TRUE; + mbInSelect = sal_True; return; } @@ -925,7 +925,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) // Gegebenenfalls den Double-Click-Handler rufen if ( !rMEvt.GetModifier() && (!nSelId || (nSelId == mnCurPageId)) ) { - USHORT nOldCurId = mnCurPageId; + sal_uInt16 nOldCurId = mnCurPageId; mnCurPageId = nSelId; DoubleClick(); // Abfrage, da im DoubleClick-Handler die aktuelle Seite @@ -943,7 +943,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) // Nur Select ausfuehren, wenn noch nicht aktuelle Page if ( nSelId != mnCurPageId ) { - USHORT nPos = GetPagePos( nSelId ); + sal_uInt16 nPos = GetPagePos( nSelId ); pItem = mpItemList->GetObject( nPos ); if ( pItem->mbEnable ) @@ -951,9 +951,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( !pItem->mbSelect ) { // Muss invalidiert werden - BOOL bUpdate = FALSE; + sal_Bool bUpdate = sal_False; if ( IsReallyVisible() && IsUpdateMode() ) - bUpdate = TRUE; + bUpdate = sal_True; // Alle selektierten Items deselektieren pItem = mpItemList->First(); @@ -961,7 +961,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) { if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { - pItem->mbSelect = FALSE; + pItem->mbSelect = sal_False; if ( bUpdate ) Invalidate( pItem->maRect ); } @@ -980,7 +980,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) } else ImplShowPage( nPos ); - mbInSelect = TRUE; + mbInSelect = sal_True; } return; @@ -994,7 +994,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt ) void TabBar::MouseButtonUp( const MouseEvent& rMEvt ) { - mbInSelect = FALSE; + mbInSelect = sal_False; Window::MouseButtonUp( rMEvt ); } @@ -1003,7 +1003,7 @@ void TabBar::MouseButtonUp( const MouseEvent& rMEvt ) void TabBar::Paint( const Rectangle& ) { // Items berechnen und ausgeben - USHORT nItemCount = (USHORT)mpItemList->Count(); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); ImplTabBarItem* pItem; // kein Item, dann auch nichts zu tun @@ -1016,7 +1016,7 @@ void TabBar::Paint( const Rectangle& ) // sichtbar wird if ( mbFirstFormat ) { - mbFirstFormat = FALSE; + mbFirstFormat = sal_False; if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos ) { @@ -1025,9 +1025,9 @@ void TabBar::Paint( const Rectangle& ) { // mbDropPos setzen (bzw. misbrauchen) um Invalidate() // zu unterbinden - mbDropPos = TRUE; + mbDropPos = sal_True; SetFirstPageId( mnCurPageId ); - mbDropPos = FALSE; + mbDropPos = sal_False; if ( mnFirstPos != 0 ) ImplFormat(); } @@ -1075,7 +1075,7 @@ void TabBar::Paint( const Rectangle& ) if ( nItemCount ) { // letzten sichtbaren Eintrag suchen - USHORT n = mnFirstPos+1; + sal_uInt16 n = mnFirstPos+1; if ( n >= nItemCount ) n = nItemCount-1; pItem = mpItemList->Seek( n ); @@ -1255,7 +1255,7 @@ void TabBar::Resize() // Scroll-Buttons anordnen long nHeight = aNewSize.Height(); // Font in der groesse Anpassen? - ImplInitSettings( TRUE, FALSE ); + ImplInitSettings( sal_True, sal_False ); long nX = mbMirrored ? (aNewSize.Width()-nHeight) : 0; long nXDiff = mbMirrored ? -nHeight : nHeight; @@ -1301,7 +1301,7 @@ void TabBar::Resize() } // Neu formatieren - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; if ( IsReallyVisible() ) { if ( ImplCalcWidth() ) @@ -1317,7 +1317,7 @@ void TabBar::Resize() void TabBar::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { if ( rHEvt.GetMode() & HELPMODE_BALLOON ) @@ -1338,7 +1338,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - ULONG nHelpId = GetHelpId( nItemId ); + sal_uIntPtr nHelpId = GetHelpId( nItemId ); if ( nHelpId ) { // Wenn eine Hilfe existiert, dann ausloesen @@ -1353,7 +1353,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) // wenn dieser abgeschnitten oder nicht voll sichtbar ist if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) { - USHORT nPos = GetPagePos( nItemId ); + sal_uInt16 nPos = GetPagePos( nItemId ); ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); if ( pItem->mbShort || (pItem->maRect.Right()-TABBAR_OFFSET_X-5 > mnLastOffX) ) @@ -1395,14 +1395,14 @@ void TabBar::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE ); + ImplInitSettings( sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) Invalidate(); else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, TRUE ); + ImplInitSettings( sal_False, sal_True ); Invalidate(); } else if ( nType == STATE_CHANGE_MIRRORING ) @@ -1428,7 +1428,7 @@ void TabBar::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - ImplInitSettings( TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True ); Invalidate(); } } @@ -1497,7 +1497,7 @@ long TabBar::DeactivatePage() if ( maDeactivatePageHdl.IsSet() ) return maDeactivatePageHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1507,7 +1507,7 @@ long TabBar::StartRenaming() if ( maStartRenamingHdl.IsSet() ) return maStartRenamingHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1517,7 +1517,7 @@ long TabBar::AllowRenaming() if ( maAllowRenamingHdl.IsSet() ) return maAllowRenamingHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1536,8 +1536,8 @@ void TabBar::Mirror() // ----------------------------------------------------------------------- -void TabBar::InsertPage( USHORT nPageId, const XubString& rText, - TabBarPageBits nBits, USHORT nPos ) +void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText, + TabBarPageBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" ); DBG_ASSERT( GetPagePos( nPageId ) == TABBAR_PAGE_NOTFOUND, @@ -1547,7 +1547,7 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, // PageItem anlegen und in die Item-Liste eintragen ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits ); mpItemList->Insert( pItem, nPos ); - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; // CurPageId gegebenenfalls setzen if ( !mnCurPageId ) @@ -1562,9 +1562,9 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, // ----------------------------------------------------------------------- -void TabBar::RemovePage( USHORT nPageId ) +void TabBar::RemovePage( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); // Existiert Item if ( nPos != TABBAR_PAGE_NOTFOUND ) @@ -1578,7 +1578,7 @@ void TabBar::RemovePage( USHORT nPageId ) // Item-Daten loeschen delete mpItemList->Remove( nPos ); - mbFormat = TRUE; + mbFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -1590,9 +1590,9 @@ void TabBar::RemovePage( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::MovePage( USHORT nPageId, USHORT nNewPos ) +void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); Pair aPair( nPos, nNewPos ); if ( nPos < nNewPos ) @@ -1607,7 +1607,7 @@ void TabBar::MovePage( USHORT nPageId, USHORT nNewPos ) // TabBar-Item in der Liste verschieben ImplTabBarItem* pItem = mpItemList->Remove( nPos ); mpItemList->Insert( pItem, nNewPos ); - mbFormat = TRUE; + mbFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -1632,7 +1632,7 @@ void TabBar::Clear() // Items aus der Liste loeschen mpItemList->Clear(); - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; mnCurPageId = 0; mnFirstPos = 0; @@ -1645,9 +1645,9 @@ void TabBar::Clear() // ----------------------------------------------------------------------- -void TabBar::EnablePage( USHORT nPageId, BOOL bEnable ) +void TabBar::EnablePage( sal_uInt16 nPageId, sal_Bool bEnable ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) { @@ -1668,21 +1668,21 @@ void TabBar::EnablePage( USHORT nPageId, BOOL bEnable ) // ----------------------------------------------------------------------- -BOOL TabBar::IsPageEnabled( USHORT nPageId ) const +sal_Bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) return mpItemList->GetObject( nPos )->mbEnable; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits ) +void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) { @@ -1701,26 +1701,26 @@ void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits ) // ----------------------------------------------------------------------- -TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const +TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) return mpItemList->GetObject( nPos )->mnBits; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -USHORT TabBar::GetPageCount() const +sal_uInt16 TabBar::GetPageCount() const { - return (USHORT)mpItemList->Count(); + return (sal_uInt16)mpItemList->Count(); } // ----------------------------------------------------------------------- -USHORT TabBar::GetPageId( USHORT nPos ) const +sal_uInt16 TabBar::GetPageId( sal_uInt16 nPos ) const { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); if ( pItem ) @@ -1731,13 +1731,13 @@ USHORT TabBar::GetPageId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT TabBar::GetPagePos( USHORT nPageId ) const +sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const { ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { if ( pItem->mnId == nPageId ) - return (USHORT)mpItemList->GetCurPos(); + return (sal_uInt16)mpItemList->GetCurPos(); pItem = mpItemList->Next(); } @@ -1747,7 +1747,7 @@ USHORT TabBar::GetPagePos( USHORT nPageId ) const // ----------------------------------------------------------------------- -USHORT TabBar::GetPageId( const Point& rPos ) const +sal_uInt16 TabBar::GetPageId( const Point& rPos ) const { ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) @@ -1763,9 +1763,9 @@ USHORT TabBar::GetPageId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle TabBar::GetPageRect( USHORT nPageId ) const +Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) return mpItemList->GetObject( nPos )->maRect; @@ -1775,9 +1775,9 @@ Rectangle TabBar::GetPageRect( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetCurPageId( USHORT nPageId ) +void TabBar::SetCurPageId( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen if ( nPos != TABBAR_PAGE_NOTFOUND ) @@ -1788,9 +1788,9 @@ void TabBar::SetCurPageId( USHORT nPageId ) return; // Muss invalidiert werden - BOOL bUpdate = FALSE; + sal_Bool bUpdate = sal_False; if ( IsReallyVisible() && IsUpdateMode() ) - bUpdate = TRUE; + bUpdate = sal_True; ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); ImplTabBarItem* pOldItem; @@ -1804,14 +1804,14 @@ void TabBar::SetCurPageId( USHORT nPageId ) // deselktieren, wenn dies die einzige selektierte Seite ist if ( !pItem->mbSelect && pOldItem ) { - USHORT nSelPageCount = GetSelectPageCount(); + sal_uInt16 nSelPageCount = GetSelectPageCount(); if ( nSelPageCount == 1 ) - pOldItem->mbSelect = FALSE; - pItem->mbSelect = TRUE; + pOldItem->mbSelect = sal_False; + pItem->mbSelect = sal_True; } mnCurPageId = nPageId; - mbFormat = TRUE; + mbFormat = sal_True; // Dafuer sorgen, das aktuelle Page sichtbar wird if ( IsReallyVisible() ) @@ -1833,7 +1833,7 @@ void TabBar::SetCurPageId( USHORT nPageId ) while ( (mbMirrored ? (pItem->maRect.Left() < mnOffX) : (pItem->maRect.Right() > nWidth)) || pItem->maRect.IsEmpty() ) { - USHORT nNewPos = mnFirstPos+1; + sal_uInt16 nNewPos = mnFirstPos+1; // Dafuer sorgen, das min. die aktuelle TabPages als // erste TabPage sichtbar ist if ( nNewPos >= nPos ) @@ -1864,12 +1864,12 @@ void TabBar::SetCurPageId( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::MakeVisible( USHORT nPageId ) +void TabBar::MakeVisible( sal_uInt16 nPageId ) { if ( !IsReallyVisible() ) return; - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen if ( nPos != TABBAR_PAGE_NOTFOUND ) @@ -1887,14 +1887,14 @@ void TabBar::MakeVisible( USHORT nPageId ) if ( mbFormat || pItem->maRect.IsEmpty() ) { - mbFormat = TRUE; + mbFormat = sal_True; ImplFormat(); } while ( (pItem->maRect.Right() > nWidth) || pItem->maRect.IsEmpty() ) { - USHORT nNewPos = mnFirstPos+1; + sal_uInt16 nNewPos = mnFirstPos+1; // Dafuer sorgen, das min. die aktuelle TabPages als // erste TabPage sichtbar ist if ( nNewPos >= nPos ) @@ -1916,11 +1916,11 @@ void TabBar::MakeVisible( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::SetFirstPageId( USHORT nPageId ) +void TabBar::SetFirstPageId( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); - // Wenn Item nicht existiert, dann FALSE zurueckgeben + // Wenn Item nicht existiert, dann sal_False zurueckgeben if ( nPos != TABBAR_PAGE_NOTFOUND ) { if ( nPos != mnFirstPos ) @@ -1928,8 +1928,8 @@ void TabBar::SetFirstPageId( USHORT nPageId ) // Dafuer sorgen, das nach Moeglichkteit soviele Pages wie // moeglich sichtbar sind ImplFormat(); - USHORT nLastFirstPos = ImplGetLastFirstPos(); - USHORT nNewPos; + sal_uInt16 nLastFirstPos = ImplGetLastFirstPos(); + sal_uInt16 nNewPos; if ( nPos > nLastFirstPos ) nNewPos = nLastFirstPos; else @@ -1938,7 +1938,7 @@ void TabBar::SetFirstPageId( USHORT nPageId ) if ( nNewPos != mnFirstPos ) { mnFirstPos = nNewPos; - mbFormat = TRUE; + mbFormat = sal_True; // Leiste neu ausgeben (Achtung: mbDropPos beachten, da wenn // dieses Flag gesetzt ist, wird direkt gepaintet) @@ -1951,9 +1951,9 @@ void TabBar::SetFirstPageId( USHORT nPageId ) // ----------------------------------------------------------------------- -void TabBar::SelectPage( USHORT nPageId, BOOL bSelect ) +void TabBar::SelectPage( sal_uInt16 nPageId, sal_Bool bSelect ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) { @@ -1972,10 +1972,10 @@ void TabBar::SelectPage( USHORT nPageId, BOOL bSelect ) // ----------------------------------------------------------------------- -void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos ) +void TabBar::SelectPageRange( sal_Bool bSelect, sal_uInt16 nStartPos, sal_uInt16 nEndPos ) { Rectangle aPaintRect; - USHORT nPos = nStartPos; + sal_uInt16 nPos = nStartPos; ImplTabBarItem* pItem = mpItemList->Seek( nPos ); while ( pItem && (nPos <= nEndPos) ) { @@ -1996,9 +1996,9 @@ void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos ) // ----------------------------------------------------------------------- -USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const +sal_uInt16 TabBar::GetSelectPage( sal_uInt16 nSelIndex ) const { - USHORT nSelected = 0; + sal_uInt16 nSelected = 0; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { @@ -2016,9 +2016,9 @@ USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const // ----------------------------------------------------------------------- -USHORT TabBar::GetSelectPageCount() const +sal_uInt16 TabBar::GetSelectPageCount() const { - USHORT nSelected = 0; + sal_uInt16 nSelected = 0; ImplTabBarItem* pItem = mpItemList->First(); while ( pItem ) { @@ -2033,22 +2033,22 @@ USHORT TabBar::GetSelectPageCount() const // ----------------------------------------------------------------------- -BOOL TabBar::IsPageSelected( USHORT nPageId ) const +sal_Bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) return mpItemList->GetObject( nPos )->mbSelect; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL TabBar::StartEditMode( USHORT nPageId ) +sal_Bool TabBar::StartEditMode( sal_uInt16 nPageId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( mpEdit || (nPos == TABBAR_PAGE_NOTFOUND) || (mnLastOffX < 8) ) - return FALSE; + return sal_False; mnEditId = nPageId; if ( StartRenaming() ) @@ -2100,23 +2100,23 @@ BOOL TabBar::StartEditMode( USHORT nPageId ) mpEdit->GrabFocus(); mpEdit->SetSelection( Selection( 0, mpEdit->GetText().Len() ) ); mpEdit->Show(); - return TRUE; + return sal_True; } else { mnEditId = 0; - return FALSE; + return sal_False; } } // ----------------------------------------------------------------------- -void TabBar::EndEditMode( BOOL bCancel ) +void TabBar::EndEditMode( sal_Bool bCancel ) { if ( mpEdit ) { // call hdl - BOOL bEnd = TRUE; + sal_Bool bEnd = sal_True; mbEditCanceled = bCancel; maEditText = mpEdit->GetText(); mpEdit->SetPostEvent(); @@ -2126,9 +2126,9 @@ void TabBar::EndEditMode( BOOL bCancel ) if ( nAllowRenaming == TABBAR_RENAMING_YES ) SetPageText( mnEditId, maEditText ); else if ( nAllowRenaming == TABBAR_RENAMING_NO ) - bEnd = FALSE; + bEnd = sal_False; else // nAllowRenaming == TABBAR_RENAMING_CANCEL - mbEditCanceled = TRUE; + mbEditCanceled = sal_True; } // renaming not allowed, than reset edit data @@ -2148,30 +2148,30 @@ void TabBar::EndEditMode( BOOL bCancel ) // reset maEditText.Erase(); - mbEditCanceled = FALSE; + mbEditCanceled = sal_False; } } // ----------------------------------------------------------------------- -void TabBar::SetMirrored( BOOL bMirrored ) +void TabBar::SetMirrored( sal_Bool bMirrored ) { if( mbMirrored != bMirrored ) { mbMirrored = bMirrored; - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; ImplInitControls(); // for button images Resize(); // recalculates control positions Mirror(); } } -void TabBar::SetEffectiveRTL( BOOL bRTL ) +void TabBar::SetEffectiveRTL( sal_Bool bRTL ) { SetMirrored( bRTL != Application::GetSettings().GetLayoutRTL() ); } -BOOL TabBar::IsEffectiveRTL() const +sal_Bool TabBar::IsEffectiveRTL() const { return IsMirrored() != Application::GetSettings().GetLayoutRTL(); } @@ -2183,7 +2183,7 @@ void TabBar::SetMaxPageWidth( long nMaxWidth ) if ( mnMaxPageWidth != nMaxWidth ) { mnMaxPageWidth = nMaxWidth; - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -2198,7 +2198,7 @@ void TabBar::SetSelectColor() if ( mbSelColor ) { maSelColor = Color( COL_TRANSPARENT ); - mbSelColor = FALSE; + mbSelColor = sal_False; Invalidate(); } } @@ -2212,7 +2212,7 @@ void TabBar::SetSelectColor( const Color& rColor ) if ( mbSelColor ) { maSelColor = Color( COL_TRANSPARENT ); - mbSelColor = FALSE; + mbSelColor = sal_False; Invalidate(); } } @@ -2221,7 +2221,7 @@ void TabBar::SetSelectColor( const Color& rColor ) if ( maSelColor != rColor ) { maSelColor = rColor; - mbSelColor = TRUE; + mbSelColor = sal_True; Invalidate(); } } @@ -2234,7 +2234,7 @@ void TabBar::SetSelectTextColor() if ( mbSelTextColor ) { maSelTextColor = Color( COL_TRANSPARENT ); - mbSelTextColor = FALSE; + mbSelTextColor = sal_False; Invalidate(); } } @@ -2248,7 +2248,7 @@ void TabBar::SetSelectTextColor( const Color& rColor ) if ( mbSelTextColor ) { maSelTextColor = Color( COL_TRANSPARENT ); - mbSelTextColor = FALSE; + mbSelTextColor = sal_False; Invalidate(); } } @@ -2257,7 +2257,7 @@ void TabBar::SetSelectTextColor( const Color& rColor ) if ( maSelTextColor != rColor ) { maSelTextColor = rColor; - mbSelTextColor = TRUE; + mbSelTextColor = sal_True; Invalidate(); } } @@ -2265,13 +2265,13 @@ void TabBar::SetSelectTextColor( const Color& rColor ) // ----------------------------------------------------------------------- -void TabBar::SetPageText( USHORT nPageId, const XubString& rText ) +void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) { mpItemList->GetObject( nPos )->maText = rText; - mbSizeFormat = TRUE; + mbSizeFormat = sal_True; // Leiste neu ausgeben if ( IsReallyVisible() && IsUpdateMode() ) @@ -2283,9 +2283,9 @@ void TabBar::SetPageText( USHORT nPageId, const XubString& rText ) // ----------------------------------------------------------------------- -XubString TabBar::GetPageText( USHORT nPageId ) const +XubString TabBar::GetPageText( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) return mpItemList->GetObject( nPos )->maText; else @@ -2294,18 +2294,18 @@ XubString TabBar::GetPageText( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpText( USHORT nPageId, const XubString& rText ) +void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) mpItemList->GetObject( nPos )->maHelpText = rText; } // ----------------------------------------------------------------------- -XubString TabBar::GetHelpText( USHORT nPageId ) const +XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -2324,18 +2324,18 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId ) +void TabBar::SetHelpId( sal_uInt16 nPageId, sal_uIntPtr nHelpId ) { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) mpItemList->GetObject( nPos )->mnHelpId = nHelpId; } // ----------------------------------------------------------------------- -ULONG TabBar::GetHelpId( USHORT nPageId ) const +sal_uIntPtr TabBar::GetHelpId( sal_uInt16 nPageId ) const { - USHORT nPos = GetPagePos( nPageId ); + sal_uInt16 nPos = GetPagePos( nPageId ); if ( nPos != TABBAR_PAGE_NOTFOUND ) return mpItemList->GetObject( nPos )->mnHelpId; else @@ -2356,10 +2356,10 @@ long TabBar::GetMinSize() const // ----------------------------------------------------------------------- -BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) +sal_Bool TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) ) - return FALSE; + return sal_False; // Testen, ob angeklickte Seite selektiert ist. Falls dies nicht // der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and @@ -2369,11 +2369,11 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // da der Select schon den Bereich gescrollt haben kann if ( rCEvt.IsMouseEvent() && !mbInSelect ) { - USHORT nSelId = GetPageId( rCEvt.GetMousePosPixel() ); + sal_uInt16 nSelId = GetPageId( rCEvt.GetMousePosPixel() ); // Falls kein Eintrag angeklickt wurde, starten wir kein Dragging if ( !nSelId ) - return FALSE; + return sal_False; // Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle // Seite setzen und Select rufen. @@ -2387,34 +2387,34 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) ImplSelect(); } else - return FALSE; + return sal_False; } } - mbInSelect = FALSE; + mbInSelect = sal_False; Region aRegion; // Region zuweisen rRegion = aRegion; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -USHORT TabBar::ShowDropPos( const Point& rPos ) +sal_uInt16 TabBar::ShowDropPos( const Point& rPos ) { ImplTabBarItem* pItem; - USHORT nDropId; - USHORT nNewDropPos; - USHORT nItemCount = (USHORT)mpItemList->Count(); + sal_uInt16 nDropId; + sal_uInt16 nNewDropPos; + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); short nScroll = 0; if ( rPos.X() > mnLastOffX-TABBAR_DRAG_SCROLLOFF ) { pItem = mpItemList->GetObject( mpItemList->Count()-1 ); if ( !pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()) ) - nNewDropPos = (USHORT)mpItemList->Count(); + nNewDropPos = (sal_uInt16)mpItemList->Count(); else { nNewDropPos = mnFirstPos+1; @@ -2450,12 +2450,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) if ( mbDropPos ) HideDropPos(); - mbDropPos = TRUE; + mbDropPos = sal_True; mnDropPos = nNewDropPos; if ( nScroll ) { - USHORT nOldFirstPos = mnFirstPos; + sal_uInt16 nOldFirstPos = mnFirstPos; SetFirstPageId( GetPageId( mnFirstPos+nScroll ) ); // Direkt ausgeben, da kein Paint bei Drag and Drop moeglich @@ -2472,7 +2472,7 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) Color aBlackColor( COL_BLACK ); long nX; long nY = (maWinSize.Height()/2)-1; - USHORT nCurPos = GetPagePos( mnCurPageId ); + sal_uInt16 nCurPos = GetPagePos( mnCurPageId ); SetLineColor( aBlackColor ); if ( mnDropPos < nItemCount ) @@ -2511,7 +2511,7 @@ void TabBar::HideDropPos() long nX; long nY1 = (maWinSize.Height()/2)-3; long nY2 = nY1 + 5; - USHORT nItemCount = (USHORT)mpItemList->Count(); + sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count(); if ( mnDropPos < nItemCount ) { @@ -2538,17 +2538,17 @@ void TabBar::HideDropPos() SetClipRegion(); } - mbDropPos = FALSE; + mbDropPos = sal_False; mnDropPos = 0; } } // ----------------------------------------------------------------------- -BOOL TabBar::SwitchPage( const Point& rPos ) +sal_Bool TabBar::SwitchPage( const Point& rPos ) { - BOOL bSwitch = FALSE; - USHORT nSwitchId = GetPageId( rPos ); + sal_Bool bSwitch = sal_False; + sal_uInt16 nSwitchId = GetPageId( rPos ); if ( !nSwitchId ) EndSwitchPage(); else @@ -2565,16 +2565,16 @@ BOOL TabBar::SwitchPage( const Point& rPos ) { if ( Time::GetSystemTicks() > mnSwitchTime+500 ) { - mbInSwitching = TRUE; + mbInSwitching = sal_True; if ( ImplDeactivatePage() ) { SetCurPageId( mnSwitchId ); Update(); ImplActivatePage(); ImplSelect(); - bSwitch = TRUE; + bSwitch = sal_True; } - mbInSwitching = FALSE; + mbInSwitching = sal_False; } } } diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx index e84c934ef0d8..3a18b9ff6129 100644..100755 --- a/svtools/source/control/taskbar.cxx +++ b/svtools/source/control/taskbar.cxx @@ -81,9 +81,9 @@ TaskBar::TaskBar( Window* pParent, WinBits nWinStyle ) : mnOldStatusWidth = 0; mnLines = 1; mnWinBits = nWinStyle; - mbStatusText = FALSE; - mbShowItems = FALSE; - mbAutoHide = FALSE; + mbStatusText = sal_False; + mbShowItems = sal_False; + mbAutoHide = sal_False; ImplInitSettings(); } @@ -314,13 +314,13 @@ void TaskBar::Resize() if ( pTempButtonBar ) { - USHORT i = 0; - BOOL bVisibleItems = FALSE; + sal_uInt16 i = 0; + sal_Bool bVisibleItems = sal_False; while ( i < pTempButtonBar->GetItemCount() ) { if ( pTempButtonBar->IsItemVisible( pTempButtonBar->GetItemId( i ) ) ) { - bVisibleItems = TRUE; + bVisibleItems = sal_True; break; } i++; @@ -469,14 +469,14 @@ void TaskBar::Format() // ----------------------------------------------------------------------- -void TaskBar::SetLines( USHORT nLines ) +void TaskBar::SetLines( sal_uInt16 nLines ) { mnLines = nLines; } // ----------------------------------------------------------------------- -void TaskBar::EnableAutoHide( BOOL bAutoHide ) +void TaskBar::EnableAutoHide( sal_Bool bAutoHide ) { mbAutoHide = bAutoHide; @@ -498,14 +498,14 @@ void TaskBar::ShowStatusText( const String& rText ) { if ( !mbStatusText ) { - mbStatusText = TRUE; + mbStatusText = sal_True; if ( mpStatusBar->AreItemsVisible() ) { - mbShowItems = TRUE; + mbShowItems = sal_True; mpStatusBar->HideItems(); } else - mbShowItems = TRUE; + mbShowItems = sal_True; maOldText = mpStatusBar->GetText(); Resize(); mpStatusBar->SetText( rText ); @@ -523,7 +523,7 @@ void TaskBar::HideStatusText() { if ( mbStatusText && mpStatusBar ) { - mbStatusText = FALSE; + mbStatusText = sal_False; mpStatusBar->SetText( maOldText ); Resize(); if ( mbShowItems ) diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx index 8e5ff6de8def..9d4af5d81ca4 100644..100755 --- a/svtools/source/control/taskbox.cxx +++ b/svtools/source/control/taskbox.cxx @@ -63,7 +63,7 @@ TaskToolBox::TaskToolBox( Window* pParent, WinBits nWinStyle ) : mnActiveItemId = 0; mnTaskItem = 0; mnSmallItem = TOOLBOX_ITEM_NOTFOUND; - mbMinActivate = FALSE; + mbMinActivate = sal_False; SetAlign( WINDOWALIGN_BOTTOM ); SetButtonType( BUTTON_SYMBOLTEXT ); @@ -85,14 +85,14 @@ TaskToolBox::~TaskToolBox() // ----------------------------------------------------------------------- -void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate ) +void TaskToolBox::ActivateTaskItem( sal_uInt16 nItemId, sal_Bool bMinActivate ) { if ( nItemId ) { if ( nItemId != mnActiveItemId ) { if ( mnActiveItemId ) - CheckItem( mnActiveItemId, FALSE ); + CheckItem( mnActiveItemId, sal_False ); CheckItem( nItemId ); mnActiveItemId = nItemId; } @@ -101,13 +101,13 @@ void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate ) if ( !bMinActivate ) return; - mbMinActivate = TRUE; + mbMinActivate = sal_True; } mnTaskItem = nItemId-1; ActivateTask(); mnTaskItem = 0; - mbMinActivate = FALSE; + mbMinActivate = sal_False; } } @@ -138,7 +138,7 @@ void TaskToolBox::MouseButtonDown( const MouseEvent& rMEvt ) void TaskToolBox::Resize() { mnOldItemCount = mpItemList->Count(); - mnUpdatePos = (USHORT)mnOldItemCount; + mnUpdatePos = (sal_uInt16)mnOldItemCount; mnUpdateNewPos = TOOLBOX_ITEM_NOTFOUND; ImplFormatTaskToolBox(); ToolBox::Resize(); @@ -150,7 +150,7 @@ void TaskToolBox::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) { - USHORT nItemId = GetItemId( rCEvt.GetMousePosPixel() ); + sal_uInt16 nItemId = GetItemId( rCEvt.GetMousePosPixel() ); // Dies machen wir nicht mehr, da es von zu vielen als stoerend empfunden wurde // ActivateTaskItem( nItemId ); mnTaskItem = nItemId-1; @@ -170,7 +170,7 @@ void TaskToolBox::RequestHelp( const HelpEvent& rHEvt ) { if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) ) { - USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { @@ -199,8 +199,8 @@ void TaskToolBox::RequestHelp( const HelpEvent& rHEvt ) void TaskToolBox::Select() { - USHORT nItemId = GetCurItemId(); - ActivateTaskItem( nItemId, TRUE ); + sal_uInt16 nItemId = GetCurItemId(); + ActivateTaskItem( nItemId, sal_True ); } // ----------------------------------------------------------------------- @@ -211,7 +211,7 @@ void TaskToolBox::ImplFormatTaskToolBox() { // Eintraege aus der Liste entfernen while ( mpItemList->Count() > mnUpdatePos ) - delete mpItemList->Remove( (ULONG)mnUpdatePos ); + delete mpItemList->Remove( (sal_uIntPtr)mnUpdatePos ); mnUpdateNewPos = mnUpdatePos; } @@ -239,14 +239,14 @@ void TaskToolBox::ImplFormatTaskToolBox() } // Eintraege aus der ToolBox entfernen, die ersetzt werden - USHORT nBtnPos = (mnUpdateNewPos*2); + sal_uInt16 nBtnPos = (mnUpdateNewPos*2); while ( nBtnPos < GetItemCount() ) RemoveItem( nBtnPos ); if ( mnUpdateNewPos <= (mnActiveItemId-1) ) mnActiveItemId = 0; // Neue Eintrage einfuegen - USHORT i = mnUpdateNewPos; + sal_uInt16 i = mnUpdateNewPos; while ( i < mpItemList->Count() ) { ImplTaskItem* pItem = mpItemList->GetObject( i ); @@ -270,7 +270,7 @@ void TaskToolBox::ImplFormatTaskToolBox() while ( (nTxtWidth > mnMaxTextWidth) && (aText.Len() > 3) ); } - USHORT nItemId = i+1; + sal_uInt16 nItemId = i+1; if ( aText.EqualsAscii( "..." ) ) InsertItem( nItemId, pItem->maImage, TIB_LEFT ); else @@ -285,7 +285,7 @@ void TaskToolBox::ImplFormatTaskToolBox() if ( mnNewActivePos+1 != mnActiveItemId ) { if ( mnActiveItemId ) - CheckItem( mnActiveItemId, FALSE ); + CheckItem( mnActiveItemId, sal_False ); mnActiveItemId = mnNewActivePos+1; CheckItem( mnActiveItemId ); } @@ -304,7 +304,7 @@ void TaskToolBox::StartUpdateTask() // ----------------------------------------------------------------------- void TaskToolBox::UpdateTask( const Image& rImage, const String& rText, - BOOL bActive ) + sal_Bool bActive ) { ImplTaskItem* pItem = mpItemList->GetObject( mnUpdatePos ); if ( pItem ) @@ -313,7 +313,7 @@ void TaskToolBox::UpdateTask( const Image& rImage, const String& rText, { // Eintraege aus der Liste entfernen while ( mpItemList->Count() > mnUpdatePos ) - delete mpItemList->Remove( (ULONG)mnUpdatePos ); + delete mpItemList->Remove( (sal_uIntPtr)mnUpdatePos ); pItem = NULL; } } @@ -343,7 +343,7 @@ void TaskToolBox::EndUpdateTask() { // Eintraege aus der Liste entfernen while ( mpItemList->Count() > mnUpdatePos ) - delete mpItemList->Remove( (ULONG)mnUpdatePos ); + delete mpItemList->Remove( (sal_uIntPtr)mnUpdatePos ); mnUpdateNewPos = mnUpdatePos; } diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx index 4c9fda217258..ba2254450a96 100644..100755 --- a/svtools/source/control/taskmisc.cxx +++ b/svtools/source/control/taskmisc.cxx @@ -76,9 +76,9 @@ WindowArrange::~WindowArrange() // ----------------------------------------------------------------------- -static USHORT ImplCeilSqareRoot( USHORT nVal ) +static sal_uInt16 ImplCeilSqareRoot( sal_uInt16 nVal ) { - USHORT i; + sal_uInt16 i; // Ueberlauf verhindern if ( nVal > 0xFE * 0xFE ) @@ -106,19 +106,19 @@ static void ImplPosSizeWindow( Window* pWindow, void WindowArrange::ImplTile( const Rectangle& rRect ) { - USHORT nCount = (USHORT)mpWinList->Count(); + sal_uInt16 nCount = (sal_uInt16)mpWinList->Count(); if ( nCount < 3 ) { ImplVert( rRect ); return; } - USHORT i; - USHORT j; - USHORT nCols; - USHORT nRows; - USHORT nActRows; - USHORT nOffset; + sal_uInt16 i; + sal_uInt16 j; + sal_uInt16 nCols; + sal_uInt16 nRows; + sal_uInt16 nActRows; + sal_uInt16 nOffset; long nOverWidth; long nOverHeight; Window* pWindow; @@ -356,7 +356,7 @@ void WindowArrange::ImplCascade( const Rectangle& rRect ) // ----------------------------------------------------------------------- -void WindowArrange::Arrange( USHORT nType, const Rectangle& rRect ) +void WindowArrange::Arrange( sal_uInt16 nType, const Rectangle& rRect ) { if ( !mpWinList->Count() ) return; diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index 2fdab63be37f..4b64a5c27ff3 100644..100755 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -53,7 +53,7 @@ struct ImplTaskSBFldItem { TaskStatusFieldItem maItem; - USHORT mnId; + sal_uInt16 mnId; long mnOffX; }; @@ -61,37 +61,37 @@ DECLARE_LIST( ImplTaskSBItemList, ImplTaskSBFldItem* ) // ======================================================================= -BOOL ITaskStatusNotify::MouseButtonDown( USHORT, const MouseEvent& ) +sal_Bool ITaskStatusNotify::MouseButtonDown( sal_uInt16, const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::MouseButtonUp( USHORT, const MouseEvent& ) +sal_Bool ITaskStatusNotify::MouseButtonUp( sal_uInt16, const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::MouseMove( USHORT, const MouseEvent& ) +sal_Bool ITaskStatusNotify::MouseMove( sal_uInt16, const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::Command( USHORT, const CommandEvent& ) +sal_Bool ITaskStatusNotify::Command( sal_uInt16, const CommandEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ITaskStatusNotify::UpdateHelp( USHORT ) +sal_Bool ITaskStatusNotify::UpdateHelp( sal_uInt16 ) { - return FALSE; + return sal_False; } // ======================================================================= @@ -119,7 +119,7 @@ TaskStatusFieldItem::TaskStatusFieldItem( ITaskStatusNotify* pNotify, const Image& rImage, const XubString& rQuickHelpText, const XubString& rHelpText, - USHORT nFlags ) : + sal_uInt16 nFlags ) : mpNotify( pNotify ), maImage( rImage ), maQuickHelpText( rQuickHelpText ), @@ -159,8 +159,8 @@ TaskStatusBar::TaskStatusBar( Window* pParent, WinBits nWinStyle ) : mnItemWidth = 0; mnFieldWidth = 0; mnFieldFlags = 0; - mbFlashItems = FALSE; - mbOutInterval = FALSE; + mbFlashItems = sal_False; + mbOutInterval = sal_False; maTimer.SetTimeoutHdl( LINK( this, TaskStatusBar, ImplTimerHdl ) ); } @@ -186,9 +186,9 @@ TaskStatusBar::~TaskStatusBar() IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG ) { - BOOL bUpdate = ImplUpdateClock(); + sal_Bool bUpdate = ImplUpdateClock(); if ( ImplUpdateFlashItems() ) - bUpdate = TRUE; + bUpdate = sal_True; if ( bUpdate ) SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL ); @@ -197,7 +197,7 @@ IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG ) // ----------------------------------------------------------------------- -ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const +ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( sal_uInt16 nItemId ) const { if ( !mpFieldItemList ) return NULL; @@ -216,11 +216,11 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const // ----------------------------------------------------------------------- -ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const +ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, sal_Bool& rFieldRect ) const { if ( GetItemId( rPos ) == TASKSTATUSBAR_STATUSFIELDID ) { - rFieldRect = TRUE; + rFieldRect = sal_True; if ( mpFieldItemList ) { @@ -236,14 +236,14 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFi } } else - rFieldRect = FALSE; + rFieldRect = sal_False; return NULL; } // ----------------------------------------------------------------------- -BOOL TaskStatusBar::ImplUpdateClock() +sal_Bool TaskStatusBar::ImplUpdateClock() { if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) { @@ -253,40 +253,40 @@ BOOL TaskStatusBar::ImplUpdateClock() (aTime.GetHour() != maTime.GetHour()) ) { maTime = aTime; - maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, FALSE, FALSE ); - return TRUE; + maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, sal_False, sal_False ); + return sal_True; } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL TaskStatusBar::ImplUpdateFlashItems() +sal_Bool TaskStatusBar::ImplUpdateFlashItems() { if ( mbFlashItems ) { if ( mbOutInterval ) { maTimer.SetTimeout( 900 ); - mbOutInterval = FALSE; + mbOutInterval = sal_False; } else { maTimer.SetTimeout( 700 ); - mbOutInterval = TRUE; + mbOutInterval = sal_True; } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void TaskStatusBar::ImplUpdateField( BOOL bItems ) +void TaskStatusBar::ImplUpdateField( sal_Bool bItems ) { maTimer.Stop(); @@ -294,15 +294,15 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) { ImplTaskSBFldItem* pItem = mpFieldItemList->First(); mnItemWidth = 0; - mbFlashItems = FALSE; - mbOutInterval = FALSE; + mbFlashItems = sal_False; + mbOutInterval = sal_False; while ( pItem ) { mnItemWidth += TASKSTATUSBAR_IMAGEOFFX; pItem->mnOffX = mnItemWidth; mnItemWidth += pItem->maItem.GetImage().GetSizePixel().Width(); if ( pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH ) - mbFlashItems = TRUE; + mbFlashItems = sal_True; pItem = mpFieldItemList->Next(); } @@ -311,7 +311,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) { if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK ) { - XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), FALSE, FALSE ); + XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), sal_False, sal_False ); mnClockWidth = GetTextWidth( aStr )+(TASKSTATUSBAR_CLOCXOFFX*2); } else @@ -329,7 +329,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) { mnFieldWidth = nNewWidth; long nOffset = GetItemOffset( TASKSTATUSBAR_STATUSFIELDID ); - USHORT nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID ); + sal_uInt16 nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID ); InsertItem( TASKSTATUSBAR_STATUSFIELDID, nNewWidth, SIB_RIGHT | SIB_IN | SIB_USERDRAW, nOffset, nItemPos ); } else @@ -344,7 +344,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) if ( mbFlashItems || (mnFieldFlags & TASKSTATUSFIELD_CLOCK) ) { ImplUpdateClock(); - mbOutInterval = TRUE; + mbOutInterval = sal_True; ImplUpdateFlashItems(); maTimer.Start(); } @@ -354,12 +354,12 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems ) void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -381,12 +381,12 @@ void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt ) void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -408,12 +408,12 @@ void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt ) void TaskStatusBar::MouseMove( const MouseEvent& rMEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -435,12 +435,12 @@ void TaskStatusBar::MouseMove( const MouseEvent& rMEvt ) void TaskStatusBar::Command( const CommandEvent& rCEvt ) { - BOOL bFieldRect; - BOOL bBaseClass = FALSE; + sal_Bool bFieldRect; + sal_Bool bBaseClass = sal_False; ImplTaskSBFldItem* pItem = ImplGetFieldItem( rCEvt.GetMousePosPixel(), bFieldRect ); ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( bFieldRect ) nItemId = TASKSTATUSBAR_CLOCKID; @@ -462,12 +462,12 @@ void TaskStatusBar::Command( const CommandEvent& rCEvt ) void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) { - BOOL bFieldRect; + sal_Bool bFieldRect; ImplTaskSBFldItem* pItem = ImplGetFieldItem( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), bFieldRect ); if ( bFieldRect ) { ITaskStatusNotify* pNotify = mpNotify; - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if ( pItem ) { @@ -517,7 +517,7 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) { if ( pItem ) { - ULONG nHelpId = pItem->maItem.GetHelpId(); + sal_uIntPtr nHelpId = pItem->maItem.GetHelpId(); if ( nHelpId ) { // Wenn eine Hilfe existiert, dann ausloesen @@ -574,28 +574,28 @@ void TaskStatusBar::UserDraw( const UserDrawEvent& rUDEvt ) // ----------------------------------------------------------------------- -void TaskStatusBar::InsertStatusField( long, USHORT, - USHORT nFlags ) +void TaskStatusBar::InsertStatusField( long, sal_uInt16, + sal_uInt16 nFlags ) { mnFieldFlags = nFlags; - ImplUpdateField( FALSE ); + ImplUpdateField( sal_False ); } // ----------------------------------------------------------------------- -void TaskStatusBar::SetFieldFlags( USHORT nFlags ) +void TaskStatusBar::SetFieldFlags( sal_uInt16 nFlags ) { if ( mnFieldFlags != nFlags ) { mnFieldFlags = nFlags; - ImplUpdateField( FALSE ); + ImplUpdateField( sal_False ); } } // ----------------------------------------------------------------------- -void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem, - USHORT nPos ) +void TaskStatusBar::AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem, + sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "TaskStatusBar::AddStatusFieldItem() - Item is 0" ); DBG_ASSERT( !ImplGetFieldItem( nItemId ), "TaskStatusBar::AddStatusFieldItem() - Item-Id already exist" ); @@ -607,50 +607,50 @@ void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldIte pItem->maItem = rItem; pItem->mnId = nItemId; pItem->mnOffX = 0; - mpFieldItemList->Insert( pItem, (ULONG)nPos ); + mpFieldItemList->Insert( pItem, (sal_uIntPtr)nPos ); - ImplUpdateField( TRUE ); + ImplUpdateField( sal_True ); } // ----------------------------------------------------------------------- -void TaskStatusBar::ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem ) +void TaskStatusBar::ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem ) { ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); if ( pItem ) { - BOOL bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) || + sal_Bool bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) || (pItem->maItem.GetFlags() != rItem.GetFlags()); pItem->maItem = rItem; if ( bUpdate ) - ImplUpdateField( TRUE ); + ImplUpdateField( sal_True ); } } // ----------------------------------------------------------------------- -void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId ) +void TaskStatusBar::RemoveStatusFieldItem( sal_uInt16 nItemId ) { ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); if ( pItem ) { mpFieldItemList->Remove( pItem ); delete pItem; - ImplUpdateField( TRUE ); + ImplUpdateField( sal_True ); } } // ----------------------------------------------------------------------- -BOOL TaskStatusBar::GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const +sal_Bool TaskStatusBar::GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const { ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); if ( pItem ) { rItem = pItem->maItem; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index f07ebd7fe8cd..2dfc54f4ef54 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -163,7 +163,7 @@ const Reference< XAccessibleContext >& ToolbarMenuEntry::GetAccessible( bool bCr { if( mpControl ) { - mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( TRUE ), UNO_QUERY ); + mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( sal_True ), UNO_QUERY ); } else { @@ -842,7 +842,7 @@ void ToolbarMenu::appendSeparator() ValueSet* ToolbarMenu::createEmptyValueSetControl() { ValueSet* pSet = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); - pSet->EnableFullItemMode( FALSE ); + pSet->EnableFullItemMode( sal_False ); pSet->SetColor( GetControlBackground() ); pSet->SetHighlightHdl( LINK( this, ToolbarMenu, HighlightHdl ) ); return pSet; @@ -926,7 +926,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) { bDrawItemRect = false; - if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, + if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, Region( aItemRect ), CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ), ImplControlValue(), @@ -1016,7 +1016,7 @@ void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown ) Size aOutSz = GetOutputSizePixel(); if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) ) { - bool bHighlighted = FALSE; + bool bHighlighted = sal_False; const int nEntryCount = mpImpl->maEntryVector.size(); int nEntry; @@ -1091,11 +1091,11 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl ); if( pValueSet ) { - USHORT nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() ); + sal_uInt16 nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() ); if( nItemPos != VALUESET_ITEM_NOTFOUND ) { - const USHORT nColCount = pValueSet->GetColCount(); - const USHORT nLine = nItemPos / nColCount; + const sal_uInt16 nColCount = pValueSet->GetColCount(); + const sal_uInt16 nLine = nItemPos / nColCount; nLastColumn = nItemPos - (nLine * nColCount); @@ -1105,7 +1105,7 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa } else { - const USHORT nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount; + const sal_uInt16 nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount; return (nLine+1) < nLineCount; } } @@ -1194,19 +1194,19 @@ ToolbarMenuEntry* ToolbarMenu::implCursorUpDown( bool bUp, bool bHomeEnd ) // -------------------------------------------------------------------- -void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl ) +void ToolbarMenu_Impl::implHighlightControl( sal_uInt16 nCode, Control* pControl ) { ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl ); if( pValueSet ) { - const USHORT nItemCount = pValueSet->GetItemCount(); - USHORT nItemPos = VALUESET_ITEM_NOTFOUND; + const sal_uInt16 nItemCount = pValueSet->GetItemCount(); + sal_uInt16 nItemPos = VALUESET_ITEM_NOTFOUND; switch( nCode ) { case KEY_UP: { - const USHORT nColCount = pValueSet->GetColCount(); - const USHORT nLastLine = nItemCount / nColCount; + const sal_uInt16 nColCount = pValueSet->GetColCount(); + const sal_uInt16 nLastLine = nItemCount / nColCount; nItemPos = std::min( ((nLastLine-1) * nColCount) + mnLastColumn, nItemCount-1 ); break; } @@ -1230,7 +1230,7 @@ void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl ) void ToolbarMenu::KeyInput( const KeyEvent& rKEvent ) { Control* pForwardControl = 0; - USHORT nCode = rKEvent.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); switch ( nCode ) { case KEY_UP: @@ -1307,7 +1307,7 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent ) // -------------------------------------------------------------------- static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight ) { - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; @@ -1325,7 +1325,7 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec { const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings(); Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() ); - i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor ); + i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor ); } } @@ -1375,7 +1375,7 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) { - USHORT nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu + sal_uInt16 nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu long nFontHeight = GetTextHeight(); // long nExtra = nFontHeight/4; @@ -1425,9 +1425,9 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) { long nTextOffsetY = ((pEntry->maSize.Height()-nFontHeight)/2); - USHORT nTextStyle = 0; - USHORT nSymbolStyle = 0; - USHORT nImageStyle = 0; + sal_uInt16 nTextStyle = 0; + sal_uInt16 nSymbolStyle = 0; + sal_uInt16 nImageStyle = 0; if( !pEntry->mbEnabled ) { @@ -1538,7 +1538,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) aTmpPos.X() = aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos); aTmpPos.Y() = aPos.Y(); aTmpPos.Y() += nTextOffsetY; - USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; + sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; DrawCtrlText( aTmpPos, pEntry->maText, 0, pEntry->maText.Len(), nStyle, NULL, NULL ); // pVector, pDisplayText ); } diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 020467084748..9ffc4fc55f04 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -213,7 +213,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getAccessibleIndexInParent() throw (RuntimeEx Window* pParent = mpParent->mrMenu.GetParent(); if( pParent ) { - for( USHORT i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ ) + for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ ) { if( pParent->GetChild( i ) == &mpParent->mrMenu ) return i; @@ -473,7 +473,7 @@ Any SAL_CALL ToolbarMenuAcc::getAccessibleKeyBinding() throw (RuntimeException) sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -482,7 +482,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException) sal_Int32 SAL_CALL ToolbarMenuAcc::getBackground() throw (RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor(); return static_cast<sal_Int32>(nColor); } diff --git a/svtools/source/control/toolbarmenuimp.hxx b/svtools/source/control/toolbarmenuimp.hxx index d1de4f704b76..a190fd9f205d 100644 --- a/svtools/source/control/toolbarmenuimp.hxx +++ b/svtools/source/control/toolbarmenuimp.hxx @@ -308,7 +308,7 @@ struct ToolbarMenu_Impl ToolbarMenuEntry* implGetEntry( int nEntry ) const; void notifyHighlightedEntry(); - void implHighlightControl( USHORT nCode, Control* pControl ); + void implHighlightControl( sal_uInt16 nCode, Control* pControl ); }; } diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 66da5636d89c..848ef4c3e10e 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -225,7 +225,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); uno::Reference< accessibility::XAccessible > xRet; - ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(i)); + ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(i)); if( pItem ) xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled ); @@ -265,7 +265,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getAccessibleIndexInParent() { sal_Bool bFound = sal_False; - for( USHORT i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ ) + for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ ) { if( pParent->GetChild( i ) == mpParent ) { @@ -450,12 +450,12 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible { ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - const USHORT nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) ); + const sal_uInt16 nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) ); uno::Reference< accessibility::XAccessible > xRet; if( VALUESET_ITEM_NOTFOUND != nItemId ) { - const USHORT nItemPos = mpParent->GetItemPos( nItemId ); + const sal_uInt16 nItemPos = mpParent->GetItemPos( nItemId ); if( VALUESET_ITEM_NONEITEM != nItemPos ) { @@ -559,7 +559,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getForeground( ) throw (uno::RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -569,7 +569,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getBackground( ) throw (uno::RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -580,7 +580,7 @@ void SAL_CALL ValueSetAcc::selectAccessibleChild( sal_Int32 nChildIndex ) { ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex)); + ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex)); if(pItem != NULL) { @@ -598,7 +598,7 @@ sal_Bool SAL_CALL ValueSetAcc::isAccessibleChildSelected( sal_Int32 nChildIndex { ThrowIfDisposed(); const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex)); + ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex)); sal_Bool bRet = sal_False; if (pItem != NULL) @@ -637,7 +637,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getSelectedAccessibleChildCount() const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); sal_Int32 nRet = 0; - for( USHORT i = 0, nCount = getItemCount(); i < nCount; i++ ) + for( sal_uInt16 i = 0, nCount = getItemCount(); i < nCount; i++ ) { ValueSetItem* pItem = getItem (i); @@ -657,7 +657,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getSelectedAc const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); uno::Reference< accessibility::XAccessible > xRet; - for( USHORT i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ ) + for( sal_uInt16 i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ ) { ValueSetItem* pItem = getItem(i); @@ -734,9 +734,9 @@ void SAL_CALL ValueSetAcc::disposing (void) } -USHORT ValueSetAcc::getItemCount (void) const +sal_uInt16 ValueSetAcc::getItemCount (void) const { - USHORT nCount = mpParent->ImplGetVisibleItemCount(); + sal_uInt16 nCount = mpParent->ImplGetVisibleItemCount(); // When the None-Item is visible then increase the number of items by // one. if (HasNoneField()) @@ -745,7 +745,7 @@ USHORT ValueSetAcc::getItemCount (void) const } -ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const +ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) const { ValueSetItem* pItem = NULL; @@ -759,7 +759,7 @@ ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const nIndex -= 1; } if (pItem == NULL) - pItem = mpParent->ImplGetVisibleItem (static_cast<USHORT>(nIndex)); + pItem = mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex)); return pItem; } @@ -935,9 +935,9 @@ sal_Int32 SAL_CALL ValueItemAcc::getAccessibleIndexInParent() { bool bDone = false; - USHORT nCount = mpParent->mrParent.ImplGetVisibleItemCount(); + sal_uInt16 nCount = mpParent->mrParent.ImplGetVisibleItemCount(); ValueSetItem* pItem; - for (USHORT i=0; i<nCount && !bDone; i++) + for (sal_uInt16 i=0; i<nCount && !bDone; i++) { // Guard the retrieval of the i-th child with a try/catch block // just in case the number of children changes in the mean time. @@ -1226,7 +1226,7 @@ uno::Any SAL_CALL ValueItemAcc::getAccessibleKeyBinding() sal_Int32 SAL_CALL ValueItemAcc::getForeground( ) throw (uno::RuntimeException) { - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -1235,7 +1235,7 @@ sal_Int32 SAL_CALL ValueItemAcc::getForeground( ) sal_Int32 SAL_CALL ValueItemAcc::getBackground( ) throw (uno::RuntimeException) { - UINT32 nColor; + sal_uInt32 nColor; if (mpParent && mpParent->meType == VALUESETITEM_COLOR) nColor = mpParent->maColor.GetColor(); else diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx index abde4a015ab8..bc5252372be9 100755 --- a/svtools/source/control/valueimp.hxx +++ b/svtools/source/control/valueimp.hxx @@ -83,8 +83,8 @@ class ValueSet; struct ValueSetItem { ValueSet& mrParent; - USHORT mnId; - USHORT mnBits; + sal_uInt16 mnId; + sal_uInt16 mnBits; ValueSetItemType meType; Image maImage; Color maColor; @@ -142,7 +142,7 @@ public: ~ValueSetAcc(); void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ); - BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } + sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } static ValueSetAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw(); @@ -222,7 +222,7 @@ private: /** Return the number of items. This takes the None-Item into account. */ - USHORT getItemCount (void) const; + sal_uInt16 getItemCount (void) const; /** Return the item associated with the given index. The None-Item is taken into account which, when present, is taken to be the first @@ -233,7 +233,7 @@ private: @return Returns NULL when the given index is out of range. */ - ValueSetItem* getItem (USHORT nIndex) const; + ValueSetItem* getItem (sal_uInt16 nIndex) const; /** Check whether or not the object has been disposed (or is in the state of beeing disposed). If that is the case then @@ -288,7 +288,7 @@ public: void ParentDestroyed(); void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ); - BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } + sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } static ValueItemAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw(); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 62193eadf735..411539f20b8d 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -74,21 +74,21 @@ void ValueSet::ImplInit() mnUserVisLines = 0; mnSpacing = 0; mnFrameStyle = 0; - mbFormat = TRUE; - mbHighlight = FALSE ; - mbSelection = FALSE; - mbNoSelection = TRUE; - mbDrawSelection = TRUE; - mbBlackSel = FALSE; - mbDoubleSel = FALSE; - mbScroll = FALSE; - mbDropPos = FALSE; - mbFullMode = TRUE; + mbFormat = sal_True; + mbHighlight = sal_False ; + mbSelection = sal_False; + mbNoSelection = sal_True; + mbDrawSelection = sal_True; + mbBlackSel = sal_False; + mbDoubleSel = sal_False; + mbScroll = sal_False; + mbDropPos = sal_False; + mbFullMode = sal_True; // #106446#, #106601# force mirroring of virtual device maVirDev.EnableRTL( GetParent()->IsRTLEnabled() ); - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -120,7 +120,7 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient ValueSet::~ValueSet() { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> - xComponent (GetAccessible(FALSE), ::com::sun::star::uno::UNO_QUERY); + xComponent (GetAccessible(sal_False), ::com::sun::star::uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose (); @@ -156,8 +156,8 @@ void ValueSet::ImplDeleteItems() // ----------------------------------------------------------------------- -void ValueSet::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void ValueSet::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -315,7 +315,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem ) aPos.X() += (aRectSize.Width()-aImageSize.Width())/2; aPos.Y() += (aRectSize.Height()-aImageSize.Height())/2; - USHORT nImageStyle = 0; + sal_uInt16 nImageStyle = 0; if( !IsEnabled() ) nImageStyle |= IMAGE_DRAW_DISABLE; @@ -345,7 +345,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem ) void ValueSet::Format() { Size aWinSize = GetOutputSizePixel(); - ULONG nItemCount = mpImpl->mpItemList->Count(); + sal_uIntPtr nItemCount = mpImpl->mpItemList->Count(); WinBits nStyle = GetStyle(); long nTxtHeight = GetTextHeight(); long nOff; @@ -425,7 +425,7 @@ void ValueSet::Format() { if ( mnUserItemWidth ) { - mnCols = (USHORT)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace)); + mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace)); if ( !mnCols ) mnCols = 1; } @@ -436,7 +436,7 @@ void ValueSet::Format() mnCols = mnUserCols; // Zeilenanzahl berechnen - mbScroll = FALSE; + mbScroll = sal_False; mnLines = (long)mpImpl->mpItemList->Count() / mnCols; if ( mpImpl->mpItemList->Count() % mnCols ) mnLines++; @@ -455,13 +455,13 @@ void ValueSet::Format() else mnVisLines = mnLines; if ( mnLines > mnVisLines ) - mbScroll = TRUE; + mbScroll = sal_True; if ( mnLines <= mnVisLines ) mnFirstLine = 0; else { - if ( mnFirstLine > (USHORT)(mnLines-mnVisLines) ) - mnFirstLine = (USHORT)(mnLines-mnVisLines); + if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) ) + mnFirstLine = (sal_uInt16)(mnLines-mnVisLines); } // Itemgroessen berechnen @@ -492,7 +492,7 @@ void ValueSet::Format() // Init VirDev maVirDev.SetSettings( GetSettings() ); maVirDev.SetBackground( GetBackground() ); - maVirDev.SetOutputSizePixel( aWinSize, TRUE ); + maVirDev.SetOutputSizePixel( aWinSize, sal_True ); // Bei zu kleinen Items machen wir nichts long nMinHeight = 2; @@ -509,7 +509,7 @@ void ValueSet::Format() } } - for ( ULONG i = 0; i < nItemCount; i++ ) + for ( sal_uIntPtr i = 0; i < nItemCount; i++ ) { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( i ); pItem->maRect.SetEmpty(); @@ -535,17 +535,17 @@ void ValueSet::Format() (aHighColor.GetBlue() > 0x80)) || ((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) && (aHighColor.GetBlue() == 0x80)) ) - mbBlackSel = TRUE; + mbBlackSel = sal_True; else - mbBlackSel = FALSE; + mbBlackSel = sal_False; // Wenn die Items groesser sind, dann die Selektion doppelt so breit // zeichnen if ( (nStyle & WB_DOUBLEBORDER) && ((nItemWidth >= 25) && (nItemHeight >= 20)) ) - mbDoubleSel = TRUE; + mbDoubleSel = sal_True; else - mbDoubleSel = FALSE; + mbDoubleSel = sal_False; // Calculate offsets long nStartX; @@ -587,8 +587,8 @@ void ValueSet::Format() } // draw items - ULONG nFirstItem = mnFirstLine * mnCols; - ULONG nLastItem = nFirstItem + (mnVisLines * mnCols); + sal_uIntPtr nFirstItem = mnFirstLine * mnCols; + sal_uIntPtr nLastItem = nFirstItem + (mnVisLines * mnCols); if ( !mbFullMode ) { @@ -598,13 +598,13 @@ void ValueSet::Format() if ( y+(mnVisLines*(nItemHeight+nSpace)) < aWinSize.Height() ) nLastItem += mnCols; } - for ( ULONG i = 0; i < nItemCount; i++ ) + for ( sal_uIntPtr i = 0; i < nItemCount; i++ ) { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( i ); if ( (i >= nFirstItem) && (i < nLastItem) ) { - const BOOL bWasEmpty = pItem->maRect.IsEmpty(); + const sal_Bool bWasEmpty = pItem->maRect.IsEmpty(); pItem->maRect.Left() = x; pItem->maRect.Top() = y; @@ -667,7 +667,7 @@ void ValueSet::Format() } // Jetzt haben wir formatiert und warten auf das naechste - mbFormat = FALSE; + mbFormat = sal_False; // ScrollBar loeschen if ( pDelScrBar ) @@ -709,13 +709,13 @@ void ValueSet::ImplDrawSelect() if ( !IsReallyVisible() ) return; - BOOL bFocus = HasFocus(); - BOOL bDrawSel; + sal_Bool bFocus = HasFocus(); + sal_Bool bDrawSel; if ( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) ) - bDrawSel = FALSE; + bDrawSel = sal_False; else - bDrawSel = TRUE; + bDrawSel = sal_True; if ( !bFocus && ((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight)) ) @@ -725,7 +725,7 @@ void ValueSet::ImplDrawSelect() return; } - USHORT nItemId = mnSelItemId; + sal_uInt16 nItemId = mnSelItemId; for( int stage = 0; stage < 2; stage++ ) { @@ -898,12 +898,12 @@ void ValueSet::ImplDrawSelect() // ----------------------------------------------------------------------- -void ValueSet::ImplHideSelect( USHORT nItemId ) +void ValueSet::ImplHideSelect( sal_uInt16 nItemId ) { Rectangle aRect; - USHORT nItemPos = GetItemPos( nItemId ); - if ( nItemPos != sal::static_int_cast<USHORT>(LIST_ENTRY_NOTFOUND) ) + sal_uInt16 nItemPos = GetItemPos( nItemId ); + if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) ) aRect = mpImpl->mpItemList->GetObject( nItemPos )->maRect; else { @@ -922,42 +922,42 @@ void ValueSet::ImplHideSelect( USHORT nItemId ) // ----------------------------------------------------------------------- -void ValueSet::ImplHighlightItem( USHORT nItemId, BOOL bIsSelection ) +void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection ) { if ( mnHighItemId != nItemId ) { // Alten merken, um vorherige Selektion zu entfernen - USHORT nOldItem = mnHighItemId; + sal_uInt16 nOldItem = mnHighItemId; mnHighItemId = nItemId; // Wenn keiner selektiert ist, dann Selektion nicht malen if ( !bIsSelection && mbNoSelection ) - mbDrawSelection = FALSE; + mbDrawSelection = sal_False; // Neu ausgeben und alte Selection wegnehmen ImplHideSelect( nOldItem ); ImplDrawSelect(); - mbDrawSelection = TRUE; + mbDrawSelection = sal_True; } } // ----------------------------------------------------------------------- -void ValueSet::ImplDrawDropPos( BOOL bShow ) +void ValueSet::ImplDrawDropPos( sal_Bool bShow ) { if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && mpImpl->mpItemList->Count() ) { - USHORT nItemPos = mnDropPos; - USHORT nItemId1; - USHORT nItemId2 = 0; - BOOL bRight; + sal_uInt16 nItemPos = mnDropPos; + sal_uInt16 nItemId1; + sal_uInt16 nItemId2 = 0; + sal_Bool bRight; if ( nItemPos >= mpImpl->mpItemList->Count() ) { - nItemPos = (USHORT)(mpImpl->mpItemList->Count()-1); - bRight = TRUE; + nItemPos = (sal_uInt16)(mpImpl->mpItemList->Count()-1); + bRight = sal_True; } else - bRight = FALSE; + bRight = sal_False; nItemId1 = GetItemId( nItemPos ); if ( (nItemId1 != mnSelItemId) && (nItemId1 != mnHighItemId) ) @@ -996,7 +996,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow ) Point aPos = aRect1.RightCenter(); nX = aPos.X()-2; nY = aPos.Y(); - for ( USHORT i = 0; i < 4; i++ ) + for ( sal_uInt16 i = 0; i < 4; i++ ) DrawLine( Point( nX-i, nY-i ), Point( nX-i, nY+i ) ); } if ( !aRect2.IsEmpty() ) @@ -1004,7 +1004,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow ) Point aPos = aRect2.LeftCenter(); nX = aPos.X()+2; nY = aPos.Y(); - for ( USHORT i = 0; i < 4; i++ ) + for ( sal_uInt16 i = 0; i < 4; i++ ) DrawLine( Point( nX+i, nY-i ), Point( nX+i, nY+i ) ); } } @@ -1089,7 +1089,7 @@ void ValueSet::ImplDraw() // ----------------------------------------------------------------------- -BOOL ValueSet::ImplScroll( const Point& rPos ) +sal_Bool ValueSet::ImplScroll( const Point& rPos ) { Size aOutSize = GetOutputSizePixel(); long nScrBarWidth; @@ -1100,10 +1100,10 @@ BOOL ValueSet::ImplScroll( const Point& rPos ) nScrBarWidth = 0; if ( !mbScroll || (rPos.X() < 0) || (rPos.X() > aOutSize.Width()-nScrBarWidth) ) - return FALSE; + return sal_False; long nScrollOffset; - USHORT nOldLine = mnFirstLine; + sal_uInt16 nOldLine = mnFirstLine; const Rectangle& rTopRect = mpImpl->mpItemList->GetObject( mnFirstLine*mnCols )->maRect; if ( rTopRect.GetHeight() <= 16 ) nScrollOffset = VALUESET_SCROLL_OFFSET/2; @@ -1116,7 +1116,7 @@ BOOL ValueSet::ImplScroll( const Point& rPos ) mnFirstLine--; } if ( (mnFirstLine == nOldLine) && - (mnFirstLine < (USHORT)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) ) + (mnFirstLine < (sal_uInt16)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) ) { long nBottomPos = mpImpl->mpItemList->GetObject( (mnFirstLine+mnVisLines-1)*mnCols )->maRect.Bottom(); if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) ) @@ -1125,17 +1125,17 @@ BOOL ValueSet::ImplScroll( const Point& rPos ) if ( mnFirstLine != nOldLine ) { - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const +sal_uInt16 ValueSet::ImplGetItem( const Point& rPos, sal_Bool bMove ) const { if ( mpNoneItem ) { @@ -1146,14 +1146,14 @@ USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const Point aDefPos; Rectangle aWinRect( aDefPos, maVirDev.GetOutputSizePixel() ); - ULONG nItemCount = mpImpl->mpItemList->Count(); - for ( ULONG i = 0; i < nItemCount; i++ ) + sal_uIntPtr nItemCount = mpImpl->mpItemList->Count(); + for ( sal_uIntPtr i = 0; i < nItemCount; i++ ) { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( i ); if ( pItem->maRect.IsInside( rPos ) ) { if ( aWinRect.IsInside( rPos ) ) - return (USHORT)i; + return (sal_uInt16)i; else return VALUESET_ITEM_NOTFOUND; } @@ -1173,7 +1173,7 @@ USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const // ----------------------------------------------------------------------- -ValueSetItem* ValueSet::ImplGetItem( USHORT nPos ) +ValueSetItem* ValueSet::ImplGetItem( sal_uInt16 nPos ) { if ( nPos == VALUESET_ITEM_NONEITEM ) return mpNoneItem; @@ -1185,8 +1185,8 @@ ValueSetItem* ValueSet::ImplGetItem( USHORT nPos ) ValueSetItem* ValueSet::ImplGetFirstItem() { - USHORT nItemCount = (USHORT)mpImpl->mpItemList->Count(); - USHORT i = 0; + sal_uInt16 nItemCount = (sal_uInt16)mpImpl->mpItemList->Count(); + sal_uInt16 i = 0; while ( i < nItemCount ) { @@ -1201,9 +1201,9 @@ ValueSetItem* ValueSet::ImplGetFirstItem() // ----------------------------------------------------------------------- -USHORT ValueSet::ImplGetVisibleItemCount() const +sal_uInt16 ValueSet::ImplGetVisibleItemCount() const { - USHORT nRet = 0; + sal_uInt16 nRet = 0; for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->Count(); n < nItemCount; n++ ) { @@ -1218,10 +1218,10 @@ USHORT ValueSet::ImplGetVisibleItemCount() const // ----------------------------------------------------------------------- -ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos ) +ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 nVisiblePos ) { ValueSetItem* pRet = NULL; - USHORT nFoundPos = 0; + sal_uInt16 nFoundPos = 0; for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->Count(); ( n < nItemCount ) && !pRet; n++ ) { @@ -1238,7 +1238,7 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos ) void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ) { - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); if( pAcc ) pAcc->FireAccessibleEvent( nEventId, rOldValue, rNewValue ); @@ -1246,9 +1246,9 @@ void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star:: // ----------------------------------------------------------------------- -BOOL ValueSet::ImplHasAccessibleListeners() +sal_Bool ValueSet::ImplHasAccessibleListeners() { - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); return( pAcc && pAcc->HasAccessibleListeners() ); } @@ -1256,11 +1256,11 @@ BOOL ValueSet::ImplHasAccessibleListeners() IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar ) { - USHORT nNewFirstLine = (USHORT)pScrollBar->GetThumbPos(); + sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos(); if ( nNewFirstLine != mnFirstLine ) { mnFirstLine = nNewFirstLine; - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); } return 0; @@ -1270,13 +1270,13 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar ) IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG ) { - ImplTracking( GetPointerPosPixel(), TRUE ); + ImplTracking( GetPointerPosPixel(), sal_True ); return 0; } // ----------------------------------------------------------------------- -void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat ) +void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat ) { if ( bRepeat || mbSelection ) { @@ -1295,22 +1295,22 @@ void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat ) if ( pItem && (pItem->meType != VALUESETITEM_SPACE) ) { if( GetStyle() & WB_MENUSTYLEVALUESET ) - mbHighlight = TRUE; + mbHighlight = sal_True; ImplHighlightItem( pItem->mnId ); } else { if( GetStyle() & WB_MENUSTYLEVALUESET ) - mbHighlight = TRUE; + mbHighlight = sal_True; - ImplHighlightItem( mnSelItemId, FALSE ); + ImplHighlightItem( mnSelItemId, sal_False ); } } // ----------------------------------------------------------------------- -void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel ) +void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel ) { ValueSetItem* pItem; @@ -1325,15 +1325,15 @@ void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel ) SelectItem( pItem->mnId ); if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) ) GrabFocus(); - mbHighlight = FALSE; - mbSelection = FALSE; + mbHighlight = sal_False; + mbSelection = sal_False; Select(); } else { - ImplHighlightItem( mnSelItemId, FALSE ); - mbHighlight = FALSE; - mbSelection = FALSE; + ImplHighlightItem( mnSelItemId, sal_False ); + mbHighlight = sal_False; + mbSelection = sal_False; } } @@ -1346,7 +1346,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt ) ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) ); if ( mbSelection ) { - mbHighlight = TRUE; + mbHighlight = sal_True; if ( pItem && (pItem->meType != VALUESETITEM_SPACE) ) { mnOldItemId = mnSelItemId; @@ -1363,7 +1363,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt ) if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) ) { mnOldItemId = mnSelItemId; - mbHighlight = TRUE; + mbHighlight = sal_True; mnHighItemId = mnSelItemId; ImplHighlightItem( pItem->mnId ); StartTracking( STARTTRACK_SCROLLREPEAT ); @@ -1385,7 +1385,7 @@ void ValueSet::MouseButtonUp( const MouseEvent& rMEvt ) { // Wegen SelectionMode if ( rMEvt.IsLeft() && mbSelection ) - ImplEndTracking( rMEvt.GetPosPixel(), FALSE ); + ImplEndTracking( rMEvt.GetPosPixel(), sal_False ); else Control::MouseButtonUp( rMEvt ); } @@ -1396,7 +1396,7 @@ void ValueSet::MouseMove( const MouseEvent& rMEvt ) { // Wegen SelectionMode if ( mbSelection || (GetStyle() & WB_MENUSTYLEVALUESET) ) - ImplTracking( rMEvt.GetPosPixel(), FALSE ); + ImplTracking( rMEvt.GetPosPixel(), sal_False ); Control::MouseMove( rMEvt ); } @@ -1416,10 +1416,10 @@ void ValueSet::Tracking( const TrackingEvent& rTEvt ) void ValueSet::KeyInput( const KeyEvent& rKEvt ) { - USHORT nLastItem = (USHORT)mpImpl->mpItemList->Count(); - USHORT nItemPos = VALUESET_ITEM_NOTFOUND; - USHORT nCurPos = VALUESET_ITEM_NONEITEM; - USHORT nCalcPos; + sal_uInt16 nLastItem = (sal_uInt16)mpImpl->mpItemList->Count(); + sal_uInt16 nItemPos = VALUESET_ITEM_NOTFOUND; + sal_uInt16 nCurPos = VALUESET_ITEM_NONEITEM; + sal_uInt16 nCalcPos; if ( !nLastItem || !ImplGetFirstItem() ) { @@ -1434,7 +1434,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) nCalcPos = nCurPos; //switch off selection mode if key travelling is used - BOOL bDefault = FALSE; + sal_Bool bDefault = sal_False; switch ( rKEvt.GetKeyCode().GetCode() ) { case KEY_HOME: @@ -1522,7 +1522,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) } } else if ( nCalcPos >= ( nLineCount * mnCols ) ) - nItemPos = sal::static_int_cast< USHORT >( + nItemPos = sal::static_int_cast< sal_uInt16 >( nCalcPos - ( nLineCount * mnCols )); else { @@ -1564,7 +1564,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) if ( nCalcPos == VALUESET_ITEM_NONEITEM ) nItemPos = mnCurCol; else if ( nCalcPos + ( nLineCount * mnCols ) <= nLastItem ) - nItemPos = sal::static_int_cast< USHORT >( + nItemPos = sal::static_int_cast< sal_uInt16 >( nCalcPos + ( nLineCount * mnCols )); else { @@ -1607,14 +1607,14 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) //no break; default: Control::KeyInput( rKEvt ); - bDefault = TRUE; + bDefault = sal_True; break; } if(!bDefault) EndSelection(); if ( nItemPos != VALUESET_ITEM_NOTFOUND ) { - USHORT nItemId; + sal_uInt16 nItemId; if ( nItemPos != VALUESET_ITEM_NONEITEM ) nItemId = GetItemId( nItemPos ); else @@ -1671,7 +1671,7 @@ void ValueSet::GetFocus() Control::GetFocus(); // Tell the accessible object that we got the focus. - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); if( pAcc ) pAcc->GetFocus(); } @@ -1688,7 +1688,7 @@ void ValueSet::LoseFocus() Control::LoseFocus(); // Tell the accessible object that we lost the focus. - ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) ); + ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) ); if( pAcc ) pAcc->LoseFocus(); } @@ -1697,7 +1697,7 @@ void ValueSet::LoseFocus() void ValueSet::Resize() { - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); Control::Resize(); @@ -1710,7 +1710,7 @@ void ValueSet::RequestHelp( const HelpEvent& rHEvt ) if ( (rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON)) == HELPMODE_QUICK ) { Point aPos = ScreenToOutputPixel( rHEvt.GetMousePosPixel() ); - USHORT nItemPos = ImplGetItem( aPos ); + sal_uInt16 nItemPos = ImplGetItem( aPos ); if ( nItemPos != VALUESET_ITEM_NOTFOUND ) { ValueSetItem* pItem = ImplGetItem( nItemPos ); @@ -1756,23 +1756,23 @@ void ValueSet::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) ) { - mbFormat = TRUE; - ImplInitSettings( FALSE, FALSE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -1789,8 +1789,8 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - mbFormat = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } @@ -1817,7 +1817,7 @@ void ValueSet::UserDraw( const UserDrawEvent& ) // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1827,16 +1827,16 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, USHORT nPos ) pItem->mnId = nItemId; pItem->meType = VALUESETITEM_IMAGE; pItem->maImage = rImage; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uIntPtr)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1846,17 +1846,17 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, USHORT nPos ) pItem->mnId = nItemId; pItem->meType = VALUESETITEM_COLOR; pItem->maColor = rColor; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uIntPtr)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, - const XubString& rText, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, + const XubString& rText, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1867,17 +1867,17 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, pItem->meType = VALUESETITEM_IMAGE; pItem->maImage = rImage; pItem->maText = rText; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uIntPtr)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, - const XubString& rText, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, + const XubString& rText, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1888,16 +1888,16 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, pItem->meType = VALUESETITEM_COLOR; pItem->maColor = rColor; pItem->maText = rText; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uIntPtr)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertItem( USHORT nItemId, USHORT nPos ) +void ValueSet::InsertItem( sal_uInt16 nItemId, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1906,16 +1906,16 @@ void ValueSet::InsertItem( USHORT nItemId, USHORT nPos ) ValueSetItem* pItem = new ValueSetItem( *this ); pItem->mnId = nItemId; pItem->meType = VALUESETITEM_USERDRAW; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uIntPtr)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::InsertSpace( USHORT nItemId, USHORT nPos ) +void ValueSet::InsertSpace( sal_uInt16 nItemId, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, @@ -1924,18 +1924,18 @@ void ValueSet::InsertSpace( USHORT nItemId, USHORT nPos ) ValueSetItem* pItem = new ValueSetItem( *this ); pItem->mnId = nItemId; pItem->meType = VALUESETITEM_SPACE; - mpImpl->mpItemList->Insert( pItem, (ULONG)nPos ); + mpImpl->mpItemList->Insert( pItem, (sal_uIntPtr)nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -void ValueSet::RemoveItem( USHORT nItemId ) +void ValueSet::RemoveItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -1949,10 +1949,10 @@ void ValueSet::RemoveItem( USHORT nItemId ) mnOldItemId = 0; mnHighItemId = 0; mnSelItemId = 0; - mbNoSelection = TRUE; + mbNoSelection = sal_True; } - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -1988,9 +1988,9 @@ void ValueSet::CopyItems( const ValueSet& rValueSet ) mnOldItemId = 0; mnHighItemId = 0; mnSelItemId = 0; - mbNoSelection = TRUE; + mbNoSelection = sal_True; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2007,29 +2007,29 @@ void ValueSet::Clear() mnOldItemId = 0; mnHighItemId = 0; mnSelItemId = 0; - mbNoSelection = TRUE; + mbNoSelection = sal_True; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemCount() const +sal_uInt16 ValueSet::GetItemCount() const { - return (USHORT)mpImpl->mpItemList->Count(); + return (sal_uInt16)mpImpl->mpItemList->Count(); } // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemPos( USHORT nItemId ) const +sal_uInt16 ValueSet::GetItemPos( sal_uInt16 nItemId ) const { ValueSetItem* pItem = mpImpl->mpItemList->First(); while ( pItem ) { if ( pItem->mnId == nItemId ) - return (USHORT)mpImpl->mpItemList->GetCurPos(); + return (sal_uInt16)mpImpl->mpItemList->GetCurPos(); pItem = mpImpl->mpItemList->Next(); } @@ -2038,7 +2038,7 @@ USHORT ValueSet::GetItemPos( USHORT nItemId ) const // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemId( USHORT nPos ) const +sal_uInt16 ValueSet::GetItemId( sal_uInt16 nPos ) const { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( nPos ); @@ -2050,9 +2050,9 @@ USHORT ValueSet::GetItemId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemId( const Point& rPos ) const +sal_uInt16 ValueSet::GetItemId( const Point& rPos ) const { - USHORT nItemPos = ImplGetItem( rPos ); + sal_uInt16 nItemPos = ImplGetItem( rPos ); if ( nItemPos != VALUESET_ITEM_NOTFOUND ) return GetItemId( nItemPos ); @@ -2061,9 +2061,9 @@ USHORT ValueSet::GetItemId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle ValueSet::GetItemRect( USHORT nItemId ) const +Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maRect; @@ -2073,19 +2073,19 @@ Rectangle ValueSet::GetItemRect( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::EnableFullItemMode( BOOL bFullMode ) +void ValueSet::EnableFullItemMode( sal_Bool bFullMode ) { mbFullMode = bFullMode; } // ----------------------------------------------------------------------- -void ValueSet::SetColCount( USHORT nNewCols ) +void ValueSet::SetColCount( sal_uInt16 nNewCols ) { if ( mnUserCols != nNewCols ) { mnUserCols = nNewCols; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2093,12 +2093,12 @@ void ValueSet::SetColCount( USHORT nNewCols ) // ----------------------------------------------------------------------- -void ValueSet::SetLineCount( USHORT nNewLines ) +void ValueSet::SetLineCount( sal_uInt16 nNewLines ) { if ( mnUserVisLines != nNewLines ) { mnUserVisLines = nNewLines; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2111,7 +2111,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth ) if ( mnUserItemWidth != nNewItemWidth ) { mnUserItemWidth = nNewItemWidth; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2124,7 +2124,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight ) if ( mnUserItemHeight != nNewItemHeight ) { mnUserItemHeight = nNewItemHeight; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2132,12 +2132,12 @@ void ValueSet::SetItemHeight( long nNewItemHeight ) // ----------------------------------------------------------------------- -void ValueSet::SetFirstLine( USHORT nNewLine ) +void ValueSet::SetFirstLine( sal_uInt16 nNewLine ) { if ( mnFirstLine != nNewLine ) { mnFirstLine = nNewLine; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2145,9 +2145,9 @@ void ValueSet::SetFirstLine( USHORT nNewLine ) // ----------------------------------------------------------------------- -void ValueSet::SelectItem( USHORT nItemId ) +void ValueSet::SelectItem( sal_uInt16 nItemId ) { - USHORT nItemPos = 0; + sal_uInt16 nItemPos = 0; if ( nItemId ) { @@ -2160,31 +2160,31 @@ void ValueSet::SelectItem( USHORT nItemId ) if ( (mnSelItemId != nItemId) || mbNoSelection ) { - USHORT nOldItem = mnSelItemId ? mnSelItemId : 1; + sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1; mnSelItemId = nItemId; - mbNoSelection = FALSE; + mbNoSelection = sal_False; - BOOL bNewOut; - BOOL bNewLine; + sal_Bool bNewOut; + sal_Bool bNewLine; if ( !mbFormat && IsReallyVisible() && IsUpdateMode() ) - bNewOut = TRUE; + bNewOut = sal_True; else - bNewOut = FALSE; - bNewLine = FALSE; + bNewOut = sal_False; + bNewLine = sal_False; // Gegebenenfalls in den sichtbaren Bereich scrollen if ( mbScroll && nItemId ) { - USHORT nNewLine = (USHORT)(nItemPos / mnCols); + sal_uInt16 nNewLine = (sal_uInt16)(nItemPos / mnCols); if ( nNewLine < mnFirstLine ) { mnFirstLine = nNewLine; - bNewLine = TRUE; + bNewLine = sal_True; } - else if ( nNewLine > (USHORT)(mnFirstLine+mnVisLines-1) ) + else if ( nNewLine > (sal_uInt16)(mnFirstLine+mnVisLines-1) ) { - mnFirstLine = (USHORT)(nNewLine-mnVisLines+1); - bNewLine = TRUE; + mnFirstLine = (sal_uInt16)(nNewLine-mnVisLines+1); + bNewLine = sal_True; } } @@ -2194,7 +2194,7 @@ void ValueSet::SelectItem( USHORT nItemId ) { // Falls sich der sichtbare Bereich geaendert hat, // alles neu ausgeben - mbFormat = TRUE; + mbFormat = sal_True; ImplDraw(); } else @@ -2210,7 +2210,7 @@ void ValueSet::SelectItem( USHORT nItemId ) // focus event (deselect) if( nOldItem ) { - const USHORT nPos = GetItemPos( nItemId ); + const sal_uInt16 nPos = GetItemPos( nItemId ); if( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -2236,7 +2236,7 @@ void ValueSet::SelectItem( USHORT nItemId ) } // focus event (select) - const USHORT nPos = GetItemPos( mnSelItemId ); + const sal_uInt16 nPos = GetItemPos( mnSelItemId ); ValueSetItem* pItem; if( nPos != VALUESET_ITEM_NOTFOUND ) @@ -2276,9 +2276,9 @@ void ValueSet::SelectItem( USHORT nItemId ) void ValueSet::SetNoSelection() { - mbNoSelection = TRUE; - mbHighlight = FALSE; - mbSelection = FALSE; + mbNoSelection = sal_True; + mbHighlight = sal_False; + mbSelection = sal_False; if ( IsReallyVisible() && IsUpdateMode() ) ImplDraw(); @@ -2286,9 +2286,9 @@ void ValueSet::SetNoSelection() // ----------------------------------------------------------------------- -void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits ) +void ValueSet::SetItemBits( sal_uInt16 nItemId, sal_uInt16 nItemBits ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) mpImpl->mpItemList->GetObject( nPos )->mnBits = nItemBits; @@ -2296,9 +2296,9 @@ void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits ) // ----------------------------------------------------------------------- -USHORT ValueSet::GetItemBits( USHORT nItemId ) const +sal_uInt16 ValueSet::GetItemBits( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->mnBits; @@ -2308,9 +2308,9 @@ USHORT ValueSet::GetItemBits( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage ) +void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2325,14 +2325,14 @@ void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage ) Invalidate( pItem->maRect ); } else - mbFormat = TRUE; + mbFormat = sal_True; } // ----------------------------------------------------------------------- -Image ValueSet::GetItemImage( USHORT nItemId ) const +Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maImage; @@ -2342,9 +2342,9 @@ Image ValueSet::GetItemImage( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor ) +void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2359,14 +2359,14 @@ void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor ) Invalidate( pItem->maRect ); } else - mbFormat = TRUE; + mbFormat = sal_True; } // ----------------------------------------------------------------------- -Color ValueSet::GetItemColor( USHORT nItemId ) const +Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maColor; @@ -2376,9 +2376,9 @@ Color ValueSet::GetItemColor( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemData( USHORT nItemId, void* pData ) +void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2394,15 +2394,15 @@ void ValueSet::SetItemData( USHORT nItemId, void* pData ) Invalidate( pItem->maRect ); } else - mbFormat = TRUE; + mbFormat = sal_True; } } // ----------------------------------------------------------------------- -void* ValueSet::GetItemData( USHORT nItemId ) const +void* ValueSet::GetItemData( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->mpData; @@ -2412,9 +2412,9 @@ void* ValueSet::GetItemData( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ValueSet::SetItemText( USHORT nItemId, const XubString& rText ) +void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == VALUESET_ITEM_NOTFOUND ) return; @@ -2433,7 +2433,7 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText ) if ( !mbFormat && IsReallyVisible() && IsUpdateMode() ) { - USHORT nTempId = mnSelItemId; + sal_uInt16 nTempId = mnSelItemId; if ( mbHighlight ) nTempId = mnHighItemId; @@ -2455,9 +2455,9 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -XubString ValueSet::GetItemText( USHORT nItemId ) const +XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != VALUESET_ITEM_NOTFOUND ) return mpImpl->mpItemList->GetObject( nPos )->maText; @@ -2470,20 +2470,20 @@ XubString ValueSet::GetItemText( USHORT nItemId ) const void ValueSet::SetColor( const Color& rColor ) { maColor = rColor; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) ImplDraw(); } // ----------------------------------------------------------------------- -void ValueSet::SetExtraSpacing( USHORT nNewSpacing ) +void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing ) { if ( GetStyle() & WB_ITEMBORDER ) { mnSpacing = nNewSpacing; - mbFormat = TRUE; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -2494,8 +2494,8 @@ void ValueSet::SetExtraSpacing( USHORT nNewSpacing ) void ValueSet::StartSelection() { mnOldItemId = mnSelItemId; - mbHighlight = TRUE; - mbSelection = TRUE; + mbHighlight = sal_True; + mbSelection = sal_True; mnHighItemId = mnSelItemId; } @@ -2509,17 +2509,17 @@ void ValueSet::EndSelection() EndTracking( ENDTRACK_CANCEL ); ImplHighlightItem( mnSelItemId ); - mbHighlight = FALSE; + mbHighlight = sal_False; } - mbSelection = FALSE; + mbSelection = sal_False; } // ----------------------------------------------------------------------- -BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) +sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( rCEvt.GetCommand() != COMMAND_STARTDRAG ) - return FALSE; + return sal_False; // Gegebenenfalls eine vorhandene Aktion abbrechen EndSelection(); @@ -2528,7 +2528,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and // Drop auch mal ueber Tastatur ausgeloest werden kann, testen wir // dies nur bei einer Mausaktion. - USHORT nSelId; + sal_uInt16 nSelId; if ( rCEvt.IsMouseEvent() ) nSelId = GetItemId( rCEvt.GetMousePosPixel() ); else @@ -2536,7 +2536,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // Falls kein Eintrag angeklickt wurde, starten wir kein Dragging if ( !nSelId ) - return FALSE; + return sal_False; // Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle // Seite setzen und Select rufen. @@ -2552,13 +2552,13 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) // Region zuweisen rRegion = aRegion; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols, - USHORT nDesireLines ) +Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCols, + sal_uInt16 nDesireLines ) { long nCalcCols = (long)nDesireCols; long nCalcLines = (long)nDesireLines; @@ -2640,7 +2640,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols, // ----------------------------------------------------------------------- -Size ValueSet::CalcItemSizePixel( const Size& rItemSize, BOOL bOut ) const +Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const { Size aSize = rItemSize; @@ -2684,15 +2684,15 @@ long ValueSet::GetScrollWidth() const // ----------------------------------------------------------------------- -USHORT ValueSet::ShowDropPos( const Point& rPos ) +sal_uInt16 ValueSet::ShowDropPos( const Point& rPos ) { - mbDropPos = TRUE; + mbDropPos = sal_True; // Gegebenenfalls scrollen ImplScroll( rPos ); // DropPosition ermitteln - USHORT nPos = ImplGetItem( rPos, TRUE ); + sal_uInt16 nPos = ImplGetItem( rPos, sal_True ); if ( nPos == VALUESET_ITEM_NONEITEM ) nPos = 0; else if ( nPos == VALUESET_ITEM_NOTFOUND ) @@ -2702,7 +2702,7 @@ USHORT ValueSet::ShowDropPos( const Point& rPos ) aOutSize.Height() = mnTextOffset; if ( (rPos.X() >= 0) && (rPos.X() < aOutSize.Width()) && (rPos.Y() >= 0) && (rPos.Y() < aOutSize.Height()) ) - nPos = (USHORT)mpImpl->mpItemList->Count(); + nPos = (sal_uInt16)mpImpl->mpItemList->Count(); } else { @@ -2714,9 +2714,9 @@ USHORT ValueSet::ShowDropPos( const Point& rPos ) if ( nPos != mnDropPos ) { - ImplDrawDropPos( FALSE ); + ImplDrawDropPos( sal_False ); mnDropPos = nPos; - ImplDrawDropPos( TRUE ); + ImplDrawDropPos( sal_True ); } return mnDropPos; @@ -2728,8 +2728,8 @@ void ValueSet::HideDropPos() { if ( mbDropPos ) { - ImplDrawDropPos( FALSE ); - mbDropPos = FALSE; + ImplDrawDropPos( sal_False ); + mbDropPos = sal_False; } } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 9a66230f012c..27786d3a79cf 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -603,9 +603,9 @@ void AssignmentPersistentData::Commit() for (sal_Int32 column=0; column<2; ++column) { // the label - m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((USHORT)(FT_FIELD_BASE + row * 2 + column))); + m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((sal_uInt16)(FT_FIELD_BASE + row * 2 + column))); // the listbox - m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((USHORT)(LB_FIELD_BASE + row * 2 + column))); + m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((sal_uInt16)(LB_FIELD_BASE + row * 2 + column))); m_pImpl->pFields[row * 2 + column]->SetDropDownLineCount(15); m_pImpl->pFields[row * 2 + column]->SetSelectHdl(LINK(this, AddressBookSourceDialog, OnFieldSelect)); diff --git a/svtools/source/dialogs/colctrl.cxx b/svtools/source/dialogs/colctrl.cxx index 4456fe2f1268..2aa1b5b10675 100644 --- a/svtools/source/dialogs/colctrl.cxx +++ b/svtools/source/dialogs/colctrl.cxx @@ -85,19 +85,19 @@ void SvColorControl::CreateBitmap() if( pWriteAccess ) { - USHORT nX = (USHORT) aSize.Width(); - USHORT nY = (USHORT) aSize.Height(); + sal_uInt16 nX = (sal_uInt16) aSize.Width(); + sal_uInt16 nY = (sal_uInt16) aSize.Height(); - UINT16 nHue, nSat; + sal_uInt16 nHue, nSat; ColorHSB aColHSB( 0, 0, mnLuminance ); - for( USHORT i = 0; i < nY; i++ ) + for( sal_uInt16 i = 0; i < nY; i++ ) { - nSat = (UINT16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY ); + nSat = (sal_uInt16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY ); - for( USHORT j = 0; j < nX; j++ ) + for( sal_uInt16 j = 0; j < nX; j++ ) { - nHue = (UINT16) FRound( ( 360.0 * j + 0.5 ) / nX ); + nHue = (sal_uInt16) FRound( ( 360.0 * j + 0.5 ) / nX ); aColHSB.SetHue( nHue ); aColHSB.SetSat( nSat ); @@ -161,7 +161,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt ) { if( rMEvt.IsLeft() && !rMEvt.IsShift() ) { - //ShowPointer( FALSE ); + //ShowPointer( sal_False ); CaptureMouse(); ShowPosition( rMEvt.GetPosPixel() ); Modify(); @@ -171,7 +171,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt ) // ----------------------------------------------------------------------- void SvColorControl::MouseButtonUp( const MouseEvent& ) { - //ShowPointer( TRUE ); + //ShowPointer( sal_True ); if( IsMouseCaptured() ) ReleaseMouse(); } @@ -219,16 +219,16 @@ void SvColorControl::Modify() } // ----------------------------------------------------------------------- -void SvColorControl::SetColor( const ColorHSB& rCol, BOOL bSetColor ) +void SvColorControl::SetColor( const ColorHSB& rCol, sal_Bool bSetColor ) { if( bSetColor ) maColor = rCol.GetRGB(); if( mpBitmap ) { - USHORT nX = (USHORT) mpBitmap->GetSizePixel().Width(); - USHORT nY = (USHORT) mpBitmap->GetSizePixel().Height(); - INT16 nZ = rCol.GetBri(); + sal_uInt16 nX = (sal_uInt16) mpBitmap->GetSizePixel().Width(); + sal_uInt16 nY = (sal_uInt16) mpBitmap->GetSizePixel().Height(); + sal_Int16 nZ = rCol.GetBri(); SetLuminance( nZ ); nX = rCol.GetHue() * nX / 360; // Farbe @@ -245,7 +245,7 @@ void SvColorControl::SetColor( const Color& rCol ) if( mpBitmap ) { ColorHSB aColHsb( rCol ); - SetColor( aColHsb, FALSE ); + SetColor( aColHsb, sal_False ); } } @@ -332,7 +332,7 @@ void ColorPreviewControl::SetColor( const Color& rCol ) // ----------------------------------------------------------------------- ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle, - USHORT nRows, USHORT nColumns ) : + sal_uInt16 nRows, sal_uInt16 nColumns ) : ValueSet ( pParent, nStyle ), mnRows ( nRows ), mnColumns ( nColumns ) @@ -342,7 +342,7 @@ ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle, // ----------------------------------------------------------------------- ColorMixingControl::ColorMixingControl( Window* pParent, const ResId& rResId, - USHORT nRows, USHORT nColumns ) : + sal_uInt16 nRows, sal_uInt16 nColumns ) : ValueSet ( pParent, rResId ), mnRows ( nRows ), mnColumns ( nColumns ) @@ -363,7 +363,7 @@ void ColorMixingControl::Initialize() Color aColor; String aStr; - for( USHORT i = 1; i <= mnRows * mnColumns; i++ ) + for( sal_uInt16 i = 1; i <= mnRows * mnColumns; i++ ) { InsertItem( i, aColor, aStr ); } @@ -386,30 +386,30 @@ void ColorMixingControl::Initialize() } // ----------------------------------------------------------------------- -Color ColorMixingControl::CalcDifferenceColor( USHORT nCol1, USHORT nCol2, - USHORT nSteps ) +Color ColorMixingControl::CalcDifferenceColor( sal_uInt16 nCol1, sal_uInt16 nCol2, + sal_uInt16 nSteps ) { // Die Berechnung ist noch etwas ungenau, daher sollte besser mit floats // gearbeitet werden... (muss !!!) Color aColor( GetItemColor( nCol1 ) ); Color aColor2( GetItemColor( nCol2 ) ); - aColor.SetRed( (UINT8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) ); - aColor.SetGreen( (UINT8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) ); - aColor.SetBlue( (UINT8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) ); + aColor.SetRed( (sal_uInt8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) ); + aColor.SetGreen( (sal_uInt8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) ); + aColor.SetBlue( (sal_uInt8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) ); return( aColor ); } // ----------------------------------------------------------------------- -void ColorMixingControl::FillRow( USHORT nRow ) +void ColorMixingControl::FillRow( sal_uInt16 nRow ) { - USHORT nCol1 = nRow * mnColumns + 1; - USHORT nCol2 = ( nRow + 1 ) * mnColumns; + sal_uInt16 nCol1 = nRow * mnColumns + 1; + sal_uInt16 nCol2 = ( nRow + 1 ) * mnColumns; Color aColor( GetItemColor( nCol1 ) ); Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnColumns - 1 ) ); - for( USHORT i = nCol1 + 1; i < nCol2; i++ ) + for( sal_uInt16 i = nCol1 + 1; i < nCol2; i++ ) { aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() ); aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() ); @@ -421,14 +421,14 @@ void ColorMixingControl::FillRow( USHORT nRow ) } // ----------------------------------------------------------------------- -void ColorMixingControl::FillColumn( USHORT nColumn ) +void ColorMixingControl::FillColumn( sal_uInt16 nColumn ) { - USHORT nCol1 = nColumn + 1; - USHORT nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1; + sal_uInt16 nCol1 = nColumn + 1; + sal_uInt16 nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1; Color aColor( GetItemColor( nCol1 ) ); Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnRows - 1 ) ); - for( USHORT i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns ) + for( sal_uInt16 i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns ) { aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() ); aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() ); @@ -440,13 +440,13 @@ void ColorMixingControl::FillColumn( USHORT nColumn ) } // ----------------------------------------------------------------------- -void ColorMixingControl::SetRows( USHORT nRows ) +void ColorMixingControl::SetRows( sal_uInt16 nRows ) { mnRows = nRows; } // ----------------------------------------------------------------------- -void ColorMixingControl::SetColumns( USHORT nColumns ) +void ColorMixingControl::SetColumns( sal_uInt16 nColumns ) { mnColumns = nColumns; } @@ -457,8 +457,8 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol ) if( rCol != maColor[ ePos ] ) { maColor[ ePos ] = rCol; - USHORT nPos = 0; - USHORT nColumn = 0; + sal_uInt16 nPos = 0; + sal_uInt16 nColumn = 0; String aStr( GetRGBString( rCol ) ); switch( ePos ) @@ -489,7 +489,7 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol ) SetItemText( nPos, aStr ); FillColumn( nColumn ); - for( USHORT i = 0; i < mnRows; i++ ) + for( sal_uInt16 i = 0; i < mnRows; i++ ) FillRow( i ); } } @@ -509,7 +509,7 @@ String ColorMixingControl::GetRGBString( const Color& rColor ) CMCPosition ColorMixingControl::GetCMCPosition() const { CMCPosition ePos = CMC_OTHER; - USHORT nPos = GetSelectItemId(); + sal_uInt16 nPos = GetSelectItemId(); if( nPos == 1 ) ePos = CMC_TOPLEFT; @@ -543,8 +543,8 @@ CMCPosition ColorMixingControl::GetCMCPosition() const ColorHSB::ColorHSB( const Color& rColor ) { - UINT8 c[3]; - UINT8 cMax, cMin; + sal_uInt8 c[3]; + sal_uInt8 cMax, cMin; c[0] = rColor.GetRed(); c[1] = rColor.GetGreen(); @@ -565,7 +565,7 @@ ColorHSB::ColorHSB( const Color& rColor ) if( c[2] < cMin ) cMin = c[2]; - UINT8 cDelta = cMax - cMin; + sal_uInt8 cDelta = cMax - cMin; // Saturation = max - min / max if( mnBri > 0 ) @@ -597,7 +597,7 @@ ColorHSB::ColorHSB( const Color& rColor ) if( dHue < 0.0 ) dHue += 360.0; - mnHue = (UINT16) dHue; + mnHue = (sal_uInt16) dHue; } } @@ -612,8 +612,8 @@ ColorHSB::ColorHSB( const Color& rColor ) Color ColorHSB::GetRGB() const { - UINT8 cR,cG,cB; - UINT8 nB = (UINT8) ( mnBri * 255 / 100 ); + sal_uInt8 cR,cG,cB; + sal_uInt8 nB = (sal_uInt8) ( mnBri * 255 / 100 ); if( mnSat == 0 ) { @@ -625,20 +625,20 @@ Color ColorHSB::GetRGB() const { double dH = mnHue; double f; - UINT16 n; + sal_uInt16 n; if( dH == 360.0 ) dH = 0.0; dH /= 60.0; - n = (UINT16) dH; + n = (sal_uInt16) dH; f = dH - n; // #107375# Doing the calculation completely in floating // point, the former optimization gave sometimes negative // results for c and was pointless anyway - UINT8 a = static_cast<UINT8>( nB * ( 100.0 - mnSat ) / 100.0 ); - UINT8 b = static_cast<UINT8>( nB * ( 100.0 - mnSat * f ) / 100.0 ); - UINT8 c = static_cast<UINT8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 ); + sal_uInt8 a = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat ) / 100.0 ); + sal_uInt8 b = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * f ) / 100.0 ); + sal_uInt8 c = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 ); switch( n ) { @@ -678,11 +678,11 @@ ColorCMYK::ColorCMYK( const Color& rColor ) Color ColorCMYK::GetRGB() const { int nTmp = Max( 0, 255 - ( mnCyan + mnKey ) ); - UINT8 cR = (UINT8) nTmp; + sal_uInt8 cR = (sal_uInt8) nTmp; nTmp = Max( 0, 255 - ( mnMagenta + mnKey ) ); - UINT8 cG = (UINT8) nTmp; + sal_uInt8 cG = (sal_uInt8) nTmp; nTmp = Max( 0, 255 - ( mnYellow + mnKey ) ); - UINT8 cB = (UINT8) nTmp; + sal_uInt8 cB = (sal_uInt8) nTmp; return( Color( cR, cG, cB ) ); } diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx index a52cc4b0834c..fa494b05b2ab 100644 --- a/svtools/source/dialogs/colrdlg.cxx +++ b/svtools/source/dialogs/colrdlg.cxx @@ -160,7 +160,7 @@ const Color& SvColorDialog::GetColor() const // ----------------------------------------------------------------------- IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) { - UINT16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB + sal_uInt16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB if( p == &maCtlColor ) { @@ -173,19 +173,19 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) } else if( p == &maNumRed ) { - maColor.SetRed( (UINT8)maNumRed.GetValue() ); + maColor.SetRed( (sal_uInt8)maNumRed.GetValue() ); maCtlColor.SetColor( maColor ); n = 6; } else if( p == &maNumGreen ) { - maColor.SetGreen( (UINT8)maNumGreen.GetValue() ); + maColor.SetGreen( (sal_uInt8)maNumGreen.GetValue() ); maCtlColor.SetColor( maColor ); n = 6; } else if( p == &maNumBlue ) { - maColor.SetBlue( (UINT8)maNumBlue.GetValue() ); + maColor.SetBlue( (sal_uInt8)maNumBlue.GetValue() ); maCtlColor.SetColor( maColor ); n = 6; } @@ -194,9 +194,9 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) p == &maNumLuminance ) { - ColorHSB aColorHSB( (UINT16) maNumHue.GetValue(), - (UINT16) maNumSaturation.GetValue(), - (UINT16) maNumLuminance.GetValue() ); + ColorHSB aColorHSB( (sal_uInt16) maNumHue.GetValue(), + (sal_uInt16) maNumSaturation.GetValue(), + (sal_uInt16) maNumLuminance.GetValue() ); maCtlColor.SetColor( aColorHSB ); maColor = maCtlColor.GetColor(); n = 3; @@ -211,10 +211,10 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p ) long aYellow = (long) ( (double)maNumYellow.GetValue() * 255.0 / 100.0 + 0.5 ); long aKey = (long) ( (double)maNumKey.GetValue() * 255.0 / 100.0 + 0.5 ); - ColorCMYK aColorCMYK( (UINT16) aCyan, - (UINT16) aMagenta, - (UINT16) aYellow, - (UINT16) aKey ); + ColorCMYK aColorCMYK( (sal_uInt16) aCyan, + (sal_uInt16) aMagenta, + (sal_uInt16) aYellow, + (sal_uInt16) aKey ); maColor = aColorCMYK.GetRGB(); maCtlColor.SetColor( maColor ); n = 5; @@ -274,7 +274,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p ) } else if( p == &maBtn2 ) { - USHORT nPos = maColMixCtrl.GetSelectItemId(); + sal_uInt16 nPos = maColMixCtrl.GetSelectItemId(); maColor = maColMixCtrl.GetItemColor( nPos ); maCtlColor.SetColor( maColor ); ColorModifyHdl( &maCtlColor ); @@ -286,7 +286,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p ) // ----------------------------------------------------------------------- IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG ) { - USHORT nPos = maColMixCtrl.GetSelectItemId(); + sal_uInt16 nPos = maColMixCtrl.GetSelectItemId(); CMCPosition ePos = maColMixCtrl.GetCMCPosition(); if( ePos != CMC_OTHER ) @@ -304,12 +304,12 @@ IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG ) // ----------------------------------------------------------------------- IMPL_LINK( SvColorDialog, SelectMixCtrlHdl, void *, EMPTYARG ) { - //USHORT nPos = maColMixCtrl.GetSelectItemId(); + //sal_uInt16 nPos = maColMixCtrl.GetSelectItemId(); //maFtRGB.SetText( maColMixCtrl.GetItemText( nPos ) ); CMCPosition ePos = maColMixCtrl.GetCMCPosition(); if( ePos == CMC_OTHER ) - maBtn1.Enable( FALSE ); + maBtn1.Enable( sal_False ); else maBtn1.Enable(); diff --git a/svtools/source/dialogs/filedlg.cxx b/svtools/source/dialogs/filedlg.cxx index 5567651c0480..8180f188bd1e 100644 --- a/svtools/source/dialogs/filedlg.cxx +++ b/svtools/source/dialogs/filedlg.cxx @@ -31,7 +31,7 @@ #include <filedlg.hxx> #include <filedlg2.hxx> -PathDialog::PathDialog( Window* _pParent, WinBits nStyle, BOOL bCreateDir ) : +PathDialog::PathDialog( Window* _pParent, WinBits nStyle, sal_Bool bCreateDir ) : ModalDialog( _pParent, WB_STDMODAL | nStyle ) { pImpFileDlg = new ImpSvFileDlg; @@ -70,7 +70,7 @@ long PathDialog::OK() if( aOKHdlLink.IsSet() ) return aOKHdlLink.Call( this ); else - return TRUE; + return sal_True; } @@ -80,7 +80,7 @@ FileDialog::FileDialog( Window* _pParent, WinBits nStyle ) : // Dadurch dass hier bei VCL nicht der CTOR mit ResType verwendet wird, // wurde im PathDialog-CTOR leider ein ImpPathDialog angelegt... // So zwar scheisse, aber der Dialog ist eh' nur ein Hack: - pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, FALSE ); + pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, sal_False ); } FileDialog::~FileDialog() @@ -122,17 +122,17 @@ void FileDialog::FilterSelect() aFilterHdlLink.Call( this ); } -USHORT FileDialog::GetFilterCount() const +sal_uInt16 FileDialog::GetFilterCount() const { return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterCount(); } -UniString FileDialog::GetFilterName( USHORT nPos ) const +UniString FileDialog::GetFilterName( sal_uInt16 nPos ) const { return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterName( nPos ); } -UniString FileDialog::GetFilterType( USHORT nPos ) const +UniString FileDialog::GetFilterType( sal_uInt16 nPos ) const { return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterType( nPos ); } diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index b0e77d658931..7f9896446e3b 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -76,9 +76,9 @@ DECLARE_LIST( UniStringList, UniString* ) p->Show(); -inline BOOL IsPrintable( sal_Unicode c ) +inline sal_Bool IsPrintable( sal_Unicode c ) { - return c >= 32 && c != 127 ? TRUE : FALSE; + return c >= 32 && c != 127 ? sal_True : sal_False; } long @@ -91,10 +91,10 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) if ( IsPrintable ( cCharCode ) ) { - USHORT nCurrentPos = GetSelectEntryPos(); - USHORT nEntries = GetEntryCount(); + sal_uInt16 nCurrentPos = GetSelectEntryPos(); + sal_uInt16 nEntries = GetEntryCount(); - for ( USHORT i = 1; i < nEntries; i++ ) + for ( sal_uInt16 i = 1; i < nEntries; i++ ) { UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries ); aEntry.EraseLeadingChars( ' ' ); @@ -119,7 +119,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) return ListBox::PreNotify ( rNEvt ); } -ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir ) +ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir ) { pSvPathDialog = pDlg; nDirCount = 0; @@ -290,14 +290,14 @@ IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p ) UniString aEntry( pDirList->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item DirEntry aNewPath; aNewPath.ToAbs(); - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wird nach oben gewechselt if( nCurPos < nDirCount ) @@ -324,7 +324,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aFile; aPath.ToAbs(); - GetPathDialog()->EndDialog( TRUE ); + GetPathDialog()->EndDialog( sal_True ); } else { @@ -341,7 +341,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) else if ( pBtn == pCancelBtn ) { - GetPathDialog()->EndDialog( FALSE ); + GetPathDialog()->EndDialog( sal_False ); } else if ( pBtn == pHomeBtn ) @@ -383,7 +383,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) UniString aEntry( pBox->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item @@ -391,7 +391,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) aNewPath.ToAbs(); if( pBox == pDirList ) { - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wenn es schon das aktuelle ist, dann mache nichts if( nCurPos == nDirCount-1 ) @@ -412,22 +412,22 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) { // Neuen Pfad setzen und Listboxen updaten aPath = aNewPath; - if( !aPath.SetCWD( TRUE ) ) + if( !aPath.SetCWD( sal_True ) ) { ErrorBox aBox( GetPathDialog(), WB_OK_CANCEL | WB_DEF_OK, UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ); if( aBox.Execute() == RET_CANCEL ) - GetPathDialog()->EndDialog( FALSE ); + GetPathDialog()->EndDialog( sal_False ); } - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); } pSvPathDialog->LeaveWait(); return 0; } -void ImpPathDialog::UpdateEntries( const BOOL ) +void ImpPathDialog::UpdateEntries( const sal_Bool ) { UniString aTabString; DirEntry aTmpPath; @@ -435,10 +435,10 @@ void ImpPathDialog::UpdateEntries( const BOOL ) nDirCount = aTmpPath.Level(); - pDirList->SetUpdateMode( FALSE ); + pDirList->SetUpdateMode( sal_False ); pDirList->Clear(); - for( USHORT i = nDirCount; i > 0; i-- ) + for( sal_uInt16 i = nDirCount; i > 0; i-- ) { UniString aName( aTabString ); aName += aTmpPath[i-1].GetName(); @@ -452,11 +452,11 @@ void ImpPathDialog::UpdateEntries( const BOOL ) Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE ); - USHORT nEntries = aDir.Count(); + sal_uInt16 nEntries = aDir.Count(); if( nEntries ) { UniStringList aSortDirList; - for ( USHORT n = 0; n < nEntries; n++ ) + for ( sal_uInt16 n = 0; n < nEntries; n++ ) { DirEntry& rEntry = aDir[n]; UniString aName( rEntry.GetName() ); @@ -464,7 +464,7 @@ void ImpPathDialog::UpdateEntries( const BOOL ) { if( FileStat( rEntry ).GetKind() & FSYS_KIND_DIR ) { - ULONG l = 0; + sal_uIntPtr l = 0; if( xCollator.is() ) { for( l = 0; l < aSortDirList.Count(); l++ ) @@ -476,7 +476,7 @@ void ImpPathDialog::UpdateEntries( const BOOL ) } } - for( ULONG l = 0; l < aSortDirList.Count(); l++ ) + for( sal_uIntPtr l = 0; l < aSortDirList.Count(); l++ ) { UniString aEntryStr( aTabString ); aEntryStr += *aSortDirList.GetObject(l); @@ -494,7 +494,7 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath ) pDirList->SetTopEntry( nDirCount > 1 ? nDirCount - 2 : nDirCount - 1 ); - pDirList->SetUpdateMode( TRUE ); + pDirList->SetUpdateMode( sal_True ); pDirList->Invalidate(); pDirList->Update(); @@ -505,10 +505,10 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath ) pEdit->SetText( aDirName ); } -BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) +sal_Bool ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) { if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) ) - return FALSE; + return sal_False; else { // Datei vorhanden ? @@ -522,7 +522,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) if( aQuery.Execute() == RET_YES ) rDirEntry.MakeDir(); else - return FALSE; + return sal_False; } if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) ) { @@ -532,7 +532,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) aBoxText.AppendAscii( "]" ); InfoBox aBox( GetPathDialog(), aBoxText ); aBox.Execute(); - return FALSE; + return sal_False; } } return GetPathDialog()->OK() != 0; @@ -542,8 +542,8 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry ) void ImpPathDialog::PreExecute() { // Neues Verzeichnis setzen und Listboxen updaten - aPath.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aPath.SetCWD( sal_True ); + UpdateEntries( sal_True ); // Zusaetzliche Buttons anordnen Point aPos; @@ -566,8 +566,8 @@ void ImpPathDialog::PreExecute() long nMaxWidth = 0; // Maximale Breite ermitteln - USHORT nChilds = GetPathDialog()->GetChildCount(); - USHORT n; + sal_uInt16 nChilds = GetPathDialog()->GetChildCount(); + sal_uInt16 n; for ( n = nOwnChilds; n < nChilds; n++ ) { Window* pChild = GetPathDialog()->GetChild( n ); @@ -627,11 +627,11 @@ void ImpPathDialog::PreExecute() DirEntry aTmpDirEntry; Dir aDir( aTmpDirEntry, FSYS_KIND_BLOCK ); - USHORT nCount = aDir.Count(), i; + sal_uInt16 nCount = aDir.Count(), i; for( i = 0; i < nCount; ++i ) { DirEntry& rEntry = aDir[i]; - UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, FALSE ); + UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, sal_False ); UniString aVolume = rEntry.GetVolume() ; aStr.ToUpperAscii(); @@ -677,8 +677,8 @@ void ImpPathDialog::SetPath( UniString const & rPath ) // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten pEdit->SetText( rPath ); - aFile.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aFile.SetCWD( sal_True ); + UpdateEntries( sal_True ); pSvPathDialog->LeaveWait(); } @@ -700,7 +700,7 @@ UniString ImpPathDialog::GetPath() const ImpFileDialog::ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType ) : - ImpPathDialog( pDlg, nType, FALSE ) + ImpPathDialog( pDlg, nType, sal_False ) { bOpen = (nWinBits & WB_SAVEAS) == 0; @@ -841,7 +841,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) UniString aEntry( pBox->GetSelectEntry() ); aEntry.EraseLeadingChars( ' ' ); - USHORT nPos = aEntry.Search( '/' ); + sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); // build the absolute path to the selected item @@ -851,7 +851,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) if( ( pDirList != pFileList ) && ( pBox == pDirList ) ) { // SVLOOK - USHORT nCurPos = pDirList->GetSelectEntryPos(); + sal_uInt16 nCurPos = pDirList->GetSelectEntryPos(); // Wenn es schon das aktuelle ist, dann mache nichts if( nCurPos == nDirCount-1 ) @@ -880,7 +880,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) { // dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aNewPath; - GetFileDialog()->EndDialog( TRUE ); + GetFileDialog()->EndDialog( sal_True ); } } @@ -893,23 +893,23 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) { // Neuen Pfad setzen und Listboxen updaten aPath = aNewPath; - if( !aPath.SetCWD( TRUE ) ) + if( !aPath.SetCWD( sal_True ) ) { if( ErrorBox( GetFileDialog(), WB_OK_CANCEL|WB_DEF_OK, UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ).Execute() == RET_CANCEL ) { - GetFileDialog()->EndDialog( FALSE ); + GetFileDialog()->EndDialog( sal_False ); } } - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); GetFileDialog()->FileSelect(); } if( pBox == pTypeList ) { // Neue Maske setzen, und Listboxen updaten - USHORT nCurPos = pTypeList->GetSelectEntryPos(); - if( nCurPos+1 > (USHORT)aFilterList.Count() ) + sal_uInt16 nCurPos = pTypeList->GetSelectEntryPos(); + if( nCurPos+1 > (sal_uInt16)aFilterList.Count() ) aMask = UniString::CreateFromAscii( ALLFILES ); else { @@ -921,7 +921,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox ) } pEdit->SetText( aMask() ); - UpdateEntries( FALSE ); + UpdateEntries( sal_False ); GetFileDialog()->FilterSelect(); } @@ -942,7 +942,7 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn ) // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden aPath = aFile; aPath.ToAbs(); - GetFileDialog()->EndDialog( TRUE ); + GetFileDialog()->EndDialog( sal_True ); } else { @@ -957,19 +957,19 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn ) // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten pEdit->SetText( aMask() ); - aFile.SetCWD( TRUE ); - UpdateEntries( TRUE ); + aFile.SetCWD( sal_True ); + UpdateEntries( sal_True ); GetFileDialog()->LeaveWait(); } } else if( pBtn == pCancelBtn ) - GetFileDialog()->EndDialog( FALSE ); + GetFileDialog()->EndDialog( sal_False ); return 0; } -void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) +void ImpFileDialog::UpdateEntries( const sal_Bool bWithDirs ) { GetFileDialog()->EnterWait(); @@ -980,16 +980,16 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) if( pFileList ) { - pFileList->SetUpdateMode( FALSE ); + pFileList->SetUpdateMode( sal_False ); pFileList->Clear(); } if( bWithDirs && (pDirList != pFileList) ) { - pDirList->SetUpdateMode( FALSE ); + pDirList->SetUpdateMode( sal_False ); pDirList->Clear(); - for( USHORT i = nDirCount; i > 0; i-- ) + for( sal_uInt16 i = nDirCount; i > 0; i-- ) { UniString aEntryStr( aTabString ); aEntryStr += aTmpPath[i-1].GetName(); @@ -1008,10 +1008,10 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) DirEntry aCurrent; aCurrent.ToAbs(); Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE ); - USHORT nEntries = aDir.Count(); + sal_uInt16 nEntries = aDir.Count(); // TempMask, weil Vergleich case-sensitiv - BOOL bMatchCase = FALSE; //aCurrent.IsCaseSensitive(); + sal_Bool bMatchCase = sal_False; //aCurrent.IsCaseSensitive(); UniString aWildCard( aMask.GetWildCard() ); if ( !bMatchCase ) aWildCard.ToLowerAscii(); @@ -1019,7 +1019,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) if ( nEntries ) { UniStringList aSortDirList; - for ( USHORT n = 0; n < nEntries; n++ ) + for ( sal_uInt16 n = 0; n < nEntries; n++ ) { DirEntry& rEntry = aDir[n]; UniString aName( rEntry.GetName() ); @@ -1048,7 +1048,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) } else { - ULONG l = 0; + sal_uIntPtr l = 0; if( xCollator.is() ) { for( l = 0; l < aSortDirList.Count(); l++ ) @@ -1060,7 +1060,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) } } } - for( ULONG l = 0; l < aSortDirList.Count(); l++ ) + for( sal_uIntPtr l = 0; l < aSortDirList.Count(); l++ ) { UniString aEntryStr( aTabString ); aEntryStr += *aSortDirList.GetObject(l); @@ -1078,7 +1078,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) pFileList->SelectEntryPos( 1 ); else pFileList->SetNoSelection(); - pFileList->SetUpdateMode( TRUE ); + pFileList->SetUpdateMode( sal_True ); pFileList->Invalidate(); pFileList->Update(); } @@ -1097,14 +1097,14 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs ) GetFileDialog()->LeaveWait(); } -BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) +sal_Bool ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) { if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) ) - return FALSE; + return sal_False; if( FileStat( rDirEntry ).GetKind() & FSYS_KIND_DIR ) { if( pFileList ) - return FALSE; + return sal_False; } else if( bOpen ) { @@ -1118,7 +1118,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) InfoBox aBox( GetFileDialog(), aErrorString ); aBox.Execute(); - return FALSE; + return sal_False; } } else @@ -1134,7 +1134,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry ) WinBits( WB_YES_NO | WB_DEF_NO ), aQueryString ); if( aBox.Execute() != RET_YES ) - return FALSE; + return sal_False; } } return GetFileDialog()->OK() != 0; @@ -1163,9 +1163,9 @@ void ImpFileDialog::SetPath( UniString const & rPath ) pEdit->SetText( rPath ); } - aFile.SetCWD( TRUE ); + aFile.SetCWD( sal_True ); - UpdateEntries( TRUE ); + UpdateEntries( sal_True ); GetFileDialog()->LeaveWait(); } @@ -1226,7 +1226,7 @@ void ImpFileDialog::SetCurFilter( const UniString& rFilter ) pItem = aFilterList.Next(); if( pItem ) - pTypeList->SelectEntryPos( (USHORT)aFilterList.GetCurPos() ); + pTypeList->SelectEntryPos( (sal_uInt16)aFilterList.GetCurPos() ); else pTypeList->SetNoSelection(); } @@ -1257,7 +1257,7 @@ void ImpFileDialog::PreExecute() if( pTypeList ) { - USHORT nCurType = pTypeList->GetSelectEntryPos(); + sal_uInt16 nCurType = pTypeList->GetSelectEntryPos(); if( nCurType < aFilterList.Count() ) { UniString aFilterListMask = aFilterList.GetObject( nCurType )->aMask; @@ -1297,7 +1297,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const UniString aPostfix; // hier kommt die ausgesuchte Extension herein // ist ein Filter mit Extension gesetzt? - USHORT nChosenFilterPos = pTypeList->GetSelectEntryPos(); + sal_uInt16 nChosenFilterPos = pTypeList->GetSelectEntryPos(); if( nChosenFilterPos != LISTBOX_ENTRY_NOTFOUND ) { UniString aExtensionMask = GetFileDialog()->GetFilterType( nChosenFilterPos ); @@ -1350,7 +1350,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const } -void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate ) +void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate ) { delete pDlg; if ( nType == WINDOW_PATHDIALOG ) diff --git a/svtools/source/dialogs/filedlg2.hxx b/svtools/source/dialogs/filedlg2.hxx index 4d32565a2775..36214db27d33 100644 --- a/svtools/source/dialogs/filedlg2.hxx +++ b/svtools/source/dialogs/filedlg2.hxx @@ -91,10 +91,10 @@ private: PushButton* pHomeBtn; PushButton* pNewDirBtn; - USHORT nOwnChilds; + sal_uInt16 nOwnChilds; DirEntry aPath; // aktuell angewaehlter Pfad - USHORT nDirCount; // Anzahl der Verzeichnis- + sal_uInt16 nDirCount; // Anzahl der Verzeichnis- // Verschachtelungen ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > @@ -102,10 +102,10 @@ private: protected: - virtual void UpdateEntries( const BOOL bWithDirs ); + virtual void UpdateEntries( const sal_Bool bWithDirs ); void UpdateDirs( const DirEntry& rTmpPath ); - BOOL IsFileOk( const DirEntry& rDirEntry ); + sal_Bool IsFileOk( const DirEntry& rDirEntry ); void InitControls(); DECL_LINK( SelectHdl, ListBox * ); @@ -113,7 +113,7 @@ protected: DECL_LINK( ClickHdl, Button * ); public: - ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir ); + ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir ); virtual ~ImpPathDialog(); virtual void SetPath( const String& rPath ); @@ -142,9 +142,9 @@ private: WildCard aMask; // aktuelle Maske ImpFilterList aFilterList; // Filterliste - USHORT nCurFilter; // aktueller Filter + sal_uInt16 nCurFilter; // aktueller Filter - BOOL bOpen; // TRUE = Open; FALSE = SAVEAS + sal_Bool bOpen; // sal_True = Open; sal_False = SAVEAS protected: void InitControls(); @@ -155,8 +155,8 @@ protected: DECL_LINK( DblClickHdl, ListBox * ); DECL_LINK( ClickHdl, Button * ); - virtual void UpdateEntries( const BOOL bWithDirs ); - BOOL IsFileOk( const DirEntry& rDirEntry ); + virtual void UpdateEntries( const sal_Bool bWithDirs ); + sal_Bool IsFileOk( const DirEntry& rDirEntry ); public: ImpFileDialog( PathDialog* pDlg, WinBits nStyle, RESOURCE_TYPE nType ); @@ -168,9 +168,9 @@ public: void SetCurFilter( const String& rFilter ); String GetCurFilter() const; - USHORT GetFilterCount() const { return (USHORT)aFilterList.Count(); } - inline String GetFilterName( USHORT nPos ) const; - inline String GetFilterType( USHORT nPos ) const; + sal_uInt16 GetFilterCount() const { return (sal_uInt16)aFilterList.Count(); } + inline String GetFilterName( sal_uInt16 nPos ) const; + inline String GetFilterType( sal_uInt16 nPos ) const; virtual void SetPath( const String& rPath ); virtual void SetPath( const Edit& rEdit ); @@ -181,7 +181,7 @@ public: FileDialog* GetFileDialog() const { return (FileDialog*)GetPathDialog(); } }; -inline String ImpFileDialog::GetFilterName( USHORT nPos ) const +inline String ImpFileDialog::GetFilterName( sal_uInt16 nPos ) const { String aName; ImpFilterItem* pItem = aFilterList.GetObject( nPos ); @@ -190,7 +190,7 @@ inline String ImpFileDialog::GetFilterName( USHORT nPos ) const return aName; } -inline String ImpFileDialog::GetFilterType( USHORT nPos ) const +inline String ImpFileDialog::GetFilterType( sal_uInt16 nPos ) const { String aFilterMask; ImpFilterItem* pItem = aFilterList.GetObject( nPos ); @@ -209,7 +209,7 @@ public: ~ImpSvFileDlg() { delete pDlg; } ImpPathDialog* GetDialog() const { return pDlg; } - void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate ); + void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate ); void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); } diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx index 3f7700805995..301b8602c17d 100644 --- a/svtools/source/dialogs/insdlg.cxx +++ b/svtools/source/dialogs/insdlg.cxx @@ -77,7 +77,7 @@ PRV_SV_IMPL_OWNER_LIST( SvObjectServerList, SvObjectServer ) *************************************************************************/ const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) const { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uIntPtr i = 0; i < Count(); i++ ) { if( rHumanName == GetObject( i ).GetHumanName() ) return &GetObject( i ); @@ -92,7 +92,7 @@ const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) cons *************************************************************************/ const SvObjectServer * SvObjectServerList::Get( const SvGlobalName & rName ) const { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uIntPtr i = 0; i < Count(); i++ ) { if( rName == GetObject( i ).GetClassName() ) return &GetObject( i ); @@ -238,7 +238,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId ) struct SotResourcePair { SotFormatStringId mnSotId; - USHORT mnResId; + sal_uInt16 mnResId; }; static const SotResourcePair aSotResourcePairs[] = @@ -312,7 +312,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId ) }; String aUIName; - USHORT nResId = 0; + sal_uInt16 nResId = 0; for( sal_uInt32 i = 0, nCount = sizeof( aSotResourcePairs ) / sizeof( aSotResourcePairs[ 0 ] ); ( i < nCount ) && !nResId; i++ ) { diff --git a/svtools/source/dialogs/logindlg.cxx b/svtools/source/dialogs/logindlg.cxx index 036d5d71a4cf..c51f7cc1bca0 100644 --- a/svtools/source/dialogs/logindlg.cxx +++ b/svtools/source/dialogs/logindlg.cxx @@ -51,18 +51,18 @@ namespace svt { //............................................................................ -void LoginDialog::HideControls_Impl( USHORT nFlags ) +void LoginDialog::HideControls_Impl( sal_uInt16 nFlags ) { - FASTBOOL bPathHide = FALSE; - FASTBOOL bErrorHide = FALSE; - FASTBOOL bAccountHide = FALSE; + int bPathHide = sal_False; + int bErrorHide = sal_False; + int bAccountHide = sal_False; if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH ) { aPathFT.Hide(); aPathED.Hide(); aPathBtn.Hide(); - bPathHide = TRUE; + bPathHide = sal_True; } else if ( ( nFlags & LF_PATH_READONLY ) == LF_PATH_READONLY ) { @@ -95,14 +95,14 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) { aErrorInfo.Hide(); aErrorGB.Hide(); - bErrorHide = TRUE; + bErrorHide = sal_True; } if ( ( nFlags & LF_NO_ACCOUNT ) == LF_NO_ACCOUNT ) { aAccountFT.Hide(); aAccountED.Hide(); - bAccountHide = TRUE; + bAccountHide = sal_True; } if ( bErrorHide ) @@ -227,7 +227,7 @@ IMPL_LINK( LoginDialog, PathHdl_Impl, PushButton *, EMPTYARG ) LoginDialog::LoginDialog ( Window* pParent, - USHORT nFlags, + sal_uInt16 nFlags, const String& rServer, const String* pRealm ) : diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index d07c41acba04..28505c6280b4 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -99,11 +99,11 @@ FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ) |* **************************************************************************/ -USHORT ImpSqrt( ULONG nRadi ) +sal_uInt16 ImpSqrt( sal_uIntPtr nRadi ) { - register ULONG inf = 1; - register ULONG sup = nRadi; - register ULONG sqr; + register sal_uIntPtr inf = 1; + register sal_uIntPtr sup = nRadi; + register sal_uIntPtr sqr; if ( !nRadi ) return 0; @@ -118,7 +118,7 @@ USHORT ImpSqrt( ULONG nRadi ) sqr = (nRadi/sqr + sqr) >> 1; // 2 Newton-Iterationen reichen fuer sqr = (nRadi/sqr + sqr) >> 1; // +- 1 Digit - return sal::static_int_cast< USHORT >(sqr); + return sal::static_int_cast< sal_uInt16 >(sqr); } /************************************************************************** @@ -133,7 +133,7 @@ USHORT ImpSqrt( ULONG nRadi ) // e**(i*nPhi), Einheit nPhi: 2**16 == 360 Grad -FixCpx ImpExPI( USHORT nPhi ) +FixCpx ImpExPI( sal_uInt16 nPhi ) { short i; FixCpx aIter(1L); // e**(0*i) @@ -165,10 +165,10 @@ FixCpx ImpExPI( USHORT nPhi ) // use for x*x+y*y==1 only -static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) +static sal_uInt16 ImpATanx2( const Fix& rX, const Fix& rY ) { - USHORT phi0 = 0; // result angel higher part - USHORT phi = 0; // dito lower part + sal_uInt16 phi0 = 0; // result angel higher part + sal_uInt16 phi = 0; // dito lower part long x = rX.x; long y = rY.x; long z; @@ -177,7 +177,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) FixCpx aTry; FixCpx aInc; FixCpx aIter(1L); - BOOL Small = FALSE; + sal_Bool Small = sal_False; if ( (x==0) && (y==0) ) return 0; @@ -225,7 +225,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) phi += (1<<i); if ( i > 11 ) - Small=TRUE; + Small=sal_True; } } } @@ -243,9 +243,9 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY ) |* **************************************************************************/ -USHORT ImpATan2( const short x, const short y ) +sal_uInt16 ImpATan2( const short x, const short y ) { - Fix rRad = ImpSqrt(ULONG(long(x)*x+long(y)*y)); + Fix rRad = ImpSqrt(sal_uIntPtr(long(x)*x+long(y)*y)); if ( !rRad.x ) return 0; @@ -267,9 +267,9 @@ USHORT ImpATan2( const short x, const short y ) |* **************************************************************************/ -void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi ) +void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ) { - rRad = Fix( ImpSqrt( ULONG( long(x)*x+long(y)*y ) ) ); + rRad = Fix( ImpSqrt( sal_uIntPtr( long(x)*x+long(y)*y ) ) ); if ( !rRad.x ) rPhi=0; @@ -294,7 +294,7 @@ void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi ) |* **************************************************************************/ -void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY ) +void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY ) { FixCpx fc = ImpExPI( Phi ); // calculate sin() & cos() fc.GetReal().MultBig( rR ); diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index 67d54fd80cf0..bd4deab0a769 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -83,7 +83,7 @@ public: Fix() { x=0; } Fix( int i ) { x=(long(i)<<FIX_POST); } Fix( short l ) { x=(long(l)<<FIX_POST); } - Fix( USHORT l ) { x=(long(l)<<FIX_POST); } + Fix( sal_uInt16 l ) { x=(long(l)<<FIX_POST); } Fix( long l ) { x=(l<<FIX_POST); } Fix( long Z, long N ) { x=(Z<<FIX_POST)/N; } @@ -101,8 +101,8 @@ public: void DivBig( const Fix& a ) { x=((x<<FIX_P3)/a.x)<<FIX_P2; } - friend BOOL operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; } - friend BOOL operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; } + friend sal_Bool operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; } + friend sal_Bool operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; } operator long() const { return (x+FIX_ADD) >> FIX_POST; } operator double() const { return double(x)/(1<<FIX_POST); } @@ -218,11 +218,11 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b ) Fix ImpMultBig2( const Fix& a, const Fix& b ); FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ); -void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi ); -void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY ); +void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ); +void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY ); -USHORT ImpSqrt( ULONG nRadi ); -USHORT ImpATan2( const short x, const short y ); -FixCpx ImpExPI( USHORT nPhi ); +sal_uInt16 ImpSqrt( sal_uIntPtr nRadi ); +sal_uInt16 ImpATan2( const short x, const short y ); +FixCpx ImpExPI( sal_uInt16 nPhi ); #endif // _MCVMATH_HXX diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx index 532fd3f61bb2..8ac47db14cdd 100644 --- a/svtools/source/dialogs/printdlg.cxx +++ b/svtools/source/dialogs/printdlg.cxx @@ -126,13 +126,13 @@ PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) : mnMinPage = 1; mnMaxPage = 65535; meCheckRange = PRINTDIALOG_ALL; - mbAll = TRUE; - mbSelection = FALSE; - mbFromTo = FALSE; - mbRange = FALSE; - mbCollate = TRUE; - mbCollateCheck = TRUE; - mbOptions = FALSE; + mbAll = sal_True; + mbSelection = sal_False; + mbFromTo = sal_False; + mbRange = sal_False; + mbCollate = sal_True; + mbCollateCheck = sal_True; + mbOptions = sal_False; maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE ); maStatusTimer.SetTimeoutHdl( LINK( this, PrintDialog, ImplStatusHdl ) ); @@ -161,7 +161,7 @@ PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) : PrintDialog::~PrintDialog() { - ImplFreePrnDlgListBox( &maLbName, FALSE ); + ImplFreePrnDlgListBox( &maLbName, sal_False ); delete mpPrinterImpl; } @@ -205,10 +205,10 @@ void PrintDialog::ImplSetInfo() #ifdef UNX if( pInfo && pInfo->GetLocation().EqualsAscii( "fax_queue" ) ) { - maFiPrintFile.Show( FALSE ); - maCbxFilePrint.Show( FALSE ); - maFiFaxNo.Show( TRUE ); - maEdtFaxNo.Show( TRUE ); + maFiPrintFile.Show( sal_False ); + maCbxFilePrint.Show( sal_False ); + maFiFaxNo.Show( sal_True ); + maEdtFaxNo.Show( sal_True ); Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter; maEdtFaxNo.SetText( pPrinter->GetJobValue( String::CreateFromAscii( "FAX#" ) ) ); @@ -229,10 +229,10 @@ void PrintDialog::ImplSetInfo() else #endif { - maFiPrintFile.Show( TRUE ); - maCbxFilePrint.Show( TRUE ); - maFiFaxNo.Show( FALSE ); - maEdtFaxNo.Show( FALSE ); + maFiPrintFile.Show( sal_True ); + maCbxFilePrint.Show( sal_True ); + maFiFaxNo.Show( sal_False ); + maEdtFaxNo.Show( sal_False ); } } @@ -242,7 +242,7 @@ void PrintDialog::ImplSetInfo() void PrintDialog::ImplCheckOK() { // Ueberprueft, ob der OK-Button enabled ist - BOOL bEnable = TRUE; + sal_Bool bEnable = sal_True; if ( bEnable && maRbtPages.IsChecked() ) bEnable = maEdtPages.GetText().Len() > 0; @@ -267,20 +267,20 @@ void PrintDialog::ImplInitControls() { maRbtAll.Enable(); if( meCheckRange == PRINTDIALOG_ALL ) - maRbtAll.Check( TRUE ); + maRbtAll.Check( sal_True ); } else - maRbtAll.Enable( FALSE ); + maRbtAll.Enable( sal_False ); // Selektion if ( mbSelection ) { maRbtSelection.Enable(); if ( meCheckRange == PRINTDIALOG_SELECTION ) - maRbtSelection.Check( TRUE ); + maRbtSelection.Check( sal_True ); } else - maRbtSelection.Enable( FALSE ); + maRbtSelection.Enable( sal_False ); // Seiten if ( mbRange ) @@ -292,15 +292,15 @@ void PrintDialog::ImplInitControls() if( ( meCheckRange == PRINTDIALOG_FROMTO ) || ( meCheckRange == PRINTDIALOG_RANGE ) ) { - maRbtPages.Check( TRUE ); + maRbtPages.Check( sal_True ); maEdtPages.Enable(); } else - maEdtPages.Enable( FALSE ); + maEdtPages.Enable( sal_False ); } else { - maRbtPages.Enable( FALSE ); + maRbtPages.Enable( sal_False ); maEdtPages.Hide(); } @@ -372,7 +372,7 @@ void PrintDialog::ImplFillDialogData() maRangeText = maEdtPages.GetText(); } - mnCopyCount = (USHORT) maNumCopies.GetValue(); + mnCopyCount = (sal_uInt16) maNumCopies.GetValue(); mbCollateCheck = maCbxCollate.IsChecked(); // In Datei drucken @@ -512,7 +512,7 @@ IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p ) // Radiobuttons (Umfang) if ( !p || (p == &maRbtAll) || (p == &maRbtPages) || (p == &maRbtSelection) ) { - BOOL bCheck = maRbtPages.IsChecked(); + sal_Bool bCheck = maRbtPages.IsChecked(); maEdtPages.Enable( bCheck ); if ( p == &maRbtPages ) maEdtPages.GrabFocus(); @@ -530,26 +530,26 @@ IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p ) } // Anzahl Kopien - BOOL bNumCopies = FALSE; + sal_Bool bNumCopies = sal_False; if ( !p || p == &maNumCopies ) { if ( p ) - bNumCopies = TRUE; - //BOOL bCopies = maNumCopies.GetValue() > 1; + bNumCopies = sal_True; + //sal_Bool bCopies = maNumCopies.GetValue() > 1; maCbxCollate.Enable( mbCollate ); /*if ( !bCopies ) - maCbxCollate.Check( FALSE ); + maCbxCollate.Check( sal_False ); else*/ if ( mbCollateCheck ) - maCbxCollate.Check( TRUE ); + maCbxCollate.Check( sal_True ); } // Sortieren if ( !p || p == &maCbxCollate || bNumCopies ) { - BOOL bCheck = maCbxCollate.IsChecked(); + sal_Bool bCheck = maCbxCollate.IsChecked(); if ( !bNumCopies ) mbCollateCheck = maCbxCollate.IsChecked(); @@ -572,7 +572,7 @@ IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p ) if( p == &maBtnOK ) { - EndDialog( maCbxFilePrint.IsChecked() ? ImplGetFilename() : TRUE ); + EndDialog( maCbxFilePrint.IsChecked() ? ImplGetFilename() : sal_True ); } return 0; @@ -585,7 +585,7 @@ long PrintDialog::ClickOptionsHdl() if ( maOptionsHdlLink.IsSet() ) return maOptionsHdlLink.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -595,7 +595,7 @@ long PrintDialog::OK() if ( maOKHdlLink.IsSet() ) return maOKHdlLink.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -632,13 +632,13 @@ bool PrintDialog::IsSheetRangeEnabled( PrintSheetRange eRange ) const switch ( eRange ) { case PRINTSHEETS_ALL : - bRet = maRbtAllSheets.IsEnabled() != FALSE; + bRet = maRbtAllSheets.IsEnabled() != sal_False; break; case PRINTSHEETS_SELECTED_SHEETS : - bRet = maRbtSelectedSheets.IsEnabled() != FALSE; + bRet = maRbtSelectedSheets.IsEnabled() != sal_False; break; case PRINTSHEETS_SELECTED_CELLS : - bRet = maRbtSelectedCells.IsEnabled() != FALSE; + bRet = maRbtSelectedCells.IsEnabled() != sal_False; break; default: DBG_ERRORFILE( "PrintDialog::IsSheetRangeEnabled(): invalid range" ); @@ -695,13 +695,13 @@ bool PrintDialog::IsSheetRangeChecked( PrintSheetRange eRange ) const switch ( eRange ) { case PRINTSHEETS_ALL : - bRet = maRbtAllSheets.IsChecked() != FALSE; + bRet = maRbtAllSheets.IsChecked() != sal_False; break; case PRINTSHEETS_SELECTED_SHEETS : - bRet = maRbtSelectedSheets.IsChecked() != FALSE; + bRet = maRbtSelectedSheets.IsChecked() != sal_False; break; case PRINTSHEETS_SELECTED_CELLS : - bRet = maRbtSelectedCells.IsChecked() != FALSE; + bRet = maRbtSelectedCells.IsChecked() != sal_False; break; default: DBG_ERRORFILE( "PrintDialog::IsSheetRangeChecked(): invalid range" ); @@ -753,13 +753,13 @@ short PrintDialog::Execute() if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() ) { DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" ); - return FALSE; + return sal_False; } // check if the printer brings up its own dialog // in that case leave the work to that dialog if( mpPrinter->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) ) - return TRUE; + return sal_True; Printer::updatePrinters(); @@ -776,7 +776,7 @@ short PrintDialog::Execute() short nRet = ModalDialog::Execute(); // Wenn Dialog mit OK beendet wurde, dann die Daten updaten - if( nRet == TRUE ) + if( nRet == sal_True ) { if ( TEMPPRINTER() ) mpPrinter->SetPrinterProps( TEMPPRINTER() ); diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index ceef2a88642b..aa67a62b66ba 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -61,7 +61,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter, // ----------------------------------------------------------------------- -void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear ) +void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear ) { if ( bClear ) pBox->Clear(); @@ -149,7 +149,7 @@ static void ImplPrnDlgAddString( XubString& rStr, const XubString& rAddStr ) // ----------------------------------------------------------------------- -static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId ) +static void ImplPrnDlgAddResString( XubString& rStr, sal_uInt16 nResId ) { SvtResId aResId( nResId ); XubString aAddStr( aResId ); @@ -161,7 +161,7 @@ static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId ) XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ) { XubString aStr; - ULONG nStatus = rInfo.GetStatus(); + sal_uIntPtr nStatus = rInfo.GetStatus(); // Default-Printer if ( rInfo.GetPrinterName().Len() && @@ -221,7 +221,7 @@ XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ) ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_POWER_SAVE ); // Anzahl Jobs - ULONG nJobs = rInfo.GetJobs(); + sal_uIntPtr nJobs = rInfo.GetJobs(); if ( nJobs && (nJobs != QUEUE_JOBS_DONTKNOW) ) { XubString aJobStr( SvtResId( STR_SVT_PRNDLG_JOBCOUNT ) ); @@ -273,7 +273,7 @@ PrinterSetupDialog::PrinterSetupDialog( Window* pWindow ) : PrinterSetupDialog::~PrinterSetupDialog() { - ImplFreePrnDlgListBox( &maLbName, FALSE ); + ImplFreePrnDlgListBox( &maLbName, sal_False ); delete mpTempPrinter; } @@ -378,7 +378,7 @@ short PrinterSetupDialog::Execute() if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() ) { DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" ); - return FALSE; + return sal_False; } Printer::updatePrinters(); @@ -391,7 +391,7 @@ short PrinterSetupDialog::Execute() short nRet = ModalDialog::Execute(); // Wenn Dialog mit OK beendet wurde, dann die Daten updaten - if ( nRet == TRUE ) + if ( nRet == sal_True ) { if ( mpTempPrinter ) mpPrinter->SetPrinterProps( mpTempPrinter ); diff --git a/svtools/source/dialogs/propctrl.cxx b/svtools/source/dialogs/propctrl.cxx index 675a93ca728b..4a20b37aa398 100644 --- a/svtools/source/dialogs/propctrl.cxx +++ b/svtools/source/dialogs/propctrl.cxx @@ -60,7 +60,7 @@ public: // Objekt zum Editieren setzen, dies loest das Eintragen // der Properties in die PropertyBox aus void setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj, - /* HACK fuer History-Interface*/String aPath, BOOL bBack=FALSE, BOOL bForward=FALSE ); + /* HACK fuer History-Interface*/String aPath, sal_Bool bBack=sal_False, sal_Bool bForward=sal_False ); /* SPAETER SMART_UNO_DECLARATION(ImplIntrospection,UsrObject); @@ -101,7 +101,7 @@ PropertyEditorControler_Impl::PropertyEditorControler_Impl( SvPropertyBox* pProp } void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj, - /* HACK fuer History-Interface*/ String aPath, BOOL bBack, BOOL bForward ) + /* HACK fuer History-Interface*/ String aPath, sal_Bool bBack, sal_Bool bForward ) { static XIntrospectionRef xIntrospection; @@ -142,7 +142,7 @@ void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const const Property* pProps = mPropSeq.getConstArray(); // 1. Seite anlegen - USHORT nPropPageId = mpPropBox->AppendPage("Properties"); + sal_uInt16 nPropPageId = mpPropBox->AppendPage("Properties"); // Beim Eintragen solls nicht flimmern mpPropBox->DisableUpdate(); @@ -152,9 +152,9 @@ void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const if( aPath.Len() ) { // Interface und Structs werden Hyperlinks - aProperty.bIsHyperLink = FALSE; - aProperty.bIsLocked = TRUE; - aProperty.bHasVisibleXButton = FALSE; + aProperty.bIsHyperLink = sal_False; + aProperty.bIsLocked = sal_True; + aProperty.bHasVisibleXButton = sal_False; aProperty.eKind = KOC_EDIT; aProperty.pControl = NULL; aProperty.pDataPtr = NULL; @@ -165,8 +165,8 @@ void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const if( bBack || bForward ) { // Interface und Structs werden Hyperlinks - aProperty.bIsHyperLink = TRUE; - aProperty.bIsLocked = TRUE; + aProperty.bIsHyperLink = sal_True; + aProperty.bIsLocked = sal_True; // HACK, solange Hyperlink nicht funktioniert aProperty.bHasVisibleXButton = aProperty.bIsHyperLink; aProperty.eKind = KOC_EDIT; @@ -232,7 +232,7 @@ void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const // 2. Seite fuer Listener // TODO: Wo kommen die Eintraege her - USHORT nListenerPageId = mpPropBox->AppendPage("Listener"); + sal_uInt16 nListenerPageId = mpPropBox->AppendPage("Listener"); XIdlClassSequence aSupportedListenerSeq = mxUnoAccess->getSupportedListeners(); const XIdlClassRef* pListenerArray = aSupportedListenerSeq.getConstArray(); @@ -242,12 +242,12 @@ void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const aProperty.eKind = KOC_EDIT; //aProperty.eKind = KOC_UNDEFINED; aProperty.aValue = "Listener-Value"; - aProperty.bHasVisibleXButton = TRUE; + aProperty.bHasVisibleXButton = sal_True; // TEST - //aProperty.bIsHyperLink = TRUE; - aProperty.bIsHyperLink = FALSE; - aProperty.bIsLocked = TRUE; - //aProperty.bIsLocked = FALSE; + //aProperty.bIsHyperLink = sal_True; + aProperty.bIsHyperLink = sal_False; + aProperty.bIsLocked = sal_True; + //aProperty.bIsLocked = sal_False; aProperty.pDataPtr = NULL; aProperty.pControl = NULL; @@ -275,8 +275,8 @@ void PropertyEditorControler_Impl::Clicked if( iPos >= nPropCount ) { // Spezial-IDs fuer forward/back? - BOOL bForward = (iPos == 1000000); - BOOL bBack = (iPos == 1000001); + sal_Bool bForward = (iPos == 1000000); + sal_Bool bBack = (iPos == 1000001); if( bForward || bBack ) { // Unterstuetzt der PropertyEditor das? @@ -383,7 +383,7 @@ XIdlClassRef SimplePropertyEditor_Impl::getIdlClass() // Methoden von SimplePropertyEditor_Impl SimplePropertyEditor_Impl::SimplePropertyEditor_Impl( Window *pParent ) - : maHistorySeq( 10 ), maHistoryNames( 10 ), bSimpleHistory( FALSE ) + : maHistorySeq( 10 ), maHistoryNames( 10 ), bSimpleHistory( sal_False ) { //XVCLComponent xC = pParent->getVCLComponent //xC->addVCLComponentListener( MyListener ) diff --git a/svtools/source/dialogs/propctrl.hxx b/svtools/source/dialogs/propctrl.hxx index 949873ceb1b7..f82424682389 100644 --- a/svtools/source/dialogs/propctrl.hxx +++ b/svtools/source/dialogs/propctrl.hxx @@ -81,7 +81,7 @@ class SimplePropertyEditor_Impl : INT32 mnActualHistoryLevel; // Einfache History via Dummy-Properties - BOOL bSimpleHistory; + sal_Bool bSimpleHistory; // Methode zum Anlegen/Aktivieren der Controller void showObject( const UsrAny& aToShowObj ); @@ -93,7 +93,7 @@ public: ~SimplePropertyEditor_Impl(); // HACK fuer History-Test - void enableSimpleHistory( BOOL bHistory_ ) { bSimpleHistory = bHistory_; } + void enableSimpleHistory( sal_Bool bHistory_ ) { bSimpleHistory = bHistory_; } SMART_UNO_DECLARATION(ImplIntrospection,UsrObject); diff --git a/svtools/source/dialogs/property.cxx b/svtools/source/dialogs/property.cxx index 3b081ce2f520..140d00d39bb1 100644 --- a/svtools/source/dialogs/property.cxx +++ b/svtools/source/dialogs/property.cxx @@ -108,7 +108,7 @@ void SvXPropertyEdit::SetCtrSize(const Size& rSize) aEdit.SetSizePixel(aSize); } -void SvXPropertyEdit::SetLocked(BOOL bLocked) +void SvXPropertyEdit::SetLocked(sal_Bool bLocked) { if(bLocked) Disable(); @@ -126,9 +126,9 @@ String SvXPropertyEdit::GetProperty() const return aEdit.GetText(); } -BOOL SvXPropertyEdit::HasList() +sal_Bool SvXPropertyEdit::HasList() { - return FALSE; + return sal_False; }; @@ -136,7 +136,7 @@ void SvXPropertyEdit::ClearList() { return; } -void SvXPropertyEdit::InsertEntry( const String&,USHORT ) +void SvXPropertyEdit::InsertEntry( const String&,sal_uInt16 ) { return; } @@ -236,7 +236,7 @@ void SvXPropertyListBox::SetCtrSize(const Size& rSize) aListBox.SetSizePixel(aSize); } -void SvXPropertyListBox::SetLocked(BOOL bLocked) +void SvXPropertyListBox::SetLocked(sal_Bool bLocked) { if(bLocked) Disable(); @@ -254,9 +254,9 @@ String SvXPropertyListBox::GetProperty()const return aListBox.GetSelectEntry(); } -BOOL SvXPropertyListBox::HasList() +sal_Bool SvXPropertyListBox::HasList() { - return TRUE; + return sal_True; } @@ -265,7 +265,7 @@ void SvXPropertyListBox::ClearList() aListBox.Clear(); } -void SvXPropertyListBox::InsertEntry( const String& rString,USHORT nPos) +void SvXPropertyListBox::InsertEntry( const String& rString,sal_uInt16 nPos) { aListBox.InsertEntry(rString,nPos); } @@ -345,7 +345,7 @@ SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, const ResId& rResId) aComboBox.Show(); } -void SvXPropertyComboBox::SetLocked(BOOL bLocked) +void SvXPropertyComboBox::SetLocked(sal_Bool bLocked) { if(bLocked) Disable(); @@ -384,9 +384,9 @@ String SvXPropertyComboBox::GetProperty() const return aComboBox.GetText(); } -BOOL SvXPropertyComboBox::HasList() +sal_Bool SvXPropertyComboBox::HasList() { - return TRUE; + return sal_True; } void SvXPropertyComboBox::ClearList() @@ -394,7 +394,7 @@ void SvXPropertyComboBox::ClearList() aComboBox.Clear(); } -void SvXPropertyComboBox::InsertEntry( const String& rString,USHORT nPos) +void SvXPropertyComboBox::InsertEntry( const String& rString,sal_uInt16 nPos) { aComboBox.InsertEntry(rString,nPos); } @@ -446,11 +446,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,WinBits nWinStyle) aName(this,WB_BORDER), pSvXPropertyControl(NULL), aXButton(this,WB_BORDER), - bIsLocked(FALSE), - bIsHyperlink(FALSE) + bIsLocked(sal_False), + bIsHyperlink(sal_False) { - bNeedsRepaint = TRUE; - bHasXButton = FALSE; + bNeedsRepaint = sal_True; + bHasXButton = sal_False; aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) ); aName.Show(); aXButton.Show(); @@ -465,11 +465,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,const ResId& rResId ) aName (this,WB_BORDER), pSvXPropertyControl(NULL), aXButton (this,WB_BORDER), - bIsLocked(FALSE), - bIsHyperlink(FALSE) + bIsLocked(sal_False), + bIsHyperlink(sal_False) { - bNeedsRepaint = TRUE; - bHasXButton = FALSE; + bNeedsRepaint = sal_True; + bHasXButton = sal_False; eKindOfCtr = KOC_UNDEFINED; aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) ); aName.Show(); @@ -504,11 +504,11 @@ void SvPropertyLine::Resize() aName.SetPosPixel(aPos); aName.SetSizePixel(aSize); - USHORT nXButtonWidth=0; + sal_uInt16 nXButtonWidth=0; if(bHasXButton) { - nXButtonWidth=(USHORT)aSize.Height(); + nXButtonWidth=(sal_uInt16)aSize.Height(); } a2Size.Width()=a2Size.Width()-nXButtonWidth; @@ -530,12 +530,12 @@ void SvPropertyLine::Resize() } } -void SvPropertyLine::SetNeedsRepaint(BOOL bFlag) +void SvPropertyLine::SetNeedsRepaint(sal_Bool bFlag) { bNeedsRepaint=bFlag; } -BOOL SvPropertyLine::NeedsRepaint() +sal_Bool SvPropertyLine::NeedsRepaint() { return bNeedsRepaint; } @@ -563,22 +563,22 @@ eKindOfControl SvPropertyLine::GetKindOfControl() void SvPropertyLine::ShowXButton() { - bHasXButton=TRUE; + bHasXButton=sal_True; aXButton.Show(); Resize(); } void SvPropertyLine::HideXButton() { - bHasXButton=FALSE; + bHasXButton=sal_False; aXButton.Hide(); Resize(); } -BOOL SvPropertyLine::IsVisibleXButton() +sal_Bool SvPropertyLine::IsVisibleXButton() { return bHasXButton; } -void SvPropertyLine::ShowAsHyperLink(BOOL nFlag) +void SvPropertyLine::ShowAsHyperLink(sal_Bool nFlag) { bIsHyperlink=nFlag; if(nFlag) @@ -595,24 +595,24 @@ void SvPropertyLine::ShowAsHyperLink(BOOL nFlag) } } -BOOL SvPropertyLine::IsShownAsHyperlink() +sal_Bool SvPropertyLine::IsShownAsHyperlink() { return bIsHyperlink; } -void SvPropertyLine::Locked(BOOL nFlag) +void SvPropertyLine::Locked(sal_Bool nFlag) { bIsLocked=nFlag; if(pSvXPropertyControl!=NULL) pSvXPropertyControl->SetLocked(nFlag); } -BOOL SvPropertyLine::IsLineLocked() +sal_Bool SvPropertyLine::IsLineLocked() { return bIsLocked; } -void SvPropertyLine::SetNameWidth(USHORT nWidth) +void SvPropertyLine::SetNameWidth(sal_uInt16 nWidth) { nNameWidth=nWidth; Resize(); @@ -687,7 +687,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, WinBits nWinSty nTheNameSize=0; ListBox aListBox(this,WB_DROPDOWN); aListBox.SetPosSizePixel(Point(0,0),Size(100,100)); - nRowHeight=(USHORT)aListBox.GetSizePixel().Height(); + nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height(); Wallpaper aWall = aPlayGround.GetBackground(); aWall.SetColor( Color( COL_TRANSPARENT ) ); aPlayGround.SetBackground( aWall ); @@ -709,7 +709,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, const ResId& rR nYOffset=0; ListBox aListBox(this,WB_DROPDOWN); aListBox.SetPosSizePixel(Point(0,0),Size(100,100)); - nRowHeight=(USHORT)aListBox.GetSizePixel().Height(); + nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height(); Wallpaper aWall = aPlayGround.GetBackground(); aWall.SetColor( Color( COL_TRANSPARENT ) ); aPlayGround.SetBackground( aWall ); @@ -727,7 +727,7 @@ SvListBoxForProperties::~SvListBoxForProperties() void SvListBoxForProperties::Clear() { - for(USHORT i=0;i<PLineArray.Count();i++) + for(sal_uInt16 i=0;i<PLineArray.Count();i++) { SvPropertyLine* pPropLine=PLineArray[i]; @@ -773,19 +773,19 @@ void SvListBoxForProperties::SetController( SvPropertyDataControl *pPDC) pPropDataControl=pPDC; } -USHORT SvListBoxForProperties::CalcVisibleLines() +sal_uInt16 SvListBoxForProperties::CalcVisibleLines() { Size aSize=aPlayGround.GetOutputSizePixel(); - USHORT nResult=0; + sal_uInt16 nResult=0; if(nRowHeight!=0) - nResult=(USHORT) aSize.Height()/nRowHeight; + nResult=(sal_uInt16) aSize.Height()/nRowHeight; return nResult; } void SvListBoxForProperties::UpdateVScroll() { - USHORT nLines=CalcVisibleLines(); + sal_uInt16 nLines=CalcVisibleLines(); aVScroll.SetPageSize(nLines-1); aVScroll.SetVisibleSize(nLines-1); aVScroll.SetRange(Range(0,PLineArray.Count()-1)); @@ -795,7 +795,7 @@ void SvListBoxForProperties::UpdateVScroll() } else { - BOOL bFlag=aVScroll.IsVisible(); + sal_Bool bFlag=aVScroll.IsVisible(); aVScroll.Show(); if(!bFlag)Resize(); } @@ -807,7 +807,7 @@ void SvListBoxForProperties::UpdatePosNSize() { Point aPos(0,nYOffset); - for(USHORT i=0; i<PLineArray.Count();i++) + for(sal_uInt16 i=0; i<PLineArray.Count();i++) { if((PLineArray[i])->NeedsRepaint()) { @@ -819,7 +819,7 @@ void SvListBoxForProperties::UpdatePosNSize() (PLineArray[i])->Invalidate(); (PLineArray[i])->Update(); (PLineArray[i])->Show(); - (PLineArray[i])->SetNeedsRepaint(FALSE); + (PLineArray[i])->SetNeedsRepaint(sal_False); } else { @@ -846,21 +846,21 @@ void SvListBoxForProperties::UpdatePlayGround() long nLines=aVScroll.GetPageSize(); long nDelta=aVScroll.GetDelta(); - USHORT nStart,nEnd; + sal_uInt16 nStart,nEnd; Size aSize=aPlayGround.GetOutputSizePixel(); Point aPEnd; aPEnd.X()=aSize.Width(); if(nDelta>0) { - nStart=(USHORT)(nThumbPos+nLines+1-nDelta); - nEnd=(USHORT)(nThumbPos+nLines); + nStart=(sal_uInt16)(nThumbPos+nLines+1-nDelta); + nEnd=(sal_uInt16)(nThumbPos+nLines); aPos.Y()=(nLines+1-nDelta)*nRowHeight; } else { - nStart=(USHORT)nThumbPos; - nEnd=(USHORT)(nThumbPos-nDelta); + nStart=(sal_uInt16)nThumbPos; + nEnd=(sal_uInt16)(nThumbPos-nDelta); aPEnd.Y()=(nThumbPos-nDelta)*nRowHeight;; } @@ -870,7 +870,7 @@ void SvListBoxForProperties::UpdatePlayGround() aPlayGround.Scroll(0,nDelta,SCROLL_CHILDREN); - for(USHORT i=nStart; i<=nEnd;i++) + for(sal_uInt16 i=nStart; i<=nEnd;i++) { (PLineArray[i])->SetPosSizePixel(aPos,aSize); (PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET); @@ -889,18 +889,18 @@ void SvListBoxForProperties::UpdateAll() void SvListBoxForProperties::DisableUpdate() { - bUpdate=FALSE; + bUpdate=sal_False; } void SvListBoxForProperties::EnableUpdate() { - bUpdate=TRUE; + bUpdate=sal_True; UpdateAll(); } void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const String & rValue ) { - USHORT i, iEnd = PLineArray.Count(); + sal_uInt16 i, iEnd = PLineArray.Count(); for( i = 0 ; i < iEnd ; i++ ) { SvPropertyLine* pPropLine = PLineArray[ i ]; @@ -912,14 +912,14 @@ void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const } } -USHORT SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData) +sal_uInt16 SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData) { return InsertEntry(aPropData); } -USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USHORT nPos) +sal_uInt16 SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, sal_uInt16 nPos) { - USHORT nInsPos=nPos; + sal_uInt16 nInsPos=nPos; SvPropertyLine* pPropLine=new SvPropertyLine(&aPlayGround,WB_TABSTOP | WB_DIALOGCONTROL); if(nPos==LISTBOX_APPEND) @@ -938,7 +938,7 @@ USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USH return nInsPos; } -void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHORT nPos) +void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, sal_uInt16 nPos) { if(nPos<PLineArray.Count()) { @@ -993,7 +993,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR if(pSvXPCtr->HasList()) { - for(USHORT i=0;i<aPropData.theValues.Count();i++) + for(sal_uInt16 i=0;i<aPropData.theValues.Count();i++) { pSvXPCtr->InsertEntry(*(aPropData.theValues[i])); } @@ -1002,7 +1002,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR pPropLine->SetName(aPropData.aName); - USHORT nTextWidth=(USHORT)aPlayGround.GetTextWidth(aPropData.aName); + sal_uInt16 nTextWidth=(sal_uInt16)aPlayGround.GetTextWidth(aPropData.aName); if ( nTheNameSize < nTextWidth ) nTheNameSize = nTextWidth; @@ -1022,21 +1022,21 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR } } -USHORT SvListBoxForProperties::GetFirstVisibleEntry() +sal_uInt16 SvListBoxForProperties::GetFirstVisibleEntry() { return 0; } -void SvListBoxForProperties::SetFirstVisibleEntry(USHORT) +void SvListBoxForProperties::SetFirstVisibleEntry(sal_uInt16) { return; } -void SvListBoxForProperties::SetSelectedEntry(USHORT) +void SvListBoxForProperties::SetSelectedEntry(sal_uInt16) { return; } -USHORT SvListBoxForProperties::GetSelectedEntry() +sal_uInt16 SvListBoxForProperties::GetSelectedEntry() { return 0; } @@ -1047,7 +1047,7 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB ) { long nDelta=aVScroll.GetDelta(); nYOffset=-aVScroll.GetThumbPos()*nRowHeight; - //aPlayGround.SetUpdateMode(FALSE); + //aPlayGround.SetUpdateMode(sal_False); long nThumbPos=aVScroll.GetThumbPos(); long nLines=aVScroll.GetPageSize(); @@ -1058,14 +1058,14 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB ) { if(i>=nThumbPos && i<=nThumbPos+nLines) { - (PLineArray[sal::static_int_cast< USHORT >(i)])-> - SetNeedsRepaint(TRUE); + (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])-> + SetNeedsRepaint(sal_True); } else { - (PLineArray[sal::static_int_cast< USHORT >(i)])->Hide(); - (PLineArray[sal::static_int_cast< USHORT >(i)])-> - SetNeedsRepaint(FALSE); + (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->Hide(); + (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])-> + SetNeedsRepaint(sal_False); } } } @@ -1186,9 +1186,9 @@ SvPropertyBox::~SvPropertyBox() void SvPropertyBox::ClearAll() { - USHORT nCount=aTabControl.GetPageCount(); + sal_uInt16 nCount=aTabControl.GetPageCount(); - for(USHORT i=nCount;i>=1;i--) + for(sal_uInt16 i=nCount;i>=1;i--) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(i); @@ -1207,10 +1207,10 @@ void SvPropertyBox::Resize() aTabControl.SetPosSizePixel(aPos,aSize); - USHORT nCount=aTabControl.GetPageCount(); + sal_uInt16 nCount=aTabControl.GetPageCount(); aSize=aTabControl.GetTabPageSizePixel(); - for(USHORT i=1;i<=nCount;i++) + for(sal_uInt16 i=1;i<=nCount;i++) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(i); @@ -1220,9 +1220,9 @@ void SvPropertyBox::Resize() } -USHORT SvPropertyBox::AppendPage( const String & rText ) +sal_uInt16 SvPropertyBox::AppendPage( const String & rText ) { - USHORT nId=aTabControl.GetPageCount()+1; + sal_uInt16 nId=aTabControl.GetPageCount()+1; aTabControl.InsertPage( nId,rText); SvTabPageForProperties* pPage=new SvTabPageForProperties(&aTabControl); pPage->SetSizePixel(aTabControl.GetTabPageSizePixel()); @@ -1232,17 +1232,17 @@ USHORT SvPropertyBox::AppendPage( const String & rText ) return nId; } -void SvPropertyBox::SetPage( USHORT nId) +void SvPropertyBox::SetPage( sal_uInt16 nId) { aTabControl.SetCurPageId(nId); } -USHORT SvPropertyBox::GetCurPage() +sal_uInt16 SvPropertyBox::GetCurPage() { return aTabControl.GetCurPageId(); } -USHORT SvPropertyBox::CalcVisibleLines() +sal_uInt16 SvPropertyBox::CalcVisibleLines() { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); @@ -1265,9 +1265,9 @@ void SvPropertyBox::DisableUpdate() void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr) { pThePropDataCtr=pDataCtr; - USHORT nCount=aTabControl.GetPageCount(); + sal_uInt16 nCount=aTabControl.GetPageCount(); - for(USHORT i=1;i<=nCount;i++) + for(sal_uInt16 i=1;i<=nCount;i++) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(i); @@ -1277,21 +1277,21 @@ void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr) } -USHORT SvPropertyBox::InsertEntry( const SvPropertyData& rData, USHORT nPos) +sal_uInt16 SvPropertyBox::InsertEntry( const SvPropertyData& rData, sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); return pPage->GetTheListBox()->InsertEntry(rData,nPos); } -void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, USHORT nPos) +void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); pPage->GetTheListBox()->ChangeEntry(rData,nPos); } -USHORT SvPropertyBox::AppendEntry( const SvPropertyData& rData) +sal_uInt16 SvPropertyBox::AppendEntry( const SvPropertyData& rData) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); @@ -1305,26 +1305,26 @@ void SvPropertyBox::SetPropertyValue( const String & rEntryName, const String & pPage->GetTheListBox()->SetPropertyValue( rEntryName, rValue ); } -void SvPropertyBox::SetFirstVisibleEntry(USHORT nPos) +void SvPropertyBox::SetFirstVisibleEntry(sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); pPage->GetTheListBox()->SetFirstVisibleEntry(nPos); } -USHORT SvPropertyBox::GetFirstVisibleEntry() +sal_uInt16 SvPropertyBox::GetFirstVisibleEntry() { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); return pPage->GetTheListBox()->GetFirstVisibleEntry(); } -void SvPropertyBox::SetSelectedEntry(USHORT nPos) +void SvPropertyBox::SetSelectedEntry(sal_uInt16 nPos) { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); pPage->GetTheListBox()->SetSelectedEntry(nPos); } -USHORT SvPropertyBox::GetSelectedEntry() +sal_uInt16 SvPropertyBox::GetSelectedEntry() { SvTabPageForProperties* pPage=(SvTabPageForProperties*) aTabControl.GetTabPage(aTabControl.GetCurPageId()); @@ -1411,7 +1411,7 @@ void SvBasicPropertyDataControl::SetTheCorrectProperty(const String& aString) aCorrectProperty=aString; } -void SvBasicPropertyDataControl::SetIsCorrect(BOOL nFlag) +void SvBasicPropertyDataControl::SetIsCorrect(sal_Bool nFlag) { bCorrectness=nFlag; } @@ -1451,15 +1451,15 @@ ScPropertyDlg::ScPropertyDlg( Window* pParent) : aPropListBox.SetController(&aBaProDatCtr); - USHORT nPageId=aPropListBox.AppendPage("YabbaDabbaDo"); + sal_uInt16 nPageId=aPropListBox.AppendPage("YabbaDabbaDo"); aPropListBox.SetPage(nPageId); aProperty.eKind=KOC_EDIT; aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); aProperty.aValue=sizeof ComboBox; - aProperty.bHasVisibleXButton=FALSE; - aProperty.bIsHyperLink=FALSE; - aProperty.bIsLocked=FALSE; + aProperty.bHasVisibleXButton=sal_False; + aProperty.bIsHyperLink=sal_False; + aProperty.bIsLocked=sal_False; aProperty.pDataPtr=NULL; aProperty.pControl=NULL; aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count()); @@ -1467,16 +1467,16 @@ ScPropertyDlg::ScPropertyDlg( Window* pParent) : aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count()); aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count()); aPropListBox.InsertEntry(aProperty); - aProperty.bHasVisibleXButton=TRUE; + aProperty.bHasVisibleXButton=sal_True; aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); aProperty.aValue="42"; aProperty.eKind=KOC_LISTBOX; aPropListBox.InsertEntry(aProperty); aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); aProperty.eKind=KOC_COMBOBOX; - aProperty.bHasVisibleXButton=FALSE; + aProperty.bHasVisibleXButton=sal_False; aPropListBox.InsertEntry(aProperty); } @@ -1494,19 +1494,19 @@ IMPL_LINK( ScPropertyDlg, ModifiedHdl, ListBox*, pLB ) { String aString("Don't know "); aProperty.aName=aString; - aProperty.aName+=String((USHORT)++nCount); + aProperty.aName+=String((sal_uInt16)++nCount); if(nCount>20) { String aStr("Yabba "); aStr+=aPropListBox.GetCurPage(); - USHORT nPageId=aPropListBox.AppendPage(aStr); + sal_uInt16 nPageId=aPropListBox.AppendPage(aStr); aPropListBox.SetPage(nPageId); nCount=0; } aProperty.eKind=(eKindOfControl)(aKindOfListBox.GetSelectEntryPos()+1); - aProperty.bHasVisibleXButton=FALSE; - if((nCount % 5)==0) aProperty.bHasVisibleXButton=TRUE; + aProperty.bHasVisibleXButton=sal_False; + if((nCount % 5)==0) aProperty.bHasVisibleXButton=sal_True; aPropListBox.InsertEntry(aProperty); } return 0; @@ -1518,7 +1518,7 @@ IMPL_LINK( ScPropertyDlg, RowModifiedHdl, SvBasicPropertyDataControl* ,pProCtr) { aModAnswer.SetText(aBaProDatCtr.GetProperty()); aModAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } @@ -1529,7 +1529,7 @@ IMPL_LINK( ScPropertyDlg, CommitHdl, SvBasicPropertyDataControl*,pProCtr) { aCommitAnswer.SetText(aBaProDatCtr.GetProperty()); aCommitAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } @@ -1540,7 +1540,7 @@ IMPL_LINK( ScPropertyDlg, ClickHdl, SvBasicPropertyDataControl*,pProCtr) { aClickAnswer.SetText(aBaProDatCtr.GetName()); aClickAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } @@ -1551,7 +1551,7 @@ IMPL_LINK( ScPropertyDlg, SelectHdl, SvBasicPropertyDataControl*,pProCtr) { aSelectAnswer.SetText(aBaProDatCtr.GetName()); aSelectAnswer.Invalidate(); - aBaProDatCtr.SetIsCorrect(TRUE); + aBaProDatCtr.SetIsCorrect(sal_True); } return 0; } diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index f06b4f53ce7c..8787e39b1284 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -203,7 +203,7 @@ void WizardDialog::ImplPosCtrls() long nViewWidth = 0; long nViewHeight = 0; long nDlgHeight = nOffY; - USHORT nViewPosFlags = WINDOW_POSSIZE_POS; + sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS; if ( meViewAlign == WINDOWALIGN_TOP ) { nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X; @@ -338,9 +338,9 @@ void WizardDialog::ImplShowTabPage( TabPage* pTabPage ) // ----------------------------------------------------------------------- -TabPage* WizardDialog::ImplGetPage( USHORT nLevel ) const +TabPage* WizardDialog::ImplGetPage( sal_uInt16 nLevel ) const { - USHORT nTempLevel = 0; + sal_uInt16 nTempLevel = 0; ImplWizPageData* pPageData = mpFirstPage; while ( pPageData ) { @@ -447,7 +447,7 @@ long WizardDialog::Notify( NotifyEvent& rNEvt ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); KeyCode aKeyCode = pKEvt->GetKeyCode(); - USHORT nKeyCode = aKeyCode.GetCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); if ( aKeyCode.IsMod1() ) { @@ -458,11 +458,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt ) if ( mpPrevBtn->IsVisible() && mpPrevBtn->IsEnabled() && mpPrevBtn->IsInputEnabled() ) { - mpPrevBtn->SetPressed( TRUE ); - mpPrevBtn->SetPressed( FALSE ); + mpPrevBtn->SetPressed( sal_True ); + mpPrevBtn->SetPressed( sal_False ); mpPrevBtn->Click(); } - return TRUE; + return sal_True; } } else @@ -472,11 +472,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt ) if ( mpNextBtn->IsVisible() && mpNextBtn->IsEnabled() && mpNextBtn->IsInputEnabled() ) { - mpNextBtn->SetPressed( TRUE ); - mpNextBtn->SetPressed( FALSE ); + mpNextBtn->SetPressed( sal_True ); + mpNextBtn->SetPressed( sal_False ); mpNextBtn->Click(); } - return TRUE; + return sal_True; } } } @@ -499,43 +499,43 @@ long WizardDialog::DeactivatePage() if ( maDeactivateHdl.IsSet() ) return maDeactivateHdl.Call( this ); else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL WizardDialog::ShowNextPage() +sal_Bool WizardDialog::ShowNextPage() { return ShowPage( mnCurLevel+1 ); } // ----------------------------------------------------------------------- -BOOL WizardDialog::ShowPrevPage() +sal_Bool WizardDialog::ShowPrevPage() { if ( !mnCurLevel ) - return FALSE; + return sal_False; return ShowPage( mnCurLevel-1 ); } // ----------------------------------------------------------------------- -BOOL WizardDialog::ShowPage( USHORT nLevel ) +sal_Bool WizardDialog::ShowPage( sal_uInt16 nLevel ) { if ( DeactivatePage() ) { mnCurLevel = nLevel; ActivatePage(); ImplShowTabPage( ImplGetPage( mnCurLevel ) ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL WizardDialog::Finnish( long nResult ) +sal_Bool WizardDialog::Finnish( long nResult ) { if ( DeactivatePage() ) { @@ -546,10 +546,10 @@ BOOL WizardDialog::Finnish( long nResult ) EndDialog( nResult ); else if ( GetStyle() & WB_CLOSEABLE ) Close(); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -600,9 +600,9 @@ void WizardDialog::RemovePage( TabPage* pPage ) // ----------------------------------------------------------------------- -void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage ) +void WizardDialog::SetPage( sal_uInt16 nLevel, TabPage* pPage ) { - USHORT nTempLevel = 0; + sal_uInt16 nTempLevel = 0; ImplWizPageData* pPageData = mpFirstPage; while ( pPageData ) { @@ -623,9 +623,9 @@ void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage ) // ----------------------------------------------------------------------- -TabPage* WizardDialog::GetPage( USHORT nLevel ) const +TabPage* WizardDialog::GetPage( sal_uInt16 nLevel ) const { - USHORT nTempLevel = 0; + sal_uInt16 nTempLevel = 0; ImplWizPageData* pPageData = mpFirstPage; while ( pPageData ) { @@ -686,7 +686,7 @@ void WizardDialog::RemoveButton( Button* pButton ) // ----------------------------------------------------------------------- -void WizardDialog::ShowButtonFixedLine( BOOL bVisible ) +void WizardDialog::ShowButtonFixedLine( sal_Bool bVisible ) { if ( !mpFixedLine ) { @@ -701,7 +701,7 @@ void WizardDialog::ShowButtonFixedLine( BOOL bVisible ) // ----------------------------------------------------------------------- -BOOL WizardDialog::IsButtonFixedLineVisible() +sal_Bool WizardDialog::IsButtonFixedLineVisible() { return (mpFixedLine && mpFixedLine->IsVisible()); } diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index 01bb7ad41682..53d83075453a 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -68,12 +68,12 @@ void MultiLineEditSyntaxHighlight::SetText(const String& rNewText) UpdateData(); } -void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey) +void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey) { TextSelection aCurrentPos = GetTextView()->GetSelection(); xub_StrLen aStartPos = aCurrentPos.GetStart().GetIndex(); - ULONG nStartPara = aCurrentPos.GetStart().GetPara(); - USHORT aCount = 0; + sal_uIntPtr nStartPara = aCurrentPos.GetStart().GetPara(); + sal_uInt16 aCount = 0; int aChar = -1; switch (aKey) @@ -109,16 +109,16 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey) continue; String aLine( GetTextEngine()->GetText( aPara ) ); - for (USHORT i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (USHORT)(aLine.Len()-1); i>0; --i) + for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i) { if (aLine.GetChar(i)==aChar) { if (!aCount) { - GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, TRUE ); - GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, TRUE ); - GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, TRUE ); - GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, TRUE ); + GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, sal_True ); + GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, sal_True ); + GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, sal_True ); + GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, sal_True ); return; } else @@ -184,19 +184,19 @@ void MultiLineEditSyntaxHighlight::UpdateData() { // syntax highlighting // this must be possible improved by using notifychange correctly - BOOL bTempModified = GetTextEngine()->IsModified(); + sal_Bool bTempModified = GetTextEngine()->IsModified(); for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++) { String aLine( GetTextEngine()->GetText( nLine ) ); Range aChanges = aHighlighter.notifyChange( nLine, 0, &aLine, 1 ); - GetTextEngine()->RemoveAttribs( nLine, TRUE ); + GetTextEngine()->RemoveAttribs( nLine, sal_True ); HighlightPortions aPortions; aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); - for ( USHORT i = 0; i < aPortions.Count(); i++ ) + for ( sal_uInt16 i = 0; i < aPortions.Count(); i++ ) { HighlightPortion& r = aPortions[i]; - GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE ); + GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, sal_True ); } } GetTextView()->ShowCursor( false, true ); diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx index daaff472d1cc..dc87086922e1 100644 --- a/svtools/source/edit/svmedit.cxx +++ b/svtools/source/edit/svmedit.cxx @@ -65,11 +65,11 @@ private: ExtTextEngine* mpExtTextEngine; ExtTextView* mpExtTextView; - BOOL mbInMBDown; - BOOL mbFocusSelectionHide; - BOOL mbIgnoreTab; - BOOL mbActivePopup; - BOOL mbSelectOnTab; + sal_Bool mbInMBDown; + sal_Bool mbFocusSelectionHide; + sal_Bool mbIgnoreTab; + sal_Bool mbActivePopup; + sal_Bool mbSelectOnTab; public: TextWindow( Window* pParent ); @@ -91,17 +91,17 @@ public: virtual void GetFocus(); virtual void LoseFocus(); - BOOL IsAutoFocusHide() const { return mbFocusSelectionHide; } - void SetAutoFocusHide( BOOL bAutoHide ) { mbFocusSelectionHide = bAutoHide; } + sal_Bool IsAutoFocusHide() const { return mbFocusSelectionHide; } + void SetAutoFocusHide( sal_Bool bAutoHide ) { mbFocusSelectionHide = bAutoHide; } - BOOL IsIgnoreTab() const { return mbIgnoreTab; } - void SetIgnoreTab( BOOL bIgnore ) { mbIgnoreTab = bIgnore; } + sal_Bool IsIgnoreTab() const { return mbIgnoreTab; } + void SetIgnoreTab( sal_Bool bIgnore ) { mbIgnoreTab = bIgnore; } void DisableSelectionOnFocus() {mbSelectOnTab = sal_False;} virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > - GetComponentInterface(BOOL bCreate = TRUE); + GetComponentInterface(sal_Bool bCreate = sal_True); }; @@ -131,17 +131,17 @@ public: ImpSvMEdit( MultiLineEdit* pSvMultiLineEdit, WinBits nWinStyle ); ~ImpSvMEdit(); - void SetModified( BOOL bMod ); - BOOL IsModified() const; + void SetModified( sal_Bool bMod ); + sal_Bool IsModified() const; - void SetReadOnly( BOOL bRdOnly ); - BOOL IsReadOnly() const; + void SetReadOnly( sal_Bool bRdOnly ); + sal_Bool IsReadOnly() const; void SetMaxTextLen( xub_StrLen nLen ); xub_StrLen GetMaxTextLen() const; - void SetInsertMode( BOOL bInsert ); - BOOL IsInsertMode() const; + void SetInsertMode( sal_Bool bInsert ); + sal_Bool IsInsertMode() const; void InsertText( const String& rStr ); String GetSelected() const; @@ -163,13 +163,13 @@ public: void Resize(); void GetFocus(); - BOOL HandleCommand( const CommandEvent& rCEvt ); + sal_Bool HandleCommand( const CommandEvent& rCEvt ); - void Enable( BOOL bEnable ); + void Enable( sal_Bool bEnable ); Size CalcMinimumSize() const; - Size CalcSize( USHORT nColumns, USHORT nLines ) const; - void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const; + Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const; + void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const; void SetAlign( WinBits nWinStyle ); @@ -197,27 +197,27 @@ ImpSvMEdit::ImpSvMEdit( MultiLineEdit* pEdt, WinBits nWinStyle ) void ImpSvMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle ) { - const BOOL bHaveVScroll = (NULL != mpVScrollBar); - const BOOL bHaveHScroll = (NULL != mpHScrollBar); - const BOOL bHaveScrollBox = (NULL != mpScrollBox); + const sal_Bool bHaveVScroll = (NULL != mpVScrollBar); + const sal_Bool bHaveHScroll = (NULL != mpHScrollBar); + const sal_Bool bHaveScrollBox = (NULL != mpScrollBox); - BOOL bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL; - const BOOL bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL; + sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL; + const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL; - const BOOL bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL; + const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL; if ( !bNeedVScroll && bAutoVScroll ) { TextEngine& rEngine( *mpTextWindow->GetTextEngine() ); - ULONG nOverallTextHeight(0); - for ( ULONG i=0; i<rEngine.GetParagraphCount(); ++i ) + sal_uIntPtr nOverallTextHeight(0); + for ( sal_uIntPtr i=0; i<rEngine.GetParagraphCount(); ++i ) nOverallTextHeight += rEngine.GetTextHeight( i ); - if ( nOverallTextHeight > (ULONG)mpTextWindow->GetOutputSizePixel().Height() ) + if ( nOverallTextHeight > (sal_uIntPtr)mpTextWindow->GetOutputSizePixel().Height() ) bNeedVScroll = true; } - const BOOL bNeedScrollBox = bNeedVScroll && bNeedHScroll; + const sal_Bool bNeedScrollBox = bNeedVScroll && bNeedHScroll; - BOOL bScrollbarsChanged = false; + sal_Bool bScrollbarsChanged = false; if ( bHaveVScroll != bNeedVScroll ) { delete mpVScrollBar; @@ -268,22 +268,22 @@ void ImpSvMEdit::InitFromStyle( WinBits nWinStyle ) SetAlign( nWinStyle ); if ( nWinStyle & WB_NOHIDESELECTION ) - mpTextWindow->SetAutoFocusHide( FALSE ); + mpTextWindow->SetAutoFocusHide( sal_False ); else - mpTextWindow->SetAutoFocusHide( TRUE ); + mpTextWindow->SetAutoFocusHide( sal_True ); if ( nWinStyle & WB_READONLY ) - mpTextWindow->GetTextView()->SetReadOnly( TRUE ); + mpTextWindow->GetTextView()->SetReadOnly( sal_True ); else - mpTextWindow->GetTextView()->SetReadOnly( FALSE ); + mpTextWindow->GetTextView()->SetReadOnly( sal_False ); if ( nWinStyle & WB_IGNORETAB ) { - mpTextWindow->SetIgnoreTab( TRUE ); + mpTextWindow->SetIgnoreTab( sal_True ); } else { - mpTextWindow->SetIgnoreTab( FALSE ); + mpTextWindow->SetIgnoreTab( sal_False ); // #103667# MultiLineEdit has the flag, but focusable window also needs this flag WinBits nStyle = mpTextWindow->GetStyle(); nStyle |= WINDOW_DLGCTRL_MOD1TAB; @@ -304,14 +304,14 @@ void ImpSvMEdit::ImpSetScrollBarRanges() { if ( mpVScrollBar ) { - ULONG nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight(); + sal_uIntPtr nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight(); mpVScrollBar->SetRange( Range( 0, (long)nTextHeight-1 ) ); } if ( mpHScrollBar ) { -// ULONG nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); +// sal_uIntPtr nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); // Es gibt kein Notify bei Breiten-Aenderung... -// ULONG nW = Max( (ULONG)mpTextWindow->GetOutputSizePixel().Width()*5, (ULONG)nTextWidth ); +// sal_uIntPtr nW = Max( (sal_uIntPtr)mpTextWindow->GetOutputSizePixel().Width()*5, (sal_uIntPtr)nTextWidth ); // mpHScrollBar->SetRange( Range( 0, (long)nW ) ); mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth-1 ) ); } @@ -364,7 +364,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar ) nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos(); mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY ); - // mpTextWindow->GetTextView()->ShowCursor( FALSE, TRUE ); + // mpTextWindow->GetTextView()->ShowCursor( sal_False, sal_True ); return 0; } @@ -378,7 +378,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar ) void ImpSvMEdit::SetAlign( WinBits nWinStyle ) { - BOOL bRTL = Application::GetSettings().GetLayoutRTL(); + sal_Bool bRTL = Application::GetSettings().GetLayoutRTL(); mpTextWindow->GetTextEngine()->SetRightToLeft( bRTL ); if ( nWinStyle & WB_CENTER ) @@ -395,28 +395,28 @@ void ImpSvMEdit::SetTextWindowOffset( const Point& rOffset ) Resize(); } -void ImpSvMEdit::SetModified( BOOL bMod ) +void ImpSvMEdit::SetModified( sal_Bool bMod ) { mpTextWindow->GetTextEngine()->SetModified( bMod ); } -BOOL ImpSvMEdit::IsModified() const +sal_Bool ImpSvMEdit::IsModified() const { return mpTextWindow->GetTextEngine()->IsModified(); } -void ImpSvMEdit::SetInsertMode( BOOL bInsert ) +void ImpSvMEdit::SetInsertMode( sal_Bool bInsert ) { mpTextWindow->GetTextView()->SetInsertMode( bInsert ); } -void ImpSvMEdit::SetReadOnly( BOOL bRdOnly ) +void ImpSvMEdit::SetReadOnly( sal_Bool bRdOnly ) { mpTextWindow->GetTextView()->SetReadOnly( bRdOnly ); // Farbe anpassen ??????????????????????????? } -BOOL ImpSvMEdit::IsReadOnly() const +sal_Bool ImpSvMEdit::IsReadOnly() const { return mpTextWindow->GetTextView()->IsReadOnly(); } @@ -533,10 +533,10 @@ void ImpSvMEdit::Paste() void ImpSvMEdit::SetText( const String& rStr ) { - BOOL bWasModified = mpTextWindow->GetTextEngine()->IsModified(); + sal_Bool bWasModified = mpTextWindow->GetTextEngine()->IsModified(); mpTextWindow->GetTextEngine()->SetText( rStr ); if ( !bWasModified ) - mpTextWindow->GetTextEngine()->SetModified( FALSE ); + mpTextWindow->GetTextEngine()->SetModified( sal_False ); mpTextWindow->GetTextView()->SetSelection( TextSelection() ); @@ -593,7 +593,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( mpHScrollBar ) { - ULONG nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); + sal_uIntPtr nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth(); if ( nWidth != mnTextWidth ) { mnTextWidth = sal::static_int_cast< xub_StrLen >(nWidth); @@ -625,9 +625,9 @@ void ImpSvMEdit::SetSelection( const Selection& rSelection ) long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() ); TextSelection aTextSel; - ULONG nPara = 0; - USHORT nChar = 0; - USHORT x = 0; + sal_uIntPtr nPara = 0; + sal_uInt16 nChar = 0; + sal_uInt16 x = 0; while ( x <= nEnd ) { if ( x == aNewSelection.Min() ) @@ -656,7 +656,7 @@ const Selection& ImpSvMEdit::GetSelection() const ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine(); // Absaetze davor: - ULONG n; + sal_uIntPtr n; for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ ) { maSelection.Min() += pExtTextEngine->GetTextLen( n ); @@ -691,7 +691,7 @@ Size ImpSvMEdit::CalcMinimumSize() const return aSz; } -Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const +Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const { static const sal_Unicode sampleText[] = { 'X', '\0' }; @@ -718,16 +718,16 @@ Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const return aSz; } -void ImpSvMEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const +void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { static const sal_Unicode sampleText[] = { 'x', '\0' }; Size aOutSz = mpTextWindow->GetOutputSizePixel(); Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() ); - rnCols = (USHORT) (aOutSz.Width()/aCharSz.Width()); - rnLines = (USHORT) (aOutSz.Height()/aCharSz.Height()); + rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width()); + rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height()); } -void ImpSvMEdit::Enable( BOOL bEnable ) +void ImpSvMEdit::Enable( sal_Bool bEnable ) { mpTextWindow->Enable( bEnable ); if ( mpHScrollBar ) @@ -736,15 +736,15 @@ void ImpSvMEdit::Enable( BOOL bEnable ) mpVScrollBar->Enable( bEnable ); } -BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt ) +sal_Bool ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) || ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) || ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) ) { mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar ); - bDone = TRUE; + bDone = sal_True; } return bDone; } @@ -752,12 +752,12 @@ BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt ) TextWindow::TextWindow( Window* pParent ) : Window( pParent ) { - mbInMBDown = FALSE; - mbSelectOnTab = TRUE; - mbFocusSelectionHide = FALSE; - mbIgnoreTab = FALSE; - mbActivePopup = FALSE; - mbSelectOnTab = TRUE; + mbInMBDown = sal_False; + mbSelectOnTab = sal_True; + mbFocusSelectionHide = sal_False; + mbIgnoreTab = sal_False; + mbActivePopup = sal_False; + mbSelectOnTab = sal_True; SetPointer( Pointer( POINTER_TEXT ) ); @@ -768,7 +768,7 @@ TextWindow::TextWindow( Window* pParent ) : Window( pParent ) mpExtTextEngine->SetLocale( GetSettings().GetLocale() ); mpExtTextView = new ExtTextView( mpExtTextEngine, this ); mpExtTextEngine->InsertView( mpExtTextView ); - mpExtTextEngine->EnableUndo( TRUE ); + mpExtTextEngine->EnableUndo( sal_True ); mpExtTextView->ShowCursor(); Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor(); @@ -790,11 +790,11 @@ void TextWindow::MouseMove( const MouseEvent& rMEvt ) void TextWindow::MouseButtonDown( const MouseEvent& rMEvt ) { - mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren wird + mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren wird mpExtTextView->MouseButtonDown( rMEvt ); Window::MouseButtonDown( rMEvt ); GrabFocus(); - mbInMBDown = FALSE; + mbInMBDown = sal_False; } void TextWindow::MouseButtonUp( const MouseEvent& rMEvt ) @@ -805,29 +805,29 @@ void TextWindow::MouseButtonUp( const MouseEvent& rMEvt ) void TextWindow::KeyInput( const KeyEvent& rKEvent ) { - BOOL bDone = FALSE; - USHORT nCode = rKEvent.GetKeyCode().GetCode(); + sal_Bool bDone = sal_False; + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); if ( nCode == com::sun::star::awt::Key::SELECT_ALL || ( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() ) ) { mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) ); - bDone = TRUE; + bDone = sal_True; } else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() ) { if ( Edit::GetGetSpecialCharsFunction() ) { // Damit die Selektion erhalten bleibt - mbActivePopup = TRUE; + mbActivePopup = sal_True; XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() ); if ( aChars.Len() ) { mpExtTextView->InsertText( aChars ); - mpExtTextView->GetTextEngine()->SetModified( TRUE ); + mpExtTextView->GetTextEngine()->SetModified( sal_True ); } - mbActivePopup = FALSE; - bDone = TRUE; + mbActivePopup = sal_False; + bDone = sal_True; } } else if ( nCode == KEY_TAB ) @@ -863,33 +863,33 @@ void TextWindow::Command( const CommandEvent& rCEvt ) pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES ); if ( !mpExtTextView->HasSelection() ) { - pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE ); + pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False ); } if ( mpExtTextView->IsReadOnly() ) { - pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE ); - pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE ); + pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False ); + pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False ); } if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() ) { - pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE ); + pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False ); } // if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) ) // { -// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE ); +// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False ); // } if ( !Edit::GetGetSpecialCharsFunction() ) { - USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL ); + sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL ); pPopup->RemoveItem( nPos ); pPopup->RemoveItem( nPos-1 ); } - mbActivePopup = TRUE; + mbActivePopup = sal_True; Point aPos = rCEvt.GetMousePosPixel(); if ( !rCEvt.IsMouseEvent() ) { @@ -898,26 +898,26 @@ void TextWindow::Command( const CommandEvent& rCEvt ) aPos = Point( aSize.Width()/2, aSize.Height()/2 ); } // pPopup->RemoveDisabledEntries(); - USHORT n = pPopup->Execute( this, aPos ); + sal_uInt16 n = pPopup->Execute( this, aPos ); Edit::DeletePopupMenu( pPopup ); switch ( n ) { case SV_MENU_EDIT_UNDO: mpExtTextView->Undo(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_CUT: mpExtTextView->Cut(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_COPY: mpExtTextView->Copy(); break; case SV_MENU_EDIT_PASTE: mpExtTextView->Paste(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_DELETE: mpExtTextView->DeleteSelected(); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); break; case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) ); @@ -928,13 +928,13 @@ void TextWindow::Command( const CommandEvent& rCEvt ) if ( aChars.Len() ) { mpExtTextView->InsertText( aChars ); - mpExtTextEngine->SetModified( TRUE ); + mpExtTextEngine->SetModified( sal_True ); mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); } } break; } - mbActivePopup = FALSE; + mbActivePopup = sal_False; } else { @@ -948,19 +948,19 @@ void TextWindow::GetFocus() Window::GetFocus(); if ( !mbActivePopup ) { - BOOL bGotoCursor = !mpExtTextView->IsReadOnly(); + sal_Bool bGotoCursor = !mpExtTextView->IsReadOnly(); if ( mbFocusSelectionHide && IsReallyVisible() && !mpExtTextView->IsReadOnly() && ( mbSelectOnTab && (!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_FOCUS ) )) ) { // Alles selektieren, aber nicht scrollen - BOOL bAutoScroll = mpExtTextView->IsAutoScroll(); - mpExtTextView->SetAutoScroll( FALSE ); + sal_Bool bAutoScroll = mpExtTextView->IsAutoScroll(); + mpExtTextView->SetAutoScroll( sal_False ); mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) ); mpExtTextView->SetAutoScroll( bAutoScroll ); - bGotoCursor = FALSE; + bGotoCursor = sal_False; } - mpExtTextView->SetPaintSelection( TRUE ); + mpExtTextView->SetPaintSelection( sal_True ); mpExtTextView->ShowCursor( bGotoCursor ); } } @@ -970,12 +970,12 @@ void TextWindow::LoseFocus() Window::LoseFocus(); if ( mbFocusSelectionHide && !mbActivePopup ) - mpExtTextView->SetPaintSelection( FALSE ); + mpExtTextView->SetPaintSelection( sal_False ); } // virtual ::css::uno::Reference< ::css::awt::XWindowPeer > -TextWindow::GetComponentInterface(BOOL bCreate) +TextWindow::GetComponentInterface(sal_Bool bCreate) { ::css::uno::Reference< ::css::awt::XWindowPeer > xPeer( Window::GetComponentInterface(false)); @@ -992,10 +992,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, WinBits nWinStyle ) { SetType( WINDOW_MULTILINEEDIT ); pImpSvMEdit = new ImpSvMEdit( this, nWinStyle ); - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); pUpdateDataTimer = 0; - SetCompoundControl( TRUE ); + SetCompoundControl( sal_True ); SetStyle( ImplInitStyle( nWinStyle ) ); } @@ -1005,10 +1005,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId ) SetType( WINDOW_MULTILINEEDIT ); WinBits nWinStyle = rResId.GetWinBits(); pImpSvMEdit = new ImpSvMEdit( this, nWinStyle ); - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); pUpdateDataTimer = 0; - USHORT nMaxLen = Edit::GetMaxTextLen(); + sal_uInt16 nMaxLen = Edit::GetMaxTextLen(); if ( nMaxLen ) SetMaxTextLen( nMaxLen ); @@ -1017,7 +1017,7 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId ) if ( IsVisible() ) pImpSvMEdit->Resize(); - SetCompoundControl( TRUE ); + SetCompoundControl( sal_True ); SetStyle( ImplInitStyle( nWinStyle ) ); // Base Edit ctor could call Show already, but that would cause problems @@ -1052,7 +1052,7 @@ WinBits MultiLineEdit::ImplInitStyle( WinBits nStyle ) } -void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL bBackground ) +void MultiLineEdit::ImplInitSettings( sal_Bool /*bFont*/, sal_Bool /*bForeground*/, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -1084,7 +1084,7 @@ void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL { if( IsPaintTransparent() ) { - pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE ); + pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True ); pImpSvMEdit->GetTextWindow()->SetBackground(); pImpSvMEdit->GetTextWindow()->SetControlBackground(); SetBackground(); @@ -1126,20 +1126,20 @@ void MultiLineEdit::UpdateData() void MultiLineEdit::SetModifyFlag() { - pImpSvMEdit->SetModified( TRUE ); + pImpSvMEdit->SetModified( sal_True ); } void MultiLineEdit::ClearModifyFlag() { - pImpSvMEdit->SetModified( FALSE ); + pImpSvMEdit->SetModified( sal_False ); } -BOOL MultiLineEdit::IsModified() const +sal_Bool MultiLineEdit::IsModified() const { return pImpSvMEdit->IsModified(); } -void MultiLineEdit::EnableUpdateData( ULONG nTimeout ) +void MultiLineEdit::EnableUpdateData( sal_uIntPtr nTimeout ) { if ( !nTimeout ) DisableUpdateData(); @@ -1154,7 +1154,7 @@ void MultiLineEdit::EnableUpdateData( ULONG nTimeout ) } } -void MultiLineEdit::SetReadOnly( BOOL bReadOnly ) +void MultiLineEdit::SetReadOnly( sal_Bool bReadOnly ) { pImpSvMEdit->SetReadOnly( bReadOnly ); Edit::SetReadOnly( bReadOnly ); @@ -1168,7 +1168,7 @@ void MultiLineEdit::SetReadOnly( BOOL bReadOnly ) SetStyle( nStyle ); } -BOOL MultiLineEdit::IsReadOnly() const +sal_Bool MultiLineEdit::IsReadOnly() const { return pImpSvMEdit->IsReadOnly(); } @@ -1299,7 +1299,7 @@ Size MultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const return aSz; } -Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const +Size MultiLineEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const { Size aSz = pImpSvMEdit->CalcSize( nColumns, nLines ); @@ -1310,7 +1310,7 @@ Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const return aSz; } -void MultiLineEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const +void MultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { pImpSvMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines ); } @@ -1320,7 +1320,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType ) if( nType == STATE_CHANGE_ENABLE ) { pImpSvMEdit->Enable( IsEnabled() ); - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); } else if( nType == STATE_CHANGE_READONLY ) { @@ -1329,23 +1329,23 @@ void MultiLineEdit::StateChanged( StateChangedType nType ) else if ( nType == STATE_CHANGE_ZOOM ) { pImpSvMEdit->GetTextWindow()->SetZoom( GetZoom() ); - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Resize(); } else if ( nType == STATE_CHANGE_CONTROLFONT ) { - ImplInitSettings( TRUE, FALSE, FALSE ); + ImplInitSettings( sal_True, sal_False, sal_False ); Resize(); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } else if ( nType == STATE_CHANGE_STYLE ) @@ -1357,7 +1357,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType ) { if( IsPaintTransparent() ) { - pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE ); + pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True ); pImpSvMEdit->GetTextWindow()->SetBackground(); pImpSvMEdit->GetTextWindow()->SetControlBackground(); SetBackground(); @@ -1373,7 +1373,7 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Resize(); Invalidate(); } @@ -1381,14 +1381,14 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt ) Control::DataChanged( rDCEvt ); } -void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags ) +void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uIntPtr nFlags ) { - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); Font aFont = pImpSvMEdit->GetTextWindow()->GetDrawPixelFont( pDev ); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); OutDevType eOutDevType = pDev->GetOutDevType(); pDev->Push(); @@ -1399,8 +1399,8 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi // Border/Background pDev->SetLineColor(); pDev->SetFillColor(); - BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER); - BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground(); + sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER); + sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground(); if ( bBorder || bBackground ) { Rectangle aRect( aPos, aSize ); @@ -1434,7 +1434,7 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi XubString aText = GetText(); Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() ); - ULONG nLines = (ULONG) (aSize.Height() / aTextSz.Height()); + sal_uIntPtr nLines = (sal_uIntPtr) (aSize.Height() / aTextSz.Height()); if ( !nLines ) nLines = 1; aTextSz.Height() = nLines*aTextSz.Height(); @@ -1588,24 +1588,24 @@ ScrollBar* MultiLineEdit::GetVScrollBar() const return pImpSvMEdit->GetVScrollBar(); } -void MultiLineEdit::EnableFocusSelectionHide( BOOL bHide ) +void MultiLineEdit::EnableFocusSelectionHide( sal_Bool bHide ) { pImpSvMEdit->GetTextWindow()->SetAutoFocusHide( bHide ); } -BOOL MultiLineEdit::IsFocusSelectionHideEnabled() const +sal_Bool MultiLineEdit::IsFocusSelectionHideEnabled() const { return pImpSvMEdit->GetTextWindow()->IsAutoFocusHide(); } -void MultiLineEdit::SetLeftMargin( USHORT n ) +void MultiLineEdit::SetLeftMargin( sal_uInt16 n ) { if ( GetTextEngine() ) GetTextEngine()->SetLeftMargin( n ); } -USHORT MultiLineEdit::GetLeftMargin() const +sal_uInt16 MultiLineEdit::GetLeftMargin() const { if ( GetTextEngine() ) return GetTextEngine()->GetLeftMargin(); @@ -1613,7 +1613,7 @@ USHORT MultiLineEdit::GetLeftMargin() const return 0; } -void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft ) +void MultiLineEdit::SetRightToLeft( sal_Bool bRightToLeft ) { if ( GetTextEngine() ) { @@ -1622,9 +1622,9 @@ void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft ) } } -BOOL MultiLineEdit::IsRightToLeft() const +sal_Bool MultiLineEdit::IsRightToLeft() const { - BOOL bRightToLeft = FALSE; + sal_Bool bRightToLeft = sal_False; if ( GetTextEngine() ) bRightToLeft = GetTextEngine()->IsRightToLeft(); @@ -1634,7 +1634,7 @@ BOOL MultiLineEdit::IsRightToLeft() const // virtual ::css::uno::Reference< ::css::awt::XWindowPeer > -MultiLineEdit::GetComponentInterface(BOOL bCreate) +MultiLineEdit::GetComponentInterface(sal_Bool bCreate) { ::css::uno::Reference< ::css::awt::XWindowPeer > xPeer( Edit::GetComponentInterface(false)); diff --git a/svtools/source/edit/svmedit2.cxx b/svtools/source/edit/svmedit2.cxx index 19eba618a828..f63487cc17bb 100644 --- a/svtools/source/edit/svmedit2.cxx +++ b/svtools/source/edit/svmedit2.cxx @@ -49,32 +49,32 @@ ExtMultiLineEdit::~ExtMultiLineEdit() { } -void ExtMultiLineEdit::InsertText( const String& rNew, BOOL ) +void ExtMultiLineEdit::InsertText( const String& rNew, sal_Bool ) { - GetTextView()->InsertText( rNew, FALSE ); + GetTextView()->InsertText( rNew, sal_False ); } -void ExtMultiLineEdit::SetAutoScroll( BOOL bAutoScroll ) +void ExtMultiLineEdit::SetAutoScroll( sal_Bool bAutoScroll ) { GetTextView()->SetAutoScroll( bAutoScroll ); } -void ExtMultiLineEdit::EnableCursor( BOOL bEnable ) +void ExtMultiLineEdit::EnableCursor( sal_Bool bEnable ) { GetTextView()->EnableCursor( bEnable ); } -void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd ) +void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, sal_uIntPtr nPara, sal_uInt16 nStart, sal_uInt16 nEnd ) { GetTextEngine()->SetAttrib( rAttr, nPara, nStart, nEnd ); } -void ExtMultiLineEdit::SetLeftMargin( USHORT nLeftMargin ) +void ExtMultiLineEdit::SetLeftMargin( sal_uInt16 nLeftMargin ) { GetTextEngine()->SetLeftMargin( nLeftMargin ); } -ULONG ExtMultiLineEdit::GetParagraphCount() const +sal_uIntPtr ExtMultiLineEdit::GetParagraphCount() const { return GetTextEngine()->GetParagraphCount(); } diff --git a/svtools/source/edit/sychconv.cxx b/svtools/source/edit/sychconv.cxx index 3efa510bfc5a..2ce9a3702519 100644 --- a/svtools/source/edit/sychconv.cxx +++ b/svtools/source/edit/sychconv.cxx @@ -30,14 +30,14 @@ #include "sychconv.hxx" #include <vcl/outdev.hxx> -BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev ) +sal_Bool SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev ) { // hibyte 0 = exact matching // 1 = little differences, // 2 = the converted character does not look like the original but got the same meaning // 3 = the destination does not match looking and meaning of the original - static USHORT __READONLY_DATA aWingdingsToStarBatsTable[ 256 - 32 ] = + static sal_uInt16 __READONLY_DATA aWingdingsToStarBatsTable[ 256 - 32 ] = { 0x0020, 0x0238, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0174, 0x02BA, 0x017B, 0x017C, 0x037C, 0x037C, 0x037C, 0x037C, 0x0000, 0x0000, 0x0372, 0x0272, 0x0372, 0x0000, 0x0000, 0x0374, 0x0279, 0x0000, 0x027A, 0x0000, 0x0178, 0x0278, 0x0000, 0x0137, @@ -55,7 +55,7 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p 0x01AF, 0x01B2, 0x01B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0150, 0x0032, 0x0033, 0x0034, 0x01C8 }; - static USHORT __READONLY_DATA aMonotypeSortsToStarBatsTable[ 256 - 32 ]= + static sal_uInt16 __READONLY_DATA aMonotypeSortsToStarBatsTable[ 256 - 32 ]= { 0x0020, 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x0074, 0x00ba, 0x0021, 0x00cc, 0x007b, 0x0036, 0x007d, 0x007e, 0x0037, 0x0038, 0x0038, 0x0039, 0x0038, 0x0038, 0x0039, 0x003a, 0x004f, 0x0050, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0086, 0x0086, 0x0086, @@ -73,9 +73,9 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p 0x0000, 0x00af, 0x0035, 0x00dc, 0x00da, 0x00dc, 0x00db, 0x00da, 0x00dc, 0x00db, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00af, 0x0000 }; - const USHORT* pTransTable = NULL; + const sal_uInt16* pTransTable = NULL; - BOOL bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : FALSE; + sal_Bool bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : sal_False; if ( !bIsAvailable ) { if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Wingdings" ) ) == COMPARE_EQUAL ) @@ -86,18 +86,18 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p if ( pTransTable ) { sal_Unicode c; - for ( UINT16 i = rString.Len(); i--; ) + for ( sal_uInt16 i = rString.Len(); i--; ) { c = rString.GetChar( i ); c -= 32; - c = ( ((UINT16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ]; + c = ( ((sal_uInt16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ]; if ( !c ) // if character is out of range or not matching c = 0xA5; // we will default a StarBats-Bullet rString.SetChar( i, c ); } rFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); rFont.SetName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarBats" ) ) ); - return TRUE; + return sal_True; } - else return FALSE; + else return sal_False; }; diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 5729eb712bfe..8343ce3a0121 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -259,22 +259,22 @@ class BasicSimpleCharClass static LetterTable aLetterTable; public: - static BOOL isAlpha( sal_Unicode c, bool bCompatible ) + static sal_Bool isAlpha( sal_Unicode c, bool bCompatible ) { - BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') + sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (bCompatible && aLetterTable.isLetter( c )); return bRet; } - static BOOL isDigit( sal_Unicode c ) + static sal_Bool isDigit( sal_Unicode c ) { - BOOL bRet = (c >= '0' && c <= '9'); + sal_Bool bRet = (c >= '0' && c <= '9'); return bRet; } - static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible ) + static sal_Bool isAlphaNumeric( sal_Unicode c, bool bCompatible ) { - BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible ); + sal_Bool bRet = isDigit( c ) || isAlpha( c, bCompatible ); return bRet; } }; @@ -286,67 +286,67 @@ LetterTable::LetterTable( void ) for( int i = 0 ; i < 256 ; ++i ) IsLetterTab[i] = false; - IsLetterTab[0xC0] = true; // , CAPITAL LETTER A WITH GRAVE ACCENT - IsLetterTab[0xC1] = true; // , CAPITAL LETTER A WITH ACUTE ACCENT - IsLetterTab[0xC2] = true; // , CAPITAL LETTER A WITH CIRCUMFLEX ACCENT - IsLetterTab[0xC3] = true; // , CAPITAL LETTER A WITH TILDE - IsLetterTab[0xC4] = true; // , CAPITAL LETTER A WITH DIAERESIS - IsLetterTab[0xC5] = true; // , CAPITAL LETTER A WITH RING ABOVE - IsLetterTab[0xC6] = true; // , CAPITAL LIGATURE AE - IsLetterTab[0xC7] = true; // , CAPITAL LETTER C WITH CEDILLA - IsLetterTab[0xC8] = true; // , CAPITAL LETTER E WITH GRAVE ACCENT - IsLetterTab[0xC9] = true; // , CAPITAL LETTER E WITH ACUTE ACCENT - IsLetterTab[0xCA] = true; // , CAPITAL LETTER E WITH CIRCUMFLEX ACCENT - IsLetterTab[0xCB] = true; // , CAPITAL LETTER E WITH DIAERESIS - IsLetterTab[0xCC] = true; // , CAPITAL LETTER I WITH GRAVE ACCENT - IsLetterTab[0xCD] = true; // , CAPITAL LETTER I WITH ACUTE ACCENT - IsLetterTab[0xCE] = true; // , CAPITAL LETTER I WITH CIRCUMFLEX ACCENT - IsLetterTab[0xCF] = true; // , CAPITAL LETTER I WITH DIAERESIS - IsLetterTab[0xD0] = true; // , CAPITAL LETTER ETH - IsLetterTab[0xD1] = true; // , CAPITAL LETTER N WITH TILDE - IsLetterTab[0xD2] = true; // , CAPITAL LETTER O WITH GRAVE ACCENT - IsLetterTab[0xD3] = true; // , CAPITAL LETTER O WITH ACUTE ACCENT - IsLetterTab[0xD4] = true; // , CAPITAL LETTER O WITH CIRCUMFLEX ACCENT - IsLetterTab[0xD5] = true; // , CAPITAL LETTER O WITH TILDE - IsLetterTab[0xD6] = true; // , CAPITAL LETTER O WITH DIAERESIS - IsLetterTab[0xD8] = true; // , CAPITAL LETTER O WITH STROKE - IsLetterTab[0xD9] = true; // , CAPITAL LETTER U WITH GRAVE ACCENT - IsLetterTab[0xDA] = true; // , CAPITAL LETTER U WITH ACUTE ACCENT - IsLetterTab[0xDB] = true; // , CAPITAL LETTER U WITH CIRCUMFLEX ACCENT - IsLetterTab[0xDC] = true; // , CAPITAL LETTER U WITH DIAERESIS - IsLetterTab[0xDD] = true; // , CAPITAL LETTER Y WITH ACUTE ACCENT - IsLetterTab[0xDE] = true; // , CAPITAL LETTER THORN - IsLetterTab[0xDF] = true; // , SMALL LETTER SHARP S - IsLetterTab[0xE0] = true; // , SMALL LETTER A WITH GRAVE ACCENT - IsLetterTab[0xE1] = true; // , SMALL LETTER A WITH ACUTE ACCENT - IsLetterTab[0xE2] = true; // , SMALL LETTER A WITH CIRCUMFLEX ACCENT - IsLetterTab[0xE3] = true; // , SMALL LETTER A WITH TILDE - IsLetterTab[0xE4] = true; // , SMALL LETTER A WITH DIAERESIS - IsLetterTab[0xE5] = true; // , SMALL LETTER A WITH RING ABOVE - IsLetterTab[0xE6] = true; // , SMALL LIGATURE AE - IsLetterTab[0xE7] = true; // , SMALL LETTER C WITH CEDILLA - IsLetterTab[0xE8] = true; // , SMALL LETTER E WITH GRAVE ACCENT - IsLetterTab[0xE9] = true; // , SMALL LETTER E WITH ACUTE ACCENT - IsLetterTab[0xEA] = true; // , SMALL LETTER E WITH CIRCUMFLEX ACCENT - IsLetterTab[0xEB] = true; // , SMALL LETTER E WITH DIAERESIS - IsLetterTab[0xEC] = true; // , SMALL LETTER I WITH GRAVE ACCENT - IsLetterTab[0xED] = true; // , SMALL LETTER I WITH ACUTE ACCENT - IsLetterTab[0xEE] = true; // , SMALL LETTER I WITH CIRCUMFLEX ACCENT - IsLetterTab[0xEF] = true; // , SMALL LETTER I WITH DIAERESIS - IsLetterTab[0xF0] = true; // , SMALL LETTER ETH - IsLetterTab[0xF1] = true; // , SMALL LETTER N WITH TILDE - IsLetterTab[0xF2] = true; // , SMALL LETTER O WITH GRAVE ACCENT - IsLetterTab[0xF3] = true; // , SMALL LETTER O WITH ACUTE ACCENT - IsLetterTab[0xF4] = true; // , SMALL LETTER O WITH CIRCUMFLEX ACCENT - IsLetterTab[0xF5] = true; // , SMALL LETTER O WITH TILDE - IsLetterTab[0xF6] = true; // , SMALL LETTER O WITH DIAERESIS - IsLetterTab[0xF8] = true; // , SMALL LETTER O WITH OBLIQUE BAR - IsLetterTab[0xF9] = true; // , SMALL LETTER U WITH GRAVE ACCENT - IsLetterTab[0xFA] = true; // , SMALL LETTER U WITH ACUTE ACCENT - IsLetterTab[0xFB] = true; // , SMALL LETTER U WITH CIRCUMFLEX ACCENT - IsLetterTab[0xFC] = true; // , SMALL LETTER U WITH DIAERESIS - IsLetterTab[0xFD] = true; // , SMALL LETTER Y WITH ACUTE ACCENT - IsLetterTab[0xFE] = true; // , SMALL LETTER THORN + IsLetterTab[0xC0] = true; // ?, CAPITAL LETTER A WITH GRAVE ACCENT + IsLetterTab[0xC1] = true; // ?, CAPITAL LETTER A WITH ACUTE ACCENT + IsLetterTab[0xC2] = true; // ?, CAPITAL LETTER A WITH CIRCUMFLEX ACCENT + IsLetterTab[0xC3] = true; // ?, CAPITAL LETTER A WITH TILDE + IsLetterTab[0xC4] = true; // ?, CAPITAL LETTER A WITH DIAERESIS + IsLetterTab[0xC5] = true; // ?, CAPITAL LETTER A WITH RING ABOVE + IsLetterTab[0xC6] = true; // ?, CAPITAL LIGATURE AE + IsLetterTab[0xC7] = true; // ?, CAPITAL LETTER C WITH CEDILLA + IsLetterTab[0xC8] = true; // ?, CAPITAL LETTER E WITH GRAVE ACCENT + IsLetterTab[0xC9] = true; // ?, CAPITAL LETTER E WITH ACUTE ACCENT + IsLetterTab[0xCA] = true; // ?, CAPITAL LETTER E WITH CIRCUMFLEX ACCENT + IsLetterTab[0xCB] = true; // ?, CAPITAL LETTER E WITH DIAERESIS + IsLetterTab[0xCC] = true; // ?, CAPITAL LETTER I WITH GRAVE ACCENT + IsLetterTab[0xCD] = true; // ?, CAPITAL LETTER I WITH ACUTE ACCENT + IsLetterTab[0xCE] = true; // ?, CAPITAL LETTER I WITH CIRCUMFLEX ACCENT + IsLetterTab[0xCF] = true; // ?, CAPITAL LETTER I WITH DIAERESIS + IsLetterTab[0xD0] = true; // ?, CAPITAL LETTER ETH + IsLetterTab[0xD1] = true; // ?, CAPITAL LETTER N WITH TILDE + IsLetterTab[0xD2] = true; // ?, CAPITAL LETTER O WITH GRAVE ACCENT + IsLetterTab[0xD3] = true; // ?, CAPITAL LETTER O WITH ACUTE ACCENT + IsLetterTab[0xD4] = true; // ?, CAPITAL LETTER O WITH CIRCUMFLEX ACCENT + IsLetterTab[0xD5] = true; // ?, CAPITAL LETTER O WITH TILDE + IsLetterTab[0xD6] = true; // ?, CAPITAL LETTER O WITH DIAERESIS + IsLetterTab[0xD8] = true; // ?, CAPITAL LETTER O WITH STROKE + IsLetterTab[0xD9] = true; // ?, CAPITAL LETTER U WITH GRAVE ACCENT + IsLetterTab[0xDA] = true; // ?, CAPITAL LETTER U WITH ACUTE ACCENT + IsLetterTab[0xDB] = true; // ?, CAPITAL LETTER U WITH CIRCUMFLEX ACCENT + IsLetterTab[0xDC] = true; // ?, CAPITAL LETTER U WITH DIAERESIS + IsLetterTab[0xDD] = true; // ?, CAPITAL LETTER Y WITH ACUTE ACCENT + IsLetterTab[0xDE] = true; // ?, CAPITAL LETTER THORN + IsLetterTab[0xDF] = true; // ?, SMALL LETTER SHARP S + IsLetterTab[0xE0] = true; // ?, SMALL LETTER A WITH GRAVE ACCENT + IsLetterTab[0xE1] = true; // ?, SMALL LETTER A WITH ACUTE ACCENT + IsLetterTab[0xE2] = true; // ?, SMALL LETTER A WITH CIRCUMFLEX ACCENT + IsLetterTab[0xE3] = true; // ?, SMALL LETTER A WITH TILDE + IsLetterTab[0xE4] = true; // ?, SMALL LETTER A WITH DIAERESIS + IsLetterTab[0xE5] = true; // ?, SMALL LETTER A WITH RING ABOVE + IsLetterTab[0xE6] = true; // ?, SMALL LIGATURE AE + IsLetterTab[0xE7] = true; // ?, SMALL LETTER C WITH CEDILLA + IsLetterTab[0xE8] = true; // ?, SMALL LETTER E WITH GRAVE ACCENT + IsLetterTab[0xE9] = true; // ?, SMALL LETTER E WITH ACUTE ACCENT + IsLetterTab[0xEA] = true; // ?, SMALL LETTER E WITH CIRCUMFLEX ACCENT + IsLetterTab[0xEB] = true; // ?, SMALL LETTER E WITH DIAERESIS + IsLetterTab[0xEC] = true; // ?, SMALL LETTER I WITH GRAVE ACCENT + IsLetterTab[0xED] = true; // ?, SMALL LETTER I WITH ACUTE ACCENT + IsLetterTab[0xEE] = true; // ?, SMALL LETTER I WITH CIRCUMFLEX ACCENT + IsLetterTab[0xEF] = true; // ?, SMALL LETTER I WITH DIAERESIS + IsLetterTab[0xF0] = true; // ?, SMALL LETTER ETH + IsLetterTab[0xF1] = true; // ?, SMALL LETTER N WITH TILDE + IsLetterTab[0xF2] = true; // ?, SMALL LETTER O WITH GRAVE ACCENT + IsLetterTab[0xF3] = true; // ?, SMALL LETTER O WITH ACUTE ACCENT + IsLetterTab[0xF4] = true; // ?, SMALL LETTER O WITH CIRCUMFLEX ACCENT + IsLetterTab[0xF5] = true; // ?, SMALL LETTER O WITH TILDE + IsLetterTab[0xF6] = true; // ?, SMALL LETTER O WITH DIAERESIS + IsLetterTab[0xF8] = true; // ?, SMALL LETTER O WITH OBLIQUE BAR + IsLetterTab[0xF9] = true; // ?, SMALL LETTER U WITH GRAVE ACCENT + IsLetterTab[0xFA] = true; // ?, SMALL LETTER U WITH ACUTE ACCENT + IsLetterTab[0xFB] = true; // ?, SMALL LETTER U WITH CIRCUMFLEX ACCENT + IsLetterTab[0xFC] = true; // ?, SMALL LETTER U WITH DIAERESIS + IsLetterTab[0xFD] = true; // ?, SMALL LETTER Y WITH ACUTE ACCENT + IsLetterTab[0xFE] = true; // ?, SMALL LETTER THORN IsLetterTab[0xFF] = true; // , SMALL LETTER Y WITH DIAERESIS } @@ -361,7 +361,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c ) } // Hilfsfunktion: Zeichen-Flag Testen -BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags ) +sal_Bool SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags ) { bool bRet = false; if( c != 0 && c <= 255 ) @@ -376,14 +376,14 @@ BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags ) return bRet; } -void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, UINT16 nCount ) +void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, sal_uInt16 nCount ) { ppListKeyWords = ppKeyWords; nKeyWordCount = nCount; } // Neues Token holen -BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, +sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, /*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos ) { reType = TT_UNKNOWN; @@ -394,25 +394,25 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Zeichen untersuchen sal_Unicode c = peekChar(); if( c == CHAR_EOF ) - return FALSE; + return sal_False; // Zeichen lesen getChar(); //*** Alle Moeglichkeiten durchgehen *** // Space? - if ( (testCharFlags( c, CHAR_SPACE ) == TRUE) ) + if ( (testCharFlags( c, CHAR_SPACE ) == sal_True) ) { - while( testCharFlags( peekChar(), CHAR_SPACE ) == TRUE ) + while( testCharFlags( peekChar(), CHAR_SPACE ) == sal_True ) getChar(); reType = TT_WHITESPACE; } // Identifier? - else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == TRUE) ) + else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == sal_True) ) { - BOOL bIdentifierChar; + sal_Bool bIdentifierChar; do { // Naechstes Zeichen holen @@ -455,7 +455,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen sal_Unicode cPeek = peekChar(); - while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) { c = getChar(); cPeek = peekChar(); @@ -470,14 +470,14 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Operator? // only for BASIC '\'' should be a comment, otherwise it is a normal string and handled there - else if ( ( testCharFlags( c, CHAR_OPERATOR ) == TRUE ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) ) + else if ( ( testCharFlags( c, CHAR_OPERATOR ) == sal_True ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) ) { // paramters for SQL view if ( (c==':') || (c=='?')) { if (c!='?') { - BOOL bIdentifierChar; + sal_Bool bIdentifierChar; do { // Naechstes Zeichen holen @@ -496,7 +496,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if (cPeekNext=='-') { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen - while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE ) + while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False ) { getChar(); cPeekNext = peekChar(); @@ -510,7 +510,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if (cPeekNext=='/') { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen - while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE ) + while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False ) { getChar(); cPeekNext = peekChar(); @@ -527,7 +527,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // Alle Zeichen bis Zeilen-Ende oder EOF entfernen sal_Unicode cPeek = peekChar(); - while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False ) { getChar(); cPeek = peekChar(); @@ -554,7 +554,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, } // Zahl? - else if( testCharFlags( c, CHAR_START_NUMBER ) == TRUE ) + else if( testCharFlags( c, CHAR_START_NUMBER ) == sal_True ) { reType = TT_NUMBER; @@ -596,7 +596,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if( reType == TT_NUMBER && nRadix == 10 ) { // Flag, ob das letzte Zeichen ein Exponent war - BOOL bAfterExpChar = FALSE; + sal_Bool bAfterExpChar = sal_False; // Alle Ziffern einlesen while( testCharFlags( peekChar(), CHAR_IN_NUMBER ) || @@ -613,7 +613,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, } // String? - else if( testCharFlags( c, CHAR_START_STRING ) == TRUE ) + else if( testCharFlags( c, CHAR_START_STRING ) == sal_True ) { // Merken, welches Zeichen den String eroeffnet hat sal_Unicode cEndString = c; @@ -631,7 +631,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, break; } c = getChar(); - if( testCharFlags( c, CHAR_EOL ) == TRUE ) + if( testCharFlags( c, CHAR_EOL ) == sal_True ) { // ERROR: unterminated string literal reType = TT_ERROR; @@ -651,11 +651,11 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, } // Zeilenende? - else if( testCharFlags( c, CHAR_EOL ) == TRUE ) + else if( testCharFlags( c, CHAR_EOL ) == sal_True ) { // Falls ein weiteres anderes EOL-Char folgt, weg damit sal_Unicode cNext = peekChar(); - if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE ) + if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == sal_True ) getChar(); // Positions-Daten auf Zeilen-Beginn setzen @@ -670,13 +670,13 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, // End-Position eintragen rpEndPos = mpActualPos; - return TRUE; + return sal_True; } String SimpleTokenizer_Impl::getTokStr ( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ) { - return String( pStartPos, (USHORT)( pEndPos - pStartPos ) ); + return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); } #ifdef DBG_UTIL @@ -701,7 +701,7 @@ String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType, } if( eType != TT_EOL ) { - aOut += String( pStartPos, (USHORT)( pEndPos - pStartPos ) ); + aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); } aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") ); return aOut; @@ -713,10 +713,10 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) ); // Zeichen-Tabelle fuellen - USHORT i; + sal_uInt16 i; // Zulaessige Zeichen fuer Identifier - USHORT nHelpMask = (USHORT)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER ); + sal_uInt16 nHelpMask = (sal_uInt16)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER ); for( i = 'a' ; i <= 'z' ; i++ ) aCharTypeTab[i] |= nHelpMask; for( i = 'A' ; i <= 'Z' ; i++ ) @@ -727,7 +727,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua aCharTypeTab[(int)'$'] |= nHelpMask; // Ziffern (Identifier und Number ist moeglich) - nHelpMask = (USHORT)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER | + nHelpMask = (sal_uInt16)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER | CHAR_IN_NUMBER | CHAR_IN_HEX_NUMBER ); for( i = '0' ; i <= '9' ; i++ ) aCharTypeTab[i] |= nHelpMask; @@ -735,7 +735,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua // e und E sowie . von Hand ergaenzen aCharTypeTab[(int)'e'] |= CHAR_IN_NUMBER; aCharTypeTab[(int)'E'] |= CHAR_IN_NUMBER; - aCharTypeTab[(int)'.'] |= (USHORT)( CHAR_IN_NUMBER | CHAR_START_NUMBER ); + aCharTypeTab[(int)'.'] |= (sal_uInt16)( CHAR_IN_NUMBER | CHAR_START_NUMBER ); aCharTypeTab[(int)'&'] |= CHAR_START_NUMBER; // Hex-Ziffern @@ -803,7 +803,7 @@ SimpleTokenizer_Impl* getSimpleTokenizer( void ) } // Heraussuchen der jeweils naechsten Funktion aus einem JavaScript-Modul -UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource ) +sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const String* aSource ) { // Position auf den Anfang des Source-Strings setzen mpStringBegin = mpActualPos = aSource->GetBuffer(); @@ -818,14 +818,14 @@ UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource const sal_Unicode* pEndPos; // Schleife ueber alle Tokens - UINT16 nTokenCount = 0; + sal_uInt16 nTokenCount = 0; while( getNextToken( eType, pStartPos, pEndPos ) ) nTokenCount++; return nTokenCount; } -void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String& rLine, +void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const String& rLine, /*out*/HighlightPortions& portions ) { // Position auf den Anfang des Source-Strings setzen @@ -845,8 +845,8 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String { HighlightPortion portion; - portion.nBegin = (UINT16)(pStartPos - mpStringBegin); - portion.nEnd = (UINT16)(pEndPos - mpStringBegin); + portion.nBegin = (sal_uInt16)(pStartPos - mpStringBegin); + portion.nEnd = (sal_uInt16)(pEndPos - mpStringBegin); portion.tokenType = eType; portions.Insert(portion, portions.Count()); @@ -891,18 +891,18 @@ void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ ) } } -const Range SyntaxHighlighter::notifyChange( UINT32 nLine, INT32 nLineCountDifference, - const String* pChangedLines, UINT32 nArrayLength) +const Range SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference, + const String* pChangedLines, sal_uInt32 nArrayLength) { (void)nLineCountDifference; - for( UINT32 i=0 ; i < nArrayLength ; i++ ) + for( sal_uInt32 i=0 ; i < nArrayLength ; i++ ) m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]); return Range( nLine, nLine + nArrayLength-1 ); } -void SyntaxHighlighter::getHighlightPortions( UINT32 nLine, const String& rLine, +void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const String& rLine, /*out*/HighlightPortions& portions ) { m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions ); diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx index 222e8abee5a4..17b4454a109f 100644 --- a/svtools/source/edit/textdat2.hxx +++ b/svtools/source/edit/textdat2.hxx @@ -56,35 +56,35 @@ class TextView; class TETextPortion { private: - USHORT nLen; + sal_uInt16 nLen; long nWidth; - BYTE nKind; - BYTE nRightToLeft; + sal_uInt8 nKind; + sal_uInt8 nRightToLeft; TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;} public: - TETextPortion( USHORT nL ) { + TETextPortion( sal_uInt16 nL ) { nLen = nL; nKind = PORTIONKIND_TEXT; nWidth= -1; nRightToLeft = 0; } - USHORT GetLen() const { return nLen; } - USHORT& GetLen() { return nLen; } + sal_uInt16 GetLen() const { return nLen; } + sal_uInt16& GetLen() { return nLen; } long GetWidth()const { return nWidth; } long& GetWidth() { return nWidth; } - BYTE GetKind() const { return nKind; } - BYTE& GetKind() { return nKind; } + sal_uInt8 GetKind() const { return nKind; } + sal_uInt8& GetKind() { return nKind; } - BYTE GetRightToLeft() const { return nRightToLeft; } - BYTE& GetRightToLeft() { return nRightToLeft; } - BOOL IsRightToLeft() const { return (nRightToLeft&1); } + sal_uInt8 GetRightToLeft() const { return nRightToLeft; } + sal_uInt8& GetRightToLeft() { return nRightToLeft; } + sal_Bool IsRightToLeft() const { return (nRightToLeft&1); } - BOOL HasValidSize() const { return nWidth != (-1); } + sal_Bool HasValidSize() const { return nWidth != (-1); } }; @@ -99,17 +99,17 @@ public: ~TETextPortionList(); void Reset(); - USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); - USHORT GetPortionStartIndex( USHORT nPortion ); - void DeleteFromPortion( USHORT nDelFrom ); + sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False ); + sal_uInt16 GetPortionStartIndex( sal_uInt16 nPortion ); + void DeleteFromPortion( sal_uInt16 nDelFrom ); }; struct TEWritingDirectionInfo { - BYTE nType; - USHORT nStartPos; - USHORT nEndPos; - TEWritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End ) + sal_uInt8 nType; + sal_uInt16 nStartPos; + sal_uInt16 nEndPos; + TEWritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End ) { nType = _Type; nStartPos = _Start; @@ -122,65 +122,65 @@ SV_DECL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo, 0, 4 ) class TextLine { private: - USHORT mnStart; - USHORT mnEnd; - USHORT mnStartPortion; - USHORT mnEndPortion; + sal_uInt16 mnStart; + sal_uInt16 mnEnd; + sal_uInt16 mnStartPortion; + sal_uInt16 mnEndPortion; short mnStartX; - BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe + sal_Bool mbInvalid; // fuer geschickte Formatierung/Ausgabe public: TextLine() { mnStart = mnEnd = 0; mnStartPortion = mnEndPortion = 0; mnStartX = 0; - mbInvalid = TRUE; + mbInvalid = sal_True; } - BOOL IsIn( USHORT nIndex ) const + sal_Bool IsIn( sal_uInt16 nIndex ) const { return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); } - BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const + sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const { return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); } - void SetStart( USHORT n ) { mnStart = n; } - USHORT GetStart() const { return mnStart; } - USHORT& GetStart() { return mnStart; } + void SetStart( sal_uInt16 n ) { mnStart = n; } + sal_uInt16 GetStart() const { return mnStart; } + sal_uInt16& GetStart() { return mnStart; } - void SetEnd( USHORT n ) { mnEnd = n; } - USHORT GetEnd() const { return mnEnd; } - USHORT& GetEnd() { return mnEnd; } + void SetEnd( sal_uInt16 n ) { mnEnd = n; } + sal_uInt16 GetEnd() const { return mnEnd; } + sal_uInt16& GetEnd() { return mnEnd; } - void SetStartPortion( USHORT n ) { mnStartPortion = n; } - USHORT GetStartPortion() const { return mnStartPortion; } - USHORT& GetStartPortion() { return mnStartPortion; } + void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; } + sal_uInt16 GetStartPortion() const { return mnStartPortion; } + sal_uInt16& GetStartPortion() { return mnStartPortion; } - void SetEndPortion( USHORT n ) { mnEndPortion = n; } - USHORT GetEndPortion() const { return mnEndPortion; } - USHORT& GetEndPortion() { return mnEndPortion; } + void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; } + sal_uInt16 GetEndPortion() const { return mnEndPortion; } + sal_uInt16& GetEndPortion() { return mnEndPortion; } - USHORT GetLen() const { return mnEnd - mnStart; } + sal_uInt16 GetLen() const { return mnEnd - mnStart; } - BOOL IsInvalid() const { return mbInvalid; } - BOOL IsValid() const { return !mbInvalid; } - void SetInvalid() { mbInvalid = TRUE; } - void SetValid() { mbInvalid = FALSE; } + sal_Bool IsInvalid() const { return mbInvalid; } + sal_Bool IsValid() const { return !mbInvalid; } + void SetInvalid() { mbInvalid = sal_True; } + void SetValid() { mbInvalid = sal_False; } - BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; } + sal_Bool IsEmpty() const { return (mnEnd > mnStart) ? sal_False : sal_True; } short GetStartX() const { return mnStartX; } void SetStartX( short n ) { mnStartX = n; } - inline BOOL operator == ( const TextLine& rLine ) const; - inline BOOL operator != ( const TextLine& rLine ) const; + inline sal_Bool operator == ( const TextLine& rLine ) const; + inline sal_Bool operator != ( const TextLine& rLine ) const; }; typedef TextLine* TextLinePtr; SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1, 4 ) -inline BOOL TextLine::operator == ( const TextLine& rLine ) const +inline sal_Bool TextLine::operator == ( const TextLine& rLine ) const { return ( ( mnStart == rLine.mnStart ) && ( mnEnd == rLine.mnEnd ) && @@ -188,7 +188,7 @@ inline BOOL TextLine::operator == ( const TextLine& rLine ) const ( mnEndPortion == rLine.mnEndPortion ) ); } -inline BOOL TextLine::operator != ( const TextLine& rLine ) const +inline sal_Bool TextLine::operator != ( const TextLine& rLine ) const { return !( *this == rLine ); } @@ -205,11 +205,11 @@ private: TEWritingDirectionInfos maWritingDirectionInfos; - USHORT mnInvalidPosStart; + sal_uInt16 mnInvalidPosStart; short mnInvalidDiff; - BOOL mbInvalid; - BOOL mbSimple; // nur lineares Tippen + sal_Bool mbInvalid; + sal_Bool mbSimple; // nur lineares Tippen TEParaPortion( const TEParaPortion& ) {;} @@ -219,15 +219,15 @@ public: ~TEParaPortion(); - BOOL IsInvalid() const { return mbInvalid; } - BOOL IsSimpleInvalid() const { return mbSimple; } - void SetNotSimpleInvalid() { mbSimple = FALSE; } - void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;} + sal_Bool IsInvalid() const { return mbInvalid; } + sal_Bool IsSimpleInvalid() const { return mbSimple; } + void SetNotSimpleInvalid() { mbSimple = sal_False; } + void SetValid() { mbInvalid = sal_False; mbSimple = sal_True;} - void MarkInvalid( USHORT nStart, short nDiff); - void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); + void MarkInvalid( sal_uInt16 nStart, short nDiff); + void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd ); - USHORT GetInvalidPosStart() const { return mnInvalidPosStart; } + sal_uInt16 GetInvalidPosStart() const { return mnInvalidPosStart; } short GetInvalidDiff() const { return mnInvalidDiff; } TextNode* GetNode() const { return mpNode; } @@ -236,8 +236,8 @@ public: TEWritingDirectionInfos& GetWritingDirectionInfos() { return maWritingDirectionInfos; } - USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd ); - void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); + sal_uInt16 GetLineNumber( sal_uInt16 nIndex, sal_Bool bInclEnd ); + void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ); }; @@ -262,9 +262,9 @@ public: virtual void CreateAnchor(); - virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE ); + virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False ); - virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); + virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); virtual void DeselectAll(); virtual void DeselectAtPoint( const Point& ); @@ -276,13 +276,13 @@ class IdleFormatter : public Timer { private: TextView* mpView; - USHORT mnRestarts; + sal_uInt16 mnRestarts; public: IdleFormatter(); ~IdleFormatter(); - void DoIdleFormat( TextView* pV, USHORT nMaxRestarts ); + void DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts ); void ForceTimeout(); TextView* GetView() { return mpView; } }; @@ -292,14 +292,14 @@ struct TextDDInfo Cursor maCursor; TextPaM maDropPos; - BOOL mbStarterOfDD; - BOOL mbVisCursor; + sal_Bool mbStarterOfDD; + sal_Bool mbVisCursor; TextDDInfo() { maCursor.SetStyle( CURSOR_SHADOW ); - mbStarterOfDD = FALSE; - mbVisCursor = FALSE; + mbStarterOfDD = sal_False; + mbVisCursor = sal_False; } }; diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx index 32bdfe40a3fb..1f3f62d20e9d 100644 --- a/svtools/source/edit/textdata.cxx +++ b/svtools/source/edit/textdata.cxx @@ -80,24 +80,24 @@ TETextPortionList::~TETextPortionList() void TETextPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } -void TETextPortionList::DeleteFromPortion( USHORT nDelFrom ) +void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom ) { DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" ); - for ( USHORT nP = nDelFrom; nP < Count(); nP++ ) + for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ ) delete GetObject( nP ); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion ) +sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion ) { // Bei nCharPos an Portion-Grenze wird die linke Portion gefunden - USHORT nTmpPos = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + sal_uInt16 nTmpPos = 0; + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { TETextPortion* pPortion = GetObject( nPortion ); nTmpPos = nTmpPos + pPortion->GetLen(); @@ -116,10 +116,10 @@ USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, B } /* -USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion ) +sal_uInt16 TETextPortionList::GetPortionStartIndex( sal_uInt16 nPortion ) { - USHORT nPos = 0; - for ( USHORT nP = 0; nP < nPortion; nP++ ) + sal_uInt16 nPos = 0; + for ( sal_uInt16 nP = 0; nP < nPortion; nP++ ) { TETextPortion* pPortion = GetObject( nP ); nPos += pPortion->GetLen(); @@ -136,17 +136,17 @@ TEParaPortion::TEParaPortion( TextNode* pN ) { mpNode = pN; mnInvalidPosStart = mnInvalidDiff = 0; - mbInvalid = TRUE; - mbSimple = FALSE; + mbInvalid = sal_True; + mbSimple = sal_False; } TEParaPortion::~TEParaPortion() { } -void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff ) +void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) { - if ( mbInvalid == FALSE ) + if ( mbInvalid == sal_False ) { mnInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); mnInvalidDiff = nDiff; @@ -168,20 +168,20 @@ void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff ) else { DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - mnInvalidPosStart = Min( mnInvalidPosStart, (USHORT) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); + mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); mnInvalidDiff = 0; - mbSimple = FALSE; + mbSimple = sal_False; } } maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() ); - mbInvalid = TRUE; + mbInvalid = sal_True; } -void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ ) +void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ ) { - if ( mbInvalid == FALSE ) + if ( mbInvalid == sal_False ) { mnInvalidPosStart = nStart; // nInvalidPosEnd = nEnd; @@ -195,13 +195,13 @@ void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ ) maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() ); mnInvalidDiff = 0; - mbInvalid = TRUE; - mbSimple = FALSE; + mbInvalid = sal_True; + mbSimple = sal_False; } -USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd ) +sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd ) { - for ( USHORT nLine = 0; nLine < maLines.Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < maLines.Count(); nLine++ ) { TextLine* pLine = maLines.GetObject( nLine ); if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) || @@ -218,9 +218,9 @@ USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd ) } -void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ) +void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ) { - USHORT nLines = maLines.Count(); + sal_uInt16 nLines = maLines.Count(); DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { @@ -238,7 +238,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 )); if ( nPDiff || nTDiff ) { - for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ ) + for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) { TextLine* pLine = maLines[ nL ]; @@ -288,7 +288,7 @@ IdleFormatter::~IdleFormatter() mpView = 0; } -void IdleFormatter::DoIdleFormat( TextView* pV, USHORT nMaxRestarts ) +void IdleFormatter::DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts ) { mpView = pV; @@ -318,12 +318,12 @@ void IdleFormatter::ForceTimeout() TYPEINIT1( TextHint, SfxSimpleHint ); -TextHint::TextHint( ULONG Id ) : SfxSimpleHint( Id ) +TextHint::TextHint( sal_uIntPtr Id ) : SfxSimpleHint( Id ) { mnValue = 0; } -TextHint::TextHint( ULONG Id, ULONG nValue ) : SfxSimpleHint( Id ) +TextHint::TextHint( sal_uIntPtr Id, sal_uIntPtr nValue ) : SfxSimpleHint( Id ) { mnValue = nValue; } @@ -333,9 +333,9 @@ TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos { aPos = rPos; nLen = 0; - bCursor = TRUE; + bCursor = sal_True; pAttribs = NULL; - bWasCursorOverwrite = FALSE; + bWasCursorOverwrite = sal_False; } TEIMEInfos::~TEIMEInfos() @@ -343,12 +343,12 @@ TEIMEInfos::~TEIMEInfos() delete[] pAttribs; } -void TEIMEInfos::CopyAttribs( const USHORT* pA, USHORT nL ) +void TEIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL ) { nLen = nL; delete pAttribs; - pAttribs = new USHORT[ nL ]; - memcpy( pAttribs, pA, nL*sizeof(USHORT) ); + pAttribs = new sal_uInt16[ nL ]; + memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) ); } void TEIMEInfos::DestroyAttribs() diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index d4470904077e..26b72450c267 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -66,7 +66,7 @@ CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- // (+) class TextCharAttrib // ------------------------------------------------------------------------- -TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd ) +TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) { mpAttr = rAttr.Clone(); mnStart = nStart, @@ -91,7 +91,7 @@ TextCharAttrib::~TextCharAttrib() TextCharAttribList::TextCharAttribList() { - mbHasEmptyAttribs = FALSE; + mbHasEmptyAttribs = sal_False; } TextCharAttribList::~TextCharAttribList() @@ -99,7 +99,7 @@ TextCharAttribList::~TextCharAttribList() // PTRARR_DEL } -void TextCharAttribList::Clear( BOOL bDestroyAttribs ) +void TextCharAttribList::Clear( sal_Bool bDestroyAttribs ) { if ( bDestroyAttribs ) TextCharAttribs::DeleteAndDestroy( 0, Count() ); @@ -111,18 +111,18 @@ void TextCharAttribList::Clear( BOOL bDestroyAttribs ) void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib ) { if ( pAttrib->IsEmpty() ) - mbHasEmptyAttribs = TRUE; + mbHasEmptyAttribs = sal_True; - const USHORT nCount = Count(); - const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. - BOOL bInserted = FALSE; - for ( USHORT x = 0; x < nCount; x++ ) + const sal_uInt16 nCount = Count(); + const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. + sal_Bool bInserted = sal_False; + for ( sal_uInt16 x = 0; x < nCount; x++ ) { TextCharAttrib* pCurAttrib = GetObject( x ); if ( pCurAttrib->GetStart() > nStart ) { Insert( pAttrib, x ); - bInserted = TRUE; + bInserted = sal_True; break; } } @@ -136,12 +136,12 @@ void TextCharAttribList::ResortAttribs() qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart ); } -TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) +TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { TextCharAttrib* pAttr = GetObject( --nAttr ); @@ -154,11 +154,11 @@ TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) return NULL; } -TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const +TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos ) const { DBG_ASSERT( nWhich, "FindNextAttrib: Which?" ); - const USHORT nAttribs = Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( ( pAttr->GetStart() >= nFromPos ) && @@ -169,41 +169,41 @@ TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromP return NULL; } -BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const +sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const { - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { const TextCharAttrib* pAttr = GetObject( --nAttr ); if ( pAttr->Which() == nWhich ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound ) +sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { TextCharAttrib* pAttr = GetObject( --nAttr ); if ( pAttr->GetEnd() < nBound ) - return FALSE; + return sal_False; if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) +TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { if ( !mbHasEmptyAttribs ) return 0; - const USHORT nAttribs = Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->GetStart() > nPos ) @@ -217,7 +217,7 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos void TextCharAttribList::DeleteEmptyAttribs() { - for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->IsEmpty() ) @@ -227,19 +227,19 @@ void TextCharAttribList::DeleteEmptyAttribs() nAttr--; } } - mbHasEmptyAttribs = FALSE; + mbHasEmptyAttribs = sal_False; } #ifdef DBG_UTIL -BOOL TextCharAttribList::DbgCheckAttribs() +sal_Bool TextCharAttribList::DbgCheckAttribs() { - BOOL bOK = TRUE; - for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ ) + sal_Bool bOK = sal_True; + for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->GetStart() > pAttr->GetEnd() ) { - bOK = FALSE; + bOK = sal_False; DBG_ERROR( "Attr verdreht" ); } } @@ -256,14 +256,14 @@ TextNode::TextNode( const String& rText ) : { } -void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) +void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) { if ( !nNew ) return; - BOOL bResort = FALSE; - USHORT nAttribs = maCharAttribs.Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_Bool bResort = sal_False; + sal_uInt16 nAttribs = maCharAttribs.Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); if ( pAttrib->GetEnd() >= nIndex ) @@ -294,7 +294,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) pAttrib->Expand( nNew ); } else - bResort = TRUE; + bResort = sal_True; } // 2: Attribut startet davor, geht hinter Index... else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -307,7 +307,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) if ( nIndex == 0 ) { pAttrib->Expand( nNew ); -// bResort = TRUE; // es gibt ja keine Features mehr... +// bResort = sal_True; // es gibt ja keine Features mehr... } else pAttrib->MoveForward( nNew ); @@ -327,18 +327,18 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) #endif } -void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) +void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) { if ( !nDeleted ) return; - BOOL bResort = FALSE; - USHORT nEndChanges = nIndex+nDeleted; + sal_Bool bResort = sal_False; + sal_uInt16 nEndChanges = nIndex+nDeleted; - for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); - BOOL bDelAttr = FALSE; + sal_Bool bDelAttr = sal_False; if ( pAttrib->GetEnd() >= nIndex ) { // Alles Attribute hinter der Einfuegeposition verschieben... @@ -354,7 +354,7 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) pAttrib->GetEnd() = nIndex; // leer else - bDelAttr = TRUE; + bDelAttr = sal_True; } // 2. Attribut beginnt davor, endet drinnen oder dahinter... else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -377,13 +377,13 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" ); if ( bDelAttr /* || pAttrib->IsEmpty() */ ) { - bResort = TRUE; + bResort = sal_True; maCharAttribs.RemoveAttrib( nAttr ); delete pAttrib; nAttr--; } else if ( pAttrib->IsEmpty() ) - maCharAttribs.HasEmptyAttribs() = TRUE; + maCharAttribs.HasEmptyAttribs() = sal_True; } if ( bResort ) @@ -394,25 +394,25 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) #endif } -void TextNode::InsertText( USHORT nPos, const String& rText ) +void TextNode::InsertText( sal_uInt16 nPos, const String& rText ) { maText.Insert( rText, nPos ); ExpandAttribs( nPos, rText.Len() ); } -void TextNode::InsertText( USHORT nPos, sal_Unicode c ) +void TextNode::InsertText( sal_uInt16 nPos, sal_Unicode c ) { maText.Insert( c, nPos ); ExpandAttribs( nPos, 1 ); } -void TextNode::RemoveText( USHORT nPos, USHORT nChars ) +void TextNode::RemoveText( sal_uInt16 nPos, sal_uInt16 nChars ) { maText.Erase( nPos, nChars ); CollapsAttribs( nPos, nChars ); } -TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) +TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs ) { String aNewText; if ( nPos < maText.Len() ) @@ -422,7 +422,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) } TextNode* pNew = new TextNode( aNewText ); - for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); if ( pAttrib->GetEnd() < nPos ) @@ -470,7 +470,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) void TextNode::Append( const TextNode& rNode ) { - USHORT nOldLen = maText.Len(); + sal_uInt16 nOldLen = maText.Len(); maText += rNode.GetText(); @@ -478,16 +478,16 @@ void TextNode::Append( const TextNode& rNode ) DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" ); #endif - const USHORT nAttribs = rNode.GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr ); - BOOL bMelted = FALSE; + sal_Bool bMelted = sal_False; if ( pAttrib->GetStart() == 0 ) { // Evtl koennen Attribute zusammengefasst werden: - USHORT nTmpAttribs = maCharAttribs.Count(); - for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) + sal_uInt16 nTmpAttribs = maCharAttribs.Count(); + for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) { TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr ); @@ -498,7 +498,7 @@ void TextNode::Append( const TextNode& rNode ) { pTmpAttrib->GetEnd() = pTmpAttrib->GetEnd() + pAttrib->GetLen(); - bMelted = TRUE; + bMelted = sal_True; break; // es kann nur eins von der Sorte an der Stelle geben } } @@ -540,15 +540,15 @@ void TextDoc::Clear() void TextDoc::DestroyTextNodes() { - for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ ) + for ( sal_uIntPtr nNode = 0; nNode < maTextNodes.Count(); nNode++ ) delete maTextNodes.GetObject( nNode ); maTextNodes.clear(); } String TextDoc::GetText( const sal_Unicode* pSep ) const { - ULONG nLen = GetTextLen( pSep ); - ULONG nNodes = maTextNodes.Count(); + sal_uIntPtr nLen = GetTextLen( pSep ); + sal_uIntPtr nNodes = maTextNodes.Count(); if ( nLen > STRING_MAXLEN ) { @@ -557,8 +557,8 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const } String aASCIIText; - ULONG nLastNode = nNodes-1; - for ( ULONG nNode = 0; nNode < nNodes; nNode++ ) + sal_uIntPtr nLastNode = nNodes-1; + for ( sal_uIntPtr nNode = 0; nNode < nNodes; nNode++ ) { TextNode* pNode = maTextNodes.GetObject( nNode ); String aTmp( pNode->GetText() ); @@ -570,7 +570,7 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const return aASCIIText; } -XubString TextDoc::GetText( ULONG nPara ) const +XubString TextDoc::GetText( sal_uIntPtr nPara ) const { XubString aText; TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0; @@ -581,26 +581,26 @@ XubString TextDoc::GetText( ULONG nPara ) const } -ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const +sal_uIntPtr TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const { - ULONG nLen = 0; - ULONG nNodes = maTextNodes.Count(); + sal_uIntPtr nLen = 0; + sal_uIntPtr nNodes = maTextNodes.Count(); if ( nNodes ) { - ULONG nStartNode = 0; - ULONG nEndNode = nNodes-1; + sal_uIntPtr nStartNode = 0; + sal_uIntPtr nEndNode = nNodes-1; if ( pSel ) { nStartNode = pSel->GetStart().GetPara(); nEndNode = pSel->GetEnd().GetPara(); } - for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uIntPtr nNode = nStartNode; nNode <= nEndNode; nNode++ ) { TextNode* pNode = maTextNodes.GetObject( nNode ); - USHORT nS = 0; - ULONG nE = pNode->GetText().Len(); + sal_uInt16 nS = 0; + sal_uIntPtr nE = pNode->GetText().Len(); if ( pSel && ( nNode == pSel->GetStart().GetPara() ) ) nS = pSel->GetStart().GetIndex(); if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) ) @@ -640,7 +640,7 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr ) return aPaM; } -TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) +TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ) { TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() ); TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs ); @@ -653,20 +653,20 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight ) { - USHORT nPrevLen = pLeft->GetText().Len(); + sal_uInt16 nPrevLen = pLeft->GetText().Len(); pLeft->Append( *pRight ); // der rechte verschwindet. - ULONG nRight = maTextNodes.GetPos( pRight ); + sal_uIntPtr nRight = maTextNodes.GetPos( pRight ); maTextNodes.Remove( nRight ); delete pRight; - ULONG nLeft = maTextNodes.GetPos( pLeft ); + sal_uIntPtr nLeft = maTextNodes.GetPos( pLeft ); TextPaM aPaM( nLeft, nPrevLen ); return aPaM; } -TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars ) +TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars ) { TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() ); pNode->RemoveText( rPaM.GetIndex(), nChars ); @@ -674,25 +674,25 @@ TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars ) return rPaM; } -BOOL TextDoc::IsValidPaM( const TextPaM& rPaM ) +sal_Bool TextDoc::IsValidPaM( const TextPaM& rPaM ) { if ( rPaM.GetPara() >= maTextNodes.Count() ) { DBG_ERROR( "PaM: Para out of range" ); - return FALSE; + return sal_False; } TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() ); if ( rPaM.GetIndex() > pNode->GetText().Len() ) { DBG_ERROR( "PaM: Index out of range" ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } /* -void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void TextDoc::InsertAttribInSelection( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -728,14 +728,14 @@ void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nE pNode->GetCharAttribs().ResortAttribs(); } -BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich ) +sal_Bool TextDoc::RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich ) { TextCharAttrib* pStarting; TextCharAttrib* pEnding; return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich ); } -BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich ) +sal_Bool TextDoc::RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -745,22 +745,22 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh // dieses startet am Ende der Selektion => kann erweitert werden rpStarting = 0; - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" ); // ueber die Attribute iterieren... - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { - BOOL bRemoveAttrib = FALSE; + sal_Bool bRemoveAttrib = sal_False; if ( !nWhich || ( pAttr->Which() == nWhich ) ) { // Attribut beginnt in Selection if ( ( pAttr->GetStart() >= nStart ) && ( pAttr->GetStart() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetEnd() > nEnd ) { pAttr->GetStart() = nEnd; // dann faengt es dahinter an @@ -770,14 +770,14 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Feature nur loeschen, wenn genau an der Stelle - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribut endet in Selection else if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetEnd() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() ) { pAttr->GetEnd() = nStart; // dann hoert es hier auf @@ -786,13 +786,13 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Feature nur loeschen, wenn genau an der Stelle - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribut ueberlappt die Selektion else if ( ( pAttr->GetStart() <= nStart ) && ( pAttr->GetEnd() >= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetStart() == nStart ) { pAttr->GetStart() = nEnd; @@ -807,10 +807,10 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh } else // Attribut muss gesplittet werden... { - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; rpEnding = pAttr; -// ULONG nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos(); +// sal_uIntPtr nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos(); InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); // pNode->GetCharAttribs().GetStartList().Seek( nSavePos ); break; // es kann weitere Attribute geben! @@ -833,14 +833,14 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh #pragma SEG_FUNCDEF(editdoc_3f) -void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHORT nStart, USHORT nEnd ) +void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ) { // Diese Methode prueft nicht mehr, ob ein entspr. Attribut // schon an der Stelle existiert! // pruefen, ob neues Attrib oder einfach nur Ende eines Attribs... // const SfxPoolItem& rDefItem = pNode->GetContentAttribs().GetItem( rPoolItem.Which() ); -// BOOL bCreateAttrib = ( rDefItem != rPoolItem ); +// sal_Bool bCreateAttrib = ( rDefItem != rPoolItem ); // Durch den Verlust der Exclude-Liste geht es nicht mehr, dass ich // kein neues Attribut benoetige und nur das alte nicht expandiere... @@ -849,7 +849,7 @@ void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHOR // => Wenn schon Default-Item, dann wenigstens nur dann einstellen, // wenn davor wirklich ein entsprechendes Attribut. // if ( pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart ) ) -// bCreateAttrib = TRUE; +// bCreateAttrib = sal_True; // Aber kleiner Trost: // Die wenigsten schreiben, aendern das Attr, schreiben, und // stellen dann wieder das Default-Attr ein. @@ -878,7 +878,7 @@ void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHOR #pragma SEG_FUNCDEF(editdoc_40) -void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void TextDoc::InsertAttrib( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { if ( nStart != nEnd ) { @@ -904,7 +904,7 @@ void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const S // ??????????????????????????????? // eigentlich noch pruefen, ob wirklich splittet, oder return ! // ??????????????????????????????? - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; pAttr = MakeCharAttrib( *pCurPool, *(pAttr->GetItem()), nStart, nOldEnd ); pNode->GetCharAttribs().InsertAttrib( pAttr ); @@ -923,12 +923,12 @@ void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const S #pragma SEG_FUNCDEF(editdoc_41) -void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ) +void TextDoc::FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ) { DBG_ASSERT( pNode, "Wo soll ich suchen ?" ); DBG_ASSERT( nStartPos <= nEndPos, "Ungueltiger Bereich!" ); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); // keine Selection... if ( nStartPos == nEndPos ) @@ -962,7 +962,7 @@ void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, Sf if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1021,7 +1021,7 @@ void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, Sf if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx index 0c875b4fe07f..8b046e647f1f 100644 --- a/svtools/source/edit/textdoc.hxx +++ b/svtools/source/edit/textdoc.hxx @@ -42,7 +42,7 @@ SV_DECL_PTRARR_DEL( TextCharAttribs, TextCharAttribPtr, 0, 4 ) class TextCharAttribList : private TextCharAttribs { private: - BOOL mbHasEmptyAttribs; + sal_Bool mbHasEmptyAttribs; TextCharAttribList( const TextCharAttribList& ) : TextCharAttribs() {} @@ -50,28 +50,28 @@ public: TextCharAttribList(); ~TextCharAttribList(); - void Clear( BOOL bDestroyAttribs ); - USHORT Count() const { return TextCharAttribs::Count(); } + void Clear( sal_Bool bDestroyAttribs ); + sal_uInt16 Count() const { return TextCharAttribs::Count(); } - TextCharAttrib* GetAttrib( USHORT n ) const { return TextCharAttribs::GetObject( n ); } - void RemoveAttrib( USHORT n ) { TextCharAttribs::Remove( n, 1 ); } + TextCharAttrib* GetAttrib( sal_uInt16 n ) const { return TextCharAttribs::GetObject( n ); } + void RemoveAttrib( sal_uInt16 n ) { TextCharAttribs::Remove( n, 1 ); } void InsertAttrib( TextCharAttrib* pAttrib ); void DeleteEmptyAttribs(); void ResortAttribs(); - BOOL HasEmptyAttribs() const { return mbHasEmptyAttribs; } - BOOL& HasEmptyAttribs() { return mbHasEmptyAttribs; } + sal_Bool HasEmptyAttribs() const { return mbHasEmptyAttribs; } + sal_Bool& HasEmptyAttribs() { return mbHasEmptyAttribs; } - TextCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos ); - TextCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos = 0xFFFF ) const; - TextCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos ); - BOOL HasAttrib( USHORT nWhich ) const; - BOOL HasBoundingAttrib( USHORT nBound ); + TextCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + TextCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos = 0xFFFF ) const; + TextCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + sal_Bool HasAttrib( sal_uInt16 nWhich ) const; + sal_Bool HasBoundingAttrib( sal_uInt16 nBound ); #ifdef DBG_UTIL - BOOL DbgCheckAttribs(); + sal_Bool DbgCheckAttribs(); #endif }; @@ -84,8 +84,8 @@ private: TextNode( const TextNode& ) {;} protected: - void ExpandAttribs( USHORT nIndex, USHORT nNewChars ); - void CollapsAttribs( USHORT nIndex, USHORT nDelChars ); + void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars ); + void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars ); public: TextNode( const String& rText ); @@ -96,11 +96,11 @@ public: const TextCharAttribList& GetCharAttribs() const { return maCharAttribs; } TextCharAttribList& GetCharAttribs() { return maCharAttribs; } - void InsertText( USHORT nPos, const String& rText ); - void InsertText( USHORT nPos, sal_Unicode c ); - void RemoveText( USHORT nPos, USHORT nChars ); + void InsertText( sal_uInt16 nPos, const String& rText ); + void InsertText( sal_uInt16 nPos, sal_Unicode c ); + void RemoveText( sal_uInt16 nPos, sal_uInt16 nChars ); - TextNode* Split( USHORT nPos, BOOL bKeepEndigAttribs ); + TextNode* Split( sal_uInt16 nPos, sal_Bool bKeepEndigAttribs ); void Append( const TextNode& rNode ); }; @@ -108,7 +108,7 @@ class TextDoc { private: ToolsList<TextNode*> maTextNodes; - USHORT mnLeftMargin; + sal_uInt16 mnLeftMargin; protected: void DestroyTextNodes(); @@ -122,27 +122,27 @@ public: ToolsList<TextNode*>& GetNodes() { return maTextNodes; } const ToolsList<TextNode*>& GetNodes() const { return maTextNodes; } - TextPaM RemoveChars( const TextPaM& rPaM, USHORT nChars ); + TextPaM RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars ); TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c ); TextPaM InsertText( const TextPaM& rPaM, const String& rStr ); - TextPaM InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ); + TextPaM InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ); TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight ); - ULONG GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const; + sal_uIntPtr GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const; String GetText( const sal_Unicode* pSep ) const; - String GetText( ULONG nPara ) const; + String GetText( sal_uIntPtr nPara ) const; - void SetLeftMargin( USHORT n ) { mnLeftMargin = n; } - USHORT GetLeftMargin() const { return mnLeftMargin; } + void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; } + sal_uInt16 GetLeftMargin() const { return mnLeftMargin; } -// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd ), USHORT nWhich = 0 ); -// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich = 0 ); +// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ), sal_uInt16 nWhich = 0 ); +// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); // void InsertAttrib( const EditCharAttrib* pAttr ); // void InsertAttribInSelection( const EditCharAttrib* pAttr ); -// void FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ); +// void FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ); - BOOL IsValidPaM( const TextPaM& rPaM ); + sal_Bool IsValidPaM( const TextPaM& rPaM ); }; #endif // _TEXTDOC_HXX diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index e0e136089d78..821a7d5b5bee 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -81,8 +81,8 @@ typedef TextView* TextViewPtr; SV_DECL_PTRARR( TextViews, TextViewPtr, 0, 1 ) // SV_IMPL_PTRARR( TextViews, TextViewPtr ); -SV_DECL_VARARR_SORT( TESortedPositions, ULONG, 16, 8 ) -SV_IMPL_VARARR_SORT( TESortedPositions, ULONG ) +SV_DECL_VARARR_SORT( TESortedPositions, sal_uIntPtr, 16, 8 ) +SV_IMPL_VARARR_SORT( TESortedPositions, sal_uIntPtr ) #define RESDIFF 10 #define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop @@ -99,15 +99,15 @@ TextEngine::TextEngine() mpViews = new TextViews; mpActiveView = NULL; - mbIsFormatting = FALSE; - mbFormatted = FALSE; - mbUpdate = TRUE; - mbModified = FALSE; - mbUndoEnabled = FALSE; - mbIsInUndo = FALSE; - mbDowning = FALSE; - mbRightToLeft = FALSE; - mbHasMultiLineParas = FALSE; + mbIsFormatting = sal_False; + mbFormatted = sal_False; + mbUpdate = sal_True; + mbModified = sal_False; + mbUndoEnabled = sal_False; + mbIsInUndo = sal_False; + mbDowning = sal_False; + mbRightToLeft = sal_False; + mbHasMultiLineParas = sal_False; meAlign = TXTALIGN_LEFT; @@ -131,7 +131,7 @@ TextEngine::TextEngine() maTextColor = COL_BLACK; Font aFont; - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aFillColor( aFont.GetFillColor() ); aFillColor.SetTransparency( 0 ); aFont.SetFillColor( aFillColor ); @@ -140,7 +140,7 @@ TextEngine::TextEngine() TextEngine::~TextEngine() { - mbDowning = TRUE; + mbDowning = sal_True; delete mpIdleFormatter; delete mpDoc; @@ -163,7 +163,7 @@ void TextEngine::InsertView( TextView* pTextView ) void TextEngine::RemoveView( TextView* pTextView ) { - USHORT nPos = mpViews->GetPos( pTextView ); + sal_uInt16 nPos = mpViews->GetPos( pTextView ); if( nPos != USHRT_MAX ) { pTextView->HideCursor(); @@ -173,12 +173,12 @@ void TextEngine::RemoveView( TextView* pTextView ) } } -USHORT TextEngine::GetViewCount() const +sal_uInt16 TextEngine::GetViewCount() const { return mpViews->Count(); } -TextView* TextEngine::GetView( USHORT nView ) const +TextView* TextEngine::GetView( sal_uInt16 nView ) const { return mpViews->GetObject( nView ); } @@ -217,7 +217,7 @@ void TextEngine::SetFont( const Font& rFont ) // Wegen Selektion keinen Transparenten Font zulassen... // (Sonst spaeter in ImplPaint den Hintergrund anders loeschen...) - maFont.SetTransparent( FALSE ); + maFont.SetTransparent( sal_False ); // Tell VCL not to use the font color, use text color from OutputDevice maFont.SetColor( COL_TRANSPARENT ); Color aFillColor( maFont.GetFillColor() ); @@ -232,10 +232,10 @@ void TextEngine::SetFont( const Font& rFont ) if ( !aTextSize.Width() ) aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "XXXX" ) ) ); - mnDefTab = (USHORT)aTextSize.Width(); + mnDefTab = (sal_uInt16)aTextSize.Width(); if ( !mnDefTab ) mnDefTab = 1; - mnCharHeight = (USHORT)aTextSize.Height(); + mnCharHeight = (sal_uInt16)aTextSize.Height(); /* // #93746# Doesn't work with CJK HalfWidth/FullWidth FontMetric aRealFont( mpRefDev->GetFontMetric() ); @@ -243,7 +243,7 @@ void TextEngine::SetFont( const Font& rFont ) { String aX100; aX100.Fill( 100, 'X' ); - mnFixCharWidth100 = (USHORT)mpRefDev->GetTextWidth( aX100 ); + mnFixCharWidth100 = (sal_uInt16)mpRefDev->GetTextWidth( aX100 ); } else */ @@ -252,7 +252,7 @@ void TextEngine::SetFont( const Font& rFont ) FormatFullDoc(); UpdateViews(); - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); @@ -260,22 +260,22 @@ void TextEngine::SetFont( const Font& rFont ) } } -void TextEngine::SetDefTab( USHORT nDefTab ) +void TextEngine::SetDefTab( sal_uInt16 nDefTab ) { mnDefTab = nDefTab; // evtl neu setzen? } -void TextEngine::SetMaxTextLen( ULONG nLen ) +void TextEngine::SetMaxTextLen( sal_uIntPtr nLen ) { mnMaxTextLen = nLen; } -void TextEngine::SetMaxTextWidth( ULONG nMaxWidth ) +void TextEngine::SetMaxTextWidth( sal_uIntPtr nMaxWidth ) { if ( nMaxWidth != mnMaxTextWidth ) { - mnMaxTextWidth = Min( nMaxWidth, (ULONG)0x7FFFFFFF ); + mnMaxTextWidth = Min( nMaxWidth, (sal_uIntPtr)0x7FFFFFFF ); FormatFullDoc(); UpdateViews(); } @@ -311,14 +311,14 @@ String TextEngine::GetText( LineEnd aSeparator ) const String TextEngine::GetTextLines( LineEnd aSeparator ) const { String aText; - ULONG nParas = mpTEParaPortions->Count(); + sal_uIntPtr nParas = mpTEParaPortions->Count(); const sal_Unicode* pSep = static_getLineEndText( aSeparator ); - for ( ULONG nP = 0; nP < nParas; nP++ ) + for ( sal_uIntPtr nP = 0; nP < nParas; nP++ ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP ); - USHORT nLines = pTEParaPortion->GetLines().Count(); - for ( USHORT nL = 0; nL < nLines; nL++ ) + sal_uInt16 nLines = pTEParaPortion->GetLines().Count(); + for ( sal_uInt16 nL = 0; nL < nLines; nL++ ) { TextLine* pLine = pTEParaPortion->GetLines()[nL]; aText += pTEParaPortion->GetNode()->GetText().Copy( pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() ); @@ -329,17 +329,17 @@ String TextEngine::GetTextLines( LineEnd aSeparator ) const return aText; } -String TextEngine::GetText( ULONG nPara ) const +String TextEngine::GetText( sal_uIntPtr nPara ) const { return mpDoc->GetText( nPara ); } -ULONG TextEngine::GetTextLen( LineEnd aSeparator ) const +sal_uIntPtr TextEngine::GetTextLen( LineEnd aSeparator ) const { return mpDoc->GetTextLen( static_getLineEndText( aSeparator ) ); } -ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const +sal_uIntPtr TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const { TextSelection aSel( rSel ); aSel.Justify(); @@ -347,12 +347,12 @@ ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) co return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel ); } -USHORT TextEngine::GetTextLen( ULONG nPara ) const +sal_uInt16 TextEngine::GetTextLen( sal_uIntPtr nPara ) const { return mpDoc->GetNodes().GetObject( nPara )->GetText().Len(); } -void TextEngine::SetUpdateMode( BOOL bUpdate ) +void TextEngine::SetUpdateMode( sal_Bool bUpdate ) { if ( bUpdate != mbUpdate ) { @@ -366,9 +366,9 @@ void TextEngine::SetUpdateMode( BOOL bUpdate ) } } -BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) +sal_Bool TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) { - BOOL bDoesMove = FALSE; + sal_Bool bDoesMove = sal_False; switch ( rKeyEvent.GetKeyCode().GetCode() ) { @@ -382,16 +382,16 @@ BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) case KEY_PAGEDOWN: { if ( !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesMove = TRUE; + bDoesMove = sal_True; } break; } return bDoesMove; } -BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) +sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) { - BOOL bDoesChange = FALSE; + sal_Bool bDoesChange = sal_False; KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction(); if ( eFunc != KEYFUNC_DONTKNOW ) @@ -401,7 +401,7 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) case KEYFUNC_UNDO: case KEYFUNC_REDO: case KEYFUNC_CUT: - case KEYFUNC_PASTE: bDoesChange = TRUE; + case KEYFUNC_PASTE: bDoesChange = sal_True; break; default: // wird dann evtl. unten bearbeitet. eFunc = KEYFUNC_DONTKNOW; @@ -415,14 +415,14 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) case KEY_BACKSPACE: { if ( !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesChange = TRUE; + bDoesChange = sal_True; } break; case KEY_RETURN: case KEY_TAB: { if ( !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesChange = TRUE; + bDoesChange = sal_True; } break; default: @@ -434,15 +434,15 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) return bDoesChange; } -BOOL TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent ) +sal_Bool TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent ) { if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 && KEY_MOD1 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) && // (ssa) #i45714#: KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) ) // check for Ctrl and Alt separately { - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void TextEngine::ImpInitDoc() @@ -459,9 +459,9 @@ void TextEngine::ImpInitDoc() mpDoc->GetNodes().Insert( pNode, 0 ); TEParaPortion* pIniPortion = new TEParaPortion( pNode ); - mpTEParaPortions->Insert( pIniPortion, (ULONG)0 ); + mpTEParaPortions->Insert( pIniPortion, (sal_uIntPtr)0 ); - mbFormatted = FALSE; + mbFormatted = sal_False; ImpParagraphRemoved( TEXT_PARA_ALL ); ImpParagraphInserted( 0 ); @@ -477,15 +477,15 @@ String TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) cons TextSelection aSel( rSel ); aSel.Justify(); - ULONG nStartPara = aSel.GetStart().GetPara(); - ULONG nEndPara = aSel.GetEnd().GetPara(); + sal_uIntPtr nStartPara = aSel.GetStart().GetPara(); + sal_uIntPtr nEndPara = aSel.GetEnd().GetPara(); const sal_Unicode* pSep = static_getLineEndText( aSeparator ); - for ( ULONG nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ ) + for ( sal_uIntPtr nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nNode ); - USHORT nStartPos = 0; - USHORT nEndPos = pNode->GetText().Len(); + sal_uInt16 nStartPos = 0; + sal_uInt16 nEndPos = pNode->GetText().Len(); if ( nNode == nStartPara ) nStartPos = aSel.GetStart().GetIndex(); if ( nNode == nEndPara ) // kann auch == nStart sein! @@ -504,7 +504,7 @@ void TextEngine::ImpRemoveText() TextPaM aStartPaM( 0, 0 ); TextSelection aEmptySel( aStartPaM, aStartPaM ); - for ( USHORT nView = 0; nView < mpViews->Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ ) { TextView* pView = mpViews->GetObject( nView ); pView->ImpSetSelection( aEmptySel ); @@ -516,9 +516,9 @@ void TextEngine::SetText( const XubString& rText ) { ImpRemoveText(); - BOOL bUndoCurrentlyEnabled = IsUndoEnabled(); + sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled(); // Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden. - EnableUndo( FALSE ); + EnableUndo( sal_False ); TextPaM aStartPaM( 0, 0 ); TextSelection aEmptySel( aStartPaM, aStartPaM ); @@ -527,7 +527,7 @@ void TextEngine::SetText( const XubString& rText ) if ( rText.Len() ) aPaM = ImpInsertText( aEmptySel, rText ); - for ( USHORT nView = 0; nView < mpViews->Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ ) { TextView* pView = mpViews->GetObject( nView ); pView->ImpSetSelection( aEmptySel ); @@ -548,7 +548,7 @@ void TextEngine::SetText( const XubString& rText ) } -void TextEngine::CursorMoved( ULONG nNode ) +void TextEngine::CursorMoved( sal_uIntPtr nNode ) { // Leere Attribute loeschen, aber nur, wenn Absatz nicht leer! TextNode* pNode = mpDoc->GetNodes().GetObject( nNode ); @@ -556,7 +556,7 @@ void TextEngine::CursorMoved( ULONG nNode ) pNode->GetCharAttribs().DeleteEmptyAttribs(); } -void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* ) +void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* ) { DBG_ASSERT( nChars, "ImpRemoveChars - 0 Chars?!" ); if ( IsUndoEnabled() && !IsInUndo() ) @@ -566,9 +566,9 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) ); // Pruefen, ob Attribute geloescht oder geaendert werden: - USHORT nStart = rPaM.GetIndex(); - USHORT nEnd = nStart + nChars; - for ( USHORT nAttr = pNode->GetCharAttribs().Count(); nAttr; ) + sal_uInt16 nStart = rPaM.GetIndex(); + sal_uInt16 nEnd = nStart + nChars; + for ( sal_uInt16 nAttr = pNode->GetCharAttribs().Count(); nAttr; ) { TextCharAttrib* pAttr = pNode->GetCharAttribs().GetAttrib( --nAttr ); if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) ) @@ -590,7 +590,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars ); } -TextPaM TextEngine::ImpConnectParagraphs( ULONG nLeft, ULONG nRight ) +TextPaM TextEngine::ImpConnectParagraphs( sal_uIntPtr nLeft, sal_uIntPtr nRight ) { DBG_ASSERT( nLeft != nRight, "Den gleichen Absatz zusammenfuegen ?" ); @@ -634,11 +634,11 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "Index im Wald in ImpDeleteText" ); DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "Index im Wald in ImpDeleteText" ); - ULONG nStartNode = aStartPaM.GetPara(); - ULONG nEndNode = aEndPaM.GetPara(); + sal_uIntPtr nStartNode = aStartPaM.GetPara(); + sal_uIntPtr nEndNode = aEndPaM.GetPara(); // Alle Nodes dazwischen entfernen.... - for ( ULONG z = nStartNode+1; z < nEndNode; z++ ) + for ( sal_uIntPtr z = nStartNode+1; z < nEndNode; z++ ) { // Immer nStartNode+1, wegen Remove()! ImpRemoveParagraph( nStartNode+1 ); @@ -648,7 +648,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) { // Den Rest des StartNodes... TextNode* pLeft = mpDoc->GetNodes().GetObject( nStartNode ); - USHORT nChars = pLeft->GetText().Len() - aStartPaM.GetIndex(); + sal_uInt16 nChars = pLeft->GetText().Len() - aStartPaM.GetIndex(); if ( nChars ) { ImpRemoveChars( aStartPaM, nChars ); @@ -675,7 +675,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) } else { - USHORT nChars; + sal_uInt16 nChars; nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex(); ImpRemoveChars( aStartPaM, nChars ); TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode ); @@ -688,7 +688,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel ) return aStartPaM; } -void TextEngine::ImpRemoveParagraph( ULONG nPara ) +void TextEngine::ImpRemoveParagraph( sal_uIntPtr nPara ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); @@ -722,14 +722,14 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSeque return xISC; } -BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const +sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const { uno::Reference< i18n::XBreakIterator > xBI = ((TextEngine *) this)->GetBreakIterator(); SvtCTLOptions aCTLOptions; // get the index that really is first - USHORT nFirstPos = rCurSel.GetStart().GetIndex(); - USHORT nMaxPos = rCurSel.GetEnd().GetIndex(); + sal_uInt16 nFirstPos = rCurSel.GetStart().GetIndex(); + sal_uInt16 nMaxPos = rCurSel.GetEnd().GetIndex(); if (nMaxPos < nFirstPos) nFirstPos = nMaxPos; @@ -742,12 +742,12 @@ BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelec return bIsSequenceChecking; } -TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, BOOL bOverwrite ) +TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, sal_Bool bOverwrite ) { return ImpInsertText( c, rCurSel, bOverwrite, sal_False ); } -TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, BOOL bOverwrite, BOOL bIsUserInput ) +TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, sal_Bool bOverwrite, sal_Bool bIsUserInput ) { DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" ); DBG_ASSERT( c != '\r', "Zeilenumbruch bei InsertText ?" ); @@ -757,10 +757,10 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, if ( pNode->GetText().Len() < STRING_MAXLEN ) { - BOOL bDoOverwrite = ( bOverwrite && - ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? TRUE : FALSE; + sal_Bool bDoOverwrite = ( bOverwrite && + ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? sal_True : sal_False; - BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); + sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); if ( bUndoAction ) UndoActionStart( TEXTUNDO_INSERT ); @@ -810,7 +810,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, String aChgText( aNewText.copy( nChgPos ), nChgLen ); // select text from first pos to be changed to current pos - TextSelection aSel( TextPaM( aPaM.GetPara(), (USHORT) nChgPos ), aPaM ); + TextSelection aSel( TextPaM( aPaM.GetPara(), (sal_uInt16) nChgPos ), aPaM ); if (aChgText.Len()) // ImpInsertText implicitly handles undo... @@ -833,7 +833,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c ); - BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE; + sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; InsertUndo( pNewUndo, bTryMerge ); } @@ -868,21 +868,21 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString XubString aText( rStr ); aText.ConvertLineEnd( LINEEND_LF ); - USHORT nStart = 0; + sal_uInt16 nStart = 0; while ( nStart < aText.Len() ) { - USHORT nEnd = aText.Search( LINE_SEP, nStart ); + sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart ); if ( nEnd == STRING_NOTFOUND ) nEnd = aText.Len(); // nicht dereferenzieren! // Start == End => Leerzeile if ( nEnd > nStart ) { - ULONG nL = aPaM.GetIndex(); + sal_uIntPtr nL = aPaM.GetIndex(); nL += ( nEnd-nStart ); if ( nL > STRING_MAXLEN ) { - USHORT nDiff = (USHORT) (nL-STRING_MAXLEN); + sal_uInt16 nDiff = (sal_uInt16) (nL-STRING_MAXLEN); nEnd = nEnd - nDiff; } @@ -914,7 +914,7 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString return aPaM; } -TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeepEndingAttribs ) +TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, sal_Bool bKeepEndingAttribs ) { TextPaM aPaM; if ( rCurSel.HasRange() ) @@ -925,13 +925,13 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeep return ImpInsertParaBreak( aPaM, bKeepEndingAttribs ); } -TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) +TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ) { if ( IsUndoEnabled() && !IsInUndo() ) InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) ); TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() ); - BOOL bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len(); + sal_Bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len(); TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) ); @@ -953,9 +953,9 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAtt return aPaM; } -Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial ) +Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial ) { - DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" ); + DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: PaMtoEditCursor" ); Rectangle aEditCursor; long nY = 0; @@ -966,7 +966,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial ) } else { - for ( ULONG nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ ) + for ( sal_uIntPtr nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion); nY += pPortion->GetLines().Count() * mnCharHeight; @@ -979,7 +979,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial ) return aEditCursor; } -Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart ) +Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart ) { if ( !IsFormatted() && !IsFormatting() ) FormatAndUpdate(); @@ -1000,9 +1000,9 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP */ long nY = 0; - USHORT nCurIndex = 0; + sal_uInt16 nCurIndex = 0; TextLine* pLine = 0; - for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) ) @@ -1036,21 +1036,21 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP return aEditCursor; } -long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart ) +long TextEngine::ImpGetXPos( sal_uIntPtr nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart ) { DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "ImpGetXPos muss richtig gerufen werden!" ); - BOOL bDoPreferPortionStart = bPreferPortionStart; + sal_Bool bDoPreferPortionStart = bPreferPortionStart; // Assure that the portion belongs to this line: if ( nIndex == pLine->GetStart() ) - bDoPreferPortionStart = TRUE; + bDoPreferPortionStart = sal_True; else if ( nIndex == pLine->GetEnd() ) - bDoPreferPortionStart = FALSE; + bDoPreferPortionStart = sal_False; TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nTextPortionStart = 0; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); + sal_uInt16 nTextPortionStart = 0; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); DBG_ASSERT( ( nTextPortion >= pLine->GetStartPortion() ) && ( nTextPortion <= pLine->GetEndPortion() ), "GetXPos: Portion not in current line! " ); @@ -1081,7 +1081,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b // nX += pNextPortion->GetWidth(); // End of the tab portion, use start of next for cursor pos DBG_ASSERT( !bPreferPortionStart, "ImpGetXPos - How can we this tab portion here???" ); - nX = ImpGetXPos( nPara, pLine, nIndex, TRUE ); + nX = ImpGetXPos( nPara, pLine, nIndex, sal_True ); } } @@ -1117,7 +1117,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b return nX; } -const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const +const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const { const TextAttrib* pAttr = NULL; const TextCharAttrib* pCharAttr = FindCharAttrib( rPaM, nWhich ); @@ -1126,7 +1126,7 @@ const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) c return pAttr; } -const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const +const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const { const TextCharAttrib* pAttr = NULL; TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() ); @@ -1135,10 +1135,10 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nW return pAttr; } -BOOL TextEngine::HasAttrib( USHORT nWhich ) const +sal_Bool TextEngine::HasAttrib( sal_uInt16 nWhich ) const { - BOOL bAttr = FALSE; - for ( ULONG n = mpDoc->GetNodes().Count(); --n && !bAttr; ) + sal_Bool bAttr = sal_False; + for ( sal_uIntPtr n = mpDoc->GetNodes().Count(); --n && !bAttr; ) { TextNode* pNode = mpDoc->GetNodes().GetObject( n ); bAttr = pNode->GetCharAttribs().HasAttrib( nWhich ); @@ -1146,12 +1146,12 @@ BOOL TextEngine::HasAttrib( USHORT nWhich ) const return bAttr; } -TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart ) +TextPaM TextEngine::GetPaM( const Point& rDocPos, sal_Bool bSmart ) { - DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" ); + DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: GetPaM" ); long nY = 0; - for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) + for ( sal_uIntPtr nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight; @@ -1169,21 +1169,21 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart ) } // Nicht gefunden - Dann den letzten sichtbare... - ULONG nLastNode = mpDoc->GetNodes().Count() - 1; + sal_uIntPtr nLastNode = mpDoc->GetNodes().Count() - 1; TextNode* pLast = mpDoc->GetNodes().GetObject( nLastNode ); return TextPaM( nLastNode, pLast->GetText().Len() ); } -USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart ) +sal_uInt16 TextEngine::ImpFindIndex( sal_uIntPtr nPortion, const Point& rPosInPara, sal_Bool bSmart ) { DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" ); TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); - USHORT nCurIndex = 0; + sal_uInt16 nCurIndex = 0; long nY = 0; TextLine* pLine = 0; - USHORT nLine; + sal_uInt16 nLine; for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); @@ -1203,24 +1203,24 @@ USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL b { uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator(); sal_Int32 nCount = 1; - nCurIndex = (USHORT)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); + nCurIndex = (sal_uInt16)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); } return nCurIndex; } -USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL ) +sal_uInt16 TextEngine::GetCharPos( sal_uIntPtr nPortion, sal_uInt16 nLine, long nXPos, sal_Bool ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); TextLine* pLine = pPortion->GetLines().GetObject( nLine ); - USHORT nCurIndex = pLine->GetStart(); + sal_uInt16 nCurIndex = pLine->GetStart(); long nTmpX = pLine->GetStartX(); if ( nXPos <= nTmpX ) return nCurIndex; - for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ ) + for ( sal_uInt16 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i ); nTmpX += pTextPortion->GetWidth(); @@ -1248,9 +1248,9 @@ USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL ) } -ULONG TextEngine::GetTextHeight() const +sal_uIntPtr TextEngine::GetTextHeight() const { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" ); if ( !IsFormatted() && !IsFormatting() ) ((TextEngine*)this)->FormatAndUpdate(); @@ -1258,9 +1258,9 @@ ULONG TextEngine::GetTextHeight() const return mnCurTextHeight; } -ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const +sal_uIntPtr TextEngine::GetTextHeight( sal_uIntPtr nParagraph ) const { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" ); if ( !IsFormatted() && !IsFormatting() ) ((TextEngine*)this)->FormatAndUpdate(); @@ -1268,15 +1268,15 @@ ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const return CalcParaHeight( nParagraph ); } -ULONG TextEngine::CalcTextWidth( ULONG nPara ) +sal_uIntPtr TextEngine::CalcTextWidth( sal_uIntPtr nPara ) { - ULONG nParaWidth = 0; + sal_uIntPtr nParaWidth = 0; TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); - for ( USHORT nLine = pPortion->GetLines().Count(); nLine; ) + for ( sal_uInt16 nLine = pPortion->GetLines().Count(); nLine; ) { - ULONG nLineWidth = 0; + sal_uIntPtr nLineWidth = 0; TextLine* pLine = pPortion->GetLines().GetObject( --nLine ); - for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) + for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP ); nLineWidth += pTextPortion->GetWidth(); @@ -1287,7 +1287,7 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara ) return nParaWidth; } -ULONG TextEngine::CalcTextWidth() +sal_uIntPtr TextEngine::CalcTextWidth() { if ( !IsFormatted() && !IsFormatting() ) FormatAndUpdate(); @@ -1295,9 +1295,9 @@ ULONG TextEngine::CalcTextWidth() if ( mnCurTextWidth == 0xFFFFFFFF ) { mnCurTextWidth = 0; - for ( ULONG nPara = mpTEParaPortions->Count(); nPara; ) + for ( sal_uIntPtr nPara = mpTEParaPortions->Count(); nPara; ) { - ULONG nParaWidth = CalcTextWidth( --nPara ); + sal_uIntPtr nParaWidth = CalcTextWidth( --nPara ); if ( nParaWidth > mnCurTextWidth ) mnCurTextWidth = nParaWidth; } @@ -1305,25 +1305,25 @@ ULONG TextEngine::CalcTextWidth() return mnCurTextWidth+1;// Ein breiter, da in CreateLines bei >= umgebrochen wird. } -ULONG TextEngine::CalcTextHeight() +sal_uIntPtr TextEngine::CalcTextHeight() { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: CalcTextHeight" ); - ULONG nY = 0; - for ( ULONG nPortion = mpTEParaPortions->Count(); nPortion; ) + sal_uIntPtr nY = 0; + for ( sal_uIntPtr nPortion = mpTEParaPortions->Count(); nPortion; ) nY += CalcParaHeight( --nPortion ); return nY; } -ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, const Font* pFont ) +sal_uIntPtr TextEngine::CalcTextWidth( sal_uIntPtr nPara, sal_uInt16 nPortionStart, sal_uInt16 nLen, const Font* pFont ) { // Innerhalb des Textes darf es keinen Portionwechsel (Attribut/Tab) geben! DBG_ASSERT( mpDoc->GetNodes().GetObject( nPara )->GetText().Search( '\t', nPortionStart ) >= (nPortionStart+nLen), "CalcTextWidth: Tab!" ); - ULONG nWidth; + sal_uIntPtr nWidth; if ( mnFixCharWidth100 ) { - nWidth = (ULONG)nLen*mnFixCharWidth100/100; + nWidth = (sal_uIntPtr)nLen*mnFixCharWidth100/100; } else { @@ -1339,14 +1339,14 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, mpRefDev->SetFont( aFont ); } TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); - nWidth = (ULONG)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); + nWidth = (sal_uIntPtr)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); } return nWidth; } -USHORT TextEngine::GetLineCount( ULONG nParagraph ) const +sal_uInt16 TextEngine::GetLineCount( sal_uIntPtr nParagraph ) const { DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" ); @@ -1357,7 +1357,7 @@ USHORT TextEngine::GetLineCount( ULONG nParagraph ) const return 0xFFFF; } -USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const +sal_uInt16 TextEngine::GetLineLen( sal_uIntPtr nParagraph, sal_uInt16 nLine ) const { DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" ); @@ -1371,9 +1371,9 @@ USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const return 0xFFFF; } -ULONG TextEngine::CalcParaHeight( ULONG nParagraph ) const +sal_uIntPtr TextEngine::CalcParaHeight( sal_uIntPtr nParagraph ) const { - ULONG nHeight = 0; + sal_uIntPtr nHeight = 0; TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph ); DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" ); @@ -1387,12 +1387,12 @@ void TextEngine::UpdateSelections() { } -Range TextEngine::GetInvalidYOffsets( ULONG nPortion ) +Range TextEngine::GetInvalidYOffsets( sal_uIntPtr nPortion ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); - USHORT nLines = pTEParaPortion->GetLines().Count(); - USHORT nLastInvalid, nFirstInvalid = 0; - USHORT nLine; + sal_uInt16 nLines = pTEParaPortion->GetLines().Count(); + sal_uInt16 nLastInvalid, nFirstInvalid = 0; + sal_uInt16 nLine; for ( nLine = 0; nLine < nLines; nLine++ ) { TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine ); @@ -1416,12 +1416,12 @@ Range TextEngine::GetInvalidYOffsets( ULONG nPortion ) return Range( nFirstInvalid*mnCharHeight, ((nLastInvalid+1)*mnCharHeight)-1 ); } -ULONG TextEngine::GetParagraphCount() const +sal_uIntPtr TextEngine::GetParagraphCount() const { return mpDoc->GetNodes().Count(); } -void TextEngine::EnableUndo( BOOL bEnable ) +void TextEngine::EnableUndo( sal_Bool bEnable ) { // Beim Umschalten des Modus Liste loeschen: if ( bEnable != IsUndoEnabled() ) @@ -1437,7 +1437,7 @@ SfxUndoManager& TextEngine::GetUndoManager() return *mpUndoManager; } -void TextEngine::UndoActionStart( USHORT nId ) +void TextEngine::UndoActionStart( sal_uInt16 nId ) { if ( IsUndoEnabled() && !IsInUndo() ) { @@ -1447,13 +1447,13 @@ void TextEngine::UndoActionStart( USHORT nId ) } } -void TextEngine::UndoActionEnd( USHORT ) +void TextEngine::UndoActionEnd( sal_uInt16 ) { if ( IsUndoEnabled() && !IsInUndo() ) GetUndoManager().LeaveListAction(); } -void TextEngine::InsertUndo( TextUndo* pUndo, BOOL bTryMerge ) +void TextEngine::InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge ) { DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" ); GetUndoManager().AddUndoAction( pUndo, bTryMerge ); @@ -1465,7 +1465,7 @@ void TextEngine::ResetUndo() mpUndoManager->Clear(); } -void TextEngine::InsertContent( TextNode* pNode, ULONG nPara ) +void TextEngine::InsertContent( TextNode* pNode, sal_uIntPtr nPara ) { DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " ); DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" ); @@ -1475,7 +1475,7 @@ void TextEngine::InsertContent( TextNode* pNode, ULONG nPara ) ImpParagraphInserted( nPara ); } -TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos ) +TextPaM TextEngine::SplitContent( sal_uIntPtr nNode, sal_uInt16 nSepPos ) { #ifdef DBG_UTIL TextNode* pNode = mpDoc->GetNodes().GetObject( nNode ); @@ -1487,21 +1487,21 @@ TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos ) return ImpInsertParaBreak( aPaM ); } -TextPaM TextEngine::ConnectContents( ULONG nLeftNode ) +TextPaM TextEngine::ConnectContents( sal_uIntPtr nLeftNode ) { DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" ); return ImpConnectParagraphs( nLeftNode, nLeftNode+1 ); } -void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice* pOutDev ) +void TextEngine::SeekCursor( sal_uIntPtr nPara, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev ) { rFont = maFont; if ( pOutDev ) pOutDev->SetTextColor( maTextColor ); TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); - USHORT nAttribs = pNode->GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_uInt16 nAttribs = pNode->GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr ); if ( pAttrib->GetStart() > nPos ) @@ -1549,7 +1549,7 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); rFont.SetColor( rStyleSettings.GetHighlightTextColor() ); rFont.SetFillColor( rStyleSettings.GetHighlightColor() ); - rFont.SetTransparent( FALSE ); + rFont.SetTransparent( sal_False ); } else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE ) { @@ -1560,9 +1560,9 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice } } -void TextEngine::SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate ) +void TextEngine::SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate ) { - BOOL bChanged = ( GetUpdateMode() != bUp ); + sal_Bool bChanged = ( GetUpdateMode() != bUp ); mbUpdate = bUp; if ( mbUpdate && ( bChanged || bForceUpdate ) ) @@ -1584,15 +1584,15 @@ void TextEngine::FormatAndUpdate( TextView* pCurView ) } -void TextEngine::IdleFormatAndUpdate( TextView* pCurView, USHORT nMaxTimerRestarts ) +void TextEngine::IdleFormatAndUpdate( TextView* pCurView, sal_uInt16 nMaxTimerRestarts ) { mpIdleFormatter->DoIdleFormat( pCurView, nMaxTimerRestarts ); } void TextEngine::TextModified() { - mbFormatted = FALSE; - mbModified = TRUE; + mbFormatted = sal_False; + mbModified = sal_True; } void TextEngine::UpdateViews( TextView* pCurView ) @@ -1602,7 +1602,7 @@ void TextEngine::UpdateViews( TextView* pCurView ) DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" ); - for ( USHORT nView = 0; nView < mpViews->Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ ) { TextView* pView = mpViews->GetObject( nView ); pView->HideCursor(); @@ -1647,12 +1647,12 @@ void TextEngine::CheckIdleFormatter() void TextEngine::FormatFullDoc() { - for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) + for ( sal_uIntPtr nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) { - TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); USHORT nLen = pTEParaPortion->GetNode()->GetText().Len(); + TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); sal_uInt16 nLen = pTEParaPortion->GetNode()->GetText().Len(); pTEParaPortion->MarkSelectionInvalid( 0, nLen ); } - mbFormatted = FALSE; + mbFormatted = sal_False; FormatDoc(); } @@ -1661,26 +1661,26 @@ void TextEngine::FormatDoc() if ( IsFormatted() || !GetUpdateMode() || IsFormatting() ) return; - mbIsFormatting = TRUE; - mbHasMultiLineParas = FALSE; + mbIsFormatting = sal_True; + mbHasMultiLineParas = sal_False; long nY = 0; - BOOL bGrow = FALSE; + sal_Bool bGrow = sal_False; maInvalidRec = Rectangle(); // leermachen - for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) + for ( sal_uIntPtr nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); if ( pTEParaPortion->IsInvalid() ) { - ULONG nOldParaWidth = 0xFFFFFFFF; + sal_uIntPtr nOldParaWidth = 0xFFFFFFFF; if ( mnCurTextWidth != 0xFFFFFFFF ) nOldParaWidth = CalcTextWidth( nPara ); ImpFormattingParagraph( nPara ); if ( CreateLines( nPara ) ) - bGrow = TRUE; + bGrow = sal_True; // InvalidRec nur einmal setzen... if ( maInvalidRec.IsEmpty() ) @@ -1700,7 +1700,7 @@ void TextEngine::FormatDoc() if ( mnCurTextWidth != 0xFFFFFFFF ) { - ULONG nNewParaWidth = CalcTextWidth( nPara ); + sal_uIntPtr nNewParaWidth = CalcTextWidth( nPara ); if ( nNewParaWidth >= mnCurTextWidth ) mnCurTextWidth = nNewParaWidth; else if ( ( nOldParaWidth != 0xFFFFFFFF ) && ( nOldParaWidth >= mnCurTextWidth ) ) @@ -1713,12 +1713,12 @@ void TextEngine::FormatDoc() } nY += CalcParaHeight( nPara ); if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().Count() > 1 ) - mbHasMultiLineParas = TRUE; + mbHasMultiLineParas = sal_True; } if ( !maInvalidRec.IsEmpty() ) { - ULONG nNewHeight = CalcTextHeight(); + sal_uIntPtr nNewHeight = CalcTextHeight(); long nDiff = nNewHeight - mnCurTextHeight; if ( nNewHeight < mnCurTextHeight ) { @@ -1735,18 +1735,18 @@ void TextEngine::FormatDoc() mnCurTextHeight = nNewHeight; if ( nDiff ) { - mbFormatted = TRUE; + mbFormatted = sal_True; ImpTextHeightChanged(); } } - mbIsFormatting = FALSE; - mbFormatted = TRUE; + mbIsFormatting = sal_False; + mbFormatted = sal_True; ImpTextFormatted(); } -void TextEngine::CreateAndInsertEmptyLine( ULONG nPara ) +void TextEngine::CreateAndInsertEmptyLine( sal_uIntPtr nPara ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); @@ -1763,31 +1763,31 @@ void TextEngine::CreateAndInsertEmptyLine( ULONG nPara ) else pTmpLine->SetStartX( mpDoc->GetLeftMargin() ); - BOOL bLineBreak = pNode->GetText().Len() ? TRUE : FALSE; + sal_Bool bLineBreak = pNode->GetText().Len() ? sal_True : sal_False; TETextPortion* pDummyPortion = new TETextPortion( 0 ); pDummyPortion->GetWidth() = 0; pTEParaPortion->GetTextPortions().Insert( pDummyPortion, pTEParaPortion->GetTextPortions().Count() ); - if ( bLineBreak == TRUE ) + if ( bLineBreak == sal_True ) { // -2: Die neue ist bereits eingefuegt. #ifdef DBG_UTIL TextLine* pLastLine = pTEParaPortion->GetLines().GetObject( pTEParaPortion->GetLines().Count()-2 ); DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" ); #endif - USHORT nPos = (USHORT) pTEParaPortion->GetTextPortions().Count() - 1 ; + sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().Count() - 1 ; pTmpLine->SetStartPortion( nPos ); pTmpLine->SetEndPortion( nPos ); } } -void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USHORT nPortionStart, long nRemainingWidth ) +void TextEngine::ImpBreakLine( sal_uIntPtr nPara, TextLine* pLine, TETextPortion*, sal_uInt16 nPortionStart, long nRemainingWidth ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); // Font sollte noch eingestellt sein. - USHORT nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart ); + sal_uInt16 nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart ); DBG_ASSERT( nMaxBreakPos < pNode->GetText().Len(), "Break?!" ); @@ -1806,7 +1806,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH static const com::sun::star::lang::Locale aDefLocale; i18n::LineBreakResults aLBR = xBI->getLineBreak( pNode->GetText(), nMaxBreakPos, aDefLocale, pLine->GetStart(), aHyphOptions, aUserOptions ); - USHORT nBreakPos = (USHORT)aLBR.breakIndex; + sal_uInt16 nBreakPos = (sal_uInt16)aLBR.breakIndex; if ( nBreakPos <= pLine->GetStart() ) { nBreakPos = nMaxBreakPos; @@ -1817,7 +1817,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH // die angeknackste Portion ist die End-Portion pLine->SetEnd( nBreakPos ); - USHORT nEndPortion = SplitTextPortion( nPara, nBreakPos ); + sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos ); sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) && ( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False; @@ -1832,7 +1832,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH pLine->SetEndPortion( nEndPortion ); } -USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) +sal_uInt16 TextEngine::SplitTextPortion( sal_uIntPtr nPara, sal_uInt16 nPos ) { // Die Portion bei nPos wird geplittet, wenn bei nPos nicht @@ -1840,11 +1840,11 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) if ( nPos == 0 ) return 0; - USHORT nSplitPortion; - USHORT nTmpPos = 0; + sal_uInt16 nSplitPortion; + sal_uInt16 nTmpPos = 0; TETextPortion* pTextPortion = 0; TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nPortions = pTEParaPortion->GetTextPortions().Count(); + sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count(); for ( nSplitPortion = 0; nSplitPortion < nPortions; nSplitPortion++ ) { TETextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject(nSplitPortion); @@ -1860,7 +1860,7 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" ); - USHORT nOverlapp = nTmpPos - nPos; + sal_uInt16 nOverlapp = nTmpPos - nPos; pTextPortion->GetLen() = pTextPortion->GetLen() - nOverlapp; TETextPortion* pNewPortion = new TETextPortion( nOverlapp ); pTEParaPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 ); @@ -1869,18 +1869,18 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos ) return nSplitPortion; } -void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) +void TextEngine::CreateTextPortions( sal_uIntPtr nPara, sal_uInt16 nStartPos ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); TextNode* pNode = pTEParaPortion->GetNode(); DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" ); TESortedPositions aPositions; - ULONG nZero = 0; + sal_uIntPtr nZero = 0; aPositions.Insert( nZero ); - USHORT nAttribs = pNode->GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_uInt16 nAttribs = pNode->GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr ); @@ -1892,7 +1892,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) aPositions.Insert( pNode->GetText().Len() ); const TEWritingDirectionInfos& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos(); - for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ ) + for ( sal_uInt16 nD = 0; nD < rWritingDirections.Count(); nD++ ) aPositions.Insert( rWritingDirections[nD].nStartPos ); if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) ) @@ -1908,7 +1908,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) } } - USHORT nTabPos = pNode->GetText().Search( '\t', 0 ); + sal_uInt16 nTabPos = pNode->GetText().Search( '\t', 0 ); while ( nTabPos != STRING_NOTFOUND ) { aPositions.Insert( nTabPos ); @@ -1919,9 +1919,9 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) // Ab ... loeschen: // Leider muss die Anzahl der TextPortions mit aPositions.Count() // nicht uebereinstimmen, da evtl. Zeilenumbrueche... - USHORT nPortionStart = 0; - USHORT nInvPortion = 0; - USHORT nP; + sal_uInt16 nPortionStart = 0; + sal_uInt16 nInvPortion = 0; + sal_uInt16 nP; for ( nP = 0; nP < pTEParaPortion->GetTextPortions().Count(); nP++ ) { TETextPortion* pTmpPortion = pTEParaPortion->GetTextPortions().GetObject(nP); @@ -1947,15 +1947,15 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) // Eine Portion kann auch durch einen Zeilenumbruch entstanden sein: aPositions.Insert( nPortionStart ); - USHORT nInvPos; + sal_uInt16 nInvPos; #ifdef DBG_UTIL - BOOL bFound = + sal_Bool bFound = #endif aPositions.Seek_Entry( nPortionStart, &nInvPos ); DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" ); - for ( USHORT i = nInvPos+1; i < aPositions.Count(); i++ ) + for ( sal_uInt16 i = nInvPos+1; i < aPositions.Count(); i++ ) { - TETextPortion* pNew = new TETextPortion( (USHORT)aPositions[i] - (USHORT)aPositions[i-1] ); + TETextPortion* pNew = new TETextPortion( (sal_uInt16)aPositions[i] - (sal_uInt16)aPositions[i-1] ); pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count()); } @@ -1965,7 +1965,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos ) #endif } -void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars ) +void TextEngine::RecalcTextPortion( sal_uIntPtr nPara, sal_uInt16 nStartPos, short nNewChars ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions!" ); @@ -1983,7 +1983,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha ( nStartPos && ( pNode->GetText().GetChar( nStartPos - 1 ) == '\t' ) ) || ( ( !nStartPos && ( nNewChars < pNode->GetText().Len() ) && pNode->GetText().GetChar( nNewChars ) == '\t' ) ) ) { - USHORT nNewPortionPos = 0; + sal_uInt16 nNewPortionPos = 0; if ( nStartPos ) nNewPortionPos = SplitTextPortion( nPara, nStartPos ) + 1; // else if ( ( pTEParaPortion->GetTextPortions().Count() == 1 ) && @@ -1996,7 +1996,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha !pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() ) { // Dann die leere Portion verwenden. - USHORT & r = + sal_uInt16 & r = pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen(); r = r + nNewChars; } @@ -2008,8 +2008,8 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha } else { - USHORT nPortionStart; - const USHORT nTP = pTEParaPortion->GetTextPortions(). + sal_uInt16 nPortionStart; + const sal_uInt16 nTP = pTEParaPortion->GetTextPortions(). FindPortion( nStartPos, nPortionStart ); TETextPortion* const pTP = pTEParaPortion->GetTextPortions()[ nTP ]; DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" ); @@ -2025,10 +2025,10 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha // Es darf keine reinragende oder im Bereich startende Portion geben, // also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein - USHORT nPortion = 0; - USHORT nPos = 0; - USHORT nEnd = nStartPos-nNewChars; - USHORT nPortions = pTEParaPortion->GetTextPortions().Count(); + sal_uInt16 nPortion = 0; + sal_uInt16 nPos = 0; + sal_uInt16 nEnd = nStartPos-nNewChars; + sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count(); TETextPortion* pTP = 0; for ( nPortion = 0; nPortion < nPortions; nPortion++ ) { @@ -2079,7 +2079,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan TextPaM const* pSelEnd = 0; if ( pSelection && pSelection->HasRange() ) { - BOOL bInvers = pSelection->GetEnd() < pSelection->GetStart(); + sal_Bool bInvers = pSelection->GetEnd() < pSelection->GetStart(); pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); } @@ -2090,23 +2090,23 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan // -------------------------------------------------- // Ueber alle Absaetze... // -------------------------------------------------- - for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) + for ( sal_uIntPtr nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); // falls beim Tippen Idle-Formatierung, asynchrones Paint. if ( pPortion->IsInvalid() ) return; - ULONG nParaHeight = CalcParaHeight( nPara ); - USHORT nIndex = 0; + sal_uIntPtr nParaHeight = CalcParaHeight( nPara ); + sal_uInt16 nIndex = 0; if ( ( !pPaintArea || ( ( nY + (long)nParaHeight ) > pPaintArea->Top() ) ) && ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) ) { // -------------------------------------------------- // Ueber die Zeilen des Absatzes... // -------------------------------------------------- - USHORT nLines = pPortion->GetLines().Count(); - for ( USHORT nLine = 0; nLine < nLines; nLine++ ) + sal_uInt16 nLines = pPortion->GetLines().Count(); + for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { TextLine* pLine = pPortion->GetLines().GetObject(nLine); Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY ); @@ -2120,7 +2120,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan // Ueber die Portions der Zeile... // -------------------------------------------------- nIndex = pLine->GetStart(); - for ( USHORT y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ ) + for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ ) { DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" ); TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y ); @@ -2145,13 +2145,13 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan Font aFont; SeekCursor( nPara, nIndex+1, aFont, pOutDev ); if( bTransparent ) - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); else if ( pSelection ) - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); pOutDev->SetFont( aFont ); - USHORT nTmpIndex = nIndex; - USHORT nEnd = nTmpIndex + pTextPortion->GetLen(); + sal_uInt16 nTmpIndex = nIndex; + sal_uInt16 nEnd = nTmpIndex + pTextPortion->GetLen(); Point aPos = aTmpPos; if ( pPaintRange ) { @@ -2168,7 +2168,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan } } - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( pSelStart ) { // liegt ein Teil in der Selektion??? @@ -2176,7 +2176,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan TextPaM aTextEnd( nPara, nEnd ); if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) ) { - USHORT nL; + sal_uInt16 nL; // 1) Bereich vor Selektion if ( aTextStart < *pSelStart ) @@ -2211,7 +2211,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, pLine, nTmpIndex, nTmpIndex+nL ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -2229,7 +2229,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan if ( pSelStart || pPaintRange ) { Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) ); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( pSelStart ) { // liegt der Tab in der Selektion??? @@ -2241,7 +2241,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() ); pOutDev->DrawRect( aTabArea ); pOutDev->SetFillColor( aOldColor ); - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -2282,15 +2282,15 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan } } -BOOL TextEngine::CreateLines( ULONG nPara ) +sal_Bool TextEngine::CreateLines( sal_uIntPtr nPara ) { - // BOOL: Aenderung der Hoehe des Absatzes Ja/Nein - TRUE/FALSE + // sal_Bool: Aenderung der Hoehe des Absatzes Ja/Nein - sal_True/sal_False TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" ); - USHORT nOldLineCount = pTEParaPortion->GetLines().Count(); + sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().Count(); // --------------------------------------------------------------- // Schnelle Sonderbehandlung fuer leere Absaetze... @@ -2318,9 +2318,9 @@ BOOL TextEngine::CreateLines( ULONG nPara ) } const short nInvalidDiff = pTEParaPortion->GetInvalidDiff(); - const USHORT nInvalidStart = pTEParaPortion->GetInvalidPosStart(); - const USHORT nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); - BOOL bQuickFormat = FALSE; + const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart(); + const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); + sal_Bool bQuickFormat = sal_False; if ( !pTEParaPortion->GetWritingDirectionInfos().Count() ) ImpInitWritingDirections( nPara ); @@ -2329,24 +2329,24 @@ BOOL TextEngine::CreateLines( ULONG nPara ) { if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) ) { - bQuickFormat = TRUE; + bQuickFormat = sal_True; } else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) ) { // pruefen, ob loeschen ueber Portiongrenzen erfolgte... - USHORT nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! - USHORT nEnd = nStart - nInvalidDiff; // neg. - bQuickFormat = TRUE; - USHORT nPos = 0; - USHORT nPortions = pTEParaPortion->GetTextPortions().Count(); - for ( USHORT nTP = 0; nTP < nPortions; nTP++ ) + sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! + sal_uInt16 nEnd = nStart - nInvalidDiff; // neg. + bQuickFormat = sal_True; + sal_uInt16 nPos = 0; + sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count(); + for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ ) { // Es darf kein Start/Ende im geloeschten Bereich liegen. TETextPortion* const pTP = pTEParaPortion->GetTextPortions().GetObject( nTP ); nPos = nPos + pTP->GetLen(); if ( ( nPos > nStart ) && ( nPos < nEnd ) ) { - bQuickFormat = FALSE; + bQuickFormat = sal_False; break; } } @@ -2363,8 +2363,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // Zeilen flaggen => nicht removen ! // --------------------------------------------------------------- - USHORT nLine = pTEParaPortion->GetLines().Count()-1; - for ( USHORT nL = 0; nL <= nLine; nL++ ) + sal_uInt16 nLine = pTEParaPortion->GetLines().Count()-1; + for ( sal_uInt16 nL = 0; nL <= nLine; nL++ ) { TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL ); if ( pLine->GetEnd() > nInvalidStart ) @@ -2384,25 +2384,25 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // --------------------------------------------------------------- // Ab hier alle Zeilen durchformatieren... // --------------------------------------------------------------- - USHORT nDelFromLine = 0xFFFF; - BOOL bLineBreak = FALSE; + sal_uInt16 nDelFromLine = 0xFFFF; + sal_Bool bLineBreak = sal_False; - USHORT nIndex = pLine->GetStart(); + sal_uInt16 nIndex = pLine->GetStart(); TextLine aSaveLine( *pLine ); Font aFont; - BOOL bCalcPortion = TRUE; + sal_Bool bCalcPortion = sal_True; while ( nIndex < pNode->GetText().Len() ) { - BOOL bEOL = FALSE; - BOOL bEOC = FALSE; - USHORT nPortionStart = 0; - USHORT nPortionEnd = 0; + sal_Bool bEOL = sal_False; + sal_Bool bEOC = sal_False; + sal_uInt16 nPortionStart = 0; + sal_uInt16 nPortionEnd = 0; - USHORT nTmpPos = nIndex; - USHORT nTmpPortion = pLine->GetStartPortion(); + sal_uInt16 nTmpPos = nIndex; + sal_uInt16 nTmpPortion = pLine->GetStartPortion(); long nTmpWidth = mpDoc->GetLeftMargin(); // long nXWidth = mnMaxTextWidth ? ( mnMaxTextWidth - mpDoc->GetLeftMargin() ) : 0x7FFFFFFF; // Margin nicht abziehen, ist schon in TmpWidth enthalten. @@ -2412,8 +2412,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // Portion suchen, die nicht mehr in Zeile passt.... TETextPortion* pPortion = 0; - BOOL bBrokenLine = FALSE; - bLineBreak = FALSE; + sal_Bool bBrokenLine = sal_False; + bLineBreak = sal_False; while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().Count() ) ) { @@ -2432,8 +2432,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // Aber was jetzt ? Tab passend machen! pPortion->GetWidth() = nXWidth-1; nTmpWidth = pPortion->GetWidth(); - bEOL = TRUE; - bBrokenLine = TRUE; + bEOL = sal_True; + bBrokenLine = sal_True; } pPortion->GetKind() = PORTIONKIND_TAB; } @@ -2454,30 +2454,30 @@ BOOL TextEngine::CreateLines( ULONG nPara ) } // das war evtl. eine Portion zu weit: - BOOL bFixedEnd = FALSE; + sal_Bool bFixedEnd = sal_False; if ( nTmpWidth > nXWidth ) { nPortionEnd = nTmpPos; nTmpPos = nTmpPos - pPortion->GetLen(); nPortionStart = nTmpPos; nTmpPortion--; - bEOL = FALSE; - bEOC = FALSE; + bEOL = sal_False; + bEOC = sal_False; nTmpWidth -= pPortion->GetWidth(); if ( pPortion->GetKind() == PORTIONKIND_TAB ) { - bEOL = TRUE; - bFixedEnd = TRUE; + bEOL = sal_True; + bFixedEnd = sal_True; } } else { - bEOL = TRUE; - bEOC = TRUE; + bEOL = sal_True; + bEOC = sal_True; pLine->SetEnd( nPortionEnd ); DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine TextPortions?" ); - pLine->SetEndPortion( (USHORT)pTEParaPortion->GetTextPortions().Count() - 1 ); + pLine->SetEndPortion( (sal_uInt16)pTEParaPortion->GetTextPortions().Count() - 1 ); } if ( bFixedEnd ) @@ -2489,7 +2489,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) { pLine->SetEnd( nPortionStart+1 ); pLine->SetEndPortion( nTmpPortion-1 ); - bEOC = FALSE; // wurde oben gesetzt, vielleich mal die if's umstellen? + bEOC = sal_False; // wurde oben gesetzt, vielleich mal die if's umstellen? } else if ( !bEOL ) { @@ -2502,7 +2502,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) { // Ausrichten... long nTextWidth = 0; - for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) + for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) { TETextPortion* pTextPortion = pTEParaPortion->GetTextPortions().GetObject( nTP ); nTextWidth += pTextPortion->GetWidth(); @@ -2511,9 +2511,9 @@ BOOL TextEngine::CreateLines( ULONG nPara ) if ( nSpace > 0 ) { if ( ImpGetAlign() == TXTALIGN_CENTER ) - pLine->SetStartX( (USHORT)(nSpace / 2) ); + pLine->SetStartX( (sal_uInt16)(nSpace / 2) ); else // TXTALIGN_RIGHT - pLine->SetStartX( (USHORT)nSpace ); + pLine->SetStartX( (sal_uInt16)nSpace ); } } else @@ -2542,8 +2542,8 @@ BOOL TextEngine::CreateLines( ULONG nPara ) } else { - USHORT nStart = pLine->GetStart(); - USHORT nEnd = pLine->GetEnd(); + sal_uInt16 nStart = pLine->GetStart(); + sal_uInt16 nEnd = pLine->GetEnd(); if ( nStart > nInvalidEnd ) { @@ -2553,7 +2553,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) pLine->SetValid(); if ( bCalcPortion && bQuickFormat ) { - bCalcPortion = FALSE; + bCalcPortion = sal_False; pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; } @@ -2567,7 +2567,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) // textbreiten neu bestimmen: if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) ) { - bCalcPortion = FALSE; + bCalcPortion = sal_False; pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; } @@ -2578,7 +2578,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende // weil nEnd hinter das letzte Zeichen zeigt! - USHORT nEndPortion = pLine->GetEndPortion(); + sal_uInt16 nEndPortion = pLine->GetEndPortion(); // Naechste Zeile oder ggf. neue Zeile.... pLine = 0; @@ -2609,7 +2609,7 @@ BOOL TextEngine::CreateLines( ULONG nPara ) DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" ); - if ( bLineBreak == TRUE ) + if ( bLineBreak == sal_True ) CreateAndInsertEmptyLine( nPara ); pTEParaPortion->SetValid(); @@ -2626,8 +2626,8 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord ) TextNode* pNode = mpDoc->GetNodes().GetObject( rCursorPos.GetPara() ); uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator(); i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rCursorPos.GetIndex(), GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True ); - aSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos; - aSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos; + aSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos; + aSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos; aWord = pNode->GetText().Copy( aSel.GetStart().GetIndex(), aSel.GetEnd().GetIndex() - aSel.GetStart().GetIndex() ); if ( pStartOfWord ) *pStartOfWord = aSel.GetStart(); @@ -2635,10 +2635,10 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord ) return aWord; } -BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) +sal_Bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) { - BOOL bUpdate = GetUpdateMode(); - SetUpdateMode( FALSE ); + sal_Bool bUpdate = GetUpdateMode(); + SetUpdateMode( sal_False ); UndoActionStart( TEXTUNDO_READ ); TextSelection aSel; @@ -2646,7 +2646,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) aSel = *pSel; else { - ULONG nParas = mpDoc->GetNodes().Count(); + sal_uIntPtr nParas = mpDoc->GetNodes().Count(); TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 ); aSel = TextPaM( nParas-1 , pNode->GetText().Len() ); } @@ -2655,7 +2655,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) aSel = ImpDeleteText( aSel ); ByteString aLine; - BOOL bDone = rInput.ReadLine( aLine ); + sal_Bool bDone = rInput.ReadLine( aLine ); String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr; while ( bDone ) { @@ -2677,17 +2677,17 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel ) SetUpdateMode( bUpdate ); FormatAndUpdate( GetActiveView() ); - return rInput.GetError() ? FALSE : TRUE; + return rInput.GetError() ? sal_False : sal_True; } -BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML ) +sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bool bHTML ) { TextSelection aSel; if ( pSel ) aSel = *pSel; else { - ULONG nParas = mpDoc->GetNodes().Count(); + sal_uIntPtr nParas = mpDoc->GetNodes().Count(); TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 ); aSel.GetStart() = TextPaM( 0, 0 ); aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().Len() ); @@ -2699,12 +2699,12 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML rOutput.WriteLine( "<BODY>" ); } - for ( ULONG nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ ) + for ( sal_uIntPtr nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); - USHORT nStartPos = 0; - USHORT nEndPos = pNode->GetText().Len(); + sal_uInt16 nStartPos = 0; + sal_uInt16 nEndPos = pNode->GetText().Len(); if ( nPara == aSel.GetStart().GetPara() ) nStartPos = aSel.GetStart().GetIndex(); if ( nPara == aSel.GetEnd().GetPara() ) @@ -2726,8 +2726,8 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML } else { - USHORT nTmpStart = nStartPos; - USHORT nTmpEnd = nEndPos; + sal_uInt16 nTmpStart = nStartPos; + sal_uInt16 nTmpEnd = nEndPos; do { TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos ); @@ -2764,22 +2764,22 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML rOutput.WriteLine( "</HTML>" ); } - return rOutput.GetError() ? FALSE : TRUE; + return rOutput.GetError() ? sal_False : sal_True; } -void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate ) +void TextEngine::RemoveAttribs( sal_uIntPtr nPara, sal_Bool bIdleFormatAndUpdate ) { if ( nPara < mpDoc->GetNodes().Count() ) { TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); if ( pNode->GetCharAttribs().Count() ) { - pNode->GetCharAttribs().Clear( TRUE ); + pNode->GetCharAttribs().Clear( sal_True ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() ); - mbFormatted = FALSE; + mbFormatted = sal_False; if ( bIdleFormatAndUpdate ) IdleFormatAndUpdate( NULL, 0xFFFF ); @@ -2788,7 +2788,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate ) } } } -void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate ) +void TextEngine::RemoveAttribs( sal_uIntPtr nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate ) { if ( nPara < mpDoc->GetNodes().Count() ) { @@ -2796,15 +2796,15 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU if ( pNode->GetCharAttribs().Count() ) { TextCharAttribList& rAttribs = pNode->GetCharAttribs(); - USHORT nAttrCount = rAttribs.Count(); - for(USHORT nAttr = nAttrCount; nAttr; --nAttr) + sal_uInt16 nAttrCount = rAttribs.Count(); + for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr) { if(rAttribs.GetAttrib( nAttr - 1 )->Which() == nWhich) rAttribs.RemoveAttrib( nAttr -1 ); } TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() ); - mbFormatted = FALSE; + mbFormatted = sal_False; if(bIdleFormatAndUpdate) IdleFormatAndUpdate( NULL, 0xFFFF ); else @@ -2812,7 +2812,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU } } } -void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib ) +void TextEngine::RemoveAttrib( sal_uIntPtr nPara, const TextCharAttrib& rAttrib ) { if ( nPara < mpDoc->GetNodes().Count() ) { @@ -2820,8 +2820,8 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib ) if ( pNode->GetCharAttribs().Count() ) { TextCharAttribList& rAttribs = pNode->GetCharAttribs(); - USHORT nAttrCount = rAttribs.Count(); - for(USHORT nAttr = nAttrCount; nAttr; --nAttr) + sal_uInt16 nAttrCount = rAttribs.Count(); + for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr) { if(rAttribs.GetAttrib( nAttr - 1 ) == &rAttrib) { @@ -2831,13 +2831,13 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib ) } TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() ); - mbFormatted = FALSE; + mbFormatted = sal_False; FormatAndUpdate( NULL ); } } } -void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate ) +void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uIntPtr nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate ) { // Es wird hier erstmal nicht geprueft, ob sich Attribute ueberlappen! // Diese Methode ist erstmal nur fuer einen Editor, der fuer eine Zeile @@ -2851,7 +2851,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nMax = pNode->GetText().Len(); + sal_uInt16 nMax = pNode->GetText().Len(); if ( nStart > nMax ) nStart = nMax; if ( nEnd > nMax ) @@ -2860,7 +2860,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, pNode->GetCharAttribs().InsertAttrib( new TextCharAttrib( rAttr, nStart, nEnd ) ); pTEParaPortion->MarkSelectionInvalid( nStart, nEnd ); - mbFormatted = FALSE; + mbFormatted = sal_False; if ( bIdleFormatAndUpdate ) IdleFormatAndUpdate( NULL, 0xFFFF ); else @@ -2887,14 +2887,14 @@ void TextEngine::ValidateSelection( TextSelection& rSel ) const void TextEngine::ValidatePaM( TextPaM& rPaM ) const { - ULONG nMaxPara = mpDoc->GetNodes().Count() - 1; + sal_uIntPtr nMaxPara = mpDoc->GetNodes().Count() - 1; if ( rPaM.GetPara() > nMaxPara ) { rPaM.GetPara() = nMaxPara; rPaM.GetIndex() = 0xFFFF; } - USHORT nMaxIndex = GetTextLen( rPaM.GetPara() ); + sal_uInt16 nMaxIndex = GetTextLen( rPaM.GetPara() ); if ( rPaM.GetIndex() > nMaxIndex ) rPaM.GetIndex() = nMaxIndex; } @@ -2902,18 +2902,18 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const // Status & Selektionsanpassung -void TextEngine::ImpParagraphInserted( ULONG nPara ) +void TextEngine::ImpParagraphInserted( sal_uIntPtr nPara ) { // Die aktive View braucht nicht angepasst werden, aber bei allen // passiven muss die Selektion angepasst werden: if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) { -// BOOL bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart(); +// sal_Bool bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart(); // TextPaM& rMin = !bInvers ? pView->maSelection.GetStart(): pView->maSelection.GetEnd(); // TextPaM& rMax = bInvers ? pView->maSelection.GetStart() : pView->maSelection.GetEnd(); // @@ -2933,16 +2933,16 @@ void TextEngine::ImpParagraphInserted( ULONG nPara ) Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) ); } -void TextEngine::ImpParagraphRemoved( ULONG nPara ) +void TextEngine::ImpParagraphRemoved( sal_uIntPtr nPara ) { if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) { - ULONG nParas = mpDoc->GetNodes().Count(); + sal_uIntPtr nParas = mpDoc->GetNodes().Count(); for ( int n = 0; n <= 1; n++ ) { TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd(); @@ -2961,16 +2961,16 @@ void TextEngine::ImpParagraphRemoved( ULONG nPara ) Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) ); } -void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars ) +void TextEngine::ImpCharsRemoved( sal_uIntPtr nPara, sal_uInt16 nPos, sal_uInt16 nChars ) { if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) { - USHORT nEnd = nPos+nChars; + sal_uInt16 nEnd = nPos+nChars; for ( int n = 0; n <= 1; n++ ) { TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd(); @@ -2988,11 +2988,11 @@ void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars ) Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) ); } -void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars ) +void TextEngine::ImpCharsInserted( sal_uIntPtr nPara, sal_uInt16 nPos, sal_uInt16 nChars ) { if ( mpViews->Count() > 1 ) { - for ( USHORT nView = mpViews->Count(); nView; ) + for ( sal_uInt16 nView = mpViews->Count(); nView; ) { TextView* pView = mpViews->GetObject( --nView ); if ( pView != GetActiveView() ) @@ -3012,7 +3012,7 @@ void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars ) Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) ); } -void TextEngine::ImpFormattingParagraph( ULONG nPara ) +void TextEngine::ImpFormattingParagraph( sal_uIntPtr nPara ) { Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) ); } @@ -3032,12 +3032,12 @@ void TextEngine::Draw( OutputDevice* pDev, const Point& rPos ) ImpPaint( pDev, rPos, NULL ); } -void TextEngine::SetLeftMargin( USHORT n ) +void TextEngine::SetLeftMargin( sal_uInt16 n ) { mpDoc->SetLeftMargin( n ); } -USHORT TextEngine::GetLeftMargin() const +sal_uInt16 TextEngine::GetLeftMargin() const { return mpDoc->GetLeftMargin(); } @@ -3074,7 +3074,7 @@ LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper() return mpLocaleDataWrapper; } -void TextEngine::SetRightToLeft( BOOL bR2L ) +void TextEngine::SetRightToLeft( sal_Bool bR2L ) { if ( mbRightToLeft != bR2L ) { @@ -3085,7 +3085,7 @@ void TextEngine::SetRightToLeft( BOOL bR2L ) } } -void TextEngine::ImpInitWritingDirections( ULONG nPara ) +void TextEngine::ImpInitWritingDirections( sal_uIntPtr nPara ) { TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara ); TEWritingDirectionInfos& rInfos = pParaPortion->GetWritingDirectionInfos(); @@ -3112,10 +3112,10 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara ) int32_t nEnd; UBiDiLevel nCurrDir; - for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx ) + for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx ) { ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir ); - rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (USHORT)nStart, (USHORT)nEnd ), rInfos.Count() ); + rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ), rInfos.Count() ); nStart = nEnd; } @@ -3124,13 +3124,13 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara ) // No infos mean no CTL and default dir is L2R... if ( !rInfos.Count() ) - rInfos.Insert( TEWritingDirectionInfo( 0, 0, (USHORT)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() ); + rInfos.Insert( TEWritingDirectionInfo( 0, 0, (sal_uInt16)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() ); } -BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd ) +sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uIntPtr nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd ) { - BYTE nRightToLeft = 0; + sal_uInt8 nRightToLeft = 0; TextNode* pNode = mpDoc->GetNodes().GetObject( nPara ); if ( pNode && pNode->GetText().Len() ) @@ -3140,7 +3140,7 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US ImpInitWritingDirections( nPara ); TEWritingDirectionInfos& rDirInfos = pParaPortion->GetWritingDirectionInfos(); - for ( USHORT n = 0; n < rDirInfos.Count(); n++ ) + for ( sal_uInt16 n = 0; n < rDirInfos.Count(); n++ ) { if ( ( rDirInfos[n].nStartPos <= nPos ) && ( rDirInfos[n].nEndPos >= nPos ) ) { @@ -3156,13 +3156,13 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US return nRightToLeft; } -long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion ) +long TextEngine::ImpGetPortionXOffset( sal_uIntPtr nPara, TextLine* pLine, sal_uInt16 nTextPortion ) { long nX = pLine->GetStartX(); TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara ); - for ( USHORT i = pLine->GetStartPortion(); i < nTextPortion; i++ ) + for ( sal_uInt16 i = pLine->GetStartPortion(); i < nTextPortion; i++ ) { TETextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i ); nX += pPortion->GetWidth(); @@ -3236,9 +3236,9 @@ long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTex return nX; } -void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion ) +void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion ) { - ULONG nLayoutMode = pOutDev->GetLayoutMode(); + sal_uIntPtr nLayoutMode = pOutDev->GetLayoutMode(); nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG ); if ( bDrawingR2LPortion ) @@ -3260,12 +3260,12 @@ TxtAlign TextEngine::ImpGetAlign() const return eAlign; } -long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 ) +long TextEngine::ImpGetOutputOffset( sal_uIntPtr nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); - USHORT nPortionStart; - USHORT nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, TRUE ); + sal_uInt16 nPortionStart; + sal_uInt16 nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, sal_True ); TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nPortion ); @@ -3286,7 +3286,7 @@ long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex nX = ImpGetXPos( nPara, pLine, nIndex, nIndex == nPortionStart ); if ( nIndex2 != nIndex ) { - long nX2 = ImpGetXPos( nPara, pLine, nIndex2, FALSE ); + long nX2 = ImpGetXPos( nPara, pLine, nIndex2, sal_False ); if ( ( !IsRightToLeft() && ( nX2 < nX ) ) || ( IsRightToLeft() && ( nX2 > nX ) ) ) { diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx index 18cf9331328e..ca8961f300c3 100644 --- a/svtools/source/edit/textund2.hxx +++ b/svtools/source/edit/textund2.hxx @@ -33,13 +33,13 @@ class TextUndoDelPara : public TextUndo { private: - BOOL mbDelObject; - ULONG mnPara; + sal_Bool mbDelObject; + sal_uIntPtr mnPara; TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt! public: TYPEINFO(); - TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara ); + TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uIntPtr nPara ); ~TextUndoDelPara(); virtual void Undo(); @@ -50,12 +50,12 @@ public: class TextUndoConnectParas : public TextUndo { private: - ULONG mnPara; - USHORT mnSepPos; + sal_uIntPtr mnPara; + sal_uInt16 mnSepPos; public: TYPEINFO(); - TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos ); + TextUndoConnectParas( TextEngine* pTextEngine, sal_uIntPtr nPara, sal_uInt16 nSepPos ); ~TextUndoConnectParas(); virtual void Undo(); @@ -66,12 +66,12 @@ public: class TextUndoSplitPara : public TextUndo { private: - ULONG mnPara; - USHORT mnSepPos; + sal_uIntPtr mnPara; + sal_uInt16 mnSepPos; public: TYPEINFO(); - TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos ); + TextUndoSplitPara( TextEngine* pTextEngine, sal_uIntPtr nPara, sal_uInt16 nSepPos ); ~TextUndoSplitPara(); virtual void Undo(); @@ -95,7 +95,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); }; @@ -123,9 +123,9 @@ private: TextSelection maSelection; // SfxItemSet aNewAttribs; // TextInfoArray aPrevAttribs; -// BYTE nSpecial; -// BOOL bSetIsRemove; -// USHORT nRemoveWhich; +// sal_uInt8 nSpecial; +// sal_Bool bSetIsRemove; +// sal_uInt16 nRemoveWhich; // // void ImpSetSelection( TextView* pView ); @@ -137,9 +137,9 @@ public: // TextInfoArray& GetTextInfos() { return aPrevAttribs; } // SfxItemSet& GetNewAttribs() { return aNewAttribs; } -// void SetSpecial( BYTE n ) { nSpecial = n; } -// void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; } -// void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; } +// void SetSpecial( sal_uInt8 n ) { nSpecial = n; } +// void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; } +// void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; } virtual void Undo(); virtual void Redo(); diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx index 4c243de16c31..137fb4c04db1 100644 --- a/svtools/source/edit/textundo.cxx +++ b/svtools/source/edit/textundo.cxx @@ -54,33 +54,33 @@ TextUndoManager::~TextUndoManager() { } -BOOL __EXPORT TextUndoManager::Undo( USHORT nCount ) +sal_Bool __EXPORT TextUndoManager::Undo( sal_uInt16 nCount ) { if ( GetUndoActionCount() == 0 ) - return FALSE; + return sal_False; UndoRedoStart(); - mpTextEngine->SetIsInUndo( TRUE ); - BOOL bDone = SfxUndoManager::Undo( nCount ); - mpTextEngine->SetIsInUndo( FALSE ); + mpTextEngine->SetIsInUndo( sal_True ); + sal_Bool bDone = SfxUndoManager::Undo( nCount ); + mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); return bDone; } -BOOL __EXPORT TextUndoManager::Redo( USHORT nCount ) +sal_Bool __EXPORT TextUndoManager::Redo( sal_uInt16 nCount ) { if ( GetRedoActionCount() == 0 ) - return FALSE; + return sal_False; UndoRedoStart(); - mpTextEngine->SetIsInUndo( TRUE ); - BOOL bDone = SfxUndoManager::Redo( nCount ); - mpTextEngine->SetIsInUndo( FALSE ); + mpTextEngine->SetIsInUndo( sal_True ); + sal_Bool bDone = SfxUndoManager::Redo( nCount ); + mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); @@ -110,7 +110,7 @@ void TextUndoManager::UndoRedoEnd() } -TextUndo::TextUndo( USHORT nI, TextEngine* p ) +TextUndo::TextUndo( sal_uInt16 nI, TextEngine* p ) { mnId = nI; mpTextEngine = p; @@ -120,7 +120,7 @@ TextUndo::~TextUndo() { } -USHORT __EXPORT TextUndo::GetId() const +sal_uInt16 __EXPORT TextUndo::GetId() const { //nId sollte mal entfallen => GetId ueberall ueberladen... return mnId; @@ -139,12 +139,12 @@ void TextUndo::SetSelection( const TextSelection& rSel ) } -TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara ) +TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uIntPtr nPara ) : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine ) { mpNode = pNode; mnPara = nPara; - mbDelObject = TRUE; + mbDelObject = sal_True; } TextUndoDelPara::~TextUndoDelPara() @@ -156,7 +156,7 @@ TextUndoDelPara::~TextUndoDelPara() void __EXPORT TextUndoDelPara::Undo() { GetTextEngine()->InsertContent( mpNode, mnPara ); - mbDelObject = FALSE; // gehoert wieder der Engine + mbDelObject = sal_False; // gehoert wieder der Engine if ( GetView() ) { @@ -178,10 +178,10 @@ void __EXPORT TextUndoDelPara::Redo() GetDoc()->GetNodes().Remove( mnPara ); GetTextEngine()->ImpParagraphRemoved( mnPara ); - mbDelObject = TRUE; // gehoert wieder dem Undo + mbDelObject = sal_True; // gehoert wieder dem Undo - ULONG nParas = GetDoc()->GetNodes().Count(); - ULONG n = mnPara < nParas ? mnPara : (nParas-1); + sal_uIntPtr nParas = GetDoc()->GetNodes().Count(); + sal_uIntPtr n = mnPara < nParas ? mnPara : (nParas-1); TextNode* pN = GetDoc()->GetNodes().GetObject( n ); TextPaM aPaM( n, pN->GetText().Len() ); SetSelection( aPaM ); @@ -190,7 +190,7 @@ void __EXPORT TextUndoDelPara::Redo() // ----------------------------------------------------------------------- // TextUndoConnectParas // ------------------------------------------------------------------------ -TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos ) +TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uIntPtr nPara, sal_uInt16 nPos ) : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine ) { mnPara = nPara; @@ -214,7 +214,7 @@ void __EXPORT TextUndoConnectParas::Redo() } -TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos ) +TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uIntPtr nPara, sal_uInt16 nPos ) : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine ) { mnPara = nPara; @@ -261,22 +261,22 @@ void __EXPORT TextUndoInsertChars::Redo() SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) ); } -BOOL __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) +sal_Bool __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) { if ( !pNextAction->ISA( TextUndoInsertChars ) ) - return FALSE; + return sal_False; TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction; if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() ) - return FALSE; + return sal_False; if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() ) { maText += pNext->maText; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -308,7 +308,7 @@ TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelec { maSelection.Justify(); // aNewAttribs.Set( rNewItems ); -// mbSetIsRemove = FALSE; +// mbSetIsRemove = sal_False; // mnRemoveWhich = 0; // mnSpecial = 0; } @@ -320,12 +320,12 @@ TextUndoSetAttribs::~TextUndoSetAttribs() void __EXPORT TextUndoSetAttribs::Undo() { - for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) + for ( sal_uIntPtr nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) { -// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ]; +// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ]; // GetTextEngine()->RemoveCharAttribs( nPara ); // TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara ); -// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) +// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) // { // GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() ); // } diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx index cc26c0b51ef6..859816a90062 100644 --- a/svtools/source/edit/textundo.hxx +++ b/svtools/source/edit/textundo.hxx @@ -47,16 +47,16 @@ public: ~TextUndoManager(); using SfxUndoManager::Undo; - virtual BOOL Undo( USHORT nCount=1 ); + virtual sal_Bool Undo( sal_uInt16 nCount=1 ); using SfxUndoManager::Redo; - virtual BOOL Redo( USHORT nCount=1 ); + virtual sal_Bool Redo( sal_uInt16 nCount=1 ); }; class TextUndo : public SfxUndoAction { private: - USHORT mnId; + sal_uInt16 mnId; TextEngine* mpTextEngine; protected: @@ -69,7 +69,7 @@ protected: public: TYPEINFO(); - TextUndo( USHORT nId, TextEngine* pTextEngine ); + TextUndo( sal_uInt16 nId, TextEngine* pTextEngine ); virtual ~TextUndo(); TextEngine* GetTextEngine() const { return mpTextEngine; } @@ -78,7 +78,7 @@ public: virtual void Redo() = 0; virtual XubString GetComment() const; - virtual USHORT GetId() const; + virtual sal_uInt16 GetId() const; }; #endif // _TEXTUNDO_HXX diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index 48cd23bdcc6f..2eba6731b3f0 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -124,7 +124,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla { uno::Any aAny; - ULONG nT = SotExchange::GetFormat( rFlavor ); + sal_uIntPtr nT = SotExchange::GetFormat( rFlavor ); if ( nT == SOT_FORMAT_STRING ) { aAny <<= (::rtl::OUString)GetText(); @@ -132,7 +132,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla else if ( nT == SOT_FORMATSTR_ID_HTML ) { GetHTMLStream().Seek( STREAM_SEEK_TO_END ); - ULONG nLen = GetHTMLStream().Tell(); + sal_uIntPtr nLen = GetHTMLStream().Tell(); GetHTMLStream().Seek(0); uno::Sequence< sal_Int8 > aSeq( nLen ); @@ -149,7 +149,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException) { GetHTMLStream().Seek( STREAM_SEEK_TO_END ); - BOOL bHTML = GetHTMLStream().Tell() > 0; + sal_Bool bHTML = GetHTMLStream().Tell() > 0; uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 ); SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] ); if ( bHTML ) @@ -159,7 +159,7 @@ uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavo sal_Bool TETextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException) { - ULONG nT = SotExchange::GetFormat( rFlavor ); + sal_uIntPtr nT = SotExchange::GetFormat( rFlavor ); return ( nT == SOT_FORMAT_STRING ); } @@ -186,17 +186,17 @@ struct ImpTextView ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener; - USHORT mnTravelXPos; - - BOOL mbAutoScroll : 1; - BOOL mbInsertMode : 1; - BOOL mbReadOnly : 1; - BOOL mbPaintSelection : 1; - BOOL mbAutoIndent : 1; - BOOL mbHighlightSelection : 1; - BOOL mbCursorEnabled : 1; - BOOL mbClickedInSelection : 1; - BOOL mbSupportProtectAttribute : 1; + sal_uInt16 mnTravelXPos; + + sal_Bool mbAutoScroll : 1; + sal_Bool mbInsertMode : 1; + sal_Bool mbReadOnly : 1; + sal_Bool mbPaintSelection : 1; + sal_Bool mbAutoIndent : 1; + sal_Bool mbHighlightSelection : 1; + sal_Bool mbCursorEnabled : 1; + sal_Bool mbClickedInSelection : 1; + sal_Bool mbSupportProtectAttribute : 1; bool mbCursorAtEndOfLine; }; @@ -206,30 +206,30 @@ struct ImpTextView TextView::TextView( TextEngine* pEng, Window* pWindow ) : mpImpl(new ImpTextView) { - pWindow->EnableRTL( FALSE ); + pWindow->EnableRTL( sal_False ); mpImpl->mpWindow = pWindow; mpImpl->mpTextEngine = pEng; mpImpl->mpVirtDev = NULL; - mpImpl->mbPaintSelection = TRUE; - mpImpl->mbAutoScroll = TRUE; - mpImpl->mbInsertMode = TRUE; - mpImpl->mbReadOnly = FALSE; - mpImpl->mbHighlightSelection = FALSE; - mpImpl->mbAutoIndent = FALSE; - mpImpl->mbCursorEnabled = TRUE; - mpImpl->mbClickedInSelection = FALSE; - mpImpl->mbSupportProtectAttribute = FALSE; + mpImpl->mbPaintSelection = sal_True; + mpImpl->mbAutoScroll = sal_True; + mpImpl->mbInsertMode = sal_True; + mpImpl->mbReadOnly = sal_False; + mpImpl->mbHighlightSelection = sal_False; + mpImpl->mbAutoIndent = sal_False; + mpImpl->mbCursorEnabled = sal_True; + mpImpl->mbClickedInSelection = sal_False; + mpImpl->mbSupportProtectAttribute = sal_False; mpImpl->mbCursorAtEndOfLine = false; -// mbInSelection = FALSE; +// mbInSelection = sal_False; mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW; mpImpl->mpSelFuncSet = new TextSelFunctionSet( this ); mpImpl->mpSelEngine = new SelectionEngine( mpImpl->mpWindow, mpImpl->mpSelFuncSet ); mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION ); - mpImpl->mpSelEngine->EnableDrag( TRUE ); + mpImpl->mpSelEngine->EnableDrag( sal_True ); mpImpl->mpCursor = new Cursor; mpImpl->mpCursor->Show(); @@ -237,7 +237,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) : pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) ); if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT ) - mpImpl->mbHighlightSelection = TRUE; + mpImpl->mbHighlightSelection = sal_True; pWindow->SetLineColor(); @@ -275,7 +275,7 @@ void TextView::Invalidate() mpImpl->mpWindow->Invalidate(); } -void TextView::SetSelection( const TextSelection& rTextSel, BOOL bGotoCursor ) +void TextView::SetSelection( const TextSelection& rTextSel, sal_Bool bGotoCursor ) { // Falls jemand gerade ein leeres Attribut hinterlassen hat, // und dann der Outliner die Selektion manipulitert: @@ -345,10 +345,10 @@ void TextView::ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle c void TextView::Paint( const Rectangle& rRect ) { - ImpPaint( rRect, FALSE ); + ImpPaint( rRect, sal_False ); } -void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev ) +void TextView::ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev ) { if ( !mpImpl->mpTextEngine->GetUpdateMode() || mpImpl->mpTextEngine->IsInUndo() ) return; @@ -367,7 +367,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev ) if ( pVDev->GetBackground().GetColor() != rBackgroundColor ) pVDev->SetBackground( rBackgroundColor ); - BOOL bVDevValid = TRUE; + sal_Bool bVDevValid = sal_True; Size aOutSz( pVDev->GetOutputSizePixel() ); if ( ( aOutSz.Width() < rRect.GetWidth() ) || ( aOutSz.Height() < rRect.GetHeight() ) ) @@ -390,7 +390,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev ) } if ( !bVDevValid ) { - ImpPaint( rRect, FALSE /* ohne VDev */ ); + ImpPaint( rRect, sal_False /* ohne VDev */ ); return; } @@ -428,27 +428,27 @@ void TextView::ImpHighlight( const TextSelection& rSel ) Rectangle aVisArea( mpImpl->maStartDocPos, mpImpl->mpWindow->GetOutputSizePixel() ); long nY = 0; - ULONG nStartPara = aSel.GetStart().GetPara(); - ULONG nEndPara = aSel.GetEnd().GetPara(); - for ( ULONG nPara = 0; nPara <= nEndPara; nPara++ ) + sal_uIntPtr nStartPara = aSel.GetStart().GetPara(); + sal_uIntPtr nEndPara = aSel.GetEnd().GetPara(); + for ( sal_uIntPtr nPara = 0; nPara <= nEndPara; nPara++ ) { long nParaHeight = (long)mpImpl->mpTextEngine->CalcParaHeight( nPara ); if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) ) { TEParaPortion* pTEParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( nPara ); - USHORT nStartLine = 0; - USHORT nEndLine = pTEParaPortion->GetLines().Count() -1; + sal_uInt16 nStartLine = 0; + sal_uInt16 nEndLine = pTEParaPortion->GetLines().Count() -1; if ( nPara == nStartPara ) - nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), FALSE ); + nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), sal_False ); if ( nPara == nEndPara ) - nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), TRUE ); + nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), sal_True ); // ueber die Zeilen iterieren.... - for ( USHORT nLine = nStartLine; nLine <= nEndLine; nLine++ ) + for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ ) { TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine ); - USHORT nStartIndex = pLine->GetStart(); - USHORT nEndIndex = pLine->GetEnd(); + sal_uInt16 nStartIndex = pLine->GetStart(); + sal_uInt16 nEndIndex = pLine->GetEnd(); if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) ) nStartIndex = aSel.GetStart().GetIndex(); if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) ) @@ -458,12 +458,12 @@ void TextView::ImpHighlight( const TextSelection& rSel ) if ( nEndIndex < nStartIndex ) nEndIndex = nStartIndex; - Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), FALSE ) ); + Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), sal_False ) ); aTmpRec.Top() += nY; aTmpRec.Bottom() += nY; Point aTopLeft( aTmpRec.TopLeft() ); - aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), TRUE ); + aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), sal_True ); aTmpRec.Top() += nY; aTmpRec.Bottom() += nY; Point aBottomRight( aTmpRec.BottomRight() ); @@ -499,20 +499,20 @@ void TextView::ImpSetSelection( const TextSelection& rSelection ) void TextView::ShowSelection() { - ImpShowHideSelection( TRUE ); + ImpShowHideSelection( sal_True ); } void TextView::HideSelection() { - ImpShowHideSelection( FALSE ); + ImpShowHideSelection( sal_False ); } void TextView::ShowSelection( const TextSelection& rRange ) { - ImpShowHideSelection( TRUE, &rRange ); + ImpShowHideSelection( sal_True, &rRange ); } -void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange ) +void TextView::ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange ) { const TextSelection* pRangeOrSelection = pRange ? pRange : &mpImpl->maSelection; @@ -532,7 +532,7 @@ void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange ) Point aStartPos( ImpGetOutputStartPos( mpImpl->maStartDocPos ) ); TextSelection aRange( *pRangeOrSelection ); aRange.Justify(); - BOOL bVisCursor = mpImpl->mpCursor->IsVisible(); + sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible(); mpImpl->mpCursor->Hide(); ImpPaint( mpImpl->mpWindow, aStartPos, &aOutArea, &aRange, bShow ? &mpImpl->maSelection : NULL ); if ( bVisCursor ) @@ -558,24 +558,24 @@ void TextView::EraseVirtualDevice() mpImpl->mpVirtDev = 0; } -BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) +sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent ) { - BOOL bDone = TRUE; - BOOL bModified = FALSE; - BOOL bMoved = FALSE; - BOOL bEndKey = FALSE; // spezielle CursorPosition - BOOL bAllowIdle = TRUE; + sal_Bool bDone = sal_True; + sal_Bool bModified = sal_False; + sal_Bool bMoved = sal_False; + sal_Bool bEndKey = sal_False; // spezielle CursorPosition + sal_Bool bAllowIdle = sal_True; // Um zu pruefen ob durch irgendeine Aktion mModified, das lokale // bModified wird z.B. bei Cut/Paste nicht gesetzt, weil dort an anderen // Stellen das updaten erfolgt. - BOOL bWasModified = mpImpl->mpTextEngine->IsModified(); - mpImpl->mpTextEngine->SetModified( FALSE ); + sal_Bool bWasModified = mpImpl->mpTextEngine->IsModified(); + mpImpl->mpTextEngine->SetModified( sal_False ); TextSelection aCurSel( mpImpl->maSelection ); TextSelection aOldSel( aCurSel ); - USHORT nCode = rKeyEvent.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode(); KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction(); if ( eFunc != KEYFUNC_DONTKNOW ) { @@ -652,12 +652,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) uno::Reference<datatransfer::clipboard::XClipboard> aSelection(GetWindow()->GetPrimarySelection()); Copy( aSelection ); } - bMoved = TRUE; + bMoved = sal_True; if ( nCode == KEY_END ) - bEndKey = TRUE; + bEndKey = sal_True; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_BACKSPACE: @@ -669,8 +669,8 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) { if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod2() ) { - BYTE nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT; - BYTE nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE; + sal_uInt8 nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT; + sal_uInt8 nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE; if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() ) nMode = DELMODE_RESTOFCONTENT; @@ -718,11 +718,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) } aCurSel = ImpDelete( nDel, nMode ); mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE ); - bModified = TRUE; - bAllowIdle = FALSE; + bModified = sal_True; + bAllowIdle = sal_False; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_TAB: @@ -732,10 +732,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) ImplCheckTextLen( 'x' ) ) { aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() ); - bModified = TRUE; + bModified = sal_True; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_RETURN: @@ -750,7 +750,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) if ( mpImpl->mbAutoIndent ) { TextNode* pPrev = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aCurSel.GetEnd().GetPara() - 1 ); - USHORT n = 0; + sal_uInt16 n = 0; while ( ( n < pPrev->GetText().Len() ) && ( ( pPrev->GetText().GetChar( n ) == ' ' ) || ( pPrev->GetText().GetChar( n ) == '\t' ) ) ) @@ -761,10 +761,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) ); } mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT ); - bModified = TRUE; + bModified = sal_True; } else - bDone = FALSE; + bDone = sal_False; } break; case KEY_INSERT: @@ -781,11 +781,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) if ( !mpImpl->mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken... { aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), sal_True ); - bModified = TRUE; + bModified = sal_True; } } else - bDone = FALSE; + bDone = sal_False; } } } @@ -809,20 +809,20 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent ) else if ( bMoved ) { // Selection wird jetzt gezielt in ImpMoveCursor gemalt. - ImpShowCursor( mpImpl->mbAutoScroll, TRUE, bEndKey ); + ImpShowCursor( mpImpl->mbAutoScroll, sal_True, bEndKey ); } if ( mpImpl->mpTextEngine->IsModified() ) mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); else if ( bWasModified ) - mpImpl->mpTextEngine->SetModified( TRUE ); + mpImpl->mpTextEngine->SetModified( sal_True ); return bDone; } void TextView::MouseButtonUp( const MouseEvent& rMouseEvent ) { - mpImpl->mbClickedInSelection = FALSE; + mpImpl->mbClickedInSelection = sal_False; mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW; mpImpl->mpSelEngine->SelMouseButtonUp( rMouseEvent ); if ( rMouseEvent.IsMiddle() && !IsReadOnly() && @@ -876,18 +876,18 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent ) uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True ); TextSelection aNewSel( mpImpl->maSelection ); - aNewSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos; - aNewSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos; + aNewSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos; + aNewSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos; if(mpImpl->mbSupportProtectAttribute) { //expand selection to include all protected content - if there is any const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib( TextPaM(aNewSel.GetStart().GetPara(), - (USHORT)aBoundary.startPos), + (sal_uInt16)aBoundary.startPos), TEXTATTR_PROTECTED ); const TextCharAttrib* pEndAttr = mpImpl->mpTextEngine->FindCharAttrib( TextPaM(aNewSel.GetEnd().GetPara(), - (USHORT)aBoundary.endPos), + (sal_uInt16)aBoundary.endPos), TEXTATTR_PROTECTED ); if(pStartAttr && pStartAttr->GetStart() < aNewSel.GetStart().GetIndex()) { @@ -900,7 +900,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent ) } ImpSetSelection( aNewSel ); ShowSelection(); - ShowCursor( TRUE, TRUE ); + ShowCursor( sal_True, sal_True ); } } else if ( rMouseEvent.GetClicks() == 3 ) @@ -914,7 +914,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent ) aNewSel.GetEnd().GetIndex() = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( mpImpl->maSelection.GetEnd().GetPara() )->GetText().Len(); ImpSetSelection( aNewSel ); ShowSelection(); - ShowCursor( TRUE, TRUE ); + ShowCursor( sal_True, sal_True ); } } } @@ -948,7 +948,7 @@ void TextView::Command( const CommandEvent& rCEvt ) TEParaPortion* pPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetPara() ); pPortion->MarkSelectionInvalid( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex(), 0 ); - BOOL bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite; + sal_Bool bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite; delete mpImpl->mpTextEngine->mpIMEInfos; mpImpl->mpTextEngine->mpIMEInfos = NULL; @@ -977,14 +977,14 @@ void TextView::Command( const CommandEvent& rCEvt ) if ( mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite ) { - USHORT nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen; - USHORT nNewIMETextLen = pData->GetText().Len(); + sal_uInt16 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen; + sal_uInt16 nNewIMETextLen = pData->GetText().Len(); if ( ( nOldIMETextLen > nNewIMETextLen ) && ( nNewIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) ) { // restore old characters - USHORT nRestore = nOldIMETextLen - nNewIMETextLen; + sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen; TextPaM aPaM( mpImpl->mpTextEngine->mpIMEInfos->aPos ); aPaM.GetIndex() = aPaM.GetIndex() + nNewIMETextLen; mpImpl->mpTextEngine->ImpInsertText( aPaM, mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ) ); @@ -993,7 +993,7 @@ void TextView::Command( const CommandEvent& rCEvt ) ( nOldIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) ) { // overwrite - USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen; + sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen; if ( ( nOldIMETextLen + nOverwrite ) > mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) nOverwrite = mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen; DBG_ASSERT( nOverwrite && (nOverwrite < 0xFF00), "IME Overwrite?!" ); @@ -1038,13 +1038,13 @@ void TextView::Command( const CommandEvent& rCEvt ) TextPaM aPaM( GetSelection().GetEnd() ); Rectangle aR1 = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM ); - USHORT nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen; + sal_uInt16 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen; if ( !mpImpl->mpTextEngine->IsFormatted() ) mpImpl->mpTextEngine->FormatDoc(); TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ); + sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ); TextLine* pLine = pParaPortion->GetLines().GetObject( nLine ); if ( pLine && ( nInputEnd > pLine->GetEnd() ) ) nInputEnd = pLine->GetEnd(); @@ -1065,12 +1065,12 @@ void TextView::Command( const CommandEvent& rCEvt ) } } -void TextView::ShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor ) +void TextView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor ) { // Die Einstellung hat mehr Gewicht: if ( !mpImpl->mbAutoScroll ) - bGotoCursor = FALSE; - ImpShowCursor( bGotoCursor, bForceVisCursor, FALSE ); + bGotoCursor = sal_False; + ImpShowCursor( bGotoCursor, bForceVisCursor, sal_False ); } void TextView::HideCursor() @@ -1102,7 +1102,7 @@ void TextView::Scroll( long ndX, long ndY ) if ( nDiffX || nDiffY ) { - BOOL bVisCursor = mpImpl->mpCursor->IsVisible(); + sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible(); mpImpl->mpCursor->Hide(); mpImpl->mpWindow->Update(); mpImpl->maStartDocPos = aNewStartPos; @@ -1146,7 +1146,7 @@ void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxCl TETextDataObject* pDataObj = new TETextDataObject( GetSelected() ); if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML - mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE ); + mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True ); const sal_uInt32 nRef = Application::ReleaseSolarMutex(); @@ -1204,7 +1204,7 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC bool bWasTruncated = false; if( mpImpl->mpTextEngine->GetMaxTextLen() != 0 ) bWasTruncated = ImplTruncateNewText( aText ); - InsertNewText( aText, FALSE ); + InsertNewText( aText, sal_False ); mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) ); if( bWasTruncated ) @@ -1234,22 +1234,22 @@ String TextView::GetSelected( LineEnd aSeparator ) return mpImpl->mpTextEngine->GetText( mpImpl->maSelection, aSeparator ); } -void TextView::SetInsertMode( BOOL bInsert ) +void TextView::SetInsertMode( sal_Bool bInsert ) { if ( mpImpl->mbInsertMode != bInsert ) { mpImpl->mbInsertMode = bInsert; - ShowCursor( mpImpl->mbAutoScroll, FALSE ); + ShowCursor( mpImpl->mbAutoScroll, sal_False ); } } -void TextView::SetReadOnly( BOOL bReadOnly ) +void TextView::SetReadOnly( sal_Bool bReadOnly ) { if ( mpImpl->mbReadOnly != bReadOnly ) { mpImpl->mbReadOnly = bReadOnly; if ( !mpImpl->mbReadOnly ) - ShowCursor( mpImpl->mbAutoScroll, FALSE ); + ShowCursor( mpImpl->mbAutoScroll, sal_False ); else HideCursor(); @@ -1271,8 +1271,8 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection ); - BOOL bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE; - USHORT nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); + sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False; + sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); bool bSelect = aTranslatedKeyEvent.GetKeyCode().IsShift(); switch ( nCode ) @@ -1289,9 +1289,9 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) break; case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM ); break; - case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); break; - case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); break; case com::sun::star::awt::Key::SELECT_WORD_FORWARD: bSelect = true; // fallthrough intentional @@ -1362,12 +1362,12 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) return mpImpl->maSelection; } -void TextView::InsertText( const XubString& rStr, BOOL bSelect ) +void TextView::InsertText( const XubString& rStr, sal_Bool bSelect ) { InsertNewText( rStr, bSelect ); } -void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect ) +void TextView::InsertNewText( const rtl::OUString& rStr, sal_Bool bSelect ) { // HideSelection(); mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT ); @@ -1411,7 +1411,7 @@ void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect ) } /* -void TextView::InsertText( const XubString& rStr, BOOL bSelect ) +void TextView::InsertText( const XubString& rStr, sal_Bool bSelect ) { // HideSelection(); @@ -1438,22 +1438,22 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect ) */ // OLD -TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode ) +TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode ) { - return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); - // Remove (USHORT) typecasts in this file when removing this method! + // Remove (sal_uInt16) typecasts in this file when removing this method! } // OLD -TextPaM TextView::CursorRight( const TextPaM& rPaM, BOOL bWordMode ) +TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_Bool bWordMode ) { - return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); - // Remove (USHORT) typecasts in this file when removing this method! + // Remove (sal_uInt16) typecasts in this file when removing this method! } -TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode ) +TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { TextPaM aPaM( rPaM ); @@ -1462,7 +1462,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() ); uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); sal_Int32 nCount = 1; - aPaM.GetIndex() = (USHORT)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); + aPaM.GetIndex() = (sal_uInt16)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); } else if ( aPaM.GetPara() ) { @@ -1473,7 +1473,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode return aPaM; } -TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode ) +TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { TextPaM aPaM( rPaM ); @@ -1482,7 +1482,7 @@ TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMod { uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); sal_Int32 nCount = 1; - aPaM.GetIndex() = (USHORT)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); + aPaM.GetIndex() = (sal_uInt16)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount ); } else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) ) { @@ -1505,7 +1505,7 @@ TextPaM TextView::CursorWordLeft( const TextPaM& rPaM ) i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True ); if ( aBoundary.startPos >= rPaM.GetIndex() ) aBoundary = xBI->previousWord( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (USHORT)aBoundary.startPos : 0; + aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (sal_uInt16)aBoundary.startPos : 0; } else if ( aPaM.GetPara() ) { @@ -1526,7 +1526,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM ) { uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - aPaM.GetIndex() = (USHORT)aBoundary.startPos; + aPaM.GetIndex() = (sal_uInt16)aBoundary.startPos; } else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) ) { @@ -1537,7 +1537,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM ) return aPaM; } -TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) +TextPaM TextView::ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode ) { if ( mpImpl->maSelection.HasRange() ) // dann nur Sel. loeschen return mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection ); @@ -1548,7 +1548,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) { if ( nDelMode == DELMODE_SIMPLE ) { - aEndPaM = CursorLeft( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER ); + aEndPaM = CursorLeft( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER ); } else if ( nDelMode == DELMODE_RESTOFWORD ) { @@ -1558,7 +1558,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) if ( aBoundary.startPos == mpImpl->maSelection.GetEnd().GetIndex() ) aBoundary = xBI->previousWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); // #i63506# startPos is -1 when the paragraph starts with a tab - aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (USHORT)aBoundary.startPos : 0; + aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (sal_uInt16)aBoundary.startPos : 0; } else // DELMODE_RESTOFCONTENT { @@ -1576,14 +1576,14 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode ) { if ( nDelMode == DELMODE_SIMPLE ) { - aEndPaM = CursorRight( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + aEndPaM = CursorRight( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); } else if ( nDelMode == DELMODE_RESTOFWORD ) { TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() ); uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator(); i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - aEndPaM.GetIndex() = (USHORT)aBoundary.startPos; + aEndPaM.GetIndex() = (sal_uInt16)aBoundary.startPos; } else // DELMODE_RESTOFCONTENT { @@ -1612,17 +1612,17 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) long nX; if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW ) { - nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left(); - mpImpl->mnTravelXPos = (USHORT)nX+1; + nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left(); + mpImpl->mnTravelXPos = (sal_uInt16)nX+1; } else nX = mpImpl->mnTravelXPos; TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False ); if ( nLine ) // gleicher Absatz { - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX ); + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX ); aPaM.GetIndex() = nCharPos; // Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das // Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang @@ -1635,8 +1635,8 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) { aPaM.GetPara()--; pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nL = pPPortion->GetLines().Count() - 1; - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 ); + sal_uInt16 nL = pPPortion->GetLines().Count() - 1; + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 ); aPaM.GetIndex() = nCharPos; } @@ -1650,17 +1650,17 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) long nX; if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW ) { - nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left(); - mpImpl->mnTravelXPos = (USHORT)nX+1; + nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left(); + mpImpl->mnTravelXPos = (sal_uInt16)nX+1; } else nX = mpImpl->mnTravelXPos; TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False ); if ( nLine < ( pPPortion->GetLines().Count() - 1 ) ) { - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX ); + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX ); aPaM.GetIndex() = nCharPos; // Sonderbehandlung siehe CursorUp... @@ -1672,7 +1672,7 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) { aPaM.GetPara()++; pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 ); + sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 ); aPaM.GetIndex() = nCharPos; TextLine* pLine = pPPortion->GetLines().GetObject( 0 ); if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) ) @@ -1687,7 +1687,7 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM ) TextPaM aPaM( rPaM ); TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); aPaM.GetIndex() = pLine->GetStart(); @@ -1699,13 +1699,13 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM ) TextPaM aPaM( rPaM ); TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); - USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); aPaM.GetIndex() = pLine->GetEnd(); if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile { - xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((USHORT)(aPaM.GetIndex()-1) ); + xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((sal_uInt16)(aPaM.GetIndex()-1) ); if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().Len() ) ) { // Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn, @@ -1740,7 +1740,7 @@ TextPaM TextView::CursorStartOfDoc() TextPaM TextView::CursorEndOfDoc() { - ULONG nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1; + sal_uIntPtr nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1; TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( nNode ); TextPaM aPaM( nNode, pNode->GetText().Len() ); return aPaM; @@ -1773,11 +1773,11 @@ TextPaM TextView::PageDown( const TextPaM& rPaM ) return aPaM; } -void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpecial ) +void TextView::ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bSpecial ) { if ( mpImpl->mpTextEngine->IsFormatting() ) return; - if ( mpImpl->mpTextEngine->GetUpdateMode() == FALSE ) + if ( mpImpl->mpTextEngine->GetUpdateMode() == sal_False ) return; if ( mpImpl->mpTextEngine->IsInUndo() ) return; @@ -1796,7 +1796,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec { TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); mpImpl->mbCursorAtEndOfLine = - pParaPortion->GetLineNumber( aPaM.GetIndex(), TRUE ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); } if ( !IsInsertMode() && !mpImpl->maSelection.HasRange() ) @@ -1805,12 +1805,12 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec if ( pNode->GetText().Len() && ( aPaM.GetIndex() < pNode->GetText().Len() ) ) { // If we are behind a portion, and the next portion has other direction, we must change position... - aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, FALSE, TRUE ).Left(); + aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, sal_False, sal_True ).Left(); TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - USHORT nTextPortionStart = 0; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, TRUE ); + sal_uInt16 nTextPortionStart = 0; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, sal_True ); TETextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); if ( pTextPortion->GetKind() == PORTIONKIND_TAB ) { @@ -1822,8 +1822,8 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec } else { - TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); - aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, TRUE ).Left(); + TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); + aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, sal_True ).Left(); } } } @@ -1872,7 +1872,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec } // X kann durch das 'bischen mehr' falsch sein: -// ULONG nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth(); +// sal_uIntPtr nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth(); // if ( !nMaxTextWidth || ( nMaxTextWidth > 0x7FFFFFFF ) ) // nMaxTextWidth = 0x7FFFFFFF; // long nMaxX = (long)nMaxTextWidth - aOutSz.Width(); @@ -1910,7 +1910,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec mpImpl->mpCursor->Show(); } -BOOL TextView::SetCursorAtPoint( const Point& rPosPixel ) +sal_Bool TextView::SetCursorAtPoint( const Point& rPosPixel ) { mpImpl->mpTextEngine->CheckIdleFormatter(); @@ -1936,50 +1936,50 @@ BOOL TextView::SetCursorAtPoint( const Point& rPosPixel ) ShowSelection( aTmpNewSel ); } - BOOL bForceCursor = mpImpl->mpDDInfo ? FALSE : TRUE; // && !mbInSelection - ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, FALSE ); - return TRUE; + sal_Bool bForceCursor = mpImpl->mpDDInfo ? sal_False : sal_True; // && !mbInSelection + ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, sal_False ); + return sal_True; } -BOOL TextView::IsSelectionAtPoint( const Point& rPosPixel ) +sal_Bool TextView::IsSelectionAtPoint( const Point& rPosPixel ) { // if ( !Rectangle( Point(), mpImpl->mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection ) -// return FALSE; +// return sal_False; Point aDocPos = GetDocPos( rPosPixel ); - TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, FALSE ); + TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, sal_False ); // Bei Hyperlinks D&D auch ohne Selektion starten. // BeginDrag wird aber nur gerufen, wenn IsSelectionAtPoint() // Problem: IsSelectionAtPoint wird bei Command() nicht gerufen, - // wenn vorher im MBDown schon FALSE returnt wurde. + // wenn vorher im MBDown schon sal_False returnt wurde. return ( IsInSelection( aPaM ) || ( /* mpImpl->mpSelEngine->IsInCommand() && */ mpImpl->mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ) ) ); } -BOOL TextView::IsInSelection( const TextPaM& rPaM ) +sal_Bool TextView::IsInSelection( const TextPaM& rPaM ) { TextSelection aSel = mpImpl->maSelection; aSel.Justify(); - ULONG nStartNode = aSel.GetStart().GetPara(); - ULONG nEndNode = aSel.GetEnd().GetPara(); - ULONG nCurNode = rPaM.GetPara(); + sal_uIntPtr nStartNode = aSel.GetStart().GetPara(); + sal_uIntPtr nEndNode = aSel.GetEnd().GetPara(); + sal_uIntPtr nCurNode = rPaM.GetPara(); if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) ) - return TRUE; + return sal_True; if ( nStartNode == nEndNode ) { if ( nCurNode == nStartNode ) if ( ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) ) - return TRUE; + return sal_True; } else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) ) - return TRUE; + return sal_True; else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } void TextView::ImpHideDDCursor() @@ -1987,7 +1987,7 @@ void TextView::ImpHideDDCursor() if ( mpImpl->mpDDInfo && mpImpl->mpDDInfo->mbVisCursor ) { mpImpl->mpDDInfo->maCursor.Hide(); - mpImpl->mpDDInfo->mbVisCursor = FALSE; + mpImpl->mpDDInfo->mbVisCursor = sal_False; } } @@ -1995,7 +1995,7 @@ void TextView::ImpShowDDCursor() { if ( !mpImpl->mpDDInfo->mbVisCursor ) { - Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, TRUE ); + Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, sal_True ); aCursor.Right()++; aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) ); @@ -2003,11 +2003,11 @@ void TextView::ImpShowDDCursor() mpImpl->mpDDInfo->maCursor.SetPos( aCursor.TopLeft() ); mpImpl->mpDDInfo->maCursor.SetSize( aCursor.GetSize() ); mpImpl->mpDDInfo->maCursor.Show(); - mpImpl->mpDDInfo->mbVisCursor = TRUE; + mpImpl->mpDDInfo->mbVisCursor = sal_True; } } -void TextView::SetPaintSelection( BOOL bPaint ) +void TextView::SetPaintSelection( sal_Bool bPaint ) { if ( bPaint != mpImpl->mbPaintSelection ) { @@ -2016,7 +2016,7 @@ void TextView::SetPaintSelection( BOOL bPaint ) } } -void TextView::SetHighlightSelection( BOOL bSelectByHighlight ) +void TextView::SetHighlightSelection( sal_Bool bSelectByHighlight ) { if ( bSelectByHighlight != mpImpl->mbHighlightSelection ) { @@ -2025,14 +2025,14 @@ void TextView::SetHighlightSelection( BOOL bSelectByHighlight ) } } -BOOL TextView::Read( SvStream& rInput ) +sal_Bool TextView::Read( SvStream& rInput ) { - BOOL bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection ); + sal_Bool bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection ); ShowCursor(); return bDone; } -BOOL TextView::Write( SvStream& rOutput ) +sal_Bool TextView::Write( SvStream& rOutput ) { return mpImpl->mpTextEngine->Read( rOutput, &mpImpl->maSelection ); } @@ -2047,17 +2047,17 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const bTruncated = true; } - ULONG nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen(); + sal_uIntPtr nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen(); // 0 means unlimited, there is just the String API limit handled above if( nMaxLen != 0 ) { - ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen(); + sal_uIntPtr nCurLen = mpImpl->mpTextEngine->GetTextLen(); sal_uInt32 nNewLen = rNewText.getLength(); if ( nCurLen + nNewLen > nMaxLen ) { // see how much text will be replaced - ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection ); + sal_uIntPtr nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection ); if ( nCurLen + nNewLen - nSelLen > nMaxLen ) { sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen)); @@ -2069,12 +2069,12 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const return bTruncated; } -BOOL TextView::ImplCheckTextLen( const String& rNewText ) +sal_Bool TextView::ImplCheckTextLen( const String& rNewText ) { - BOOL bOK = TRUE; + sal_Bool bOK = sal_True; if ( mpImpl->mpTextEngine->GetMaxTextLen() ) { - ULONG n = mpImpl->mpTextEngine->GetTextLen(); + sal_uIntPtr n = mpImpl->mpTextEngine->GetTextLen(); n += rNewText.Len(); if ( n > mpImpl->mpTextEngine->GetMaxTextLen() ) { @@ -2085,7 +2085,7 @@ BOOL TextView::ImplCheckTextLen( const String& rNewText ) // Beep hat hier eigentlich nichts verloren, sondern lieber ein Hdl, // aber so funktioniert es wenigstens in ME, BasicIDE, SourceView Sound::Beep(); - bOK = FALSE; + bOK = sal_False; } } } @@ -2102,12 +2102,12 @@ void TextView::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd: delete mpImpl->mpDDInfo; mpImpl->mpDDInfo = new TextDDInfo; - mpImpl->mpDDInfo->mbStarterOfDD = TRUE; + mpImpl->mpDDInfo->mbStarterOfDD = sal_True; TETextDataObject* pDataObj = new TETextDataObject( GetSelected() ); if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML - mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE ); + mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True ); /* @@ -2151,7 +2151,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv { vos::OGuard aVclGuard( Application::GetSolarMutex() ); - BOOL bChanges = FALSE; + sal_Bool bChanges = sal_False; if ( !mpImpl->mbReadOnly && mpImpl->mpDDInfo ) { ImpHideDDCursor(); @@ -2159,12 +2159,12 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv // Daten fuer das loeschen nach einem DROP_MOVE: TextSelection aPrevSel( mpImpl->maSelection ); aPrevSel.Justify(); - ULONG nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount(); - USHORT nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ); + sal_uIntPtr nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount(); + sal_uInt16 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ); - BOOL bStarterOfDD = FALSE; - for ( USHORT nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; ) - bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : FALSE; + sal_Bool bStarterOfDD = sal_False; + for ( sal_uInt16 nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; ) + bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : sal_False; HideSelection(); ImpSetSelection( mpImpl->mpDDInfo->maDropPos ); @@ -2198,7 +2198,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv mpImpl->mpTextEngine->SetAttrib( TextAttribProtect(), aTempStart.GetPara(), aTempStart.GetIndex(), - mpImpl->maSelection.GetEnd().GetIndex(), FALSE ); + mpImpl->maSelection.GetEnd().GetIndex(), sal_False ); } if ( aPrevSel.HasRange() && @@ -2210,7 +2210,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv ( ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() ) && ( mpImpl->mpDDInfo->maDropPos.GetIndex() < aPrevSel.GetStart().GetIndex() ) ) ) { - ULONG nNewParasBeforeSelection = + sal_uIntPtr nNewParasBeforeSelection = mpImpl->mpTextEngine->GetParagraphCount() - nPrevParaCount; aPrevSel.GetStart().GetPara() += nNewParasBeforeSelection; @@ -2218,7 +2218,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv if ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() ) { - USHORT nNewChars = + sal_uInt16 nNewChars = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen; aPrevSel.GetStart().GetIndex() = @@ -2380,7 +2380,7 @@ sal_Int32 TextView::GetLineNumberOfCursorInSelection() const { TextPaM aPaM = GetSelection().GetEnd(); TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); if( mpImpl->mbCursorAtEndOfLine ) --nLineNo; } @@ -2411,12 +2411,12 @@ void __EXPORT TextSelFunctionSet::CreateAnchor() mpView->ImpSetSelection( mpView->mpImpl->maSelection.GetEnd() ); } -BOOL __EXPORT TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL ) +sal_Bool __EXPORT TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool ) { return mpView->SetCursorAtPoint( rPointPixel ); } -BOOL __EXPORT TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) +sal_Bool __EXPORT TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) { return mpView->IsSelectionAtPoint( rPointPixel ); } @@ -2439,31 +2439,31 @@ TextEngine* TextView::GetTextEngine() const { return mpImpl->mpTextEngine; } Window* TextView::GetWindow() const { return mpImpl->mpWindow; } -void TextView::EnableCursor( BOOL bEnable ) +void TextView::EnableCursor( sal_Bool bEnable ) { mpImpl->mbCursorEnabled = bEnable; } -BOOL TextView::IsCursorEnabled() const +sal_Bool TextView::IsCursorEnabled() const { return mpImpl->mbCursorEnabled; } void TextView::SetStartDocPos( const Point& rPos ) { mpImpl->maStartDocPos = rPos; } const Point& TextView::GetStartDocPos() const { return mpImpl->maStartDocPos; } -void TextView::SetAutoIndentMode( BOOL bAutoIndent ) +void TextView::SetAutoIndentMode( sal_Bool bAutoIndent ) { mpImpl->mbAutoIndent = bAutoIndent; } -BOOL TextView::IsAutoIndentMode() const +sal_Bool TextView::IsAutoIndentMode() const { return mpImpl->mbAutoIndent; } -BOOL TextView::IsReadOnly() const +sal_Bool TextView::IsReadOnly() const { return mpImpl->mbReadOnly; } -void TextView::SetAutoScroll( BOOL bAutoScroll ) +void TextView::SetAutoScroll( sal_Bool bAutoScroll ) { mpImpl->mbAutoScroll = bAutoScroll; } -BOOL TextView::IsAutoScroll() const +sal_Bool TextView::IsAutoScroll() const { return mpImpl->mbAutoScroll; } -BOOL TextView::IsPaintSelection() const +sal_Bool TextView::IsPaintSelection() const { return mpImpl->mbPaintSelection; } -BOOL TextView::IsHighlightSelection() const +sal_Bool TextView::IsHighlightSelection() const { return mpImpl->mbHighlightSelection; } -BOOL TextView::HasSelection() const +sal_Bool TextView::HasSelection() const { return mpImpl->maSelection.HasRange(); } -BOOL TextView::IsInsertMode() const +sal_Bool TextView::IsInsertMode() const { return mpImpl->mbInsertMode; } void TextView::SupportProtectAttribute(sal_Bool bSupport) { mpImpl->mbSupportProtectAttribute = bSupport;} diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx index 0a4907edcadd..43158d6caf83 100644 --- a/svtools/source/edit/xtextedt.cxx +++ b/svtools/source/edit/xtextedt.cxx @@ -52,12 +52,12 @@ ExtTextEngine::~ExtTextEngine() TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const { TextSelection aSel( rCursor ); - USHORT nPos = rCursor.GetIndex(); - ULONG nPara = rCursor.GetPara(); - ULONG nParas = GetParagraphCount(); + sal_uInt16 nPos = rCursor.GetIndex(); + sal_uIntPtr nPara = rCursor.GetPara(); + sal_uIntPtr nParas = GetParagraphCount(); if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) ) { - USHORT nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) ); + sal_uInt16 nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) ); if ( nMatchChar != STRING_NOTFOUND ) { if ( ( nMatchChar % 2 ) == 0 ) @@ -66,8 +66,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const sal_Unicode nSC = maGroupChars.GetChar( nMatchChar ); sal_Unicode nEC = maGroupChars.GetChar( nMatchChar+1 ); - USHORT nCur = nPos+1; - USHORT nLevel = 1; + sal_uInt16 nCur = nPos+1; + sal_uInt16 nLevel = 1; while ( nLevel && ( nPara < nParas ) ) { XubString aStr = GetText( nPara ); @@ -102,8 +102,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const xub_Unicode nEC = maGroupChars.GetChar( nMatchChar ); xub_Unicode nSC = maGroupChars.GetChar( nMatchChar-1 ); - USHORT nCur = rCursor.GetIndex()-1; - USHORT nLevel = 1; + sal_uInt16 nCur = rCursor.GetIndex()-1; + sal_uInt16 nLevel = 1; while ( nLevel ) { if ( GetTextLen( nPara ) ) @@ -148,12 +148,12 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const return aSel; } -BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, BOOL bForward ) +sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, sal_Bool bForward ) { TextSelection aSel( rSel ); aSel.Justify(); - BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); + sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); TextPaM aStartPaM( aSel.GetEnd() ); if ( aSel.HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) ) @@ -162,7 +162,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea } bool bFound = false; - ULONG nStartNode, nEndNode; + sal_uIntPtr nStartNode, nEndNode; if ( bSearchInSelection ) nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara(); @@ -176,13 +176,13 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea utl::TextSearch aSearcher( rSearchOptions ); // ueber die Absaetze iterieren... - for ( ULONG nNode = nStartNode; + for ( sal_uIntPtr nNode = nStartNode; bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode ); bForward ? nNode++ : nNode-- ) { String aText = GetText( nNode ); - USHORT nStartPos = 0; - USHORT nEndPos = aText.Len(); + sal_uInt16 nStartPos = 0; + sal_uInt16 nEndPos = aText.Len(); if ( nNode == nStartNode ) { if ( bForward ) @@ -212,7 +212,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea // Ueber den Absatz selektieren? // Select over the paragraph? // FIXME This should be max long... - if( nEndPos == sal::static_int_cast<USHORT>(-1) ) // USHORT for 0 and -1 ! + if( nEndPos == sal::static_int_cast<sal_uInt16>(-1) ) // sal_uInt16 for 0 and -1 ! { if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() ) { @@ -249,34 +249,34 @@ ExtTextView::~ExtTextView() { } -BOOL ExtTextView::MatchGroup() +sal_Bool ExtTextView::MatchGroup() { TextSelection aTmpSel( GetSelection() ); aTmpSel.Justify(); if ( ( aTmpSel.GetStart().GetPara() != aTmpSel.GetEnd().GetPara() ) || ( ( aTmpSel.GetEnd().GetIndex() - aTmpSel.GetStart().GetIndex() ) > 1 ) ) { - return FALSE; + return sal_False; } TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() ); if ( aMatchSel.HasRange() ) SetSelection( aMatchSel ); - return aMatchSel.HasRange() ? TRUE : FALSE; + return aMatchSel.HasRange() ? sal_True : sal_False; } -BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForward ) +sal_Bool ExtTextView::Search( const util::SearchOptions& rSearchOptions, sal_Bool bForward ) { - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; TextSelection aSel( GetSelection() ); if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchOptions, bForward ) ) { - bFound = TRUE; + bFound = sal_True; // Erstmal den Anfang des Wortes als Selektion einstellen, // damit das ganze Wort in den sichtbaren Bereich kommt. SetSelection( aSel.GetStart() ); - ShowCursor( TRUE, FALSE ); + ShowCursor( sal_True, sal_False ); } else { @@ -289,9 +289,9 @@ BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForwa return bFound; } -USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward ) +sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward ) { - USHORT nFound = 0; + sal_uInt16 nFound = 0; if ( !bAll ) { @@ -316,7 +316,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl // HideSelection(); TextSelection aSel; - BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); + sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); if ( bSearchInSelection ) { aSel = GetSelection(); @@ -325,7 +325,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl TextSelection aSearchSel( aSel ); - BOOL bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE ); + sal_Bool bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True ); if ( bFound ) pTextEngine->UndoActionStart( XTEXTUNDO_REPLACEALL ); while ( bFound ) @@ -335,7 +335,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchOptions.replaceString ); aSel = aSearchSel; aSel.GetStart() = aNewStart; - bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE ); + bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True ); } if ( nFound ) { @@ -347,9 +347,9 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl return nFound; } -BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) +sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; TextSelection aSel = GetSelection(); aSel.Justify(); @@ -357,20 +357,20 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) HideSelection(); GetTextEngine()->UndoActionStart( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK ); - ULONG nStartPara = aSel.GetStart().GetPara(); - ULONG nEndPara = aSel.GetEnd().GetPara(); + sal_uIntPtr nStartPara = aSel.GetStart().GetPara(); + sal_uIntPtr nEndPara = aSel.GetEnd().GetPara(); if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() ) { nEndPara--; // den dann nicht einruecken... } - for ( ULONG nPara = nStartPara; nPara <= nEndPara; nPara++ ) + for ( sal_uIntPtr nPara = nStartPara; nPara <= nEndPara; nPara++ ) { if ( bRight ) { // Tabs hinzufuegen GetTextEngine()->ImpInsertText( TextPaM( nPara, 0 ), '\t' ); - bDone = TRUE; + bDone = sal_True; } else { @@ -381,14 +381,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) ( aText.GetChar( 0 ) == ' ' ) ) ) { GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) ); - bDone = TRUE; + bDone = sal_True; } } } GetTextEngine()->UndoActionEnd( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK ); - BOOL bRange = aSel.HasRange(); + sal_Bool bRange = aSel.HasRange(); if ( bRight ) { aSel.GetStart().GetIndex()++; @@ -409,13 +409,13 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight ) return bDone; } -BOOL ExtTextView::IndentBlock() +sal_Bool ExtTextView::IndentBlock() { - return ImpIndentBlock( TRUE ); + return ImpIndentBlock( sal_True ); } -BOOL ExtTextView::UnindentBlock() +sal_Bool ExtTextView::UnindentBlock() { - return ImpIndentBlock( FALSE ); + return ImpIndentBlock( sal_False ); } diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx index b4b7c0fc949d..cf6d735c7258 100644 --- a/svtools/source/filter.vcl/filter/dlgexpor.cxx +++ b/svtools/source/filter.vcl/filter/dlgexpor.cxx @@ -139,19 +139,19 @@ DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) : { case 2 : { - aRbSize.Check( TRUE ); + aRbSize.Check( sal_True ); ClickRbSize( NULL ); } break; case 1 : { - aRbRes.Check( TRUE ); + aRbRes.Check( sal_True ); ClickRbRes( NULL ); } break; default : { - aRbOriginal.Check( TRUE ); + aRbOriginal.Check( sal_True ); ClickRbOriginal( NULL ); } break; @@ -264,7 +264,7 @@ IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG ) IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG ) { - const USHORT nLbPos = aLbColors.GetSelectEntryPos(); + const sal_uInt16 nLbPos = aLbColors.GetSelectEntryPos(); if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) ) aCbxRLE.Enable(); @@ -358,14 +358,14 @@ DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) : { case 1 : { - aRbSize.Check( TRUE ); + aRbSize.Check( sal_True ); ClickRbSize( NULL ); } break; default : { - aRbOriginal.Check( TRUE ); + aRbOriginal.Check( sal_True ); ClickRbOriginal( NULL ); } break; diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index c8a79d3a35cd..51658847c55f 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -137,9 +137,9 @@ public: ~ImpFilterOutputStream() {} }; -BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj ) +sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj ) { - BOOL bExists = FALSE; + sal_Bool bExists = sal_False; try { @@ -192,11 +192,11 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl ) //-------------------------------------------------------------------------- -BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize ) +sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uIntPtr nComp, sal_uIntPtr nSize ) { while ( nComp-- >= nSize ) { - ULONG i; + sal_uIntPtr i; for ( i = 0; i < nSize; i++ ) { if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) ) @@ -229,9 +229,9 @@ inline String ImpGetExtension( const String &rPath ) |* Eingabe-prarameter: |* rPath - Dateipfad |* rFormatExtension - Inhalt egal -|* bTest - setze FALSE +|* bTest - setze sal_False |* Ausgabe-parameter: -|* Funkionswert - TRUE wenn Erfolg +|* Funkionswert - sal_True wenn Erfolg |* rFormatExtension - Bei Erfolg: uebliche Dateiendung |* des Formats (Grossbuchstaben) |* 2.) Datei anlesen, Dateiformat ueberpruefen @@ -239,11 +239,11 @@ inline String ImpGetExtension( const String &rPath ) |* rPath - Dateipfad |* rFormatExtension - uebliche Dateiendung des Formats |* (Grossbuchstaben) -|* bTest - setze TRUE +|* bTest - setze sal_True |* Ausgabe-parameter: -|* Funkionswert - FALSE, wenn die Datei bestimmt nicht +|* Funkionswert - sal_False, wenn die Datei bestimmt nicht |* vom uebgebenen Format ist. -|* TRUE, wenn die Datei WAHRSCHEINLICH von +|* sal_True, wenn die Datei WAHRSCHEINLICH von |* dem Format ist, ODER WENN DAS FORMAT |* DIESER FUNKTION NICHT BEKANNT IST! |* @@ -252,22 +252,22 @@ inline String ImpGetExtension( const String &rPath ) |* *************************************************************************/ -static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest ) +static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, sal_Bool bTest ) { - USHORT i; - BYTE sFirstBytes[ 256 ]; - ULONG nFirstLong,nSecondLong; - ULONG nStreamPos = rStream.Tell(); + sal_uInt16 i; + sal_uInt8 sFirstBytes[ 256 ]; + sal_uIntPtr nFirstLong,nSecondLong; + sal_uIntPtr nStreamPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); - ULONG nStreamLen = rStream.Tell() - nStreamPos; + sal_uIntPtr nStreamLen = rStream.Tell() - nStreamPos; rStream.Seek( nStreamPos ); if ( !nStreamLen ) { SvLockBytes* pLockBytes = rStream.GetLockBytes(); if ( pLockBytes ) - pLockBytes->SetSynchronMode( TRUE ); + pLockBytes->SetSynchronMode( sal_True ); rStream.Seek( STREAM_SEEK_TO_END ); nStreamLen = rStream.Tell() - nStreamPos; @@ -280,25 +280,25 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B { rStream.Read( sFirstBytes, nStreamLen ); - for( i = (USHORT) nStreamLen; i < 256; i++ ) + for( i = (sal_uInt16) nStreamLen; i < 256; i++ ) sFirstBytes[ i ]=0; } if( rStream.GetError() ) - return FALSE; + return sal_False; // Die ersten 8 Bytes in nFirstLong, nSecondLong unterbringen, // Big-Endian: for( i = 0, nFirstLong = 0L, nSecondLong = 0L; i < 4; i++ ) { - nFirstLong=(nFirstLong<<8)|(ULONG)sFirstBytes[i]; - nSecondLong=(nSecondLong<<8)|(ULONG)sFirstBytes[i+4]; + nFirstLong=(nFirstLong<<8)|(sal_uIntPtr)sFirstBytes[i]; + nSecondLong=(nSecondLong<<8)|(sal_uIntPtr)sFirstBytes[i+4]; } - // Folgende Variable ist nur bei bTest==TRUE interessant. Sie - // bleibt FALSE, wenn das Format (rFormatExtension) hier noch nicht + // Folgende Variable ist nur bei bTest==sal_True interessant. Sie + // bleibt sal_False, wenn das Format (rFormatExtension) hier noch nicht // einprogrammiert wurde. - BOOL bSomethingTested = FALSE; + sal_Bool bSomethingTested = sal_False; // Nun werden die verschieden Formate ueberprueft. Dabei ist die // Reihenfolge nicht egal. Z.b. koennte eine MET-Datei auch durch @@ -307,7 +307,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B // Theoretisch waere aber vielleicht auch eine BMP-Datei denkbar, // die durch den MET-Test geht. // Diese Probleme gibt es natuerlich nicht nur bei MET und BMP. - // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==TRUE) + // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==sal_True) // nur genau dieses eine Format getestet. Alles andere koennte fatale // Folgen haben, z.B. wenn der Benutzer sagt, es sei BMP-Datei (und es // ist BMP-Datei), und hier wuerde die Datei durch den MET-Test gehen... @@ -315,26 +315,26 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- MET ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "MET", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( sFirstBytes[2] == 0xd3 ) { rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStream.Seek( nStreamPos ); - USHORT nFieldSize; - BYTE nMagic; - BOOL bOK=TRUE; + sal_uInt16 nFieldSize; + sal_uInt8 nMagic; + sal_Bool bOK=sal_True; rStream >> nFieldSize >> nMagic; for (i=0; i<3; i++) { - if (nFieldSize<6) { bOK=FALSE; break; } - if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=FALSE; break; } + if (nFieldSize<6) { bOK=sal_False; break; } + if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=sal_False; break; } rStream.SeekRel(nFieldSize-3); rStream >> nFieldSize >> nMagic; - if (nMagic!=0xd3) { bOK=FALSE; break; } + if (nMagic!=0xd3) { bOK=sal_False; break; } } rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); if (bOK && !rStream.GetError()) { rFormatExtension= UniString::CreateFromAscii( "MET", 3 ); - return TRUE; + return sal_True; } } } @@ -342,9 +342,9 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- BMP ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "BMP", 3 ) == COMPARE_EQUAL ) ) { - BYTE nOffs; + sal_uInt8 nOffs; - bSomethingTested=TRUE; + bSomethingTested=sal_True; // OS/2-Bitmaparray ('BA') koennen wir evtl. auch lesen, // dementspr. muessen wir den Offset anpassen, @@ -368,7 +368,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B sFirstBytes[14+nOffs] == 0x0c ) { rFormatExtension = UniString::CreateFromAscii( "BMP", 3 ); - return TRUE; + return sal_True; } } } @@ -379,33 +379,33 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B ( rFormatExtension.CompareToAscii( "WMF", 3 ) == COMPARE_EQUAL ) || ( rFormatExtension.CompareToAscii( "EMF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if ( nFirstLong==0xd7cdc69a || nFirstLong==0x01000900 ) { rFormatExtension = UniString::CreateFromAscii( "WMF", 3 ); - return TRUE; + return sal_True; } else if( nFirstLong == 0x01000000 && sFirstBytes[ 40 ] == 0x20 && sFirstBytes[ 41 ] == 0x45 && sFirstBytes[ 42 ] == 0x4d && sFirstBytes[ 43 ] == 0x46 ) { rFormatExtension = UniString::CreateFromAscii( "EMF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PCX ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PCX", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if (sFirstBytes[0]==0x0a) { - BYTE nVersion=sFirstBytes[1]; - BYTE nEncoding=sFirstBytes[2]; + sal_uInt8 nVersion=sFirstBytes[1]; + sal_uInt8 nEncoding=sFirstBytes[2]; if( ( nVersion==0 || nVersion==2 || nVersion==3 || nVersion==5 ) && nEncoding<=1 ) { rFormatExtension = UniString::CreateFromAscii( "PCX", 3 ); - return TRUE; + return sal_True; } } } @@ -413,69 +413,69 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- TIF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "TIF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( nFirstLong==0x49492a00 || nFirstLong==0x4d4d002a ) { rFormatExtension=UniString::CreateFromAscii( "TIF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- GIF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "GIF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( nFirstLong==0x47494638 && (sFirstBytes[4]==0x37 || sFirstBytes[4]==0x39) && sFirstBytes[5]==0x61 ) { rFormatExtension = UniString::CreateFromAscii( "GIF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PNG ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PNG", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if (nFirstLong==0x89504e47 && nSecondLong==0x0d0a1a0a) { rFormatExtension = UniString::CreateFromAscii( "PNG", 3 ); - return TRUE; + return sal_True; } } //--------------------------- JPG ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "JPG", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( ( nFirstLong==0xffd8ffe0 && sFirstBytes[6]==0x4a && sFirstBytes[7]==0x46 && sFirstBytes[8]==0x49 && sFirstBytes[9]==0x46 ) || ( nFirstLong==0xffd8fffe ) || ( 0xffd8ff00 == ( nFirstLong & 0xffffff00 ) ) ) { rFormatExtension = UniString::CreateFromAscii( "JPG", 3 ); - return TRUE; + return sal_True; } } //--------------------------- SVM ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SVM", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( nFirstLong==0x53564744 && sFirstBytes[4]==0x49 ) { rFormatExtension = UniString::CreateFromAscii( "SVM", 3 ); - return TRUE; + return sal_True; } else if( sFirstBytes[0]==0x56 && sFirstBytes[1]==0x43 && sFirstBytes[2]==0x4C && sFirstBytes[3]==0x4D && sFirstBytes[4]==0x54 && sFirstBytes[5]==0x46 ) { rFormatExtension = UniString::CreateFromAscii( "SVM", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PCD ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PCD", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if( nStreamLen >= 2055 ) { char sBuf[8]; @@ -485,7 +485,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if( strncmp( sBuf, "PCD_IPI", 7 ) == 0 ) { rFormatExtension = UniString::CreateFromAscii( "PCD", 3 ); - return TRUE; + return sal_True; } } } @@ -493,30 +493,30 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- PSD ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PSD", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if ( ( nFirstLong == 0x38425053 ) && ( (nSecondLong >> 16 ) == 1 ) ) { rFormatExtension = UniString::CreateFromAscii( "PSD", 3 ); - return TRUE; + return sal_True; } } //--------------------------- EPS ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "EPS", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; - if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (BYTE*)"%!PS-Adobe", 10, 10 ) && - ImplSearchEntry( &sFirstBytes[15], (BYTE*)"EPS", 3, 3 ) ) ) + bSomethingTested = sal_True; + if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"%!PS-Adobe", 10, 10 ) && + ImplSearchEntry( &sFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { rFormatExtension = UniString::CreateFromAscii( "EPS", 3 ); - return TRUE; + return sal_True; } } //--------------------------- DXF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "DXF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; i=0; while (i<256 && sFirstBytes[i]<=32) @@ -537,22 +537,22 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if (strncmp((char*)(sFirstBytes+i),"SECTION",7)==0) { rFormatExtension = UniString::CreateFromAscii( "DXF", 3 ); - return TRUE; + return sal_True; } } if( strncmp( (char*) sFirstBytes, "AutoCAD Binary DXF", 18 ) == 0 ) { rFormatExtension = UniString::CreateFromAscii( "DXF", 3 ); - return TRUE; + return sal_True; } } //--------------------------- PCT ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; - BYTE sBuf[4]; + bSomethingTested = sal_True; + sal_uInt8 sBuf[4]; sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes for ( nOffset = 10; ( nOffset <= 522 ) && ( ( nStreamPos + nOffset + 3 ) <= nStreamLen ); nOffset += 512 ) { @@ -561,7 +561,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) ) { rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); - return TRUE; + return sal_True; } } } @@ -572,7 +572,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B ( rFormatExtension.CompareToAscii( "PGM", 3 ) == COMPARE_EQUAL ) || ( rFormatExtension.CompareToAscii( "PPM", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if ( sFirstBytes[ 0 ] == 'P' ) { switch( sFirstBytes[ 1 ] ) @@ -580,17 +580,17 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B case '1' : case '4' : rFormatExtension = UniString::CreateFromAscii( "PBM", 3 ); - return TRUE; + return sal_True; case '2' : case '5' : rFormatExtension = UniString::CreateFromAscii( "PGM", 3 ); - return TRUE; + return sal_True; case '3' : case '6' : rFormatExtension = UniString::CreateFromAscii( "PPM", 3 ); - return TRUE; + return sal_True; } } } @@ -598,81 +598,81 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B //--------------------------- RAS( SUN RasterFile )------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "RAS", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( nFirstLong == 0x59a66a95 ) { rFormatExtension = UniString::CreateFromAscii( "RAS", 3 ); - return TRUE; + return sal_True; } } //--------------------------- XPM ------------------------------------ if( !bTest ) { - bSomethingTested = TRUE; - if( ImplSearchEntry( sFirstBytes, (BYTE*)"/* XPM */", 256, 9 ) ) + bSomethingTested = sal_True; + if( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"/* XPM */", 256, 9 ) ) { rFormatExtension = UniString::CreateFromAscii( "XPM", 3 ); - return TRUE; + return sal_True; } } else if( rFormatExtension.CompareToAscii( "XPM", 3 ) == COMPARE_EQUAL ) { - bSomethingTested = TRUE; - return TRUE; + bSomethingTested = sal_True; + return sal_True; } //--------------------------- XBM ------------------------------------ if( !bTest ) { - ULONG nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; - BYTE* pBuf = new BYTE [ nSize ]; + sal_uIntPtr nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen; + sal_uInt8* pBuf = new sal_uInt8 [ nSize ]; rStream.Seek( nStreamPos ); rStream.Read( pBuf, nSize ); - BYTE* pPtr = ImplSearchEntry( pBuf, (BYTE*)"#define", nSize, 7 ); + sal_uInt8* pPtr = ImplSearchEntry( pBuf, (sal_uInt8*)"#define", nSize, 7 ); if( pPtr ) { - if( ImplSearchEntry( pPtr, (BYTE*)"_width", pBuf + nSize - pPtr, 6 ) ) + if( ImplSearchEntry( pPtr, (sal_uInt8*)"_width", pBuf + nSize - pPtr, 6 ) ) { rFormatExtension = UniString::CreateFromAscii( "XBM", 3 ); delete[] pBuf; - return TRUE; + return sal_True; } } delete[] pBuf; } else if( rFormatExtension.CompareToAscii( "XBM", 3 ) == COMPARE_EQUAL ) { - bSomethingTested = TRUE; - return TRUE; + bSomethingTested = sal_True; + return sal_True; } //--------------------------- TGA ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) - return TRUE; + return sal_True; } //--------------------------- SGV ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested = TRUE; + bSomethingTested = sal_True; if( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) - return TRUE; + return sal_True; } //--------------------------- SGF ------------------------------------ if( !bTest || ( rFormatExtension.CompareToAscii( "SGF", 3 ) == COMPARE_EQUAL ) ) { - bSomethingTested=TRUE; + bSomethingTested=sal_True; if( sFirstBytes[ 0 ] == 'J' && sFirstBytes[ 1 ] == 'J' ) { rFormatExtension = UniString::CreateFromAscii( "SGF", 3 ); - return TRUE; + return sal_True; } } @@ -690,7 +690,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS if( rFormat == GRFILTER_FORMAT_DONTKNOW ) { String aFormatExt; - if( ImpPeekGraphicFormat( rStream, aFormatExt, FALSE ) ) + if( ImpPeekGraphicFormat( rStream, aFormatExt, sal_False ) ) { for( sal_uInt16 i = 0; i < n; i++ ) { @@ -719,7 +719,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS else { String aTmpStr( pConfig->GetImportFormatExtension( rFormat ) ); - if( !ImpPeekGraphicFormat( rStream, aTmpStr, TRUE ) ) + if( !ImpPeekGraphicFormat( rStream, aTmpStr, sal_True ) ) return GRFILTER_FORMATERROR; if ( pConfig->GetImportFormatExtension( rFormat ).EqualsIgnoreCaseAscii( "pcd" ) ) { @@ -1051,7 +1051,7 @@ void GraphicFilter::ImplInit() // ------------------------------------------------------------------------ -ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm ) +sal_uIntPtr GraphicFilter::ImplSetError( sal_uIntPtr nError, const SvStream* pStm ) { pErrorEx->nFilterError = nError; pErrorEx->nStreamError = pStm ? pStm->GetError() : ERRCODE_NONE; @@ -1059,28 +1059,28 @@ ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm ) } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatCount() +sal_uInt16 GraphicFilter::GetImportFormatCount() { return pConfig->GetImportFormatCount(); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumber( const String& rFormatName ) +sal_uInt16 GraphicFilter::GetImportFormatNumber( const String& rFormatName ) { return pConfig->GetImportFormatNumber( rFormatName ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType ) +sal_uInt16 GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType ) { return pConfig->GetImportFormatNumberForMediaType( rMediaType ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName ) +sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName ) { return pConfig->GetImportFormatNumberForShortName( rShortName ); } @@ -1094,35 +1094,35 @@ sal_uInt16 GraphicFilter::GetImportFormatNumberForTypeName( const String& rType // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatName( USHORT nFormat ) +String GraphicFilter::GetImportFormatName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatTypeName( USHORT nFormat ) +String GraphicFilter::GetImportFormatTypeName( sal_uInt16 nFormat ) { return pConfig->GetImportFilterTypeName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatMediaType( USHORT nFormat ) +String GraphicFilter::GetImportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetImportFormatMediaType( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportFormatShortName( USHORT nFormat ) +String GraphicFilter::GetImportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatShortName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetImportOSFileType( USHORT ) +String GraphicFilter::GetImportOSFileType( sal_uInt16 ) { String aOSFileType; return aOSFileType; @@ -1130,42 +1130,42 @@ String GraphicFilter::GetImportOSFileType( USHORT ) // ------------------------------------------------------------------------ -String GraphicFilter::GetImportWildcard( USHORT nFormat, sal_Int32 nEntry ) +String GraphicFilter::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetImportWildcard( nFormat, nEntry ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::IsImportPixelFormat( USHORT nFormat ) +sal_Bool GraphicFilter::IsImportPixelFormat( sal_uInt16 nFormat ) { return pConfig->IsImportPixelFormat( nFormat ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatCount() +sal_uInt16 GraphicFilter::GetExportFormatCount() { return pConfig->GetExportFormatCount(); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumber( const String& rFormatName ) +sal_uInt16 GraphicFilter::GetExportFormatNumber( const String& rFormatName ) { return pConfig->GetExportFormatNumber( rFormatName ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType ) +sal_uInt16 GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType ) { return pConfig->GetExportFormatNumberForMediaType( rMediaType ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName ) +sal_uInt16 GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName ) { return pConfig->GetExportFormatNumberForShortName( rShortName ); } @@ -1179,35 +1179,35 @@ sal_uInt16 GraphicFilter::GetExportFormatNumberForTypeName( const String& rType // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatName( USHORT nFormat ) +String GraphicFilter::GetExportFormatName( sal_uInt16 nFormat ) { return pConfig->GetExportFormatName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatTypeName( USHORT nFormat ) +String GraphicFilter::GetExportFormatTypeName( sal_uInt16 nFormat ) { return pConfig->GetExportFilterTypeName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatMediaType( USHORT nFormat ) +String GraphicFilter::GetExportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetExportFormatMediaType( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportFormatShortName( USHORT nFormat ) +String GraphicFilter::GetExportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetExportFormatShortName( nFormat ); } // ------------------------------------------------------------------------ -String GraphicFilter::GetExportOSFileType( USHORT ) +String GraphicFilter::GetExportOSFileType( sal_uInt16 ) { String aOSFileType; return aOSFileType; @@ -1215,22 +1215,22 @@ String GraphicFilter::GetExportOSFileType( USHORT ) // ------------------------------------------------------------------------ -String GraphicFilter::GetExportWildcard( USHORT nFormat, sal_Int32 nEntry ) +String GraphicFilter::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetExportWildcard( nFormat, nEntry ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::IsExportPixelFormat( USHORT nFormat ) +sal_Bool GraphicFilter::IsExportPixelFormat( sal_uInt16 nFormat ) { return pConfig->IsExportPixelFormat( nFormat ); } // ------------------------------------------------------------------------ -USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath, - USHORT nFormat, USHORT* pDeterminedFormat ) +sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); @@ -1247,10 +1247,10 @@ USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath, // ------------------------------------------------------------------------ -USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat ) +sal_uInt16 GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { - ULONG nStreamPos = rIStream.Tell(); + sal_uIntPtr nStreamPos = rIStream.Tell(); sal_uInt16 nRes = ImpTestOrFindFormat( rMainUrl, rIStream, nFormat ); rIStream.Seek(nStreamPos); @@ -1258,13 +1258,13 @@ USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStre if( nRes==GRFILTER_OK && pDeterminedFormat!=NULL ) *pDeterminedFormat = nFormat; - return (USHORT) ImplSetError( nRes, &rIStream ); + return (sal_uInt16) ImplSetError( nRes, &rIStream ); } // ------------------------------------------------------------------------ //SJ: TODO, we need to create a GraphicImporter component -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, - USHORT nFormat, USHORT * pDeterminedFormat, sal_uInt32 nImportFlags ) +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, + sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); @@ -1279,25 +1279,25 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPa return nRetValue; } -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags ) +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags ) { return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL ); } //------------------------------------------------------------------------- -USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, - USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags, +sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData ) { String aFilterName; - ULONG nStmBegin; - USHORT nStatus; + sal_uIntPtr nStmBegin; + sal_uInt16 nStatus; GraphicReader* pContext = rGraphic.GetContext(); GfxLinkType eLinkType = GFX_LINK_TYPE_NONE; - BOOL bDummyContext = ( pContext == (GraphicReader*) 1 ); - const BOOL bLinkSet = rGraphic.IsLink(); + sal_Bool bDummyContext = ( pContext == (GraphicReader*) 1 ); + const sal_Bool bLinkSet = rGraphic.IsLink(); FilterConfigItem* pFilterConfigItem = NULL; Size aPreviewSizeHint( 0, 0 ); @@ -1348,7 +1348,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS else nStmBegin = rIStream.Tell(); - bAbort = FALSE; + bAbort = sal_False; nStatus = ImpTestOrFindFormat( rPath, rIStream, nFormat ); // Falls Pending, geben wir GRFILTER_OK zurueck, // um mehr Bytes anzufordern @@ -1357,13 +1357,13 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS rGraphic.SetContext( (GraphicReader*) 1 ); rIStream.ResetError(); rIStream.Seek( nStmBegin ); - return (USHORT) ImplSetError( GRFILTER_OK ); + return (sal_uInt16) ImplSetError( GRFILTER_OK ); } rIStream.Seek( nStmBegin ); if( ( nStatus != GRFILTER_OK ) || rIStream.GetError() ) - return (USHORT) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream ); + return (sal_uInt16) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream ); if( pDeterminedFormat ) *pDeterminedFormat = nFormat; @@ -1497,7 +1497,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS else if( aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGF ) || aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGV ) ) { - USHORT nVersion; + sal_uInt16 nVersion; unsigned char nTyp = CheckSgfTyp( rIStream, nVersion ); switch( nTyp ) @@ -1609,15 +1609,15 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS if( nStatus == GRFILTER_OK && bCreateNativeLink && ( eLinkType != GFX_LINK_TYPE_NONE ) && !rGraphic.GetContext() && !bLinkSet ) { - const ULONG nStmEnd = rIStream.Tell(); - const ULONG nBufSize = nStmEnd - nStmBegin; + const sal_uIntPtr nStmEnd = rIStream.Tell(); + const sal_uIntPtr nBufSize = nStmEnd - nStmBegin; if( nBufSize ) { - BYTE* pBuf=0; + sal_uInt8* pBuf=0; try { - pBuf = new BYTE[ nBufSize ]; + pBuf = new sal_uInt8[ nBufSize ]; } catch (std::bad_alloc) { @@ -1628,7 +1628,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS { rIStream.Seek( nStmBegin ); rIStream.Read( pBuf, nBufSize ); - rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, TRUE ) ); + rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, sal_True ) ); } } } @@ -1651,12 +1651,12 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS // ------------------------------------------------------------------------ -USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, +sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INET_PROT_NOT_VALID" ); - BOOL bAlreadyExists = ImplDirEntryHelper::Exists( rPath ); + sal_Bool bAlreadyExists = ImplDirEntryHelper::Exists( rPath ); String aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_WRITE | STREAM_TRUNC ); @@ -1673,10 +1673,10 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObjec // ------------------------------------------------------------------------ -USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, +sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, SvStream& rOStm, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { - USHORT nFormatCount = GetExportFormatCount(); + sal_uInt16 nFormatCount = GetExportFormatCount(); ResetLastError(); nExpGraphHint = 0; @@ -1687,7 +1687,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat String aExt( aURL.GetFileExtension().toAsciiUpperCase() ); - for( USHORT i = 0; i < nFormatCount; i++ ) + for( sal_uInt16 i = 0; i < nFormatCount; i++ ) { if ( pConfig->GetExportFormatExtension( i ).EqualsIgnoreCaseAscii( aExt ) ) { @@ -1697,13 +1697,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat } } if( nFormat >= nFormatCount ) - return (USHORT) ImplSetError( GRFILTER_FORMATERROR ); + return (sal_uInt16) ImplSetError( GRFILTER_FORMATERROR ); FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData ); String aFilterName( pConfig->GetExportFilterName( nFormat ) ); - bAbort = FALSE; - USHORT nStatus = GRFILTER_OK; + bAbort = sal_False; + sal_uInt16 nStatus = GRFILTER_OK; GraphicType eType; Graphic aGraphic( rGraphic ); @@ -1715,12 +1715,12 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat if( eType != GRAPHIC_BITMAP ) { Size aSizePixel; - ULONG nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; + sal_uIntPtr nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; VirtualDevice aVirDev; // Maximalen Speicherbedarf fuer das Bildes holen: // if( GetOptionsConfig() ) -// nMaxMem = (UINT32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32(); +// nMaxMem = (sal_uInt32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32(); // else nMaxMem = 1024; @@ -1737,14 +1737,14 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat else if (nColorCount<=256) nBitsPerPixel=8; else if (nColorCount<=65536) nBitsPerPixel=16; else nBitsPerPixel=24; - nNeededMem=((ULONG)aSizePixel.Width()*(ULONG)aSizePixel.Height()*nBitsPerPixel+7)/8; + nNeededMem=((sal_uIntPtr)aSizePixel.Width()*(sal_uIntPtr)aSizePixel.Height()*nBitsPerPixel+7)/8; // ggf. Groesse des Bildes einschraenken: if (nMaxMem<nNeededMem) { double fFak=sqrt(((double)nMaxMem)/((double)nNeededMem)); - aSizePixel.Width()=(ULONG)(((double)aSizePixel.Width())*fFak); - aSizePixel.Height()=(ULONG)(((double)aSizePixel.Height())*fFak); + aSizePixel.Width()=(sal_uIntPtr)(((double)aSizePixel.Width())*fFak); + aSizePixel.Height()=(sal_uIntPtr)(((double)aSizePixel.Height())*fFak); } aVirDev.SetMapMode(MapMode(MAP_PIXEL)); @@ -1765,7 +1765,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat { Bitmap aBmp( aGraphic.GetBitmap() ); sal_Int32 nColorRes = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Colors" ) ), 0 ); - if ( nColorRes && ( nColorRes <= (USHORT)BMP_CONVERSION_24BIT) ) + if ( nColorRes && ( nColorRes <= (sal_uInt16)BMP_CONVERSION_24BIT) ) { if( !aBmp.Convert( (BmpConversion) nColorRes ) ) aBmp = aGraphic.GetBitmap(); @@ -1991,16 +1991,16 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat // ------------------------------------------------------------------------ -BOOL GraphicFilter::Setup( USHORT ) +sal_Bool GraphicFilter::Setup( sal_uInt16 ) { - return FALSE; + return sal_False; } /* ------------------------------------------------------------------------ No Import filter has a dialog, so the following two methods are obsolete */ -BOOL GraphicFilter::HasImportDialog( USHORT ) +sal_Bool GraphicFilter::HasImportDialog( sal_uInt16 ) { return sal_True; // return pConfig->IsImportDialog( nFormat ); @@ -2008,26 +2008,26 @@ BOOL GraphicFilter::HasImportDialog( USHORT ) // ------------------------------------------------------------------------ -BOOL GraphicFilter::DoImportDialog( Window*, USHORT ) +sal_Bool GraphicFilter::DoImportDialog( Window*, sal_uInt16 ) { return sal_True; } // ------------------------------------------------------------------------ -BOOL GraphicFilter::HasExportDialog( USHORT nFormat ) +sal_Bool GraphicFilter::HasExportDialog( sal_uInt16 nFormat ) { return pConfig->IsExportDialog( nFormat ); } // ------------------------------------------------------------------------ -BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat ) +sal_Bool GraphicFilter::DoExportDialog( Window* pWindow, sal_uInt16 nFormat ) { return DoExportDialog( pWindow, nFormat, FUNIT_MM ); } -BOOL GraphicFilter::DoExportDialog( Window*, USHORT nFormat, FieldUnit ) +sal_Bool GraphicFilter::DoExportDialog( Window*, sal_uInt16 nFormat, FieldUnit ) { sal_Bool bRet = sal_False; com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > @@ -2085,7 +2085,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData ) if( pData ) { - USHORT nFormat = GRFILTER_FORMAT_DONTKNOW; + sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW; ByteString aShortName; switch( pData->mnFormat ) { @@ -2133,12 +2133,12 @@ GraphicFilter* GraphicFilter::GetGraphicFilter() int GraphicFilter::LoadGraphic( const String &rPath, const String &rFilterName, Graphic& rGraphic, GraphicFilter* pFilter, - USHORT* pDeterminedFormat ) + sal_uInt16* pDeterminedFormat ) { if ( !pFilter ) pFilter = GetGraphicFilter(); - const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() + const sal_uInt16 nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() ? pFilter->GetImportFormatNumber( rFilterName ) : GRFILTER_FORMAT_DONTKNOW; diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx index de2bef64ba6e..03806b9b3c03 100644 --- a/svtools/source/filter.vcl/filter/filter2.cxx +++ b/svtools/source/filter.vcl/filter/filter2.cxx @@ -40,7 +40,7 @@ #define DATA_SIZE 640 -BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG ); +sal_uInt8* ImplSearchEntry( sal_uInt8* , sal_uInt8* , sal_uIntPtr , sal_uIntPtr ); /************************************************************************* @@ -59,9 +59,9 @@ GraphicDescriptor::GraphicDescriptor( const String* pPath ) : INetURLObject aURL( *pPath, INET_PROT_FILE ); aPathExt = aURL.GetFileExtension().toAsciiLowerCase(); } - bLinked = TRUE; - bLinkChanged = FALSE; - bWideSearch = FALSE; + bLinked = sal_True; + bLinkChanged = sal_False; + bWideSearch = sal_False; } @@ -79,13 +79,13 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : { nStmPos = 0; pFileStm->Seek( nStmPos ); - bDataReady = TRUE; + bDataReady = sal_True; } ImpConstruct(); if ( pFileStm && !pFileStm->GetError() ) - bDataReady = TRUE; + bDataReady = sal_True; } /************************************************************************* @@ -106,10 +106,10 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) } nStmPos = rInStream.Tell(); pBaseStm = &rInStream; - bBaseStm = TRUE; + bBaseStm = sal_True; if ( !pBaseStm->GetError() ) - bDataReady = TRUE; + bDataReady = sal_True; } @@ -131,9 +131,9 @@ GraphicDescriptor::~GraphicDescriptor() |* \************************************************************************/ -BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // Link-Status ueberpruefen if ( bLinked && bLinkChanged ) @@ -143,45 +143,45 @@ BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) if ( pMemStm ) { nStmPos = pMemStm->Tell(); - bDataReady = TRUE; + bDataReady = sal_True; } } if ( bDataReady ) { SvStream& rStm = GetSearchStream(); - UINT16 nOldFormat = rStm.GetNumberFormatInt(); - - if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE; - else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE; + sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); + + if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = sal_True; + else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = sal_True; // diese Formate lassen sich nur bei WideSearch im gesamten // Stream ermitteln else if ( bWideSearch ) { if ( ImpDetectPCD( rStm, bExtendedInfo ) ) - bRet = TRUE; + bRet = sal_True; } rStm.SetNumberFormatInt( nOldFormat ); @@ -198,7 +198,7 @@ BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::IsDataReady() const +sal_Bool GraphicDescriptor::IsDataReady() const { return bDataReady; } @@ -210,7 +210,7 @@ BOOL GraphicDescriptor::IsDataReady() const |* \************************************************************************/ -BOOL GraphicDescriptor::IsWideSearch() const +sal_Bool GraphicDescriptor::IsWideSearch() const { return bWideSearch; } @@ -244,7 +244,7 @@ SvStream& GraphicDescriptor::GetSearchStream() const void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink ) { aReqLink = rRequestLink; - bLinkChanged = TRUE; + bLinkChanged = sal_True; } @@ -254,7 +254,7 @@ void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink ) |* \************************************************************************/ -ULONG GraphicDescriptor::GetRequestedByteCount() const +sal_uIntPtr GraphicDescriptor::GetRequestedByteCount() const { return DATA_SIZE; } @@ -278,11 +278,11 @@ void GraphicDescriptor::ImpConstruct() nFormat = GFF_NOT; nBitsPerPixel = 0; nPlanes = 0; - bCompressed = FALSE; - bDataReady = FALSE; - bLinked = FALSE; - bWideSearch = TRUE; - bBaseStm = FALSE; + bCompressed = sal_False; + bDataReady = sal_False; + bLinked = sal_False; + bWideSearch = sal_True; + bBaseStm = sal_False; pMemStm = NULL; } @@ -293,10 +293,10 @@ void GraphicDescriptor::ImpConstruct() |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT16 nTemp16; - BOOL bRet = FALSE; + sal_uInt16 nTemp16; + sal_Bool bRet = sal_False; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStm.Seek( nStmPos ); @@ -314,12 +314,12 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp16 == 0x4d42 ) { nFormat = GFF_BMP; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT32 nTemp32; - UINT32 nCompression; + sal_uInt32 nTemp32; + sal_uInt32 nCompression; // bis zur ersten Information rStm.SeekRel( 0x10 ); @@ -360,7 +360,7 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) ) { nFormat = GFF_NOT; - bRet = FALSE; + bRet = sal_False; } } } @@ -375,12 +375,12 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 n32; - UINT16 n16; - BOOL bRet = FALSE; - BYTE cByte; + sal_uInt32 n32; + sal_uInt16 n16; + sal_Bool bRet = sal_False; + sal_uInt8 cByte; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStm.Seek( nStmPos ); @@ -392,11 +392,11 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) if ( ( n16 == 0x6137 ) || ( n16 == 0x6139 ) ) { nFormat = GFF_GIF; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; // PixelBreite auslesen rStm >> nTemp16; @@ -423,12 +423,12 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 nTemp32; - BOOL bRet = FALSE; - BYTE cByte = 0; - BOOL bM_COM; + sal_uInt32 nTemp32; + sal_Bool bRet = sal_False; + sal_uInt8 cByte = 0; + sal_Bool bM_COM; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm.Seek( nStmPos ); @@ -439,7 +439,7 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) ) { nFormat = GFF_JPG; - return TRUE; + return sal_True; } bM_COM = ( nTemp32 == 0xffd8fffe ); @@ -454,17 +454,17 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) if( bM_COM || ( nTemp32 == 0x4a464946 ) ) { nFormat = GFF_JPG; - bRet = TRUE; + bRet = sal_True; if( bExtendedInfo ) { MapMode aMap; - UINT16 nTemp16; - ULONG nCount = 9; - ULONG nMax; - ULONG nResX; - ULONG nResY; - BYTE cUnit; + sal_uInt16 nTemp16; + sal_uIntPtr nCount = 9; + sal_uIntPtr nMax; + sal_uIntPtr nResX; + sal_uIntPtr nResY; + sal_uInt8 cUnit; // Groesse des verbleibenden Puffers ermitteln if ( bLinked ) @@ -474,7 +474,7 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) nMax = DATA_SIZE - 16; // max. 8K - nMax = Min( nMax, (ULONG) 8192 ); + nMax = Min( nMax, (sal_uIntPtr) 8192 ); // Res-Unit ermitteln rStm.SeekRel( 3 ); @@ -552,18 +552,18 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStm.Seek( nStmPos ); if ( bWideSearch ) { - UINT32 nTemp32; - UINT16 nTemp16; - BYTE cByte; + sal_uInt32 nTemp32; + sal_uInt16 nTemp16; + sal_uInt8 cByte; rStm.SeekRel( 2048 ); rStm >> nTemp32; @@ -575,7 +575,7 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) ( cByte == 0x49 ) ) { nFormat = GFF_PCD; - bRet = TRUE; + bRet = sal_True; } } else @@ -597,16 +597,16 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo ) { // ! Because 0x0a can be interpreted as LF too ... // we cant be shure that this special sign represent a PCX file only. // Every Ascii file is possible here :-( // We must detect the whole header. - bExtendedInfo = TRUE; + bExtendedInfo = sal_True; - BOOL bRet = FALSE; - BYTE cByte; + sal_Bool bRet = sal_False; + sal_uInt8 cByte; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStm.Seek( nStmPos ); @@ -615,17 +615,17 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte == 0x0a ) { nFormat = GFF_PCX; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nTemp16; - USHORT nXmin; - USHORT nXmax; - USHORT nYmin; - USHORT nYmax; - USHORT nDPIx; - USHORT nDPIy; + sal_uInt16 nTemp16; + sal_uInt16 nXmin; + sal_uInt16 nXmax; + sal_uInt16 nYmin; + sal_uInt16 nYmax; + sal_uInt16 nDPIx; + sal_uInt16 nDPIy; rStm.SeekRel( 1 ); @@ -685,10 +685,10 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 nTemp32; - BOOL bRet = FALSE; + sal_uInt32 nTemp32; + sal_Bool bRet = sal_False; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm.Seek( nStmPos ); @@ -700,11 +700,11 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp32 == 0x0d0a1a0a ) { nFormat = GFF_PNG; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - BYTE cByte; + sal_uInt8 cByte; // IHDR-Chunk rStm.SeekRel( 8 ); @@ -724,11 +724,11 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) // Planes immer 1; // Kompression immer nPlanes = 1; - bCompressed = TRUE; + bCompressed = sal_True; if ( bWideSearch ) { - UINT32 nLen32; + sal_uInt32 nLen32; rStm.SeekRel( 8 ); @@ -745,8 +745,8 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) if ( nTemp32 == 0x70485973 ) { - ULONG nXRes; - ULONG nYRes; + sal_uIntPtr nXRes; + sal_uIntPtr nYRes; // horizontale Aufloesung rStm >> nTemp32; @@ -785,12 +785,12 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bDetectOk = FALSE; - BOOL bRet = FALSE; - BYTE cByte1; - BYTE cByte2; + sal_Bool bDetectOk = sal_False; + sal_Bool bRet = sal_False; + sal_uInt8 cByte1; + sal_uInt8 cByte2; rStm.Seek( nStmPos ); rStm >> cByte1; @@ -800,30 +800,30 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte1 == 0x49 ) { rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - bDetectOk = TRUE; + bDetectOk = sal_True; } else if ( cByte1 == 0x4d ) { rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - bDetectOk = TRUE; + bDetectOk = sal_True; } if ( bDetectOk ) { - UINT16 nTemp16; + sal_uInt16 nTemp16; rStm >> nTemp16; if ( nTemp16 == 0x2a ) { nFormat = GFF_TIF; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - ULONG nCount; - ULONG nMax = DATA_SIZE - 48; - UINT32 nTemp32; - BOOL bOk = FALSE; + sal_uIntPtr nCount; + sal_uIntPtr nMax = DATA_SIZE - 48; + sal_uInt32 nTemp32; + sal_Bool bOk = sal_False; // Offset des ersten IFD einlesen rStm >> nTemp32; @@ -923,9 +923,9 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectXBM( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_XBM; @@ -939,9 +939,9 @@ BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectXPM( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_XPM; @@ -954,22 +954,22 @@ BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // erst auf Datei Extension pruefen, da diese aussagekraeftiger ist // als die 2 ID Bytes if ( aPathExt.CompareToAscii( "pbm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) ) - bRet = TRUE; + bRet = sal_True; } if ( bRet ) @@ -984,19 +984,19 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( aPathExt.CompareToAscii( "pgm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) ) - bRet = TRUE; + bRet = sal_True; } if ( bRet ) @@ -1011,19 +1011,19 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( aPathExt.CompareToAscii( "ppm", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) ) - bRet = TRUE; + bRet = sal_True; } if ( bRet ) @@ -1038,19 +1038,19 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool ) { - UINT32 nMagicNumber; + sal_uInt32 nMagicNumber; rStm.Seek( nStmPos ); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x59a66a95 ) { nFormat = GFF_RAS; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } /************************************************************************* @@ -1059,9 +1059,9 @@ BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectTGA( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_TGA; @@ -1074,28 +1074,28 @@ BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - UINT32 nMagicNumber; + sal_uInt32 nMagicNumber; rStm.Seek( nStmPos ); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x38425053 ) { - UINT16 nVersion; + sal_uInt16 nVersion; rStm >> nVersion; if ( nVersion == 1 ) { - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT16 nChannels; - UINT32 nRows; - UINT32 nColumns; - UINT16 nDepth; - UINT16 nMode; + sal_uInt16 nChannels; + sal_uInt32 nRows; + sal_uInt32 nColumns; + sal_uInt16 nDepth; + sal_uInt16 nMode; rStm.SeekRel( 6 ); // Pad rStm >> nChannels >> nRows >> nColumns >> nDepth >> nMode; if ( ( nDepth == 1 ) || ( nDepth == 8 ) || ( nDepth == 16 ) ) @@ -1112,11 +1112,11 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) aPixSize.Height() = nRows; break; default: - bRet = FALSE; + bRet = sal_False; } } else - bRet = FALSE; + bRet = sal_False; } } } @@ -1132,7 +1132,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool ) { // es wird die EPS mit Vorschaubild Variante und die Extensionuebereinstimmung // geprueft @@ -1151,10 +1151,10 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) && ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { nFormat = GFF_EPS; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } /************************************************************************* @@ -1163,9 +1163,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectDXF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_DXF; @@ -1178,9 +1178,9 @@ BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectMET( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_MET; @@ -1194,14 +1194,14 @@ BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_PCT; else { - BYTE sBuf[4]; + sal_uInt8 sBuf[4]; rStm.Seek( nStmPos + 522 ); rStm.Read( sBuf, 3 ); @@ -1211,7 +1211,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) if ( ( sBuf[0] == 0x00 ) && ( sBuf[1] == 0x11 ) && ( ( sBuf[2] == 0x01 ) || ( sBuf[2] == 0x02 ) ) ) { - bRet = TRUE; + bRet = sal_True; nFormat = GFF_PCT; } } @@ -1227,21 +1227,21 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL ) - bRet = TRUE; + bRet = sal_True; else { - BYTE nFirst, nSecond; + sal_uInt8 nFirst, nSecond; rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if( nFirst == 'J' && nSecond == 'J' ) - bRet = TRUE; + bRet = sal_True; } if( bRet ) @@ -1257,9 +1257,9 @@ BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectSGV( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_SGV; @@ -1273,11 +1273,11 @@ BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) +sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo ) { - UINT32 n32; - BOOL bRet = FALSE; - BYTE cByte; + sal_uInt32 n32; + sal_Bool bRet = sal_False; + sal_uInt8 cByte; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStm.Seek( nStmPos ); @@ -1289,12 +1289,12 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) if ( cByte == 0x49 ) { nFormat = GFF_SVM; - bRet = TRUE; + bRet = sal_True; if ( bExtendedInfo ) { - UINT32 nTemp32; - UINT16 nTemp16; + sal_uInt32 nTemp32; + sal_uInt16 nTemp16; rStm.SeekRel( 0x04 ); @@ -1321,14 +1321,14 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) if( n32 == 0x4D4C4356 ) { - UINT16 nTmp16; + sal_uInt16 nTmp16; rStm >> nTmp16; if( nTmp16 == 0x4654 ) { nFormat = GFF_SVM; - bRet = TRUE; + bRet = sal_True; if( bExtendedInfo ) { @@ -1353,9 +1353,9 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectWMF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_WMF; @@ -1368,9 +1368,9 @@ BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL ) |* \************************************************************************/ -BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL ) +sal_Bool GraphicDescriptor::ImpDetectEMF( SvStream&, sal_Bool ) { - BOOL bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL; + sal_Bool bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL; if (bRet) nFormat = GFF_EMF; diff --git a/svtools/source/filter.vcl/filter/fldll.cxx b/svtools/source/filter.vcl/filter/fldll.cxx index b44e08835f34..7ba8b0f79c2c 100644 --- a/svtools/source/filter.vcl/filter/fldll.cxx +++ b/svtools/source/filter.vcl/filter/fldll.cxx @@ -54,7 +54,7 @@ extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) hDLLInst = hDLL; - return TRUE; + return sal_True; } /*************************************************************************** diff --git a/svtools/source/filter.vcl/filter/gradwrap.cxx b/svtools/source/filter.vcl/filter/gradwrap.cxx index be5dade03313..970c022b7c21 100644 --- a/svtools/source/filter.vcl/filter/gradwrap.cxx +++ b/svtools/source/filter.vcl/filter/gradwrap.cxx @@ -57,7 +57,7 @@ GradientWrapper::~GradientWrapper() void GradientWrapper::WriteLinearGradient(const Rectangle& rRect, const Gradient& rGradient) { - USHORT nStepCount = 100; + sal_uInt16 nStepCount = 100; Rectangle aRect = rRect; aRect.Left()--; @@ -84,18 +84,18 @@ void GradientWrapper::WriteLinearGradient(const Rectangle& rRect, Point aCenter = rRect.Center(); Rectangle aFullRect = aRect; long nBorder = (long)rGradient.GetBorder() * aRect.GetHeight() / 100; - BOOL bLinear; + sal_Bool bLinear; // Rand berechnen und Rechteck neu setzen fuer linearen Farbverlauf if ( rGradient.GetStyle() == GRADIENT_LINEAR ) { - bLinear = TRUE; + bLinear = sal_True; aRect.Top() += nBorder; } // Rand berechnen und Rechteck neu setzen fuer axiale Farbverlauf else { - bLinear = FALSE; + bLinear = sal_False; nBorder >>= 1; aRect.Top() += nBorder; @@ -115,10 +115,10 @@ void GradientWrapper::WriteLinearGradient(const Rectangle& rRect, if ( !nInc ) nInc = 1; - nStepCount = (USHORT)(nMinRect / nInc); + nStepCount = (sal_uInt16)(nMinRect / nInc); } // minimal drei Schritte - long nSteps = Max( nStepCount, (USHORT)3 ); + long nSteps = Max( nStepCount, (sal_uInt16)3 ); // Falls axialer Farbverlauf, muss die Schrittanzahl ungerade sein if ( !bLinear && !(nSteps & 1) ) @@ -171,7 +171,7 @@ void GradientWrapper::WriteLinearGradient(const Rectangle& rRect, // zeichnen zu koennen nSteps2 = nSteps + 2; } - Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + Color aCol( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); // GDI-Objekte sichern und setzen aSetFillInBrushRecordHdl.Call(&aCol); @@ -247,13 +247,13 @@ void GradientWrapper::WriteLinearGradient(const Rectangle& rRect, // fuer lineare FV ganz normale Bestimmung der Farbe if ( bLinear || (i <= nSteps) ) { - aCol = Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + aCol = Color( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); } // fuer axiale FV muss die letzte Farbe der ersten // Farbe entsprechen else { - aCol = Color( (BYTE) nEndRed, (BYTE) nEndGreen, (BYTE) nEndBlue ); + aCol = Color( (sal_uInt8) nEndRed, (sal_uInt8) nEndGreen, (sal_uInt8) nEndBlue ); } aSetFillInBrushRecordHdl.Call(&aCol); @@ -265,7 +265,7 @@ void GradientWrapper::WriteLinearGradient(const Rectangle& rRect, void GradientWrapper::WriteRadialGradient(const Rectangle& rRect, const Gradient& rGradient) { - USHORT nStepCount = 100; + sal_uInt16 nStepCount = 100; Rectangle aClipRect = rRect; Rectangle aRect = rRect; long nZWidth = aRect.GetWidth() * (long)rGradient.GetOfsX() / 100; @@ -305,10 +305,10 @@ void GradientWrapper::WriteRadialGradient(const Rectangle& rRect, if ( !nInc ) nInc = 1; - nStepCount = (USHORT)(nMinRect / nInc); + nStepCount = (sal_uInt16)(nMinRect / nInc); } // minimal drei Schritte - long nSteps = Max( nStepCount, (USHORT)3 ); + long nSteps = Max( nStepCount, (sal_uInt16)3 ); // Ausgabebegrenzungen und Schrittweite fuer jede Richtung festlegen double fScanLeft = aRect.Left(); @@ -339,7 +339,7 @@ void GradientWrapper::WriteRadialGradient(const Rectangle& rRect, long nStepRed = (nEndRed - nRed) / nSteps; long nStepGreen = (nEndGreen - nGreen) / nSteps; long nStepBlue = (nEndBlue - nBlue) / nSteps; - Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + Color aCol( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); // GDI-Objekte sichern und setzen aSetFillInBrushRecordHdl.Call(&aCol); @@ -360,7 +360,7 @@ void GradientWrapper::WriteRadialGradient(const Rectangle& rRect, for ( long i = 0; i < nSteps; i++ ) { - Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + Color aCol( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); aSetFillInBrushRecordHdl.Call(&aCol); // neues Polygon berechnen @@ -395,7 +395,7 @@ void GradientWrapper::WriteRadialGradient(const Rectangle& rRect, // Falls PolyPolygon-Ausgabe, muessen wir noch ein letztes // inneres Polygon zeichnen - aCol = Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + aCol = Color( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); aSetFillInBrushRecordHdl.Call(&aCol); aPoly = aPolyPoly.GetObject( 1 ); @@ -411,7 +411,7 @@ void GradientWrapper::WriteRadialGradient(const Rectangle& rRect, void GradientWrapper::WriteRectGradient(const Rectangle& rRect, const Gradient& rGradient) { - USHORT nStepCount = 100; + sal_uInt16 nStepCount = 100; Rectangle aClipRect = rRect; Rectangle aRect = rRect; @@ -471,10 +471,10 @@ void GradientWrapper::WriteRectGradient(const Rectangle& rRect, if ( !nInc ) nInc = 1; - nStepCount = (USHORT)(nMinRect / nInc); + nStepCount = (sal_uInt16)(nMinRect / nInc); } // minimal drei Schritte - long nSteps = Max( nStepCount, (USHORT)3 ); + long nSteps = Max( nStepCount, (sal_uInt16)3 ); // Ausgabebegrenzungen und Schrittweite fuer jede Richtung festlegen double fScanLeft = aRect.Left(); @@ -505,7 +505,7 @@ void GradientWrapper::WriteRectGradient(const Rectangle& rRect, long nStepRed = (nEndRed - nRed) / nSteps; long nStepGreen = (nEndGreen - nGreen) / nSteps; long nStepBlue = (nEndBlue - nBlue) / nSteps; - Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + Color aCol( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); // GDI-Objekte sichern und setzen aSetFillInBrushRecordHdl.Call(&aCol); @@ -526,7 +526,7 @@ void GradientWrapper::WriteRectGradient(const Rectangle& rRect, // Schleife, um nacheinander die Polygone/PolyPolygone auszugeben for ( long i = 0; i < nSteps; i++ ) { - Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + Color aCol( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); aSetFillInBrushRecordHdl.Call(&aCol); // neues Polygon berechnen @@ -558,7 +558,7 @@ void GradientWrapper::WriteRectGradient(const Rectangle& rRect, nBlue = MinMax( nBlue, 0, 0xFF ); } - aCol = Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ); + aCol = Color( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ); aSetFillInBrushRecordHdl.Call(&aCol); aPoly = aPolyPoly.GetObject( 1 ); diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx index 43cf0fbbacd3..e2fff4f49433 100644 --- a/svtools/source/filter.vcl/filter/sgfbram.cxx +++ b/svtools/source/filter.vcl/filter/sgfbram.cxx @@ -79,11 +79,11 @@ SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfHeader::ChkMagic() +sal_Bool SgfHeader::ChkMagic() { return Magic=='J'*256+'J'; } -UINT32 SgfHeader::GetOffset() -{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); } +sal_uInt32 SgfHeader::GetOffset() +{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); } /************************************************************************* @@ -109,8 +109,8 @@ SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr) return rIStream; } -UINT32 SgfEntry::GetOffset() -{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); } +sal_uInt32 SgfEntry::GetOffset() +{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); } /************************************************************************* @@ -169,21 +169,21 @@ SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead) return rOStream; } -void BmpFileHeader::SetSize(UINT32 Size) +void BmpFileHeader::SetSize(sal_uInt32 Size) { - SizeLo=UINT16(Size & 0x0000FFFF); - SizeHi=UINT16((Size & 0xFFFF0000)>>16); + SizeLo=sal_uInt16(Size & 0x0000FFFF); + SizeHi=sal_uInt16((Size & 0xFFFF0000)>>16); } -void BmpFileHeader::SetOfs(UINT32 Ofs) +void BmpFileHeader::SetOfs(sal_uInt32 Ofs) { - OfsLo=UINT16(Ofs & 0x0000FFFF); - OfsHi=UINT16((Ofs & 0xFFFF0000)>>16); + OfsLo=sal_uInt16(Ofs & 0x0000FFFF); + OfsHi=sal_uInt16((Ofs & 0xFFFF0000)>>16); } -UINT32 BmpFileHeader::GetOfs() +sal_uInt32 BmpFileHeader::GetOfs() { - return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); + return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); } /************************************************************************* @@ -251,14 +251,14 @@ SvStream& operator<<(SvStream& rOStream, const RGBQuad& rQuad) class PcxExpand { private: - USHORT Count; - BYTE Data; + sal_uInt16 Count; + sal_uInt8 Data; public: PcxExpand() { Count=0; } - BYTE GetByte(SvStream& rInp); + sal_uInt8 GetByte(SvStream& rInp); }; -BYTE PcxExpand::GetByte(SvStream& rInp) +sal_uInt8 PcxExpand::GetByte(SvStream& rInp) { if (Count>0) { Count--; @@ -286,21 +286,21 @@ BYTE PcxExpand::GetByte(SvStream& rInp) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) +sal_Bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) { BmpFileHeader aBmpHead; BmpInfoHeader aBmpInfo; - USHORT nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes - USHORT nWdtOut; // Breite der Output-Bitmap in Bytes - USHORT nColors; // Anzahl der Farben (1,16,256) - USHORT nColBits; // Anzahl der Bits/Pixel (2, 4, 8) - USHORT i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler - USHORT a,b; // Hilfsvariable - BYTE pl1 = 0,pl2= 0; // Masken fuer die Planes - BYTE* pBuf=NULL; // Buffer fuer eine Pixelzeile + sal_uInt16 nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes + sal_uInt16 nWdtOut; // Breite der Output-Bitmap in Bytes + sal_uInt16 nColors; // Anzahl der Farben (1,16,256) + sal_uInt16 nColBits; // Anzahl der Bits/Pixel (2, 4, 8) + sal_uInt16 i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler + sal_uInt16 a,b; // Hilfsvariable + sal_uInt8 pl1 = 0,pl2= 0; // Masken fuer die Planes + sal_uInt8* pBuf=NULL; // Buffer fuer eine Pixelzeile PcxExpand aPcx; - ULONG nOfs; - BYTE cRGB[4]; + sal_uIntPtr nOfs; + sal_uInt8 cRGB[4]; if (rHead.Planes<=1) nColBits=1; else nColBits=4; if (rHead.Typ==4) nColBits=8; nColors=1<<nColBits; @@ -321,8 +321,8 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) aBmpInfo.yDpmm=0; aBmpInfo.ColUsed=0; aBmpInfo.ColMust=0; - pBuf=new BYTE[nWdtOut]; - if (!pBuf) return FALSE; // Fehler: kein Speichel da + pBuf=new sal_uInt8[nWdtOut]; + if (!pBuf) return sal_False; // Fehler: kein Speichel da rOut<<aBmpHead<<aBmpInfo; memset(pBuf,0,nWdtOut); // Buffer mit Nullen fuellen @@ -339,7 +339,7 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) pBuf[i]=aPcx.GetByte(rInp); } for(i=nWdtInp;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes - rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben! + rOut.Seek(nOfs+((sal_uIntPtr)rHead.Ysize-j-1L)*(sal_uIntPtr)nWdtOut); // rueckwaerts schreiben! rOut.Write((char*)pBuf,nWdtOut); } } else if (nColors==16) { @@ -385,7 +385,7 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) } } for(i=nWdtInp*4;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes - rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben! + rOut.Seek(nOfs+((sal_uIntPtr)rHead.Ysize-j-1L)*(sal_uIntPtr)nWdtOut); // rueckwaerts schreiben! rOut.Write((char*)pBuf,nWdtOut); } } else if (nColors==256) { @@ -405,12 +405,12 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) for(i=0;i<rHead.Xsize;i++) pBuf[i]=aPcx.GetByte(rInp); for(i=rHead.Xsize;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes - rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben! + rOut.Seek(nOfs+((sal_uIntPtr)rHead.Ysize-j-1L)*(sal_uIntPtr)nWdtOut); // rueckwaerts schreiben! rOut.Write((char*)pBuf,nWdtOut); } } delete[] pBuf; - return TRUE; + return sal_True; } @@ -423,14 +423,14 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut) +sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut) { - ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. + sal_uIntPtr nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. SgfHeader aHead; SgfEntry aEntr; - ULONG nNext; - BOOL bRdFlag=FALSE; // Grafikentry gelesen ? - BOOL bRet=FALSE; // Returncode + sal_uIntPtr nNext; + sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ? + sal_Bool bRet=sal_False; // Returncode nFileStart=rInp.Tell(); rInp>>aHead; @@ -442,7 +442,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut) rInp>>aEntr; nNext=aEntr.GetOffset(); if (aEntr.Typ==aHead.Typ) { - bRdFlag=TRUE; + bRdFlag=sal_True; switch(aEntr.Typ) { case SgfBitImag0: case SgfBitImag1: @@ -452,7 +452,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut) } } // while(nNext) } - if (rInp.GetError()) bRet=FALSE; + if (rInp.GetError()) bRet=sal_False; return(bRet); } @@ -468,15 +468,15 @@ long SgfVectXmul=0; long SgfVectYmul=0; long SgfVectXdiv=0; long SgfVectYdiv=0; -BOOL SgfVectScal=FALSE; +sal_Bool SgfVectScal=sal_False; //////////////////////////////////////////////////////////// // Hpgl2SvFarbe //////////////////////////////////////////// //////////////////////////////////////////////////////////// -Color Hpgl2SvFarbe( BYTE nFarb ) +Color Hpgl2SvFarbe( sal_uInt8 nFarb ) { - ULONG nColor = COL_BLACK; + sal_uIntPtr nColor = COL_BLACK; switch (nFarb & 0x07) { case 0: nColor=COL_WHITE; break; @@ -501,20 +501,20 @@ Color Hpgl2SvFarbe( BYTE nFarb ) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf) +sal_Bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf) { VirtualDevice aOutDev; SgfVector aVect; - BYTE nFarb; - BYTE nFrb0=7; - BYTE nLTyp; - BYTE nOTyp; - BOOL bEoDt=FALSE; - BOOL bPDwn=FALSE; + sal_uInt8 nFarb; + sal_uInt8 nFrb0=7; + sal_uInt8 nLTyp; + sal_uInt8 nOTyp; + sal_Bool bEoDt=sal_False; + sal_Bool bPDwn=sal_False; Point aP0(0,0); Point aP1(0,0); String Msg; - USHORT RecNr=0; + sal_uInt16 RecNr=0; rMtf.Record(&aOutDev); aOutDev.SetLineColor(Color(COL_BLACK)); @@ -522,9 +522,9 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt while (!bEoDt && !rInp.GetError()) { rInp>>aVect; RecNr++; - nFarb=(BYTE) (aVect.Flag & 0x000F); - nLTyp=(BYTE)((aVect.Flag & 0x00F0) >>4); - nOTyp=(BYTE)((aVect.Flag & 0x0F00) >>8); + nFarb=(sal_uInt8) (aVect.Flag & 0x000F); + nLTyp=(sal_uInt8)((aVect.Flag & 0x00F0) >>4); + nOTyp=(sal_uInt8)((aVect.Flag & 0x0F00) >>8); bEoDt=(aVect.Flag & 0x4000) !=0; bPDwn=(aVect.Flag & 0x8000) !=0; @@ -565,7 +565,7 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt Fraction( 1, 4 ), Fraction( 1, 4 ) ); rMtf.SetPrefMapMode( aMap ); rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) ); - return TRUE; + return sal_True; } @@ -578,14 +578,14 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) +sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) { - ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. + sal_uIntPtr nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. SgfHeader aHead; SgfEntry aEntr; - ULONG nNext; - BOOL bRdFlag=FALSE; // Grafikentry gelesen ? - BOOL bRet=FALSE; // Returncode + sal_uIntPtr nNext; + sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ? + sal_Bool bRet=sal_False; // Returncode nFileStart=rInp.Tell(); rInp>>aHead; @@ -600,7 +600,7 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) } } // while(nNext) if (bRdFlag) { - if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok + if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok } } return(bRet); @@ -616,9 +616,9 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) +sal_Bool SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) { - return FALSE; // PostSrcipt wird noch nicht unterstuetzt ! + return sal_False; // PostSrcipt wird noch nicht unterstuetzt ! } @@ -631,7 +631,7 @@ BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion) +sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion) { #if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Allignment! if (sizeof(SgfHeader)!=SgfHeaderSize || @@ -642,7 +642,7 @@ BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion) sizeof(RGBQuad )!=RGBQuadSize ) return SGF_DONTKNOW; #endif - ULONG nPos; + sal_uIntPtr nPos; SgfHeader aHead; nVersion=0; nPos=rInp.Tell(); diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx index e175380244b3..4c69d48438a3 100644 --- a/svtools/source/filter.vcl/filter/sgvmain.cxx +++ b/svtools/source/filter.vcl/filter/sgvmain.cxx @@ -58,7 +58,7 @@ p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \ p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \ SWAPPOINT(p.U); \ - UINT16 iTemp; \ + sal_uInt16 iTemp; \ for (iTemp=0;iTemp<20;iTemp++) { \ rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]); \ rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]); }} @@ -127,41 +127,41 @@ static void AntiMscBug() {} //////////////////////////////////////////////////////////////////////////////////////////////////// // Fuer Kreisunterarten, Text und gedrehte Rechtecke /////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// -void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs) +void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs) { - INT16 dx,dy; + sal_Int16 dx,dy; double x1,y1; dx=P.x-cx; dy=P.y-cy; x1=dx*cs-dy*sn; y1=dy*cs+dx*sn; - P.x=cx+INT16(x1); - P.y=cy+INT16(y1); + P.x=cx+sal_Int16(x1); + P.y=cy+sal_Int16(y1); } -void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs) +void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs) { - INT16 dx,dy; + sal_Int16 dx,dy; double x1,y1; - dx=(INT16)(P.X()-cx); - dy=(INT16)(P.Y()-cy); + dx=(sal_Int16)(P.X()-cx); + dy=(sal_Int16)(P.Y()-cy); x1=dx*cs-dy*sn; y1=dy*cs+dx*sn; - P=Point(cx+INT16(x1),cy+INT16(y1)); + P=Point(cx+sal_Int16(x1),cy+sal_Int16(y1)); } -INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div) +sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div) { - INT32 Temp; - Temp=INT32(a)*INT32(Mul)/INT32(Div); - return INT16(Temp); + sal_Int32 Temp; + Temp=sal_Int32(a)*sal_Int32(Mul)/sal_Int32(Div); + return sal_Int16(Temp); } -UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div) +sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div) { - UINT32 Temp; - Temp=UINT32(a)*UINT32(Mul)/UINT32(Div); - return UINT16(Temp); + sal_uInt32 Temp; + Temp=sal_uInt32(a)*sal_uInt32(Mul)/sal_uInt32(Div); + return sal_uInt16(Temp); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -176,10 +176,10 @@ SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd) void DtHdOverSeek(SvStream& rInp) { - ULONG FPos=rInp.Tell(); - FPos+=(ULONG)DtHdSize; + sal_uIntPtr FPos=rInp.Tell(); + FPos+=(sal_uIntPtr)DtHdSize; rInp.Seek(FPos); -// rInp.seekg(rInp.tellg()+(ULONG)DtHdSize); +// rInp.seekg(rInp.tellg()+(sal_uIntPtr)DtHdSize); } @@ -194,21 +194,21 @@ SvStream& operator>>(SvStream& rIStream, PageType& rPage) void ObjkOverSeek(SvStream& rInp, ObjkType& rObjk) { - ULONG Siz; - Siz=(ULONG)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize + sal_uIntPtr Siz; + Siz=(sal_uIntPtr)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize rInp.Seek(rInp.Tell()+Siz); } SvStream& operator>>(SvStream& rInp, ObjkType& rObjk) { // Die Fileposition im Stream bleibt unveraendert! - ULONG nPos; + sal_uIntPtr nPos; nPos=rInp.Tell(); rInp.Read((char*)&rObjk.Last,ObjkSize); #if defined OSL_BIGENDIAN SWAPOBJK(rObjk); #endif #ifdef InArbeit - ULONG nPos1=rInp.Tell(); + sal_uIntPtr nPos1=rInp.Tell(); if(nPos == nPos1) InfoBox( NULL, "tellg funkt nich" ).Execute(); #endif rInp.Seek(nPos); @@ -340,10 +340,10 @@ SvStream& operator>>(SvStream& rInp, GrupType& rGrup) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts) +Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts) { - UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0; - BYTE nInt2=100-nInts; + sal_uInt16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0; + sal_uInt8 nInt2=100-nInts; switch(nFrb1 & 0x07) { case 0: r1=0xFF; g1=0xFF; b1=0xFF; break; case 1: r1=0xFF; g1=0xFF; break; @@ -364,9 +364,9 @@ Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts) case 6: b2=0xFF; break; case 7: break; } - r1=(UINT16)((UINT32)r1*nInts/100+(UINT32)r2*nInt2/100); - g1=(UINT16)((UINT32)g1*nInts/100+(UINT32)g2*nInt2/100); - b1=(UINT16)((UINT32)b1*nInts/100+(UINT32)b2*nInt2/100); + r1=(sal_uInt16)((sal_uInt32)r1*nInts/100+(sal_uInt32)r2*nInt2/100); + g1=(sal_uInt16)((sal_uInt32)g1*nInts/100+(sal_uInt32)g2*nInt2/100); + b1=(sal_uInt16)((sal_uInt32)b1*nInts/100+(sal_uInt32)b2*nInt2/100); Color aColor( (sal_uInt8)r1, (sal_uInt8)g1, (sal_uInt8)b1 ); return aColor; } @@ -467,7 +467,7 @@ void StrkType::Draw(OutputDevice& rOut) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDevice& rOut) +void SgfAreaColorIntens(sal_uInt16 Muster, sal_uInt8 Col1, sal_uInt8 Col2, sal_uInt8 Int, OutputDevice& rOut) { ObjAreaType F; F.FMuster=Muster; @@ -477,15 +477,15 @@ void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDev SetArea(F,rOut); } -void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, OutputDevice& rOut) +void DrawSlideRect(sal_Int16 x1, sal_Int16 y1, sal_Int16 x2, sal_Int16 y2, ObjAreaType& F, OutputDevice& rOut) { - INT16 i,i0,b,b0; - INT16 Int1,Int2; - INT16 Col1,Col2; + sal_Int16 i,i0,b,b0; + sal_Int16 Int1,Int2; + sal_Int16 Col1,Col2; // ClipMerk: HgdClipRec; - INT16 cx,cy; - INT16 MaxR; - INT32 dx,dy; + sal_Int16 cx,cy; + sal_Int16 MaxR; + sal_Int32 dx,dy; rOut.SetLineColor(); if (x1>x2) { i=x1; x1=x2; x2=i; } @@ -493,7 +493,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87; Int1=100-F.FIntens; Int2=F.FIntens; if (Int1==Int2) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawRect(Rectangle(x1,y1,x2,y2)); } else { b0=Int1; @@ -502,30 +502,30 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu i0=y1; i=y1; while (i<=y2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.DrawRect(Rectangle(x1,i0,x2,i-1)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawRect(Rectangle(x1,i0,x2,y2)); } break; case 0x28: { // horizontal i0=x1; i=x1; while (i<=x2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.DrawRect(Rectangle(i0,y1,i-1,y2)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawRect(Rectangle(i0,y1,x2,y2)); } break; @@ -539,14 +539,14 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu dx=x2-x1+1; dy=y2-y1+1; a=sqrt((double)(dx*dx+dy*dy)); - MaxR=INT16(a) /2 +1; + MaxR=sal_Int16(a) /2 +1; b0=Int2; i0=MaxR; if (MaxR<1) MaxR=1; i=MaxR; while (i>=0) { - b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR)); + b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); //if (i0>200 || (Col1 & $80)!=0 || (Col2 & $80)!=0) { // then begin { Fallunterscheidung fuer etwas bessere Performance } // s2:=i0-i+2; @@ -559,7 +559,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu } i--; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut); rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0)); rOut.SetClipRegion(ClipMerk); } break; // Kreis @@ -586,7 +586,7 @@ void RectType::Draw(OutputDevice& rOut) } } else { Point aPts[4]; - USHORT i; + sal_uInt16 i; double sn,cs; sn=sin(double(DrehWink)*3.14159265359/18000); cs=cos(double(DrehWink)*3.14159265359/18000); @@ -617,7 +617,7 @@ void PolyType::Draw(OutputDevice& rOut) if ((Flags & PolyClosBit) !=0) SetArea(F,rOut); SetLine(L,rOut); Polygon aPoly(nPoints); - USHORT i; + sal_uInt16 i; for(i=0;i<nPoints;i++) aPoly.SetPoint(Point(EckP[i].x,EckP[i].y),i); if ((Flags & PolyClosBit) !=0) { rOut.DrawPolygon(aPoly); @@ -641,13 +641,13 @@ void SplnType::Draw(OutputDevice& rOut) SetLine(L,rOut); Polygon aPoly(0); Polygon aSpln(nPoints); - USHORT i; + sal_uInt16 i; for(i=0;i<nPoints;i++) aSpln.SetPoint(Point(EckP[i].x,EckP[i].y),i); if ((Flags & PolyClosBit) !=0) { - Spline2Poly(aSpln,TRUE,aPoly); + Spline2Poly(aSpln,sal_True,aPoly); if (aPoly.GetSize()>0) rOut.DrawPolygon(aPoly); } else { - Spline2Poly(aSpln,FALSE,aPoly); + Spline2Poly(aSpln,sal_False,aPoly); if (aPoly.GetSize()>0) rOut.DrawPolyLine(aPoly); } } @@ -661,22 +661,22 @@ void SplnType::Draw(OutputDevice& rOut) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, OutputDevice& rOut) +void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAreaType& F, OutputDevice& rOut) { - INT16 x1=cx-rx; - INT16 y1=cy-ry; - INT16 x2=cx+rx; - INT16 y2=cy+ry; + sal_Int16 x1=cx-rx; + sal_Int16 y1=cy-ry; + sal_Int16 x2=cx+rx; + sal_Int16 y2=cy+ry; - INT16 i,i0,b,b0; - INT16 Int1,Int2; - INT16 Col1,Col2; + sal_Int16 i,i0,b,b0; + sal_Int16 Int1,Int2; + sal_Int16 Col1,Col2; rOut.SetLineColor(); Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87; Int1=100-F.FIntens; Int2=F.FIntens; if (Int1==Int2) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); } else { b0=Int1; @@ -686,16 +686,16 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu i0=y1; i=y1; while (i<=y2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.SetClipRegion(Rectangle(x1,i0,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.SetClipRegion(ClipMerk); @@ -705,23 +705,23 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu i0=x1; i=x1; while (i<=x2) { - b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1)); + b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1)); if (b!=b0) { - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); i0=i; b0=b; } i++; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); rOut.SetClipRegion(Rectangle(i0,y1,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.SetClipRegion(ClipMerk); } break; case 0x18: case 0x38: { // Kreis - INT16 MaxR; + sal_Int16 MaxR; if (rx<1) rx=1; if (ry<1) ry=1; @@ -730,17 +730,17 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu i0=MaxR; if (MaxR<1) MaxR=1; i=MaxR; while (i>=0) { - b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR)); + b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR)); if (b!=b0) { - INT32 temp=INT32(i0)*INT32(ry)/INT32(rx); - INT16 j0=INT16(temp); - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut); + sal_Int32 temp=sal_Int32(i0)*sal_Int32(ry)/sal_Int32(rx); + sal_Int16 j0=sal_Int16(temp); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); rOut.DrawEllipse(Rectangle(cx-i0,cy-j0,cx+i0,cy+j0)); i0=i; b0=b; } i--; } - SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut); + SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut); rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0)); } break; // Kreis } @@ -813,7 +813,7 @@ void BmapType::Draw(OutputDevice& rOut) { //ifstream aInp; unsigned char nSgfTyp; - USHORT nVersion; + sal_uInt16 nVersion; String aStr( reinterpret_cast< char const * >(&Filename[ 1 ]), (xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 ); @@ -827,7 +827,7 @@ void BmapType::Draw(OutputDevice& rOut) case SGF_BITIMAGE: { GraphicFilter aFlt; Graphic aGrf; - USHORT nRet; + sal_uInt16 nRet; nRet=aFlt.ImportGraphic(aGrf,aFNam); aGrf.Draw(&rOut,Point(Pos1.x,Pos1.y),Size(Pos2.x-Pos1.x,Pos2.y-Pos1.y)); } break; @@ -839,7 +839,7 @@ void BmapType::Draw(OutputDevice& rOut) SgfVectYmul=Pos2.y-Pos1.y; SgfVectXdiv=0; SgfVectYdiv=0; - SgfVectScal=TRUE; + SgfVectScal=sal_True; SgfVectFilter(*pInp,aMtf); SgfVectXofs=0; SgfVectYofs=0; @@ -847,7 +847,7 @@ void BmapType::Draw(OutputDevice& rOut) SgfVectYmul=0; SgfVectXdiv=0; SgfVectYdiv=0; - SgfVectScal=FALSE; + SgfVectScal=sal_False; aMtf.Play(&rOut); } break; } @@ -865,9 +865,9 @@ void BmapType::Draw(OutputDevice& rOut) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -UINT32 GrupType::GetSubPtr() +sal_uInt32 GrupType::GetSubPtr() { - return UINT32(SbLo)+0x00010000*UINT32(SbHi); + return sal_uInt32(SbLo)+0x00010000*sal_uInt32(SbHi); } /************************************************************************* @@ -882,8 +882,8 @@ UINT32 GrupType::GetSubPtr() void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) { ObjkType aObjk; - USHORT nGrpCnt=0; - BOOL bEnde=FALSE; + sal_uInt16 nGrpCnt=0; + sal_Bool bEnde=sal_False; do { rInp>>aObjk; if (!rInp.GetError()) { @@ -950,11 +950,11 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) } // if rInp if (!rInp.GetError()) { if (aObjk.Next==0L) { - if (nGrpCnt==0) bEnde=TRUE; + if (nGrpCnt==0) bEnde=sal_True; else nGrpCnt--; } } else { - bEnde=TRUE; // Lesefehler + bEnde=sal_True; // Lesefehler } } while (!bEnde); } @@ -994,15 +994,15 @@ void SkipObjkList(SvStream& rInp) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) +sal_Bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; PageType aPage; VirtualDevice aOutDev; OutputDevice* pOutDev; - ULONG nStdPos; - ULONG nZchPos; - USHORT Num; + sal_uIntPtr nStdPos; + sal_uIntPtr nZchPos; + sal_uInt16 Num; pOutDev=&aOutDev; DtHdOverSeek(rInp); // DataHeader weglesen @@ -1038,8 +1038,8 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) rMtf.WindStart(); MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4)); rMtf.SetPrefMapMode(aMap); - rMtf.SetPrefSize(Size((INT16)aPage.Paper.Size.x,(INT16)aPage.Paper.Size.y)); - bRet=TRUE; + rMtf.SetPrefSize(Size((sal_Int16)aPage.Paper.Size.x,(sal_Int16)aPage.Paper.Size.y)); + bRet=sal_True; return bRet; } @@ -1054,18 +1054,18 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf ) |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) +sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) { #if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Alignment! - if (sizeof(ObjTextType)!=ObjTextTypeSize) return FALSE; + if (sizeof(ObjTextType)!=ObjTextTypeSize) return sal_False; #endif - ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. + sal_uIntPtr nFileStart; // Offset des SgfHeaders. Im allgemeinen 0. SgfHeader aHead; SgfEntry aEntr; - ULONG nNext; - BOOL bRdFlag=FALSE; // Grafikentry gelesen ? - BOOL bRet=FALSE; // Returncode + sal_uIntPtr nNext; + sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ? + sal_Bool bRet=sal_False; // Returncode aIniPath.Append( String::CreateFromAscii( "sgf.ini", 7 ) ); // aIniPath.ToAbs(); @@ -1086,7 +1086,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) } } // while(nNext) if (bRdFlag) { - if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok + if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok } } delete pSgfFonts; @@ -1094,7 +1094,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ) } /* -Bitmap Dither(BYTE Intens) +Bitmap Dither(sal_uInt8 Intens) { Bitmap aBmp; BmpInfoHeader Info; diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx index 7a23e85f4dbe..aefc8601ec87 100644 --- a/svtools/source/filter.vcl/filter/sgvspln.cxx +++ b/svtools/source/filter.vcl/filter/sgvspln.cxx @@ -145,8 +145,8 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */ #define NEGMAX -POSMIN /* groesste negative Zahl */ #define NEGMIN -POSMAX /* kleinste negative Zahl */ -#define TRUE 1 -#define FALSE 0 +#define sal_True 1 +#define sal_False 0 /* Definition von Funktionsmakros: @@ -175,7 +175,7 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */ /*---------------------- MODUL TRIDIAGONAL ------------------------*/ -USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, +sal_uInt16 TriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower, double* diag, double* upper, double* b) /************************/ /* GAUSS-Verfahren fuer */ @@ -212,7 +212,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /* */ /* Eingabeparameter: */ /* ================ */ -/* n Dimension der Matrix ( > 1 ) USHORT n */ +/* n Dimension der Matrix ( > 1 ) sal_uInt16 n */ /* */ /* lower untere Nebendiagonale double lower[n] */ /* diag Hauptdiagonale double diag[n] */ @@ -222,7 +222,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /* Dreieckzerlegung der Ausgangsmatrix. */ /* */ /* b rechte Seite des Systems double b[n] */ -/* rep = 0 erstmaliger Aufruf BOOL rep */ +/* rep = 0 erstmaliger Aufruf sal_Bool rep */ /* !=0 wiederholter Aufruf */ /* fuer gleiche Matrix, */ /* aber verschiedenes b. */ @@ -256,7 +256,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /*.cp 5 */ { - USHORT i; + sal_uInt16 i; short j; // double fabs(double); @@ -307,7 +307,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower, /*---------------- MODUL ZYKLISCH TRIDIAGONAL ----------------------*/ -USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, +sal_uInt16 ZyklTriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower, double* diag, double* upper, double* lowrow, double* ricol, double* b) /******************************/ /* Systeme mit zyklisch tri- */ @@ -348,12 +348,12 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, /* */ /* Eingabeparameter: */ /* ================ */ -/* n Dimension der Matrix ( > 2 ) USHORT n */ +/* n Dimension der Matrix ( > 2 ) sal_uInt16 n */ /* lower untere Nebendiagonale double lower[n] */ /* diag Hauptdiagonale double diag[n] */ /* upper obere Nebendiagonale double upper[n] */ /* b rechte Seite des Systems double b[n] */ -/* rep = 0 erstmaliger Aufruf BOOL rep */ +/* rep = 0 erstmaliger Aufruf sal_Bool rep */ /* !=0 wiederholter Aufruf */ /* fuer gleiche Matrix, */ /* aber verschiedenes b. */ @@ -390,7 +390,7 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, /*.cp 5 */ { double temp; // fabs(double); - USHORT i; + sal_uInt16 i; short j; if ( n < 3 ) return(1); @@ -463,15 +463,15 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag, |* *************************************************************************/ -USHORT NaturalSpline(USHORT n, double* x, double* y, +sal_uInt16 NaturalSpline(sal_uInt16 n, double* x, double* y, double Marg0, double MargN, - BYTE MargCond, + sal_uInt8 MargCond, double* b, double* c, double* d) { - USHORT i; + sal_uInt16 i; double* a; double* h; - USHORT error; + sal_uInt16 error; if (n<2) return 1; if ( (MargCond & ~3) ) return 2; @@ -521,7 +521,7 @@ USHORT NaturalSpline(USHORT n, double* x, double* y, if (n==2) { c[1]=a[0]/d[0]; } else { - error=TriDiagGS(FALSE,n-1,b,d,c,a); + error=TriDiagGS(sal_False,n-1,b,d,c,a); if (error!=0) { delete[] a; delete[] h; return error+2; } for (i=0;i<n-1;i++) c[i+1]=a[i]; } @@ -572,11 +572,11 @@ USHORT NaturalSpline(USHORT n, double* x, double* y, *************************************************************************/ -USHORT PeriodicSpline(USHORT n, double* x, double* y, +sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y, double* b, double* c, double* d) { // Arrays muessen von [0..n] dimensioniert sein! - USHORT Error; - USHORT i,im1,nm1; //integer + sal_uInt16 Error; + sal_uInt16 i,im1,nm1; //integer double hr,hl; double* a; double* lowrow; @@ -613,7 +613,7 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y, lowrow[0]=hr; ricol[0]=hr; a[nm1]=3.0*((y[1]-y[0])/hr-(y[n]-y[nm1])/hl); - Error=ZyklTriDiagGS(FALSE,n,b,d,c,lowrow,ricol,a); + Error=ZyklTriDiagGS(sal_False,n,b,d,c,lowrow,ricol,a); if ( Error != 0 ) { delete[] a; @@ -650,22 +650,22 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y, |* *************************************************************************/ -USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond, +sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond, double Marg01, double Marg02, double MargN1, double MargN2, - BOOL CondT, double* T, + sal_Bool CondT, double* T, double* bx, double* cx, double* dx, double* by, double* cy, double* dy) { - USHORT Error,Marg; - USHORT i; + sal_uInt16 Error,Marg; + sal_uInt16 i; double deltX,deltY,delt, alphX = 0,alphY = 0, betX = 0,betY = 0; if (n<2) return 1; if ((MargCond & ~3) && (MargCond != 4)) return 2; // ungueltige Randbedingung - if (CondT==FALSE) { + if (CondT==sal_False) { T[0]=0.0; for (i=0;i<n;i++) { deltX=x[i+1]-x[i]; deltY=y[i+1]-y[i]; @@ -729,7 +729,7 @@ USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond, |* Polygons werden als Stuetzstellen angenommen. |* n liefert die Anzahl der Teilpolynome. |* Ist die Berechnung fehlerfrei verlaufen, so -|* liefert die Funktion TRUE. Nur in diesem Fall +|* liefert die Funktion sal_True. Nur in diesem Fall |* ist Speicher fuer die Koeffizientenarrays |* allokiert, der dann spaeter vom Aufrufer mittels |* delete freizugeben ist. @@ -738,14 +738,14 @@ USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond, |* *************************************************************************/ -BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, +sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n, double*& ax, double*& ay, double*& bx, double*& by, double*& cx, double*& cy, double*& dx, double*& dy, double*& T) { - BYTE Marg; + sal_uInt8 Marg; double Marg01,Marg02; double MargN1,MargN2; - USHORT i; + sal_uInt16 i; Point P0(-32768,-32768); Point Pt; @@ -787,12 +787,12 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, MargN2=0.0; if (n>0) n--; // n Korregieren (Anzahl der Teilpolynome) - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( ( Marg == 3 && n >= 3 ) || ( Marg == 2 && n >= 2 ) ) { - bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,FALSE,T,bx,cx,dx,by,cy,dy) == 0; + bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,sal_False,T,bx,cx,dx,by,cy,dy) == 0; } - if ( bRet == FALSE ) + if ( bRet == sal_False ) { delete[] ax; delete[] ay; @@ -816,7 +816,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Beschreibung Konvertiert einen parametrichen kubischen |* Polynomspline Spline (natuerlich oder periodisch) |* in ein angenaehertes Polygon. -|* Die Funktion liefert FALSE, wenn ein Fehler bei +|* Die Funktion liefert sal_False, wenn ein Fehler bei |* der Koeffizientenberechnung aufgetreten ist oder |* das Polygon zu gross wird (>PolyMax=16380). Im 1. |* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte. @@ -826,7 +826,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) +sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly) { short MinKoord=-32000; // zur Vermeidung short MaxKoord=32000; // von Ueberlaeufen @@ -844,11 +844,11 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) double Step; // Schrittweite fuer t double dt1,dt2,dt3; // Delta t, y, ^3 double t; - BOOL bEnde; // Teilpolynom zu Ende? - USHORT n; // Anzahl der zu zeichnenden Teilpolynome - USHORT i; // aktuelles Teilpolynom - BOOL bOk; // noch alles ok? - USHORT PolyMax=16380;// Maximale Anzahl von Polygonpunkten + sal_Bool bEnde; // Teilpolynom zu Ende? + sal_uInt16 n; // Anzahl der zu zeichnenden Teilpolynome + sal_uInt16 i; // aktuelles Teilpolynom + sal_Bool bOk; // noch alles ok? + sal_uInt16 PolyMax=16380;// Maximale Anzahl von Polygonpunkten long x,y; bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv); @@ -860,7 +860,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) i=0; while (i<n) { // n Teilpolynome malen t=tv[i]+Step; - bEnde=FALSE; + bEnde=sal_False; while (!bEnde) { // ein Teilpolynom interpolieren bEnde=t>=tv[i+1]; if (bEnde) t=tv[i+1]; @@ -873,7 +873,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) rPoly.SetSize(rPoly.GetSize()+1); rPoly.SetPoint(Point(short(x),short(y)),rPoly.GetSize()-1); } else { - bOk=FALSE; // Fehler: Polygon wird zu gross + bOk=sal_False; // Fehler: Polygon wird zu gross } t=t+Step; } // Ende von Teilpolynom @@ -891,5 +891,5 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly) return bOk; } // Ende von if (bOk) rPoly.SetSize(0); - return FALSE; + return sal_False; } diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx index 4a0be80b55be..b93e4287d17c 100644 --- a/svtools/source/filter.vcl/filter/sgvtext.cxx +++ b/svtools/source/filter.vcl/filter/sgvtext.cxx @@ -217,9 +217,9 @@ extern SgfFontLst* pSgfFonts; ///////////////////////////////////////////////////////////////////////////////// -BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L); +sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L); -BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L) +sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L) { return (F.FIntens!=L.LIntens) || ((F.FFarbe!=L.LFarbe) && (F.FIntens>0)) || @@ -265,11 +265,11 @@ short Sgf2hPoint(short a) // Unterkante berechnen. Alles in SGF-Units. // ====================================================================== -USHORT GetTopToBaseLine(USHORT MaxGrad) +sal_uInt16 GetTopToBaseLine(sal_uInt16 MaxGrad) { long ret; ret=long(MaxGrad)*long(CharTopToBase) /long(100); - return USHORT(ret); + return sal_uInt16(ret); } // ====================================================================== @@ -310,9 +310,9 @@ UCHAR ConvertTextChar(UCHAR c) -USHORT GetSchnittBit(UCHAR c) +sal_uInt16 GetSchnittBit(UCHAR c) { - USHORT r=0; + sal_uInt16 r=0; switch (c) { case EscBold : r=TextBoldBit; break; case EscRSlnt: r=TextRSlnBit; break; @@ -353,10 +353,10 @@ long ChgValue(long Def, long Min, long Max, UCHAR FlgVal, long NumVal) -void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3, - UCHAR FlgVal, USHORT Schnitt0, USHORT& Schnitt) +void ChgSchnittBit(sal_uInt16 Bit, sal_uInt16 Radio1, sal_uInt16 Radio2, sal_uInt16 Radio3, + UCHAR FlgVal, sal_uInt16 Schnitt0, sal_uInt16& Schnitt) { - USHORT All,Rad; + sal_uInt16 All,Rad; Rad=Radio1 | Radio2 | Radio3; All=Bit | Rad; @@ -371,9 +371,9 @@ void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3, -UCHAR GetNextChar(UCHAR* TBuf, USHORT Index) +UCHAR GetNextChar(UCHAR* TBuf, sal_uInt16 Index) { - USHORT Cnt; + sal_uInt16 Cnt; while (TBuf[Index]==Escape) { Index++; Cnt=0; @@ -386,24 +386,24 @@ UCHAR GetNextChar(UCHAR* TBuf, USHORT Index) -UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index, +UCHAR ProcessOne(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - BOOL ScanEsc) + sal_Bool ScanEsc) { UCHAR c; UCHAR Ident; - BOOL Ende; - BOOL q; + sal_Bool Ende; + sal_Bool q; UCHAR FlgVal; long NumVal; long Sgn; short i; - BOOL EoVal; + sal_Bool EoVal; do { c=TBuf[Index]; Index++; Ende=(c!=Escape); - if (Ende==FALSE) { + if (Ende==sal_False) { c=TBuf[Index]; Index++; Ident=c; // Identifer merken FlgVal=EscNoFlg; @@ -417,36 +417,36 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index, do { NumVal=10*NumVal+c-'0'; EoVal=(TBuf[Index]<'0' || TBuf[Index]>'9'); - if (EoVal==FALSE) { c=TBuf[Index]; Index++; } + if (EoVal==sal_False) { c=TBuf[Index]; Index++; } i--; - } while (i>0 && EoVal==FALSE); + } while (i>0 && EoVal==sal_False); NumVal=Sgn*NumVal; } q=!CheckTextOutl(AktAtr.F,AktAtr.L); switch (Ident) { - case EscFont : AktAtr.SetFont(ULONG (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break; - case EscGrad : AktAtr.Grad =USHORT(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break; - case EscBreit: AktAtr.Breite =USHORT(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break; - case EscKaptS: AktAtr.Kapit =(BYTE)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break; - case EscLFeed: AktAtr.LnFeed =USHORT(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break; - case EscSlant: AktAtr.Slant =USHORT(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break; + case EscFont : AktAtr.SetFont(sal_uIntPtr (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break; + case EscGrad : AktAtr.Grad =sal_uInt16(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break; + case EscBreit: AktAtr.Breite =sal_uInt16(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break; + case EscKaptS: AktAtr.Kapit =(sal_uInt8)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break; + case EscLFeed: AktAtr.LnFeed =sal_uInt16(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break; + case EscSlant: AktAtr.Slant =sal_uInt16(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break; case EscVPos : AktAtr.ChrVPos=char (ChgValue(Atr0.ChrVPos,-128,127 ,FlgVal,NumVal)); break; - case EscZAbst: AktAtr.ZAbst =(BYTE)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break; - case EscHJust: AktAtr.Justify=(BYTE)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break; - case EscFarbe: { AktAtr.L.LFarbe =(BYTE)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break; - case EscBFarb: { AktAtr.L.LBFarbe=(BYTE)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break; - case EscInts : { AktAtr.L.LIntens=(BYTE)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break; - - case EscMustr: { AktAtr.F.FMuster=USHORT(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break; - case EscMFarb: { AktAtr.F.FFarbe =(BYTE)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break; - case EscMBFrb: { AktAtr.F.FBFarbe=(BYTE)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break; - case EscMInts: { AktAtr.F.FIntens=(BYTE)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break; - - case EscSMstr: { AktAtr.ShdF.FMuster=USHORT(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break; - case EscSFarb: { AktAtr.ShdL.LFarbe =(BYTE)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break; - case EscSBFrb: { AktAtr.ShdL.LBFarbe=(BYTE)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break; - case EscSInts: { AktAtr.ShdL.LIntens=(BYTE)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break; + case EscZAbst: AktAtr.ZAbst =(sal_uInt8)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break; + case EscHJust: AktAtr.Justify=(sal_uInt8)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break; + case EscFarbe: { AktAtr.L.LFarbe =(sal_uInt8)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break; + case EscBFarb: { AktAtr.L.LBFarbe=(sal_uInt8)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break; + case EscInts : { AktAtr.L.LIntens=(sal_uInt8)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break; + + case EscMustr: { AktAtr.F.FMuster=sal_uInt16(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break; + case EscMFarb: { AktAtr.F.FFarbe =(sal_uInt8)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break; + case EscMBFrb: { AktAtr.F.FBFarbe=(sal_uInt8)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break; + case EscMInts: { AktAtr.F.FIntens=(sal_uInt8)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break; + + case EscSMstr: { AktAtr.ShdF.FMuster=sal_uInt16(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break; + case EscSFarb: { AktAtr.ShdL.LFarbe =(sal_uInt8)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break; + case EscSBFrb: { AktAtr.ShdL.LBFarbe=(sal_uInt8)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break; + case EscSInts: { AktAtr.ShdL.LIntens=(sal_uInt8)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break; case EscSDist: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); AktAtr.ShdVers.y=AktAtr.ShdVers.x; } break; case EscSXDst: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); } break; case EscSYDst: { AktAtr.ShdVers.y=(short)ChgValue(Atr0.ShdVers.y,0,30000,FlgVal,NumVal); } break; @@ -467,21 +467,21 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index, case EscEbShd: ChgSchnittBit(TextShEbBit,TextSh2DBit,TextSh3DBit,TextSh4DBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break; } //endcase if (TBuf[Index]==Escape) Index++; // zweites Esc weglesen } - } // if Ende==FALSE - } while (Ende==FALSE && ScanEsc==FALSE); - if (Ende==FALSE) c=Escape; + } // if Ende==sal_False + } while (Ende==sal_False && ScanEsc==sal_False); + if (Ende==sal_False) c=Escape; return c; } // end of ProcessOne -UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index, +UCHAR GetTextChar(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - USHORT Rest, BOOL ScanEsc) + sal_uInt16 Rest, sal_Bool ScanEsc) { UCHAR c,c0,nc; c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc); - if (ScanEsc==FALSE) { + if (ScanEsc==sal_False) { if (c==SoftTrennAdd || c==SoftTrennK || c==SoftTrenn) { nc=GetNextChar(TBuf,Index); c0=c; @@ -511,9 +511,9 @@ UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index, -UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index, +UCHAR GetTextCharConv(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - USHORT Rest, BOOL ScanEsc) + sal_uInt16 Rest, sal_Bool ScanEsc) { UCHAR c; @@ -534,23 +534,23 @@ UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index, // // Benoetigter Zeilenabstand in SGF-Units. ChrVPos wird beruecksichtigt. // ====================================================================== -USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktAtr, - USHORT nChar, USHORT& LF, USHORT& MaxGrad) +sal_uInt16 GetLineFeed(UCHAR* TBuf, sal_uInt16 Index, ObjTextType Atr0, ObjTextType AktAtr, + sal_uInt16 nChar, sal_uInt16& LF, sal_uInt16& MaxGrad) { UCHAR c=0; - BOOL AbsEnd=FALSE; - ULONG LF100=0; - ULONG MaxLF100=0; - BOOL LFauto=0; - BOOL First=TRUE; - USHORT Grad; - USHORT i=0; - USHORT r=1; + sal_Bool AbsEnd=sal_False; + sal_uIntPtr LF100=0; + sal_uIntPtr MaxLF100=0; + sal_Bool LFauto=0; + sal_Bool First=sal_True; + sal_uInt16 Grad; + sal_uInt16 i=0; + sal_uInt16 r=1; MaxGrad=0; while (!AbsEnd && nChar>0) { nChar--; - c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,FALSE); + c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,sal_False); i++; AbsEnd=(c==TextEnd || c==AbsatzEnd); if (First || (!AbsEnd && c!=' ' && c!=HardTrenn)) { @@ -562,15 +562,15 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA Grad=AktAtr.Grad; if (AktAtr.ChrVPos>0) Grad=Grad-AktAtr.ChrVPos; if (Grad>MaxGrad) MaxGrad=Grad; - First=FALSE; + First=sal_False; } if (!AbsEnd && c!=' ') r=i; } MaxGrad=hPoint2Sgf(MaxGrad); if (MaxLF100<=4000) { // sonst Overflowgefahr - LF=USHORT(hPoint2Sgf(short(MaxLF100)) /100); + LF=sal_uInt16(hPoint2Sgf(short(MaxLF100)) /100); } else { - LF=USHORT(hPoint2Sgf(short(MaxLF100) /100)); + LF=sal_uInt16(hPoint2Sgf(short(MaxLF100) /100)); } return r; @@ -592,17 +592,17 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA #define SuperSubFact 60 /* SuperScript/SubScript: 60% vom Schriftgrad */ #define DefaultSpace 40 /* Default: Space ist 40% vom SchriftGrad */ -USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dreh, - USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv) +sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, sal_uInt16 Dreh, + sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv) { SgfFontOne* pSgfFont; // Font aus dem IniFile Font aFont; Color aColor; - ULONG Grad; - ULONG Brei; + sal_uIntPtr Grad; + sal_uIntPtr Brei; String FNam; - USHORT StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad - BOOL bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1); + sal_uInt16 StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad + sal_Bool bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1); pSgfFont = pSgfFonts->GetFontDesc(Atr.GetFont()); @@ -653,25 +653,25 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr //aFont.SetCharSet(CHARSET_SYSTEM); } - Grad=ULONG(Atr.Grad); - if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*ULONG(Atr.Kapit)/100; + Grad=sal_uIntPtr(Atr.Grad); + if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*sal_uIntPtr(Atr.Kapit)/100; if ((Atr.Schnitt & TextSupSBit) !=0 || (Atr.Schnitt & TextSubSBit) !=0) Grad=Grad*SuperSubFact/100; Brei=Grad; if (Atr.Breite!=100 || bFit) { if (bFit) { - Grad=Grad*ULONG(FitYMul)/ULONG(FitYDiv); - Brei=Brei*ULONG(FitXMul)/ULONG(FitXDiv); + Grad=Grad*sal_uIntPtr(FitYMul)/sal_uIntPtr(FitYDiv); + Brei=Brei*sal_uIntPtr(FitXMul)/sal_uIntPtr(FitXDiv); } - Brei=Brei*ULONG(Atr.Breite)/100; - Brei=Brei*ULONG(StdBrei)/100; - aFont.SetSize(Size(hPoint2Sgf(USHORT(Brei)),hPoint2Sgf(USHORT(Grad)))); + Brei=Brei*sal_uIntPtr(Atr.Breite)/100; + Brei=Brei*sal_uIntPtr(StdBrei)/100; + aFont.SetSize(Size(hPoint2Sgf(sal_uInt16(Brei)),hPoint2Sgf(sal_uInt16(Grad)))); } else { - aFont.SetSize(Size(0,hPoint2Sgf(USHORT(Grad)))); + aFont.SetSize(Size(0,hPoint2Sgf(sal_uInt16(Grad)))); } aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor); aColor=Sgv2SvFarbe(Atr.F.FFarbe,Atr.F.FBFarbe,Atr.F.FIntens); aFont.SetFillColor(aColor); - aFont.SetTransparent(TRUE); + aFont.SetTransparent(sal_True); aFont.SetAlign(ALIGN_BASELINE); Dreh/=10; Dreh=3600-Dreh; if (Dreh==3600) Dreh=0; @@ -683,11 +683,11 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr if ((Atr.Schnitt & TextDbUnBit) !=0) aFont.SetUnderline(UNDERLINE_DOUBLE); if ((Atr.Schnitt & TextStrkBit) !=0) aFont.SetStrikeout(STRIKEOUT_SINGLE); if ((Atr.Schnitt & TextDbStBit) !=0) aFont.SetStrikeout(STRIKEOUT_DOUBLE); - if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(TRUE); - if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(TRUE); - if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(TRUE); - if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(TRUE); - if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(TRUE); + if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(sal_True); + if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(sal_True); + if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(sal_True); + if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(sal_True); + if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(sal_True); if (aFont!=rOut.GetFont()) rOut.SetFont(aFont); @@ -706,26 +706,26 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr // Absatz.Pas struct ProcChrSta { - USHORT Index; - USHORT ChrXP; + sal_uInt16 Index; + sal_uInt16 ChrXP; UCHAR OutCh; - BOOL Kapt; + sal_Bool Kapt; ObjTextType Attrib; }; -void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, USHORT IndexA) +void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, sal_uInt16 IndexA) { State.Attrib=AktAtr; State.OutCh=0; State.Index=IndexA; State.ChrXP=0; - State.Kapt=FALSE; + State.Kapt=sal_False; } -BOOL UpcasePossible(UCHAR c) +sal_Bool UpcasePossible(UCHAR c) { - if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return TRUE; - else return FALSE; + if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return sal_True; + else return sal_False; } UCHAR Upcase(UCHAR c) @@ -737,15 +737,15 @@ UCHAR Upcase(UCHAR c) return c; } -USHORT GetCharWidth(OutputDevice& rOut, UCHAR c) +sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c) { UCHAR c1; - USHORT ChrWidth; + sal_uInt16 ChrWidth; c1 = ByteString::Convert((char)c,RTL_TEXTENCODING_IBM_437, gsl_getSystemTextEncoding() ); if (c==' ') { - ChrWidth=(USHORT)rOut.GetTextWidth( String('A') ); + ChrWidth=(sal_uInt16)rOut.GetTextWidth( String('A') ); if (rOut.GetFont().GetPitch()!=PITCH_FIXED) { ChrWidth=MulDiv(ChrWidth,DefaultSpace,100); } @@ -755,30 +755,30 @@ USHORT GetCharWidth(OutputDevice& rOut, UCHAR c) OSL_ENSURE( MaxChar == 255, "MaxChar not 255" ); if (c>=MinChar /*&& c<=MaxChar*/) { - ChrWidth=(USHORT)rOut.GetTextWidth(String((char)c1)); + ChrWidth=(sal_uInt16)rOut.GetTextWidth(String((char)c1)); } else { - ChrWidth=(USHORT)rOut.GetTextWidth(String('A')); + ChrWidth=(sal_uInt16)rOut.GetTextWidth(String('A')); } } return ChrWidth; } UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& Atr0, - USHORT& nChars, USHORT Rest, + sal_uInt16& nChars, sal_uInt16 Rest, short* Line, UCHAR* cLine) { - USHORT KernDist=0; // Wert fuer Kerning - USHORT ChrWidth; + sal_uInt16 KernDist=0; // Wert fuer Kerning + sal_uInt16 ChrWidth; UCHAR c; UCHAR c1; - BOOL AbsEnd; + sal_Bool AbsEnd; - c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,FALSE); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt + c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,sal_False); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt AbsEnd=(c==AbsatzEnd || c==TextEnd); - if (AbsEnd==FALSE) { + if (AbsEnd==sal_False) { R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ... R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh); if (R.Kapt) R.OutCh=Upcase(R.OutCh); @@ -788,9 +788,9 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A ChrWidth=GetCharWidth(rOut,c1); if (R.Attrib.ZAbst!=100) { // Spezial-Zeichenabstand ? - ULONG Temp; - Temp=ULONG(ChrWidth)*ULONG(R.Attrib.ZAbst)/100; - ChrWidth=USHORT(Temp); + sal_uIntPtr Temp; + Temp=sal_uIntPtr(ChrWidth)*sal_uIntPtr(R.Attrib.ZAbst)/100; + ChrWidth=sal_uInt16(Temp); } nChars++; if (R.ChrXP>32000) R.ChrXP=32000; @@ -801,44 +801,44 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A return c; } -void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktAtr, - USHORT UmbWdt, USHORT AdjWdt, - short* Line, USHORT& nChars, +void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr, + sal_uInt16 UmbWdt, sal_uInt16 AdjWdt, + short* Line, sal_uInt16& nChars, double, double, - UCHAR* cLine, BOOL TextFit) + UCHAR* cLine, sal_Bool TextFit) { VirtualDevice vOut; UCHAR c,c0; UCHAR ct; - BOOL First; // erster Char ? - BYTE Just = 0; // Absatzformatierung - BOOL Border; // Rand der Box erreicht ? - BOOL Border0; - BOOL AbsEnd; // Ende des Absatzes erreicht ? + sal_Bool First; // erster Char ? + sal_uInt8 Just = 0; // Absatzformatierung + sal_Bool Border; // Rand der Box erreicht ? + sal_Bool Border0; + sal_Bool AbsEnd; // Ende des Absatzes erreicht ? ProcChrSta* R=new ProcChrSta; ProcChrSta* R0=new ProcChrSta; ProcChrSta* WErec=new ProcChrSta; - USHORT WEnChar; + sal_uInt16 WEnChar; ProcChrSta* WErec0=new ProcChrSta; - USHORT WEnChar0; + sal_uInt16 WEnChar0; ProcChrSta* TRrec=new ProcChrSta; - USHORT TRnChar; + sal_uInt16 TRnChar; - USHORT WordEndCnt; // Justieren und Trennen - BOOL WordEnd; - BOOL Trenn; + sal_uInt16 WordEndCnt; // Justieren und Trennen + sal_Bool WordEnd; + sal_Bool Trenn; short BoxRest; // zum Quetschen und formatieren - USHORT i,j,k,h; - USHORT re,li; + sal_uInt16 i,j,k,h; + sal_uInt16 re,li; vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4))); nChars=0; - SetTextContext(vOut,AktAtr,FALSE,0,1,1,1,1); + SetTextContext(vOut,AktAtr,sal_False,0,1,1,1,1); InitProcessCharState(*R,AktAtr,Index); - (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=FALSE; - Border=FALSE; First=TRUE; + (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=sal_False; + Border=sal_False; First=sal_True; WordEndCnt=0; do { // mal schauen, wieviele Worte so in die Zeile passen @@ -866,16 +866,16 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA } (*R0)=(*R); c0=c; Border0=Border; - First=FALSE; + First=sal_False; AbsEnd=AbsEnd || (nChars>=MaxLineChars); } while (!(AbsEnd || (Border && ((WordEndCnt>0) || WordEnd || Trenn)))); if (Border) { // Trennen und Quetschen (*WErec0)=(*WErec); WEnChar0=WEnChar; - AbsEnd=FALSE; c0=0; + AbsEnd=sal_False; c0=0; (*R)=(*WErec); nChars=WEnChar; (*TRrec)=(*R); TRnChar=nChars; - Border0=FALSE; Border=FALSE; + Border0=sal_False; Border=sal_False; do { // erst mal gucken wieviele Silben noch reinpassen ct=ProcessChar(vOut,TBuf,*TRrec,Atr0,TRnChar,DoTrenn,Line,cLine); c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,NoTrenn,Line,cLine); @@ -922,7 +922,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA if (!AbsEnd) { do { // Leerzeichen weglesen (*WErec)=(*R); - c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); + c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False); nChars++; Line[nChars]=R->ChrXP; cLine[nChars]=c; @@ -938,7 +938,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA nChars++; Line[nChars]=R->ChrXP; // Damit AbsatzEnde auch weggelesen wird Line[nChars+1]=R->ChrXP; // denn die Breite von CR oder #0 ist nun mal sehr klein if (TBuf[R->Index-1]!=AbsatzEnd && TBuf[R->Index-1]!=TextEnd) { - c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); // Kleine Korrektur. Notig, wenn nur 1 Wort in + c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False); // Kleine Korrektur. Notig, wenn nur 1 Wort in } } @@ -1022,8 +1022,8 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA ///////////////////////////////////////////////////////////////////////////////// // DrawText.Pas -void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, USHORT DrehWink, - USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv) +void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, sal_uInt16 DrehWink, + sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv) { SetTextContext(rOut,T,UpcasePossible(c),DrehWink,FitXMul,FitXDiv,FitYMul,FitYDiv); if ((T.Schnitt & TextKaptBit)!=0 && UpcasePossible(c)) c=Upcase(c); @@ -1045,32 +1045,32 @@ void TextType::Draw(OutputDevice& rOut) if ((Flags & TextOutlBit)!=0) return; // Sourcetext fuer Outliner !! ObjTextType T1,T2; - USHORT Index1; - USHORT Index2; + sal_uInt16 Index1; + sal_uInt16 Index2; UCHAR c = TextEnd; - USHORT l; // Anzahl der Zeichen in der Zeile - USHORT i; + sal_uInt16 l; // Anzahl der Zeichen in der Zeile + sal_uInt16 i; short yPos0; short xPos; short yPos; - USHORT LF; - USHORT MaxGrad; + sal_uInt16 LF; + sal_uInt16 MaxGrad; short xSize; short xSAdj; short ySize; double sn,cs; - USHORT TopToBase; - BOOL Ende = 0; - USHORT lc; - BOOL LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen - BOOL TextFit; + sal_uInt16 TopToBase; + sal_Bool Ende = 0; + sal_uInt16 lc; + sal_Bool LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen + sal_Bool TextFit; short* xLine; UCHAR* cLine; // Buffer fuer FormatLine - USHORT FitXMul; - USHORT FitXDiv; - USHORT FitYMul; - USHORT FitYDiv; - BOOL Fehler; + sal_uInt16 FitXMul; + sal_uInt16 FitXDiv; + sal_uInt16 FitYMul; + sal_uInt16 FitYDiv; + sal_Bool Fehler; UCHAR* Buf=Buffer; // Zeiger auf die Buchstaben pSgfFonts->ReadList(); @@ -1078,9 +1078,9 @@ void TextType::Draw(OutputDevice& rOut) cLine=new UCHAR[CharLineSize]; TextFit=(Flags & TextFitBits)!=0; - LineFit=FALSE; + LineFit=sal_False; LineFit=((Flags & TextFitZBit)!=0); - if (TextFit && FitSize.x==0) LineFit=TRUE; + if (TextFit && FitSize.x==0) LineFit=sal_True; if (DrehWink==0) { sn=0.0; @@ -1095,9 +1095,9 @@ void TextType::Draw(OutputDevice& rOut) ySize=Pos2.y-Pos1.y; xSize=32000 /2; // Umbruch xSAdj=Pos2.x-Pos1.x; // zum Ausrichten bei Zentriert/Blocksatz - //if (xSize<=0) { xSize=32000 /2; LineFit=TRUE; } - FitXMul=sal::static_int_cast< USHORT >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1; - FitYMul=sal::static_int_cast< USHORT >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1; + //if (xSize<=0) { xSize=32000 /2; LineFit=sal_True; } + FitXMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1; + FitYMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1; } else { xSize=Pos2.x-Pos1.x; xSAdj=xSize; @@ -1136,7 +1136,7 @@ void TextType::Draw(OutputDevice& rOut) T2=T1; Index2=Index1; i=1; while (i<=l) { - c=GetTextCharConv(Buf,Index2,T,T2,l-i,FALSE); + c=GetTextCharConv(Buf,Index2,T,T2,l-i,sal_False); long xp1,yp1; // wegen Overflowgefahr PointType Pos; xp1=long(Pos1.x)+xPos+long(xLine[i]); @@ -1168,27 +1168,27 @@ void TextType::Draw(OutputDevice& rOut) // (DEC Alpha hat naemlich 64Bit-Pointer!) //UCHAR* TextType::GetBufPtr() //{ -// ULONG Temp; -// Temp=ULONG(BufLo)+0x00010000*ULONG(BufHi); +// sal_uIntPtr Temp; +// Temp=sal_uIntPtr(BufLo)+0x00010000*sal_uIntPtr(BufHi); // return (UCHAR*)Temp; //} // //void TextType::SetBufPtr(UCHAR* Ptr) //{ -// ULONG Temp=(ULONG)Ptr; -// BufLo=USHORT(Temp & 0x0000FFFF); -// BufHi=USHORT((Temp & 0xFFFF0000)>>16); +// sal_uIntPtr Temp=(sal_uIntPtr)Ptr; +// BufLo=sal_uInt16(Temp & 0x0000FFFF); +// BufHi=sal_uInt16((Temp & 0xFFFF0000)>>16); //} -UINT32 ObjTextType::GetFont() +sal_uInt32 ObjTextType::GetFont() { - return ULONG(FontLo)+0x00010000*ULONG(FontHi); + return sal_uIntPtr(FontLo)+0x00010000*sal_uIntPtr(FontHi); } -void ObjTextType::SetFont(UINT32 FontID) +void ObjTextType::SetFont(sal_uInt32 FontID) { - FontLo=USHORT(FontID & 0x0000FFFF); - FontHi=USHORT((FontID & 0xFFFF0000)>>16); + FontLo=sal_uInt16(FontID & 0x0000FFFF); + FontHi=sal_uInt16((FontID & 0xFFFF0000)>>16); } @@ -1199,11 +1199,11 @@ SgfFontOne::SgfFontOne() { Next=NULL; IFID=0; - Bold=FALSE; - Ital=FALSE; - Sans=FALSE; - Serf=FALSE; - Fixd=FALSE; + Bold=sal_False; + Ital=sal_False; + Sans=sal_False; + Serf=sal_False; + Fixd=sal_False; SVFamil=FAMILY_DONTKNOW; SVChSet=RTL_TEXTENCODING_DONTKNOW; SVWidth=40; @@ -1211,7 +1211,7 @@ SgfFontOne::SgfFontOne() void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) { - USHORT i,j,n; + sal_uInt16 i,j,n; ByteString s; if ( Dsc.Len() < 4 || ( Dsc.GetChar( 0 ) != '(' ) ) @@ -1233,7 +1233,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) SVFName=String(Dsc,i+1,j); // SV-Fontname rausholen Dsc.Erase(i,j); - IFID = (UINT32)ID.ToInt32(); + IFID = (sal_uInt32)ID.ToInt32(); n=Dsc.GetTokenCount(' '); for (i=0;i<n;i++) { @@ -1241,11 +1241,11 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) if ( s.Len() ) { s.ToUpperAscii(); - if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=TRUE; - else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=TRUE; - else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=TRUE; - else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=TRUE; - else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=TRUE; + if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=sal_True; + else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=sal_True; + else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=sal_True; + else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=sal_True; + else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=sal_True; else if ( s.CompareTo( "ROMAN", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_ROMAN; else if ( s.CompareTo( "SWISS", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_SWISS; else if ( s.CompareTo( "MODERN", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_MODERN; @@ -1256,7 +1256,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc ) else if ( s.CompareTo( "MAC", 3 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN; else if ( s.CompareTo( "SYMBOL", 6 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_SYMBOL; else if ( s.CompareTo( "SYSTEM", 6 ) == COMPARE_EQUAL ) SVChSet = gsl_getSystemTextEncoding(); - else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< USHORT >(s.ToInt32()); + else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.ToInt32()); } } } @@ -1269,7 +1269,7 @@ SgfFontLst::SgfFontLst() Last=NULL; LastID=0; LastLn=NULL; - Tried=FALSE; + Tried=sal_False; } SgfFontLst::~SgfFontLst() @@ -1289,7 +1289,7 @@ void SgfFontLst::RausList() } pList=NULL; Last=NULL; - Tried=FALSE; + Tried=sal_False; LastID=0; LastLn=NULL; } @@ -1300,14 +1300,14 @@ void SgfFontLst::AssignFN(const String& rFName) void SgfFontLst::ReadList() { if (!Tried) { - Tried=TRUE; + Tried=sal_True; LastID=0; LastLn=NULL; SgfFontOne* P,P1; Config aCfg(FNam); aCfg.SetGroup("SGV Fonts fuer StarView"); - USHORT Anz=aCfg.GetKeyCount(); - USHORT i; + sal_uInt16 Anz=aCfg.GetKeyCount(); + sal_uInt16 i; ByteString FID,Dsc; for (i=0;i<Anz;i++) @@ -1325,7 +1325,7 @@ void SgfFontLst::ReadList() } } -SgfFontOne* SgfFontLst::GetFontDesc(UINT32 ID) +SgfFontOne* SgfFontLst::GetFontDesc(sal_uInt32 ID) { if (ID!=LastID) { SgfFontOne* P; diff --git a/svtools/source/filter.vcl/igif/decode.cxx b/svtools/source/filter.vcl/igif/decode.cxx index bfe77319b81a..5c0f70b2b7f2 100644 --- a/svtools/source/filter.vcl/igif/decode.cxx +++ b/svtools/source/filter.vcl/igif/decode.cxx @@ -36,19 +36,19 @@ struct GIFLZWTableEntry { GIFLZWTableEntry* pPrev; GIFLZWTableEntry* pFirst; - BYTE nData; + sal_uInt8 nData; }; // ------------------------------------------------------------------------ -GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) : +GIFLZWDecompressor::GIFLZWDecompressor( sal_uInt8 cDataSize ) : nInputBitsBuf ( 0 ), nOutBufDataLen ( 0 ), nInputBitsBufSize ( 0 ), - bEOIFound ( FALSE ), + bEOIFound ( sal_False ), nDataSize ( cDataSize ) { - pOutBuf = new BYTE[ 4096 ]; + pOutBuf = new sal_uInt8[ 4096 ]; nClearCode = 1 << nDataSize; nEOICode = nClearCode + 1; @@ -59,11 +59,11 @@ GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) : pTable = new GIFLZWTableEntry[ 4098 ]; - for( USHORT i = 0; i < nTableSize; i++ ) + for( sal_uInt16 i = 0; i < nTableSize; i++ ) { pTable[i].pPrev = NULL; pTable[i].pFirst = pTable + i; - pTable[i].nData = (BYTE) i; + pTable[i].nData = (sal_uInt8) i; } } @@ -77,11 +77,11 @@ GIFLZWDecompressor::~GIFLZWDecompressor() // ------------------------------------------------------------------------ -HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize, - ULONG& rCount, BOOL& rEOI ) +HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, + sal_uIntPtr& rCount, sal_Bool& rEOI ) { - ULONG nTargetSize = 4096; - ULONG nCount = 0; + sal_uIntPtr nTargetSize = 4096; + sal_uIntPtr nCount = 0; HPBYTE pTarget = (HPBYTE) rtl_allocateMemory( nTargetSize ); HPBYTE pTmpTarget = pTarget; @@ -95,8 +95,8 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize, if( nCount > nTargetSize ) { - ULONG nNewSize = nTargetSize << 1; - ULONG nOffset = pTmpTarget - pTarget; + sal_uIntPtr nNewSize = nTargetSize << 1; + sal_uIntPtr nOffset = pTmpTarget - pTarget; HPBYTE pTmp = (HPBYTE) rtl_allocateMemory( nNewSize ); memcpy( pTmp, pTarget, nTargetSize ); @@ -123,7 +123,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize, // ------------------------------------------------------------------------ -void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData ) +void GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData ) { GIFLZWTableEntry* pE; @@ -135,37 +135,37 @@ void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData ) pE->nData = pTable[ nCodeFirstData ].pFirst->nData; nTableSize++; - if ( ( nTableSize == (USHORT) (1 << nCodeSize) ) && ( nTableSize < 4096 ) ) + if ( ( nTableSize == (sal_uInt16) (1 << nCodeSize) ) && ( nTableSize < 4096 ) ) nCodeSize++; } } // ------------------------------------------------------------------------ -BOOL GIFLZWDecompressor::ProcessOneCode() +sal_Bool GIFLZWDecompressor::ProcessOneCode() { GIFLZWTableEntry* pE; - USHORT nCode; - BOOL bRet = FALSE; - BOOL bEndOfBlock = FALSE; + sal_uInt16 nCode; + sal_Bool bRet = sal_False; + sal_Bool bEndOfBlock = sal_False; while( nInputBitsBufSize < nCodeSize ) { if( nBlockBufPos >= nBlockBufSize ) { - bEndOfBlock = TRUE; + bEndOfBlock = sal_True; break; } - nInputBitsBuf |= ( (ULONG) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize; + nInputBitsBuf |= ( (sal_uIntPtr) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize; nInputBitsBufSize += 8; } if ( !bEndOfBlock ) { // Einen Code aus dem Eingabe-Buffer holen: - nCode = sal::static_int_cast< USHORT >( - ( (USHORT) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) )); + nCode = sal::static_int_cast< sal_uInt16 >( + ( (sal_uInt16) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) )); nInputBitsBuf >>= nCodeSize; nInputBitsBufSize = nInputBitsBufSize - nCodeSize; @@ -191,9 +191,9 @@ BOOL GIFLZWDecompressor::ProcessOneCode() nOutBufDataLen = 0; } else - bEOIFound = TRUE; + bEOIFound = sal_True; - return TRUE; + return sal_True; } nOldCode = nCode; @@ -208,7 +208,7 @@ BOOL GIFLZWDecompressor::ProcessOneCode() } while( pE ); - bRet = TRUE; + bRet = sal_True; } return bRet; diff --git a/svtools/source/filter.vcl/igif/decode.hxx b/svtools/source/filter.vcl/igif/decode.hxx index 3c6a61e7508d..91b3a59a0243 100644 --- a/svtools/source/filter.vcl/igif/decode.hxx +++ b/svtools/source/filter.vcl/igif/decode.hxx @@ -40,29 +40,29 @@ class GIFLZWDecompressor HPBYTE pOutBuf; HPBYTE pOutBufData; HPBYTE pBlockBuf; - ULONG nInputBitsBuf; - USHORT nTableSize; - USHORT nClearCode; - USHORT nEOICode; - USHORT nCodeSize; - USHORT nOldCode; - USHORT nOutBufDataLen; - USHORT nInputBitsBufSize; - BOOL bEOIFound; - BYTE nDataSize; - BYTE nBlockBufSize; - BYTE nBlockBufPos; + sal_uIntPtr nInputBitsBuf; + sal_uInt16 nTableSize; + sal_uInt16 nClearCode; + sal_uInt16 nEOICode; + sal_uInt16 nCodeSize; + sal_uInt16 nOldCode; + sal_uInt16 nOutBufDataLen; + sal_uInt16 nInputBitsBufSize; + sal_Bool bEOIFound; + sal_uInt8 nDataSize; + sal_uInt8 nBlockBufSize; + sal_uInt8 nBlockBufPos; - void AddToTable(USHORT nPrevCode, USHORT nCodeFirstData); - BOOL ProcessOneCode(); + void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData); + sal_Bool ProcessOneCode(); public: - GIFLZWDecompressor( BYTE cDataSize ); + GIFLZWDecompressor( sal_uInt8 cDataSize ); ~GIFLZWDecompressor(); - HPBYTE DecompressBlock( HPBYTE pSrc, BYTE cBufSize, ULONG& rCount, BOOL& rEOI ); + HPBYTE DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, sal_uIntPtr& rCount, sal_Bool& rEOI ); }; #endif diff --git a/svtools/source/filter.vcl/igif/gifread.cxx b/svtools/source/filter.vcl/igif/gifread.cxx index e4020c727ff4..84c6e4b251cb 100644 --- a/svtools/source/filter.vcl/igif/gifread.cxx +++ b/svtools/source/filter.vcl/igif/gifread.cxx @@ -54,11 +54,11 @@ GIFReader::GIFReader( SvStream& rStm ) : nLogHeight100 ( 0UL ), nLoops ( 1 ), eActAction ( GLOBAL_HEADER_READING ), - bGCTransparent ( FALSE ), - bImGraphicReady ( FALSE ) + bGCTransparent ( sal_False ), + bImGraphicReady ( sal_False ) { maUpperName = UniString::CreateFromAscii( "SVIGIF", 6 ); - pSrcBuf = new BYTE[ 256 ]; + pSrcBuf = new sal_uInt8[ 256 ]; ClearImageExtensions(); } @@ -82,14 +82,14 @@ GIFReader::~GIFReader() void GIFReader::ClearImageExtensions() { nGCDisposalMethod = 0; - bGCTransparent = FALSE; + bGCTransparent = sal_False; nTimer = 0; } // ------------------------------------------------------------------------ -BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, - BOOL bWatchForBackgroundColor ) +sal_Bool GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, + sal_Bool bWatchForBackgroundColor ) { const Size aSize( nWidth, nHeight ); @@ -106,11 +106,11 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, if( pAcc1 ) { - cTransIndex1 = (BYTE) pAcc1->GetBestPaletteIndex( aWhite ); + cTransIndex1 = (sal_uInt8) pAcc1->GetBestPaletteIndex( aWhite ); cNonTransIndex1 = cTransIndex1 ? 0 : 1; } else - bStatus = FALSE; + bStatus = sal_False; } if( bStatus ) @@ -131,12 +131,12 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, // ------------------------------------------------------------------------ -BOOL GIFReader::ReadGlobalHeader() +sal_Bool GIFReader::ReadGlobalHeader() { char pBuf[ 7 ]; - BYTE nRF; - BYTE nAspect; - BOOL bRet = FALSE; + sal_uInt8 nRF; + sal_uInt8 nAspect; + sal_Bool bRet = sal_False; rIStm.Read( pBuf, 6 ); if( NO_PENDING( rIStm ) ) @@ -149,14 +149,14 @@ BOOL GIFReader::ReadGlobalHeader() { SvMemoryStream aMemStm; - aMemStm.SetBuffer( pBuf, 7, FALSE, 7 ); + aMemStm.SetBuffer( pBuf, 7, sal_False, 7 ); aMemStm >> nGlobalWidth; aMemStm >> nGlobalHeight; aMemStm >> nRF; aMemStm >> nBackgroundColor; aMemStm >> nAspect; - bGlobalPalette = (BOOL) ( nRF & 0x80 ); + bGlobalPalette = (sal_Bool) ( nRF & 0x80 ); if( bGlobalPalette ) ReadPaletteEntries( &aGPalette, 1 << ( ( nRF & 7 ) + 1 ) ); @@ -164,11 +164,11 @@ BOOL GIFReader::ReadGlobalHeader() nBackgroundColor = 0; if( NO_PENDING( rIStm ) ) - bRet = TRUE; + bRet = sal_True; } } else - bStatus = FALSE; + bStatus = sal_False; } return bRet; @@ -176,19 +176,19 @@ BOOL GIFReader::ReadGlobalHeader() // ------------------------------------------------------------------------ -void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ) +void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uIntPtr nCount ) { - const ULONG nLen = 3UL * nCount; - BYTE* pBuf = new BYTE[ nLen ]; + const sal_uIntPtr nLen = 3UL * nCount; + sal_uInt8* pBuf = new sal_uInt8[ nLen ]; rIStm.Read( pBuf, nLen ); if( NO_PENDING( rIStm ) ) { - BYTE* pTmp = pBuf; + sal_uInt8* pTmp = pBuf; - for( ULONG i = 0UL; i < nCount; ) + for( sal_uIntPtr i = 0UL; i < nCount; ) { - BitmapColor& rColor = (*pPal)[ (USHORT) i++ ]; + BitmapColor& rColor = (*pPal)[ (sal_uInt16) i++ ]; rColor.SetRed( *pTmp++ ); rColor.SetGreen( *pTmp++ ); @@ -210,13 +210,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ) // ------------------------------------------------------------------------ -BOOL GIFReader::ReadExtension() +sal_Bool GIFReader::ReadExtension() { - BYTE cFunction; - BYTE cSize; - BYTE cByte; - BOOL bRet = FALSE; - BOOL bOverreadDataBlocks = FALSE; + sal_uInt8 cFunction; + sal_uInt8 cSize; + sal_uInt8 cByte; + sal_Bool bRet = sal_False; + sal_Bool bOverreadDataBlocks = sal_False; // Extension-Label rIStm >> cFunction; @@ -230,7 +230,7 @@ BOOL GIFReader::ReadExtension() // 'Graphic Control Extension' case( 0xf9 ) : { - BYTE cFlags; + sal_uInt8 cFlags; rIStm >> cFlags; rIStm >> nTimer; @@ -240,9 +240,9 @@ BOOL GIFReader::ReadExtension() if ( NO_PENDING( rIStm ) ) { nGCDisposalMethod = ( cFlags >> 2) & 7; - bGCTransparent = ( cFlags & 1 ) ? TRUE : FALSE; + bGCTransparent = ( cFlags & 1 ) ? sal_True : sal_False; bStatus = ( cSize == 4 ) && ( cByte == 0 ); - bRet = TRUE; + bRet = sal_True; } } break; @@ -253,7 +253,7 @@ BOOL GIFReader::ReadExtension() if ( NO_PENDING( rIStm ) ) { // default diese Extension ueberlesen - bOverreadDataBlocks = TRUE; + bOverreadDataBlocks = sal_True; // Appl.-Extension hat Laenge 11 if ( cSize == 0x0b ) @@ -276,12 +276,12 @@ BOOL GIFReader::ReadExtension() rIStm >> cByte; nLoops = cByte; rIStm >> cByte; - nLoops |= ( (USHORT) cByte << 8 ); + nLoops |= ( (sal_uInt16) cByte << 8 ); rIStm >> cByte; bStatus = ( cByte == 0 ); bRet = NO_PENDING( rIStm ); - bOverreadDataBlocks = FALSE; + bOverreadDataBlocks = sal_False; // Netscape interpretiert den LoopCount // als reine Anzahl der _Wiederholungen_; @@ -304,7 +304,7 @@ BOOL GIFReader::ReadExtension() rIStm >> cByte; bStatus = ( cByte == 0 ); bRet = NO_PENDING( rIStm ); - bOverreadDataBlocks = FALSE; + bOverreadDataBlocks = sal_False; } else rIStm.SeekRel( -1 ); @@ -317,25 +317,25 @@ BOOL GIFReader::ReadExtension() // alles andere ueberlesen default: - bOverreadDataBlocks = TRUE; + bOverreadDataBlocks = sal_True; break; } // Sub-Blocks ueberlesen if ( bOverreadDataBlocks ) { - bRet = TRUE; + bRet = sal_True; while( cSize && bStatus && !rIStm.IsEof() ) { - USHORT nCount = (USHORT) cSize + 1; + sal_uInt16 nCount = (sal_uInt16) cSize + 1; char* pBuffer = new char[ nCount ]; - bRet = FALSE; + bRet = sal_False; rIStm.Read( pBuffer, nCount ); if( NO_PENDING( rIStm ) ) { - cSize = (BYTE) pBuffer[ cSize ]; - bRet = TRUE; + cSize = (sal_uInt8) pBuffer[ cSize ]; + bRet = sal_True; } else cSize = 0; @@ -350,19 +350,19 @@ BOOL GIFReader::ReadExtension() // ------------------------------------------------------------------------ -BOOL GIFReader::ReadLocalHeader() +sal_Bool GIFReader::ReadLocalHeader() { - BYTE pBuf[ 9 ]; - BOOL bRet = FALSE; + sal_uInt8 pBuf[ 9 ]; + sal_Bool bRet = sal_False; rIStm.Read( pBuf, 9 ); if( NO_PENDING( rIStm ) ) { SvMemoryStream aMemStm; BitmapPalette* pPal; - BYTE nFlags; + sal_uInt8 nFlags; - aMemStm.SetBuffer( (char*) pBuf, 9, FALSE, 9 ); + aMemStm.SetBuffer( (char*) pBuf, 9, sal_False, 9 ); aMemStm >> nImagePosX; aMemStm >> nImagePosY; aMemStm >> nImageWidth; @@ -390,7 +390,7 @@ BOOL GIFReader::ReadLocalHeader() if( NO_PENDING( rIStm ) ) { CreateBitmaps( nImageWidth, nImageHeight, pPal, bGlobalPalette && ( pPal == &aGPalette ) ); - bRet = TRUE; + bRet = sal_True; } } @@ -399,11 +399,11 @@ BOOL GIFReader::ReadLocalHeader() // ------------------------------------------------------------------------ -ULONG GIFReader::ReadNextBlock() +sal_uIntPtr GIFReader::ReadNextBlock() { - ULONG nRet = 0UL; - ULONG nRead; - BYTE cBlockSize; + sal_uIntPtr nRet = 0UL; + sal_uIntPtr nRead; + sal_uInt8 cBlockSize; rIStm >> cBlockSize; @@ -423,7 +423,7 @@ ULONG GIFReader::ReadNextBlock() nRet = 3UL; else { - BOOL bEOI; + sal_Bool bEOI; HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI ); nRet = ( bEOI ? 3 : 1 ); @@ -442,9 +442,9 @@ ULONG GIFReader::ReadNextBlock() // ------------------------------------------------------------------------ -void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) +void GIFReader::FillImages( HPBYTE pBytes, sal_uIntPtr nCount ) { - for( ULONG i = 0UL; i < nCount; i++ ) + for( sal_uIntPtr i = 0UL; i < nCount; i++ ) { if( nImageX >= nImageWidth ) { @@ -463,9 +463,9 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) ) { HPBYTE pScanline8 = pAcc8->GetScanline( nYAcc ); - ULONG nSize8 = pAcc8->GetScanlineSize(); + sal_uIntPtr nSize8 = pAcc8->GetScanlineSize(); HPBYTE pScanline1 = 0; - ULONG nSize1 = 0; + sal_uIntPtr nSize1 = 0; if( bGCTransparent ) { @@ -507,7 +507,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) } } - nLastImageY = (USHORT) nT1; + nLastImageY = (sal_uInt16) nT1; nYAcc = nT1; } else @@ -522,7 +522,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) if( nImageY < nImageHeight ) { - const BYTE cTmp = pBytes[ i ]; + const sal_uInt8 cTmp = pBytes[ i ]; if( bGCTransparent ) { @@ -539,7 +539,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount ) } else { - bOverreadBlock = TRUE; + bOverreadBlock = sal_True; break; } } @@ -566,7 +566,7 @@ void GIFReader::CreateNewBitmaps() aAnimBmp.aPosPix = Point( nImagePosX, nImagePosY ); aAnimBmp.aSizePix = Size( nImageWidth, nImageHeight ); aAnimBmp.nWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK; - aAnimBmp.bUserInput = FALSE; + aAnimBmp.bUserInput = sal_False; if( nGCDisposalMethod == 2 ) aAnimBmp.eDisposal = DISPOSE_BACK; @@ -617,10 +617,10 @@ const Graphic& GIFReader::GetIntermediateGraphic() // ------------------------------------------------------------------------ -BOOL GIFReader::ProcessGIF() +sal_Bool GIFReader::ProcessGIF() { - BOOL bRead = FALSE; - BOOL bEnd = FALSE; + sal_Bool bRead = sal_False; + sal_Bool bEnd = sal_False; if ( !bStatus ) eActAction = ABORT_READING; @@ -633,7 +633,7 @@ BOOL GIFReader::ProcessGIF() // naechsten Marker lesen case( MARKER_READING ): { - BYTE cByte; + sal_uInt8 cByte; rIStm >> cByte; @@ -641,7 +641,7 @@ BOOL GIFReader::ProcessGIF() eActAction = END_READING; else if( NO_PENDING( rIStm ) ) { - bRead = TRUE; + bRead = sal_True; if( cByte == '!' ) eActAction = EXTENSION_READING; @@ -658,7 +658,7 @@ BOOL GIFReader::ProcessGIF() // ScreenDescriptor lesen case( GLOBAL_HEADER_READING ): { - if( ( bRead = ReadGlobalHeader() ) == TRUE ) + if( ( bRead = ReadGlobalHeader() ) == sal_True ) { ClearImageExtensions(); eActAction = MARKER_READING; @@ -670,7 +670,7 @@ BOOL GIFReader::ProcessGIF() // Extension lesen case( EXTENSION_READING ): { - if( ( bRead = ReadExtension() ) == TRUE ) + if( ( bRead = ReadExtension() ) == sal_True ) eActAction = MARKER_READING; } break; @@ -679,7 +679,7 @@ BOOL GIFReader::ProcessGIF() // Image-Descriptor lesen case( LOCAL_HEADER_READING ): { - if( ( bRead = ReadLocalHeader() ) == TRUE ) + if( ( bRead = ReadLocalHeader() ) == sal_True ) { nYAcc = nImageX = nImageY = 0; eActAction = FIRST_BLOCK_READING; @@ -691,20 +691,20 @@ BOOL GIFReader::ProcessGIF() // ersten Datenblock lesen case( FIRST_BLOCK_READING ): { - BYTE cDataSize; + sal_uInt8 cDataSize; rIStm >> cDataSize; if( rIStm.IsEof() ) eActAction = ABORT_READING; else if( cDataSize > 12 ) - bStatus = FALSE; + bStatus = sal_False; else if( NO_PENDING( rIStm ) ) { - bRead = TRUE; + bRead = sal_True; pDecomp = new GIFLZWDecompressor( cDataSize ); eActAction = NEXT_BLOCK_READING; - bOverreadBlock = FALSE; + bOverreadBlock = sal_False; } else eActAction = FIRST_BLOCK_READING; @@ -714,20 +714,20 @@ BOOL GIFReader::ProcessGIF() // naechsten Datenblock lesen case( NEXT_BLOCK_READING ): { - USHORT nLastX = nImageX; - USHORT nLastY = nImageY; - ULONG nRet = ReadNextBlock(); + sal_uInt16 nLastX = nImageX; + sal_uInt16 nLastY = nImageY; + sal_uIntPtr nRet = ReadNextBlock(); // Return: 0:Pending / 1:OK; / 2:OK und letzter Block: / 3:EOI / 4:HardAbort if( nRet ) { - bRead = TRUE; + bRead = sal_True; if ( nRet == 1UL ) { - bImGraphicReady = TRUE; + bImGraphicReady = sal_True; eActAction = NEXT_BLOCK_READING; - bOverreadBlock = FALSE; + bOverreadBlock = sal_False; } else { @@ -741,7 +741,7 @@ BOOL GIFReader::ProcessGIF() else if( nRet == 3UL ) { eActAction = NEXT_BLOCK_READING; - bOverreadBlock = TRUE; + bOverreadBlock = sal_True; } else { @@ -763,7 +763,7 @@ BOOL GIFReader::ProcessGIF() // ein Fehler trat auf case( ABORT_READING ): { - bEnd = TRUE; + bEnd = sal_True; eActAction = END_READING; } break; @@ -787,7 +787,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) { ReadState eReadState; - bStatus = TRUE; + bStatus = sal_True; while( ProcessGIF() && ( eActAction != END_READING ) ) {} @@ -824,12 +824,12 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) // - ImportGIF - // ------------- -BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic ) +sal_Bool ImportGIF( SvStream & rStm, Graphic& rGraphic ) { GIFReader* pGIFReader = (GIFReader*) rGraphic.GetContext(); - USHORT nOldFormat = rStm.GetNumberFormatInt(); + sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -841,7 +841,7 @@ BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic ) if( eReadState == GIFREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pGIFReader; } else if( eReadState == GIFREAD_OK ) diff --git a/svtools/source/filter.vcl/ixbm/xbmread.cxx b/svtools/source/filter.vcl/ixbm/xbmread.cxx index 9c7faaafa88c..5084f7267e46 100644 --- a/svtools/source/filter.vcl/ixbm/xbmread.cxx +++ b/svtools/source/filter.vcl/ixbm/xbmread.cxx @@ -44,7 +44,7 @@ XBMReader::XBMReader( SvStream& rStm ) : nLastPos ( rStm.Tell() ), nWidth ( 0 ), nHeight ( 0 ), - bStatus ( TRUE ) + bStatus ( sal_True ) { pHexTable = new short[ 256 ]; maUpperName = String::CreateFromAscii( "SVIXBM", 6 ); @@ -109,7 +109,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1, long nPos2; long nPos3; - bStatus = FALSE; + bStatus = sal_False; do { @@ -120,23 +120,23 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1, { if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND ) { - bStatus = TRUE; + bStatus = sal_True; if( pTok2 ) { - bStatus = FALSE; + bStatus = sal_False; if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) && ( nPos2 > nPos1 ) ) { - bStatus = TRUE; + bStatus = sal_True; if( pTok3 ) { - bStatus = FALSE; + bStatus = sal_False; if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) ) - bStatus = TRUE; + bStatus = sal_True; } } } @@ -199,16 +199,16 @@ long XBMReader::ParseDefine( const sal_Char* pDefine ) // ------------------------------------------------------------------------ -BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ) +sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ) { ByteString aLine; long nRow = 0; long nCol = 0; long nBits = ( eFormat == XBM10 ) ? 16 : 8; long nBit; - USHORT nValue; - USHORT nDigits; - BOOL bFirstLine = TRUE; + sal_uInt16 nValue; + sal_uInt16 nDigits; + sal_Bool bFirstLine = sal_True; while( nRow < nHeight ) { @@ -220,20 +220,20 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND ) aLine.Erase( 0, nPos + 1 ); - bFirstLine = FALSE; + bFirstLine = sal_False; } else if( !pInStm->ReadLine( aLine ) ) break; if( aLine.Len() ) { - const USHORT nCount = aLine.GetTokenCount( ',' ); + const sal_uInt16 nCount = aLine.GetTokenCount( ',' ); - for( USHORT i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ ) + for( sal_uInt16 i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ ) { const ByteString aToken( aLine.GetToken( i, ',' ) ); const xub_StrLen nLen = aToken.Len(); - BOOL bProcessed = FALSE; + sal_Bool bProcessed = sal_False; nBit = nDigits = nValue = 0; @@ -246,11 +246,11 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor { nValue = ( nValue << 4 ) + nTable; nDigits++; - bProcessed = TRUE; + bProcessed = sal_True; } else if( ( nTable < 0 ) && nDigits ) { - bProcessed = TRUE; + bProcessed = sal_True; break; } } @@ -267,7 +267,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor } } - return TRUE; + return sal_True; } // ------------------------------------------------------------------------ @@ -275,7 +275,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor ReadState XBMReader::ReadXBM( Graphic& rGraphic ) { ReadState eReadState; - BYTE cDummy; + sal_uInt8 cDummy; // sehen, ob wir _alles_ lesen koennen rIStm.Seek( STREAM_SEEK_TO_END ); @@ -289,7 +289,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) int nValue; rIStm.Seek( nLastPos ); - bStatus = FALSE; + bStatus = sal_False; aLine = FindTokenLine( &rIStm, "#define", "_width" ); if ( bStatus ) @@ -308,7 +308,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) } } else - bStatus = FALSE; + bStatus = sal_False; if ( bStatus ) { @@ -326,7 +326,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) else if ( aLine.Search( "char" ) != STRING_NOTFOUND ) eFormat = XBM11; else - bStatus = FALSE; + bStatus = sal_False; if ( bStatus && nWidth && nHeight ) { @@ -340,7 +340,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) bStatus = ParseData( &rIStm, aLine, eFormat ); } else - bStatus = FALSE; + bStatus = sal_False; } } } @@ -372,11 +372,11 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) // - ImportXBM - // ------------- -BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic ) +sal_Bool ImportXBM( SvStream& rStm, Graphic& rGraphic ) { XBMReader* pXBMReader = (XBMReader*) rGraphic.GetContext(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( !pXBMReader ) pXBMReader = new XBMReader( rStm ); @@ -386,7 +386,7 @@ BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic ) if( eReadState == XBMREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pXBMReader; } else if( eReadState == XBMREAD_OK ) diff --git a/svtools/source/filter.vcl/ixpm/rgbtable.hxx b/svtools/source/filter.vcl/ixpm/rgbtable.hxx index afdab883b369..054e1e86b064 100644 --- a/svtools/source/filter.vcl/ixpm/rgbtable.hxx +++ b/svtools/source/filter.vcl/ixpm/rgbtable.hxx @@ -28,9 +28,9 @@ struct XPMRGBTab { const char* name; - BYTE red; - BYTE green; - BYTE blue; + sal_uInt8 red; + sal_uInt8 green; + sal_uInt8 blue; }; static XPMRGBTab pRGBTable[] = { diff --git a/svtools/source/filter.vcl/ixpm/xpmread.cxx b/svtools/source/filter.vcl/ixpm/xpmread.cxx index 7575c94e3ed9..b84b5fdc7545 100644 --- a/svtools/source/filter.vcl/ixpm/xpmread.cxx +++ b/svtools/source/filter.vcl/ixpm/xpmread.cxx @@ -51,8 +51,8 @@ XPMReader::XPMReader( SvStream& rStm ) : mnHeight ( 0 ), mnColors ( 0 ), mnCpp ( 0 ), - mbTransparent ( FALSE ), - mbStatus ( TRUE ), + mbTransparent ( sal_False ), + mbStatus ( sal_True ), mnStatus ( 0 ), mnIdentifier ( XPMIDENTIFIER ), mcThisByte ( 0 ), @@ -80,7 +80,7 @@ XPMReader::~XPMReader() ReadState XPMReader::ReadXPM( Graphic& rGraphic ) { ReadState eReadState; - BYTE cDummy; + sal_uInt8 cDummy; // sehen, ob wir _alles_ lesen koennen mrIStm.Seek( STREAM_SEEK_TO_END ); @@ -91,14 +91,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) if ( mrIStm.GetError() != ERRCODE_IO_PENDING ) { mrIStm.Seek( mnLastPos ); - mbStatus = TRUE; + mbStatus = sal_True; if ( mbStatus ) { - mpStringBuf = new BYTE [ XPMSTRINGBUF ]; - mpTempBuf = new BYTE [ XPMTEMPBUFSIZE ]; + mpStringBuf = new sal_uInt8 [ XPMSTRINGBUF ]; + mpTempBuf = new sal_uInt8 [ XPMTEMPBUFSIZE ]; - if ( ( mbStatus = ImplGetString() ) == TRUE ) + if ( ( mbStatus = ImplGetString() ) == sal_True ) { mnIdentifier = XPMVALUES; // Bitmap informationen einholen mnWidth = ImplGetULONG( 0 ); @@ -118,14 +118,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) // Farbe: ( mnCpp )Byte(s)-> ASCII Eintrag der der Farbe zugeordnet ist // 1 Byte -> 0xff wenn Farbe transparent ist // 3 Bytes -> RGB Wert der Farbe - mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ]; + mpColMap = new sal_uInt8[ mnColors * ( 4 + mnCpp ) ]; if ( mpColMap ) { - for ( ULONG i = 0; i < mnColors; i++ ) + for ( sal_uIntPtr i = 0; i < mnColors; i++ ) { - if ( ImplGetColor( i ) == FALSE ) + if ( ImplGetColor( i ) == sal_False ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } } @@ -149,35 +149,35 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) maBmp = Bitmap( Size( mnWidth, mnHeight ), nBits ); mpAcc = maBmp.AcquireWriteAccess(); - // mbTransparent ist TRUE wenn mindestens eine Farbe Transparent ist + // mbTransparent ist sal_True wenn mindestens eine Farbe Transparent ist if ( mbTransparent ) { maMaskBmp = Bitmap( Size( mnWidth, mnHeight ), 1 ); if ( ( mpMaskAcc = maMaskBmp.AcquireWriteAccess() ) == NULL ) - mbStatus = FALSE; + mbStatus = sal_False; } if( mpAcc && mbStatus ) { - ULONG i; + sal_uIntPtr i; if ( mnColors <=256 ) // palette is only needed by using less than 257 { // colors - BYTE* pPtr = &mpColMap[mnCpp]; + sal_uInt8* pPtr = &mpColMap[mnCpp]; for ( i = 0; i < mnColors; i++ ) { - mpAcc->SetPaletteColor( (BYTE)i, Color( pPtr[1], pPtr[2], pPtr[3] ) ); + mpAcc->SetPaletteColor( (sal_uInt8)i, Color( pPtr[1], pPtr[2], pPtr[3] ) ); pPtr += ( mnCpp + 4 ); } // using 2 charakters per pixel and less than 257 Colors we speed up if ( mnCpp == 2 ) // by using a 64kb indexing table { - mpFastColorTable = new BYTE[ 256 * 256 ]; + mpFastColorTable = new sal_uInt8[ 256 * 256 ]; for ( pPtr = mpColMap, i = 0; i < mnColors; i++, pPtr += mnCpp + 4 ) { - ULONG j = pPtr[ 0 ] << 8; + sal_uIntPtr j = pPtr[ 0 ] << 8; j += pPtr[ 1 ]; - mpFastColorTable[ j ] = (BYTE)i; + mpFastColorTable[ j ] = (sal_uInt8)i; } } } @@ -185,9 +185,9 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) mnIdentifier = XPMPIXELS; for ( i = 0; i < mnHeight; i++ ) { - if ( ImplGetScanLine( i ) == FALSE ) + if ( ImplGetScanLine( i ) == sal_False ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } } @@ -238,17 +238,17 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) // ------------------------------------------------------------------------ // ImplGetColor ermittelt saemtliche Farbwerte, -// die Rueckgabe ist TRUE wenn saemtliche Farben zugeordnet werden konnten +// die Rueckgabe ist sal_True wenn saemtliche Farben zugeordnet werden konnten -BOOL XPMReader::ImplGetColor( ULONG nNumb ) +sal_Bool XPMReader::ImplGetColor( sal_uIntPtr nNumb ) { - BYTE* pString = mpStringBuf; - BYTE* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) ); - BOOL bStatus = ImplGetString(); + sal_uInt8* pString = mpStringBuf; + sal_uInt8* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) ); + sal_Bool bStatus = ImplGetString(); if ( bStatus ) { - for ( ULONG i = 0; i < mnCpp; i++ ) + for ( sal_uIntPtr i = 0; i < mnCpp; i++ ) *pPtr++ = *pString++; bStatus = ImplGetColSub ( pPtr ); } @@ -259,11 +259,11 @@ BOOL XPMReader::ImplGetColor( ULONG nNumb ) // ImpGetScanLine liest den String mpBufSize aus und schreibt die Pixel in die // Bitmap. Der Parameter nY gibt die horizontale Position an. -BOOL XPMReader::ImplGetScanLine( ULONG nY ) +sal_Bool XPMReader::ImplGetScanLine( sal_uIntPtr nY ) { - BOOL bStatus = ImplGetString(); - BYTE* pString = mpStringBuf; - BYTE* pColor; + sal_Bool bStatus = ImplGetString(); + sal_uInt8* pString = mpStringBuf; + sal_uInt8* pColor; BitmapColor aWhite; BitmapColor aBlack; @@ -275,18 +275,18 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY ) aBlack = mpMaskAcc->GetBestMatchingColor( Color( COL_BLACK ) ); } if ( mnStringSize != ( mnWidth * mnCpp )) - bStatus = FALSE; + bStatus = sal_False; else { - ULONG i, j; + sal_uIntPtr i, j; if ( mpFastColorTable ) { for ( i = 0; i < mnWidth; i++ ) { j = (*pString++) << 8; j += *pString++; - BYTE k = (BYTE)mpFastColorTable[ j ]; - mpAcc->SetPixel( nY, i, BitmapColor( (BYTE)k ) ); + sal_uInt8 k = (sal_uInt8)mpFastColorTable[ j ]; + mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8)k ) ); if ( mpMaskAcc ) mpMaskAcc->SetPixel( nY, i, @@ -298,12 +298,12 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY ) pColor = mpColMap; for ( j = 0; j < mnColors; j++ ) { - if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == TRUE ) + if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == sal_True ) { if ( mnColors > 256 ) mpAcc->SetPixel( nY, i, Color ( pColor[3], pColor[4], pColor[5] ) ); else - mpAcc->SetPixel( nY, i, BitmapColor( (BYTE) j ) ); + mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8) j ) ); if ( mpMaskAcc ) mpMaskAcc->SetPixel( nY, i, ( @@ -326,11 +326,11 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY ) // wurde eine Farbe gefunden wird an pDest[1]..pDest[2] der RGB wert geschrieben // pDest[0] enthaelt 0xff wenn die Farbe transparent ist sonst 0 -BOOL XPMReader::ImplGetColSub( BYTE* pDest ) +sal_Bool XPMReader::ImplGetColSub( sal_uInt8* pDest ) { unsigned char cTransparent[] = "None"; - BOOL bColStatus = FALSE; + sal_Bool bColStatus = sal_False; if ( ImplGetColKey( 'c' ) || ImplGetColKey( 'm' ) || ImplGetColKey( 'g' ) ) { @@ -338,7 +338,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) if ( *mpPara == '#' ) { *pDest++ = 0; - bColStatus = TRUE; + bColStatus = sal_True; switch ( mnParaSize ) { case 25 : @@ -351,7 +351,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) ImplGetRGBHex ( pDest, 0 ); break; default: - bColStatus = FALSE; + bColStatus = sal_False; break; } } @@ -359,14 +359,14 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) else if ( ImplCompare( &cTransparent[0], mpPara, 4 )) { *pDest++ = 0xff; - bColStatus = TRUE; - mbTransparent = TRUE; + bColStatus = sal_True; + mbTransparent = sal_True; } // last we will try to get the colorname else if ( mnParaSize > 2 ) // name must enlarge the minimum size { - ULONG i = 0; - while ( TRUE ) + sal_uIntPtr i = 0; + while ( sal_True ) { if ( pRGBTable[ i ].name == NULL ) break; @@ -375,7 +375,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) if ( ImplCompare ( (unsigned char*)pRGBTable[ i ].name, mpPara, mnParaSize, XPMCASENONSENSITIVE ) ) { - bColStatus = TRUE; + bColStatus = sal_True; *pDest++ = 0; *pDest++ = pRGBTable[ i ].red; *pDest++ = pRGBTable[ i ].green; @@ -391,11 +391,11 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest ) // ------------------------------------------------------------------------ // ImplGetColKey durchsuch den String mpStringBuf nach einem Parameter 'nKey' -// und gibt einen BOOL zurueck. ( wenn TRUE werden mpPara und mnParaSize gesetzt ) +// und gibt einen sal_Bool zurueck. ( wenn sal_True werden mpPara und mnParaSize gesetzt ) -BOOL XPMReader::ImplGetColKey( BYTE nKey ) +sal_Bool XPMReader::ImplGetColKey( sal_uInt8 nKey ) { - BYTE nTemp, nPrev = ' '; + sal_uInt8 nTemp, nPrev = ' '; mpPara = mpStringBuf + mnCpp + 1; mnParaSize = 0; @@ -430,7 +430,7 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey ) } } } - return ( mnParaSize ) ? TRUE : FALSE; + return ( mnParaSize ) ? sal_True : sal_False; } // ------------------------------------------------------------------------ @@ -442,12 +442,12 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey ) // 6 : '#12345678abcdefab12345678' " " " " -void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd ) +void XPMReader::ImplGetRGBHex( sal_uInt8* pDest,sal_uIntPtr nAdd ) { - BYTE* pPtr = mpPara+1; - BYTE nHex, nTemp; + sal_uInt8* pPtr = mpPara+1; + sal_uInt8 nHex, nTemp; - for ( ULONG i = 0; i < 3; i++ ) + for ( sal_uIntPtr i = 0; i < 3; i++ ) { nHex = (*pPtr++) - '0'; if ( nHex > 9 ) @@ -459,24 +459,24 @@ void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd ) nHex = ( nHex << 4 ) + nTemp; pPtr += nAdd; - *pDest++ = (BYTE)nHex; + *pDest++ = (sal_uInt8)nHex; } } // ------------------------------------------------------------------------ // ImplGetUlong gibt den wert einer bis zu 6stelligen ASCII-Dezimalzahl zurueck. -ULONG XPMReader::ImplGetULONG( ULONG nPara ) +sal_uIntPtr XPMReader::ImplGetULONG( sal_uIntPtr nPara ) { if ( ImplGetPara ( nPara ) ) { - ULONG nRetValue = 0; - BYTE* pPtr = mpPara; + sal_uIntPtr nRetValue = 0; + sal_uInt8* pPtr = mpPara; if ( ( mnParaSize > 6 ) || ( mnParaSize == 0 ) ) return 0; - for ( ULONG i = 0; i < mnParaSize; i++ ) + for ( sal_uIntPtr i = 0; i < mnParaSize; i++ ) { - BYTE j = (*pPtr++) - 48; + sal_uInt8 j = (*pPtr++) - 48; if ( j > 9 ) return 0; // ascii is invalid nRetValue*=10; nRetValue+=j; @@ -488,28 +488,28 @@ ULONG XPMReader::ImplGetULONG( ULONG nPara ) // ------------------------------------------------------------------------ -BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMode ) +sal_Bool XPMReader::ImplCompare( sal_uInt8* pSource, sal_uInt8* pDest, sal_uIntPtr nSize, sal_uIntPtr nMode ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if ( nMode == XPMCASENONSENSITIVE ) { - for ( ULONG i = 0; i < nSize; i++ ) + for ( sal_uIntPtr i = 0; i < nSize; i++ ) { if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) ) { - bRet = FALSE; + bRet = sal_False; break; } } } else { - for ( ULONG i = 0; i < nSize; i++ ) + for ( sal_uIntPtr i = 0; i < nSize; i++ ) { if ( pSource[i] != pDest[i] ) { - bRet = FALSE; + bRet = sal_False; break; } } @@ -520,15 +520,15 @@ BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMod // ------------------------------------------------------------------------ // ImplGetPara versucht den nNumb ( 0...x ) Parameter aus mpStringBuf zu ermitteln. // Ein Parameter ist durch Spaces oder Tabs von den anderen getrennt. -// Konnte der Parameter gefunden werden ist der Rueckgabewert TRUE und mpPara + mnParaSize +// Konnte der Parameter gefunden werden ist der Rueckgabewert sal_True und mpPara + mnParaSize // werden gesetzt. -BOOL XPMReader::ImplGetPara ( ULONG nNumb ) +sal_Bool XPMReader::ImplGetPara ( sal_uIntPtr nNumb ) { - BYTE nByte; - ULONG pSize = 0; - BYTE* pPtr = mpStringBuf; - ULONG nCount = 0; + sal_uInt8 nByte; + sal_uIntPtr pSize = 0; + sal_uInt8* pPtr = mpStringBuf; + sal_uIntPtr nCount = 0; if ( ( *pPtr != ' ' ) && ( *pPtr != 0x09 ) ) { @@ -570,7 +570,7 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb ) pSize++; pPtr++; } - return ( ( nCount == nNumb ) && ( mpPara ) ) ? TRUE : FALSE; + return ( ( nCount == nNumb ) && ( mpPara ) ) ? sal_True : sal_False; } // ------------------------------------------------------------------------ @@ -578,10 +578,10 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb ) // mnStringSize enthaelt die Groesse des gelesenen Strings. // Bemerkungen wie '//' und '/*.....*/' werden uebersprungen. -BOOL XPMReader::ImplGetString( void ) +sal_Bool XPMReader::ImplGetString( void ) { - BYTE sID[] = "/* XPM */"; - BYTE* pString = mpStringBuf; + sal_uInt8 sID[] = "/* XPM */"; + sal_uInt8* pString = mpStringBuf; mnStringSize = 0; mpStringBuf[0] = 0; @@ -600,13 +600,13 @@ BOOL XPMReader::ImplGetString( void ) { if ( mnTempAvail <= 50 ) { - mbStatus = FALSE; // file is too short to be a correct XPM format + mbStatus = sal_False; // file is too short to be a correct XPM format break; } for ( int i = 0; i < 9; i++ ) // searching for "/* XPM */" if ( *mpTempPtr++ != sID[i] ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } mnTempAvail-=9; @@ -638,7 +638,7 @@ BOOL XPMReader::ImplGetString( void ) } if ( mnStringSize >= ( XPMSTRINGBUF - 1 ) ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } *pString++ = mcThisByte; @@ -676,11 +676,11 @@ BOOL XPMReader::ImplGetString( void ) // - ImportXPM - // ------------- -BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic ) +sal_Bool ImportXPM( SvStream& rStm, Graphic& rGraphic ) { XPMReader* pXPMReader = (XPMReader*) rGraphic.GetContext(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( !pXPMReader ) pXPMReader = new XPMReader( rStm ); @@ -690,7 +690,7 @@ BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic ) if( eReadState == XPMREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pXPMReader; } else if( eReadState == XPMREAD_OK ) diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx index a2de92171af3..d42fcb2b3c21 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.cxx +++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx @@ -125,7 +125,7 @@ extern "C" int empty_output_buffer (j_compress_ptr cinfo) dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = BUF_SIZE; - return TRUE; + return sal_True; } extern "C" void term_destination (j_compress_ptr cinfo) @@ -189,7 +189,7 @@ extern "C" void init_source (j_decompress_ptr cinfo) * but we don't clear the input buffer. * This is correct behavior for reading a series of images from one source. */ - src->start_of_file = TRUE; + src->start_of_file = sal_True; } long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize ) @@ -238,9 +238,9 @@ extern "C" int fill_input_buffer (j_decompress_ptr cinfo) src->pub.next_input_byte = src->buffer; src->pub.bytes_in_buffer = nbytes; - src->start_of_file = FALSE; + src->start_of_file = sal_False; - return TRUE; + return sal_True; } extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes) @@ -255,7 +255,7 @@ extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes) while (num_bytes > (long) src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; (void) fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, + /* note we assume that fill_input_buffer will never return sal_False, * so suspension need not be handled. */ } @@ -350,9 +350,9 @@ void* JPEGReader::CreateBitmap( void* pParam ) { BitmapPalette aGrayPal( 256 ); - for( USHORT n = 0; n < 256; n++ ) + for( sal_uInt16 n = 0; n < 256; n++ ) { - const BYTE cGray = (BYTE) n; + const sal_uInt8 cGray = (sal_uInt8) n; aGrayPal[ n ] = BitmapColor( cGray, cGray, cGray ); } @@ -386,7 +386,7 @@ void* JPEGReader::CreateBitmap( void* pParam ) { long nAlignedWidth; - const ULONG nFormat = pAcc->GetScanlineFormat(); + const sal_uIntPtr nFormat = pAcc->GetScanlineFormat(); if( ( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) || @@ -400,7 +400,7 @@ void* JPEGReader::CreateBitmap( void* pParam ) else { nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) ); - ((JPEGCreateBitmapParam*)pParam)->bTopDown = TRUE; + ((JPEGCreateBitmapParam*)pParam)->bTopDown = sal_True; pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * aSize.Height() ); } ((JPEGCreateBitmapParam*)pParam)->nAlignedWidth = nAlignedWidth; @@ -425,9 +425,9 @@ void JPEGReader::FillBitmap() { BitmapColor* pCols = new BitmapColor[ 256 ]; - for( USHORT n = 0; n < 256; n++ ) + for( sal_uInt16 n = 0; n < 256; n++ ) { - const BYTE cGray = (BYTE) n; + const sal_uInt8 cGray = (sal_uInt8) n; pCols[ n ] = pAcc->GetBestMatchingColor( BitmapColor( cGray, cGray, cGray ) ); } @@ -435,7 +435,7 @@ void JPEGReader::FillBitmap() for( long nY = 0L; nY < nHeight; nY++ ) { - pTmp = (BYTE*) pBuffer + nY * nAlignedWidth; + pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth; for( long nX = 0L; nX < nWidth; nX++ ) pAcc->SetPixel( nY, nX, pCols[ *pTmp++ ] ); @@ -449,7 +449,7 @@ void JPEGReader::FillBitmap() for( long nY = 0L; nY < nHeight; nY++ ) { - pTmp = (BYTE*) pBuffer + nY * nAlignedWidth; + pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth; for( long nX = 0L; nX < nWidth; nX++ ) { @@ -515,8 +515,8 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) long nEndPos; long nLines; ReadState eReadState; - BOOL bRet = FALSE; - BYTE cDummy; + sal_Bool bRet = sal_False; + sal_uInt8 cDummy; #if 1 // TODO: is it possible to get rid of this seek to the end? // check if the stream's end is already available @@ -562,10 +562,10 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) else rGraphic = aBmp; - bRet = TRUE; + bRet = sal_True; } else if( rIStm.GetError() == ERRCODE_IO_PENDING ) - bRet = TRUE; + bRet = sal_True; // Status setzen ( Pending hat immer Vorrang ) if( rIStm.GetError() == ERRCODE_IO_PENDING ) @@ -629,13 +629,13 @@ void* JPEGWriter::GetScanline( long nY ) { BitmapColor aColor; long nWidth = pAcc->Width(); - BYTE* pTmp = pBuffer; + sal_uInt8* pTmp = pBuffer; if( pAcc->HasPalette() ) { for( long nX = 0L; nX < nWidth; nX++ ) { - aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ); + aColor = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) ); *pTmp++ = aColor.GetRed(); if ( bGreys ) continue; @@ -665,9 +665,9 @@ void* JPEGWriter::GetScanline( long nY ) // ------------------------------------------------------------------------ -BOOL JPEGWriter::Write( const Graphic& rGraphic ) +sal_Bool JPEGWriter::Write( const Graphic& rGraphic ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( xStatusIndicator.is() ) { @@ -696,7 +696,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) BitmapColor aColor; for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ ) { - aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ) + aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) ) : pAcc->GetPixel( nY, nX ); bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() ); } @@ -713,11 +713,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); if( !bNative ) - pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ]; + pBuffer = new sal_uInt8[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ]; JPEGCallbackStruct aCallbackData; aCallbackData.xStatusIndicator = xStatusIndicator; - bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData ); + bRet = (sal_Bool) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData ); delete[] pBuffer; pBuffer = NULL; @@ -735,11 +735,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) // - ImportJPEG - // -------------- -BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ) +sal_Bool ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ) { JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext(); ReadState eReadState; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( !pJPEGReader ) pJPEGReader = new JPEGReader( rStm, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 ); @@ -754,7 +754,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 if( eReadState == JPEGREAD_ERROR ) { - bRet = FALSE; + bRet = sal_False; delete pJPEGReader; } else if( eReadState == JPEGREAD_OK ) @@ -769,7 +769,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 // - ExportJPEG - // -------------- -BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic, +sal_Bool ExportJPEG( SvStream& rOStm, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData, bool* pExportWasGrey ) diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h index deb06600474c..3d6b8cf234d0 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.h +++ b/svtools/source/filter.vcl/jpeg/jpeg.h @@ -50,7 +50,7 @@ struct JPEGCreateBitmapParam }; typedef struct my_error_mgr* my_error_ptr; -typedef unsigned char BYTE; +typedef unsigned char sal_uInt8; #ifdef WIN typedef unsigned char _huge* HPBYTE; #else diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c index 29b4749a7b51..8d3a82a86ef3 100644 --- a/svtools/source/filter.vcl/jpeg/jpegc.c +++ b/svtools/source/filter.vcl/jpeg/jpegc.c @@ -100,13 +100,13 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) jpeg_create_decompress( &cinfo ); bDecompCreated = 1; jpeg_svstream_src( &cinfo, pIStm ); - jpeg_read_header( &cinfo, TRUE ); + jpeg_read_header( &cinfo, sal_True ); cinfo.scale_num = 1; cinfo.scale_denom = 1; cinfo.output_gamma = 1.0; - cinfo.raw_data_out = FALSE; - cinfo.quantize_colors = FALSE; + cinfo.raw_data_out = sal_False; + cinfo.quantize_colors = sal_False; if ( cinfo.jpeg_color_space == JCS_YCbCr ) cinfo.out_color_space = JCS_RGB; else if ( cinfo.jpeg_color_space == JCS_YCCK ) @@ -138,8 +138,8 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) if( cinfo.scale_denom > 1 ) { cinfo.dct_method = JDCT_FASTEST; - cinfo.do_fancy_upsampling = FALSE; - cinfo.do_block_smoothing = FALSE; + cinfo.do_fancy_upsampling = sal_False; + cinfo.do_block_smoothing = sal_False; } } @@ -253,12 +253,12 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm, } jpeg_set_defaults( &cinfo ); - jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE ); + jpeg_set_quality( &cinfo, (int) nQualityPercent, sal_False ); if ( ( nWidth > 128 ) || ( nHeight > 128 ) ) jpeg_simple_progression( &cinfo ); - jpeg_start_compress( &cinfo, TRUE ); + jpeg_start_compress( &cinfo, sal_True ); for( nY = 0; nY < nHeight; nY++ ) { diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx index f31fd4439e9f..a2af40354879 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.cxx +++ b/svtools/source/filter.vcl/wmf/emfwr.cxx @@ -168,18 +168,18 @@ // - EMFWriter - // ------------- -BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pFilterConfigItem ) +sal_Bool EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pFilterConfigItem ) { - const ULONG nHeaderPos = rOStm.Tell(); + const sal_uIntPtr nHeaderPos = rOStm.Tell(); - mpHandlesUsed = new BOOL[ MAXHANDLES ]; - memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( BOOL ) ); + mpHandlesUsed = new sal_Bool[ MAXHANDLES ]; + memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( sal_Bool ) ); mnHorTextAlign = mnHandleCount = mnLastPercent = mnRecordPos = mnRecordCount = 0; mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID; - mbRecordOpen = FALSE; + mbRecordOpen = sal_False; mpStm = &rOStm; - maVDev.EnableOutput( FALSE ); + maVDev.EnableOutput( sal_False ); maVDev.SetMapMode( rMtf.GetPrefMapMode() ); mpFilterConfigItem = pFilterConfigItem; @@ -197,29 +197,29 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // set 100th mm map mode in EMF ImplBeginRecord( WIN_EMR_SETMAPMODE ); - (*mpStm) << (INT32) MM_ANISOTROPIC; + (*mpStm) << (sal_Int32) MM_ANISOTROPIC; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX ); - (*mpStm) << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY(); + (*mpStm) << (sal_Int32) maVDev.ImplGetDPIX() << (sal_Int32) maVDev.ImplGetDPIY(); ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX ); - (*mpStm) << (INT32) 2540 << (INT32) 2540; + (*mpStm) << (sal_Int32) 2540 << (sal_Int32) 2540; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0; ImplEndRecord(); ImplWriteRasterOp( ROP_OVERPAINT ); ImplBeginRecord( WIN_EMR_SETBKMODE ); - (*mpStm) << (UINT32) 1; // TRANSPARENT + (*mpStm) << (sal_uInt32) 1; // TRANSPARENT ImplEndRecord(); // write emf data @@ -233,17 +233,17 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // write header - const ULONG nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos ); - - (*mpStm) << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object - << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 ) - << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 ) - << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos ) - << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 - << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height() - << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 ) - << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 - << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object + const sal_uIntPtr nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos ); + + (*mpStm) << (sal_uInt32) 0x00000001 << (sal_uInt32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object + << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizePix.Width() - 1 ) << (sal_Int32) ( aMtfSizePix.Height() - 1 ) + << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizeLog.Width() - 1 ) << (sal_Int32) ( aMtfSizeLog.Height() - 1 ) + << (sal_uInt32) 0x464d4520 << (sal_uInt32) 0x10000 << (sal_uInt32) ( nEndPos - nHeaderPos ) + << (sal_uInt32) mnRecordCount << (sal_uInt16) ( mnHandleCount + 1 ) << (sal_uInt16) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 + << (sal_Int32) aMtfSizePix.Width() << (sal_Int32) aMtfSizePix.Height() + << (sal_Int32) ( aMtfSizeLog.Width() / 100 ) << (sal_Int32) ( aMtfSizeLog.Height() / 100 ) + << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 + << (sal_Int32) ( aMtfSizeLog.Width() * 10 ) << (sal_Int32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object mpStm->Seek( nEndPos ); delete[] mpHandlesUsed; @@ -253,15 +253,15 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // ----------------------------------------------------------------------------- -ULONG EMFWriter::ImplAcquireHandle() +sal_uIntPtr EMFWriter::ImplAcquireHandle() { - ULONG nHandle = HANDLE_INVALID; + sal_uIntPtr nHandle = HANDLE_INVALID; - for( ULONG i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ ) + for( sal_uIntPtr i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ ) { if( !mpHandlesUsed[ i ] ) { - mpHandlesUsed[ i ] = TRUE; + mpHandlesUsed[ i ] = sal_True; if( ( nHandle = i ) == mnHandleCount ) mnHandleCount++; @@ -274,10 +274,10 @@ ULONG EMFWriter::ImplAcquireHandle() // ----------------------------------------------------------------------------- -void EMFWriter::ImplReleaseHandle( ULONG nHandle ) +void EMFWriter::ImplReleaseHandle( sal_uIntPtr nHandle ) { DBG_ASSERT( nHandle && ( nHandle < MAXHANDLES ), "Handle out of range" ); - mpHandlesUsed[ nHandle - 1 ] = FALSE; + mpHandlesUsed[ nHandle - 1 ] = sal_False; } // ----------------------------------------------------------------------------- @@ -288,7 +288,7 @@ void EMFWriter::ImplBeginRecord( sal_uInt32 nType ) if( !mbRecordOpen ) { - mbRecordOpen = TRUE; + mbRecordOpen = sal_True; mnRecordPos = mpStm->Tell(); (*mpStm) << nType; @@ -315,17 +315,17 @@ void EMFWriter::ImplEndRecord() while( nFillBytes-- ) *mpStm << (sal_uInt8)0; mnRecordCount++; - mbRecordOpen = FALSE; + mbRecordOpen = sal_False; } } // ----------------------------------------------------------------------------- -BOOL EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType ) +sal_Bool EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uIntPtr nSelectType ) { if( rHandle != HANDLE_INVALID ) { - UINT32 nStockObject = 0x80000000; + sal_uInt32 nStockObject = 0x80000000; if( LINE_SELECT == nSelectType ) nStockObject |= 0x00000007; @@ -410,7 +410,7 @@ void EMFWriter::ImplCheckTextAttr() (*mpStm) << mnTextHandle; ImplWriteExtent( -rFont.GetSize().Height() ); ImplWriteExtent( rFont.GetSize().Width() ); - (*mpStm) << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation(); + (*mpStm) << (sal_Int32) rFont.GetOrientation() << (sal_Int32) rFont.GetOrientation(); switch( rFont.GetWeight() ) { @@ -428,11 +428,11 @@ void EMFWriter::ImplCheckTextAttr() } (*mpStm) << nWeight; - (*mpStm) << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 ); - (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; + (*mpStm) << (sal_uInt8) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 ); + (*mpStm) << (sal_uInt8) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 ); + (*mpStm) << (sal_uInt8) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 ); + (*mpStm) << (sal_uInt8) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 ); + (*mpStm) << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0; switch( rFont.GetPitch() ) { @@ -465,24 +465,24 @@ void EMFWriter::ImplCheckTextAttr() (*mpStm) << (sal_Unicode) 0; // dummy elfVersion, elfStyleSize, elfMatch, elfReserved - (*mpStm) << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ; + (*mpStm) << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 ; // dummy elfVendorId - (*mpStm) << (UINT32) 0; + (*mpStm) << (sal_uInt32) 0; // dummy elfCulture - (*mpStm) << (UINT32) 0; + (*mpStm) << (sal_uInt32) 0; // dummy elfPanose - (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; + (*mpStm) << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0; // fill record to get a record size divideable by 4 - (*mpStm) << (UINT16) 0; + (*mpStm) << (sal_uInt16) 0; ImplEndRecord(); // TextAlign - UINT32 nTextAlign; + sal_uInt32 nTextAlign; switch( rFont.GetAlign() ) { @@ -511,10 +511,10 @@ void EMFWriter::ImplCheckTextAttr() void EMFWriter::ImplWriteColor( const Color& rColor ) { - UINT32 nCol = rColor.GetRed(); + sal_uInt32 nCol = rColor.GetRed(); - nCol |= ( (UINT32) rColor.GetGreen() ) << 8; - nCol |= ( (UINT32) rColor.GetBlue() ) << 16; + nCol |= ( (sal_uInt32) rColor.GetGreen() ) << 8; + nCol |= ( (sal_uInt32) rColor.GetBlue() ) << 16; (*mpStm) << nCol; } @@ -523,7 +523,7 @@ void EMFWriter::ImplWriteColor( const Color& rColor ) void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) { - UINT32 nROP2; + sal_uInt32 nROP2; switch( eRop ) { @@ -542,7 +542,7 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) void EMFWriter::ImplWriteExtent( long nExtent ) { nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width(); - (*mpStm) << (INT32) nExtent; + (*mpStm) << (sal_Int32) nExtent; } // ----------------------------------------------------------------------------- @@ -550,7 +550,7 @@ void EMFWriter::ImplWriteExtent( long nExtent ) void EMFWriter::ImplWritePoint( const Point& rPoint ) { const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y(); + (*mpStm) << (sal_Int32) aPoint.X() << (sal_Int32) aPoint.Y(); } // ----------------------------------------------------------------------------- @@ -558,7 +558,7 @@ void EMFWriter::ImplWritePoint( const Point& rPoint ) void EMFWriter::ImplWriteSize( const Size& rSize) { const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << (INT32) aSize.Width() << (INT32) aSize.Height(); + (*mpStm) << (sal_Int32) aSize.Width() << (sal_Int32) aSize.Height(); } // ----------------------------------------------------------------------------- @@ -571,7 +571,7 @@ void EMFWriter::ImplWriteRect( const Rectangle& rRect ) // ----------------------------------------------------------------------------- -void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ) +void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose ) { if( rPoly.GetSize() ) { @@ -586,9 +586,9 @@ void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ) ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE ); ImplWriteRect( rPoly.GetBoundRect() ); - (*mpStm) << (UINT32) rPoly.GetSize(); + (*mpStm) << (sal_uInt32) rPoly.GetSize(); - for( USHORT i = 0; i < rPoly.GetSize(); i++ ) + for( sal_uInt16 i = 0; i < rPoly.GetSize(); i++ ) ImplWritePoint( rPoly[ i ] ); ImplEndRecord(); @@ -605,7 +605,7 @@ void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly ) if( nPolyCount ) { if( 1 == nPolyCount ) - ImplWritePolygonRecord( rPolyPoly[ 0 ], TRUE ); + ImplWritePolygonRecord( rPolyPoly[ 0 ], sal_True ); else { sal_Bool bHasFlags = sal_False; @@ -737,7 +737,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) // ----------------------------------------------------------------------------- void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, - const Size& rSz, UINT32 nROP ) + const Size& rSz, sal_uInt32 nROP ) { if( !!rBmp ) { @@ -747,19 +747,19 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, ImplBeginRecord( WIN_EMR_STRETCHDIBITS ); ImplWriteRect( Rectangle( rPt, rSz ) ); ImplWritePoint( rPt ); - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height(); + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) aBmpSizePixel.Width() << (sal_Int32) aBmpSizePixel.Height(); // write offset positions and sizes later - const ULONG nOffPos = mpStm->Tell(); + const sal_uIntPtr nOffPos = mpStm->Tell(); mpStm->SeekRel( 16 ); - (*mpStm) << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); + (*mpStm) << (sal_uInt32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); ImplWriteSize( rSz ); - rBmp.Write( aMemStm, TRUE, FALSE ); + rBmp.Write( aMemStm, sal_True, sal_False ); - UINT32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize; - UINT16 nBitCount; + sal_uInt32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize; + sal_uInt16 nBitCount; // get DIB parameters aMemStm.Seek( 0 ); @@ -769,15 +769,15 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, aMemStm.SeekRel( 8 ); aMemStm >> nColsUsed; - nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (UINT32) nBitCount ) ) : + nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (sal_uInt32) nBitCount ) ) : ( ( 3 == nCompression ) ? 12 : 0 ); mpStm->Write( aMemStm.GetData(), nDIBSize ); - const ULONG nEndPos = mpStm->Tell(); + const sal_uIntPtr nEndPos = mpStm->Tell(); mpStm->Seek( nOffPos ); - (*mpStm) << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) ); - (*mpStm) << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize; + (*mpStm) << (sal_uInt32) 80 << (sal_uInt32)( nHeaderSize + ( nPalCount << 2 ) ); + (*mpStm) << (sal_uInt32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize; mpStm->Seek( nEndPos ); ImplEndRecord(); @@ -827,12 +827,12 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons ImplBeginRecord( WIN_EMR_EXTTEXTOUTW ); ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) ); - (*mpStm) << (UINT32)1; - (*mpStm) << (INT32) 0 << (INT32) 0; + (*mpStm) << (sal_uInt32)1; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0; ImplWritePoint( rPos ); - (*mpStm) << (UINT32) nLen << (UINT32) 76 << (UINT32) 2; - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0; - (*mpStm) << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ); + (*mpStm) << (sal_uInt32) nLen << (sal_uInt32) 76 << (sal_uInt32) 2; + (*mpStm) << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0; + (*mpStm) << (sal_uInt32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ); // write text for( i = 0; i < nLen; i++ ) @@ -840,7 +840,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons // padding word if( nLen & 1 ) - (*mpStm) << (UINT16) 0; + (*mpStm) << (sal_uInt16) 0; // write DX array ImplWriteExtent( pDX[ 0 ] ); @@ -874,7 +874,7 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) { const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); - ImplWritePolygonRecord( Polygon(aCandidate), FALSE ); + ImplWritePolygonRecord( Polygon(aCandidate), sal_False ); } } @@ -902,10 +902,10 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { - for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ ) + for( sal_uIntPtr j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ ) { const MetaAction* pAction = rMtf.GetAction( j ); - const USHORT nType = pAction->GetType(); + const sal_uInt16 nType = pAction->GetType(); switch( nType ) { @@ -1073,7 +1073,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if(pA->GetLineInfo().IsDefault()) { - ImplWritePolygonRecord( rPoly, FALSE ); + ImplWritePolygonRecord( rPoly, sal_False ); } else { @@ -1156,7 +1156,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) const MetaEPSAction* pA = (const MetaEPSAction*) pAction; const GDIMetaFile aSubstitute( pA->GetSubstitute() ); - for( ULONG i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ ) + for( sal_uIntPtr i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ ) { const MetaAction* pSubstAct = aSubstitute.GetAction( i ); if( pSubstAct->GetType() == META_BMPSCALE_ACTION ) @@ -1175,7 +1175,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) maVDev.Pop(); ImplBeginRecord( WIN_EMR_RESTOREDC ); - (*mpStm) << (INT32) -1; + (*mpStm) << (sal_Int32) -1; ImplEndRecord(); break; } @@ -1306,14 +1306,14 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_LINECOLOR_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - mbLineChanged = TRUE; + mbLineChanged = sal_True; } break; case( META_FILLCOLOR_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - mbFillChanged = TRUE; + mbFillChanged = sal_True; } break; @@ -1324,7 +1324,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_FONT_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - mbTextChanged = TRUE; + mbTextChanged = sal_True; } break; @@ -1365,11 +1365,11 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) ( (MetaAction*) pAction )->Execute( &maVDev ); ImplBeginRecord( WIN_EMR_RESTOREDC ); - (*mpStm) << (INT32) -1; + (*mpStm) << (sal_Int32) -1; ImplEndRecord(); ImplWriteRasterOp( maVDev.GetRasterOp() ); - mbLineChanged = mbFillChanged = mbTextChanged = TRUE; + mbLineChanged = mbFillChanged = mbTextChanged = sal_True; } break; diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx index 6334b5dfe16f..3b785a6ab5d0 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.hxx +++ b/svtools/source/filter.vcl/wmf/emfwr.hxx @@ -50,27 +50,27 @@ private: MapMode maDestMapMode; FilterConfigItem* mpFilterConfigItem; SvStream* mpStm; - BOOL* mpHandlesUsed; - ULONG mnHandleCount; - ULONG mnLastPercent; - ULONG mnRecordCount; - ULONG mnRecordPos; - BOOL mbRecordOpen; - BOOL mbLineChanged; + sal_Bool* mpHandlesUsed; + sal_uIntPtr mnHandleCount; + sal_uIntPtr mnLastPercent; + sal_uIntPtr mnRecordCount; + sal_uIntPtr mnRecordPos; + sal_Bool mbRecordOpen; + sal_Bool mbLineChanged; sal_uInt32 mnLineHandle; - BOOL mbFillChanged; + sal_Bool mbFillChanged; sal_uInt32 mnFillHandle; - BOOL mbTextChanged; + sal_Bool mbTextChanged; sal_uInt32 mnTextHandle; sal_uInt32 mnHorTextAlign; void ImplBeginRecord( sal_uInt32 nType ); void ImplEndRecord(); - ULONG ImplAcquireHandle(); - void ImplReleaseHandle( ULONG nHandle ); + sal_uIntPtr ImplAcquireHandle(); + void ImplReleaseHandle( sal_uIntPtr nHandle ); - BOOL ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType ); + sal_Bool ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uIntPtr nSelectType ); void ImplCheckLineAttr(); void ImplCheckFillAttr(); void ImplCheckTextAttr(); @@ -82,9 +82,9 @@ private: void ImplWriteSize( const Size& rSize); void ImplWriteRect( const Rectangle& rRect ); void ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClose ); - void ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ); + void ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose ); void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly ); - void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP ); + void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP ); void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth ); void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); @@ -94,7 +94,7 @@ public: EMFWriter() {} - BOOL WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pConfigItem = NULL ); + sal_Bool WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pConfigItem = NULL ); }; #endif // _EMFWR_HXX diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx index 1e49e0d61446..29128ffd7904 100644 --- a/svtools/source/filter.vcl/wmf/enhwmf.cxx +++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx @@ -229,7 +229,7 @@ static sal_Bool ImplReadRegion( PolyPolygon& rPolyPoly, SvStream& rSt, sal_uInt3 return bOk; } -BOOL EnhWMFReader::ReadEnhWMF() +sal_Bool EnhWMFReader::ReadEnhWMF() { sal_uInt32 nStretchBltMode = 0; sal_uInt32 nRecType, nRecSize, nNextPos, @@ -246,7 +246,7 @@ BOOL EnhWMFReader::ReadEnhWMF() if ( ( nRecSize < 8 ) || ( nRecSize & 3 ) ) // Parameter sind immer durch 4 teilbar { - bStatus = FALSE; + bStatus = sal_False; break; } @@ -254,7 +254,7 @@ BOOL EnhWMFReader::ReadEnhWMF() if ( nNextPos > nEndPos ) { - bStatus = FALSE; + bStatus = sal_False; break; } @@ -291,8 +291,8 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - Polygon aPoly( (UINT16)nPoints ); - for( UINT16 k = 0; k < (UINT16)nPoints; k++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ ) { *pWMF >> nX32 >> nY32; aPoly[ k ] = Point( nX32, nY32 ); @@ -307,14 +307,14 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 0x10 ); *pWMF >> nPoints; - UINT16 i = 0; + sal_uInt16 i = 0; if ( bFlag ) { i++; nPoints++; } - Polygon aPolygon( (UINT16)nPoints ); - for ( ; i < (UINT16)nPoints; i++ ) + Polygon aPolygon( (sal_uInt16)nPoints ); + for ( ; i < (sal_uInt16)nPoints; i++ ) { *pWMF >> nX32 >> nY32; aPolygon[ i ] = Point( nX32, nY32 ); @@ -325,25 +325,25 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYLINE : { - UINT16* pnPoints; + sal_uInt16* pnPoints; - INT32 i, nPoly; + sal_Int32 i, nPoly; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> i; // taking the amount of points of each polygon, retrieving the total number of points - if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) ) + if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) { - if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } // Polygonpunkte holen: @@ -351,7 +351,7 @@ BOOL EnhWMFReader::ReadEnhWMF() for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ ) { Polygon aPoly( pnPoints[ i ] ); - for( UINT16 k = 0; k < pnPoints[ i ]; k++ ) + for( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ ) { *pWMF >> nX32 >> nY32; aPoly[ k ] = Point( nX32, nY32 ); @@ -366,25 +366,25 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYGON : { - UINT16* pnPoints; + sal_uInt16* pnPoints; Point* pPtAry; - UINT32 i, nPoly, nGesPoints; + sal_uInt32 i, nPoly, nGesPoints; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> nGesPoints; - if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) ) + if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) ) { - if ( ( nPoly * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( nPoly * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } if ( ( nGesPoints * (sizeof(sal_uInt32)+sizeof(sal_uInt32)) ) <= ( nEndPos - pWMF->Tell() ) ) @@ -398,7 +398,7 @@ BOOL EnhWMFReader::ReadEnhWMF() pPtAry[ i ] = Point( nX32, nY32 ); } // PolyPolygon Actions erzeugen - PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry ); + PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry ); pOut->DrawPolyPolygon( aPolyPoly, bRecordPath ); delete[] pPtAry; } @@ -554,7 +554,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_MODIFYWORLDTRANSFORM : { - UINT32 nMode; + sal_uInt32 nMode; XForm aTempXForm; *pWMF >> aTempXForm >> nMode; pOut->ModifyWorldTransform( aTempXForm, nMode ); @@ -575,7 +575,7 @@ BOOL EnhWMFReader::ReadEnhWMF() { LineInfo aLineInfo; - UINT32 nStyle; + sal_uInt32 nStyle; Size aSize; *pWMF >> nStyle >> aSize.Width() >> aSize.Height(); @@ -583,9 +583,9 @@ BOOL EnhWMFReader::ReadEnhWMF() if ( aSize.Width() ) aLineInfo.SetWidth( aSize.Width() ); - BOOL bTransparent = FALSE; - UINT16 nDashCount = 0; - UINT16 nDotCount = 0; + sal_Bool bTransparent = sal_False; + sal_uInt16 nDashCount = 0; + sal_uInt16 nDotCount = 0; switch( nStyle ) { case PS_DASHDOTDOT : @@ -599,7 +599,7 @@ BOOL EnhWMFReader::ReadEnhWMF() nDashCount++; break; case PS_NULL : - bTransparent = TRUE; + bTransparent = sal_True; aLineInfo.SetStyle( LINE_NONE ); break; default : @@ -674,12 +674,12 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_CREATEBRUSHINDIRECT : { - UINT32 nStyle; + sal_uInt32 nStyle; *pWMF >> nIndex; if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { *pWMF >> nStyle; - pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) ); + pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) ); } } break; @@ -716,7 +716,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_ARC : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) ); } @@ -724,7 +724,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_CHORD : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; pOut->DrawChord( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) ); } @@ -732,7 +732,7 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_PIE : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; const Rectangle aRect( ReadRectangle( nX32, nY32, nx32, ny32 )); @@ -754,9 +754,9 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_ARCTO : { - UINT32 nStartX, nStartY, nEndX, nEndY; + sal_uInt32 nStartX, nStartY, nEndX, nEndY; *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY; - pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), TRUE ); + pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), sal_True ); } break; @@ -813,11 +813,11 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_BITBLT : // PASSTHROUGH INTENDED case EMR_STRETCHBLT : { - INT32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc; - UINT32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc; + sal_Int32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc; + sal_uInt32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc; XForm xformSrc; - UINT32 nStart = pWMF->Tell() - 8; + sal_uInt32 nStart = pWMF->Tell() - 8; pWMF->SeekRel( 0x10 ); *pWMF >> xDest >> yDest >> cxDest >> cyDest >> dwRop >> xSrc >> ySrc @@ -836,27 +836,27 @@ BOOL EnhWMFReader::ReadEnhWMF() cyDest = abs( (int)cyDest ); // and also 122889 if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) ) - bStatus = FALSE; + bStatus = sal_False; else { - UINT32 nSize = cbBmiSrc + cbBitsSrc + 14; + sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14; if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); - aTmp.ObjectOwnsMemory( TRUE ); - aTmp << (BYTE)'B' - << (BYTE)'M' - << (UINT32)cbBitsSrc - << (UINT16)0 - << (UINT16)0 - << (UINT32)cbBmiSrc + 14; + aTmp.ObjectOwnsMemory( sal_True ); + aTmp << (sal_uInt8)'B' + << (sal_uInt8)'M' + << (sal_uInt32)cbBitsSrc + << (sal_uInt16)0 + << (sal_uInt16)0 + << (sal_uInt32)cbBmiSrc + 14; pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc ); aTmp.Seek( 0 ); - aBitmap.Read( aTmp, TRUE ); + aBitmap.Read( aTmp, sal_True ); // test if it is sensible to crop if ( ( cxSrc > 0 ) && ( cySrc > 0 ) && @@ -875,9 +875,9 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_STRETCHDIBITS : { - INT32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest; - UINT32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop; - UINT32 nStart = pWMF->Tell() - 8; + sal_Int32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest; + sal_uInt32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop; + sal_uInt32 nStart = pWMF->Tell() - 8; pWMF->SeekRel( 0x10 ); *pWMF >> xDest >> yDest >> xSrc >> ySrc >> cxSrc >> cySrc >> offBmiSrc >> cbBmiSrc >> offBitsSrc @@ -890,27 +890,27 @@ BOOL EnhWMFReader::ReadEnhWMF() cyDest = abs( (int)cyDest ); // and also 122889 if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) ) - bStatus = FALSE; + bStatus = sal_False; else { - UINT32 nSize = cbBmiSrc + cbBitsSrc + 14; + sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14; if ( nSize <= ( nEndPos - nStartPos ) ) { char* pBuf = new char[ nSize ]; SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); - aTmp.ObjectOwnsMemory( TRUE ); - aTmp << (BYTE)'B' - << (BYTE)'M' - << (UINT32)cbBitsSrc - << (UINT16)0 - << (UINT16)0 - << (UINT32)cbBmiSrc + 14; + aTmp.ObjectOwnsMemory( sal_True ); + aTmp << (sal_uInt8)'B' + << (sal_uInt8)'M' + << (sal_uInt32)cbBitsSrc + << (sal_uInt16)0 + << (sal_uInt16)0 + << (sal_uInt32)cbBmiSrc + 14; pWMF->Seek( nStart + offBmiSrc ); pWMF->Read( pBuf + 14, cbBmiSrc ); pWMF->Seek( nStart + offBitsSrc ); pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc ); aTmp.Seek( 0 ); - aBitmap.Read( aTmp, TRUE ); + aBitmap.Read( aTmp, sal_True ); // test if it is sensible to crop if ( ( cxSrc > 0 ) && ( cySrc > 0 ) && @@ -941,7 +941,7 @@ BOOL EnhWMFReader::ReadEnhWMF() for ( int i = 0; i < LF_FACESIZE; i++ ) { - UINT16 nChar; + sal_uInt16 nChar; *pWMF >> nChar; lfFaceName[ i ] = nChar; } @@ -1045,14 +1045,14 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - UINT16 i = 0; + sal_uInt16 i = 0; if ( bFlag ) { i++; nPoints++; } - Polygon aPoly( (UINT16)nPoints ); - for( ; i < (UINT16)nPoints; i++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( ; i < (sal_uInt16)nPoints; i++ ) { *pWMF >> nX16 >> nY16; aPoly[ i ] = Point( nX16, nY16 ); @@ -1065,8 +1065,8 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - Polygon aPoly( (UINT16)nPoints ); - for( UINT16 k = 0; k < (UINT16)nPoints; k++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ ) { *pWMF >> nX16 >> nY16; aPoly[ k ] = Point( nX16, nY16 ); @@ -1081,15 +1081,15 @@ BOOL EnhWMFReader::ReadEnhWMF() { pWMF->SeekRel( 16 ); *pWMF >> nPoints; - UINT16 i = 0; + sal_uInt16 i = 0; if ( bFlag ) { i++; nPoints++; } - Polygon aPoly( (UINT16)nPoints ); - for( ; i < (UINT16)nPoints; i++ ) + Polygon aPoly( (sal_uInt16)nPoints ); + for( ; i < (sal_uInt16)nPoints; i++ ) { *pWMF >> nX16 >> nY16; aPoly[ i ] = Point( nX16, nY16 ); @@ -1100,29 +1100,29 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYLINE16 : { - UINT16* pnPoints; + sal_uInt16* pnPoints; - INT32 i, nPoly, nGesPoints; + sal_Int32 i, nPoly, nGesPoints; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> nGesPoints; // taking the amount of points of each polygon, retrieving the total number of points - if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) ) + if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) { - if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } // Polygonpunkte holen: for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ ) { Polygon aPolygon( pnPoints[ i ] ); - for ( UINT16 k = 0; k < pnPoints[ i ]; k++ ) + for ( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ ) { *pWMF >> nX16 >> nY16; aPolygon[ k ] = Point( nX16, nY16 ); @@ -1137,22 +1137,22 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_POLYPOLYGON16 : { - UINT16* pnPoints; + sal_uInt16* pnPoints; Point* pPtAry; - UINT32 i, nPoly, nGesPoints; + sal_uInt32 i, nPoly, nGesPoints; pWMF->SeekRel( 0x10 ); // Anzahl der Polygone: *pWMF >> nPoly >> nGesPoints; - if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) ) + if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) ) { - if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( UINT16 ) ) <= ( nEndPos - pWMF->Tell() ) ) + if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) ) { - pnPoints = new UINT16[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; for ( i = 0; i < nPoly; i++ ) { *pWMF >> nPoints; - pnPoints[ i ] = (UINT16)nPoints; + pnPoints[ i ] = (sal_uInt16)nPoints; } if ( ( nGesPoints * (sizeof(sal_uInt16)+sizeof(sal_uInt16)) ) <= ( nEndPos - pWMF->Tell() ) ) { @@ -1165,7 +1165,7 @@ BOOL EnhWMFReader::ReadEnhWMF() } // PolyPolygon Actions erzeugen - PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry ); + PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry ); pOut->DrawPolyPolygon( aPolyPoly, bRecordPath ); delete[] pPtAry; } @@ -1266,16 +1266,16 @@ BOOL EnhWMFReader::ReadEnhWMF() //----------------------------------------------------------------------------------- -BOOL EnhWMFReader::ReadHeader() +sal_Bool EnhWMFReader::ReadHeader() { - UINT32 nUINT32, nHeaderSize, nPalEntries; - INT32 nLeft, nTop, nRight, nBottom; + sal_uInt32 nUINT32, nHeaderSize, nPalEntries; + sal_Int32 nLeft, nTop, nRight, nBottom; // METAFILEHEADER SPARE ICH MIR HIER // Einlesen des METAHEADER *pWMF >> nUINT32 >> nHeaderSize; if ( nUINT32 != 1 ) // Typ - return FALSE; + return sal_False; // bound size Rectangle rclBounds; // rectangle in logical units 1/100th mm @@ -1296,7 +1296,7 @@ BOOL EnhWMFReader::ReadHeader() *pWMF >> nUINT32; // signature if ( nUINT32 != 0x464d4520 ) - return FALSE; + return sal_False; *pWMF >> nUINT32; // nVersion *pWMF >> nEndPos; // size of metafile @@ -1311,7 +1311,7 @@ BOOL EnhWMFReader::ReadHeader() *pWMF >> nRecordCount; if ( !nRecordCount ) - return FALSE; + return sal_False; pWMF->SeekRel( 0xc ); @@ -1324,12 +1324,12 @@ BOOL EnhWMFReader::ReadHeader() pOut->SetRefMill( Size( nMillX, nMillY ) ); pWMF->Seek( nStartPos + nHeaderSize ); - return TRUE; + return sal_True; } //----------------------------------------------------------------------------------- -Rectangle EnhWMFReader::ReadRectangle( INT32 x1, INT32 y1, INT32 x2, INT32 y2 ) +Rectangle EnhWMFReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) { Point aTL ( Point( x1, y1 ) ); Point aBR( Point( --x2, --y2 ) ); diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index bf176015fd77..bfc4437a77e8 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -355,7 +355,7 @@ WinMtf::WinMtf( WinMtfOutput* pWinMtfOutput, SvStream& rStreamWMF, FilterConfigI SvLockBytes *pLB = pWMF->GetLockBytes(); if ( pLB ) - pLB->SetSynchronMode( TRUE ); + pLB->SetSynchronMode( sal_True ); nStartPos = pWMF->Tell(); @@ -383,7 +383,7 @@ WinMtf::~WinMtf() // ------------------------------------------------------------------------ -void WinMtf::Callback( USHORT nPercent ) +void WinMtf::Callback( sal_uInt16 nPercent ) { if ( xStatusIndicator.is() ) xStatusIndicator->setValue( nPercent ); @@ -393,9 +393,9 @@ void WinMtf::Callback( USHORT nPercent ) Color WinMtf::ReadColor() { - UINT32 nColor; + sal_uInt32 nColor; *pWMF >> nColor; - return Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) ); + return Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) ); }; //----------------------------------------------------------------------------------- @@ -561,8 +561,8 @@ void WinMtfOutput::ImplMap( Font& rFont ) Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon ) { - UINT16 nPoints = rPolygon.GetSize(); - for ( UINT16 i = 0; i < nPoints; i++ ) + sal_uInt16 nPoints = rPolygon.GetSize(); + for ( sal_uInt16 i = 0; i < nPoints; i++ ) { rPolygon[ i ] = ImplMap( rPolygon[ i ] ); } @@ -573,14 +573,14 @@ Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon ) PolyPolygon& WinMtfOutput::ImplMap( PolyPolygon& rPolyPolygon ) { - UINT16 nPolys = rPolyPolygon.Count(); - for ( UINT16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ; + sal_uInt16 nPolys = rPolyPolygon.Count(); + for ( sal_uInt16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ; return rPolyPolygon; } //----------------------------------------------------------------------------------- -void WinMtfOutput::SelectObject( INT32 nIndex ) +void WinMtfOutput::SelectObject( sal_Int32 nIndex ) { GDIObj* pGDIObj = NULL; @@ -590,7 +590,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) { nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen - if ( (UINT32)nIndex < vGDIObj.size() ) + if ( (sal_uInt32)nIndex < vGDIObj.size() ) pGDIObj = vGDIObj[ nIndex ]; } @@ -599,7 +599,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) if ( nIndex & ENHMETA_STOCK_OBJECT ) { - UINT16 nStockId = (BYTE)nIndex; + sal_uInt16 nStockId = (sal_uInt8)nIndex; switch( nStockId ) { case WHITE_BRUSH : @@ -625,7 +625,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) break; case NULL_BRUSH : { - pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ) ); + pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True ) ); } break; case WHITE_PEN : @@ -640,7 +640,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex ) break; case NULL_PEN : { - pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ) ); + pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True ) ); } break; default: @@ -701,7 +701,7 @@ sal_uInt32 WinMtfOutput::GetTextLayoutMode() const //----------------------------------------------------------------------------------- -void WinMtfOutput::SetBkMode( UINT32 nMode ) +void WinMtfOutput::SetBkMode( sal_uInt32 nMode ) { mnBkMode = nMode; } @@ -722,14 +722,14 @@ void WinMtfOutput::SetTextColor( const Color& rColor ) //----------------------------------------------------------------------------------- -void WinMtfOutput::SetTextAlign( UINT32 nAlign ) +void WinMtfOutput::SetTextAlign( sal_uInt32 nAlign ) { mnTextAlign = nAlign; } //----------------------------------------------------------------------------------- -void WinMtfOutput::ImplResizeObjectArry( UINT32 nNewEntrys ) +void WinMtfOutput::ImplResizeObjectArry( sal_uInt32 nNewEntrys ) { sal_uInt32 i = vGDIObj.size(); vGDIObj.resize( nNewEntrys ); @@ -795,7 +795,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle ) } } } - UINT32 nIndex; + sal_uInt32 nIndex; for ( nIndex = 0; nIndex < vGDIObj.size(); nIndex++ ) { if ( vGDIObj[ nIndex ] == NULL ) @@ -809,7 +809,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle ) //----------------------------------------------------------------------------------- -void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle ) +void WinMtfOutput::CreateObject( sal_Int32 nIndex, GDIObjectType eType, void* pStyle ) { if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { @@ -832,7 +832,7 @@ void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle } } } - if ( (UINT32)nIndex >= vGDIObj.size() ) + if ( (sal_uInt32)nIndex >= vGDIObj.size() ) ImplResizeObjectArry( nIndex + 16 ); if ( vGDIObj[ nIndex ] != NULL ) @@ -968,7 +968,7 @@ WinMtfOutput::~WinMtfOutput() else mpGDIMetaFile->SetPrefSize( mrclFrame.GetSize() ); - for ( UINT32 i = 0; i < vGDIObj.size(); i++ ) + for ( sal_uInt32 i = 0; i < vGDIObj.size(); i++ ) delete vGDIObj[ i ]; }; @@ -1010,7 +1010,7 @@ void WinMtfOutput::UpdateClipRegion() void WinMtfOutput::ImplSetNonPersistentLineColorTransparenz() { Color aColor( COL_TRANSPARENT); - WinMtfLineStyle aTransparentLine( aColor, TRUE ); + WinMtfLineStyle aTransparentLine( aColor, sal_True ); if ( ! ( maLatestLineStyle == aTransparentLine ) ) { maLatestLineStyle = aTransparentLine; @@ -1044,7 +1044,7 @@ void WinMtfOutput::UpdateFillStyle() //----------------------------------------------------------------------------------- -sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp ) +sal_uInt32 WinMtfOutput::SetRasterOp( sal_uInt32 nRasterOp ) { sal_uInt32 nRetROP = mnRop; if ( nRasterOp != mnRop ) @@ -1077,8 +1077,8 @@ sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp ) { aNopFillStyle = maFillStyle; aNopLineStyle = maLineStyle; - maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ); - maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ); + maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True ); + maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True ); mbNopMode = sal_True; } } @@ -1108,7 +1108,7 @@ void WinMtfOutput::StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill ) if ( !bStroke ) { mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) ); - mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) ); + mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) ); } if ( aPathObj.Count() == 1 ) mpGDIMetaFile->AddAction( new MetaPolygonAction( aPathObj.GetObject( 0 ) ) ); @@ -1173,7 +1173,7 @@ void WinMtfOutput::DrawLine( const Point& rSource, const Point& rDest ) //----------------------------------------------------------------------------------- -void WinMtfOutput::DrawRect( const Rectangle& rRect, BOOL bEdge ) +void WinMtfOutput::DrawRect( const Rectangle& rRect, sal_Bool bEdge ) { UpdateClipRegion(); UpdateFillStyle(); @@ -1247,7 +1247,7 @@ void WinMtfOutput::DrawEllipse( const Rectangle& rRect ) //----------------------------------------------------------------------------------- -void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, BOOL bTo ) +void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, sal_Bool bTo ) { UpdateClipRegion(); UpdateLineStyle(); @@ -1349,7 +1349,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath ) { if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) { - USHORT nCount = rPolygon.GetSize(); + sal_uInt16 nCount = rPolygon.GetSize(); if ( nCount ) { if ( rPolygon[ nCount - 1 ] != rPolygon[ 0 ] ) @@ -1564,7 +1564,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry pVDev->SetFont( maFont ); if( pDXArry ) { - UINT32 nLen = rText.Len(); + sal_uInt32 nLen = rText.Len(); nTextWidth = pVDev->GetTextWidth( rText.GetChar( (sal_uInt16)( nLen - 1 ) ) ); if( nLen > 1 ) nTextWidth += pDXArry[ nLen - 2 ]; @@ -1644,7 +1644,7 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B const Point aEmptyPoint; // #i50672# Extract whole VDev content (to match size of rBitmap) - aVDev.EnableMapMode( FALSE ); + aVDev.EnableMapMode( sal_False ); Bitmap aMask( aVDev.GetBitmap( aEmptyPoint, aSizePixel ).CreateMask( Color( COL_WHITE ) ) ); if ( aBmpEx.IsTransparent() ) @@ -1713,7 +1713,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) { // patterns aren't well supported yet sal_uInt32 nOldRop = SetRasterOp( ROP_OVERPAINT ); // in this case nRasterOperation is either 0 or 0xff UpdateFillStyle(); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); SetRasterOp( nOldRop ); } else @@ -1778,7 +1778,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0x1 ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1796,7 +1796,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0x7 ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1805,7 +1805,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) case 0xb : { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); SetRasterOp( R2_COPYPEN ); Bitmap aMask( aBitmap ); aBitmap.Invert(); @@ -1816,7 +1816,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0xb ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1833,7 +1833,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0xd ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1845,7 +1845,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( nOperation == 0x9 ) { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } } break; @@ -1855,7 +1855,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) { // in this case nRasterOperation is either 0 or 0xff maFillStyle = WinMtfFillStyle( Color( nRasterOperation, nRasterOperation, nRasterOperation ) ); UpdateFillStyle(); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } break; @@ -1871,7 +1871,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) case 0x5 : // only destination is used { SetRasterOp( R2_NOT ); - DrawRect( aRect, FALSE ); + DrawRect( aRect, sal_False ); } case 0xa : // no operation break; @@ -1900,7 +1900,7 @@ void WinMtfOutput::SetDevOrg( const Point& rPoint ) //----------------------------------------------------------------------------------- -void WinMtfOutput::SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd ) +void WinMtfOutput::SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ) { mnDevOrgX += nXAdd; mnDevOrgY += nYAdd; @@ -1942,7 +1942,7 @@ void WinMtfOutput::SetWinOrg( const Point& rPoint ) //----------------------------------------------------------------------------------- -void WinMtfOutput::SetWinOrgOffset( INT32 nXAdd, INT32 nYAdd ) +void WinMtfOutput::SetWinOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ) { mnWinOrgX += nXAdd; mnWinOrgY += nYAdd; @@ -2036,7 +2036,7 @@ void WinMtfOutput::SetWorldTransform( const XForm& rXForm ) //----------------------------------------------------------------------------------- -void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ) +void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ) { switch( nMode ) { diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx index fb4fd2fe0c57..299d297c90bc 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.hxx +++ b/svtools/source/filter.vcl/wmf/winmtf.hxx @@ -144,19 +144,19 @@ struct LOGFONTW { - INT32 lfHeight; - INT32 lfWidth; - INT32 lfEscapement; - INT32 lfOrientation; - INT32 lfWeight; - BYTE lfItalic; - BYTE lfUnderline; - BYTE lfStrikeOut; - BYTE lfCharSet; - BYTE lfOutPrecision; - BYTE lfClipPrecision; - BYTE lfQuality; - BYTE lfPitchAndFamily; + sal_Int32 lfHeight; + sal_Int32 lfWidth; + sal_Int32 lfEscapement; + sal_Int32 lfOrientation; + sal_Int32 lfWeight; + sal_uInt8 lfItalic; + sal_uInt8 lfUnderline; + sal_uInt8 lfStrikeOut; + sal_uInt8 lfCharSet; + sal_uInt8 lfOutPrecision; + sal_uInt8 lfClipPrecision; + sal_uInt8 lfQuality; + sal_uInt8 lfPitchAndFamily; String alfFaceName; }; @@ -367,23 +367,23 @@ struct WinMtfFontStyle struct WinMtfFillStyle { Color aFillColor; - BOOL bTransparent; + sal_Bool bTransparent; WinMtfFillStyle() : aFillColor ( Color( COL_BLACK ) ), - bTransparent( FALSE ) + bTransparent( sal_False ) { }; - WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE ) : + WinMtfFillStyle( const Color& rColor, sal_Bool bTrans = sal_False ) : aFillColor ( rColor ), bTransparent( bTrans ) { }; - BOOL operator==( const WinMtfFillStyle& rStyle ) + sal_Bool operator==( const WinMtfFillStyle& rStyle ) { return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) ); }; - BOOL operator==( WinMtfFillStyle* pStyle ) + sal_Bool operator==( WinMtfFillStyle* pStyle ) { return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) ); }; void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; }; void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; }; @@ -395,23 +395,23 @@ struct WinMtfLineStyle { Color aLineColor; LineInfo aLineInfo; - BOOL bTransparent; + sal_Bool bTransparent; WinMtfLineStyle() : aLineColor ( COL_BLACK ), - bTransparent( FALSE ) {}; + bTransparent( sal_False ) {}; - WinMtfLineStyle( const Color& rColor, BOOL bTrans = FALSE ) : + WinMtfLineStyle( const Color& rColor, sal_Bool bTrans = sal_False ) : aLineColor ( rColor ), bTransparent( bTrans ) {}; - WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, BOOL bTrans = FALSE ) : + WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, sal_Bool bTrans = sal_False ) : aLineColor ( rColor ), aLineInfo ( rStyle ), bTransparent( bTrans ) {}; - BOOL operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }; - BOOL operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }; + sal_Bool operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }; + sal_Bool operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }; void operator=( const WinMtfLineStyle& rStyle ) { aLineColor = rStyle.aLineColor; @@ -480,9 +480,9 @@ struct BSaveStruct { Bitmap aBmp; Rectangle aOutRect; - UINT32 nWinRop; + sal_uInt32 nWinRop; - BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop ) : + BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, sal_uInt32 nRop ) : aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ){}; }; @@ -594,7 +594,7 @@ class WinMtfOutput void ImplMap( Font& rFont ); Polygon& ImplMap( Polygon& rPolygon ); PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon ); - void ImplResizeObjectArry( UINT32 nNewEntry ); + void ImplResizeObjectArry( sal_uInt32 nNewEntry ); void ImplSetNonPersistentLineColorTransparenz(); void ImplDrawClippedPolyPolygon( const PolyPolygon& rPolyPoly ); void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx rBitmap ); @@ -602,12 +602,12 @@ class WinMtfOutput public: void SetDevOrg( const Point& rPoint ); - void SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd ); + void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ); void SetDevExt( const Size& rSize ); void ScaleDevExt( double fX, double fY ); void SetWinOrg( const Point& rPoint ); - void SetWinOrgOffset( INT32 nX, INT32 nY ); + void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY ); void SetWinExt( const Size& rSize ); void ScaleWinExt( double fX, double fY ); @@ -619,24 +619,24 @@ class WinMtfOutput sal_uInt32 GetMapMode() const { return mnMapMode; }; void SetMapMode( sal_uInt32 mnMapMode ); void SetWorldTransform( const XForm& rXForm ); - void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ); + void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ); void Push(); void Pop(); - UINT32 SetRasterOp( UINT32 nRasterOp ); + sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp ); void StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill ); void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; }; sal_Int32 GetGfxMode() const { return mnGfxMode; }; - void SetBkMode( UINT32 nMode ); + void SetBkMode( sal_uInt32 nMode ); void SetBkColor( const Color& rColor ); void SetTextColor( const Color& rColor ); - void SetTextAlign( UINT32 nAlign ); + void SetTextAlign( sal_uInt32 nAlign ); void CreateObject( GDIObjectType, void* pStyle = NULL ); - void CreateObject( INT32 nIndex, GDIObjectType, void* pStyle = NULL ); - void DeleteObject( INT32 nIndex ); - void SelectObject( INT32 nIndex ); + void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = NULL ); + void DeleteObject( sal_Int32 nIndex ); + void SelectObject( sal_Int32 nIndex ); CharSet GetCharSet(){ return maFont.GetCharSet(); }; void SetFont( const Font& rFont ); const Font& GetFont() const; @@ -651,10 +651,10 @@ class WinMtfOutput void LineTo( const Point& rPoint, sal_Bool bRecordPath = sal_False ); void DrawPixel( const Point& rSource, const Color& rColor ); void DrawLine( const Point& rSource, const Point& rDest ); - void DrawRect( const Rectangle& rRect, BOOL bEdge = TRUE ); + void DrawRect( const Rectangle& rRect, sal_Bool bEdge = sal_True ); void DrawRoundRect( const Rectangle& rRect, const Size& rSize ); void DrawEllipse( const Rectangle& rRect ); - void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, BOOL bDrawTo = FALSE ); + void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, sal_Bool bDrawTo = sal_False ); void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ); void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ); void DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath = sal_False ); @@ -685,7 +685,7 @@ class WinMtf WinMtfOutput* pOut; // SvStream* pWMF; // Die einzulesende WMF/EMF-Datei - UINT32 nStartPos, nEndPos; + sal_uInt32 nStartPos, nEndPos; List aBmpSaveList; FilterConfigItem* pFilterConfigItem; @@ -695,7 +695,7 @@ class WinMtf // Sorgt dafuer, das aSampledBrush der aktuelle Brush des GDIMetaFiles ist. Color ReadColor(); - void Callback( USHORT nPercent ); + void Callback( sal_uInt16 nPercent ); WinMtf( WinMtfOutput* pOut, SvStream& rStreamWMF, FilterConfigItem* pConfigItem = NULL ); ~WinMtf(); @@ -711,16 +711,16 @@ class EnhWMFReader : public WinMtf sal_Bool bRecordPath; sal_Int32 nRecordCount; - BOOL ReadHeader(); - Rectangle ReadRectangle( INT32, INT32, INT32, INT32 ); // Liesst und konvertiert ein Rechteck - void ImplExtTextOut( BOOL bWideCharakter ); + sal_Bool ReadHeader(); + Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); // Liesst und konvertiert ein Rechteck + void ImplExtTextOut( sal_Bool bWideCharakter ); public: EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ) {}; ~EnhWMFReader(); - BOOL ReadEnhWMF(); + sal_Bool ReadEnhWMF(); }; //============================ WMFReader ================================== @@ -730,7 +730,7 @@ class WMFReader : public WinMtf private: VirtualDevice aVDev; // just for the purpose of "IsFontAvailable" - UINT16 nUnitsPerInch; + sal_uInt16 nUnitsPerInch; sal_uInt32 nRecSize; // embedded EMF data @@ -750,10 +750,10 @@ private: sal_uInt32 nUnicodeEscapeAction; // Liesst den Kopf der WMF-Datei - BOOL ReadHeader(); + sal_Bool ReadHeader(); // Liesst die Parameter des Rocords mit der Funktionsnummer nFunction. - void ReadRecordParams( USHORT nFunction ); + void ReadRecordParams( sal_uInt16 nFunction ); Point ReadPoint(); // Liesst und konvertiert einen Punkt (erst X dann Y) Point ReadYX(); // Liesst und konvertiert einen Punkt (erst Y dann X) diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx index f7c4f51ce1e2..a8ffffe4084f 100644 --- a/svtools/source/filter.vcl/wmf/winwmf.cxx +++ b/svtools/source/filter.vcl/wmf/winwmf.cxx @@ -156,7 +156,7 @@ Size WMFReader::ReadYXExt() // ------------------------------------------------------------------------ -void WMFReader::ReadRecordParams( USHORT nFunc ) +void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) { switch( nFunc ) { @@ -168,7 +168,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SETBKMODE: { - USHORT nDat; + sal_uInt16 nDat; *pWMF >> nDat; pOut->SetBkMode( nDat ); } @@ -185,7 +185,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SETROP2: { - UINT16 nROP2; + sal_uInt16 nROP2; *pWMF >> nROP2; pOut->SetRasterOp( nROP2 ); } @@ -322,7 +322,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_POLYGON: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pWMF >> nPoints; Polygon aPoly( nPoints ); for( i = 0; i < nPoints; i++ ) @@ -333,13 +333,13 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_POLYPOLYGON: { - USHORT i, nPoly, nPoints; - USHORT* pnPoints; + sal_uInt16 i, nPoly, nPoints; + sal_uInt16* pnPoints; Point* pPtAry; // Anzahl der Polygone: *pWMF >> nPoly; // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln: - pnPoints = new USHORT[ nPoly ]; + pnPoints = new sal_uInt16[ nPoly ]; nPoints = 0; for( i = 0; i < nPoly; i++ ) { @@ -360,7 +360,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_POLYLINE: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pWMF >> nPoints; Polygon aPoly( nPoints ); for( i = 0; i < nPoints; i++ ) @@ -396,7 +396,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_TEXTOUT: { - USHORT nLength; + sal_uInt16 nLength; *pWMF >> nLength; if ( nLength ) { @@ -453,7 +453,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) sal_uInt32 nMaxStreamPos = nRecordPos + ( nRecordSize << 1 ); sal_Int32 nDxArySize = nMaxStreamPos - pWMF->Tell(); sal_Int32 nDxAryEntries = nDxArySize >> 1; - sal_Bool bUseDXAry = FALSE; + sal_Bool bUseDXAry = sal_False; if ( ( ( nDxAryEntries % nOriginalTextLen ) == 0 ) && ( nNewTextLen <= nOriginalTextLen ) ) { @@ -481,7 +481,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) pDXAry[ i ] = nDx; } if ( i == nNewTextLen ) - bUseDXAry = TRUE; + bUseDXAry = sal_True; } if ( pDXAry && bUseDXAry ) pOut->DrawText( aPosition, aText, pDXAry ); @@ -496,7 +496,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SELECTOBJECT: { - INT16 nObjIndex; + sal_Int16 nObjIndex; *pWMF >> nObjIndex; pOut->SelectObject( nObjIndex ); } @@ -504,7 +504,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_SETTEXTALIGN: { - UINT16 nAlign; + sal_uInt16 nAlign; *pWMF >> nAlign; pOut->SetTextAlign( nAlign ); } @@ -602,14 +602,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) { if ( nWinROP == PATCOPY ) *pWMF >> nUsage; // i don't know anything of this parameter, so its called nUsage - // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE ); + // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False ); Size aDestSize( ReadYXExt() ); if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps { Rectangle aDestRect( ReadYX(), aDestSize ); if ( nWinROP != PATCOPY ) - aBmp.Read( *pWMF, FALSE ); + aBmp.Read( *pWMF, sal_False ); // test if it is sensible to crop if ( nSye && nSxe && @@ -629,18 +629,18 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) { Bitmap aBmp; BitmapReadAccess* pBmp; - UINT32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1; - UINT16 nFunction; + sal_uInt32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1; + sal_uInt16 nFunction; *pWMF >> nFunction >> nFunction; - aBmp.Read( *pWMF, FALSE ); + aBmp.Read( *pWMF, sal_False ); pBmp = aBmp.AcquireReadAccess(); if ( pBmp ) { - for ( INT32 y = 0; y < pBmp->Height(); y++ ) + for ( sal_Int32 y = 0; y < pBmp->Height(); y++ ) { - for ( INT32 x = 0; x < pBmp->Width(); x++ ) + for ( sal_Int32 x = 0; x < pBmp->Width(); x++ ) { const BitmapColor aColor( pBmp->GetColor( y, x ) ); @@ -654,14 +654,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) nCount++; aBmp.ReleaseAccess( pBmp ); } - Color aColor( (BYTE)( nRed / nCount ), (BYTE)( nGreen / nCount ), (BYTE)( nBlue / nCount ) ); - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, FALSE ) ); + Color aColor( (sal_uInt8)( nRed / nCount ), (sal_uInt8)( nGreen / nCount ), (sal_uInt8)( nBlue / nCount ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, sal_False ) ); } break; case W_META_DELETEOBJECT: { - INT16 nIndex; + sal_Int16 nIndex; *pWMF >> nIndex; pOut->DeleteObject( nIndex ); } @@ -675,29 +675,29 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_CREATEBRUSH: { - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) ); } break; case W_META_CREATEPATTERNBRUSH: { - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) ); } break; case W_META_CREATEPENINDIRECT: { LineInfo aLineInfo; - USHORT nStyle, nWidth, nHeight; + sal_uInt16 nStyle, nWidth, nHeight; *pWMF >> nStyle >> nWidth >> nHeight; if ( nWidth ) aLineInfo.SetWidth( nWidth ); - BOOL bTransparent = FALSE; - UINT16 nDashCount = 0; - UINT16 nDotCount = 0; + sal_Bool bTransparent = sal_False; + sal_uInt16 nDashCount = 0; + sal_uInt16 nDotCount = 0; switch( nStyle ) { case PS_DASHDOTDOT : @@ -711,7 +711,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) nDashCount++; break; case PS_NULL : - bTransparent = TRUE; + bTransparent = sal_True; aLineInfo.SetStyle( LINE_NONE ); break; default : @@ -731,9 +731,9 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_CREATEBRUSHINDIRECT: { - USHORT nStyle; + sal_uInt16 nStyle; *pWMF >> nStyle; - pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) ); + pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) ); } break; @@ -741,7 +741,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) { Size aFontSize; char lfFaceName[ LF_FACESIZE ]; - INT16 lfEscapement, lfOrientation, lfWeight; // ( ehemals USHORT ) + sal_Int16 lfEscapement, lfOrientation, lfWeight; // ( ehemals sal_uInt16 ) LOGFONTW aLogFont; aFontSize = ReadYXExt(); @@ -796,11 +796,11 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) case W_META_PATBLT: { - UINT32 nROP, nOldROP; + sal_uInt32 nROP, nOldROP; *pWMF >> nROP; Size aSize = ReadYXExt(); nOldROP = pOut->SetRasterOp( nROP ); - pOut->DrawRect( Rectangle( ReadYX(), aSize ), FALSE ); + pOut->DrawRect( Rectangle( ReadYX(), aSize ), sal_False ); pOut->SetRasterOp( nOldROP ); } break; @@ -996,7 +996,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) // ------------------------------------------------------------------------ -BOOL WMFReader::ReadHeader() +sal_Bool WMFReader::ReadHeader() { Rectangle aPlaceableBound; sal_uInt32 nl, nStrmPos = pWMF->Tell(); @@ -1007,7 +1007,7 @@ BOOL WMFReader::ReadHeader() Size aWMFSize; if ( nl == 0x9ac6cdd7L ) { - INT16 nVal; + sal_Int16 nVal; // hmf (Unused) ueberlesen wir pWMF->SeekRel(2); @@ -1055,7 +1055,7 @@ BOOL WMFReader::ReadHeader() if( nl != 0x00090001 ) { pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); - return FALSE; + return sal_False; } pWMF->SeekRel( 2 ); // Version (von Windows) @@ -1064,13 +1064,13 @@ BOOL WMFReader::ReadHeader() pWMF->SeekRel( 4 ); // MaxRecord (Groesse des groessten Records in Words) pWMF->SeekRel( 2 ); // NoParameters (Unused - return TRUE; + return sal_True; } void WMFReader::ReadWMF() { - USHORT nFunction; - ULONG nPos, nPercent, nLastPercent; + sal_uInt16 nFunction; + sal_uIntPtr nPos, nPercent, nLastPercent; nSkipActions = 0; nCurrentAction = 0; @@ -1088,7 +1088,7 @@ void WMFReader::ReadWMF() nEndPos=pWMF->Seek( STREAM_SEEK_TO_END ); pWMF->Seek( nStartPos ); - Callback( (USHORT) ( nLastPercent = 0 ) ); + Callback( (sal_uInt16) ( nLastPercent = 0 ) ); if ( ReadHeader() ) { @@ -1097,14 +1097,14 @@ void WMFReader::ReadWMF() if( nEndPos - nStartPos ) { - while( TRUE ) + while( sal_True ) { nCurrentAction++; nPercent = ( nPos - nStartPos ) * 100 / ( nEndPos - nStartPos ); if( nLastPercent + 4 <= nPercent ) { - Callback( (USHORT) nPercent ); + Callback( (sal_uInt16) nPercent ); nLastPercent = nPercent; } *pWMF >> nRecSize >> nFunction; @@ -1134,7 +1134,7 @@ void WMFReader::ReadWMF() GDIMetaFile aMeta; pEMFStream->Seek( 0 ); EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta ); - BOOL bRead = pEMFReader->ReadEnhWMF(); + sal_Bool bRead = pEMFReader->ReadEnhWMF(); delete pEMFReader; // destroy first!!! if( bRead ) @@ -1283,7 +1283,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_POLYGON: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pStm >> nPoints; for( i = 0; i < nPoints; i++ ) GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode ); @@ -1292,7 +1292,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_POLYPOLYGON: { - USHORT i, nPoly, nPoints = 0; + sal_uInt16 i, nPoly, nPoints = 0; *pStm >> nPoly; for( i = 0; i < nPoly; i++ ) { @@ -1307,7 +1307,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_POLYLINE: { - USHORT i,nPoints; + sal_uInt16 i,nPoints; *pStm >> nPoints; for( i = 0; i < nPoints; i++ ) GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode ); @@ -1323,7 +1323,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_TEXTOUT: { - USHORT nLength; + sal_uInt16 nLength; *pStm >> nLength; // todo: we also have to take care of the text width if ( nLength ) @@ -1378,7 +1378,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt { if ( nWinROP == PATCOPY ) *pStm >> nUsage; // i don't know anything of this parameter, so its called nUsage - // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE ); + // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False ); Size aDestSize( ReadYXExt() ); if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps @@ -1392,7 +1392,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt case W_META_PATBLT: { - UINT32 nROP; + sal_uInt32 nROP; *pStm >> nROP; Size aSize = ReadYXExt(); GetWinExtMax( Rectangle( ReadYX(), aSize ), rPlaceableBound, nMapMode ); diff --git a/svtools/source/filter.vcl/wmf/wmf.cxx b/svtools/source/filter.vcl/wmf/wmf.cxx index 25ca9f721b33..4e84cd920b56 100644 --- a/svtools/source/filter.vcl/wmf/wmf.cxx +++ b/svtools/source/filter.vcl/wmf/wmf.cxx @@ -35,18 +35,18 @@ // ----------------------------------------------------------------------------- -BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem ) +sal_Bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem ) { - UINT32 nMetaType; - UINT32 nOrgPos = rStreamWMF.Tell(); - UINT16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt(); + sal_uInt32 nMetaType; + sal_uInt32 nOrgPos = rStreamWMF.Tell(); + sal_uInt16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt(); rStreamWMF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStreamWMF.Seek( 0x28 ); rStreamWMF >> nMetaType; rStreamWMF.Seek( nOrgPos ); if ( nMetaType == 0x464d4520 ) { - if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == FALSE ) + if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == sal_False ) rStreamWMF.SetError( SVSTREAM_FILEFORMAT_ERROR ); } else @@ -59,18 +59,18 @@ BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, // ----------------------------------------------------------------------------- -BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem ) +sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem ) { - UINT32 nMetaType; - UINT32 nOrgPos = rStream.Tell(); - UINT16 nOrigNumberFormat = rStream.GetNumberFormatInt(); + sal_uInt32 nMetaType; + sal_uInt32 nOrgPos = rStream.Tell(); + sal_uInt16 nOrigNumberFormat = rStream.GetNumberFormatInt(); rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rStream.Seek( 0x28 ); rStream >> nMetaType; rStream.Seek( nOrgPos ); if ( nMetaType == 0x464d4520 ) { - if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == FALSE ) + if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == sal_False ) rStream.SetError( SVSTREAM_FILEFORMAT_ERROR ); } else @@ -83,8 +83,8 @@ BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* // ----------------------------------------------------------------------------- -BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, - FilterConfigItem* pConfigItem, BOOL bPlaceable) +sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, + FilterConfigItem* pConfigItem, sal_Bool bPlaceable) { WMFWriter aWMFWriter; return aWMFWriter.WriteWMF( rMTF, rTargetStream, pConfigItem, bPlaceable ); @@ -92,7 +92,7 @@ BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream // ----------------------------------------------------------------------------- -BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, +sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem ) { EMFWriter aEMFWriter; @@ -101,14 +101,14 @@ BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream // ----------------------------------------------------------------------------- -BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ) +sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ) { return WMFWriter().WriteWMF( rMTF, rStream, NULL ); } // ----------------------------------------------------------------------------- -BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ) +sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ) { - return WMFWriter().WriteWMF( rMTF, rStream, NULL, FALSE ); + return WMFWriter().WriteWMF( rMTF, rStream, NULL, sal_False ); } diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx index 4dff9732c7d0..a1ee788f631f 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.cxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx @@ -281,7 +281,7 @@ void WMFWriter::MayCallback() { if ( xStatusIndicator.is() ) { - ULONG nPercent; + sal_uIntPtr nPercent; // Wir gehen mal einfach so davon aus, dass 16386 Actions einer Bitmap entsprechen // (in der Regel wird ein Metafile entweder nur Actions oder einige Bitmaps und fast @@ -302,7 +302,7 @@ void WMFWriter::MayCallback() void WMFWriter::CountActionsAndBitmaps( const GDIMetaFile & rMTF ) { - ULONG nAction, nActionCount; + sal_uIntPtr nAction, nActionCount; nActionCount = rMTF.GetActionCount(); @@ -370,7 +370,7 @@ void WMFWriter::WriteRectangle(const Rectangle & rRect) void WMFWriter::WriteColor(const Color & rColor) { - *pWMF << (BYTE) rColor.GetRed() << (BYTE) rColor.GetGreen() << (BYTE) rColor.GetBlue() << (BYTE) 0; + *pWMF << (sal_uInt8) rColor.GetRed() << (sal_uInt8) rColor.GetGreen() << (sal_uInt8) rColor.GetBlue() << (sal_uInt8) 0; } @@ -384,12 +384,12 @@ void WMFWriter::WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType) void WMFWriter::UpdateRecordHeader() { - ULONG nPos; + sal_uIntPtr nPos; sal_uInt32 nSize; nPos=pWMF->Tell(); nSize=nPos-nActRecordPos; if ((nSize & 1)!=0) { - *pWMF << (BYTE)0; + *pWMF << (sal_uInt8)0; nPos++; nSize++; } nSize/=2; @@ -422,19 +422,19 @@ void WMFWriter::WMFRecord_CreateBrushIndirect(const Color& rColor) WriteRecordHeader(0x00000007,W_META_CREATEBRUSHINDIRECT); if( rColor==Color(COL_TRANSPARENT) ) - *pWMF << (UINT16) W_BS_HOLLOW; + *pWMF << (sal_uInt16) W_BS_HOLLOW; else - *pWMF << (UINT16) W_BS_SOLID; + *pWMF << (sal_uInt16) W_BS_SOLID; WriteColor( rColor ); - *pWMF << (UINT16) 0; + *pWMF << (sal_uInt16) 0; } void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) { - USHORT nWeight,i; - BYTE nPitchFamily; + sal_uInt16 nWeight,i; + sal_uInt8 nPitchFamily; WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT); WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height())); @@ -455,9 +455,9 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) } *pWMF << nWeight; - if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1; - if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1; - if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1; + if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1; + if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1; + if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1; CharSet eFontNameEncoding = rFont.GetCharSet(); sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( eFontNameEncoding ); @@ -467,7 +467,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) nCharSet = W_ANSI_CHARSET; *pWMF << nCharSet; - *pWMF << (BYTE)0 << (BYTE)0 << (BYTE)0; + *pWMF << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0; switch (rFont.GetPitch()) { case PITCH_FIXED: nPitchFamily=W_FIXED_PITCH; break; @@ -496,7 +496,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont) void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo ) { WriteRecordHeader(0x00000008,W_META_CREATEPENINDIRECT); - USHORT nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID; + sal_uInt16 nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID; switch( rLineInfo.GetStyle() ) { case LINE_DASH : @@ -529,7 +529,7 @@ void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& WriteColor( rColor ); } -void WMFWriter::WMFRecord_DeleteObject(USHORT nObjectHandle) +void WMFWriter::WMFRecord_DeleteObject(sal_uInt16 nObjectHandle) { WriteRecordHeader(0x00000004,W_META_DELETEOBJECT); *pWMF << nObjectHandle; @@ -750,7 +750,7 @@ void WMFWriter::WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, c void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) { - USHORT nSize,i; + sal_uInt16 nSize,i; Polygon aSimplePoly; if ( rPoly.HasFlags() ) @@ -758,7 +758,7 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) else aSimplePoly = rPoly; nSize = aSimplePoly.GetSize(); - WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYGON); + WriteRecordHeader(((sal_uIntPtr)nSize)*2+4,W_META_POLYGON); *pWMF << nSize; for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i)); } @@ -766,14 +766,14 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly) { - USHORT nSize,i; + sal_uInt16 nSize,i; Polygon aSimplePoly; if ( rPoly.HasFlags() ) rPoly.AdaptiveSubdivide( aSimplePoly ); else aSimplePoly = rPoly; nSize=aSimplePoly.GetSize(); - WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYLINE); + WriteRecordHeader(((sal_uIntPtr)nSize)*2+4,W_META_POLYLINE); *pWMF << nSize; for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i)); } @@ -782,7 +782,7 @@ void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly) void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly) { const Polygon * pPoly; - USHORT nCount,nSize,i,j; + sal_uInt16 nCount,nSize,i,j; nCount=rPolyPoly.Count(); PolyPolygon aSimplePolyPoly( rPolyPoly ); @@ -797,7 +797,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly) } WriteRecordHeader(0,W_META_POLYPOLYGON); *pWMF << nCount; - for (i=0; i<nCount; i++) *pWMF << ((USHORT)(aSimplePolyPoly.GetObject(i).GetSize())); + for (i=0; i<nCount; i++) *pWMF << ((sal_uInt16)(aSimplePolyPoly.GetObject(i).GetSize())); for (i=0; i<nCount; i++) { pPoly=&(aSimplePolyPoly.GetObject(i)); nSize=pPoly->GetSize(); @@ -835,7 +835,7 @@ void WMFWriter::WMFRecord_SaveDC() } -void WMFWriter::WMFRecord_SelectObject(USHORT nObjectHandle) +void WMFWriter::WMFRecord_SelectObject(sal_uInt16 nObjectHandle) { WriteRecordHeader(0x00000004,W_META_SELECTOBJECT); *pWMF << nObjectHandle; @@ -849,17 +849,17 @@ void WMFWriter::WMFRecord_SetBkColor(const Color & rColor) } -void WMFWriter::WMFRecord_SetBkMode(BOOL bTransparent) +void WMFWriter::WMFRecord_SetBkMode(sal_Bool bTransparent) { WriteRecordHeader(0x00000004,W_META_SETBKMODE); - if (bTransparent==TRUE) *pWMF << (USHORT)W_TRANSPARENT; - else *pWMF << (USHORT)W_OPAQUE; + if (bTransparent==sal_True) *pWMF << (sal_uInt16)W_TRANSPARENT; + else *pWMF << (sal_uInt16)W_OPAQUE; } void WMFWriter::WMFRecord_SetStretchBltMode() { WriteRecordHeader( 0x00000004, W_META_SETSTRETCHBLTMODE ); - *pWMF << (USHORT) 3; // STRETCH_DELETESCANS + *pWMF << (sal_uInt16) 3; // STRETCH_DELETESCANS } void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor) @@ -872,7 +872,7 @@ void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor) void WMFWriter::WMFRecord_SetROP2(RasterOp eROP) { - USHORT nROP2; + sal_uInt16 nROP2; switch (eROP) { case ROP_INVERT: nROP2=W_R2_NOT; break; @@ -884,9 +884,9 @@ void WMFWriter::WMFRecord_SetROP2(RasterOp eROP) } -void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign) +void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign) { - USHORT nAlign; + sal_uInt16 nAlign; switch (eFontAlign) { case ALIGN_TOP: nAlign=W_TA_TOP; break; @@ -925,7 +925,7 @@ void WMFWriter::WMFRecord_SetWindowOrg(const Point & rPoint) void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize, const Bitmap & rBitmap, sal_uInt32 nROP ) { - ULONG nPosAnf,nPosEnd; + sal_uIntPtr nPosAnf,nPosEnd; nActBitmapPercent=50; MayCallback(); @@ -985,14 +985,14 @@ void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const String & rStr) void WMFWriter::TrueTextOut(const Point & rPoint, const ByteString& rString) { - USHORT nLen,i; + sal_uInt16 nLen,i; WriteRecordHeader(0,W_META_TEXTOUT); nLen=rString.Len(); *pWMF << nLen; for ( i = 0; i < nLen; i++ ) - *pWMF << (BYTE)rString.GetChar( i ); - if ((nLen&1)!=0) *pWMF << (BYTE)0; + *pWMF << (sal_uInt8)rString.GetChar( i ); + if ((nLen&1)!=0) *pWMF << (sal_uInt8)0; WritePointYX(rPoint); UpdateRecordHeader(); } @@ -1010,30 +1010,30 @@ void WMFWriter::WMFRecord_IntersectClipRect( const Rectangle& rRect ) } -USHORT WMFWriter::AllocHandle() +sal_uInt16 WMFWriter::AllocHandle() { - USHORT i; + sal_uInt16 i; for (i=0; i<MAXOBJECTHANDLES; i++) { - if (bHandleAllocated[i]==FALSE) { - bHandleAllocated[i]=TRUE; + if (bHandleAllocated[i]==sal_False) { + bHandleAllocated[i]=sal_True; return i; } } - bStatus=FALSE; + bStatus=sal_False; return 0xffff; } -void WMFWriter::FreeHandle(USHORT nObjectHandle) +void WMFWriter::FreeHandle(sal_uInt16 nObjectHandle) { - if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=FALSE; + if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=sal_False; } void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo ) { - USHORT nOldHandle; + sal_uInt16 nOldHandle; nOldHandle=nDstPenHandle; nDstPenHandle=AllocHandle(); @@ -1048,7 +1048,7 @@ void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLin void WMFWriter::CreateSelectDeleteFont(const Font & rFont) { - USHORT nOldHandle; + sal_uInt16 nOldHandle; nOldHandle=nDstFontHandle; nDstFontHandle=AllocHandle(); @@ -1063,7 +1063,7 @@ void WMFWriter::CreateSelectDeleteFont(const Font & rFont) void WMFWriter::CreateSelectDeleteBrush(const Color& rColor) { - USHORT nOldHandle; + sal_uInt16 nOldHandle; nOldHandle=nDstBrushHandle; nDstBrushHandle=AllocHandle(); @@ -1095,7 +1095,7 @@ void WMFWriter::SetLineAndFillAttr() CreateSelectDeleteBrush( aDstFillColor ); } if ( bDstIsClipping != bSrcIsClipping || - (bSrcIsClipping==TRUE && aDstClipRegion!=aSrcClipRegion)) { + (bSrcIsClipping==sal_True && aDstClipRegion!=aSrcClipRegion)) { bDstIsClipping=bSrcIsClipping; aDstClipRegion=aSrcClipRegion; } @@ -1180,7 +1180,7 @@ void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx: void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { - ULONG nA, nACount; + sal_uIntPtr nA, nACount; MetaAction* pMA; if( bStatus ) @@ -1698,8 +1698,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) const MetaEPSAction* pA = (const MetaEPSAction*)pMA; const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() ); - INT32 nCount = aGDIMetaFile.GetActionCount(); - for ( INT32 i = 0; i < nCount; i++ ) + sal_Int32 nCount = aGDIMetaFile.GetActionCount(); + for ( sal_Int32 i = 0; i < nCount; i++ ) { const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i ); if ( pMetaAct->GetType() == META_BMPSCALE_ACTION ) @@ -1802,9 +1802,9 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) MayCallback(); if (pWMF->GetError()) - bStatus=FALSE; + bStatus=sal_False; - if(bStatus==FALSE) + if(bStatus==sal_False) break; } } @@ -1812,13 +1812,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) // ------------------------------------------------------------------------ -void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable ) +void WMFWriter::WriteHeader( const GDIMetaFile &, sal_Bool bPlaceable ) { if( bPlaceable ) { - USHORT nCheckSum, nValue; + sal_uInt16 nCheckSum, nValue; Size aSize( pVirDev->LogicToLogic(Size(1,1),MapMode(MAP_INCH), aTargetMapMode) ); - USHORT nUnitsPerInch = (USHORT) ( ( aSize.Width() + aSize.Height() ) >> 1 ); + sal_uInt16 nUnitsPerInch = (sal_uInt16) ( ( aSize.Width() + aSize.Height() ) >> 1 ); nCheckSum=0; nValue=0xcdd7; nCheckSum^=nValue; *pWMF << nValue; @@ -1826,8 +1826,8 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable ) nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; - nValue=(USHORT) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue; - nValue=(USHORT) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue; + nValue=(sal_uInt16) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue; + nValue=(sal_uInt16) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue; nValue=nUnitsPerInch; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue; @@ -1848,13 +1848,13 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable ) void WMFWriter::UpdateHeader() { - ULONG nPos; + sal_uIntPtr nPos; sal_uInt32 nFileSize; nPos=pWMF->Tell(); // Endposition = Gesammtgroesse der Datei nFileSize=nPos-nMetafileHeaderPos; // Groesse des 1. Headers abziehen if ((nFileSize&1)!=0) { // ggf. auf ganze Worte aufrunden - *pWMF << (BYTE)0; + *pWMF << (sal_uInt8)0; nPos++; nFileSize++; } @@ -1868,13 +1868,13 @@ void WMFWriter::UpdateHeader() // ------------------------------------------------------------------------ -BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, - FilterConfigItem* pFConfigItem, BOOL bPlaceable ) +sal_Bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, + FilterConfigItem* pFConfigItem, sal_Bool bPlaceable ) { WMFWriterAttrStackMember * pAt; - bEmbedEMF = TRUE; - bStatus=TRUE; + bEmbedEMF = sal_True; + bStatus=sal_True; pConvert = 0; pVirDev = new VirtualDevice; @@ -1921,8 +1921,8 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, pAttrStack=NULL; - for (USHORT i=0; i<MAXOBJECTHANDLES; i++) - bHandleAllocated[i]=FALSE; + for (sal_uInt16 i=0; i<MAXOBJECTHANDLES; i++) + bHandleAllocated[i]=sal_False; nDstPenHandle=0xffff; nDstFontHandle=0xffff; @@ -1941,7 +1941,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, WriteEmbeddedEMF( rMTF ); WMFRecord_SetWindowOrg(Point(0,0)); WMFRecord_SetWindowExt(rMTF.GetPrefSize()); - WMFRecord_SetBkMode( TRUE ); + WMFRecord_SetBkMode( sal_True ); eDstROP2 = eSrcRasterOp = ROP_OVERPAINT; WMFRecord_SetROP2(eDstROP2); @@ -1954,7 +1954,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, CreateSelectDeleteBrush( aDstFillColor ); aDstClipRegion = aSrcClipRegion = Region(); - bDstIsClipping = bSrcIsClipping = FALSE; + bDstIsClipping = bSrcIsClipping = sal_False; Font aFont; aFont.SetCharSet( GetExtendedTextEncoding( gsl_getSystemTextEncoding() ) ); @@ -1994,11 +1994,11 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, // ------------------------------------------------------------------------ -USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode, +sal_uInt16 WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize) { Fraction aDivFrac(2, 1); - USHORT nDivisor = 1; + sal_uInt16 nDivisor = 1; Size aSize = pVirDev->LogicToLogic( rPrefSize, aSrcMapMode, rMapMode ); diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx index 9fe698b22c2e..b215b4f138a7 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.hxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx @@ -69,9 +69,9 @@ class WMFWriter { private: - BOOL bStatus; + sal_Bool bStatus; - ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde. + sal_uIntPtr nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde. FilterConfigItem* pFilterConfigItem; com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator; @@ -81,11 +81,11 @@ private: StarSymbolToMSMultiFont *pConvert; MapMode aTargetMapMode; Size aTargetSize; - USHORT nTargetDivisor; + sal_uInt16 nTargetDivisor; - ULONG nMetafileHeaderPos; + sal_uIntPtr nMetafileHeaderPos; sal_uInt32 nMaxRecordSize; // in Worten - ULONG nActRecordPos; + sal_uIntPtr nActRecordPos; // Aktuelle Attribute im Quell-Metafile: Color aSrcLineColor; @@ -96,11 +96,11 @@ private: FontAlign eSrcTextAlign; Font aSrcFont; MapMode aSrcMapMode; - BOOL bSrcIsClipping; + sal_Bool bSrcIsClipping; Region aSrcClipRegion; WMFWriterAttrStackMember * pAttrStack; - UINT32 eSrcHorTextAlign; + sal_uInt32 eSrcHorTextAlign; // Aktuelle Attribute im Ziel-Metafile: Color aDstLineColor; @@ -111,28 +111,28 @@ private: FontAlign eDstTextAlign; Font aDstFont; - UINT32 eDstHorTextAlign; + sal_uInt32 eDstHorTextAlign; - BOOL bDstIsClipping; // ???: derzeit unberuecksichtigt + sal_Bool bDstIsClipping; // ???: derzeit unberuecksichtigt Region aDstClipRegion; // ???: derzeit unberuecksichtigt - BOOL bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind - USHORT nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen + sal_Bool bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind + sal_uInt16 nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen // Selected-Objects besitzen // 0xffff = keines: // Damit nicht bei jeder Operation alle Attribute verglichen werden muessen: - ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile - ULONG nNumberOfBitmaps; // Anzahl der Bitmaps - ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders - ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps - ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist. + sal_uIntPtr nNumberOfActions; // Anzahl der Actions im GDIMetafile + sal_uIntPtr nNumberOfBitmaps; // Anzahl der Bitmaps + sal_uIntPtr nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders + sal_uIntPtr nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps + sal_uIntPtr nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist. - BOOL bEmbedEMF; // optionally embedd EMF data into WMF + sal_Bool bEmbedEMF; // optionally embedd EMF data into WMF void MayCallback(); // Berechnet anhand der obigen 5 Parameter eine Prozentzahl - // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen + // und macht dann ggf. einen Callback. Setzt bStatus auf sal_False wenn User abbrechen // moechte. void CountActionsAndBitmaps(const GDIMetaFile & rMTF); @@ -154,14 +154,14 @@ private: void UpdateRecordHeader(); // berichtig die Groesse des Records nach dem Schreiben der Parameter, wenn // nSizeWords bei Aufruf von WriteRecordHeader(..) unbekannt war. - // fuegt ggf. noch ein BYTE 0 ein damit Anzahl Bytes immer gerade. + // fuegt ggf. noch ein sal_uInt8 0 ein damit Anzahl Bytes immer gerade. void WMFRecord_Arc(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt); void WMFRecord_Chord(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt); void WMFRecord_CreateBrushIndirect(const Color& rColor); void WMFRecord_CreateFontIndirect(const Font & rFont); void WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo ); - void WMFRecord_DeleteObject(USHORT nObjectHandle); + void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle); void WMFRecord_Ellipse(const Rectangle & rRect); void WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData ); sal_Bool WMFRecord_Escape_Unicode( const Point& rPoint, const String& rStr, const sal_Int32 * pDXAry ); @@ -180,13 +180,13 @@ private: void WMFRecord_RestoreDC(); void WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound); void WMFRecord_SaveDC(); - void WMFRecord_SelectObject(USHORT nObjectHandle); + void WMFRecord_SelectObject(sal_uInt16 nObjectHandle); void WMFRecord_SetBkColor(const Color & rColor); - void WMFRecord_SetBkMode(BOOL bTransparent); + void WMFRecord_SetBkMode(sal_Bool bTransparent); void WMFRecord_SetStretchBltMode(); void WMFRecord_SetPixel(const Point & rPoint, const Color & rColor); void WMFRecord_SetROP2(RasterOp eROP); - void WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign); + void WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign); void WMFRecord_SetTextColor(const Color & rColor); void WMFRecord_SetWindowExt(const Size & rSize); void WMFRecord_SetWindowOrg(const Point & rPoint); @@ -195,8 +195,8 @@ private: void WMFRecord_EndOfFile(); void WMFRecord_IntersectClipRect( const Rectangle& rRect); - USHORT AllocHandle(); - void FreeHandle(USHORT nObjectHandle); + sal_uInt16 AllocHandle(); + void FreeHandle(sal_uInt16 nObjectHandle); void CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo ); void CreateSelectDeleteFont(const Font & rFont); void CreateSelectDeleteBrush(const Color& rColor); @@ -207,7 +207,7 @@ private: void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void WriteRecords(const GDIMetaFile & rMTF); - void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable); + void WriteHeader(const GDIMetaFile & rMTF, sal_Bool bPlaceable); void UpdateHeader(); void WriteEmbeddedEMF( const GDIMetaFile& rMTF ); @@ -217,13 +217,13 @@ private: sal_uInt32 nRecCounts, sal_uInt16 nCheckSum ); - USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); + sal_uInt16 CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); public: WMFWriter() {} - BOOL WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, BOOL bPlaceable=TRUE); + sal_Bool WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, sal_Bool bPlaceable=sal_True); }; #endif diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 5db73e6cc2f3..6c808baa169d 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -457,7 +457,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** case( UNOGRAPHIC_BITSPERPIXEL ): { - USHORT nBitsPerPixel = 0; + sal_uInt16 nBitsPerPixel = 0; if( mpGraphic ) { diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx index bed7c64c0411..2a8c06723eb6 100644 --- a/svtools/source/graphic/descriptor.hxx +++ b/svtools/source/graphic/descriptor.hxx @@ -123,7 +123,7 @@ private: ::rtl::OUString maMimeType; Size maSizePixel; Size maSize100thMM; - USHORT mnBitsPerPixel; + sal_uInt16 mnBitsPerPixel; bool mbTransparent; bool mbAlpha; bool mbAnimated; diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx index 757be42a104c..68c0ea9ae4a7 100644 --- a/svtools/source/graphic/grfattr.cxx +++ b/svtools/source/graphic/grfattr.cxx @@ -48,7 +48,7 @@ GraphicAttr::GraphicAttr() : mnRPercent ( 0 ), mnGPercent ( 0 ), mnBPercent ( 0 ), - mbInvert ( FALSE ), + mbInvert ( sal_False ), mcTransparency ( 0 ), meDrawMode ( GRAPHICDRAWMODE_STANDARD ) { @@ -62,7 +62,7 @@ GraphicAttr::~GraphicAttr() // ------------------------------------------------------------------------ -BOOL GraphicAttr::operator==( const GraphicAttr& rAttr ) const +sal_Bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const { return( ( mfGamma == rAttr.mfGamma ) && ( mnMirrFlags == rAttr.mnMirrFlags ) && @@ -87,7 +87,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr ) { VersionCompat aCompat( rIStm, STREAM_READ ); sal_uInt32 nTmp32; - UINT16 nTmp16; + sal_uInt16 nTmp16; rIStm >> nTmp32 >> nTmp32 >> rAttr.mfGamma >> rAttr.mnMirrFlags >> rAttr.mnRotate10; rIStm >> rAttr.mnContPercent >> rAttr.mnLumPercent >> rAttr.mnRPercent >> rAttr.mnGPercent >> rAttr.mnBPercent; @@ -111,7 +111,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr ) rOStm << nTmp32 << nTmp32 << rAttr.mfGamma << rAttr.mnMirrFlags << rAttr.mnRotate10; rOStm << rAttr.mnContPercent << rAttr.mnLumPercent << rAttr.mnRPercent << rAttr.mnGPercent << rAttr.mnBPercent; - rOStm << rAttr.mbInvert << rAttr.mcTransparency << (UINT16) rAttr.meDrawMode; + rOStm << rAttr.mbInvert << rAttr.mcTransparency << (sal_uInt16) rAttr.meDrawMode; rOStm << rAttr.mnLeftCrop << rAttr.mnTopCrop << rAttr.mnRightCrop << rAttr.mnBottomCrop; return rOStm; diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 41240c95d113..3768bab7f739 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -70,14 +70,14 @@ public: GraphicID( const GraphicObject& rObj ); ~GraphicID() {} - BOOL operator==( const GraphicID& rID ) const + sal_Bool operator==( const GraphicID& rID ) const { return( rID.mnID1 == mnID1 && rID.mnID2 == mnID2 && rID.mnID3 == mnID3 && rID.mnID4 == mnID4 ); } ByteString GetIDString() const; - BOOL IsEmpty() const { return( 0 == mnID4 ); } + sal_Bool IsEmpty() const { return( 0 == mnID4 ); } }; // ----------------------------------------------------------------------------- @@ -86,7 +86,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) { const Graphic& rGraphic = rObj.GetGraphic(); - mnID1 = ( (ULONG) rGraphic.GetType() ) << 28; + mnID1 = ( (sal_uIntPtr) rGraphic.GetType() ) << 28; switch( rGraphic.GetType() ) { @@ -105,7 +105,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) { const BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - mnID1 |= ( ( ( (ULONG) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff ); + mnID1 |= ( ( ( (sal_uIntPtr) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff ); mnID2 = aBmpEx.GetSizePixel().Width(); mnID3 = aBmpEx.GetSizePixel().Height(); mnID4 = rGraphic.GetChecksum(); @@ -167,10 +167,10 @@ private: BitmapEx* mpBmpEx; GDIMetaFile* mpMtf; Animation* mpAnimation; - BOOL mbSwappedAll; + sal_Bool mbSwappedAll; - BOOL ImplInit( const GraphicObject& rObj ); - BOOL ImplMatches( const GraphicObject& rObj ) const { return( GraphicID( rObj ) == maID ); } + sal_Bool ImplInit( const GraphicObject& rObj ); + sal_Bool ImplMatches( const GraphicObject& rObj ) const { return( GraphicID( rObj ) == maID ); } void ImplFillSubstitute( Graphic& rSubstitute ); public: @@ -181,13 +181,13 @@ public: const GraphicID& GetID() const { return maID; } void AddGraphicObjectReference( const GraphicObject& rObj, Graphic& rSubstitute ); - BOOL ReleaseGraphicObjectReference( const GraphicObject& rObj ); - ULONG GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); } - BOOL HasGraphicObjectReference( const GraphicObject& rObj ); + sal_Bool ReleaseGraphicObjectReference( const GraphicObject& rObj ); + sal_uIntPtr GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); } + sal_Bool HasGraphicObjectReference( const GraphicObject& rObj ); void TryToSwapIn(); void GraphicObjectWasSwappedOut( const GraphicObject& rObj ); - BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); + sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); void GraphicObjectWasSwappedIn( const GraphicObject& rObj ); }; @@ -216,9 +216,9 @@ GraphicCacheEntry::~GraphicCacheEntry() // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) +sal_Bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) { - BOOL bRet; + sal_Bool bRet; if( !rObj.IsSwappedOut() ) { @@ -260,10 +260,10 @@ BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) else maGfxLink = GfxLink(); - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -277,9 +277,9 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() ); const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() ); const String aDocFileName( rSubstitute.GetDocFileName() ); - const ULONG nDocFilePos = rSubstitute.GetDocFilePos(); + const sal_uIntPtr nDocFilePos = rSubstitute.GetDocFilePos(); const GraphicType eOldType = rSubstitute.GetType(); - const BOOL bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); + const sal_Bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); if( rSubstitute.IsLink() && ( GFX_LINK_TYPE_NONE == maGfxLink.GetType() ) ) maGfxLink = rSubstitute.GetLink(); @@ -321,16 +321,16 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) +sal_Bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() ) { if( &rObj == (GraphicObject*) pObj ) { maGraphicObjectList.Remove( pObj ); - bRet = TRUE; + bRet = sal_True; } } @@ -339,13 +339,13 @@ BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj ) +sal_Bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() ) if( &rObj == (GraphicObject*) pObj ) - bRet = TRUE; + bRet = sal_True; return bRet; } @@ -362,11 +362,11 @@ void GraphicCacheEntry::TryToSwapIn() void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*/ ) { - mbSwappedAll = TRUE; + mbSwappedAll = sal_True; for( void* pObj = maGraphicObjectList.First(); mbSwappedAll && pObj; pObj = maGraphicObjectList.Next() ) if( !( (GraphicObject*) pObj )->IsSwappedOut() ) - mbSwappedAll = FALSE; + mbSwappedAll = sal_False; if( mbSwappedAll ) { @@ -378,17 +378,17 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj* // ----------------------------------------------------------------------------- -BOOL GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +sal_Bool GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { - BOOL bRet; + sal_Bool bRet; if( !mbSwappedAll && rObj.IsSwappedOut() ) { ImplFillSubstitute( rSubstitute ); - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -415,13 +415,13 @@ private: BitmapEx* mpBmpEx; GraphicAttr maAttr; Size maOutSizePix; - ULONG mnCacheSize; - ULONG mnOutDevDrawMode; - USHORT mnOutDevBitCount; + sal_uIntPtr mnCacheSize; + sal_uIntPtr mnOutDevDrawMode; + sal_uInt16 mnOutDevBitCount; public: - static ULONG GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz, + static sal_uIntPtr GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ); public: @@ -457,15 +457,15 @@ public: const GraphicAttr& GetAttr() const { return maAttr; } const Size& GetOutputSizePixel() const { return maOutSizePix; } - ULONG GetCacheSize() const { return mnCacheSize; } + sal_uIntPtr GetCacheSize() const { return mnCacheSize; } const GraphicCacheEntry* GetReferencedCacheEntry() const { return mpRefCacheEntry; } - ULONG GetOutDevDrawMode() const { return mnOutDevDrawMode; } - USHORT GetOutDevBitCount() const { return mnOutDevBitCount; } + sal_uIntPtr GetOutDevDrawMode() const { return mnOutDevDrawMode; } + sal_uInt16 GetOutDevBitCount() const { return mnOutDevBitCount; } void SetReleaseTime( const ::vos::TTimeValue& rReleaseTime ) { maReleaseTime = rReleaseTime; } const ::vos::TTimeValue& GetReleaseTime() const { return maReleaseTime; } - BOOL Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel, + sal_Bool Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel, const GraphicCacheEntry* pCacheEntry, const GraphicAttr& rAttr ) const { // #i46805# Additional match @@ -486,12 +486,12 @@ public: // ----------------------------------------------------------------------------- -ULONG GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz, +sal_uIntPtr GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) { const Graphic& rGraphic = rObj.GetGraphic(); const GraphicType eType = rGraphic.GetType(); - ULONG nNeededSize; + sal_uIntPtr nNeededSize; if( GRAPHIC_BITMAP == eType ) { @@ -560,7 +560,7 @@ void GraphicDisplayCacheEntry::Draw( OutputDevice* pOut, const Point& rPt, const // - GraphicCache - // ----------------------- -GraphicCache::GraphicCache( GraphicManager& rMgr, ULONG nDisplayCacheSize, ULONG nMaxObjDisplayCacheSize ) : +GraphicCache::GraphicCache( GraphicManager& rMgr, sal_uIntPtr nDisplayCacheSize, sal_uIntPtr nMaxObjDisplayCacheSize ) : mrMgr ( rMgr ), mnReleaseTimeoutSeconds ( 0UL ), mnMaxDisplaySize ( nDisplayCacheSize ), @@ -585,7 +585,7 @@ GraphicCache::~GraphicCache() void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute, const ByteString* pID, const GraphicObject* pCopyObj ) { - BOOL bInserted = FALSE; + sal_Bool bInserted = sal_False; if( !rObj.IsSwappedOut() && ( pID || ( pCopyObj && ( pCopyObj->GetType() != GRAPHIC_NONE ) ) || ( rObj.GetType() != GRAPHIC_NONE ) ) ) @@ -599,7 +599,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( pEntry->HasGraphicObjectReference( *pCopyObj ) ) { pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + bInserted = sal_True; } else { @@ -640,14 +640,14 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( rID.GetIDString() == *pID ) { pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + bInserted = sal_True; } } if( !bInserted ) { maGraphicCache.Insert( new GraphicCacheEntry( rObj ), LIST_APPEND ); - bInserted = TRUE; + bInserted = sal_True; } } } @@ -656,7 +656,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( rEntryID == *apID ) { pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + bInserted = sal_True; } } @@ -676,7 +676,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj ) { // Release cached object GraphicCacheEntry* pEntry = (GraphicCacheEntry*) maGraphicCache.First(); - BOOL bRemoved = FALSE; + sal_Bool bRemoved = sal_False; while( !bRemoved && pEntry ) { @@ -729,12 +729,12 @@ void GraphicCache::GraphicObjectWasSwappedOut( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -BOOL GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +sal_Bool GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { GraphicCacheEntry* pEntry = ImplGetCacheEntry( rObj ); if( !pEntry ) - return FALSE; + return sal_False; return pEntry->FillSwappedGraphicObject( rObj, rSubstitute ); } @@ -759,7 +759,7 @@ void GraphicCache::GraphicObjectWasSwappedIn( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize ) +void GraphicCache::SetMaxDisplayCacheSize( sal_uIntPtr nNewCacheSize ) { mnMaxDisplaySize = nNewCacheSize; @@ -769,9 +769,9 @@ void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize ) // ----------------------------------------------------------------------------- -void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached ) +void GraphicCache::SetMaxObjDisplayCacheSize( sal_uIntPtr nNewMaxObjSize, sal_Bool bDestroyGreaterCached ) { - const BOOL bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) ); + const sal_Bool bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) ); mnMaxObjDisplaySize = Min( nNewMaxObjSize, mnMaxDisplaySize ); @@ -796,7 +796,7 @@ void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestro // ----------------------------------------------------------------------------- -void GraphicCache::SetCacheTimeout( ULONG nTimeoutSeconds ) +void GraphicCache::SetCacheTimeout( sal_uIntPtr nTimeoutSeconds ) { if( mnReleaseTimeoutSeconds != nTimeoutSeconds ) { @@ -830,7 +830,7 @@ void GraphicCache::ClearDisplayCache() // ----------------------------------------------------------------------------- -BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const { return( GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) <= @@ -839,20 +839,20 @@ BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, con // ----------------------------------------------------------------------------- -BOOL GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const { const Point aPtPixel( pOut->LogicToPixel( rPt ) ); const Size aSzPixel( pOut->LogicToPixel( rSz ) ); const GraphicCacheEntry* pCacheEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj ); //GraphicDisplayCacheEntry* pDisplayEntry = (GraphicDisplayCacheEntry*) ( (GraphicCache*) this )->maDisplayCache.First(); // -Wall removed .... - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; if( pCacheEntry ) { for( long i = 0, nCount = maDisplayCache.Count(); !bFound && ( i < nCount ); i++ ) if( ( (GraphicDisplayCacheEntry*) maDisplayCache.GetObject( i ) )->Matches( pOut, aPtPixel, aSzPixel, pCacheEntry, rAttr ) ) - bFound = TRUE; + bFound = sal_True; } return bFound; @@ -880,12 +880,12 @@ ByteString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const // ----------------------------------------------------------------------------- -BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const BitmapEx& rBmpEx ) { - const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); - BOOL bRet = FALSE; + const sal_uIntPtr nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); + sal_Bool bRet = sal_False; if( nNeededSize <= GetMaxObjDisplayCacheSize() ) { @@ -906,7 +906,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, maDisplayCache.Insert( pNewEntry, LIST_APPEND ); mnUsedDisplaySize += pNewEntry->GetCacheSize(); - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -914,12 +914,12 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const GDIMetaFile& rMtf ) { - const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); - BOOL bRet = FALSE; + const sal_uIntPtr nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ); + sal_Bool bRet = sal_False; if( nNeededSize <= GetMaxObjDisplayCacheSize() ) { @@ -940,7 +940,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, maDisplayCache.Insert( pNewEntry, LIST_APPEND ); mnUsedDisplaySize += pNewEntry->GetCacheSize(); - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -948,14 +948,14 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) { const Point aPtPixel( pOut->LogicToPixel( rPt ) ); const Size aSzPixel( pOut->LogicToPixel( rSz ) ); const GraphicCacheEntry* pCacheEntry = ImplGetCacheEntry( rObj ); GraphicDisplayCacheEntry* pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.First(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; while( !bRet && pDisplayCacheEntry ) { @@ -973,7 +973,7 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co } pDisplayCacheEntry->SetReleaseTime( aReleaseTime ); - bRet = TRUE; + bRet = sal_True; } else pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.Next(); @@ -987,9 +987,9 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co // ----------------------------------------------------------------------------- -BOOL GraphicCache::ImplFreeDisplayCacheSpace( ULONG nSizeToFree ) +sal_Bool GraphicCache::ImplFreeDisplayCacheSpace( sal_uIntPtr nSizeToFree ) { - ULONG nFreedSize = 0UL; + sal_uIntPtr nFreedSize = 0UL; if( nSizeToFree ) { diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx index 55309a00827d..99df81b1d32e 100644 --- a/svtools/source/graphic/grfcache.hxx +++ b/svtools/source/graphic/grfcache.hxx @@ -47,12 +47,12 @@ private: Timer maReleaseTimer; List maGraphicCache; List maDisplayCache; - ULONG mnReleaseTimeoutSeconds; - ULONG mnMaxDisplaySize; - ULONG mnMaxObjDisplaySize; - ULONG mnUsedDisplaySize; + sal_uIntPtr mnReleaseTimeoutSeconds; + sal_uIntPtr mnMaxDisplaySize; + sal_uIntPtr mnMaxObjDisplaySize; + sal_uIntPtr mnUsedDisplaySize; - BOOL ImplFreeDisplayCacheSpace( ULONG nSizeToFree ); + sal_Bool ImplFreeDisplayCacheSpace( sal_uIntPtr nSizeToFree ); GraphicCacheEntry* ImplGetCacheEntry( const GraphicObject& rObj ); @@ -61,8 +61,8 @@ private: public: GraphicCache( GraphicManager& rMgr, - ULONG nDisplayCacheSize = 10000000UL, - ULONG nMaxObjDisplayCacheSize = 2400000UL ); + sal_uIntPtr nDisplayCacheSize = 10000000UL, + sal_uIntPtr nMaxObjDisplayCacheSize = 2400000UL ); ~GraphicCache(); public: @@ -72,37 +72,37 @@ public: void ReleaseGraphicObject( const GraphicObject& rObj ); void GraphicObjectWasSwappedOut( const GraphicObject& rObj ); - BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); + sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); void GraphicObjectWasSwappedIn( const GraphicObject& rObj ); ByteString GetUniqueID( const GraphicObject& rObj ) const; public: - void SetMaxDisplayCacheSize( ULONG nNewCacheSize ); - ULONG GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; }; + void SetMaxDisplayCacheSize( sal_uIntPtr nNewCacheSize ); + sal_uIntPtr GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; }; - void SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE ); - ULONG GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; } + void SetMaxObjDisplayCacheSize( sal_uIntPtr nNewMaxObjSize, sal_Bool bDestroyGreaterCached = sal_False ); + sal_uIntPtr GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; } - ULONG GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; } - ULONG GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); } + sal_uIntPtr GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; } + sal_uIntPtr GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); } - void SetCacheTimeout( ULONG nTimeoutSeconds ); - ULONG GetCacheTimeout() const { return mnReleaseTimeoutSeconds; } + void SetCacheTimeout( sal_uIntPtr nTimeoutSeconds ); + sal_uIntPtr GetCacheTimeout() const { return mnReleaseTimeoutSeconds; } void ClearDisplayCache(); - BOOL IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const; - BOOL IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const; - BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const BitmapEx& rBmpEx ); - BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr, const GDIMetaFile& rMtf ); - BOOL DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + sal_Bool DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ); }; diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 221354cc6665..93ef8489412d 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -174,9 +174,9 @@ void GraphicObject::ImplConstruct() mpSwapOutTimer = NULL; mpSimpleCache = NULL; mnAnimationLoopCount = 0; - mbAutoSwapped = FALSE; - mbIsInSwapIn = FALSE; - mbIsInSwapOut = FALSE; + mbAutoSwapped = sal_False; + mbIsInSwapIn = sal_False; + mbIsInSwapOut = sal_False; } // ----------------------------------------------------------------------------- @@ -198,7 +198,7 @@ void GraphicObject::ImplAssignGraphicData() mbEPS = ( rMtf.GetActionCount() >= 1 ) && ( META_EPS_ACTION == rMtf.GetAction( 0 )->GetType() ); } else - mbEPS = FALSE; + mbEPS = sal_False; } // ----------------------------------------------------------------------------- @@ -247,13 +247,13 @@ void GraphicObject::ImplAutoSwapIn() if( IsSwappedOut() ) { if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; else { - mbIsInSwapIn = TRUE; + mbIsInSwapIn = sal_True; if( maGraphic.SwapIn() ) - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; else { SvStream* pStream = GetSwapStream(); @@ -296,7 +296,7 @@ void GraphicObject::ImplAutoSwapIn() } } - mbIsInSwapIn = FALSE; + mbIsInSwapIn = sal_False; if( !mbAutoSwapped && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedIn( *this ); @@ -305,15 +305,15 @@ void GraphicObject::ImplAutoSwapIn() } // ----------------------------------------------------------------------------- -BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, - PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const +sal_Bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, + PolyPolygon& rClipPolyPoly, sal_Bool& bRectClipRegion ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( GetType() != GRAPHIC_NONE ) { Polygon aClipPoly( Rectangle( rPt, rSz ) ); - const USHORT nRot10 = pAttr->GetRotation() % 3600; + const sal_uInt16 nRot10 = pAttr->GetRotation() % 3600; const Point aOldOrigin( rPt ); // --> OD 2005-09-30 #i54875# - It's not needed to get the graphic again. // const Graphic& rGraphic = GetGraphic(); @@ -327,10 +327,10 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz if( nRot10 ) { aClipPoly.Rotate( rPt, nRot10 ); - bRectClipRegion = FALSE; + bRectClipRegion = sal_False; } else - bRectClipRegion = TRUE; + bRectClipRegion = sal_True; rClipPolyPoly = aClipPoly; @@ -379,7 +379,7 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz rPt = aOriginPoly[ 0 ]; } - bRet = TRUE; + bRet = sal_True; } } @@ -404,7 +404,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj ) mpLink = rGraphicObj.mpLink ? new String( *rGraphicObj.mpLink ) : NULL; mpUserData = rGraphicObj.mpUserData ? new String( *rGraphicObj.mpUserData ) : NULL; ImplAssignGraphicData(); - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; mpMgr = rGraphicObj.mpMgr; mpMgr->ImplRegisterObj( *this, maGraphic, NULL, &rGraphicObj ); @@ -415,7 +415,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj ) // ----------------------------------------------------------------------------- -BOOL GraphicObject::operator==( const GraphicObject& rGraphicObj ) const +sal_Bool GraphicObject::operator==( const GraphicObject& rGraphicObj ) const { return( ( rGraphicObj.maGraphic == maGraphic ) && ( rGraphicObj.maAttr == maAttr ) && @@ -460,7 +460,7 @@ ByteString GraphicObject::GetUniqueID() const // ----------------------------------------------------------------------------- -ULONG GraphicObject::GetChecksum() const +sal_uIntPtr GraphicObject::GetChecksum() const { return( ( maGraphic.IsSupportedGraphic() && !maGraphic.IsSwapOut() ) ? maGraphic.GetChecksum() : 0 ); } @@ -475,7 +475,7 @@ SvStream* GraphicObject::GetSwapStream() const // ----------------------------------------------------------------------------- // !!! to be removed -ULONG GraphicObject::GetReleaseFromCache() const +sal_uIntPtr GraphicObject::GetReleaseFromCache() const { return 0; } @@ -553,7 +553,7 @@ void GraphicObject::SetSwapStreamHdl() // ----------------------------------------------------------------------------- -void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout ) +void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const sal_uIntPtr nSwapOutTimeout ) { delete mpSwapStreamHdl, mpSwapStreamHdl = new Link( rHdl ); @@ -614,10 +614,10 @@ void GraphicObject::SetGraphicManager( const GraphicManager& rMgr ) // ----------------------------------------------------------------------------- -BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr, ULONG nFlags ) const +sal_Bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr, sal_uIntPtr nFlags ) const { - BOOL bRet; + sal_Bool bRet; if( nFlags & GRFMGR_DRAW_CACHED ) { @@ -630,13 +630,13 @@ BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& if ( pAttr->IsCropped() ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; + sal_Bool bRectClip; ImplGetCropParams( pOut, aPt, aSz, pAttr, aClipPolyPoly, bRectClip ); } bRet = mpMgr->IsInCache( pOut, aPt, aSz, *this, ( pAttr ? *pAttr : GetAttr() ) ); } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -665,16 +665,16 @@ List* GraphicObject::GetAnimationInfoList() const // ----------------------------------------------------------------------------- -BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr, ULONG nFlags ) +sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr, sal_uIntPtr nFlags ) { GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() ); Point aPt( rPt ); Size aSz( rSz ); const sal_uInt32 nOldDrawMode = pOut->GetDrawMode(); - BOOL bCropped = aAttr.IsCropped(); - BOOL bCached = FALSE; - BOOL bRet; + sal_Bool bCropped = aAttr.IsCropped(); + sal_Bool bCached = sal_False; + sal_Bool bRet; // #i29534# Provide output rects for PDF writer Rectangle aCropRect; @@ -701,8 +701,8 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, if( bCropped ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; - const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); + sal_Bool bRectClip; + const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); pOut->Push( PUSH_CLIPREGION ); @@ -743,10 +743,10 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, } // --> OD 2010-01-04 #i105243# -BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, +sal_Bool GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, const Point& rPt, const Size& rSz, const GraphicAttr* pGrfAttr, - const ULONG nFlags ) + const sal_uIntPtr nFlags ) { const GraphicAttr aGrfAttr( pGrfAttr ? *pGrfAttr : GetAttr() ); @@ -773,8 +773,8 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, if( aGrfAttr.IsCropped() ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; - const BOOL bCrop = ImplGetCropParams( &rOutDev, + sal_Bool bRectClip; + const sal_Bool bCrop = ImplGetCropParams( &rOutDev, aPt, aSz, &aGrfAttr, aClipPolyPoly, @@ -789,7 +789,7 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, } } - BOOL bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags ); + sal_Bool bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags ); // Notify PDF writer about linked graphic (if any) if( bWritingPdfLinkedGraphic ) @@ -806,11 +806,11 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev, // ----------------------------------------------------------------------------- -BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, - const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D ) +sal_Bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, + const Size& rOffset, const GraphicAttr* pAttr, sal_uIntPtr nFlags, int nTileCacheSize1D ) { if( pOut == NULL || rSize.Width() == 0 || rSize.Height() == 0 ) - return FALSE; + return sal_False; const MapMode aOutMapMode( pOut->GetMapMode() ); const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() ); @@ -830,11 +830,11 @@ BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const // ----------------------------------------------------------------------------- -BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, - long nExtraData, const GraphicAttr* pAttr, ULONG /*nFlags*/, +sal_Bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, + long nExtraData, const GraphicAttr* pAttr, sal_uIntPtr /*nFlags*/, OutputDevice* pFirstFrameOutDev ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; GetGraphic(); @@ -846,13 +846,13 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const { Point aPt( rPt ); Size aSz( rSz ); - BOOL bCropped = aAttr.IsCropped(); + sal_Bool bCropped = aAttr.IsCropped(); if( bCropped ) { PolyPolygon aClipPolyPoly; - BOOL bRectClip; - const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); + sal_Bool bRectClip; + const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); pOut->Push( PUSH_CLIPREGION ); @@ -879,7 +879,7 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const if( bCropped ) pOut->Pop(); - bRet = TRUE; + bRet = sal_True; } else bRet = Draw( pOut, rPt, rSz, &aAttr, GRFMGR_DRAW_STANDARD ); @@ -916,7 +916,7 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC mpSwapOutTimer->Stop(); maGraphic = rGraphic; - mbAutoSwapped = FALSE; + mbAutoSwapped = sal_False; ImplAssignGraphicData(); delete mpLink, mpLink = NULL; delete mpSimpleCache, mpSimpleCache = NULL; @@ -1042,7 +1042,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo // #105641# Also crop animations if( aTransGraphic.IsAnimated() ) { - USHORT nFrame; + sal_uInt16 nFrame; Animation aAnim( aTransGraphic.GetAnimation() ); for( nFrame=0; nFrame<aAnim.Count(); ++nFrame ) @@ -1059,7 +1059,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo // cropping affects this frame, apply it then // do _not_ apply enlargement, this is done below ImplTransformBitmap( aAnimBmp.aBmpEx, rAttr, Size(), Size(), - aCropRectRel, rDestSize, FALSE ); + aCropRectRel, rDestSize, sal_False ); aAnim.Replace( aAnimBmp, nFrame ); } @@ -1106,7 +1106,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo BitmapEx aBmpEx( aTransGraphic.GetBitmapEx() ); ImplTransformBitmap( aBmpEx, rAttr, aCropLeftTop, aCropRightBottom, - aCropRect, rDestSize, TRUE ); + aCropRect, rDestSize, sal_True ); aTransGraphic = aBmpEx; } @@ -1188,9 +1188,9 @@ void GraphicObject::ResetAnimationLoopCount() // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapOut() +sal_Bool GraphicObject::SwapOut() { - BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : FALSE ); + sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : sal_False ); if( bRet && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedOut( *this ); @@ -1200,9 +1200,9 @@ BOOL GraphicObject::SwapOut() // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapOut( SvStream* pOStm ) +sal_Bool GraphicObject::SwapOut( SvStream* pOStm ) { - BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : FALSE ); + sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : sal_False ); if( bRet && mpMgr ) mpMgr->ImplGraphicObjectWasSwappedOut( *this ); @@ -1212,17 +1212,17 @@ BOOL GraphicObject::SwapOut( SvStream* pOStm ) // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapIn() +sal_Bool GraphicObject::SwapIn() { - BOOL bRet; + sal_Bool bRet; if( mbAutoSwapped ) { ImplAutoSwapIn(); - bRet = TRUE; + bRet = sal_True; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) - bRet = TRUE; + bRet = sal_True; else { bRet = maGraphic.SwapIn(); @@ -1239,17 +1239,17 @@ BOOL GraphicObject::SwapIn() // ----------------------------------------------------------------------------- -BOOL GraphicObject::SwapIn( SvStream* pIStm ) +sal_Bool GraphicObject::SwapIn( SvStream* pIStm ) { - BOOL bRet; + sal_Bool bRet; if( mbAutoSwapped ) { ImplAutoSwapIn(); - bRet = TRUE; + bRet = sal_True; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) - bRet = TRUE; + bRet = sal_True; else { bRet = maGraphic.SwapIn( pIStm ); @@ -1270,7 +1270,7 @@ void GraphicObject::SetSwapState() { if( !IsSwappedOut() ) { - mbAutoSwapped = TRUE; + mbAutoSwapped = sal_True; if( mpMgr ) mpMgr->ImplGraphicObjectWasSwappedOut( *this ); @@ -1283,7 +1283,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG ) { if( !IsSwappedOut() ) { - mbIsInSwapOut = TRUE; + mbIsInSwapOut = sal_True; SvStream* pStream = GetSwapStream(); @@ -1303,7 +1303,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG ) } } - mbIsInSwapOut = FALSE; + mbIsInSwapOut = sal_False; } if( mpSwapOutTimer ) @@ -1320,7 +1320,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj ) Graphic aGraphic; GraphicAttr aAttr; ByteString aLink; - BOOL bLink; + sal_Bool bLink; rIStm >> aGraphic >> aAttr >> bLink; @@ -1345,7 +1345,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj ) SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj ) { VersionCompat aCompat( rOStm, STREAM_WRITE, 1 ); - const BOOL bLink = rGraphicObj.HasLink(); + const sal_Bool bLink = rGraphicObj.HasLink(); rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink; diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 7e1255aabc56..c0ed79a417d2 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -47,7 +47,7 @@ // ----------- #define MAX_PRINTER_EXT 1024 -#define MAP( cVal0, cVal1, nFrac ) ((BYTE)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L)) +#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L)) #define WATERMARK_LUM_OFFSET 50 #define WATERMARK_CON_OFFSET -70 @@ -113,7 +113,7 @@ BitmapEx muckWithBitmap( const BitmapEx& rBmpEx, // - GraphicManager - // ------------------ -GraphicManager::GraphicManager( ULONG nCacheSize, ULONG nMaxObjCacheSize ) : +GraphicManager::GraphicManager( sal_uIntPtr nCacheSize, sal_uIntPtr nMaxObjCacheSize ) : mpCache( new GraphicCache( *this, nCacheSize, nMaxObjCacheSize ) ) { } @@ -130,56 +130,56 @@ GraphicManager::~GraphicManager() // ----------------------------------------------------------------------------- -void GraphicManager::SetMaxCacheSize( ULONG nNewCacheSize ) +void GraphicManager::SetMaxCacheSize( sal_uIntPtr nNewCacheSize ) { mpCache->SetMaxDisplayCacheSize( nNewCacheSize ); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetMaxCacheSize() const +sal_uIntPtr GraphicManager::GetMaxCacheSize() const { return mpCache->GetMaxDisplayCacheSize(); } // ----------------------------------------------------------------------------- -void GraphicManager::SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached ) +void GraphicManager::SetMaxObjCacheSize( sal_uIntPtr nNewMaxObjSize, sal_Bool bDestroyGreaterCached ) { mpCache->SetMaxObjDisplayCacheSize( nNewMaxObjSize, bDestroyGreaterCached ); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetMaxObjCacheSize() const +sal_uIntPtr GraphicManager::GetMaxObjCacheSize() const { return mpCache->GetMaxObjDisplayCacheSize(); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetUsedCacheSize() const +sal_uIntPtr GraphicManager::GetUsedCacheSize() const { return mpCache->GetUsedDisplayCacheSize(); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetFreeCacheSize() const +sal_uIntPtr GraphicManager::GetFreeCacheSize() const { return mpCache->GetFreeDisplayCacheSize(); } // ----------------------------------------------------------------------------- -void GraphicManager::SetCacheTimeout( ULONG nTimeoutSeconds ) +void GraphicManager::SetCacheTimeout( sal_uIntPtr nTimeoutSeconds ) { mpCache->SetCacheTimeout( nTimeoutSeconds ); } // ----------------------------------------------------------------------------- -ULONG GraphicManager::GetCacheTimeout() const +sal_uIntPtr GraphicManager::GetCacheTimeout() const { return mpCache->GetCacheTimeout(); } @@ -200,7 +200,7 @@ void GraphicManager::ReleaseFromCache( const GraphicObject& /*rObj*/ ) // ----------------------------------------------------------------------------- -BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, +sal_Bool GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicObject& rObj, const GraphicAttr& rAttr ) const { @@ -209,15 +209,15 @@ BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, +sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const ULONG nFlags, BOOL& rCached ) + const sal_uIntPtr nFlags, sal_Bool& rCached ) { Point aPt( rPt ); Size aSz( rSz ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - rCached = FALSE; + rCached = sal_False; if( ( rObj.GetType() == GRAPHIC_BITMAP ) || ( rObj.GetType() == GRAPHIC_GDIMETAFILE ) ) { @@ -235,7 +235,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& if( aGraphic.IsSupportedGraphic() ) { - const USHORT nRot10 = rAttr.GetRotation() % 3600; + const sal_uInt16 nRot10 = rAttr.GetRotation() % 3600; if( nRot10 ) { @@ -250,7 +250,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& aGraphic.Draw( pOut, aPt, aSz ); } - bRet = TRUE; + bRet = sal_True; } if( !bRet ) @@ -259,7 +259,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& if( !mpCache->DrawDisplayCacheObj( pOut, aPt, aSz, rObj, rAttr ) ) bRet = ImplDraw( pOut, aPt, aSz, rObj, rAttr, nFlags, rCached ); else - bRet = rCached = TRUE; + bRet = rCached = sal_True; } } @@ -299,7 +299,7 @@ ByteString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +sal_Bool GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { return( mpCache->FillSwappedGraphicObject( rObj, rSubstitute ) ); } @@ -313,13 +313,13 @@ void GraphicManager::ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, +sal_Bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, GraphicObject& rObj, const GraphicAttr& rAttr, - const ULONG nFlags, BOOL& rCached ) + const sal_uIntPtr nFlags, sal_Bool& rCached ) { const Graphic& rGraphic = rObj.GetGraphic(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( rGraphic.IsSupportedGraphic() && !rGraphic.IsSwapOut() ) { @@ -337,7 +337,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( ImplCreateOutput( pOut, rPt, rSz, aSrcBmpEx, rAttr, nFlags, &aDstBmpEx ) ) { rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx ); - bRet = TRUE; + bRet = sal_True; } } @@ -365,13 +365,13 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( ImplCreateOutput( pOut, rPt, rSz, aContainedBmpEx, rAttr, nFlags, &aDstBmpEx ) ) { rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx ); - bRet = TRUE; + bRet = sal_True; } } else { rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstMtf ); - bRet = TRUE; + bRet = sal_True; } } } @@ -383,7 +383,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( aGraphic.IsSupportedGraphic() ) { aGraphic.Draw( pOut, rPt, rSz ); - bRet = TRUE; + bRet = sal_True; } } } @@ -394,16 +394,16 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, +sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, const BitmapEx& rBmpEx, const GraphicAttr& rAttr, - const ULONG nFlags, BitmapEx* pBmpEx ) + const sal_uIntPtr nFlags, BitmapEx* pBmpEx ) { - USHORT nRot10 = rAttr.GetRotation() % 3600; + sal_uInt16 nRot10 = rAttr.GetRotation() % 3600; Point aOutPtPix; Size aOutSzPix; Size aUnrotatedSzPix( pOut->LogicToPixel( rSz ) ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( nRot10 ) { @@ -438,8 +438,8 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, long* pMapFY = new long[ nNewH ]; long nStartX = -1, nStartY = -1, nEndX = -1, nEndY = -1; long nX, nY, nTmp, nTmpX, nTmpY; - BOOL bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0; - BOOL bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0; + sal_Bool bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0; + sal_Bool bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0; if( nFlags & GRFMGR_DRAW_BILINEAR ) { @@ -541,7 +541,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, // do transformation if( nStartX >= 0L ) { - const BOOL bSimple = ( 1 == nW || 1 == nH ); + const sal_Bool bSimple = ( 1 == nW || 1 == nH ); if( nRot10 ) { @@ -570,7 +570,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, aOutPt = pOut->PixelToLogic( aOutPtPix ); aOutSz = pOut->PixelToLogic( aOutSzPix ); aOutBmpEx = aBmpEx; - bRet = TRUE; + bRet = sal_True; } else { @@ -624,10 +624,10 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, +sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GDIMetaFile& rMtf, const GraphicAttr& rAttr, - const ULONG /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ) + const sal_uIntPtr /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ) { const Size aNewSize( rMtf.GetPrefSize() ); @@ -919,12 +919,12 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut, rOutBmpEx = BitmapEx(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, +sal_Bool GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, long nStartX, long nEndX, long nStartY, long nEndY, BitmapEx& rOutBmpEx ) @@ -938,8 +938,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, const long nDstH = nEndY - nStartY + 1L; long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY; long nXDst, nYDst; - BYTE cR0, cG0, cB0, cR1, cG1, cB1; - BOOL bRet = FALSE; + sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1; + sal_Bool bRet = sal_False; DBG_ASSERT( aBmp.GetSizePixel() == rBmpEx.GetSizePixel(), "GraphicManager::ImplCreateScaled(): bmp size inconsistent" ); @@ -1117,7 +1117,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, } aOutBmp.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aBmp.ReleaseAccess( pAcc ); @@ -1125,7 +1125,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, if( bRet && rBmpEx.IsTransparent() ) { - bRet = FALSE; + bRet = sal_False; if( rBmpEx.IsAlpha() ) { @@ -1198,7 +1198,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, } aOutAlpha.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aAlpha.ReleaseAccess( pAcc ); @@ -1277,7 +1277,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, { for( nX = 0L; nX < nDstW; nX++ ) { - if( pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB ) + if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB ) pWAcc->SetPixel( nY, nX, aWB ); else pWAcc->SetPixel( nY, nX, aWW ); @@ -1302,7 +1302,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, delete[] pMapLX; delete[] pMapLY; aOutMsk.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aMsk.ReleaseAccess( pAcc ); @@ -1323,8 +1323,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx, // ----------------------------------------------------------------------------- -BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, - USHORT nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix, +sal_Bool GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, + sal_uInt16 nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix, long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, long nStartX, long nEndX, long nStartY, long nEndY, BitmapEx& rOutBmpEx ) @@ -1347,8 +1347,8 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, long* pCosY = new long[ nDstH ]; long* pSinY = new long[ nDstH ]; long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY, nUnRotX, nUnRotY, nSinY, nCosY; - BYTE cR0, cG0, cB0, cR1, cG1, cB1; - BOOL bRet = FALSE; + sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1; + sal_Bool bRet = sal_False; // create horizontal mapping table for( nX = 0L, nTmpX = aNewBound.Left() + nStartX; nX < nDstW; nX++ ) @@ -1453,7 +1453,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, } aOutBmp.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aBmp.ReleaseAccess( pAcc ); @@ -1462,7 +1462,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, // mask processing if( bRet && ( rBmpEx.IsTransparent() || ( nRot10 != 900 && nRot10 != 1800 && nRot10 != 2700 ) ) ) { - bRet = FALSE; + bRet = sal_False; if( rBmpEx.IsAlpha() ) { @@ -1553,7 +1553,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, } aOutAlpha.ReleaseAccess( pWAcc ); - bRet = TRUE; + bRet = sal_True; } aAlpha.ReleaseAccess( pAcc ); @@ -1626,7 +1626,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, if( pMAcc ) aMsk.ReleaseAccess( pMAcc ); - bRet = TRUE; + bRet = sal_True; } aOutMsk.ReleaseAccess( pWAcc ); @@ -1652,7 +1652,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx, // ----------------------------------------------------------------------------- -void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ) +void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal_uIntPtr nAdjustmentFlags ) { GraphicAttr aAttr( rAttr ); @@ -1700,7 +1700,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO if( ( nAdjustmentFlags & ADJUSTMENT_TRANSPARENCY ) && aAttr.IsTransparent() ) { AlphaMask aAlpha; - BYTE cTrans = aAttr.GetTransparency(); + sal_uInt8 cTrans = aAttr.GetTransparency(); if( !rBmpEx.IsTransparent() ) aAlpha = AlphaMask( rBmpEx.GetSizePixel(), &cTrans ); @@ -1716,7 +1716,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO if( pA ) { - ULONG nTrans = cTrans, nNewTrans; + sal_uIntPtr nTrans = cTrans, nNewTrans; const long nWidth = pA->Width(), nHeight = pA->Height(); if( pA->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) @@ -1728,7 +1728,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO for( long nX = 0; nX < nWidth; nX++ ) { nNewTrans = nTrans + *pAScan; - *pAScan++ = (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ); + *pAScan++ = (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ); } } } @@ -1741,7 +1741,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO for( long nX = 0; nX < nWidth; nX++ ) { nNewTrans = nTrans + pA->GetPixel( nY, nX ).GetIndex(); - aAlphaValue.SetIndex( (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) ); + aAlphaValue.SetIndex( (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) ); pA->SetPixel( nY, nX, aAlphaValue ); } } @@ -1757,7 +1757,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO // ----------------------------------------------------------------------------- -void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ) +void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sal_uIntPtr nAdjustmentFlags ) { GraphicAttr aAttr( rAttr ); @@ -1810,7 +1810,7 @@ void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, UL // ----------------------------------------------------------------------------- -void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ) +void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, sal_uIntPtr nAdjustmentFlags ) { GraphicAttr aAttr( rAttr ); @@ -1866,7 +1866,7 @@ void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr void GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GDIMetaFile& rMtf, const GraphicAttr& rAttr ) { - USHORT nRot10 = rAttr.GetRotation() % 3600; + sal_uInt16 nRot10 = rAttr.GetRotation() % 3600; Point aOutPt( rPt ); Size aOutSz( rSz ); @@ -1924,7 +1924,7 @@ struct ImplTileInfo bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, int nNumTilesX, int nNumTilesY, const Size& rTileSizePixel, - const GraphicAttr* pAttr, ULONG nFlags ) + const GraphicAttr* pAttr, sal_uIntPtr nFlags ) { if( nExponent <= 1 ) return false; @@ -1944,8 +1944,8 @@ bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, // #105229# Switch off mapping (converting to logic and back to // pixel might cause roundoff errors) - BOOL bOldMap( rVDev.IsMapModeEnabled() ); - rVDev.EnableMapMode( FALSE ); + sal_Bool bOldMap( rVDev.IsMapModeEnabled() ); + rVDev.EnableMapMode( sal_False ); bool bRet( ImplRenderTileRecursive( rVDev, nExponent, nMSBFactor, nNumTilesX, nNumTilesY, nNumTilesX, nNumTilesY, rTileSizePixel, pAttr, nFlags, aTileInfo ) ); @@ -1968,7 +1968,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent int nNumOrigTilesX, int nNumOrigTilesY, int nRemainderTilesX, int nRemainderTilesY, const Size& rTileSizePixel, const GraphicAttr* pAttr, - ULONG nFlags, ImplTileInfo& rTileInfo ) + sal_uIntPtr nFlags, ImplTileInfo& rTileInfo ) { // gets loaded with our tile bitmap GraphicObject aTmpGraphic; @@ -2143,7 +2143,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent // ----------------------------------------------------------------------------- bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel, - const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D ) + const Size& rOffset, const GraphicAttr* pAttr, sal_uIntPtr nFlags, int nTileCacheSize1D ) { // how many tiles to generate per recursion step enum{ SubdivisionExponent=2 }; @@ -2254,7 +2254,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, int nNumTilesX, int nNumTilesY, - const Size& rTileSizePixel, const GraphicAttr* pAttr, ULONG nFlags ) + const Size& rTileSizePixel, const GraphicAttr* pAttr, sal_uIntPtr nFlags ) { Point aCurrPos( rPosPixel ); Size aTileSizeLogic( rOut.PixelToLogic( rTileSizePixel ) ); @@ -2262,14 +2262,14 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, // #107607# Use logical coordinates for metafile playing, too bool bDrawInPixel( rOut.GetConnectMetaFile() == NULL && GRAPHIC_BITMAP == GetType() ); - BOOL bRet( FALSE ); + sal_Bool bRet( sal_False ); // #105229# Switch off mapping (converting to logic and back to // pixel might cause roundoff errors) - BOOL bOldMap( rOut.IsMapModeEnabled() ); + sal_Bool bOldMap( rOut.IsMapModeEnabled() ); if( bDrawInPixel ) - rOut.EnableMapMode( FALSE ); + rOut.EnableMapMode( sal_False ); for( nY=0; nY < nNumTilesY; ++nY ) { @@ -2308,7 +2308,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx, const Size& rCropRightBottom, const Rectangle& rCropRect, const Size& rDstSize, - BOOL bEnlarge ) const + sal_Bool bEnlarge ) const { // #107947# Extracted from svdograf.cxx diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index fbf95406a63a..c4420b6b35e4 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -337,7 +337,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const : if( 0 < nImageId ) { - const Image aImage( aImageList.GetImage( sal::static_int_cast< USHORT >(nImageId) ) ); + const Image aImage( aImageList.GetImage( sal::static_int_cast< sal_uInt16 >(nImageId) ) ); aBmpEx = aImage.GetBitmapEx(); } else diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx index 1beae4a54355..65db0f444faa 100644 --- a/svtools/source/hatchwindow/ipwin.cxx +++ b/svtools/source/hatchwindow/ipwin.cxx @@ -43,7 +43,7 @@ SvResizeHelper::SvResizeHelper() : aBorder( 5, 5 ) , nGrab( -1 ) - , bResizeable( TRUE ) + , bResizeable( sal_True ) { } @@ -127,7 +127,7 @@ void SvResizeHelper::Draw( OutputDevice * pDev ) Rectangle aMoveRects[ 4 ]; FillMoveRectsPixel( aMoveRects ); - USHORT i; + sal_uInt16 i; for( i = 0; i < 4; i++ ) pDev->DrawRect( aMoveRects[ i ] ); if( bResizeable ) @@ -151,7 +151,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin ) { Rectangle aMoveRects[ 4 ]; FillMoveRectsPixel( aMoveRects ); - for( USHORT i = 0; i < 4; i++ ) + for( sal_uInt16 i = 0; i < 4; i++ ) pWin->Invalidate( aMoveRects[ i ] ); } @@ -160,7 +160,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin ) |* |* Beschreibung *************************************************************************/ -BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos ) +sal_Bool SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos ) { if( -1 == nGrab ) { @@ -169,10 +169,10 @@ BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos ) { aSelPos = rPos; // Start-Position merken pWin->CaptureMouse(); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } /************************************************************************* @@ -188,14 +188,14 @@ short SvResizeHelper::SelectMove( Window * pWin, const Point & rPos ) { Rectangle aRects[ 8 ]; FillHandleRectsPixel( aRects ); - for( USHORT i = 0; i < 8; i++ ) + for( sal_uInt16 i = 0; i < 8; i++ ) if( aRects[ i ].IsInside( rPos ) ) return i; } // Move-Rect ueberlappen Handles Rectangle aMoveRects[ 4 ]; FillMoveRectsPixel( aMoveRects ); - for( USHORT i = 0; i < 4; i++ ) + for( sal_uInt16 i = 0; i < 4; i++ ) if( aMoveRects[ i ].IsInside( rPos ) ) return 8; } @@ -420,7 +420,7 @@ void SvResizeHelper::ValidateRect( Rectangle & rValidate ) const |* |* Beschreibung *************************************************************************/ -BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos, +sal_Bool SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos, Rectangle & rOutPosSize ) { if( -1 != nGrab ) @@ -430,9 +430,9 @@ BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos, nGrab = -1; pWin->ReleaseMouse(); pWin->HideTracking(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /************************************************************************* @@ -631,7 +631,7 @@ long SvResizeWindow::Notify( NotifyEvent& rEvt ) { if ( rEvt.GetType() == EVENT_LOSEFOCUS && m_bActive ) { - BOOL bHasFocus = HasChildPathFocus(TRUE); + sal_Bool bHasFocus = HasChildPathFocus(sal_True); if ( !bHasFocus ) { m_bActive = sal_False; diff --git a/svtools/source/hatchwindow/ipwin.hxx b/svtools/source/hatchwindow/ipwin.hxx index 4c7cb6d88d36..1c58bc5b7178 100644 --- a/svtools/source/hatchwindow/ipwin.hxx +++ b/svtools/source/hatchwindow/ipwin.hxx @@ -40,11 +40,11 @@ class SvResizeHelper Rectangle aOuter; short nGrab; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle... Point aSelPos; - BOOL bResizeable; + sal_Bool bResizeable; public: SvResizeHelper(); - void SetResizeable( BOOL b ) { bResizeable = b; } + void SetResizeable( sal_Bool b ) { bResizeable = b; } short GetGrab() const { return nGrab; } void SetBorderPixel( const Size & rBorderP ) { aBorder = rBorderP; } @@ -67,12 +67,12 @@ public: void FillMoveRectsPixel( Rectangle aRects[ 4 ] ) const; void Draw( OutputDevice * ); void InvalidateBorder( Window * ); - BOOL SelectBegin( Window *, const Point & rPos ); + sal_Bool SelectBegin( Window *, const Point & rPos ); short SelectMove( Window * pWin, const Point & rPos ); Point GetTrackPosPixel( const Rectangle & rRect ) const; Rectangle GetTrackRectPixel( const Point & rTrackPos ) const; void ValidateRect( Rectangle & rValidate ) const; - BOOL SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize ); + sal_Bool SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize ); void Release( Window * pWin ); }; diff --git a/svtools/source/inc/gifread.hxx b/svtools/source/inc/gifread.hxx index de4c6935ef67..64ed6c2b8cb1 100644 --- a/svtools/source/inc/gifread.hxx +++ b/svtools/source/inc/gifread.hxx @@ -88,41 +88,41 @@ class GIFReader : public GraphicReader long nLastPos; sal_uInt32 nLogWidth100; sal_uInt32 nLogHeight100; - USHORT nTimer; - USHORT nGlobalWidth; // maximale Bildbreite aus Header - USHORT nGlobalHeight; // maximale Bildhoehe aus Header - USHORT nImageWidth; // maximale Bildbreite aus Header - USHORT nImageHeight; // maximale Bildhoehe aus Header - USHORT nImagePosX; - USHORT nImagePosY; - USHORT nImageX; // maximale Bildbreite aus Header - USHORT nImageY; // maximale Bildhoehe aus Header - USHORT nLastImageY; - USHORT nLastInterCount; - USHORT nLoops; + sal_uInt16 nTimer; + sal_uInt16 nGlobalWidth; // maximale Bildbreite aus Header + sal_uInt16 nGlobalHeight; // maximale Bildhoehe aus Header + sal_uInt16 nImageWidth; // maximale Bildbreite aus Header + sal_uInt16 nImageHeight; // maximale Bildhoehe aus Header + sal_uInt16 nImagePosX; + sal_uInt16 nImagePosY; + sal_uInt16 nImageX; // maximale Bildbreite aus Header + sal_uInt16 nImageY; // maximale Bildhoehe aus Header + sal_uInt16 nLastImageY; + sal_uInt16 nLastInterCount; + sal_uInt16 nLoops; GIFAction eActAction; - BOOL bStatus; - BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja: - BOOL bInterlaced; - BOOL bOverreadBlock; - BOOL bImGraphicReady; - BOOL bGlobalPalette; - BYTE nBackgroundColor; // Hintergrundfarbe - BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig - BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku) - BYTE cTransIndex1; - BYTE cNonTransIndex1; - - void ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ); + sal_Bool bStatus; + sal_Bool bGCTransparent; // Ob das Bild Transparent ist, wenn ja: + sal_Bool bInterlaced; + sal_Bool bOverreadBlock; + sal_Bool bImGraphicReady; + sal_Bool bGlobalPalette; + sal_uInt8 nBackgroundColor; // Hintergrundfarbe + sal_uInt8 nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig + sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku) + sal_uInt8 cTransIndex1; + sal_uInt8 cNonTransIndex1; + + void ReadPaletteEntries( BitmapPalette* pPal, sal_uIntPtr nCount ); void ClearImageExtensions(); - BOOL CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, BOOL bWatchForBackgroundColor ); - BOOL ReadGlobalHeader(); - BOOL ReadExtension(); - BOOL ReadLocalHeader(); - ULONG ReadNextBlock(); - void FillImages( HPBYTE pBytes, ULONG nCount ); + sal_Bool CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, sal_Bool bWatchForBackgroundColor ); + sal_Bool ReadGlobalHeader(); + sal_Bool ReadExtension(); + sal_Bool ReadLocalHeader(); + sal_uIntPtr ReadNextBlock(); + void FillImages( HPBYTE pBytes, sal_uIntPtr nCount ); void CreateNewBitmaps(); - BOOL ProcessGIF(); + sal_Bool ProcessGIF(); public: @@ -139,6 +139,6 @@ public: // - ImportGIF - // ------------- - BOOL ImportGIF( SvStream& rStream, Graphic& rGraphic ); + sal_Bool ImportGIF( SvStream& rStream, Graphic& rGraphic ); #endif // _GIFREAD_HXX diff --git a/svtools/source/inc/jpeg.hxx b/svtools/source/inc/jpeg.hxx index 9923190c5e21..0d8db406132a 100644 --- a/svtools/source/inc/jpeg.hxx +++ b/svtools/source/inc/jpeg.hxx @@ -93,8 +93,8 @@ class JPEGWriter SvStream& rOStm; Bitmap aBmp; BitmapReadAccess* pAcc; - BYTE* pBuffer; - BOOL bNative; + sal_uInt8* pBuffer; + sal_Bool bNative; sal_Bool bGreys; sal_Int32 nQuality; @@ -111,7 +111,7 @@ public: bool* pExportWasGrey = NULL ); ~JPEGWriter() {}; - BOOL Write( const Graphic& rGraphic ); + sal_Bool Write( const Graphic& rGraphic ); }; #endif // _JPEGPRIVATE @@ -120,9 +120,9 @@ public: // - Import/ExportJPEG - // --------------------- -BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ); +sal_Bool ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ); -BOOL ExportJPEG( SvStream& rStream, +sal_Bool ExportJPEG( SvStream& rStream, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData, bool* pExportWasGrey = NULL diff --git a/svtools/source/inc/msgrd.hxx b/svtools/source/inc/msgrd.hxx index 2d3dcccb1244..90337f57fa75 100644 --- a/svtools/source/inc/msgrd.hxx +++ b/svtools/source/inc/msgrd.hxx @@ -29,9 +29,9 @@ #define _MSGRD_HXX -BOOL ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile, - BOOL(*pCallback)(void *, USHORT), void * pCallerData, - ULONG nMinPercent, ULONG nMaxPercent); +sal_Bool ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile, + sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData, + sal_uIntPtr nMinPercent, sal_uIntPtr nMaxPercent); #endif // _MSGRD_HXX diff --git a/svtools/source/inc/msgwr.hxx b/svtools/source/inc/msgwr.hxx index 7e72e98c124c..a2e6cdbf5f70 100644 --- a/svtools/source/inc/msgwr.hxx +++ b/svtools/source/inc/msgwr.hxx @@ -29,9 +29,9 @@ #define _MSGWR_HXX -BOOL ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream, - BOOL(*pCallback)(void *, USHORT), void * pCallerData, - ULONG nMinPercent, ULONG nMaxPercent); +sal_Bool ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream, + sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData, + sal_uIntPtr nMinPercent, sal_uIntPtr nMaxPercent); #endif // _MSGWR_HXX diff --git a/svtools/source/inc/property.hxx b/svtools/source/inc/property.hxx index 689da1faf140..aa9a721fa292 100644 --- a/svtools/source/inc/property.hxx +++ b/svtools/source/inc/property.hxx @@ -85,13 +85,13 @@ public: virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener()=0; virtual void SetProperty(const String &rString)=0; virtual String GetProperty()const=0; - virtual BOOL HasList()=0; + virtual sal_Bool HasList()=0; virtual void ClearList()=0; virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND )=0; + sal_uInt16 nPos = LISTBOX_APPEND )=0; virtual void SetCtrSize(const Size& rSize)=0; - virtual void SetLocked(BOOL bLocked=TRUE)=0; + virtual void SetLocked(sal_Bool bLocked=sal_True)=0; virtual void SetMyName(const String &rString)=0; virtual String GetMyName()const=0; @@ -135,13 +135,13 @@ public: virtual void SetProperty(const String &rString); virtual String GetProperty()const; - virtual BOOL HasList(); + virtual sal_Bool HasList(); virtual void ClearList(); virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND ); + sal_uInt16 nPos = LISTBOX_APPEND ); virtual void SetCtrSize(const Size& rSize); - virtual void SetLocked(BOOL bLocked=TRUE); + virtual void SetLocked(sal_Bool bLocked=sal_True); virtual void SetMyName(const String &rString); virtual String GetMyName()const; @@ -178,13 +178,13 @@ public: virtual void SetProperty(const String &rString); virtual String GetProperty()const; - virtual BOOL HasList(); + virtual sal_Bool HasList(); virtual void ClearList(); virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND ); + sal_uInt16 nPos = LISTBOX_APPEND ); virtual void SetCtrSize(const Size& rSize); - virtual void SetLocked(BOOL bLocked=TRUE); + virtual void SetLocked(sal_Bool bLocked=sal_True); virtual void SetMyName(const String &rString); virtual String GetMyName()const; @@ -220,13 +220,13 @@ public: virtual void SetProperty(const String &rString); virtual String GetProperty()const; - virtual BOOL HasList(); + virtual sal_Bool HasList(); virtual void ClearList(); virtual void InsertEntry( const String& rString, - USHORT nPos = LISTBOX_APPEND ); + sal_uInt16 nPos = LISTBOX_APPEND ); virtual void SetCtrSize(const Size& rSize); - virtual void SetLocked(BOOL bLocked=TRUE); + virtual void SetLocked(sal_Bool bLocked=sal_True); virtual void SetMyName(const String &rString); virtual String GetMyName()const; @@ -241,14 +241,14 @@ class SvPropertyLine : public Control { private: FixedText aName; - USHORT nNameWidth; - BOOL bNeedsRepaint; + sal_uInt16 nNameWidth; + sal_Bool bNeedsRepaint; SvXPropertyControl* pSvXPropertyControl; PushButton aXButton; - BOOL bIsLocked; - BOOL bHasXButton; - BOOL bIsHyperlink; + sal_Bool bIsLocked; + sal_Bool bHasXButton; + sal_Bool bIsHyperlink; eKindOfControl eKindOfCtr; protected: @@ -260,8 +260,8 @@ public: SvPropertyLine( Window* pParent, const ResId& rResId ); - BOOL NeedsRepaint(); - void SetNeedsRepaint(BOOL bFlag); + sal_Bool NeedsRepaint(); + void SetNeedsRepaint(sal_Bool bFlag); void SetSvXPropertyControl(SvXPropertyControl*); SvXPropertyControl* GetSvXPropertyControl(); @@ -270,16 +270,16 @@ public: void SetName(const String& rString ); String GetName() const; - void SetNameWidth(USHORT); + void SetNameWidth(sal_uInt16); void ShowXButton(); void HideXButton(); - BOOL IsVisibleXButton(); - void ShowAsHyperLink(BOOL nFlag=TRUE); - BOOL IsShownAsHyperlink(); + sal_Bool IsVisibleXButton(); + void ShowAsHyperLink(sal_Bool nFlag=sal_True); + sal_Bool IsShownAsHyperlink(); - void Locked(BOOL nFlag=TRUE); - BOOL IsLineLocked(); + void Locked(sal_Bool nFlag=sal_True); + sal_Bool IsLineLocked(); void SetClickHdl(const Link&); @@ -294,9 +294,9 @@ public: String aValue; SvStrings theValues; // ??? - BOOL bHasVisibleXButton; - BOOL bIsHyperLink; - BOOL bIsLocked; + sal_Bool bHasVisibleXButton; + sal_Bool bIsHyperLink; + sal_Bool bIsLocked; void* pDataPtr; SvXPropertyControl* pControl; }; @@ -378,9 +378,9 @@ private: ScrollBar aVScroll; SvPropLineArray PLineArray; SvPropertyDataControl* pPropDataControl; - USHORT nRowHeight; - BOOL bUpdate; - USHORT nTheNameSize; + sal_uInt16 nRowHeight; + sal_Bool bUpdate; + sal_uInt16 nTheNameSize; long nYOffset; DECL_LINK( ScrollHdl,ScrollBar*); @@ -405,7 +405,7 @@ public: ~SvListBoxForProperties(); - virtual USHORT CalcVisibleLines(); + virtual sal_uInt16 CalcVisibleLines(); virtual void EnableUpdate(); virtual void DisableUpdate(); @@ -413,19 +413,19 @@ public: virtual void Clear(); - virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND ); + virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND ); - virtual void ChangeEntry( const SvPropertyData&, USHORT nPos); + virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos); - virtual USHORT AppendEntry( const SvPropertyData&); + virtual sal_uInt16 AppendEntry( const SvPropertyData&); virtual void SetPropertyValue( const String & rEntryName, const String & rValue ); - virtual void SetFirstVisibleEntry(USHORT nPos); - virtual USHORT GetFirstVisibleEntry(); + virtual void SetFirstVisibleEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetFirstVisibleEntry(); - virtual void SetSelectedEntry(USHORT nPos); - virtual USHORT GetSelectedEntry(); + virtual void SetSelectedEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetSelectedEntry(); }; class SvTabPageForProperties: public TabPage @@ -450,7 +450,7 @@ class SvBasicPropertyDataControl: public SvPropertyDataControl { private: - BOOL bCorrectness; + sal_Bool bCorrectness; String aEntryName; String aEntryProperty; String aCorrectProperty; @@ -481,7 +481,7 @@ public: virtual void LinkClicked(const String& aName, void* pData); - virtual void SetIsCorrect(BOOL nFlag); + virtual void SetIsCorrect(sal_Bool nFlag); //virtual String GetTheCorrectProperty()const; virtual void SetTheCorrectProperty(const String& aName); @@ -521,30 +521,30 @@ public: ~SvPropertyBox(); - virtual USHORT CalcVisibleLines(); + virtual sal_uInt16 CalcVisibleLines(); virtual void EnableUpdate(); // auch IDL? virtual void DisableUpdate(); // auch IDL? // AB: Hier beginnt das 'offizielle' Interface, das in IDL uebernommen werden soll virtual void SetController(SvPropertyDataControl *); - virtual USHORT AppendPage( const String & r ); - virtual void SetPage( USHORT ); - virtual USHORT GetCurPage(); + virtual sal_uInt16 AppendPage( const String & r ); + virtual void SetPage( sal_uInt16 ); + virtual sal_uInt16 GetCurPage(); virtual void ClearAll(); virtual void ClearTable(); virtual void SetPropertyValue( const String & rEntryName, const String & rValue ); - virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND ); - virtual void ChangeEntry( const SvPropertyData&, USHORT nPos); - virtual USHORT AppendEntry( const SvPropertyData&); + virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND ); + virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos); + virtual sal_uInt16 AppendEntry( const SvPropertyData&); - virtual void SetFirstVisibleEntry(USHORT nPos); - virtual USHORT GetFirstVisibleEntry(); + virtual void SetFirstVisibleEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetFirstVisibleEntry(); - virtual void SetSelectedEntry(USHORT nPos); - virtual USHORT GetSelectedEntry(); + virtual void SetSelectedEntry(sal_uInt16 nPos); + virtual sal_uInt16 GetSelectedEntry(); }; @@ -556,8 +556,8 @@ private: SvBasicPropertyDataControl aBaProDatCtr; OKButton anOk; CancelButton aCancel; - USHORT nCount; - USHORT nClickCount; + sal_uInt16 nCount; + sal_uInt16 nClickCount; SvPropertyData aProperty; SvPropertyBox aPropListBox; diff --git a/svtools/source/inc/sgfbram.hxx b/svtools/source/inc/sgfbram.hxx index 2acab5445a8c..aa4ed5836606 100644 --- a/svtools/source/inc/sgfbram.hxx +++ b/svtools/source/inc/sgfbram.hxx @@ -40,11 +40,11 @@ #define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */ // Konstanten fr SgfHeader.SwGrCol -#define SgfBlckWhit 1 /* Schwarz/Wei Bild Ŀ SimpVector, */ -#define SgfGrayscal 2 /* Bild mit Graustufen StarDraw und */ +#define SgfBlckWhit 1 /* Schwarz/Wei?Bild Ŀ SimpVector, */ +#define SgfGrayscal 2 /* Bild mit Graustufen ?StarDraw und */ #define Sgf16Colors 3 /* Farbbild (16 Farben) Bit Image */ #define SgfVectFarb 4 /* Farben fr Linien verwenden Ŀ */ -#define SgfVectGray 5 /* Graustufen fr Linien verwenden Nur fr */ +#define SgfVectGray 5 /* Graustufen fr Linien verwenden ?Nur fr */ #define SgfVectWdth 6 /* Strichstrken fr Linien verwenden SimpVector */ @@ -52,35 +52,35 @@ class SgfHeader { public: - UINT16 Magic; - UINT16 Version; - UINT16 Typ; - UINT16 Xsize; - UINT16 Ysize; - INT16 Xoffs; - INT16 Yoffs; - UINT16 Planes; // Layer - UINT16 SwGrCol; + sal_uInt16 Magic; + sal_uInt16 Version; + sal_uInt16 Typ; + sal_uInt16 Xsize; + sal_uInt16 Ysize; + sal_Int16 Xoffs; + sal_Int16 Yoffs; + sal_uInt16 Planes; // Layer + sal_uInt16 SwGrCol; char Autor[10]; char Programm[10]; - UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) ! + sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) ! - UINT32 GetOffset(); + sal_uInt32 GetOffset(); friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead); - BOOL ChkMagic(); + sal_Bool ChkMagic(); }; #define SgfEntrySize 22 class SgfEntry { public: - UINT16 Typ; - UINT16 iFrei; - UINT16 lFreiLo,lFreiHi; + sal_uInt16 Typ; + sal_uInt16 iFrei; + sal_uInt16 lFreiLo,lFreiHi; char cFrei[10]; - UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) ! + sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) ! - UINT32 GetOffset(); + sal_uInt32 GetOffset(); friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr); }; @@ -88,10 +88,10 @@ public: class SgfVector { public: - UINT16 Flag; - INT16 x; - INT16 y; - UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) ! + sal_uInt16 Flag; + sal_Int16 x; + sal_Int16 y; + sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) ! friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr); }; @@ -102,7 +102,7 @@ extern long SgfVectXmul; extern long SgfVectYmul; extern long SgfVectXdiv; extern long SgfVectYdiv; -extern BOOL SgfVectScal; +extern sal_Bool SgfVectScal; //////////////////////////////////////////////////////////////////////////////////////////////////// // Windows BMP ///////////////////////////////////////////////////////////////////////////////////// @@ -112,15 +112,15 @@ extern BOOL SgfVectScal; class BmpFileHeader { public: - UINT16 Typ; // = "BM" - UINT16 SizeLo,SizeHi; // Filesize in Bytes - UINT16 Reserve1; // Reserviert - UINT16 Reserve2; // Reserviert - UINT16 OfsLo,OfsHi; // Offset? - - void SetSize(UINT32 Size); - void SetOfs(UINT32 Size); - UINT32 GetOfs(); + sal_uInt16 Typ; // = "BM" + sal_uInt16 SizeLo,SizeHi; // Filesize in Bytes + sal_uInt16 Reserve1; // Reserviert + sal_uInt16 Reserve2; // Reserviert + sal_uInt16 OfsLo,OfsHi; // Offset? + + void SetSize(sal_uInt32 Size); + void SetOfs(sal_uInt32 Size); + sal_uInt32 GetOfs(); friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead); }; @@ -128,17 +128,17 @@ public: class BmpInfoHeader { public: - UINT32 Size; // Gre des BmpInfoHeaders - INT32 Width; // Breite in Pixel - INT32 Hight; // Hhe in Pixel - UINT16 Planes; // Anzahl der Planes (immer 1) - UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24) - UINT32 Compress; // Datenkompression - UINT32 ImgSize; // Gre der Images in Bytes. Ohne Kompression ist auch 0 erlaubt. - INT32 xDpmm; // Dot per Meter (0 ist erlaubt) - INT32 yDpmm; // Dot per Meter (0 ist erlaubt) - UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle) - UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle) + sal_uInt32 Size; // Gre des BmpInfoHeaders + sal_Int32 Width; // Breite in Pixel + sal_Int32 Hight; // Hhe in Pixel + sal_uInt16 Planes; // Anzahl der Planes (immer 1) + sal_uInt16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24) + sal_uInt32 Compress; // Datenkompression + sal_uInt32 ImgSize; // Gre der Images in Bytes. Ohne Kompression ist auch 0 erlaubt. + sal_Int32 xDpmm; // Dot per Meter (0 ist erlaubt) + sal_Int32 yDpmm; // Dot per Meter (0 ist erlaubt) + sal_uInt32 ColUsed; // Anzahl der verwendeten Farben (0=alle) + sal_uInt32 ColMust; // Anzahl der wichtigen Farben (0=alle) friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead); }; @@ -146,12 +146,12 @@ public: #define RGBQuadSize 4 class RGBQuad { private: - BYTE Red; - BYTE Grn; - BYTE Blu; - BYTE Fil; + sal_uInt8 Red; + sal_uInt8 Grn; + sal_uInt8 Blu; + sal_uInt8 Fil; public: - RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; } + RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; } }; #endif //_SGFBRAM_HXX diff --git a/svtools/source/inc/sgffilt.hxx b/svtools/source/inc/sgffilt.hxx index 1c75917b8f73..28d48fe13820 100644 --- a/svtools/source/inc/sgffilt.hxx +++ b/svtools/source/inc/sgffilt.hxx @@ -29,10 +29,10 @@ #define _SGFFILT_HXX #include <tools/urlobj.hxx> -BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion); -BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut); -BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf); -BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ); +sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion); +sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut); +sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf); +sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ); // Konstanten fr CheckSgfTyp() #define SGF_BITIMAGE 1 /* Bitmap */ diff --git a/svtools/source/inc/sgvmain.hxx b/svtools/source/inc/sgvmain.hxx index 6f69908865c5..3006a23f5f10 100644 --- a/svtools/source/inc/sgvmain.hxx +++ b/svtools/source/inc/sgvmain.hxx @@ -36,8 +36,8 @@ #define UCHAR unsigned char struct PointType { - INT16 x; - INT16 y; + sal_Int16 x; + sal_Int16 y; }; #define SgfDpmm 40 @@ -45,7 +45,7 @@ struct PointType { #define DtHdSize 256 class DtHdType { public: - BYTE Reserved[256]; + sal_uInt8 Reserved[256]; friend SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd); friend void DtHdOverSeek(SvStream& rInp); }; @@ -53,30 +53,30 @@ public: struct Seitenformat { PointType Size; // 0.00mm...819.175mm (Papiergr��e) - INT16 RandL; // links Rand auf - INT16 RandR; // rechts dem Papier - INT16 RandO; // oben Rand auf - INT16 RandU; // unten dem Papier - BYTE PColor; // Future Use - BYTE PIntens; // erst recht Future use -// BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) + sal_Int16 RandL; // links Rand auf + sal_Int16 RandR; // rechts dem Papier + sal_Int16 RandO; // oben Rand auf + sal_Int16 RandU; // unten dem Papier + sal_uInt8 PColor; // Future Use + sal_uInt8 PIntens; // erst recht Future use +// sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) }; #define PageSize 146 class PageType { public: - UINT32 Next; // N�chste Seite - UINT32 nList; // Objektdaten, erster Record - UINT32 ListEnd; // Objektdaten, letzter Record + sal_uInt32 Next; // N�chste Seite + sal_uInt32 nList; // Objektdaten, erster Record + sal_uInt32 ListEnd; // Objektdaten, letzter Record Seitenformat Paper; // Papierdaten - BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) - BYTE StdPg; // welche Standardseite einblenden ? + sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) + sal_uInt8 StdPg; // welche Standardseite einblenden ? PointType U; // Nullpunkt - INT16 HlpLnH[20]; // Hilfslinien - INT16 HlpLnV[20]; - BYTE LnAnzH; - BYTE LnAnzV; + sal_Int16 HlpLnH[20]; // Hilfslinien + sal_Int16 HlpLnV[20]; + sal_uInt8 LnAnzH; + sal_uInt8 LnAnzV; UCHAR PgName[32]; // Seitenname friend SvStream& operator>>(SvStream& rIStream, PageType& rPage); }; @@ -86,21 +86,21 @@ enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln, ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi}; struct ObjLineType { - BYTE LFarbe; // [Index] - BYTE LBFarbe; // [Index] - BYTE LIntens; // [%] - BYTE LMuster; // [Index] inkl. Transparenz - INT16 LMSize; // [Koeffizient/100] - INT16 LDicke; // Strichst�rke + sal_uInt8 LFarbe; // [Index] + sal_uInt8 LBFarbe; // [Index] + sal_uInt8 LIntens; // [%] + sal_uInt8 LMuster; // [Index] inkl. Transparenz + sal_Int16 LMSize; // [Koeffizient/100] + sal_Int16 LDicke; // Strichst�rke }; struct ObjAreaType { - BYTE FFarbe; // [Index] - BYTE FBFarbe; // [Index] - BYTE FIntens; // [%] - BYTE FDummy1; // - INT16 FDummy2; // - UINT16 FMuster; // [Index] inkl. Invers, Transparenz + sal_uInt8 FFarbe; // [Index] + sal_uInt8 FBFarbe; // [Index] + sal_uInt8 FIntens; // [%] + sal_uInt8 FDummy1; // + sal_Int16 FDummy2; // + sal_uInt16 FMuster; // [Index] inkl. Invers, Transparenz }; #define ObjTextTypeSize 64 @@ -108,24 +108,24 @@ class ObjTextType { public: ObjLineType L; // Text-Outline (future) ObjAreaType F; // Text innen - UINT16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType. - UINT16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein - UINT16 Breite; // 1..65535% bitte nicht mehr als 500% - BYTE Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo) - BYTE Kapit; // 1..255% - UINT16 Schnitt; // 8 Flags - UINT16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile - UINT16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen) - BYTE ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als - INT8 ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�) + sal_uInt16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType. + sal_uInt16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein + sal_uInt16 Breite; // 1..65535% bitte nicht mehr als 500% + sal_uInt8 Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo) + sal_uInt8 Kapit; // 1..255% + sal_uInt16 Schnitt; // 8 Flags + sal_uInt16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile + sal_uInt16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen) + sal_uInt8 ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als + sal_sChar ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�) ObjLineType ShdL; // Schatten-Outline (neu 2.0) ObjAreaType ShdF; // Schatten-innen (neu 2.0) PointType ShdVers; // Schattenversatz Max.300.00% - BOOL ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad - BOOL NoSpc; // True-> kein Zwischenraum (f�r BackArea) + sal_Bool ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad + sal_Bool NoSpc; // True-> kein Zwischenraum (f�r BackArea) ObjAreaType BackF; // Hintergrundfl�che - UINT32 GetFont(); - void SetFont(UINT32 FontID); + sal_uInt32 GetFont(); + void SetFont(sal_uInt32 FontID); }; class Obj0Type { // SuperClass f�r Apple-VMT @@ -137,16 +137,16 @@ public: #define ObjkSize 20 /* eigentlich 21. Wg. Allignment ist Flags jedoch verschoben worden*/ class ObjkType: public Obj0Type { // Grundkomponenten aller Stardraw-Objekte public: - UINT32 Last; - UINT32 Next; - UINT16 MemSize; // in Bytes + sal_uInt32 Last; + sal_uInt32 Next; + sal_uInt16 MemSize; // in Bytes PointType ObjMin; // XY-Minimum des Objekts PointType ObjMax; // XY-Maximum des Objekts - BYTE Art; - BYTE Layer; -// BYTE Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Art; + sal_uInt8 Layer; +// sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) friend SvStream& operator>>(SvStream& rIStream, ObjkType& rObjk); - friend BOOL ObjOverSeek(SvStream& rInp, ObjkType& rObjk); + friend sal_Bool ObjOverSeek(SvStream& rInp, ObjkType& rObjk); virtual void Draw(OutputDevice& rOut); }; @@ -154,8 +154,8 @@ public: #define StrkSize 38 class StrkType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // Linienenden + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // Linienenden ObjLineType L; PointType Pos1; // Anfangspunkt PointType Pos2; // Endpunkt @@ -167,15 +167,15 @@ public: #define RectSize 52 class RectType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE Reserve; + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Reserve; ObjLineType L; ObjAreaType F; PointType Pos1; // LO-Ecke = Bezugspunkt PointType Pos2; // R-Ecke - INT16 Radius; // Eckenradius - UINT16 DrehWink; // 315...<45 - UINT16 Slant; // >270...<90 + sal_Int16 Radius; // Eckenradius + sal_uInt16 DrehWink; // 315...<45 + sal_uInt16 Slant; // >270...<90 friend SvStream& operator>>(SvStream& rIStream, RectType& rRect); virtual void Draw(OutputDevice& rOut); }; @@ -184,13 +184,13 @@ public: #define PolySize 44 class PolyType: public ObjkType { // identisch mit Spline ! public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // nur f�r Polyline + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // nur f�r Polyline ObjLineType L; ObjAreaType F; // nicht f�r Polyline - BYTE nPoints; - BYTE Reserve; - UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) + sal_uInt8 nPoints; + sal_uInt8 Reserve; + sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!)) friend SvStream& operator>>(SvStream& rIStream, PolyType& rPoly); virtual void Draw(OutputDevice& rOut); @@ -201,13 +201,13 @@ public: #define SplnSize 44 class SplnType: public ObjkType { // identisch mit Poly ! public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // nur f�r nSpline + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // nur f�r nSpline ObjLineType L; ObjAreaType F; // nicht f�r nSpline - BYTE nPoints; - BYTE Reserve; - UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) + sal_uInt8 nPoints; + sal_uInt8 Reserve; + sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!)) friend SvStream& operator>>(SvStream& rIStream, SplnType& rSpln); virtual void Draw(OutputDevice& rOut); @@ -218,15 +218,15 @@ public: #define CircSize 52 class CircType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE LEnden; // nur Bogen (Kr & El) + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 LEnden; // nur Bogen (Kr & El) ObjLineType L; ObjAreaType F; // nicht f�r Bogen (Kr & El) PointType Center; // Mittelpunkt PointType Radius; // Radius - UINT16 DrehWink; // nur Ellipse - UINT16 StartWink; // � nicht f�r Vollkreis - UINT16 RelWink; // � und Vollellipse + sal_uInt16 DrehWink; // nur Ellipse + sal_uInt16 StartWink; // � nicht f�r Vollkreis + sal_uInt16 RelWink; // � und Vollellipse friend SvStream& operator>>(SvStream& rIStream, CircType& rCirc); virtual void Draw(OutputDevice& rOut); }; @@ -239,19 +239,19 @@ public: #define TextSize 116 class TextType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE Reserve; // f�r Word Allign + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Reserve; // f�r Word Allign ObjTextType T; // 64 Bytes << DWord-Allign bei FontID erforderlich PointType Pos1; // Bezugspunkt (ObenLinks) PointType Pos2; // (untenRechts) - INT16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify) - UINT16 DrehWink; // 0...<360 - UINT16 BoxSlant; // >270...<90 (nur Box) - UINT16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so - UINT16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich - UINT16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich + sal_Int16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify) + sal_uInt16 DrehWink; // 0...<360 + sal_uInt16 BoxSlant; // >270...<90 (nur Box) + sal_uInt16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so + sal_uInt16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich + sal_uInt16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich PointType FitSize; // Ursprungsgr��e f�r Fit2Size - INT16 FitBreit; // Breite zum formatieren bei Fit2Size + sal_Int16 FitBreit; // Breite zum formatieren bei Fit2Size UCHAR* Buffer; // Diese Variable wird nicht durch Lesen von Disk gef�llt, sondern explizit! friend SvStream& operator>>(SvStream& rIStream, TextType& rText); virtual void Draw(OutputDevice& rOut); @@ -268,21 +268,21 @@ enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf}; #define BmapSize 132 class BmapType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) - BYTE Reserve; + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Reserve; ObjAreaType F; // Farbe und Muster der 1-Plane Bitmap PointType Pos1; PointType Pos2; - UINT16 DrehWink; // 315...<45 (Future) - UINT16 Slant; // >270...<90 (Future) + sal_uInt16 DrehWink; // 315...<45 (Future) + sal_uInt16 Slant; // >270...<90 (Future) UCHAR Filename[80]; // Pfad PointType PixSize; // Gr��e in Pixel (0 bei Vektor) GrafStat Format; // siehe GpmDef.Pas - BYTE nPlanes; // Anzahl der Bitplanes (0 bei Vektor) - BOOL RawOut; // als Raw ausgeben ? - BOOL InvOut; // invertiert ausgeben ? - BOOL LightOut; // aufhellen? (SD20) - BYTE GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp) + sal_uInt8 nPlanes; // Anzahl der Bitplanes (0 bei Vektor) + sal_Bool RawOut; // als Raw ausgeben ? + sal_Bool InvOut; // invertiert ausgeben ? + sal_Bool LightOut; // aufhellen? (SD20) + sal_uInt8 GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp) INetURLObject aFltPath; // F�r GraphicFilter friend SvStream& operator>>(SvStream& rIStream, BmapType& rBmap); @@ -294,13 +294,13 @@ public: #define GrupSize 48 class GrupType: public ObjkType { public: - BYTE Flags; // (Schummel f�r Allignment unter NT) + sal_uInt8 Flags; // (Schummel f�r Allignment unter NT) UCHAR Name[13]; // Name der Gruppe - UINT16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich - UINT16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich - UINT16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur - UINT32 ChartPtr; // Diagrammstruktur - UINT32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist. + sal_uInt16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich + sal_uInt16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich + sal_uInt16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur + sal_uInt32 ChartPtr; // Diagrammstruktur + sal_uInt32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist. friend SvStream& operator>>(SvStream& rIStream, GrupType& rGrup); // virtual void Draw(OutputDevice& rOut); }; @@ -308,26 +308,26 @@ public: void SetLine(ObjLineType& rLine, OutputDevice& rOut); void SetArea(ObjAreaType& rArea, OutputDevice& rOut); -Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts); -void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs); -void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs); -INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div); -UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div); +Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts); +void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs); +void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs); +sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div); +sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div); class SgfFontOne { public: SgfFontOne* Next; // Zeiger f�r Listenverkettung - UINT32 IFID; - BOOL Bold; - BOOL Ital; - BOOL Sans; - BOOL Serf; - BOOL Fixd; + sal_uInt32 IFID; + sal_Bool Bold; + sal_Bool Ital; + sal_Bool Sans; + sal_Bool Serf; + sal_Bool Fixd; FontFamily SVFamil; CharSet SVChSet; String SVFName; // z.B. "Times New Roman" = 15 Chars - USHORT SVWidth; // Durchschnittliche Zeichenbreite in % + sal_uInt16 SVWidth; // Durchschnittliche Zeichenbreite in % SgfFontOne(); void ReadOne( ByteString& ID, ByteString& Dsc); }; @@ -337,15 +337,15 @@ public: String FNam; // vollst�ndiger Filename des Inifiles SgfFontOne* pList; // Listenanfang SgfFontOne* Last; // Listenende - UINT32 LastID; // f�r schnelleren Zugriff bei Wiederholungen + sal_uInt32 LastID; // f�r schnelleren Zugriff bei Wiederholungen SgfFontOne* LastLn; // f�r schnelleren Zugriff bei Wiederholungen - BOOL Tried; + sal_Bool Tried; SgfFontLst(); ~SgfFontLst(); void AssignFN(const String& rFName); void ReadList(); void RausList(); - SgfFontOne* GetFontDesc(UINT32 ID); + SgfFontOne* GetFontDesc(sal_uInt32 ID); }; #endif //_SGVMAIN_HXX diff --git a/svtools/source/inc/sgvspln.hxx b/svtools/source/inc/sgvspln.hxx index 29df09247f22..3bb7ea85374b 100644 --- a/svtools/source/inc/sgvspln.hxx +++ b/svtools/source/inc/sgvspln.hxx @@ -38,7 +38,7 @@ |* Polygons werden als Sttzstellen angenommen. |* n liefert die Anzahl der Teilpolynome. |* Ist die Berechnung fehlerfrei verlaufen, so -|* liefert die Funktion TRUE. Nur in diesem Fall +|* liefert die Funktion sal_True. Nur in diesem Fall |* ist Speicher fr die Koeffizientenarrays |* allokiert, der dann spter vom Aufrufer mittels |* delete freizugeben ist. @@ -47,7 +47,7 @@ |* *************************************************************************/ -BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, +sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n, double*& ax, double*& ay, double*& bx, double*& by, double*& cx, double*& cy, double*& dx, double*& dy, double*& T); @@ -58,9 +58,9 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Beschreibung Konvertiert einen parametrichen kubischen |* Polynomspline Spline (natrlich oder periodisch) |* in ein angenhertes Polygon. -|* Die Funktion liefert FALSE, wenn ein Fehler bei +|* Die Funktion liefert sal_False, wenn ein Fehler bei |* der Koeffizientenberechnung aufgetreten ist oder -|* das Polygon zu gro wird (>PolyMax=16380). Im 1. +|* das Polygon zu gro?wird (>PolyMax=16380). Im 1. |* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte. |* Um Koordinatenberlufe zu vermeiden werden diese |* auf +/-32000 begrenzt. @@ -68,6 +68,6 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, |* Letzte Aenderung JOE 23.06.93 |* *************************************************************************/ -BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly); +sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly); #endif //_SGVSPLN_HXX diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index 92b9f960b65c..8655e46aace4 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -64,9 +64,9 @@ public: void BeginDrag(); void CreateAnchor(); void DestroyAnchor(); - BOOL SetCursorAtPoint( const Point& rPoint, - BOOL bDontSelectAtCursor=FALSE ); - BOOL IsSelectionAtPoint( const Point& rPoint ); + sal_Bool SetCursorAtPoint( const Point& rPoint, + sal_Bool bDontSelectAtCursor=sal_False ); + sal_Bool IsSelectionAtPoint( const Point& rPoint ); void DeselectAtPoint( const Point& rPoint ); void DeselectAll(); }; @@ -147,22 +147,22 @@ private: long nNodeBmpWidth; long nNextVerVisSize; long nMostRight; - ULONG nVisibleCount; // Anzahl Zeilen im Control - ULONG nCurUserEvent; //-1 == kein Userevent amn Laufen + sal_uIntPtr nVisibleCount; // Anzahl Zeilen im Control + sal_uIntPtr nCurUserEvent; //-1 == kein Userevent amn Laufen short nHorSBarHeight, nVerSBarWidth; - USHORT nFlags; - USHORT nCurTabPos; + sal_uInt16 nFlags; + sal_uInt16 nCurTabPos; WinBits nWinBits; ExtendedWinBits nExtendedWinBits; - BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION - BOOL bUpdateMode : 1; - BOOL bInVScrollHdl : 1; - BOOL bAsyncBeginDrag : 1; - BOOL bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with FALSE - BOOL bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with FALSE - BOOL bContextMenuHandling : 1; - BOOL bIsCellFocusEnabled : 1; + sal_Bool bSimpleTravel : 1; // ist sal_True bei SINGLE_SELECTION + sal_Bool bUpdateMode : 1; + sal_Bool bInVScrollHdl : 1; + sal_Bool bAsyncBeginDrag : 1; + sal_Bool bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with sal_False + sal_Bool bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with sal_False + sal_Bool bContextMenuHandling : 1; + sal_Bool bIsCellFocusEnabled : 1; sal_Bool bAreChildrenTransient; @@ -186,16 +186,16 @@ private: void ShowVerSBar(); // setzt Thumb auf FirstEntryToDraw void SyncVerThumb(); - BOOL IsLineVisible( long nY ) const; + sal_Bool IsLineVisible( long nY ) const; long GetEntryLine( SvLBoxEntry* pEntry ) const; void FillView(); void CursorDown(); void CursorUp(); void KeyLeftRight( long nDiff ); - void PageDown( USHORT nDelta ); - void PageUp( USHORT nDelta ); + void PageDown( sal_uInt16 nDelta ); + void PageUp( sal_uInt16 nDelta ); - void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE ); + void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False ); void DrawNet(); @@ -209,39 +209,39 @@ private: // Selection-Engine SvLBoxEntry* MakePointVisible( const Point& rPoint, - BOOL bNotifyScroll=TRUE ); + sal_Bool bNotifyScroll=sal_True ); void SetAnchorSelection( SvLBoxEntry* pOld, SvLBoxEntry* pNewCursor ); void BeginDrag(); - BOOL ButtonDownCheckCtrl( const MouseEvent& rMEvt, + sal_Bool ButtonDownCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long nY ); - BOOL MouseMoveCheckCtrl( const MouseEvent& rMEvt, + sal_Bool MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry ); - BOOL ButtonUpCheckCtrl( const MouseEvent& rMEvt ); - BOOL ButtonDownCheckExpand( const MouseEvent&, + sal_Bool ButtonUpCheckCtrl( const MouseEvent& rMEvt ); + sal_Bool ButtonDownCheckExpand( const MouseEvent&, SvLBoxEntry*,long nY ); - void PositionScrollBars( Size& rOSize, USHORT nMask ); - USHORT AdjustScrollBars( Size& rSize ); + void PositionScrollBars( Size& rOSize, sal_uInt16 nMask ); + sal_uInt16 AdjustScrollBars( Size& rSize ); void BeginScroll(); void EndScroll(); - BOOL InScroll() const { return (BOOL)(nFlags & F_IN_SCROLLING)!=0;} + sal_Bool InScroll() const { return (sal_Bool)(nFlags & F_IN_SCROLLING)!=0;} Rectangle GetVisibleArea() const; - BOOL EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine); + sal_Bool EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine); void InitScrollBarBox(); SvLBoxTab* NextTab( SvLBoxTab* ); - BOOL SetMostRight( SvLBoxEntry* pEntry ); + sal_Bool SetMostRight( SvLBoxEntry* pEntry ); void FindMostRight( SvLBoxEntry* EntryToIgnore ); void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore ); void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore ); void NotifyTabsChanged(); - inline BOOL IsExpandable() const // if element at cursor can be expanded in general + inline sal_Bool IsExpandable() const // if element at cursor can be expanded in general { return pCursor->HasChilds() || pCursor->HasChildsOnDemand(); } - inline BOOL IsNowExpandable() const // if element at cursor can be expanded at this moment + inline sal_Bool IsNowExpandable() const // if element at cursor can be expanded at this moment { return IsExpandable() && !pView->IsExpanded( pCursor ); } static void implInitDefaultNodeImages(); @@ -280,40 +280,40 @@ public: void EntryExpanded( SvLBoxEntry* pEntry ); void EntryCollapsed( SvLBoxEntry* pEntry ); void CollapsingEntry( SvLBoxEntry* pEntry ); - void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + void EntrySelected( SvLBoxEntry*, sal_Bool bSelect ); void Paint( const Rectangle& rRect ); void RepaintSelectionItems(); void MouseButtonDown( const MouseEvent& ); void MouseButtonUp( const MouseEvent& ); void MouseMove( const MouseEvent&); - BOOL KeyInput( const KeyEvent& ); + sal_Bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); void LoseFocus(); void UpdateAll( - BOOL bInvalidateCompleteView= TRUE, - BOOL bUpdateVerSBar = TRUE ); + sal_Bool bInvalidateCompleteView= sal_True, + sal_Bool bUpdateVerSBar = sal_True ); void SetEntryHeight( short nHeight ); void PaintEntry( SvLBoxEntry* pEntry ); void InvalidateEntry( SvLBoxEntry* ); void RecalcFocusRect(); - inline void SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect ); + inline void SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect ); void SetDragDropMode( DragDropMode eDDMode ); void SetSelectionMode( SelectionMode eSelMode ); - void SetAddMode( BOOL ) { aSelEng.AddAlways(FALSE); } - BOOL IsAddMode() const { return aSelEng.IsAlwaysAdding(); } + void SetAddMode( sal_Bool ) { aSelEng.AddAlways(sal_False); } + sal_Bool IsAddMode() const { return aSelEng.IsAlwaysAdding(); } SvLBoxEntry* GetCurrentEntry() const { return pCursor; } - BOOL IsEntryInView( SvLBoxEntry* ) const; + sal_Bool IsEntryInView( SvLBoxEntry* ) const; SvLBoxEntry* GetEntry( const Point& rPos ) const; // gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag SvLBoxEntry* GetClickedEntry( const Point& ) const; SvLBoxEntry* GetCurEntry() const { return pCursor; } void SetCurEntry( SvLBoxEntry* ); Point GetEntryPosition( SvLBoxEntry* ) const; - void MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop=FALSE ); + void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop=sal_False ); void PaintDDCursor( SvLBoxEntry* ); @@ -338,38 +338,38 @@ public: static const Image& GetDefaultCollapsedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ); const Size& GetOutputSize() const { return aOutputSize;} - void KeyUp( BOOL bPageUp, BOOL bNotifyScroll = TRUE ); - void KeyDown( BOOL bPageDown, BOOL bNotifyScroll = TRUE ); + void KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll = sal_True ); + void KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll = sal_True ); bool Command( const CommandEvent& rCEvt ); void Invalidate(); void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); } - void SelAllDestrAnch( BOOL bSelect, - BOOL bDestroyAnchor = TRUE, - BOOL bSingleSelToo = FALSE ); - void ShowCursor( BOOL bShow ); + void SelAllDestrAnch( sal_Bool bSelect, + sal_Bool bDestroyAnchor = sal_True, + sal_Bool bSingleSelToo = sal_False ); + void ShowCursor( sal_Bool bShow ); - BOOL RequestHelp( const HelpEvent& rHEvt ); + sal_Bool RequestHelp( const HelpEvent& rHEvt ); void EndSelection(); - BOOL IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const; + sal_Bool IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const; void RepaintScrollBars(); - void EnableAsyncDrag( BOOL b) { bAsyncBeginDrag = b; } - void SetUpdateMode( BOOL ); - void SetUpdateModeFast( BOOL ); - BOOL GetUpdateMode() const { return bUpdateMode; } + void EnableAsyncDrag( sal_Bool b) { bAsyncBeginDrag = b; } + void SetUpdateMode( sal_Bool ); + void SetUpdateModeFast( sal_Bool ); + sal_Bool GetUpdateMode() const { return bUpdateMode; } Rectangle GetClipRegionRect() const; - BOOL HasHorScrollBar() const { return aHorSBar.IsVisible(); } + sal_Bool HasHorScrollBar() const { return aHorSBar.IsVisible(); } void ShowFocusRect( const SvLBoxEntry* pEntry ); void SetTabBar( TabBar* pTabBar ); void CancelPendingEdit(); - void CallEventListeners( ULONG nEvent, void* pData = NULL ); + void CallEventListeners( sal_uIntPtr nEvent, void* pData = NULL ); /** Enables, that one cell of a tablistbox entry can be focused */ - inline BOOL IsCellFocusEnabled() const { return bIsCellFocusEnabled; } - inline void EnableCellFocus() { bIsCellFocusEnabled = TRUE; } - bool SetCurrentTabPos( USHORT _nNewPos ); - inline USHORT GetCurrentTabPos() const { return nCurTabPos; } + inline sal_Bool IsCellFocusEnabled() const { return bIsCellFocusEnabled; } + inline void EnableCellFocus() { bIsCellFocusEnabled = sal_True; } + bool SetCurrentTabPos( sal_uInt16 _nNewPos ); + inline sal_uInt16 GetCurrentTabPos() const { return nCurTabPos; } bool IsSelectable( const SvLBoxEntry* pEntry ); }; @@ -457,11 +457,11 @@ inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry ) pView->PaintEntry( pEntry, nY ); } -inline BOOL SvImpLBox::IsLineVisible( long nY ) const +inline sal_Bool SvImpLBox::IsLineVisible( long nY ) const { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if ( nY < 0 || nY >= aOutputSize.Height() ) - bRet = FALSE; + bRet = sal_False; return bRet; } diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx index 20f98d2bcbbd..c2592314a2b9 100644 --- a/svtools/source/inc/svimpicn.hxx +++ b/svtools/source/inc/svimpicn.hxx @@ -104,8 +104,8 @@ class SvImpIconView long nMaxBmpHeight; long nMaxTextWidth; long nMaxBoundHeight; // Hoehe des hoechsten BoundRects - ULONG nFlags; - ULONG nCurUserEvent; + sal_uIntPtr nFlags; + sal_uIntPtr nCurUserEvent; SvLBoxEntry* pCurParent; SvLBoxEntry* pCursor; SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist @@ -116,12 +116,12 @@ class SvImpIconView VirtualDevice* pDDTempDev; SvIconViewTextMode eTextMode; - BOOL bMustRecalcBoundingRects; + sal_Bool bMustRecalcBoundingRects; void CheckAllSizes(); void CheckSizes( SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData = 0 ); - void ShowCursor( BOOL bShow ); + void ShowCursor( sal_Bool bShow ); void SetNextEntryPos(const Point& rPos); Point FindNextEntryPos( const Size& rBoundSize ); @@ -138,7 +138,7 @@ class SvImpIconView void AdjustScrollBars(); void PositionScrollBars( long nRealWidth, long nRealHeight ); void CalcDocPos( Point& aMousePos ); - BOOL GetResizeRect( Rectangle& ); + sal_Bool GetResizeRect( Rectangle& ); void PaintResizeRect( const Rectangle& ); SvLBoxEntry* GetNewCursor(); void ToggleSelection( SvLBoxEntry* ); @@ -161,8 +161,8 @@ class SvImpIconView SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData ) const; - BOOL CheckVerScrollBar(); - BOOL CheckHorScrollBar(); + sal_Bool CheckVerScrollBar(); + sal_Bool CheckHorScrollBar(); void CancelUserEvent(); public: @@ -170,7 +170,7 @@ public: SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle ); ~SvImpIconView(); - void Clear( BOOL bInCtor = FALSE ); + void Clear( sal_Bool bInCtor = sal_False ); void SetWindowBits( WinBits nWinStyle ); void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent ) { pModel = pTree; SetCurParent(pParent); } @@ -185,14 +185,14 @@ public: void EntryExpanded( SvLBoxEntry* pEntry ); void EntryCollapsed( SvLBoxEntry* pEntry ); void CollapsingEntry( SvLBoxEntry* pEntry ); - void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + void EntrySelected( SvLBoxEntry*, sal_Bool bSelect ); void Paint( const Rectangle& rRect ); void RepaintSelectionItems(); void MouseButtonDown( const MouseEvent& ); void MouseButtonUp( const MouseEvent& ); void MouseMove( const MouseEvent&); - BOOL KeyInput( const KeyEvent& ); + sal_Bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); void LoseFocus(); @@ -202,8 +202,8 @@ public: void PaintEntry( SvLBoxEntry*, const Point&, SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0); void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, - BOOL bAdjustRow = FALSE, - BOOL bCheckScrollBars = FALSE ); + sal_Bool bAdjustRow = sal_False, + sal_Bool bCheckScrollBars = sal_False ); void InvalidateEntry( SvLBoxEntry* ); void ViewDataInitialized( SvLBoxEntry* pEntry ); SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos ); @@ -218,7 +218,7 @@ public: SvLBoxEntry* GetCurEntry() const { return pCursor; } void SetCursor( SvLBoxEntry* ); - BOOL IsEntryInView( SvLBoxEntry* ); + sal_Bool IsEntryInView( SvLBoxEntry* ); SvLBoxEntry* GetEntry( const Point& rDocPos ); SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); @@ -238,7 +238,7 @@ public: SvIcnVwDataEntry* pViewData=0 ); Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0, const Point* pPos = 0, - BOOL bForInplaceEdit = FALSE, + sal_Bool bForInplaceEdit = sal_False, SvIcnVwDataEntry* pViewData = 0 ); long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const; @@ -255,22 +255,22 @@ public: SvIcnVwDataEntry* pViewData=0); void InvalidateBoundingRect( SvLBoxEntry* ); void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; } - BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } + sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); } - void PaintEmphasis( const Rectangle&, BOOL bSelected, - BOOL bCursored, OutputDevice* pOut = 0 ); + void PaintEmphasis( const Rectangle&, sal_Bool bSelected, + sal_Bool bCursored, OutputDevice* pOut = 0 ); void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem, - SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 ); - // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE + SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut = 0 ); + // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); } // berechnet alle invalidierten BoundingRects neu void UpdateBoundingRects(); - void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ); + void ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow ); SvLBoxEntry* GetDropTarget( const Point& rPosPixel ); - BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); - BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); + sal_Bool NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uIntPtr& rNewChildPos ); + sal_Bool NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, sal_uIntPtr& rNewChildPos ); void WriteDragServerInfo( const Point&, SvLBoxDDInfo* ); void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); @@ -278,9 +278,9 @@ public: void SetCurParent( SvLBoxEntry* pNewParent ); SvLBoxEntry* GetCurParent() const { return pCurParent; } - USHORT GetSelectionCount() const; + sal_uInt16 GetSelectionCount() const; void SetGrid( long nDX, long nDY ); - void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); + void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False ); const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*, const SvIcnVwDataEntry* pViewData = 0 ) const; void PrepareCommandEvent( const Point& rPt ); @@ -291,18 +291,18 @@ public: SvLBoxEntry* mpViewData; - BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; - void SelectRect( const Rectangle&, BOOL bAdd = TRUE, + sal_Bool IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; + void SelectRect( const Rectangle&, sal_Bool bAdd = sal_True, SvPtrarr* pOtherRects = 0, short nOffs = SELRECT_BORDER_OFFS ); void DrawSelectionRect( const Rectangle& ); void HideSelectionRect(); void CalcScrollOffsets( const Point& rRefPosPixel, - long& rX, long& rY, BOOL bDragDrop = FALSE, - USHORT nBorderWidth = 10 ); + long& rX, long& rY, sal_Bool bDragDrop = sal_False, + sal_uInt16 nBorderWidth = 10 ); void EndTracking(); - BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); - void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE); + sal_Bool IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); + void MakeVisible( const Rectangle& rDocPos,sal_Bool bInScrollBarEvent=sal_False); void AdjustAtGrid( SvLBoxEntry* pStart = 0 ); void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 ); SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0, diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx index aab52eeffa63..5d6db03f73a7 100644 --- a/svtools/source/inc/xbmread.hxx +++ b/svtools/source/inc/xbmread.hxx @@ -69,13 +69,13 @@ class XBMReader : public GraphicReader long nLastPos; long nWidth; long nHeight; - BOOL bStatus; + sal_Bool bStatus; void InitTable(); ByteString FindTokenLine( SvStream* pInStm, const char* pTok1, const char* pTok2 = NULL, const char* pTok3 = NULL ); long ParseDefine( const sal_Char* pDefine ); - BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ); + sal_Bool ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ); public: @@ -92,6 +92,6 @@ public: // - ImportXBM - // ------------- -BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic ); +sal_Bool ImportXBM( SvStream& rStream, Graphic& rGraphic ); #endif // _XBMREAD_HXX diff --git a/svtools/source/inc/xpmread.hxx b/svtools/source/inc/xpmread.hxx index 29edd15a3b1c..1fff44fbc7ea 100644 --- a/svtools/source/inc/xpmread.hxx +++ b/svtools/source/inc/xpmread.hxx @@ -83,35 +83,35 @@ private: BitmapWriteAccess* mpMaskAcc; long mnLastPos; - ULONG mnWidth; - ULONG mnHeight; - ULONG mnColors; - ULONG mnCpp; // characters per pix - BOOL mbTransparent; - BOOL mbStatus; - ULONG mnStatus; - ULONG mnIdentifier; - BYTE mcThisByte; - BYTE mcLastByte; - ULONG mnTempAvail; - BYTE* mpTempBuf; - BYTE* mpTempPtr; - BYTE* mpFastColorTable; - BYTE* mpColMap; - ULONG mnStringSize; - BYTE* mpStringBuf; - ULONG mnParaSize; - BYTE* mpPara; - - BOOL ImplGetString( void ); - BOOL ImplGetColor( ULONG ); - BOOL ImplGetScanLine( ULONG ); - BOOL ImplGetColSub( BYTE* ); - BOOL ImplGetColKey( BYTE ); - void ImplGetRGBHex( BYTE*, ULONG ); - BOOL ImplGetPara( ULONG numb ); - BOOL ImplCompare( BYTE*, BYTE*, ULONG, ULONG nmode = XPMCASENONSENSITIVE ); - ULONG ImplGetULONG( ULONG nPara ); + sal_uIntPtr mnWidth; + sal_uIntPtr mnHeight; + sal_uIntPtr mnColors; + sal_uIntPtr mnCpp; // characters per pix + sal_Bool mbTransparent; + sal_Bool mbStatus; + sal_uIntPtr mnStatus; + sal_uIntPtr mnIdentifier; + sal_uInt8 mcThisByte; + sal_uInt8 mcLastByte; + sal_uIntPtr mnTempAvail; + sal_uInt8* mpTempBuf; + sal_uInt8* mpTempPtr; + sal_uInt8* mpFastColorTable; + sal_uInt8* mpColMap; + sal_uIntPtr mnStringSize; + sal_uInt8* mpStringBuf; + sal_uIntPtr mnParaSize; + sal_uInt8* mpPara; + + sal_Bool ImplGetString( void ); + sal_Bool ImplGetColor( sal_uIntPtr ); + sal_Bool ImplGetScanLine( sal_uIntPtr ); + sal_Bool ImplGetColSub( sal_uInt8* ); + sal_Bool ImplGetColKey( sal_uInt8 ); + void ImplGetRGBHex( sal_uInt8*, sal_uIntPtr ); + sal_Bool ImplGetPara( sal_uIntPtr numb ); + sal_Bool ImplCompare( sal_uInt8*, sal_uInt8*, sal_uIntPtr, sal_uIntPtr nmode = XPMCASENONSENSITIVE ); + sal_uIntPtr ImplGetULONG( sal_uIntPtr nPara ); public: XPMReader( SvStream& rStm ); @@ -126,6 +126,6 @@ public: // - ImportXPM - // ------------- -BOOL ImportXPM( SvStream& rStream, Graphic& rGraphic ); +sal_Bool ImportXPM( SvStream& rStream, Graphic& rGraphic ); #endif // _XPMREAD_HXX diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index ec34ed07f25d..73e5718df147 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -137,7 +137,7 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque com::sun::star::java::RestartRequiredException e5; // Try to recover the Exception type in the any and // react accordingly. - USHORT nResult = RET_CANCEL; + sal_uInt16 nResult = RET_CANCEL; ::rtl::OUString aParameter; if ( anyExc >>= e1 ) diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 6458e359a49c..c941a3b3990d 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -286,7 +286,7 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey) sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 ); sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 ); sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 ); - USHORT nKey = (USHORT)aAWTKey.KeyCode; + sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode; return KeyCode(nKey, bShift, bMod1, bMod2, bMod3); } diff --git a/svtools/source/misc/cliplistener.cxx b/svtools/source/misc/cliplistener.cxx index 8fb61a5a1cb9..c16b58d57ad4 100644 --- a/svtools/source/misc/cliplistener.cxx +++ b/svtools/source/misc/cliplistener.cxx @@ -68,7 +68,7 @@ void SAL_CALL TransferableClipboardListener::changedContents( } } -void TransferableClipboardListener::AddRemoveListener( Window* pWin, BOOL bAdd ) +void TransferableClipboardListener::AddRemoveListener( Window* pWin, sal_Bool bAdd ) { try { diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index bf9e87d33a74..0118047d591e 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -47,9 +47,9 @@ //========================================================================= -static USHORT aWndFunc( +static sal_uInt16 aWndFunc( Window *pWin, // Parent des Dialoges - USHORT nFlags, + sal_uInt16 nFlags, const String &rErr, // Fehlertext const String &rAction) // Actiontext @@ -132,7 +132,7 @@ static USHORT aWndFunc( } } - USHORT nRet = RET_CANCEL; + sal_uInt16 nRet = RET_CANCEL; switch ( pBox->Execute() ) { case RET_OK: @@ -160,7 +160,7 @@ static USHORT aWndFunc( //------------------------------------------------------------------------- -SfxErrorHandler::SfxErrorHandler(USHORT nIdP, ULONG lStartP, ULONG lEndP, ResMgr *pMgrP) : +SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, sal_uIntPtr lStartP, sal_uIntPtr lEndP, ResMgr *pMgrP) : lStart(lStartP), lEnd(lEndP), nId(nIdP), pMgr(pMgrP), pFreeMgr( NULL ) @@ -183,8 +183,8 @@ SfxErrorHandler::~SfxErrorHandler() //------------------------------------------------------------------------- -BOOL SfxErrorHandler::CreateString( - const ErrorInfo *pErr, String &rStr, USHORT& nFlags) const +sal_Bool SfxErrorHandler::CreateString( + const ErrorInfo *pErr, String &rStr, sal_uInt16& nFlags) const /* [Beschreibung] @@ -193,9 +193,9 @@ BOOL SfxErrorHandler::CreateString( */ { - ULONG nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK; + sal_uIntPtr nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK; if( nErrCode>=lEnd || nErrCode<=lStart ) - return FALSE; + return sal_False; MessageInfo *pMsgInfo=PTR_CAST(MessageInfo,pErr); if(pMsgInfo) { @@ -209,7 +209,7 @@ BOOL SfxErrorHandler::CreateString( break; i = i + pMsgInfo->GetMessageArg().Len(); } - return TRUE; + return sal_True; } } else if(GetErrorString(nErrCode, rStr, nFlags)) @@ -229,10 +229,10 @@ BOOL SfxErrorHandler::CreateString( TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo, pErr); if (pTwoStringInfo) - for (USHORT i = 0; i < rStr.Len();) + for (sal_uInt16 i = 0; i < rStr.Len();) { - USHORT nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i); - USHORT nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i); + sal_uInt16 nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i); + sal_uInt16 nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i); if (nArg1Pos < nArg2Pos) { rStr.Replace(nArg1Pos, 7, pTwoStringInfo->GetArg1()); @@ -246,9 +246,9 @@ BOOL SfxErrorHandler::CreateString( else break; } } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } //------------------------------------------------------------------------- @@ -263,9 +263,9 @@ class ResString: public String */ { - USHORT nFlags; + sal_uInt16 nFlags; public: - USHORT GetFlags() const {return nFlags;} + sal_uInt16 GetFlags() const {return nFlags;} const String & GetString() const {return *this;} ResString( ResId &rId); }; @@ -273,14 +273,14 @@ class ResString: public String //------------------------------------------------------------------------- ResString::ResString(ResId & rId): - String(rId.SetAutoRelease(FALSE)), + String(rId.SetAutoRelease(sal_False)), nFlags(0) { ResMgr * pResMgr = rId.GetResMgr(); // String ctor temporarily sets global ResManager if (pResMgr->GetRemainSize()) - nFlags = USHORT(pResMgr->ReadShort()); - rId.SetAutoRelease(TRUE); + nFlags = sal_uInt16(pResMgr->ReadShort()); + rId.SetAutoRelease(sal_True); pResMgr->PopContext(); } @@ -297,18 +297,18 @@ struct ErrorResource_Impl : private Resource ResId aResId; - ErrorResource_Impl(ResId& rErrIdP, USHORT nId) + ErrorResource_Impl(ResId& rErrIdP, sal_uInt16 nId) : Resource(rErrIdP),aResId(nId,*rErrIdP.GetResMgr()){} ~ErrorResource_Impl() { FreeResource(); } operator ResString(){ return ResString( aResId ); } - operator BOOL(){return IsAvailableRes(aResId.SetRT(RSC_STRING));} + operator sal_Bool(){return IsAvailableRes(aResId.SetRT(RSC_STRING));} }; -BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const +sal_Bool SfxErrorHandler::GetClassString(sal_uIntPtr lClassId, String &rStr) const /* [Beschreibung] @@ -318,17 +318,17 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const */ { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILocale() ); ResMgr* pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(ofa), aLocale ); if( pResMgr ) { ResId aId(RID_ERRHDL, *pResMgr ); - ErrorResource_Impl aEr(aId, (USHORT)lClassId); + ErrorResource_Impl aEr(aId, (sal_uInt16)lClassId); if(aEr) { rStr=((ResString)aEr).GetString(); - bRet = TRUE; + bRet = sal_True; } } delete pResMgr; @@ -337,8 +337,8 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const //------------------------------------------------------------------------- -BOOL SfxErrorHandler::GetMessageString( - ULONG lErrId, String &rStr, USHORT &nFlags) const +sal_Bool SfxErrorHandler::GetMessageString( + sal_uIntPtr lErrId, String &rStr, sal_uInt16 &nFlags) const /* [Beschreibung] @@ -347,18 +347,18 @@ BOOL SfxErrorHandler::GetMessageString( */ { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; ResId *pResId= new ResId(nId, *pMgr); - ErrorResource_Impl aEr(*pResId, (USHORT)lErrId); + ErrorResource_Impl aEr(*pResId, (sal_uInt16)lErrId); if(aEr) { ResString aErrorString(aEr); - USHORT nResFlags = aErrorString.GetFlags(); + sal_uInt16 nResFlags = aErrorString.GetFlags(); if( nResFlags ) nFlags=aErrorString.GetFlags(); rStr = aErrorString.GetString(); - bRet = TRUE; + bRet = sal_True; } delete pResId; @@ -367,8 +367,8 @@ BOOL SfxErrorHandler::GetMessageString( //------------------------------------------------------------------------- -BOOL SfxErrorHandler::GetErrorString( - ULONG lErrId, String &rStr, USHORT &nFlags) const +sal_Bool SfxErrorHandler::GetErrorString( + sal_uIntPtr lErrId, String &rStr, sal_uInt16 &nFlags) const /* [Beschreibung] Erzeugt den Fehlerstring fuer den eigentlichen Fehler ohne @@ -379,25 +379,25 @@ BOOL SfxErrorHandler::GetErrorString( { NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; rStr=String(SvtResId(RID_ERRHDL_CLASS)); ResId aResId(nId, *pMgr); { - ErrorResource_Impl aEr(aResId, (USHORT)lErrId); + ErrorResource_Impl aEr(aResId, (sal_uInt16)lErrId); if(aEr) { ResString aErrorString(aEr); - USHORT nResFlags = aErrorString.GetFlags(); + sal_uInt16 nResFlags = aErrorString.GetFlags(); if ( nResFlags ) nFlags = nResFlags; rStr.SearchAndReplace( String::CreateFromAscii("$(ERROR)"), aErrorString.GetString()); - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; } if( bRet ) @@ -416,7 +416,7 @@ BOOL SfxErrorHandler::GetErrorString( //------------------------------------------------------------------------- SfxErrorContext::SfxErrorContext( - USHORT nCtxIdP, Window *pWindow, USHORT nResIdP, ResMgr *pMgrP) + sal_uInt16 nCtxIdP, Window *pWindow, sal_uInt16 nResIdP, ResMgr *pMgrP) : ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP) { if( nResId==USHRT_MAX ) @@ -426,8 +426,8 @@ SfxErrorContext::SfxErrorContext( //------------------------------------------------------------------------- SfxErrorContext::SfxErrorContext( - USHORT nCtxIdP, const String &aArg1P, Window *pWindow, - USHORT nResIdP, ResMgr *pMgrP) + sal_uInt16 nCtxIdP, const String &aArg1P, Window *pWindow, + sal_uInt16 nResIdP, ResMgr *pMgrP) : ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP), aArg1(aArg1P) { @@ -437,7 +437,7 @@ SfxErrorContext::SfxErrorContext( //------------------------------------------------------------------------- -BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr) +sal_Bool SfxErrorContext::GetString(sal_uIntPtr nErrId, String &rStr) /* [Beschreibung] @@ -473,7 +473,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr) if ( bRet ) { - USHORT nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR; + sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR; ResId aSfxResId( RID_ERRCTX, *pMgr ); ErrorResource_Impl aEr( aSfxResId, nId ); rStr.SearchAndReplace( String::CreateFromAscii( "$(ERR)" ), ( (ResString)aEr ).GetString() ); diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 3aa0016c225e..77cce8149ea4 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -245,7 +245,7 @@ struct EmbeddedObjectRef_Impl Graphic* pGraphic; Graphic* pHCGraphic; sal_Int64 nViewAspect; - BOOL bIsLocked; + sal_Bool bIsLocked; sal_Bool bNeedUpdate; // #i104867# @@ -260,7 +260,7 @@ void EmbeddedObjectRef::Construct_Impl() mpImp->pGraphic = 0; mpImp->pHCGraphic = 0; mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT; - mpImp->bIsLocked = FALSE; + mpImp->bIsLocked = sal_False; mpImp->bNeedUpdate = sal_False; mpImp->mnGraphicVersion = 0; mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000); @@ -397,7 +397,7 @@ void EmbeddedObjectRef::Clear() } mpImp->pContainer = 0; - mpImp->bIsLocked = FALSE; + mpImp->bIsLocked = sal_False; mpImp->bNeedUpdate = sal_False; } @@ -439,17 +439,17 @@ void EmbeddedObjectRef::SetViewAspect( sal_Int64 nAspect ) mpImp->nViewAspect = nAspect; } -void EmbeddedObjectRef::Lock( BOOL bLock ) +void EmbeddedObjectRef::Lock( sal_Bool bLock ) { mpImp->bIsLocked = bLock; } -BOOL EmbeddedObjectRef::IsLocked() const +sal_Bool EmbeddedObjectRef::IsLocked() const { return mpImp->bIsLocked; } -void EmbeddedObjectRef::GetReplacement( BOOL bUpdate ) +void EmbeddedObjectRef::GetReplacement( sal_Bool bUpdate ) { if ( bUpdate ) { @@ -488,7 +488,7 @@ Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const // bNeedUpdate will be set to false while retrieving new replacement const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True ); else if ( !mpImp->pGraphic ) - const_cast < EmbeddedObjectRef* >(this)->GetReplacement( FALSE ); + const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False ); if ( mpImp->pGraphic && pMediaType ) *pMediaType = mpImp->aMediaType; @@ -668,7 +668,7 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri mpImp->bNeedUpdate = sal_False; } -SvStream* EmbeddedObjectRef::GetGraphicStream( BOOL bUpdate ) const +SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const { RTL_LOGFILE_CONTEXT( aLog, "svtools (mv76033) svt::EmbeddedObjectRef::GetGraphicStream" ); DBG_ASSERT( bUpdate || mpImp->pContainer, "Can't retrieve current graphic!" ); @@ -722,7 +722,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri MapMode aMM( MAP_APPFONT ); Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, NULL ); Font aFnt( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Helvetica" ) ), aAppFontSz ); - aFnt.SetTransparent( TRUE ); + aFnt.SetTransparent( sal_True ); aFnt.SetColor( Color( COL_LIGHTRED ) ); aFnt.SetWeight( WEIGHT_BOLD ); aFnt.SetFamily( FAMILY_SWISS ); @@ -734,14 +734,14 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri Point aPt; // Nun den Text so skalieren, dass er in das Rect passt. // Wir fangen mit der Defaultsize an und gehen 1-AppFont runter - for( USHORT i = 8; i > 2; i-- ) + for( sal_uInt16 i = 8; i > 2; i-- ) { aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2; aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2; - BOOL bTiny = FALSE; - if( aPt.X() < 0 ) bTiny = TRUE, aPt.X() = 0; - if( aPt.Y() < 0 ) bTiny = TRUE, aPt.Y() = 0; + sal_Bool bTiny = sal_False; + if( aPt.X() < 0 ) bTiny = sal_True, aPt.X() = 0; + if( aPt.Y() < 0 ) bTiny = sal_True, aPt.Y() = 0; if( bTiny ) { // heruntergehen bei kleinen Bildern @@ -803,8 +803,8 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut aPixSize.Width() -= 1; aPixSize.Height() -= 1; Point aPixViewPos = pOut->LogicToPixel( rRect.TopLeft() ); - INT32 nMax = aPixSize.Width() + aPixSize.Height(); - for( INT32 i = 5; i < nMax; i += 5 ) + sal_Int32 nMax = aPixSize.Width() + aPixSize.Height(); + for( sal_Int32 i = 5; i < nMax; i += 5 ) { Point a1( aPixViewPos ), a2( aPixViewPos ); if( i > aPixSize.Width() ) @@ -823,15 +823,15 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut } -BOOL EmbeddedObjectRef::TryRunningState() +sal_Bool EmbeddedObjectRef::TryRunningState() { return TryRunningState( mxObj ); } -BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj ) +sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj ) { if ( !xEmbObj.is() ) - return FALSE; + return sal_False; try { @@ -840,10 +840,10 @@ BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbedded } catch ( uno::Exception& ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } void EmbeddedObjectRef::SetGraphicToContainer( const Graphic& rGraphic, @@ -906,7 +906,7 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand() } } -BOOL EmbeddedObjectRef::IsChart() const +sal_Bool EmbeddedObjectRef::IsChart() const { //todo maybe for 3.0: //if the changes work good for chart diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index cbf87f40b7fc..3d38f41c2e53 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -110,21 +110,21 @@ sal_Bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::D // TODO/LATER: Propbably the graphic should be copied here as well // currently it is handled by the applications utl::TempFile aTmp; - aTmp.EnableKillingFile( TRUE ); + aTmp.EnableKillingFile( sal_True ); uno::Reference < embed::XEmbedPersist > xPers( m_xObj, uno::UNO_QUERY ); if ( xPers.is() ) { uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetTemporaryStorage(); ::rtl::OUString aName = ::rtl::OUString::createFromAscii("Dummy"); SvStream* pStream = NULL; - BOOL bDeleteStream = FALSE; + sal_Bool bDeleteStream = sal_False; uno::Sequence < beans::PropertyValue > aEmpty; xPers->storeToEntry( xStg, aName, aEmpty, aEmpty ); if ( xStg->isStreamElement( aName ) ) { uno::Reference < io::XStream > xStm = xStg->cloneStreamElement( aName ); pStream = utl::UcbStreamHelper::CreateStream( xStm ); - bDeleteStream = TRUE; + bDeleteStream = sal_True; } else { @@ -251,6 +251,6 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) ); rDesc.maDragStartPos = Point(); rDesc.maDisplayName = String(); - rDesc.mbCanLink = FALSE; + rDesc.mbCanLink = sal_False; } diff --git a/svtools/source/misc/helpagentwindow.cxx b/svtools/source/misc/helpagentwindow.cxx index 1d407bbdb611..63c803be353d 100644 --- a/svtools/source/misc/helpagentwindow.cxx +++ b/svtools/source/misc/helpagentwindow.cxx @@ -106,7 +106,7 @@ namespace svt m_aPreferredSize.Height() += aSize.Height() - aOutputSize.Height(); SetPointer(Pointer(POINTER_REFHAND)); - AlwaysEnableInput( TRUE, TRUE ); + AlwaysEnableInput( sal_True, sal_True ); // unique id for the testtool SetUniqueId( HID_HELPAGENT_WINDOW ); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index c02ebc4477c6..95dbef61cb3b 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -59,160 +59,160 @@ // globals ******************************************************************* -#define NO_INDEX ((USHORT)0xFFFF) +#define NO_INDEX ((sal_uInt16)0xFFFF) #define CONTENT_HELPER ::utl::UCBContentHelper #define ASCII_STRING(s) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) ) struct SvtExtensionResIdMapping_Impl { const char* _pExt; - BOOL _bExt; - USHORT _nStrId; - USHORT _nImgId; + sal_Bool _bExt; + sal_uInt16 _nStrId; + sal_uInt16 _nImgId; }; static SvtExtensionResIdMapping_Impl __READONLY_DATA ExtensionMap_Impl[] = { - { "awk", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "bas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "bat", TRUE, STR_DESCRIPTION_BATCHFILE, 0 }, - { "bmk", FALSE, STR_DESCRIPTION_BOOKMARKFILE, 0 }, - { "bmp", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP }, - { "c", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "cfg", FALSE, STR_DESCRIPTION_CFGFILE, 0 }, - { "cmd", TRUE, STR_DESCRIPTION_BATCHFILE, 0 }, - { "cob", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "com", TRUE, STR_DESCRIPTION_APPLICATION, 0 }, - { "cxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "dbf", TRUE, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE }, - { "def", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "dll", TRUE, STR_DESCRIPTION_SYSFILE, 0 }, - { "doc", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, - { "dot", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE }, - { "docx", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, - { "dxf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF }, - { "exe", TRUE, STR_DESCRIPTION_APPLICATION, 0 }, - { "gif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF }, - { "h", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "hlp", FALSE, STR_DESCRIPTION_HELP_DOC, 0 }, - { "hrc", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "htm", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "html", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "asp", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "hxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "ini", FALSE, STR_DESCRIPTION_CFGFILE, 0 }, - { "java", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "jpeg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, - { "jpg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, - { "lha", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "awk", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "bas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "bat", sal_True, STR_DESCRIPTION_BATCHFILE, 0 }, + { "bmk", sal_False, STR_DESCRIPTION_BOOKMARKFILE, 0 }, + { "bmp", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP }, + { "c", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "cfg", sal_False, STR_DESCRIPTION_CFGFILE, 0 }, + { "cmd", sal_True, STR_DESCRIPTION_BATCHFILE, 0 }, + { "cob", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "com", sal_True, STR_DESCRIPTION_APPLICATION, 0 }, + { "cxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "dbf", sal_True, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE }, + { "def", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "dll", sal_True, STR_DESCRIPTION_SYSFILE, 0 }, + { "doc", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, + { "dot", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE }, + { "docx", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, + { "dxf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF }, + { "exe", sal_True, STR_DESCRIPTION_APPLICATION, 0 }, + { "gif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF }, + { "h", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "hlp", sal_False, STR_DESCRIPTION_HELP_DOC, 0 }, + { "hrc", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "htm", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "html", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "asp", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "hxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "ini", sal_False, STR_DESCRIPTION_CFGFILE, 0 }, + { "java", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "jpeg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, + { "jpg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG }, + { "lha", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, #ifdef WNT - { "lnk", FALSE, 0, 0 }, + { "lnk", sal_False, 0, 0 }, #endif - { "log", TRUE, STR_DESCRIPTION_LOGFILE, 0 }, - { "lst", TRUE, STR_DESCRIPTION_LOGFILE, 0 }, - { "met", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET }, - { "mml", FALSE, STR_DESCRIPTION_MATHML_DOC, IMG_MATH }, - { "mod", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "odb", FALSE, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC }, - { "odg", FALSE, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC }, - { "odf", FALSE, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC }, - { "odm", FALSE, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC }, - { "odp", FALSE, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC }, - { "ods", FALSE, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC }, - { "odt", FALSE, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC }, - { "otg", FALSE, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE }, - { "otp", FALSE, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE }, - { "ots", FALSE, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE }, - { "ott", FALSE, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE }, - { "pas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "pcd", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD }, - { "pct", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT }, - { "pcx", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX }, - { "pl", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "png", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG }, - { "rar", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "rtf", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, - { "sbl", FALSE, 0, 0 }, - { "sch", FALSE, 0, 0 }, - { "sda", FALSE, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW }, - { "sdb", FALSE, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE }, - { "sdc", FALSE, STR_DESCRIPTION_SCALC_DOC, IMG_CALC }, - { "sdd", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS }, - { "sdp", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, 0 }, - { "sds", FALSE, STR_DESCRIPTION_SCHART_DOC, 0 }, - { "sdw", FALSE, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER }, - { "sga", FALSE, 0, 0 }, - { "sgf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF }, - { "sgl", FALSE, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC }, - { "sgv", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV }, - { "shtml", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, - { "sim", FALSE, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM }, - { "smf", FALSE, STR_DESCRIPTION_SMATH_DOC, IMG_MATH }, - { "src", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 }, - { "svh", FALSE, STR_DESCRIPTION_HELP_DOC, 0 }, - { "svm", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM }, - { "stc", FALSE, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE }, - { "std", FALSE, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE }, - { "sti", FALSE, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE }, - { "stw", FALSE, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE }, - { "sxc", FALSE, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC }, - { "sxd", FALSE, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW }, - { "sxg", FALSE, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC }, - { "sxi", FALSE, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS }, - { "sxm", FALSE, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH }, - { "sxs", FALSE, STR_DESCRIPTION_SXCHART_DOC, 0 }, - { "sxw", FALSE, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER }, - { "sys", TRUE, STR_DESCRIPTION_SYSFILE, 0 }, - { "tif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, - { "tiff", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, - { "txt", FALSE, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE }, - { "url", FALSE, STR_DESCRIPTION_LINK, 0 }, - { "vor", FALSE, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE }, - { "vxd", TRUE, STR_DESCRIPTION_SYSFILE, 0 }, - { "wmf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF }, - { "xls", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, - { "xlt", FALSE, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE }, - { "xlsx", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, - { "uu", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "uue", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "z", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "zip", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "zoo", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "gz", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 }, - { "ppt", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, - { "pot", FALSE, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE }, - { "pps", FALSE, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS }, - { "pptx", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, - { "oxt", FALSE, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION }, - { 0, FALSE, 0, 0 } + { "log", sal_True, STR_DESCRIPTION_LOGFILE, 0 }, + { "lst", sal_True, STR_DESCRIPTION_LOGFILE, 0 }, + { "met", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET }, + { "mml", sal_False, STR_DESCRIPTION_MATHML_DOC, IMG_MATH }, + { "mod", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "odb", sal_False, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC }, + { "odg", sal_False, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC }, + { "odf", sal_False, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC }, + { "odm", sal_False, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC }, + { "odp", sal_False, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC }, + { "ods", sal_False, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC }, + { "odt", sal_False, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC }, + { "otg", sal_False, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE }, + { "otp", sal_False, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE }, + { "ots", sal_False, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE }, + { "ott", sal_False, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE }, + { "pas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "pcd", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD }, + { "pct", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT }, + { "pcx", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX }, + { "pl", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "png", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG }, + { "rar", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "rtf", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER }, + { "sbl", sal_False, 0, 0 }, + { "sch", sal_False, 0, 0 }, + { "sda", sal_False, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW }, + { "sdb", sal_False, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE }, + { "sdc", sal_False, STR_DESCRIPTION_SCALC_DOC, IMG_CALC }, + { "sdd", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS }, + { "sdp", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, 0 }, + { "sds", sal_False, STR_DESCRIPTION_SCHART_DOC, 0 }, + { "sdw", sal_False, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER }, + { "sga", sal_False, 0, 0 }, + { "sgf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF }, + { "sgl", sal_False, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC }, + { "sgv", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV }, + { "shtml", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML }, + { "sim", sal_False, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM }, + { "smf", sal_False, STR_DESCRIPTION_SMATH_DOC, IMG_MATH }, + { "src", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 }, + { "svh", sal_False, STR_DESCRIPTION_HELP_DOC, 0 }, + { "svm", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM }, + { "stc", sal_False, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE }, + { "std", sal_False, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE }, + { "sti", sal_False, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE }, + { "stw", sal_False, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE }, + { "sxc", sal_False, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC }, + { "sxd", sal_False, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW }, + { "sxg", sal_False, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC }, + { "sxi", sal_False, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS }, + { "sxm", sal_False, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH }, + { "sxs", sal_False, STR_DESCRIPTION_SXCHART_DOC, 0 }, + { "sxw", sal_False, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER }, + { "sys", sal_True, STR_DESCRIPTION_SYSFILE, 0 }, + { "tif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, + { "tiff", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF }, + { "txt", sal_False, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE }, + { "url", sal_False, STR_DESCRIPTION_LINK, 0 }, + { "vor", sal_False, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE }, + { "vxd", sal_True, STR_DESCRIPTION_SYSFILE, 0 }, + { "wmf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF }, + { "xls", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, + { "xlt", sal_False, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE }, + { "xlsx", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC }, + { "uu", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "uue", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "z", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "zip", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "zoo", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "gz", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 }, + { "ppt", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, + { "pot", sal_False, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE }, + { "pps", sal_False, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS }, + { "pptx", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS }, + { "oxt", sal_False, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION }, + { 0, sal_False, 0, 0 } }; #ifdef OS2 SvtExtensionResIdMapping_Impl Mappings[] = { - {"StarWriter 4.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, - {"StarWriter 3.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, - {"StarCalc 4.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, - {"StarCalc 3.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, - {"StarImpress 4.0", FALSE,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS}, - {"StarDraw 4.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, - {"StarDraw 3.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, - {"StarChart 3.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, - {"StarChart 4.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, - {"Bitmap", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, - {"AutoCAD", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"Gif-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF}, - {"JPEG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG}, - {"Metafile ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"Photo-CD ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD}, - {"Mac Pict", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT}, - {"PCX-File ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX}, - {"PNG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"SV-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, - {"TIFF-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF}, - {"MS-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF}, - {"XBM-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, - {"UniformResourceLocator", FALSE,STR_DESCRIPTION_LINK, IMG_URL}, + {"StarWriter 4.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, + {"StarWriter 3.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER}, + {"StarCalc 4.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, + {"StarCalc 3.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC}, + {"StarImpress 4.0", sal_False,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS}, + {"StarDraw 4.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, + {"StarDraw 3.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW}, + {"StarChart 3.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, + {"StarChart 4.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART}, + {"Bitmap", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, + {"AutoCAD", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"Gif-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF}, + {"JPEG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG}, + {"Metafile ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"Photo-CD ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD}, + {"Mac Pict", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT}, + {"PCX-File ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX}, + {"PNG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"SV-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM}, + {"TIFF-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF}, + {"MS-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF}, + {"XBM-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP}, + {"UniformResourceLocator", sal_False,STR_DESCRIPTION_LINK, IMG_URL}, {NULL, 0} }; #endif @@ -248,7 +248,7 @@ static String GetImageExtensionByFactory_Impl( const String& rURL ) if ( aPath.Len() ) { - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; while ( Fac2ExtMap_Impl[ nIndex ]._pFactory ) { if ( aPath.EqualsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) ) @@ -306,12 +306,12 @@ static String GetImageExtensionByFactory_Impl( const String& rURL ) return aExtension; } -static USHORT GetIndexOfExtension_Impl( const String& rExtension ) +static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension ) { - USHORT nRet = NO_INDEX; + sal_uInt16 nRet = NO_INDEX; if ( rExtension.Len() ) { - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; String aExt = rExtension; aExt.ToLowerAscii(); while ( ExtensionMap_Impl[ nIndex ]._pExt ) @@ -328,12 +328,12 @@ static USHORT GetIndexOfExtension_Impl( const String& rExtension ) return nRet; } -static USHORT GetImageId_Impl( const String& rExtension ) +static sal_uInt16 GetImageId_Impl( const String& rExtension ) { - USHORT nImage = IMG_FILE; + sal_uInt16 nImage = IMG_FILE; if ( rExtension.Len() != NO_INDEX ) { - USHORT nIndex = GetIndexOfExtension_Impl( rExtension ); + sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension ); if ( nIndex != NO_INDEX ) { nImage = ExtensionMap_Impl[ nIndex ]._nImgId; @@ -369,9 +369,9 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool return bRet; } -static USHORT GetFolderImageId_Impl( const String& rURL ) +static sal_uInt16 GetFolderImageId_Impl( const String& rURL ) { - USHORT nRet = IMG_FOLDER; + sal_uInt16 nRet = IMG_FOLDER; ::svtools::VolumeInfo aVolumeInfo; try { @@ -399,12 +399,12 @@ static USHORT GetFolderImageId_Impl( const String& rURL ) return nRet; } -static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder ) +static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder ) { RTL_LOGFILE_CONTEXT_AUTHOR( aTimeLog, "svtools", "hb93813", "SvFileInformationManager::GetImageId_Impl()" ); String aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE ); - USHORT nImage = IMG_FILE; + sal_uInt16 nImage = IMG_FILE; if ( rObject.GetProtocol() == INET_PROT_PRIVATE ) { @@ -419,7 +419,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol return nImage; } else if ( aType == String( RTL_CONSTASCII_STRINGPARAM("image") ) ) - nImage = (USHORT)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32(); + nImage = (sal_uInt16)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32(); } else { @@ -427,7 +427,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol if ( aExt.EqualsAscii( "vor" ) ) { SotStorageRef aStorage = new SotStorage( sURL, STREAM_STD_READ ); - USHORT nId = IMG_WRITERTEMPLATE; + sal_uInt16 nId = IMG_WRITERTEMPLATE; if ( !aStorage->GetError() ) { SvGlobalName aGlobalName = aStorage->GetClassName(); @@ -456,13 +456,13 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol return nImage; } -static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt ) +static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt ) { - USHORT nId = 0; + sal_uInt16 nId = 0; if ( rExtension.Len() != NO_INDEX ) { - USHORT nIndex = GetIndexOfExtension_Impl( rExtension ); + sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension ); if ( nIndex != NO_INDEX ) { nId = ExtensionMap_Impl[ nIndex ]._nStrId; @@ -475,7 +475,7 @@ static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowE static String GetDescriptionByFactory_Impl( const String& rFactory ) { - USHORT nResId = 0; + sal_uInt16 nResId = 0; if ( rFactory.EqualsIgnoreCaseAscii( "swriter", 0, 7 ) ) nResId = STR_DESCRIPTION_FACTORY_WRITER; else if ( rFactory.EqualsIgnoreCaseAscii( "scalc", 0, 5 ) ) @@ -502,9 +502,9 @@ static String GetDescriptionByFactory_Impl( const String& rFactory ) return aRet; } -static USHORT GetFolderDescriptionId_Impl( const String& rURL ) +static sal_uInt16 GetFolderDescriptionId_Impl( const String& rURL ) { - USHORT nRet = STR_DESCRIPTION_FOLDER; + sal_uInt16 nRet = STR_DESCRIPTION_FOLDER; svtools::VolumeInfo aVolumeInfo; try { @@ -553,7 +553,7 @@ static ResMgr* GetIsoResMgr_Impl() return pIsoResMgr; } -static ImageList* CreateImageList_Impl( USHORT nResId ) +static ImageList* CreateImageList_Impl( sal_uInt16 nResId ) { ImageList* pList = NULL; ResMgr* pResMgr = GetIsoResMgr_Impl(); @@ -567,7 +567,7 @@ static ImageList* CreateImageList_Impl( USHORT nResId ) return pList; } -static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContrast ) +static Image GetOfficeImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig, sal_Bool bHighContrast ) { ImageList* pList = NULL; @@ -575,7 +575,7 @@ static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHigh static ImageList* _pBigOfficeImgList = NULL; static ImageList* _pSmallHCOfficeImgList = NULL; static ImageList* _pBigHCOfficeImgList = NULL; - static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); + static sal_uIntPtr nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); // If the style has been changed, throw away our cache of the older images if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() ) @@ -588,11 +588,11 @@ static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHigh } // #i21242# MT: For B&W we need the HC Image and must transform. - // bHiContrast is TRUE for all dark backgrounds, but we need HC Images for HC White also, + // bHiContrast is sal_True for all dark backgrounds, but we need HC Images for HC White also, // so we can't rely on bHighContrast. - BOOL bBlackAndWhite = Application::GetSettings().GetStyleSettings().IsHighContrastBlackAndWhite(); + sal_Bool bBlackAndWhite = Application::GetSettings().GetStyleSettings().IsHighContrastBlackAndWhite(); if ( bBlackAndWhite ) - bHighContrast = TRUE; + bHighContrast = sal_True; if ( bBig ) @@ -642,7 +642,7 @@ static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHigh return aImage; } -static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContrast ) +static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig, sal_Bool bHighContrast ) { if ( !bBig && IMG_FOLDER == nImageId && !bHighContrast ) // return our new small folder image (256 colors) @@ -654,7 +654,7 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContra static ImageList* _pBigImageList = NULL; static ImageList* _pSmallHCImageList = NULL; static ImageList* _pBigHCImageList = NULL; - static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); + static sal_uIntPtr nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); // If the style has been changed, throw away our cache of the older images if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() ) @@ -727,7 +727,7 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje String sDescription; String sExtension( rObject.getExtension() ), sURL( rObject.GetMainURL( INetURLObject::NO_DECODE ) ); - USHORT nResId = 0; + sal_uInt16 nResId = 0; sal_Bool bShowExt = sal_False, bDetected = sal_False, bOnlyFile = sal_False; sal_Bool bFolder = bDetectFolder ? CONTENT_HELPER::IsFolder( sURL ) : sal_False; if ( !bFolder ) @@ -793,41 +793,41 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje Image SvFileInformationManager::GetImage( const INetURLObject& rObject, sal_Bool bBig ) { - return GetImage( rObject, bBig, FALSE ); + return GetImage( rObject, bBig, sal_False ); } Image SvFileInformationManager::GetFileImage( const INetURLObject& rObject, sal_Bool bBig ) { - return GetFileImage( rObject, bBig, FALSE ); + return GetFileImage( rObject, bBig, sal_False ); } Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, sal_Bool bBig ) { - return GetImageNoDefault( rObject, bBig, FALSE ); + return GetImageNoDefault( rObject, bBig, sal_False ); } Image SvFileInformationManager::GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig ) { - return GetFolderImage( rInfo, bBig, FALSE ); + return GetFolderImage( rInfo, bBig, sal_False ); } Image SvFileInformationManager::GetImage( const INetURLObject& rObject, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = GetImageId_Impl( rObject, sal_True ); + sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True ); DBG_ASSERT( nImage, "invalid ImageId" ); return GetImageFromList_Impl( nImage, bBig, bHighContrast ); } Image SvFileInformationManager::GetFileImage( const INetURLObject& rObject, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = GetImageId_Impl( rObject, sal_False ); + sal_uInt16 nImage = GetImageId_Impl( rObject, sal_False ); DBG_ASSERT( nImage, "invalid ImageId" ); return GetImageFromList_Impl( nImage, bBig, bHighContrast ); } Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = GetImageId_Impl( rObject, sal_True ); + sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True ); DBG_ASSERT( nImage, "invalid ImageId" ); if ( nImage == IMG_FILE ) @@ -838,7 +838,7 @@ Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, Image SvFileInformationManager::GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig, sal_Bool bHighContrast ) { - USHORT nImage = IMG_FOLDER; + sal_uInt16 nImage = IMG_FOLDER; DBG_ASSERT( nImage, "invalid ImageId" ); if ( rInfo.m_bIsRemote ) @@ -865,7 +865,7 @@ String SvFileInformationManager::GetFileDescription( const INetURLObject& rObjec String SvFileInformationManager::GetFolderDescription( const svtools::VolumeInfo& rInfo ) { - USHORT nResId = STR_DESCRIPTION_FOLDER; + sal_uInt16 nResId = STR_DESCRIPTION_FOLDER; if ( rInfo.m_bIsRemote ) nResId = STR_DESCRIPTION_REMOTE_VOLUME; else if ( rInfo.m_bIsFloppy ) diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 25f23e2ef00b..0704b6a0da22 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -52,7 +52,7 @@ DBG_NAME( ImageMap ) /******************************************************************************/ -UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW; +sal_uInt16 IMapObject::nActualTextEncoding = (sal_uInt16) RTL_TEXTENCODING_DONTKNOW; /******************************************************************************/ @@ -68,7 +68,7 @@ IMapObject::IMapObject() } IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc, - const String& rTarget, const String& rName, BOOL bURLActive ) + const String& rTarget, const String& rName, sal_Bool bURLActive ) : aURL( rURL ) , aAltText( rAltText ) , aDesc( rDesc ) @@ -86,7 +86,7 @@ IMapObject::IMapObject( const String& rURL, const String& rAltText, const String |* \******************************************************************************/ -UINT16 IMapObject::GetVersion() const +sal_uInt16 IMapObject::GetVersion() const { return IMAP_OBJ_VERSION; } @@ -105,7 +105,7 @@ void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const rOStm << GetType(); rOStm << GetVersion(); - rOStm << ( (UINT16) eEncoding ); + rOStm << ( (sal_uInt16) eEncoding ); const ByteString aRelURL = ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), eEncoding ); rOStm.WriteByteString( aRelURL ); @@ -196,7 +196,7 @@ Point IMapObject::GetLogPoint( const Point& rPixelPoint ) |* \******************************************************************************/ -BOOL IMapObject::IsEqual( const IMapObject& rEqObj ) +sal_Bool IMapObject::IsEqual( const IMapObject& rEqObj ) { return ( ( aURL == rEqObj.aURL ) && ( aAltText == rEqObj.aAltText ) && @@ -217,8 +217,8 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect, const String& rDesc, const String& rTarget, const String& rName, - BOOL bURLActive, - BOOL bPixelCoords ) : + sal_Bool bURLActive, + sal_Bool bPixelCoords ) : IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ) { ImpConstruct( rRect, bPixelCoords ); @@ -231,7 +231,7 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect, |* \******************************************************************************/ -void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, BOOL bPixel ) +void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, sal_Bool bPixel ) { if ( bPixel ) aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MAP_100TH_MM ) ); @@ -270,7 +270,7 @@ void IMapRectangleObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -UINT16 IMapRectangleObject::GetType() const +sal_uInt16 IMapRectangleObject::GetType() const { return IMAP_OBJ_RECTANGLE; } @@ -282,7 +282,7 @@ UINT16 IMapRectangleObject::GetType() const |* \******************************************************************************/ -BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const +sal_Bool IMapRectangleObject::IsHit( const Point& rPoint ) const { return aRect.IsInside( rPoint ); } @@ -294,7 +294,7 @@ BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const |* \******************************************************************************/ -Rectangle IMapRectangleObject::GetRectangle( BOOL bPixelCoords ) const +Rectangle IMapRectangleObject::GetRectangle( sal_Bool bPixelCoords ) const { Rectangle aNewRect; @@ -334,7 +334,7 @@ void IMapRectangleObject::Scale( const Fraction& rFracX, const Fraction& rFracY |* \******************************************************************************/ -BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) +sal_Bool IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) { return ( IMapObject::IsEqual( rEqObj ) && ( aRect == rEqObj.aRect ) ); } @@ -344,14 +344,14 @@ BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj ) /******************************************************************************/ /******************************************************************************/ -IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius, +IMapCircleObject::IMapCircleObject( const Point& rCenter, sal_uIntPtr nCircleRadius, const String& rURL, const String& rAltText, const String& rDesc, const String& rTarget, const String& rName, - BOOL bURLActive, - BOOL bPixelCoords ) : + sal_Bool bURLActive, + sal_Bool bPixelCoords ) : IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ) { ImpConstruct( rCenter, nCircleRadius, bPixelCoords ); @@ -364,7 +364,7 @@ IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius, |* \******************************************************************************/ -void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPixel ) +void IMapCircleObject::ImpConstruct( const Point& rCenter, sal_uIntPtr nRad, sal_Bool bPixel ) { if ( bPixel ) { @@ -389,7 +389,7 @@ void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPix void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const { - UINT32 nTmp = nRadius; + sal_uInt32 nTmp = nRadius; rOStm << aCenter; rOStm << nTmp; @@ -404,7 +404,7 @@ void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const void IMapCircleObject::ReadIMapObject( SvStream& rIStm ) { - UINT32 nTmp; + sal_uInt32 nTmp; rIStm >> aCenter; rIStm >> nTmp; @@ -419,7 +419,7 @@ void IMapCircleObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -UINT16 IMapCircleObject::GetType() const +sal_uInt16 IMapCircleObject::GetType() const { return IMAP_OBJ_CIRCLE; } @@ -431,15 +431,15 @@ UINT16 IMapCircleObject::GetType() const |* \******************************************************************************/ -BOOL IMapCircleObject::IsHit( const Point& rPoint ) const +sal_Bool IMapCircleObject::IsHit( const Point& rPoint ) const { const Point aPoint( aCenter - rPoint ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - if ( (ULONG) sqrt( (double) aPoint.X() * aPoint.X() + + if ( (sal_uIntPtr) sqrt( (double) aPoint.X() * aPoint.X() + aPoint.Y() * aPoint.Y() ) <= nRadius ) { - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -452,7 +452,7 @@ BOOL IMapCircleObject::IsHit( const Point& rPoint ) const |* \******************************************************************************/ -Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const +Point IMapCircleObject::GetCenter( sal_Bool bPixelCoords ) const { Point aNewPoint; @@ -471,9 +471,9 @@ Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const |* \******************************************************************************/ -ULONG IMapCircleObject::GetRadius( BOOL bPixelCoords ) const +sal_uIntPtr IMapCircleObject::GetRadius( sal_Bool bPixelCoords ) const { - ULONG nNewRadius; + sal_uIntPtr nNewRadius; if ( bPixelCoords ) nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MAP_100TH_MM ) ).Width(); @@ -527,7 +527,7 @@ void IMapCircleObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) |* \******************************************************************************/ -BOOL IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj ) +sal_Bool IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj ) { return ( IMapObject::IsEqual( rEqObj ) && ( aCenter == rEqObj.aCenter ) && @@ -544,10 +544,10 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly, const String& rDesc, const String& rTarget, const String& rName, - BOOL bURLActive, - BOOL bPixelCoords ) : + sal_Bool bURLActive, + sal_Bool bPixelCoords ) : IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ), - bEllipse ( FALSE ) + bEllipse ( sal_False ) { ImpConstruct( rPoly, bPixelCoords ); } @@ -559,7 +559,7 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly, |* \******************************************************************************/ -void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, BOOL bPixel ) +void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, sal_Bool bPixel ) { if ( bPixel ) aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MAP_100TH_MM ) ); @@ -607,7 +607,7 @@ void IMapPolygonObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -UINT16 IMapPolygonObject::GetType() const +sal_uInt16 IMapPolygonObject::GetType() const { return IMAP_OBJ_POLYGON; } @@ -619,7 +619,7 @@ UINT16 IMapPolygonObject::GetType() const |* \******************************************************************************/ -BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const +sal_Bool IMapPolygonObject::IsHit( const Point& rPoint ) const { return aPoly.IsInside( rPoint ); } @@ -631,7 +631,7 @@ BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const |* \******************************************************************************/ -Polygon IMapPolygonObject::GetPolygon( BOOL bPixelCoords ) const +Polygon IMapPolygonObject::GetPolygon( sal_Bool bPixelCoords ) const { Polygon aNewPoly; @@ -654,7 +654,7 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse ) { if ( aPoly.GetSize() ) { - bEllipse = TRUE; + bEllipse = sal_True; aEllipse = rEllipse; } } @@ -668,9 +668,9 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse ) void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) { - USHORT nCount = aPoly.GetSize(); + sal_uInt16 nCount = aPoly.GetSize(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { Point aScaledPt( aPoly[ i ] ); @@ -704,30 +704,30 @@ void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) |* \******************************************************************************/ -BOOL IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj ) +sal_Bool IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( IMapObject::IsEqual( rEqObj ) ) { const Polygon& rEqPoly = rEqObj.aPoly; - const USHORT nCount = aPoly.GetSize(); - const USHORT nEqCount = rEqPoly.GetSize(); - BOOL bDifferent = FALSE; + const sal_uInt16 nCount = aPoly.GetSize(); + const sal_uInt16 nEqCount = rEqPoly.GetSize(); + sal_Bool bDifferent = sal_False; if ( nCount == nEqCount ) { - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { if ( aPoly[ i ] != rEqPoly[ i ] ) { - bDifferent = TRUE; + bDifferent = sal_True; break; } } if ( !bDifferent ) - bRet = TRUE; + bRet = sal_True; } } @@ -762,9 +762,9 @@ ImageMap::ImageMap( const ImageMap& rImageMap ) { DBG_CTOR( ImageMap, NULL ); - USHORT nCount = rImageMap.GetIMapObjectCount(); + sal_uInt16 nCount = rImageMap.GetIMapObjectCount(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { IMapObject* pCopyObj = rImageMap.GetIMapObject( i ); @@ -835,11 +835,11 @@ void ImageMap::ClearImageMap() ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) { - USHORT nCount = rImageMap.GetIMapObjectCount(); + sal_uInt16 nCount = rImageMap.GetIMapObjectCount(); ClearImageMap(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { IMapObject* pCopyObj = rImageMap.GetIMapObject( i ); @@ -874,17 +874,17 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) |* \******************************************************************************/ -BOOL ImageMap::operator==( const ImageMap& rImageMap ) +sal_Bool ImageMap::operator==( const ImageMap& rImageMap ) { - const USHORT nCount = (USHORT) maList.Count(); - const USHORT nEqCount = rImageMap.GetIMapObjectCount(); - BOOL bRet = FALSE; + const sal_uInt16 nCount = (sal_uInt16) maList.Count(); + const sal_uInt16 nEqCount = rImageMap.GetIMapObjectCount(); + sal_Bool bRet = sal_False; if ( nCount == nEqCount ) { - BOOL bDifferent = ( aName != rImageMap.aName ); + sal_Bool bDifferent = ( aName != rImageMap.aName ); - for ( USHORT i = 0; ( i < nCount ) && !bDifferent; i++ ) + for ( sal_uInt16 i = 0; ( i < nCount ) && !bDifferent; i++ ) { IMapObject* pObj = (IMapObject*) maList.GetObject( i ); IMapObject* pEqObj = rImageMap.GetIMapObject( i ); @@ -896,21 +896,21 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap ) case( IMAP_OBJ_RECTANGLE ): { if ( !( (IMapRectangleObject*) pObj )->IsEqual( *(IMapRectangleObject*) pEqObj ) ) - bDifferent = TRUE; + bDifferent = sal_True; } break; case( IMAP_OBJ_CIRCLE ): { if ( !( (IMapCircleObject*) pObj )->IsEqual( *(IMapCircleObject*) pEqObj ) ) - bDifferent = TRUE; + bDifferent = sal_True; } break; case( IMAP_OBJ_POLYGON ): { if ( !( (IMapPolygonObject*) pObj )->IsEqual( *(IMapPolygonObject*) pEqObj ) ) - bDifferent = TRUE; + bDifferent = sal_True; } break; @@ -919,11 +919,11 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap ) } } else - bDifferent = TRUE; + bDifferent = sal_True; } if ( !bDifferent ) - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -936,7 +936,7 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap ) |* \******************************************************************************/ -BOOL ImageMap::operator!=( const ImageMap& rImageMap ) +sal_Bool ImageMap::operator!=( const ImageMap& rImageMap ) { return !( *this == rImageMap ); } @@ -948,7 +948,7 @@ BOOL ImageMap::operator!=( const ImageMap& rImageMap ) |* \******************************************************************************/ -UINT16 ImageMap::GetVersion() const +sal_uInt16 ImageMap::GetVersion() const { return IMAGE_MAP_VERSION; } @@ -991,7 +991,7 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject ) IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, const Size& rDisplaySize, const Point& rRelHitPoint, - ULONG nFlags ) + sal_uIntPtr nFlags ) { Point aRelPoint( rTotalSize.Width() * rRelHitPoint.X() / rDisplaySize.Width(), rTotalSize.Height() * rRelHitPoint.Y() / rDisplaySize.Height() ); @@ -1030,9 +1030,9 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, Rectangle ImageMap::GetBoundRect() const { Rectangle aBoundRect; - ULONG nCount = maList.Count(); + sal_uIntPtr nCount = maList.Count(); - for ( ULONG i = 0; i < nCount; i++ ) + for ( sal_uIntPtr i = 0; i < nCount; i++ ) aBoundRect.Union( ( (IMapObject*) maList.GetObject( i ) )->GetBoundRect() ); return aBoundRect; @@ -1047,9 +1047,9 @@ Rectangle ImageMap::GetBoundRect() const void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) { - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { IMapObject* pObj = GetIMapObject( i ); @@ -1083,9 +1083,9 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pObj = (IMapObject*) maList.GetObject( i ); pObj->Write( rOStm, rBaseURL ); @@ -1099,12 +1099,12 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const |* \******************************************************************************/ -void ImageMap::ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& rBaseURL ) +void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& rBaseURL ) { // neue Objekte einlesen - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { - UINT16 nType; + sal_uInt16 nType; rIStm >> nType; rIStm.SeekRel( -2 ); @@ -1153,8 +1153,8 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const IMapCompat* pCompat; String aImageName( GetName() ); String aDummy; - USHORT nOldFormat = rOStm.GetNumberFormatInt(); - UINT16 nCount = (UINT16) GetIMapObjectCount(); + sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); + sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount(); const rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding(); rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -1189,8 +1189,8 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL ) { ByteString aString; char cMagic[6]; - USHORT nOldFormat = rIStm.GetNumberFormatInt(); - UINT16 nCount; + sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + sal_uInt16 nCount; rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); rIStm.Read( cMagic, sizeof( cMagic ) ); diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 9834fe0fcb76..92dc43152ed1 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -218,9 +218,9 @@ void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) cons void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const { ByteString aStr( "polygon " ); - const USHORT nCount = aPoly.GetSize(); + const sal_uInt16 nCount = aPoly.GetSize(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) AppendCERNCoords( aPoly[ i ], aStr ); AppendCERNURL( aStr, rBaseURL ); @@ -238,11 +238,11 @@ void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) co void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { ByteString aStr( "poly " ); - const USHORT nCount = Min( aPoly.GetSize(), (USHORT) 100 ); + const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 ); AppendNCSAURL( aStr, rBaseURL ); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) AppendNCSACoords( aPoly[ i ], aStr ); rOStm.WriteLine( aStr ); @@ -259,7 +259,7 @@ void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) co |* \******************************************************************************/ -void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) const +void ImageMap::Write( SvStream& rOStm, sal_uIntPtr nFormat, const String& rBaseURL ) const { switch( nFormat ) { @@ -282,9 +282,9 @@ void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) c void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pObj = GetIMapObject( i ); @@ -318,9 +318,9 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - USHORT nCount = (USHORT) maList.Count(); + sal_uInt16 nCount = (sal_uInt16) maList.Count(); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { pObj = GetIMapObject( i ); @@ -351,9 +351,9 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const |* \******************************************************************************/ -ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL ) +sal_uIntPtr ImageMap::Read( SvStream& rIStm, sal_uIntPtr nFormat, const String& rBaseURL ) { - ULONG nRet = IMAP_ERR_FORMAT; + sal_uIntPtr nRet = IMAP_ERR_FORMAT; if ( nFormat == IMAP_FORMAT_DETECT ) nFormat = ImpDetectFormat( rIStm ); @@ -381,7 +381,7 @@ ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL ) |* \******************************************************************************/ -ULONG ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) +sal_uIntPtr ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) { ByteString aStr; @@ -444,11 +444,11 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL } else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) ) { - const USHORT nCount = aStr.GetTokenCount( '(' ) - 1; + const sal_uInt16 nCount = aStr.GetTokenCount( '(' ) - 1; Polygon aPoly( nCount ); String aURL; - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) aPoly[ i ] = ImpReadCERNCoords( &pStr ); aURL = ImpReadCERNURL( &pStr, rBaseURL ); @@ -559,7 +559,7 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL ) |* \******************************************************************************/ -ULONG ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) +sal_uIntPtr ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) { ByteString aStr; @@ -624,11 +624,11 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL } else if ( aToken == "poly" ) { - const USHORT nCount = aStr.GetTokenCount( ',' ) - 1; + const sal_uInt16 nCount = aStr.GetTokenCount( ',' ) - 1; const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) ); Polygon aPoly( nCount ); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) aPoly[ i ] = ImpReadNCSACoords( &pStr ); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() ); @@ -714,10 +714,10 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr ) |* \******************************************************************************/ -ULONG ImageMap::ImpDetectFormat( SvStream& rIStm ) +sal_uIntPtr ImageMap::ImpDetectFormat( SvStream& rIStm ) { - ULONG nPos = rIStm.Tell(); - ULONG nRet = IMAP_FORMAT_BIN; + sal_uIntPtr nPos = rIStm.Tell(); + sal_uIntPtr nRet = IMAP_FORMAT_BIN; char cMagic[6]; rIStm.Read( cMagic, sizeof( cMagic ) ); diff --git a/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx index 76763ae422f2..3ff6d41fac39 100644 --- a/svtools/source/misc/imap3.cxx +++ b/svtools/source/misc/imap3.cxx @@ -40,7 +40,7 @@ |* \******************************************************************************/ -IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) : +IMapCompat::IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode ) : pRWStm ( &rStm ), nStmMode ( nStreamMode ) { @@ -56,7 +56,7 @@ IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) : } else { - UINT32 nTotalSizeTmp; + sal_uInt32 nTotalSizeTmp; *pRWStm >> nTotalSizeTmp; nTotalSize = nTotalSizeTmp; nCompatPos = pRWStm->Tell(); @@ -77,15 +77,15 @@ IMapCompat::~IMapCompat() { if ( nStmMode == STREAM_WRITE ) { - const ULONG nEndPos = pRWStm->Tell(); + const sal_uIntPtr nEndPos = pRWStm->Tell(); pRWStm->Seek( nCompatPos ); - *pRWStm << (UINT32) ( nEndPos - nTotalSize ); + *pRWStm << (sal_uInt32) ( nEndPos - nTotalSize ); pRWStm->Seek( nEndPos ); } else { - const ULONG nReadSize = pRWStm->Tell() - nCompatPos; + const sal_uIntPtr nReadSize = pRWStm->Tell() - nCompatPos; if ( nTotalSize > nReadSize ) pRWStm->SeekRel( nTotalSize - nReadSize ); diff --git a/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx index 559d31cdeb1d..05d7cf62a51a 100644 --- a/svtools/source/misc/itemdel.cxx +++ b/svtools/source/misc/itemdel.cxx @@ -124,7 +124,7 @@ void DeleteOnIdleItems() = ImpSvtData::GetSvtData().pItemDesruptList; if ( rpList ) { - USHORT n; + sal_uInt16 n; while ( 0 != ( n = rpList->Count() ) ) // Remove ist implizit im Dtor delete rpList->GetObject( n-1 ); diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index d1ff94572a99..61d397afbec9 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -51,7 +51,7 @@ using namespace ::com::sun::star; SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) { - const USHORT nLen = rText.Len(); + const sal_uInt16 nLen = rText.Len(); if (nLen == 0) return String(); @@ -77,7 +77,7 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) // Thus we can avoid to check every character of the text. bool bFound = false; bool bIsRtlText = false; - for (USHORT i = 0; i < nLen && !bFound; ++i) + for (sal_uInt16 i = 0; i < nLen && !bFound; ++i) { sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i ); switch (nDirection) diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx index 65715f635883..a162dd16dc7f 100644 --- a/svtools/source/misc/svtdata.cxx +++ b/svtools/source/misc/svtdata.cxx @@ -75,7 +75,7 @@ ResMgr * ImpSvtData::GetPatchResMgr() return GetPatchResMgr(Application::GetSettings().GetUILocale()); } -SvpResId::SvpResId( USHORT nId ) : +SvpResId::SvpResId( sal_uInt16 nId ) : ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() ) { } diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 62f3ec39eb6f..a7f5b978f0f4 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -506,7 +506,7 @@ namespace svt static sal_Int32 getMagicNumber(); static void normalize( TemplateFolderContent& _rState ); - // @return <TRUE/> if the states equal + // @return <sal_True/> if the states equal static sal_Bool equalStates( const TemplateFolderContent& _rLHS, const TemplateFolderContent& _rRHS ); // late initialize m_xOfficeInstDirs diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 268533ebb8c8..1d2aba199e94 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -440,7 +440,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th SvMemoryStream aDstStm( 65535, 65535 ); // taking wmf without file header - if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, FALSE ) ) + if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, sal_False ) ) { maAny <<= ( aSeq = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aDstStm.GetData() ), aDstStm.Seek( STREAM_SEEK_TO_END ) ) ); @@ -944,7 +944,7 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, rFDesc1.dwFlags = FD_LINKUI; ByteString aStr( rBmk.GetDescription(), eSysCSet ); - for( USHORT nChar = 0; nChar < aStr.Len(); ++nChar ) + for( sal_uInt16 nChar = 0; nChar < aStr.Len(); ++nChar ) if( strchr( "\\/:*?\"<>|", aStr.GetChar( nChar ) ) ) aStr.Erase( nChar--, 1 ); @@ -1852,7 +1852,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE ) { rMtf = aGraphic.GetGDIMetaFile(); - bRet = TRUE; + bRet = sal_True; } } @@ -1866,7 +1866,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE ) { rMtf = aGraphic.GetGDIMetaFile(); - bRet = TRUE; + bRet = sal_True; } } diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index dcd0f81b2758..6cf2645c10ad 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -441,7 +441,7 @@ sal_Bool TransferDataContainer::GetData( const TDataCntnrEntryList::iterator aIter( pImpl->aFmtList.begin() ), aEnd( pImpl->aFmtList.end() ); sal_Bool bFnd = sal_False; - ULONG nFmtId = SotExchange::GetFormat( rFlavor ); + sal_uIntPtr nFmtId = SotExchange::GetFormat( rFlavor ); // test first the list for( ; aIter != aEnd; ++aIter ) @@ -507,8 +507,8 @@ void TransferDataContainer::CopyINetBookmark( const INetBookmark& rBkmk ) // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyAnyData( ULONG nFormatId, - const sal_Char* pData, ULONG nLen ) +void TransferDataContainer::CopyAnyData( sal_uIntPtr nFormatId, + const sal_Char* pData, sal_uIntPtr nLen ) { if( nLen ) { @@ -525,7 +525,7 @@ void TransferDataContainer::CopyAnyData( ULONG nFormatId, // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyByteString( ULONG nFormatId, +void TransferDataContainer::CopyByteString( sal_uIntPtr nFormatId, const ByteString& rStr ) { CopyAnyData( nFormatId, rStr.GetBuffer(), rStr.Len() ); @@ -575,7 +575,7 @@ void TransferDataContainer::CopyGraphic( const Graphic& rGrf ) // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyString( USHORT nFmt, const String& rStr ) +void TransferDataContainer::CopyString( sal_uInt16 nFmt, const String& rStr ) { if( rStr.Len() ) { @@ -597,7 +597,7 @@ void TransferDataContainer::CopyString( const String& rStr ) // ----------------------------------------------------------------------------- -void TransferDataContainer::CopyAny( USHORT nFmt, +void TransferDataContainer::CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny ) { TDataCntnrEntry_Impl aEntry; diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 612bcb4f0221..fa92a6ecb0be 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -37,7 +37,7 @@ // ----------------------------------------------------------------------- -void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll ) +void SetFieldUnit( MetricField& rField, FieldUnit eUnit, sal_Bool bAll ) { sal_Int64 nFirst = rField.Denormalize( rField.GetFirst( FUNIT_TWIP ) ); sal_Int64 nLast = rField.Denormalize( rField.GetLast( FUNIT_TWIP ) ); @@ -94,7 +94,7 @@ void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll ) // ----------------------------------------------------------------------- -void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, BOOL bAll ) +void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, sal_Bool bAll ) { sal_Int64 nMin = rBox.Denormalize( rBox.GetMin( FUNIT_TWIP ) ); sal_Int64 nMax = rBox.Denormalize( rBox.GetMax( FUNIT_TWIP ) ); @@ -350,7 +350,7 @@ long ConvertValueToUnit( long nVal, SfxMapUnit eUnit ) // ----------------------------------------------------------------------- -long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor ) +long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor ) { DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP || eUnit == SFX_MAPUNIT_100TH_MM || @@ -722,8 +722,8 @@ long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew ) return nVal; } - USHORT nOld = 0; - USHORT nNew = 0; + sal_uInt16 nOld = 0; + sal_uInt16 nNew = 0; switch ( aOld ) { diff --git a/svtools/source/plugapp/commtest.cxx b/svtools/source/plugapp/commtest.cxx index 3a235afcc61b..033d0fd89580 100644 --- a/svtools/source/plugapp/commtest.cxx +++ b/svtools/source/plugapp/commtest.cxx @@ -52,11 +52,11 @@ class PacketSender : public Timer CommunicationLinkRef mxCL; public: - PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL ); + PacketSender( sal_uIntPtr nDelay, SvStream* pData, CommunicationLink* pCL ); virtual void Timeout(); }; -PacketSender::PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL ) +PacketSender::PacketSender( sal_uIntPtr nDelay, SvStream* pData, CommunicationLink* pCL ) : mpData( pData ) , mxCL( pCL ) { @@ -78,11 +78,11 @@ class DelayedDeleter : public Timer CommunicationManager *mpManager; public: - DelayedDeleter( ULONG nDelay, CommunicationManager *pManager ); + DelayedDeleter( sal_uIntPtr nDelay, CommunicationManager *pManager ); virtual void Timeout(); }; -DelayedDeleter::DelayedDeleter( ULONG nDelay, CommunicationManager *pManager ) +DelayedDeleter::DelayedDeleter( sal_uIntPtr nDelay, CommunicationManager *pManager ) : mpManager( pManager ) { SetTimeout( nDelay ); @@ -135,8 +135,8 @@ void CommunicationTester::Main() ToolBox aTB( &aWW, ResId( TBMenu ) ); aTB.Show(); aTB.RecalcItems(); - aTB.SetFloatingMode( TRUE ); - aTB.SetFloatingMode( FALSE ); + aTB.SetFloatingMode( sal_True ); + aTB.SetFloatingMode( sal_False ); aTB.SetClickHdl( LINK( this, CommunicationTester, TBClick ) ); Execute(); @@ -168,7 +168,7 @@ IMPL_LINK( CommunicationTester, TBClick, ToolBox*, pTB ) { case SERVER_TCP: { - SWITCH( pServerTcp, CommunicationManagerServerViaSocket( TCP_PORT, (USHORT) 32000 ) ); + SWITCH( pServerTcp, CommunicationManagerServerViaSocket( TCP_PORT, (sal_uInt16) 32000 ) ); if ( pServerTcp ) pServerTcp->StartCommunication(); // Am Port horchen } diff --git a/svtools/source/plugapp/ttprops.cxx b/svtools/source/plugapp/ttprops.cxx index 2ae41a4c50c1..d80f643cff71 100644 --- a/svtools/source/plugapp/ttprops.cxx +++ b/svtools/source/plugapp/ttprops.cxx @@ -34,7 +34,7 @@ TYPEINIT1( TTProperties, ApplicationProperty ) -BOOL TTProperties::RequestProperty( USHORT nRequest ) +sal_Bool TTProperties::RequestProperty( sal_uInt16 nRequest ) { if ( (( nRequest & TT_PR_ONCE ) == 0) || (nDonePRs & (nRequest & 0x0ff)) == 0 ) { @@ -43,17 +43,17 @@ BOOL TTProperties::RequestProperty( USHORT nRequest ) GetpApp()->Property( *this ); return nActualPR == 0; } - return TRUE; + return sal_True; } -BOOL TTProperties::GetSlots() +sal_Bool TTProperties::GetSlots() { RequestProperty( TT_PR_SLOTS ); return HasSlots(); } -USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT nMode ) +sal_uInt16 TTProperties::ExecuteFunction( sal_uInt16 nSID, SfxPoolItem** ppArgs, sal_uInt16 nMode ) { mnSID = nSID; mppArgs = ppArgs; @@ -63,16 +63,16 @@ USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT return nActualPR; } -BOOL TTProperties::Img( Bitmap *pBmp ) +sal_Bool TTProperties::Img( Bitmap *pBmp ) { - BOOL bRet; + sal_Bool bRet; mpBmp = pBmp; bRet = RequestProperty( TT_PR_IMG ); mpBmp = NULL; return bRet; } -SvtResId TTProperties::GetSvtResId( USHORT nId ) +SvtResId TTProperties::GetSvtResId( sal_uInt16 nId ) { return SvtResId( nId ); } diff --git a/svtools/source/productregistration/registrationdlg.cxx b/svtools/source/productregistration/registrationdlg.cxx index 460cedb060d1..7cface187915 100644 --- a/svtools/source/productregistration/registrationdlg.cxx +++ b/svtools/source/productregistration/registrationdlg.cxx @@ -117,7 +117,7 @@ namespace svt FreeResource(); - m_aNow.Check( TRUE ); + m_aNow.Check( sal_True ); } //-------------------------------------------------------------------- diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx index 96377a1b7efb..99ec82d4e756 100644 --- a/svtools/source/svhtml/htmlkywd.cxx +++ b/svtools/source/svhtml/htmlkywd.cxx @@ -49,7 +49,7 @@ struct HTML_TokenEntry }; // Flag: RTF-Token Tabelle wurde schon sortiert -static int __FAR_DATA bSortKeyWords = FALSE; +static int __FAR_DATA bSortKeyWords = sal_False; static HTML_TokenEntry __FAR_DATA aHTMLTokenTab[] = { {{OOO_STRING_SVTOOLS_HTML_area}, HTML_AREA}, // Netscape 2.0 @@ -244,7 +244,7 @@ int GetHTMLToken( const String& rName ) sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ), sizeof( HTML_TokenEntry ), HTMLKeyCompare ); - bSortKeyWords = TRUE; + bSortKeyWords = sal_True; } int nRet = 0; @@ -279,7 +279,7 @@ struct HTML_CharEntry }; // Flag: RTF-Token Tabelle wurde schon sortiert -static int __FAR_DATA bSortCharKeyWords = FALSE; +static int __FAR_DATA bSortCharKeyWords = sal_False; static HTML_CharEntry __FAR_DATA aHTMLCharNameTab[] = { {{OOO_STRING_SVTOOLS_HTML_C_lt}, 60}, @@ -599,7 +599,7 @@ sal_Unicode GetHTMLCharName( const String& rName ) sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ), sizeof( HTML_CharEntry ), HTMLCharNameCompare ); - bSortCharKeyWords = TRUE; + bSortCharKeyWords = sal_True; } sal_Unicode cRet = 0; @@ -620,7 +620,7 @@ sal_Unicode GetHTMLCharName( const String& rName ) /**/ // Flag: Optionen-Tabelle wurde schon sortiert -static int __FAR_DATA bSortOptionKeyWords = FALSE; +static int __FAR_DATA bSortOptionKeyWords = sal_False; static HTML_TokenEntry __FAR_DATA aHTMLOptionTab[] = { @@ -832,7 +832,7 @@ int GetHTMLOption( const String& rName ) sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ), sizeof( HTML_TokenEntry ), HTMLKeyCompare ); - bSortOptionKeyWords = TRUE; + bSortOptionKeyWords = sal_True; } int nRet = HTML_O_UNKNOWN; @@ -860,10 +860,10 @@ struct HTML_ColorEntry const sal_Char* sName; const String *pUName; }; - ULONG nColor; + sal_uIntPtr nColor; }; -static int __FAR_DATA bSortColorKeyWords = FALSE; +static int __FAR_DATA bSortColorKeyWords = sal_False; #define HTML_NO_COLOR 0xffffffffUL @@ -1052,7 +1052,7 @@ static int } -ULONG GetHTMLColor( const String& rName ) +sal_uIntPtr GetHTMLColor( const String& rName ) { if( !bSortColorKeyWords ) { @@ -1060,10 +1060,10 @@ ULONG GetHTMLColor( const String& rName ) sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ), sizeof( HTML_ColorEntry ), HTMLColorNameCompare ); - bSortColorKeyWords = TRUE; + bSortColorKeyWords = sal_True; } - ULONG nRet = ULONG_MAX; + sal_uIntPtr nRet = ULONG_MAX; void* pFound; HTML_ColorEntry aSrch; aSrch.pUName = &rName; diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index af0d0dff9667..7e800ace4e90 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -528,7 +528,7 @@ void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc, } SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr, - BOOL bOn, rtl_TextEncoding ) + sal_Bool bOn, rtl_TextEncoding ) { sal_Char sStt[3] = "</"; if( bOn ) @@ -569,7 +569,7 @@ SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream, return rStream; } -SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen, +SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uIntPtr nHex, sal_uInt8 nLen, rtl_TextEncoding ) { // in einen Stream aus sal_Char aNToABuf[] = "0000000000000000"; @@ -580,7 +580,7 @@ SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen, // Pointer an das Bufferende setzen sal_Char *pStr = aNToABuf + (sizeof(aNToABuf)-1); - for( BYTE n = 0; n < nLen; ++n ) + for( sal_uInt8 n = 0; n < nLen; ++n ) { *(--pStr) = (sal_Char)(nHex & 0xf ) + 48; if( *pStr > '9' ) @@ -615,7 +615,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, const ImageMap& rIMap, const String& rName, const HTMLOutEvent *pEventTable, - BOOL bOutStarBasic, + sal_Bool bOutStarBasic, const sal_Char *pDelim, const sal_Char *pIndentArea, const sal_Char *pIndentMap, @@ -640,7 +640,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, Out_String( rStream, rOutName, eDestEnc, pNonConvertableChars ); rStream << "\">"; - for( USHORT i=0U; i<rIMap.GetIMapObjectCount(); i++ ) + for( sal_uInt16 i=0U; i<rIMap.GetIMapObjectCount(); i++ ) { const IMapObject* pObj = rIMap.GetIMapObject( i ); DBG_ASSERT( pObj, "Wo ist das ImageMap-Object?" ); @@ -683,7 +683,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, (const IMapPolygonObject *)pObj; pShape= OOO_STRING_SVTOOLS_HTML_SH_poly; Polygon aPoly( pPolyObj->GetPolygon() ); - USHORT nCount = aPoly.GetSize(); + sal_uInt16 nCount = aPoly.GetSize(); if( nCount>0 ) { const Point& rPoint = aPoly[0]; @@ -691,7 +691,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, ByteString::CreateFromInt32(rPoint.X())) += ',') += ByteString::CreateFromInt32(rPoint.Y()); } - for( USHORT j=1; j<nCount; j++ ) + for( sal_uInt16 j=1; j<nCount; j++ ) { const Point& rPoint = aPoly[j]; (((aCoords += ',') @@ -771,7 +771,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, rStream << pDelim; if( pIndentMap ) rStream << pIndentMap; - Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, FALSE ); + Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, sal_False ); return rStream; } @@ -885,7 +885,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, } } - HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, FALSE ); + HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, sal_False ); return rStrm; } @@ -894,11 +894,11 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm, const SvxMacroTableDtor& rMacroTable, const HTMLOutEvent *pEventTable, - BOOL bOutStarBasic, + sal_Bool bOutStarBasic, rtl_TextEncoding eDestEnc, String *pNonConvertableChars ) { - USHORT i=0; + sal_uInt16 i=0; while( pEventTable[i].pBasicName || pEventTable[i].pJavaName ) { const SvxMacro *pMacro = @@ -927,8 +927,8 @@ SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm, } ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD, - BOOL bValue, - double fVal, ULONG nFormat, SvNumberFormatter& rFormatter, + sal_Bool bValue, + double fVal, sal_uIntPtr nFormat, SvNumberFormatter& rFormatter, rtl_TextEncoding eDestEnc, String* pNonConvertableChars ) { if ( bValue ) @@ -965,16 +965,16 @@ ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD, return aStrTD; } -BOOL HTMLOutFuncs::PrivateURLToInternalImg( String& rURL ) +sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( String& rURL ) { if( rURL.Len() > 14UL && rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_private_image, 14UL ) == COMPARE_EQUAL ) { rURL.Erase( 0UL, 14UL ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index 4c08d9c41ec9..a264a0c5aa09 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -56,7 +56,7 @@ static HTMLOptionEnum __READONLY_DATA aScriptLangOptEnums[] = { 0, 0 } }; -BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL, +sal_Bool HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL, HTMLScriptLanguage& rLang, String& rSrc, String& rLibrary, @@ -70,7 +70,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL rLibrary.Erase(); rModule.Erase(); - for( USHORT i = pScriptOptions->Count(); i; ) + for( sal_uInt16 i = pScriptOptions->Count(); i; ) { const HTMLOption *pOption = (*pScriptOptions)[ --i ]; switch( pOption->GetToken() ) @@ -78,7 +78,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL case HTML_O_LANGUAGE: { rLangString = pOption->GetString(); - USHORT nLang; + sal_uInt16 nLang; if( pOption->GetEnum( nLang, aScriptLangOptEnums ) ) rLang = (HTMLScriptLanguage)nLang; else @@ -99,10 +99,10 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL } } - return TRUE; + return sal_True; } -void HTMLParser::RemoveSGMLComment( String &rString, BOOL bFull ) +void HTMLParser::RemoveSGMLComment( String &rString, sal_Bool bFull ) { sal_Unicode c = 0; while( rString.Len() && diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 67fc5f619fdf..b9b928f26e46 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -114,9 +114,9 @@ SV_IMPL_PTRARR(HTMLOptions,HTMLOptionPtr) /* */ -USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) const +sal_uInt16 HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, sal_uInt16 nDflt ) const { - USHORT nValue = nDflt; + sal_uInt16 nValue = nDflt; while( pOptEnums->pName ) if( aValue.EqualsIgnoreCaseAscii( pOptEnums->pName ) ) @@ -130,7 +130,7 @@ USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) cons return nValue; } -BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const +sal_Bool HTMLOption::GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const { while( pOptEnums->pName ) { @@ -147,7 +147,7 @@ BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const return (pName != 0); } -HTMLOption::HTMLOption( USHORT nTok, const String& rToken, +HTMLOption::HTMLOption( sal_uInt16 nTok, const String& rToken, const String& rValue ) : aValue(rValue) , aToken(rToken) @@ -171,7 +171,7 @@ sal_uInt32 HTMLOption::GetNumber() const return nTmp >= 0 ? (sal_uInt32)nTmp : 0; } -INT32 HTMLOption::GetSNumber() const +sal_Int32 HTMLOption::GetSNumber() const { DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START && nToken<HTML_OPTION_NUMBER_END) || (nToken>=HTML_OPTION_CONTEXT_START && nToken<HTML_OPTION_CONTEXT_END), @@ -181,7 +181,7 @@ INT32 HTMLOption::GetSNumber() const return aTmp.ToInt32(); } -void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const +void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const { if( rLongs.Count() ) rLongs.Remove( 0, rLongs.Count() ); @@ -190,8 +190,8 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const { // das ist ein sehr stark vereinfachter Scanner. Er sucht einfach // alle Tiffern aus dem String - BOOL bInNum = FALSE; - ULONG nNum = 0; + sal_Bool bInNum = sal_False; + sal_uIntPtr nNum = 0; for( xub_StrLen i=0; i<aValue.Len(); i++ ) { register sal_Unicode c = aValue.GetChar( i ); @@ -199,12 +199,12 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const { nNum *= 10; nNum += (c - '0'); - bInNum = TRUE; + bInNum = sal_True; } else if( bInNum ) { rLongs.Insert( nNum, rLongs.Count() ); - bInNum = FALSE; + bInNum = sal_False; nNum = 0; } } @@ -227,7 +227,7 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const nPos++; if( nPos==aValue.Len() ) - rLongs.Insert( ULONG(0), rLongs.Count() ); + rLongs.Insert( sal_uIntPtr(0), rLongs.Count() ); else { xub_StrLen nEnd = aValue.Search( (sal_Unicode)',', nPos ); @@ -258,7 +258,7 @@ void HTMLOption::GetColor( Color& rColor ) const String aTmp( aValue ); aTmp.ToUpperAscii(); - ULONG nColor = ULONG_MAX; + sal_uIntPtr nColor = ULONG_MAX; if( '#'!=aTmp.GetChar( 0 ) ) nColor = GetHTMLColor( aTmp ); @@ -288,9 +288,9 @@ void HTMLOption::GetColor( Color& rColor ) const } } - rColor.SetRed( (BYTE)((nColor & 0x00ff0000) >> 16) ); - rColor.SetGreen( (BYTE)((nColor & 0x0000ff00) >> 8)); - rColor.SetBlue( (BYTE)(nColor & 0x000000ff) ); + rColor.SetRed( (sal_uInt8)((nColor & 0x00ff0000) >> 16) ); + rColor.SetGreen( (sal_uInt8)((nColor & 0x0000ff00) >> 8)); + rColor.SetBlue( (sal_uInt8)(nColor & 0x000000ff) ); } HTMLInputType HTMLOption::GetInputType() const @@ -320,8 +320,8 @@ HTMLParser::HTMLParser( SvStream& rIn, int bReadNewDoc ) bReadListing = bReadXMP = bReadPRE = bReadTextArea = bReadScript = bReadStyle = bEndTokenFound = bIsInBody = bReadNextChar = - bReadComment = FALSE; - bIsInHeader = TRUE; + bReadComment = sal_False; + bIsInHeader = sal_True; pOptions = new HTMLOptions; } @@ -339,7 +339,7 @@ SvParserState __EXPORT HTMLParser::CallParser() SaveState( 0 ); nPre_LinePos = 0; - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; AddRef(); Continue( 0 ); @@ -378,24 +378,24 @@ int HTMLParser::FilterToken( int nToken ) break; // nicht verschicken case HTML_HEAD_OFF: - bIsInBody = TRUE; + bIsInBody = sal_True; case HTML_HEAD_ON: bIsInHeader = HTML_HEAD_ON == nToken; break; case HTML_BODY_ON: case HTML_FRAMESET_ON: - bIsInHeader = FALSE; + bIsInHeader = sal_False; bIsInBody = HTML_BODY_ON == nToken; break; case HTML_BODY_OFF: - bIsInBody = bReadPRE = bReadListing = bReadXMP = FALSE; + bIsInBody = bReadPRE = bReadListing = bReadXMP = sal_False; break; case HTML_HTML_OFF: nToken = 0; - bReadPRE = bReadListing = bReadXMP = FALSE; + bReadPRE = bReadListing = bReadXMP = sal_False; break; // HTML_ON wurde auch nicht verschickt ! case HTML_PREFORMTXT_ON: @@ -448,23 +448,23 @@ int HTMLParser::FilterToken( int nToken ) int HTMLParser::ScanText( const sal_Unicode cBreak ) { ::rtl::OUStringBuffer sTmpBuffer( MAX_LEN ); - int bWeiter = TRUE; - int bEqSignFound = FALSE; + int bWeiter = sal_True; + int bEqSignFound = sal_False; sal_Unicode cQuote = 0U; while( bWeiter && IsParserWorking() ) { - int bNextCh = TRUE; + int bNextCh = sal_True; switch( nNextCh ) { case '&': - bEqSignFound = FALSE; + bEqSignFound = sal_False; if( bReadXMP ) sTmpBuffer.append( (sal_Unicode)'&' ); else { - ULONG nStreamPos = rInput.Tell(); - ULONG nLinePos = GetLinePos(); + sal_uIntPtr nStreamPos = rInput.Tell(); + sal_uIntPtr nLinePos = GetLinePos(); sal_Unicode cChar = 0U; if( '#' == (nNextCh = GetNextChar()) ) @@ -545,7 +545,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( 0U == cChar && ';' != nNextCh ) { DBG_ASSERT( rInput.Tell() - nStreamPos == - (ULONG)(nPos+1L)*GetCharSize(), + (sal_uIntPtr)(nPos+1L)*GetCharSize(), "UTF-8 geht hier schief" ); for( xub_StrLen i=nPos-1L; i>1L; i-- ) { @@ -575,10 +575,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) // rInput.SeekRel( -(long)(++nPos*GetCharSize()) ); // nlLinePos -= nPos; DBG_ASSERT( rInput.Tell()-nStreamPos == - (ULONG)(nPos+1)*GetCharSize(), + (sal_uIntPtr)(nPos+1)*GetCharSize(), "Falsche Stream-Position" ); DBG_ASSERT( nlLinePos-nLinePos == - (ULONG)(nPos+1), + (sal_uIntPtr)(nPos+1), "Falsche Zeilen-Position" ); rInput.Seek( nStreamPos ); nlLinePos = nLinePos; @@ -620,10 +620,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) // rInput.SeekRel( -(long)(++nPos*GetCharSize()) ); // nlLinePos -= nPos; DBG_ASSERT( rInput.Tell()-nStreamPos == - (ULONG)(nPos+1)*GetCharSize(), + (sal_uIntPtr)(nPos+1)*GetCharSize(), "Falsche Stream-Position" ); DBG_ASSERT( nlLinePos-nLinePos == - (ULONG)(nPos+1), + (sal_uIntPtr)(nPos+1), "Falsche Zeilen-Position" ); rInput.Seek( nStreamPos ); nlLinePos = nLinePos; @@ -655,7 +655,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) else if( IsParserWorking() ) { sTmpBuffer.append( (sal_Unicode)'&' ); - bNextCh = FALSE; + bNextCh = sal_False; break; } @@ -692,15 +692,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) rInput.Seek( nStreamPos-(sal_uInt32)GetCharSize() ); nlLinePos = nLinePos-1; ClearTxtConvContext(); - bReadNextChar = TRUE; + bReadNextChar = sal_True; } - bNextCh = FALSE; + bNextCh = sal_False; } } break; case '=': if( '>'==cBreak && !cQuote ) - bEqSignFound = TRUE; + bEqSignFound = sal_True; sTmpBuffer.append( nNextCh ); break; @@ -725,7 +725,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) cQuote = 0U; } sTmpBuffer.append( nNextCh ); - bEqSignFound = FALSE; + bEqSignFound = sal_False; break; case sal_Unicode(EOF): @@ -735,7 +735,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) // abcä<EOF> nicht angezeigt, also lassen wir das in Zukunft. // if( '>' != cBreak ) // eState = SVPAR_ACCEPTED; - bWeiter = FALSE; + bWeiter = sal_False; } else { @@ -744,11 +744,11 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) break; case '<': - bEqSignFound = FALSE; + bEqSignFound = sal_False; if( '>'==cBreak ) sTmpBuffer.append( nNextCh ); else - bWeiter = FALSE; // Abbrechen, String zusammen + bWeiter = sal_False; // Abbrechen, String zusammen break; case '\f': @@ -760,7 +760,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) else { // sonst wird es ein eigenes Token - bWeiter = FALSE; + bWeiter = sal_False; } break; @@ -774,7 +774,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) } else if( bReadListing || bReadXMP || bReadPRE || bReadTextArea ) { - bWeiter = FALSE; + bWeiter = sal_False; break; } // Bug 18984: CR-LF -> Blank @@ -784,7 +784,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( '\t'==nNextCh && bReadPRE && '>'!=cBreak ) { // In <PRE>: Tabs nach oben durchreichen - bWeiter = FALSE; + bWeiter = sal_False; break; } // kein break @@ -821,15 +821,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) } while ( ' ' == nNextCh || '\t' == nNextCh || '\r' == nNextCh || '\n' == nNextCh || '\x0b' == nNextCh ); - bNextCh = FALSE; + bNextCh = sal_False; } break; default: - bEqSignFound = FALSE; + bEqSignFound = sal_False; if( (nNextCh==cBreak && !cQuote) || - (ULONG(aToken.Len()) + MAX_LEN) > ULONG(STRING_MAXLEN & ~1 )) - bWeiter = FALSE; + (sal_uIntPtr(aToken.Len()) + MAX_LEN) > sal_uIntPtr(STRING_MAXLEN & ~1 )) + bWeiter = sal_False; else { do { @@ -838,8 +838,8 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( MAX_LEN == sTmpBuffer.getLength() ) { aToken += String(sTmpBuffer.makeStringAndClear()); - if( (ULONG(aToken.Len()) + MAX_LEN) > - ULONG(STRING_MAXLEN & ~1 ) ) + if( (sal_uIntPtr(aToken.Len()) + MAX_LEN) > + sal_uIntPtr(STRING_MAXLEN & ~1 ) ) { nNextCh = GetNextChar(); return HTML_TEXTTOKEN; @@ -854,7 +854,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) return HTML_TEXTTOKEN; } } while( HTML_ISALPHA( nNextCh ) || HTML_ISDIGIT( nNextCh ) ); - bNextCh = FALSE; + bNextCh = sal_False; } } @@ -879,21 +879,21 @@ int HTMLParser::_GetNextRawToken() { // beim letzten Aufruf haben wir das End-Token bereits gefunden, // deshalb muessen wir es nicht noch einmal suchen - bReadScript = FALSE; - bReadStyle = FALSE; + bReadScript = sal_False; + bReadStyle = sal_False; aEndToken.Erase(); - bEndTokenFound = FALSE; + bEndTokenFound = sal_False; return 0; } // per default geben wir HTML_RAWDATA zurueck - int bWeiter = TRUE; + int bWeiter = sal_True; int nToken = HTML_RAWDATA; SaveState( 0 ); while( bWeiter && IsParserWorking() ) { - int bNextCh = TRUE; + int bNextCh = sal_True; switch( nNextCh ) { case '<': @@ -904,15 +904,15 @@ int HTMLParser::_GetNextRawToken() aToken += String(sTmpBuffer.makeStringAndClear()); // und die Position im Stream merken - ULONG nStreamPos = rInput.Tell(); - ULONG nLineNr = GetLineNr(); - ULONG nLinePos = GetLinePos(); + sal_uIntPtr nStreamPos = rInput.Tell(); + sal_uIntPtr nLineNr = GetLineNr(); + sal_uIntPtr nLinePos = GetLinePos(); // Start eines End-Token? - int bOffState = FALSE; + int bOffState = sal_False; if( '/' == (nNextCh = GetNextChar()) ) { - bOffState = TRUE; + bOffState = sal_True; nNextCh = GetNextChar(); } else if( '!' == nNextCh ) @@ -933,7 +933,7 @@ int HTMLParser::_GetNextRawToken() sal::static_int_cast< xub_StrLen >( sTmpBuffer.getLength()) ); aTok.ToUpperAscii(); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if( bReadScript || aEndToken.Len() ) { if( !bReadComment ) @@ -941,7 +941,7 @@ int HTMLParser::_GetNextRawToken() if( aTok.CompareToAscii( OOO_STRING_SVTOOLS_HTML_comment, 3 ) == COMPARE_EQUAL ) { - bReadComment = TRUE; + bReadComment = sal_True; } else { @@ -958,7 +958,7 @@ int HTMLParser::_GetNextRawToken() aTok.Copy( aTok.Len()-2 ).EqualsAscii( "--" ) ) { // hier ist ein Kommentar der Art <!-----> zuende - bReadComment = FALSE; + bReadComment = sal_False; } } else @@ -981,15 +981,15 @@ int HTMLParser::_GetNextRawToken() // bisher gelesenen String zurueckgeben und dnach normal // weitermachen - bWeiter = FALSE; + bWeiter = sal_False; // nToken==0 heisst, dass _GetNextToken gleich weiterliest if( !aToken.Len() && (bReadStyle || bReadScript) ) { // wir koennen sofort die Umgebung beeden und // das End-Token parsen - bReadScript = FALSE; - bReadStyle = FALSE; + bReadScript = sal_False; + bReadStyle = sal_False; aEndToken.Erase(); nToken = 0; } @@ -998,7 +998,7 @@ int HTMLParser::_GetNextRawToken() // wir muessen bReadScript/bReadStyle noch am // Leben lassen und koennen erst beim naechsten // mal das End-Token Parsen - bEndTokenFound = TRUE; + bEndTokenFound = sal_True; } // jetzt fahren wir im Stream auf das '<' zurueck @@ -1018,7 +1018,7 @@ int HTMLParser::_GetNextRawToken() if( bOffState ) aToken += (sal_Unicode)'/'; - bNextCh = FALSE; + bNextCh = sal_False; } } break; @@ -1026,11 +1026,11 @@ int HTMLParser::_GetNextRawToken() sTmpBuffer.append( nNextCh ); if( bReadComment ) { - BOOL bTwoMinus = FALSE; + sal_Bool bTwoMinus = sal_False; nNextCh = GetNextChar(); while( '-' == nNextCh && IsParserWorking() ) { - bTwoMinus = TRUE; + bTwoMinus = sal_True; if( MAX_LEN == sTmpBuffer.getLength() ) aToken += String(sTmpBuffer.makeStringAndClear()); @@ -1039,9 +1039,9 @@ int HTMLParser::_GetNextRawToken() } if( '>' == nNextCh && IsParserWorking() && bTwoMinus ) - bReadComment = FALSE; + bReadComment = sal_False; - bNextCh = FALSE; + bNextCh = sal_False; } break; @@ -1050,27 +1050,27 @@ int HTMLParser::_GetNextRawToken() nNextCh = GetNextChar(); if( nNextCh=='\n' ) nNextCh = GetNextChar(); - bWeiter = FALSE; + bWeiter = sal_False; break; case '\n': // \n beendet das aktuelle Text-Token (auch wenn es leer ist) nNextCh = GetNextChar(); - bWeiter = FALSE; + bWeiter = sal_False; break; case sal_Unicode(EOF): // eof beendet das aktuelle Text-Token und tut so, als ob // ein End-Token gelesen wurde if( rInput.IsEof() ) { - bWeiter = FALSE; + bWeiter = sal_False; if( aToken.Len() || sTmpBuffer.getLength() ) { - bEndTokenFound = TRUE; + bEndTokenFound = sal_True; } else { - bReadScript = FALSE; - bReadStyle = FALSE; + bReadScript = sal_False; + bReadStyle = sal_False; aEndToken.Erase(); nToken = 0; } @@ -1112,7 +1112,7 @@ int __EXPORT HTMLParser::_GetNextToken() if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter! return 0; - BOOL bReadNextCharSave = bReadNextChar; + sal_Bool bReadNextCharSave = bReadNextChar; if( bReadNextChar ) { DBG_ASSERT( !bEndTokenFound, @@ -1120,7 +1120,7 @@ int __EXPORT HTMLParser::_GetNextToken() nNextCh = GetNextChar(); if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter! return 0; - bReadNextChar = FALSE; + bReadNextChar = sal_False; } if( bReadScript || bReadStyle || aEndToken.Len() ) @@ -1131,19 +1131,19 @@ int __EXPORT HTMLParser::_GetNextToken() } do { - int bNextCh = TRUE; + int bNextCh = sal_True; switch( nNextCh ) { case '<': { - ULONG nStreamPos = rInput.Tell(); - ULONG nLineNr = GetLineNr(); - ULONG nLinePos = GetLinePos(); + sal_uIntPtr nStreamPos = rInput.Tell(); + sal_uIntPtr nLineNr = GetLineNr(); + sal_uIntPtr nLinePos = GetLinePos(); - int bOffState = FALSE; + int bOffState = sal_False; if( '/' == (nNextCh = GetNextChar()) ) { - bOffState = TRUE; + bOffState = sal_True; nNextCh = GetNextChar(); } if( HTML_ISALPHA( nNextCh ) || '!'==nNextCh ) // fix #26984# @@ -1203,12 +1203,12 @@ int __EXPORT HTMLParser::_GetNextToken() aToken = sSaveToken; if( '>'!=nNextCh ) aToken += (sal_Unicode)' '; - ULONG nCStreamPos = 0; - ULONG nCLineNr = 0; - ULONG nCLinePos = 0; + sal_uIntPtr nCStreamPos = 0; + sal_uIntPtr nCLineNr = 0; + sal_uIntPtr nCLinePos = 0; xub_StrLen nCStrLen = 0; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // bis zum schliessenden --> lesen. wenn keins gefunden // wurde beim der ersten > wieder aufsetzen while( !bDone && !rInput.IsEof() && IsParserWorking() ) @@ -1265,7 +1265,7 @@ int __EXPORT HTMLParser::_GetNextToken() aToken = '<'; nRet = HTML_TEXTTOKEN; nNextCh = GetNextChar(); - bNextCh = FALSE; + bNextCh = sal_False; break; } } @@ -1290,7 +1290,7 @@ int __EXPORT HTMLParser::_GetNextToken() aToken = '<'; nRet = HTML_TEXTTOKEN; nNextCh = GetNextChar(); - bNextCh = FALSE; + bNextCh = sal_False; break; } if( SVPAR_PENDING == eState ) @@ -1301,10 +1301,10 @@ int __EXPORT HTMLParser::_GetNextToken() { nRet = HTML_UNKNOWNCONTROL_ON; - ULONG nCStreamPos = rInput.Tell(); - ULONG nCLineNr = GetLineNr(), nCLinePos = GetLinePos(); + sal_uIntPtr nCStreamPos = rInput.Tell(); + sal_uIntPtr nCLineNr = GetLineNr(), nCLinePos = GetLinePos(); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // bis zum schliessenden %> lesen. wenn keins gefunden // wurde beim der ersten > wieder aufsetzen while( !bDone && !rInput.IsEof() && IsParserWorking() ) @@ -1337,7 +1337,7 @@ int __EXPORT HTMLParser::_GetNextToken() { aToken = '<'; nRet = HTML_TEXTTOKEN; - bNextCh = FALSE; + bNextCh = sal_False; break; } } @@ -1348,32 +1348,32 @@ int __EXPORT HTMLParser::_GetNextToken() switch( nRet ) { case HTML_TEXTAREA_ON: - bReadTextArea = TRUE; + bReadTextArea = sal_True; break; case HTML_TEXTAREA_OFF: - bReadTextArea = FALSE; + bReadTextArea = sal_False; break; case HTML_SCRIPT_ON: if( !bReadTextArea ) - bReadScript = TRUE; + bReadScript = sal_True; break; case HTML_SCRIPT_OFF: if( !bReadTextArea ) { - bReadScript = FALSE; + bReadScript = sal_False; // JavaScript kann den Stream veraendern // also muss das letzte Zeichen nochmals // gelesen werden - bReadNextChar = TRUE; - bNextCh = FALSE; + bReadNextChar = sal_True; + bNextCh = sal_False; } break; case HTML_STYLE_ON: - bReadStyle = TRUE; + bReadStyle = sal_True; break; case HTML_STYLE_OFF: - bReadStyle = FALSE; + bReadStyle = sal_False; break; } @@ -1407,7 +1407,7 @@ int __EXPORT HTMLParser::_GetNextToken() if( ( '\n' != nNextCh || '\r' != c ) && ( '\r' != nNextCh || '\n' != c ) ) { - bNextCh = FALSE; + bNextCh = sal_False; nNextCh = c; } nRet = HTML_NEWPARA; @@ -1434,7 +1434,7 @@ scan_text: if( !bNextCh && eState == SVPAR_PENDING ) { eState = SVPAR_WORKING; - bReadNextChar = TRUE; + bReadNextChar = sal_True; } break; @@ -1445,7 +1445,7 @@ scan_text: nNextCh = GetNextChar(); if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet ) { - bReadNextChar = TRUE; + bReadNextChar = sal_True; eState = SVPAR_WORKING; } } @@ -1462,15 +1462,15 @@ void HTMLParser::UnescapeToken() { xub_StrLen nPos=0; - BOOL bEscape = FALSE; + sal_Bool bEscape = sal_False; while( nPos < aToken.Len() ) { - BOOL bOldEscape = bEscape; - bEscape = FALSE; + sal_Bool bOldEscape = bEscape; + bEscape = sal_False; if( '\\'==aToken.GetChar(nPos) && !bOldEscape ) { aToken.Erase( nPos, 1 ); - bEscape = TRUE; + bEscape = sal_True; } else { @@ -1480,7 +1480,7 @@ void HTMLParser::UnescapeToken() } // hole die Optionen -const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const +const HTMLOptions *HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) const { // wenn die Option fuer das aktuelle Token schon einmal // geholt wurden, geben wir sie noch einmal zurueck @@ -1518,7 +1518,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const nToken = GetHTMLOption( sNameUpperCase ); // der Name ist fertig DBG_ASSERTWARNING( nToken!=HTML_O_UNKNOWN, "GetOption: unbekannte HTML-Option" ); - BOOL bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START || + sal_Bool bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START || nToken >= HTML_OPTION_SCRIPT_END) && (!pNoConvertToken || nToken != *pNoConvertToken); @@ -1545,12 +1545,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const { sal_Unicode cEnd = cChar; nPos++; nStt++; - BOOL bDone = FALSE; - BOOL bEscape = FALSE; + sal_Bool bDone = sal_False; + sal_Bool bEscape = sal_False; while( nPos < aToken.Len() && !bDone ) { - BOOL bOldEscape = bEscape; - bEscape = FALSE; + sal_Bool bOldEscape = bEscape; + bEscape = sal_False; cChar = aToken.GetChar(nPos); switch( cChar ) { @@ -1569,7 +1569,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const else { ((String &)aToken).Erase( nPos, 1 ); - bEscape = TRUE; + bEscape = sal_True; } break; case '"': @@ -1590,12 +1590,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const { // hier sind wir etwas laxer als der // Standard und erlauben alles druckbare - BOOL bEscape = FALSE; - BOOL bDone = FALSE; + sal_Bool bEscape = sal_False; + sal_Bool bDone = sal_False; while( nPos < aToken.Len() && !bDone ) { - BOOL bOldEscape = bEscape; - bEscape = FALSE; + sal_Bool bOldEscape = bEscape; + bEscape = sal_False; sal_Unicode c = aToken.GetChar(nPos); switch( c ) { @@ -1608,7 +1608,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const case '\t': case '\r': case '\n': - bDone = TRUE; + bDone = sal_True; break; case '\\': @@ -1619,7 +1619,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const else { ((String &)aToken).Erase( nPos, 1 ); - bEscape = TRUE; + bEscape = sal_True; } break; @@ -1627,7 +1627,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const if( HTML_ISPRINTABLE( c ) ) nPos++, nLen++; else - bDone = TRUE; + bDone = sal_True; break; } } @@ -1832,7 +1832,7 @@ int HTMLParser::FilterPRE( int nToken ) break; } - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; return nToken; } @@ -1873,7 +1873,7 @@ int HTMLParser::FilterXMP( int nToken ) break; } - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; return nToken; } @@ -1901,13 +1901,13 @@ int HTMLParser::FilterListing( int nToken ) break; } - bPre_IgnoreNewPara = FALSE; + bPre_IgnoreNewPara = sal_False; return nToken; } -FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, - BOOL bSwitchToUCS2, +int HTMLParser::IsHTMLFormat( const sal_Char* pHeader, + sal_Bool bSwitchToUCS2, rtl_TextEncoding eEnc ) { // Einer der folgenden regulaeren Ausdrucke muss sich auf den String @@ -1921,14 +1921,14 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, // ensprechen muss ByteString sCmp; - BOOL bUCS2B = FALSE; + sal_Bool bUCS2B = sal_False; if( bSwitchToUCS2 ) { if( 0xfeU == (sal_uChar)pHeader[0] && 0xffU == (sal_uChar)pHeader[1] ) { eEnc = RTL_TEXTENCODING_UCS2; - bUCS2B = TRUE; + bUCS2B = sal_True; } else if( 0xffU == (sal_uChar)pHeader[0] && 0xfeU == (sal_uChar)pHeader[1] ) @@ -1946,7 +1946,7 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, ) { if( 0xfe == (sal_uChar)pHeader[0] ) - bUCS2B = TRUE; + bUCS2B = sal_True; xub_StrLen nLen; for( nLen = 2; @@ -1979,7 +1979,7 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, // Ein HTML-Dokument muss in der ersten Zeile ein '<' besitzen xub_StrLen nStart = sCmp.Search( '<' ); if( STRING_NOTFOUND == nStart ) - return FALSE; + return sal_False; nStart++; // danach duerfen beliebige andere Zeichen bis zu einem blank oder @@ -1994,7 +1994,7 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, // wenn das Dokeument hinter dem < aufhoert ist es wohl kein HTML if( nPos==nStart ) - return FALSE; + return sal_False; // die Zeichenkette nach dem '<' muss ausserdem ein bekanntes // HTML Token sein. Damit die Ausgabe eines DOS-dir-Befehls nicht @@ -2003,30 +2003,30 @@ FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader, String sTest( sCmp.Copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US ); int nTok = GetHTMLToken( sTest ); if( 0 != nTok && HTML_DIRLIST_ON != nTok ) - return TRUE; + return sal_True; // oder es handelt sich um ein "<!" ganz am Anfang der Datei (fix #27092#) if( nStart == 1 && '!' == sCmp.GetChar( 1 ) ) - return TRUE; + return sal_True; // oder wir finden irgendwo ein <HTML> in den ersten 80 Zeichen nStart = sCmp.Search( OOO_STRING_SVTOOLS_HTML_html ); if( nStart!=STRING_NOTFOUND && nStart>0 && '<'==sCmp.GetChar(nStart-1) && nStart+4 < sCmp.Len() && '>'==sCmp.GetChar(nStart+4) ) - return TRUE; + return sal_True; // sonst ist es wohl doch eher kein HTML-Dokument - return FALSE; + return sal_False; } -BOOL HTMLParser::InternalImgToPrivateURL( String& rURL ) +sal_Bool HTMLParser::InternalImgToPrivateURL( String& rURL ) { if( rURL.Len() < 19 || 'i' != rURL.GetChar(0) || rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher, 9 ) != COMPARE_EQUAL ) - return FALSE; + return sal_False; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; if( rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher,16) == COMPARE_EQUAL ) { @@ -2151,10 +2151,10 @@ bool HTMLParser::ParseMetaOptionsImpl( rtl_TextEncoding& o_rEnc ) { String aName, aContent; - USHORT nAction = HTML_META_NONE; + sal_uInt16 nAction = HTML_META_NONE; bool bHTTPEquiv = false, bChanged = false; - for ( USHORT i = i_pOptions->Count(); i; ) + for ( sal_uInt16 i = i_pOptions->Count(); i; ) { const HTMLOption *pOption = (*i_pOptions)[ --i ]; switch ( pOption->GetToken() ) @@ -2240,8 +2240,8 @@ bool HTMLParser::ParseMetaOptionsImpl( if ( i_xDocProps.is() && aContent.Len() && aContent.GetTokenCount() == 2 ) { - Date aDate( (ULONG)aContent.GetToken(0).ToInt32() ); - Time aTime( (ULONG)aContent.GetToken(1).ToInt32() ); + Date aDate( (sal_uIntPtr)aContent.GetToken(0).ToInt32() ); + Time aTime( (sal_uIntPtr)aContent.GetToken(1).ToInt32() ); DateTime aDateTime( aDate, aTime ); ::util::DateTime uDT(aDateTime.Get100Sec(), aDateTime.GetSec(), aDateTime.GetMin(), @@ -2297,7 +2297,7 @@ bool HTMLParser::ParseMetaOptions( const uno::Reference<document::XDocumentProperties> & i_xDocProps, SvKeyValueIterator *i_pHeader ) { - USHORT nContentOption = HTML_O_CONTENT; + sal_uInt16 nContentOption = HTML_O_CONTENT; rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW; bool bRet = ParseMetaOptionsImpl( i_xDocProps, i_pHeader, @@ -2305,7 +2305,7 @@ bool HTMLParser::ParseMetaOptions( eEnc ); // If the encoding is set by a META tag, it may only overwrite the - // current encoding if both, the current and the new encoding, are 1-BYTE + // current encoding if both, the current and the new encoding, are 1-sal_uInt8 // encodings. Everything else cannot lead to reasonable results. if (RTL_TEXTENCODING_DONTKNOW != eEnc && rtl_isOctetTextEncoding( eEnc ) && @@ -2344,7 +2344,7 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH if( pHTTPHeader ) { SvKeyValue aKV; - for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont; + for( sal_Bool bCont = pHTTPHeader->GetFirst( aKV ); bCont; bCont = pHTTPHeader->GetNext( aKV ) ) { if( aKV.GetKey().EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_type ) ) @@ -2359,15 +2359,15 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH return eRet; } -BOOL HTMLParser::SetEncodingByHTTPHeader( +sal_Bool HTMLParser::SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; rtl_TextEncoding eEnc = HTMLParser::GetEncodingByHttpHeader( pHTTPHeader ); if(RTL_TEXTENCODING_DONTKNOW != eEnc) { SetSrcEncoding( eEnc ); - bRet = TRUE; + bRet = sal_True; } return bRet; } diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index 1c578d160307..3091919d6623 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -46,7 +46,7 @@ const int MAX_TOKEN_LEN = 128; SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl ) -SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize ) +SvRTFParser::SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize ) : SvParser( rIn, nStackSize ), eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet nUCharOverread( 1 ) @@ -172,7 +172,7 @@ int SvRTFParser::_GetNextToken() case RTF_UC: if( 0 <= nTokenValue ) { - nUCharOverread = (BYTE)nTokenValue; + nUCharOverread = (sal_uInt8)nTokenValue; #if 1 //cmc: other ifdef breaks #i3584 aParserStates[ aParserStates.Count()-1]. @@ -211,7 +211,7 @@ int SvRTFParser::_GetNextToken() // overread the next n "RTF" characters. This // can be also \{, \}, \'88 - for( BYTE m = 0; m < nUCharOverread; ++m ) + for( sal_uInt8 m = 0; m < nUCharOverread; ++m ) { sal_Unicode cAnsi = nNextCh; while( 0xD == cAnsi ) @@ -253,7 +253,7 @@ int SvRTFParser::_GetNextToken() { RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() ); aParserStates.Insert( - aState, sal::static_int_cast< USHORT >(nOpenBrakets) ); + aState, sal::static_int_cast< sal_uInt16 >(nOpenBrakets) ); } ++nOpenBrakets; DBG_ASSERT( nOpenBrakets == aParserStates.Count(), @@ -267,7 +267,7 @@ int SvRTFParser::_GetNextToken() if( 0 <= nOpenBrakets ) { aParserStates.Remove( - sal::static_int_cast< USHORT >(nOpenBrakets) ); + sal::static_int_cast< sal_uInt16 >(nOpenBrakets) ); if( aParserStates.Count() ) { const RtfParserState_Impl& rRPS = @@ -440,7 +440,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) // overread the next n "RTF" characters. This // can be also \{, \}, \'88 - for( BYTE m = 0; m < nUCharOverread; ++m ) + for( sal_uInt8 m = 0; m < nUCharOverread; ++m ) { sal_Unicode cAnsi = nNextCh; while( 0xD == cAnsi ) diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index 27ce3643f8cf..84d8ff6a5cc6 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -49,7 +49,7 @@ struct RTF_TokenEntry }; // Flag: RTF-Token Tabelle wurde schon sortiert -static int __FAR_DATA bSortKeyWords = FALSE; +static int __FAR_DATA bSortKeyWords = sal_False; static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = { {{OOO_STRING_SVTOOLS_RTF_IGNORE}, RTF_IGNOREFLAG}, @@ -1227,7 +1227,7 @@ int GetRTFToken( const String& rSearch ) sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ), sizeof( RTF_TokenEntry ), RTFKeyCompare ); - bSortKeyWords = TRUE; + bSortKeyWords = sal_True; } int nRet = 0; diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx index d97e838d2450..1a5ea855c607 100644 --- a/svtools/source/svrtf/rtfout.cxx +++ b/svtools/source/svrtf/rtfout.cxx @@ -45,7 +45,7 @@ const sal_Char __FAR_DATA RTFOutFuncs::sNewLine[] = "\015\012"; SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c, - int *pUCMode, rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile) + int *pUCMode, rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) { const sal_Char* pStr = 0; switch (c) @@ -164,7 +164,7 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c, } SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr, - rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile) + rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) { int nUCMode = 1; for (xub_StrLen n = 0; n < rStr.Len(); ++n) @@ -175,7 +175,7 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr, } SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr, - rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile) + rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) { //Fontnames in word have a quirk in that \uc and usage of ansi replacement //chars after a \u don't work and in wordpad \u doesn't work, so we are @@ -185,7 +185,7 @@ SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr, return rStream; } -SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen ) +SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uIntPtr nHex, sal_uInt8 nLen ) { sal_Char aNToABuf[] = "0000000000000000"; @@ -195,7 +195,7 @@ SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen ) // Pointer an das Bufferende setzen sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1); - for( BYTE n = 0; n < nLen; ++n ) + for( sal_uInt8 n = 0; n < nLen; ++n ) { *(--pStr) = (sal_Char)(nHex & 0xf ) + 48; if( *pStr > '9' ) diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 53b7ee497754..082ffc5b98cd 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -50,11 +50,11 @@ struct SvParser_Impl { String aToken; // gescanntes Token - ULONG nFilePos; // akt. Position im Stream - ULONG nlLineNr; // akt. Zeilen Nummer - ULONG nlLinePos; // akt. Spalten Nummer + sal_uIntPtr nFilePos; // akt. Position im Stream + sal_uIntPtr nlLineNr; // akt. Zeilen Nummer + sal_uIntPtr nlLinePos; // akt. Spalten Nummer long nTokenValue; // zusaetzlicher Wert (RTF) - BOOL bTokenHasValue; // indicates whether nTokenValue is valid + sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid int nToken; // akt. Token sal_Unicode nNextCh; // akt. Zeichen @@ -77,7 +77,7 @@ struct SvParser_Impl // Konstruktor -SvParser::SvParser( SvStream& rIn, BYTE nStackSize ) +SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize ) : rInput( rIn ) , nlLineNr( 1 ) , nlLinePos( 1 ) @@ -86,11 +86,11 @@ SvParser::SvParser( SvStream& rIn, BYTE nStackSize ) , bTokenHasValue( false ) , eState( SVPAR_NOTSTARTED ) , eSrcEnc( RTL_TEXTENCODING_DONTKNOW ) - , bDownloadingFile( FALSE ) + , bDownloadingFile( sal_False ) , nTokenStackSize( nStackSize ) , nTokenStackPos( 0 ) { - bUCS2BSrcEnc = bSwitchToUCS2 = FALSE; + bUCS2BSrcEnc = bSwitchToUCS2 = sal_False; eState = SVPAR_NOTSTARTED; if( nTokenStackSize < 3 ) nTokenStackSize = 3; @@ -191,11 +191,11 @@ sal_Unicode SvParser::GetNextChar() // When reading muliple bytes, we don't have to care about the file // position when we run inti the pending state. The file position is // maintained by SaveState/RestoreState. - BOOL bErr; + sal_Bool bErr; if( bSwitchToUCS2 && 0 == rInput.Tell() ) { sal_uChar c1, c2; - BOOL bSeekBack = TRUE; + sal_Bool bSeekBack = sal_True; rInput >> c1; bErr = rInput.IsEof() || rInput.GetError(); @@ -210,14 +210,14 @@ sal_Unicode SvParser::GetNextChar() if( 0xfe == c1 && 0xff == c2 ) { eSrcEnc = RTL_TEXTENCODING_UCS2; - bUCS2BSrcEnc = TRUE; - bSeekBack = FALSE; + bUCS2BSrcEnc = sal_True; + bSeekBack = sal_False; } else if( 0xff == c1 && 0xfe == c2 ) { eSrcEnc = RTL_TEXTENCODING_UCS2; - bUCS2BSrcEnc = FALSE; - bSeekBack = FALSE; + bUCS2BSrcEnc = sal_False; + bSeekBack = sal_False; } } } @@ -225,7 +225,7 @@ sal_Unicode SvParser::GetNextChar() if( bSeekBack ) rInput.Seek( 0 ); - bSwitchToUCS2 = FALSE; + bSwitchToUCS2 = sal_False; } nNextChPos = rInput.Tell(); @@ -480,7 +480,7 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen" nTmp = 0; else if( nTmp > nTokenStackSize ) nTmp = nTokenStackSize; - nTokenStackPos = BYTE(nTmp); + nTokenStackPos = sal_uInt8(nTmp); // und die Werte zurueck aToken = pTokenStackPos->sToken; @@ -492,15 +492,15 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen" SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt ) { - BYTE nAktPos = BYTE(pTokenStackPos - pTokenStack ); + sal_uInt8 nAktPos = sal_uInt8(pTokenStackPos - pTokenStack ); if( nCnt > 0 ) { if( nCnt >= nTokenStackSize ) nCnt = (nTokenStackSize-1); if( nAktPos + nCnt < nTokenStackSize ) - nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt); + nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt); else - nAktPos = sal::static_int_cast< BYTE >( + nAktPos = sal::static_int_cast< sal_uInt8 >( nAktPos + (nCnt - nTokenStackSize)); } else if( nCnt < 0 ) @@ -508,9 +508,9 @@ SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt ) if( -nCnt >= nTokenStackSize ) nCnt = -nTokenStackSize+1; if( -nCnt <= nAktPos ) - nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt); + nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt); else - nAktPos = sal::static_int_cast< BYTE >( + nAktPos = sal::static_int_cast< sal_uInt8 >( nAktPos + (nCnt + nTokenStackSize)); } return pTokenStack + nAktPos; @@ -574,32 +574,32 @@ void SvParser::Continue( int ) } void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, - USHORT *pWhichIds, - USHORT nWhichIds ) + sal_uInt16 *pWhichIds, + sal_uInt16 nWhichIds ) { - USHORT aNewRange[2]; + sal_uInt16 aNewRange[2]; - for( USHORT nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds ) + for( sal_uInt16 nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds ) if( *pWhichIds ) { aNewRange[0] = aNewRange[1] = *pWhichIds; - BOOL bIns = TRUE; + sal_Bool bIns = sal_True; // Position suchen - for ( USHORT nOfs = 0; rWhichMap[nOfs]; nOfs += 2 ) + for ( sal_uInt16 nOfs = 0; rWhichMap[nOfs]; nOfs += 2 ) { if( *pWhichIds < rWhichMap[nOfs] - 1 ) { // neuen Range davor rWhichMap.Insert( aNewRange, 2, nOfs ); - bIns = FALSE; + bIns = sal_False; break; } else if( *pWhichIds == rWhichMap[nOfs] - 1 ) { // diesen Range nach unten erweitern rWhichMap[nOfs] = *pWhichIds; - bIns = FALSE; + bIns = sal_False; break; } else if( *pWhichIds == rWhichMap[nOfs+1] + 1 ) @@ -613,7 +613,7 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, else // diesen Range nach oben erweitern rWhichMap[nOfs+1] = *pWhichIds; - bIns = FALSE; + bIns = sal_False; break; } } @@ -691,7 +691,7 @@ SvKeyValueIterator::~SvKeyValueIterator (void) /* * GetFirst. */ -BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) +sal_Bool SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) { m_nPos = m_pList->Count(); return GetNext (rKeyVal); @@ -700,17 +700,17 @@ BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal) /* * GetNext. */ -BOOL SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal) +sal_Bool SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal) { if (m_nPos > 0) { rKeyVal = *m_pList->GetObject(--m_nPos); - return TRUE; + return sal_True; } else { // Nothing to do. - return FALSE; + return sal_False; } } diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx index ad8f7a7562d3..71f40b2c3503 100644 --- a/svtools/source/table/defaultinputhandler.cxx +++ b/svtools/source/table/defaultinputhandler.cxx @@ -137,12 +137,12 @@ namespace svt { namespace table bool bHandled = false; const KeyCode& rKeyCode = rKEvt.GetKeyCode(); - USHORT nKeyCode = rKeyCode.GetCode(); + sal_uInt16 nKeyCode = rKeyCode.GetCode(); struct _ActionMapEntry { - USHORT nKeyCode; - USHORT nKeyModifier; + sal_uInt16 nKeyCode; + sal_uInt16 nKeyModifier; TableControlAction eAction; } static aKnownActions[] = { diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index a3f954e0bef5..793265662773 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -110,8 +110,8 @@ namespace svt { namespace table if ( !!pColumn ) sHeaderText = pColumn->getName(); _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); - ULONG nHorFlag = TEXT_DRAW_LEFT; - ULONG nVerFlag = TEXT_DRAW_TOP; + sal_uIntPtr nHorFlag = TEXT_DRAW_LEFT; + sal_uIntPtr nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) nVerFlag = TEXT_DRAW_VCENTER; else if(m_pImpl->rModel.getVerticalAlign() == 2) @@ -196,8 +196,8 @@ namespace svt { namespace table _rDevice.SetLineColor(_rStyle.GetSeparatorColor()); _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() ); _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); - ULONG nHorFlag = TEXT_DRAW_LEFT; - ULONG nVerFlag = TEXT_DRAW_TOP; + sal_uIntPtr nHorFlag = TEXT_DRAW_LEFT; + sal_uIntPtr nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) nVerFlag = TEXT_DRAW_VCENTER; else if(m_pImpl->rModel.getVerticalAlign() == 2) @@ -335,8 +335,8 @@ namespace svt { namespace table } else _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); - ULONG nHorFlag = TEXT_DRAW_LEFT; - ULONG nVerFlag = TEXT_DRAW_TOP; + sal_uIntPtr nHorFlag = TEXT_DRAW_LEFT; + sal_uIntPtr nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) nVerFlag = TEXT_DRAW_VCENTER; else if(m_pImpl->rModel.getVerticalAlign() == 2) diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 1770bfd7dd02..a82dc527f17d 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -284,7 +284,7 @@ namespace svt { namespace table Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 _nIndex ) { (void)_nIndex; - DBG_ASSERT( FALSE, "TableControl::CreateAccessibleControl: to be overwritten!" ); + DBG_ASSERT( sal_False, "TableControl::CreateAccessibleControl: to be overwritten!" ); return NULL; } ::rtl::OUString TableControl::GetAccessibleObjectName( AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const @@ -454,7 +454,7 @@ void TableControl::GrabFocus() Control::GrabFocus(); } // ----------------------------------------------------------------------------- -Reference< XAccessible > TableControl::GetAccessible( BOOL bCreate ) +Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate ) { return Control::GetAccessible( bCreate ); } @@ -563,13 +563,13 @@ void TableControl::commitGridControlEvent( sal_Int16 _nEventId, const Any& _rNew m_pAccessTable->m_pAccessible->commitEvent( _nEventId, _rNewValue, _rOldValue); } // ----------------------------------------------------------------------------- -Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen) +Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen) { (void)_bOnScreen; return m_pImpl->calcHeaderRect(_bIsColumnBar); } // ----------------------------------------------------------------------------- -Rectangle TableControl::calcTableRect(BOOL _bOnScreen) +Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen) { (void)_bOnScreen; return m_pImpl->calcTableRect(); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 3288ab6a4284..058fdca245ca 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -704,7 +704,7 @@ namespace svt { namespace table } //................................................................ - void lcl_setButtonRepeat( Window& _rWindow, ULONG _nDelay ) + void lcl_setButtonRepeat( Window& _rWindow, sal_uIntPtr _nDelay ) { AllSettings aSettings = _rWindow.GetSettings(); MouseSettings aMouseSettings = aSettings.GetMouseSettings(); @@ -712,7 +712,7 @@ namespace svt { namespace table aMouseSettings.SetButtonRepeat( _nDelay ); aSettings.SetMouseSettings( aMouseSettings ); - _rWindow.SetSettings( aSettings, TRUE ); + _rWindow.SetSettings( aSettings, sal_True ); } //................................................................ @@ -1355,7 +1355,7 @@ namespace svt { namespace table invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); } } - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); m_nAnchor = m_nCurRow; ensureVisible(m_nCurColumn, m_nCurRow, false); m_rAntiImpl.selectionChanged(true); @@ -1440,7 +1440,7 @@ namespace svt { namespace table invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); } } - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); m_nAnchor = m_nCurRow; ensureVisible(m_nCurColumn, m_nCurRow, false); m_rAntiImpl.selectionChanged(true); @@ -1468,7 +1468,7 @@ namespace svt { namespace table } m_nCurRow = 0; m_nAnchor = m_nCurRow; - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); ensureVisible(m_nCurColumn, 0, false); m_rAntiImpl.selectionChanged(true); bSuccess = true; @@ -1493,7 +1493,7 @@ namespace svt { namespace table } m_nCurRow = m_nRowCount-1; m_nAnchor = m_nCurRow; - m_pSelEngine->SetAnchor(TRUE); + m_pSelEngine->SetAnchor(sal_True); ensureVisible(m_nCurColumn, m_nRowCount-1, false); m_rAntiImpl.selectionChanged(true); bSuccess = true; @@ -1888,7 +1888,7 @@ namespace svt { namespace table return m_pVScroll; } //------------------------------------------------------------------------------- - BOOL TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current) + sal_Bool TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current) { return ::std::find(selectedRows.begin(),selectedRows.end(),current) != selectedRows.end(); } @@ -2211,19 +2211,19 @@ namespace svt { namespace table m_pTableControl->m_nAnchor = -1; } //------------------------------------------------------------------------------- - BOOL TableFunctionSet::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor) + sal_Bool TableFunctionSet::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; Rectangle rCells; //curRow is the row where the mouse click happened, m_nCurRow is the last selected row, before the mouse click RowPos curRow = m_pTableControl->getCurrentRow(rPoint); if(curRow == -2) - return FALSE; + return sal_False; if( bDontSelectAtCursor ) { if(m_pTableControl->m_nRowSelected.size()>1) - m_pTableControl->m_pSelEngine->AddAlways(TRUE); - bHandled = TRUE; + m_pTableControl->m_pSelEngine->AddAlways(sal_True); + bHandled = sal_True; } else if(m_pTableControl->m_nAnchor == m_pTableControl->m_nCurRow) { @@ -2258,7 +2258,7 @@ namespace svt { namespace table m_pTableControl->m_nAnchor--; } m_pTableControl->invalidateSelectedRegion(m_pTableControl->m_nCurRow, curRow, rCells); - bHandled = TRUE; + bHandled = sal_True; } //no region selected else @@ -2280,20 +2280,20 @@ namespace svt { namespace table } } if(m_pTableControl->m_nRowSelected.size()>1 && m_pTableControl->m_pSelEngine->GetSelectionMode()!=SINGLE_SELECTION) - m_pTableControl->m_pSelEngine->AddAlways(TRUE); + m_pTableControl->m_pSelEngine->AddAlways(sal_True); m_pTableControl->invalidateSelectedRegion(curRow, curRow, rCells); - bHandled = TRUE; + bHandled = sal_True; } m_pTableControl->m_nCurRow = curRow; m_pTableControl->ensureVisible(m_pTableControl->m_nCurColumn,m_pTableControl->m_nCurRow,false); return bHandled; } //------------------------------------------------------------------------------- - BOOL TableFunctionSet::IsSelectionAtPoint( const Point& rPoint ) + sal_Bool TableFunctionSet::IsSelectionAtPoint( const Point& rPoint ) { - m_pTableControl->m_pSelEngine->AddAlways(FALSE); + m_pTableControl->m_pSelEngine->AddAlways(sal_False); if(m_pTableControl->m_nRowSelected.empty()) - return FALSE; + return sal_False; else { RowPos curRow = m_pTableControl->getCurrentRow(rPoint); diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index 12b518aa3578..0d6a78fcfb54 100644 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -170,7 +170,7 @@ namespace svt { namespace table /** moves the cursor to the cell with the given coordinates To ease the caller's code, the coordinates must not necessarily denote a - valid position. If they don't, <FALSE/> will be returned. + valid position. If they don't, <sal_False/> will be returned. */ bool goTo( ColPos _nColumn, RowPos _nRow ); @@ -182,7 +182,7 @@ namespace svt { namespace table the row position which should be visibleMust be non-negative, and smaller than the row count. @param _bAcceptPartialVisibility - <TRUE/> if it's okay that the given cooordinate is only partially visible + <sal_True/> if it's okay that the given cooordinate is only partially visible */ void ensureVisible( ColPos _nColumn, RowPos _nRow, bool _bAcceptPartialVisibility ); /** returns the row, which contains the input point*/ @@ -190,7 +190,7 @@ namespace svt { namespace table void setCursorAtCurrentCell(const Point& rPoint); /** checks whether the vector with the selected rows contains the current row*/ - BOOL isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current); + sal_Bool isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current); bool isRowSelected(RowPos current); /** returns the position of the current row in the selection vector */ @@ -343,8 +343,8 @@ namespace svt { namespace table virtual void BeginDrag(); virtual void CreateAnchor(); virtual void DestroyAnchor(); - virtual BOOL SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor); - virtual BOOL IsSelectionAtPoint( const Point& rPoint ); + virtual sal_Bool SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor); + virtual sal_Bool IsSelectionAtPoint( const Point& rPoint ); virtual void DeselectAtPoint( const Point& rPoint ); virtual void DeselectAll(); }; diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx index 040f33045fff..e113961d9d15 100644 --- a/svtools/source/toolpanel/drawerlayouter.cxx +++ b/svtools/source/toolpanel/drawerlayouter.cxx @@ -147,10 +147,10 @@ namespace svt const PToolPanelDrawer pDrawer( m_aDrawers[ i_nChildIndex ] ); - Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( FALSE ); + Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( sal_False ); if ( !xItemAccessible.is() ) { - xItemAccessible = pDrawer->GetAccessible( TRUE ); + xItemAccessible = pDrawer->GetAccessible( sal_True ); ENSURE_OR_RETURN( xItemAccessible.is(), "illegal accessible provided by the drawer implementation!", NULL ); OSL_VERIFY( ::comphelper::OAccessibleImplementationAccess::setAccessibleParent( xItemAccessible->getAccessibleContext(), i_rParentAccessible ) ); diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 38aee00c8f55..3abae776cd72 100755 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -168,8 +168,8 @@ namespace svt aSelectionRect, ( bHovered || bFocused ) ? ( bActive ? 1 : 2 ) : 0 /* hilight */, bActive /* check */, - TRUE /* border */, - FALSE /* ext border only */, + sal_True /* border */, + sal_False /* ext border only */, 0 /* corner radius */, NULL, NULL @@ -687,7 +687,7 @@ namespace svt Font aFont( m_rTabBar.GetFont() ); aFont.SetOrientation( 2700 ); - aFont.SetVertical( TRUE ); + aFont.SetVertical( sal_True ); m_rTabBar.SetFont( aFont ); aTextPos.X() += aTextSize.Height(); @@ -789,7 +789,7 @@ namespace svt return; } - m_rTabBar.SetUpdateMode( FALSE ); + m_rTabBar.SetUpdateMode( sal_False ); // the aligned bounding and content rect const Rectangle aActualBounds = m_aNormalizer.getTransformed( aNormalizedBounds, m_eTabAlignment ); @@ -807,7 +807,7 @@ namespace svt // render item "foreground" layer m_pRenderer->postRenderItem( m_rTabBar, aActualBounds, nItemFlags ); - m_rTabBar.SetUpdateMode( TRUE ); + m_rTabBar.SetUpdateMode( sal_True ); } //------------------------------------------------------------------------------------------------------------------ @@ -1340,9 +1340,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - Reference< XWindowPeer > PanelTabBar::GetComponentInterface( BOOL i_bCreate ) + Reference< XWindowPeer > PanelTabBar::GetComponentInterface( sal_Bool i_bCreate ) { - Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) ); + Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) ); if ( !xWindowPeer.is() && i_bCreate ) { xWindowPeer.set( new PanelTabBarPeer( *this ) ); diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx index f68bbc1bbd0f..e93fc9fc1357 100755 --- a/svtools/source/toolpanel/tablayouter.cxx +++ b/svtools/source/toolpanel/tablayouter.cxx @@ -254,7 +254,7 @@ namespace svt if ( lcl_checkDisposed( *m_pData ) ) return NULL; - return m_pData->pTabBar->GetAccessible( TRUE ); + return m_pData->pTabBar->GetAccessible( sal_True ); } //........................................................................ diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx index e157090bbf0e..ae69b85dfecd 100755 --- a/svtools/source/toolpanel/toolpaneldeck.cxx +++ b/svtools/source/toolpanel/toolpaneldeck.cxx @@ -544,9 +544,9 @@ namespace svt } //-------------------------------------------------------------------- - Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( BOOL i_bCreate ) + Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( sal_Bool i_bCreate ) { - Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) ); + Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) ); if ( !xWindowPeer.is() && i_bCreate ) { xWindowPeer.set( new ToolPanelDeckPeer( *this ) ); diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx index 851556bc7874..1e7f2358a125 100644 --- a/svtools/source/toolpanel/toolpaneldrawer.cxx +++ b/svtools/source/toolpanel/toolpaneldrawer.cxx @@ -57,7 +57,7 @@ namespace svt :Window( &i_rParent ) ,m_rDrawer( i_rParent ) { - SetMouseTransparent( TRUE ); + SetMouseTransparent( sal_True ); Show(); SetAccessibleRole( AccessibleRole::LABEL ); } @@ -85,7 +85,7 @@ namespace svt ,m_bFocused( false ) ,m_bExpanded( false ) { - EnableMapMode( FALSE ); + EnableMapMode( sal_False ); SetBackground( Wallpaper() ); SetPointer( POINTER_REFHAND ); @@ -162,7 +162,7 @@ namespace svt Image ToolPanelDrawer::impl_getExpansionIndicator() const { const bool bHighContrastMode( GetSettings().GetStyleSettings().GetHighContrastMode() != 0 ); - USHORT nResourceId = 0; + sal_uInt16 nResourceId = 0; if ( m_bExpanded ) if ( bHighContrastMode ) nResourceId = IMG_TRIANGLE_DOWN_HC; @@ -177,9 +177,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - USHORT ToolPanelDrawer::impl_getTextStyle() const + sal_uInt16 ToolPanelDrawer::impl_getTextStyle() const { - const USHORT nBasicStyle = TEXT_DRAW_LEFT + const sal_uInt16 nBasicStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_WORDBREAK; @@ -212,7 +212,7 @@ namespace svt { const Rectangle aTextPixelBox( m_pPaintDevice->LogicToPixel( i_rTextBox ) ); - m_pPaintDevice->EnableMapMode( FALSE ); + m_pPaintDevice->EnableMapMode( sal_False ); m_pPaintDevice->SetFillColor(); Rectangle aBox( i_rTextBox ); @@ -229,7 +229,7 @@ namespace svt m_pPaintDevice->SetLineColor( COL_BLACK ); m_pPaintDevice->DrawPolyLine( Polygon( aTextPixelBox ), aDottedStyle ); - m_pPaintDevice->EnableMapMode( FALSE ); + m_pPaintDevice->EnableMapMode( sal_False ); } else HideFocus(); @@ -306,9 +306,9 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( BOOL i_bCreate ) + Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( sal_Bool i_bCreate ) { - Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( FALSE ) ); + Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( sal_False ) ); if ( !xWindowPeer.is() && i_bCreate ) { xWindowPeer.set( new ToolPanelDrawerPeer() ); diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx index a465a0a6c9e1..4baf49dd17c9 100644 --- a/svtools/source/toolpanel/toolpaneldrawer.hxx +++ b/svtools/source/toolpanel/toolpaneldrawer.hxx @@ -86,13 +86,13 @@ namespace svt virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > - GetComponentInterface( BOOL i_bCreate ); + GetComponentInterface( sal_Bool i_bCreate ); private: Rectangle impl_calcTextBoundingBox() const; Rectangle impl_calcTitleBarBox( const Rectangle& i_rTextBox ) const; void impl_paintBackground( const Rectangle& i_rTitleBarBox ); - USHORT impl_getTextStyle() const; + sal_uInt16 impl_getTextStyle() const; void impl_paintFocusIndicator( const Rectangle& i_rTextBox ); Rectangle impl_paintExpansionIndicator( const Rectangle& i_rTextBox ); Image impl_getExpansionIndicator() const; diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx index a58d9b784cca..33ec21a189f8 100644 --- a/svtools/source/uno/generictoolboxcontroller.cxx +++ b/svtools/source/uno/generictoolboxcontroller.cxx @@ -70,7 +70,7 @@ struct ExecuteInfo GenericToolboxController::GenericToolboxController( const Reference< XMultiServiceFactory >& rServiceManager, const Reference< XFrame >& rFrame, ToolBox* pToolbox, - USHORT nID, + sal_uInt16 nID, const ::rtl::OUString& aCommand ) : svt::ToolboxController( rServiceManager, rFrame, aCommand ) , m_pToolbox( pToolbox ) @@ -157,7 +157,7 @@ throw ( RuntimeException ) { m_pToolbox->EnableItem( m_nID, Event.IsEnabled ); - USHORT nItemBits = m_pToolbox->GetItemBits( m_nID ); + sal_uInt16 nItemBits = m_pToolbox->GetItemBits( m_nID ); nItemBits &= ~TIB_CHECKABLE; TriState eTri = STATE_NOCHECK; diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 92ae93f5080d..41f676f5f378 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -849,7 +849,7 @@ void ToolboxController::enable( bool bEnable ) sal_uInt16 nItemId = 0; if( getToolboxId( nItemId, &pToolBox ) ) { - pToolBox->EnableItem( nItemId, bEnable ? TRUE : FALSE ); + pToolBox->EnableItem( nItemId, bEnable ? sal_True : sal_False ); } } diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 7fb1a007960f..52ec5039262d 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -81,7 +81,7 @@ public: class ImplGraphicItem : public SvLBoxBmp { public: - ImplGraphicItem( SvLBoxEntry* pEntry, USHORT nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {} + ImplGraphicItem( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {} OUString msGraphicURL; }; @@ -91,7 +91,7 @@ public: class ImplContextGraphicItem : public SvLBoxContextBmp { public: - ImplContextGraphicItem( SvLBoxEntry* pEntry,USHORT nFlags,Image& rI1,Image& rI2, USHORT nEntryFlagsBmp1) + ImplContextGraphicItem( SvLBoxEntry* pEntry,sal_uInt16 nFlags,Image& rI1,Image& rI2, sal_uInt16 nEntryFlagsBmp1) : SvLBoxContextBmp( pEntry, nFlags, rI1, rI2, nEntryFlagsBmp1 ) {} OUString msExpandedGraphicURL; @@ -106,12 +106,12 @@ public: UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent, WinBits nWinStyle ); ~UnoTreeListBoxImpl(); - sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos=LIST_APPEND ); + sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uIntPtr nPos=LIST_APPEND ); virtual void RequestingChilds( SvLBoxEntry* pParent ); - virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); + virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); DECL_LINK( OnSelectionChangeHdl, UnoTreeListBoxImpl* ); DECL_LINK( OnExpandingHdl, UnoTreeListBoxImpl* ); @@ -129,7 +129,7 @@ public: UnoTreeListItem( SvLBoxEntry* ); UnoTreeListItem(); virtual ~UnoTreeListItem(); - virtual USHORT IsA(); + virtual sal_uInt16 IsA(); void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* ); OUString GetText() const; void SetText( const OUString& rText ); @@ -137,7 +137,7 @@ public: void SetImage( const Image& rImage ); OUString GetGraphicURL() const; void SetGraphicURL( const OUString& rGraphicURL ); - void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* ); + void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* ); SvLBoxItem* Create() const; void Clone( SvLBoxItem* pSource ); @@ -259,7 +259,7 @@ void TreeControlPeer::SetWindow( Window* pWindow ) // -------------------------------------------------------------------- -UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos /* = LIST_APPEND */ ) +UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uIntPtr nPos /* = LIST_APPEND */ ) { UnoTreeListEntry* pEntry = 0; if( mpTreeImpl ) @@ -326,9 +326,9 @@ bool TreeControlPeer::updateEntry( UnoTreeListEntry* pEntry ) } } - if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == TRUE) ) + if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == sal_True) ) { - pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? TRUE : FALSE ); + pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? sal_True : sal_False ); bChanged = true; } @@ -530,14 +530,14 @@ void TreeControlPeer::ChangeNodesSelection( const Any& rSelection, bool bSelect, } if( bSetSelection ) - rTree.SelectAll( FALSE ); + rTree.SelectAll( sal_False ); if( pNodes && nCount ) { while( nCount-- ) { UnoTreeListEntry* pEntry = getEntry( *pNodes++ ); - rTree.Select( pEntry, bSelect ? TRUE : FALSE ); + rTree.Select( pEntry, bSelect ? sal_True : sal_False ); } } } @@ -563,7 +563,7 @@ Any SAL_CALL TreeControlPeer::getSelection() throw (RuntimeException) Any aRet; - ULONG nSelectionCount = rTree.GetSelectionCount(); + sal_uIntPtr nSelectionCount = rTree.GetSelectionCount(); if( nSelectionCount == 1 ) { UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.FirstSelected() ); @@ -625,7 +625,7 @@ void SAL_CALL TreeControlPeer::removeSelection( const Any& rSelection ) throw (I void SAL_CALL TreeControlPeer::clearSelection() throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); - getTreeListBoxOrThrow().SelectAll( FALSE ); + getTreeListBoxOrThrow().SelectAll( sal_False ); } // ------------------------------------------------------------------- @@ -891,7 +891,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getNodeForLocation( sal_Int32 x Reference< XTreeNode > xNode; const Point aPos( x, y ); - UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) ); + UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) ); if( pEntry ) xNode = pEntry->mxNode; @@ -909,7 +909,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getClosestNodeForLocation( sal_ Reference< XTreeNode > xNode; const Point aPos( x, y ); - UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) ); + UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) ); if( pEntry ) xNode = pEntry->mxNode; @@ -948,7 +948,7 @@ sal_Bool SAL_CALL TreeControlPeer::stopEditing() throw (RuntimeException) UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); if( rTree.IsEditingActive() ) { - rTree.EndEditing(FALSE); + rTree.EndEditing(sal_False); return sal_True; } else @@ -964,7 +964,7 @@ void SAL_CALL TreeControlPeer::cancelEditing( ) throw (RuntimeException) ::vos::OGuard aGuard( GetMutex() ); UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); - rTree.EndEditing(FALSE); + rTree.EndEditing(sal_False); } // ------------------------------------------------------------------- @@ -1104,7 +1104,7 @@ void TreeControlPeer::updateNode( UnoTreeListBoxImpl& rTree, const Reference< XT { Reference< XTreeNode > xParentNode( xNode->getParent() ); UnoTreeListEntry* pParentEntry = 0; - ULONG nChild = LIST_APPEND; + sal_uIntPtr nChild = LIST_APPEND; if( xParentNode.is() ) { @@ -1356,7 +1356,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An { sal_Bool bEnabled = false; if( aValue >>= bEnabled ) - rTree.EnableInplaceEditing( bEnabled ? TRUE : FALSE ); + rTree.EnableInplaceEditing( bEnabled ? sal_True : sal_False ); break; } case BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING: @@ -1563,7 +1563,7 @@ IMPL_LINK(UnoTreeListBoxImpl, OnExpandedHdl, UnoTreeListBoxImpl*, EMPTYARG ) // -------------------------------------------------------------------- -sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos ) +sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uIntPtr nPos ) { if( pParent ) return SvTreeListBox::Insert( pEntry, pParent, nPos ); @@ -1582,14 +1582,14 @@ void UnoTreeListBoxImpl::RequestingChilds( SvLBoxEntry* pParent ) // -------------------------------------------------------------------- -BOOL UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& ) +sal_Bool UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& ) { return mxPeer.is() ? mxPeer->onEditingEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ) ) : false; } // -------------------------------------------------------------------- -BOOL UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) +sal_Bool UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) { return mxPeer.is() ? mxPeer->onEditedEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ), rNewText ) : false; } @@ -1618,14 +1618,14 @@ UnoTreeListItem::~UnoTreeListItem() // -------------------------------------------------------------------- -USHORT UnoTreeListItem::IsA() +sal_uInt16 UnoTreeListItem::IsA() { return 0; } // -------------------------------------------------------------------- -void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, SvLBoxEntry* _pEntry) +void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry) { Point aPos( rPos ); if( _pEntry ) diff --git a/svtools/source/uno/treecontrolpeer.hxx b/svtools/source/uno/treecontrolpeer.hxx index 336830804a6f..518d59cb469c 100644 --- a/svtools/source/uno/treecontrolpeer.hxx +++ b/svtools/source/uno/treecontrolpeer.hxx @@ -129,7 +129,7 @@ private: void fillTree( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeDataModel >& xDataModel ); void addNode( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParentEntry ); - UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos = LIST_APPEND ); + UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uIntPtr nPos = LIST_APPEND ); bool updateEntry( UnoTreeListEntry* pEntry ); void updateTree( const ::com::sun::star::awt::tree::TreeDataModelEvent& rEvent, bool bRecursive ); diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index f2090be1655f..aabd0b27253b 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -123,7 +123,7 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com:: pWindow = new CalendarField( pParent, nWinBits); static_cast<CalendarField*>(pWindow)->EnableToday(); static_cast<CalendarField*>(pWindow)->EnableNone(); - static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( TRUE ); + static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( sal_True ); *ppNewComp = new SVTXDateField; ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow ); } @@ -840,7 +840,7 @@ void SVTXFormattedField::SetWindow( Window* _pWindow ) { VCLXSpinField::SetWindow(_pWindow); if (GetFormattedField()) - GetFormattedField()->SetAutoColor(TRUE); + GetFormattedField()->SetAutoColor(sal_True); } // -------------------------------------------------------------------------------------- @@ -2136,7 +2136,7 @@ void VCLXProgressBar::ImplUpdateValue() } // set progressbar value - pProgressBar->SetValue( (USHORT) nPercent ); + pProgressBar->SetValue( (sal_uInt16) nPercent ); } } diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 6b6e35482ae9..5672a27ef6e4 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -98,7 +98,7 @@ class SvUnoImageMapObject : public OWeakAggObject, public XUnoTunnel { public: - SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems ); + SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ); SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems ); virtual ~SvUnoImageMapObject() throw(); @@ -131,10 +131,10 @@ public: virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw( RuntimeException ); private: - static PropertySetInfo* createPropertySetInfo( UINT16 nType ); + static PropertySetInfo* createPropertySetInfo( sal_uInt16 nType ); - UINT16 mnType; + sal_uInt16 mnType; ::rtl::OUString maURL; ::rtl::OUString maAltText; @@ -150,7 +150,7 @@ private: UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject ); -PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType ) +PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) { switch( nType ) { @@ -207,7 +207,7 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType ) } } -SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems ) +SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ) : PropertySetHelper( createPropertySetInfo( nType ) ), mnType( nType ) { @@ -251,11 +251,11 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv { const Polygon aPoly( ((IMapPolygonObject*)&rMapObject)->GetPolygon(sal_False) ); - const USHORT nCount = aPoly.GetSize(); + const sal_uInt16 nCount = aPoly.GetSize(); maPolygon.realloc( nCount ); awt::Point* pPoints = maPolygon.getArray(); - for( USHORT nPoint = 0; nPoint < nCount; nPoint++ ) + for( sal_uInt16 nPoint = 0; nPoint < nCount; nPoint++ ) { const Point& rPoint = aPoly.GetPoint( nPoint ); pPoints->X = rPoint.X(); @@ -607,8 +607,8 @@ SvUnoImageMap::SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pS { maName = rMap.GetName(); - const UINT16 nCount = rMap.GetIMapObjectCount(); - for( UINT16 nPos = 0; nPos < nCount; nPos++ ) + const sal_uInt16 nCount = rMap.GetIMapObjectCount(); + for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ ) { IMapObject* pMapObject = rMap.GetIMapObject( nPos ); SvUnoImageMapObject* pUnoObj = new SvUnoImageMapObject( *pMapObject, pSupportedMacroItems ); diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx index d6f7029b477c..6bc01c76da4a 100644 --- a/svtools/source/uno/wizard/wizardpagecontroller.cxx +++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx @@ -75,7 +75,7 @@ namespace svt { namespace uno try { m_xWizardPage.set( m_xController->createPage( - Reference< XWindow >( i_rParent.GetComponentInterface( TRUE ), UNO_QUERY_THROW ), + Reference< XWindow >( i_rParent.GetComponentInterface( sal_True ), UNO_QUERY_THROW ), m_nPageId ), UNO_SET_THROW ); diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index 7e81f17209f2..65a04b1d5a7c 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -38,7 +38,7 @@ #define TOKEN_SEPARATOR '\001' -sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const +sal_Bool INetImage::Write( SvStream& rOStm, sal_uIntPtr nFormat ) const { sal_Bool bRet = sal_False; switch( nFormat ) @@ -68,7 +68,7 @@ sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const return bRet; } -sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat ) +sal_Bool INetImage::Read( SvStream& rIStm, sal_uIntPtr nFormat ) { sal_Bool bRet = sal_False; switch( nFormat ) @@ -96,11 +96,11 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat ) --> structure size MUST - alignment of 4! int iSize; // size of all data, including variable length strings BOOL bIsMap; // For server side maps - INT32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct - INT32 iHeight; // and EDT_ImageData - INT32 iHSpace; - INT32 iVSpace; - INT32 iBorder; + sal_Int32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct + sal_Int32 iHeight; // and EDT_ImageData + sal_Int32 iHSpace; + sal_Int32 iVSpace; + sal_Int32 iBorder; int iLowResOffset; // Offsets into string_data. If 0, string is NULL (not used) int iAltOffset; // (alternate text?) int iAnchorOffset; // HREF in image @@ -117,7 +117,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat ) rIStm >> nVal; aSizePixel.Width() = nVal; rIStm >> nVal; aSizePixel.Height() = nVal; // skip over iHSpace, iVSpace, iBorder, iLowResOffset - rIStm.SeekRel( 3 * sizeof( INT32 ) + sizeof( int ) ); + rIStm.SeekRel( 3 * sizeof( sal_Int32 ) + sizeof( int ) ); rIStm >> nAltOffset; rIStm >> nAnchorOffset; // skip over iExtraHTML_Offset |