summaryrefslogtreecommitdiff
path: root/sd/source/ui/func/fuconbez.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-11-14 13:27:41 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-11-14 13:27:41 +0000
commitc6a4b9180629327f590519aa56da001a32c650d5 (patch)
tree72a00e287de91130958ce8dfd5dbb1f5f36f3507 /sd/source/ui/func/fuconbez.cxx
parent59f97b703aed6a17e2f31c527060fe0cc2f20727 (diff)
INTEGRATION: CWS aw024 (1.10.28); FILE MERGED
2006/09/21 23:10:44 aw 1.10.28.8: RESYNC: (1.13-1.14); FILE MERGED 2006/05/12 20:28:57 aw 1.10.28.7: RESYNC: (1.12-1.13); FILE MERGED 2006/01/26 19:50:45 aw 1.10.28.6: RESYNC: (1.11-1.12); FILE MERGED 2005/09/17 11:23:04 aw 1.10.28.5: RESYNC: (1.10-1.11); FILE MERGED 2005/05/26 11:24:30 aw 1.10.28.4: #i39531# 2005/05/19 12:11:24 aw 1.10.28.3: #i39529# 2005/05/12 16:46:23 aw 1.10.28.2: #i39529# 2005/04/26 14:58:37 aw 1.10.28.1: #i39528#
Diffstat (limited to 'sd/source/ui/func/fuconbez.cxx')
-rw-r--r--sd/source/ui/func/fuconbez.cxx129
1 files changed, 67 insertions, 62 deletions
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index a4a363069483..bc978f3d817b 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: fuconbez.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: obo $ $Date: 2006-09-16 18:47:39 $
+ * last change: $Author: ihi $ $Date: 2006-11-14 14:27:41 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -89,6 +89,14 @@
#include "drawdoc.hxx"
#include "res_bmp.hrc"
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#endif
+
namespace sd {
TYPEINIT1( FuConstructBezierPolygon, FuConstruct );
@@ -163,7 +171,7 @@ BOOL FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
/******************************************************************
* Klebepunkt einfuegen
******************************************************************/
- pView->BegInsObjPoint(aMDPos, rMEvt.IsMod1(), NULL, 0);
+ pView->BegInsObjPoint(aMDPos, rMEvt.IsMod1());
}
else
{
@@ -208,7 +216,7 @@ BOOL FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt)
SdrViewEvent aVEvt;
SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt);
- ULONG nCount = pView->GetPageViewPvNum(0)->GetObjList()->GetObjCount();
+ ULONG nCount = pView->GetSdrPageView()->GetObjList()->GetObjCount();
if (pView->IsInsObjPoint())
{
@@ -223,7 +231,7 @@ BOOL FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt)
{
bReturn = TRUE;
- if (nCount != pView->GetPageViewPvNum(0)->GetObjList()->GetObjCount())
+ if (nCount != pView->GetSdrPageView()->GetObjList()->GetObjCount())
{
bCreated = TRUE;
}
@@ -388,7 +396,7 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
{
if(pObj->ISA(SdrPathObj))
{
- XPolyPolygon aPoly;
+ ::basegfx::B2DPolyPolygon aPoly;
switch(nID)
{
@@ -396,99 +404,96 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
{
sal_Int32 nWdt(rRectangle.GetWidth() / 2);
sal_Int32 nHgt(rRectangle.GetHeight() / 2);
-
- XPolygon aInnerPoly(rRectangle.Center(), nWdt, nHgt);
-
- aPoly.Insert(aInnerPoly);
+ ::basegfx::B2DPolygon aInnerPoly(::basegfx::tools::createPolygonFromEllipse(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()), nWdt, nHgt));
+ aPoly.append(aInnerPoly);
break;
}
case SID_DRAW_BEZIER_NOFILL:
{
- XPolygon aInnerPoly;
- aInnerPoly[0] = rRectangle.BottomLeft();
- aInnerPoly[1] = rRectangle.BottomCenter();
- aInnerPoly[2] = rRectangle.BottomCenter();
- aInnerPoly[3] = rRectangle.Center();
- aInnerPoly[4] = rRectangle.TopCenter();
- aInnerPoly[5] = rRectangle.TopCenter();
- aInnerPoly[6] = rRectangle.TopRight();
-
- aInnerPoly.SetFlags(1, XPOLY_CONTROL);
- aInnerPoly.SetFlags(2, XPOLY_CONTROL);
- aInnerPoly.SetFlags(3, XPOLY_SYMMTR);
- aInnerPoly.SetFlags(4, XPOLY_CONTROL);
- aInnerPoly.SetFlags(5, XPOLY_CONTROL);
-
- aPoly.Insert(aInnerPoly);
+ ::basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.setControlPointA(0L, ::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ aInnerPoly.setControlPointB(0L, aInnerPoly.getControlPointA(0L));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ aInnerPoly.setControlPointA(1L, ::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()));
+ aInnerPoly.setControlPointB(1L, aInnerPoly.getControlPointA(1L));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
+ aPoly.append(aInnerPoly);
break;
}
case SID_DRAW_FREELINE:
case SID_DRAW_FREELINE_NOFILL:
{
- XPolygon aInnerPoly;
- aInnerPoly[0] = rRectangle.BottomLeft();
- aInnerPoly[1] = rRectangle.TopLeft();
- aInnerPoly[2] = rRectangle.TopCenter();
- aInnerPoly[3] = rRectangle.Center();
- aInnerPoly[4] = rRectangle.BottomCenter();
- aInnerPoly[5] = rRectangle.BottomRight();
- aInnerPoly[6] = rRectangle.TopRight();
-
- aInnerPoly.SetFlags(1, XPOLY_CONTROL);
- aInnerPoly.SetFlags(2, XPOLY_CONTROL);
- aInnerPoly.SetFlags(3, XPOLY_SMOOTH);
- aInnerPoly.SetFlags(4, XPOLY_CONTROL);
- aInnerPoly.SetFlags(5, XPOLY_CONTROL);
+ ::basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.setControlPointA(0L, ::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
+ aInnerPoly.setControlPointB(0L, ::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ aInnerPoly.setControlPointA(1L, ::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ aInnerPoly.setControlPointB(1L, ::basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
if(SID_DRAW_FREELINE == nID)
{
- aInnerPoly[7] = rRectangle.BottomRight();
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
+ }
+ else
+ {
+ aInnerPoly.setClosed(true);
}
- aPoly.Insert(aInnerPoly);
+ aPoly.append(aInnerPoly);
break;
}
case SID_DRAW_XPOLYGON:
case SID_DRAW_XPOLYGON_NOFILL:
{
- XPolygon aInnerPoly;
- aInnerPoly[0] = rRectangle.BottomLeft();
- aInnerPoly[1] = rRectangle.TopLeft();
- aInnerPoly[2] = rRectangle.TopCenter();
- aInnerPoly[3] = rRectangle.Center();
- aInnerPoly[4] = rRectangle.RightCenter();
- aInnerPoly[5] = rRectangle.BottomRight();
+ ::basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Right(), rRectangle.Center().Y()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
if(SID_DRAW_XPOLYGON_NOFILL == nID)
{
- aInnerPoly[6] = rRectangle.BottomCenter();
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ }
+ else
+ {
+ aInnerPoly.setClosed(true);
}
- aPoly.Insert(aInnerPoly);
+ aPoly.append(aInnerPoly);
break;
}
case SID_DRAW_POLYGON:
case SID_DRAW_POLYGON_NOFILL:
{
- XPolygon aInnerPoly;
+ ::basegfx::B2DPolygon aInnerPoly;
sal_Int32 nWdt(rRectangle.GetWidth());
sal_Int32 nHgt(rRectangle.GetHeight());
- aInnerPoly[0] = rRectangle.BottomLeft();
- aInnerPoly[1] = rRectangle.TopLeft() + Point((nWdt * 30) / 100, (nHgt * 70) / 100);
- aInnerPoly[2] = rRectangle.TopLeft() + Point(0, (nHgt * 15) / 100);
- aInnerPoly[3] = rRectangle.TopLeft() + Point((nWdt * 65) / 100, 0);
- aInnerPoly[4] = rRectangle.TopLeft() + Point(nWdt, (nHgt * 30) / 100);
- aInnerPoly[5] = rRectangle.TopLeft() + Point((nWdt * 80) / 100, (nHgt * 50) / 100);
- aInnerPoly[6] = rRectangle.TopLeft() + Point((nWdt * 80) / 100, (nHgt * 75) / 100);
- aInnerPoly[7] = rRectangle.BottomRight();
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left() + (nWdt * 30) / 100, rRectangle.Top() + (nHgt * 70) / 100));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top() + (nHgt * 15) / 100));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left() + (nWdt * 65) / 100, rRectangle.Top()));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left() + nWdt, rRectangle.Top() + (nHgt * 30) / 100));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 50) / 100));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 75) / 100));
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Bottom(), rRectangle.Right()));
if(SID_DRAW_POLYGON_NOFILL == nID)
{
- aInnerPoly[8] = rRectangle.BottomCenter();
+ aInnerPoly.append(::basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ }
+ else
+ {
+ aInnerPoly.setClosed(true);
}
- aPoly.Insert(aInnerPoly);
+ aPoly.append(aInnerPoly);
break;
}
}