summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-05-03 00:15:30 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-05-03 20:28:17 -0400
commit7684ae6cf43e2fa186f6e9c80d7d377e0dc1a1ab (patch)
treee6ecc88cac68e7eccc5dc86949d41ad47b8bdeea /sc/source
parent9fbcdedb98f096abfcf1893b3658bc8dc4a2efd4 (diff)
Update sheet IDs in sheet field items during copy and paste.
Change-Id: I1c6e9b4e82eead3c411044482e4fa09332b0babd
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/cell.cxx2
-rw-r--r--sc/source/core/data/cell2.cxx10
2 files changed, 7 insertions, 5 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index fd9499bece11..3af1a1bf2581 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -112,7 +112,7 @@ ScBaseCell* lclCloneCell( const ScBaseCell& rSrcCell, ScDocument& rDestDoc, cons
case CELLTYPE_STRING:
return new ScStringCell( static_cast< const ScStringCell& >( rSrcCell ) );
case CELLTYPE_EDIT:
- return new ScEditCell( static_cast< const ScEditCell& >( rSrcCell ), rDestDoc );
+ return new ScEditCell(static_cast<const ScEditCell&>(rSrcCell), rDestDoc, rDestPos);
case CELLTYPE_FORMULA:
return new ScFormulaCell( static_cast< const ScFormulaCell& >( rSrcCell ), rDestDoc, rDestPos, nCloneFlags );
case CELLTYPE_NOTE:
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index de24d1132605..c8c6b9b8af06 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -38,6 +38,7 @@
#include <vcl/mapmod.hxx>
#include <editeng/editobj.hxx>
#include <editeng/editstat.hxx>
+#include "editeng/fieldupdater.hxx"
#include "cell.hxx"
#include "compiler.hxx"
@@ -73,12 +74,13 @@ ScEditCell::ScEditCell( const EditTextObject* pObject, ScDocument* pDocP,
SetTextObject( pObject, pFromPool );
}
-ScEditCell::ScEditCell( const ScEditCell& rCell, ScDocument& rDoc ) :
- ScBaseCell( rCell ),
- pString( NULL ),
- pDoc( &rDoc )
+ScEditCell::ScEditCell(const ScEditCell& rCell, ScDocument& rDoc, const ScAddress& rDestPos) :
+ ScBaseCell(rCell), pString(NULL), pDoc(&rDoc)
{
SetTextObject( rCell.pData, rCell.pDoc->GetEditPool() );
+
+ editeng::FieldUpdater aUpdater = pData->GetFieldUpdater();
+ aUpdater.updateTableFields(rDestPos.Tab());
}
ScEditCell::ScEditCell( const rtl::OUString& rString, ScDocument* pDocP ) :