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

Eike Rathke erack at redhat.com
Wed Nov 16 11:24:33 UTC 2016


 sc/source/core/data/column3.cxx |    5 +++++
 sc/source/core/data/table3.cxx  |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 87d2c012ef51aca8bba127145c97409506217a4f
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Nov 16 12:23:36 2016 +0100

    tdf#96475 PasteSpecial EmptyDisplayedAsString as empty
    
    Deactivating the assert in fillSortedColumnArray() was necessary for the bug's
    Paste Special and Sort scenario, but actually the assert could had been hit
    also earlier if some cell values were not pasted / skipped and Sort was invoked
    after that.
    
    Change-Id: I7b08bfb4104f4c7eb30815944bc87eec79a87334

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 8a81dcb..3af350d 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -953,6 +953,11 @@ public:
                                 }
                             }
                         }
+                        else if (rSrcCell.IsEmptyDisplayedAsString())
+                        {
+                            // Empty stays empty and doesn't become 0.
+                            continue;
+                        }
                         else if (rSrcCell.IsValue())
                         {
                             bool bCopy = mrCxt.isDateCell(mrSrcCol, nSrcRow) ? bDateTime : bNumeric;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index cace309..eb91b3c 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -780,7 +780,12 @@ void fillSortedColumnArray(
                 }
                 break;
                 default:
-                    assert(!rCell.mpAttr);
+                    //assert(!rCell.mpAttr);
+                    // This assert doesn't hold, for example
+                    // CopyCellsFromClipHandler may omit copying cells during
+                    // PasteSpecial for which CopyTextAttrsFromClipHandler
+                    // still copies a CellTextAttr. So if that really is not
+                    // expected then fix it there.
                     rCellStore.push_back_empty();
             }
 


More information about the Libreoffice-commits mailing list