summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-12-31 17:45:50 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-01-18 09:05:28 +0000
commit441d7e046df36900bbf14b37277b15d615f67641 (patch)
tree05df1fb77bab72e79abbf4674198be59b80a8c23
parentb7388a7483da5cffdc4eef6c0474b98c9e5f5af0 (diff)
tdf#35021 TabOverMargin: support LEFT tabs also
Change-Id: Ifea8c7fcde82c9d45ce1d67a829555f5499feeb0 Reviewed-on: https://gerrit.libreoffice.org/32539 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/core/text/txttab.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 6b4d5bb1c2fc..b2dfd6ff146b 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -312,7 +312,7 @@ bool SwTabPortion::Format( SwTextFormatInfo &rInf )
void SwTabPortion::FormatEOL( SwTextFormatInfo &rInf )
{
- if( rInf.GetLastTab() == this && !IsTabLeftPortion() )
+ if( rInf.GetLastTab() == this )
PostFormat( rInf );
}
@@ -325,6 +325,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
const bool bTabCompat = rInf.GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_COMPAT);
const bool bTabOverflow = rInf.GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVERFLOW);
+ const bool bTabOverMargin = rInf.GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVER_MARGIN);
// The minimal width of a tab is one blank at least.
// #i37686# In compatibility mode, the minimum width
@@ -376,6 +377,13 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
}
case POR_TABLEFT:
{
+ // handle this case in PostFormat
+ if( bTabOverMargin && GetTabPos() > rInf.Width() )
+ {
+ rInf.SetLastTab( this );
+ break;
+ }
+
PrtWidth( static_cast<sal_uInt16>(GetTabPos() - rInf.X()) );
bFull = rInf.Width() <= rInf.X() + PrtWidth();
@@ -444,9 +452,13 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf )
}
const sal_uInt16 nWhich = GetWhichPor();
- OSL_ENSURE( POR_TABLEFT != nWhich, "SwTabPortion::PostFormat: already formatted" );
const bool bTabCompat = rInf.GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_COMPAT);
+ if ( bTabOverMargin && POR_TABLEFT == nWhich )
+ {
+ nPorWidth = 0;
+ }
+
// #127428# Abandon dec. tab position if line is full
if ( bTabCompat && POR_TABDECIMAL == nWhich )
{