diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-24 11:00:10 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-26 09:58:00 -0400 |
commit | 0809ccec5cee9f65461f7b551ffd686d2ff4281c (patch) | |
tree | 3765b411400c652996853f8e26ef8635c6ac9487 /sc/source/ui/unoobj/editsrc.cxx | |
parent | 1e6268e50d94eac41743ee23efc1b5dc4bd176bd (diff) |
Merged ScSharedCellEditSource with ScCellEditSource.
Again, this inheritance makes no sense.
Diffstat (limited to 'sc/source/ui/unoobj/editsrc.cxx')
-rw-r--r-- | sc/source/ui/unoobj/editsrc.cxx | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index af6bad4d4d06..d1a41659158f 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -102,70 +102,46 @@ void ScHeaderFooterEditSource::UpdateData() //------------------------------------------------------------------------ -ScSharedCellEditSource::ScSharedCellEditSource( ScCellTextData* pData ) : - pCellTextData( pData ) -{ - // pCellTextData is part of the ScCellTextObj. - // Text range and cursor keep a reference to their parent text, so the text object is - // always alive and the CellTextData is valid as long as there are children. -} +ScCellEditSource::ScCellEditSource(ScDocShell* pDocSh, const ScAddress& rP) : + pCellTextData(new ScCellTextData(pDocSh, rP)) {} -ScSharedCellEditSource::~ScSharedCellEditSource() +ScCellEditSource::~ScCellEditSource() { + delete pCellTextData; } -SvxEditSource* ScSharedCellEditSource::Clone() const +SvxEditSource* ScCellEditSource::Clone() const { - return new ScSharedCellEditSource( pCellTextData ); + return new ScCellEditSource(pCellTextData->GetDocShell(), pCellTextData->GetCellPos()); } -SvxTextForwarder* ScSharedCellEditSource::GetTextForwarder() +SvxTextForwarder* ScCellEditSource::GetTextForwarder() { return pCellTextData->GetTextForwarder(); } -void ScSharedCellEditSource::UpdateData() +void ScCellEditSource::UpdateData() { pCellTextData->UpdateData(); } -void ScSharedCellEditSource::SetDoUpdateData(sal_Bool bValue) +void ScCellEditSource::SetDoUpdateData(bool bValue) { pCellTextData->SetDoUpdate(bValue); } -sal_Bool ScSharedCellEditSource::IsDirty() const +bool ScCellEditSource::IsDirty() const { return pCellTextData->IsDirty(); } -ScEditEngineDefaulter* ScSharedCellEditSource::GetEditEngine() +ScEditEngineDefaulter* ScCellEditSource::GetEditEngine() { return pCellTextData->GetEditEngine(); } //------------------------------------------------------------------------ -// each ScCellEditSource object has its own ScCellTextData - -ScCellEditSource::ScCellEditSource( ScDocShell* pDocSh, const ScAddress& rP ) : - ScSharedCellEditSource( new ScCellTextData( pDocSh, rP ) ) -{ -} - -ScCellEditSource::~ScCellEditSource() -{ - delete GetCellTextData(); // not accessed in ScSharedCellEditSource dtor -} - -SvxEditSource* ScCellEditSource::Clone() const -{ - const ScCellTextData* pData = GetCellTextData(); - return new ScCellEditSource( pData->GetDocShell(), pData->GetCellPos() ); -} - -//------------------------------------------------------------------------ - ScAnnotationEditSource::ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP) : pDocShell( pDocSh ), aCellPos( rP ), |