diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2020-05-24 00:40:57 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-02 10:54:19 +0200 |
commit | bb0039ca67f84d8c46e78f4209c17d2923790140 (patch) | |
tree | 3adf6ba8e0a201b0f01c76cb015f1da667b55956 | |
parent | e25334e1c1022b4741897a3e659fcbad5cde97c4 (diff) |
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>
-rw-r--r-- | include/vcl/outdev.hxx | 2 | ||||
-rw-r--r-- | include/vcl/print.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 13 | ||||
-rw-r--r-- | vcl/source/window/decoview.cxx | 10 |
4 files changed, 17 insertions, 9 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index fb58781479c4..18c47547d44a 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -535,6 +535,8 @@ public: ///@} +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 2a27e4c2469f..6e0fd0d15c76 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -240,6 +240,7 @@ public: 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 c825d25f3501..66ae9022faa8 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -946,6 +946,19 @@ void Printer::dispose() 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 9111f74027f6..2d418a0ad486 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -480,15 +480,7 @@ void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect, 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 ); |