[Libreoffice-commits] .: sw/inc sw/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Mon Mar 28 02:40:32 PDT 2011
sw/inc/swabstdlg.hxx | 1 +
sw/source/ui/app/docst.cxx | 11 +++++++++--
sw/source/ui/fmtui/tmpdlg.cxx | 14 ++++++++++++++
sw/source/ui/inc/tmpdlg.hxx | 1 +
4 files changed, 25 insertions(+), 2 deletions(-)
New commits:
commit c62b8fc02d9357cea7fd399b173ed5280bf4c53c
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Sat Mar 26 17:07:46 2011 +0100
fdo#32413: Add an apply button to style edit dialog in Writer
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index b000fc8..4d84284 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -323,6 +323,7 @@ public:
#define RET_EDIT_RESULT_DOC 102
#define RET_TARGET_CREATED 103
#define RET_REMOVE_TARGET 104
+#define RET_APPLY_TEMPLATE 105
class SwView;
class SwMailMergeConfigItem;
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 6705e59..fca6e9d 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -663,7 +663,10 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
0, *(xTmp.get()), nFamily, bColumn,
pActShell ? pActShell : pWrtShell, bNew);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
- if(RET_OK == pDlg->Execute())
+ while (true)
+ {
+ short nButton = pDlg->Execute();
+ if(RET_OK == nButton || RET_APPLY_TEMPLATE == nButton)
{
GetWrtShell()->StartAllAction();
@@ -726,7 +729,8 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
// Destroy dialog before EndAction - with page-templates the
// ItemSet must be destroyed, so that the cursors get removed
// from Headers/Footers. Otherwise "GPF" happen!!!
- delete pDlg;
+ if(RET_OK == nButton)
+ delete pDlg;
pDoc->SetModified();
if( !bModified ) // Bug 57028
@@ -748,6 +752,9 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
pDoc->ResetModified();
delete pDlg;
}
+ if(RET_APPLY_TEMPLATE != nButton)
+ break;
+ }
}
else
{
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 223def1..9edb36d 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -71,6 +71,7 @@
#include <poolfmt.hxx>
#include <uitool.hxx>
#include <shellres.hxx>
+#include <swabstdlg.hxx>
#include <cmdid.h>
#include <helpid.h>
@@ -314,12 +315,25 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
OSL_ENSURE(!this, "wrong family");
}
+ EnableApplyButton( true );
+ SetApplyHandler( LINK(this, SwTemplateDlg, ApplyHdl ) );
}
SwTemplateDlg::~SwTemplateDlg()
{
}
+IMPL_LINK( SwTemplateDlg, ApplyHdl, void*, pVoid )
+{
+ (void)pVoid; //unused
+ if ( OK_Impl() )
+ {
+ Ok();
+ EndDialog( RET_APPLY_TEMPLATE );
+ }
+ return 0;
+}
+
short SwTemplateDlg::Ok()
{
short nRet = SfxTabDialog::Ok();
diff --git a/sw/source/ui/inc/tmpdlg.hxx b/sw/source/ui/inc/tmpdlg.hxx
index 6a8e7de..eca821e 100644
--- a/sw/source/ui/inc/tmpdlg.hxx
+++ b/sw/source/ui/inc/tmpdlg.hxx
@@ -45,6 +45,7 @@ class SwTemplateDlg: public SfxStyleDialog
sal_Bool bNewStyle;
DECL_LINK( NumOptionsHdl, PushButton* );
+ DECL_LINK( ApplyHdl, void* );
public:
SwTemplateDlg( Window* pParent,
More information about the Libreoffice-commits
mailing list