summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-09-26 15:19:06 +0200
committerNoel Grandin <noel@peralex.com>2014-09-29 12:50:35 +0200
commit0ecf6afbd104b53836c7a4d45fbc2a6ce1e356e0 (patch)
treea1253c850347f9df39254fe9cf82b6ebf39d73f0
parentc353caee1c86476d98cd483f963f63c4195975f4 (diff)
loplugin: cstylecast
Change-Id: Iea517d2287bded4a702c73dfdd1f182023425d67
-rw-r--r--i18npool/source/collator/collator_unicode.cxx2
-rw-r--r--include/svtools/editbrowsebox.hxx9
-rw-r--r--include/svtools/grfmgr.hxx8
-rw-r--r--include/toolkit/awt/vclxwindow.hxx4
-rw-r--r--package/source/xstor/owriteablestream.cxx8
-rw-r--r--package/source/xstor/xstorage.cxx10
-rw-r--r--svtools/source/brwbox/brwbox1.cxx16
-rw-r--r--svtools/source/brwbox/brwbox2.cxx10
-rw-r--r--svtools/source/brwbox/datwin.cxx2
-rw-r--r--svtools/source/brwbox/datwin.hxx2
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx6
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx8
-rw-r--r--svtools/source/contnr/imivctl1.cxx4
-rw-r--r--svtools/source/contnr/simptabl.cxx4
-rw-r--r--svtools/source/contnr/svimpbox.cxx16
-rw-r--r--svtools/source/contnr/svlbitm.cxx6
-rw-r--r--svtools/source/contnr/svtabbx.cxx6
-rw-r--r--svtools/source/contnr/treelist.cxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx40
-rw-r--r--svtools/source/control/ctrlbox.cxx6
-rw-r--r--svtools/source/control/headbar.cxx4
-rw-r--r--svtools/source/control/tabbar.cxx12
-rw-r--r--svtools/source/control/toolbarmenu.cxx6
-rw-r--r--svtools/source/control/toolbarmenuacc.cxx6
-rw-r--r--svtools/source/graphic/grfcache.cxx14
-rw-r--r--svtools/source/graphic/grfmgr.cxx7
-rw-r--r--svtools/source/graphic/grfmgr2.cxx18
-rw-r--r--svtools/source/graphic/provider.cxx2
-rw-r--r--svtools/source/inc/unoiface.hxx2
-rw-r--r--svtools/source/misc/ehdl.cxx6
-rw-r--r--svtools/source/misc/imap.cxx30
-rw-r--r--svtools/source/misc/imap2.cxx12
-rw-r--r--svtools/source/svhtml/htmlout.cxx8
-rw-r--r--svtools/source/svrtf/svparser.cxx6
-rw-r--r--svtools/source/uno/statusbarcontroller.cxx4
-rw-r--r--svtools/source/uno/unoiface.cxx74
-rw-r--r--svtools/source/uno/unoimap.cxx8
-rw-r--r--ucb/source/sorter/sortresult.cxx46
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx2
39 files changed, 221 insertions, 215 deletions
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index d0aef3f5a21f..675b00711f31 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -364,7 +364,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
*/
icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale), rAlgorithm));
// load ICU collator
- collator = (RuleBasedCollator*) icu::Collator::createInstance(icuLocale, status);
+ collator = static_cast<RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) );
if (! U_SUCCESS(status)) throw RuntimeException();
}
}
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index db10afd92f49..cb696925e260 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -27,6 +27,7 @@
#include <vcl/window.hxx>
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/spinfld.hxx>
#include <vcl/button.hxx>
#include <svtools/brwbox.hxx>
@@ -256,7 +257,8 @@ namespace svt
public:
TYPEINFO_OVERRIDE();
SpinCellController(SpinField* pSpinField);
- SpinField& GetSpinWindow() const {return (SpinField &)GetWindow();}
+ const SpinField& GetSpinWindow() const { return static_cast<const SpinField &>(GetWindow()); }
+ SpinField& GetSpinWindow() { return static_cast<SpinField &>(GetWindow()); }
virtual void SetModified() SAL_OVERRIDE;
virtual bool IsModified() const SAL_OVERRIDE;
@@ -342,7 +344,7 @@ namespace svt
TYPEINFO_OVERRIDE();
ComboBoxCellController(ComboBoxControl* pParent);
- ComboBoxControl& GetComboBox() const {return (ComboBoxControl &)GetWindow();}
+ ComboBoxControl& GetComboBox() const { return static_cast<ComboBoxControl &>(GetWindow()); }
virtual bool IsModified() const SAL_OVERRIDE;
virtual void ClearModified() SAL_OVERRIDE;
@@ -375,7 +377,8 @@ namespace svt
TYPEINFO_OVERRIDE();
ListBoxCellController(ListBoxControl* pParent);
- ListBoxControl& GetListBox() const {return (ListBoxControl &)GetWindow();}
+ const ListBoxControl& GetListBox() const { return static_cast<const ListBoxControl &>(GetWindow()); }
+ ListBoxControl& GetListBox() { return static_cast<ListBoxControl &>(GetWindow()); }
virtual bool IsModified() const SAL_OVERRIDE;
virtual void ClearModified() SAL_OVERRIDE;
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 4ef7e10f3b32..bca790be0472 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -33,10 +33,10 @@
// AutoSwap defines
-#define GRFMGR_AUTOSWAPSTREAM_LINK ((SvStream*)0x00000000UL)
-#define GRFMGR_AUTOSWAPSTREAM_LOADED ((SvStream*)0xfffffffdUL)
-#define GRFMGR_AUTOSWAPSTREAM_TEMP ((SvStream*)0xfffffffeUL)
-#define GRFMGR_AUTOSWAPSTREAM_NONE ((SvStream*)0xffffffffUL)
+#define GRFMGR_AUTOSWAPSTREAM_LINK (reinterpret_cast<SvStream*>(0x00000000UL))
+#define GRFMGR_AUTOSWAPSTREAM_LOADED (reinterpret_cast<SvStream*>(0xfffffffdUL))
+#define GRFMGR_AUTOSWAPSTREAM_TEMP (reinterpret_cast<SvStream*>(0xfffffffeUL))
+#define GRFMGR_AUTOSWAPSTREAM_NONE (reinterpret_cast<SvStream*>(0xffffffffUL))
// Adjustment defines
diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx
index f3f1e133bd53..6306ce6717e3 100644
--- a/include/toolkit/awt/vclxwindow.hxx
+++ b/include/toolkit/awt/vclxwindow.hxx
@@ -23,6 +23,7 @@
#include <toolkit/dllapi.h>
#include <toolkit/awt/vclxdevice.hxx>
#include <toolkit/helper/listenermultiplexer.hxx>
+#include <vcl/window.hxx>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
@@ -46,7 +47,6 @@
#include <list>
#include <boost/function.hpp>
-namespace vcl { class Window; }
class VclSimpleEvent;
class VclWindowEvent;
struct SystemParentData;
@@ -129,7 +129,7 @@ public:
virtual ~VCLXWindow();
virtual void SetWindow( vcl::Window* pWindow );
- vcl::Window* GetWindow() const { return (vcl::Window*)GetOutputDevice(); }
+ vcl::Window* GetWindow() const { return static_cast<vcl::Window*>(GetOutputDevice()); }
void suspendVclEventListening( );
void resumeVclEventListening( );
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 22e21d239cd2..e7a1d056e3f2 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -3276,16 +3276,16 @@ void OWriteStream::BroadcastTransaction( sal_Int8 nMessage )
switch( nMessage )
{
case STOR_MESS_PRECOMMIT:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->preCommit( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->preCommit( aSource );
break;
case STOR_MESS_COMMITED:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->commited( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->commited( aSource );
break;
case STOR_MESS_PREREVERT:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->preRevert( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->preRevert( aSource );
break;
case STOR_MESS_REVERTED:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->reverted( aSource );
+ static_cast< embed::XTransactionListener*>( pIterator.next( ) )->reverted( aSource );
break;
}
}
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index d19e9d2c7a9e..3ac32e987694 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -2075,7 +2075,7 @@ void OStorage::BroadcastModifiedIfNecessary()
::cppu::OInterfaceIteratorHelper pIterator( *pContainer );
while ( pIterator.hasMoreElements( ) )
{
- ( ( util::XModifyListener* )pIterator.next( ) )->modified( aSource );
+ static_cast<util::XModifyListener*>( pIterator.next( ) )->modified( aSource );
}
}
}
@@ -2112,16 +2112,16 @@ void OStorage::BroadcastTransaction( sal_Int8 nMessage )
switch( nMessage )
{
case STOR_MESS_PRECOMMIT:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->preCommit( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->preCommit( aSource );
break;
case STOR_MESS_COMMITED:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->commited( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->commited( aSource );
break;
case STOR_MESS_PREREVERT:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->preRevert( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->preRevert( aSource );
break;
case STOR_MESS_REVERTED:
- ( ( embed::XTransactionListener* )pIterator.next( ) )->reverted( aSource );
+ static_cast<embed::XTransactionListener*>( pIterator.next( ) )->reverted( aSource );
break;
}
}
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 3fedada33ca0..bb4b392942d4 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -34,7 +34,7 @@
#define SCROLL_FLAGS (SCROLL_CLIP | SCROLL_NOCHILDREN)
-#define getDataWindow() ((BrowserDataWin*)pDataWin)
+#define getDataWindow() (static_cast<BrowserDataWin*>(pDataWin))
using namespace com::sun::star::accessibility::AccessibleEventId;
using namespace com::sun::star::accessibility::AccessibleTableModelChangeType;
@@ -586,7 +586,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
nMaxWidth -= getDataWindow()->bAutoSizeLastCol
? GetFieldRect(nItemId).Left()
: GetFrozenWidth();
- if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth )
+ if ( static_cast<BrowserDataWin*>(pDataWin )->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth )
{
nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth;
nWidth = QueryColumnResize( nItemId, nWidth );
@@ -642,7 +642,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
getDataWindow()->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (sal_uLong)nOldWidth ), USHRT_MAX );
Control::Invalidate( aInvRect, INVALIDATE_NOCHILDREN );
- ( (BrowserDataWin*)pDataWin )->Invalidate( aInvRect );
+ static_cast<BrowserDataWin*>( pDataWin )->Invalidate( aInvRect );
}
else
{
@@ -2277,7 +2277,7 @@ void BrowseBox::SetMode( BrowserMode nMode )
WB_VSCROLL | ( ( nMode & BROWSER_THUMBDRAGGING ) ? WB_DRAG : 0 );
pVScroll = ( nMode & BROWSER_TRACKING_TIPS ) == BROWSER_TRACKING_TIPS
? new BrowserScrollBar( this, nVScrollWinBits,
- (BrowserDataWin*) pDataWin )
+ static_cast<BrowserDataWin*>( pDataWin ) )
: new ScrollBar( this, nVScrollWinBits );
pVScroll->SetLineSize( 1 );
pVScroll->SetPageSize(1);
@@ -2399,9 +2399,9 @@ BrowserHeader* BrowseBox::CreateHeaderBar( BrowseBox* pParent )
void BrowseBox::SetHeaderBar( BrowserHeader* pHeaderBar )
{
- delete ( (BrowserDataWin*)pDataWin )->pHeaderBar;
- ( (BrowserDataWin*)pDataWin )->pHeaderBar = pHeaderBar;
- ( (BrowserDataWin*)pDataWin )->pHeaderBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) );
+ delete static_cast<BrowserDataWin*>(pDataWin)->pHeaderBar;
+ static_cast<BrowserDataWin*>( pDataWin )->pHeaderBar = pHeaderBar;
+ static_cast<BrowserDataWin*>( pDataWin )->pHeaderBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) );
}
long BrowseBox::GetTitleHeight() const
@@ -2409,7 +2409,7 @@ long BrowseBox::GetTitleHeight() const
long nHeight;
// ask the header bar for the text height (if possible), as the header bar's font is adjusted with
// our (and the header's) zoom factor
- HeaderBar* pHeaderBar = ( (BrowserDataWin*)pDataWin )->pHeaderBar;
+ HeaderBar* pHeaderBar = static_cast<BrowserDataWin*>( pDataWin )->pHeaderBar;
if ( pHeaderBar )
nHeight = pHeaderBar->GetTextHeight();
else
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 74561dab7749..238cfc3317df 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -29,7 +29,7 @@
using namespace ::com::sun::star::datatransfer;
-#define getDataWindow() ((BrowserDataWin*)pDataWin)
+#define getDataWindow() (static_cast<BrowserDataWin*>(pDataWin))
@@ -406,9 +406,9 @@ void BrowseBox::DrawCursor()
{
// on these platforms, the StarView focus works correctly
if ( bReallyHide )
- ((Control*)pDataWin)->HideFocus();
+ static_cast<Control*>(pDataWin)->HideFocus();
else
- ((Control*)pDataWin)->ShowFocus( aCursor );
+ static_cast<Control*>(pDataWin)->ShowFocus( aCursor );
}
else
{
@@ -1125,7 +1125,7 @@ void BrowseBox::UpdateScrollbars()
return;
// protect against recursion
- BrowserDataWin *pBDW = (BrowserDataWin*) pDataWin;
+ BrowserDataWin *pBDW = static_cast<BrowserDataWin*>( pDataWin );
if ( pBDW->bInUpdateScrollbars )
{
pBDW->bHadRecursion = true;
@@ -1545,7 +1545,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
bResizing = false;
}
else
- MouseButtonUp( BrowserMouseEvent( (BrowserDataWin*)pDataWin,
+ MouseButtonUp( BrowserMouseEvent( static_cast<BrowserDataWin*>(pDataWin),
MouseEvent( Point( rEvt.GetPosPixel().X(),
rEvt.GetPosPixel().Y() - pDataWin->GetPosPixel().Y() ),
rEvt.GetClicks(), rEvt.GetMode(), rEvt.GetButtons(),
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 0803feb4a6ce..91bff8b52be8 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -45,7 +45,7 @@ void ButtonFrame::Draw( OutputDevice& rDev )
if( rDev.GetOutDevType() == OUTDEV_WINDOW )
{
- vcl::Window *pWin = (vcl::Window*) &rDev;
+ vcl::Window *pWin = static_cast<vcl::Window*>( &rDev );
if( bPressed )
pWin->DrawSelectionBackground( aRect, 0, true, false, false );
}
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index 27cc8e1c44a8..e9644ffed580 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -162,7 +162,7 @@ public:
BrowseEvent CreateBrowseEvent( const Point& rPosPixel );
void Repaint();
BrowseBox* GetParent() const
- { return (BrowseBox*) Window::GetParent(); }
+ { return static_cast<BrowseBox*>( Window::GetParent() ); }
const OUString& GetRealRowCount() const { return aRealRowCount; }
void SetUpdateMode( bool bMode );
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 26807c03cdb3..86281790a647 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -202,7 +202,7 @@ namespace svt
bool ListBoxCellController::MoveAllowed(const KeyEvent& rEvt) const
{
- ListBoxControl& rBox = GetListBox();
+ const ListBoxControl& rBox = GetListBox();
switch (rEvt.GetKeyCode().GetCode())
{
case KEY_UP:
@@ -349,7 +349,7 @@ namespace svt
CheckBox& CheckBoxCellController::GetCheckBox() const
{
- return ((CheckBoxControl &)GetWindow()).GetBox();
+ return static_cast<CheckBoxControl &>(GetWindow()).GetBox();
}
@@ -367,7 +367,7 @@ namespace svt
void CheckBoxCellController::SetModifyHdl(const Link& rLink)
{
- ((CheckBoxControl &)GetWindow()).SetModifyHdl(rLink);
+ static_cast<CheckBoxControl &>(GetWindow()).SetModifyHdl(rLink);
}
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 4e7d6efc9ee2..73eb1c3ff76b 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -77,11 +77,11 @@ namespace svt
sal_uInt16 nColId = GetCurItemId();
if (nColId)
{
- sal_uInt32 nAutoWidth = ((EditBrowseBox*)GetParent())->GetAutoColumnWidth(nColId);
- if (nAutoWidth != ((EditBrowseBox*)GetParent())->GetColumnWidth(nColId))
+ sal_uInt32 nAutoWidth = static_cast<EditBrowseBox*>(GetParent())->GetAutoColumnWidth(nColId);
+ if (nAutoWidth != static_cast<EditBrowseBox*>(GetParent())->GetColumnWidth(nColId))
{
- ((EditBrowseBox*)GetParent())->SetColumnWidth(nColId, nAutoWidth);
- ((EditBrowseBox*)GetParent())->ColumnResized(nColId);
+ static_cast<EditBrowseBox*>(GetParent())->SetColumnWidth(nColId, nAutoWidth);
+ static_cast<EditBrowseBox*>(GetParent())->ColumnResized(nColId);
}
}
}
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 0c39c577f24b..6e7b1fcc6ae0 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -47,8 +47,8 @@
#define DRAWTEXT_FLAGS_SMALLICON (TEXT_DRAW_LEFT|TEXT_DRAW_ENDELLIPSIS|TEXT_DRAW_CLIP)
-#define EVENTID_SHOW_CURSOR ((void*)1)
-#define EVENTID_ADJUST_SCROLLBARS ((void*)2)
+#define EVENTID_SHOW_CURSOR (reinterpret_cast<void*>(1))
+#define EVENTID_ADJUST_SCROLLBARS (reinterpret_cast<void*>(2))
static bool bEndScrollInvalidate = true;
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 3de35c3f8e9d..f5755bdc7875 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -451,8 +451,8 @@ sal_Int32 SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRig
IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
- nCompare = pCollator->compareString( ((SvLBoxString*)pLeftItem)->GetText(),
- ((SvLBoxString*)pRightItem)->GetText());
+ nCompare = pCollator->compareString( static_cast<SvLBoxString*>(pLeftItem)->GetText(),
+ static_cast<SvLBoxString*>(pRightItem)->GetText());
if (nCompare == 0)
nCompare = -1;
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index e0718ac6b127..26514755de0b 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -405,7 +405,7 @@ void SvImpLBox::PageDown( sal_uInt16 nDelta )
return;
SvTreeListEntry* pNext = pView->NextVisible(pStartEntry, nRealDelta);
- if( (sal_uLong)pNext == (sal_uLong)pStartEntry )
+ if( pNext == pStartEntry )
return;
ShowCursor( false );
@@ -445,7 +445,7 @@ void SvImpLBox::PageUp( sal_uInt16 nDelta )
return;
SvTreeListEntry* pPrev = pView->PrevVisible(pStartEntry, nRealDelta);
- if( (sal_uLong)pPrev == (sal_uLong)pStartEntry )
+ if( pPrev == pStartEntry )
return;
nFlags &= (~F_FILLING);
@@ -807,7 +807,7 @@ bool SvImpLBox::EntryReallyHit(SvTreeListEntry* pEntry, const Point& rPosPixel,
Rectangle aRect( pView->GetFocusRect( pEntry, nLine ));
aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X();
- SvLBoxContextBmp* pBmp = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pBmp = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
aRect.Left() -= pBmp->GetSize(pView,pEntry).Width();
aRect.Left() -= 4; // a little tolerance
@@ -907,7 +907,7 @@ void SvImpLBox::Paint( const Rectangle& rRect )
aVerSBar.SetThumbPos( 0 );
StopUserEvent();
ShowCursor( true );
- nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)1);
+ nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent), reinterpret_cast<void*>(1));
return;
}
}
@@ -1906,7 +1906,7 @@ bool SvImpLBox::ButtonDownCheckCtrl(
SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab);
if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
{
- pActiveButton = (SvLBoxButton*)pItem;
+ pActiveButton = static_cast<SvLBoxButton*>(pItem);
pActiveEntry = pEntry;
if( pCursor == pActiveEntry )
pView->HideFocus();
@@ -2338,7 +2338,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( nDelta )
{
- DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?");
+ DBG_ASSERT(pNewCursor && pNewCursor!=pCursor, "Cursor?");
aSelEng.CursorPosChanging( bShift, bMod1 );
if( IsEntryInView( pNewCursor ) )
SetCursor( pNewCursor );
@@ -2366,7 +2366,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( nDelta && pNewCursor )
{
- DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?");
+ DBG_ASSERT(pNewCursor && pNewCursor!=pCursor, "Cursor?");
aSelEng.CursorPosChanging( bShift, bMod1 );
if( IsEntryInView( pNewCursor ) )
SetCursor( pNewCursor );
@@ -3190,7 +3190,7 @@ bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
{
// recalculate text rectangle
SvLBoxTab* pTab;
- SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab ));
+ SvLBoxString* pItem = static_cast<SvLBoxString*>(pView->GetItem( pEntry, aPos.X(), &pTab ));
if (!pItem || pItem->GetType() != SV_ITEM_ID_LBOXSTRING)
return false;
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 82d59421e57e..affd9de43b2f 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -221,7 +221,7 @@ SvLBoxItem* SvLBoxString::Create() const
void SvLBoxString::Clone( SvLBoxItem* pSource )
{
- maText = ((SvLBoxString*)pSource)->maText;
+ maText = static_cast<SvLBoxString*>(pSource)->maText;
}
void SvLBoxString::InitViewData(
@@ -291,7 +291,7 @@ SvLBoxItem* SvLBoxBmp::Create() const
void SvLBoxBmp::Clone( SvLBoxItem* pSource )
{
- aBmp = ((SvLBoxBmp*)pSource)->aBmp;
+ aBmp = static_cast<SvLBoxBmp*>(pSource)->aBmp;
}
// ***************************************************************
@@ -393,7 +393,7 @@ SvLBoxItem* SvLBoxButton::Create() const
void SvLBoxButton::Clone( SvLBoxItem* pSource )
{
- pData = ((SvLBoxButton*)pSource)->pData;
+ pData = static_cast<SvLBoxButton*>(pSource)->pData;
}
void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, vcl::Window* i_pParent )
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index b71fca5b646d..266b195f01eb 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -315,7 +315,7 @@ void SvTabListBox::SetEntryText(const OUString& rStr, SvTreeListEntry* pEntry, s
if (!nCol || nCol==0xFFFF)
{
const OUString aTemp(GetToken(rStr, nIndex));
- ((SvLBoxString*)pStr)->SetText( aTemp );
+ static_cast<SvLBoxString*>(pStr)->SetText( aTemp );
if (!nCol && nIndex<0)
break;
}
@@ -551,7 +551,7 @@ void SvHeaderTabListBox::InitHeaderBar( HeaderBar* pHeaderBar )
bool SvHeaderTabListBox::IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const
{
SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( nCol + 1 ) );
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>( pEntry->GetItem( nCol + 1 ) );
if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
{
@@ -683,7 +683,7 @@ bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriSta
sal_uInt16 nItemCount = pEntry->ItemCount();
if ( nItemCount > ( _nColumn + 1 ) )
{
- SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( _nColumn + 1 ) );
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>( pEntry->GetItem( _nColumn + 1 ) );
if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
{
bRet = true;
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index a8830a6587c3..087496cb3037 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -353,7 +353,7 @@ void SvTreeList::InsertTree(SvTreeListEntry* pSrcEntry,
SvTreeListEntry* SvTreeList::CloneEntry( SvTreeListEntry* pSource ) const
{
if( aCloneLink.IsSet() )
- return (SvTreeListEntry*)aCloneLink.Call( pSource );
+ return reinterpret_cast<SvTreeListEntry*>(aCloneLink.Call( pSource ));
SvTreeListEntry* pEntry = CreateEntry();
pSource->Clone( pEntry );
return pSource;
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index a1e51b4a1768..faa3367e13ee 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -461,7 +461,7 @@ bool SvTreeListBox::IsEntryMnemonicsEnabled() const
IMPL_LINK_INLINE_START( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry )
{
- return (sal_IntPtr)(CloneEntry((SvTreeListEntry*)pEntry));
+ return reinterpret_cast<sal_IntPtr>(CloneEntry((SvTreeListEntry*)pEntry));
}
IMPL_LINK_INLINE_END( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry )
@@ -634,7 +634,7 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar
nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying
bool bSuccess = true;
std::vector<SvTreeListEntry*> aList;
- bool bClone = ( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
+ bool bClone = ( pSource->GetModel() != GetModel() );
Link aCloneLink( pModel->GetCloneLink() );
pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
@@ -691,7 +691,7 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S
nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying
bool bSuccess = true;
std::vector<SvTreeListEntry*> aList;
- bool bClone = ( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
+ bool bClone = ( pSource->GetModel() != GetModel() );
Link aCloneLink( pModel->GetCloneLink() );
if ( bClone )
pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
@@ -1390,19 +1390,19 @@ namespace
void SvTreeListBox::AddBoxToDDList_Impl( const SvTreeListBox& rB )
{
- sal_uLong nVal = (sal_uLong)&rB;
+ sal_uLong nVal = reinterpret_cast<sal_uLong>(&rB);
SortLBoxes::get().insert( nVal );
}
void SvTreeListBox::RemoveBoxFromDDList_Impl( const SvTreeListBox& rB )
{
- sal_uLong nVal = (sal_uLong)&rB;
+ sal_uLong nVal = reinterpret_cast<sal_uLong>(&rB);
SortLBoxes::get().erase( nVal );
}
IMPL_STATIC_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8*, pAction )
{
- sal_uLong nVal = (sal_uLong)pThis;
+ sal_uLong nVal = reinterpret_cast<sal_uLong>(pThis);
std::set<sal_uLong> &rSortLBoxes = SortLBoxes::get();
std::set<sal_uLong>::const_iterator it = rSortLBoxes.find(nVal);
if( it != rSortLBoxes.end() )
@@ -1776,7 +1776,7 @@ void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry,
OUString SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const
{
DBG_ASSERT( pEntry, "SvTreeListBox::GetEntryText(): no entry" );
- SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxString* pItem = static_cast<SvLBoxString*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
DBG_ASSERT( pEntry, "SvTreeListBox::GetEntryText(): item not found" );
return pItem->GetText();
}
@@ -1870,7 +1870,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText,
void SvTreeListBox::SetEntryText(SvTreeListEntry* pEntry, const OUString& rStr)
{
- SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxString* pItem = static_cast<SvLBoxString*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
DBG_ASSERT(pItem,"SetText:Item not found");
pItem->SetText(rStr);
pItem->InitViewData( this, pEntry, 0 );
@@ -1879,7 +1879,7 @@ void SvTreeListBox::SetEntryText(SvTreeListEntry* pEntry, const OUString& rStr)
void SvTreeListBox::SetExpandedEntryBmp( SvTreeListEntry* pEntry, const Image& aBmp )
{
- SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pItem = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
DBG_ASSERT(pItem,"SetExpBmp:Item not found");
pItem->SetBitmap2( aBmp );
@@ -1897,7 +1897,7 @@ void SvTreeListBox::SetExpandedEntryBmp( SvTreeListEntry* pEntry, const Image& a
void SvTreeListBox::SetCollapsedEntryBmp(SvTreeListEntry* pEntry,const Image& aBmp )
{
- SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pItem = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
DBG_ASSERT(pItem,"SetExpBmp:Item not found");
pItem->SetBitmap1( aBmp );
@@ -1945,7 +1945,7 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
if( nTreeFlags & TREEFLAG_CHKBTN )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if( pItem )
{
long nWidth = pItem->GetSize(this, pEntry).Width();
@@ -1964,7 +1964,7 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState
{
if( nTreeFlags & TREEFLAG_CHKBTN )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if(!(pItem && pItem->CheckModification()))
return ;
switch( eState )
@@ -1989,7 +1989,7 @@ void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry)
{
if( nTreeFlags & TREEFLAG_CHKBTN )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
pItem->SetStateInvisible();
InvalidateEntry( pEntry );
}
@@ -2000,7 +2000,7 @@ SvButtonState SvTreeListBox::GetCheckButtonState( SvTreeListEntry* pEntry ) cons
SvButtonState eState = SV_BUTTON_UNCHECKED;
if( nTreeFlags & TREEFLAG_CHKBTN )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if(!pItem)
return SV_BUTTON_TRISTATE;
sal_uInt16 nButtonFlags = pItem->GetButtonFlags();
@@ -2030,16 +2030,16 @@ SvTreeListEntry* SvTreeListBox::CloneEntry( SvTreeListEntry* pSource )
Image aExpEntryBmp;
SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox;
- SvLBoxString* pStringItem = (SvLBoxString*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxString* pStringItem = static_cast<SvLBoxString*>(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
if( pStringItem )
aStr = pStringItem->GetText();
- SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pBmpItem = static_cast<SvLBoxContextBmp*>(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
if( pBmpItem )
{
aCollEntryBmp = pBmpItem->GetBitmap1( );
aExpEntryBmp = pBmpItem->GetBitmap2( );
}
- SvLBoxButton* pButtonItem = (SvLBoxButton*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pButtonItem = static_cast<SvLBoxButton*>(pSource->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if( pButtonItem )
eButtonKind = pButtonItem->GetKind();
SvTreeListEntry* pClone = CreateEntry();
@@ -2771,7 +2771,7 @@ void SvTreeListBox::EditedText( const OUString& rStr )
{
if( EditedEntry( pEdEntry, rStr ) )
{
- ((SvLBoxString*)pEdItem)->SetText( rStr );
+ static_cast<SvLBoxString*>(pEdItem)->SetText( rStr );
pModel->InvalidateEntry( pEdEntry );
}
if( GetSelectionCount() == 0 )
@@ -3598,8 +3598,8 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData )
{
const SvTreeListEntry* pLeft = pData->pLeft;
const SvTreeListEntry* pRight = pData->pRight;
- OUString aLeft( ((SvLBoxString*)(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
- OUString aRight( ((SvLBoxString*)(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
+ OUString aLeft( static_cast<const SvLBoxString*>(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING))->GetText());
+ OUString aRight( static_cast<const SvLBoxString*>(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING))->GetText());
pImp->UpdateStringSorter();
return pImp->m_pStringSorter->compare(aLeft, aRight);
}
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index a51de50c1963..c83db0b4a1d5 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1692,7 +1692,7 @@ void FontSizeBox::Fill( const vcl::FontInfo* pInfo, const FontList* pList )
OUString aSizeName = aFontSizeNames.GetIndexName( i );
sal_IntPtr nSize = aFontSizeNames.GetIndexSize( i );
ComboBox::InsertEntry( aSizeName, nPos );
- ComboBox::SetEntryData( nPos, (void*)(-nSize) ); // mark as special
+ ComboBox::SetEntryData( nPos, reinterpret_cast<void*>(-nSize) ); // mark as special
nPos++;
}
}
@@ -1706,7 +1706,7 @@ void FontSizeBox::Fill( const vcl::FontInfo* pInfo, const FontList* pList )
if ( !aSizeName.isEmpty() )
{
ComboBox::InsertEntry( aSizeName, nPos );
- ComboBox::SetEntryData( nPos, (void*)(-(*pTempAry)) ); // mark as special
+ ComboBox::SetEntryData( nPos, reinterpret_cast<void*>(-(*pTempAry)) ); // mark as special
nPos++;
}
pTempAry++;
@@ -1719,7 +1719,7 @@ void FontSizeBox::Fill( const vcl::FontInfo* pInfo, const FontList* pList )
while ( *pTempAry )
{
InsertValue( *pTempAry, FUNIT_NONE, nPos );
- ComboBox::SetEntryData( nPos, (void*)(*pTempAry) );
+ ComboBox::SetEntryData( nPos, reinterpret_cast<void*>(*pTempAry) );
nPos++;
pTempAry++;
}
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 5f513e6e0220..0e305155723a 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -303,7 +303,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
const Rectangle* pRect,
sal_uLong )
{
- vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? (vcl::Window*) pDev : NULL;
+ vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : NULL;
ImplControlValue aControlValue(0);
Rectangle aCtrlRegion;
ControlState nState(0);
@@ -1553,7 +1553,7 @@ void HeaderBar::SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::sta
if ( !xPeer.is() && bCreate )
{
::com::sun::star::awt::XWindowPeer* mxPeer = new VCLXHeaderBar(this);
- m_pVCLXHeaderBar = (VCLXHeaderBar*)(mxPeer);
+ m_pVCLXHeaderBar = static_cast<VCLXHeaderBar*>(mxPeer);
SetComponentInterface(mxPeer);
return mxPeer;
}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 7dd15b0d55e1..cf7fafc6dcb2 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -95,7 +95,7 @@ public:
ImplTabButton( TabBar* pParent, WinBits nWinStyle = 0 ) :
PushButton( pParent, nWinStyle | WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOLIGHTBORDER | WB_NOPOINTERFOCUS ) {}
- TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
+ TabBar* GetParent() const { return static_cast<TabBar*>(Window::GetParent()); }
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -147,7 +147,7 @@ class ImplTabSizer : public vcl::Window
public:
ImplTabSizer( TabBar* pParent, WinBits nWinStyle = 0 );
- TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
+ TabBar* GetParent() const { return static_cast<TabBar*>(Window::GetParent()); }
private:
void ImplTrack( const Point& rScreenPos );
@@ -254,7 +254,7 @@ private:
public:
TabBarEdit( TabBar* pParent, WinBits nWinStyle = 0 );
- TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
+ TabBar* GetParent() const { return static_cast<TabBar*>(Window::GetParent()); }
void SetPostEvent() { mbPostEvt = true; }
void ResetPostEvent() { mbPostEvt = false; }
@@ -284,7 +284,7 @@ bool TabBarEdit::PreNotify( NotifyEvent& rNEvt )
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) )
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), reinterpret_cast<void*>(sal_False) ) )
mbPostEvt = true;
}
return true;
@@ -293,7 +293,7 @@ bool TabBarEdit::PreNotify( NotifyEvent& rNEvt )
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_True ) )
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), reinterpret_cast<void*>(sal_True) ) )
mbPostEvt = true;
}
return true;
@@ -310,7 +310,7 @@ void TabBarEdit::LoseFocus()
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) )
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), reinterpret_cast<void*>(sal_False) ) )
mbPostEvt = true;
}
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index fb03917624d5..b28a9e4953e9 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -53,7 +53,7 @@ static vcl::Window* GetTopMostParentSystemWindow( vcl::Window* pWindow )
while ( pWindow )
{
if ( pWindow->IsSystemWindow() )
- pTopMostSysWin = (SystemWindow*)pWindow;
+ pTopMostSysWin = static_cast<SystemWindow*>(pWindow);
pWindow = pWindow->GetParent();
}
pWindow = pTopMostSysWin;
@@ -464,7 +464,7 @@ void ToolbarMenu::implInit(const Reference< XFrame >& rFrame)
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
+ static_cast<SystemWindow*>(pWindow)->GetTaskPaneList()->AddWindow( this );
}
@@ -473,7 +473,7 @@ ToolbarMenu::~ToolbarMenu()
{
vcl::Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
- ((SystemWindow *)pWindow)->GetTaskPaneList()->RemoveWindow( this );
+ static_cast<SystemWindow*>(pWindow)->GetTaskPaneList()->RemoveWindow( this );
if ( mpImpl->mxStatusListener.is() )
{
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 2464694faa0c..8aab2122293b 100644
--- a/svtools/source/control/toolbarmenuacc.cxx
+++ b/svtools/source/control/toolbarmenuacc.cxx
@@ -71,10 +71,10 @@ IMPL_LINK( ToolbarMenuAcc, WindowEventListener, VclSimpleEvent*, pEvent )
*/
if ( mpParent && pEvent && pEvent->ISA( VclWindowEvent ) && (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;
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 72fdc3a6ec9a..ca4347e5e6c5 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -564,7 +564,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
case META_BMP_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpAction* pAction = (MetaBmpAction*)pAct;
+ MetaBmpAction* pAction = static_cast<MetaBmpAction*>(pAct);
checkMetadataBitmap(
BitmapEx( pAction->GetBitmap()),
@@ -581,7 +581,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
case META_BMPSCALE_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpScaleAction* pAction = (MetaBmpScaleAction*)pAct;
+ MetaBmpScaleAction* pAction = static_cast<MetaBmpScaleAction*>(pAct);
checkMetadataBitmap(
BitmapEx( pAction->GetBitmap()),
@@ -599,7 +599,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
case META_BMPSCALEPART_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpScalePartAction* pAction = (MetaBmpScalePartAction*)pAct;
+ MetaBmpScalePartAction* pAction = static_cast<MetaBmpScalePartAction*>(pAct);
checkMetadataBitmap( BitmapEx( pAction->GetBitmap() ),
pAction->GetSrcPoint(),
@@ -617,7 +617,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
case META_BMPEX_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpExAction* pAction = (MetaBmpExAction*)pAct;
+ MetaBmpExAction* pAction = static_cast<MetaBmpExAction*>(pAct);
checkMetadataBitmap(
pAction->GetBitmapEx(),
@@ -634,7 +634,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
case META_BMPEXSCALE_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpExScaleAction* pAction = (MetaBmpExScaleAction*)pAct;
+ MetaBmpExScaleAction* pAction = static_cast<MetaBmpExScaleAction*>(pAct);
checkMetadataBitmap(
pAction->GetBitmapEx(),
@@ -652,7 +652,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
case META_BMPEXSCALEPART_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpExScalePartAction* pAction = (MetaBmpExScalePartAction*)pAct;
+ MetaBmpExScalePartAction* pAction = static_cast<MetaBmpExScalePartAction*>(pAct);
checkMetadataBitmap( pAction->GetBitmapEx(),
pAction->GetSrcPoint(),
@@ -670,7 +670,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
// these actions actually output something (that's
// different from a bitmap)
case META_RASTEROP_ACTION:
- if( ((MetaRasterOpAction*)pAct)->GetRasterOp() == ROP_OVERPAINT )
+ if( static_cast<MetaRasterOpAction*>(pAct)->GetRasterOp() == ROP_OVERPAINT )
break;
// FALLTHROUGH intended
case META_PIXEL_ACTION:
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 32539dca9279..ed55e0932e53 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -377,7 +377,7 @@ void GraphicObject::Save( SvStream& rOStm )
void GraphicObject::Assign( const SvDataCopyStream& rCopyStream )
{
- *this = (const GraphicObject& ) rCopyStream;
+ *this = static_cast<const GraphicObject&>(rCopyStream);
}
OString GraphicObject::GetUniqueID() const
@@ -395,7 +395,10 @@ OString GraphicObject::GetUniqueID() const
SvStream* GraphicObject::GetSwapStream() const
{
- return( HasSwapStreamHdl() ? (SvStream*) mpSwapStreamHdl->Call( (void*) this ) : GRFMGR_AUTOSWAPSTREAM_NONE );
+ if( HasSwapStreamHdl() )
+ return reinterpret_cast<SvStream*>( mpSwapStreamHdl->Call( const_cast<void*>(reinterpret_cast<const void*>(this)) ) );
+ else
+ return GRFMGR_AUTOSWAPSTREAM_NONE;
}
void GraphicObject::SetAttr( const GraphicAttr& rAttr )
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index be2a12e09dfc..00c89b36b425 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -945,7 +945,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
if( pOutputDevice->GetOutDevType() == OUTDEV_WINDOW )
{
- const Region aPaintRgn( ( (vcl::Window*) pOutputDevice )->GetPaintRegion() );
+ const Region aPaintRgn( static_cast<vcl::Window*>( pOutputDevice )->GetPaintRegion() );
if( !aPaintRgn.IsNull() )
aOutRect.Intersection( pOutputDevice->LogicToPixel( aPaintRgn.GetBoundRect() ) );
}
@@ -1160,7 +1160,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_FONT_ACTION:
{
// taking care of font width default if scaling metafile.
- MetaFontAction* pA = (MetaFontAction*)pAct;
+ MetaFontAction* pA = static_cast<MetaFontAction*>(pAct);
vcl::Font aFont( pA->GetFont() );
if ( !aFont.GetWidth() )
{
@@ -1204,7 +1204,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_BMP_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpAction* pAction = (MetaBmpAction*)pAct;
+ MetaBmpAction* pAction = static_cast<MetaBmpAction*>(pAct);
rOutBmpEx = checkMetadataBitmap(
BitmapEx( pAction->GetBitmap()),
@@ -1221,7 +1221,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_BMPSCALE_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpScaleAction* pAction = (MetaBmpScaleAction*)pAct;
+ MetaBmpScaleAction* pAction = static_cast<MetaBmpScaleAction*>(pAct);
rOutBmpEx = checkMetadataBitmap(
BitmapEx( pAction->GetBitmap()),
@@ -1239,7 +1239,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_BMPSCALEPART_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpScalePartAction* pAction = (MetaBmpScalePartAction*)pAct;
+ MetaBmpScalePartAction* pAction = static_cast<MetaBmpScalePartAction*>(pAct);
rOutBmpEx = checkMetadataBitmap(
BitmapEx( pAction->GetBitmap() ),
@@ -1258,7 +1258,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_BMPEX_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpExAction* pAction = (MetaBmpExAction*)pAct;
+ MetaBmpExAction* pAction = static_cast<MetaBmpExAction*>(pAct);
rOutBmpEx = checkMetadataBitmap(
pAction->GetBitmapEx(),
@@ -1275,7 +1275,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_BMPEXSCALE_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpExScaleAction* pAction = (MetaBmpExScaleAction*)pAct;
+ MetaBmpExScaleAction* pAction = static_cast<MetaBmpExScaleAction*>(pAct);
rOutBmpEx = checkMetadataBitmap(
pAction->GetBitmapEx(),
@@ -1293,7 +1293,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
case META_BMPEXSCALEPART_ACTION:
if( !nNumBitmaps && !bNonBitmapActionEncountered )
{
- MetaBmpExScalePartAction* pAction = (MetaBmpExScalePartAction*)pAct;
+ MetaBmpExScalePartAction* pAction = static_cast<MetaBmpExScalePartAction*>(pAct);
rOutBmpEx = checkMetadataBitmap( pAction->GetBitmapEx(),
pAction->GetSrcPoint(),
@@ -1311,7 +1311,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
// these actions actually output something (that's
// different from a bitmap)
case META_RASTEROP_ACTION:
- if( ((MetaRasterOpAction*)pAct)->GetRasterOp() == ROP_OVERPAINT )
+ if( static_cast<MetaRasterOpAction*>(pAct)->GetRasterOp() == ROP_OVERPAINT )
break;
// FALLTHROUGH intended
case META_PIXEL_ACTION:
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index c21577be0c7f..c8f35378fb6d 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -658,7 +658,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
}
case( META_PUSH_ACTION ):
{
- const MetaPushAction* pA = (const MetaPushAction*)pAction;
+ const MetaPushAction* pA = static_cast<const MetaPushAction*>(pAction);
aDummyVDev.Push( pA->GetFlags() );
break;
}
diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx
index 36588b1b65c0..8a5865a13047 100644
--- a/svtools/source/inc/unoiface.hxx
+++ b/svtools/source/inc/unoiface.hxx
@@ -176,7 +176,7 @@ protected:
sal_Int32 nKeyToSetDelayed;
- FormattedField* GetFormattedField() const { return (FormattedField*)GetWindow(); }
+ FormattedField* GetFormattedField() const { return static_cast<FormattedField*>(GetWindow()); }
public:
SVTXFormattedField();
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 1be2f4e05f26..05d8b3a75bb6 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -283,7 +283,7 @@ bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const
ErrorResource_Impl aEr(aId, (sal_uInt16)lClassId);
if(aEr)
{
- rStr=((ResString)aEr).GetString();
+ rStr = static_cast<ResString>(aEr).GetString();
bRet = true;
}
}
@@ -414,7 +414,7 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
ErrorResource_Impl aTestEr( aResId, nCtxId );
if ( aTestEr )
{
- rStr = ( (ResString)aTestEr ).GetString();
+ rStr = static_cast<ResString>(aTestEr).GetString();
rStr = rStr.replaceAll(OUString("$(ARG1)"), aArg1 );
bRet = true;
}
@@ -429,7 +429,7 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
ResId aSfxResId( RID_ERRCTX, *pMgr );
ErrorResource_Impl aEr( aSfxResId, nId );
- rStr = rStr.replaceAll( OUString("$(ERR)"), ( (ResString)aEr ).GetString() );
+ rStr = rStr.replaceAll( OUString("$(ERR)"), static_cast<ResString>(aEr).GetString() );
}
}
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 05fbeafb28f4..705021afe3fb 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -584,15 +584,15 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
switch( pCopyObj->GetType() )
{
case( IMAP_OBJ_RECTANGLE ):
- maList.push_back( new IMapRectangleObject( *(IMapRectangleObject*) pCopyObj ) );
+ maList.push_back( new IMapRectangleObject( *static_cast<IMapRectangleObject*>( pCopyObj ) ) );
break;
case( IMAP_OBJ_CIRCLE ):
- maList.push_back( new IMapCircleObject( *(IMapCircleObject*) pCopyObj ) );
+ maList.push_back( new IMapCircleObject( *static_cast<IMapCircleObject*>( pCopyObj ) ) );
break;
case( IMAP_OBJ_POLYGON ):
- maList.push_back( new IMapPolygonObject( *(IMapPolygonObject*) pCopyObj ) );
+ maList.push_back( new IMapPolygonObject( *static_cast<IMapPolygonObject*>( pCopyObj ) ) );
break;
default:
@@ -652,15 +652,15 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
switch( pCopyObj->GetType() )
{
case( IMAP_OBJ_RECTANGLE ):
- maList.push_back( new IMapRectangleObject( *(IMapRectangleObject*) pCopyObj ) );
+ maList.push_back( new IMapRectangleObject( *static_cast<IMapRectangleObject*>(pCopyObj) ) );
break;
case( IMAP_OBJ_CIRCLE ):
- maList.push_back( new IMapCircleObject( *(IMapCircleObject*) pCopyObj ) );
+ maList.push_back( new IMapCircleObject( *static_cast<IMapCircleObject*>(pCopyObj) ) );
break;
case( IMAP_OBJ_POLYGON ):
- maList.push_back( new IMapPolygonObject( *(IMapPolygonObject*) pCopyObj ) );
+ maList.push_back( new IMapPolygonObject( *static_cast<IMapPolygonObject*>(pCopyObj) ) );
break;
default:
@@ -701,21 +701,21 @@ bool ImageMap::operator==( const ImageMap& rImageMap )
{
case( IMAP_OBJ_RECTANGLE ):
{
- if ( !( (IMapRectangleObject*) pObj )->IsEqual( *(IMapRectangleObject*) pEqObj ) )
+ if ( !( static_cast<IMapRectangleObject*>(pObj) )->IsEqual( *static_cast<IMapRectangleObject*>(pEqObj) ) )
bDifferent = true;
}
break;
case( IMAP_OBJ_CIRCLE ):
{
- if ( !( (IMapCircleObject*) pObj )->IsEqual( *(IMapCircleObject*) pEqObj ) )
+ if ( !( static_cast<IMapCircleObject*>(pObj) )->IsEqual( *static_cast<IMapCircleObject*>(pEqObj) ) )
bDifferent = true;
}
break;
case( IMAP_OBJ_POLYGON ):
{
- if ( !( (IMapPolygonObject*) pObj )->IsEqual( *(IMapPolygonObject*) pEqObj ) )
+ if ( !( static_cast<IMapPolygonObject*>(pObj) )->IsEqual( *static_cast<IMapPolygonObject*>(pEqObj) ) )
bDifferent = true;
}
break;
@@ -771,15 +771,15 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject )
switch( rIMapObject.GetType() )
{
case( IMAP_OBJ_RECTANGLE ):
- maList.push_back( new IMapRectangleObject( (IMapRectangleObject&) rIMapObject ) );
+ maList.push_back( new IMapRectangleObject( static_cast<const IMapRectangleObject&>( rIMapObject ) ) );
break;
case( IMAP_OBJ_CIRCLE ):
- maList.push_back( new IMapCircleObject( (IMapCircleObject&) rIMapObject ) );
+ maList.push_back( new IMapCircleObject( static_cast<const IMapCircleObject&>( rIMapObject ) ) );
break;
case( IMAP_OBJ_POLYGON ):
- maList.push_back( new IMapPolygonObject( (IMapPolygonObject&) rIMapObject ) );
+ maList.push_back( new IMapPolygonObject( static_cast<const IMapPolygonObject&>( rIMapObject ) ) );
break;
default:
@@ -835,15 +835,15 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY )
switch( pObj->GetType() )
{
case( IMAP_OBJ_RECTANGLE ):
- ( (IMapRectangleObject*) pObj )->Scale( rFracX, rFracY );
+ static_cast<IMapRectangleObject*>( pObj )->Scale( rFracX, rFracY );
break;
case( IMAP_OBJ_CIRCLE ):
- ( (IMapCircleObject*) pObj )->Scale( rFracX, rFracY );
+ static_cast<IMapCircleObject*>( pObj )->Scale( rFracX, rFracY );
break;
case( IMAP_OBJ_POLYGON ):
- ( (IMapPolygonObject*) pObj )->Scale( rFracX, rFracY );
+ static_cast<IMapPolygonObject*>( pObj )->Scale( rFracX, rFracY );
break;
default:
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 14e67b100f3a..3164f8a57e36 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -167,15 +167,15 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const
switch( pObj->GetType() )
{
case( IMAP_OBJ_RECTANGLE ):
- ( (IMapRectangleObject*) pObj )->WriteCERN( rOStm, rBaseURL );
+ static_cast<IMapRectangleObject*>( pObj )->WriteCERN( rOStm, rBaseURL );
break;
case( IMAP_OBJ_CIRCLE ):
- ( (IMapCircleObject*) pObj )->WriteCERN( rOStm, rBaseURL );
+ static_cast<IMapCircleObject*>( pObj )->WriteCERN( rOStm, rBaseURL );
break;
case( IMAP_OBJ_POLYGON ):
- ( (IMapPolygonObject*) pObj )->WriteCERN( rOStm, rBaseURL );
+ static_cast<IMapPolygonObject*>( pObj )->WriteCERN( rOStm, rBaseURL );
break;
default:
@@ -196,15 +196,15 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const
switch( pObj->GetType() )
{
case( IMAP_OBJ_RECTANGLE ):
- ( (IMapRectangleObject*) pObj )->WriteNCSA( rOStm, rBaseURL );
+ static_cast<IMapRectangleObject*>( pObj )->WriteNCSA( rOStm, rBaseURL );
break;
case( IMAP_OBJ_CIRCLE ):
- ( (IMapCircleObject*) pObj )->WriteNCSA( rOStm, rBaseURL );
+ static_cast<IMapCircleObject*>( pObj )->WriteNCSA( rOStm, rBaseURL );
break;
case( IMAP_OBJ_POLYGON ):
- ( (IMapPolygonObject*) pObj )->WriteNCSA( rOStm, rBaseURL );
+ static_cast<IMapPolygonObject*>( pObj )->WriteNCSA( rOStm, rBaseURL );
break;
default:
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 003889d7f26b..4e239519da5c 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -46,7 +46,7 @@ HTMLOutContext::HTMLOutContext( rtl_TextEncoding eDestEnc )
DBG_ASSERT( m_hConv,
"HTMLOutContext::HTMLOutContext: no converter for source encoding" );
m_hContext = m_hConv ? rtl_createUnicodeToTextContext( m_hConv )
- : (rtl_TextToUnicodeContext)1;
+ : reinterpret_cast<rtl_TextToUnicodeContext>(1);
}
HTMLOutContext::~HTMLOutContext()
@@ -642,7 +642,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
case( IMAP_OBJ_RECTANGLE ):
{
const IMapRectangleObject* pRectObj =
- (const IMapRectangleObject *)pObj;
+ static_cast<const IMapRectangleObject *>(pObj);
pShape = OOO_STRING_SVTOOLS_HTML_SH_rect;
Rectangle aRect( pRectObj->GetRectangle() );
@@ -660,7 +660,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
case( IMAP_OBJ_CIRCLE ):
{
const IMapCircleObject* pCirc =
- (const IMapCircleObject *)pObj;
+ static_cast<const IMapCircleObject *>(pObj);
pShape= OOO_STRING_SVTOOLS_HTML_SH_circ;
Point aCenter( pCirc->GetCenter() );
long nOff = pCirc->GetRadius();
@@ -677,7 +677,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
case( IMAP_OBJ_POLYGON ):
{
const IMapPolygonObject* pPolyObj =
- (const IMapPolygonObject *)pObj;
+ static_cast<const IMapPolygonObject *>(pObj);
pShape= OOO_STRING_SVTOOLS_HTML_SH_poly;
Polygon aPoly( pPolyObj->GetPolygon() );
sal_uInt16 nCount = aPoly.GetSize();
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 51a4081232f5..14126096fb37 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -50,7 +50,7 @@ struct SvParser_Impl
, nNextCh(0)
, nSaveToken(0)
, hConv( 0 )
- , hContext( (rtl_TextToUnicodeContext)1 )
+ , hContext( reinterpret_cast<rtl_TextToUnicodeContext>(1) )
{
}
@@ -115,7 +115,7 @@ void SvParser::SetSrcEncoding( rtl_TextEncoding eEnc )
pImplData->hContext );
rtl_destroyTextToUnicodeConverter( pImplData->hConv );
pImplData->hConv = 0;
- pImplData->hContext = (rtl_TextToUnicodeContext )1;
+ pImplData->hContext = reinterpret_cast<rtl_TextToUnicodeContext>(1);
}
if( rtl_isOctetTextEncoding(eEnc) ||
@@ -276,7 +276,7 @@ sal_Unicode SvParser::GetNextChar()
{
// The conversion wasn't successful because we haven't
// read enough characters.
- if( pImplData->hContext != (rtl_TextToUnicodeContext)1 )
+ if( pImplData->hContext != reinterpret_cast<rtl_TextToUnicodeContext>(1) )
{
while( (nInfo&RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL) != 0 )
{
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index b9ef5a4f0d85..6131baf342bb 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -288,8 +288,8 @@ throw ( RuntimeException, std::exception )
vcl::Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR && m_nID != 0 )
{
- OUString aStrValue;
- StatusBar* pStatusBar = (StatusBar *)pWindow;
+ OUString aStrValue;
+ StatusBar* pStatusBar = static_cast<StatusBar *>(pWindow);
if ( Event.State >>= aStrValue )
pStatusBar->SetItemText( m_nID, aStrValue );
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index b0ac7e01313a..e5ad4e3b5053 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -112,7 +112,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
static_cast<CalendarField*>(pWindow)->EnableNone();
static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( true );
*ppNewComp = new SVTXDateField;
- ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow );
+ static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<DateField*>(pWindow) );
}
else if (aServiceName.equalsIgnoreAsciiCase("roadmap") )
{
@@ -214,7 +214,7 @@ void VCLXMultiLineEdit::setText( const OUString& aText ) throw(::com::sun::star:
{
SolarMutexGuard aGuard;
- MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
{
pEdit->SetText( aText );
@@ -231,7 +231,7 @@ void VCLXMultiLineEdit::insertText( const ::com::sun::star::awt::Selection& rSel
{
SolarMutexGuard aGuard;
- MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
{
setSelection( rSel );
@@ -244,7 +244,7 @@ OUString VCLXMultiLineEdit::getText() throw(::com::sun::star::uno::RuntimeExcept
SolarMutexGuard aGuard;
OUString aText;
- MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
aText = pEdit->GetText( meLineEndType );
return aText;
@@ -255,7 +255,7 @@ OUString VCLXMultiLineEdit::getSelectedText() throw(::com::sun::star::uno::Runti
SolarMutexGuard aGuard;
OUString aText;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit)
aText = pMultiLineEdit->GetSelected( meLineEndType );
return aText;
@@ -266,7 +266,7 @@ void VCLXMultiLineEdit::setSelection( const ::com::sun::star::awt::Selection& aS
{
SolarMutexGuard aGuard;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit )
{
pMultiLineEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) );
@@ -278,7 +278,7 @@ void VCLXMultiLineEdit::setSelection( const ::com::sun::star::awt::Selection& aS
SolarMutexGuard aGuard;
::com::sun::star::awt::Selection aSel;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit )
{
aSel.Min = pMultiLineEdit->GetSelection().Min();
@@ -291,7 +291,7 @@ sal_Bool VCLXMultiLineEdit::isEditable() throw(::com::sun::star::uno::RuntimeExc
{
SolarMutexGuard aGuard;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
return ( pMultiLineEdit && !pMultiLineEdit->IsReadOnly() && pMultiLineEdit->IsEnabled() ) ? sal_True : sal_False;
}
@@ -299,7 +299,7 @@ void VCLXMultiLineEdit::setEditable( sal_Bool bEditable ) throw(::com::sun::star
{
SolarMutexGuard aGuard;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit )
pMultiLineEdit->SetReadOnly( !bEditable );
}
@@ -308,7 +308,7 @@ void VCLXMultiLineEdit::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::
{
SolarMutexGuard aGuard;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit )
pMultiLineEdit->SetMaxTextLen( nLen );
}
@@ -317,7 +317,7 @@ sal_Int16 VCLXMultiLineEdit::getMaxTextLen() throw(::com::sun::star::uno::Runtim
{
SolarMutexGuard aGuard;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
return pMultiLineEdit ? (sal_Int16)pMultiLineEdit->GetMaxTextLen() : (sal_Int16)0;
}
@@ -326,7 +326,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE
SolarMutexGuard aGuard;
OUString aText;
- MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
aText = pEdit->GetTextLines( meLineEndType );
return aText;
@@ -337,7 +337,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE
SolarMutexGuard aGuard;
::com::sun::star::awt::Size aSz;
- MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
aSz = AWTSize(pEdit->CalcMinimumSize());
return aSz;
@@ -353,7 +353,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE
SolarMutexGuard aGuard;
::com::sun::star::awt::Size aSz = rNewSize;
- MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize )));
return aSz;
@@ -364,7 +364,7 @@ OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeE
SolarMutexGuard aGuard;
::com::sun::star::awt::Size aSz;
- MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
aSz = AWTSize(pEdit->CalcBlockSize( nCols, nLines ));
return aSz;
@@ -375,7 +375,7 @@ void VCLXMultiLineEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines
SolarMutexGuard aGuard;
nCols = nLines = 0;
- MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ MultiLineEdit* pEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pEdit )
{
sal_uInt16 nC, nL;
@@ -411,7 +411,7 @@ void VCLXMultiLineEdit::setProperty( const OUString& PropertyName, const ::com::
{
SolarMutexGuard aGuard;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -468,7 +468,7 @@ void VCLXMultiLineEdit::setProperty( const OUString& PropertyName, const ::com::
SolarMutexGuard aGuard;
::com::sun::star::uno::Any aProp;
- MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow();
+ MultiLineEdit* pMultiLineEdit = static_cast<MultiLineEdit*>(GetWindow());
if ( pMultiLineEdit )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -541,7 +541,7 @@ VCLXFileControl::VCLXFileControl() : maTextListeners( *this )
VCLXFileControl::~VCLXFileControl()
{
- FileControl* pControl = (FileControl*) GetWindow();
+ FileControl* pControl = static_cast<FileControl*>(GetWindow());
if ( pControl )
pControl->GetEdit().SetModifyHdl( Link() );
}
@@ -566,7 +566,7 @@ void SAL_CALL VCLXFileControl::setProperty( const OUString& PropertyName, const
{
SolarMutexGuard aGuard;
- FileControl* pControl = (FileControl*)GetWindow();
+ FileControl* pControl = static_cast<FileControl*>(GetWindow());
if ( pControl )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -631,7 +631,7 @@ void VCLXFileControl::insertText( const ::com::sun::star::awt::Selection& rSel,
{
SolarMutexGuard aGuard;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
if ( pFileControl )
{
pFileControl->GetEdit().SetSelection( Selection( rSel.Min, rSel.Max ) );
@@ -655,7 +655,7 @@ OUString VCLXFileControl::getSelectedText() throw(::com::sun::star::uno::Runtime
SolarMutexGuard aGuard;
OUString aText;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
if ( pFileControl)
aText = pFileControl->GetEdit().GetSelected();
return aText;
@@ -666,7 +666,7 @@ void VCLXFileControl::setSelection( const ::com::sun::star::awt::Selection& aSel
{
SolarMutexGuard aGuard;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
if ( pFileControl )
pFileControl->GetEdit().SetSelection( Selection( aSelection.Min, aSelection.Max ) );
}
@@ -676,7 +676,7 @@ void VCLXFileControl::setSelection( const ::com::sun::star::awt::Selection& aSel
SolarMutexGuard aGuard;
::com::sun::star::awt::Selection aSel;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
if ( pFileControl )
{
aSel.Min = pFileControl->GetEdit().GetSelection().Min();
@@ -689,7 +689,7 @@ sal_Bool VCLXFileControl::isEditable() throw(::com::sun::star::uno::RuntimeExcep
{
SolarMutexGuard aGuard;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
return ( pFileControl && !pFileControl->GetEdit().IsReadOnly() && pFileControl->GetEdit().IsEnabled() ) ? sal_True : sal_False;
}
@@ -697,7 +697,7 @@ void VCLXFileControl::setEditable( sal_Bool bEditable ) throw(::com::sun::star::
{
SolarMutexGuard aGuard;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
if ( pFileControl )
pFileControl->GetEdit().SetReadOnly( !bEditable );
}
@@ -706,7 +706,7 @@ void VCLXFileControl::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::un
{
SolarMutexGuard aGuard;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
if ( pFileControl )
pFileControl->GetEdit().SetMaxTextLen( nLen );
}
@@ -715,7 +715,7 @@ sal_Int16 VCLXFileControl::getMaxTextLen() throw(::com::sun::star::uno::RuntimeE
{
SolarMutexGuard aGuard;
- FileControl* pFileControl = (FileControl*) GetWindow();
+ FileControl* pFileControl = static_cast<FileControl*>(GetWindow());
return pFileControl ? pFileControl->GetEdit().GetMaxTextLen() : 0;
}
@@ -734,7 +734,7 @@ IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl)
SolarMutexGuard aGuard;
::com::sun::star::awt::Size aSz;
- FileControl* pControl = (FileControl*) GetWindow();
+ FileControl* pControl = static_cast<FileControl*>(GetWindow());
if ( pControl )
{
Size aTmpSize = pControl->GetEdit().CalcMinimumSize();
@@ -756,7 +756,7 @@ IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl)
SolarMutexGuard aGuard;
::com::sun::star::awt::Size aSz =rNewSize;
- FileControl* pControl = (FileControl*) GetWindow();
+ FileControl* pControl = static_cast<FileControl*>(GetWindow());
if ( pControl )
{
::com::sun::star::awt::Size aMinSz = getMinimumSize();
@@ -771,7 +771,7 @@ IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl)
SolarMutexGuard aGuard;
::com::sun::star::awt::Size aSz;
- FileControl* pControl = (FileControl*) GetWindow();
+ FileControl* pControl = static_cast<FileControl*>(GetWindow());
if ( pControl )
{
aSz = AWTSize(pControl->GetEdit().CalcSize( nCols ));
@@ -786,7 +786,7 @@ void VCLXFileControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines )
nCols = 0;
nLines = 1;
- FileControl* pControl = (FileControl*) GetWindow();
+ FileControl* pControl = static_cast<FileControl*>(GetWindow());
if ( pControl )
nCols = pControl->GetEdit().GetMaxVisChars();
}
@@ -1984,7 +1984,7 @@ void SVTXCurrencyField::setProperty( const OUString& PropertyName, const ::com::
{
SolarMutexGuard aGuard;
- DoubleCurrencyField* pField = (DoubleCurrencyField*)GetFormattedField();
+ DoubleCurrencyField* pField = static_cast<DoubleCurrencyField*>(GetFormattedField());
if ( pField )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -2019,7 +2019,7 @@ void SVTXCurrencyField::setProperty( const OUString& PropertyName, const ::com::
::com::sun::star::uno::Any aReturn;
- DoubleCurrencyField* pField = (DoubleCurrencyField*)GetFormattedField();
+ DoubleCurrencyField* pField = static_cast<DoubleCurrencyField*>(GetFormattedField());
if ( pField )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -2069,7 +2069,7 @@ VCLXProgressBar::~VCLXProgressBar()
void VCLXProgressBar::ImplUpdateValue()
{
- ProgressBar* pProgressBar = (ProgressBar*) GetWindow();
+ ProgressBar* pProgressBar = static_cast<ProgressBar*>(GetWindow());
if ( pProgressBar )
{
sal_Int32 nVal;
@@ -2200,7 +2200,7 @@ void VCLXProgressBar::setProperty( const OUString& PropertyName, const ::com::su
{
SolarMutexGuard aGuard;
- ProgressBar* pProgressBar = (ProgressBar*)GetWindow();
+ ProgressBar* pProgressBar = static_cast<ProgressBar*>(GetWindow());
if ( pProgressBar )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
@@ -2259,7 +2259,7 @@ void VCLXProgressBar::setProperty( const OUString& PropertyName, const ::com::su
SolarMutexGuard aGuard;
::com::sun::star::uno::Any aProp;
- ProgressBar* pProgressBar = (ProgressBar*)GetWindow();
+ ProgressBar* pProgressBar = static_cast<ProgressBar*>(GetWindow());
if ( pProgressBar )
{
sal_uInt16 nPropType = GetPropertyId( PropertyName );
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 96adcee23f46..b4ece344101e 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -207,7 +207,7 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv
{
case IMAP_OBJ_RECTANGLE:
{
- const Rectangle aRect( ((IMapRectangleObject*)&rMapObject)->GetRectangle(false) );
+ const Rectangle aRect( static_cast<const IMapRectangleObject*>(&rMapObject)->GetRectangle(false) );
maBoundary.X = aRect.Left();
maBoundary.Y = aRect.Top();
maBoundary.Width = aRect.GetWidth();
@@ -216,8 +216,8 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv
break;
case IMAP_OBJ_CIRCLE:
{
- mnRadius = (sal_Int32)((IMapCircleObject*)&rMapObject)->GetRadius(false);
- const Point aPoint( ((IMapCircleObject*)&rMapObject)->GetCenter(false) );
+ mnRadius = (sal_Int32)static_cast<const IMapCircleObject*>(&rMapObject)->GetRadius(false);
+ const Point aPoint( static_cast<const IMapCircleObject*>(&rMapObject)->GetCenter(false) );
maCenter.X = aPoint.X();
maCenter.Y = aPoint.Y();
@@ -226,7 +226,7 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv
case IMAP_OBJ_POLYGON:
default:
{
- const Polygon aPoly( ((IMapPolygonObject*)&rMapObject)->GetPolygon(false) );
+ const Polygon aPoly( static_cast<const IMapPolygonObject*>(&rMapObject)->GetPolygon(false) );
const sal_uInt16 nCount = aPoly.GetSize();
maPolygon.realloc( nCount );
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 7a8b7c2410d3..5bef2377c064 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1288,7 +1288,7 @@ sal_IntPtr SortedResultSet::FindPos( SortListData *pEntry,
nCompare = Compare( pEntry, pMid );
if ( !nCompare )
- nCompare = ((sal_IntPtr) pEntry ) - ( (sal_IntPtr) pMid );
+ nCompare = reinterpret_cast<sal_IntPtr>(pEntry) - reinterpret_cast<sal_IntPtr>(pMid);
if ( nCompare < 0 ) // pEntry < pMid
nEnd = nMid - 1;
@@ -1421,7 +1421,7 @@ void SortedResultSet::Initialize(
for ( i=1; i<maS2O.Count(); i++ )
maO2S.Insert( (void*) 0, i ); // Insert( data, pos )
for ( i=1; i<maS2O.Count(); i++ )
- maO2S.Replace( (void*) i, maS2O[ i ] ); // Insert( data, pos )
+ maO2S.Replace( reinterpret_cast<void*>(i), maS2O[ i ] ); // Insert( data, pos )
mnCount = maS2O.Count() - 1;
}
@@ -1491,7 +1491,7 @@ void SortedResultSet::InsertNew( sal_IntPtr nPos, sal_IntPtr nCount )
pData = new SortListData( nEnd );
maS2O.Insert( pData, nEnd ); // Insert( Value, Position )
- maO2S.Insert( (void*)nEnd, (sal_uInt32)(nPos+i) ); // Insert( Value, Position )
+ maO2S.Insert( reinterpret_cast<void*>(nEnd), (sal_uInt32)(nPos+i) ); // Insert( Value, Position )
}
mnCount += nCount;
@@ -1517,16 +1517,16 @@ void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEv
// in the original2sorted list
for ( i=0; i < (sal_uInt32) nCount; i++ )
{
- sal_IntPtr nSortPos = (sal_IntPtr) maO2S.GetObject( nPos );
+ sal_IntPtr nSortPos = reinterpret_cast<sal_IntPtr>( maO2S.GetObject( nPos ) );
maO2S.Remove( (sal_uInt32) nPos );
for ( j=1; j<=maO2S.Count(); j++ )
{
- sal_IntPtr nVal = (sal_IntPtr) maO2S.GetObject( j );
+ sal_IntPtr nVal = reinterpret_cast<sal_IntPtr>( maO2S.GetObject( j ) );
if ( nVal > nSortPos )
{
--nVal;
- maO2S.Replace( (void*) nVal, j );
+ maO2S.Replace( reinterpret_cast<void*>(nVal), j );
}
}
@@ -1562,7 +1562,7 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
for ( i=0; i<nCount; i++ )
{
- nSortPos = (sal_IntPtr) maO2S.GetObject( nPos+i );
+ nSortPos = reinterpret_cast<sal_IntPtr>(maO2S.GetObject( nPos+i ));
pData = maS2O.GetData( nSortPos );
pData->mnCurPos += nOffset;
}
@@ -1571,7 +1571,7 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
{
for ( i=nPos+nOffset; i<nPos; i++ )
{
- nSortPos = (sal_IntPtr) maO2S.GetObject( i );
+ nSortPos = reinterpret_cast<sal_IntPtr>(maO2S.GetObject( i ));
pData = maS2O.GetData( nSortPos );
pData->mnCurPos += nCount;
}
@@ -1582,7 +1582,7 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
sal_IntPtr nEnd = nStart + nOffset;
for ( i=nStart; i<nEnd; i++ )
{
- nSortPos = (sal_IntPtr) maO2S.GetObject( i );
+ nSortPos = reinterpret_cast<sal_IntPtr>(maO2S.GetObject( i ));
pData = maS2O.GetData( nSortPos );
pData->mnCurPos -= nCount;
}
@@ -1591,7 +1591,7 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
// remember the to be moved entries
boost::scoped_array<sal_IntPtr> pTmpArr(new sal_IntPtr[ nCount ]);
for ( i=0; i<nCount; i++ )
- pTmpArr[i] = (sal_IntPtr)maO2S.GetObject( (sal_uInt32)( nPos+i ) );
+ pTmpArr[i] = reinterpret_cast<sal_IntPtr>(maO2S.GetObject( (sal_uInt32)( nPos+i ) ));
// now move the entries, which are in the way
if ( nOffset < 0 )
@@ -1604,8 +1604,8 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
// same for i here
for ( i=0; i>nOffset; i-- )
{
- sal_IntPtr nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( nFrom+i ) );
- maO2S.Replace( (void*) nVal, (sal_uInt32)( nTo+i ) );
+ sal_IntPtr nVal = reinterpret_cast<sal_IntPtr>( maO2S.GetObject( (sal_uInt32)( nFrom+i ) ) );
+ maO2S.Replace( reinterpret_cast<void*>(nVal), (sal_uInt32)( nTo+i ) );
}
}
@@ -1614,8 +1614,8 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
sal_IntPtr nStart = nPos + nCount;
for ( i=0; i<nOffset; i++ )
{
- sal_IntPtr nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( nStart+i ) );
- maO2S.Replace( (void*) nVal, (sal_uInt32)( nPos+i ) );
+ sal_IntPtr nVal = reinterpret_cast<sal_IntPtr>( maO2S.GetObject( (sal_uInt32)( nStart+i ) ) );
+ maO2S.Replace( reinterpret_cast<void*>(nVal), (sal_uInt32)( nPos+i ) );
}
}
@@ -1623,7 +1623,7 @@ void SortedResultSet::Move( sal_IntPtr nPos, sal_IntPtr nCount, sal_IntPtr nOffs
nTo = nPos + nOffset;
for ( i=0; i<nCount; i++ )
{
- maO2S.Replace( (void*)pTmpArr[ i ], (sal_uInt32)( nTo+i ) );
+ maO2S.Replace( reinterpret_cast<void*>(pTmpArr[ i ]), (sal_uInt32)( nTo+i ) );
}
}
@@ -1683,7 +1683,7 @@ void SortedResultSet::SetChanged( sal_IntPtr nPos, sal_IntPtr nCount )
{
for ( sal_IntPtr i=0; i<nCount; i++ )
{
- sal_IntPtr nSortPos = (sal_IntPtr) maO2S.GetObject( nPos );
+ sal_IntPtr nSortPos = reinterpret_cast<sal_IntPtr>(maO2S.GetObject( nPos ));
if ( nSortPos < mnLastSort )
{
SortListData *pData = maS2O.GetData( nSortPos );
@@ -1715,7 +1715,7 @@ void SortedResultSet::ResortModified( EventList* pList )
pData->mbModified = false;
if ( nCompare != 0 )
{
- nCurPos = (sal_IntPtr) maO2S.GetObject( (sal_uInt32) pData->mnCurPos );
+ nCurPos = reinterpret_cast<sal_IntPtr>( maO2S.GetObject( (sal_uInt32) pData->mnCurPos ) );
if ( nCompare < 0 )
{
nNewPos = FindPos( pData, 1, nCurPos-1 );
@@ -1738,15 +1738,15 @@ void SortedResultSet::ResortModified( EventList* pList )
maS2O.Insert( pData, nNewPos );
for ( j=1; j<maO2S.Count(); j++ )
{
- nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( j ) );
+ nVal = reinterpret_cast<sal_IntPtr>( maO2S.GetObject( (sal_uInt32)j ) );
if ( ( nStart <= nVal ) && ( nVal <= nEnd ) )
{
nVal += nOffset;
- maO2S.Replace( (void*) (nVal), (sal_uInt32)( j ) );
+ maO2S.Replace( reinterpret_cast<void*>(nVal), (sal_uInt32)j );
}
}
- maO2S.Replace( (void*) nNewPos, (sal_uInt32) pData->mnCurPos );
+ maO2S.Replace( reinterpret_cast<void*>(nNewPos), (sal_uInt32) pData->mnCurPos );
pAction = new ListAction;
pAction->Position = nCurPos;
@@ -1786,11 +1786,11 @@ void SortedResultSet::ResortNew( EventList* pList )
// maO2S liste korigieren
for ( j=1; j<(sal_IntPtr)maO2S.Count(); j++ )
{
- nVal = (sal_IntPtr) maO2S.GetObject( (sal_uInt32)( j ) );
+ nVal = reinterpret_cast<sal_IntPtr>(maO2S.GetObject( (sal_uInt32)j ));
if ( nVal >= nNewPos )
- maO2S.Replace( (void*) (nVal+1), (sal_uInt32)( j ) );
+ maO2S.Replace( reinterpret_cast<void*>(nVal+1), (sal_uInt32)( j ) );
}
- maO2S.Replace( (void*) nNewPos, (sal_uInt32) pData->mnCurPos );
+ maO2S.Replace( reinterpret_cast<void*>(nNewPos), (sal_uInt32) pData->mnCurPos );
}
mnLastSort++;
pList->AddEvent( ListActionType::INSERTED, nNewPos, 1 );
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index f7c98119b061..937523918841 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -103,7 +103,7 @@ struct hashPtr
{
size_t operator()( const ne_request* p ) const
{
- return (size_t)p;
+ return reinterpret_cast<size_t>(p);
}
};