[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - sc/source

Pranav Kant pranavk at collabora.com
Thu May 12 14:59:37 UTC 2016


 sc/source/ui/view/tabview3.cxx |   28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit bb51f11cf7b4143123b279fa7c0e6d2345e768b4
Author: Pranav Kant <pranavk at collabora.com>
Date:   Thu May 12 16:40:04 2016 +0530

    sc lok: Invalidate the new extended area
    
    Change-Id: I1fa58ca935860ed3c5983f4e6b15c9f7c8feda9b
    Reviewed-on: https://gerrit.libreoffice.org/24930
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 2005d91..21a9a6b 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -306,15 +306,41 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
         {
             if (nPosX > aViewData.GetMaxTiledCol() - 10 || nPosY > aViewData.GetMaxTiledRow() - 25)
             {
+                ScDocShell* pDocSh = aViewData.GetDocShell();
+                ScModelObj* pModelObj = pDocSh ? ScModelObj::getImplementation( pDocSh->GetModel() ) : nullptr;
+                Size aOldSize(0, 0);
+                if (pModelObj)
+                    aOldSize = pModelObj->getDocumentSize();
+
                 if (nPosX > aViewData.GetMaxTiledCol() - 10)
                     aViewData.SetMaxTiledCol(std::max(nPosX, aViewData.GetMaxTiledCol()) + 10);
 
                 if (nPosY > aViewData.GetMaxTiledRow() - 25)
                     aViewData.SetMaxTiledRow(std::max(nPosY, aViewData.GetMaxTiledRow()) + 25);
 
-                ScDocShell* pDocSh = aViewData.GetDocShell();
+                Size aNewSize(0, 0);
+                if (pModelObj)
+                    aNewSize = pModelObj->getDocumentSize();
+
                 if (pDocSh)
+                {
                     pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+
+                    // New area extended to the right of the sheet after last column
+                    // including overlapping area with aNewRowArea
+                    Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight());
+                    // New area extended to the bottom of the sheet after last row
+                    // excluding overlapping area with aNewColArea
+                    Rectangle aNewRowArea(0, aOldSize.getHeight(), aOldSize.getWidth(), aNewSize.getHeight());
+
+                    // Only invalidate if spreadsheet extended to the right
+                    if (aNewColArea.getWidth())
+                        pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
+
+                    // Only invalidate if spreadsheet extended to the bottom
+                    if (aNewRowArea.getHeight())
+                        pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
+                }
             }
         }
     }


More information about the Libreoffice-commits mailing list