summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-20 23:48:52 +0100
committerDavid Tardon <dtardon@redhat.com>2014-12-11 16:25:29 +0000
commitf7d4adcae854ac1b40c809c9f9fadad067ad08fb (patch)
tree11b203d236f230f753fb141da5c80f2b001abe96
parent3328458f260cac0521d831dbcc142504b03e0fa4 (diff)
fdo#86215 pool new ScPatternAttr if source and destination are different docs
(cherry picked from commit d9c15867e914d91a7e86c499ffb6ee62f5b443f6) Conflicts: sc/source/core/data/column4.cxx Change-Id: Icdb68af83a0b208f9a427ee61ae18020c8835a41 Reviewed-on: https://gerrit.libreoffice.org/13433 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sc/source/core/data/column4.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index aeaecb09390b..19c2c2ca7d9a 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -148,6 +148,8 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
if (!pBlockPos)
return;
+ bool bSameDocPool = (rCxt.getClipDoc()->GetPool() == pDocument->GetPool());
+
ScCellValue& rSrcCell = rCxt.getSingleCell();
sal_uInt16 nFlags = rCxt.getInsertFlag();
@@ -156,7 +158,8 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
{
if (!rCxt.isSkipAttrForEmptyCells() || rSrcCell.meType != CELLTYPE_NONE)
{
- const ScPatternAttr* pAttr = rCxt.getSingleCellPattern();
+ const ScPatternAttr* pAttr = (bSameDocPool ? rCxt.getSingleCellPattern() :
+ rCxt.getSingleCellPattern()->PutInPool( pDocument, rCxt.getClipDoc()));
pAttrArray->SetPatternArea(nRow1, nRow2, pAttr, true);
}
}
@@ -181,8 +184,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
{
// Compare the ScDocumentPool* to determine if we are copying within the
// same document. If not, re-intern shared strings.
- svl::SharedStringPool* pSharedStringPool = (rCxt.getClipDoc()->GetPool() != pDocument->GetPool()) ?
- &pDocument->GetSharedStringPool() : NULL;
+ svl::SharedStringPool* pSharedStringPool = (bSameDocPool ? NULL : &pDocument->GetSharedStringPool());
svl::SharedString aStr = (pSharedStringPool ?
pSharedStringPool->intern( rSrcCell.mpString->getString()) :
*rSrcCell.mpString);