summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-11-09 13:16:29 +0200
committerAndras Timar <andras.timar@collabora.com>2022-03-15 13:00:28 +0100
commit3616578d615a3f8ca030f407e4da2b9addd037ca (patch)
tree87b77f93fdf7cd22bedbfae22b1c7c97b6c0615d
parenttdf#145354: Don't claim random paper sizes from the system are "User Defined" (diff)
downloadcore-3616578d615a3f8ca030f407e4da2b9addd037ca.tar.gz
core-3616578d615a3f8ca030f407e4da2b9addd037ca.zip
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 <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124925 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--include/vcl/print.hxx3
-rw-r--r--vcl/source/gdi/print.cxx5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 3d50fd089a60..34a154f64aff 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -294,7 +294,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 fb3e5de9a95b..ba7c63296c97 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1470,6 +1470,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() )