summaryrefslogtreecommitdiff
path: root/sw/source/core/text/itradj.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-06-16 08:13:19 +0200
committerLászló Németh <nemeth@numbertext.org>2020-06-16 18:31:56 +0200
commitcec1d2cb8eb17a28bf418625ea6ea522d6c1c580 (patch)
tree530b1a8b6a8ffd78a63719a99c4692d3832f8ac7 /sw/source/core/text/itradj.cxx
parent0747e8b98089803d6b66bc8ede3e961c2471f455 (diff)
tdf#106234 sw: don't justify after centered tabs
(also after right-aligned and decimal-aligned tabs) before the page break in a justified paragraph. Justify only after left-aligned tabs, like MSO does. Regression from commit 07dcbed5fb6d88f69d84313ddede81c222a5a7a6 (INTEGRATION: CWS fmebugs01 (1.15.104); FILE MERGED 2004/02/09 15:13:57 fme 1.15.104.1: #i13507# Justified alignment for lines containing manual breaks). See also commit 5d7b3475278f59a423c2139ae51f9b4849621890 (INTEGRATION: CWS swqbf34 (1.17.96); FILE MERGED 2005/06/29 12:12:25 fme 1.17.96.2: #i49277# New compatibility option bDoNotJustifyLinesWithManualBreak). Change-Id: Ib92e301aaf46eec283c0850d23549b1b54106068 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96438 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/text/itradj.cxx')
-rw-r--r--sw/source/core/text/itradj.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index e3c24e6cf5ca..64a53c3c4481 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -287,18 +287,33 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
// #i49277#
const bool bDoNotJustifyLinesWithManualBreak =
GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
+ bool bDoNotJustifyTab = false;
SwLinePortion *pPos = pCurrent->GetNextPortion();
while( pPos )
{
- if ( bDoNotJustifyLinesWithManualBreak &&
+ if ( ( bDoNotJustifyLinesWithManualBreak || bDoNotJustifyTab ) &&
pPos->IsBreakPortion() && !IsLastBlock() )
{
pCurrent->FinishSpaceAdd();
break;
}
+ switch ( pPos->GetWhichPor() )
+ {
+ case PortionType::TabCenter :
+ case PortionType::TabRight :
+ case PortionType::TabDecimal :
+ bDoNotJustifyTab = true;
+ break;
+ case PortionType::TabLeft :
+ case PortionType::Break:
+ bDoNotJustifyTab = false;
+ break;
+ default: break;
+ }
+
if ( pPos->InTextGrp() )
nGluePortion = nGluePortion + static_cast<SwTextPortion*>(pPos)->GetSpaceCnt( GetInfo(), nCharCnt );
else if( pPos->IsMultiPortion() )