From 87f1f7fdb34fe452ac540524224e1e808ce5d3a2 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 21 Aug 2017 16:06:43 +0200 Subject: VML, Watermark: detect shapetype from other subdocuments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some documents Watermark wasn't visible because shapetype wasn't detected. It was impossible to use shapetype defined in header1.xml in shape placed in the header2.xml. Change-Id: Ib406c8fc702968684ad46efd0857b768af2820f5 Reviewed-on: https://gerrit.libreoffice.org/41395 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai --- oox/source/vml/vmlshape.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'oox/source/vml') diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index e1d0cf6d9a41..d6a14caf16b5 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -283,6 +283,14 @@ void ShapeBase::finalizeFragmentImport() aType = aType.copy(1); if( const ShapeType* pShapeType = mrDrawing.getShapes().getShapeTypeById( aType ) ) maTypeModel.assignUsed( pShapeType->getTypeModel() ); + else { + // Temporary fix, shapetype not found if referenced from different substream + // FIXME: extend scope of ShapeContainer to store all shapetypes from the document + const OUString sShapeTypePrefix = "shapetype_"; + if (aType.startsWith(sShapeTypePrefix)) { + maTypeModel.moShapeType = aType.copy(sShapeTypePrefix.getLength()).toInt32(); + } + } } } -- cgit