Kaydet (Commit) 5bfff14d authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 2d5d52c2
...@@ -498,7 +498,15 @@ void SwDrawShell::GetState(SfxItemSet& rSet) ...@@ -498,7 +498,15 @@ void SwDrawShell::GetState(SfxItemSet& rSet)
SwFrmFmt* pFrmFmt = ::FindFrmFmt(pObj); SwFrmFmt* pFrmFmt = ::FindFrmFmt(pObj);
// Allow creating a TextBox only in case this is a draw format without a TextBox so far. // 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)) 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) if (bDisable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment