[Libreoffice-commits] core.git: sw/inc sw/source

Caolán McNamara caolanm at redhat.com
Fri Apr 26 07:45:11 PDT 2013


 sw/inc/swabstdlg.hxx              |    7 ++----
 sw/source/ui/app/applab.cxx       |    2 -
 sw/source/ui/dialog/swdlgfact.cxx |   40 +++++++-------------------------------
 sw/source/ui/dialog/swdlgfact.hxx |    7 ++----
 sw/source/ui/dochdl/gloshdl.cxx   |    5 +---
 sw/source/ui/ribbar/workctrl.cxx  |    2 -
 sw/source/ui/shells/textglos.cxx  |    6 ++---
 7 files changed, 21 insertions(+), 48 deletions(-)

New commits:
commit 2324681b5187fe2c8f174084a7f70d2256632967
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 26 15:41:55 2013 +0100

    remove unnecessary and misleading use of DLG_RENAME_GLOS id
    
    none of it has anything to do with a rename dialog
    
    Change-Id: I18a963e55d085182b922e5a7f77010b895a179a6

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index d8d2148..19cb943 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 689c760..5972421 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 6d766bf..fb7a53c 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 da283f2..9b68100 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 09925ec..4253cf7 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 8c39203..11a6fe8 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 c48690b..fc981f1 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);


More information about the Libreoffice-commits mailing list