summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/source/font/fontselect.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx
index 927e1106c5b6..8e62cf080808 100644
--- a/vcl/source/font/fontselect.cxx
+++ b/vcl/source/font/fontselect.cxx
@@ -18,6 +18,7 @@
*/
#include <sal/config.h>
+#include <o3tl/safeint.hxx>
#include <PhysicalFontFace.hxx>
#include <svdata.hxx>
@@ -62,9 +63,9 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont
// normalize width and height
if( mnHeight < 0 )
- mnHeight = -mnHeight;
+ mnHeight = o3tl::saturating_toggle_sign(mnHeight);
if( mnWidth < 0 )
- mnWidth = -mnWidth;
+ mnWidth = o3tl::saturating_toggle_sign(mnWidth);
}