[Libreoffice-commits] .: 2 commits - framework/inc framework/source sal/inc svl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 25 01:14:34 PDT 2012


 framework/inc/general.h                        |   19 ------
 framework/source/dispatch/dispatchprovider.cxx |    3 -
 framework/source/services/desktop.cxx          |   69 +++++++++++--------------
 sal/inc/sal/log-areas.dox                      |    6 ++
 svl/source/numbers/zforfind.cxx                |   10 +--
 5 files changed, 44 insertions(+), 63 deletions(-)

New commits:
commit 7b2772629eb19579e04923883123af9e4a8c1ff0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 25 09:08:51 2012 +0100

    loplugin: tidy up some log areas
    
    Change-Id: Ie2c7b219f57a2bdf14fc07311a03a2c66f6c75aa

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 91b1e8d..9a3ee16 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -91,6 +91,12 @@ certain functionality.
 
 @li @c i18npool.langtag
 
+ at section jvmfwk
+
+ at li @c jfw
+ at li @c jfw.level1
+ at li @c jfw.level2
+
 @section Math
 
 @li @c starmath.rtf
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 085d567..b2f8d2b 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -886,7 +886,7 @@ bool ImpSvNumberInputScan::GetTimeRef(
     {
         nHour = 0;
         bRet = false;
-        SAL_WARN( "svl.items", "ImpSvNumberInputScan::GetTimeRef: bad number index");
+        SAL_WARN( "svl", "ImpSvNumberInputScan::GetTimeRef: bad number index");
     }
     if (nDecPos == 2 && nAnz == 2)                  // 45.5
         nMinute = 0;
@@ -1082,7 +1082,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt )
     else if (!sDateAcceptancePatterns.getLength())
     {
         sDateAcceptancePatterns = pFormatter->GetLocaleData()->getDateAcceptancePatterns();
-        SAL_WARN_IF( !sDateAcceptancePatterns.getLength(), "nf.date", "ImpSvNumberInputScan::IsAcceptedDatePattern: no date acceptance patterns");
+        SAL_WARN_IF( !sDateAcceptancePatterns.getLength(), "svl", "ImpSvNumberInputScan::IsAcceptedDatePattern: no date acceptance patterns");
         nAcceptedDatePattern = (sDateAcceptancePatterns.getLength() ? -2 : -1);
     }
 
@@ -1300,7 +1300,7 @@ DateFormat ImpSvNumberInputScan::GetDateOrder()
                     break;
             }
     }
-    SAL_WARN( "nf.date", "ImpSvNumberInputScan::GetDateOrder: undefined, falling back to locale's default");
+    SAL_WARN( "svl", "ImpSvNumberInputScan::GetDateOrder: undefined, falling back to locale's default");
     return pFormatter->GetLocaleData()->getDateFormat();
 }
 
@@ -1550,7 +1550,7 @@ input for the following reasons:
                                 default:
                                     bHadExact = false;
                             }
-                            SAL_WARN_IF( !bHadExact, "nf.date", "ImpSvNumberInputScan::GetDateRef: error in exact date order");
+                            SAL_WARN_IF( !bHadExact, "svl", "ImpSvNumberInputScan::GetDateRef: error in exact date order");
                         }
                         else
                             bHadExact = false;
@@ -3230,7 +3230,7 @@ bool ImpSvNumberInputScan::IsNumberFormat(
             break;
 
             default:
-                SAL_WARN( "svl.items", "Some number recognized but what's it?" );
+                SAL_WARN( "svl", "Some number recognized but what's it?" );
                 fOutNumber = 0.0;
                 break;
         }
commit 73fc75bf805eb7660598f2862746f3cfac75aa79
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 25 09:03:20 2012 +0100

    ditch SYNCHRONIZED_START/END
    
    Change-Id: I1c0c015f371346efc5712ead7abe9e7f2ec0f9d0

diff --git a/framework/inc/general.h b/framework/inc/general.h
index f131eac..3ab1556 100644
--- a/framework/inc/general.h
+++ b/framework/inc/general.h
@@ -48,25 +48,6 @@
  */
 namespace css = ::com::sun::star;
 
-namespace framework {
-
-//-----------------------------------------------------------------------------
-/** Those macro is used to make it more clear where a synchronized block will start.
-    Because normal documentation code wont be recognized by some developers to be real
-    I need something where they are thinking about.
-
-    At least this macro will do nothing ... it's empty.
-    But it should make the code more clear .-))
-*/
-#define SYNCHRONIZED_START
-
-//-----------------------------------------------------------------------------
-/** Same then SYNCHRONIZED_START ... but instead it mark the end of such code block.
-*/
-#define SYNCHRONIZED_END
-
-} // namespace framework
-
 #endif // #ifndef __FRAMEWORK_GENERAL_H_
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index 1fb6019..ebb0099 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -230,8 +230,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryDeskt
     // I.II) "_default"
     //  This is a combination of search an empty task for recycling - or create a new one.
     //-----------------------------------------------------------------------------------------------------
