diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-05 10:47:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-07 13:24:51 +0100 |
commit | 1d2773807f6d2deb1181ef4b14fbdd49ca1d5c14 (patch) | |
tree | 788ef3ef220549c9785bcf1f5b35becc176300d4 /cui | |
parent | e4e80ed313882f9ea1b309054e5aa3e839586516 (diff) |
ref-count SdrPage
which simplifies ownership handling, particularly with regard to
undo/redo
Change-Id: Ie8f300ebfdae6db3c06f78a87e35a07497d6b825
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111991
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/tpline.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index aba1fafc6735..2a9fc74cc429 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -820,13 +820,13 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) std::unique_ptr<SdrModel> pModel( new SdrModel(nullptr, nullptr, true)); pModel->GetItemPool().FreezeIdRanges(); - SdrPage* pPage = new SdrPage( *pModel, false ); + rtl::Reference<SdrPage> pPage = new SdrPage( *pModel, false ); pPage->SetSize(Size(1000,1000)); - pModel->InsertPage( pPage, 0 ); + pModel->InsertPage( pPage.get(), 0 ); { std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev )); pView->hideMarkHandles(); - pView->ShowSdrPage(pPage); + pView->ShowSdrPage(pPage.get()); size_t nSymTmp = static_cast<size_t>(nSymType); if(m_pSymbolList) { @@ -1437,14 +1437,14 @@ IMPL_LINK_NOARG(SvxLineTabPage, MenuCreateHdl_Impl, weld::ToggleButton&, void) new SdrModel(nullptr, nullptr, true)); pModel->GetItemPool().FreezeIdRanges(); // Page - SdrPage* pPage = new SdrPage( *pModel, false ); + rtl::Reference<SdrPage> pPage = new SdrPage( *pModel, false ); pPage->SetSize(Size(1000,1000)); - pModel->InsertPage( pPage, 0 ); + pModel->InsertPage( pPage.get(), 0 ); { // 3D View std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev )); pView->hideMarkHandles(); - pView->ShowSdrPage(pPage); + pView->ShowSdrPage(pPage.get()); // Generate invisible square to give all symbols a // bitmap size, which is independent from specific glyph |