summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-20 16:51:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-20 16:59:57 +0100
commit3e199f81473d1f85a75238ac03d38a220f3ab818 (patch)
tree6ce53d7cae5cdc002d354d62b8f4808aeba92839
parentc85456b01bd8dd12792b76fb393f893496461c5c (diff)
fdo#72204 RTF import: fix crash on rotated, but not imported groupshape
In case the groupshape contains textboxes and they contain table, we don't import the groupshape itself, just the children, as drawinglayer rectangles wouldn't handle tables. If that's the case, don't try to apply properties on the groupshape, as that would crash (the Writer drawpage implements XShapes, but not the XShape interface). Change-Id: Ie34039170314b772dd050eb354681cfaec61c1fa
-rw-r--r--sw/qa/core/data/rtf/pass/fdo72204.rtf48
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx4
2 files changed, 51 insertions, 1 deletions
diff --git a/sw/qa/core/data/rtf/pass/fdo72204.rtf b/sw/qa/core/data/rtf/pass/fdo72204.rtf
new file mode 100644
index 000000000000..052a639323ba
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo72204.rtf
@@ -0,0 +1,48 @@
+{\rtf1
+{\shpgrp
+{\*\shpinst\shpleft-950\shptop156\shpright1583\shpbottom2942\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1036
+{\sp{\sn groupLeft}{\sv 1621}}
+{\sp{\sn groupTop}{\sv 2621}}
+{\sp{\sn groupRight}{\sv 4154}}
+{\sp{\sn groupBottom}{\sv 5407}}
+{\sp{\sn rotation}{\sv 0}}
+{\shp
+{\*\shpinst\shplid1037
+{\sp{\sn relLeft}{\sv 1621}}
+{\sp{\sn relTop}{\sv 2621}}
+{\sp{\sn relRight}{\sv 4154}}
+{\sp{\sn relBottom}{\sv 5092}}
+{\sp{\sn shapeType}{\sv 202}}
+{\shptxt \ltrpar \trowd
+\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cellx567
+\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cellx1134\clbrdrt\brdrtbl \clbrdrl\brdrnone \clbrdrb\brdrtbl \clbrdrr\brdrtbl
+\cellx1701\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\cellx2268\pard\plain \ltrpar\ql
+\intbl \rtlch \afs22\alang1025 \ltrch \lang1038\langfe1033\loch\hich\dbch\cgrid\langnp1038\langfenp1033
+{\rtlch \ltrch
+\hich\dbch\loch\f37 a)\cell }
+\pard \ltrpar\qc \intbl
+{\rtlch \ltrch
+\cell \cell \cell }
+\pard \ltrpar\ql \intbl
+{\rtlch \ltrch \trowd
+\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cellx567
+\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cellx1134\clbrdrt\brdrtbl \clbrdrl\brdrnone \clbrdrb\brdrtbl \clbrdrr\brdrtbl
+\cellx1701\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\cellx2268\row }
+\trowd \clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cellx567
+\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cellx1134\clbrdrt\brdrtbl \clbrdrl\brdrnone \clbrdrb\brdrtbl \clbrdrr\brdrtbl
+\cellx1701\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\cellx2268\pard \ltrpar\qc
+\intbl
+{\rtlch \ltrch \cell \cell \cell \cell }
+\pard \ltrpar\ql \intbl
+{\rtlch \ltrch \trowd
+\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cellx567
+\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cellx1134\clbrdrt\brdrtbl \clbrdrl\brdrnone \clbrdrb\brdrtbl \clbrdrr\brdrtbl
+\cellx1701\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\cellx2268\row }
+\pard \ltrpar\ql \itap0\par
+}
+}
+}
+}
+}
+\par
+}
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index aaaa4eee36d8..3d9df8b1aaf0 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -704,7 +704,9 @@ void RTFSdrImport::append(OUString aKey, OUString aValue)
void RTFSdrImport::appendGroupProperty(OUString aKey, OUString aValue)
{
- applyProperty(uno::Reference<drawing::XShape>(m_aParents.top(), uno::UNO_QUERY), aKey, aValue);
+ uno::Reference<drawing::XShape> xShape(m_aParents.top(), uno::UNO_QUERY);
+ if (xShape.is())
+ applyProperty(xShape, aKey, aValue);
}
} // namespace rtftok