[Libreoffice-commits] .: 2 commits - sfx2/inc sfx2/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 16 15:42:43 PST 2013


 sfx2/inc/sfx2/tabdlg.hxx          |   10 +++-------
 sfx2/source/dialog/tabdlg.cxx     |   16 +++++++++-------
 sw/source/ui/dialog/swdlgfact.cxx |    2 +-
 3 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit b7aa16fe0da53001e056ad347ac5e10855376365
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 16 23:32:54 2013 +0000

    bInOK is unused, remove it
    
    Change-Id: I133d7d2e37d267afe521d6641582dc88f9054a41

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 932e4f2..130abfe 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -162,7 +162,6 @@ struct TabDlg_Impl
 {
     sal_Bool                bModified       : 1,
                         bModal          : 1,
-                        bInOK           : 1,
                         bHideResetBtn   : 1;
     SfxTabDlgData_Impl* pData;
 
@@ -172,7 +171,6 @@ struct TabDlg_Impl
 
         bModified       ( sal_False ),
         bModal          ( sal_True ),
-        bInOK           ( sal_False ),
         bHideResetBtn   ( sal_False ),
         pData           ( new SfxTabDlgData_Impl( nCnt ) ),
         pController     ( NULL )
@@ -1073,8 +1071,6 @@ short SfxTabDialog::Ok()
 {
     SavePosAndId(); //See fdo#38828 "Apply" resetting window position
 
-    pImpl->bInOK = sal_True;
-
     if ( !pOutSet )
     {
         if ( !pExampleSet && pSet )
@@ -1173,8 +1169,6 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
 */
 
 {
-    pImpl->bInOK = sal_True;
-
     if (PrepareLeaveCurrentPage())
     {
         if ( pImpl->bModal )
commit 8fd85527981e3a6a915192aaea6f1595ea9f037c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 16 23:26:10 2013 +0000

    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

diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index 69c7d89..d9593c0 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -219,13 +219,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 68d001d..932e4f2 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1175,7 +1175,7 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
 {
     pImpl->bInOK = sal_True;
 
-    if ( OK_Impl() )
+    if (PrepareLeaveCurrentPage())
     {
         if ( pImpl->bModal )
             EndDialog( Ok() );
@@ -1188,6 +1188,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()
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 5f833a3..dd84f23 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -159,7 +159,7 @@ String AbstractTabDialog_Impl::GetText() const
 
 IMPL_LINK_NOARG(AbstractApplyTabDialog_Impl, ApplyHdl)
 {
-    if (pDlg->OK_Impl())
+    if (pDlg->Apply())
         m_aHandler.Call(NULL);
     return 0;
 }


More information about the Libreoffice-commits mailing list