diff options
author | Mark Hung <marklh9@gmail.com> | 2015-05-14 23:02:21 +0800 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-05-19 11:41:46 +0000 |
commit | b7c8c337d4ffad55fe111c9634c4c04afce78bad (patch) | |
tree | 090833e16261007525577686269e5ea14fcd6148 /sw | |
parent | 3128dbdebef081cc865a6239543c5a8ab705fdcc (diff) |
tdf#91261: DOCX import: snapGrid property of paragraphs are ignored
Fix the situation for OOXML import filter:
a) While handling DocGrid type, SnapToChars was treated as
None. Now it is implemented as described in the article:
http://linpeifeng.blogspot.tw/2007/02/text-grid-enhancement.html
Both LinesAndChars and SnapToChars will be translated to
Writer grid type "lines and characters", and set SnapToGrid
property to false or true accordingly.
b) All the imported paragraphs snap to grid because SnapToGrid was
appended to grabbag, now it allows SnapToGrid property in
paragraph and paragraph styles to be imported properly.
Change-Id: I446b4c64c0ed86960896bcd61a1006c9173a757a
Reviewed-on: https://gerrit.libreoffice.org/15732
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf91261.docx | bin | 0 -> 22081 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf91261.docx b/sw/qa/extras/ooxmlexport/data/tdf91261.docx Binary files differnew file mode 100644 index 000000000000..6edb8b8755d7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf91261.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 948d3fbaf6d5..ba7715ba4abc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -676,6 +676,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89791, "tdf89791.docx") } } +DECLARE_OOXMLEXPORT_TEST(testTdf91261, "tdf91261.docx") +{ + bool snapToGrid = true; + uno::Reference< text::XTextRange > xPara = getParagraph( 2 ); + uno::Reference< beans::XPropertySet > properties( xPara, uno::UNO_QUERY); + properties->getPropertyValue("SnapToGrid") >>= snapToGrid ; + CPPUNIT_ASSERT_EQUAL(false, snapToGrid); + + uno::Reference< beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + sal_Int16 nGridMode; + xStyle->getPropertyValue("GridMode") >>= nGridMode; + CPPUNIT_ASSERT_EQUAL( sal_Int16(2), nGridMode); + + bool bGridSnapToChars; + xStyle->getPropertyValue("GridSnapToChars") >>= bGridSnapToChars; + CPPUNIT_ASSERT_EQUAL(true, bGridSnapToChars); + +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |