summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 22:13:59 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 22:13:59 +0000
commitf1d204f98f1a0005b4b4ee94f7a3ecfb60d99fc7 (patch)
tree64dba918bbc538e34e3f7d6f0fcceb39b6f998f4 /svx/source/sdr
parent01d5b4a0004c7d48440351a1b1bf1ad9ad703a2a (diff)
INTEGRATION: CWS aw033 (1.3.10); FILE MERGED
2008/05/14 14:00:02 aw 1.3.10.4: RESYNC: (1.4-1.5); FILE MERGED 2008/03/14 13:50:17 cl 1.3.10.3: RESYNC: (1.3-1.4); FILE MERGED 2007/12/17 10:22:19 aw 1.3.10.2: #i39532# minor primitive corrections 2007/11/07 14:34:33 aw 1.3.10.1: #i39532# committing to have a base for HDU
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/overlay/overlayobject.cxx55
1 files changed, 25 insertions, 30 deletions
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index e9ff803066..698ab7dd5a 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: overlayobject.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
* This file is part of OpenOffice.org.
*
@@ -74,14 +74,12 @@ namespace sdr
{
if(getOverlayManager())
{
- basegfx::B2DPolygon aPolygon;
- aPolygon.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY()));
- aPolygon.append(basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY()));
- aPolygon.append(basegfx::B2DPoint(rRange.getMaxX(), rRange.getMaxY()));
- aPolygon.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
- aPolygon.setClosed(true);
-
- ImpDrawPolygonStriped(rOutputDevice, aPolygon);
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange));
+
+ if(aPolygon.count())
+ {
+ ImpDrawPolygonStriped(rOutputDevice, aPolygon);
+ }
}
}
@@ -91,17 +89,21 @@ namespace sdr
{
const basegfx::B2DPoint aStart(x1, y1);
const basegfx::B2DPoint aEnd(x2, y2);
- basegfx::B2DPolygon aPolygon;
- aPolygon.append(aStart);
- aPolygon.append(aEnd);
-
- ImpDrawPolygonStriped(rOutputDevice, aPolygon);
+
+ if(!aStart.equal(aEnd))
+ {
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append(aStart);
+ aPolygon.append(aEnd);
+
+ ImpDrawPolygonStriped(rOutputDevice, aPolygon);
+ }
}
}
void OverlayObject::ImpDrawLineStriped(OutputDevice& rOutputDevice, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd)
{
- if(getOverlayManager())
+ if(getOverlayManager() && !rStart.equal(rEnd))
{
basegfx::B2DPolygon aPolygon;
aPolygon.append(rStart);
@@ -113,7 +115,7 @@ namespace sdr
void OverlayObject::ImpDrawPolygonStriped(OutputDevice& rOutputDevice, const basegfx::B2DPolygon& rPolygon)
{
- if(getOverlayManager())
+ if(getOverlayManager() && rPolygon.count())
{
const sal_uInt32 nLenPixel(getOverlayManager()->getStripeLengthPixel());
const Size aDashSizePixel(nLenPixel, nLenPixel);
@@ -121,22 +123,15 @@ namespace sdr
const double fDashLength(aDashSizeLogic.Width());
const double fFullDotDashLength(fDashLength + fDashLength);
- // fill DashDot vector A
- ::std::vector<double> aDashDotArrayA;
- aDashDotArrayA.push_back(fDashLength);
- aDashDotArrayA.push_back(fDashLength);
-
- // fill DashDot vector B
- ::std::vector<double> aDashDotArrayB;
- aDashDotArrayB.push_back(0.0);
- aDashDotArrayB.push_back(fDashLength);
- aDashDotArrayB.push_back(fDashLength);
+ // fill DashDot vector
+ ::std::vector<double> aDotDashArray;
+ aDotDashArray.push_back(fDashLength);
+ aDotDashArray.push_back(fDashLength);
// get dash polygons
- basegfx::B2DPolyPolygon aStripesA = basegfx::tools::applyLineDashing(rPolygon, aDashDotArrayA, fFullDotDashLength);
- aStripesA = basegfx::tools::mergeDashedLines(aStripesA);
- basegfx::B2DPolyPolygon aStripesB = basegfx::tools::applyLineDashing(rPolygon, aDashDotArrayB, fFullDotDashLength);
- aStripesB = basegfx::tools::mergeDashedLines(aStripesB);
+ basegfx::B2DPolyPolygon aStripesA;
+ basegfx::B2DPolyPolygon aStripesB;
+ basegfx::tools::applyLineDashing(rPolygon, aDotDashArray, &aStripesA, &aStripesB, fFullDotDashLength);
// draw stripes A
if(aStripesA.count())