summaryrefslogtreecommitdiff
path: root/vcl/osx/salprn.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-27 17:07:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-02 07:24:36 +0100
commit312c0abcff23a5bc7cf4442359ec48187ec06d48 (patch)
tree9f4b8be273c1560018f035a73294fcab9b1476a7 /vcl/osx/salprn.cxx
parent451ed3d595c5e2a32d820e1751e890f894832a9c (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/salprn.cxx')
-rw-r--r--vcl/osx/salprn.cxx26
1 files changed, 16 insertions, 10 deletions
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;
}
}