summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-12-31 16:08:54 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-01-17 08:30:50 +0000
commita9367c1b39600d5a5e2d0067113f06ad59cc37a1 (patch)
tree6f8e735b9635a4775abe631749a75149a08317f8
parentd74e3b5bc43635c8c86988884b97929c3b086732 (diff)
tdf#35021 TabOverMargin: support center and decimal tabs also
TabOverMargin compatibility setting allows tabs placed beyond the right margin to function where they are instead of using the right margin as a hard limit. So far this has only been effective for right tabs (the most logical tab to use at the far right. This patch adds support for center and decimal tabs also. Left tabs are trickier, so they will be attempted separately. CAVEAT: Basically all of this stuff tricks the layout engine, so the amount of text allowed on a single line is still "controlled" by the right margin. So, even though the extended line could theoretically be very long, the amount of text still must fit within the limits set by the right margin. Thus large margins may cause wrapping in LibreOffice, instead of disappearing off of the end of the paper as it does in MSWord, and editing the text might get confusing - which matches the experience in MSWord. Change-Id: I1ff638eb3576ec221247e9a9823e7e082a1cba79 Reviewed-on: https://gerrit.libreoffice.org/32534 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.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 3592bc2b1789..6b4d5bb1c2fc 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -455,7 +455,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf )
// no value was set => no decimal character was found
if ( USHRT_MAX != nPrePorWidth )
{
- if ( nPrePorWidth && nPorWidth - nPrePorWidth > rInf.Width() - nRight )
+ if ( !bTabOverMargin && nPrePorWidth && nPorWidth - nPrePorWidth > rInf.Width() - nRight )
{
nPrePorWidth += nPorWidth - nPrePorWidth - ( rInf.Width() - nRight );
}
@@ -469,7 +469,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf )
// centered tabs are problematic:
// We have to detect how much fits into the line.
sal_uInt16 nNewWidth = nPorWidth /2;
- if( nNewWidth > rInf.Width() - nRight )
+ if( !bTabOverMargin && nNewWidth > rInf.Width() - nRight )
nNewWidth = nPorWidth - (rInf.Width() - nRight);
nPorWidth = nNewWidth;
}