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@gmail.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6813ecc..e9822fc 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1667,6 +1667,7 @@
    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 edc5572..2a27e4c 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -271,6 +271,8 @@
    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 46a1457..6b99db3 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -502,10 +502,8 @@

    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 92d9e63..1ee5b7e 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -770,6 +770,14 @@
    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 )