diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-19 15:12:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-19 21:34:46 +0200 |
commit | 3aef606f2758172a27718a06fea0ff9080e4d80f (patch) | |
tree | ad323c90301d80bbb3b68163d8b87e5402b687ed /vcl/source/control | |
parent | 5afba3e12c8d4eb1ebb8e087134eb87593bb017a (diff) |
use tools::Long in vcl
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control')
27 files changed, 469 insertions, 469 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index f96f8c0a57c4..45e4876a11ae 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -75,7 +75,7 @@ public: ImplCommonButtonData(); tools::Rectangle maFocusRect; - long mnSeparatorX; + tools::Long mnSeparatorX; DrawButtonFlags mnButtonState; bool mbSmallSymbol; @@ -158,12 +158,12 @@ ImageAlign Button::GetImageAlign() const return mpButtonData->meImageAlign; } -long Button::ImplGetSeparatorX() const +tools::Long Button::ImplGetSeparatorX() const { return mpButtonData->mnSeparatorX; } -void Button::ImplSetSeparatorX( long nX ) +void Button::ImplSetSeparatorX( tools::Long nX ) { mpButtonData->mnSeparatorX = nX; } @@ -239,7 +239,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Point aImagePos = rPos; Point aTextPos = rPos; tools::Rectangle aUnion(aImagePos, aImageSize); - long nSymbolHeight = 0; + tools::Long nSymbolHeight = 0; if (bDrawText || bHasSymbol) { @@ -304,7 +304,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, if (bAddImageSep && bDrawImage) { - long nDiff = (aImageSize.Height() - aTextSize.Height()) / 3; + tools::Long nDiff = (aImageSize.Height() - aTextSize.Height()) / 3; if (nDiff > 0) nImageSep += nDiff; } @@ -378,8 +378,8 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, // Now place the combination of text and image in the output area of the button // according to the window style (WinBits) - long nXOffset = 0; - long nYOffset = 0; + tools::Long nXOffset = 0; + tools::Long nYOffset = 0; if (nWinStyle & WB_CENTER) { @@ -816,11 +816,11 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, DrawFlags nDrawFl if ( mnDDStyle == PushButtonDropdownStyle::MenuButton || mnDDStyle == PushButtonDropdownStyle::SplitMenuButton ) { - long nSeparatorX = 0; + tools::Long nSeparatorX = 0; tools::Rectangle aSymbolRect = aInRect; // calculate symbol size - long nSymbolSize = pDev->GetTextHeight() / 2 + 1; + tools::Long nSymbolSize = pDev->GetTextHeight() / 2 + 1; nSeparatorX = aInRect.Right() - 2*nSymbolSize; aSize.AdjustWidth( -(2*nSymbolSize) ); @@ -832,7 +832,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, DrawFlags nDrawFl ImplDrawAlignedImage( pDev, aPos, aSize, nImageSep, nTextStyle, nullptr, true ); - long nDistance = (aSymbolRect.GetHeight() > 10) ? 2 : 1; + tools::Long nDistance = (aSymbolRect.GetHeight() > 10) ? 2 : 1; DecorationView aDecoView( pDev ); if( bMenuBtnSep && nSeparatorX > 0 ) { @@ -1574,7 +1574,7 @@ Size PushButton::CalcMinimumSize() const if( mnDDStyle == PushButtonDropdownStyle::MenuButton || mnDDStyle == PushButtonDropdownStyle::SplitMenuButton ) { - long nSymbolSize = GetTextHeight() / 2 + 1; + tools::Long nSymbolSize = GetTextHeight() / 2 + 1; aSize.AdjustWidth(2*nSymbolSize ); } if (!PushButton::GetText().isEmpty()) @@ -1582,7 +1582,7 @@ Size PushButton::CalcMinimumSize() const Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize(); aSize.AdjustWidth(textSize.Width() ); - aSize.setHeight( std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ) ); + aSize.setHeight( std::max( aSize.Height(), tools::Long( textSize.Height() * 1.15 ) ) ); } // cf. ImplDrawPushButton ... @@ -1972,7 +1972,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, { DrawTextFlags nTextStyle = Button::ImplGetTextStyle( nWinStyle, nDrawFlags ); - const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); + const tools::Long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); Size aSize( rSize ); Point aPos( rPos ); aPos.AdjustX(rImageSize.Width() + nImageSep ); @@ -2033,8 +2033,8 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, bool bTopImage = (nWinStyle & WB_TOP) != 0; Size aImageSize = maImage.GetSizePixel(); tools::Rectangle aImageRect( rPos, rSize ); - long nTextHeight = pDev->GetTextHeight(); - long nTextWidth = pDev->GetCtrlTextWidth( aText ); + tools::Long nTextHeight = pDev->GetTextHeight(); + tools::Long nTextWidth = pDev->GetCtrlTextWidth( aText ); // calculate position and sizes if (!aText.isEmpty()) @@ -2394,8 +2394,8 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, aImageSize, aStateRect, aMouseRect ); Point aCenterPos = aStateRect.Center(); - long nRadX = aImageSize.Width()/2; - long nRadY = aImageSize.Height()/2; + tools::Long nRadX = aImageSize.Width()/2; + tools::Long nRadY = aImageSize.Height()/2; pDev->SetLineColor(); pDev->SetFillColor( COL_BLACK ); @@ -2625,7 +2625,7 @@ void RadioButton::Check( bool bCheck ) Toggle(); } -long RadioButton::ImplGetImageToTextDistance() const +tools::Long RadioButton::ImplGetImageToTextDistance() const { // 4 pixels, but take zoom into account, so the text doesn't "jump" relative to surrounding elements, // which might have been aligned with the text of the check box @@ -2781,7 +2781,7 @@ void RadioButton::ImplAdjustNWFSizes() Pop(); } -Size RadioButton::CalcMinimumSize(long nMaxWidth) const +Size RadioButton::CalcMinimumSize(tools::Long nMaxWidth) const { Size aSize; if ( !maImage ) @@ -2987,7 +2987,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, { DrawTextFlags nTextStyle = Button::ImplGetTextStyle( nWinStyle, nDrawFlags ); - const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); + const tools::Long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); Size aSize( rSize ); Point aPos( rPos ); aPos.AdjustX(rImageSize.Width() + nImageSep ); @@ -3200,7 +3200,7 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, Size aImageSize = pDev->LogicToPixel( Size( 300, 300 ), aResMapMode ); Size aBrd1Size = pDev->LogicToPixel( Size( 20, 20 ), aResMapMode ); Size aBrd2Size = pDev->LogicToPixel( Size( 30, 30 ), aResMapMode ); - long nCheckWidth = pDev->LogicToPixel( Size( 20, 20 ), aResMapMode ).Width(); + tools::Long nCheckWidth = pDev->LogicToPixel( Size( 20, 20 ), aResMapMode ).Width(); vcl::Font aFont = GetDrawPixelFont( pDev ); tools::Rectangle aStateRect; tools::Rectangle aMouseRect; @@ -3263,8 +3263,8 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, Point aTempPos21( aPos21 ); Point aTempPos22( aPos22 ); pDev->SetLineColor( COL_BLACK ); - long nDX = 0; - for ( long i = 0; i < nCheckWidth; i++ ) + tools::Long nDX = 0; + for ( tools::Long i = 0; i < nCheckWidth; i++ ) { if ( !(i % 2) ) { @@ -3465,7 +3465,7 @@ void CheckBox::EnableTriState( bool bTriState ) } } -long CheckBox::ImplGetImageToTextDistance() const +tools::Long CheckBox::ImplGetImageToTextDistance() const { // 4 pixels, but take zoom into account, so the text doesn't "jump" relative to surrounding elements, // which might have been aligned with the text of the check box @@ -3605,7 +3605,7 @@ void CheckBox::ImplAdjustNWFSizes() Pop(); } -Size CheckBox::CalcMinimumSize( long nMaxWidth ) const +Size CheckBox::CalcMinimumSize( tools::Long nMaxWidth ) const { Size aSize = ImplGetCheckImageSize(); nMaxWidth -= aSize.Width(); diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx index 3913e617a4ea..5b6ae6e7262f 100644 --- a/vcl/source/control/calendar.cxx +++ b/vcl/source/control/calendar.cxx @@ -201,8 +201,8 @@ void Calendar::ImplFormat() if ( (aOutSize.Width() <= 1) || (aOutSize.Height() <= 1) ) return; - long n99TextWidth = GetTextWidth( "99" ); - long nTextHeight = GetTextHeight(); + tools::Long n99TextWidth = GetTextWidth( "99" ); + tools::Long nTextHeight = GetTextHeight(); // calculate width and x-position mnDayWidth = n99TextWidth+DAY_OFFX; @@ -211,7 +211,7 @@ void Calendar::ImplFormat() mnMonthPerLine = aOutSize.Width() / mnMonthWidth; if ( !mnMonthPerLine ) mnMonthPerLine = 1; - long nOver = (aOutSize.Width()-(mnMonthPerLine*mnMonthWidth)) / mnMonthPerLine; + tools::Long nOver = (aOutSize.Width()-(mnMonthPerLine*mnMonthWidth)) / mnMonthPerLine; mnMonthWidth += nOver; mnDaysOffX = MONTH_BORDERX; mnDaysOffX += nOver/2; @@ -228,7 +228,7 @@ void Calendar::ImplFormat() mnMonthHeight += (aOutSize.Height()-(mnLines*mnMonthHeight)) / mnLines; // calculate spinfields - long nSpinSize = nTextHeight+TITLE_BORDERY-SPIN_OFFY; + tools::Long nSpinSize = nTextHeight+TITLE_BORDERY-SPIN_OFFY; maPrevRect.SetLeft( SPIN_OFFX ); maPrevRect.SetTop( SPIN_OFFY ); maPrevRect.SetRight( maPrevRect.Left()+nSpinSize ); @@ -240,14 +240,14 @@ void Calendar::ImplFormat() // Calculate DayOfWeekText (gets displayed in a narrow font) maDayOfWeekText.clear(); - long nStartOffX = 0; + tools::Long nStartOffX = 0; sal_Int16 nDay = maCalendarWrapper.getFirstDayOfWeek(); for ( sal_Int16 nDayOfWeek = 0; nDayOfWeek < 7; nDayOfWeek++ ) { // Use narrow name. OUString aDayOfWeek( maCalendarWrapper.getDisplayName( i18n::CalendarDisplayIndex::DAY, nDay, 2)); - long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2; + tools::Long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2; if ( !nDayOfWeek ) nStartOffX = nOffX; else @@ -335,21 +335,21 @@ sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const else if ( maNextRect.IsInside( rPos ) ) return CALENDAR_HITTEST_NEXT; - long nY; - long nOffX; + tools::Long nY; + tools::Long nOffX; sal_Int32 nDay; DayOfWeek eStartDay = ImplGetWeekStart(); rDate = GetFirstMonth(); nY = 0; - for ( long i = 0; i < mnLines; i++ ) + for ( tools::Long i = 0; i < mnLines; i++ ) { if ( rPos.Y() < nY ) return 0; - long nX = 0; - long nYMonth = nY+mnMonthHeight; - for ( long j = 0; j < mnMonthPerLine; j++ ) + tools::Long nX = 0; + tools::Long nYMonth = nY+mnMonthHeight; + for ( tools::Long j = 0; j < mnMonthPerLine; j++ ) { if ( (rPos.X() < nX) && (rPos.Y() < nYMonth) ) return 0; @@ -364,8 +364,8 @@ sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const return CALENDAR_HITTEST_MONTHTITLE; else { - long nDayX = nX+mnDaysOffX; - long nDayY = nY+mnDaysOffY; + tools::Long nDayX = nX+mnDaysOffX; + tools::Long nDayY = nY+mnDaysOffY; if ( rPos.Y() < nDayY ) return 0; sal_Int32 nDayIndex = static_cast<sal_Int32>(rDate.GetDayOfWeek()); @@ -457,11 +457,11 @@ namespace void ImplDrawSpinArrow(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect, bool bPrev) { - long i; - long n; - long nLines; - long nHeight = rRect.GetHeight(); - long nWidth = rRect.GetWidth(); + tools::Long i; + tools::Long n; + tools::Long nLines; + tools::Long nHeight = rRect.GetHeight(); + tools::Long nWidth = rRect.GetWidth(); if (nWidth < nHeight) n = nWidth; else @@ -519,7 +519,7 @@ void Calendar::ImplDrawSpin(vcl::RenderContext& rRenderContext ) } void Calendar::ImplDrawDate(vcl::RenderContext& rRenderContext, - long nX, long nY, + tools::Long nX, tools::Long nY, sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear, bool bOther, sal_Int32 nToday ) { @@ -561,8 +561,8 @@ void Calendar::ImplDrawDate(vcl::RenderContext& rRenderContext, } // display text - long nTextX = nX + (mnDayWidth - GetTextWidth(rDay)) - (DAY_OFFX / 2); - long nTextY = nY + (mnDayHeight - GetTextHeight()) / 2; + tools::Long nTextX = nX + (mnDayWidth - GetTextWidth(rDay)) - (DAY_OFFX / 2); + tools::Long nTextY = nY + (mnDayHeight - GetTextHeight()) / 2; if (pTextColor) { Color aOldColor = rRenderContext.GetTextColor(); @@ -599,13 +599,13 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); Size aOutSize(GetOutputSizePixel()); - long i; - long j; - long nY; - long nDeltaX; - long nDeltaY; - long nDayX; - long nDayY; + tools::Long i; + tools::Long j; + tools::Long nY; + tools::Long nDeltaX; + tools::Long nDeltaY; + tools::Long nDayX; + tools::Long nDayY; sal_Int32 nToday = Date(Date::SYSTEM).GetDate(); sal_uInt16 nDay; sal_uInt16 nMonth; @@ -651,7 +651,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) rRenderContext.DrawLine(aSepPos1, aSepPos2); } - long nX = 0; + tools::Long nX = 0; for (j = 0; j < mnMonthPerLine; j++) { nMonth = aDate.GetMonth(); @@ -663,9 +663,9 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) OUString aMonthText = maCalendarWrapper.getDisplayName(i18n::CalendarDisplayIndex::MONTH, nMonth - 1, 1) + " " + OUString::number(nYear); - long nMonthTextWidth = rRenderContext.GetTextWidth(aMonthText); - long nMonthOffX1 = 0; - long nMonthOffX2 = 0; + tools::Long nMonthTextWidth = rRenderContext.GetTextWidth(aMonthText); + tools::Long nMonthOffX1 = 0; + tools::Long nMonthOffX2 = 0; if (i == 0) { if (j == 0) @@ -673,7 +673,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) if (j == mnMonthPerLine - 1) nMonthOffX2 = aOutSize.Width() - maNextRect.Left() + 1; } - long nMaxMonthWidth = mnMonthWidth - nMonthOffX1 - nMonthOffX2 - 4; + tools::Long nMaxMonthWidth = mnMonthWidth - nMonthOffX1 - nMonthOffX2 - 4; if (nMonthTextWidth > nMaxMonthWidth) { // Abbreviated month name. @@ -682,7 +682,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) + OUString::number(nYear); nMonthTextWidth = rRenderContext.GetTextWidth(aMonthText); } - long nTempOff = (mnMonthWidth - nMonthTextWidth + 1) / 2; + tools::Long nTempOff = (mnMonthWidth - nMonthTextWidth + 1) / 2; if (nTempOff < nMonthOffX1) nDeltaX += nMonthOffX1 + 1; else @@ -1212,7 +1212,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) const CommandWheelData* pData = rCEvt.GetWheelData(); if ( pData->GetMode() == CommandWheelMode::SCROLL ) { - long nNotchDelta = pData->GetNotchDelta(); + tools::Long nNotchDelta = pData->GetNotchDelta(); if ( nNotchDelta < 0 ) { while ( nNotchDelta < 0 ) @@ -1296,7 +1296,7 @@ void Calendar::SetCurDate( const Date& rNewDate ) else if ( maCurDate > GetLastMonth() ) { Date aTempDate = GetLastMonth(); - long nDateOff = maCurDate-aTempDate; + tools::Long nDateOff = maCurDate-aTempDate; if ( nDateOff < 365 ) { Date aFirstDate = GetFirstMonth(); @@ -1385,8 +1385,8 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const if ( mbFormat || (rDate < maFirstDate) || (rDate > (maFirstDate+mnDayCount)) ) return aRect; - long nX; - long nY; + tools::Long nX; + tools::Long nY; sal_Int32 nDaysOff; sal_uInt16 nDayIndex; Date aDate = GetFirstMonth(); @@ -1433,10 +1433,10 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const } nY = 0; - for ( long i = 0; i < mnLines; i++ ) + for ( tools::Long i = 0; i < mnLines; i++ ) { nX = 0; - for ( long j = 0; j < mnMonthPerLine; j++ ) + for ( tools::Long j = 0; j < mnMonthPerLine; j++ ) { sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); @@ -1444,8 +1444,8 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const if ( (aDate.GetMonth() == rDate.GetMonth()) && (aDate.GetYear() == rDate.GetYear()) ) { - long nDayX = nX+mnDaysOffX; - long nDayY = nY+mnDaysOffY; + tools::Long nDayX = nX+mnDaysOffX; + tools::Long nDayY = nY+mnDaysOffY; nDayIndex = static_cast<sal_uInt16>(aDate.GetDayOfWeek()); nDayIndex = (nDayIndex+(7-static_cast<sal_uInt16>(ImplGetWeekStart()))) % 7; for ( sal_uInt16 nDay = 1; nDay <= nDaysInMonth; nDay++ ) @@ -1494,8 +1494,8 @@ void Calendar::EndSelection() Size Calendar::CalcWindowSizePixel() const { Size aSize; - long n99TextWidth = GetTextWidth( "99" ); - long nTextHeight = GetTextHeight(); + tools::Long n99TextWidth = GetTextWidth( "99" ); + tools::Long nTextHeight = GetTextHeight(); aSize.AdjustWidth((n99TextWidth+DAY_OFFX)*7); aSize.AdjustWidth(MONTH_BORDERX*2 ); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index b5b14d833d9d..188df87a4d9c 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -168,7 +168,7 @@ void ComboBox::ImplCalcEditHeight() aControlValue, aBoundRegion, aContentRegion ) ) { - const long nNCHeight = aBoundRegion.GetHeight(); + const tools::Long nNCHeight = aBoundRegion.GetHeight(); if (m_pImpl->m_nDDHeight < nNCHeight) m_pImpl->m_nDDHeight = sal::static_int_cast<sal_uInt16>(nNCHeight); } @@ -552,7 +552,7 @@ sal_uInt16 ComboBox::GetDropDownLineCount() const return nLines; } -void ComboBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, +void ComboBox::setPosSizePixel( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags ) { if( IsDropDownBox() && ( nFlags & PosSizeFlags::Size ) ) @@ -996,9 +996,9 @@ Size ComboBox::GetOptimalSize() const return CalcMinimumSize(); } -long ComboBox::getMaxWidthScrollBarAndDownButton() const +tools::Long ComboBox::getMaxWidthScrollBarAndDownButton() const { - long nButtonDownWidth = 0; + tools::Long nButtonDownWidth = 0; vcl::Window *pBorder = GetWindow( GetWindowType::Border ); ImplControlValue aControlValue; @@ -1013,7 +1013,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const nButtonDownWidth = aContent.getWidth(); } - long nScrollBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nScrollBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); return std::max(nScrollBarWidth, nButtonDownWidth); } @@ -1042,7 +1042,7 @@ Size ComboBox::CalcMinimumSize() const if (m_pImpl->m_nMaxWidthChars != -1) { - long nMaxWidth = m_pImpl->m_nMaxWidthChars * approximate_char_width(); + tools::Long nMaxWidth = m_pImpl->m_nMaxWidthChars * approximate_char_width(); aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); } @@ -1067,8 +1067,8 @@ Size ComboBox::CalcAdjustedSize( const Size& rPrefSize ) const aSz.AdjustHeight( -(nTop+nBottom) ); if ( !IsDropDownBox() ) { - long nEntryHeight = CalcBlockSize( 1, 1 ).Height(); - long nLines = aSz.Height() / nEntryHeight; + tools::Long nEntryHeight = CalcBlockSize( 1, 1 ).Height(); + tools::Long nLines = aSz.Height() / nEntryHeight; if ( nLines < 1 ) nLines = 1; aSz.setHeight( nLines * nEntryHeight ); @@ -1124,14 +1124,14 @@ Size ComboBox::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const return aSz; } -long ComboBox::GetDropDownEntryHeight() const +tools::Long ComboBox::GetDropDownEntryHeight() const { return m_pImpl->m_pImplLB->GetEntryHeight(); } void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { - long nCharWidth = GetTextWidth(OUString(u'x')); + tools::Long nCharWidth = GetTextWidth(OUString(u'x')); if ( !IsDropDownBox() ) { Size aOutSz = m_pImpl->m_pImplLB->GetMainWindow()->GetOutputSizePixel(); @@ -1182,9 +1182,9 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) // contents if ( !IsDropDownBox() ) { - long nOnePixel = GetDrawPixel( pDev, 1 ); - long nTextHeight = pDev->GetTextHeight(); - long nEditHeight = nTextHeight + 6*nOnePixel; + tools::Long nOnePixel = GetDrawPixel( pDev, 1 ); + tools::Long nTextHeight = pDev->GetTextHeight(); + tools::Long nEditHeight = nTextHeight + 6*nOnePixel; DrawTextFlags nTextStyle = DrawTextFlags::VCenter; // First, draw the edit part @@ -1404,13 +1404,13 @@ void ComboBox::SetBorderStyle( WindowBorderStyle nBorderStyle ) } } -long ComboBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const +tools::Long ComboBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const { if( !HasLayoutData() ) FillLayoutData(); // check whether rPoint fits at all - long nIndex = Control::GetIndexForPoint( rPoint ); + tools::Long nIndex = Control::GetIndexForPoint( rPoint ); if( nIndex != -1 ) { // point must be either in main list window @@ -1443,8 +1443,8 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds( { ComboBoxBounds aBounds; - long nTop = 0; - long nBottom = rOutSz.Height(); + tools::Long nTop = 0; + tools::Long nBottom = rOutSz.Height(); vcl::Window *pBorder = m_rThis.GetWindow( GetWindowType::Border ); ImplControlValue aControlValue; @@ -1483,7 +1483,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds( } else { - long nSBWidth = m_rThis.GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nSBWidth = m_rThis.GetSettings().GetStyleSettings().GetScrollBarSize(); nSBWidth = m_rThis.CalcZoom( nSBWidth ); aBounds.aSubEditSize = Size(rOutSz.Width() - nSBWidth, rOutSz.Height()); aBounds.aButtonPos = Point(rOutSz.Width() - nSBWidth, nTop); diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index dc8f2d7a9e85..779b90927317 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -102,22 +102,22 @@ ControlLayoutData::ControlLayoutData() : m_pParent( nullptr ) { } -tools::Rectangle ControlLayoutData::GetCharacterBounds( long nIndex ) const +tools::Rectangle ControlLayoutData::GetCharacterBounds( tools::Long nIndex ) const { - return (nIndex >= 0 && nIndex < static_cast<long>(m_aUnicodeBoundRects.size())) ? m_aUnicodeBoundRects[ nIndex ] : tools::Rectangle(); + return (nIndex >= 0 && nIndex < static_cast<tools::Long>(m_aUnicodeBoundRects.size())) ? m_aUnicodeBoundRects[ nIndex ] : tools::Rectangle(); } -tools::Rectangle Control::GetCharacterBounds( long nIndex ) const +tools::Rectangle Control::GetCharacterBounds( tools::Long nIndex ) const { if( !HasLayoutData() ) FillLayoutData(); return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetCharacterBounds( nIndex ) : tools::Rectangle(); } -long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const +tools::Long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const { - long nIndex = -1; - for( long i = m_aUnicodeBoundRects.size()-1; i >= 0; i-- ) + tools::Long nIndex = -1; + for( tools::Long i = m_aUnicodeBoundRects.size()-1; i >= 0; i-- ) { Point aTopLeft = m_aUnicodeBoundRects[i].TopLeft(); Point aBottomRight = m_aUnicodeBoundRects[i].BottomRight(); @@ -131,22 +131,22 @@ long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const return nIndex; } -long Control::GetIndexForPoint( const Point& rPoint ) const +tools::Long Control::GetIndexForPoint( const Point& rPoint ) const { if( ! HasLayoutData() ) FillLayoutData(); return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetIndexForPoint( rPoint ) : -1; } -long ControlLayoutData::GetLineCount() const +tools::Long ControlLayoutData::GetLineCount() const { - long nLines = m_aLineIndices.size(); + tools::Long nLines = m_aLineIndices.size(); if( nLines == 0 && !m_aDisplayText.isEmpty() ) nLines = 1; return nLines; } -Pair ControlLayoutData::GetLineStartEnd( long nLine ) const +Pair ControlLayoutData::GetLineStartEnd( tools::Long nLine ) const { Pair aPair( -1, -1 ); @@ -169,14 +169,14 @@ Pair ControlLayoutData::GetLineStartEnd( long nLine ) const return aPair; } -Pair Control::GetLineStartEnd( long nLine ) const +Pair Control::GetLineStartEnd( tools::Long nLine ) const { if( !HasLayoutData() ) FillLayoutData(); return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 ); } -long ControlLayoutData::ToRelativeLineIndex( long nIndex ) const +tools::Long ControlLayoutData::ToRelativeLineIndex( tools::Long nIndex ) const { // is the index sensible at all ? if( nIndex >= 0 && nIndex < m_aDisplayText.getLength() ) @@ -208,7 +208,7 @@ long ControlLayoutData::ToRelativeLineIndex( long nIndex ) const return nIndex; } -long Control::ToRelativeLineIndex( long nIndex ) const +tools::Long Control::ToRelativeLineIndex( tools::Long nIndex ) const { if( !HasLayoutData() ) FillLayoutData(); @@ -277,7 +277,7 @@ void Control::AppendLayoutData( const Control& rSubControl ) const if( !rSubControl.HasLayoutData() || rSubControl.mpControlData->mpLayoutData->m_aDisplayText.isEmpty() ) return; - long nCurrentIndex = mpControlData->mpLayoutData->m_aDisplayText.getLength(); + tools::Long nCurrentIndex = mpControlData->mpLayoutData->m_aDisplayText.getLength(); mpControlData->mpLayoutData->m_aDisplayText += rSubControl.mpControlData->mpLayoutData->m_aDisplayText; int nLines = rSubControl.mpControlData->mpLayoutData->m_aLineIndices.size(); int n; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index a2e3c497e5c7..18f4fb70ee66 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -398,21 +398,21 @@ void Edit::ApplySettings(vcl::RenderContext& rRenderContext) } } -long Edit::ImplGetExtraXOffset() const +tools::Long Edit::ImplGetExtraXOffset() const { // MT 09/2002: nExtraOffsetX should become a member, instead of checking every time, // but I need an incompatible update for this... // #94095# Use extra offset only when edit has a border - long nExtraOffset = 0; + tools::Long nExtraOffset = 0; if( ( GetStyle() & WB_BORDER ) || ( mbIsSubEdit && ( GetParent()->GetStyle() & WB_BORDER ) ) ) nExtraOffset = 2; return nExtraOffset; } -long Edit::ImplGetExtraYOffset() const +tools::Long Edit::ImplGetExtraYOffset() const { - long nExtraOffset = 0; + tools::Long nExtraOffset = 0; ControlType eCtrlType = ImplGetNativeControlType(); if (eCtrlType != ControlType::EditboxNoBorder) { @@ -452,7 +452,7 @@ void Edit::ImplInvalidateOrRepaint() Invalidate(); } -long Edit::ImplGetTextYPosition() const +tools::Long Edit::ImplGetTextYPosition() const { if ( GetStyle() & WB_TOP ) return ImplGetExtraXOffset(); @@ -471,9 +471,9 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl const OUString aText = ImplGetText(); const sal_Int32 nLen = aText.getLength(); - long nDXBuffer[256]; + tools::Long nDXBuffer[256]; std::unique_ptr<long[]> pDXBuffer; - long* pDX = nDXBuffer; + tools::Long* pDX = nDXBuffer; if (nLen) { @@ -486,7 +486,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl GetCaretPositions(aText, pDX, 0, nLen); } - long nTH = GetTextHeight(); + tools::Long nTH = GetTextHeight(); Point aPos(mnXOffset, ImplGetTextYPosition()); vcl::Cursor* pCursor = GetCursor(); @@ -976,7 +976,7 @@ ControlType Edit::ImplGetNativeControlType() const return nCtrl; } -void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle, long nXStart, long nXEnd ) +void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle, tools::Long nXStart, tools::Long nXEnd ) { /* * note: at this point the cursor must be switched off already @@ -1065,11 +1065,11 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) vcl::Cursor* pCursor = GetCursor(); OUString aText = ImplGetText(); - long nTextPos = 0; + tools::Long nTextPos = 0; - long nDXBuffer[256]; + tools::Long nDXBuffer[256]; std::unique_ptr<long[]> pDXBuffer; - long* pDX = nDXBuffer; + tools::Long* pDX = nDXBuffer; if( !aText.isEmpty() ) { @@ -1087,21 +1087,21 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) nTextPos = pDX[ 2*aText.getLength()-1 ]; } - long nCursorWidth = 0; + tools::Long nCursorWidth = 0; if ( !mbInsertMode && !maSelection.Len() && (maSelection.Max() < aText.getLength()) ) nCursorWidth = GetTextWidth(aText, maSelection.Max(), 1); - long nCursorPosX = nTextPos + mnXOffset + ImplGetExtraXOffset(); + tools::Long nCursorPosX = nTextPos + mnXOffset + ImplGetExtraXOffset(); // cursor should land in visible area const Size aOutSize = GetOutputSizePixel(); if ( (nCursorPosX < 0) || (nCursorPosX >= aOutSize.Width()) ) { - long nOldXOffset = mnXOffset; + tools::Long nOldXOffset = mnXOffset; if ( nCursorPosX < 0 ) { mnXOffset = - nTextPos; - long nMaxX = 0; + tools::Long nMaxX = 0; mnXOffset += aOutSize.Width() / 5; if ( mnXOffset > nMaxX ) mnXOffset = nMaxX; @@ -1112,7 +1112,7 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) // Something more? if ( (aOutSize.Width()-ImplGetExtraXOffset()) < nTextPos ) { - long nMaxNegX = (aOutSize.Width()-ImplGetExtraXOffset()) - GetTextWidth( aText ); + tools::Long nMaxNegX = (aOutSize.Width()-ImplGetExtraXOffset()) - GetTextWidth( aText ); mnXOffset -= aOutSize.Width() / 5; if ( mnXOffset < nMaxNegX ) // both negative... mnXOffset = nMaxNegX; @@ -1127,8 +1127,8 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) ImplInvalidateOrRepaint(); } - const long nTextHeight = GetTextHeight(); - const long nCursorPosY = ImplGetTextYPosition(); + const tools::Long nTextHeight = GetTextHeight(); + const tools::Long nCursorPosY = ImplGetTextYPosition(); if (pCursor) { pCursor->SetPos( Point( nCursorPosX, nCursorPosY ) ); @@ -1145,8 +1145,8 @@ void Edit::ImplAlign() return; } - long nTextWidth = GetTextWidth( ImplGetText() ); - long nOutWidth = GetOutputSizePixel().Width(); + tools::Long nTextWidth = GetTextWidth( ImplGetText() ); + tools::Long nOutWidth = GetOutputSizePixel().Width(); if ( mnAlign == EDIT_ALIGN_LEFT ) { @@ -1155,7 +1155,7 @@ void Edit::ImplAlign() } else if ( mnAlign == EDIT_ALIGN_RIGHT ) { - long nMinXOffset = nOutWidth - nTextWidth - 1 - ImplGetExtraXOffset(); + tools::Long nMinXOffset = nOutWidth - nTextWidth - 1 - ImplGetExtraXOffset(); bool bRTL = IsRTLEnabled(); if( mbIsSubEdit && GetParent() ) bRTL = GetParent()->IsRTLEnabled(); @@ -1191,9 +1191,9 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const sal_Int32 nIndex = EDIT_NOLIMIT; OUString aText = ImplGetText(); - long nDXBuffer[256]; + tools::Long nDXBuffer[256]; std::unique_ptr<long[]> pDXBuffer; - long* pDX = nDXBuffer; + tools::Long* pDX = nDXBuffer; if( o3tl::make_unsigned(2*aText.getLength()) > SAL_N_ELEMENTS(nDXBuffer) ) { pDXBuffer.reset(new long[2*(aText.getLength()+1)]); @@ -1201,7 +1201,7 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const } GetCaretPositions( aText, pDX, 0, aText.getLength() ); - long nX = rWindowPos.X() - mnXOffset - ImplGetExtraXOffset(); + tools::Long nX = rWindowPos.X() - mnXOffset - ImplGetExtraXOffset(); for (sal_Int32 i = 0; i < aText.getLength(); aText.iterateCodePoints(&i)) { if( (pDX[2*i] >= nX && pDX[2*i+1] <= nX) || @@ -1225,7 +1225,7 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const { nIndex = 0; sal_Int32 nFinalIndex = 0; - long nDiff = std::abs( pDX[0]-nX ); + tools::Long nDiff = std::abs( pDX[0]-nX ); sal_Int32 i = 0; if (!aText.isEmpty()) { @@ -1233,7 +1233,7 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const } while (i < aText.getLength()) { - long nNewDiff = std::abs( pDX[2*i]-nX ); + tools::Long nNewDiff = std::abs( pDX[2*i]-nX ); if( nNewDiff < nDiff ) { @@ -1786,8 +1786,8 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) } } - const long nOnePixel = GetDrawPixel( pDev, 1 ); - const long nOffX = 3*nOnePixel; + const tools::Long nOnePixel = GetDrawPixel( pDev, 1 ); + const tools::Long nOffX = 3*nOnePixel; DrawTextFlags nTextStyle = DrawTextFlags::VCenter; tools::Rectangle aTextRect( aPos, aSize ); @@ -1802,9 +1802,9 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) aTextRect.AdjustRight( -nOffX ); OUString aText = ImplGetText(); - long nTextHeight = pDev->GetTextHeight(); - long nTextWidth = pDev->GetTextWidth( aText ); - long nOffY = (aSize.Height() - nTextHeight) / 2; + tools::Long nTextHeight = pDev->GetTextHeight(); + tools::Long nTextWidth = pDev->GetTextWidth( aText ); + tools::Long nOffY = (aSize.Height() - nTextHeight) / 2; // Clipping? if ( (nOffY < 0) || @@ -2130,9 +2130,9 @@ void Edit::Command( const CommandEvent& rCEvt ) if (mpIMEInfos && mpIMEInfos->nLen > 0) { OUString aText = ImplGetText(); - long nDXBuffer[256]; + tools::Long nDXBuffer[256]; std::unique_ptr<long[]> pDXBuffer; - long* pDX = nDXBuffer; + tools::Long* pDX = nDXBuffer; if( !aText.isEmpty() ) { @@ -2144,7 +2144,7 @@ void Edit::Command( const CommandEvent& rCEvt ) GetCaretPositions( aText, pDX, 0, aText.getLength() ); } - long nTH = GetTextHeight(); + tools::Long nTH = GetTextHeight(); Point aPos( mnXOffset, ImplGetTextYPosition() ); std::unique_ptr<tools::Rectangle[]> aRects(new tools::Rectangle[ mpIMEInfos->nLen ]); @@ -2264,8 +2264,8 @@ void Edit::ImplShowDDCursor() { if (!mpDDInfo->bVisCursor) { - long nTextWidth = GetTextWidth( maText.toString(), 0, mpDDInfo->nDropPos ); - long nTextHeight = GetTextHeight(); + tools::Long nTextWidth = GetTextWidth( maText.toString(), 0, mpDDInfo->nDropPos ); + tools::Long nTextHeight = GetTextHeight(); tools::Rectangle aCursorRect( Point( nTextWidth + mnXOffset, (GetOutputSize().Height()-nTextHeight)/2 ), Size( 2, nTextHeight ) ); mpDDInfo->aCursor.SetWindow( this ); mpDDInfo->aCursor.SetPos( aCursorRect.TopLeft() ); @@ -2444,8 +2444,8 @@ void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint ) ImplShowCursor(); bool bCaret = false, bSelection = false; - long nB=aNew.Max(), nA=aNew.Min(),oB=aTemp.Max(), oA=aTemp.Min(); - long nGap = nB-nA, oGap = oB-oA; + tools::Long nB=aNew.Max(), nA=aNew.Min(),oB=aTemp.Max(), oA=aTemp.Min(); + tools::Long nGap = nB-nA, oGap = oB-oA; if (nB != oB) bCaret = true; if (nGap != 0 || oGap != 0) @@ -2777,7 +2777,7 @@ void Edit::dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent& rDSDE { if ( aSel.Max() > mpDDInfo->nDropPos ) { - long nLen = aSel.Len(); + tools::Long nLen = aSel.Len(); aSel.Min() += nLen; aSel.Max() += nLen; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 2f7f08f40f2c..84844174e0af 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1001,7 +1001,7 @@ mm/100 mm cm m km twip point pica inch foot mile #undef M #undef K -static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, long& nDecDigits ) +static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, tools::Long& nDecDigits ) { switch( meUnit ) { @@ -1076,7 +1076,7 @@ bool checkConversionUnits(MapUnit eInUnit, FieldUnit eOutUnit) && eInUnit != MapUnit::MapRelative; } -double convertValue( double nValue, long nDigits, FieldUnit eInUnit, FieldUnit eOutUnit ) +double convertValue( double nValue, tools::Long nDigits, FieldUnit eInUnit, FieldUnit eOutUnit ) { if ( nDigits < 0 ) { @@ -1124,7 +1124,7 @@ namespace vcl return nValue; } - long nDecDigits = nDigits; + tools::Long nDecDigits = nDigits; FieldUnit eFieldUnit = ImplMap2FieldUnit( eInUnit, nDecDigits ); // Avoid sal_Int64 <-> double conversion issues if possible: @@ -1201,7 +1201,7 @@ namespace vcl return nValue; } - long nDecDigits = nDigits; + tools::Long nDecDigits = nDigits; FieldUnit eFieldUnit = ImplMap2FieldUnit( eInUnit, nDecDigits ); return convertValue(nValue, nDecDigits, eFieldUnit, eOutUnit); @@ -1226,7 +1226,7 @@ namespace vcl return nValue; } - long nDecDigits = nDigits; + tools::Long nDecDigits = nDigits; FieldUnit eFieldUnit = ImplMap2FieldUnit( eOutUnit, nDecDigits ); if ( nDecDigits < 0 ) diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 91e001ac9bc9..51688a092564 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -46,8 +46,8 @@ constexpr auto FIXEDIMAGE_VIEW_STYLE = WB_3DLOOK | static Point ImplCalcPos( WinBits nStyle, const Point& rPos, const Size& rObjSize, const Size& rWinSize ) { - long nX; - long nY; + tools::Long nX; + tools::Long nY; if ( nStyle & WB_LEFT ) nX = 0; @@ -296,7 +296,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt ) } } -Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth) +Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, tools::Long nMaxWidth) { DrawTextFlags nStyle = ImplGetTextStyle( pControl->GetStyle() ); if ( !( pControl->GetStyle() & WB_NOLABEL ) ) @@ -306,7 +306,7 @@ Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, rTxt, nStyle).GetSize(); } -Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth ) +Size FixedText::CalcMinimumTextSize( Control const *pControl, tools::Long nMaxWidth ) { Size aSize = getTextDimensions(pControl, pControl->GetText(), nMaxWidth); @@ -322,7 +322,7 @@ Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth ) return aSize; } -Size FixedText::CalcMinimumSize( long nMaxWidth ) const +Size FixedText::CalcMinimumSize( tools::Long nMaxWidth ) const { return CalcWindowSize( CalcMinimumTextSize ( this, nMaxWidth ) ); } @@ -493,18 +493,18 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext) { if (nWinStyle & WB_VERT) { - long nX = (aOutSize.Width() - 1) / 2; + tools::Long nX = (aOutSize.Width() - 1) / 2; aDecoView.DrawSeparator(Point(nX, 0), Point(nX, aOutSize.Height() - 1)); } else { - long nY = (aOutSize.Height() - 1) / 2; + tools::Long nY = (aOutSize.Height() - 1) / 2; aDecoView.DrawSeparator(Point(0, nY), Point(aOutSize.Width() - 1, nY), false); } } else if (nWinStyle & WB_VERT) { - long nWidth = rRenderContext.GetTextWidth(aText); + tools::Long nWidth = rRenderContext.GetTextWidth(aText); rRenderContext.Push(PushFlags::FONT); vcl::Font aFont(rRenderContext.GetFont()); aFont.SetOrientation(900); @@ -540,7 +540,7 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext) aRect = DrawControlText(*this, aRect, aText, nStyle, nullptr, nullptr); - long nTop = aRect.Top() + ((aRect.GetHeight() - 1) / 2); + tools::Long nTop = aRect.Top() + ((aRect.GetHeight() - 1) / 2); aDecoView.DrawSeparator(Point(aRect.Right() + FIXEDLINE_TEXT_BORDER, nTop), Point(aOutSize.Width() - 1, nTop), false); if (aRect.Left() > FIXEDLINE_TEXT_BORDER) aDecoView.DrawSeparator(Point(0, nTop), Point(aRect.Left() - FIXEDLINE_TEXT_BORDER, nTop), false); diff --git a/vcl/source/control/hyperlabel.cxx b/vcl/source/control/hyperlabel.cxx index f42debe51ee2..d3afea1ce848 100644 --- a/vcl/source/control/hyperlabel.cxx +++ b/vcl/source/control/hyperlabel.cxx @@ -53,7 +53,7 @@ namespace vcl implInit(); } - Size const & HyperLabel::CalcMinimumSize( long nMaxWidth ) const + Size const & HyperLabel::CalcMinimumSize( tools::Long nMaxWidth ) const { m_pImpl->m_aMinSize = FixedText::CalcMinimumSize( nMaxWidth ); // the MinimumSize is used to size the FocusRectangle diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx index 4ecda5b1ee99..73094dfcc454 100644 --- a/vcl/source/control/imgctrl.cxx +++ b/vcl/source/control/imgctrl.cxx @@ -54,7 +54,7 @@ namespace const double nRatioY = 1.0 * aPaintSize.Height() / _rBitmapSize.Height(); const double nRatioMin = ::std::min( nRatioX, nRatioY ); - return Size( long( _rBitmapSize.Width() * nRatioMin ), long( _rBitmapSize.Height() * nRatioMin ) ); + return Size( tools::Long( _rBitmapSize.Width() * nRatioMin ), tools::Long( _rBitmapSize.Height() * nRatioMin ) ); } Point lcl_centerWithin( const tools::Rectangle& _rArea, const Size& _rObjectSize ) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 5c23cee3c0d1..8e63a555b6b9 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -127,12 +127,12 @@ class SvxIconChoiceCtrl_Impl VclPtr<SvtIconChoiceCtrl> pView; std::unique_ptr<IcnCursor_Impl> pImpCursor; std::unique_ptr<IcnGridMap_Impl> pGridMap; - long nMaxVirtWidth; // max. width aVirtOutputSize for ALIGN_TOP - long nMaxVirtHeight; // max. height aVirtOutputSize for ALIGN_LEFT + tools::Long nMaxVirtWidth; // max. width aVirtOutputSize for ALIGN_TOP + tools::Long nMaxVirtHeight; // max. height aVirtOutputSize for ALIGN_LEFT std::vector< SvxIconChoiceCtrlEntry* > maZOrderList; std::unique_ptr<SvxIconChoiceCtrlColumnInfoMap> m_pColumns; WinBits nWinBits; - long nMaxBoundHeight; // height of highest BoundRects + tools::Long nMaxBoundHeight; // height of highest BoundRects IconChoiceFlags nFlags; DrawTextFlags nCurTextDrawFlags; ImplSVEvent * nUserEventAdjustScrBars; @@ -168,12 +168,12 @@ class SvxIconChoiceCtrl_Impl DECL_LINK( CallSelectHdlHdl, Timer*, void ); void AdjustScrollBars(); - void PositionScrollBars( long nRealWidth, long nRealHeight ); - static long GetScrollBarPageSize( long nVisibleRange ) + void PositionScrollBars( tools::Long nRealWidth, tools::Long nRealHeight ); + static tools::Long GetScrollBarPageSize( tools::Long nVisibleRange ) { return ((nVisibleRange*75)/100); } - long GetScrollBarLineSize() const + tools::Long GetScrollBarLineSize() const { return nMaxBoundHeight / 2; } @@ -244,10 +244,10 @@ class SvxIconChoiceCtrl_Impl public: - long nGridDX; - long nGridDY; - long nHorSBarHeight; - long nVerSBarWidth; + tools::Long nGridDX; + tools::Long nGridDY; + tools::Long nHorSBarHeight; + tools::Long nVerSBarWidth; SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle ); ~SvxIconChoiceCtrl_Impl(); @@ -301,8 +301,8 @@ public: void Arrange( bool bKeepPredecessors, - long nSetMaxVirtWidth, - long nSetMaxVirtHeight + tools::Long nSetMaxVirtWidth, + tools::Long nSetMaxVirtHeight ); tools::Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* ); @@ -313,8 +313,8 @@ public: const OUString* pStr = nullptr ); - long CalcBoundingWidth() const; - long CalcBoundingHeight() const; + tools::Long CalcBoundingWidth() const; + tools::Long CalcBoundingHeight() const; Size CalcBoundingSize() const; void FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry ); void SetBoundingRect_Impl( @@ -346,7 +346,7 @@ public: sal_Int32 GetSelectionCount() const; void SetGrid( const Size& ); Size GetMinGrid() const; - void Scroll( long nDeltaX, long nDeltaY ); + void Scroll( tools::Long nDeltaX, tools::Long nDeltaY ); const Size& GetItemSize( IcnViewFieldType ) const; void HideDDIcon(); @@ -417,8 +417,8 @@ class IcnCursor_Impl SvxIconChoiceCtrl_Impl* pView; std::unique_ptr<IconChoiceMap> xColumns; std::unique_ptr<IconChoiceMap> xRows; - long nCols; - long nRows; + tools::Long nCols; + tools::Long nRows; short nDeltaWidth; short nDeltaHeight; SvxIconChoiceCtrlEntry* pCurEntry; @@ -428,7 +428,7 @@ class IcnCursor_Impl sal_uInt16 GetSortListPos( SvxIconChoiceCtrlEntryPtrVec& rList, - long nValue, + tools::Long nValue, bool bVertical); SvxIconChoiceCtrlEntry* SearchCol( sal_uInt16 nCol, diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 4410d7241378..bcef44294468 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -366,8 +366,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const tools::Rectangle& rRect ) { - long nHeightOffs = 0; - long nWidthOffs = 0; + tools::Long nHeightOffs = 0; + tools::Long nWidthOffs = 0; if( aVirtOutputSize.Width() < (rRect.Right()+LROFFS_WINBORDER) ) nWidthOffs = (rRect.Right()+LROFFS_WINBORDER) - aVirtOutputSize.Width(); @@ -434,7 +434,7 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors() } } -void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight ) +void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, tools::Long nSetMaxVirtWidth, tools::Long nSetMaxVirtHeight ) { if ( nSetMaxVirtWidth != 0 ) nMaxVirtWidth = nSetMaxVirtWidth; @@ -1043,7 +1043,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) } // recalculate TopLeft of scrollbars (but not their sizes!) -void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeight ) +void SvxIconChoiceCtrl_Impl::PositionScrollBars( tools::Long nRealWidth, tools::Long nRealHeight ) { // horizontal scrollbar Point aPos( 0, nRealHeight ); @@ -1064,25 +1064,25 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig void SvxIconChoiceCtrl_Impl::AdjustScrollBars() { - long nVirtHeight = aVirtOutputSize.Height(); - long nVirtWidth = aVirtOutputSize.Width(); + tools::Long nVirtHeight = aVirtOutputSize.Height(); + tools::Long nVirtWidth = aVirtOutputSize.Width(); Size aOSize( pView->Control::GetOutputSizePixel() ); - long nRealHeight = aOSize.Height(); - long nRealWidth = aOSize.Width(); + tools::Long nRealHeight = aOSize.Height(); + tools::Long nRealWidth = aOSize.Width(); PositionScrollBars( nRealWidth, nRealHeight ); const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); - long nVisibleWidth; + tools::Long nVisibleWidth; if( nRealWidth > nVirtWidth ) nVisibleWidth = nVirtWidth + aOrigin.X(); else nVisibleWidth = nRealWidth; - long nVisibleHeight; + tools::Long nVisibleHeight; if( nRealHeight > nVirtHeight ) nVisibleHeight = nVirtHeight + aOrigin.Y(); else @@ -1134,7 +1134,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars() } // size vertical scrollbar - long nThumb = aVerSBar->GetThumbPos(); + tools::Long nThumb = aVerSBar->GetThumbPos(); Size aSize( nVerSBarWidth, nRealHeight ); aSize.AdjustHeight(2 ); if( aSize != aVerSBar->GetSizePixel() ) @@ -1219,13 +1219,13 @@ bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar() Point aOrigin( rMapMode.GetOrigin() ); if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() ) { - long nWidth = aOutputSize.Width(); + tools::Long nWidth = aOutputSize.Width(); const size_t nCount = maZOrderList.size(); - long nMostRight = 0; + tools::Long nMostRight = 0; for( size_t nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = maZOrderList[ nCur ]; - long nRight = GetEntryBoundRect(pEntry).Right(); + tools::Long nRight = GetEntryBoundRect(pEntry).Right(); if( nRight > nWidth ) return false; if( nRight > nMostRight ) @@ -1257,13 +1257,13 @@ bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() Point aOrigin( rMapMode.GetOrigin() ); if(!( nWinBits & WB_VSCROLL) && !aOrigin.Y() ) { - long nDeepest = 0; - long nHeight = aOutputSize.Height(); + tools::Long nDeepest = 0; + tools::Long nHeight = aOutputSize.Height(); const size_t nCount = maZOrderList.size(); for( size_t nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = maZOrderList[ nCur ]; - long nBottom = GetEntryBoundRect(pEntry).Bottom(); + tools::Long nBottom = GetEntryBoundRect(pEntry).Bottom(); if( nBottom > nHeight ) return false; if( nBottom > nDeepest ) @@ -1620,8 +1620,8 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* p Size aTextSize( aTextRect.GetSize() ); Point aPos( aBound.TopLeft() ); - long nBoundWidth = aBound.GetWidth(); - long nBoundHeight = aBound.GetHeight(); + tools::Long nBoundWidth = aBound.GetWidth(); + tools::Long nBoundHeight = aBound.GetHeight(); switch( nWinBits & VIEWMODE_MASK ) { @@ -1642,10 +1642,10 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* p } -long SvxIconChoiceCtrl_Impl::CalcBoundingWidth() const +tools::Long SvxIconChoiceCtrl_Impl::CalcBoundingWidth() const { - long nStringWidth = GetItemSize( IcnViewFieldType::Text ).Width(); - long nWidth = 0; + tools::Long nStringWidth = GetItemSize( IcnViewFieldType::Text ).Width(); + tools::Long nWidth = 0; switch( nWinBits & VIEWMODE_MASK ) { @@ -1663,10 +1663,10 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingWidth() const return nWidth; } -long SvxIconChoiceCtrl_Impl::CalcBoundingHeight() const +tools::Long SvxIconChoiceCtrl_Impl::CalcBoundingHeight() const { - long nStringHeight = GetItemSize(IcnViewFieldType::Text).Height(); - long nHeight = 0; + tools::Long nStringHeight = GetItemSize(IcnViewFieldType::Text).Height(); + tools::Long nHeight = 0; switch( nWinBits & VIEWMODE_MASK ) { @@ -1823,7 +1823,7 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) bool bHor = aDocSize.Width() > aVisSize.Width(); bool bVer = aDocSize.Height() > aVisSize.Height(); - long nScrollDX = 0, nScrollDY = 0; + tools::Long nScrollDX = 0, nScrollDY = 0; switch( rCmd.GetCommand() ) { @@ -1857,7 +1857,7 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) } else { - nScrollDY = pData->GetNotchDelta() * static_cast<long>(nScrollLines); + nScrollDY = pData->GetNotchDelta() * static_cast<tools::Long>(nScrollLines); nScrollDY *= GetScrollBarLineSize(); } } @@ -1943,7 +1943,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS if( aOutputArea.IsInside( aVirtRect ) ) return; // is already visible - long nDy; + tools::Long nDy; if( aVirtRect.Top() < aOutputArea.Top() ) { // scroll up (nDy < 0) @@ -1957,7 +1957,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS else nDy = 0; - long nDx; + tools::Long nDx; if( aVirtRect.Left() < aOutputArea.Left() ) { // scroll to the left (nDx < 0) @@ -2133,7 +2133,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtr aBoundRect.AdjustRight( -(LROFFS_BOUND) ); if( aBoundRect.Left() > aBoundRect.Right() ) aBoundRect.SetLeft( aBoundRect.Right() ); - long nHeight = aBoundRect.GetSize().Height(); + tools::Long nHeight = aBoundRect.GetSize().Height(); nHeight = nHeight - aDefaultTextSize.Height(); nHeight /= 2; aBoundRect.AdjustTop(nHeight ); @@ -2144,20 +2144,20 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtr void SvxIconChoiceCtrl_Impl::SetDefaultTextSize() { - long nDY = nGridDY; + tools::Long nDY = nGridDY; nDY -= aImageSize.Height(); nDY -= VER_DIST_BMP_STRING; nDY -= 2 * TBOFFS_BOUND; if (nDY <= 0) nDY = 2; - long nDX = nGridDX; + tools::Long nDX = nGridDX; nDX -= 2 * LROFFS_BOUND; nDX -= 2; if (nDX <= 0) nDX = 2; - long nHeight = pView->GetTextHeight(); + tools::Long nHeight = pView->GetTextHeight(); if (nDY < nHeight) nDY = nHeight; if(pView->GetDPIScaleFactor() > 1) @@ -2175,7 +2175,7 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const if( nWinBits & WB_ICON ) { // center horizontally - long nBorder = pEntry->aGridRect.GetWidth() - aSize.Width(); + tools::Long nBorder = pEntry->aGridRect.GetWidth() - aSize.Width(); pEntry->aRect.AdjustLeft(nBorder / 2 ); pEntry->aRect.AdjustRight( -(nBorder / 2) ); } @@ -2187,7 +2187,7 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const // The deltas are the offsets by which the view is moved on the document. // left, up: offsets < 0 // right, down: offsets > 0 -void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY ) +void SvxIconChoiceCtrl_Impl::Scroll( tools::Long nDeltaX, tools::Long nDeltaY ) { const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); @@ -2222,7 +2222,7 @@ static tools::Rectangle GetHotSpot( const tools::Rectangle& rRect ) tools::Rectangle aResult( rRect ); aResult.Justify(); Size aSize( rRect.GetSize() ); - long nDelta = aSize.Width() / 4; + tools::Long nDelta = aSize.Width() / 4; aResult.AdjustLeft(nDelta ); aResult.AdjustRight( -nDelta ); nDelta = aSize.Height() / 4; @@ -2621,7 +2621,7 @@ void SvxIconChoiceCtrl_Impl::InitSettings() pView->SetBackground( rStyleSettings.GetFieldColor()); - long nScrBarSize = rStyleSettings.GetScrollBarSize(); + tools::Long nScrBarSize = rStyleSettings.GetScrollBarSize(); if( nScrBarSize == nHorSBarHeight && nScrBarSize == nVerSBarWidth ) return; @@ -2751,16 +2751,16 @@ sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const Point aPos( rPos ); aPos.AdjustX( -(LROFFS_WINBORDER) ); aPos.AdjustY( -(TBOFFS_WINBORDER) ); - long nMaxCol = aVirtOutputSize.Width() / nGridDX; + tools::Long nMaxCol = aVirtOutputSize.Width() / nGridDX; if( nMaxCol ) nMaxCol--; - long nGridX = aPos.X() / nGridDX; + tools::Long nGridX = aPos.X() / nGridDX; if( nGridX > nMaxCol ) nGridX = nMaxCol; - long nGridY = aPos.Y() / nGridDY; - long nGridsX = aOutputSize.Width() / nGridDX; + tools::Long nGridY = aPos.Y() / nGridDY; + tools::Long nGridsX = aOutputSize.Width() / nGridDX; sal_uLong nGrid = (nGridY * nGridsX) + nGridX; - long nMiddle = (nGridX * nGridDX) + (nGridDX / 2); + tools::Long nMiddle = (nGridX * nGridDX) + (nGridDX / 2); if( rPos.X() < nMiddle ) { if( !nGrid ) @@ -2845,7 +2845,7 @@ const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderContext, const tools::Rectangle& rBmpRect) { tools::Rectangle aBmpRect(rBmpRect); - long nBorder = 2; + tools::Long nBorder = 2; if (aImageSize.Width() < 32) nBorder = 1; aBmpRect.AdjustRight(nBorder ); diff --git a/vcl/source/control/imivctl2.cxx b/vcl/source/control/imivctl2.cxx index 284921f8f62e..5b0d2d8adb49 100644 --- a/vcl/source/control/imivctl2.cxx +++ b/vcl/source/control/imivctl2.cxx @@ -34,7 +34,7 @@ IcnCursor_Impl::~IcnCursor_Impl() { } -sal_uInt16 IcnCursor_Impl::GetSortListPos( SvxIconChoiceCtrlEntryPtrVec& rList, long nValue, +sal_uInt16 IcnCursor_Impl::GetSortListPos( SvxIconChoiceCtrlEntryPtrVec& rList, tools::Long nValue, bool bVertical ) { sal_uInt16 nCount = rList.size(); @@ -42,11 +42,11 @@ sal_uInt16 IcnCursor_Impl::GetSortListPos( SvxIconChoiceCtrlEntryPtrVec& rList, return 0; sal_uInt16 nCurPos = 0; - long nPrevValue = LONG_MIN; + tools::Long nPrevValue = LONG_MIN; while( nCount ) { const tools::Rectangle& rRect = pView->GetEntryBoundRect( rList[nCurPos] ); - long nCurValue; + tools::Long nCurValue; if( bVertical ) nCurValue = rRect.Top(); else @@ -162,7 +162,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol, sal_uInt16 nT if( nTop > nBottom ) std::swap(nTop, nBottom); - long nMinDistance = LONG_MAX; + tools::Long nMinDistance = LONG_MAX; SvxIconChoiceCtrlEntry* pResult = nullptr; for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { @@ -173,7 +173,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol, sal_uInt16 nT if( nY >= nTop && nY <= nBottom ) { const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); - long nDistance = rRect.Top() - rRefRect.Top(); + tools::Long nDistance = rRect.Top() - rRefRect.Top(); if( nDistance < 0 ) nDistance *= -1; if( nDistance && nDistance < nMinDistance ) @@ -238,7 +238,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow, sal_uInt16 nL if( nRight < nLeft ) std::swap(nRight, nLeft); - long nMinDistance = LONG_MAX; + tools::Long nMinDistance = LONG_MAX; SvxIconChoiceCtrlEntry* pResult = nullptr; for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { @@ -249,7 +249,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow, sal_uInt16 nL if( nX >= nLeft && nX <= nRight ) { const tools::Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); - long nDistance = rRect.Left() - rRefRect.Left(); + tools::Long nDistance = rRect.Left() - rRefRect.Left(); if( nDistance < 0 ) nDistance *= -1; if( nDistance && nDistance < nMinDistance ) @@ -299,9 +299,9 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt if( pResult ) return pResult; - long nCurCol = nX; + tools::Long nCurCol = nX; - long nColOffs, nLastCol; + tools::Long nColOffs, nLastCol; if( bRight ) { nColOffs = 1; @@ -333,15 +333,15 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS { if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) ) { - const long nPos = static_cast<long>(pView->GetEntryListPos( pStart )); - long nEntriesInView = pView->aOutputSize.Height() / pView->nGridDY; + const tools::Long nPos = static_cast<tools::Long>(pView->GetEntryListPos( pStart )); + tools::Long nEntriesInView = pView->aOutputSize.Height() / pView->nGridDY; nEntriesInView *= ((pView->aOutputSize.Width()+(pView->nGridDX/2)) / pView->nGridDX ); - long nNewPos = nPos; + tools::Long nNewPos = nPos; if( bDown ) { nNewPos += nEntriesInView; - if( nNewPos >= static_cast<long>(pView->maEntries.size()) ) + if( nNewPos >= static_cast<tools::Long>(pView->maEntries.size()) ) nNewPos = pView->maEntries.size() - 1; } else @@ -354,7 +354,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS return pView->maEntries[ static_cast<size_t>(nNewPos) ].get(); return nullptr; } - long nOpt = pView->GetEntryBoundRect( pStart ).Top(); + tools::Long nOpt = pView->GetEntryBoundRect( pStart ).Top(); if( bDown ) { nOpt += pView->aOutputSize.Height(); @@ -368,14 +368,14 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS if( nOpt < 0 ) nOpt = 0; - long nPrevErr = LONG_MAX; + tools::Long nPrevErr = LONG_MAX; SvxIconChoiceCtrlEntry* pPrev = pStart; SvxIconChoiceCtrlEntry* pNext = GoUpDown( pStart, bDown ); while( pNext ) { - long nCur = pView->GetEntryBoundRect( pNext ).Top(); - long nErr = nOpt - nCur; + tools::Long nCur = pView->GetEntryBoundRect( pNext ).Top(); + tools::Long nErr = nOpt - nCur; if( nErr < 0 ) nErr *= -1; if( nErr > nPrevErr ) @@ -418,9 +418,9 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE if( pResult ) return pResult; - long nCurRow = nY; + tools::Long nCurRow = nY; - long nRowOffs, nLastRow; + tools::Long nRowOffs, nLastRow; if( bDown ) { nRowOffs = 1; @@ -529,7 +529,7 @@ void IcnGridMap_Impl::Create_Impl() void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const { - long nX, nY; + tools::Long nX, nY; if( _pView->nWinBits & WB_ALIGN_TOP ) { // The view grows in vertical direction. Its max. width is _pView->nMaxVirtWidth @@ -557,8 +557,8 @@ void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const if( !nY ) nY = DEFAULT_MAX_VIRT_HEIGHT; - long nDX = nX / _pView->nGridDX; - long nDY = nY / _pView->nGridDY; + tools::Long nDX = nX / _pView->nGridDX; + tools::Long nDY = nY / _pView->nGridDY; if( !nDX ) nDX++; @@ -582,8 +582,8 @@ GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos ) { Create(); - long nX = rDocPos.X(); - long nY = rDocPos.Y(); + tools::Long nX = rDocPos.X(); + tools::Long nY = rDocPos.Y(); nX -= LROFFS_WINBORDER; nY -= TBOFFS_WINBORDER; nX /= _pView->nGridDX; @@ -606,8 +606,8 @@ tools::Rectangle IcnGridMap_Impl::GetGridRect( GridId nId ) Create(); sal_uInt16 nGridX, nGridY; GetGridCoord( nId, nGridX, nGridY ); - const long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER; - const long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER; + const tools::Long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER; + const tools::Long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER; return tools::Rectangle( nLeft, nTop, nLeft + _pView->nGridDX, @@ -663,9 +663,9 @@ void IcnGridMap_Impl::Clear() sal_uLong IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, sal_uInt16 nDY) { - long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX; + tools::Long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX; if( ndx < 0 ) ndx *= -1; - long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY; + tools::Long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY; if( ndy < 0 ) ndy *= -1; return static_cast<sal_uLong>(ndx * ndy); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 22d26a3ef076..f9ba50513178 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -47,7 +47,7 @@ using namespace ::com::sun::star; -constexpr long gnBorder = 1; +constexpr tools::Long gnBorder = 1; void ImplInitDropDownButton( PushButton* pButton ) { @@ -276,9 +276,9 @@ sal_Int32 ImplEntryList::FindMatchingEntry( const OUString& rStr, sal_Int32 nSta return nPos; } -long ImplEntryList::GetAddedHeight( sal_Int32 i_nEndIndex, sal_Int32 i_nBeginIndex ) const +tools::Long ImplEntryList::GetAddedHeight( sal_Int32 i_nEndIndex, sal_Int32 i_nBeginIndex ) const { - long nHeight = 0; + tools::Long nHeight = 0; sal_Int32 nStart = std::min(i_nEndIndex, i_nBeginIndex); sal_Int32 nStop = std::max(i_nEndIndex, i_nBeginIndex); sal_Int32 nEntryCount = GetEntryCount(); @@ -295,7 +295,7 @@ long ImplEntryList::GetAddedHeight( sal_Int32 i_nEndIndex, sal_Int32 i_nBeginInd sal_Int32 nIndex = nStart; while( nIndex != LISTBOX_ENTRY_NOTFOUND && nIndex < nStop ) { - long nPosHeight = GetEntryPtr( nIndex )->getHeightWithMargin(); + tools::Long nPosHeight = GetEntryPtr( nIndex )->getHeightWithMargin(); if (nHeight > ::std::numeric_limits<long>::max() - nPosHeight) { SAL_WARN( "vcl", "ImplEntryList::GetAddedHeight: truncated"); @@ -310,7 +310,7 @@ long ImplEntryList::GetAddedHeight( sal_Int32 i_nEndIndex, sal_Int32 i_nBeginInd return i_nEndIndex > i_nBeginIndex ? nHeight : -nHeight; } -long ImplEntryList::GetEntryHeight( sal_Int32 nPos ) const +tools::Long ImplEntryList::GetEntryHeight( sal_Int32 nPos ) const { ImplEntryType* pImplEntry = GetEntry( nPos ); return pImplEntry ? pImplEntry->getHeightWithMargin() : 0; @@ -567,16 +567,16 @@ struct ImplEntryMetrics { bool bText; bool bImage; - long nEntryWidth; - long nEntryHeight; - long nTextWidth; - long nImgWidth; - long nImgHeight; + tools::Long nEntryWidth; + tools::Long nEntryHeight; + tools::Long nTextWidth; + tools::Long nImgWidth; + tools::Long nImgHeight; }; } -long ImplEntryType::getHeightWithMargin() const +tools::Long ImplEntryType::getHeightWithMargin() const { return mnHeight + ImplGetSVData()->maNWFData.mnListBoxEntryMargin; } @@ -780,13 +780,13 @@ void ImplListBoxWindow::ImplHideFocusRect() sal_Int32 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const { - long nY = gnBorder; + tools::Long nY = gnBorder; sal_Int32 nSelect = mnTop; const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nSelect ); while (pEntry) { - long nEntryHeight = pEntry->getHeightWithMargin(); + tools::Long nEntryHeight = pEntry->getHeightWithMargin(); if (rPoint.Y() <= nEntryHeight + nY) break; nY += nEntryHeight; @@ -814,18 +814,18 @@ bool ImplListBoxWindow::IsVisible( sal_Int32 i_nEntry ) const return bRet; } -long ImplListBoxWindow::GetEntryHeightWithMargin() const +tools::Long ImplListBoxWindow::GetEntryHeightWithMargin() const { - long nMargin = ImplGetSVData()->maNWFData.mnListBoxEntryMargin; + tools::Long nMargin = ImplGetSVData()->maNWFData.mnListBoxEntryMargin; return mnMaxHeight + nMargin; } sal_Int32 ImplListBoxWindow::GetLastVisibleEntry() const { sal_Int32 nPos = mnTop; - long nWindowHeight = GetSizePixel().Height(); + tools::Long nWindowHeight = GetSizePixel().Height(); sal_Int32 nCount = mpEntryList->GetEntryCount(); - long nDiff; + tools::Long nDiff; for( nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff = mpEntryList->GetAddedHeight( nPos, mnTop ) ) nPos++; @@ -1104,7 +1104,7 @@ bool ImplListBoxWindow::SelectEntries( sal_Int32 nSelect, LB_EVENT_TYPE eLET, bo if( bFocusChanged ) { - long nHeightDiff = mpEntryList->GetAddedHeight( nSelect, mnTop ); + tools::Long nHeightDiff = mpEntryList->GetAddedHeight( nSelect, mnTop ); maFocusRect.SetPos( Point( 0, nHeightDiff ) ); Size aSz( maFocusRect.GetWidth(), mpEntryList->GetEntryHeight( nSelect ) ); @@ -1143,7 +1143,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) mbTrackingSelect = false; if ( mnTrackingSaveSelection != LISTBOX_ENTRY_NOTFOUND ) { - long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop ); + tools::Long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop ); maFocusRect.SetPos( Point( 0, nHeightDiff ) ); Size aSz( maFocusRect.GetWidth(), mpEntryList->GetEntryHeight( mnCurrentPos ) ); @@ -1231,7 +1231,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) } else { - long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop ); + tools::Long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop ); maFocusRect.SetPos( Point( 0, nHeightDiff ) ); Size aSz( maFocusRect.GetWidth(), mpEntryList->GetEntryHeight( mnCurrentPos ) ); maFocusRect.SetSize( aSz ); @@ -1369,8 +1369,8 @@ bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt ) nTmp += mnTop - 1; if( mnCurrentPos == nTmp && mnCurrentPos != nCount - 1 ) { - long nTmp2 = std::min( static_cast<long>(nCount-nCurVis), static_cast<long>(static_cast<long>(mnTop)+static_cast<long>(nCurVis)-1) ); - nTmp2 = std::max( long(0) , nTmp2 ); + tools::Long nTmp2 = std::min( static_cast<tools::Long>(nCount-nCurVis), static_cast<tools::Long>(static_cast<tools::Long>(mnTop)+static_cast<tools::Long>(nCurVis)-1) ); + nTmp2 = std::max( tools::Long(0) , nTmp2 ); nTmp = static_cast<sal_Int32>(nTmp2+(nCurVis-1) ); SetTopEntry( static_cast<sal_Int32>(nTmp2) ); } @@ -1609,8 +1609,8 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 if (!pEntry) return; - long nWidth = GetOutputSizePixel().Width(); - long nY = mpEntryList->GetAddedHeight(nPos, mnTop); + tools::Long nWidth = GetOutputSizePixel().Width(); + tools::Long nY = mpEntryList->GetAddedHeight(nPos, mnTop); tools::Rectangle aRect(Point(0, nY), Size(nWidth, pEntry->getHeightWithMargin())); bool bSelected = mpEntryList->IsEntryPosSelected(nPos); @@ -1654,14 +1654,14 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (!pEntry) return; - long nEntryHeight = pEntry->getHeightWithMargin(); + tools::Long nEntryHeight = pEntry->getHeightWithMargin(); // when changing this function don't forget to adjust ImplWin::DrawEntry() if (mbInUserDraw) nPos = mnUserDrawEntry; // real entry, not the matching entry from MRU - long nY = mpEntryList->GetAddedHeight(nPos, mnTop); + tools::Long nY = mpEntryList->GetAddedHeight(nPos, mnTop); if (bDrawImage && mpEntryList->HasImages()) { @@ -1705,7 +1705,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 OUString aStr(mpEntryList->GetEntryText(nPos)); if (!aStr.isEmpty()) { - long nMaxWidth = std::max(mnMaxWidth, GetOutputSizePixel().Width() - 2 * gnBorder); + tools::Long nMaxWidth = std::max(mnMaxWidth, GetOutputSizePixel().Width() - 2 * gnBorder); // a multiline entry should only be as wide as the window if (pEntry->mnFlags & ListBoxEntryFlags::MultiLine) nMaxWidth = GetOutputSizePixel().Width() - 2 * gnBorder; @@ -1715,7 +1715,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled()) { - long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); + tools::Long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE ); } @@ -1757,13 +1757,13 @@ void ImplListBoxWindow::ImplDoPaint(vcl::RenderContext& rRenderContext, const to if (mbHasFocusRect) ImplHideFocusRect(); - long nY = 0; // + gnBorder; - long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + gnBorder; + tools::Long nY = 0; // + gnBorder; + tools::Long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + gnBorder; for (sal_Int32 i = mnTop; i < nCount && nY < nHeight + mnMaxHeight; i++) { const ImplEntryType* pEntry = mpEntryList->GetEntryPtr(i); - long nEntryHeight = pEntry->getHeightWithMargin(); + tools::Long nEntryHeight = pEntry->getHeightWithMargin(); if (nY + nEntryHeight >= rRect.Top() && nY <= rRect.Bottom() + mnMaxHeight) { @@ -1772,7 +1772,7 @@ void ImplListBoxWindow::ImplDoPaint(vcl::RenderContext& rRenderContext, const to nY += nEntryHeight; } - long nHeightDiff = mpEntryList->GetAddedHeight(mnCurrentPos, mnTop); + tools::Long nHeightDiff = mpEntryList->GetAddedHeight(mnCurrentPos, mnTop); maFocusRect.SetPos(Point(0, nHeightDiff)); Size aSz(maFocusRect.GetWidth(), mpEntryList->GetEntryHeight(mnCurrentPos)); maFocusRect.SetSize(aSz); @@ -1797,7 +1797,7 @@ sal_uInt16 ImplListBoxWindow::GetDisplayLineCount() const // FIXME: ListBoxEntryFlags::MultiLine const sal_Int32 nCount = mpEntryList->GetEntryCount()-mnTop; - long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + gnBorder; + tools::Long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + gnBorder; sal_uInt16 nEntries = static_cast< sal_uInt16 >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight ); if( nEntries > nCount ) nEntries = static_cast<sal_uInt16>(nCount); @@ -1830,7 +1830,7 @@ void ImplListBoxWindow::GetFocus() sal_Int32 nPos = mnCurrentPos; if ( nPos == LISTBOX_ENTRY_NOTFOUND ) nPos = 0; - long nHeightDiff = mpEntryList->GetAddedHeight( nPos, mnTop ); + tools::Long nHeightDiff = mpEntryList->GetAddedHeight( nPos, mnTop ); maFocusRect.SetPos( Point( 0, nHeightDiff ) ); Size aSz( maFocusRect.GetWidth(), mpEntryList->GetEntryHeight( nPos ) ); maFocusRect.SetSize( aSz ); @@ -1849,7 +1849,7 @@ void ImplListBoxWindow::SetTopEntry( sal_Int32 nTop ) if( mpEntryList->GetEntryCount() == 0 ) return; - long nWHeight = PixelToLogic( GetSizePixel() ).Height(); + tools::Long nWHeight = PixelToLogic( GetSizePixel() ).Height(); sal_Int32 nLastEntry = mpEntryList->GetEntryCount()-1; if( nTop > nLastEntry ) @@ -1862,7 +1862,7 @@ void ImplListBoxWindow::SetTopEntry( sal_Int32 nTop ) return; ImplClearLayoutData(); - long nDiff = mpEntryList->GetAddedHeight( mnTop, nTop ); + tools::Long nDiff = mpEntryList->GetAddedHeight( mnTop, nTop ); PaintImmediately(); ImplHideFocusRect(); mnTop = nTop; @@ -1878,17 +1878,17 @@ void ImplListBoxWindow::ShowProminentEntry( sal_Int32 nEntryPos ) SetTopEntry( nEntryPos ); } -void ImplListBoxWindow::SetLeftIndent( long n ) +void ImplListBoxWindow::SetLeftIndent( tools::Long n ) { ScrollHorz( n - mnLeft ); } -void ImplListBoxWindow::ScrollHorz( long n ) +void ImplListBoxWindow::ScrollHorz( tools::Long n ) { - long nDiff = 0; + tools::Long nDiff = 0; if ( n > 0 ) { - long nWidth = GetOutputSizePixel().Width(); + tools::Long nWidth = GetOutputSizePixel().Width(); if( ( mnMaxWidth - mnLeft + n ) > nWidth ) nDiff = n; } @@ -1896,7 +1896,7 @@ void ImplListBoxWindow::ScrollHorz( long n ) { if( mnLeft ) { - long nAbs = -n; + tools::Long nAbs = -n; nDiff = - std::min( mnLeft, nAbs ); } } @@ -1952,7 +1952,7 @@ tools::Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_Int32 nItem ) cons { const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem ); Size aSz( GetSizePixel().Width(), pEntry ? pEntry->getHeightWithMargin() : GetEntryHeightWithMargin() ); - long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) + GetEntryList()->GetMRUCount()*GetEntryHeightWithMargin(); + tools::Long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) + GetEntryList()->GetMRUCount()*GetEntryHeightWithMargin(); tools::Rectangle aRect( Point( 0, nY ), aSz ); return aRect; } @@ -2140,7 +2140,7 @@ IMPL_LINK_NOARG(ImplListBox, MRUChanged, LinkParamNone*, void) IMPL_LINK_NOARG(ImplListBox, LBWindowScrolled, ImplListBoxWindow*, void) { - long nSet = GetTopEntry(); + tools::Long nSet = GetTopEntry(); if( nSet > mpVScrollBar->GetRangeMax() ) mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() ); mpVScrollBar->SetThumbPos( GetTopEntry() ); @@ -2194,11 +2194,11 @@ void ImplListBox::ImplCheckScrollBars() // horizontal ScrollBar if( mbAutoHScroll ) { - long nWidth = static_cast<sal_uInt16>(aOutSz.Width()); + tools::Long nWidth = static_cast<sal_uInt16>(aOutSz.Width()); if ( mbVScroll ) nWidth -= mpVScrollBar->GetSizePixel().Width(); - long nMaxWidth = GetMaxEntryWidth(); + tools::Long nMaxWidth = GetMaxEntryWidth(); if( nWidth < nMaxWidth ) { if( !mbHScroll ) @@ -2270,7 +2270,7 @@ void ImplListBox::ImplResizeControls() // visible is already determined in ImplCheckScrollBars Size aOutSz = GetOutputSizePixel(); - long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); nSBWidth = CalcZoom( nSBWidth ); Size aInnerSz( aOutSz ); @@ -2653,7 +2653,7 @@ void ImplWin::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& void ImplWin::DrawEntry(vcl::RenderContext& rRenderContext, bool bLayout) { - long nBorder = 1; + tools::Long nBorder = 1; Size aOutSz(GetOutputSizePixel()); bool bImage = !!maImage; @@ -2834,7 +2834,7 @@ bool ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt ) return FloatingWindow::PreNotify( rNEvt ); } -void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags ) +void ImplListBoxFloatingWindow::setPosSizePixel( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags ) { FloatingWindow::setPosSizePixel( nX, nY, nWidth, nHeight, nFlags ); @@ -2886,7 +2886,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() nLines = mnDDLineCount; Size aSz = mpImplLB->CalcSize( nLines ); - long nMaxHeight = aSz.Height() + nTop + nBottom; + tools::Long nMaxHeight = aSz.Height() + nTop + nBottom; if ( mnDDLineCount ) aFloatSz.setHeight( nMaxHeight ); @@ -2901,11 +2901,11 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() if ( ( aFloatSz.Height() < nMaxHeight ) || ( mnDDLineCount && ( mnDDLineCount < mpImplLB->GetEntryList()->GetEntryCount() ) ) ) { // then we also need the vertical Scrollbar - long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); aFloatSz.AdjustWidth(nSBWidth ); } - long nDesktopWidth = GetDesktopRectPixel().getWidth(); + tools::Long nDesktopWidth = GetDesktopRectPixel().getWidth(); if (aFloatSz.Width() > nDesktopWidth) // Don't exceed the desktop width. aFloatSz.setWidth( nDesktopWidth ); @@ -2925,8 +2925,8 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() aFloatSz.setWidth( aParentSz.Width() ); // align height to entries... - long nInnerHeight = aFloatSz.Height() - nTop - nBottom; - long nEntryHeight = mpImplLB->GetEntryHeightWithMargin(); + tools::Long nInnerHeight = aFloatSz.Height() - nTop - nBottom; + tools::Long nEntryHeight = mpImplLB->GetEntryHeightWithMargin(); if ( nInnerHeight % nEntryHeight ) { nInnerHeight /= nEntryHeight; @@ -2939,7 +2939,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() { // The max width of list box entries exceeds the window width. // Account for the scroll bar height. - long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); aFloatSz.AdjustHeight(nSBWidth ); } diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index a82e4ce0fb11..bf4b71412514 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -365,8 +365,8 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) } } - const long nOnePixel = GetDrawPixel( pDev, 1 ); - const long nOffX = 3*nOnePixel; + const tools::Long nOnePixel = GetDrawPixel( pDev, 1 ); + const tools::Long nOffX = 3*nOnePixel; DrawTextFlags nTextStyle = DrawTextFlags::VCenter; tools::Rectangle aTextRect( aPos, aSize ); @@ -383,9 +383,9 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) if ( IsDropDownBox() ) { OUString aText = GetSelectedEntry(); - long nTextHeight = pDev->GetTextHeight(); - long nTextWidth = pDev->GetTextWidth( aText ); - long nOffY = (aSize.Height()-nTextHeight) / 2; + tools::Long nTextHeight = pDev->GetTextHeight(); + tools::Long nTextWidth = pDev->GetTextWidth( aText ); + tools::Long nOffY = (aSize.Height()-nTextHeight) / 2; // Clipping? if ( (nOffY < 0) || @@ -402,7 +402,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) } else { - long nTextHeight = pDev->GetTextHeight(); + tools::Long nTextHeight = pDev->GetTextHeight(); sal_uInt16 nLines = ( nTextHeight > 0 ) ? static_cast<sal_uInt16>(aSize.Height() / nTextHeight) : 1; tools::Rectangle aClip( aPos, aSize ); @@ -535,7 +535,7 @@ sal_uInt16 ListBox::GetDropDownLineCount() const return mnLineCount; } -void ListBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags ) +void ListBox::setPosSizePixel( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags ) { if( IsDropDownBox() && ( nFlags & PosSizeFlags::Size ) ) { @@ -559,8 +559,8 @@ void ListBox::Resize() if( IsDropDownBox() ) { // Initialize the dropdown button size with the standard scrollbar width - long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); - long nBottom = aOutSz.Height(); + tools::Long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nBottom = aOutSz.Height(); // Note: in case of no border, pBorder will actually be this vcl::Window *pBorder = GetWindow( GetWindowType::Border ); @@ -597,7 +597,7 @@ void ListBox::Resize() // let's do the best we can and center vertically, so it doesn't look // completely wrong. Size aSz( GetOutputSizePixel() ); - long nDiff = aContent.Top() - (aSz.Height() - aContent.GetHeight())/2; + tools::Long nDiff = aContent.Top() - (aSz.Height() - aContent.GetHeight())/2; aContent.AdjustTop( -nDiff ); aContent.AdjustBottom( -nDiff ); } @@ -647,13 +647,13 @@ void ListBox::FillLayoutData() const } } -long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const +tools::Long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const { if( !HasLayoutData() ) FillLayoutData(); // Check whether rPoint fits at all - long nIndex = Control::GetIndexForPoint( rPoint ); + tools::Long nIndex = Control::GetIndexForPoint( rPoint ); if( nIndex != -1 ) { // Point must be either in main list window @@ -1214,7 +1214,7 @@ Size ListBox::CalcSubEditSize() const if (m_nMaxWidthChars != -1) { - long nMaxWidth = m_nMaxWidthChars * approximate_char_width(); + tools::Long nMaxWidth = m_nMaxWidthChars * approximate_char_width(); aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); } @@ -1239,8 +1239,8 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const aSz.AdjustHeight( -(nTop+nBottom) ); if ( !IsDropDownBox() ) { - long nEntryHeight = CalcBlockSize( 1, 1 ).Height(); - long nLines = aSz.Height() / nEntryHeight; + tools::Long nEntryHeight = CalcBlockSize( 1, 1 ).Height(); + tools::Long nLines = aSz.Height() / nEntryHeight; if ( nLines < 1 ) nLines = 1; aSz.setHeight( nLines * nEntryHeight ); diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 920fb48fe04c..5025c1d68ef0 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -52,8 +52,8 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt { SAL_WARN_IF( nDigits >= 10, "vcl", "LongCurrency may only have 9 decimal places" ); - if ( rNumber.IsZero() || static_cast<long>(rNumber) ) - return rLocaleDataWrapper.getCurr( static_cast<long>(rNumber), nDigits, rCurrSymbol, bShowThousandSep ); + if ( rNumber.IsZero() || static_cast<tools::Long>(rNumber) ) + return rLocaleDataWrapper.getCurr( static_cast<tools::Long>(rNumber), nDigits, rCurrSymbol, bShowThousandSep ); BigInt aTmp( ImplPower10( nDigits ) ); BigInt aInteger( rNumber ); @@ -70,7 +70,7 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt if ( rNumber.IsNeg() ) aFraction *= -1; - OUStringBuffer aTemplate = rLocaleDataWrapper.getCurr( static_cast<long>(aFraction), nDigits, rCurrSymbol, bShowThousandSep ); + OUStringBuffer aTemplate = rLocaleDataWrapper.getCurr( static_cast<tools::Long>(aFraction), nDigits, rCurrSymbol, bShowThousandSep ); while( !aInteger.IsZero() ) { aFraction = aInteger; @@ -79,7 +79,7 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt if( !aInteger.IsZero() ) aFraction += aTmp; - OUString aFractionStr = rLocaleDataWrapper.getNum( static_cast<long>(aFraction), 0 ); + OUString aFractionStr = rLocaleDataWrapper.getNum( static_cast<tools::Long>(aFraction), 0 ); sal_Int32 nSPos = aTemplate.indexOf( '1' ); if (nSPos == -1) diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index c6bbe576c05d..64686e1729b5 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -157,7 +157,7 @@ Size NotebookBar::GetOptimalSize() const return Control::GetOptimalSize(); } -void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags) +void NotebookBar::setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags) { bool bCanHandleSmallerWidth = false; bool bCanHandleSmallerHeight = false; diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index 0f61ea90b496..e861d66bcb03 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -123,7 +123,7 @@ void ProgressBar::ImplDrawProgress(vcl::RenderContext& rRenderContext, sal_uInt1 mnPrgsHeight = aSize.Height() - (PROGRESSBAR_WIN_OFFSET * 2); mnPrgsWidth = (mnPrgsHeight * 2) / 3; maPos.setY( PROGRESSBAR_WIN_OFFSET ); - long nMaxWidth = aSize.Width() - (PROGRESSBAR_WIN_OFFSET * 2) + PROGRESSBAR_OFFSET; + tools::Long nMaxWidth = aSize.Width() - (PROGRESSBAR_WIN_OFFSET * 2) + PROGRESSBAR_OFFSET; sal_uInt16 nMaxCount = static_cast<sal_uInt16>(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET)); if (nMaxCount <= 1) { diff --git a/vcl/source/control/roadmap.cxx b/vcl/source/control/roadmap.cxx index 9f7e6a0e12ef..f1df11cff5bb 100644 --- a/vcl/source/control/roadmap.cxx +++ b/vcl/source/control/roadmap.cxx @@ -26,10 +26,10 @@ #include <tools/color.hxx> #include <rtl/ustring.hxx> -constexpr long LABELBASEMAPHEIGHT = 8; -constexpr long ROADMAP_INDENT_X = 4; -constexpr long ROADMAP_INDENT_Y = 27; -constexpr long ROADMAP_ITEM_DISTANCE_Y = 6; +constexpr tools::Long LABELBASEMAPHEIGHT = 8; +constexpr tools::Long ROADMAP_INDENT_X = 4; +constexpr tools::Long ROADMAP_INDENT_Y = 27; +constexpr tools::Long ROADMAP_ITEM_DISTANCE_Y = 6; namespace vcl { @@ -775,8 +775,8 @@ void RoadmapItem::ToggleBackgroundColor(const Color& _rGBColor) void RoadmapItem::ImplUpdatePosSize() { // calculate widths - long nIDWidth = mpID->GetTextWidth( mpID->GetText() ); - long nMaxIDWidth = mpID->GetTextWidth( "100." ); + tools::Long nIDWidth = mpID->GetTextWidth( mpID->GetText() ); + tools::Long nMaxIDWidth = mpID->GetTextWidth( "100." ); nIDWidth = ::std::min( nIDWidth, nMaxIDWidth ); // check how many space the description would need diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 01b645c1b80c..848260b4b9b5 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -89,7 +89,7 @@ void ScrollBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) ImplInitStyle( nStyle ); Control::ImplInit( pParent, nStyle, nullptr ); - long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize(); SetSizePixel( Size( nScrollSize, nScrollSize ) ); } @@ -162,7 +162,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) { if ( GetStyle() & WB_HORZ ) { - const long nSpace = maTrackRect.Right() - maTrackRect.Left(); + const tools::Long nSpace = maTrackRect.Right() - maTrackRect.Left(); if ( nSpace > 0 ) { maPage1Rect.SetLeft( maTrackRect.Left() ); @@ -173,7 +173,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) } else { - const long nSpace = maTrackRect.Bottom() - maTrackRect.Top(); + const tools::Long nSpace = maTrackRect.Bottom() - maTrackRect.Top(); if ( nSpace > 0 ) { maPage1Rect.SetTop( maTrackRect.Top() ); @@ -200,19 +200,19 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) } } -long ScrollBar::ImplCalcThumbPos( long nPixPos ) +tools::Long ScrollBar::ImplCalcThumbPos( tools::Long nPixPos ) { // Calculate position - long nCalcThumbPos; + tools::Long nCalcThumbPos; nCalcThumbPos = ImplMulDiv( nPixPos, mnMaxRange-mnVisibleSize-mnMinRange, mnThumbPixRange-mnThumbPixSize ); nCalcThumbPos += mnMinRange; return nCalcThumbPos; } -long ScrollBar::ImplCalcThumbPosPix( long nPos ) +tools::Long ScrollBar::ImplCalcThumbPosPix( tools::Long nPos ) { - long nCalcThumbPos; + tools::Long nCalcThumbPos; // Calculate position nCalcThumbPos = ImplMulDiv( nPos-mnMinRange, mnThumbPixRange-mnThumbPixSize, @@ -232,7 +232,7 @@ long ScrollBar::ImplCalcThumbPosPix( long nPos ) void ScrollBar::ImplCalc( bool bUpdate ) { const Size aSize = GetOutputSizePixel(); - const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize(); + const tools::Long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize(); if ( mbCalcSize ) { @@ -671,11 +671,11 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext) } } -long ScrollBar::ImplScroll( long nNewPos, bool bCallEndScroll ) +tools::Long ScrollBar::ImplScroll( tools::Long nNewPos, bool bCallEndScroll ) { - long nOldPos = mnThumbPos; + tools::Long nOldPos = mnThumbPos; SetThumbPos( nNewPos ); - long nDelta = mnThumbPos-nOldPos; + tools::Long nDelta = mnThumbPos-nOldPos; if ( nDelta ) { mnDelta = nDelta; @@ -687,9 +687,9 @@ long ScrollBar::ImplScroll( long nNewPos, bool bCallEndScroll ) return nDelta; } -long ScrollBar::ImplDoAction( bool bCallEndScroll ) +tools::Long ScrollBar::ImplDoAction( bool bCallEndScroll ) { - long nDelta = 0; + tools::Long nDelta = 0; switch ( meScrollType ) { @@ -792,7 +792,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) void ScrollBar::ImplDragThumb( const Point& rMousePos ) { - long nMovePix; + tools::Long nMovePix; if ( GetStyle() & WB_HORZ ) nMovePix = rMousePos.X()-(maThumbRect.Left()+mnMouseOff); else @@ -807,7 +807,7 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos ) mnThumbPixPos = 0; if ( mnThumbPixPos > (mnThumbPixRange-mnThumbPixSize) ) mnThumbPixPos = mnThumbPixRange-mnThumbPixSize; - long nOldPos = mnThumbPos; + tools::Long nOldPos = mnThumbPos; mnThumbPos = ImplCalcThumbPos( mnThumbPixPos ); ImplUpdateRects(); if ( !(mbFullDrag && (nOldPos != mnThumbPos)) ) @@ -982,7 +982,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt ) // Restore the old ThumbPosition when canceled if ( rTEvt.IsTrackingCanceled() ) { - long nOldPos = mnThumbPos; + tools::Long nOldPos = mnThumbPos; SetThumbPos( mnStartPos ); mnDelta = mnThumbPos-nOldPos; Scroll(); @@ -1300,19 +1300,19 @@ void ScrollBar::EndScroll() ImplCallEventListenersAndHandler( VclEventId::ScrollbarEndScroll, [this] () { maEndScrollHdl.Call(this); } ); } -long ScrollBar::DoScroll( long nNewPos ) +tools::Long ScrollBar::DoScroll( tools::Long nNewPos ) { if ( meScrollType != ScrollType::DontKnow ) return 0; SAL_INFO("vcl.scrollbar", "DoScroll(" << nNewPos << ")"); meScrollType = ScrollType::Drag; - long nDelta = ImplScroll( nNewPos, true ); + tools::Long nDelta = ImplScroll( nNewPos, true ); meScrollType = ScrollType::DontKnow; return nDelta; } -long ScrollBar::DoScrollAction( ScrollType eScrollType ) +tools::Long ScrollBar::DoScrollAction( ScrollType eScrollType ) { if ( (meScrollType != ScrollType::DontKnow) || (eScrollType == ScrollType::DontKnow) || @@ -1320,17 +1320,17 @@ long ScrollBar::DoScrollAction( ScrollType eScrollType ) return 0; meScrollType = eScrollType; - long nDelta = ImplDoAction( true ); + tools::Long nDelta = ImplDoAction( true ); meScrollType = ScrollType::DontKnow; return nDelta; } -void ScrollBar::SetRangeMin( long nNewRange ) +void ScrollBar::SetRangeMin( tools::Long nNewRange ) { SetRange( Range( nNewRange, GetRangeMax() ) ); } -void ScrollBar::SetRangeMax( long nNewRange ) +void ScrollBar::SetRangeMax( tools::Long nNewRange ) { SetRange( Range( GetRangeMin(), nNewRange ) ); } @@ -1340,8 +1340,8 @@ void ScrollBar::SetRange( const Range& rRange ) // Adapt Range Range aRange = rRange; aRange.Justify(); - long nNewMinRange = aRange.Min(); - long nNewMaxRange = aRange.Max(); + tools::Long nNewMinRange = aRange.Min(); + tools::Long nNewMaxRange = aRange.Max(); // If Range differs, set a new one if ( (mnMinRange == nNewMinRange) && (mnMaxRange == nNewMaxRange)) @@ -1359,7 +1359,7 @@ void ScrollBar::SetRange( const Range& rRange ) CompatStateChanged( StateChangedType::Data ); } -void ScrollBar::SetThumbPos( long nNewThumbPos ) +void ScrollBar::SetThumbPos( tools::Long nNewThumbPos ) { if ( nNewThumbPos > mnMaxRange-mnVisibleSize ) nNewThumbPos = mnMaxRange-mnVisibleSize; @@ -1373,7 +1373,7 @@ void ScrollBar::SetThumbPos( long nNewThumbPos ) } } -void ScrollBar::SetVisibleSize( long nNewSize ) +void ScrollBar::SetVisibleSize( tools::Long nNewSize ) { if ( mnVisibleSize != nNewSize ) { @@ -1395,7 +1395,7 @@ Size ScrollBar::GetOptimalSize() const Size aRet = getCurrentCalcSize(); - const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize(); + const tools::Long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize(); if (GetStyle() & WB_HORZ) { @@ -1425,7 +1425,7 @@ void ScrollBarBox::ImplInit(vcl::Window* pParent, WinBits nStyle) Window::ImplInit( pParent, nStyle, nullptr ); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - long nScrollSize = rStyleSettings.GetScrollBarSize(); + tools::Long nScrollSize = rStyleSettings.GetScrollBarSize(); SetSizePixel(Size(nScrollSize, nScrollSize)); } diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index f25cd384d68c..af259cd184e7 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -202,19 +202,19 @@ void Slider::ImplUpdateRects( bool bUpdate ) } } -long Slider::ImplCalcThumbPos( long nPixPos ) +tools::Long Slider::ImplCalcThumbPos( tools::Long nPixPos ) { // calculate position - long nCalcThumbPos; + tools::Long nCalcThumbPos; nCalcThumbPos = ImplMulDiv( nPixPos-mnThumbPixOffset, mnMaxRange-mnMinRange, mnThumbPixRange-1 ); nCalcThumbPos += mnMinRange; return nCalcThumbPos; } -long Slider::ImplCalcThumbPosPix( long nPos ) +tools::Long Slider::ImplCalcThumbPosPix( tools::Long nPos ) { // calculate position - long nCalcThumbPos; + tools::Long nCalcThumbPos; nCalcThumbPos = ImplMulDiv( nPos-mnMinRange, mnThumbPixRange-1, mnMaxRange-mnMinRange ); // at the beginning and end we try to display Slider correctly if ( !nCalcThumbPos && (mnThumbPos > mnMinRange) ) @@ -263,11 +263,11 @@ void Slider::ImplCalc( bool bUpdate ) } } - long nOldChannelPixRange = mnChannelPixRange; - long nOldChannelPixTop = mnChannelPixTop; - long nOldChannelPixBottom = mnChannelPixBottom; - long nCalcWidth; - long nCalcHeight; + tools::Long nOldChannelPixRange = mnChannelPixRange; + tools::Long nOldChannelPixTop = mnChannelPixTop; + tools::Long nOldChannelPixBottom = mnChannelPixBottom; + tools::Long nCalcWidth; + tools::Long nCalcHeight; maChannel1Rect.SetEmpty(); maChannel2Rect.SetEmpty(); @@ -360,7 +360,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) if (!maChannel1Rect.IsEmpty()) { - long nRectSize; + tools::Long nRectSize; tools::Rectangle aRect = maChannel1Rect; rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); if (GetStyle() & WB_HORZ) @@ -404,7 +404,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) if (!maChannel2Rect.IsEmpty()) { - long nRectSize; + tools::Long nRectSize; tools::Rectangle aRect = maChannel2Rect; rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); if (GetStyle() & WB_HORZ) @@ -495,11 +495,11 @@ bool Slider::ImplIsPageDown( const Point& rPos ) return aRect.IsInside( rPos ); } -long Slider::ImplSlide( long nNewPos ) +tools::Long Slider::ImplSlide( tools::Long nNewPos ) { - long nOldPos = mnThumbPos; + tools::Long nOldPos = mnThumbPos; SetThumbPos( nNewPos ); - long nDelta = mnThumbPos-nOldPos; + tools::Long nDelta = mnThumbPos-nOldPos; if ( nDelta ) { Slide(); @@ -507,9 +507,9 @@ long Slider::ImplSlide( long nNewPos ) return nDelta; } -long Slider::ImplDoAction() +tools::Long Slider::ImplDoAction() { - long nDelta = 0; + tools::Long nDelta = 0; switch ( meScrollType ) { @@ -579,7 +579,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) } } -void Slider::ImplDoSlide( long nNewPos ) +void Slider::ImplDoSlide( tools::Long nNewPos ) { if ( meScrollType != ScrollType::DontKnow ) return; @@ -683,7 +683,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) // special handling for dragging if ( meScrollType == ScrollType::Drag ) { - long nMovePix; + tools::Long nMovePix; Point aCenterPos = maThumbRect.Center(); if ( GetStyle() & WB_HORZ ) nMovePix = rMousePos.X()-(aCenterPos.X()+mnMouseOff); @@ -697,7 +697,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) mnThumbPixPos = mnThumbPixOffset; if ( mnThumbPixPos > (mnThumbPixOffset+mnThumbPixRange-1) ) mnThumbPixPos = mnThumbPixOffset+mnThumbPixRange-1; - long nOldPos = mnThumbPos; + tools::Long nOldPos = mnThumbPos; mnThumbPos = ImplCalcThumbPos( mnThumbPixPos ); if ( nOldPos != mnThumbPos ) { @@ -836,12 +836,12 @@ void Slider::Slide() maSlideHdl.Call( this ); } -void Slider::SetRangeMin(long nNewRange) +void Slider::SetRangeMin(tools::Long nNewRange) { SetRange(Range(nNewRange, GetRangeMax())); } -void Slider::SetRangeMax(long nNewRange) +void Slider::SetRangeMax(tools::Long nNewRange) { SetRange(Range(GetRangeMin(), nNewRange)); } @@ -851,8 +851,8 @@ void Slider::SetRange( const Range& rRange ) // adjust Range Range aRange = rRange; aRange.Justify(); - long nNewMinRange = aRange.Min(); - long nNewMaxRange = aRange.Max(); + tools::Long nNewMinRange = aRange.Min(); + tools::Long nNewMaxRange = aRange.Max(); // reset Range if different if ( (mnMinRange != nNewMinRange) || @@ -870,7 +870,7 @@ void Slider::SetRange( const Range& rRange ) } } -void Slider::SetThumbPos( long nNewThumbPos ) +void Slider::SetThumbPos( tools::Long nNewThumbPos ) { if ( nNewThumbPos < mnMinRange ) nNewThumbPos = mnMinRange; @@ -886,8 +886,8 @@ void Slider::SetThumbPos( long nNewThumbPos ) Size Slider::CalcWindowSizePixel() { - long nWidth = mnMaxRange - mnMinRange + mnThumbSize + 1; - long nHeight = SLIDER_HEIGHT; + tools::Long nWidth = mnMaxRange - mnMinRange + mnThumbSize + 1; + tools::Long nHeight = SLIDER_HEIGHT; Size aSize; if ( GetStyle() & WB_HORZ ) { diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 531c90222233..db8ca2b13e8f 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -334,12 +334,12 @@ void SpinButton::StateChanged( StateChangedType nType ) Control::StateChanged( nType ); } -void SpinButton::SetRangeMin( long nNewRange ) +void SpinButton::SetRangeMin( tools::Long nNewRange ) { SetRange( Range( nNewRange, GetRangeMax() ) ); } -void SpinButton::SetRangeMax( long nNewRange ) +void SpinButton::SetRangeMax( tools::Long nNewRange ) { SetRange( Range( GetRangeMin(), nNewRange ) ); } @@ -349,8 +349,8 @@ void SpinButton::SetRange( const Range& rRange ) // adjust rage Range aRange = rRange; aRange.Justify(); - long nNewMinRange = aRange.Min(); - long nNewMaxRange = aRange.Max(); + tools::Long nNewMinRange = aRange.Min(); + tools::Long nNewMaxRange = aRange.Max(); // do something only if old and new range differ if ( (mnMinRange == nNewMinRange) && (mnMaxRange == nNewMaxRange)) @@ -368,7 +368,7 @@ void SpinButton::SetRange( const Range& rRange ) CompatStateChanged( StateChangedType::Data ); } -void SpinButton::SetValue( long nValue ) +void SpinButton::SetValue( tools::Long nValue ) { // adjust, if necessary if ( nValue > mnMaxRange ) diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index f63c037d6e9d..090579322fbe 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -257,8 +257,8 @@ void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext, } // calculate Symbol size - long nTempSize1 = aUpRect.GetWidth(); - long nTempSize2 = aLowRect.GetWidth(); + tools::Long nTempSize1 = aUpRect.GetWidth(); + tools::Long nTempSize2 = aLowRect.GetWidth(); if (std::abs( nTempSize1-nTempSize2 ) == 1) { if (nTempSize1 > nTempSize2) @@ -614,7 +614,7 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, tool if (GetStyle() & WB_DROPDOWN) { - long nW = rStyleSettings.GetScrollBarSize(); + tools::Long nW = rStyleSettings.GetScrollBarSize(); nW = GetDrawPixel( pDev, nW ); aDropDownSize = Size( CalcZoom( nW ), aSize.Height() ); aSize.AdjustWidth( -(aDropDownSize.Width()) ); @@ -627,9 +627,9 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, tool // calculate sizes according to the height if (GetStyle() & WB_SPIN) { - long nBottom1 = aSize.Height()/2; - long nBottom2 = aSize.Height()-1; - long nTop2 = nBottom1; + tools::Long nBottom1 = aSize.Height()/2; + tools::Long nBottom2 = aSize.Height()-1; + tools::Long nTop2 = nBottom1; if ( !(aSize.Height() & 0x01) ) nBottom1--; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index c3c894cb451d..04e1e909f5b3 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -224,7 +224,7 @@ ImplTabItem* TabControl::ImplGetItem( sal_uInt16 nId ) const return nullptr; } -Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) +Size TabControl::ImplGetItemSize( ImplTabItem* pItem, tools::Long nMaxWidth ) { pItem->maFormatText = pItem->maText; Size aSize( GetCtrlTextWidth( pItem->maFormatText ), GetTextHeight() ); @@ -368,7 +368,7 @@ namespace MinimumRaggednessWrap } }; -static void lcl_AdjustSingleLineTabs(long nMaxWidth, ImplTabCtrlData *pTabCtrlData) +static void lcl_AdjustSingleLineTabs(tools::Long nMaxWidth, ImplTabCtrlData *pTabCtrlData) { if (!ImplGetSVData()->maNWFData.mbCenteredTabs) return; @@ -391,17 +391,17 @@ static void lcl_AdjustSingleLineTabs(long nMaxWidth, ImplTabCtrlData *pTabCtrlDa } } -bool TabControl::ImplPlaceTabs( long nWidth ) +bool TabControl::ImplPlaceTabs( tools::Long nWidth ) { if ( nWidth <= 0 ) return false; if ( mpTabCtrlData->maItemList.empty() ) return false; - long nMaxWidth = nWidth; + tools::Long nMaxWidth = nWidth; - const long nOffsetX = 2 + GetItemsOffset().X(); - const long nOffsetY = 2 + GetItemsOffset().Y(); + const tools::Long nOffsetX = 2 + GetItemsOffset().X(); + const tools::Long nOffsetY = 2 + GetItemsOffset().Y(); //fdo#66435 throw Knuth/Tex minimum raggedness algorithm at the problem //of ugly bare tabs on lines of their own @@ -420,13 +420,13 @@ bool TabControl::ImplPlaceTabs( long nWidth ) nMaxWidth -= GetItemsOffset().X(); - long nX = nOffsetX; - long nY = nOffsetY; + tools::Long nX = nOffsetX; + tools::Long nY = nOffsetY; sal_uInt16 nLines = 0; sal_uInt16 nCurLine = 0; - long nLineWidthAry[100]; + tools::Long nLineWidthAry[100]; sal_uInt16 nLinePosAry[101]; nLineWidthAry[0] = 0; nLinePosAry[0] = 0; @@ -477,8 +477,8 @@ bool TabControl::ImplPlaceTabs( long nWidth ) if (nLines) // two or more lines { - long nLineHeightAry[100]; - long nIH = 0; + tools::Long nLineHeightAry[100]; + tools::Long nIH = 0; for (const auto& item : mpTabCtrlData->maItemList) { if (!item.m_bVisible) @@ -497,9 +497,9 @@ bool TabControl::ImplPlaceTabs( long nWidth ) nLinePosAry[nLines+1] = static_cast<sal_uInt16>(mpTabCtrlData->maItemList.size()); - long nDX = 0; - long nModDX = 0; - long nIDX = 0; + tools::Long nDX = 0; + tools::Long nModDX = 0; + tools::Long nIDX = 0; sal_uInt16 i = 0; sal_uInt16 n = 0; @@ -551,7 +551,7 @@ bool TabControl::ImplPlaceTabs( long nWidth ) return true; } -tools::Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight ) +tools::Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, tools::Long nWidth, tools::Long nHeight ) { Size aWinSize = Control::GetOutputSizePixel(); if ( nWidth < 0 ) @@ -561,8 +561,8 @@ tools::Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, l if ( mpTabCtrlData->maItemList.empty() ) { - long nW = nWidth-TAB_OFFSET*2; - long nH = nHeight-TAB_OFFSET*2; + tools::Long nW = nWidth-TAB_OFFSET*2; + tools::Long nH = nHeight-TAB_OFFSET*2; return (nW > 0 && nH > 0) ? tools::Rectangle(Point(TAB_OFFSET, TAB_OFFSET), Size(nW, nH)) : tools::Rectangle(); @@ -580,8 +580,8 @@ tools::Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, l if (aRect.IsEmpty()) return aRect; - long nW = nWidth-TAB_OFFSET*2; - long nH = nHeight-aRect.Bottom()-TAB_OFFSET*2; + tools::Long nW = nWidth-TAB_OFFSET*2; + tools::Long nH = nHeight-aRect.Bottom()-TAB_OFFSET*2; return (nW > 0 && nH > 0) ? tools::Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ), Size( nW, nH ) ) : tools::Rectangle(); @@ -592,7 +592,7 @@ tools::Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, l return ImplGetTabRect(pItem, nWidth, nHeight); } -tools::Rectangle TabControl::ImplGetTabRect(const ImplTabItem* pItem, long nWidth, long nHeight) +tools::Rectangle TabControl::ImplGetTabRect(const ImplTabItem* pItem, tools::Long nWidth, tools::Long nHeight) { if ((nWidth <= 1) || (nHeight <= 0) || !pItem || !pItem->m_bVisible) return tools::Rectangle(); @@ -758,8 +758,8 @@ void TabControl::ImplShowFocus() const ImplTabItem& rItem = mpTabCtrlData->maItemList[ nCurPos ]; Size aTabSize = aRect.GetSize(); Size aImageSize( 0, 0 ); - long nTextHeight = GetTextHeight(); - long nTextWidth = GetCtrlTextWidth( rItem.maFormatText ); + tools::Long nTextHeight = GetTextHeight(); + tools::Long nTextWidth = GetCtrlTextWidth( rItem.maFormatText ); sal_uInt16 nOff; if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::Mono) ) @@ -785,8 +785,8 @@ void TabControl::ImplShowFocus() else { // show focus around image - long nXPos = aRect.Left()+((aTabSize.Width()-nTextWidth-aImageSize.Width())/2)-nOff-1; - long nYPos = aRect.Top(); + tools::Long nXPos = aRect.Left()+((aTabSize.Width()-nTextWidth-aImageSize.Width())/2)-nOff-1; + tools::Long nYPos = aRect.Top(); if( aImageSize.Height() < aRect.GetHeight() ) nYPos += (aRect.GetHeight() - aImageSize.Height())/2; @@ -806,8 +806,8 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem co const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); tools::Rectangle aRect = pItem->maRect; - long nLeftBottom = aRect.Bottom(); - long nRightBottom = aRect.Bottom(); + tools::Long nLeftBottom = aRect.Bottom(); + tools::Long nRightBottom = aRect.Bottom(); bool bLeftBorder = true; bool bRightBorder = true; sal_uInt16 nOff; @@ -948,16 +948,16 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem co Size aTabSize = aRect.GetSize(); Size aImageSize(0, 0); - long nTextHeight = rRenderContext.GetTextHeight(); - long nTextWidth = rRenderContext.GetCtrlTextWidth(pItem->maFormatText); + tools::Long nTextHeight = rRenderContext.GetTextHeight(); + tools::Long nTextWidth = rRenderContext.GetCtrlTextWidth(pItem->maFormatText); if (!!pItem->maTabImage) { aImageSize = pItem->maTabImage.GetSizePixel(); if (!pItem->maFormatText.isEmpty()) aImageSize.AdjustWidth(GetTextHeight() / 4 ); } - long nXPos = aRect.Left() + ((aTabSize.Width() - nTextWidth - aImageSize.Width()) / 2) - nOff - nOff3; - long nYPos = aRect.Top() + ((aTabSize.Height() - nTextHeight) / 2) - nOff3; + tools::Long nXPos = aRect.Left() + ((aTabSize.Width() - nTextWidth - aImageSize.Width()) / 2) - nOff - nOff3; + tools::Long nYPos = aRect.Top() + ((aTabSize.Height() - nTextHeight) / 2) - nOff3; if (!pItem->maFormatText.isEmpty()) { DrawTextFlags nStyle = DrawTextFlags::Mnemonic; @@ -1133,7 +1133,7 @@ void TabControl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectang aRect.SetTop(0); if (mpTabCtrlData->maItemList.size()) { - long nRight = 0; + tools::Long nRight = 0; for (const auto &item : mpTabCtrlData->maItemList) if (item.m_bVisible) nRight = item.maRect.Right(); @@ -1160,7 +1160,7 @@ void TabControl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectang } else { - long nTopOff = 1; + tools::Long nTopOff = 1; if (!(rStyleSettings.GetOptions() & StyleSettingsOptions::Mono)) rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); else @@ -1265,7 +1265,7 @@ void TabControl::setAllocation(const Size &rAllocation) { // get the listbox' preferred size Size aTabCtrlSize( GetSizePixel() ); - long nPrefWidth = mpTabCtrlData->mpListBox->get_preferred_size().Width(); + tools::Long nPrefWidth = mpTabCtrlData->mpListBox->get_preferred_size().Width(); if( nPrefWidth > aTabCtrlSize.Width() ) nPrefWidth = aTabCtrlSize.Width(); Size aNewSize( nPrefWidth, LogicToPixel( Size( 12, 12 ), MapMode( MapUnit::MapAppFont ) ).Height() ); @@ -1280,7 +1280,7 @@ void TabControl::setAllocation(const Size &rAllocation) // check what needs to be invalidated Size aNewSize = rAllocation; - long nNewWidth = aNewSize.Width(); + tools::Long nNewWidth = aNewSize.Width(); for (auto const& item : mpTabCtrlData->maItemList) { if (!item.m_bVisible) @@ -2013,7 +2013,7 @@ void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage ) } } -tools::Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const +tools::Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, tools::Long nIndex ) const { tools::Rectangle aRet; @@ -2034,9 +2034,9 @@ tools::Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex return aRet; } -long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const +tools::Long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const { - long nRet = -1; + tools::Long nRet = -1; if( !HasLayoutData() || mpTabCtrlData->maLayoutPageIdToLine.empty() ) FillLayoutData(); @@ -2136,7 +2136,7 @@ Size TabControl::ImplCalculateRequisition(sal_uInt16& nHeaderHeight) const pThis->ActivatePage(); } - long nTabLabelsBottom = 0, nTabLabelsRight = 0; + tools::Long nTabLabelsBottom = 0, nTabLabelsRight = 0; for (sal_uInt16 nPos(0), sizeList(static_cast <sal_uInt16> (mpTabCtrlData->maItemList.size())); nPos < sizeList; ++nPos) { @@ -2324,7 +2324,7 @@ sal_uInt16 NotebookbarTabControlBase::GetHeaderHeight() return m_nHeaderHeight; } -bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) +bool NotebookbarTabControlBase::ImplPlaceTabs( tools::Long nWidth ) { if ( nWidth <= 0 ) return false; @@ -2333,20 +2333,20 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) if (!m_pOpenMenu || m_pOpenMenu->isDisposed()) return false; - const long nHamburgerWidth = m_pOpenMenu->GetSizePixel().Width(); - long nMaxWidth = nWidth - nHamburgerWidth; - long nShortcutsWidth = m_pShortcuts != nullptr ? m_pShortcuts->GetSizePixel().getWidth() + 1 : 0; - long nFullWidth = nShortcutsWidth; + const tools::Long nHamburgerWidth = m_pOpenMenu->GetSizePixel().Width(); + tools::Long nMaxWidth = nWidth - nHamburgerWidth; + tools::Long nShortcutsWidth = m_pShortcuts != nullptr ? m_pShortcuts->GetSizePixel().getWidth() + 1 : 0; + tools::Long nFullWidth = nShortcutsWidth; - const long nOffsetX = 2 + GetItemsOffset().X() + nShortcutsWidth; - const long nOffsetY = 2 + GetItemsOffset().Y(); + const tools::Long nOffsetX = 2 + GetItemsOffset().X() + nShortcutsWidth; + const tools::Long nOffsetY = 2 + GetItemsOffset().Y(); //fdo#66435 throw Knuth/Tex minimum raggedness algorithm at the problem //of ugly bare tabs on lines of their own for (auto & item : mpTabCtrlData->maItemList) { - long nTabWidth = 0; + tools::Long nTabWidth = 0; if (item.m_bVisible) { nTabWidth = ImplGetItemSize(&item, nMaxWidth).getWidth(); @@ -2358,10 +2358,10 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) nMaxWidth -= GetItemsOffset().X(); - long nX = nOffsetX; - long nY = nOffsetY; + tools::Long nX = nOffsetX; + tools::Long nY = nOffsetY; - long nLineWidthAry[100]; + tools::Long nLineWidthAry[100]; nLineWidthAry[0] = 0; for (auto & item : mpTabCtrlData->maItemList) @@ -2396,11 +2396,11 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) // position the shortcutbox if (m_pShortcuts) { - long nPosY = (m_nHeaderHeight - m_pShortcuts->GetSizePixel().getHeight()) / 2; + tools::Long nPosY = (m_nHeaderHeight - m_pShortcuts->GetSizePixel().getHeight()) / 2; m_pShortcuts->SetPosPixel(Point(0, nPosY)); } - long nPosY = (m_nHeaderHeight - m_pOpenMenu->GetSizePixel().getHeight()) / 2; + tools::Long nPosY = (m_nHeaderHeight - m_pOpenMenu->GetSizePixel().getHeight()) / 2; // position the menu m_pOpenMenu->SetPosPixel(Point(nWidth - nHamburgerWidth, nPosY)); diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx index 850edf27bc40..4f79ab9fcca4 100644 --- a/vcl/source/control/throbber.cxx +++ b/vcl/source/control/throbber.cxx @@ -108,7 +108,7 @@ void Throbber::initImages() size_t nPreferredSet = 0; if ( aImageSets.size() > 1 ) { - long nMinimalDistance = ::std::numeric_limits< long >::max(); + tools::Long nMinimalDistance = ::std::numeric_limits< long >::max(); for ( ::std::vector< ::std::vector< Image > >::const_iterator check = aImageSets.begin(); check != aImageSets.end(); ++check diff --git a/vcl/source/control/thumbpos.hxx b/vcl/source/control/thumbpos.hxx index 1992bd853745..13e24fe6044e 100644 --- a/vcl/source/control/thumbpos.hxx +++ b/vcl/source/control/thumbpos.hxx @@ -10,12 +10,12 @@ #ifndef INCLUDED_VCL_SOURCE_CONTROL_THUMBPOS_HXX #define INCLUDED_VCL_SOURCE_CONTROL_THUMBPOS_HXX -inline long ImplMulDiv( long nNumber, long nNumerator, long nDenominator ) +inline tools::Long ImplMulDiv( tools::Long nNumber, tools::Long nNumerator, tools::Long nDenominator ) { if (!nDenominator) return 0; double n = (static_cast<double>(nNumber) * static_cast<double>(nNumerator)) / static_cast<double>(nDenominator); - return static_cast<long>(n); + return static_cast<tools::Long>(n); } #endif // INCLUDED_VCL_SOURCE_CONTROL_THUMBPOS_HXX diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx index 6272e0073f75..919b54bbdc00 100644 --- a/vcl/source/control/wizardmachine.cxx +++ b/vcl/source/control/wizardmachine.cxx @@ -83,8 +83,8 @@ namespace vcl void RoadmapWizard::ImplCalcSize( Size& rSize ) { // calculate ButtonBar height and width - long nMaxHeight = 0; - long nBarWidth = WIZARDDIALOG_BUTTON_DLGOFFSET_X * 2 + LogicalCoordinateToPixel(6); + tools::Long nMaxHeight = 0; + tools::Long nBarWidth = WIZARDDIALOG_BUTTON_DLGOFFSET_X * 2 + LogicalCoordinateToPixel(6); ImplWizButtonData* pBtnData = mpFirstBtn; while (pBtnData) { @@ -133,9 +133,9 @@ namespace vcl void RoadmapWizard::ImplPosCtrls() { Size aDlgSize = GetOutputSizePixel(); - long nBtnWidth = 0; - long nMaxHeight = 0; - long nOffY = aDlgSize.Height(); + tools::Long nBtnWidth = 0; + tools::Long nMaxHeight = 0; + tools::Long nOffY = aDlgSize.Height(); ImplWizButtonData* pBtnData = mpFirstBtn; int j = 0; @@ -144,7 +144,7 @@ namespace vcl if (j >= mnLeftAlignCount) { Size aBtnSize = pBtnData->mpButton->GetSizePixel(); - long nBtnHeight = aBtnSize.Height(); + tools::Long nBtnHeight = aBtnSize.Height(); if ( nBtnHeight > nMaxHeight ) nMaxHeight = nBtnHeight; nBtnWidth += aBtnSize.Width(); @@ -156,8 +156,8 @@ namespace vcl if ( nMaxHeight ) { - long nOffX = aDlgSize.Width()-nBtnWidth-WIZARDDIALOG_BUTTON_DLGOFFSET_X; - long nOffLeftAlignX = LogicalCoordinateToPixel(6); + tools::Long nOffX = aDlgSize.Width()-nBtnWidth-WIZARDDIALOG_BUTTON_DLGOFFSET_X; + tools::Long nOffLeftAlignX = LogicalCoordinateToPixel(6); nOffY -= WIZARDDIALOG_BUTTON_OFFSET_Y+nMaxHeight; pBtnData = mpFirstBtn; @@ -190,11 +190,11 @@ namespace vcl if ( !(mpViewWindow && mpViewWindow->IsVisible()) ) return; - long nViewOffX = 0; - long nViewOffY = 0; - long nViewWidth = 0; - long nViewHeight = 0; - long nDlgHeight = nOffY; + tools::Long nViewOffX = 0; + tools::Long nViewOffY = 0; + tools::Long nViewWidth = 0; + tools::Long nViewHeight = 0; + tools::Long nDlgHeight = nOffY; PosSizeFlags nViewPosFlags = PosSizeFlags::Pos; // align left { @@ -217,7 +217,7 @@ namespace vcl nViewPosFlags ); } - long RoadmapWizard::LogicalCoordinateToPixel(int iCoordinate){ + tools::Long RoadmapWizard::LogicalCoordinateToPixel(int iCoordinate){ Size aLocSize = LogicToPixel(Size(iCoordinate, 0), MapMode(MapUnit::MapAppFont)); int iPixelCoordinate = aLocSize.Width(); return iPixelCoordinate; @@ -237,11 +237,11 @@ namespace vcl } // calculate height of ButtonBar - long nMaxHeight = 0; + tools::Long nMaxHeight = 0; ImplWizButtonData* pBtnData = mpFirstBtn; while ( pBtnData ) { - long nBtnHeight = pBtnData->mpButton->GetSizePixel().Height(); + tools::Long nBtnHeight = pBtnData->mpButton->GetSizePixel().Height(); if ( nBtnHeight > nMaxHeight ) nMaxHeight = nBtnHeight; pBtnData = pBtnData->mpNext; @@ -252,13 +252,13 @@ namespace vcl // position TabPage Size aDlgSize = GetOutputSizePixel(); aDlgSize.AdjustHeight( -nMaxHeight ); - long nOffX = 0; - long nOffY = 0; + tools::Long nOffX = 0; + tools::Long nOffY = 0; if ( mpViewWindow && mpViewWindow->IsVisible() ) { Size aViewSize = mpViewWindow->GetSizePixel(); // align left - long nViewOffset = mbEmptyViewMargin ? 0 : WIZARDDIALOG_VIEW_DLGOFFSET_X; + tools::Long nViewOffset = mbEmptyViewMargin ? 0 : WIZARDDIALOG_VIEW_DLGOFFSET_X; nOffX += aViewSize.Width() + nViewOffset; aDlgSize.AdjustWidth( -nOffX ); } @@ -527,7 +527,7 @@ namespace vcl return true; } - bool RoadmapWizard::Finish( long nResult ) + bool RoadmapWizard::Finish( tools::Long nResult ) { if ( IsInExecute() ) EndDialog( nResult ); @@ -614,7 +614,7 @@ namespace vcl return nullptr; } - void RoadmapWizard::AddButton( Button* pButton, long nOffset ) + void RoadmapWizard::AddButton( Button* pButton, tools::Long nOffset ) { ImplWizButtonData* pNewBtnData = new ImplWizButtonData; pNewBtnData->mpNext = nullptr; diff --git a/vcl/source/control/wizimpldata.hxx b/vcl/source/control/wizimpldata.hxx index fdac4baef076..f943c0473aec 100644 --- a/vcl/source/control/wizimpldata.hxx +++ b/vcl/source/control/wizimpldata.hxx @@ -32,7 +32,7 @@ struct ImplWizButtonData { ImplWizButtonData* mpNext; VclPtr<Button> mpButton; - long mnOffset; + tools::Long mnOffset; }; namespace vcl |