sw/source/uibase/uiview/viewtab.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 79ceef1dd0970055a8de0f0676e1cd992a484ee1
Author: Michael Stahl <[email protected]>
Date:   Fri Sep 15 23:28:02 2017 +0200

    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

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);
                     }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to