Kaydet (Commit) 2f5c60f1 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

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#
üst a1682f5a
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: imapwnd.cxx,v $ * $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 Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -95,6 +95,13 @@ ...@@ -95,6 +95,13 @@
#include "svxdlg.hxx" #include "svxdlg.hxx"
#include "dialogs.hrc" #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 #ifdef MAC
#define TRANSCOL Color( COL_LIGHTGRAY ) #define TRANSCOL Color( COL_LIGHTGRAY )
...@@ -375,7 +382,9 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) ...@@ -375,7 +382,9 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// auf Zeichenflaeche clippen // auf Zeichenflaeche clippen
aDrawPoly.Clip( aClipRect ); 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 ); pCloneIMapObj = (IMapObject*) new IMapPolygonObject( *pIMapPolyObj );
...@@ -454,20 +463,12 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) ...@@ -454,20 +463,12 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
case( OBJ_CIRC ): case( OBJ_CIRC ):
{ {
IMapPolygonObject* pObj; SdrCircObj* pCircObj = (SdrCircObj*) &rObj;
SdrCircObj* pCircObj = (SdrCircObj*) &rObj; SdrPathObj* pPathObj = (SdrPathObj*) pCircObj->ConvertToPolyObj( FALSE, FALSE );
SdrPathObj* pPathObj = (SdrPathObj*) pCircObj->ConvertToPolyObj( FALSE, FALSE ); Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L));
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
delete pPathObj; delete pPathObj;
pObj = new IMapPolygonObject( aPoly, String(), String(), TRUE, FALSE ); IMapPolygonObject* pObj = new IMapPolygonObject( Polygon(aPoly), String(), String(), TRUE, FALSE );
pObj->SetExtraEllipse( aPoly.GetBoundRect() ); pObj->SetExtraEllipse( aPoly.GetBoundRect() );
pCircObj->InsertUserData( new IMapUserData( pObj ) ); pCircObj->InsertUserData( new IMapUserData( pObj ) );
} }
...@@ -478,22 +479,13 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) ...@@ -478,22 +479,13 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
case( OBJ_PATHPOLY ): case( OBJ_PATHPOLY ):
case( OBJ_PATHFILL ): case( OBJ_PATHFILL ):
{ {
IMapPolygonObject* pObj; SdrPathObj* pPathObj = (SdrPathObj*) &rObj;
SdrPathObj* pPathObj = (SdrPathObj*) &rObj; const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
const XPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
if ( rXPolyPoly.Count() ) if ( rXPolyPoly.count() )
{ {
const XPolygon& rXPoly = rXPolyPoly.GetObject( 0 ); Polygon aPoly(rXPolyPoly.getB2DPolygon(0L));
USHORT nCount = rXPoly.GetPointCount(); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, String(), String(), TRUE, FALSE );
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 );
pPathObj->InsertUserData( new IMapUserData( pObj ) ); pPathObj->InsertUserData( new IMapUserData( pObj ) );
} }
} }
...@@ -541,14 +533,9 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) ...@@ -541,14 +533,9 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj )
case( OBJ_CIRC ): case( OBJ_CIRC ):
{ {
const SdrCircObj& rCircObj = (const SdrCircObj&) rObj; const SdrCircObj& rCircObj = (const SdrCircObj&) rObj;
SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj( FALSE, FALSE ); SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj( FALSE, FALSE );
const XPolygon& rXPoly = pPathObj->GetPathPoly().GetObject( 0 ); Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L));
USHORT nCount = rXPoly.GetPointCount();
Polygon aPoly( nCount );
for ( USHORT i = 0; i < nCount; i++ )
aPoly[ i ] = rXPoly[ i ];
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aText, aTarget, bActive, FALSE ); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aText, aTarget, bActive, FALSE );
pObj->SetExtraEllipse( aPoly.GetBoundRect() ); pObj->SetExtraEllipse( aPoly.GetBoundRect() );
...@@ -564,18 +551,12 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) ...@@ -564,18 +551,12 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj )
case( OBJ_PATHPOLY ): case( OBJ_PATHPOLY ):
case( OBJ_PATHFILL ): case( OBJ_PATHFILL ):
{ {
const SdrPathObj& rPathObj = (const SdrPathObj&) rObj; const SdrPathObj& rPathObj = (const SdrPathObj&) rObj;
const XPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly(); const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
if ( rXPolyPoly.Count() ) if ( rXPolyPoly.count() )
{ {
const XPolygon& rXPoly = rPathObj.GetPathPoly().GetObject( 0 ); Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0L));
USHORT nCount = rXPoly.GetPointCount();
Polygon aPoly( nCount );
for ( USHORT i = 0; i < nCount; i++ )
aPoly[ i ] = rXPoly[ i ];
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aText, aTarget, bActive, FALSE ); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aText, aTarget, bActive, FALSE );
pUserData->ReplaceObject( pObj ); pUserData->ReplaceObject( pObj );
} }
...@@ -789,7 +770,7 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) ...@@ -789,7 +770,7 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
pIMapObj->SetDescription( aBookMark.GetDescription() ); pIMapObj->SetDescription( aBookMark.GetDescription() );
pModel->SetChanged( sal_True ); pModel->SetChanged( sal_True );
pView->UnmarkAll(); pView->UnmarkAll();
pView->MarkObj( pSdrObj, pView->GetPageViewPvNum( 0 ) ); pView->MarkObj( pSdrObj, pView->GetSdrPageView() );
UpdateInfo( TRUE ); UpdateInfo( TRUE );
nRet = rEvt.mnAction; nRet = rEvt.mnAction;
} }
...@@ -1050,12 +1031,12 @@ IMPL_LINK( IMapWindow, MenuSelectHdl, Menu*, pMenu ) ...@@ -1050,12 +1031,12 @@ IMPL_LINK( IMapWindow, MenuSelectHdl, Menu*, pMenu )
void IMapWindow::CreateDefaultObject() void IMapWindow::CreateDefaultObject()
{ {
SdrPageView* pPageView = pView->GetPageViewPvNum(0); SdrPageView* pPageView = pView->GetSdrPageView();
if(pPageView) if(pPageView)
{ {
// calc position and size // calc position and size
Point aPagePos = pPageView->GetOffset(); Point aPagePos(0, 0); // = pPageView->GetOffset();
Size aPageSize = pPageView->GetPage()->GetSize(); Size aPageSize = pPageView->GetPage()->GetSize();
sal_uInt32 nDefaultObjectSizeWidth = aPageSize.Width() / 4; sal_uInt32 nDefaultObjectSizeWidth = aPageSize.Width() / 4;
sal_uInt32 nDefaultObjectSizeHeight = aPageSize.Height() / 4; sal_uInt32 nDefaultObjectSizeHeight = aPageSize.Height() / 4;
...@@ -1071,38 +1052,30 @@ void IMapWindow::CreateDefaultObject() ...@@ -1071,38 +1052,30 @@ void IMapWindow::CreateDefaultObject()
case OBJ_POLY: case OBJ_POLY:
case OBJ_PATHPOLY: case OBJ_PATHPOLY:
{ {
XPolyPolygon aPoly; basegfx::B2DPolygon aInnerPoly;
aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomLeft().X(), aNewObjectRectangle.BottomLeft().Y()));
XPolygon aInnerPoly; aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopLeft().X(), aNewObjectRectangle.TopLeft().Y()));
aInnerPoly[0] = aNewObjectRectangle.BottomLeft(); aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopCenter().X(), aNewObjectRectangle.TopCenter().Y()));
aInnerPoly[1] = aNewObjectRectangle.TopLeft(); aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.Center().X(), aNewObjectRectangle.Center().Y()));
aInnerPoly[2] = aNewObjectRectangle.TopCenter(); aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.RightCenter().X(), aNewObjectRectangle.RightCenter().Y()));
aInnerPoly[3] = aNewObjectRectangle.Center(); aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomRight().X(), aNewObjectRectangle.BottomRight().Y()));
aInnerPoly[4] = aNewObjectRectangle.RightCenter(); aInnerPoly.setClosed(true);
aInnerPoly[5] = aNewObjectRectangle.BottomRight(); ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
aPoly.Insert(aInnerPoly);
((SdrPathObj*)pObj)->SetPathPoly(aPoly);
break; break;
} }
case OBJ_FREEFILL: case OBJ_FREEFILL:
case OBJ_PATHFILL: case OBJ_PATHFILL:
{ {
XPolyPolygon aPoly;
sal_Int32 nWdt(aNewObjectRectangle.GetWidth() / 2); sal_Int32 nWdt(aNewObjectRectangle.GetWidth() / 2);
sal_Int32 nHgt(aNewObjectRectangle.GetHeight() / 2); sal_Int32 nHgt(aNewObjectRectangle.GetHeight() / 2);
basegfx::B2DPolygon aInnerPoly(XPolygon(aNewObjectRectangle.Center(), nWdt, nHgt).getB2DPolygon());
XPolygon aInnerPoly(aNewObjectRectangle.Center(), nWdt, nHgt); ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
aPoly.Insert(aInnerPoly);
((SdrPathObj*)pObj)->SetPathPoly(aPoly);
break; break;
} }
} }
pView->InsertObject(pObj, *pPageView, 0); pView->InsertObjectAtView(pObj, *pPageView);
SdrObjCreated( *pObj ); SdrObjCreated( *pObj );
SetCurrentObjState( true ); SetCurrentObjState( true );
pView->MarkObj( pObj, pPageView ); pView->MarkObj( pObj, pPageView );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment