[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source

Laurent Godard lgodard.libre at laposte.net
Fri Sep 13 01:17:45 PDT 2013


 sc/source/ui/navipi/content.cxx |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 2df476cc1c48c9e8df559dd0bc4c9d6807fad6df
Author: Laurent Godard <lgodard.libre at laposte.net>
Date:   Fri Sep 13 10:16:45 2013 +0200

    notes & navigator : reach correct cell
    
    Change-Id: I66ec8db438c0ed22bc8bdf469830fbb839b08e14

diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 73ec095..0afe65d 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -868,7 +868,7 @@ void ScContentTree::GetNoteStrings()
         for (SCCOL nCol=0; nCol<MAXCOLCOUNT; nCol++)
         {
             sc::CellNoteStoreType& maCellNotes = pDoc->GetColNotes(nCol, nTab);
-            for (SCROW nRow=0; nRow < MAXROWCOUNT; nRow++) // TODO : suboptimal
+            for (SCROW nRow=0; nRow < MAXROWCOUNT; nRow++) // TODO : notes suboptimal
             {
                 ScPostIt* pNote = maCellNotes.get<ScPostIt*>(nRow);
                 if (pNote)
@@ -891,20 +891,18 @@ ScAddress ScContentTree::GetNotePos( sal_uLong nIndex )
     {
         for (SCCOL nCol=0; nCol<MAXCOLCOUNT; nCol++)
         {
-            sc::CellNoteStoreType& maNotes = pDoc->GetColNotes(nCol, nTab);
-            if (nFound + maNotes.size() >= nIndex)
-            {
-                for (SCROW nRow=0; nRow < MAXROWCOUNT; nRow++) // TODO : suboptimal
+            sc::CellNoteStoreType& maCellNotes = pDoc->GetColNotes(nCol, nTab);
+
+                for (SCROW nRow=0; nRow < MAXROWCOUNT; nRow++) // TODO : notes suboptimal
                 {
-                    if (nFound == nIndex)
-                        return ScAddress(nCol, nRow, nTab);
-                    ++nFound;
+                    ScPostIt* pNote = maCellNotes.get<ScPostIt*>(nRow);
+                    if (pNote)
+                    {
+                        if (nFound == nIndex)
+                            return ScAddress(nCol, nRow, nTab);
+                        ++nFound;
+                    }
                 }
-            }
-            else
-            {
-                nFound += maNotes.size();
-            }
         }
     }
 
@@ -932,7 +930,7 @@ sal_Bool ScContentTree::NoteStringsChanged()
         for (SCCOL nCol=0; nCol<MAXCOLCOUNT; nCol++)
         {
             sc::CellNoteStoreType& maCellNotes = pDoc->GetColNotes(nCol, nTab);
-            for (SCROW nRow=0; nRow<MAXROWCOUNT; nRow++) // TODO : suboptimal
+            for (SCROW nRow=0; nRow<MAXROWCOUNT; nRow++) // TODO : notes suboptimal
             {
                     ScPostIt* pNote = maCellNotes.get<ScPostIt*>(nRow);
                     if (pNote)


More information about the Libreoffice-commits mailing list