summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-15 23:28:02 +0200
committerMichael Stahl <mstahl@redhat.com>2017-09-18 11:16:37 +0200
commit79ceef1dd0970055a8de0f0676e1cd992a484ee1 (patch)
tree93a120407d6a866ca067d66193603e396b612e2d
parent6fa56459f1b3ddd7667585d18952cf409f5f8c4c (diff)
related: tdf#111967 fix assertions about silly column positions
ImplLogicToPixel() is called with ~LONG_MIN value, which comes from SwView::StateTabWin() where we have: (rr) p aTabCols $12 = { nLeftMin = 1134, nLeft = 0, nRight = 4618, nRightMax = 9223372036854775807, bLastRowAllowedToChange = true, aData = std::__debug::vector of length 9, capacity 16 = {{ nPos = 387, nMin = 0, nMax = 9223372036854775807, bHidden = false }, { The problem is that the "aTabCols.GetRight() - rEntry.nMax" becomes negative, which is probably wrong, so enforce a minimum of 0. (regression from 4c60f722afdc0be5c129ce5f5ed6786d09d0051e, which removed a cast of the value to sal_uInt16, which also didn't look right to me, but perhaps wouldn't cause this assert?) Change-Id: Ia1aa2cd100ac25a8c34902cc992d54954fead284
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index ef8b0752eeb6..7d969e5430fd 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1959,8 +1959,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
nEnd = aTabCols.GetRight() - rEntry.nPos;
SvxColumnDescription aColDesc( nStart, nEnd,
- aTabCols.GetRight() - rEntry.nMax,
- aTabCols.GetRight() - rEntry.nMin,
+ std::max(0L, aTabCols.GetRight() - rEntry.nMax),
+ std::max(0L, aTabCols.GetRight() - rEntry.nMin),
!aTabCols.IsHidden(i) );
aColItem.Append(aColDesc);
}