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

Laurent Godard lgodard.libre at laposte.net
Fri Sep 20 03:53:43 PDT 2013


 sc/source/core/data/column.cxx |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 515c69a812b3c43d87310157ce30dc7cc51aa0d5
Author: Laurent Godard <lgodard.libre at laposte.net>
Date:   Fri Sep 20 12:52:30 2013 +0200

    notes clipboard - as link option
    
    - not functionnal
    
    Change-Id: Ib28d995e2966c04ae845e3b0d112ec08bcc34b59

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 3438165..08d1a6e 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1666,6 +1666,23 @@ class CopyAsLinkHandler
         setDefaultAttrsToDest(nTopRow, nDataSize);
     }
 
+    void linkNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal
+    {
+        sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore();
+        SCROW nRowMax = nStartRow + nDataSize;
+
+        for (SCROW nRow = nStartRow; nRow < nRowMax; ++nRow)
+        {
+            ScPostIt* pSrcNote = maSrcCellNotes.get<ScPostIt*>(nRow);
+            if (pSrcNote)
+            {
+                ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab());
+                mrDestCol.GetDoc().ReleaseNote(aDestPos);
+                mrDestCol.GetDoc().SetNote(aDestPos, pSrcNote);
+            }
+        }
+    }
+
 public:
     CopyAsLinkHandler(const ScColumn& rSrcCol, ScColumn& rDestCol, sc::ColumnBlockPosition* pDestPos, sal_uInt16 nCopyFlags) :
         mrSrcCol(rSrcCol), mrDestCol(rDestCol), mpDestPos(pDestPos), mnCopyFlags(nCopyFlags)
@@ -1684,6 +1701,9 @@ public:
     {
         size_t nRow = aNode.position + nOffset;
 
+        if (mnCopyFlags & (IDF_NOTE|IDF_ADDNOTES)) //
+                linkNotes(nRow, nDataSize ); // TODO : notes not actually working
+
         switch (aNode.type)
         {
             case sc::element_type_numeric:


More information about the Libreoffice-commits mailing list