summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive2d/textlayoutdevice.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/primitive2d/textlayoutdevice.cxx')
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index df8617c409c4..12e83f6baf09 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <algorithm>
+
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/scoped_disposing_ptr.hxx>
@@ -394,7 +398,7 @@ namespace drawinglayer
vcl::Font aRetval(
rFontAttribute.getFamilyName(),
rFontAttribute.getStyleName(),
- Size(bFontIsScaled ? nWidth : 0, nHeight));
+ Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight));
#endif
// define various other FontAttribute
aRetval.SetAlign(ALIGN_BASELINE);