diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2020-12-22 10:54:27 +1100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-01-02 14:59:49 +0100 |
commit | ab2d3462f412d5180e60512df0dfb9c3b13ebf0c (patch) | |
tree | 6c873d8d8f2f6ad3ede20ffb068a5828684b3b11 /vcl/source/gdi | |
parent | dd91d3389c26645459d3b80649941d65efa4f63f (diff) |
tdf#74702 - vcl: introduce OutputDevice::GetDeviceInfo()
Change-Id: I02c9cc83fea330ed0ba1539b2682f75d33ba80fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108132
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/print.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 99931441de04..bb99579fcafc 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1644,4 +1644,19 @@ Bitmap Printer::GetBitmap( const Point& rSrcPt, const Size& rSize ) const return OutputDevice::GetBitmap( rSrcPt, rSize ); } +css::awt::DeviceInfo Printer::GetDeviceInfo() const +{ + Size aDevSz = GetPaperSizePixel(); + css::awt::DeviceInfo aInfo = GetCommonDeviceInfo(aDevSz); + Size aOutSz = GetOutputSizePixel(); + Point aOffset = GetPageOffset(); + aInfo.LeftInset = aOffset.X(); + aInfo.TopInset = aOffset.Y(); + aInfo.RightInset = aDevSz.Width() - aOutSz.Width() - aOffset.X(); + aInfo.BottomInset = aDevSz.Height() - aOutSz.Height() - aOffset.Y(); + aInfo.Capabilities = 0; + + return aInfo; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |