summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-14 16:19:50 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-14 16:50:19 +0100
commita6278bc3a9a7de6de5802fc4cbceb739bc0720d6 (patch)
tree977ddf160e0c4faac1ccf2056ce2c4e9576d3778 /sw
parent1e3e7b077f708aefd2e866eca85abc822ae4cd02 (diff)
drawingML import: fix inheritance of character height
The problem was that in case a shape had multiple (e.g. two) paragraphs, and in case the first paragraph had an explicit character height, but not the second, then the cursor carried over the explicit character height to the second paragraph, but it shouldn't, as that leads to incorrect character height in the second paragraph. Fix this by remembering the default character height and using that in case nothing is set explicitly. Change-Id: I66e06d5cf192739fb254f7280c74617171d9ee6a
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/dml-charheight-default.docxbin0 -> 15770 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx b/sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx
new file mode 100755
index 000000000000..0f22a87f0e29
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/dml-charheight-default.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3b3a227c63d2..f1e7abd9e744 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1756,6 +1756,14 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString());
}
+DECLARE_OOXMLIMPORT_TEST(testDmlCharheightDefault, "dml-charheight-default.docx")
+{
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
+ // This was 16: the first run of the second para incorrectly inherited the char height of the first para.
+ CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(getRun(getParagraphOfText(2, xShape->getText()), 1), "CharHeight"));
+}
+
DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx")
{
// This was 43760, i.e. the height of the groupshape was larger than the page height, which is obviously incorrect.