summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-16 23:26:10 +0000
committerNoel Power <noel.power@suse.com>2013-01-17 09:52:48 +0000
commit573e3b1aa208ffed6d5ca22698f1fe4c271e3c8e (patch)
treee924db6060d8e6ed023dc0cd1fae2515b2c1bb45 /sfx2
parent1839f7be0a6720c11086df00a50443fe8ee3bd00 (diff)
Resolves: fdo#58998 insert section applied twice
regression since 0157f0b1ba364f7f9af2aacd1be9fbb5ddec2b4d my belief was that OK_Impl was only called in one place, in sw/source/ui/fmtui/tmpdlg.cxx, so I merged the use there into OK_Impl, but of course there was another use in sfx2/source/dialog/tabdlg.cxx Given that OK_Impl only called PrepareLeaveCurrentPage originally... a) replace OK_Impl in sfx2/source/dialog/tabdlg.cxx with PrepareLeaveCurrentPage, a no-op from the original state. b) add an Apply method that does what I want, i.e. call ok without closing the dialog, so we can retain the fix of fdo#38606 to have "apply" immediately apply the effect of pressing "ok" without closing and reopening the dialog Change-Id: I57e2e41c07ab9bf89ada98d1b9c3336db3493f19 (cherry picked from commit 8fd85527981e3a6a915192aaea6f1595ea9f037c) Reviewed-on: https://gerrit.libreoffice.org/1729 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/tabdlg.hxx10
-rw-r--r--sfx2/source/dialog/tabdlg.cxx10
2 files changed, 12 insertions, 8 deletions
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index 164dae330514..594731fd3047 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -201,13 +201,9 @@ public:
void SetApplyHandler(const Link& _rHdl);
SAL_DLLPRIVATE void Start_Impl();
- bool OK_Impl()
- {
- bool bRet = PrepareLeaveCurrentPage();
- if (bRet)
- Ok();
- return bRet;
- }
+
+ //calls Ok without closing dialog
+ bool Apply();
};
namespace sfx { class ItemConnectionBase; }
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index eda237570f9a..0015972f6e05 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1090,7 +1090,7 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
{
pImpl->bInOK = sal_True;
- if ( OK_Impl() )
+ if (PrepareLeaveCurrentPage())
{
if ( pImpl->bModal )
EndDialog( Ok() );
@@ -1103,6 +1103,14 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
return 0;
}
+bool SfxTabDialog::Apply()
+{
+ bool bApplied = false;
+ if (PrepareLeaveCurrentPage())
+ bApplied = (Ok() == RET_OK);
+ return bApplied;
+}
+
// -----------------------------------------------------------------------
bool SfxTabDialog::PrepareLeaveCurrentPage()