[Libreoffice-commits] core.git: 3 commits - cppuhelper/source linguistic/source

Stephan Bergmann sbergman at redhat.com
Mon Aug 19 03:53:06 PDT 2013


 cppuhelper/source/access_control.cxx      |    4 ++--
 cppuhelper/source/bootstrap.cxx           |    5 +++--
 cppuhelper/source/component_context.cxx   |    6 ++++--
 cppuhelper/source/exc_thrower.cxx         |    2 --
 cppuhelper/source/implbase.cxx            |    3 ++-
 cppuhelper/source/implbase_ex.cxx         |    5 ++++-
 cppuhelper/source/implementationentry.cxx |    4 +++-
 cppuhelper/source/macro_expander.cxx      |    5 +++--
 cppuhelper/source/servicemanager.cxx      |    8 ++++----
 cppuhelper/source/shlib.cxx               |    6 ++++--
 cppuhelper/source/tdmgr.cxx               |    2 +-
 cppuhelper/source/typemanager.cxx         |    2 +-
 linguistic/source/gciterator.cxx          |    2 +-
 13 files changed, 32 insertions(+), 22 deletions(-)

New commits:
commit e89e7cded7cf449807c93bd3ce35b1e1a876da3f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 19 11:49:57 2013 +0200

    Prefer using declarations over using directives
    
    Change-Id: I1316fc4ae1d4dab91684bdc059f5c69c5e0c401a

diff --git a/cppuhelper/source/access_control.cxx b/cppuhelper/source/access_control.cxx
index 5c39d73..1df5d2d 100644
--- a/cppuhelper/source/access_control.cxx
+++ b/cppuhelper/source/access_control.cxx
@@ -25,12 +25,12 @@
 #include <com/sun/star/io/FilePermission.hpp>
 #include <com/sun/star/connection/SocketPermission.hpp>
 
-
-using namespace ::rtl;
 using namespace ::osl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+using rtl::OUString;
+
 namespace
 {
     inline OUString str_ac_singleton()
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 2de4b56..81d3420 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -44,12 +44,13 @@
 
 #define ARLEN(x) sizeof (x) / sizeof *(x)
 
-
-using namespace ::rtl;
 using namespace ::osl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+using rtl::Bootstrap;
+using rtl::OUString;
+
 namespace cppu
 {
 
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 7d41778..f758912 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -60,12 +60,14 @@
 #define TDMGR_SINGLETON "/singletons/com.sun.star.reflection.theTypeDescriptionManager"
 #define AC_SINGLETON "/singletons/com.sun.star.security.theAccessController"
 
-
 using namespace ::osl;
-using namespace ::rtl;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star;
 
+using rtl::OUString;
+using rtl::OUStringBuffer;
+using rtl::OUStringHash;
+
 namespace cppu
 {
 
diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx
index d63b9be..a7de5c8 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -29,8 +29,6 @@
 
 #include "cppuhelper/exc_hlp.hxx"
 
-
-using namespace ::rtl;
 using namespace ::osl;
 using namespace ::cppu;
 using namespace ::com::sun::star;
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx
index 4816c4a6..24a3b27 100644
--- a/cppuhelper/source/implbase.cxx
+++ b/cppuhelper/source/implbase.cxx
@@ -27,10 +27,11 @@
 #include "com/sun/star/uno/RuntimeException.hpp"
 
 using namespace ::osl;
-using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+using rtl::OUString;
+
 namespace
 {
     class theImplHelperInitMutex : public rtl::Static<Mutex, theImplHelperInitMutex>{};
diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx
index b581807..30e4d08 100644
--- a/cppuhelper/source/implbase_ex.cxx
+++ b/cppuhelper/source/implbase_ex.cxx
@@ -30,10 +30,13 @@
 
 using namespace ::cppu;
 using namespace ::osl;
-using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+using rtl::OString;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
 namespace cppu
 {
 
diff --git a/cppuhelper/source/implementationentry.cxx b/cppuhelper/source/implementationentry.cxx
index 1ee5136..b6d9dd4 100644
--- a/cppuhelper/source/implementationentry.cxx
+++ b/cppuhelper/source/implementationentry.cxx
@@ -20,11 +20,13 @@
 #include <cppuhelper/implementationentry.hxx>
 #include <rtl/ustrbuf.hxx>
 
-using namespace ::rtl;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::registry;
 
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
 namespace cppu {
 
 sal_Bool component_writeInfoHelper(
diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx
index 72ff90a..24708d9 100644
--- a/cppuhelper/source/macro_expander.cxx
+++ b/cppuhelper/source/macro_expander.cxx
@@ -38,12 +38,13 @@
 #define SERVICE_NAME_B "com.sun.star.lang.BootstrapMacroExpander"
 #define IMPL_NAME "com.sun.star.lang.comp.cppuhelper.BootstrapMacroExpander"
 
-
-using namespace ::rtl;
 using namespace ::osl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+using rtl::Bootstrap;
+using rtl::OUString;
+
 namespace cppu
 {
 
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index db741ad..1ec2549 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -43,12 +43,14 @@
 #include <osl/detail/ios-bootstrap.h>
 #endif
 
-
-using namespace ::rtl;
 using namespace ::osl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+using rtl::OString;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
 namespace cppu
 {
 
diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx
index f838adf..76c6558 100644
--- a/cppuhelper/source/tdmgr.cxx
+++ b/cppuhelper/source/tdmgr.cxx
@@ -51,11 +51,11 @@
 
 #include "boost/scoped_array.hpp"
 
-using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::reflection;
 
+using rtl::OUString;
 
 namespace cppu
 {
commit 477e7ad9d05ccb48146c9f7e8dcbc0980c2d9481
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 19 11:40:21 2013 +0200

    Use upcasting Reference copy ctor
    
    Change-Id: Iab00310e2e6fcf8a43617363cf095a1bccfd9751

diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 8affc2b..ab48268c 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1072,7 +1072,7 @@ void cppuhelper::ServiceManager::addPropertyChangeListener(
             aPropertyName, static_cast< cppu::OWeakObject * >(this));
     }
     // DefaultContext does not change, so just treat it as an event listener:
-    return addEventListener(xListener.get());
+    return addEventListener(xListener);
 }
 
 void cppuhelper::ServiceManager::removePropertyChangeListener(
@@ -1088,7 +1088,7 @@ void cppuhelper::ServiceManager::removePropertyChangeListener(
             aPropertyName, static_cast< cppu::OWeakObject * >(this));
     }
     // DefaultContext does not change, so just treat it as an event listener:
-    return removeEventListener(aListener.get());
+    return removeEventListener(aListener);
 }
 
 void cppuhelper::ServiceManager::addVetoableChangeListener(
@@ -1104,7 +1104,7 @@ void cppuhelper::ServiceManager::addVetoableChangeListener(
             PropertyName, static_cast< cppu::OWeakObject * >(this));
     }
     // DefaultContext does not change, so just treat it as an event listener:
-    return addEventListener(aListener.get());
+    return addEventListener(aListener);
 }
 
 void cppuhelper::ServiceManager::removeVetoableChangeListener(
@@ -1120,7 +1120,7 @@ void cppuhelper::ServiceManager::removeVetoableChangeListener(
             PropertyName, static_cast< cppu::OWeakObject * >(this));
     }
     // DefaultContext does not change, so just treat it as an event listener:
-    return removeEventListener(aListener.get());
+    return removeEventListener(aListener);
 }
 
 css::uno::Sequence< css::beans::Property >
diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx
index 672e377..05d39cc 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2238,7 +2238,7 @@ css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
         if (mems[i]->getMemberName() == member) {
             return css::uno::makeAny<
                 css::uno::Reference< css::reflection::XTypeDescription > >(
-                    mems[i].get());
+                    mems[i]);
         }
     }
     return css::uno::Any();
commit 2864959cf71b16ac5c3cd0789ac243958a991917
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 19 10:20:17 2013 +0200

    Use standard idiom
    
    Change-Id: Ida916e3019d72c9e9d1b5b117de2060f0227c310

diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index d7382e3..a8e6db0 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -841,7 +841,7 @@ throw (uno::RuntimeException)
     {
         try
         {
-             uno::Reference< uno::XInterface > xThis( dynamic_cast< XLinguServiceEventBroadcaster * >(this) );
+             uno::Reference< uno::XInterface > xThis( static_cast< OWeakObject * >(this) );
              linguistic2::LinguServiceEvent aEvent( xThis, linguistic2::LinguServiceEventFlags::PROOFREAD_AGAIN );
              m_aNotifyListeners.notifyEach(
                     &linguistic2::XLinguServiceEventListener::processLinguServiceEvent,


More information about the Libreoffice-commits mailing list