diff options
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 14 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 8 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 4 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.hxx | 10 | ||||
-rw-r--r-- | svtools/source/brwbox/editbrowsebox.cxx | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 509d1265649f..cc78b514f7a6 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -272,13 +272,13 @@ const vcl::Font& BrowseBox::GetFont() const return pDataWin->GetFont(); } -sal_uLong BrowseBox::GetDefaultColumnWidth( const OUString& _rText ) const +tools::Long BrowseBox::GetDefaultColumnWidth( const OUString& _rText ) const { return pDataWin->GetTextWidth( _rText ) + pDataWin->GetTextWidth(OUString('0')) * 4; } -void BrowseBox::InsertHandleColumn( sal_uLong nWidth ) +void BrowseBox::InsertHandleColumn( tools::Long nWidth ) { #if OSL_DEBUG_LEVEL > 0 @@ -570,7 +570,7 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const OUString& rTitle ) } -void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) +void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, tools::Long nWidth ) { // get the position in the current array @@ -591,7 +591,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) nMaxWidth -= pDataWin->bAutoSizeLastCol ? GetFieldRect(nItemId).Left() : GetFrozenWidth(); - if ( pDataWin->bAutoSizeLastCol || nWidth > o3tl::make_unsigned(nMaxWidth) ) + if ( pDataWin->bAutoSizeLastCol || nWidth > nMaxWidth ) { nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth; } @@ -600,7 +600,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) // OV // In AutoSizeLastColumn(), we call SetColumnWidth with nWidth==0xffff. // Thus, check here, if the width has actually changed. - if( static_cast<sal_uLong>(nOldWidth) == nWidth ) + if( nOldWidth == nWidth ) return; // do we want to display the change immediately? @@ -638,13 +638,13 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) if( GetBackground().IsScrollable() ) { - tools::Rectangle aScrRect( nX + std::min( static_cast<sal_uLong>(nOldWidth), nWidth ), 0, + tools::Rectangle aScrRect( nX + std::min( 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.SetBottom( pDataWin->GetSizePixel().Height() ); pDataWin->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); - tools::Rectangle aInvRect( nX, 0, nX + std::max( nWidth, static_cast<sal_uLong>(nOldWidth) ), USHRT_MAX ); + tools::Rectangle aInvRect( nX, 0, nX + std::max( nWidth, nOldWidth ), USHRT_MAX ); Control::Invalidate( aInvRect, InvalidateFlags::NoChildren ); pDataWin->Invalidate( aInvRect ); } diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 33f0990de6e9..08bfe6c7f460 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -366,7 +366,7 @@ void BrowseBox::DrawCursor() } -sal_uLong BrowseBox::GetColumnWidth( sal_uInt16 nId ) const +tools::Long BrowseBox::GetColumnWidth( sal_uInt16 nId ) const { sal_uInt16 nItemPos = GetColumnPos( nId ); @@ -1382,7 +1382,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) sal_uInt16 nX = 0; for ( size_t nCol = 0; nCol < mvCols.size() && - ( nX + mvCols[ nCol ]->Width() ) < o3tl::make_unsigned(GetOutputSizePixel().Width()); + ( nX + mvCols[ nCol ]->Width() ) < GetOutputSizePixel().Width(); ++nCol ) // is this column visible? if ( mvCols[ nCol ]->IsFrozen() || nCol >= nFirstCol ) @@ -1405,7 +1405,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX ); tools::Long nDeltaX = nDragX - nResizeX; sal_uInt16 nId = GetColumnId(nResizeCol); - sal_uLong nOldWidth = GetColumnWidth(nId); + tools::Long nOldWidth = GetColumnWidth(nId); nDragX = nOldWidth + nDeltaX + nResizeX - nOldWidth; // draw new auxiliary line @@ -1433,7 +1433,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) // width changed? nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX ); - if ( (nDragX - nResizeX) != static_cast<tools::Long>(mvCols[ nResizeCol ]->Width()) ) + if ( (nDragX - nResizeX) != mvCols[ nResizeCol ]->Width() ) { // resize column tools::Long nMaxX = pDataWin->GetSizePixel().Width(); diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index d0144a9d4f7c..c818bb9d829d 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -88,7 +88,7 @@ void ButtonFrame::Draw( OutputDevice& rDev ) } BrowserColumn::BrowserColumn( sal_uInt16 nItemId, - OUString aTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom ) + OUString aTitle, tools::Long nWidthPixel, const Fraction& rCurrentZoom ) : _nId( nItemId ), _nWidth( nWidthPixel ), _aTitle(std::move( aTitle )), @@ -106,7 +106,7 @@ BrowserColumn::~BrowserColumn() { } -void BrowserColumn::SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom) +void BrowserColumn::SetWidth(tools::Long nNewWidthPixel, const Fraction& rCurrentZoom) { _nWidth = nNewWidthPixel; // Avoid overflow when called with LONG_MAX from diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index a345d28fee48..29e0ac301bda 100644 --- a/svtools/source/brwbox/datwin.hxx +++ b/svtools/source/brwbox/datwin.hxx @@ -53,19 +53,19 @@ public: class BrowserColumn final { sal_uInt16 _nId; - sal_uLong _nOriginalWidth; - sal_uLong _nWidth; + tools::Long _nOriginalWidth; + tools::Long _nWidth; OUString _aTitle; bool _bFrozen; public: BrowserColumn( sal_uInt16 nItemId, - OUString aTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom ); + OUString aTitle, tools::Long nWidthPixel, const Fraction& rCurrentZoom ); ~BrowserColumn(); sal_uInt16 GetId() const { return _nId; } - sal_uLong Width() const { return _nWidth; } + tools::Long Width() const { return _nWidth; } OUString& Title() { return _aTitle; } bool IsFrozen() const { return _bFrozen; } @@ -74,7 +74,7 @@ public: void Draw( BrowseBox const & rBox, OutputDevice& rDev, const Point& rPos ); - void SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom); + void SetWidth(tools::Long nNewWidthPixel, const Fraction& rCurrentZoom); void ZoomChanged(const Fraction& rNewZoom); }; diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 46f3379b7847..927e203dd14a 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -65,7 +65,7 @@ namespace svt sal_uInt16 nColId = GetCurItemId(); if (nColId) { - sal_uInt32 nAutoWidth = static_cast<EditBrowseBox*>(GetParent())->GetAutoColumnWidth(nColId); + tools::Long nAutoWidth = static_cast<EditBrowseBox*>(GetParent())->GetAutoColumnWidth(nColId); if (nAutoWidth != static_cast<EditBrowseBox*>(GetParent())->GetColumnWidth(nColId)) { static_cast<EditBrowseBox*>(GetParent())->SetColumnWidth(nColId, nAutoWidth); |