[Libreoffice-commits] libvisio.git: src/lib

Fridrich Štrba fridrich.strba at bluewin.ch
Mon Dec 14 01:58:12 PST 2015


 src/lib/VSDContentCollector.cpp |  141 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 140 insertions(+), 1 deletion(-)

New commits:
commit 8ce3cd43bfb1190574296b7fad873fe3fa16007d
Author: Fridrich Štrba <fridrich.strba at bluewin.ch>
Date:   Mon Dec 14 10:57:48 2015 +0100

    BIPU support of hatch fill
    
    Change-Id: Ia0eadd391e820f03795ca0742934b49b283153e9

diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index 79d351f..a1ef3ff 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -2476,6 +2476,145 @@ void libvisio::VSDContentCollector::_fillAndShadowProperties(const VSDFillStyle
     else
       styleProps.remove("draw:opacity");
   }
+  else if (style.pattern >= 2 && style.pattern <= 24)
+  {
+    styleProps.insert("draw:fill", "hatch");
+    if (style.bgTransparency == 1)
+      styleProps.insert("draw:fill-hatch-solid", "false");
+    else
+    {
+      styleProps.insert("draw:fill-hatch-solid", "true");
+      styleProps.insert("draw:opacity", (1 - (std::max)(style.fgTransparency, style.bgTransparency)), librevenge::RVNG_PERCENT);
+      styleProps.insert("draw:fill-color", getColourString(style.bgColour));
+    }
+
+    styleProps.insert("draw:color", getColourString(style.fgColour));
+    if (style.pattern == 2)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 45);
+      styleProps.insert("draw:distance", 0.1, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 3)
+    {
+      styleProps.insert("draw:style", "double");
+      styleProps.insert("draw:distance", 0.1, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 4)
+    {
+      styleProps.insert("draw:style", "double");
+      styleProps.insert("draw:rotation", 45);
+      styleProps.insert("draw:distance", 0.1, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 5)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 315);
+      styleProps.insert("draw:distance", 0.1, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 6)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:distance", 0.1, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 7)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 90);
+      styleProps.insert("draw:distance", 0.1, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 8)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 9)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 10)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 11)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 12)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 13)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 14)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 90);
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 15)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 315);
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 16)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 45);
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 17)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 18)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 19)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 20)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 90);
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 21)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 315);
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 22)
+    {
+      styleProps.insert("draw:style", "single");
+      styleProps.insert("draw:rotation", 45);
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 23)
+    {
+      styleProps.insert("draw:style", "double");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+    else if (style.pattern == 24)
+    {
+      styleProps.insert("draw:style", "triple");
+      styleProps.insert("draw:distance", 0.05, librevenge::RVNG_INCH);
+    }
+  }
   else if (style.pattern == 26 || style.pattern == 29)
   {
     styleProps.insert("draw:fill", "gradient");
@@ -2605,7 +2744,7 @@ void libvisio::VSDContentCollector::_fillAndShadowProperties(const VSDFillStyle
     }
   }
   else
-    // fill types we don't handle right, but let us approximate with solid fill
+    // fill types we don't handle right, but let us approximate with solid fill of background colour
   {
     styleProps.insert("draw:fill", "solid");
     styleProps.insert("draw:fill-color", getColourString(style.bgColour));


More information about the Libreoffice-commits mailing list