diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-17 13:14:20 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-17 13:16:52 +0200 |
commit | a3525585f10ff39b9aae14d7506e94cf77542c14 (patch) | |
tree | 2219d91c5da071598ab773f43216bf4febc955ce /sw/source/uibase/sidebar | |
parent | 0a497cb52a2ffecd94178eed296ba8ae7f526358 (diff) |
sw: convert new to ::Create.
Change-Id: I937aa67ee4a3b07bd180daaaa3c665245ea08b92
Diffstat (limited to 'sw/source/uibase/sidebar')
-rw-r--r-- | sw/source/uibase/sidebar/PageColumnControl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageMarginControl.cxx | 24 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PagePropertyPanel.cxx | 22 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PagePropertyPanel.hxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageSizeControl.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/WrapPropertyPanel.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/WrapPropertyPanel.hxx | 5 |
7 files changed, 37 insertions, 33 deletions
diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx index 23676cbc43c1..39b6757771cd 100644 --- a/sw/source/uibase/sidebar/PageColumnControl.cxx +++ b/sw/source/uibase/sidebar/PageColumnControl.cxx @@ -38,7 +38,7 @@ PageColumnControl::PageColumnControl( const bool bLandscape ) : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_COLUMN) ) , mpColumnValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_COLUMN) ) ) - , maMoreButton( new PushButton( this, SW_RES(CB_COLUMN_MORE) ) ) + , maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_COLUMN_MORE) ) ) , mnColumnType( nColumnType ) , mrPagePropPanel(rPanel) { diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index e01c373221c8..6479a7f7baf8 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -50,18 +50,18 @@ PageMarginControl::PageMarginControl( const SfxMapUnit eUnit ) : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_MARGIN) ) , mpMarginValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) ) - , maCustom(new FixedText(this, SW_RES(FT_CUSTOM))) - , maLeft(new FixedText(this, SW_RES(FT_LEFT))) - , maInner(new FixedText(this, SW_RES(FT_INNER))) - , maLeftMarginEdit(new MetricField(this, SW_RES(MF_SWLEFT_MARGIN))) - , maRight(new FixedText(this, SW_RES(FT_RIGHT))) - , maOuter(new FixedText(this, SW_RES(FT_OUTER))) - , maRightMarginEdit(new MetricField(this, SW_RES(MF_SWRIGHT_MARGIN))) - , maTop(new FixedText(this, SW_RES(FT_TOP))) - , maTopMarginEdit(new MetricField(this, SW_RES(MF_SWTOP_MARGIN))) - , maBottom(new FixedText(this, SW_RES(FT_BOTTOM))) - , maBottomMarginEdit(new MetricField(this, SW_RES(MF_SWBOTTOM_MARGIN))) - , maWidthHeightField(new MetricField( this, SW_RES(FLD_WIDTH_HEIGHT) ) ) + , maCustom(VclPtr<FixedText>::Create(this, SW_RES(FT_CUSTOM))) + , maLeft(VclPtr<FixedText>::Create(this, SW_RES(FT_LEFT))) + , maInner(VclPtr<FixedText>::Create(this, SW_RES(FT_INNER))) + , maLeftMarginEdit(VclPtr<MetricField>::Create(this, SW_RES(MF_SWLEFT_MARGIN))) + , maRight(VclPtr<FixedText>::Create(this, SW_RES(FT_RIGHT))) + , maOuter(VclPtr<FixedText>::Create(this, SW_RES(FT_OUTER))) + , maRightMarginEdit(VclPtr<MetricField>::Create(this, SW_RES(MF_SWRIGHT_MARGIN))) + , maTop(VclPtr<FixedText>::Create(this, SW_RES(FT_TOP))) + , maTopMarginEdit(VclPtr<MetricField>::Create(this, SW_RES(MF_SWTOP_MARGIN))) + , maBottom(VclPtr<FixedText>::Create(this, SW_RES(FT_BOTTOM))) + , maBottomMarginEdit(VclPtr<MetricField>::Create(this, SW_RES(MF_SWBOTTOM_MARGIN))) + , maWidthHeightField(VclPtr<MetricField>::Create( this, SW_RES(FLD_WIDTH_HEIGHT) ) ) , mnPageLeftMargin( aPageLRMargin.GetLeft() ) , mnPageRightMargin( aPageLRMargin.GetRight() ) , mnPageTopMargin( aPageULMargin.GetUpper() ) diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx index d35ac67a880b..48c7b5af3a2c 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx @@ -96,7 +96,8 @@ VclPtr<vcl::Window> PagePropertyPanel::Create ( throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new PagePropertyPanel( + VclPtr<PagePropertyPanel>::Create( + pParent, rxFrame, pBindings), @@ -294,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 ) @@ -371,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(), @@ -421,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, @@ -455,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(), diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hxx b/sw/source/uibase/sidebar/PagePropertyPanel.hxx index d97d27a6dc00..05119bf2b34a 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.hxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.hxx @@ -72,11 +72,11 @@ namespace sw { namespace sidebar { return mpBindings; } - ::svx::sidebar::PopupControl* CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ); + VclPtr<::svx::sidebar::PopupControl> CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ); void ExecuteOrientationChange( const bool bLandscape ); void ClosePageOrientationPopup(); - ::svx::sidebar::PopupControl* CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ); + VclPtr<::svx::sidebar::PopupControl> CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ); void ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin ); @@ -86,22 +86,22 @@ namespace sw { namespace sidebar { void ExecutePageLayoutChange( const bool bMirrored ); void ClosePageMarginPopup(); - ::svx::sidebar::PopupControl* CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ); + VclPtr<::svx::sidebar::PopupControl> CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ); void ExecuteSizeChange( const Paper ePaper ); void ClosePageSizePopup(); - ::svx::sidebar::PopupControl* CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ); + VclPtr<::svx::sidebar::PopupControl> CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ); void ExecuteColumnChange( const sal_uInt16 nColumnType ); void ClosePageColumnPopup(); void StartUndo(); void EndUndo(); - private: PagePropertyPanel( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, SfxBindings* pBindings ); + private: virtual ~PagePropertyPanel(); virtual void dispose() SAL_OVERRIDE; diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 6eb4ea3501f2..bc9c0b9be335 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -43,8 +43,8 @@ PageSizeControl::PageSizeControl( const FieldUnit eFUnit ) : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_SIZE) ) , mpSizeValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) ) - , maMoreButton( new PushButton( this, SW_RES(CB_SIZE_MORE) ) ) - , maWidthHeightField( new MetricField( this, SW_RES(FLD_WIDTH_HEIGHT) ) ) + , maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_SIZE_MORE) ) ) + , maWidthHeightField( VclPtr<MetricField>::Create( this, SW_RES(FLD_WIDTH_HEIGHT) ) ) , mePaper( ePaper ) , maPaperList() , mrPagePropPanel(rPanel) diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx index a388d429b44b..76db6711d8fd 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx @@ -55,7 +55,8 @@ VclPtr<vcl::Window> WrapPropertyPanel::Create ( throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to WrapPropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new WrapPropertyPanel( + VclPtr<WrapPropertyPanel>::Create( + pParent, rxFrame, pBindings), diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx index 4c0291bc7114..bd1f27ad0931 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx @@ -49,13 +49,12 @@ namespace sw { namespace sidebar { virtual ~WrapPropertyPanel(); virtual void dispose() SAL_OVERRIDE; - private: + WrapPropertyPanel( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, SfxBindings* pBindings ); - - + private: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame; SfxBindings* mpBindings; |