[Libreoffice-commits] .: 3 commits - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 19 12:05:03 PDT 2012


 sw/source/core/crsr/crsrsh.cxx |   28 ++++++++++++++--------------
 sw/source/ui/inc/hyp.hxx       |    1 -
 sw/source/ui/lingu/hyp.cxx     |    9 ---------
 3 files changed, 14 insertions(+), 24 deletions(-)

New commits:
commit 2855009f8fd1670c804996d64336ce5c3f45b175
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Sep 19 21:01:13 2012 +0200

    SwCrsrShell::Combine: this can be assert
    
    Change-Id: Ia23804f213f80f4b31f1e31491dfc87d2d49f46a

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 187095c..64da8ea 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1987,13 +1987,10 @@ void SwCrsrShell::Combine()
     // rhbz#689053: IsSelOvr must restore the saved stack position, not the
     // current one, because current point + stack mark may be invalid PaM
     SwCrsrSaveState aSaveState(*pCrsrStk);
-    if( pCrsrStk->HasMark() ) // only if GetMark was set
-    {
-        bool const bResult =
-        CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True );
-        OSL_ENSURE(bResult, "StackCrsr & current Crsr not in same Section.");
-        (void) bResult; // non-debug: unused
-    }
+    // stack cursor & current cursor in same Section?
+    assert(!pCrsrStk->HasMark() ||
+            CheckNodesRange(pCrsrStk->GetMark()->nNode,
+                            pCurCrsr->GetPoint()->nNode, true));
     *pCrsrStk->GetPoint() = *pCurCrsr->GetPoint();
     pCrsrStk->GetPtPos() = pCurCrsr->GetPtPos();
 
@@ -2009,7 +2006,9 @@ void SwCrsrShell::Combine()
     if( !pCurCrsr->IsInProtectTable( sal_True ) &&
         !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
                              nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+    {
         UpdateCrsr(); // update current cursor
+    }
 }
 
 
commit af4b6c94c68b5f67b931cde8d0acda6ec8b288bb
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Sep 19 20:47:48 2012 +0200

    rhbz#689053: fix crash following delete at last table cell:
    
    The IsSelOvr() in SwCrsrShell::Combine() detects that the PaM with mark
    in the last table cell and point ouside the table is invalid, but
    unfortunatley restores the wrong position, which does not actually
    correct the PaM; the deletion on the invalid PaM then removes the
    last SwTxtNode in the document, which leads to crash later.
    
    Change-Id: Ib2ae0b54e6c15dbe5b6811d8696531bf2022e1a4

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 96d96b7..187095c 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1984,26 +1984,27 @@ void SwCrsrShell::Combine()
         return;
 
     SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
-    SwCrsrSaveState aSaveState( *pCurCrsr );
+    // rhbz#689053: IsSelOvr must restore the saved stack position, not the
+    // current one, because current point + stack mark may be invalid PaM
+    SwCrsrSaveState aSaveState(*pCrsrStk);
     if( pCrsrStk->HasMark() ) // only if GetMark was set
     {
         bool const bResult =
         CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True );
         OSL_ENSURE(bResult, "StackCrsr & current Crsr not in same Section.");
         (void) bResult; // non-debug: unused
-        // copy GetMark
-        if( !pCurCrsr->HasMark() )
-            pCurCrsr->SetMark();
-        *pCurCrsr->GetMark() = *pCrsrStk->GetMark();
-        pCurCrsr->GetMkPos() = pCrsrStk->GetMkPos();
     }
+    *pCrsrStk->GetPoint() = *pCurCrsr->GetPoint();
+    pCrsrStk->GetPtPos() = pCurCrsr->GetPtPos();
 
     SwShellCrsr * pTmp = 0;
     if( pCrsrStk->GetNext() != pCrsrStk )
     {
         pTmp = dynamic_cast<SwShellCrsr*>(pCrsrStk->GetNext());
     }
-    delete pCrsrStk;
+    delete pCurCrsr;
+    pCurCrsr = pCrsrStk;
+    pCrsrStk->MoveTo(0); // remove from ring
     pCrsrStk = pTmp;
     if( !pCurCrsr->IsInProtectTable( sal_True ) &&
         !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
commit b74da58c7e85f92e6ce2d061dd3ced26e12a1dff
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Sep 19 20:26:49 2012 +0200

    SwHyphWrapper::bShowError is dead
    
    Change-Id: Ia9b8205a3b23fb98bf08d2d53aa82fdeda7785f5

diff --git a/sw/source/ui/inc/hyp.hxx b/sw/source/ui/inc/hyp.hxx
index 96ab150..5ec1106 100644
--- a/sw/source/ui/inc/hyp.hxx
+++ b/sw/source/ui/inc/hyp.hxx
@@ -45,7 +45,6 @@ private:
     sal_uInt16          nPageCount;     // page count for progress view
     sal_uInt16          nPageStart;     // 1st checked page
     sal_Bool            bInSelection : 1; // seperating selected text
-    sal_Bool            bShowError : 1; // report non existing language
     sal_Bool            bAutomatic : 1; // insert seperators without further inquiry
     sal_Bool            bInfoBox : 1;   // display info-box when ending
 
diff --git a/sw/source/ui/lingu/hyp.cxx b/sw/source/ui/lingu/hyp.cxx
index 13e29bb..1d3cfec 100644
--- a/sw/source/ui/lingu/hyp.cxx
+++ b/sw/source/ui/lingu/hyp.cxx
@@ -63,7 +63,6 @@ SwHyphWrapper::SwHyphWrapper( SwView* pVw,
     nPageCount( 0 ),
     nPageStart( 0 ),
     bInSelection( bSelect ),
-    bShowError( sal_False ),
     bInfoBox( sal_False )
 {
     uno::Reference< beans::XPropertySet >  xProp( GetLinguPropertySet() );
@@ -108,14 +107,6 @@ sal_Bool SwHyphWrapper::SpellContinue()
         delete pWait;
     }
 
-    if( bShowError )
-    {
-        bShowError = sal_False;
-        PSH->Push();
-        PSH->ClearMark();
-        pView->SpellError( nLangError );
-        PSH->Combine();
-    }
     return GetLast().is();
 }
 


More information about the Libreoffice-commits mailing list