summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/page-background.rtf30
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
2 files changed, 39 insertions, 0 deletions
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<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();