tdf#74702 vcl: extract GetButtonBorderSize()

Change-Id: Ibc1818453425cbe5dac3e16bfde9dbe93beb1311
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94725
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index fb58781..18c4754 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -535,6 +535,8 @@

    ///@}

public:
    virtual Size GetButtonBorderSize() { return Size(1, 1); };

    /** @name Direct OutputDevice drawing functions
     */
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 2a27e4c..6e0fd0d 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -240,6 +240,7 @@
    void                        DrawGradientEx( OutputDevice* pOut, const tools::Rectangle& rRect,
                                    const Gradient& rGradient );
    virtual Bitmap              GetBitmap( const Point& rSrcPt, const Size& rSize ) const override;
    virtual Size                GetButtonBorderSize() override;

    bool                        IsScreenComp() const override { return false; }

diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index c825d25..66ae902 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -946,6 +946,19 @@
    OutputDevice::dispose();
}

Size Printer::GetButtonBorderSize()
{
    Size aBrdSize(LogicToPixel(Size(20, 20), MapMode(MapUnit::Map100thMM)));

    if (!aBrdSize.Width())
        aBrdSize.setWidth(1);

    if (!aBrdSize.Height())
        aBrdSize.setHeight(1);

    return aBrdSize;
}

sal_uInt32 Printer::GetCapabilities( PrinterCapType nType ) const
{
    if ( IsDisplayPrinter() )
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 9111f74..2d418a0 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -480,15 +480,7 @@

        ImplDrawDPILineRect( pDev, aFillRect, &aBlackColor );

        Size aBrdSize( 1, 1 );
        if ( pDev->GetOutDevType() == OUTDEV_PRINTER )
        {
            aBrdSize = pDev->LogicToPixel( Size( 20, 20 ), MapMode(MapUnit::Map100thMM) );
            if ( !aBrdSize.Width() )
                aBrdSize.setWidth( 1 );
            if ( !aBrdSize.Height() )
                aBrdSize.setHeight( 1 );
        }
        Size aBrdSize(pDev->GetButtonBorderSize());

        pDev->SetLineColor();
        pDev->SetFillColor( aBlackColor );