tdf#74702: clean up of OutputDevice::SetMapMode

All changes are formatted using clang-format utility.

Change-Id: Icfa7ae22bc06e57c7f7cb512813966dcefd4fc40
Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/83601
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d0578b3..64ba3f1 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1673,6 +1673,10 @@
    void                        SetRelativeMapMode( const MapMode& rNewMapMode );
    const MapMode&              GetMapMode() const { return maMapMode; }

protected:
    virtual void ImplInitMapModeObjects();

public:
     // #i75163#
    basegfx::B2DHomMatrix       GetViewTransformation() const;
    basegfx::B2DHomMatrix       GetInverseViewTransformation() const;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8ea622a..a78259c 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -746,6 +746,7 @@

    void ImplClearFontData(bool bNewFontLists) override;
    void ImplRefreshFontData(bool bNewFontLists) override;
    void ImplInitMapModeObjects() override;

    // FIXME: this is a hack to workaround missing layout functionality
    virtual void                        ImplAdjustNWFSizes();
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 7ac99f6..92d9e63 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -666,11 +666,7 @@
        // create new objects (clip region are not re-scaled)
        mbNewFont   = true;
        mbInitFont  = true;
        if ( GetOutDevType() == OUTDEV_WINDOW )
        {
            if ( static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor )
                static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor->ImplNew();
        }
        ImplInitMapModeObjects();

        // #106426# Adapt logical offset when changing mapmode
        mnOutOffLogicX = mnOutOffOrigX; // no mapping -> equal offsets
@@ -760,11 +756,7 @@
    // create new objects (clip region are not re-scaled)
    mbNewFont   = true;
    mbInitFont  = true;
    if ( GetOutDevType() == OUTDEV_WINDOW )
    {
        if ( static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor )
            static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor->ImplNew();
    }
    ImplInitMapModeObjects();

    // #106426# Adapt logical offset when changing mapmode
    mnOutOffLogicX = ImplPixelToLogic( mnOutOffOrigX, mnDPIX,
@@ -778,6 +770,8 @@
    ImplInvalidateViewTransform();
}

void OutputDevice::ImplInitMapModeObjects() {}

void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
{
    // do nothing if MapMode did not change
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index 565a81e..c99d085 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -20,6 +20,7 @@
#include <vcl/window.hxx>
#include <vcl/waitobj.hxx>
#include <window.h>
#include <vcl/cursor.hxx>

WaitObject::~WaitObject()
{
@@ -55,7 +56,13 @@
        pChild->ImplRefreshFontData(bNewFontLists);
}

} /* namespace vcl */
void Window::ImplInitMapModeObjects()
{
    OutputDevice::ImplInitMapModeObjects();
    if (mpWindowImpl->mpCursor)
        mpWindowImpl->mpCursor->ImplNew();
}

} /* namespace vcl */

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */