summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-07-26 08:16:50 +0000
committerArmin Le Grand <alg@apache.org>2012-07-26 08:16:50 +0000
commit8e63413dbf514303095790630a2d77d854c3da95 (patch)
tree9dfbab62dc2acab53d82a82deed683805bcca39f /sd
parent8f2fdaeea4079db21e8ccee619274c47f0a398ae (diff)
#118267# Add undo actions for adapted arrowhead sizes when linewidth is changed
Notes
Notes: merged as: 196ec14db1d4f39e25c83517cc7bad4d78ee6572
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviews2.cxx30
1 files changed, 24 insertions, 6 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index bf91e44077ec..7cc906faa92b 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -155,8 +155,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
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(SfxRequest& rReq)
}
if(bSetItemSet)
+ {
+ 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(SfxRequest& rReq)
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(SfxRequest& rReq)
{
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 )
{