[Libreoffice-commits] core.git: sc/source
Luboš Luňák (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 20 08:03:41 UTC 2019
sc/source/core/data/column3.cxx | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
New commits:
commit 5d5e308331e7166726264c43545798b5fb833c8a
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Thu May 16 17:13:40 2019 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon May 20 10:02:49 2019 +0200
cache mdds positions also in CopyTextAttrsFromClipHandler (tdf#112000)
This is basically just a copy&paste from CopyCellsFromClipHandler.
Change-Id: I4abd39923cb933e73d73938a8d38913b5e5382a0
Reviewed-on: https://gerrit.libreoffice.org/72423
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 26847a3a6126..a02a2442ce8b 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1330,13 +1330,32 @@ public:
class CopyTextAttrsFromClipHandler
{
+ sc::CopyFromClipContext& mrCxt;
sc::CellTextAttrStoreType& mrAttrs;
- sc::CellTextAttrStoreType::iterator miPos;
size_t const mnDelta;
+ sc::ColumnBlockPosition maDestBlockPos;
+ sc::ColumnBlockPosition* mpDestBlockPos; // to save it for next iteration.
public:
- CopyTextAttrsFromClipHandler( sc::CellTextAttrStoreType& rAttrs, size_t nDelta ) :
- mrAttrs(rAttrs), miPos(mrAttrs.begin()), mnDelta(nDelta) {}
+ CopyTextAttrsFromClipHandler( sc::CopyFromClipContext& rCxt, sc::CellTextAttrStoreType& rAttrs,
+ ScColumn& rDestCol, SCTAB nDestTab, SCCOL nDestCol, size_t nDelta ) :
+ mrCxt( rCxt ),
+ mrAttrs(rAttrs),
+ mnDelta(nDelta),
+ mpDestBlockPos(mrCxt.getBlockPosition(nDestTab, nDestCol))
+ {
+ if (mpDestBlockPos)
+ maDestBlockPos = *mpDestBlockPos;
+ else
+ rDestCol.InitBlockPosition(maDestBlockPos);
+ }
+
+ ~CopyTextAttrsFromClipHandler()
+ {
+ if (mpDestBlockPos)
+ // Don't forget to save this to the context!
+ *mpDestBlockPos = maDestBlockPos;
+ }
void operator() ( const sc::CellTextAttrStoreType::value_type& aNode, size_t nOffset, size_t nDataSize )
{
@@ -1349,7 +1368,7 @@ public:
std::advance(itEnd, nDataSize);
size_t nPos = aNode.position + nOffset + mnDelta;
- miPos = mrAttrs.set(miPos, nPos, it, itEnd);
+ maDestBlockPos.miCellTextAttrPos = mrAttrs.set(maDestBlockPos.miCellTextAttrPos, nPos, it, itEnd);
}
};
@@ -1406,7 +1425,7 @@ void ScColumn::CopyFromClip(
}
// Don't forget to copy the cell text attributes.
- CopyTextAttrsFromClipHandler aFunc(maCellTextAttrs, nDy);
+ CopyTextAttrsFromClipHandler aFunc(rCxt, maCellTextAttrs, *this, nTab, nCol, nDy);
sc::ParseBlock(rColumn.maCellTextAttrs.begin(), rColumn.maCellTextAttrs, aFunc, nRow1-nDy, nRow2-nDy);
return;
@@ -1426,7 +1445,7 @@ void ScColumn::CopyFromClip(
{
// Don't forget to copy the cell text attributes.
- CopyTextAttrsFromClipHandler aFunc(maCellTextAttrs, nDy);
+ CopyTextAttrsFromClipHandler aFunc(rCxt, maCellTextAttrs, *this, nTab, nCol, nDy);
sc::ParseBlock(rColumn.maCellTextAttrs.begin(), rColumn.maCellTextAttrs, aFunc, nRow1-nDy, nRow2-nDy);
}
}
More information about the Libreoffice-commits
mailing list