[Libreoffice-commits] core.git: drawinglayer/source
Stephan Bergmann
sbergman at redhat.com
Mon Nov 3 09:11:47 PST 2014
drawinglayer/source/primitive2d/textlayoutdevice.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 4c30eb7a067b5a8dfe04689d37ff6a775acaf10a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Nov 3 18:11:01 2014 +0100
Zero font width means non-scaled
...so make sure to always round small width of a scaled font to one, not zero.
Change-Id: I032b28e7f7183770db134f5891393ceaf39e0103
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index df8617c..12e83f6 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);
More information about the Libreoffice-commits
mailing list