summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2017-04-27 20:41:06 +0800
committerMark Hung <marklh9@gmail.com>2017-05-01 14:09:09 +0200
commitb647f9f4bcb24ed9b71c77038da6b754b8d42eb7 (patch)
treeb263bee23486d77c3361d6646ba9dfe46023c15f /sw/qa/extras
parente7e149508a95d684e033786560bb9972ee59e1ad (diff)
tdf#107362 don't insert kern if snap to char is not checked.
SwKernPortion is inserted between different scripts to snap the later text portion to the charcter grid if type of text grid is lines and chars, even if snap-to-char isn't checked, and create unexpected space there. It is not necessary because when snap-to-char is not checked, there would be pitch between characters. Format all three scripts in the same way and do not insert kern portion anymore if snap-to-char isn't checked. Change-Id: I6078b425aa735beb50cc6a6b4eafbba9f91f7132 Reviewed-on: https://gerrit.libreoffice.org/37037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sw/qa/extras')
-rwxr-xr-xsw/qa/extras/uiwriter/data/tdf107362.odtbin0 -> 10905 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf107362.odt b/sw/qa/extras/uiwriter/data/tdf107362.odt
new file mode 100755
index 000000000000..9f7e5cbfb7ab
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf107362.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 9cf0fad97ff3..2b4764b7b998 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -232,6 +232,7 @@ public:
void testTdf106701_tabOverMarginAutotab();
void testTdf104492();
void testTdf107025();
+ void testTdf107362();
void testTdf105417();
void testTdf105625();
void testTdf106736();
@@ -359,6 +360,7 @@ public:
CPPUNIT_TEST(testTdf106701_tabOverMarginAutotab);
CPPUNIT_TEST(testTdf104492);
CPPUNIT_TEST(testTdf107025);
+ CPPUNIT_TEST(testTdf107362);
CPPUNIT_TEST(testTdf105417);
CPPUNIT_TEST(testTdf105625);
CPPUNIT_TEST(testTdf106736);
@@ -4486,6 +4488,23 @@ void SwUiWriterTest::testTdf107025()
CPPUNIT_ASSERT_EQUAL( sal_Int32(9), nWidth2 / nWidth1 );
}
+void SwUiWriterTest::testTdf107362()
+{
+ createDoc("tdf107362.odt");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ sal_Int32 nHeight = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[1]" , "nHeight").toInt32();
+ sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[1]" , "nWidth").toInt32();
+ sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[2]" , "nWidth").toInt32();
+ sal_Int32 nLineWidth = getXPath(pXmlDoc, "//LineBreak" , "nWidth").toInt32();
+ sal_Int32 nKernWidth = nLineWidth - nWidth1 - nWidth2;
+ // Test only if fonts are available
+ if ( nWidth1 > 500 && nWidth2 > 200 )
+ {
+ // Kern width should be smaller than 1/3 of the CJK font height.
+ CPPUNIT_ASSERT( nKernWidth * 3 < nHeight );
+ }
+}
+
void SwUiWriterTest::testTdf105417()
{
SwDoc* pDoc = createDoc("tdf105417.odt");