tdf#107392 ODF import: fix z-order sorting of SVG imagescp-5.3-8-win
commitfee240db94d110d5c34d05c3b6c1792fece7a716
authorMiklos Vajna <vmiklos@collabora.co.uk>
Wed, 26 Apr 2017 15:52:27 +0000 (26 17:52 +0200)
committerMiklos Vajna <vmiklos@collabora.co.uk>
Thu, 27 Apr 2017 07:42:30 +0000 (27 09:42 +0200)
treecfeb95c8f6b69976e9fe8fbf8f985261b37bce06
parentf9de9af221f0824afda7660694c15fcf24836a48
tdf#107392 ODF import: fix z-order sorting of SVG images

The problem was that in case the document has shapes where the order
does not match the z-index order, so sorting is needed, then sorting
failed to take the multi-image feature into account. E.g. SVG images
have a PNG fallback, but at the end of the shape import the PNG
fallback is removed, which means the "actual" (not the "wished") z-index
of the shapes after the SVG image has to be adjusted.

Without this happening SvxDrawPage::getByIndex() (or in case of Writer,
SwTextBoxHelper::getByIndex()) will throw when the importer calls
getByIndex(3) but we only have 3 shapes. This results in not honoring
the z-index request of the remaining shapes.

Regression from commit 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70 (re-base
on ALv2 code. Includes (at least) relevant parts of:, 2012-10-09), from
the

        Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement
        http://svn.apache.org/viewvc?view=revision&revision=1220836

part.

Reviewed-on: https://gerrit.libreoffice.org/36998
Tested-by: Jenkins <ci@libreoffice.org>
Conflicts:
sw/qa/extras/odfimport/odfimport.cxx

Change-Id: Ibe880e5c6c74b728b4a760498720ee31f052b726
include/xmloff/shapeimport.hxx
include/xmloff/xmlmultiimagehelper.hxx
sw/qa/extras/odfimport/data/tdf107392.odt [new file with mode: 0644]
sw/qa/extras/odfimport/odfimport.cxx
xmloff/source/draw/shapeimport.cxx
xmloff/source/draw/ximpshap.cxx
xmloff/source/draw/ximpshap.hxx
xmloff/source/text/XMLTextFrameContext.cxx
xmloff/source/text/XMLTextFrameContext.hxx