diff options
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx | bin | 0 -> 38145 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 11 |
3 files changed, 12 insertions, 1 deletions
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index f49d0ddfae04..4ddd8c5d8e0a 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -304,7 +304,7 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper const & rParent, Shape // - given width is used only if explicit o:hrpct="0" is given OUString hrpct = rAttribs.getString( O_TOKEN( hrpct ), "1000" ); if( hrpct != "0" ) - mrTypeModel.maWidth = OUString::number( hrpct.toInt32() / 10 ) + "%"; + mrTypeModel.maWidthPercent = OUString::number( hrpct.toInt32() ); } // stroke settings (may be overridden by v:stroke element later) diff --git a/sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx b/sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx Binary files differnew file mode 100644 index 000000000000..8419113f1617 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf97648_relativeWidth.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 693d18d59fb4..a89799b87e39 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -9,6 +9,7 @@ #include <swmodeltestbase.hxx> +#include <com/sun/star/awt/Size.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/text/XFootnote.hpp> @@ -204,6 +205,16 @@ DECLARE_OOXMLEXPORT_TEST(tdf105490_negativeMargins, "tdf105490_negativeMargins.d } #endif +DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth,"tdf97648_relativeWidth.docx") +{ + int i = mbExported ? 0 : 1; + //divide everything by 10 to avoid rounding errors etc + CPPUNIT_ASSERT_EQUAL( sal_Int32(15995/10), getShape(++i)->getSize().Width/10); + CPPUNIT_ASSERT_EQUAL( sal_Int32(8001/10), getShape(++i)->getSize().Width/10); + CPPUNIT_ASSERT_EQUAL( sal_Int32(4001/10), getShape(++i)->getSize().Width/10); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1600/10), getShape(++i)->getSize().Width/10); +} + DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx") { CPPUNIT_ASSERT_MESSAGE("There should be two or three pages", getPages() <= 3 ); |