[Libreoffice-commits] core.git: 3 commits - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Oct 23 15:59:48 PDT 2013


 sc/source/core/data/column3.cxx  |   10 +++++++---
 sc/source/core/data/document.cxx |    4 ++--
 sc/source/ui/navipi/content.cxx  |   17 +++++++----------
 3 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit 59585984fcede9dcfce44557b7076ed682059e1c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Oct 23 18:59:09 2013 -0400

    When failing, we need to return an invalid address.
    
    ScAddress() gets initialized to a valid address of col=0,row=0,tab=0.
    
    Change-Id: I9f12b4b2329e2c9907b9c8113371d963fc06f442

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 30c9256..ccf7d32 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6177,12 +6177,12 @@ ScAddress ScDocument::GetNotePosition( size_t nIndex ) const
                 return ScAddress(nCol, nRow, nTab);
 
             OSL_FAIL("note not found");
-            return ScAddress();
+            return ScAddress(ScAddress::INITIALIZE_INVALID);
         }
     }
 
     OSL_FAIL("note not found");
-    return ScAddress();
+    return ScAddress(ScAddress::INITIALIZE_INVALID);
 }
 
 SCROW ScDocument::GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const
commit 5b483ed15d70bdc34b9520632ee569db0e6c4f9d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Oct 23 18:12:09 2013 -0400

    Cell note deletion should happen even when no cells exist in the column.
    
    This fixes one of the API test breakages.
    
    Change-Id: I8168d490ec5d519e151a74fb8c4343337262f15b

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index c90a33e..73bcf2d 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -600,14 +600,18 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag)
         aBlockPos.miCellTextAttrPos = maCellTextAttrs.begin();
         aBlockPos.miCellNotePos = maCellNotes.begin();
 
-        if ( nDelFlag & IDF_NOTE )
-            DeleteCellNotes( aBlockPos, nStartRow, nEndRow );
-
         // Delete the cells for real.
         std::for_each(aSpans.begin(), aSpans.end(), EmptyCells(aBlockPos, *this));
         CellStorageModified();
     }
 
+    if (nDelFlag & IDF_NOTE)
+    {
+        sc::ColumnBlockPosition aBlockPos;
+        aBlockPos.miCellNotePos = maCellNotes.begin();
+        DeleteCellNotes(aBlockPos, nStartRow, nEndRow);
+    }
+
     if ( nDelFlag & IDF_EDITATTR )
     {
         OSL_ENSURE( nContFlag == 0, "DeleteArea: Wrong Flags" );
commit f068f1ae32f4243d8f8f8b90209508b1b5906548
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Oct 23 17:38:27 2013 -0400

    Bail out on first hit. No need to go through the whole set.
    
    Change-Id: I044432a1d4e63f49731c24e4eb62525386818620

diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index fc70ef6..1fa2ca5 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -886,7 +886,6 @@ sal_Bool ScContentTree::NoteStringsChanged()
 
     SvTreeListEntry* pEntry = FirstChild( pParent );
 
-    bool bEqual = true;
     std::vector<sc::NoteEntry> aEntries;
     pDoc->GetAllNoteEntries(aEntries);
     std::vector<sc::NoteEntry>::const_iterator it = aEntries.begin(), itEnd = aEntries.end();
@@ -894,20 +893,18 @@ sal_Bool ScContentTree::NoteStringsChanged()
     {
         const ScPostIt* pNote = it->mpNote;
         if (!pEntry)
-            bEqual = false;
-        else
-        {
-            if (lcl_NoteString(*pNote) != GetEntryText(pEntry))
-                bEqual = false;
+            return true;
 
-            pEntry = NextSibling(pEntry);
-        }
+        if (lcl_NoteString(*pNote) != GetEntryText(pEntry))
+            return true;
+
+        pEntry = NextSibling(pEntry);
     }
 
     if ( pEntry )
-        bEqual = false;             // kommt noch was
+        return true;
 
-    return !bEqual;
+    return false;
 }
 
 sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType )


More information about the Libreoffice-commits mailing list