diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf134063.docx | bin | 0 -> 19854 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/text/txttab.cxx | 15 |
3 files changed, 19 insertions, 9 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf134063.docx b/sw/qa/extras/ooxmlexport/data/tdf134063.docx Binary files differnew file mode 100644 index 000000000000..372fed20e57f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf134063.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 0f3a428c5985..92c5423a2b25 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -39,6 +39,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133370_columnBreak, "tdf133370_columnBreak.odt") CPPUNIT_ASSERT_EQUAL(1, getPages()); } + +DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + xmlDocUniquePtr pDump = parseLayoutDump(); + + // There are three tabs with default width + CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[1]", "nWidth").toInt32()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[2]", "nWidth").toInt32()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[3]", "nWidth").toInt32()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 616a919eb2e0..df8b5ee4ce75 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -48,6 +48,11 @@ const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos, const SwTwip if( rTabStop.GetTabPos() > SwTwips(nRight) ) return i ? nullptr : &rTabStop; + // If we are starting search from zero position, + // than we should include tabstop at zero position + if ((nSearchPos == 0) && (rTabStop.GetTabPos() == 0)) + return &rTabStop; + if( rTabStop.GetTabPos() > nSearchPos ) return &rTabStop; } @@ -119,7 +124,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto // #i24363# tab stops relative to indent // nSearchPos: The current position relative to the tabs origin - SwTwips nSearchPos = bRTL ? + const SwTwips nSearchPos = bRTL ? nTabLeft - nCurrentAbsPos : nCurrentAbsPos - nTabLeft; @@ -127,14 +132,6 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto // any hard set tab stops: // Note: If there are no user defined tab stops, there is always a // default tab stop. - - // If search is started from zero position (beginning of line), than - // lets do it from -1: this will allow to include into account potential - // tab stop at zero position. Yes, it will be zero width tab useless - // mostly, but this have sense in case of lists. - if (nSearchPos == 0) - nSearchPos = -1; - const SvxTabStop* pTabStop = m_aLineInf.GetTabStop( nSearchPos, nMyRight ); if ( pTabStop ) { |