cppcanvas/source/mtfrenderer/emfppen.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit ff7f5e1bbd4a9a3e3fa3e4ddb349c97605dc8a01
Author: Bartosz Kosiorek <gan...@poczta.onet.pl>
Date:   Sun May 7 02:57:26 2017 +0200

    tdf#31814 Introduce minimal value of line width to fix EMF+ import issues
    
    Based on observation of different EMF+ files (eg. exported by ChemDraw),
    there is minimal value of line width.
    This commit is fixing all such import issues.
    
    Change-Id: I5c26a1b511363eb1e429bf770ad0f482b124ecb5
    Reviewed-on: https://gerrit.libreoffice.org/37319
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl>

diff --git a/cppcanvas/source/mtfrenderer/emfppen.cxx 
b/cppcanvas/source/mtfrenderer/emfppen.cxx
index 03014b37b7a7..b3b0c97dcb8a 100755
--- a/cppcanvas/source/mtfrenderer/emfppen.cxx
+++ b/cppcanvas/source/mtfrenderer/emfppen.cxx
@@ -103,12 +103,16 @@ namespace cppcanvas
 
         void EMFPPen::SetStrokeWidth(rendering::StrokeAttributes& 
rStrokeAttributes, ImplRenderer& rR, const OutDevState& rState)
         {
-#if OSL_DEBUG_LEVEL > 1
-            if (penWidth == 0.0) {
-                SAL_INFO("cppcanvas.emf", "TODO: pen with zero width - using 
minimal which might not be correct");
-            }
-#endif
+            // If a zero width is specified, a minimum value is used, which is 
determined by the units.
+            //TODO Add support for other units than Pixel
             rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * 
rR.MapSize(penWidth == 0.0 ? 0.05 : penWidth, 0)).getLength());
+
+            // tdf#31814 Based on observation of different EMF+ files (eg. 
exported by ChemDraw),
+            // there is minimal value of line width
+            if (rStrokeAttributes.StrokeWidth < 1.0)
+            {
+                rStrokeAttributes.StrokeWidth = 1.0;
+            }
         }
 
         /// Convert stroke caps between EMF+ and rendering API
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to