include/vcl/print.hxx    |    3 +++
 vcl/source/gdi/print.cxx |    5 +++++
 2 files changed, 8 insertions(+)

New commits:
commit 1134aad621a96a23af88aaa50e10e328ea58a502
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Tue Nov 9 13:16:29 2021 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Nov 9 13:44:24 2021 +0100

    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 <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index f67145335357..83f4170c241c 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -230,7 +230,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 88143e27ce29..0d6cf081ce41 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1471,6 +1471,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() )

Reply via email to