summaryrefslogtreecommitdiff
path: root/xmloff/source/draw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-12-14 13:51:14 +0100
committerAndras Timar <andras.timar@collabora.com>2022-02-14 11:00:08 +0100
commitaa1787cf326f779a4deabc2974d9636b9dd45ae2 (patch)
tree95be28492c0208473dcb7d55881d884cff1bbf24 /xmloff/source/draw
parentb6f6bfcc4b5351d034e53e422ad32ba802ffa989 (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. (cherry picked from commit c2726c29b233b8fa7fbd390aafe149bdf7e94b07) Conflicts: xmloff/qa/unit/draw.cxx Change-Id: Id59ed28a64a9398f2f1620f69b5f148d65e6c95a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129729 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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 9a10055b1c27..a19a6c19d936 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3526,7 +3526,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;