summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-02-09 11:12:26 +0100
committerAndras Timar <andras.timar@collabora.com>2017-02-10 13:17:34 +0100
commite094103ac613d3c52ad6d6c4b23e4b9121bd981b (patch)
treec746d28ce9a323593fed2186ec2624690e5dc989 /xmloff
parenta688fa7067c071ea309c6f9c794aa0c2dcfb40fe (diff)
tdf#103567 xmloff: ODF import: fix more lossage on Writer frames
There's another context that reads draw:frame, and it has the same problem as the one used for Impress shapes. This causes SVG images in Writer to lose contour polygons and image maps. Fix this the same way as the other context. (likely regression from 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70) Change-Id: I16cf55e68829b4e1b0841f2015d0729be0ce3725 (cherry picked from commit ae00898f12b9087e1d9b59d9a7820d64b5501775) Reviewed-on: https://gerrit.libreoffice.org/34088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 38c82af5368c7dfb134305cb402b1ce9e1a7cc7f)
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 82191a9ad3f7..add7629688ca 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1586,6 +1586,10 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
{
if( IsXMLToken( rLocalName, XML_TITLE ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ m_xImplContext = solveMultipleImages();
+ }
pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
p_nPrefix,
rLocalName,
@@ -1593,6 +1597,10 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
}
else if ( IsXMLToken( rLocalName, XML_DESC ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ m_xImplContext = solveMultipleImages();
+ }
pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
p_nPrefix,
rLocalName,
@@ -1605,24 +1613,40 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
Reference < XPropertySet > xPropSet;
if( IsXMLToken( rLocalName, XML_CONTOUR_POLYGON ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ m_xImplContext = solveMultipleImages();
+ }
if( CreateIfNotThere( xPropSet ) )
pContext = new XMLTextFrameContourContext_Impl( GetImport(), p_nPrefix, rLocalName,
xAttrList, xPropSet, false );
}
else if( IsXMLToken( rLocalName, XML_CONTOUR_PATH ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ m_xImplContext = solveMultipleImages();
+ }
if( CreateIfNotThere( xPropSet ) )
pContext = new XMLTextFrameContourContext_Impl( GetImport(), p_nPrefix, rLocalName,
xAttrList, xPropSet, true );
}
else if( IsXMLToken( rLocalName, XML_IMAGE_MAP ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ m_xImplContext = solveMultipleImages();
+ }
if( CreateIfNotThere( xPropSet ) )
pContext = new XMLImageMapContext( GetImport(), p_nPrefix, rLocalName, xPropSet );
}
}
else if( (XML_NAMESPACE_OFFICE == p_nPrefix) && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ m_xImplContext = solveMultipleImages();
+ }
// do we still have the frame object?
Reference < XPropertySet > xPropSet;
if( CreateIfNotThere( xPropSet ) )
@@ -1641,6 +1665,11 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
else if( p_nPrefix == XML_NAMESPACE_SVG && // #i68101#
(IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) )
{
+ if (getSupportsMultipleContents())
+ { // tdf#103567 ensure props are set on surviving shape
+ // note: no more draw:image can be added once we get here
+ m_xImplContext = solveMultipleImages();
+ }
pContext = m_xImplContext->CreateChildContext( p_nPrefix, rLocalName, xAttrList );
}
else