[Libreoffice-commits] core.git: 2 commits - sw/source

Caolán McNamara caolanm at redhat.com
Fri Jun 17 09:35:36 UTC 2016


 sw/source/core/access/acctable.cxx |   10 ++++++----
 sw/source/core/layout/tabfrm.cxx   |    7 +++++--
 sw/source/core/layout/wsfrm.cxx    |    2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 4561119a8bab986df25a5ce2a544aa96394cbd5d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 17 10:10:33 2016 +0100

    Resolves: tdf#100421, don't crash on deleting particular table
    
    Change-Id: I52a4cf0732240aa26147313ae6a52c4fd8d8933c

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 002b653..422d64e 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4326,8 +4326,10 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
 
     //Only shrink as much as the content of the biggest cell allows.
     SwTwips nRealDist = nDist;
+    SwFormat* pMod = GetFormat();
+    if (pMod)
     {
-        const SwFormatFrameSize &rSz = GetFormat()->GetFrameSize();
+        const SwFormatFrameSize &rSz = pMod->GetFrameSize();
         SwTwips nMinHeight = rSz.GetHeightSizeType() == ATT_MIN_SIZE ?
                              rSz.GetHeight() :
                              0;
@@ -4361,7 +4363,8 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
                 Frame().Pos().X() += nReal;
         }
 
-        SwTwips nTmp = GetUpper()->Shrink( nReal, bTst );
+        SwLayoutFrame* pFrame = GetUpper();
+        SwTwips nTmp = pFrame ? pFrame->Shrink(nReal, bTst) : 0;
         if ( !bShrinkAnyway && !GetNext() && nTmp != nReal )
         {
             //The last one gets the leftover in the upper and therefore takes
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 1635463..9451c0a 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1216,7 +1216,7 @@ SwTwips SwFrame::Shrink( SwTwips nDist, bool bTst, bool bInfo )
                 const SwTabFrame* pTab = FindTabFrame();
 
                 // NEW TABLES
-                if ( pTab->IsVertical() != IsVertical() ||
+                if ( (pTab && pTab->IsVertical() != IsVertical()) ||
                      pThisCell->GetLayoutRowSpan() < 1 )
                     return 0;
             }
commit e41a694c8b4fd1503b31f3a9da326e9f7ddd1b79
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 17 09:44:26 2016 +0100

    Related: tdf#100421 crash in a11y on load of source odt
    
    stldebug assert because end is before start and we can'g
    get to start from end in a std::set
    
    Change-Id: I0471220d3940e08b564f88841703a539aaf369d6

diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 28611e2..8f2c4e3 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -557,15 +557,17 @@ void SwAccessibleTableData_Impl::GetRowColumnAndExtent(
                 maRows.upper_bound( rBox.Bottom() - maTabFramePos.Y() ) );
     rRow =
          static_cast< sal_Int32 >( std::distance( maRows.begin(), aStt ) );
-    rRowExtent =
-         static_cast< sal_Int32 >( std::distance( aStt, aEnd ) );
+    sal_Int32 nRowEnd =
+         static_cast< sal_Int32 >( std::distance( maRows.begin(), aEnd ) );
+    rRowExtent = nRowEnd - rRow;
 
     aStt = maColumns.lower_bound( rBox.Left() - maTabFramePos.X() );
     aEnd = maColumns.upper_bound( rBox.Right() - maTabFramePos.X() );
     rColumn =
          static_cast< sal_Int32 >( std::distance( maColumns.begin(), aStt ) );
-    rColumnExtent =
-         static_cast< sal_Int32 >( std::distance( aStt, aEnd ) );
+    sal_Int32 nColumnEnd =
+         static_cast< sal_Int32 >( std::distance( maColumns.begin(), aEnd ) );
+    rColumnExtent = nColumnEnd - rColumn;
 }
 
 class SwAccSingleTableSelHander_Impl : public SwAccTableSelHander_Impl


More information about the Libreoffice-commits mailing list