[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Mar 4 02:22:55 PST 2015
sw/source/uibase/shells/drawsh.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 4f5f5b5d0e141e1d719eae3ba243ccf6e4e50e41
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Feb 12 11:00:20 2015 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 5986acb..86202dd 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)
More information about the Libreoffice-commits
mailing list