From 79f31e518588ae5e97a3aee750f7b95c107ff1af Mon Sep 17 00:00:00 2001 From: mark-sil <83427558+mark-sil@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:27:37 -0500 Subject: [PATCH] =?UTF-8?q?LT-21004:=20Fix=20text=20alignment=20when=20?= =?UTF-8?q?=E2=80=98Sorted=20from=20End=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/views/VwTextBoxes.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Src/views/VwTextBoxes.cpp b/Src/views/VwTextBoxes.cpp index cf309c57bb..91a036c915 100644 --- a/Src/views/VwTextBoxes.cpp +++ b/Src/views/VwTextBoxes.cpp @@ -3186,10 +3186,12 @@ class ParaBuilder // If there are inner piles in the line, align their corresponding components IntVec vdyBaselines; // item is position of nth baseline bool fNeedAdjust = false; + bool bContainsInnerPileBox = false; for (pbox = m_pboxStartLine; ; pbox = pbox->Next()) { if (pbox->IsInnerPileBox()) { + bContainsInnerPileBox = true; int irow = 0; pbox->ComputeInnerPileBaselines(m_pvpbox, vdyBaselines, 0, irow, fNeedAdjust); } @@ -3268,11 +3270,18 @@ class ParaBuilder break; case ktalRight: if (m_pvpbox->RightToLeft()) { - xPos = m_dxTrail + dxAlignMentAdjust; + xPos = m_dxTrail; } else { - xPos = m_dxLead + dxAlignMentAdjust; + xPos = m_dxLead; } + + // Only add the adjustment if this box does not contain an inner pile. (LT-21004) + if (!bContainsInnerPileBox) + { + xPos += dxAlignMentAdjust; + } + xSpaceUsed = xPos; dxExtraWidthRight = m_dxLead; break; @@ -9993,10 +10002,6 @@ void VwConcParaBox::DoSpecialAlignment(IVwGraphics * pvg) { if (m_cpo & kcpoAlign) { - // For now we can only do align left. - // The trick otherwise is not just to do our alignment, but to undo what the - // superclass Layout did. - Assert(m_qzvps->ParaAlign() == ktalLeft || m_qzvps->ParaAlign() == ktalLeading); // Figure out where the key word is naturally displayed. // First find the box it is part of. VwStringBox * psbox = NULL;