[Libreoffice-commits] core.git: include/vcl vcl/source
Chris Sherlock (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 1 05:21:17 UTC 2020
include/vcl/outdev.hxx | 1 +
include/vcl/print.hxx | 2 ++
vcl/source/gdi/gdimtf.cxx | 6 ++----
vcl/source/outdev/map.cxx | 8 ++++++++
4 files changed, 13 insertions(+), 4 deletions(-)
New commits:
commit 201651953740edd3e9eb0b4fcbdcd4bf1a79a2c1
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Sun May 24 00:11:42 2020 +1000
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 1 07:20:41 2020 +0200
tdf#74702 vcl: extract SetMetafileMapMode()
Change-Id: Icdd9d612b998d260c4cf0e30fb38e72b5ebd3194
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94723
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6813eccd51ee..e9822fc37049 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1667,6 +1667,7 @@ public:
void SetMapMode();
virtual void SetMapMode( const MapMode& rNewMapMode );
void SetRelativeMapMode( const MapMode& rNewMapMode );
+ virtual void SetMetafileMapMode(const MapMode& rNewMapMode, bool bIsRecord);
const MapMode& GetMapMode() const { return maMapMode; }
protected:
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index edc55728e5f0..2a27e4c2469f 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -271,6 +271,8 @@ public:
virtual ~Printer() override;
virtual void dispose() override;
+ virtual void SetMetafileMapMode(const MapMode& rNewMapMode, bool) override { SetMapMode(rNewMapMode); }
+
static const std::vector< OUString >&
GetPrinterQueues();
static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate );
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 46a145750609..6b99db3ab3ee 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -502,10 +502,8 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
pOut->Push();
- if ( pMtf && pMtf->IsRecord() && ( pOut->GetOutDevType() != OUTDEV_PRINTER ) )
- pOut->SetRelativeMapMode( aDrawMap );
- else
- pOut->SetMapMode( aDrawMap );
+ bool bIsRecord = (pMtf && pMtf->IsRecord());
+ pOut->SetMetafileMapMode(aDrawMap, bIsRecord);
// #i23407# Set backwards-compatible text language and layout mode
// This is necessary, since old metafiles don't even know of these
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 92d9e63224e7..1ee5b7e93a32 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -770,6 +770,14 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
ImplInvalidateViewTransform();
}
+void OutputDevice::SetMetafileMapMode(const MapMode& rNewMapMode, bool bIsRecord)
+{
+ if (bIsRecord)
+ SetRelativeMapMode(rNewMapMode);
+ else
+ SetMapMode(rNewMapMode);
+}
+
void OutputDevice::ImplInitMapModeObjects() {}
void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
More information about the Libreoffice-commits
mailing list