summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itrpaint.cxx19
-rw-r--r--sw/source/core/text/porlin.hxx1
2 files changed, 19 insertions, 1 deletions
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 79d3c5dd11e6..c5eba017cb04 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -37,6 +37,7 @@
#include <tgrditem.hxx>
#include <EnhancedPDFExportHelper.hxx>
+#include <IDocumentSettingAccess.hxx>
#include "flyfrms.hxx"
#include "viewsh.hxx"
@@ -161,8 +162,24 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
SwLinePortion *pPor = bEndPor ? m_pCurr->GetFirstPortion() : CalcPaintOfst( rPaint );
// Optimization!
- const SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
+ SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
const SwTwips nTmpLeft = GetInfo().X();
+ //compatibility setting: allow tabstop text to exceed right margin
+ if( GetInfo().GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVER_MARGIN) )
+ {
+ SwLinePortion* pPorIter = pPor;
+ while( pPorIter )
+ {
+ if( pPorIter->IsTabRightPortion() )
+ {
+ const SwTabRightPortion *pRightTabPor = static_cast<SwTabRightPortion*>(pPorIter);
+ const SwTwips nTabPos = nTmpLeft + pRightTabPor->GetTabPos();
+ if( nMaxRight < nTabPos )
+ nMaxRight = std::min( rPaint.Right(), nTabPos );
+ }
+ pPorIter = pPorIter->GetPortion();
+ }
+ }
if( !bEndPor && nTmpLeft >= nMaxRight )
return;
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 486827db2e39..cf46070c3b71 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -125,6 +125,7 @@ public:
inline bool IsErgoSumPortion() const { return nWhichPor == POR_ERGOSUM; }
inline bool IsQuoVadisPortion() const { return nWhichPor == POR_QUOVADIS; }
inline bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; }
+ inline bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; }
inline bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; }
inline bool IsFootnotePortion() const { return nWhichPor == POR_FTN; }
inline bool IsDropPortion() const { return nWhichPor == POR_DROP; }