[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 22 19:45:53 UTC 2021
sc/source/core/data/table7.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 0a8131d098e24842480c9c42b5e47accc7c59ce0
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Jun 19 13:51:28 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jun 22 21:45:18 2021 +0200
tdf#142932: fix crash when pasting cells with comments+"skip empty cells"
See bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=173011
4 0x00007fc4b0cdbb3d in ScColContainer::operator[](unsigned long) (this=0x872e1e0, nIndex=64) at sc/inc/colcontainer.hxx:43
5 0x00007fc4b120d82b in ScTable::DeleteBeforeCopyFromClip(sc::CopyFromClipContext&, ScTable const&, sc::ColumnSpanSet&) (this=0x872e1e0, rCxt=..., rClipTab=..., rBroadcastSpans=...)
at sc/source/core/data/table7.cxx:118
6 0x00007fc4b0e42939 in ScDocument::DeleteBeforeCopyFromClip(sc::CopyFromClipContext&, ScMarkData const&, sc::ColumnSpanSet&) (this=0x3bffa60, rCxt=..., rMark=..., rBroadcastSpans=...)
at sc/source/core/data/document10.cxx:75
7 0x00007fc4b0e0b67b in ScDocument::CopyFromClip(ScRange const&, ScMarkData const&, InsertDeleteFlags, ScDocument*, ScDocument*, bool, bool, bool, bool, ScRangeList const*)
(this=0x3bffa60, rDestRange=..., rMark=..., nInsFlag=7, pRefUndoDoc=0x0, pClipDoc=0x7d3bb40, bResetCut=true, bAsLink=false, bIncludeFiltered=false, bSkipAttrForEmpty=true, pDestRanges=0x7fff4a3da4b0)
at sc/source/core/data/document.cxx:2916
8 0x00007fc4b2412dc3 in ScViewFunc::PasteFromClip(InsertDeleteFlags, ScDocument*, ScPasteFunc, bool, bool, bool, InsCellCmd, InsertDeleteFlags, bool) (this=
0x41a29e0, nFlags=7, pClipDoc=0x7d3bb40, nFunction=ScPasteFunc::NONE, bSkipEmpty=true, bTranspose=false, bAsLink=false, eMoveMode=INS_NONE, nUndoExtraFlags=InsertDeleteFlags::NONE, bAllowDialogs=true)
at sc/source/ui/view/viewfun3.cxx:1312
Change-Id: Ic119cb5d414a35a9ba18b0564d7adf83154eb9d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117497
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit a6d269ed9478b20f611912bf9711c2683e7bc924)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117632
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
(cherry picked from commit bb59b4165456d13eda800098be8b875d93b093d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117637
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index fc821133ef65..b75751ff7de4 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -108,7 +108,8 @@ void ScTable::DeleteBeforeCopyFromClip(
ScRange aClipRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
SCCOL nClipCol = aClipRange.aStart.Col();
{
- for (SCCOL nCol = aRange.mnCol1; nCol <= aRange.mnCol2; ++nCol, ++nClipCol)
+ const SCCOL nMaxCol2 = std::min<SCCOL>( aRange.mnCol2, aCol.size() - 1 );
+ for (SCCOL nCol = aRange.mnCol1; nCol <= nMaxCol2; ++nCol, ++nClipCol)
{
if (nClipCol > aClipRange.aEnd.Col())
nClipCol = aClipRange.aStart.Col(); // loop through columns.
More information about the Libreoffice-commits
mailing list