summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/drawsh.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-19 10:11:34 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-19 11:29:31 +0200
commit692ea03e1d9974d036e1b9109c3fe32e1c0e51cd (patch)
tree3dfedbecd4b8e345d97635ec5cc2ac2a63766956 /sw/source/uibase/shells/drawsh.cxx
parent7f77b8a689f84a03495ac5911236b68f01ee7b24 (diff)
sw: add UI for removing the textbox of a draw shape
Change-Id: Ib95573228d3dc98c88cd4af19995c99433c84ae6
Diffstat (limited to 'sw/source/uibase/shells/drawsh.cxx')
-rw-r--r--sw/source/uibase/shells/drawsh.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 76d2538f7fd1..d4887fa3d4b3 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -409,6 +409,16 @@ void SwDrawShell::Execute(SfxRequest &rReq)
}
break;
}
+ case FN_REMOVE_TEXT_BOX:
+ {
+ if (SdrObject* pObj = IsSingleFillableNonOLESelected())
+ {
+ SwFrmFmt* pFrmFmt = ::FindFrmFmt(pObj);
+ if (pFrmFmt)
+ SwTextBoxHelper::destroy(pFrmFmt);
+ }
+ break;
+ }
default:
OSL_ENSURE(!this, "wrong dispatcher");
return;
@@ -529,6 +539,21 @@ void SwDrawShell::GetState(SfxItemSet& rSet)
rSet.DisableItem(nWhich);
break;
}
+ case FN_REMOVE_TEXT_BOX:
+ {
+ bool bDisable = true;
+ if (SdrObject* pObj = IsSingleFillableNonOLESelected())
+ {
+ SwFrmFmt* pFrmFmt = ::FindFrmFmt(pObj);
+ // Allow removing a TextBox only in case it has one.
+ if (pFrmFmt && SwTextBoxHelper::findTextBox(pFrmFmt))
+ bDisable = false;
+ }
+
+ if (bDisable)
+ rSet.DisableItem(nWhich);
+ break;
+ }
}
nWhich = aIter.NextWhich();
}