summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-11-14 12:16:18 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-11-14 12:16:18 +0000
commit2f5c60f15eff4e18f435a75b2009869f1848b051 (patch)
treeee241d0923cc9e1fa6a9faede182fd0a5781304d
parenta1682f5acf1f00cae311cc337279ab21cfd72a6a (diff)
INTEGRATION: CWS aw024 (1.14.232); FILE MERGED
2006/11/10 03:10:17 aw 1.14.232.10: RESYNC: (1.18-1.19); FILE MERGED 2006/10/27 12:13:56 aw 1.14.232.9: #i39528# ::basegfx -> basegfx adaption 2006/09/21 18:25:24 aw 1.14.232.8: RESYNC: (1.17-1.18); FILE MERGED 2006/08/03 15:12:05 aw 1.14.232.7: RESYNC: (1.16-1.17); FILE MERGED 2006/07/04 12:17:42 aw 1.14.232.6: RESYNC: (1.15-1.16); FILE MERGED 2005/09/18 02:39:58 aw 1.14.232.5: RESYNC: (1.14-1.15); FILE MERGED 2005/05/26 11:27:55 aw 1.14.232.4: #i39531# 2005/05/19 12:31:09 aw 1.14.232.3: #i39529# 2005/05/12 16:39:20 aw 1.14.232.2: #i39529# 2005/04/26 15:04:07 aw 1.14.232.1: #i39528#
-rw-r--r--svx/source/dialog/imapwnd.cxx113
1 files changed, 43 insertions, 70 deletions
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index fd6c529ded52..482d45fc8a6f 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: imapwnd.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: obo $ $Date: 2006-10-12 12:16:34 $
+ * last change: $Author: ihi $ $Date: 2006-11-14 13:16:18 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -95,6 +95,13 @@
#include "svxdlg.hxx"
#include "dialogs.hrc"
+#ifndef _BGFX_POINT_B2DPOINT_HXX
+#include <basegfx/point/b2dpoint.hxx>
+#endif
+
+#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#endif
#ifdef MAC
#define TRANSCOL Color( COL_LIGHTGRAY )
@@ -375,7 +382,9 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// auf Zeichenflaeche clippen
aDrawPoly.Clip( aClipRect );
- pSdrObj = (SdrObject*) new SdrPathObj( OBJ_POLY, XPolyPolygon( XPolygon( aDrawPoly ) ) );
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append(aDrawPoly.getB2DPolygon());
+ pSdrObj = (SdrObject*)new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aPolygon));
}
pCloneIMapObj = (IMapObject*) new IMapPolygonObject( *pIMapPolyObj );
@@ -454,20 +463,12 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
case( OBJ_CIRC ):
{
- IMapPolygonObject* pObj;
- SdrCircObj* pCircObj = (SdrCircObj*) &rObj;
- SdrPathObj* pPathObj = (SdrPathObj*) pCircObj->ConvertToPolyObj( FALSE, FALSE );
- const XPolygon& rXPoly = pPathObj->GetPathPoly().GetObject( 0 );
- USHORT nCount = rXPoly.GetPointCount();
- Polygon aPoly( nCount );
-
- for ( USHORT i = 0; i < nCount; i++ )
- aPoly[ i ] = rXPoly[ i ];
-
- // wurde von uns nur temporaer angelegt
+ SdrCircObj* pCircObj = (SdrCircObj*) &rObj;
+ SdrPathObj* pPathObj = (SdrPathObj*) pCircObj->ConvertToPolyObj( FALSE, FALSE );
+ Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L));
delete pPathObj;
- pObj = new IMapPolygonObject( aPoly, String(), String(), TRUE, FALSE );
+ IMapPolygonObject* pObj = new IMapPolygonObject( Polygon(aPoly), String(), String(), TRUE, FALSE );
pObj->SetExtraEllipse( aPoly.GetBoundRect() );
pCircObj->InsertUserData( new IMapUserData( pObj ) );
}
@@ -478,22 +479,13 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
case( OBJ_PATHPOLY ):
case( OBJ_PATHFILL ):
{
- IMapPolygonObject* pObj;
- SdrPathObj* pPathObj = (SdrPathObj*) &rObj;
- const XPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
+ SdrPathObj* pPathObj = (SdrPathObj*) &rObj;
+ const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
- if ( rXPolyPoly.Count() )
+ if ( rXPolyPoly.count() )
{
- const XPolygon& rXPoly = rXPolyPoly.GetObject( 0 );
- USHORT nCount = rXPoly.GetPointCount();
- Polygon aPoly( nCount );
-
- for ( USHORT i = 0; i < nCount; i++ )
- aPoly[ i ] = rXPoly[ i ];
-
- IMapPolygonObject aPolyObj( aPoly, String(), String(), TRUE, FALSE );
-
- pObj = new IMapPolygonObject( aPoly, String(), String(), TRUE, FALSE );
+ Polygon aPoly(rXPolyPoly.getB2DPolygon(0L));
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, String(), String(), TRUE, FALSE );
pPathObj->InsertUserData( new IMapUserData( pObj ) );
}
}
@@ -541,14 +533,9 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj )
case( OBJ_CIRC ):
{
- const SdrCircObj& rCircObj = (const SdrCircObj&) rObj;
- SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj( FALSE, FALSE );
- const XPolygon& rXPoly = pPathObj->GetPathPoly().GetObject( 0 );
- USHORT nCount = rXPoly.GetPointCount();
- Polygon aPoly( nCount );
-
- for ( USHORT i = 0; i < nCount; i++ )
- aPoly[ i ] = rXPoly[ i ];
+ const SdrCircObj& rCircObj = (const SdrCircObj&) rObj;
+ SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj( FALSE, FALSE );
+ Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L));
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aText, aTarget, bActive, FALSE );
pObj->SetExtraEllipse( aPoly.GetBoundRect() );
@@ -564,18 +551,12 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj )
case( OBJ_PATHPOLY ):
case( OBJ_PATHFILL ):
{
- const SdrPathObj& rPathObj = (const SdrPathObj&) rObj;
- const XPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
+ const SdrPathObj& rPathObj = (const SdrPathObj&) rObj;
+ const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
- if ( rXPolyPoly.Count() )
+ if ( rXPolyPoly.count() )
{
- const XPolygon& rXPoly = rPathObj.GetPathPoly().GetObject( 0 );
- USHORT nCount = rXPoly.GetPointCount();
- Polygon aPoly( nCount );
-
- for ( USHORT i = 0; i < nCount; i++ )
- aPoly[ i ] = rXPoly[ i ];
-
+ Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0L));
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aText, aTarget, bActive, FALSE );
pUserData->ReplaceObject( pObj );
}
@@ -789,7 +770,7 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
pIMapObj->SetDescription( aBookMark.GetDescription() );
pModel->SetChanged( sal_True );
pView->UnmarkAll();
- pView->MarkObj( pSdrObj, pView->GetPageViewPvNum( 0 ) );
+ pView->MarkObj( pSdrObj, pView->GetSdrPageView() );
UpdateInfo( TRUE );
nRet = rEvt.mnAction;
}
@@ -1050,12 +1031,12 @@ IMPL_LINK( IMapWindow, MenuSelectHdl, Menu*, pMenu )
void IMapWindow::CreateDefaultObject()
{
- SdrPageView* pPageView = pView->GetPageViewPvNum(0);
+ SdrPageView* pPageView = pView->GetSdrPageView();
if(pPageView)
{
// calc position and size
- Point aPagePos = pPageView->GetOffset();
+ Point aPagePos(0, 0); // = pPageView->GetOffset();
Size aPageSize = pPageView->GetPage()->GetSize();
sal_uInt32 nDefaultObjectSizeWidth = aPageSize.Width() / 4;
sal_uInt32 nDefaultObjectSizeHeight = aPageSize.Height() / 4;
@@ -1071,38 +1052,30 @@ void IMapWindow::CreateDefaultObject()
case OBJ_POLY:
case OBJ_PATHPOLY:
{
- XPolyPolygon aPoly;
-
- XPolygon aInnerPoly;
- aInnerPoly[0] = aNewObjectRectangle.BottomLeft();
- aInnerPoly[1] = aNewObjectRectangle.TopLeft();
- aInnerPoly[2] = aNewObjectRectangle.TopCenter();
- aInnerPoly[3] = aNewObjectRectangle.Center();
- aInnerPoly[4] = aNewObjectRectangle.RightCenter();
- aInnerPoly[5] = aNewObjectRectangle.BottomRight();
-
- aPoly.Insert(aInnerPoly);
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomLeft().X(), aNewObjectRectangle.BottomLeft().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopLeft().X(), aNewObjectRectangle.TopLeft().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopCenter().X(), aNewObjectRectangle.TopCenter().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.Center().X(), aNewObjectRectangle.Center().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.RightCenter().X(), aNewObjectRectangle.RightCenter().Y()));
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomRight().X(), aNewObjectRectangle.BottomRight().Y()));
+ aInnerPoly.setClosed(true);
+ ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
break;
}
case OBJ_FREEFILL:
case OBJ_PATHFILL:
{
- XPolyPolygon aPoly;
-
sal_Int32 nWdt(aNewObjectRectangle.GetWidth() / 2);
sal_Int32 nHgt(aNewObjectRectangle.GetHeight() / 2);
-
- XPolygon aInnerPoly(aNewObjectRectangle.Center(), nWdt, nHgt);
-
- aPoly.Insert(aInnerPoly);
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ basegfx::B2DPolygon aInnerPoly(XPolygon(aNewObjectRectangle.Center(), nWdt, nHgt).getB2DPolygon());
+ ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
break;
}
}
- pView->InsertObject(pObj, *pPageView, 0);
+ pView->InsertObjectAtView(pObj, *pPageView);
SdrObjCreated( *pObj );
SetCurrentObjState( true );
pView->MarkObj( pObj, pPageView );