summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-03-30 12:48:18 +0300
committerJustin Luth <justin_luth@sil.org>2017-03-31 06:01:18 +0000
commit5251e7988a3bb1cfccff54eccf7fdd7621c4627c (patch)
tree510f6e717921f96c89c1e4debc9397258ee0bef8 /sw
parent4a58754714c4e570f68b31a1926c7de6feb48cc2 (diff)
tdf#106701 tabOverMargin: only affect specified tabstops, not autotab
Change-Id: I15bf3a8555a152cab90380524b4a968f9f95fc37 Reviewed-on: https://gerrit.libreoffice.org/35924 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf106701_tabOverMarginAutotab.docbin0 -> 21504 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx15
-rw-r--r--sw/source/core/text/txttab.cxx2
3 files changed, 16 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf106701_tabOverMarginAutotab.doc b/sw/qa/extras/uiwriter/data/tdf106701_tabOverMarginAutotab.doc
new file mode 100644
index 000000000000..438a8cb791f2
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf106701_tabOverMarginAutotab.doc
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 1bd2b02f1d6e..e5ea84a5d8f0 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -227,6 +227,7 @@ public:
void testTdf104814();
void testTdf66405();
void testTdf35021_tabOverMarginDemo();
+ void testTdf106701_tabOverMarginAutotab();
void testTdf104492();
void testTdf105417();
void testTdf105625();
@@ -349,6 +350,7 @@ public:
CPPUNIT_TEST(testTdf104814);
CPPUNIT_TEST(testTdf66405);
CPPUNIT_TEST(testTdf35021_tabOverMarginDemo);
+ CPPUNIT_TEST(testTdf106701_tabOverMarginAutotab);
CPPUNIT_TEST(testTdf104492);
CPPUNIT_TEST(testTdf105417);
CPPUNIT_TEST(testTdf105625);
@@ -4415,6 +4417,19 @@ void SwUiWriterTest::testTdf35021_tabOverMarginDemo()
CPPUNIT_ASSERT_MESSAGE("Decimal Tab width is ~4096", nMargin < nWidth);
}
+void SwUiWriterTest::testTdf106701_tabOverMarginAutotab()
+{
+ createDoc("tdf106701_tabOverMarginAutotab.doc");
+ calcLayout();
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ // The right margin is ~3378
+ sal_Int32 nRightMargin = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds", "width").toInt32();
+ // Automatic tabstops should never be affected by tabOverMargin compatibility
+ // The 1st line's width previously was ~9506
+ sal_Int32 nWidth = getXPath(pXmlDoc, "//LineBreak[1]", "nWidth").toInt32();
+ CPPUNIT_ASSERT_MESSAGE("1st line's width is less than the right margin", nWidth < nRightMargin);
+}
+
void SwUiWriterTest::testTdf104492()
{
createDoc("tdf104492.docx");
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index b2dfd6ff146b..451dcb4d4b4e 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -378,7 +378,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
case POR_TABLEFT:
{
// handle this case in PostFormat
- if( bTabOverMargin && GetTabPos() > rInf.Width() )
+ if( bTabOverMargin && !bAutoTabStop && GetTabPos() > rInf.Width() )
{
rInf.SetLastTab( this );
break;