You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/06/07 19:08:12 UTC

svn commit: r1347716 [6/6] - in /incubator/ooo/branches/alg/aw080/main: basctl/source/dlged/ basctl/source/inc/ chart2/source/controller/main/ cui/source/tabpages/ filter/source/msfilter/ reportdesign/source/core/sdr/ reportdesign/source/ui/inc/ report...

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx Thu Jun  7 17:08:07 2012
@@ -1514,7 +1514,7 @@ sal_Bool SwFEShell::GotoObj( sal_Bool bN
 |*
 *************************************************************************/
 
-bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/  eSdrObjectKind, const basegfx::B2DPoint& rPos )
+bool SwFEShell::BeginCreate(const SdrObjectCreationInfo& rSdrObjectCreationInfo, const basegfx::B2DPoint& rPos )
 {
 	bool bRet(false);
 
@@ -1523,14 +1523,18 @@ bool SwFEShell::BeginCreate( sal_uInt16 
 
 	if ( GetPageNumber( rPos ) )
 	{
-		Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind );
-		if ( eSdrObjectKind == OBJ_CAPTION )
+		Imp()->GetDrawView()->setSdrObjectCreationInfo(rSdrObjectCreationInfo);
+
+        if(OBJ_CAPTION == rSdrObjectCreationInfo.getIdent())
+        {
 			bRet = Imp()->GetDrawView()->BegCreateCaptionObj(
 						rPos, 
-						basegfx::B2DVector(lMinBorder - MINFLY, lMinBorder - MINFLY),
-						GetOut() );
+						basegfx::B2DVector(lMinBorder - MINFLY, lMinBorder - MINFLY));
+        }
 		else
-			bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
+        {
+			bRet = Imp()->GetDrawView()->BegCreateObj( rPos );
+        }
 	}
 	if ( bRet )
     {
@@ -1540,23 +1544,6 @@ bool SwFEShell::BeginCreate( sal_uInt16 
 	return bRet;
 }
 
-bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/  eSdrObjectKind, sal_uInt32 eObjInventor, const basegfx::B2DPoint& rPos )
-{
-	bool bRet(false);
-
-	if ( !Imp()->HasDrawView() )
-		Imp()->MakeDrawView();
-
-	if ( GetPageNumber( rPos ) )
-	{
-		Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind, eObjInventor );
-		bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
-	}
-	if ( bRet )
-		::FrameNotify( this, FLY_DRAG_START );
-	return bRet;
-}
-
 /*************************************************************************
 |*
 |*	SwFEShell::MoveCreate()
@@ -2870,21 +2857,23 @@ long SwFEShell::GetSectionWidth( SwFmt& 
 	return 0;
 }
 
-void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
-                sal_uInt16 nSlotId)
+void SwFEShell::CreateDefaultShape(const SdrObjectCreationInfo& rSdrObjectCreationInfo, const Rectangle& rRect, sal_uInt16 nSlotId)
 {
     SdrView* pDrawView = GetDrawView();
     SdrObject* pObj = 0;
 	
 	if(pDrawView)
 	{
-		pObj = SdrObjFactory::MakeNewObject(pDrawView->getSdrModelFromSdrView(), SdrInventor, eSdrObjectKind);
+		pObj = SdrObjFactory::MakeNewObject(pDrawView->getSdrModelFromSdrView(), rSdrObjectCreationInfo);
 	}
 
 	if(pObj)
 	{
         Rectangle aRect(rRect);
-        if(OBJ_CARC == eSdrObjectKind || OBJ_CCUT == eSdrObjectKind)
+
+        if(OBJ_CIRC == rSdrObjectCreationInfo.getIdent()
+            && (CircleType_Arc == rSdrObjectCreationInfo.getSdrCircleObjType() 
+                || CircleType_Segment == rSdrObjectCreationInfo.getSdrCircleObjType()))
         {
             // force quadratic
             if(aRect.GetWidth() > aRect.GetHeight())
@@ -2903,63 +2892,69 @@ void SwFEShell::CreateDefaultShape( sal_
         sdr::legacy::SetLogicRect(*pObj, aRect);
 
 		SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(pObj);
+        SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+        SdrCaptionObj* pSdrCaptionObj = dynamic_cast< SdrCaptionObj* >(pObj);
+        SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pObj);
 
 		if(pSdrCircObj)
 		{
 			pSdrCircObj->SetStartAngle(F_PI2); // TTTT formally 9000, needs check (mirror?)
 			pSdrCircObj->SetEndAngle(0.0);
         }
-        else if(dynamic_cast< SdrPathObj* >(pObj))
+        else if(pSdrPathObj)
 		{
 			basegfx::B2DPolyPolygon aPoly;
 
-            switch(eSdrObjectKind)
+            switch(pSdrPathObj->getSdrPathObjType())
 			{
-                case OBJ_PATHLINE:
+                case PathType_OpenBezier:
+                case PathType_ClosedBezier:
 				{
-					basegfx::B2DPolygon aInnerPoly;
-
-					aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
+                    if(rSdrObjectCreationInfo.getFreehandMode())
+                    {
+					    basegfx::B2DPolygon aInnerPoly;
 
-					const basegfx::B2DPoint aCenterBottom(aRect.Center().X(), aRect.Bottom());
-					aInnerPoly.appendBezierSegment(
-						aCenterBottom,
-						aCenterBottom,
-						basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
-
-					const basegfx::B2DPoint aCenterTop(aRect.Center().X(), aRect.Top());
-					aInnerPoly.appendBezierSegment(
-						aCenterTop,
-						aCenterTop,
-						basegfx::B2DPoint(aRect.Right(), aRect.Top()));
+					    aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
 
-					aInnerPoly.setClosed(true);
-					aPoly.append(aInnerPoly);
-                }
-                break;
-                case OBJ_FREELINE:
-				{
-					basegfx::B2DPolygon aInnerPoly;
+					    aInnerPoly.appendBezierSegment(
+						    basegfx::B2DPoint(aRect.Left(), aRect.Top()),
+						    basegfx::B2DPoint(aRect.Center().X(), aRect.Top()),
+						    basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
+
+					    aInnerPoly.appendBezierSegment(
+						    basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()),
+						    basegfx::B2DPoint(aRect.Right(), aRect.Bottom()),
+						    basegfx::B2DPoint(aRect.Right(), aRect.Top()));
+
+					    aInnerPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
+					    aInnerPoly.setClosed(true);
+					    aPoly.append(aInnerPoly);
+                    }
+                    else
+                    {
+					    basegfx::B2DPolygon aInnerPoly;
 
-					aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
+					    aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
 
-					aInnerPoly.appendBezierSegment(
-						basegfx::B2DPoint(aRect.Left(), aRect.Top()),
-						basegfx::B2DPoint(aRect.Center().X(), aRect.Top()),
-						basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
-
-					aInnerPoly.appendBezierSegment(
-						basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()),
-						basegfx::B2DPoint(aRect.Right(), aRect.Bottom()),
-						basegfx::B2DPoint(aRect.Right(), aRect.Top()));
+					    const basegfx::B2DPoint aCenterBottom(aRect.Center().X(), aRect.Bottom());
+					    aInnerPoly.appendBezierSegment(
+						    aCenterBottom,
+						    aCenterBottom,
+						    basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
+
+					    const basegfx::B2DPoint aCenterTop(aRect.Center().X(), aRect.Top());
+					    aInnerPoly.appendBezierSegment(
+						    aCenterTop,
+						    aCenterTop,
+						    basegfx::B2DPoint(aRect.Right(), aRect.Top()));
 
-					aInnerPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
-					aInnerPoly.setClosed(true);
-					aPoly.append(aInnerPoly);
+					    aInnerPoly.setClosed(true);
+					    aPoly.append(aInnerPoly);
+                    }
                 }
                 break;
-                case OBJ_POLY:
-                case OBJ_PLIN:
+                case PathType_ClosedPolygon:
+                case PathType_OpenPolygon:
 				{
 					basegfx::B2DPolygon aInnerPoly;
                     sal_Int32 nWdt(aRect.GetWidth());
@@ -2974,7 +2969,7 @@ void SwFEShell::CreateDefaultShape( sal_
 					aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 75) / 100));
 					aInnerPoly.append(basegfx::B2DPoint(aRect.Bottom(), aRect.Right()));
 
-                    if(OBJ_PLIN == eSdrObjectKind)
+                    if(PathType_OpenPolygon == pSdrPathObj->getSdrPathObjType())
 					{
 						aInnerPoly.append(basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()));
 					}
@@ -2986,7 +2981,7 @@ void SwFEShell::CreateDefaultShape( sal_
 					aPoly.append(aInnerPoly);
                 }
                 break;
-                case OBJ_LINE :
+                case PathType_Line:
                 {
 					sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
 					basegfx::B2DPolygon aTempPoly;
@@ -2997,44 +2992,43 @@ void SwFEShell::CreateDefaultShape( sal_
                 break;
 			}
 
-			((SdrPathObj*)pObj)->setB2DPolyPolygonInObjectCoordinates(aPoly);
+			pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly);
 		}
-        else if(dynamic_cast< SdrCaptionObj* >(pObj))
+        else if(pSdrCaptionObj)
         {
-            sal_Bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
-                                            SID_DRAW_CAPTION_VERTICAL == nSlotId );
-            ((SdrTextObj*)pObj)->SetVerticalWriting(bVerticalText);
+            sal_Bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId || SID_DRAW_CAPTION_VERTICAL == nSlotId );
+            pSdrCaptionObj->SetVerticalWriting(bVerticalText);
+
             if(bVerticalText)
             {
-                SfxItemSet aSet(pObj->GetMergedItemSet());
+                SfxItemSet aSet(pSdrCaptionObj->GetMergedItemSet());
                 aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
                 aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
-                pObj->SetMergedItemSet(aSet);
+                pSdrCaptionObj->SetMergedItemSet(aSet);
             }
 
-            sdr::legacy::SetLogicRect(*pObj, aRect);
+            sdr::legacy::SetLogicRect(*pSdrCaptionObj, aRect);
 
 			const Point aTailPos(aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
-            ((SdrCaptionObj*)pObj)->SetTailPos(basegfx::B2DPoint(aTailPos.X(), aTailPos.Y()));
+            pSdrCaptionObj->SetTailPos(basegfx::B2DPoint(aTailPos.X(), aTailPos.Y()));
         }
-        else if(dynamic_cast< SdrTextObj* >(pObj))
+        else if(pSdrTextObj)
         {
-            SdrTextObj* pText = (SdrTextObj*)pObj;
-            sdr::legacy::SetLogicRect(*pText, aRect);
+            sdr::legacy::SetLogicRect(*pSdrTextObj, aRect);
 
             sal_Bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
             sal_Bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
 
-			pText->SetVerticalWriting(bVertical);
+			pSdrTextObj->SetVerticalWriting(bVertical);
 
 			if(bVertical)
 			{
-                SfxItemSet aSet(pText->GetObjectItemPool());
+                SfxItemSet aSet(pSdrTextObj->GetObjectItemPool());
 				aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
 				aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
 				aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
 				aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
-				pText->SetMergedItemSet(aSet);
+				pSdrTextObj->SetMergedItemSet(aSet);
 			}
 
 			if(bMarquee)

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/html/htmldraw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/html/htmldraw.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/html/htmldraw.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/html/htmldraw.cxx Thu Jun  7 17:08:07 2012
@@ -19,12 +19,9 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-
 #include "hintids.hxx"
 #include <vcl/svapp.hxx>
 #include <vcl/wrkwin.hxx>
@@ -33,7 +30,6 @@
 #include <svx/svdobj.hxx>
 #include <svx/svdotext.hxx>
 #include <editeng/eeitem.hxx>
-
 #ifndef _OUTLINER_HXX //autogen
 #define _EEITEMID_HXX
 #include <editeng/outliner.hxx>
@@ -49,8 +45,6 @@
 #include <svtools/htmltokn.h>
 #include <svtools/htmlkywd.hxx>
 #include <svx/svdpool.hxx>
-
-
 #include "charatr.hxx"
 #include <frmfmt.hxx>
 #include <fmtanchr.hxx>
@@ -64,10 +58,10 @@
 #include "wrthtml.hxx"
 #include <svx/svdlegacy.hxx>
 #include <svx/fmmodel.hxx>
+#include <svx/sdrobjectfactory.hxx>
 
 using namespace ::com::sun::star;
 
-
 const sal_uInt32 HTML_FRMOPTS_MARQUEE 	=
 	HTML_FRMOPT_ALIGN |
 	HTML_FRMOPT_SPACE;
@@ -405,7 +399,7 @@ void SwHTMLParser::NewMarquee( HTMLTable
     SdrModel* pModel = pDoc->GetOrCreateDrawModel();
     // <--
 	SdrPage* pPg = pModel->GetPage( 0 );
-	pMarquee = SdrObjFactory::MakeNewObject( *pModel, SdrInventor, OBJ_TEXT);
+	pMarquee = SdrObjFactory::MakeNewObject( *pModel, SdrObjectCreationInfo(OBJ_TEXT, SdrInventor));
 	if( !pMarquee )
 		return;
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/rtf/swparrtf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/rtf/swparrtf.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/rtf/swparrtf.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/rtf/swparrtf.cxx Thu Jun  7 17:08:07 2012
@@ -1243,7 +1243,6 @@ void SwRTFParser::ReadDrawingObject()
         SdrModel* pDrawModel  = pDoc->GetOrCreateDrawModel();
         SdrPathObj* pStroke = new SdrPathObj(
 			*pDrawModel,
-			OBJ_PLIN, 
 			::basegfx::B2DPolyPolygon(aPolygon));
         SfxItemSet aFlySet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1);
         SwFmtSurround aSur( SURROUND_PARALLEL );
@@ -1527,7 +1526,6 @@ void SwRTFParser::ReadShapeObject()
 
             SdrPathObj* pStroke = new SdrPathObj(
 				*pDoc->GetOrCreateDrawModel(),
-				OBJ_PLIN, 
 				::basegfx::B2DPolyPolygon(aLine));
             pSdrObject = pStroke;
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx Thu Jun  7 17:08:07 2012
@@ -348,7 +348,6 @@ SdrObject* SwWW8ImplReader::ReadLine( WW
 	aPolygon.append(::basegfx::B2DPoint(aP[1].X(), aP[1].Y()));
 	SdrObject* pObj = new SdrPathObj(
 		*pDrawModel,
-		OBJ_LINE, 
 		::basegfx::B2DPolyPolygon(aPolygon));
 
     SetStdAttr( rSet, aLine.aLnt, aLine.aShd );
@@ -399,7 +398,7 @@ SdrObject* SwWW8ImplReader::ReadElipse( 
 
     SdrObject* pObj = new SdrCircObj( 
 		*pDrawModel,
-		OBJ_CIRC, 
+		CircleType_Circle, 
 		basegfx::tools::createScaleTranslateB2DHomMatrix(
 			aP1.X() - aP0.X(), aP1.Y() - aP0.Y(), 
 			aP0.X(), aP0.Y()));
@@ -443,7 +442,7 @@ SdrObject* SwWW8ImplReader::ReadArc( WW8
     
 	SdrObject* pObj = new SdrCircObj( 
 		*pDrawModel,
-		OBJ_SECT, 
+		CircleType_Sector, 
 		basegfx::tools::createScaleTranslateB2DHomMatrix(
 			aP1.X() - aP0.X(), aP1.Y() - aP0.Y(), 
 			aP0.X(), aP0.Y()),
@@ -482,7 +481,6 @@ SdrObject* SwWW8ImplReader::ReadPolyLine
 
 	SdrObject* pObj = new SdrPathObj(
 		*pDrawModel,
-		( SVBT16ToShort( aPoly.aBits1 ) & 0x1 ) ? OBJ_POLY : OBJ_PLIN, 
 		::basegfx::B2DPolyPolygon(aP.getB2DPolygon()));
     SetStdAttr( rSet, aPoly.aLnt, aPoly.aShd );
     SetFill( rSet, aPoly.aFill );

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/app/swdll.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/app/swdll.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/app/swdll.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/app/swdll.cxx Thu Jun  7 17:08:07 2012
@@ -19,22 +19,13 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-
 #include <svx/svdobj.hxx>
 #include <rtl/logfile.hxx>
-
-#ifndef _GLOBDOC_HRC
 #include "globdoc.hrc"
-#endif
-
-#ifndef _SWDLL_HXX
 #include <swdll.hxx>
-#endif
 #include <wdocsh.hxx>
 #include <globdoc.hxx>
 #include <initui.hxx>
@@ -43,17 +34,12 @@
 #include <init.hxx>
 #include <dobjfac.hxx>
 #include <cfgid.h>
-
 #include <unotools/moduleoptions.hxx>
-
-#ifndef _FM_FMOBJFAC_HXX
 #include <svx/fmobjfac.hxx>
-#endif
 #include <svx/svdfield.hxx>
 #include <svx/objfac3d.hxx>
-
 #include <unomid.h>
-
+#include <svx/sdrobjectfactory.hxx>
 
 /*************************************************************************
 |*

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/docvw/edtwin.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/docvw/edtwin.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/docvw/edtwin.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/docvw/edtwin.cxx Thu Jun  7 17:08:07 2012
@@ -661,7 +661,7 @@ void SwEditWin::InsFrm(sal_uInt16 nCols)
 
 void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect )
 {
-    SetSdrDrawMode( eSdrObjectKind );
+    setSdrObjectCreationInfo(SdrObjectCreationInfo(eSdrObjectKind));
 
 /*  if (GetDrawFuncPtr())
         GetDrawFuncPtr()->Deactivate();*/
