diff options
-rw-r--r-- | sc/source/core/data/postit.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlannoi.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index f3a51f069c2b..068ec3ade5e5 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -504,7 +504,7 @@ void ScPostIt::CreateCaption( const ScAddress& rPos, const SdrCaptionObj* pCapti { // copy edit text object (object must be inserted into page already) if( OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() ) - maNoteData.mpCaption->SetOutlinerParaObject( pOPO ); + maNoteData.mpCaption->SetOutlinerParaObject( new OutlinerParaObject( *pOPO ) ); // copy formatting items (after text has been copied to apply font formatting) maNoteData.mpCaption->SetMergedItemSetAndBroadcast( pCaption->GetMergedItemSet() ); // move textbox position relative to new cell, copy textbox size diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx index 64d8c661ce20..5160b17a1a9d 100644 --- a/sc/source/filter/xml/xmlannoi.cxx +++ b/sc/source/filter/xml/xmlannoi.cxx @@ -216,8 +216,8 @@ void ScXMLAnnotationContext::EndElement() pMyAnnotation->pRect = new Rectangle(aRect); } - if((pSdrObj->GetOutlinerParaObject())) - pMyAnnotation->pOPO = new OutlinerParaObject( *(pSdrObj->GetOutlinerParaObject()) ); + if( OutlinerParaObject* pOPO = pSdrObj->GetOutlinerParaObject() ) + pMyAnnotation->pOPO = new OutlinerParaObject( *pOPO ); xShapes->remove(xShape); } diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index f9a86d718770..06c84ac83366 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -644,7 +644,12 @@ void ScXMLTableRowCellContext::SetAnnotation(const table::CellAddress& aCellAddr if( SdrCaptionObj* pCaption = pNote->GetCaption() ) { if( pMyAnnotation->pOPO ) + { + // transfer outliner object to caption pCaption->SetOutlinerParaObject( pMyAnnotation->pOPO ); + // do not delete the object in ScMyImportAnnotation d'tor + pMyAnnotation->pOPO = 0; + } else pCaption->SetText( pMyAnnotation->sText ); // copy all items and reset shadow items |