diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-12 11:00:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-04 10:22:20 +0000 |
commit | 4f5f5b5d0e141e1d719eae3ba243ccf6e4e50e41 (patch) | |
tree | 005cbc4b6f1e72d5c93122facbf210870c4f38ca | |
parent | 9c5ea0469ab96bd39cccd3bd60d79846ce065679 (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.
(cherry picked from commit 5bfff14d8f2240ff37b91b78c337438214dfa1bc)
Change-Id: Ic1df38edc38495d7899038ec2b8ad753da87d352
Reviewed-on: https://gerrit.libreoffice.org/14726
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/shells/drawsh.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index 5986acb0b1d9..86202ddafd3b 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -531,7 +531,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) |