[Libreoffice-commits] core.git: 8 commits - compilerplugins/clang extensions/source i18npool/source idl/inc idl/source include/svtools include/toolkit include/vcl io/source javaunohelper/source jvmfwk/plugins package/source pyuno/source rsc/inc rsc/source sot/source stoc/source svtools/source toolkit/source ucb/source UnoControls/source vcl/generic vcl/inc vcl/source vcl/unx

Noel Grandin noel at peralex.com
Mon Sep 29 04:00:28 PDT 2014


 UnoControls/source/base/basecontainercontrol.cxx    |    4 
 UnoControls/source/base/multiplexer.cxx             |    2 
 compilerplugins/clang/store/cstylecast.cxx          |   10 
 extensions/source/plugin/unx/npnapi.cxx             |    6 
 i18npool/source/collator/collator_unicode.cxx       |    2 
 idl/inc/slot.hxx                                    |    2 
 idl/source/objects/basobj.cxx                       |    2 
 idl/source/objects/slot.cxx                         |   64 +--
 idl/source/objects/types.cxx                        |   42 +-
 include/svtools/editbrowsebox.hxx                   |    9 
 include/svtools/grfmgr.hxx                          |    8 
 include/toolkit/awt/vclxwindow.hxx                  |    4 
 include/vcl/dialog.hxx                              |    2 
 include/vcl/ppdparser.hxx                           |    2 
 io/source/stm/odata.cxx                             |    2 
 javaunohelper/source/bootstrap.cxx                  |    4 
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |    2 
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx          |    4 
 package/source/xstor/owriteablestream.cxx           |    8 
 package/source/xstor/xstorage.cxx                   |   10 
 pyuno/source/module/pyuno_runtime.cxx               |    5 
 rsc/inc/rscarray.hxx                                |    6 
 rsc/inc/rscclobj.hxx                                |    4 
 rsc/inc/rsctree.hxx                                 |    8 
 rsc/source/parser/rscdb.cxx                         |   24 -
 rsc/source/parser/rscibas.cxx                       |    6 
 rsc/source/parser/rsckey.cxx                        |    2 
 rsc/source/parser/rsclex.cxx                        |    2 
 rsc/source/res/rscclobj.cxx                         |   18 
 rsc/source/tools/rscdef.cxx                         |   10 
 rsc/source/tools/rsctree.cxx                        |   26 -
 sot/source/base/filelist.cxx                        |    2 
 sot/source/sdstor/stg.cxx                           |    2 
 sot/source/sdstor/stgcache.cxx                      |    2 
 sot/source/sdstor/stgdir.cxx                        |   30 -
 sot/source/sdstor/stgdir.hxx                        |    4 
 sot/source/sdstor/stgio.cxx                         |    2 
 sot/source/sdstor/ucbstorage.cxx                    |   14 
 stoc/source/inspect/introspection.cxx               |    8 
 stoc/source/invocation_adapterfactory/iafactory.cxx |    2 
 stoc/source/javavm/javavm.cxx                       |    2 
 stoc/source/servicemanager/servicemanager.cxx       |    2 
 svtools/source/brwbox/brwbox1.cxx                   |   16 
 svtools/source/brwbox/brwbox2.cxx                   |   10 
 svtools/source/brwbox/datwin.cxx                    |    2 
 svtools/source/brwbox/datwin.hxx                    |    2 
 svtools/source/brwbox/ebbcontrols.cxx               |    6 
 svtools/source/brwbox/editbrowsebox.cxx             |    8 
 svtools/source/contnr/imivctl1.cxx                  |    4 
 svtools/source/contnr/simptabl.cxx                  |    4 
 svtools/source/contnr/svimpbox.cxx                  |   16 
 svtools/source/contnr/svlbitm.cxx                   |    6 
 svtools/source/contnr/svtabbx.cxx                   |    6 
 svtools/source/contnr/treelist.cxx                  |    2 
 svtools/source/contnr/treelistbox.cxx               |   40 -
 svtools/source/control/ctrlbox.cxx                  |    6 
 svtools/source/control/headbar.cxx                  |    4 
 svtools/source/control/tabbar.cxx                   |   12 
 svtools/source/control/toolbarmenu.cxx              |    6 
 svtools/source/control/toolbarmenuacc.cxx           |    6 
 svtools/source/graphic/grfcache.cxx                 |   14 
 svtools/source/graphic/grfmgr.cxx                   |    7 
 svtools/source/graphic/grfmgr2.cxx                  |   18 
 svtools/source/graphic/provider.cxx                 |    2 
 svtools/source/inc/unoiface.hxx                     |    2 
 svtools/source/misc/ehdl.cxx                        |    6 
 svtools/source/misc/imap.cxx                        |   30 -
 svtools/source/misc/imap2.cxx                       |   12 
 svtools/source/svhtml/htmlout.cxx                   |    8 
 svtools/source/svrtf/svparser.cxx                   |    6 
 svtools/source/uno/statusbarcontroller.cxx          |    4 
 svtools/source/uno/unoiface.cxx                     |   74 +--
 svtools/source/uno/unoimap.cxx                      |    8 
 toolkit/source/awt/vclxaccessiblecomponent.cxx      |   18 
 toolkit/source/awt/vclxdevice.cxx                   |    8 
 toolkit/source/awt/vclxmenu.cxx                     |   14 
 toolkit/source/awt/vclxsystemdependentwindow.cxx    |    6 
 toolkit/source/awt/vclxtabpagecontainer.cxx         |   18 
 toolkit/source/awt/vclxtoolkit.cxx                  |   22 -
 toolkit/source/awt/vclxtopwindow.cxx                |   12 
 toolkit/source/awt/vclxwindow.cxx                   |    4 
 toolkit/source/awt/vclxwindow1.cxx                  |    2 
 toolkit/source/awt/vclxwindows.cxx                  |  416 ++++++++++----------
 ucb/source/sorter/sortresult.cxx                    |   46 +-
 ucb/source/ucp/webdav-neon/NeonSession.cxx          |    2 
 vcl/generic/glyphs/gcach_ftyp.cxx                   |    2 
 vcl/generic/print/prtsetup.cxx                      |    6 
 vcl/inc/cupsmgr.hxx                                 |    2 
 vcl/inc/generic/gendata.hxx                         |    2 
 vcl/inc/unx/gtk/gtkdata.hxx                         |    2 
 vcl/source/app/dbggui.cxx                           |   26 -
 vcl/source/app/help.cxx                             |    2 
 vcl/source/app/unohelp2.cxx                         |    2 
 vcl/source/control/button.cxx                       |   20 
 vcl/source/control/combobox.cxx                     |   10 
 vcl/source/control/edit.cxx                         |   10 
 vcl/source/control/ilstbox.cxx                      |    2 
 vcl/source/control/lstbox.cxx                       |   12 
 vcl/source/control/scrbar.cxx                       |    2 
 vcl/source/control/spinfld.cxx                      |    4 
 vcl/source/control/tabctrl.cxx                      |   10 
 vcl/source/edit/texteng.cxx                         |    4 
 vcl/source/edit/textundo.cxx                        |    2 
 vcl/source/edit/textview.cxx                        |    2 
 vcl/source/edit/txtattr.cxx                         |   10 
 vcl/source/edit/xtextedt.cxx                        |    6 
 vcl/source/filter/graphicfilter.cxx                 |   16 
 vcl/source/filter/igif/gifread.cxx                  |    4 
 vcl/source/filter/ixbm/xbmread.cxx                  |    2 
 vcl/source/filter/ixpm/xpmread.cxx                  |    2 
 vcl/source/filter/jpeg/jpeg.cxx                     |    2 
 vcl/source/filter/wmf/emfwr.cxx                     |   62 +-
 vcl/source/filter/wmf/wmfwr.cxx                     |   80 +--
 vcl/source/gdi/bitmapex.cxx                         |    2 
 vcl/source/gdi/cvtsvm.cxx                           |  144 +++---
 vcl/source/gdi/gdimtf.cxx                           |  245 +++++------
 vcl/source/gdi/graph.cxx                            |    2 
 vcl/source/gdi/impanmvw.cxx                         |    6 
 vcl/source/gdi/impgraph.cxx                         |    2 
 vcl/source/gdi/impvect.cxx                          |    4 
 vcl/source/gdi/metaact.cxx                          |  254 ++++++------
 vcl/source/gdi/pdfwriter_impl2.cxx                  |  100 ++--
 vcl/source/gdi/virdev.cxx                           |    2 
 vcl/source/outdev/font.cxx                          |    4 
 vcl/source/outdev/map.cxx                           |    8 
 vcl/source/outdev/outdev.cxx                        |    2 
 vcl/source/window/accessibility.cxx                 |   16 
 vcl/source/window/brdwin.cxx                        |   24 -
 vcl/source/window/builder.cxx                       |    2 
 vcl/source/window/decoview.cxx                      |    4 
 vcl/source/window/dialog.cxx                        |   12 
 vcl/source/window/dlgctrl.cxx                       |   32 -
 vcl/source/window/dockmgr.cxx                       |    8 
 vcl/source/window/dockwin.cxx                       |    2 
 vcl/source/window/floatwin.cxx                      |    4 
 vcl/source/window/layout.cxx                        |    2 
 vcl/source/window/menu.cxx                          |   14 
 vcl/source/window/menubarwindow.cxx                 |   17 
 vcl/source/window/menufloatingwindow.cxx            |   24 -
 vcl/source/window/menuitemlist.cxx                  |    2 
 vcl/source/window/mouse.cxx                         |    2 
 vcl/source/window/resource.cxx                      |    2 
 vcl/source/window/settings.cxx                      |    8 
 vcl/source/window/split.cxx                         |    2 
 vcl/source/window/stacking.cxx                      |    6 
 vcl/source/window/status.cxx                        |   12 
 vcl/source/window/syschild.cxx                      |   18 
 vcl/source/window/syswin.cxx                        |   32 -
 vcl/source/window/taskpanelist.cxx                  |    4 
 vcl/source/window/window.cxx                        |   22 -
 vcl/source/window/window2.cxx                       |    4 
 vcl/source/window/window3.cxx                       |    4 
 vcl/source/window/winproc.cxx                       |   10 
 vcl/unx/generic/gdi/salbmp.cxx                      |    2 
 vcl/unx/generic/gdi/salgdi2.cxx                     |    4 
 vcl/unx/generic/window/salframe.cxx                 |    6 
 vcl/unx/gtk/a11y/atkutil.cxx                        |    2 
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx            |   20 
 158 files changed, 1355 insertions(+), 1334 deletions(-)

New commits:
commit 00bd4571560bdbfbe4753d93513e55d58014228b
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 29 09:44:47 2014 +0200

    loplugin: cstylecast
    
    Change-Id: I20358c271e32b4af11d3258c950bde836596933a

diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 37ab388..f6b4c4a 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -112,10 +112,10 @@ IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclSimpleEvent*, pEvent
          */
     if ( pEvent && pEvent->ISA( VclWindowEvent ) && mxWindow.is() /* #122218# */ && (pEvent->GetId() != VCLEVENT_WINDOW_ENDPOPUPMODE) )
     {
-        DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "Window???" );
-        if( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
+        DBG_ASSERT( static_cast<VclWindowEvent*>(pEvent)->GetWindow(), "Window???" );
+        if( !static_cast<VclWindowEvent*>(pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
         {
-            ProcessWindowEvent( *(VclWindowEvent*)pEvent );
+            ProcessWindowEvent( *static_cast<VclWindowEvent*>(pEvent) );
         }
     }
     return 0;
@@ -126,13 +126,13 @@ IMPL_LINK( VCLXAccessibleComponent, WindowChildEventListener, VclSimpleEvent*, p
     DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
     if ( pEvent && pEvent->ISA( VclWindowEvent ) && mxWindow.is() /* #i68079# */ )
     {
-        DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "Window???" );
-        if( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() )
+        DBG_ASSERT( static_cast<VclWindowEvent*>(pEvent)->GetWindow(), "Window???" );
+        if( !static_cast<VclWindowEvent*>(pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() )
         {
             // #103087# to prevent an early release of the component
             uno::Reference< accessibility::XAccessibleContext > xTmp = this;
 
-            ProcessWindowChildEvent( *(VclWindowEvent*)pEvent );
+            ProcessWindowChildEvent( *static_cast<VclWindowEvent*>(pEvent) );
         }
     }
     return 0;
@@ -442,7 +442,7 @@ void VCLXAccessibleComponent::FillAccessibleStateSet( utl::AccessibleStateSetHel
         if( pWindow && pWindow->GetType() == WINDOW_COMBOBOX )
         {
             if( !( pWindow->GetStyle() & WB_READONLY) ||
-                !((Edit*)pWindow)->IsReadOnly() )
+                !static_cast<Edit*>(pWindow)->IsReadOnly() )
                     rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE );
         }
 
@@ -454,14 +454,14 @@ void VCLXAccessibleComponent::FillAccessibleStateSet( utl::AccessibleStateSetHel
             if( pWinTemp && pWinTemp->GetType() == WINDOW_EDIT )
             {
                 if( !( pWinTemp->GetStyle() & WB_READONLY) ||
-                    !((Edit*)pWinTemp)->IsReadOnly() )
+                    !static_cast<Edit*>(pWinTemp)->IsReadOnly() )
                     rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE );
                 break;
             }
             if( pChild->GetType() == WINDOW_EDIT )
             {
                 if( !( pChild->GetStyle() & WB_READONLY) ||
-                    !((Edit*)pChild)->IsReadOnly())
+                    !static_cast<Edit*>(pChild)->IsReadOnly())
                     rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE );
                 break;
             }
diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx
index 2a48f73..36b5a18 100644
--- a/toolkit/source/awt/vclxdevice.cxx
+++ b/toolkit/source/awt/vclxdevice.cxx
@@ -128,14 +128,14 @@ IMPL_XTYPEPROVIDER_END
         OutDevType eDevType = mpOutputDevice->GetOutDevType();
         if ( eDevType == OUTDEV_WINDOW )
         {
-            aDevSz = ((vcl::Window*)mpOutputDevice)->GetSizePixel();
-            ((vcl::Window*)mpOutputDevice)->GetBorder( aInfo.LeftInset, aInfo.TopInset, aInfo.RightInset, aInfo.BottomInset );
+            aDevSz = static_cast<vcl::Window*>(mpOutputDevice)->GetSizePixel();
+            static_cast<vcl::Window*>(mpOutputDevice)->GetBorder( aInfo.LeftInset, aInfo.TopInset, aInfo.RightInset, aInfo.BottomInset );
         }
         else if ( eDevType == OUTDEV_PRINTER )
         {
-            aDevSz = ((Printer*)mpOutputDevice)->GetPaperSizePixel();
+            aDevSz = static_cast<Printer*>(mpOutputDevice)->GetPaperSizePixel();
             Size aOutSz = mpOutputDevice->GetOutputSizePixel();
-            Point aOffset = ((Printer*)mpOutputDevice)->GetPageOffset();
+            Point aOffset = static_cast<Printer*>(mpOutputDevice)->GetPageOffset();
             aInfo.LeftInset = aOffset.X();
             aInfo.TopInset = aOffset.Y();
             aInfo.RightInset = aDevSz.Width() - aOutSz.Width() - aOffset.X();
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 90c7a26..d8711d6 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -83,9 +83,9 @@ IMPL_LINK( VCLXMenu, MenuEventListener, VclSimpleEvent*, pEvent )
     DBG_ASSERT( pEvent && pEvent->ISA( VclMenuEvent ), "Unknown Event!" );
     if ( pEvent && pEvent->ISA( VclMenuEvent ) )
     {
-        DBG_ASSERT( ((VclMenuEvent*)pEvent)->GetMenu() && mpMenu, "Menu???" );
+        DBG_ASSERT( static_cast<VclMenuEvent*>(pEvent)->GetMenu() && mpMenu, "Menu???" );
 
-        VclMenuEvent* pMenuEvent = (VclMenuEvent*)pEvent;
+        VclMenuEvent* pMenuEvent = static_cast<VclMenuEvent*>(pEvent);
         if ( pMenuEvent->GetMenu() == mpMenu )  // Also called for the root menu
         {
             switch ( pMenuEvent->GetId() )
@@ -434,7 +434,7 @@ throw(css::uno::RuntimeException, std::exception)
         *pNewRef = rxPopupMenu;
         maPopupMenuRefs.push_back( pNewRef );
 
-        mpMenu->SetPopupMenu( nItemId, (PopupMenu*) pVCLMenu->GetMenu() );
+        mpMenu->SetPopupMenu( nItemId, static_cast<PopupMenu*>( pVCLMenu->GetMenu() ) );
     }
 }
 
@@ -452,7 +452,7 @@ throw(css::uno::RuntimeException, std::exception)
         for ( size_t n = maPopupMenuRefs.size(); n; )
         {
             css::uno::Reference< css::awt::XPopupMenu > * pRef = maPopupMenuRefs[ --n ];
-            Menu* pM = ((VCLXMenu*)pRef->get())->GetMenu();
+            Menu* pM = static_cast<VCLXMenu*>(pRef->get())->GetMenu();
             if ( pM == pMenu )
             {
                 aRef = *pRef;
@@ -463,7 +463,7 @@ throw(css::uno::RuntimeException, std::exception)
         // if the popup men is not created by stardiv.Toolkit.VCLXPopupMenu
         if( !aRef.is() )
         {
-            aRef = new VCLXPopupMenu( (PopupMenu*)pMenu );
+            aRef = new VCLXPopupMenu( static_cast<PopupMenu*>(pMenu) );
         }
     }
     return aRef;
@@ -535,7 +535,7 @@ throw(css::uno::RuntimeException, std::exception)
     sal_Int16 nRet = 0;
     if ( mpMenu && IsPopupMenu() )
     {
-        nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ),
+        nRet = static_cast<PopupMenu*>(mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ),
                                               VCLRectangle( rPos ),
                                               nFlags | POPUPMENU_NOMOUSEUPCLOSE );
     }
@@ -735,7 +735,7 @@ throw (css::uno::RuntimeException, std::exception)
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu && IsPopupMenu() )
-        ( (PopupMenu*) mpMenu )->EndExecute();
+        static_cast<PopupMenu*>( mpMenu )->EndExecute();
 }
 
 
diff --git a/toolkit/source/awt/vclxsystemdependentwindow.cxx b/toolkit/source/awt/vclxsystemdependentwindow.cxx
index e76a8be7..e905577 100644
--- a/toolkit/source/awt/vclxsystemdependentwindow.cxx
+++ b/toolkit/source/awt/vclxsystemdependentwindow.cxx
@@ -71,18 +71,18 @@ IMPL_XTYPEPROVIDER_END
     vcl::Window* pWindow = GetWindow();
     if ( pWindow )
     {
-        const SystemEnvData* pSysData = ((SystemChildWindow *)pWindow)->GetSystemData();
+        const SystemEnvData* pSysData = static_cast<SystemChildWindow *>(pWindow)->GetSystemData();
         if( pSysData )
         {
 #if (defined WNT)
             if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32 )
             {
-                 aRet <<= (sal_IntPtr)pSysData->hWnd;
+                 aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->hWnd);
             }
 #elif (defined MACOSX)
             if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_MAC )
             {
-                 aRet <<= (sal_IntPtr)pSysData->mpNSView;
+                 aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->mpNSView);
             }
 #elif (defined ANDROID)
             // Nothing
diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx
index 90d62a1..b0e0ef1 100644
--- a/toolkit/source/awt/vclxtabpagecontainer.cxx
+++ b/toolkit/source/awt/vclxtabpagecontainer.cxx
@@ -57,7 +57,7 @@ VCLXTabPageContainer::~VCLXTabPageContainer()
 void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY ) throw(RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
-    TabControl* pTabControl = (TabControl*)GetWindow();
+    TabControl* pTabControl = static_cast<TabControl*>(GetWindow());
     if ( pTabControl )
     {
         TabPage *pTabPage = pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >(  pTabControl->GetCurPageId( ) ) );
@@ -87,7 +87,7 @@ void SAL_CALL VCLXTabPageContainer::setProperty(const OUString& PropertyName,
 {
     SolarMutexGuard aGuard;
 
-    TabControl* pTabPage = (TabControl*)GetWindow();
+    TabControl* pTabPage = static_cast<TabControl*>(GetWindow());
     if ( pTabPage )
     {
         VCLXWindow::setProperty( PropertyName, Value );
@@ -95,18 +95,18 @@ void SAL_CALL VCLXTabPageContainer::setProperty(const OUString& PropertyName,
 }
 ::sal_Int16 SAL_CALL VCLXTabPageContainer::getActiveTabPageID() throw (RuntimeException, std::exception)
 {
-    TabControl* pTabCtrl = (TabControl*)GetWindow();
+    TabControl* pTabCtrl = static_cast<TabControl*>(GetWindow());
     return pTabCtrl != NULL ? pTabCtrl->GetCurPageId( ) : 0;
 }
 void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (RuntimeException, std::exception)
 {
-    TabControl* pTabCtrl = (TabControl*)GetWindow();
+    TabControl* pTabCtrl = static_cast<TabControl*>(GetWindow());
     if ( pTabCtrl )
         pTabCtrl->SelectTabPage(_activetabpageid);
 }
 ::sal_Int16 SAL_CALL VCLXTabPageContainer::getTabPageCount(  ) throw (RuntimeException, std::exception)
 {
-    TabControl* pTabCtrl = (TabControl*)GetWindow();
+    TabControl* pTabCtrl = static_cast<TabControl*>(GetWindow());
     return pTabCtrl != NULL ? pTabCtrl->GetPageCount() : 0;
 }
 sal_Bool SAL_CALL VCLXTabPageContainer::isTabPageActive( ::sal_Int16 tabPageIndex ) throw (RuntimeException, std::exception)
@@ -154,7 +154,7 @@ void VCLXTabPageContainer::ProcessWindowEvent( const VclWindowEvent& _rVclWindow
         {
             case VCLEVENT_TABPAGE_ACTIVATE:
             {
-                sal_uLong page = (sal_uLong)_rVclWindowEvent.GetData();
+                sal_uLong page = reinterpret_cast<sal_uLong>(_rVclWindowEvent.GetData());
                 awt::tab::TabPageActivatedEvent aEvent(NULL,page);
                 m_aTabPageListeners.tabPageActivated(aEvent);
                 break;
@@ -172,7 +172,7 @@ void SAL_CALL VCLXTabPageContainer::disposing( const ::com::sun::star::lang::Eve
 void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
-    TabControl* pTabCtrl = (TabControl*)GetWindow();
+    TabControl* pTabCtrl = static_cast<TabControl*>(GetWindow());
     Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
     if ( pTabCtrl && xTabPage.is() )
     {
@@ -181,7 +181,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con
         sal_Int16 nPageID = xP->getTabPageID();
 
         vcl::Window* pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
-        TabPage* pPage = (TabPage*)pWindow;
+        TabPage* pPage = static_cast<TabPage*>(pWindow);
         pTabCtrl->InsertPage(nPageID,pPage->GetText());
 
         pPage->Hide();
@@ -196,7 +196,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con
 void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
-    TabControl* pTabCtrl = (TabControl*)GetWindow();
+    TabControl* pTabCtrl = static_cast<TabControl*>(GetWindow());
     Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
     if ( pTabCtrl && xTabPage.is() )
     {
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 4e57b33..94fe04a 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -746,7 +746,9 @@ void SAL_CALL VCLXToolkit::disposing()
         ByteBufferWrapper *bbw = (ByteBufferWrapper *) (intptr_t) addressOfMemoryBufferForSharedArrayWrapper;
         pV->SetOutputSizePixelScaleOffsetAndBuffer( Size( Width, Height ), Fraction(ScaleNumerator, ScaleDenominator), Point( XOffset, YOffset), basebmp::RawMemorySharedArray( bbw->pointer(), *bbw ));
 #else
-        pV->SetOutputSizePixelScaleOffsetAndBuffer( Size( Width, Height ), Fraction(ScaleNumerator, ScaleDenominator), Point( XOffset, YOffset), basebmp::RawMemorySharedArray( (sal_uInt8*) (sal_uIntPtr) addressOfMemoryBufferForSharedArrayWrapper ));
+        pV->SetOutputSizePixelScaleOffsetAndBuffer( Size( Width, Height ),
+            Fraction(ScaleNumerator, ScaleDenominator), Point( XOffset, YOffset),
+            basebmp::RawMemorySharedArray( reinterpret_cast<sal_uInt8*>( addressOfMemoryBufferForSharedArrayWrapper )));
 #endif
     } else {
         pV->SetOutputSizePixel( Size( Width, Height ) );
@@ -827,7 +829,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
             break;
             case WINDOW_COMBOBOX:
                 pNewWindow = new ComboBox( pParent, nWinBits|WB_AUTOHSCROLL );
-                ((ComboBox*)pNewWindow)->EnableAutoSize( false );
+                static_cast<ComboBox*>(pNewWindow)->EnableAutoSize( false );
                 *ppNewComp = new VCLXComboBox;
             break;
             case WINDOW_CURRENCYBOX:
@@ -837,7 +839,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
                 pNewWindow = new CurrencyField( pParent, nWinBits );
                 static_cast<CurrencyField*>(pNewWindow)->EnableEmptyFieldValue( true );
                 *ppNewComp = new VCLXNumericField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(CurrencyField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<CurrencyField*>(pNewWindow) );
             break;
             case WINDOW_DATEBOX:
                 pNewWindow = new DateBox( pParent, nWinBits );
@@ -846,7 +848,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
                 pNewWindow = new DateField( pParent, nWinBits );
                 static_cast<DateField*>(pNewWindow)->EnableEmptyFieldValue( true );
                 *ppNewComp = new VCLXDateField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<DateField*>(pNewWindow) );
             break;
             case WINDOW_DOCKINGAREA:
                 pNewWindow = new DockingAreaWindow( pParent );
@@ -902,7 +904,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
             break;
             case WINDOW_LISTBOX:
                 pNewWindow = new ListBox( pParent, nWinBits|WB_SIMPLEMODE|WB_AUTOHSCROLL );
-                ((ListBox*)pNewWindow)->EnableAutoSize( false );
+                static_cast<ListBox*>(pNewWindow)->EnableAutoSize( false );
                 *ppNewComp = new VCLXListBox;
             break;
             case WINDOW_LONGCURRENCYBOX:
@@ -911,7 +913,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
             case WINDOW_LONGCURRENCYFIELD:
                 pNewWindow = new LongCurrencyField( pParent, nWinBits );
                 *ppNewComp = new VCLXCurrencyField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(LongCurrencyField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<LongCurrencyField*>(pNewWindow) );
             break;
             case WINDOW_MENUBUTTON:
                 pNewWindow = new MenuButton( pParent, nWinBits );
@@ -927,7 +929,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
             case WINDOW_METRICFIELD:
                 pNewWindow = new MetricField( pParent, nWinBits );
                 *ppNewComp = new VCLXMetricField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(MetricField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<MetricField*>(pNewWindow) );
             break;
             case WINDOW_DIALOG:
             case WINDOW_MODALDIALOG:
@@ -962,7 +964,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
                 pNewWindow = new NumericField( pParent, nWinBits );
                 static_cast<NumericField*>(pNewWindow)->EnableEmptyFieldValue( true );
                 *ppNewComp = new VCLXNumericField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(NumericField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<NumericField*>(pNewWindow) );
             break;
             case WINDOW_OKBUTTON:
                 pNewWindow = new OKButton( pParent, nWinBits );
@@ -974,7 +976,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
             case WINDOW_PATTERNFIELD:
                 pNewWindow = new PatternField( pParent, nWinBits );
                 *ppNewComp = new VCLXPatternField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(PatternField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<PatternField*>(pNewWindow) );
             break;
             case WINDOW_PUSHBUTTON:
                 pNewWindow = new PushButton( pParent, nWinBits );
@@ -1047,7 +1049,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
                 pNewWindow = new TimeField( pParent, nWinBits );
                 static_cast<TimeField*>(pNewWindow)->EnableEmptyFieldValue( true );
                 *ppNewComp = new VCLXTimeField;
-                ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(TimeField*)pNewWindow );
+                static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<TimeField*>(pNewWindow) );
             break;
             case WINDOW_TOOLBOX:
                 pNewWindow = new ToolBox( pParent, nWinBits );
diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx
index e3d0dd6..21386ae 100644
--- a/toolkit/source/awt/vclxtopwindow.cxx
+++ b/toolkit/source/awt/vclxtopwindow.cxx
@@ -83,18 +83,18 @@ Sequence< Type > VCLXTopWindow_Base::getTypes() throw(RuntimeException, std::exc
     vcl::Window* pWindow = GetWindowImpl();
     if ( pWindow )
     {
-        const SystemEnvData* pSysData = ((SystemWindow *)pWindow)->GetSystemData();
+        const SystemEnvData* pSysData = static_cast<SystemWindow *>(pWindow)->GetSystemData();
         if( pSysData )
         {
 #if (defined WNT)
             if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_WIN32 )
             {
-                 aRet <<= (sal_IntPtr)pSysData->hWnd;
+                 aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->hWnd);
             }
 #elif (defined MACOSX)
             if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_MAC )
             {
-                 aRet <<= (sal_IntPtr)pSysData->mpNSView;
+                 aRet <<= reinterpret_cast<sal_IntPtr>(pSysData->mpNSView);
             }
 #elif (defined ANDROID)
             // Nothing
@@ -136,7 +136,7 @@ void VCLXTopWindow_Base::toFront(  ) throw(::com::sun::star::uno::RuntimeExcepti
 
     vcl::Window* pWindow = GetWindowImpl();
     if ( pWindow )
-        ((WorkWindow*)pWindow)->ToTop( TOTOP_RESTOREWHENMIN );
+        static_cast<WorkWindow*>(pWindow)->ToTop( TOTOP_RESTOREWHENMIN );
 }
 
 void VCLXTopWindow_Base::toBack(  ) throw(::com::sun::star::uno::RuntimeException, std::exception)
@@ -147,7 +147,7 @@ void VCLXTopWindow_Base::setMenuBar( const ::com::sun::star::uno::Reference< ::c
 {
     SolarMutexGuard aGuard;
 
-    SystemWindow* pWindow = (SystemWindow*) GetWindowImpl();
+    SystemWindow* pWindow = dynamic_cast<SystemWindow*>( GetWindowImpl() );
     if ( pWindow )
     {
         pWindow->SetMenuBar( NULL );
@@ -155,7 +155,7 @@ void VCLXTopWindow_Base::setMenuBar( const ::com::sun::star::uno::Reference< ::c
         {
             VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu );
             if ( pMenu && !pMenu->IsPopupMenu() )
-                pWindow->SetMenuBar( (MenuBar*) pMenu->GetMenu() );
+                pWindow->SetMenuBar( static_cast<MenuBar*>( pMenu->GetMenu() ));
         }
     }
     mxMenuBar = rxMenu;
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index e80cc22..f3376e74 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -413,8 +413,8 @@ IMPL_LINK( VCLXWindow, WindowEventListener, VclSimpleEvent*, pEvent )
     DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
     if ( pEvent && pEvent->ISA( VclWindowEvent ) )
     {
-        DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow() && GetWindow(), "Window???" );
-        ProcessWindowEvent( *(VclWindowEvent*)pEvent );
+        DBG_ASSERT( static_cast<VclWindowEvent*>(pEvent)->GetWindow() && GetWindow(), "Window???" );
+        ProcessWindowEvent( *static_cast<VclWindowEvent*>(pEvent) );
     }
     return 0;
 }
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index b4d0f72..46b2e72 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -91,7 +91,7 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle )
 #endif
 
     // set system parent
-    ((WorkWindow*)pWindow)->SetPluginParent( &aSysParentData );
+    static_cast<WorkWindow*>(pWindow)->SetPluginParent( &aSysParentData );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 6161e73..a55844f 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -440,7 +440,7 @@ void VCLXButton::setActionCommand( const OUString& rCommand ) throw(::com::sun::
     SolarMutexGuard aGuard;
 
     Size aSz;
-    PushButton* pButton = (PushButton*) GetWindow();
+    PushButton* pButton = static_cast<PushButton*>(GetWindow());
     if ( pButton )
         aSz = pButton->CalcMinimumSize();
     return AWTSize(aSz);
@@ -459,7 +459,7 @@ void VCLXButton::setActionCommand( const OUString& rCommand ) throw(::com::sun::
     SolarMutexGuard aGuard;
 
     Size aSz = VCLSize(rNewSize);
-    PushButton* pButton = (PushButton*) GetWindow();
+    PushButton* pButton = static_cast<PushButton*>( GetWindow() );
     if ( pButton )
     {
         Size aMinSz = pButton->CalcMinimumSize();
@@ -486,7 +486,7 @@ void VCLXButton::setProperty( const OUString& PropertyName, const ::com::sun::st
 {
     SolarMutexGuard aGuard;
 
-    Button* pButton = (Button*)GetWindow();
+    Button* pButton = static_cast<Button*>(GetWindow());
     if ( pButton )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -515,7 +515,7 @@ void VCLXButton::setProperty( const OUString& PropertyName, const ::com::sun::st
                 {
                     sal_Int16 n = sal_Int16();
                     if ( Value >>= n )
-                        ((PushButton*)pButton)->SetState( (TriState)n );
+                        static_cast<PushButton*>(pButton)->SetState( (TriState)n );
                 }
             }
             break;
@@ -532,7 +532,7 @@ void VCLXButton::setProperty( const OUString& PropertyName, const ::com::sun::st
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    Button* pButton = (Button*)GetWindow();
+    Button* pButton = static_cast<Button*>(GetWindow());
     if ( pButton )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -555,7 +555,7 @@ void VCLXButton::setProperty( const OUString& PropertyName, const ::com::sun::st
             {
                 if ( GetWindow()->GetType() == WINDOW_PUSHBUTTON )
                 {
-                     aProp <<= (sal_Int16)((PushButton*)pButton)->GetState();
+                     aProp <<= (sal_Int16)static_cast<PushButton*>(pButton)->GetState();
                 }
             }
             break;
@@ -690,7 +690,7 @@ void VCLXImageControl::setProperty( const OUString& PropertyName, const ::com::s
 {
     SolarMutexGuard aGuard;
 
-    ImageControl* pImageControl = (ImageControl*)GetWindow();
+    ImageControl* pImageControl = static_cast<ImageControl*>(GetWindow());
 
     sal_uInt16 nPropType = GetPropertyId( PropertyName );
     switch ( nPropType )
@@ -727,7 +727,7 @@ void VCLXImageControl::setProperty( const OUString& PropertyName, const ::com::s
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    ImageControl* pImageControl = (ImageControl*)GetWindow();
+    ImageControl* pImageControl = static_cast<ImageControl*>(GetWindow());
     sal_uInt16 nPropType = GetPropertyId( PropertyName );
 
     switch ( nPropType )
@@ -859,7 +859,7 @@ void VCLXCheckBox::setState( short n ) throw(::com::sun::star::uno::RuntimeExcep
 {
     SolarMutexGuard aGuard;
 
-    CheckBox* pCheckBox = (CheckBox*)GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox)
     {
         TriState eState;
@@ -888,7 +888,7 @@ short VCLXCheckBox::getState() throw(::com::sun::star::uno::RuntimeException, st
     SolarMutexGuard aGuard;
 
     short nState = -1;
-    CheckBox* pCheckBox = (CheckBox*)GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox )
     {
         switch ( pCheckBox->GetState() )
@@ -907,7 +907,7 @@ void VCLXCheckBox::enableTriState( sal_Bool b ) throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    CheckBox* pCheckBox = (CheckBox*)GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox)
         pCheckBox->EnableTriState( b );
 }
@@ -917,7 +917,7 @@ void VCLXCheckBox::enableTriState( sal_Bool b ) throw(::com::sun::star::uno::Run
     SolarMutexGuard aGuard;
 
     Size aSz;
-    CheckBox* pCheckBox = (CheckBox*) GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox )
         aSz = pCheckBox->CalcMinimumSize();
     return AWTSize(aSz);
@@ -933,7 +933,7 @@ void VCLXCheckBox::enableTriState( sal_Bool b ) throw(::com::sun::star::uno::Run
     SolarMutexGuard aGuard;
 
     Size aSz = VCLSize(rNewSize);
-    CheckBox* pCheckBox = (CheckBox*) GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox )
     {
         Size aMinSz = pCheckBox->CalcMinimumSize();
@@ -949,7 +949,7 @@ void VCLXCheckBox::setProperty( const OUString& PropertyName, const ::com::sun::
 {
     SolarMutexGuard aGuard;
 
-    CheckBox* pCheckBox = (CheckBox*)GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -986,7 +986,7 @@ void VCLXCheckBox::setProperty( const OUString& PropertyName, const ::com::sun::
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    CheckBox* pCheckBox = (CheckBox*)GetWindow();
+    CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
     if ( pCheckBox )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -1021,7 +1021,7 @@ void VCLXCheckBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
                 // in during the listener call. To prevent the resulting crashs, we keep us
                 // alive as long as we're here
 
-            CheckBox* pCheckBox = (CheckBox*)GetWindow();
+            CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
             if ( pCheckBox )
             {
                 if ( maItemListeners.getLength() )
@@ -1121,7 +1121,7 @@ void VCLXRadioButton::setProperty( const OUString& PropertyName, const ::com::su
 {
     SolarMutexGuard aGuard;
 
-    RadioButton* pButton = (RadioButton*)GetWindow();
+    RadioButton* pButton = static_cast<RadioButton*>(GetWindow());
     if ( pButton )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -1164,7 +1164,7 @@ void VCLXRadioButton::setProperty( const OUString& PropertyName, const ::com::su
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    RadioButton* pButton = (RadioButton*)GetWindow();
+    RadioButton* pButton = static_cast<RadioButton*>(GetWindow());
     if ( pButton )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -1231,7 +1231,7 @@ void VCLXRadioButton::setState( sal_Bool b ) throw(::com::sun::star::uno::Runtim
 {
     SolarMutexGuard aGuard;
 
-    RadioButton* pRadioButton = (RadioButton*)GetWindow();
+    RadioButton* pRadioButton = static_cast<RadioButton*>(GetWindow());
     if ( pRadioButton)
     {
         pRadioButton->Check( b );
@@ -1250,7 +1250,7 @@ sal_Bool VCLXRadioButton::getState() throw(::com::sun::star::uno::RuntimeExcepti
 {
     SolarMutexGuard aGuard;
 
-    RadioButton* pRadioButton = (RadioButton*)GetWindow();
+    RadioButton* pRadioButton = static_cast<RadioButton*>(GetWindow());
     return pRadioButton ? pRadioButton->IsChecked() : sal_False;
 }
 
@@ -1259,7 +1259,7 @@ sal_Bool VCLXRadioButton::getState() throw(::com::sun::star::uno::RuntimeExcepti
     SolarMutexGuard aGuard;
 
     Size aSz;
-    RadioButton* pRadioButton = (RadioButton*) GetWindow();
+    RadioButton* pRadioButton = static_cast<RadioButton*>(GetWindow());
     if ( pRadioButton )
         aSz = pRadioButton->CalcMinimumSize();
     return AWTSize(aSz);
@@ -1275,7 +1275,7 @@ sal_Bool VCLXRadioButton::getState() throw(::com::sun::star::uno::RuntimeExcepti
     SolarMutexGuard aGuard;
 
     Size aSz = VCLSize(rNewSize);
-    RadioButton* pRadioButton = (RadioButton*) GetWindow();
+    RadioButton* pRadioButton = static_cast<RadioButton*>(GetWindow());
     if ( pRadioButton )
     {
         Size aMinSz = pRadioButton->CalcMinimumSize();
@@ -1321,7 +1321,7 @@ void VCLXRadioButton::ImplClickedOrToggled( bool bToggled )
 {
     // In the formulars, RadioChecked is not enabled, call itemStateChanged only for click
     // In the dialog editor, RadioChecked is enabled, call itemStateChanged only for bToggled
-    RadioButton* pRadioButton = (RadioButton*)GetWindow();
+    RadioButton* pRadioButton = static_cast<RadioButton*>(GetWindow());
     if ( pRadioButton && ( pRadioButton->IsRadioCheckEnabled() == bToggled ) && ( bToggled || pRadioButton->IsStateChanged() ) && maItemListeners.getLength() )
     {
         ::com::sun::star::awt::ItemEvent aEvent;
@@ -1377,7 +1377,7 @@ void VCLXSpinField::up() throw(::com::sun::star::uno::RuntimeException, std::exc
 {
     SolarMutexGuard aGuard;
 
-    SpinField* pSpinField = (SpinField*) GetWindow();
+    SpinField* pSpinField = static_cast<SpinField*>(GetWindow());
     if ( pSpinField )
         pSpinField->Up();
 }
@@ -1386,7 +1386,7 @@ void VCLXSpinField::down() throw(::com::sun::star::uno::RuntimeException, std::e
 {
     SolarMutexGuard aGuard;
 
-    SpinField* pSpinField = (SpinField*) GetWindow();
+    SpinField* pSpinField = static_cast<SpinField*>(GetWindow());
     if ( pSpinField )
         pSpinField->Down();
 }
@@ -1395,7 +1395,7 @@ void VCLXSpinField::first() throw(::com::sun::star::uno::RuntimeException, std::
 {
     SolarMutexGuard aGuard;
 
-    SpinField* pSpinField = (SpinField*) GetWindow();
+    SpinField* pSpinField = static_cast<SpinField*>(GetWindow());
     if ( pSpinField )
         pSpinField->First();
 }
@@ -1404,7 +1404,7 @@ void VCLXSpinField::last() throw(::com::sun::star::uno::RuntimeException, std::e
 {
     SolarMutexGuard aGuard;
 
-    SpinField* pSpinField = (SpinField*) GetWindow();
+    SpinField* pSpinField = static_cast<SpinField*>(GetWindow());
     if ( pSpinField )
         pSpinField->Last();
 }
@@ -1546,7 +1546,7 @@ void VCLXListBox::addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         pBox->InsertEntry( aItem, nPos );
 }
@@ -1555,7 +1555,7 @@ void VCLXListBox::addItems( const ::com::sun::star::uno::Sequence< OUString>& aI
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         sal_uInt16 nP = nPos;
@@ -1579,7 +1579,7 @@ void VCLXListBox::removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::s
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         for ( sal_uInt16 n = nCount; n; )
@@ -1591,7 +1591,7 @@ sal_Int16 VCLXListBox::getItemCount() throw(::com::sun::star::uno::RuntimeExcept
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     return pBox ? pBox->GetEntryCount() : 0;
 }
 
@@ -1600,7 +1600,7 @@ OUString VCLXListBox::getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::Run
     SolarMutexGuard aGuard;
 
     OUString aItem;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         aItem = pBox->GetEntry( nPos );
     return aItem;
@@ -1611,7 +1611,7 @@ OUString VCLXListBox::getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::Run
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Sequence< OUString> aSeq;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         sal_uInt16 nEntries = pBox->GetEntryCount();
@@ -1629,7 +1629,7 @@ sal_Int16 VCLXListBox::getSelectedItemPos() throw(::com::sun::star::uno::Runtime
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     return pBox ? pBox->GetSelectEntryPos() : 0;
 }
 
@@ -1638,7 +1638,7 @@ sal_Int16 VCLXListBox::getSelectedItemPos() throw(::com::sun::star::uno::Runtime
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Sequence<sal_Int16> aSeq;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         sal_uInt16 nSelEntries = pBox->GetSelectEntryCount();
@@ -1654,7 +1654,7 @@ OUString VCLXListBox::getSelectedItem() throw(::com::sun::star::uno::RuntimeExce
     SolarMutexGuard aGuard;
 
     OUString aItem;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         aItem = pBox->GetSelectEntry();
     return aItem;
@@ -1665,7 +1665,7 @@ OUString VCLXListBox::getSelectedItem() throw(::com::sun::star::uno::RuntimeExce
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Sequence< OUString> aSeq;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         sal_uInt16 nSelEntries = pBox->GetSelectEntryCount();
@@ -1680,7 +1680,7 @@ void VCLXListBox::selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) throw(::com:
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox && ( pBox->IsEntryPosSelected( nPos ) != bool(bSelect) ) )
     {
         pBox->SelectEntryPos( nPos, bSelect );
@@ -1699,7 +1699,7 @@ void VCLXListBox::selectItemsPos( const ::com::sun::star::uno::Sequence<sal_Int1
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         bool bChanged = false;
@@ -1730,7 +1730,7 @@ void VCLXListBox::selectItem( const OUString& rItemText, sal_Bool bSelect ) thro
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
     {
         OUString aItemText( rItemText );
@@ -1743,7 +1743,7 @@ void VCLXListBox::setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::sta
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         pBox->SetDropDownLineCount( nLines );
 }
@@ -1753,7 +1753,7 @@ sal_Int16 VCLXListBox::getDropDownLineCount() throw(::com::sun::star::uno::Runti
     SolarMutexGuard aGuard;
 
     sal_Int16 nLines = 0;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         nLines = pBox->GetDropDownLineCount();
     return nLines;
@@ -1764,7 +1764,7 @@ sal_Bool VCLXListBox::isMutipleMode() throw(::com::sun::star::uno::RuntimeExcept
     SolarMutexGuard aGuard;
 
     bool bMulti = false;
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         bMulti = pBox->IsMultiSelectionEnabled();
     return bMulti;
@@ -1774,7 +1774,7 @@ void VCLXListBox::setMultipleMode( sal_Bool bMulti ) throw(::com::sun::star::uno
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         pBox->EnableMultiSelection( bMulti );
 }
@@ -1783,7 +1783,7 @@ void VCLXListBox::makeVisible( sal_Int16 nEntry ) throw(::com::sun::star::uno::R
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pBox = (ListBox*) GetWindow();
+    ListBox* pBox = static_cast<ListBox*>(GetWindow());
     if ( pBox )
         pBox->SetTopEntry( nEntry );
 }
@@ -1799,7 +1799,7 @@ void VCLXListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
     {
         case VCLEVENT_LISTBOX_SELECT:
         {
-            ListBox* pListBox = (ListBox*)GetWindow();
+            ListBox* pListBox = static_cast<ListBox*>(GetWindow());
 
             if( pListBox )
             {
@@ -1826,7 +1826,7 @@ void VCLXListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
             {
                 ::com::sun::star::awt::ActionEvent aEvent;
                 aEvent.Source = (::cppu::OWeakObject*)this;
-                aEvent.ActionCommand = ((ListBox*)GetWindow())->GetSelectEntry();
+                aEvent.ActionCommand = static_cast<ListBox*>(GetWindow())->GetSelectEntry();
                 maActionListeners.actionPerformed( aEvent );
             }
             break;
@@ -1848,7 +1848,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const ::com::sun::s
 {
     SolarMutexGuard aGuard;
 
-    ListBox* pListBox = (ListBox*)GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -1926,7 +1926,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const ::com::sun::s
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    ListBox* pListBox = (ListBox*)GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -1980,7 +1980,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const ::com::sun::s
     SolarMutexGuard aGuard;
 
     Size aSz;
-    ListBox* pListBox = (ListBox*) GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
         aSz = pListBox->CalcMinimumSize();
     return AWTSize(aSz);
@@ -1991,7 +1991,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const ::com::sun::s
     SolarMutexGuard aGuard;
 
     Size aSz;
-    ListBox* pListBox = (ListBox*) GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
     {
         aSz = pListBox->CalcMinimumSize();
@@ -2006,7 +2006,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const ::com::sun::s
     SolarMutexGuard aGuard;
 
     Size aSz = VCLSize(rNewSize);
-    ListBox* pListBox = (ListBox*) GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
         aSz = pListBox->CalcAdjustedSize( aSz );
     return AWTSize(aSz);
@@ -2017,7 +2017,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const ::com::sun::s
     SolarMutexGuard aGuard;
 
     Size aSz;
-    ListBox* pListBox = (ListBox*) GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
         aSz = pListBox->CalcBlockSize( nCols, nLines );
     return AWTSize(aSz);
@@ -2028,7 +2028,7 @@ void VCLXListBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) thro
     SolarMutexGuard aGuard;
 
     nCols = nLines = 0;
-    ListBox* pListBox = (ListBox*) GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox )
     {
         sal_uInt16 nC, nL;
@@ -2040,7 +2040,7 @@ void VCLXListBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) thro
 
 void VCLXListBox::ImplCallItemListeners()
 {
-    ListBox* pListBox = (ListBox*) GetWindow();
+    ListBox* pListBox = static_cast<ListBox*>(GetWindow());
     if ( pListBox && maItemListeners.getLength() )
     {
         ::com::sun::star::awt::ItemEvent aEvent;
@@ -2230,7 +2230,7 @@ void VCLXMessageBox::setMessageText( const OUString& rText ) throw(::com::sun::s
 {
     SolarMutexGuard aGuard;
 
-    MessBox* pBox = (MessBox*)GetWindow();
+    MessBox* pBox = static_cast<MessBox*>(GetWindow());
     if ( pBox )
         pBox->SetMessText( rText );
 }
@@ -2240,7 +2240,7 @@ OUString VCLXMessageBox::getMessageText() throw(::com::sun::star::uno::RuntimeEx
     SolarMutexGuard aGuard;
 
     OUString aText;
-    MessBox* pBox = (MessBox*)GetWindow();
+    MessBox* pBox = static_cast<MessBox*>(GetWindow());
     if ( pBox )
         aText = pBox->GetMessText();
     return aText;
@@ -2250,7 +2250,7 @@ sal_Int16 VCLXMessageBox::execute() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    MessBox* pBox = (MessBox*)GetWindow();
+    MessBox* pBox = static_cast<MessBox*>(GetWindow());
     return pBox ? pBox->Execute() : 0;
 }
 
@@ -2339,7 +2339,7 @@ sal_Int16 VCLXDialog::execute() throw(::com::sun::star::uno::RuntimeException, s
     sal_Int16 nRet = 0;
     if ( GetWindow() )
     {
-        Dialog* pDlg = (Dialog*) GetWindow();
+        Dialog* pDlg = static_cast<Dialog*>(GetWindow());
         vcl::Window* pParent = pDlg->GetWindow( WINDOW_PARENTOVERLAP );
         vcl::Window* pOldParent = NULL;
         vcl::Window* pSetParent = NULL;
@@ -2392,7 +2392,7 @@ void SAL_CALL VCLXDialog::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::s
     ::com::sun::star::awt::DeviceInfo aInfo = VCLXDevice::getInfo();
 
     SolarMutexGuard aGuard;
-    Dialog* pDlg = (Dialog*) GetWindow();
+    Dialog* pDlg = static_cast<Dialog*>(GetWindow());
     if ( pDlg )
         pDlg->GetDrawWindowBorder( aInfo.LeftInset, aInfo.TopInset, aInfo.RightInset, aInfo.BottomInset );
 
@@ -2406,7 +2406,7 @@ throw(::com::sun::star::uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
 
-    Dialog* pDialog = (Dialog*)GetWindow();
+    Dialog* pDialog = static_cast<Dialog*>(GetWindow());
     if ( pDialog )
     {
         bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
@@ -2559,7 +2559,7 @@ throw(::com::sun::star::uno::RuntimeException, std::exception)
     SolarMutexGuard aGuard;
     OSL_TRACE(" **** VCLXMultiPage::setProperty( %s )", OUStringToOString( PropertyName, RTL_TEXTENCODING_UTF8 ).getStr() );
 
-    TabControl* pTabControl = (TabControl*)GetWindow();
+    TabControl* pTabControl = static_cast<TabControl*>(GetWindow());
     if ( pTabControl )
     {
         bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
@@ -2715,14 +2715,14 @@ void VCLXMultiPage::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
     {
         case VCLEVENT_TABPAGE_DEACTIVATE:
         {
-            sal_uLong nPageID = (sal_uLong)( rVclWindowEvent.GetData() );
+            sal_uLong nPageID = reinterpret_cast<sal_uLong>( rVclWindowEvent.GetData() );
             maTabListeners.deactivated( nPageID );
             break;
 
         }
         case VCLEVENT_TABPAGE_ACTIVATE:
         {
-            sal_uLong nPageID = (sal_uLong)( rVclWindowEvent.GetData() );
+            sal_uLong nPageID = reinterpret_cast<sal_uLong>( rVclWindowEvent.GetData() );
             maTabListeners.activated( nPageID );
             break;
         }
@@ -2810,7 +2810,7 @@ throw(::com::sun::star::uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
 
-    TabPage* pTabPage = (TabPage*)GetWindow();
+    TabPage* pTabPage = static_cast<TabPage*>(GetWindow());
     if ( pTabPage )
     {
         bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
@@ -2921,7 +2921,7 @@ void VCLXFixedHyperlink::ProcessWindowEvent( const VclWindowEvent& rVclWindowEve
             {
                 // open the URL
                 OUString sURL;
-                FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
+                FixedHyperlink* pBase = static_cast<FixedHyperlink*>(GetWindow());
                 if ( pBase )
                     sURL = pBase->GetURL();
                 Reference< ::com::sun::star::system::XSystemShellExecute > xSystemShellExecute( ::com::sun::star::system::SystemShellExecute::create(
@@ -2956,7 +2956,7 @@ void VCLXFixedHyperlink::setText( const OUString& Text ) throw(::com::sun::star:
 {
     SolarMutexGuard aGuard;
 
-    FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
+    FixedHyperlink* pBase = static_cast<FixedHyperlink*>(GetWindow());
     if (pBase)
         pBase->SetText(Text);
 }
@@ -2976,7 +2976,7 @@ void VCLXFixedHyperlink::setURL( const OUString& URL ) throw(::com::sun::star::u
 {
     SolarMutexGuard aGuard;
 
-    FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
+    FixedHyperlink* pBase = static_cast<FixedHyperlink*>(GetWindow());
     if ( pBase )
         pBase->SetURL( URL );
 }
@@ -2986,7 +2986,7 @@ OUString VCLXFixedHyperlink::getURL(  ) throw(::com::sun::star::uno::RuntimeExce
     SolarMutexGuard aGuard;
 
     OUString aText;
-    FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
+    FixedHyperlink* pBase = static_cast<FixedHyperlink*>(GetWindow());
     if ( pBase )
         aText = pBase->GetURL();
     return aText;
@@ -3049,7 +3049,7 @@ void VCLXFixedHyperlink::removeActionListener( const ::com::sun::star::uno::Refe
     SolarMutexGuard aGuard;
 
     Size aSz;
-    FixedText* pFixedText = (FixedText*)GetWindow();
+    FixedText* pFixedText = static_cast<FixedText*>(GetWindow());
     if ( pFixedText )
         aSz = pFixedText->CalcMinimumSize();
     return AWTSize(aSz);
@@ -3076,7 +3076,7 @@ void VCLXFixedHyperlink::setProperty( const OUString& PropertyName, const ::com:
 {
     SolarMutexGuard aGuard;
 
-    FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
+    FixedHyperlink* pBase = static_cast<FixedHyperlink*>(GetWindow());
     if ( pBase )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -3111,7 +3111,7 @@ void VCLXFixedHyperlink::setProperty( const OUString& PropertyName, const ::com:
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    FixedHyperlink* pBase = (FixedHyperlink*)GetWindow();
+    FixedHyperlink* pBase = static_cast<FixedHyperlink*>(GetWindow());
     if ( pBase )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -3279,7 +3279,7 @@ short VCLXFixedText::getAlignment() throw(::com::sun::star::uno::RuntimeExceptio
     SolarMutexGuard aGuard;
 
     Size aSz;
-    FixedText* pFixedText = (FixedText*)GetWindow();
+    FixedText* pFixedText = static_cast<FixedText*>(GetWindow());
     if ( pFixedText )
         aSz = pFixedText->CalcMinimumSize();
     return AWTSize(aSz);
@@ -3295,7 +3295,7 @@ short VCLXFixedText::getAlignment() throw(::com::sun::star::uno::RuntimeExceptio
     SolarMutexGuard aGuard;
 
     Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) );
-    FixedText* pFixedText = (FixedText*)GetWindow();
+    FixedText* pFixedText = static_cast<FixedText*>(GetWindow());
     if ( pFixedText )
         aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width );
     return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize );
@@ -3384,7 +3384,7 @@ void VCLXScrollBar::setValue( sal_Int32 n ) throw(::com::sun::star::uno::Runtime
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
         pScrollBar->DoScroll( n );
 }
@@ -3393,7 +3393,7 @@ void VCLXScrollBar::setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 n
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
     {
         pScrollBar->SetVisibleSize( nVisible );
@@ -3406,7 +3406,7 @@ sal_Int32 VCLXScrollBar::getValue() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     return pScrollBar ? pScrollBar->GetThumbPos() : 0;
 }
 
@@ -3414,7 +3414,7 @@ void VCLXScrollBar::setMaximum( sal_Int32 n ) throw(::com::sun::star::uno::Runti
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
         pScrollBar->SetRangeMax( n );
 }
@@ -3423,7 +3423,7 @@ sal_Int32 VCLXScrollBar::getMaximum() throw(::com::sun::star::uno::RuntimeExcept
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     return pScrollBar ? pScrollBar->GetRangeMax() : 0;
 }
 
@@ -3448,7 +3448,7 @@ void VCLXScrollBar::setLineIncrement( sal_Int32 n ) throw(::com::sun::star::uno:
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
         pScrollBar->SetLineSize( n );
 }
@@ -3457,7 +3457,7 @@ sal_Int32 VCLXScrollBar::getLineIncrement() throw(::com::sun::star::uno::Runtime
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     return pScrollBar ? pScrollBar->GetLineSize() : 0;
 }
 
@@ -3465,7 +3465,7 @@ void VCLXScrollBar::setBlockIncrement( sal_Int32 n ) throw(::com::sun::star::uno
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
         pScrollBar->SetPageSize( n );
 }
@@ -3474,7 +3474,7 @@ sal_Int32 VCLXScrollBar::getBlockIncrement() throw(::com::sun::star::uno::Runtim
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     return pScrollBar ? pScrollBar->GetPageSize() : 0;
 }
 
@@ -3482,7 +3482,7 @@ void VCLXScrollBar::setVisibleSize( sal_Int32 n ) throw(::com::sun::star::uno::R
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
         pScrollBar->SetVisibleSize( n );
 }
@@ -3491,7 +3491,7 @@ sal_Int32 VCLXScrollBar::getVisibleSize() throw(::com::sun::star::uno::RuntimeEx
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*) GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     return pScrollBar ? pScrollBar->GetVisibleSize() : 0;
 }
 
@@ -3537,7 +3537,7 @@ void VCLXScrollBar::setProperty( const OUString& PropertyName, const ::com::sun:
 {
     SolarMutexGuard aGuard;
 
-    ScrollBar* pScrollBar = (ScrollBar*)GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
     {
         bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
@@ -3653,7 +3653,7 @@ void VCLXScrollBar::setProperty( const OUString& PropertyName, const ::com::sun:
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    ScrollBar* pScrollBar = (ScrollBar*)GetWindow();
+    ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
     if ( pScrollBar )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -3730,7 +3730,7 @@ void VCLXScrollBar::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
 
             if ( maAdjustmentListeners.getLength() )
             {
-                ScrollBar* pScrollBar = (ScrollBar*)GetWindow();
+                ScrollBar* pScrollBar = static_cast<ScrollBar*>(GetWindow());
 
                 if( pScrollBar )
                 {
@@ -3870,7 +3870,7 @@ void VCLXEdit::setText( const OUString& aText ) throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*)GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         pEdit->SetText( aText );
@@ -3887,7 +3887,7 @@ void VCLXEdit::insertText( const ::com::sun::star::awt::Selection& rSel, const O
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*)GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         pEdit->SetSelection( Selection( rSel.Min, rSel.Max ) );
@@ -3917,7 +3917,7 @@ OUString VCLXEdit::getSelectedText() throw(::com::sun::star::uno::RuntimeExcepti
     SolarMutexGuard aGuard;
 
     OUString aText;
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit)
         aText = pEdit->GetSelected();
     return aText;
@@ -3928,7 +3928,7 @@ void VCLXEdit::setSelection( const ::com::sun::star::awt::Selection& aSelection
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         pEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) );
 }
@@ -3938,7 +3938,7 @@ void VCLXEdit::setSelection( const ::com::sun::star::awt::Selection& aSelection
     SolarMutexGuard aGuard;
 
     Selection aSel;
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         aSel = pEdit->GetSelection();
     return ::com::sun::star::awt::Selection( aSel.Min(), aSel.Max() );
@@ -3948,7 +3948,7 @@ sal_Bool VCLXEdit::isEditable() throw(::com::sun::star::uno::RuntimeException, s
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     return ( pEdit && !pEdit->IsReadOnly() && pEdit->IsEnabled() ) ? sal_True : sal_False;
 }
 
@@ -3956,7 +3956,7 @@ void VCLXEdit::setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::Ru
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         pEdit->SetReadOnly( !bEditable );
 }
@@ -3966,7 +3966,7 @@ void VCLXEdit::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::Runt
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         pEdit->SetMaxTextLen( nLen );
 }
@@ -3975,7 +3975,7 @@ sal_Int16 VCLXEdit::getMaxTextLen() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     return pEdit ? pEdit->GetMaxTextLen() : 0;
 }
 
@@ -3983,7 +3983,7 @@ void VCLXEdit::setEchoChar( sal_Unicode cEcho ) throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         pEdit->SetEchoChar( cEcho );
 }
@@ -3992,7 +3992,7 @@ void VCLXEdit::setProperty( const OUString& PropertyName, const ::com::sun::star
 {
     SolarMutexGuard aGuard;
 
-    Edit* pEdit = (Edit*)GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -4038,7 +4038,7 @@ void VCLXEdit::setProperty( const OUString& PropertyName, const ::com::sun::star
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    Edit* pEdit = (Edit*)GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -4070,7 +4070,7 @@ void VCLXEdit::setProperty( const OUString& PropertyName, const ::com::sun::star
     SolarMutexGuard aGuard;
 
     Size aSz;
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         aSz = pEdit->CalcMinimumSize();
     return AWTSize(aSz);
@@ -4081,7 +4081,7 @@ void VCLXEdit::setProperty( const OUString& PropertyName, const ::com::sun::star
     SolarMutexGuard aGuard;
 
     Size aSz;
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         aSz = pEdit->CalcMinimumSize();
@@ -4107,7 +4107,7 @@ void VCLXEdit::setProperty( const OUString& PropertyName, const ::com::sun::star
     SolarMutexGuard aGuard;
 
     Size aSz;
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         if ( nCols )
@@ -4124,7 +4124,7 @@ void VCLXEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(:
 
     nLines = 1;
     nCols = 0;
-    Edit* pEdit = (Edit*) GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
         nCols = pEdit->GetMaxVisChars();
 }
@@ -4250,7 +4250,7 @@ void VCLXComboBox::addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com:
 {
     SolarMutexGuard aGuard;
 
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
         pBox->InsertEntry( aItem, nPos );
 }
@@ -4259,7 +4259,7 @@ void VCLXComboBox::addItems( const ::com::sun::star::uno::Sequence< OUString>& a
 {
     SolarMutexGuard aGuard;
 
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
     {
         sal_uInt16 nP = nPos;
@@ -4280,7 +4280,7 @@ void VCLXComboBox::removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::
 {
     SolarMutexGuard aGuard;
 
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
     {
         for ( sal_uInt16 n = nCount; n; )
@@ -4292,7 +4292,7 @@ sal_Int16 VCLXComboBox::getItemCount() throw(::com::sun::star::uno::RuntimeExcep
 {
     SolarMutexGuard aGuard;
 
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     return pBox ? pBox->GetEntryCount() : 0;
 }
 
@@ -4301,7 +4301,7 @@ OUString VCLXComboBox::getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::Ru
     SolarMutexGuard aGuard;
 
     OUString aItem;
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
         aItem = pBox->GetEntry( nPos );
     return aItem;
@@ -4312,7 +4312,7 @@ OUString VCLXComboBox::getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::Ru
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Sequence< OUString> aSeq;
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
     {
         sal_uInt16 nEntries = pBox->GetEntryCount();
@@ -4330,7 +4330,7 @@ void VCLXComboBox::setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::st
 {
     SolarMutexGuard aGuard;
 
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
         pBox->SetDropDownLineCount( nLines );
 }
@@ -4340,7 +4340,7 @@ sal_Int16 VCLXComboBox::getDropDownLineCount() throw(::com::sun::star::uno::Runt
     SolarMutexGuard aGuard;
 
     sal_Int16 nLines = 0;
-    ComboBox* pBox = (ComboBox*) GetWindow();
+    ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
     if ( pBox )
         nLines = pBox->GetDropDownLineCount();
     return nLines;
@@ -4350,7 +4350,7 @@ void VCLXComboBox::setProperty( const OUString& PropertyName, const ::com::sun::
 {
     SolarMutexGuard aGuard;
 
-    ComboBox* pComboBox = (ComboBox*)GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -4407,7 +4407,7 @@ void VCLXComboBox::setProperty( const OUString& PropertyName, const ::com::sun::
     SolarMutexGuard aGuard;
 
     ::com::sun::star::uno::Any aProp;
-    ComboBox* pComboBox = (ComboBox*)GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
     {
         sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -4455,7 +4455,7 @@ void VCLXComboBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
         case VCLEVENT_COMBOBOX_SELECT:
             if ( maItemListeners.getLength() )
             {
-                ComboBox* pComboBox = (ComboBox*)GetWindow();
+                ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
                 if( pComboBox )
                 {
                     if ( !pComboBox->IsTravelSelect() )
@@ -4494,7 +4494,7 @@ void VCLXComboBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
     SolarMutexGuard aGuard;
 
     Size aSz;
-    ComboBox* pComboBox = (ComboBox*) GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
         aSz = pComboBox->CalcMinimumSize();
     return AWTSize(aSz);
@@ -4505,7 +4505,7 @@ void VCLXComboBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
     SolarMutexGuard aGuard;
 
     Size aSz;
-    ComboBox* pComboBox = (ComboBox*) GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
     {
         aSz = pComboBox->CalcMinimumSize();
@@ -4520,7 +4520,7 @@ void VCLXComboBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
     SolarMutexGuard aGuard;
 
     Size aSz = VCLSize(rNewSize);
-    ComboBox* pComboBox = (ComboBox*) GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
         aSz = pComboBox->CalcAdjustedSize( aSz );
     return AWTSize(aSz);
@@ -4531,7 +4531,7 @@ void VCLXComboBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
     SolarMutexGuard aGuard;
 
     Size aSz;
-    ComboBox* pComboBox = (ComboBox*) GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
         aSz = pComboBox->CalcBlockSize( nCols, nLines );
     return AWTSize(aSz);
@@ -4542,7 +4542,7 @@ void VCLXComboBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) thr
     SolarMutexGuard aGuard;
 
     nCols = nLines = 0;
-    ComboBox* pComboBox = (ComboBox*) GetWindow();
+    ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
     if ( pComboBox )
     {
         sal_uInt16 nC, nL;
@@ -4846,8 +4846,8 @@ void VCLXDateField::setProperty( const OUString& PropertyName, const ::com::sun:
             {
                 if ( bVoid )
                 {
-                    ((DateField*)GetWindow())->EnableEmptyFieldValue( true );
-                    ((DateField*)GetWindow())->SetEmptyFieldValue();
+                    static_cast<DateField*>(GetWindow())->EnableEmptyFieldValue( true );
+                    static_cast<DateField*>(GetWindow())->SetEmptyFieldValue();
                 }
                 else
                 {
@@ -4875,14 +4875,14 @@ void VCLXDateField::setProperty( const OUString& PropertyName, const ::com::sun:
             {
                 sal_Int16 n = sal_Int16();
                 if ( Value >>= n )
-                    ((DateField*)GetWindow())->SetExtDateFormat( (ExtDateFieldFormat) n );
+                    static_cast<DateField*>(GetWindow())->SetExtDateFormat( (ExtDateFieldFormat) n );
             }
             break;
             case BASEPROPERTY_DATESHOWCENTURY:
             {
                 bool b = bool();
                 if ( Value >>= b )
-                     ((DateField*)GetWindow())->SetShowDateCentury( b );
+                     static_cast<DateField*>(GetWindow())->SetShowDateCentury( b );
             }
             break;
             case BASEPROPERTY_ENFORCE_FORMAT:
@@ -4928,7 +4928,7 @@ void VCLXDateField::setProperty( const OUString& PropertyName, const ::com::sun:
             break;
             case BASEPROPERTY_DATESHOWCENTURY:
             {
-                aProp <<= ((DateField*)GetWindow())->IsShowDateCentury();
+                aProp <<= static_cast<DateField*>(GetWindow())->IsShowDateCentury();
             }
             break;
             case BASEPROPERTY_ENFORCE_FORMAT:
@@ -4950,7 +4950,7 @@ void VCLXDateField::setDate( const util::Date& aDate ) throw(::com::sun::star::u
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
     {
         pDateField->SetDate( aDate );
@@ -4967,7 +4967,7 @@ util::Date VCLXDateField::getDate() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         return pDateField->GetDate().GetUNODate();
     else
@@ -4978,7 +4978,7 @@ void VCLXDateField::setMin( const util::Date& aDate ) throw(::com::sun::star::un
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         pDateField->SetMin( aDate );
 }
@@ -4987,7 +4987,7 @@ util::Date VCLXDateField::getMin() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         return pDateField->GetMin().GetUNODate();
     else
@@ -4998,7 +4998,7 @@ void VCLXDateField::setMax( const util::Date& aDate ) throw(::com::sun::star::un
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         pDateField->SetMax( aDate );
 }
@@ -5007,7 +5007,7 @@ util::Date VCLXDateField::getMax() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         return pDateField->GetMax().GetUNODate();
     else
@@ -5018,7 +5018,7 @@ void VCLXDateField::setFirst( const util::Date& aDate ) throw(::com::sun::star::
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         pDateField->SetFirst( aDate );
 }
@@ -5027,7 +5027,7 @@ util::Date VCLXDateField::getFirst() throw(::com::sun::star::uno::RuntimeExcepti
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         return pDateField->GetFirst().GetUNODate();
     else
@@ -5038,7 +5038,7 @@ void VCLXDateField::setLast( const util::Date& aDate ) throw(::com::sun::star::u
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         pDateField->SetLast( aDate );
 }
@@ -5047,7 +5047,7 @@ util::Date VCLXDateField::getLast() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         return pDateField->GetLast().GetUNODate();
     else
@@ -5058,7 +5058,7 @@ void VCLXDateField::setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno:
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
         pDateField->SetLongFormat( bLong );
 }
@@ -5067,7 +5067,7 @@ sal_Bool VCLXDateField::isLongFormat() throw(::com::sun::star::uno::RuntimeExcep
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     return pDateField ? pDateField->IsLongFormat() : sal_False;
 }
 
@@ -5075,7 +5075,7 @@ void VCLXDateField::setEmpty() throw(::com::sun::star::uno::RuntimeException, st
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     if ( pDateField )
     {
         pDateField->SetEmptyDate();
@@ -5092,7 +5092,7 @@ sal_Bool VCLXDateField::isEmpty() throw(::com::sun::star::uno::RuntimeException,
 {
     SolarMutexGuard aGuard;
 
-    DateField* pDateField = (DateField*) GetWindow();
+    DateField* pDateField = static_cast<DateField*>(GetWindow());
     return pDateField ? pDateField->IsEmptyDate() : sal_False;
 }
 
@@ -5183,7 +5183,7 @@ void VCLXTimeField::setTime( const util::Time& aTime ) throw(::com::sun::star::u
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
     {
         pTimeField->SetTime( aTime );
@@ -5200,7 +5200,7 @@ util::Time VCLXTimeField::getTime() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         return pTimeField->GetTime().GetUNOTime();
     else
@@ -5211,7 +5211,7 @@ void VCLXTimeField::setMin( const util::Time& aTime ) throw(::com::sun::star::un
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         pTimeField->SetMin( aTime );
 }
@@ -5220,7 +5220,7 @@ util::Time VCLXTimeField::getMin() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         return pTimeField->GetMin().GetUNOTime();
     else
@@ -5231,7 +5231,7 @@ void VCLXTimeField::setMax( const util::Time& aTime ) throw(::com::sun::star::un
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         pTimeField->SetMax( aTime );
 }
@@ -5240,7 +5240,7 @@ util::Time VCLXTimeField::getMax() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         return pTimeField->GetMax().GetUNOTime();
     else
@@ -5251,7 +5251,7 @@ void VCLXTimeField::setFirst( const util::Time& aTime ) throw(::com::sun::star::
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         pTimeField->SetFirst( aTime );
 }
@@ -5260,7 +5260,7 @@ util::Time VCLXTimeField::getFirst() throw(::com::sun::star::uno::RuntimeExcepti
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         return pTimeField->GetFirst().GetUNOTime();
     else
@@ -5271,7 +5271,7 @@ void VCLXTimeField::setLast( const util::Time& aTime ) throw(::com::sun::star::u
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         pTimeField->SetLast( aTime );
 }
@@ -5280,7 +5280,7 @@ util::Time VCLXTimeField::getLast() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         return pTimeField->GetLast().GetUNOTime();
     else
@@ -5291,7 +5291,7 @@ void VCLXTimeField::setEmpty() throw(::com::sun::star::uno::RuntimeException, st
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     if ( pTimeField )
         pTimeField->SetEmptyTime();
 }
@@ -5300,7 +5300,7 @@ sal_Bool VCLXTimeField::isEmpty() throw(::com::sun::star::uno::RuntimeException,
 {
     SolarMutexGuard aGuard;
 
-    TimeField* pTimeField = (TimeField*) GetWindow();
+    TimeField* pTimeField = static_cast<TimeField*>(GetWindow());
     return pTimeField ? pTimeField->IsEmptyTime() : sal_False;
 }
 
@@ -5330,8 +5330,8 @@ void VCLXTimeField::setProperty( const OUString& PropertyName, const ::com::sun:
             {
                 if ( bVoid )
                 {
-                    ((TimeField*)GetWindow())->EnableEmptyFieldValue( true );
-                    ((TimeField*)GetWindow())->SetEmptyFieldValue();
+                    static_cast<TimeField*>(GetWindow())->EnableEmptyFieldValue( true );
+                    static_cast<TimeField*>(GetWindow())->SetEmptyFieldValue();
                 }
                 else
                 {
@@ -5359,7 +5359,7 @@ void VCLXTimeField::setProperty( const OUString& PropertyName, const ::com::sun:
             {
                 sal_Int16 n = sal_Int16();
                 if ( Value >>= n )
-                    ((TimeField*)GetWindow())->SetExtFormat( (ExtTimeFieldFormat) n );
+                    static_cast<TimeField*>(GetWindow())->SetExtFormat( (ExtTimeFieldFormat) n );
             }
             break;
             case BASEPROPERTY_ENFORCE_FORMAT:
@@ -5482,7 +5482,7 @@ void VCLXNumericField::setValue( double Value ) throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     if ( pNumericFormatter )
     {
         // shift long value using decimal digits
@@ -5492,7 +5492,7 @@ void VCLXNumericField::setValue( double Value ) throw(::com::sun::star::uno::Run
             (long)ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() ) );
 
         // #107218# Call same listeners like VCL would do after user interaction
-        Edit* pEdit = (Edit*)GetWindow();
+        Edit* pEdit = static_cast<Edit*>(GetWindow());
         if ( pEdit )
         {
             SetSynthesizingVCLEvent( true );
@@ -5507,7 +5507,7 @@ double VCLXNumericField::getValue() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     return pNumericFormatter
         ? ImplCalcDoubleValue( (double)pNumericFormatter->GetValue(), pNumericFormatter->GetDecimalDigits() )
         : 0;
@@ -5517,7 +5517,7 @@ void VCLXNumericField::setMin( double Value ) throw(::com::sun::star::uno::Runti
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     if ( pNumericFormatter )
         pNumericFormatter->SetMin(
             (long)ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() ) );
@@ -5527,7 +5527,7 @@ double VCLXNumericField::getMin() throw(::com::sun::star::uno::RuntimeException,
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     return pNumericFormatter
         ? ImplCalcDoubleValue( (double)pNumericFormatter->GetMin(), pNumericFormatter->GetDecimalDigits() )
         : 0;
@@ -5537,7 +5537,7 @@ void VCLXNumericField::setMax( double Value ) throw(::com::sun::star::uno::Runti
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     if ( pNumericFormatter )
         pNumericFormatter->SetMax(
             (long)ImplCalcLongValue( Value, pNumericFormatter->GetDecimalDigits() ) );
@@ -5547,7 +5547,7 @@ double VCLXNumericField::getMax() throw(::com::sun::star::uno::RuntimeException,
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     return pNumericFormatter
         ? ImplCalcDoubleValue( (double)pNumericFormatter->GetMax(), pNumericFormatter->GetDecimalDigits() )
         : 0;
@@ -5557,7 +5557,7 @@ void VCLXNumericField::setFirst( double Value ) throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    NumericField* pNumericField = (NumericField*) GetWindow();
+    NumericField* pNumericField = static_cast<NumericField*>(GetWindow());
     if ( pNumericField )
         pNumericField->SetFirst(
             (long)ImplCalcLongValue( Value, pNumericField->GetDecimalDigits() ) );
@@ -5567,7 +5567,7 @@ double VCLXNumericField::getFirst() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    NumericField* pNumericField = (NumericField*) GetWindow();
+    NumericField* pNumericField = static_cast<NumericField*>(GetWindow());
     return pNumericField
         ? ImplCalcDoubleValue( (double)pNumericField->GetFirst(), pNumericField->GetDecimalDigits() )
         : 0;
@@ -5577,7 +5577,7 @@ void VCLXNumericField::setLast( double Value ) throw(::com::sun::star::uno::Runt
 {
     SolarMutexGuard aGuard;
 
-    NumericField* pNumericField = (NumericField*) GetWindow();
+    NumericField* pNumericField = static_cast<NumericField*>(GetWindow());
     if ( pNumericField )
         pNumericField->SetLast(
             (long)ImplCalcLongValue( Value, pNumericField->GetDecimalDigits() ) );
@@ -5587,7 +5587,7 @@ double VCLXNumericField::getLast() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    NumericField* pNumericField = (NumericField*) GetWindow();
+    NumericField* pNumericField = static_cast<NumericField*>(GetWindow());
     return pNumericField
         ? ImplCalcDoubleValue( (double)pNumericField->GetLast(), pNumericField->GetDecimalDigits() )
         : 0;
@@ -5608,7 +5608,7 @@ void VCLXNumericField::setSpinSize( double Value ) throw(::com::sun::star::uno::
 {
     SolarMutexGuard aGuard;
 
-    NumericField* pNumericField = (NumericField*) GetWindow();
+    NumericField* pNumericField = static_cast<NumericField*>(GetWindow());
     if ( pNumericField )
         pNumericField->SetSpinSize(
             (long)ImplCalcLongValue( Value, pNumericField->GetDecimalDigits() ) );
@@ -5618,7 +5618,7 @@ double VCLXNumericField::getSpinSize() throw(::com::sun::star::uno::RuntimeExcep
 {
     SolarMutexGuard aGuard;
 
-    NumericField* pNumericField = (NumericField*) GetWindow();
+    NumericField* pNumericField = static_cast<NumericField*>(GetWindow());
     return pNumericField
         ? ImplCalcDoubleValue( (double)pNumericField->GetSpinSize(), pNumericField->GetDecimalDigits() )
         : 0;
@@ -5628,7 +5628,7 @@ void VCLXNumericField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::sta
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     if ( pNumericFormatter )
     {
         double n = getValue();
@@ -5641,7 +5641,7 @@ sal_Int16 VCLXNumericField::getDecimalDigits() throw(::com::sun::star::uno::Runt
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     return pNumericFormatter ? pNumericFormatter->GetDecimalDigits() : 0;
 }
 
@@ -5660,8 +5660,8 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const ::com::s
             {
                 if ( bVoid )
                 {
-                    ((NumericField*)GetWindow())->EnableEmptyFieldValue( true );
-                    ((NumericField*)GetWindow())->SetEmptyFieldValue();
+                    static_cast<NumericField*>(GetWindow())->EnableEmptyFieldValue( true );
+                    static_cast<NumericField*>(GetWindow())->SetEmptyFieldValue();
                 }
                 else
                 {
@@ -5703,7 +5703,7 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const ::com::s
             {
                 bool b = bool();
                 if ( Value >>= b )
-                     ((NumericField*)GetWindow())->SetUseThousandSep( b );
+                     static_cast<NumericField*>(GetWindow())->SetUseThousandSep( b );
             }
             break;
             default:
@@ -5747,7 +5747,7 @@ void VCLXNumericField::setProperty( const OUString& PropertyName, const ::com::s
             break;
             case BASEPROPERTY_NUMSHOWTHOUSANDSEP:
             {
-                aProp <<= ((NumericField*)GetWindow())->IsUseThousandSep();
+                aProp <<= static_cast<NumericField*>(GetWindow())->IsUseThousandSep();
             }
             break;
             default:
@@ -5807,7 +5807,7 @@ VCLXMetricField::~VCLXMetricField()
 
 MetricFormatter *VCLXMetricField::GetMetricFormatter() throw(::com::sun::star::uno::RuntimeException)
 {
-    MetricFormatter *pFormatter = (MetricFormatter *) GetFormatter();
+    MetricFormatter *pFormatter = static_cast<MetricFormatter *>(GetFormatter());
     if (!pFormatter)
         throw ::com::sun::star::uno::RuntimeException();
     return pFormatter;
@@ -5815,7 +5815,7 @@ MetricFormatter *VCLXMetricField::GetMetricFormatter() throw(::com::sun::star::u
 
 MetricField *VCLXMetricField::GetMetricField() throw(::com::sun::star::uno::RuntimeException)
 {
-    MetricField *pField = (MetricField *) GetWindow();
+    MetricField *pField = static_cast<MetricField *>(GetWindow());
     if (!pField)
         throw ::com::sun::star::uno::RuntimeException();
     return pField;
@@ -5873,7 +5873,7 @@ METRIC_MAP_PAIR(Last,  Field)
 void VCLXMetricField::CallListeners()
 {
     // #107218# Call same listeners like VCL would do after user interaction
-    Edit* pEdit = (Edit*)GetWindow();
+    Edit* pEdit = static_cast<Edit*>(GetWindow());
     if ( pEdit )
     {
         SetSynthesizingVCLEvent( true );
@@ -5929,7 +5929,7 @@ sal_Int16 VCLXMetricField::getDecimalDigits() throw(::com::sun::star::uno::Runti
 {
     SolarMutexGuard aGuard;
 
-    NumericFormatter* pNumericFormatter = (NumericFormatter*) GetFormatter();
+    NumericFormatter* pNumericFormatter = static_cast<NumericFormatter*>(GetFormatter());
     return pNumericFormatter ? pNumericFormatter->GetDecimalDigits() : 0;
 }
 
@@ -5953,21 +5953,21 @@ void VCLXMetricField::setProperty( const OUString& PropertyName, const ::com::su
             {
                 bool b = false;
                 if ( Value >>= b )
-                     ((NumericField*)GetWindow())->SetUseThousandSep( b );
+                     static_cast<NumericField*>(GetWindow())->SetUseThousandSep( b );
             }
             break;
             case BASEPROPERTY_UNIT:
             {
                 sal_uInt16 nVal = 0;
                 if ( Value >>= nVal )
-                    ((MetricField*)GetWindow())->SetUnit( (FieldUnit) nVal );
+                    static_cast<MetricField*>(GetWindow())->SetUnit( (FieldUnit) nVal );
                 break;
             }
             case BASEPROPERTY_CUSTOMUNITTEXT:
             {
                 OUString aStr;
                 if ( Value >>= aStr )
-                    ((MetricField*)GetWindow())->SetCustomUnitText( aStr );
+                    static_cast<MetricField*>(GetWindow())->SetCustomUnitText( aStr );
                 break;
             }
             default:
@@ -5991,13 +5991,13 @@ void VCLXMetricField::setProperty( const OUString& PropertyName, const ::com::su
         switch ( nPropType )
         {
             case BASEPROPERTY_NUMSHOWTHOUSANDSEP:
-                aProp <<= ((NumericField*)GetWindow())->IsUseThousandSep();
+                aProp <<= static_cast<NumericField*>(GetWindow())->IsUseThousandSep();
                 break;
             case BASEPROPERTY_UNIT:
-                aProp <<= (sal_uInt16) ((MetricField*)GetWindow())->GetUnit();
+                aProp <<= (sal_uInt16) (static_cast<MetricField*>(GetWindow())->GetUnit());
                 break;
             case BASEPROPERTY_CUSTOMUNITTEXT:
-                aProp <<= OUString (((MetricField*)GetWindow())->GetCustomUnitText());
+                aProp <<= OUString( static_cast<MetricField*>(GetWindow())->GetCustomUnitText() );
                 break;
             default:
             {
@@ -6078,7 +6078,7 @@ void VCLXCurrencyField::setValue( double Value ) throw(::com::sun::star::uno::Ru
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     if ( pCurrencyFormatter )
     {
         // shift long value using decimal digits
@@ -6088,7 +6088,7 @@ void VCLXCurrencyField::setValue( double Value ) throw(::com::sun::star::uno::Ru
             ImplCalcLongValue( Value, pCurrencyFormatter->GetDecimalDigits() ) );
 
         // #107218# Call same listeners like VCL would do after user interaction
-        Edit* pEdit = (Edit*)GetWindow();
+        Edit* pEdit = static_cast<Edit*>(GetWindow());
         if ( pEdit )
         {
             SetSynthesizingVCLEvent( true );
@@ -6103,7 +6103,7 @@ double VCLXCurrencyField::getValue() throw(::com::sun::star::uno::RuntimeExcepti
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     return pCurrencyFormatter
         ? ImplCalcDoubleValue( (double)pCurrencyFormatter->GetValue(), pCurrencyFormatter->GetDecimalDigits() )
         : 0;
@@ -6113,7 +6113,7 @@ void VCLXCurrencyField::setMin( double Value ) throw(::com::sun::star::uno::Runt
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     if ( pCurrencyFormatter )
         pCurrencyFormatter->SetMin(
             ImplCalcLongValue( Value, pCurrencyFormatter->GetDecimalDigits() ) );
@@ -6123,7 +6123,7 @@ double VCLXCurrencyField::getMin() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     return pCurrencyFormatter
         ? ImplCalcDoubleValue( (double)pCurrencyFormatter->GetMin(), pCurrencyFormatter->GetDecimalDigits() )
         : 0;
@@ -6133,7 +6133,7 @@ void VCLXCurrencyField::setMax( double Value ) throw(::com::sun::star::uno::Runt
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     if ( pCurrencyFormatter )
         pCurrencyFormatter->SetMax(
             ImplCalcLongValue( Value, pCurrencyFormatter->GetDecimalDigits() ) );
@@ -6143,7 +6143,7 @@ double VCLXCurrencyField::getMax() throw(::com::sun::star::uno::RuntimeException
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     return pCurrencyFormatter
         ? ImplCalcDoubleValue( (double)pCurrencyFormatter->GetMax(), pCurrencyFormatter->GetDecimalDigits() )
         : 0;
@@ -6153,7 +6153,7 @@ void VCLXCurrencyField::setFirst( double Value ) throw(::com::sun::star::uno::Ru
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyField* pCurrencyField = (LongCurrencyField*) GetWindow();
+    LongCurrencyField* pCurrencyField = static_cast<LongCurrencyField*>(GetWindow());
     if ( pCurrencyField )
         pCurrencyField->SetFirst(
             ImplCalcLongValue( Value, pCurrencyField->GetDecimalDigits() ) );
@@ -6163,7 +6163,7 @@ double VCLXCurrencyField::getFirst() throw(::com::sun::star::uno::RuntimeExcepti
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyField* pCurrencyField = (LongCurrencyField*) GetWindow();
+    LongCurrencyField* pCurrencyField = static_cast<LongCurrencyField*>(GetWindow());
     return pCurrencyField
         ? ImplCalcDoubleValue( (double)pCurrencyField->GetFirst(), pCurrencyField->GetDecimalDigits() )
         : 0;
@@ -6173,7 +6173,7 @@ void VCLXCurrencyField::setLast( double Value ) throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyField* pCurrencyField = (LongCurrencyField*) GetWindow();
+    LongCurrencyField* pCurrencyField = static_cast<LongCurrencyField*>(GetWindow());
     if ( pCurrencyField )
         pCurrencyField->SetLast(
             ImplCalcLongValue( Value, pCurrencyField->GetDecimalDigits() ) );
@@ -6183,7 +6183,7 @@ double VCLXCurrencyField::getLast() throw(::com::sun::star::uno::RuntimeExceptio
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyField* pCurrencyField = (LongCurrencyField*) GetWindow();
+    LongCurrencyField* pCurrencyField = static_cast<LongCurrencyField*>(GetWindow());
     return pCurrencyField
         ? ImplCalcDoubleValue( (double)pCurrencyField->GetLast(), pCurrencyField->GetDecimalDigits() )
         : 0;
@@ -6193,7 +6193,7 @@ void VCLXCurrencyField::setSpinSize( double Value ) throw(::com::sun::star::uno:
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyField* pCurrencyField = (LongCurrencyField*) GetWindow();
+    LongCurrencyField* pCurrencyField = static_cast<LongCurrencyField*>(GetWindow());
     if ( pCurrencyField )
         pCurrencyField->SetSpinSize(
             ImplCalcLongValue( Value, pCurrencyField->GetDecimalDigits() ) );
@@ -6203,7 +6203,7 @@ double VCLXCurrencyField::getSpinSize() throw(::com::sun::star::uno::RuntimeExce
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyField* pCurrencyField = (LongCurrencyField*) GetWindow();
+    LongCurrencyField* pCurrencyField = static_cast<LongCurrencyField*>(GetWindow());
     return pCurrencyField
         ? ImplCalcDoubleValue( (double)pCurrencyField->GetSpinSize(), pCurrencyField->GetDecimalDigits() )
         : 0;
@@ -6224,7 +6224,7 @@ void VCLXCurrencyField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::st
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     if ( pCurrencyFormatter )
     {
         double n = getValue();
@@ -6237,7 +6237,7 @@ sal_Int16 VCLXCurrencyField::getDecimalDigits() throw(::com::sun::star::uno::Run
 {
     SolarMutexGuard aGuard;
 
-    LongCurrencyFormatter* pCurrencyFormatter = (LongCurrencyFormatter*) GetFormatter();
+    LongCurrencyFormatter* pCurrencyFormatter = static_cast<LongCurrencyFormatter*>(GetFormatter());
     return pCurrencyFormatter ? pCurrencyFormatter->GetDecimalDigits() : 0;
 }
 
@@ -6256,8 +6256,8 @@ void VCLXCurrencyField::setProperty( const OUString& PropertyName, const ::com::
             {
                 if ( bVoid )
                 {
-                    ((LongCurrencyField*)GetWindow())->EnableEmptyFieldValue( true );
-                    ((LongCurrencyField*)GetWindow())->SetEmptyFieldValue();
+                    static_cast<LongCurrencyField*>(GetWindow())->EnableEmptyFieldValue( true );
+                    static_cast<LongCurrencyField*>(GetWindow())->SetEmptyFieldValue();
                 }
                 else
                 {
@@ -6299,14 +6299,14 @@ void VCLXCurrencyField::setProperty( const OUString& PropertyName, const ::com::
             {
                 OUString aString;
                 if ( Value >>= aString )
-                     ((LongCurrencyField*)GetWindow())->SetCurrencySymbol( aString );
+                     static_cast<LongCurrencyField*>(GetWindow())->SetCurrencySymbol( aString );
             }
             break;
             case BASEPROPERTY_NUMSHOWTHOUSANDSEP:
             {
                 bool b = bool();
                 if ( Value >>= b )
-                     ((LongCurrencyField*)GetWindow())->SetUseThousandSep( b );
+                     static_cast<LongCurrencyField*>(GetWindow())->SetUseThousandSep( b );
             }
             break;
             default:
@@ -6350,12 +6350,12 @@ void VCLXCurrencyField::setProperty( const OUString& PropertyName, const ::com::
             break;
             case BASEPROPERTY_CURRENCYSYMBOL:
             {
-                aProp <<= OUString( ((LongCurrencyField*)GetWindow())->GetCurrencySymbol() );
+                aProp <<= OUString( static_cast<LongCurrencyField*>(GetWindow())->GetCurrencySymbol() );
             }
             break;
             case BASEPROPERTY_NUMSHOWTHOUSANDSEP:
             {
-                aProp <<= ((LongCurrencyField*)GetWindow())->IsUseThousandSep();
+                aProp <<= static_cast<LongCurrencyField*>(GetWindow())->IsUseThousandSep();
             }
             break;
             default:
@@ -6427,7 +6427,7 @@ void VCLXPatternField::setMasks( const OUString& EditMask, const OUString& Liter
 {
     SolarMutexGuard aGuard;
 
-    PatternField* pPatternField = (PatternField*) GetWindow();
+    PatternField* pPatternField = static_cast<PatternField*>(GetWindow());
     if ( pPatternField )
     {
         pPatternField->SetMask( OUStringToOString(EditMask, RTL_TEXTENCODING_ASCII_US), LiteralMask );
@@ -6438,7 +6438,7 @@ void VCLXPatternField::getMasks( OUString& EditMask, OUString& LiteralMask ) thr
 {
     SolarMutexGuard aGuard;
 
-    PatternField* pPatternField = (PatternField*) GetWindow();
+    PatternField* pPatternField = static_cast<PatternField*>(GetWindow());
     if ( pPatternField )
     {
         EditMask = OStringToOUString(pPatternField->GetEditMask(), RTL_TEXTENCODING_ASCII_US);
@@ -6450,7 +6450,7 @@ void VCLXPatternField::setString( const OUString& Str ) throw(::com::sun::star::
 {
     SolarMutexGuard aGuard;
 
-    PatternField* pPatternField = (PatternField*) GetWindow();
+    PatternField* pPatternField = static_cast<PatternField*>(GetWindow());
     if ( pPatternField )
     {
         pPatternField->SetString( Str );
@@ -6462,7 +6462,7 @@ OUString VCLXPatternField::getString() throw(::com::sun::star::uno::RuntimeExcep
     SolarMutexGuard aGuard;
 
     OUString aString;
-    PatternField* pPatternField = (PatternField*) GetWindow();
+    PatternField* pPatternField = static_cast<PatternField*>(GetWindow());
     if ( pPatternField )
         aString = pPatternField->GetString();
     return aString;
commit 65b69c44fca13de5bd5fe33eb9b607780ab4b75f
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Sep 26 15:49:58 2014 +0200

    loplugin: cstylecast
    
    Change-Id: I31bbeb5f068754d6dc77c22d759058089b03c9b1

diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index 65ede6d..db16bfd 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -169,7 +169,7 @@ protected:
 public:
             SV_DECL_META_FACTORY1( SvMetaSlot, SvMetaReference, 11 )
             SvMetaObject *  MakeClone() const;
-            SvMetaSlot *Clone() const { return (SvMetaSlot *)MakeClone(); }
+            SvMetaSlot *Clone() const { return static_cast<SvMetaSlot *>(MakeClone()); }
 
             SvMetaSlot();
             SvMetaSlot( SvMetaType * pType );
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index 666d1cb..9cb4f35 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -493,7 +493,7 @@ const SvGlobalName & SvMetaExtern::GetUUId() const
 
 void SvMetaExtern::SetModule( SvIdlDataBase & rBase )
 {
-    pModule = (SvMetaModule *)rBase.GetStack().Get( TYPE( SvMetaModule ) );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list