sw/source/uibase/inc/view.hxx | 1 + sw/source/uibase/shells/annotsh.cxx | 7 +------ sw/source/uibase/shells/drawsh.cxx | 7 +------ sw/source/uibase/shells/drwtxtex.cxx | 7 +------ sw/source/uibase/shells/frmsh.cxx | 7 +------ sw/source/uibase/shells/textsh1.cxx | 7 +------ sw/source/uibase/uiview/view0.cxx | 11 +++++++++++ 7 files changed, 17 insertions(+), 30 deletions(-)
New commits: commit 0473818b3ebd8446a40cffa6a83b985dc3d9d1a0 Author: Michaël Lefèvre <lefevr...@yahoo.fr> Date: Tue Feb 3 21:45:53 2015 +0100 tdf#60739 code factorisation Limit duplication for SfxRequest FN_FORMAT_FOOTNOTE_DLG in sw shells Change-Id: I6f1ce98acf44a3811e4666a6bd9952232429f55a Reviewed-on: https://gerrit.libreoffice.org/14312 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx index 0eecc7d..81d2a9f 100644 --- a/sw/source/uibase/inc/view.hxx +++ b/sw/source/uibase/inc/view.hxx @@ -545,6 +545,7 @@ public: void GetState(SfxItemSet&); void StateStatusLine(SfxItemSet&); void UpdateWordCount(SfxShell*, sal_uInt16); + void ExecFormatFootnote(); // functions for drawing void SetDrawFuncPtr(SwDrawBase* pFuncPtr); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index a7ee88e..28ce006 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -436,12 +436,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) } case FN_FORMAT_FOOTNOTE_DLG: { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - - boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(rView.GetWindow(), rView.GetWrtShell())); - OSL_ENSURE(pDlg, "Dialog creation failed!"); - pDlg->Execute(); + rView.ExecFormatFootnote(); break; } case FN_NUMBERING_OUTLINE_DLG: diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index b13a957..12e4ee0 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -298,12 +298,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) break; case FN_FORMAT_FOOTNOTE_DLG: { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - - boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(GetView().GetWindow(), GetView().GetWrtShell())); - OSL_ENSURE(pDlg, "Dialog creation failed!"); - pDlg->Execute(); + GetView().ExecFormatFootnote(); break; } case FN_NUMBERING_OUTLINE_DLG: diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 6c7b344..86e9643 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -376,12 +376,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) break; case FN_FORMAT_FOOTNOTE_DLG: { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - assert(pFact && "SwAbstractDialogFactory fail!"); - - boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(GetView().GetWindow(), rView.GetWrtShell())); - assert(pDlg && "Dialog creation failed!"); - pDlg->Execute(); + GetView().ExecFormatFootnote(); break; } case FN_NUMBERING_OUTLINE_DLG: diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 020bcad..eba9627 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -237,12 +237,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) break; case FN_FORMAT_FOOTNOTE_DLG: { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - assert(pFact); - - boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(GetView().GetWindow(), GetView().GetWrtShell())); - assert(pDlg); - pDlg->Execute(); + GetView().ExecFormatFootnote(); break; } case FN_NUMBERING_OUTLINE_DLG: diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index a1c9010..d4bdd65 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -472,12 +472,7 @@ void SwTextShell::Execute(SfxRequest &rReq) break; case FN_FORMAT_FOOTNOTE_DLG: { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - - boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(GetView().GetWindow(), rWrtSh)); - OSL_ENSURE(pDlg, "Dialog creation failed!"); - pDlg->Execute(); + GetView().ExecFormatFootnote(); break; } case SID_INSERTDOC: diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 78a0b6c..a821f04 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -78,6 +78,7 @@ using namespace ::com::sun::star; #include <unomid.h> #include <boost/scoped_ptr.hpp> +#include "swabstdlg.hxx" SFX_IMPL_NAMED_VIEWFACTORY(SwView, "Default") { @@ -594,4 +595,14 @@ void SwView::ExecViewOptions(SfxRequest &rReq) rReq.Done(); } +void SwView::ExecFormatFootnote() +{ + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); + + boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateSwFootNoteOptionDlg(GetWindow(), GetWrtShell())); + OSL_ENSURE(pDlg, "Dialog creation failed!"); + pDlg->Execute(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits