summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-09-19 21:53:41 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2021-10-08 20:26:04 +0200
commitcab77a48da1d481ddae24c9bd273ba4e7585b81c (patch)
tree9cc27ca16d7a16c0fbf15abf0ad9ef832c7c82ce /svx/source/tbxctrls
parent3f5fb07565d0e08773ddfcda4d5acbb1446aa2f2 (diff)
tdf#83090 - Allow any font size in the toolbar/sidebar
In order to allow any font size in the toolbar/sidebar, correctly round the height of the font in the status listener. Change-Id: Iebd07f5e710a01c5a9be4a7dd8c950d191d5d629 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122332 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index a6da6df4b78e..8811d75dc2aa 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <rtl/math.hxx>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weldutils.hxx>
@@ -422,7 +423,11 @@ void SAL_CALL FontHeightToolBoxControl::statusChanged(
m_pBox->set_sensitive(true);
frame::status::FontHeight aFontHeight;
if ( rEvent.State >>= aFontHeight )
- m_pBox->statusChanged_Impl( tools::Long( 10. * aFontHeight.Height ), false );
+ {
+ // tdf#83090 - correctly round the height of the font
+ aFontHeight.Height = rtl::math::round(10. * aFontHeight.Height);
+ m_pBox->statusChanged_Impl(tools::Long(aFontHeight.Height), false);
+ }
else
m_pBox->statusChanged_Impl( tools::Long( -1 ), true );
}