diff options
-rw-r--r-- | sw/qa/extras/rtfimport/data/shpz-dhgt.rtf | 43 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 6 |
3 files changed, 55 insertions, 3 deletions
diff --git a/sw/qa/extras/rtfimport/data/shpz-dhgt.rtf b/sw/qa/extras/rtfimport/data/shpz-dhgt.rtf new file mode 100644 index 000000000000..63df566bc9b2 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/shpz-dhgt.rtf @@ -0,0 +1,43 @@ +{\rtf1 +{\shp +{\*\shpinst\shpleft1898\shptop1043\shpright4598\shpbottom2123\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz1\shplid1027 +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fillColor} +{\sv 65280} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn dhgt} +{\sv 5} +} +} +} +{\shp +{\*\shpinst\shpleft563\shptop518\shpright2243\shpbottom1448\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026 +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fillColor} +{\sv 255} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn dhgt} +{\sv 10} +} +} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index a8932c5a0038..130715d484c8 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1391,6 +1391,15 @@ DECLARE_RTFIMPORT_TEST(testFdo65090, "fdo65090.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); } +DECLARE_RTFIMPORT_TEST(testShpzDhgt, "shpz-dhgt.rtf") +{ + // Test that shpz has priority over dhght and not the other way around. + // Drawpage is sorted by ZOrder, so first should be red (back). + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(getShape(1), "FillColor")); + // Second (front) should be green. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(2), "FillColor")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 3d9df8b1aaf0..84d541ee2f51 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -450,9 +450,9 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose) aViewBox.Height = i->second.toInt32(); else if ( i->first == "dhgt" ) { - resolveDhgt(xPropertySet, i->second.toInt32()); - // dhgt is Word 2007, \shpz is Word 97-2003, the previous has priority. - rShape.oZ.reset(); + // dhgt is Word 2007, \shpz is Word 97-2003, the later has priority. + if (!rShape.oZ) + resolveDhgt(xPropertySet, i->second.toInt32()); } // These are in EMU, convert to mm100. else if (i->first == "dxTextLeft") |