From 312c0abcff23a5bc7cf4442359ec48187ec06d48 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 27 Feb 2018 17:07:24 +0200 Subject: drop old tools/gen methods in vcl Change-Id: I863ce5ae46ae90f06780261fa17b087a7153c807 Reviewed-on: https://gerrit.libreoffice.org/50445 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/osx/salprn.cxx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'vcl/osx/salprn.cxx') 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(nDPIY)/72.0; NSSize aPaperSize = [mpPrintInfo paperSize]; - o_rPageWidth = static_cast( double(aPaperSize.width) * fXScaling ); - o_rPageHeight = static_cast( double(aPaperSize.height) * fYScaling ); + rPaperSize.setWidth( static_cast( double(aPaperSize.width) * fXScaling ) ); + rPaperSize.setHeight( static_cast( double(aPaperSize.height) * fYScaling ) ); NSRect aImageRect = [mpPrintInfo imageablePageBounds]; - o_rPageOffX = static_cast( aImageRect.origin.x * fXScaling ); - o_rPageOffY = static_cast( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ); + rPageOffset.setX( static_cast( aImageRect.origin.x * fXScaling ) ); + rPageOffset.setY( static_cast( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ) ); o_rOutWidth = static_cast( aImageRect.size.width * fXScaling ); o_rOutHeight = static_cast( 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; } } -- cgit