svx/source/tbxctrls/tbunocontroller.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit cab77a48da1d481ddae24c9bd273ba4e7585b81c
Author:     Andreas Heinisch <[email protected]>
AuthorDate: Sun Sep 19 21:53:41 2021 +0200
Commit:     Andreas Heinisch <[email protected]>
CommitDate: Fri Oct 8 20:26:04 2021 +0200

    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 <[email protected]>

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 );
         }

Reply via email to