@@ -672,7 +672,7 @@ void SwEditWin::StdDrawMode( SdrObjKind 
         rView.SetDrawFuncPtr(new SwDrawBase( &rView.GetWrtShell(), this, &rView ));
 
     rView.SetSelDrawSlot();
-    SetSdrDrawMode( eSdrObjectKind );
+    setSdrObjectCreationInfo(SdrObjectCreationInfo(eSdrObjectKind));
     if (bObjSelect)
         rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT );
     else
@@ -4580,7 +4580,7 @@ SwEditWin::SwEditWin(Window *pParent, Sw
     m_nDropDestination( 0 ),
 
     nInsFrmColCount( 1 ),
-    eDrawMode(OBJ_NONE),
+    meSdrObjectCreationInfo(),
 
     bLockInput(sal_False),
     bObjectSelect( sal_False ),
@@ -4719,7 +4719,6 @@ sal_Bool SwEditWin::EnterDrawMode(const 
 
 sal_Bool SwEditWin::IsDrawSelMode()
 {
-//  return (IsFrmAction() == sal_False && GetSdrDrawMode() == OBJ_NONE);
     return IsObjectSelect();
 }
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/inc/edtwin.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/inc/edtwin.hxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/inc/edtwin.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/inc/edtwin.hxx Thu Jun  7 17:08:07 2012
@@ -29,9 +29,9 @@
 #include <vcl/window.hxx>
 #include <svtools/transfer.hxx>
 #include <swevent.hxx>
-
 #define _SVSTDARR_STRINGSISORTDTOR
 #include <svl/svstdarr.hxx>
+#include <svx/sdrobjectfactory.hxx>
 
 class	SwWrtShell;
 class 	SwView;
@@ -115,7 +115,7 @@ friend void 	PageNumNotify( 	ViewShell* 
 
 	sal_uInt16			eBezierMode;
 	sal_uInt16			nInsFrmColCount; //Spaltenzahl fuer interaktiven Rahmen
-	SdrObjKind		eDrawMode;
+	SdrObjectCreationInfo meSdrObjectCreationInfo;
 	sal_Bool			bLinkRemoved	: 1,
 					bMBPressed		: 1,
 					bInsDraw 		: 1,
@@ -222,8 +222,8 @@ public:
 	void			SetObjectSelect( sal_Bool bVal )	{ bObjectSelect = bVal; }
 	sal_Bool			IsObjectSelect() const			{ return bObjectSelect; }
 
-	inline SdrObjKind	GetSdrDrawMode(/*sal_Bool bBuf = sal_False*/) const { return eDrawMode; }
-	inline void			SetSdrDrawMode( SdrObjKind eSdrObjectKind )	{ eDrawMode = eSdrObjectKind; SetObjectSelect( sal_False ); }
+	inline const SdrObjectCreationInfo& getSdrObjectCreationInfo() const { return meSdrObjectCreationInfo; }
+	inline void setSdrObjectCreationInfo(const SdrObjectCreationInfo& eSdrObjectCreationInfo) { meSdrObjectCreationInfo = eSdrObjectCreationInfo; SetObjectSelect( sal_False ); }
 	void				StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect );
 
 	sal_Bool			IsFrmAction() 					{ return (bInsFrm); }

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conarc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conarc.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conarc.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conarc.cxx Thu Jun  7 17:08:07 2012
@@ -116,22 +116,28 @@ sal_Bool ConstArc::MouseButtonUp( const 
 
 void ConstArc::Activate(const sal_uInt16 nSlotId)
 {
+    SdrObjectCreationInfo aSdrObjectCreationInfo;
+
 	switch (nSlotId)
 	{
 		case SID_DRAW_ARC:
-            m_pWin->SetSdrDrawMode(OBJ_CARC);
+            aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
+            aSdrObjectCreationInfo.setSdrCircleObjType(CircleType_Arc);
 			break;
 		case SID_DRAW_PIE:
-            m_pWin->SetSdrDrawMode(OBJ_SECT);
+            aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
+            aSdrObjectCreationInfo.setSdrCircleObjType(CircleType_Sector);
 			break;
 		case SID_DRAW_CIRCLECUT:
-            m_pWin->SetSdrDrawMode(OBJ_CCUT);
+            aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
+            aSdrObjectCreationInfo.setSdrCircleObjType(CircleType_Segment);
 			break;
 		default:
-            m_pWin->SetSdrDrawMode(OBJ_NONE);
 			break;
 	}
 
+    m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+
 	SwDrawBase::Activate(nSlotId);
 }
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/concustomshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/concustomshape.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/concustomshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/concustomshape.cxx Thu Jun  7 17:08:07 2012
@@ -148,7 +148,7 @@ sal_Bool ConstCustomShape::MouseButtonUp
 
 void ConstCustomShape::Activate(const sal_uInt16 nSlotId)
 {
-    m_pWin->SetSdrDrawMode( OBJ_CUSTOMSHAPE );
+    m_pWin->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_CUSTOMSHAPE));
 
 	SwDrawBase::Activate(nSlotId);
 }

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conform.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conform.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conform.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conform.cxx Thu Jun  7 17:08:07 2012
@@ -92,7 +92,7 @@ sal_Bool ConstFormControl::MouseButtonDo
 		const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
 		m_aStartPos = m_pWin->GetInverseViewTransformation() * aPixelPos;
 
-        bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, m_aStartPos);
+        bReturn = m_pSh->BeginCreate(m_pWin->getSdrObjectCreationInfo(), m_aStartPos);
 
 		if (bReturn)
             m_pWin->SetDrawAction(sal_True);
@@ -112,9 +112,11 @@ sal_Bool ConstFormControl::MouseButtonDo
 
 void ConstFormControl::Activate(const sal_uInt16 nSlotId)
 {
-    m_pWin->SetSdrDrawMode( static_cast<SdrObjKind>(nSlotId) );
+    const SdrObjectCreationInfo aSdrObjectCreationInfo(nSlotId);
+
+    m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
 	SwDrawBase::Activate(nSlotId);
-    m_pSh->GetDrawView()->SetCurrentObj(nSlotId);
+    m_pSh->GetDrawView()->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
 
     m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT));
 }
@@ -133,7 +135,7 @@ void ConstFormControl::CreateDefaultObje
     SdrView *pSdrView = m_pSh->GetDrawView();
     pSdrView->SetDesignMode(true);
 
-    m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, aStartPos);
+    m_pSh->BeginCreate(m_pWin->getSdrObjectCreationInfo(), aStartPos);
     m_pSh->MoveCreate(aEndPos);
     m_pSh->EndCreate(SDRCREATE_FORCEEND);
 }

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conpoly.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conpoly.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conpoly.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conpoly.cxx Thu Jun  7 17:08:07 2012
@@ -96,8 +96,9 @@ sal_Bool ConstPolygon::MouseButtonUp(con
 
     if (m_pSh->IsDrawCreate())
 	{
-		if (rMEvt.IsLeft() && rMEvt.GetClicks() == 1 &&
-                                        m_pWin->GetSdrDrawMode() != OBJ_FREELINE)
+		if (rMEvt.IsLeft() 
+            && rMEvt.GetClicks() == 1 
+            && !(OBJ_POLY == m_pWin->getSdrObjectCreationInfo().getIdent() && m_pWin->getSdrObjectCreationInfo().getFreehandMode()))
 		{
             if (!m_pSh->EndCreate(SDRCREATE_NEXTPOINT))
 			{
@@ -110,10 +111,6 @@ sal_Bool ConstPolygon::MouseButtonUp(con
 		{
             Point aPnt(m_pWin->PixelToLogic(rMEvt.GetPosPixel()));
 			bReturn = SwDrawBase::MouseButtonUp(rMEvt);
-
-			// #i85045# removed double mechanism to check for AutoClose polygon
-			// after construction; the method here did not check for already closed and
-			// also worked only for a single polygon. Removing.
 		}
 	}
 	else
@@ -132,24 +129,36 @@ sal_Bool ConstPolygon::MouseButtonUp(con
 
 void ConstPolygon::Activate(const sal_uInt16 nSlotId)
 {
+    SdrObjectCreationInfo aSdrObjectCreationInfo;
+    bool bSet(false);
+
 	switch (nSlotId)
 	{
 		case SID_DRAW_POLYGON_NOFILL:
-            m_pWin->SetSdrDrawMode(OBJ_PLIN);
+            aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+            aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenPolygon);
 			break;
 
 		case SID_DRAW_BEZIER_NOFILL:
-            m_pWin->SetSdrDrawMode(OBJ_PATHLINE);
+            aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+            aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
 			break;
 
 		case SID_DRAW_FREELINE_NOFILL:
-            m_pWin->SetSdrDrawMode(OBJ_FREELINE);
+            aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+            aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
+            aSdrObjectCreationInfo.setFreehandMode(true);
 			break;
 
 		default:
 			break;
 	}
 
+    if(bSet)
+    {
+        m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+    }
+
 	SwDrawBase::Activate(nSlotId);
 }
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conrect.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conrect.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conrect.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/conrect.cxx Thu Jun  7 17:08:07 2012
@@ -68,8 +68,7 @@ sal_Bool ConstRectangle::MouseButtonDown
 {
 	sal_Bool bReturn;
 
-	if ((bReturn = SwDrawBase::MouseButtonDown(rMEvt)) == sal_True
-                                    && m_pWin->GetSdrDrawMode() == OBJ_CAPTION)
+	if ((bReturn = SwDrawBase::MouseButtonDown(rMEvt)) == sal_True && OBJ_CAPTION == m_pWin->getSdrObjectCreationInfo().getIdent())
 	{
         m_pView->NoRotate();
         if (m_pView->IsDrawSelMode())
@@ -97,7 +96,7 @@ sal_Bool ConstRectangle::MouseButtonUp(c
         SdrView *pSdrView = m_pSh->GetDrawView();
 		SdrObject* pObj = pSdrView->getSelectedIfSingle();
 
-        switch( m_pWin->GetSdrDrawMode() )
+        switch( m_pWin->getSdrObjectCreationInfo().getIdent() )
 		{
 		case OBJ_TEXT:
 			if( bMarquee )
@@ -177,48 +176,50 @@ void ConstRectangle::Activate(const sal_
 {
 	bMarquee = bCapVertical = sal_False;
 	mbVertical = sal_False;
+    SdrObjectCreationInfo aSdrObjectCreationInfo;
 
 	switch (nSlotId)
 	{
 	case SID_DRAW_LINE:
-        m_pWin->SetSdrDrawMode(OBJ_LINE);
+        aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+        aSdrObjectCreationInfo.setSdrPathObjType(PathType_Line);
 		break;
 
 	case SID_DRAW_RECT:
-        m_pWin->SetSdrDrawMode(OBJ_RECT);
+        aSdrObjectCreationInfo.setIdent(OBJ_RECT);
 		break;
 
 	case SID_DRAW_ELLIPSE:
-        m_pWin->SetSdrDrawMode(OBJ_CIRC);
+        aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
 		break;
 
 	case SID_DRAW_TEXT_MARQUEE:
 		bMarquee = sal_True;
-        m_pWin->SetSdrDrawMode(OBJ_TEXT);
+        aSdrObjectCreationInfo.setIdent(OBJ_TEXT);
 		break;
 
 	case SID_DRAW_TEXT_VERTICAL:
 		// #93382#
 		mbVertical = sal_True;
-        m_pWin->SetSdrDrawMode(OBJ_TEXT);
+        aSdrObjectCreationInfo.setIdent(OBJ_TEXT);
 		break;
 
 	case SID_DRAW_TEXT:
-        m_pWin->SetSdrDrawMode(OBJ_TEXT);
+        aSdrObjectCreationInfo.setIdent(OBJ_TEXT);
 		break;
 
 	case SID_DRAW_CAPTION_VERTICAL:
 		bCapVertical = sal_True;
 		// no break
 	case SID_DRAW_CAPTION:
-        m_pWin->SetSdrDrawMode(OBJ_CAPTION);
+        aSdrObjectCreationInfo.setIdent(OBJ_CAPTION);
 		break;
 
 	default:
-        m_pWin->SetSdrDrawMode(OBJ_NONE);
 		break;
 	}
 
+    m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
 	SwDrawBase::Activate(nSlotId);
 }
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/drawbase.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/drawbase.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/drawbase.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/drawbase.cxx Thu Jun  7 17:08:07 2012
@@ -124,7 +124,7 @@ sal_Bool SwDrawBase::MouseButtonDown(con
 			const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
             m_aStartPos = m_pWin->GetInverseViewTransformation() * aPixelPos;
 
-            bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), m_aStartPos);
+            bReturn = m_pSh->BeginCreate(m_pWin->getSdrObjectCreationInfo(), m_aStartPos);
 
 			SetDrawPointer();
 
@@ -311,11 +311,11 @@ sal_Bool SwDrawBase::MouseButtonUp(const
 
     if (IsCreateObj() && m_pSh->IsDrawCreate() && !m_pWin->IsDrawSelMode())
 	{
-        const SdrObjKind nDrawMode = m_pWin->GetSdrDrawMode();
-		//objects with multiple point may end at the start position
-		sal_Bool bMultiPoint = OBJ_PLIN == nDrawMode ||
-                                OBJ_PATHLINE == nDrawMode ||
-								OBJ_FREELINE == nDrawMode;
+        const SdrObjectCreationInfo& rSdrObjectCreationInfo = m_pWin->getSdrObjectCreationInfo();
+		
+        //objects with multiple point may end at the start position
+        const bool bMultiPoint(OBJ_POLY == rSdrObjectCreationInfo.getIdent() && PathType_Line != rSdrObjectCreationInfo.getSdrPathObjType());
+
         if(rMEvt.IsRight() || (aPnt.equal(m_aStartPos) && !bMultiPoint))
 		{
             m_pSh->BreakCreate();
@@ -323,7 +323,7 @@ sal_Bool SwDrawBase::MouseButtonUp(const
 		}
 		else
 		{
-            if (OBJ_NONE == nDrawMode)
+            if(OBJ_NONE == rSdrObjectCreationInfo.getIdent())
             {
                 SwRewriter aRewriter;
 
@@ -332,7 +332,8 @@ sal_Bool SwDrawBase::MouseButtonUp(const
             }
 
             m_pSh->EndCreate(SDRCREATE_FORCEEND);
-            if (OBJ_NONE == nDrawMode)   // Textrahmen eingefuegt
+            
+            if(OBJ_NONE == rSdrObjectCreationInfo.getIdent())   // Textrahmen eingefuegt
 			{
                uno::Reference< frame::XDispatchRecorder > xRecorder =
                     m_pSh->GetView().GetViewFrame()->GetBindings().GetRecorder();
@@ -360,7 +361,8 @@ sal_Bool SwDrawBase::MouseButtonUp(const
                         m_pSh->SetFlyFrmAttr( aSet );
 				}
 			}
-            if (m_pWin->GetSdrDrawMode() == OBJ_NONE)
+            
+            if(OBJ_NONE == m_pWin->getSdrObjectCreationInfo().getIdent())
             {
                 m_pSh->EndUndo();
             }
@@ -502,7 +504,7 @@ void SwDrawBase::Activate(const sal_uInt
     SetSlotId(nSlot);
     SdrView *pSdrView = m_pSh->GetDrawView();
 
-    pSdrView->SetCurrentObj( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()) );
+    pSdrView->setSdrObjectCreationInfo(m_pWin->getSdrObjectCreationInfo());
 	pSdrView->SetViewEditMode(SDREDITMODE_CREATE);
 
 	SetDrawPointer();
@@ -701,7 +703,7 @@ void SwDrawBase::CreateDefaultObject()
     aEndPos.X() += 8 * MM50;
     aEndPos.Y() += 4 * MM50;
     Rectangle aRect(aStartPos, aEndPos);
-    m_pSh->CreateDefaultShape( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), aRect, m_nSlotId);
+    m_pSh->CreateDefaultShape(m_pWin->getSdrObjectCreationInfo(), aRect, m_nSlotId);
 }
 /* -----------------25.10.2002 14:14-----------------
  *

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/dselect.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/dselect.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/dselect.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/ribbar/dselect.cxx Thu Jun  7 17:08:07 2012
@@ -88,7 +88,7 @@ sal_Bool DrawSelection::KeyInput(const K
 
 void DrawSelection::Activate(const sal_uInt16 nSlotId)
 {
-    m_pWin->SetSdrDrawMode(OBJ_NONE);
+    m_pWin->setSdrObjectCreationInfo(SdrObjectCreationInfo());
     m_pWin->SetObjectSelect( sal_True );
 	SwDrawBase::Activate(nSlotId);
 

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/shells/textdrw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/shells/textdrw.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/shells/textdrw.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/shells/textdrw.cxx Thu Jun  7 17:08:07 2012
@@ -65,15 +65,17 @@ void SwBaseShell::InsertURLButton(const 
 	SdrView *pSdrView = rSh.GetDrawView();
 
 	// OBJ_FM_BUTTON
+    const SdrObjectCreationInfo aSdrObjectCreationInfo(OBJ_FM_BUTTON, FmFormInventor);
     pSdrView->SetDesignMode(true);
-	pSdrView->SetCurrentObj(OBJ_FM_BUTTON);
+	pSdrView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
 	pSdrView->SetViewEditMode(SDREDITMODE_CREATE);
 
 	const basegfx::B2DPoint aStartPos(rSh.GetCharRect().Pos().X(), rSh.GetCharRect().Pos().Y() + 1.0);
 
 	rSh.StartAction();
     rSh.StartUndo( UNDO_UI_INSERT_URLBTN );
-	if (rSh.BeginCreate(OBJ_FM_BUTTON, FmFormInventor, aStartPos))
+	
+    if (rSh.BeginCreate(aSdrObjectCreationInfo, aStartPos))
 	{
 		pSdrView->SetOrthogonal(false);
 		const basegfx::B2DVector aObjSize(

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx?rev=1347716&r1=1347715&r2=1347716&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx Thu Jun  7 17:08:07 2012
@@ -633,7 +633,7 @@ sal_Bool SwView::IsTextTool() const
 	if (pSdrView->IsCreateMode())
 		pSdrView->SetViewEditMode(SDREDITMODE_EDIT);
 
-	return (pSdrView->GetCurrentObjInventor() == SdrInventor);
+	return (SdrInventor == pSdrView->getSdrObjectCreationInfo().getInvent());
 }
 
 /*--------------------------------------------------------------------