summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-12 11:00:20 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-12 11:20:36 +0100
commit5bfff14d8f2240ff37b91b78c337438214dfa1bc (patch)
treee262b99c84568fb850a0672ba5e53d0769988f91 /sw
parent2d5d52c2abc9fa882b1350a522f2989933fcb67b (diff)
tdf#89266 SwDrawShell::GetState: fix crash on adding textbox to fontwork
Till we find a use case where it makes sense to support this, just hide the menu item to avoid the crash. Change-Id: Ic1df38edc38495d7899038ec2b8ad753da87d352
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/drawsh.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index e1384184f62d..80cb4c4b1c49 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -498,7 +498,15 @@ void SwDrawShell::GetState(SfxItemSet& rSet)
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 (SdrObjCustomShape* pCustomShape = PTR_CAST(SdrObjCustomShape, pObj))
+ {
+ const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pCustomShape->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
+ if (const uno::Any* pAny = rGeometryItem.GetPropertyValueByName("Type"))
+ // But still disallow fontwork shapes.
+ bDisable = pAny->get<OUString>().startsWith("fontwork-");
+ }
+ }
}
if (bDisable)