diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-27 17:07:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-02 07:24:36 +0100 |
commit | 312c0abcff23a5bc7cf4442359ec48187ec06d48 (patch) | |
tree | 9f4b8be273c1560018f035a73294fcab9b1476a7 /vcl/osx | |
parent | 451ed3d595c5e2a32d820e1751e890f894832a9c (diff) |
drop old tools/gen methods in vcl
Change-Id: I863ce5ae46ae90f06780261fa17b087a7153c807
Reviewed-on: https://gerrit.libreoffice.org/50445
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salframe.cxx | 8 | ||||
-rw-r--r-- | vcl/osx/salnativewidgets.cxx | 26 | ||||
-rw-r--r-- | vcl/osx/salprn.cxx | 26 |
3 files changed, 33 insertions, 27 deletions
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 5b00f7242900..7b5b203668d8 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1341,10 +1341,10 @@ void AquaSalFrame::GetWorkArea( tools::Rectangle& rRect ) pScreen = [NSScreen mainScreen]; NSRect aRect = [pScreen visibleFrame]; CocoaToVCL( aRect ); - rRect.Left() = static_cast<long>(aRect.origin.x); - rRect.Top() = static_cast<long>(aRect.origin.y); - rRect.Right() = static_cast<long>(aRect.origin.x + aRect.size.width - 1); - rRect.Bottom() = static_cast<long>(aRect.origin.y + aRect.size.height - 1); + rRect.SetLeft( static_cast<long>(aRect.origin.x) ); + rRect.SetTop( static_cast<long>(aRect.origin.y) ); + rRect.SetRight( static_cast<long>(aRect.origin.x + aRect.size.width - 1) ); + rRect.SetBottom( static_cast<long>(aRect.origin.y + aRect.size.height - 1) ); } SalPointerState AquaSalFrame::GetPointerState() diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 811960f1b92e..9e5008703549 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -126,19 +126,19 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart, switch( nPart ) { case ControlPart::ButtonUp: - rResultRect.Bottom() = rResultRect.Top(); + rResultRect.SetBottom( rResultRect.Top() ); break; case ControlPart::ButtonDown: - rResultRect.Top() = rResultRect.Bottom(); + rResultRect.SetTop( rResultRect.Bottom() ); break; case ControlPart::ButtonLeft: - rResultRect.Right() = rResultRect.Left(); + rResultRect.SetRight( rResultRect.Left() ); break; case ControlPart::ButtonRight: - rResultRect.Left() = rResultRect.Right(); + rResultRect.SetLeft( rResultRect.Right() ); break; case ControlPart::TrackHorzArea: @@ -1120,9 +1120,9 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa { tools::Rectangle aRect( aCtrlBoundRect ); if( aRect.GetHeight() < 16 ) - aRect.Bottom() = aRect.Top() + 9; // values taken from HIG for medium progress + aRect.SetBottom( aRect.Top() + 9 ); // values taken from HIG for medium progress else - aRect.Bottom() = aRect.Top() + 15; // values taken from HIG for large progress + aRect.SetBottom( aRect.Top() + 15 ); // values taken from HIG for large progress rNativeBoundingRegion = aRect; rNativeContentRegion = aRect; toReturn = true; @@ -1132,7 +1132,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa case ControlType::IntroProgress: { tools::Rectangle aRect( aCtrlBoundRect ); - aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress + aRect.SetBottom( aRect.Top() + INTRO_PROGRESS_HEIGHT ); // values taken from HIG for medium progress rNativeBoundingRegion = aRect; rNativeContentRegion = aRect; toReturn = true; @@ -1277,17 +1277,17 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa tools::Rectangle aRect(aCtrlBoundRect); if( nStyle == DrawFrameStyle::DoubleIn ) { - aRect.Left() += 1; - aRect.Top() += 1; + aRect.AdjustLeft(1); + aRect.AdjustTop(1); //rRect.Right() -= 1; //rRect.Bottom() -= 1; } else { - aRect.Left() += 1; - aRect.Top() += 1; - aRect.Right() -= 1; - aRect.Bottom() -= 1; + aRect.AdjustLeft(1); + aRect.AdjustTop(1); + aRect.AdjustRight(-1); + aRect.AdjustBottom(-1); } rNativeContentRegion = aRect; diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index e77d2c39a3fc..b87585de91db 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -294,8 +294,8 @@ sal_uInt32 AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup*, PrinterCapT void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, long& o_rOutWidth, long& o_rOutHeight, - long& o_rPageOffX, long& o_rPageOffY, - long& o_rPageWidth, long& o_rPageHeight ) + Point& rPageOffset, + Size& rPaperSize ) { if( mpPrintInfo ) { @@ -305,20 +305,26 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, fYScaling = static_cast<double>(nDPIY)/72.0; NSSize aPaperSize = [mpPrintInfo paperSize]; - o_rPageWidth = static_cast<long>( double(aPaperSize.width) * fXScaling ); - o_rPageHeight = static_cast<long>( double(aPaperSize.height) * fYScaling ); + rPaperSize.setWidth( static_cast<long>( double(aPaperSize.width) * fXScaling ) ); + rPaperSize.setHeight( static_cast<long>( double(aPaperSize.height) * fYScaling ) ); NSRect aImageRect = [mpPrintInfo imageablePageBounds]; - o_rPageOffX = static_cast<long>( aImageRect.origin.x * fXScaling ); - o_rPageOffY = static_cast<long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ); + rPageOffset.setX( static_cast<long>( aImageRect.origin.x * fXScaling ) ); + rPageOffset.setY( static_cast<long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ) ); o_rOutWidth = static_cast<long>( aImageRect.size.width * fXScaling ); o_rOutHeight = static_cast<long>( aImageRect.size.height * fYScaling ); if( mePageOrientation == Orientation::Landscape ) { std::swap( o_rOutWidth, o_rOutHeight ); - std::swap( o_rPageWidth, o_rPageHeight ); - std::swap( o_rPageOffX, o_rPageOffY ); + // swap width and height + long n = rPaperSize.Width(); + rPaperSize.setWidth(rPaperSize.Height()); + rPaperSize.setHeight(n); + // swap offset x and y + n = rPageOffset.X(); + rPageOffset.setX(rPageOffset.Y()); + rPageOffset.setY(n); } } } @@ -333,8 +339,8 @@ static Size getPageSize( vcl::PrinterController const & i_rController, sal_Int32 { awt::Size aSize; aPageParms[ nProperty].Value >>= aSize; - aPageSize.Width() = aSize.Width; - aPageSize.Height() = aSize.Height; + aPageSize.setWidth( aSize.Width ); + aPageSize.setHeight( aSize.Height ); break; } } |