summaryrefslogtreecommitdiff
path: root/xmloff/source/draw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-12-14 13:51:14 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-12-14 15:47:19 +0100
commitc2726c29b233b8fa7fbd390aafe149bdf7e94b07 (patch)
treec8c131fe163e4bbfdd1cdc0d9516a18c97712b9a /xmloff/source/draw
parent19394a924fdc486202ca27e318385287eb0df26f (diff)
sw ODF shape import: improve is-textbox check
This builds on top of commit 28d67b792724a23015dec32fb0278b729f676736 (tdf#107776 sw ODF shape import: make is-textbox check more strict, 2019-08-26). Before that commit, any non-empty parent style name on a shape resulted in an sw textbox. After that commit, we filtered out Writer images by checking for the Frame parent style name. The problem with this approach is that in case two documents are to be merged together, then it's reasonable to rename the Frame style, but then the complex content inside the shape gets lost. Fix the problem by going with a middle ground: require Frame as a prefix, but allow other names as well. This gets e.g. FrameX to work without breaking the "reject Graphics" use-case. Change-Id: Id59ed28a64a9398f2f1620f69b5f148d65e6c95a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126828 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r--xmloff/source/draw/ximpshap.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index c1f93885c9c7..4d2dec38a3c8 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3503,7 +3503,9 @@ SdXMLCustomShapeContext::SdXMLCustomShapeContext(
rtl::Reference<XMLTextImportHelper> xTxtImport = GetImport().GetTextImport();
XMLPropStyleContext* pStyle = xTxtImport->FindAutoFrameStyle(aStyleName);
// Note that this an API name, so intentionally not localized.
- if (pStyle && pStyle->GetParentName() == "Frame")
+ // Also allow other Frame styles with the same prefix, we just want to reject
+ // Graphics after all.
+ if (pStyle && pStyle->GetParentName().startsWith("Frame"))
{
mbTextBox = true;
break;