[Libreoffice-commits] core.git: 9 commits - include/osl include/toolkit include/vcl svtools/source tools/source vcl/source vcl/unx

Stephan Bergmann sbergman at redhat.com
Fri Dec 5 00:10:38 PST 2014


 include/osl/mutex.hxx              |    2 +-
 include/osl/socket.hxx             |    3 ++-
 include/toolkit/awt/vclxdevice.hxx |    3 ++-
 include/vcl/menu.hxx               |    2 +-
 svtools/source/inc/unoiface.hxx    |    4 ++--
 svtools/source/uno/unoiface.cxx    |    8 ++++++++
 tools/source/memtools/mempool.cxx  |    8 ++++----
 vcl/source/window/menu.cxx         |    4 ++++
 vcl/unx/generic/app/i18n_ic.cxx    |    2 +-
 vcl/unx/gtk/window/gtksalframe.cxx |    2 +-
 vcl/unx/gtk/window/gtksalmenu.cxx  |    6 +++---
 11 files changed, 29 insertions(+), 15 deletions(-)

New commits:
commit bcaf496cd250bd4b3b9ab54342200009175e2c4f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 5 09:09:19 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: Iffdb3d72b24b44cb895f1729aadbbae1802e80bc

diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx
index 8a5865a..684c964 100644
--- a/svtools/source/inc/unoiface.hxx
+++ b/svtools/source/inc/unoiface.hxx
@@ -187,7 +187,7 @@ public:
     ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
 protected:
-    ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >  getFormatsSupplier(void) const { return ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > ((::com::sun::star::util::XNumberFormatsSupplier*)m_pCurrentSupplier);}
+    ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >  getFormatsSupplier(void) const;
     void    setFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xSupplier);
     sal_Int32   getFormatKey(void) const;
     void    setFormatKey(sal_Int32 nKey);
@@ -250,7 +250,7 @@ private:
     RMItemData GetRMItemData( const ::com::sun::star::container::ContainerEvent& _rEvent );
 
 protected:
-    ::svt::ORoadmap*                GetRoadmap() const { return (::svt::ORoadmap*)GetWindow(); }
+    ::svt::ORoadmap*                GetRoadmap() const;
     void                            ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) SAL_OVERRIDE;
 
     virtual ~SVTXRoadmap();
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index bc4ba57..d59d92b 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -1024,6 +1024,10 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const ::com:
     return aReturn;
 }
 
+::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >  SVTXFormattedField::getFormatsSupplier(void) const
+{
+    return ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > (m_pCurrentSupplier);
+}
 
 ::com::sun::star::uno::Any SVTXFormattedField::convertEffectiveValue(const ::com::sun::star::uno::Any& rValue)
 {
@@ -1399,6 +1403,10 @@ void SVTXFormattedField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
 
 using namespace svt;
 
+::svt::ORoadmap* SVTXRoadmap::GetRoadmap() const
+{
+    return static_cast<svt::ORoadmap*>(GetWindow());
+}
 
 SVTXRoadmap::SVTXRoadmap() : maItemListeners( *this )
 {
commit 8dbc966794f95cb6000f127a8615333de5cd70ff
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 5 08:57:03 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: Ibd0cc43ff210ffaae291f4f4467ba8ebe265c446

diff --git a/include/toolkit/awt/vclxdevice.hxx b/include/toolkit/awt/vclxdevice.hxx
index 3de7931..61d5689 100644
--- a/include/toolkit/awt/vclxdevice.hxx
+++ b/include/toolkit/awt/vclxdevice.hxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <cppuhelper/weak.hxx>
 #include <osl/mutex.hxx>
+#include <vcl/virdev.hxx>
 
 #include <com/sun/star/awt/XUnitConversion.hpp>
 
@@ -107,7 +108,7 @@ class VCLXVirtualDevice : public VCLXDevice
 public:
                     virtual ~VCLXVirtualDevice();
 
-    void            SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( (OutputDevice*)pVDev ); }
+    void            SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( pVDev ); }
 };
 
 
commit 2f7a386ab2876223da1be73410bf1e7486f724ba
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 5 08:40:21 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: I73850d2b2ea6ff4376e25e0be39c65c35328a9a6

diff --git a/tools/source/memtools/mempool.cxx b/tools/source/memtools/mempool.cxx
index cf043f9..415f188 100644
--- a/tools/source/memtools/mempool.cxx
+++ b/tools/source/memtools/mempool.cxx
@@ -28,24 +28,24 @@ FixedMemPool::FixedMemPool(char const * pTypeName, sal_uInt16 nTypeSize)
 {
     char name[RTL_CACHE_NAME_LENGTH + 1];
     snprintf (name, sizeof(name), "FixedMemPool_%d", (int)nTypeSize);
-    m_pImpl = (FixedMemPool_Impl*)rtl_cache_create (name, nTypeSize, 0, NULL, NULL, NULL, 0, NULL, 0);
+    m_pImpl = reinterpret_cast<FixedMemPool_Impl*>(rtl_cache_create (name, nTypeSize, 0, NULL, NULL, NULL, 0, NULL, 0));
     SAL_INFO("tools.memtools","FixedMemPool::ctor(\"" << m_pTypeName << "\"): " << m_pImpl);
 }
 
 FixedMemPool::~FixedMemPool()
 {
     SAL_INFO("tools.memtools","FixedMemPool::dtor(\"" << m_pTypeName << "\"): " << m_pImpl);
-    rtl_cache_destroy ((rtl_cache_type*)(m_pImpl)), m_pImpl = 0;
+    rtl_cache_destroy (reinterpret_cast<rtl_cache_type*>(m_pImpl)), m_pImpl = 0;
 }
 
 void* FixedMemPool::Alloc()
 {
-    return rtl_cache_alloc ((rtl_cache_type*)(m_pImpl));
+    return rtl_cache_alloc (reinterpret_cast<rtl_cache_type*>(m_pImpl));
 }
 
 void FixedMemPool::Free( void* pFree )
 {
-    rtl_cache_free ((rtl_cache_type*)(m_pImpl), pFree);
+    rtl_cache_free (reinterpret_cast<rtl_cache_type*>(m_pImpl), pFree);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d06a37b0d29834ed493903e5c7e4d746c83c7f20
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 23:54:46 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: I533f1177ff7de2409cdca90f35788d057a5fc3e5

diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 3409ae7..67545b9 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -662,7 +662,7 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
         if ( ( nBits & MenuItemBits::CHECKABLE ) || bIsSubmenu )
         {
             // Item is a checkmark button.
-            GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_BOOLEAN );
+            GVariantType* pStateType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_BOOLEAN) );
             GVariant* pState = g_variant_new_boolean( bChecked );
 
             g_lo_action_group_insert_stateful( pActionGroup, aCommand, nId, bIsSubmenu, NULL, pStateType, NULL, pState );
@@ -670,8 +670,8 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
         else if ( nBits & MenuItemBits::RADIOCHECK )
         {
             // Item is a radio button.
-            GVariantType* pParameterType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );
-            GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );
+            GVariantType* pParameterType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_STRING) );
+            GVariantType* pStateType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_STRING) );
             GVariant* pState = g_variant_new_string( "" );
             pTarget = g_variant_new_string( aCommand );
 
commit fb3fc60a349f4bf45c772fdd8d00ca2fd2131551
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 23:54:40 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: If2758fa42b484a5afbe0d358a3d4533c68189697

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index c7c8024..6f36883 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -669,7 +669,7 @@ gboolean ensure_dbus_setup( gpointer data )
 
         // Create menu model and action group attached to this frame.
         GMenuModel* pMenuModel = G_MENU_MODEL( g_lo_menu_new() );
-        GActionGroup* pActionGroup = ( ( GActionGroup* ) g_lo_action_group_new( reinterpret_cast< gpointer >( pSalFrame ) ) );
+        GActionGroup* pActionGroup = reinterpret_cast<GActionGroup*>(g_lo_action_group_new( reinterpret_cast< gpointer >( pSalFrame ) ));
 
         // Generate menu paths.
         ::Window windowId = GDK_WINDOW_XID( gdkWindow );
commit cee5bd8d52f3ff0334837b5581e8ad84daadd3e6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 23:46:49 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: I8cf382e7f5f5ed9c797be9ec2b42f0d7f9f0b0ce

diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index 449e94d..bdc73c0 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -283,7 +283,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
                 if (pFontSet != NULL)
                 {
                     mpPreeditAttributes = XVaAddToNestedList( mpPreeditAttributes,
-                                                              const_cast<char*>(XNFontSet), (XPointer)pFontSet);
+                                                              const_cast<char*>(XNFontSet), reinterpret_cast<XPointer>(pFontSet));
                 }
 
                 break;
commit e84e45ef361a5e03a1a69d15d27ebb61f7b1b5cb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 23:37:38 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: I0177a0f50ba65553773f43a28e8790f7e1f8de9b

diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 207b012..9b7e522 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -500,7 +500,7 @@ class VCL_DLLPUBLIC PopupMenu : public Menu
 private:
     Menu**              pRefAutoSubMenu;    // keeps track if a pointer to this Menu is stored in the MenuItemData
 
-    SAL_DLLPRIVATE MenuFloatingWindow*   ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
+    SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
 
 protected:
     SAL_DLLPRIVATE sal_uInt16                ImplExecute( vcl::Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, bool bPreSelectFirst );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 546725a..3c0a3e9 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2637,6 +2637,10 @@ bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId )
 
 // bool PopupMenu::bAnyPopupInExecute = false;
 
+MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const {
+    return static_cast<MenuFloatingWindow *>(Menu::ImplGetWindow());
+}
+
 PopupMenu::PopupMenu()
     : pRefAutoSubMenu(NULL)
 {
commit ac16358c2afe36babcc64ea59ea44d42dc65fe5b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 23:37:22 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: Iaadb8aef9e10b378fca844fa323e0a1ae369d31c

diff --git a/include/osl/socket.hxx b/include/osl/socket.hxx
index 716f025..b8557ef 100644
--- a/include/osl/socket.hxx
+++ b/include/osl/socket.hxx
@@ -502,7 +502,8 @@ namespace osl
         StreamSocket&   Connection, SocketAddr & PeerAddr)
     {
         // TODO change in/OUT parameter
-        oslSocket o = osl_acceptConnectionOnSocket( m_handle, (oslSocketAddr *)&PeerAddr );
+        oslSocket o = osl_acceptConnectionOnSocket(
+            m_handle, reinterpret_cast<oslSocketAddr *>(&PeerAddr));
         oslSocketResult status = osl_Socket_Ok;
         if( o )
         {
commit eeaf8026e1df9dd22c7f85058e602d1450a41355
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 23:37:11 2014 +0100

    loplugin:cstylecast, involving pointer to incomplete type
    
    Change-Id: Iff55c88a365859400e87f3333735e54ba59811b6

diff --git a/include/osl/mutex.hxx b/include/osl/mutex.hxx
index 99241eb..ca8c1901 100644
--- a/include/osl/mutex.hxx
+++ b/include/osl/mutex.hxx
@@ -82,7 +82,7 @@ namespace osl
         */
         static Mutex * getGlobalMutex()
         {
-            return (Mutex *)osl_getGlobalMutex();
+            return reinterpret_cast<Mutex *>(osl_getGlobalMutex());
         }
 
     private:


More information about the Libreoffice-commits mailing list