diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-26 15:41:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-26 15:44:50 +0100 |
commit | 2324681b5187fe2c8f174084a7f70d2256632967 (patch) | |
tree | 33974497d4851d74b8c3c7f967d9d49e6760f0e8 | |
parent | 489e588ff749e5f673d10baa6b79fa6bbee68574 (diff) |
remove unnecessary and misleading use of DLG_RENAME_GLOS id
none of it has anything to do with a rename dialog
Change-Id: I18a963e55d085182b922e5a7f77010b895a179a6
-rw-r--r-- | sw/inc/swabstdlg.hxx | 7 | ||||
-rw-r--r-- | sw/source/ui/app/applab.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 40 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dochdl/gloshdl.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/ribbar/workctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/shells/textglos.cxx | 6 |
7 files changed, 21 insertions, 48 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index d8d214895c2c..19cb943db62d 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -407,8 +407,7 @@ public: sal_uInt16 nPageId = 0, SwWrtShell* pActShell = 0, sal_Bool bNew = sal_False ) = 0; //add for SwTemplateDlg - virtual AbstractGlossaryDlg* CreateGlossaryDlg( int nResId, - SfxViewFrame* pViewFrame, + virtual AbstractGlossaryDlg* CreateGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell) = 0; //add for SwGlossaryDlg virtual AbstractFldInputDlg* CreateFldInputDlg( int nResId, @@ -464,8 +463,8 @@ public: virtual AbstractMailMergeWizard* CreateMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem) = 0; //add for static func in SwGlossaryDlg - virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc( sal_uInt16 nId ) = 0; - virtual GlossarySetActGroup SetGlossaryActGroupFunc( sal_uInt16 nId ) = 0; + virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc() = 0; + virtual GlossarySetActGroup SetGlossaryActGroupFunc() = 0; // for tabpage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0; diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index 689c760280d9..5972421d0321 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -105,7 +105,7 @@ static const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); + ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc(); if ( fnSetActGroup ) (*fnSetActGroup)( rItem.sGlossaryGroup ); SwGlossaryHdl* pGlosHdl = rSh.GetView().GetGlosHdl(); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 6d766bff79ff..fb7a53c7a3d2 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1061,23 +1061,12 @@ SfxAbstractApplyTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( return new AbstractApplyTabDialog_Impl( pDlg ); } -AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg( int nResId, - SfxViewFrame* pViewFrame, +AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell) //add for SwGlossaryDlg { - SwGlossaryDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_RENAME_GLOS : - pDlg = new SwGlossaryDlg( pViewFrame, pGlosHdl, pWrtShell ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractGlossaryDlg_Impl( pDlg ); - return 0; + SwGlossaryDlg* pDlg = new SwGlossaryDlg(pViewFrame, pGlosHdl, pWrtShell); + return new AbstractGlossaryDlg_Impl( pDlg ); } AbstractFldInputDlg* SwAbstractDialogFactory_Impl::CreateFldInputDlg( int nResId, @@ -1319,27 +1308,14 @@ AbstractMailMergeWizard* SwAbstractDialogFactory_Impl::CreateMailMergeWizard( } //add for static func in SwGlossaryDlg -GlossaryGetCurrGroup SwAbstractDialogFactory_Impl::GetGlossaryCurrGroupFunc( sal_uInt16 nId ) +GlossaryGetCurrGroup SwAbstractDialogFactory_Impl::GetGlossaryCurrGroupFunc() { - switch ( nId ) - { - case DLG_RENAME_GLOS : - return SwGlossaryDlg::GetCurrGroup; - default: - break; - } - return 0; + return SwGlossaryDlg::GetCurrGroup; } -GlossarySetActGroup SwAbstractDialogFactory_Impl::SetGlossaryActGroupFunc( sal_uInt16 nId ) + +GlossarySetActGroup SwAbstractDialogFactory_Impl::SetGlossaryActGroupFunc() { - switch ( nId ) - { - case DLG_RENAME_GLOS : - return SwGlossaryDlg::SetActGroup; - default: - break; - } - return 0; + return SwGlossaryDlg::SetActGroup; } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index da283f2e4481..9b681008e0f2 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -506,8 +506,7 @@ public: sal_uInt16 nPageId = 0, SwWrtShell* pActShell = 0, sal_Bool bNew = sal_False ); //add for SwTemplateDlg - virtual AbstractGlossaryDlg* CreateGlossaryDlg( int nResId, - SfxViewFrame* pViewFrame, + virtual AbstractGlossaryDlg* CreateGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell); //add for SwGlossaryDlg virtual AbstractFldInputDlg* CreateFldInputDlg( int nResId, @@ -563,8 +562,8 @@ public: virtual AbstractMailMergeWizard* CreateMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem); //add for static func in SwGlossaryDlg - virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc( sal_uInt16 nId ); - virtual GlossarySetActGroup SetGlossaryActGroupFunc( sal_uInt16 nId ); + virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc(); + virtual GlossarySetActGroup SetGlossaryActGroupFunc(); // For TabPage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ); diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 09925ec98238..4253cf763537 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -79,8 +79,7 @@ void SwGlossaryHdl::GlossaryDlg() { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractGlossaryDlg* pDlg = pFact->CreateGlossaryDlg( DLG_RENAME_GLOS, - pViewFrame, this, pWrtShell); + AbstractGlossaryDlg* pDlg = pFact->CreateGlossaryDlg(pViewFrame, this, pWrtShell); OSL_ENSURE(pDlg, "Dialogdiet fail!"); String sName, sShortName; @@ -370,7 +369,7 @@ sal_Bool SwGlossaryHdl::ExpandGlossary() SwTextBlocks *pGlossary; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::GlossaryGetCurrGroup fnGetCurrGroup = pFact->GetGlossaryCurrGroupFunc( DLG_RENAME_GLOS ); + ::GlossaryGetCurrGroup fnGetCurrGroup = pFact->GetGlossaryCurrGroupFunc(); OSL_ENSURE(fnGetCurrGroup, "Dialogdiet fail!"); String sGroupName( (*fnGetCurrGroup)() ); if(STRING_NOTFOUND == sGroupName.Search(GLOS_DELIM)) diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index 8c3920345904..11a6fe86416c 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -308,7 +308,7 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu) SwGlossaryHdl* pGlosHdl = pView->GetGlosHdl(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); + ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc(); if ( fnSetActGroup ) (*fnSetActGroup)( sGroup ); pGlosHdl->SetCurGroup(sGroup, sal_True); diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx index c48690b3b05b..fc981f177238 100644 --- a/sw/source/ui/shells/textglos.cxx +++ b/sw/source/ui/shells/textglos.cxx @@ -74,7 +74,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); + ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc(); if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); pGlosHdl->SetCurGroup(aGroup, sal_True); @@ -90,7 +90,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) String aGroup = (( const SfxStringItem *)pItem)->GetValue(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); + ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc(); if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); rReq.Done(); @@ -106,7 +106,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) aName = (( const SfxStringItem *)pItem)->GetValue(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); + ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc(); if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); pGlosHdl->SetCurGroup(aGroup, sal_True); |