Author: alg
Date: Thu Jul 26 09:16:50 2012
New Revision: 1365920

URL: http://svn.apache.org/viewvc?rev=1365920&view=rev
Log:
#118267# Add undo actions for adapted arrowhead sizes when linewidth is changed

Modified:
    incubator/ooo/trunk/main/sd/source/ui/view/drviews2.cxx

Modified: incubator/ooo/trunk/main/sd/source/ui/view/drviews2.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/view/drviews2.cxx?rev=1365920&r1=1365919&r2=1365920&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/view/drviews2.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/view/drviews2.cxx Thu Jul 26 09:16:50 
2012
@@ -155,8 +155,8 @@ void DrawViewShell::FuTemporary(SfxReque
                                        SdrObject* pObj = NULL;
                                        const SdrMarkList& rMarkList = 
mpDrawView->GetMarkedObjectList();
                                        sal_uLong nCount = 
rMarkList.GetMarkCount();
-
-                                       sal_Int32 nNewLineWidth = ((const 
XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue();
+                                       const sal_Int32 nNewLineWidth(((const 
XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue());
+                                       const bool 
bUndo(mpDrawView->IsUndoEnabled());
 
                                        for (sal_uLong i=0; i<nCount; i++)
                                        {
@@ -193,9 +193,28 @@ void DrawViewShell::FuTemporary(SfxReque
                                                        }
 
                                                        if(bSetItemSet)
-                                                               
pObj->SetMergedItemSet(aAttr);
+                            {
+                                if(bUndo)
+                                {
+                                    if(!bMergeUndo)
+                                    {
+                                                                               
pUndoManager->EnterListAction( String(), String() );
+                                                               
mpDrawView->BegUndo();
+                                                                               
bMergeUndo = sal_True;
+                                    }
+
+                                    
mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+                                }
+
+                                pObj->SetMergedItemSet(aAttr);
+                            }
                                                }
                                        }
+
+                    if(bMergeUndo)
+                    {
+                                               mpDrawView->EndUndo();
+                    }
                                }
 
                                if (nSId == SID_ATTR_FILL_SHADOW)
@@ -204,7 +223,6 @@ void DrawViewShell::FuTemporary(SfxReque
                                        SdrObject* pObj = NULL;
                                        const SdrMarkList& rMarkList = 
mpDrawView->GetMarkedObjectList();
                                        sal_uLong nCount = 
rMarkList.GetMarkCount();
-
                                        const bool bUndo = 
mpDrawView->IsUndoEnabled();
 
                                        for (sal_uLong i=0; i<nCount; i++)
@@ -217,10 +235,10 @@ void DrawViewShell::FuTemporary(SfxReque
                                                {
                                                        
aAttr.Put(pObj->GetMergedItemSet());
 
-                                                       const XFillStyleItem& 
rFillStyle =
-                                                       (const XFillStyleItem&) 
aAttr.Get(XATTR_FILLSTYLE);
+                                                       const XFillStyleItem& 
rFillStyle = (const XFillStyleItem&) aAttr.Get(XATTR_FILLSTYLE);
+                                                       const XLineStyleItem& 
rLineStyle = (const XLineStyleItem&) aAttr.Get(XATTR_LINESTYLE);
 
-                                                       if 
(rFillStyle.GetValue() == XFILL_NONE)
+                                                       if(XFILL_NONE == 
rFillStyle.GetValue() && XLINE_NONE == rLineStyle.GetValue())
                                                        {
                                                                if( bUndo )
                                                                {


Reply via email to