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

Miklos Vajna vmiklos at kemper.freedesktop.org
Fri Apr 20 00:46:57 PDT 2012


 sw/source/core/crsr/callnk.cxx |   63 ++++++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 29 deletions(-)

New commits:
commit e4509eea8fc7c07ddff48edf0d4c015c2663d896
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Apr 20 09:45:24 2012 +0200

    n#751313 SwCallLink: avoid redrawing complete rows without nested tables

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 642b3ea..79aac33 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -100,8 +100,21 @@ void lcl_notifyRow(const SwCntntNode* pNode, SwCrsrShell& rShell)
             if ( pRow )
             {
                 const SwTableLine* pLine = pRow->GetTabLine( );
-                SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
-                pRow->ModifyNotification( NULL, &pSize );
+                // Avoid redrawing the complete row if there are no nested tables
+                bool bHasTable = false;
+                SwFrm *pCell = pRow->GetLower();
+                for (; pCell && !bHasTable; pCell = pCell->GetNext())
+                {
+                    SwFrm *pContent = pCell->GetLower();
+                    for (; pContent && !bHasTable; pContent = pContent->GetNext())
+                        if (pContent->GetType() == FRM_TAB)
+                            bHasTable = true;
+                }
+                if (bHasTable)
+                {
+                    SwFmtFrmSize pSize = pLine->GetFrmFmt()->GetFrmSize();
+                    pRow->ModifyNotification(NULL, &pSize);
+                }
             }
         }
     }
commit 071c4d56517c43d3160c4c529abc534851066060
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Apr 19 16:20:46 2012 +0200

    n#751313 SwCallLink: avoid copy&paste via introducing lcl_notifyRow

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index a6373da..642b3ea 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -87,6 +87,25 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
     }
 }
 
+void lcl_notifyRow(const SwCntntNode* pNode, SwCrsrShell& rShell)
+{
+    if ( pNode != NULL )
+    {
+        SwFrm *myFrm = pNode->getLayoutFrm( rShell.GetLayout() );
+        if (myFrm!=NULL)
+        {
+            // We need to emulated a change of the row height in order
+            // to have the complete row redrawn
+            SwRowFrm* pRow = myFrm->FindRowFrm();
+            if ( pRow )
+            {
+                const SwTableLine* pLine = pRow->GetTabLine( );
+                SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
+                pRow->ModifyNotification( NULL, &pSize );
+            }
+        }
+    }
+}
 
 SwCallLink::~SwCallLink()
 {
@@ -100,19 +119,7 @@ SwCallLink::~SwCallLink()
     if( !pCNd )
         return;
 
-    SwFrm *myFrm = pCNd->getLayoutFrm( rShell.GetLayout() );
-    if (myFrm!=NULL)
-    {
-        // We need to emulated a change of the row height in order
-        // to have the complete row redrawn
-        SwRowFrm* pRow = myFrm->FindRowFrm( );
-        if ( pRow )
-        {
-            const SwTableLine* pLine = pRow->GetTabLine( );
-            SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
-            pRow->ModifyNotification( NULL, &pSize );
-        }
-    }
+    lcl_notifyRow(pCNd, rShell);
 
     const SwDoc *pDoc=rShell.GetDoc();
     const SwCntntNode *pNode = NULL;
@@ -120,22 +127,7 @@ SwCallLink::~SwCallLink()
     {
         pNode = pDoc->GetNodes()[nNode]->GetCntntNode();
     }
-    if ( pNode != NULL )
-    {
-        SwFrm *myFrm2 = pNode->getLayoutFrm( rShell.GetLayout() );
-        if (myFrm2!=NULL)
-        {
-            // We need to emulated a change of the row height in order
-            // to have the complete row redrawn
-            SwRowFrm* pRow = myFrm2->FindRowFrm();
-            if ( pRow )
-            {
-                const SwTableLine* pLine = pRow->GetTabLine( );
-                SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
-                pRow->ModifyNotification( NULL, &pSize );
-            }
-        }
-    }
+    lcl_notifyRow(pNode, rShell);
 
     xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex();
     sal_uInt16 nNdWhich = pCNd->GetNodeType();


More information about the Libreoffice-commits mailing list