[Libreoffice-commits] core.git: svx/Library_svx.mk svx/source

Julien Nabet serval2412 at yahoo.fr
Fri Jul 26 00:38:31 PDT 2013


 svx/Library_svx.mk                |    4 +++
 svx/source/dialog/docrecovery.cxx |   45 ++++++++++++++------------------------
 svx/source/inc/docrecovery.hxx    |   10 ++++----
 svx/source/unodraw/recoveryui.cxx |   15 +-----------
 4 files changed, 28 insertions(+), 46 deletions(-)

New commits:
commit 513212eb71ffca09e47025ac82e0203d3df22d4a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Fri Jul 26 09:36:53 2013 +0200

    fdo#46037: no more comphelper/configurationhelper.hxx in svx
    
    + sal_Bool -> bool conversion
    
    Change-Id: Id8dc56e61984af599dcd53bb2cc9665db5fa0a1e

diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 2a51f46..e1e7f45 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -29,6 +29,10 @@ $(eval $(call gb_Library_set_include,svx,\
 
 $(eval $(call gb_Library_use_sdk_api,svx))
 
+$(eval $(call gb_Library_use_custom_headers,svx,\
+        officecfg/registry \
+))
+
 $(eval $(call gb_Library_add_defs,svx,\
     -DSVX_DLLIMPLEMENTATION \
     -DBOOST_SPIRIT_USE_OLD_NAMESPACE \
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index dc1e62c..e3c57b4 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -25,7 +25,6 @@
 #include "docrecovery.hxx"
 #include "docrecovery.hrc"
 
-#include <comphelper/configurationhelper.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <comphelper/string.hxx>
@@ -56,6 +55,7 @@
 #include <unotools/pathoptions.hxx>
 #include <unotools/localfilehelper.hxx>
 #include "svtools/treelistentry.hxx"
+#include <officecfg/Office/Recovery.hxx>
 
 namespace svx{
     namespace DocRecovery{
@@ -959,11 +959,11 @@ RecoveryDialog::RecoveryDialog(Window*       pParent,
     , m_pDefButton          ( NULL                                                       )
     , m_pCore               ( pCore                                                      )
     , m_eRecoveryState      (RecoveryDialog::E_RECOVERY_PREPARED)
-    , m_bWaitForUser        (sal_False)
-    , m_bWaitForCore        (sal_False)
-    , m_bUserDecideNext     (sal_False)
-    , m_bWasRecoveryStarted (sal_False)
-    , m_bRecoveryOnly       (sal_False)
+    , m_bWaitForUser        (false)
+    , m_bWaitForCore        (false)
+    , m_bUserDecideNext     (false)
+    , m_bWasRecoveryStarted (false)
+    , m_bRecoveryOnly       (false)
 {
     static long nTabs[] = { 2, 0, 40*RECOV_CONTROLWIDTH/100 };
     m_aFileListLB.SetTabs( &nTabs[0] );
@@ -971,18 +971,7 @@ RecoveryDialog::RecoveryDialog(Window*       pParent,
 
     FreeResource();
 
-    OUString CFG_PACKAGE_RECOVERY( "org.openoffice.Office.Recovery/" );
-    OUString CFG_PATH_CRASHREPORTER( "CrashReporter"                 );
-    OUString CFG_ENTRY_ENABLED( "Enabled"                       );
-
-    sal_Bool bCrashRepEnabled( sal_False );
-    css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
-                                pCore->getComponentContext(),
-                                CFG_PACKAGE_RECOVERY,
-                                CFG_PATH_CRASHREPORTER,
-                                CFG_ENTRY_ENABLED,
-                                ::comphelper::ConfigurationHelper::E_READONLY);
-    aVal >>= bCrashRepEnabled;
+    bool bCrashRepEnabled(officecfg::Office::Recovery::CrashReporter::Enabled::get());
     m_bRecoveryOnly = !bCrashRepEnabled;
 
     PluginProgress* pProgress   = new PluginProgress( &m_aProgrParent, pCore->getComponentContext() );
@@ -1044,7 +1033,7 @@ short RecoveryDialog::execute()
                 // This decision will be made inside the NextBtn handler.
                 m_aNextBtn.Enable(sal_True);
                 m_aCancelBtn.Enable(sal_True);
-                m_bWaitForUser = sal_True;
+                m_bWaitForUser = true;
                 while(m_bWaitForUser)
                     Application::Yield();
                 if (m_bUserDecideNext)
@@ -1057,7 +1046,7 @@ short RecoveryDialog::execute()
         case RecoveryDialog::E_RECOVERY_IN_PROGRESS :
              {
                 // user decided to start recovery ...
-                m_bWasRecoveryStarted = sal_True;
+                m_bWasRecoveryStarted = true;
                 // do it asynchronous (to allow repaints)
                 // and wait for this asynchronous operation.
                 m_aDescrFT.SetText( m_aTitleRecoveryInProgress );
@@ -1067,7 +1056,7 @@ short RecoveryDialog::execute()
                 m_pCore->setUpdateListener(this);
                 m_pCore->doRecovery();
 
-                m_bWaitForCore = sal_True;
+                m_bWaitForCore = true;
                 while(m_bWaitForCore)
                     Application::Yield();
 
@@ -1095,7 +1084,7 @@ short RecoveryDialog::execute()
                     m_aCancelBtn.Enable(sal_True);
                  }
 
-                 m_bWaitForUser = sal_True;
+                 m_bWaitForUser = true;
                  while(m_bWaitForUser)
                      Application::Yield();
 
@@ -1233,7 +1222,7 @@ short RecoveryDialog::execute()
 
         case RecoveryDialog::E_RECOVERY_HANDLED :
              {
-                 m_bWaitForUser = sal_True;
+                 m_bWaitForUser = true;
                  while(m_bWaitForUser)
                      Application::Yield();
 
@@ -1321,14 +1310,14 @@ void RecoveryDialog::end()
         m_pDefButton->GrabFocus();
         m_pDefButton = NULL;
     }
-    m_bWaitForCore = sal_False;
+    m_bWaitForCore = false;
 }
 
 //===============================================
 IMPL_LINK_NOARG(RecoveryDialog, NextButtonHdl)
 {
-    m_bUserDecideNext = sal_True;
-    m_bWaitForUser    = sal_False;
+    m_bUserDecideNext = true;
+    m_bWaitForUser    = false;
     return 0;
 }
 
@@ -1340,8 +1329,8 @@ IMPL_LINK_NOARG(RecoveryDialog, CancelButtonHdl)
         if (impl_askUserForWizardCancel(this, RID_SVXQB_EXIT_RECOVERY) == DLG_RET_CANCEL)
             return 0;
     }
-    m_bUserDecideNext = sal_False;
-    m_bWaitForUser    = sal_False;
+    m_bUserDecideNext = false;
+    m_bWaitForUser    = false;
     return 0;
 }
 
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 1e3beaa..370c36f 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -633,11 +633,11 @@ class RecoveryDialog : public IExtendedTabPage
             E_RECOVERY_HANDLED              // the recovery wizard page was shown already ... and will be shown now again ...
         };
         sal_Int32 m_eRecoveryState;
-        sal_Bool  m_bWaitForUser;
-        sal_Bool  m_bWaitForCore;
-        sal_Bool  m_bUserDecideNext;
-        sal_Bool  m_bWasRecoveryStarted;
-        sal_Bool  m_bRecoveryOnly;
+        bool  m_bWaitForUser;
+        bool  m_bWaitForCore;
+        bool  m_bUserDecideNext;
+        bool  m_bWasRecoveryStarted;
+        bool  m_bRecoveryOnly;
 
     //-------------------------------------------
     // member
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 652511b..e6d4c33 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -26,11 +26,11 @@
 #include <osl/file.hxx>
 #include <rtl/bootstrap.hxx>
 #include <comphelper/processfactory.hxx>
-#include <comphelper/configurationhelper.hxx>
 
 #include <vcl/svapp.hxx>
 
 #include <boost/scoped_ptr.hpp>
+#include <officecfg/Office/Recovery.hxx>
 
 
 #define IMPLEMENTATIONNAME_RECOVERYUI       OUString("com.sun.star.comp.svx.RecoveryUI")
@@ -276,18 +276,7 @@ void RecoveryUI::impl_doRecovery()
 {
     bool bRecoveryOnly( false );
 
-    OUString CFG_PACKAGE_RECOVERY( "org.openoffice.Office.Recovery/");
-    OUString CFG_PATH_CRASHREPORTER(  "CrashReporter" );
-    OUString CFG_ENTRY_ENABLED( "Enabled" );
-
-    sal_Bool bCrashRepEnabled(sal_False);
-    css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
-                                m_xContext,
-                                CFG_PACKAGE_RECOVERY,
-                                CFG_PATH_CRASHREPORTER,
-                                CFG_ENTRY_ENABLED,
-                                ::comphelper::ConfigurationHelper::E_READONLY);
-    aVal >>= bCrashRepEnabled;
+    bool bCrashRepEnabled(officecfg::Office::Recovery::CrashReporter::Enabled::get());
     bRecoveryOnly = !bCrashRepEnabled;
 
     // create core service, which implements the real "emergency save" algorithm.


More information about the Libreoffice-commits mailing list