diff options
Diffstat (limited to 'sw/source/uibase/sidebar/PagePropertyPanel.cxx')
-rw-r--r-- | sw/source/uibase/sidebar/PagePropertyPanel.cxx | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx index ed4a66aeb3b1..48c7b5af3a2c 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx @@ -83,7 +83,7 @@ namespace { namespace sw { namespace sidebar { -PagePropertyPanel* PagePropertyPanel::Create ( +VclPtr<vcl::Window> PagePropertyPanel::Create ( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, SfxBindings* pBindings) @@ -95,10 +95,13 @@ PagePropertyPanel* PagePropertyPanel::Create ( if (pBindings == NULL) throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); - return new PagePropertyPanel( - pParent, - rxFrame, - pBindings); + return VclPtr<vcl::Window>( + VclPtr<PagePropertyPanel>::Create( + + pParent, + rxFrame, + pBindings), + SAL_NO_ACQUIRE); } PagePropertyPanel::PagePropertyPanel( @@ -200,8 +203,34 @@ PagePropertyPanel::PagePropertyPanel( PagePropertyPanel::~PagePropertyPanel() { + disposeOnce(); +} + +void PagePropertyPanel::dispose() +{ delete[] maImgSize; + maImgSize = NULL; delete[] maImgSize_L; + maImgSize_L = NULL; + + mpPageItem.reset(); + mpPageLRMarginItem.reset(); + mpPageULMarginItem.reset(); + mpPageSizeItem.reset(); + + mpToolBoxOrientation.clear(); + mpToolBoxMargin.clear(); + mpToolBoxSize.clear(); + mpToolBoxColumn.clear(); + + m_aSwPagePgULControl.dispose(); + m_aSwPagePgLRControl.dispose(); + m_aSwPagePgSizeControl.dispose(); + m_aSwPagePgControl.dispose(); + m_aSwPageColControl.dispose(); + m_aSwPagePgMetricControl.dispose(); + + PanelLayout::dispose(); } void PagePropertyPanel::Initialize() @@ -266,9 +295,9 @@ void PagePropertyPanel::Initialize() mpBindings->Update( SID_ATTR_PAGE_SIZE ); } -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ) +VclPtr<::svx::sidebar::PopupControl> PagePropertyPanel::CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ) { - return new PageOrientationControl( pParent, *this , mpPageItem->IsLandscape() ); + return VclPtr<PageOrientationControl>::Create( pParent, *this , mpPageItem->IsLandscape() ); } IMPL_LINK( PagePropertyPanel, ClickOrientationHdl, ToolBox*, pToolBox ) @@ -343,9 +372,10 @@ void PagePropertyPanel::ClosePageOrientationPopup() maOrientationPopup.Hide(); } -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ) +VclPtr<::svx::sidebar::PopupControl> PagePropertyPanel::CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ) { - return new PageMarginControl( + return VclPtr<PageMarginControl>::Create( + pParent, *this, *mpPageLRMarginItem.get(), @@ -393,9 +423,10 @@ void PagePropertyPanel::ClosePageMarginPopup() maMarginPopup.Hide(); } -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ) +VclPtr<::svx::sidebar::PopupControl> PagePropertyPanel::CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ) { - return new PageSizeControl( + return VclPtr<PageSizeControl>::Create( + pParent, *this, mePaper, @@ -427,9 +458,10 @@ void PagePropertyPanel::ClosePageSizePopup() maSizePopup.Hide(); } -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ) +VclPtr<::svx::sidebar::PopupControl> PagePropertyPanel::CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ) { - return new PageColumnControl( + return VclPtr<PageColumnControl>::Create( + pParent, *this, mpPageColumnTypeItem->GetValue(), @@ -462,6 +494,9 @@ void PagePropertyPanel::NotifyItemUpdate( { (void)bIsEnabled; + if (IsDisposed()) + return; + switch( nSId ) { case SID_ATTR_PAGE_COLUMN: |