diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-19 10:11:34 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-19 11:29:31 +0200 |
commit | 692ea03e1d9974d036e1b9109c3fe32e1c0e51cd (patch) | |
tree | 3dfedbecd4b8e345d97635ec5cc2ac2a63766956 /sw/source/uibase | |
parent | sw: add UI for adding a textbox for a draw shape (diff) | |
download | core-692ea03e1d9974d036e1b9109c3fe32e1c0e51cd.tar.gz core-692ea03e1d9974d036e1b9109c3fe32e1c0e51cd.zip |
sw: add UI for removing the textbox of a draw shape
Change-Id: Ib95573228d3dc98c88cd4af19995c99433c84ae6
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/shells/drawsh.cxx | 25 |
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(); } |