diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-01 14:12:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-02 09:58:41 +0200 |
commit | 3c80f4880d0d3a8f7c71d76877efe234f4f3629c (patch) | |
tree | efbb64a152e15c125a2ada453585c8d32b4725d6 /cui/source/tabpages | |
parent | 616fd241838069e18c59064e33c4b24f5ae112c6 (diff) |
weld SvxLineTabDialog
Change-Id: Icb13a6eb2e8c6f6dbd3cf477051bc0bd682e2e7a
Reviewed-on: https://gerrit.libreoffice.org/61193
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r-- | cui/source/tabpages/tabline.cxx | 81 | ||||
-rw-r--r-- | cui/source/tabpages/tpline.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/tplnedef.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/tplneend.cxx | 2 |
4 files changed, 38 insertions, 55 deletions
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx index 526886134a4b..df1b6a3ba9d9 100644 --- a/cui/source/tabpages/tabline.cxx +++ b/cui/source/tabpages/tabline.cxx @@ -28,38 +28,24 @@ #include <svx/xtable.hxx> #include <svx/drawitem.hxx> -SvxLineTabDialog::SvxLineTabDialog -( - vcl::Window* pParent, - const SfxItemSet* pAttr, - SdrModel* pModel, - const SdrObject* pSdrObj, - bool bHasObj -) : - - SfxTabDialog ( pParent - , "LineDialog" - , "cui/ui/linedialog.ui" - , pAttr ), - m_nLineTabPage(0), - m_nShadowTabPage(0), - m_nStyleTabPage(0), - m_nEndTabPage(0), - pDrawModel ( pModel ), - pObj ( pSdrObj ), - pColorList ( pModel->GetColorList() ), - mpNewColorList ( pModel->GetColorList() ), - pDashList ( pModel->GetDashList() ), - pNewDashList ( pModel->GetDashList() ), - pLineEndList ( pModel->GetLineEndList() ), - pNewLineEndList ( pModel->GetLineEndList() ), - bObjSelected ( bHasObj ), - nLineEndListState( ChangeType::NONE ), - nDashListState( ChangeType::NONE ), - mnColorListState( ChangeType::NONE ), - nPageType( PageType::Area ), // We use it here primarily to get the right attributes with FillItemSet - nPosDashLb( 0 ), - nPosLineEndLb( 0 ) +SvxLineTabDialog::SvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, + SdrModel* pModel, const SdrObject* pSdrObj, bool bHasObj) + : SfxTabDialogController(pParent, "cui/ui/linedialog.ui", "LineDialog", pAttr) + , pDrawModel(pModel) + , pObj(pSdrObj) + , pColorList(pModel->GetColorList()) + , mpNewColorList(pModel->GetColorList()) + , pDashList(pModel->GetDashList()) + , pNewDashList(pModel->GetDashList()) + , pLineEndList(pModel->GetLineEndList()) + , pNewLineEndList(pModel->GetLineEndList()) + , bObjSelected(bHasObj) + , nLineEndListState(ChangeType::NONE) + , nDashListState(ChangeType::NONE) + , mnColorListState(ChangeType::NONE) + , nPageType(PageType::Area) // We use it here primarily to get the right attributes with FillItemSet + , nPosDashLb(0) + , nPosLineEndLb(0) { bool bLineOnly = false; if( pObj && pObj->GetObjInventor() == SdrInventor::Default ) @@ -81,20 +67,19 @@ SvxLineTabDialog::SvxLineTabDialog } - m_nLineTabPage = AddTabPage( "RID_SVXPAGE_LINE", SvxLineTabPage::Create, nullptr); + AddTabPage("RID_SVXPAGE_LINE", SvxLineTabPage::Create, nullptr); if( bLineOnly ) - m_nShadowTabPage = AddTabPage( "RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, nullptr ); + AddTabPage("RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, nullptr); else RemoveTabPage( "RID_SVXPAGE_SHADOW" ); - m_nStyleTabPage = AddTabPage( "RID_SVXPAGE_LINE_DEF", SvxLineDefTabPage::Create, nullptr); - m_nEndTabPage = AddTabPage( "RID_SVXPAGE_LINEEND_DEF", SvxLineEndDefTabPage::Create, nullptr); + AddTabPage("RID_SVXPAGE_LINE_DEF", SvxLineDefTabPage::Create, nullptr); + AddTabPage("RID_SVXPAGE_LINEEND_DEF", SvxLineEndDefTabPage::Create, nullptr); - CancelButton& rBtnCancel = GetCancelButton(); - rBtnCancel.SetClickHdl( LINK( this, SvxLineTabDialog, CancelHdlImpl ) ); + weld::Button& rBtnCancel = GetCancelButton(); + rBtnCancel.connect_clicked(LINK(this, SvxLineTabDialog, CancelHdlImpl)); } - void SvxLineTabDialog::SavePalettes() { SfxObjectShell* pShell = SfxObjectShell::Current(); @@ -161,27 +146,25 @@ void SvxLineTabDialog::SavePalettes() } } - short SvxLineTabDialog::Ok() { SavePalettes(); // We return RET_OK if at least one TabPage in FillItemSet() returns sal_True. // We do this by default at the moment. - return SfxTabDialog::Ok(); + return SfxTabDialogController::Ok(); } - -IMPL_LINK_NOARG(SvxLineTabDialog, CancelHdlImpl, Button*, void) +IMPL_LINK_NOARG(SvxLineTabDialog, CancelHdlImpl, weld::Button&, void) { SavePalettes(); - EndDialog(); + m_xDialog->response(RET_CANCEL); } -void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void SvxLineTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage) { - if( nId == m_nLineTabPage) + if (rId == "RID_SVXPAGE_LINE") { static_cast<SvxLineTabPage&>(rPage).SetColorList( pColorList ); static_cast<SvxLineTabPage&>(rPage).SetDashList( pDashList ); @@ -196,7 +179,7 @@ void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) static_cast<SvxLineTabPage&>(rPage).Construct(); static_cast<SvxLineTabPage&>(rPage).SetColorChgd( &mnColorListState ); } - else if(nId == m_nStyleTabPage) + else if (rId == "RID_SVXPAGE_LINE_DEF") { static_cast<SvxLineDefTabPage&>(rPage).SetDashList( pDashList ); static_cast<SvxLineDefTabPage&>(rPage).SetDlgType( 0 ); @@ -205,7 +188,7 @@ void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) static_cast<SvxLineDefTabPage&>(rPage).SetDashChgd( &nDashListState ); static_cast<SvxLineDefTabPage&>(rPage).Construct(); } - else if(nId == m_nEndTabPage) + else if (rId == "RID_SVXPAGE_LINEEND_DEF") { static_cast<SvxLineEndDefTabPage&>(rPage).SetLineEndList( pLineEndList ); static_cast<SvxLineEndDefTabPage&>(rPage).SetPolyObj( pObj ); @@ -215,7 +198,7 @@ void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) static_cast<SvxLineEndDefTabPage&>(rPage).SetLineEndChgd( &nLineEndListState ); static_cast<SvxLineEndDefTabPage&>(rPage).Construct(); } - else if (nId == m_nShadowTabPage) + else if (rId == "RID_SVXPAGE_SHADOW") { static_cast<SvxShadowTabPage&>(rPage).SetColorList( pColorList ); static_cast<SvxShadowTabPage&>(rPage).SetPageType( nPageType ); diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 053389519570..eb6a22d3288d 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -71,7 +71,7 @@ const sal_uInt16 SvxLineTabPage::pLineRanges[] = }; SvxLineTabPage::SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) - : SfxTabPage(pParent, "cui/ui/linetabpage.ui", "SvxLineTabPage", &rInAttrs) + : SfxTabPage(pParent, "cui/ui/linetabpage.ui", "LineTabPage", &rInAttrs) , m_pSymbolList(nullptr) , m_bNewSize(false) , m_nNumMenuGalleryItems(0) @@ -258,7 +258,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) ( *m_pnDashListState & ChangeType::CHANGED ) ) { if( *m_pnDashListState & ChangeType::CHANGED ) - m_pDashList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewDashList(); + m_pDashList = static_cast<SvxLineTabDialog*>(GetDialogController() )->GetNewDashList(); *m_pnDashListState = ChangeType::NONE; @@ -287,7 +287,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) if( ( *m_pnLineEndListState & ChangeType::MODIFIED ) || ( *m_pnLineEndListState & ChangeType::CHANGED ) ) { if( *m_pnLineEndListState & ChangeType::CHANGED ) - m_pLineEndList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewLineEndList(); + m_pLineEndList = static_cast<SvxLineTabDialog*>(GetDialogController())->GetNewLineEndList(); *m_pnLineEndListState = ChangeType::NONE; @@ -342,7 +342,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) if( *m_pnColorListState != ChangeType::NONE ) { if( *m_pnColorListState & ChangeType::CHANGED ) - m_pColorList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewColorList(); + m_pColorList = static_cast<SvxLineTabDialog*>(GetDialogController())->GetNewColorList(); ChangePreviewHdl_Impl( nullptr ); } diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index bdc61de0d594..7a3063896738 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -698,7 +698,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl, weld::Button&, void) if( pDshLst->Load() ) { pDashList = pDshLst; - static_cast<SvxLineTabDialog*>( GetParentDialog() )->SetNewDashList( pDashList ); + static_cast<SvxLineTabDialog*>(GetDialogController())->SetNewDashList( pDashList ); m_xLbLineStyles->clear(); m_xLbLineStyles->Fill( pDashList ); diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 4222266e3656..38f42d51d71b 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -536,7 +536,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, weld::Button&, void) if( pLeList->Load() ) { pLineEndList = pLeList; - static_cast<SvxLineTabDialog*>( GetParentDialog() )->SetNewLineEndList( pLineEndList ); + static_cast<SvxLineTabDialog*>(GetDialogController())->SetNewLineEndList( pLineEndList ); m_xLbLineEnds->clear(); m_xLbLineEnds->Fill( pLineEndList ); Reset( &rOutAttrs ); |