diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-12 09:52:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-26 07:35:36 +0100 |
commit | 4fbd63860500b2db76df4d5aedbe5e3aa31fac69 (patch) | |
tree | 5fa96dc262ba651e82244b0f9e508f79e88ea2df /toolkit/source/awt | |
parent | 62fa5bb8c1299469eacc21cb35ee670b65120713 (diff) |
switching long to a 64-bit type on 64-bit windows
(*) create a rewriting plugin to do most of the work, heavily
based on the fakebool plugin
(*) but there are still a number of "long"s in the codebase
that will need to be done by hand
(*) the plugin needs lots of handholding, due to needing to
add #include and update macros
Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit/source/awt')
-rw-r--r-- | toolkit/source/awt/animatedimagespeer.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/scrollabledialog.cxx | 14 | ||||
-rw-r--r-- | toolkit/source/awt/vclxgraphics.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxspinbutton.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 12 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 14 |
6 files changed, 24 insertions, 24 deletions
diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx index 087ddb4d381e..ecee7b365194 100644 --- a/toolkit/source/awt/animatedimagespeer.cxx +++ b/toolkit/source/awt/animatedimagespeer.cxx @@ -219,7 +219,7 @@ namespace toolkit // find the set with the smallest difference between window size and image size const ::Size aWindowSizePixel = pThrobber->GetSizePixel(); - long nMinimalDistance = ::std::numeric_limits< long >::max(); + tools::Long nMinimalDistance = ::std::numeric_limits< long >::max(); for ( ::std::vector< Size >::const_iterator check = aImageSizes.begin(); check != aImageSizes.end(); ++check diff --git a/toolkit/source/awt/scrollabledialog.cxx b/toolkit/source/awt/scrollabledialog.cxx index ff9abf48b58d..bcc8d18e0717 100644 --- a/toolkit/source/awt/scrollabledialog.cxx +++ b/toolkit/source/awt/scrollabledialog.cxx @@ -88,10 +88,10 @@ void ScrollableDialog::dispose() Dialog::dispose(); } -void ScrollableDialog::lcl_Scroll( long nX, long nY ) +void ScrollableDialog::lcl_Scroll( tools::Long nX, tools::Long nY ) { - long nXScroll = mnScrollPos.X() - nX; - long nYScroll = mnScrollPos.Y() - nY; + tools::Long nXScroll = mnScrollPos.X() - nX; + tools::Long nYScroll = mnScrollPos.Y() - nY; mnScrollPos = Point( nX, nY ); tools::Rectangle aScrollableArea( 0, 0, maScrollArea.Width(), maScrollArea.Height() ); @@ -118,7 +118,7 @@ IMPL_LINK( ScrollableDialog, ScrollBarHdl, ScrollBar*, pSB, void ) lcl_Scroll(nPos, mnScrollPos.Y() ); } -void ScrollableDialog::SetScrollTop( long nTop ) +void ScrollableDialog::SetScrollTop( tools::Long nTop ) { Point aOld = mnScrollPos; lcl_Scroll( mnScrollPos.X() , mnScrollPos.Y() - nTop ); @@ -126,7 +126,7 @@ void ScrollableDialog::SetScrollTop( long nTop ) // new pos is 0,0 mnScrollPos = aOld; } -void ScrollableDialog::SetScrollLeft( long nLeft ) +void ScrollableDialog::SetScrollLeft( tools::Long nLeft ) { Point aOld = mnScrollPos; lcl_Scroll( mnScrollPos.X() - nLeft , mnScrollPos.Y() ); @@ -135,13 +135,13 @@ void ScrollableDialog::SetScrollLeft( long nLeft ) mnScrollPos = aOld; } -void ScrollableDialog::SetScrollWidth( long nWidth ) +void ScrollableDialog::SetScrollWidth( tools::Long nWidth ) { maScrollArea.setWidth( nWidth ); ResetScrollBars(); } -void ScrollableDialog::SetScrollHeight( long nHeight ) +void ScrollableDialog::SetScrollHeight( tools::Long nHeight ) { maScrollArea.setHeight( nHeight ); ResetScrollBars(); diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index 72ce78fb4fd1..5b6cf29334c5 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -287,13 +287,13 @@ void VCLXGraphics::draw( const uno::Reference< awt::XDisplayBitmap >& rxBitmapHa if(nDestWidth != nSourceWidth) { float zoomX = static_cast<float>(nDestWidth) / static_cast<float>(nSourceWidth); - aSz.setWidth( static_cast<long>(static_cast<float>(aSz.Width()) * zoomX) ); + aSz.setWidth( static_cast<tools::Long>(static_cast<float>(aSz.Width()) * zoomX) ); } if(nDestHeight != nSourceHeight) { float zoomY = static_cast<float>(nDestHeight) / static_cast<float>(nSourceHeight); - aSz.setHeight( static_cast<long>(static_cast<float>(aSz.Height()) * zoomY) ); + aSz.setHeight( static_cast<tools::Long>(static_cast<float>(aSz.Height()) * zoomY) ); } if(nSourceX || nSourceY || aSz.Width() != nSourceWidth || aSz.Height() != nSourceHeight) diff --git a/toolkit/source/awt/vclxspinbutton.cxx b/toolkit/source/awt/vclxspinbutton.cxx index 7941f3760c9a..20a06c010618 100644 --- a/toolkit/source/awt/vclxspinbutton.cxx +++ b/toolkit/source/awt/vclxspinbutton.cxx @@ -94,7 +94,7 @@ namespace toolkit namespace { - typedef void (SpinButton::*SetSpinButtonValue) (long); + typedef void (SpinButton::*SetSpinButtonValue) (tools::Long); typedef long (SpinButton::*GetSpinButtonValue) () const; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 7bf211d7150f..12fb64bee90b 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -274,10 +274,10 @@ void MessBox::ImplPosControls() Size aImageSize; Size aPageSize; Size aMEditSize; - long nTitleWidth; - long nButtonSize = ImplGetButtonSize(); - long nMaxLineWidth; - long nWidth; + tools::Long nTitleWidth; + tools::Long nButtonSize = ImplGetButtonSize(); + tools::Long nMaxLineWidth; + tools::Long nWidth; WinBits nWinStyle = WB_LEFT | WB_NOLABEL; DrawTextFlags nTextStyle = DrawTextFlags::MultiLine | DrawTextFlags::Top | DrawTextFlags::Left; @@ -288,7 +288,7 @@ void MessBox::ImplPosControls() OUString aMessText(maMessText.replaceAll("\t", " ")); //If window too small, we make dialog box be wider - long nMaxWidth = 630 * GetDPIScaleFactor(); + tools::Long nMaxWidth = 630 * GetDPIScaleFactor(); // MessagBox should be at least as wide as to see the title // Extra-Width for Close button, because Close button is set after this call @@ -2209,7 +2209,7 @@ css::uno::Sequence< OUString > VCLXToolkit::getSupportedServiceNames() css::uno::Reference< css::awt::XTopWindow > SAL_CALL VCLXToolkit::getTopWindow(::sal_Int32 nIndex) { - vcl::Window * p = ::Application::GetTopWindow(static_cast< long >(nIndex)); + vcl::Window * p = ::Application::GetTopWindow(static_cast< tools::Long >(nIndex)); // XXX numeric overflow return css::uno::Reference< css::awt::XTopWindow >( p == nullptr ? nullptr : static_cast< css::awt::XWindow * >(p->GetWindowPeer()), diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 7909612e562e..554b5fc7f212 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -3741,7 +3741,7 @@ void VCLXScrollBar::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) css::awt::Size VCLXScrollBar::implGetMinimumSize( vcl::Window const * p ) { - long n = p->GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long n = p->GetSettings().GetStyleSettings().GetScrollBarSize(); return css::awt::Size( n, n ); } @@ -5482,7 +5482,7 @@ void VCLXNumericField::setValue( double Value ) // (e.g., input 105 using 2 digits returns 1,05) // Thus, to set a value of 1,05, insert 105 and 2 digits pNumericFormatter->SetValue( - static_cast<long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); + static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); // #107218# Call same listeners like VCL would do after user interaction VclPtr< Edit > pEdit = GetAs< Edit >(); @@ -5512,7 +5512,7 @@ void VCLXNumericField::setMin( double Value ) NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter()); if ( pNumericFormatter ) pNumericFormatter->SetMin( - static_cast<long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); + static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getMin() @@ -5532,7 +5532,7 @@ void VCLXNumericField::setMax( double Value ) NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter()); if ( pNumericFormatter ) pNumericFormatter->SetMax( - static_cast<long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); + static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getMax() @@ -5552,7 +5552,7 @@ void VCLXNumericField::setFirst( double Value ) NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter()); if ( pNumericFormatter ) pNumericFormatter->SetFirst( - static_cast<long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); + static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getFirst() @@ -5572,7 +5572,7 @@ void VCLXNumericField::setLast( double Value ) NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter()); if ( pNumericFormatter ) pNumericFormatter->SetLast( - static_cast<long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); + static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getLast() @@ -5602,7 +5602,7 @@ void VCLXNumericField::setSpinSize( double Value ) NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter()); if ( pNumericFormatter ) pNumericFormatter->SetSpinSize( - static_cast<long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); + static_cast<tools::Long>(ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() )) ); } double VCLXNumericField::getSpinSize() |