From 14e163b0caf97addf340aefc5760a9031ec98390 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 28 May 2013 21:34:37 +0200 Subject: import RTF_BACKGROUND That destination contains a whole shape, but the only interesing detail of it is the fill color, which is the page background color. Change-Id: I9527db8954c48c980f8734c9bbeaa6ccd3c48fbc --- sw/qa/extras/rtfimport/data/page-background.rtf | 30 +++++++++++++++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 9 ++++++++ 2 files changed, 39 insertions(+) create mode 100644 sw/qa/extras/rtfimport/data/page-background.rtf (limited to 'sw') diff --git a/sw/qa/extras/rtfimport/data/page-background.rtf b/sw/qa/extras/rtfimport/data/page-background.rtf new file mode 100644 index 000000000000..e19d2d4c3547 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/page-background.rtf @@ -0,0 +1,30 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0 +\viewbksp1 +{\*\background +{\shp +{\*\shpinst\shpleft0\shptop0\shpright0\shpbottom0\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr0\shpwrk0\shpfblwtxt1 +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fillColor} +{\sv 5296274} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn bWMode} +{\sv 9} +} +{\sp +{\sn fBackground} +{\sv 1} +} +} +} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 5aadfa64b72b..bb0b0145a512 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -137,6 +137,7 @@ public: void testFdo62977(); void testN818997(); void testFdo64671(); + void testPageBackground(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -263,6 +264,7 @@ void Test::run() {"fdo62977.rtf", &Test::testFdo62977}, {"n818997.rtf", &Test::testN818997}, {"fdo64671.rtf", &Test::testFdo64671}, + {"page-background.rtf", &Test::testPageBackground}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1248,6 +1250,13 @@ void Test::testFdo64671() getRun(getParagraph(1), 1, OUString("\xC5\xBD", 2, RTL_TEXTENCODING_UTF8)); } +void Test::testPageBackground() +{ + // The problem was that \background was ignored. + uno::Reference xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty(xPageStyle, "BackColor")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit