summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorTomofumi Yagi <yagit@mknada.sakura.ne.jp>2011-10-20 11:03:54 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-10-20 11:05:17 +0200
commit8c2902ecbf135fae070ea032fa10a59bb76ec1b0 (patch)
tree7b87fcb52ef5eddf9998b9b4fee2652ec7959b8a /svtools
parent8eb50d3b4be4df15f830e4b36449c9fcf05aa71b (diff)
fdo#37129: Fix the drawing of dotted and dashed borders in Calc.
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/borderhelper.hxx3
-rw-r--r--svtools/source/control/ctrlbox.cxx18
2 files changed, 21 insertions, 0 deletions
diff --git a/svtools/inc/svtools/borderhelper.hxx b/svtools/inc/svtools/borderhelper.hxx
index de24369929f5..486eaef8ded1 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 810a41b6fbc1..bf412d4b8cc3 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -594,6 +594,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 )
{