summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Lefèvre <lefevre00@yahoo.fr>2015-02-03 22:18:17 +0100
committerNoel Grandin <noelgrandin@gmail.com>2015-02-05 11:12:02 +0000
commit71c49bcfa0677f013684030defbf5ead21695d85 (patch)
treea3c17dc153467b00fe14f0298397301b2dffa4d6
parent0473818b3ebd8446a40cffa6a83b985dc3d9d1a0 (diff)
tdf#60739 code factorisation
Limit duplication for SfxRequest FN_NUMBERING_OUTLINE_DLG in sw shells Change-Id: Ibbf58480232f3b393d13548508b7cdbc98690847 Reviewed-on: https://gerrit.libreoffice.org/14313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--sw/source/uibase/inc/view.hxx1
-rw-r--r--sw/source/uibase/shells/annotsh.cxx9
-rw-r--r--sw/source/uibase/shells/drawsh.cxx9
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx9
-rw-r--r--sw/source/uibase/shells/frmsh.cxx9
-rw-r--r--sw/source/uibase/shells/textsh1.cxx9
-rw-r--r--sw/source/uibase/uiview/view0.cxx13
7 files changed, 19 insertions, 40 deletions
diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx
index 81d2a9ffe1ba..3301a19e9a96 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/source/uibase/inc/view.hxx
@@ -546,6 +546,7 @@ public:
void StateStatusLine(SfxItemSet&);
void UpdateWordCount(SfxShell*, sal_uInt16);
void ExecFormatFootnote();
+ void ExecNumberingOutline(SfxItemPool &);
// functions for drawing
void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 28ce00665db0..f00737290dd4 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -441,14 +441,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
}
case FN_NUMBERING_OUTLINE_DLG:
{
- SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "Dialog creation failed!");
- boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
- rView.GetWindow(), &aTmp, rView.GetWrtShell()));
- OSL_ENSURE(pDlg, "Dialog creation failed!");
- pDlg->Execute();
- pDlg.reset();
+ rView.ExecNumberingOutline(GetPool());
rReq.Done();
}
break;
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 12e4ee082d8e..e1384184f62d 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -303,14 +303,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
}
case FN_NUMBERING_OUTLINE_DLG:
{
- SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "Dialog creation failed!");
- boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
- GetView().GetWindow(), &aTmp, GetView().GetWrtShell()));
- OSL_ENSURE(pDlg, "Dialog creation failed!");
- pDlg->Execute();
- pDlg.reset();
+ GetView().ExecNumberingOutline(GetPool());
rReq.Done();
}
break;
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 86e96432b728..291328d2fae9 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -381,14 +381,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
case FN_NUMBERING_OUTLINE_DLG:
{
- SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- assert(pFact && "Dialog creation failed!");
- boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
- GetView().GetWindow(), &aTmp, GetView().GetWrtShell()));
- assert(pDlg && "Dialog creation failed!");
- pDlg->Execute();
- pDlg.reset();
+ GetView().ExecNumberingOutline(GetPool());
rReq.Done();
}
break;
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index eba9627784a4..eeaffff0d49d 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -242,14 +242,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
case FN_NUMBERING_OUTLINE_DLG:
{
- SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- assert(pFact);
- boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
- GetView().GetWindow(), &aTmp, GetView().GetWrtShell()));
- assert(pDlg);
- pDlg->Execute();
- pDlg.reset();
+ GetView().ExecNumberingOutline(GetPool());
rReq.Done();
break;
}
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index d4bdd65c1225..0d3d360159dd 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -695,14 +695,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case FN_NUMBERING_OUTLINE_DLG:
{
- SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "Dialog creation failed!");
- boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
- GetView().GetWindow(), &aTmp, rWrtSh));
- OSL_ENSURE(pDlg, "Dialog creation failed!");
- pDlg->Execute();
- pDlg.reset();
+ GetView().ExecNumberingOutline(GetPool());
rReq.Done();
}
break;
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index a821f04e3609..1c7bf5cbecce 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -79,6 +79,7 @@ using namespace ::com::sun::star;
#include <unomid.h>
#include <boost/scoped_ptr.hpp>
#include "swabstdlg.hxx"
+#include "misc.hrc"
SFX_IMPL_NAMED_VIEWFACTORY(SwView, "Default")
{
@@ -605,4 +606,16 @@ void SwView::ExecFormatFootnote()
pDlg->Execute();
}
+void SwView::ExecNumberingOutline(SfxItemPool & rPool)
+{
+ SfxItemSet aTmp(rPool, FN_PARAM_1, FN_PARAM_1);
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ OSL_ENSURE(pFact, "Dialog creation failed!");
+ boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
+ GetWindow(), &aTmp, GetWrtShell()));
+ OSL_ENSURE(pDlg, "Dialog creation failed!");
+ pDlg->Execute();
+ pDlg.reset();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */