summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2007-07-06 12:22:13 +0000
committerRüdiger Timm <rt@openoffice.org>2007-07-06 12:22:13 +0000
commit046d584624e3e01a7c6bd31c388b9d6dff5239a3 (patch)
tree919e0400140b448158d45dba47eadf05543bcb26 /svx/source
parent4a1d2d62988bbde3769350ca4ca1387c7d6f7d21 (diff)
INTEGRATION: CWS pathfinder01 (1.41.80); FILE MERGED
2007/07/01 16:48:52 cl 1.41.80.1: #i41800# added helper class for high level polypolygon editing
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdopath.cxx44
1 files changed, 11 insertions, 33 deletions
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 39fb0e1c78ac..379427241d36 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: svdopath.cxx,v $
*
- * $Revision: 1.42 $
+ * $Revision: 1.43 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 19:07:53 $
+ * last change: $Author: rt $ $Date: 2007-07-06 13:22:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -64,6 +64,8 @@
#include <svx/xflclit.hxx>
#include <svx/svdogrp.hxx>
+#include "polypolygoneditor.hxx"
+
#ifndef _SVX_XLNTRIT_HXX
#include <svx/xlntrit.hxx>
#endif
@@ -112,6 +114,8 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <basegfx/polygon/b2dpolygontools.hxx>
#endif
+using namespace sdr;
+
inline USHORT GetPrevPnt(USHORT nPnt, USHORT nPntMax, FASTBOOL bClosed)
{
if (nPnt>0) {
@@ -914,7 +918,7 @@ FASTBOOL ImpPathForDragAndCreate::EndDrag(SdrDragStat& rDrag)
basegfx::B2DPolyPolygon aTempPolyPolygon(aPathPolygon.getB2DPolyPolygon());
sal_uInt32 nPoly,nPnt;
- if(SdrPathObj::ImpFindPolyPnt(aTempPolyPolygon, rDrag.GetHdl()->GetSourceHdlNum(), nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(aTempPolyPolygon, rDrag.GetHdl()->GetSourceHdlNum(), nPoly, nPnt))
{
basegfx::B2DPolygon aCandidate(aTempPolyPolygon.getB2DPolygon(nPoly));
aCandidate.remove(nPnt);
@@ -1697,32 +1701,6 @@ SdrPathObj::~SdrPathObj()
impDeleteDAC();
}
-sal_Bool SdrPathObj::ImpFindPolyPnt(const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum)
-{
- const sal_uInt32 nPolyCount(rPoly.count());
- sal_uInt32 nPolyNum(0L);
-
- while(nPolyNum < nPolyCount)
- {
- const sal_uInt32 nPointCount(rPoly.getB2DPolygon(nPolyNum).count());
-
- if(nAbsPnt < nPointCount)
- {
- rPolyNum = nPolyNum;
- rPointNum = nAbsPnt;
-
- return true;
- }
- else
- {
- nPolyNum++;
- nAbsPnt -= nPointCount;
- }
- }
-
- return false;
-}
-
sal_Bool ImpIsLine(const basegfx::B2DPolyPolygon& rPolyPolygon)
{
return (1L == rPolyPolygon.count() && 2L == rPolyPolygon.getB2DPolygon(0L).count());
@@ -2622,7 +2600,7 @@ sal_uInt32 SdrPathObj::GetSnapPointCount() const
Point SdrPathObj::GetSnapPoint(sal_uInt32 nSnapPnt) const
{
sal_uInt32 nPoly,nPnt;
- if(!ImpFindPolyPnt(GetPathPoly(), nSnapPnt, nPoly, nPnt))
+ if(!PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nSnapPnt, nPoly, nPnt))
{
DBG_ASSERT(FALSE,"SdrPathObj::GetSnapPoint: Punkt nSnapPnt nicht vorhanden!");
}
@@ -2654,7 +2632,7 @@ Point SdrPathObj::GetPoint(sal_uInt32 nHdlNum) const
Point aRetval;
sal_uInt32 nPoly,nPnt;
- if(ImpFindPolyPnt(GetPathPoly(), nHdlNum, nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nHdlNum, nPoly, nPnt))
{
const basegfx::B2DPolygon aPoly(GetPathPoly().getB2DPolygon(nPoly));
const basegfx::B2DPoint aPoint(aPoly.getB2DPoint(nPnt));
@@ -2668,7 +2646,7 @@ void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum)
{
sal_uInt32 nPoly,nPnt;
- if(ImpFindPolyPnt(GetPathPoly(), nHdlNum, nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nHdlNum, nPoly, nPnt))
{
basegfx::B2DPolygon aNewPolygon(GetPathPoly().getB2DPolygon(nPoly));
aNewPolygon.setB2DPoint(nPnt, basegfx::B2DPoint(rPnt.X(), rPnt.Y()));
@@ -2837,7 +2815,7 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
const basegfx::B2DPolyPolygon aLocalPolyPolygon(GetPathPoly());
sal_uInt32 nPoly, nPnt;
- if(ImpFindPolyPnt(aLocalPolyPolygon, nHdlNum, nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(aLocalPolyPolygon, nHdlNum, nPoly, nPnt))
{
if(0L == nPoly)
{