summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-07 10:56:49 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-07 11:14:43 +0100
commit312e3c38befc8164b18842e62e0f91820f4d94bc (patch)
tree3bfe0e33b6b1d466ebf19e6005d8098050a9358c
parent03fcda48819219d89d92db0ebd3d0515b2b9b002 (diff)
drawingML export: fix handling of dkVert pattern fill preset
We convert the dkVert preset to a certain hatch configuration (style, distance, angle), but when we exported it back, then we didn't recognize it, and wrote ltVert instead. Change-Id: I021885496843f5ea5453af3473453bbec50d928f
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx5
-rw-r--r--sw/qa/extras/ooxmlexport/data/dkvert.docxbin0 -> 20751 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx9
3 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index 48faa5438ebd..b3c646eb2dcb 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -317,7 +317,10 @@ const char* GetHatchPattern( const drawing::Hatch& rHatch )
{
case drawing::HatchStyle_SINGLE:
{
- if( rHatch.Distance < 75 )
+ // dkVert is imported as Distance = 25, ltVert as Distance = 50, export them accordingly.
+ if( rHatch.Distance < 50 )
+ sPattern = "dkVert";
+ else if( rHatch.Distance < 75 )
sPattern = "ltVert";
else
sPattern = "vert";
diff --git a/sw/qa/extras/ooxmlexport/data/dkvert.docx b/sw/qa/extras/ooxmlexport/data/dkvert.docx
new file mode 100644
index 000000000000..bc1ee7881378
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/dkvert.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index ed9f630ef6fa..8842cddef690 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -902,6 +902,15 @@ DECLARE_OOXMLEXPORT_TEST(testAnchorIdForWP14AndW14, "AnchorId.docx")
}
+DECLARE_OOXMLEXPORT_TEST(testDkVert, "dkvert.docx")
+{
+ // <a:pattFill prst="dkVert"> was exported as ltVert.
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
+ // This was 50.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<drawing::Hatch>(xShape, "FillHatch").Distance);
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();