[Libreoffice-commits] .: Branch 'libreoffice-3-4' - svtools/inc svtools/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Oct 26 08:59:35 PDT 2011


 svtools/inc/svtools/borderhelper.hxx |    3 +++
 svtools/source/control/ctrlbox.cxx   |   18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

New commits:
commit d3728312e7655a3580113470461f5fcf04b9c7a2
Author: Tomofumi Yagi <yagit at mknada.sakura.ne.jp>
Date:   Wed Oct 26 11:37:10 2011 -0400

    fdo#37129: Fix the drawing of dotted and dashed borders in Calc.
    
    Signed-off-by: Kohei Yoshida <kohei.yoshida at suse.com>

diff --git a/svtools/inc/svtools/borderhelper.hxx b/svtools/inc/svtools/borderhelper.hxx
index de24369..486eaef 100644
--- a/svtools/inc/svtools/borderhelper.hxx
+++ b/svtools/inc/svtools/borderhelper.hxx
@@ -42,6 +42,9 @@ namespace svtools
     SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
             sal_uInt16 nDashing, MapUnit eUnit );
 
+    SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
+            sal_uInt16 nDashing, MapUnit eUnit, double fScale );
+
     SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const basegfx::B2DPoint& rBeg,
             const basegfx::B2DPoint& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing );
 
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 9305e18..70a040e 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -579,6 +579,24 @@ namespace svtools
         return aPolygons;
     }
 
+    basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, MapUnit eUnit, double fScale )
+    {
+        std::vector< double > aPattern = GetDashing( nDashing, eUnit );
+        std::vector< double >::iterator i = aPattern.begin();
+        while( i != aPattern.end() ) {
+            (*i) *= fScale;
+            ++i;
+        }
+
+        basegfx::B2DPolyPolygon aPolygons;
+        if ( ! aPattern.empty() )
+            basegfx::tools::applyLineDashing( rPolygon, aPattern, &aPolygons );
+        else
+            aPolygons.append( rPolygon );
+
+        return aPolygons;
+    }
+
     void DrawLine( OutputDevice& rDev, const Point& rP1, const Point& rP2,
         sal_uInt32 nWidth, sal_uInt16 nDashing )
     {


More information about the Libreoffice-commits mailing list