diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-19 10:11:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-19 11:29:31 +0200 |
commit | 7f77b8a689f84a03495ac5911236b68f01ee7b24 (patch) | |
tree | 88641a11936b836c9a0167e20de72f1ed1df7c82 /sw/source/uibase | |
parent | basic: silence expected SAL_WARN output (diff) | |
download | core-7f77b8a689f84a03495ac5911236b68f01ee7b24.tar.gz core-7f77b8a689f84a03495ac5911236b68f01ee7b24.zip |
sw: add UI for adding a textbox for a draw shape
Change-Id: Icc4ff083431635f1769dba5907f26e7dc6b08d02
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/shells/drawsh.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index cf7dba779fc1..76d2538f7fd1 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -32,6 +32,8 @@ #include <svx/fontworkbar.hxx> #include <svx/tbxcustomshapes.hxx> #include <uitool.hxx> +#include <dcontact.hxx> +#include <textboxhelper.hxx> #include <wview.hxx> #include <swmodule.hxx> #include <swwait.hxx> @@ -397,6 +399,16 @@ void SwDrawShell::Execute(SfxRequest &rReq) break; } + case FN_ADD_TEXT_BOX: + { + if (SdrObject* pObj = IsSingleFillableNonOLESelected()) + { + SwFrmFmt* pFrmFmt = ::FindFrmFmt(pObj); + if (pFrmFmt) + SwTextBoxHelper::create(pFrmFmt); + } + break; + } default: OSL_ENSURE(!this, "wrong dispatcher"); return; @@ -502,6 +514,21 @@ void SwDrawShell::GetState(SfxItemSet& rSet) break; } + case FN_ADD_TEXT_BOX: + { + bool bDisable = true; + if (SdrObject* pObj = IsSingleFillableNonOLESelected()) + { + SwFrmFmt* pFrmFmt = ::FindFrmFmt(pObj); + // Allow creating a TextBox only in case this is a draw format without a TextBox so far. + if (pFrmFmt && pFrmFmt->Which() == RES_DRAWFRMFMT && !SwTextBoxHelper::findTextBox(pFrmFmt)) + bDisable = false; + } + + if (bDisable) + rSet.DisableItem(nWhich); + break; + } } nWhich = aIter.NextWhich(); } |