From 724920d6074abdba210436c625329e395ae1b238 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 9 Nov 2021 13:16:29 +0200 Subject: Add Printer::GetSizeOfPaper() with semantics to match GetPaper() Will be used in follow-up commits. Change-Id: I18b167a217a4f82d8b6605e2ba14f1ddc6e98324 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124910 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124925 Tested-by: Andras Timar Reviewed-by: Andras Timar --- include/vcl/print.hxx | 3 +++ vcl/source/gdi/print.cxx | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 5ce81b9a9a27..c65009276a89 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -314,7 +314,10 @@ public: sal_uInt16 GetPaperBin() const; void SetPaper( Paper ePaper ); bool SetPaperSizeUser( const Size& rSize ); + /** @return The paper format of the printer's current "jobsetup". Note that if PAPER_USER the actual size can be anything. */ Paper GetPaper() const; + /** @return Size of the paper of the printer's current "jobsetup". */ + Size GetSizeOfPaper() const; static OUString GetPaperName( Paper ePaper ); /** @return Number of available paper formats */ diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index e6386ef17048..35de14ee5a73 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1462,6 +1462,11 @@ Paper Printer::GetPaper() const return maJobSetup.ImplGetConstData().GetPaperFormat(); } +Size Printer::GetSizeOfPaper() const +{ + return Size(maJobSetup.ImplGetConstData().GetPaperWidth(), maJobSetup.ImplGetConstData().GetPaperHeight()); +} + sal_uInt16 Printer::GetPaperBinCount() const { if ( IsDisplayPrinter() ) -- cgit