-    else
-    if (sTargetFrameName==SPECIALTARGET_DEFAULT)
+    else if (sTargetFrameName==SPECIALTARGET_DEFAULT)
     {
         if (implts_isLoadableContent(aURL))
             xDispatcher = implts_getOrCreateDispatchHelper( E_DEFAULTDISPATCHER, xDesktop );
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 5f0629d..bd281a3 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -271,19 +271,17 @@ sal_Bool SAL_CALL Desktop::terminate()
 {
     TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
 
-    SYNCHRONIZED_START
-        ReadGuard aReadLock( m_aLock );
+    ReadGuard aReadLock( m_aLock ); // start synchronize
 
-        css::uno::Reference< css::frame::XTerminateListener > xPipeTerminator    = m_xPipeTerminator;
-        css::uno::Reference< css::frame::XTerminateListener > xQuickLauncher     = m_xQuickLauncher;
-        css::uno::Reference< css::frame::XTerminateListener > xSWThreadManager   = m_xSWThreadManager;
-        css::uno::Reference< css::frame::XTerminateListener > xSfxTerminator     = m_xSfxTerminator;
+    css::uno::Reference< css::frame::XTerminateListener > xPipeTerminator    = m_xPipeTerminator;
+    css::uno::Reference< css::frame::XTerminateListener > xQuickLauncher     = m_xQuickLauncher;
+    css::uno::Reference< css::frame::XTerminateListener > xSWThreadManager   = m_xSWThreadManager;
+    css::uno::Reference< css::frame::XTerminateListener > xSfxTerminator     = m_xSfxTerminator;
 
-        css::lang::EventObject                                aEvent             ( static_cast< ::cppu::OWeakObject* >(this) );
-        ::sal_Bool                                            bAskQuickStart     = !m_bSuspendQuickstartVeto                  ;
+    css::lang::EventObject                                aEvent             ( static_cast< ::cppu::OWeakObject* >(this) );
+    ::sal_Bool                                            bAskQuickStart     = !m_bSuspendQuickstartVeto                  ;
 
-        aReadLock.unlock();
-    SYNCHRONIZED_END
+    aReadLock.unlock(); // end synchronize
 
     //-------------------------------------------------------------------------------------------------------------
     // Ask normal terminate listener. They could stop terminate without closing any open document.
@@ -1179,30 +1177,29 @@ void SAL_CALL Desktop::dispose()
         fprintf( stderr, "This used to be an assertion failure: Desktop disposed before terminating it,\n"
                  "but nothing bad seems to happen anyway?\n" );
 #endif
-    SYNCHRONIZED_START
-        WriteGuard aWriteLock( m_aLock );
 
-        // Look for multiple calls of this method!
-        // If somewhere call dispose() twice - he will be stopped here realy!!!
-        TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
-
-        // Now - we are alone and its the first call of this method ...
-        // otherwise call before had thrown a DisposedException / hopefully .-)
-        // But we dont use the transaction object created before ... we reset it immediatly ...
-        // two lines of code ... for what ?
-        // The answer: We wished to synchronize concurrent dispose() calls -> OK
-        // But next line will wait for all currently running transaction (even if they
-        // are running within the same thread!) So we would block ourself there if aTransaction
-        // will stay registered .-)
-        aTransaction.stop();
-
-        // Disable this instance for further work.
-        // This will wait for all current running transactions ...
-        // and reject all new incoming requests!
-        m_aTransactionManager.setWorkingMode( E_BEFORECLOSE );
+    WriteGuard aWriteLock( m_aLock ); // start synchronize
 
-        aWriteLock.unlock();
-    SYNCHRONIZED_END
+    // Look for multiple calls of this method!
+    // If somewhere call dispose() twice - he will be stopped here realy!!!
+    TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+
+    // Now - we are alone and its the first call of this method ...
+    // otherwise call before had thrown a DisposedException / hopefully .-)
+    // But we dont use the transaction object created before ... we reset it immediatly ...
+    // two lines of code ... for what ?
+    // The answer: We wished to synchronize concurrent dispose() calls -> OK
+    // But next line will wait for all currently running transaction (even if they
+    // are running within the same thread!) So we would block ourself there if aTransaction
+    // will stay registered .-)
+    aTransaction.stop();
+
+    // Disable this instance for further work.
+    // This will wait for all current running transactions ...
+    // and reject all new incoming requests!
+    m_aTransactionManager.setWorkingMode( E_BEFORECLOSE );
+
+    aWriteLock.unlock(); // end synchronize
 
     // Following lines of code can be called outside a synchronized block ...
     // Because our transaction manager will block all new requests to this object.
@@ -1898,11 +1895,9 @@ void Desktop::impl_sendNotifyTerminationEvent()
 //=============================================================================
 ::sal_Bool Desktop::impl_closeFrames(::sal_Bool bAllowUI)
 {
-    SYNCHRONIZED_START
-        ReadGuard aReadLock( m_aLock );
-        css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > lFrames = m_aChildTaskContainer.getAllElements();
-        aReadLock.unlock();
-    SYNCHRONIZED_END
+    ReadGuard aReadLock( m_aLock ); // start synchronize
+    css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > lFrames = m_aChildTaskContainer.getAllElements();
+    aReadLock.unlock(); // end synchronize
 
     ::sal_Int32 c                = lFrames.getLength();
     ::sal_Int32 i                = 0;


More information about the Libreoffice-commits mailing list