diff options
Diffstat (limited to 'chart2/source/controller/drawinglayer/ViewElementListProvider.cxx')
-rw-r--r-- | chart2/source/controller/drawinglayer/ViewElementListProvider.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 77099c9444fe..51b163d1fccd 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -26,14 +26,13 @@ #include <com/sun/star/drawing/Direction3D.hpp> #include <o3tl/safeint.hxx> #include <svx/xtable.hxx> -#include <svl/itempool.hxx> #include <svtools/ctrltool.hxx> #include <vcl/svapp.hxx> #include <svx/svdobj.hxx> #include <vcl/virdev.hxx> #include <svx/svdview.hxx> #include <svx/svdpage.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace chart { @@ -110,10 +109,6 @@ SdrObjList* ViewElementListProvider::GetSymbolList() const { //@todo use mutex - //get shape factory - uno::Reference<lang::XMultiServiceFactory> xShapeFactory( - m_pDrawModelWrapper->getShapeFactory()); - //get hidden draw page (target): rtl::Reference<SvxDrawPage> xTarget = m_pDrawModelWrapper->getHiddenDrawPage(); @@ -143,7 +138,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co nStandardSymbol*=-1; if( o3tl::make_unsigned(nStandardSymbol) >= pSymbolList->GetObjCount() ) nStandardSymbol %= pSymbolList->GetObjCount(); - SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol); + rtl::Reference<SdrObject> pObj = pSymbolList->GetObj(nStandardSymbol); ScopedVclPtrInstance< VirtualDevice > pVDev; pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); @@ -151,7 +146,6 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co std::unique_ptr<SdrModel> pModel( new SdrModel()); - pModel->GetItemPool().FreezeIdRanges(); rtl::Reference<SdrPage> pPage = new SdrPage( *pModel, false ); pPage->SetSize(Size(1000,1000)); pModel->InsertPage( pPage.get(), 0 ); @@ -162,8 +156,8 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co // directly clone to target SdrModel pObj = pObj->CloneSdrObject(*pModel); - pPage->NbcInsertObject(pObj); - aView.MarkObj(pObj,pPageView); + pPage->NbcInsertObject(pObj.get()); + aView.MarkObj(pObj.get(),pPageView); if( pSymbolShapeProperties ) pObj->SetMergedItemSet(*pSymbolShapeProperties); @@ -176,7 +170,9 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co aView.UnmarkAll(); pObj=pPage->RemoveObject(0); - SdrObject::Free( pObj ); + // these need to die before the associated SdrModel + pObj.clear(); + pPage.clear(); return aGraph; } |