summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-20 23:48:52 +0100
committerEike Rathke <erack@redhat.com>2014-12-11 01:00:53 +0100
commit9377c934434140d5e70b67cd4864a3631a70e438 (patch)
tree12150723a06416e66ed4a273301a50108870598b /sc/source/core
parentde9f3661741db3223332433d9bd7c327559e4b70 (diff)
fdo#86215 pool new ScPatternAttr if source and destination are different docs
Change-Id: Icdb68af83a0b208f9a427ee61ae18020c8835a41 (cherry picked from commit d9c15867e914d91a7e86c499ffb6ee62f5b443f6)
Diffstat (limited to 'sc/source/core')
-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 2291d3810827..c4be8c8339ef 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -149,6 +149,8 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
if (!pBlockPos)
return;
+ bool bSameDocPool = (rCxt.getClipDoc()->GetPool() == pDocument->GetPool());
+
ScCellValue& rSrcCell = rCxt.getSingleCell(nColOffset);
InsertDeleteFlags nFlags = rCxt.getInsertFlag();
@@ -157,7 +159,8 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
{
if (!rCxt.isSkipAttrForEmptyCells() || rSrcCell.meType != CELLTYPE_NONE)
{
- const ScPatternAttr* pAttr = rCxt.getSingleCellPattern(nColOffset);
+ const ScPatternAttr* pAttr = (bSameDocPool ? rCxt.getSingleCellPattern(nColOffset) :
+ rCxt.getSingleCellPattern(nColOffset)->PutInPool( pDocument, rCxt.getClipDoc()));
pAttrArray->SetPatternArea(nRow1, nRow2, pAttr, true);
}
}
@@ -182,8 +185,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);