diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-19 15:17:37 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-29 12:50:34 +0200 |
commit | 26f2da07b1c6074e519d28557a3d1d5518ff6cb4 (patch) | |
tree | 6981a11bc7e6fc897771277a7b60a6e3a88cff29 /vcl | |
parent | d9632a6effabe8554c4e7e05ee24c16acd0f4f95 (diff) |
loplugin: cstylecast
Change-Id: I58ec00d6f8a4cc6188877db1330c5e32c9db12e5
Diffstat (limited to 'vcl')
73 files changed, 705 insertions, 699 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index 3d7574418f52..2b2f7fa37341 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -486,7 +486,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI ) { // TODO: move update of mpFontEntry into FontEntry class when // it becomes reponsible for the ServerFont instantiation - ((ImplServerFontEntry*)rFSD.mpFontEntry)->SetServerFont( this ); + static_cast<ImplServerFontEntry*>(rFSD.mpFontEntry)->SetServerFont( this ); maFaceFT = pFI->GetFaceFT(); if( !maFaceFT ) diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index a6ea399b308c..84a8b5bb2b09 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -324,7 +324,7 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) for( sal_uInt16 i = 0; i < m_pLevelBox->GetEntryCount(); i++ ) { - if( (sal_uLong)m_pLevelBox->GetEntryData( i ) == nLevelEntryData ) + if( reinterpret_cast<sal_uLong>(m_pLevelBox->GetEntryData( i )) == nLevelEntryData ) { m_pLevelBox->SelectEntryPos( i ); break; @@ -391,7 +391,7 @@ sal_uLong RTSDevicePage::getColorDevice() sal_uLong RTSDevicePage::getLevel() { - sal_uLong nLevel = (sal_uLong)m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() ); + sal_uLong nLevel = reinterpret_cast<sal_uLong>(m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() )); if (nLevel == 0) return 0; //automatic return nLevel < 10 ? nLevel-1 : 0; @@ -399,7 +399,7 @@ sal_uLong RTSDevicePage::getLevel() sal_uLong RTSDevicePage::getPDFDevice() { - sal_uLong nLevel = (sal_uLong)m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() ); + sal_uLong nLevel = reinterpret_cast<sal_uLong>(m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() )); if (nLevel > 9) return 2; //explictly PDF else if (nLevel == 0) diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx index 6c807e5707c5..12beba4d365c 100644 --- a/vcl/inc/cupsmgr.hxx +++ b/vcl/inc/cupsmgr.hxx @@ -33,7 +33,7 @@ class PPDParser; struct FPtrHash { size_t operator()(const FILE* pPtr) const - { return (size_t)pPtr; } + { return reinterpret_cast<size_t>(pPtr); } }; class CUPSManager : public PrinterInfoManager diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx index ec587ce6f699..334193d402a5 100644 --- a/vcl/inc/generic/gendata.hxx +++ b/vcl/inc/generic/gendata.hxx @@ -74,7 +74,7 @@ class VCL_DLLPUBLIC SalGenericData : public SalData inline SalGenericData * GetGenericData() { - return (SalGenericData *)ImplGetSVData()->mpSalData; + return static_cast<SalGenericData *>(ImplGetSVData()->mpSalData); } #endif diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index e7a8dbac0ed8..0622f593d5c7 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -181,7 +181,7 @@ public: inline GtkData* GetGtkSalData() { - return (GtkData*)ImplGetSVData()->mpSalData; + return static_cast<GtkData*>(ImplGetSVData()->mpSalData); } inline GdkDisplay *GtkData::GetGdkDisplay() { diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index a35d62dead31..9b29b001e2f1 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -563,14 +563,14 @@ void DbgDialogTest( vcl::Window* pWindow ) switch( pChild->GetType() ) { case WINDOW_RADIOBUTTON: - aWidth = ((RadioButton*)pChild)->CalcMinimumSize(0).Width(); + aWidth = static_cast<RadioButton*>(pChild)->CalcMinimumSize(0).Width(); break; case WINDOW_CHECKBOX: case WINDOW_TRISTATEBOX: - aWidth = ((CheckBox*)pChild)->CalcMinimumSize(0).Width(); + aWidth = static_cast<CheckBox*>(pChild)->CalcMinimumSize(0).Width(); break; case WINDOW_PUSHBUTTON: - aWidth = ((PushButton*)pChild)->CalcMinimumSize(0).Width(); + aWidth = static_cast<PushButton*>(pChild)->CalcMinimumSize(0).Width(); break; default: break; } @@ -666,61 +666,61 @@ void DbgDialogTest( vcl::Window* pWindow ) bool bMaxWarning = false; if ( pChild->GetType() == WINDOW_NUMERICFIELD ) { - NumericField* pField = (NumericField*)pChild; + NumericField* pField = static_cast<NumericField*>(pChild); if ( pField->GetMax() == LONG_MAX ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_METRICFIELD ) { - MetricField* pField = (MetricField*)pChild; + MetricField* pField = static_cast<MetricField*>(pChild); if ( pField->GetMax() == LONG_MAX ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_CURRENCYFIELD ) { - CurrencyField* pField = (CurrencyField*)pChild; + CurrencyField* pField = static_cast<CurrencyField*>(pChild); if ( pField->GetMax() == LONG_MAX ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_TIMEFIELD ) { - TimeField* pField = (TimeField*)pChild; + TimeField* pField = static_cast<TimeField*>(pChild); if ( pField->GetMax() == Time( 23, 59, 59, 99 ) ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_DATEFIELD ) { - DateField* pField = (DateField*)pChild; + DateField* pField = static_cast<DateField*>(pChild); if ( pField->GetMax() == Date( 31, 12, 9999 ) ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_NUMERICBOX ) { - NumericBox* pBox = (NumericBox*)pChild; + NumericBox* pBox = static_cast<NumericBox*>(pChild); if ( pBox->GetMax() == LONG_MAX ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_METRICBOX ) { - MetricBox* pBox = (MetricBox*)pChild; + MetricBox* pBox = static_cast<MetricBox*>(pChild); if ( pBox->GetMax() == LONG_MAX ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_CURRENCYBOX ) { - CurrencyBox* pBox = (CurrencyBox*)pChild; + CurrencyBox* pBox = static_cast<CurrencyBox*>(pChild); if ( pBox->GetMax() == LONG_MAX ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_TIMEBOX ) { - TimeBox* pBox = (TimeBox*)pChild; + TimeBox* pBox = static_cast<TimeBox*>(pChild); if ( pBox->GetMax() == Time( 23, 59, 59, 99 ) ) bMaxWarning = true; } else if ( pChild->GetType() == WINDOW_DATEBOX ) { - DateBox* pBox = (DateBox*)pChild; + DateBox* pBox = static_cast<DateBox*>(pChild); if ( pBox->GetMax() == Date( 31, 12, 9999 ) ) bMaxWarning = true; } diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 5a475e77213e..5d0b1e382f01 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -229,7 +229,7 @@ void Help::UpdateTip( sal_uIntPtr nId, vcl::Window* pParent, const Rectangle& rS void Help::HideTip( sal_uLong nId ) { - HelpTextWindow* pHelpWin = (HelpTextWindow*)nId; + HelpTextWindow* pHelpWin = reinterpret_cast<HelpTextWindow*>(nId); vcl::Window* pFrameWindow = pHelpWin->ImplGetFrameWindow(); pHelpWin->Hide(); // trigger update, so that a Paint is instantly triggered since we do not save the background diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx index 7dc274cffb00..8e5def4411ff 100644 --- a/vcl/source/app/unohelp2.cxx +++ b/vcl/source/app/unohelp2.cxx @@ -76,7 +76,7 @@ namespace vcl { namespace unohelper { sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( nT == SOT_FORMAT_STRING ) { - aAny <<= (OUString)GetString(); + aAny <<= GetString(); } else { diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 1ee4014fb6fc..5db9d6d1fa5e 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1708,19 +1708,19 @@ void OKButton::Click() { if ( pParent->IsDialog() ) { - if ( ((Dialog*)pParent)->IsInExecute() ) - ((Dialog*)pParent)->EndDialog( RET_OK ); + if ( static_cast<Dialog*>(pParent)->IsInExecute() ) + static_cast<Dialog*>(pParent)->EndDialog( RET_OK ); // prevent recursive calls - else if ( !((Dialog*)pParent)->IsInClose() ) + else if ( !static_cast<Dialog*>(pParent)->IsInClose() ) { if ( pParent->GetStyle() & WB_CLOSEABLE ) - ((Dialog*)pParent)->Close(); + static_cast<Dialog*>(pParent)->Close(); } } else { if ( pParent->GetStyle() & WB_CLOSEABLE ) - ((SystemWindow*)pParent)->Close(); + static_cast<SystemWindow*>(pParent)->Close(); } } } @@ -1753,19 +1753,19 @@ void CancelButton::Click() { if ( pParent->IsDialog() ) { - if ( ((Dialog*)pParent)->IsInExecute() ) - ((Dialog*)pParent)->EndDialog( RET_CANCEL ); + if ( static_cast<Dialog*>(pParent)->IsInExecute() ) + static_cast<Dialog*>(pParent)->EndDialog( RET_CANCEL ); // prevent recursive calls - else if ( !((Dialog*)pParent)->IsInClose() ) + else if ( !static_cast<Dialog*>(pParent)->IsInClose() ) { if ( pParent->GetStyle() & WB_CLOSEABLE ) - ((Dialog*)pParent)->Close(); + static_cast<Dialog*>(pParent)->Close(); } } else { if ( pParent->GetStyle() & WB_CLOSEABLE ) - ((SystemWindow*)pParent)->Close(); + static_cast<SystemWindow*>(pParent)->Close(); } } } diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index cb39c0a5b7c5..2880c9011c95 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -440,7 +440,7 @@ IMPL_LINK( ComboBox, ImplSelectionChangedHdl, void*, n ) { if ( !mpImplLB->IsTrackingSelect() ) { - sal_Int32 nChanged = (sal_Int32)(sal_uLong)n; + sal_Int32 nChanged = (sal_Int32)reinterpret_cast<sal_uLong>(n); if ( !mpSubEdit->IsReadOnly() && mpImplLB->GetEntryList()->IsEntryPosSelected( nChanged ) ) mpSubEdit->SetText( mpImplLB->GetEntryList()->GetEntryText( nChanged ) ); } @@ -861,7 +861,7 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos) nRealPos = mpImplLB->InsertEntry( nRealPos, rStr ); nRealPos -= mpImplLB->GetEntryList()->GetMRUCount(); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) ); + CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -884,7 +884,7 @@ sal_Int32 ComboBox::InsertEntryWithImage( nRealPos = mpImplLB->InsertEntry( nRealPos, rStr, rImage ); nRealPos -= mpImplLB->GetEntryList()->GetMRUCount(); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) ); + CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -900,13 +900,13 @@ void ComboBox::RemoveEntryAt(sal_Int32 const nPos) return; mpImplLB->RemoveEntry( nPos + nMRUCount ); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) ); + CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, reinterpret_cast<void*>(nPos) ); } void ComboBox::Clear() { mpImplLB->Clear(); - CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(-1) ); + CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, reinterpret_cast<void*>(-1) ); } Image ComboBox::GetEntryImage( sal_Int32 nPos ) const diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index f33cbcbe09ea..9962c3213578 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1892,7 +1892,7 @@ void Edit::GetFocus() maSelection.Max() = maText.getLength(); } if ( mbIsSubEdit ) - ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + static_cast<Edit*>(GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); else ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); } @@ -2376,7 +2376,7 @@ void Edit::Modify() if ( mbIsSubEdit ) { - ((Edit*)GetParent())->Modify(); + static_cast<Edit*>(GetParent())->Modify(); } else { @@ -2532,7 +2532,7 @@ void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint ) if (bSelection) { if ( mbIsSubEdit ) - ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + static_cast<Edit*>(GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); else ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); } @@ -2540,14 +2540,14 @@ void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint ) if (bCaret) { if ( mbIsSubEdit ) - ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); + static_cast<Edit*>(GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); else ImplCallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); } // #103511# notify combobox listeners of deselection if( !maSelection && GetParent() && GetParent()->GetType() == WINDOW_COMBOBOX ) - ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_COMBOBOX_DESELECT ); + static_cast<Edit*>(GetParent())->ImplCallEventListeners( VCLEVENT_COMBOBOX_DESELECT ); } } } diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 8bcdf11202eb..a1dea0d77724 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -121,7 +121,7 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect ) { iter->mbIsSelected = bSelect; if ( mbCallSelectionChangedHdl ) - maSelectionChangedHdl.Call( (void*)sal_IntPtr(nPos) ); + maSelectionChangedHdl.Call( reinterpret_cast<void*>(nPos) ); } } } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 504f11252479..c0451281ce5f 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -202,7 +202,7 @@ void ListBox::ImplLoadRes( const ResId& rResId ) sal_IntPtr nId = ReadLongRes(); if( nId ) - SetEntryData( nPos, (void *)nId ); // ID as UserData + SetEntryData( nPos, reinterpret_cast<void *>(nId) ); // ID as UserData } if( nSelPos < nNumber ) @@ -266,7 +266,7 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n ) { if ( !mpImplLB->IsTrackingSelect() ) { - sal_Int32 nChanged = (sal_Int32)(sal_uLong)n; + sal_Int32 nChanged = (sal_Int32)reinterpret_cast<sal_uLong>(n); const ImplEntryList* pEntryList = mpImplLB->GetEntryList(); if ( pEntryList->IsEntryPosSelected( nChanged ) ) { @@ -979,7 +979,7 @@ void ListBox::Clear() mpImplWin->SetImage( aImage ); mpImplWin->Invalidate(); } - CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(-1) ); + CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, reinterpret_cast<void*>(-1) ); } void ListBox::SetNoSelection() @@ -1000,7 +1000,7 @@ sal_Int32 ListBox::InsertEntry( const OUString& rStr, sal_Int32 nPos ) { sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr ); nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount()); - CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) ); + CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -1008,7 +1008,7 @@ sal_Int32 ListBox::InsertEntry( const OUString& rStr, const Image& rImage, sal_I { sal_Int32 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage ); nRealPos = sal::static_int_cast<sal_Int32>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount()); - CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) ); + CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, reinterpret_cast<void*>(nRealPos) ); return nRealPos; } @@ -1020,7 +1020,7 @@ void ListBox::RemoveEntry( const OUString& rStr ) void ListBox::RemoveEntry( sal_Int32 nPos ) { mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() ); - CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) ); + CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, reinterpret_cast<void*>(nPos) ); } Image ListBox::GetEntryImage( sal_Int32 nPos ) const diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 8d144ce9a516..c11bb36654ba 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -624,7 +624,7 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev ) vcl::Window *pWin = NULL; if( pOutDev->GetOutDevType() == OUTDEV_WINDOW ) - pWin = (vcl::Window*) pOutDev; + pWin = static_cast<vcl::Window*>(pOutDev); // Draw the entire control if the native theme engine needs it if ( nDrawFlags && pWin && pWin->IsNativeControlSupported(CTRL_SCROLLBAR, PART_DRAW_BACKGROUND_HORZ) ) diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index c027cbbccbf5..e71cfbb60406 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -189,7 +189,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, if( pOutDev->GetOutDevType() == OUTDEV_WINDOW ) { - vcl::Window *pWin = (vcl::Window*) pOutDev; + vcl::Window *pWin = static_cast<vcl::Window*>(pOutDev); // are we drawing standalone spin buttons or members of a spinfield ? ControlType aControl = CTRL_SPINBUTTONS; @@ -663,7 +663,7 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec ! (GetStyle() & WB_DROPDOWN) && IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) ) { - vcl::Window *pWin = (vcl::Window*) pDev; + vcl::Window *pWin = static_cast<vcl::Window*>(pDev); vcl::Window *pBorder = pWin->GetWindow( WINDOW_BORDER ); // get the system's spin button size diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 67cdbbe82934..4e377cb103ee 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1663,7 +1663,7 @@ void TabControl::InsertPage( sal_uInt16 nPageId, const OUString& rText, if( mpTabCtrlData->mpListBox ) // reposition/resize listbox Resize(); - ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (sal_uLong)nPageId ); + ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, reinterpret_cast<void*>(nPageId) ); } void TabControl::RemovePage( sal_uInt16 nPageId ) @@ -1708,7 +1708,7 @@ void TabControl::RemovePage( sal_uInt16 nPageId ) ImplFreeLayoutData(); - ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (sal_uLong) nPageId ); + ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, reinterpret_cast<void*>(nPageId) ); } } @@ -1858,7 +1858,7 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId ) { ImplFreeLayoutData(); - ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (sal_uLong) mnCurPageId ); + ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, reinterpret_cast<void*>(mnCurPageId) ); if ( DeactivatePage() ) { mnActPageId = nPageId; @@ -1869,7 +1869,7 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId ) SetCurPageId( nPageId ); if( mpTabCtrlData->mpListBox ) mpTabCtrlData->mpListBox->SelectEntryPos( GetPagePos( nPageId ) ); - ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (sal_uLong) nPageId ); + ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, reinterpret_cast<void*>(nPageId) ); } } } @@ -1929,7 +1929,7 @@ void TabControl::SetPageText( sal_uInt16 nPageId, const OUString& rText ) if ( IsUpdateMode() ) Invalidate(); ImplFreeLayoutData(); - ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (sal_uLong) nPageId ); + ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, reinterpret_cast<void*>(nPageId) ); } } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 0cc3f90f6066..19f9bc9db4ba 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1420,7 +1420,7 @@ void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, vcl::Font& rFont, else { if ( pOutDev ) - pOutDev->SetTextColor( ((TextAttribFontColor&)pAttrib->GetAttr()).GetColor() ); + pOutDev->SetTextColor( static_cast<const TextAttribFontColor&>(pAttrib->GetAttr()).GetColor() ); } } } @@ -2602,7 +2602,7 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML // e.g. <A HREF="http://www.mopo.de/">Morgenpost</A> aText.append( "<A HREF=\"" ); - aText.append( ((const TextAttribHyperLink&) pAttr->GetAttr() ).GetURL() ); + aText.append( static_cast<const TextAttribHyperLink&>( pAttr->GetAttr() ).GetURL() ); aText.append( "\">" ); nTmpStart = pAttr->GetStart(); aText.append( pNode->GetText().copy( nTmpStart, nTmpEnd-nTmpStart ) ); diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx index 59781e1d585d..57a721ed2b33 100644 --- a/vcl/source/edit/textundo.cxx +++ b/vcl/source/edit/textundo.cxx @@ -280,7 +280,7 @@ bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) if ( !pNextAction->ISA( TextUndoInsertChars ) ) return false; - TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction; + TextUndoInsertChars* pNext = static_cast<TextUndoInsertChars*>(pNextAction); if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() ) return false; diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index c2b7fadb2771..fdd4872bf792 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -106,7 +106,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( nT == SOT_FORMAT_STRING ) { - aAny <<= (OUString)GetText(); + aAny <<= GetText(); } else if ( nT == SOT_FORMATSTR_ID_HTML ) { diff --git a/vcl/source/edit/txtattr.cxx b/vcl/source/edit/txtattr.cxx index 2baa47bc213f..1d894273e449 100644 --- a/vcl/source/edit/txtattr.cxx +++ b/vcl/source/edit/txtattr.cxx @@ -56,7 +56,7 @@ TextAttrib* TextAttribFontColor::Clone() const bool TextAttribFontColor::operator==( const TextAttrib& rAttr ) const { return ( ( TextAttrib::operator==(rAttr ) ) && - ( maColor == ((const TextAttribFontColor&)rAttr).maColor ) ); + ( maColor == static_cast<const TextAttribFontColor&>(rAttr).maColor ) ); } TextAttribFontWeight::TextAttribFontWeight( FontWeight eWeight ) @@ -86,7 +86,7 @@ TextAttrib* TextAttribFontWeight::Clone() const bool TextAttribFontWeight::operator==( const TextAttrib& rAttr ) const { return ( ( TextAttrib::operator==(rAttr ) ) && - ( meWeight == ((const TextAttribFontWeight&)rAttr).meWeight ) ); + ( meWeight == static_cast<const TextAttribFontWeight&>(rAttr).meWeight ) ); } TextAttribHyperLink::TextAttribHyperLink( const TextAttribHyperLink& rAttr ) @@ -113,9 +113,9 @@ TextAttrib* TextAttribHyperLink::Clone() const bool TextAttribHyperLink::operator==( const TextAttrib& rAttr ) const { return ( ( TextAttrib::operator==(rAttr ) ) && - ( maURL == ((const TextAttribHyperLink&)rAttr).maURL ) && - ( maDescription == ((const TextAttribHyperLink&)rAttr).maDescription ) && - ( maColor == ((const TextAttribHyperLink&)rAttr).maColor ) ); + ( maURL == static_cast<const TextAttribHyperLink&>(rAttr).maURL ) && + ( maDescription == static_cast<const TextAttribHyperLink&>(rAttr).maDescription ) && + ( maColor == static_cast<const TextAttribHyperLink&>(rAttr).maColor ) ); } TextAttribProtect::TextAttribProtect() : diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx index 4fd5f27e498d..072e1f9dab91 100644 --- a/vcl/source/edit/xtextedt.cxx +++ b/vcl/source/edit/xtextedt.cxx @@ -241,7 +241,7 @@ bool ExtTextView::MatchGroup() return false; } - TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() ); + TextSelection aMatchSel = static_cast<ExtTextEngine*>(GetTextEngine())->MatchGroup( aTmpSel.GetStart() ); if ( aMatchSel.HasRange() ) SetSelection( aMatchSel ); @@ -252,7 +252,7 @@ bool ExtTextView::Search( const util::SearchOptions& rSearchOptions, bool bForwa { bool bFound = false; TextSelection aSel( GetSelection() ); - if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchOptions, bForward ) ) + if ( static_cast<ExtTextEngine*>(GetTextEngine())->Search( aSel, rSearchOptions, bForward ) ) { bFound = true; // First add the beginning of the word to the selection, @@ -293,7 +293,7 @@ sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, bool { // the writer replaces all, from beginning to end - ExtTextEngine* pTextEngine = (ExtTextEngine*)GetTextEngine(); + ExtTextEngine* pTextEngine = static_cast<ExtTextEngine*>(GetTextEngine()); // HideSelection(); TextSelection aSel; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 2f38fbf764ed..79be1aadf326 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1334,7 +1334,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat sal_uInt16 nStatus; GraphicReader* pContext = rGraphic.GetContext(); GfxLinkType eLinkType = GFX_LINK_TYPE_NONE; - bool bDummyContext = ( pContext == (GraphicReader*) 1 ); + bool bDummyContext = ( pContext == reinterpret_cast<GraphicReader*>(1) ); const bool bLinkSet = rGraphic.IsLink(); FilterConfigItem* pFilterConfigItem = NULL; @@ -1395,7 +1395,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat // if pending, return GRFILTER_OK in order to request more bytes if( rIStream.GetError() == ERRCODE_IO_PENDING ) { - rGraphic.SetContext( (GraphicReader*) 1 ); + rGraphic.SetContext( reinterpret_cast<GraphicReader*>(1) ); rIStream.ResetError(); rIStream.Seek( nStreamBegin ); return (sal_uInt16) ImplSetError( GRFILTER_OK ); @@ -1425,7 +1425,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat { if( aFilterName.equalsIgnoreAsciiCase( IMP_GIF ) ) { - if( rGraphic.GetContext() == (GraphicReader*) 1 ) + if( rGraphic.GetContext() == reinterpret_cast<GraphicReader*>(1) ) rGraphic.SetContext( NULL ); if( !ImportGIF( rIStream, rGraphic ) ) @@ -1435,7 +1435,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat } else if( aFilterName.equalsIgnoreAsciiCase( IMP_PNG ) ) { - if ( rGraphic.GetContext() == (GraphicReader*) 1 ) + if ( rGraphic.GetContext() == reinterpret_cast<GraphicReader*>(1) ) rGraphic.SetContext( NULL ); vcl::PNGReader aPNGReader( rIStream ); @@ -1486,7 +1486,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat } else if( aFilterName.equalsIgnoreAsciiCase( IMP_JPEG ) ) { - if( rGraphic.GetContext() == (GraphicReader*) 1 ) + if( rGraphic.GetContext() == reinterpret_cast<GraphicReader*>(1) ) rGraphic.SetContext( NULL ); // set LOGSIZE flag always, if not explicitly disabled @@ -1501,7 +1501,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat } else if( aFilterName.equalsIgnoreAsciiCase( IMP_SVG ) ) { - if( rGraphic.GetContext() == (GraphicReader*) 1 ) + if( rGraphic.GetContext() == reinterpret_cast<GraphicReader*>(1) ) rGraphic.SetContext( NULL ); const sal_uInt32 nStreamPosition(rIStream.Tell()); @@ -1570,7 +1570,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat } else if( aFilterName.equalsIgnoreAsciiCase( IMP_XBM ) ) { - if( rGraphic.GetContext() == (GraphicReader*) 1 ) + if( rGraphic.GetContext() == reinterpret_cast<GraphicReader*>(1) ) rGraphic.SetContext( NULL ); if( !ImportXBM( rIStream, rGraphic ) ) @@ -1578,7 +1578,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat } else if( aFilterName.equalsIgnoreAsciiCase( IMP_XPM ) ) { - if( rGraphic.GetContext() == (GraphicReader*) 1 ) + if( rGraphic.GetContext() == reinterpret_cast<GraphicReader*>(1) ) rGraphic.SetContext( NULL ); if( !ImportXPM( rIStream, rGraphic ) ) diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index a3633cd1eedf..9602e852910b 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -797,8 +797,8 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) bool ImportGIF( SvStream & rStm, Graphic& rGraphic ) { - GIFReader* pGIFReader = (GIFReader*) rGraphic.GetContext(); - sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); + GIFReader* pGIFReader = static_cast<GIFReader*>(rGraphic.GetContext()); + sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); ReadState eReadState; bool bRet = true; diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index b2910844843c..95603d4dc6b9 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -338,7 +338,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) bool ImportXBM( SvStream& rStm, Graphic& rGraphic ) { - XBMReader* pXBMReader = (XBMReader*) rGraphic.GetContext(); + XBMReader* pXBMReader = static_cast<XBMReader*>( rGraphic.GetContext() ); ReadState eReadState; bool bRet = true; diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index 04bc86645a8d..3b4b562e3eb9 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -640,7 +640,7 @@ bool XPMReader::ImplGetString( void ) bool ImportXPM( SvStream& rStm, Graphic& rGraphic ) { - XPMReader* pXPMReader = (XPMReader*) rGraphic.GetContext(); + XPMReader* pXPMReader = static_cast<XPMReader*>(rGraphic.GetContext()); ReadState eReadState; bool bRet = true; diff --git a/vcl/source/filter/jpeg/jpeg.cxx b/vcl/source/filter/jpeg/jpeg.cxx index 2f448e141fa0..1f7d0e1ab387 100644 --- a/vcl/source/filter/jpeg/jpeg.cxx +++ b/vcl/source/filter/jpeg/jpeg.cxx @@ -30,7 +30,7 @@ bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, s ReadState eReadState; bool bReturn = true; - JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext(); + JPEGReader* pJPEGReader = static_cast<JPEGReader*>( rGraphic.GetContext() ); if( !pJPEGReader ) { diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 369be8b4b5d2..ac64e2bb7b82 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -989,7 +989,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { case( META_PIXEL_ACTION ): { - const MetaPixelAction* pA = (const MetaPixelAction*) pAction; + const MetaPixelAction* pA = static_cast<const MetaPixelAction*>(pAction); ImplCheckLineAttr(); ImplBeginRecord( WIN_EMR_SETPIXELV ); @@ -1003,7 +1003,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if( maVDev.IsLineColor() ) { - const MetaPointAction* pA = (const MetaPointAction*) pAction; + const MetaPointAction* pA = static_cast<const MetaPointAction*>(pAction); ImplCheckLineAttr(); ImplBeginRecord( WIN_EMR_SETPIXELV ); @@ -1018,7 +1018,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if( maVDev.IsLineColor() ) { - const MetaLineAction* pA = (const MetaLineAction*) pAction; + const MetaLineAction* pA = static_cast<const MetaLineAction*>(pAction); if(pA->GetLineInfo().IsDefault()) { @@ -1053,7 +1053,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if( maVDev.IsLineColor() || maVDev.IsFillColor() ) { - const MetaRectAction* pA = (const MetaRectAction*) pAction; + const MetaRectAction* pA = static_cast<const MetaRectAction*>(pAction); ImplCheckFillAttr(); ImplCheckLineAttr(); @@ -1069,7 +1069,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if( maVDev.IsLineColor() || maVDev.IsFillColor() ) { - const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction; + const MetaRoundRectAction* pA = static_cast<const MetaRoundRectAction*>(pAction); ImplCheckFillAttr(); ImplCheckLineAttr(); @@ -1086,7 +1086,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if( maVDev.IsLineColor() || maVDev.IsFillColor() ) { - const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction; + const MetaEllipseAction* pA = static_cast<const MetaEllipseAction*>(pAction); ImplCheckFillAttr(); ImplCheckLineAttr(); @@ -1111,27 +1111,27 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { case( META_ARC_ACTION ): { - const MetaArcAction* pA = (const MetaArcAction*) pAction; + const MetaArcAction* pA = static_cast<const MetaArcAction*>(pAction); aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_ARC ); } break; case( META_PIE_ACTION ): { - const MetaPieAction* pA = (const MetaPieAction*) pAction; + const MetaPieAction* pA = static_cast<const MetaPieAction*>(pAction); aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_PIE ); } break; case( META_CHORD_ACTION ): { - const MetaChordAction* pA = (const MetaChordAction*) pAction; + const MetaChordAction* pA = static_cast<const MetaChordAction*>(pAction); aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_CHORD ); } break; case( META_POLYGON_ACTION ): - aPoly = ( (const MetaPolygonAction*) pAction )->GetPolygon(); + aPoly = static_cast<const MetaPolygonAction*>(pAction)->GetPolygon(); break; } @@ -1144,7 +1144,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { if( maVDev.IsLineColor() ) { - const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction; + const MetaPolyLineAction* pA = static_cast<const MetaPolyLineAction*>(pAction); const Polygon& rPoly = pA->GetPolygon(); if( rPoly.GetSize() ) @@ -1166,13 +1166,13 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_POLYPOLYGON_ACTION ): { if( maVDev.IsLineColor() || maVDev.IsFillColor() ) - ImplWritePolyPolygonRecord( ( (const MetaPolyPolygonAction*) pAction )->GetPolyPolygon() ); + ImplWritePolyPolygonRecord( static_cast<const MetaPolyPolygonAction*>(pAction)->GetPolyPolygon() ); } break; case( META_GRADIENT_ACTION ): { - const MetaGradientAction* pA = (const MetaGradientAction*) pAction; + const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pAction); GDIMetaFile aTmpMtf; maVDev.AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf ); @@ -1182,7 +1182,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_HATCH_ACTION: { - const MetaHatchAction* pA = (const MetaHatchAction*) pAction; + const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pAction); GDIMetaFile aTmpMtf; maVDev.AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf ); @@ -1192,9 +1192,9 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_TRANSPARENT_ACTION: { - const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon(); + const PolyPolygon& rPolyPoly = static_cast<const MetaTransparentAction*>(pAction)->GetPolyPolygon(); if( rPolyPoly.Count() ) - ImplWritePlusFillPolygonRecord( rPolyPoly[0], ( (MetaTransparentAction*)pAction)->GetTransparence() ); + ImplWritePlusFillPolygonRecord( rPolyPoly[0], static_cast<const MetaTransparentAction*>(pAction)->GetTransparence() ); ImplCheckFillAttr(); ImplCheckLineAttr(); ImplWritePolyPolygonRecord( rPolyPoly ); @@ -1207,7 +1207,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_FLOATTRANSPARENT_ACTION: { - const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction; + const MetaFloatTransparentAction* pA = static_cast<const MetaFloatTransparentAction*>(pAction); GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() ); Point aSrcPt( aTmpMtf.GetPrefMapMode().GetOrigin() ); @@ -1238,7 +1238,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_EPS_ACTION ): { - const MetaEPSAction* pA = (const MetaEPSAction*) pAction; + const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pAction); const GDIMetaFile aSubstitute( pA->GetSubstitute() ); for( size_t i = 0, nCount = aSubstitute.GetActionSize(); i < nCount; i++ ) @@ -1270,21 +1270,21 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_BMP_ACTION: { - const MetaBmpAction* pA = (const MetaBmpAction *) pAction; + const MetaBmpAction* pA = static_cast<const MetaBmpAction *>(pAction); ImplWriteBmpRecord( pA->GetBitmap(), pA->GetPoint(), maVDev.PixelToLogic( pA->GetBitmap().GetSizePixel() ), WIN_SRCCOPY ); } break; case META_BMPSCALE_ACTION: { - const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction; + const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction); ImplWriteBmpRecord( pA->GetBitmap(), pA->GetPoint(), pA->GetSize(), WIN_SRCCOPY ); } break; case META_BMPSCALEPART_ACTION: { - const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction; + const MetaBmpScalePartAction* pA = static_cast<const MetaBmpScalePartAction*>(pAction); Bitmap aTmp( pA->GetBitmap() ); if( aTmp.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ) ) @@ -1294,7 +1294,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_BMPEX_ACTION: { - const MetaBmpExAction* pA = (const MetaBmpExAction *) pAction; + const MetaBmpExAction* pA = static_cast<const MetaBmpExAction *>(pAction); Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); @@ -1312,7 +1312,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_BMPEXSCALE_ACTION: { - const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction; + const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction); Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); @@ -1330,7 +1330,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_BMPEXSCALEPART_ACTION: { - const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction; + const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction); BitmapEx aBmpEx( pA->GetBitmapEx() ); aBmpEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); Bitmap aBmp( aBmpEx.GetBitmap() ); @@ -1350,7 +1350,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_TEXT_ACTION: { - const MetaTextAction* pA = (const MetaTextAction*) pAction; + const MetaTextAction* pA = static_cast<const MetaTextAction*>(pAction); const OUString aText = pA->GetText().copy( pA->GetIndex(), std::min(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); ImplCheckTextAttr(); @@ -1360,7 +1360,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_TEXTRECT_ACTION: { - const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction; + const MetaTextRectAction* pA = static_cast<const MetaTextRectAction*>(pAction); const OUString aText( pA->GetText() ); ImplCheckTextAttr(); @@ -1370,7 +1370,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_TEXTARRAY_ACTION: { - const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction; + const MetaTextArrayAction* pA = static_cast<const MetaTextArrayAction*>(pAction); const OUString aText = pA->GetText().copy( pA->GetIndex(), std::min(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); ImplCheckTextAttr(); @@ -1380,7 +1380,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case META_STRETCHTEXT_ACTION: { - const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction; + const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pAction); const OUString aText = pA->GetText().copy( pA->GetIndex(), std::min(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); ImplCheckTextAttr(); @@ -1418,7 +1418,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) ( (MetaAction*) pAction )->Execute( &maVDev ); ImplBeginRecord( WIN_EMR_INTERSECTCLIPRECT ); - ImplWriteRect( ( (MetaISectRectClipRegionAction*) pAction )->GetRect() ); + ImplWriteRect( static_cast<const MetaISectRectClipRegionAction*>(pAction)->GetRect() ); ImplEndRecord(); } break; @@ -1461,13 +1461,13 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_RASTEROP_ACTION ): { ( (MetaAction*) pAction )->Execute( &maVDev ); - ImplWriteRasterOp( ( (MetaRasterOpAction*) pAction )->GetRasterOp() ); + ImplWriteRasterOp( static_cast<const MetaRasterOpAction*>(pAction)->GetRasterOp() ); } break; case( META_LAYOUTMODE_ACTION ): { - ComplexTextLayoutMode nLayoutMode = ( (MetaLayoutModeAction*) pAction )->GetLayoutMode(); + ComplexTextLayoutMode nLayoutMode = static_cast<const MetaLayoutModeAction*>(pAction)->GetLayoutMode(); mnHorTextAlign = 0; if ((nLayoutMode & TEXT_LAYOUT_BIDI_RTL) != TEXT_LAYOUT_DEFAULT) { diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 8538d932a63d..a4b0b67ebd81 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1020,7 +1020,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { case META_PIXEL_ACTION: { - const MetaPixelAction* pA = (const MetaPixelAction *) pMA; + const MetaPixelAction* pA = static_cast<const MetaPixelAction *>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_SetPixel( pA->GetPoint(), pA->GetColor() ); @@ -1029,7 +1029,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_POINT_ACTION: { - const MetaPointAction* pA = (const MetaPointAction*) pMA; + const MetaPointAction* pA = static_cast<const MetaPointAction*>(pMA); const Point& rPt = pA->GetPoint(); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); @@ -1040,7 +1040,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_LINE_ACTION: { - const MetaLineAction* pA = (const MetaLineAction *) pMA; + const MetaLineAction* pA = static_cast<const MetaLineAction *>(pMA); if(pA->GetLineInfo().IsDefault()) { aSrcLineInfo = pA->GetLineInfo(); @@ -1061,7 +1061,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_RECT_ACTION: { - const MetaRectAction* pA = (const MetaRectAction*) pMA; + const MetaRectAction* pA = static_cast<const MetaRectAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_Rectangle( pA->GetRect() ); @@ -1070,7 +1070,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_ROUNDRECT_ACTION: { - const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pMA; + const MetaRoundRectAction* pA = static_cast<const MetaRoundRectAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_RoundRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() ); @@ -1079,7 +1079,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_ELLIPSE_ACTION: { - const MetaEllipseAction* pA = (const MetaEllipseAction*) pMA; + const MetaEllipseAction* pA = static_cast<const MetaEllipseAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_Ellipse( pA->GetRect() ); @@ -1088,7 +1088,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_ARC_ACTION: { - const MetaArcAction* pA = (const MetaArcAction*) pMA; + const MetaArcAction* pA = static_cast<const MetaArcAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_Arc( pA->GetRect(),pA->GetStartPoint(),pA->GetEndPoint() ); @@ -1097,7 +1097,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_PIE_ACTION: { - const MetaPieAction* pA = (const MetaPieAction*) pMA; + const MetaPieAction* pA = static_cast<const MetaPieAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_Pie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); @@ -1106,7 +1106,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_CHORD_ACTION: { - const MetaChordAction* pA = (const MetaChordAction*) pMA; + const MetaChordAction* pA = static_cast<const MetaChordAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_Chord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); @@ -1115,7 +1115,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_POLYLINE_ACTION: { - const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pMA; + const MetaPolyLineAction* pA = static_cast<const MetaPolyLineAction*>(pMA); const Polygon& rPoly = pA->GetPolygon(); if( rPoly.GetSize() ) @@ -1137,7 +1137,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_POLYGON_ACTION: { - const MetaPolygonAction* pA = (const MetaPolygonAction*) pMA; + const MetaPolygonAction* pA = static_cast<const MetaPolygonAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_Polygon( pA->GetPolygon() ); @@ -1146,7 +1146,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_POLYPOLYGON_ACTION: { - const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pMA; + const MetaPolyPolygonAction* pA = static_cast<const MetaPolyPolygonAction*>(pMA); aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); WMFRecord_PolyPolygon( pA->GetPolyPolygon() ); @@ -1155,7 +1155,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_TEXTRECT_ACTION: { - const MetaTextRectAction * pA = (const MetaTextRectAction*)pMA; + const MetaTextRectAction * pA = static_cast<const MetaTextRectAction*>(pMA); OUString aTemp( pA->GetText() ); aSrcLineInfo = LineInfo(); SetAllAttr(); @@ -1168,7 +1168,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_TEXT_ACTION: { - const MetaTextAction * pA = (const MetaTextAction*) pMA; + const MetaTextAction * pA = static_cast<const MetaTextAction*>(pMA); OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); aSrcLineInfo = LineInfo(); SetAllAttr(); @@ -1179,7 +1179,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_TEXTARRAY_ACTION: { - const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pMA; + const MetaTextArrayAction* pA = static_cast<const MetaTextArrayAction*>(pMA); OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); aSrcLineInfo = LineInfo(); @@ -1191,7 +1191,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_STRETCHTEXT_ACTION: { - const MetaStretchTextAction* pA = (const MetaStretchTextAction *) pMA; + const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction *>(pMA); OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ); sal_uInt16 nLen,i; @@ -1214,21 +1214,21 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_BMP_ACTION: { - const MetaBmpAction* pA = (const MetaBmpAction *) pMA; + const MetaBmpAction* pA = static_cast<const MetaBmpAction *>(pMA); WMFRecord_StretchDIB( pA->GetPoint(), pA->GetBitmap().GetSizePixel(), pA->GetBitmap() ); } break; case META_BMPSCALE_ACTION: { - const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pMA; + const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pMA); WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), pA->GetBitmap() ); } break; case META_BMPSCALEPART_ACTION: { - const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pMA; + const MetaBmpScalePartAction* pA = static_cast<const MetaBmpScalePartAction*>(pMA); Bitmap aTmp( pA->GetBitmap() ); if( aTmp.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ) ) @@ -1238,7 +1238,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_BMPEX_ACTION: { - const MetaBmpExAction* pA = (const MetaBmpExAction *) pMA; + const MetaBmpExAction* pA = static_cast<const MetaBmpExAction *>(pMA); Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); @@ -1256,7 +1256,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_BMPEXSCALE_ACTION: { - const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pMA; + const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pMA); Bitmap aBmp( pA->GetBitmapEx().GetBitmap() ); Bitmap aMsk( pA->GetBitmapEx().GetMask() ); @@ -1274,7 +1274,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_BMPEXSCALEPART_ACTION: { - const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pMA; + const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pMA); BitmapEx aBmpEx( pA->GetBitmapEx() ); aBmpEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); Bitmap aBmp( aBmpEx.GetBitmap() ); @@ -1294,7 +1294,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_GRADIENT_ACTION: { - const MetaGradientAction* pA = (const MetaGradientAction*) pMA; + const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA); GDIMetaFile aTmpMtf; pVirDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf ); @@ -1304,7 +1304,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_HATCH_ACTION: { - const MetaHatchAction* pA = (const MetaHatchAction*) pMA; + const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA); GDIMetaFile aTmpMtf; pVirDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf ); @@ -1314,7 +1314,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_WALLPAPER_ACTION: { - const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pMA; + const MetaWallpaperAction* pA = static_cast<const MetaWallpaperAction*>(pMA); const Color& rColor = pA->GetWallpaper().GetColor(); const Color aOldLineColor( aSrcLineColor ); const Color aOldFillColor( aSrcFillColor ); @@ -1331,14 +1331,14 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_ISECTRECTCLIPREGION_ACTION: { - const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pMA; + const MetaISectRectClipRegionAction* pA = static_cast<const MetaISectRectClipRegionAction*>(pMA); WMFRecord_IntersectClipRect( pA->GetRect() ); } break; case META_LINECOLOR_ACTION: { - const MetaLineColorAction* pA = (const MetaLineColorAction*) pMA; + const MetaLineColorAction* pA = static_cast<const MetaLineColorAction*>(pMA); if( pA->IsSetting() ) aSrcLineColor = pA->GetColor(); @@ -1349,7 +1349,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_FILLCOLOR_ACTION: { - const MetaFillColorAction* pA = (const MetaFillColorAction*) pMA; + const MetaFillColorAction* pA = static_cast<const MetaFillColorAction*>(pMA); if( pA->IsSetting() ) aSrcFillColor = pA->GetColor(); @@ -1360,14 +1360,14 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_TEXTCOLOR_ACTION: { - const MetaTextColorAction* pA = (const MetaTextColorAction*) pMA; + const MetaTextColorAction* pA = static_cast<const MetaTextColorAction*>(pMA); aSrcTextColor = pA->GetColor(); } break; case META_TEXTFILLCOLOR_ACTION: { - const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pMA; + const MetaTextFillColorAction* pA = static_cast<const MetaTextFillColorAction*>(pMA); if( pA->IsSetting() ) aSrcFont.SetFillColor( pA->GetColor() ); else @@ -1377,14 +1377,14 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_TEXTALIGN_ACTION: { - const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pMA; + const MetaTextAlignAction* pA = static_cast<const MetaTextAlignAction*>(pMA); eSrcTextAlign = pA->GetTextAlign(); } break; case META_MAPMODE_ACTION: { - const MetaMapModeAction* pA = (const MetaMapModeAction*) pMA; + const MetaMapModeAction* pA = static_cast<const MetaMapModeAction*>(pMA); if (aSrcMapMode!=pA->GetMapMode()) { @@ -1438,7 +1438,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_FONT_ACTION: { - const MetaFontAction* pA = (const MetaFontAction*) pMA; + const MetaFontAction* pA = static_cast<const MetaFontAction*>(pMA); aSrcFont = pA->GetFont(); if ( (aSrcFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW) @@ -1455,7 +1455,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_PUSH_ACTION: { - const MetaPushAction* pA = (const MetaPushAction*)pMA; + const MetaPushAction* pA = static_cast<const MetaPushAction*>(pMA); WMFWriterAttrStackMember* pAt = new WMFWriterAttrStackMember; pAt->nFlags = pA->GetFlags(); @@ -1517,7 +1517,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_EPS_ACTION : { - const MetaEPSAction* pA = (const MetaEPSAction*)pMA; + const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pMA); const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() ); size_t nCount = aGDIMetaFile.GetActionSize(); @@ -1526,7 +1526,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i ); if ( pMetaAct->GetType() == META_BMPSCALE_ACTION ) { - const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*)pMetaAct; + const MetaBmpScaleAction* pBmpScaleAction = static_cast<const MetaBmpScaleAction*>(pMetaAct); WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), pBmpScaleAction->GetBitmap() ); break; } @@ -1536,7 +1536,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_RASTEROP_ACTION: { - const MetaRasterOpAction* pA = (const MetaRasterOpAction*) pMA; + const MetaRasterOpAction* pA = static_cast<const MetaRasterOpAction*>(pMA); eSrcRasterOp=pA->GetRasterOp(); } break; @@ -1545,13 +1545,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { aSrcLineInfo = LineInfo(); SetLineAndFillAttr(); - WMFRecord_PolyPolygon( ( (MetaTransparentAction*) pMA )->GetPolyPolygon() ); + WMFRecord_PolyPolygon( static_cast<const MetaTransparentAction*>(pMA)->GetPolyPolygon() ); } break; case META_FLOATTRANSPARENT_ACTION: { - const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pMA; + const MetaFloatTransparentAction* pA = static_cast<const MetaFloatTransparentAction*>(pMA); GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() ); Point aSrcPt( aTmpMtf.GetPrefMapMode().GetOrigin() ); @@ -1582,7 +1582,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case( META_LAYOUTMODE_ACTION ): { - ComplexTextLayoutMode nLayoutMode = ( (MetaLayoutModeAction*) pMA )->GetLayoutMode(); + ComplexTextLayoutMode nLayoutMode = static_cast<const MetaLayoutModeAction*>(pMA)->GetLayoutMode(); eSrcHorTextAlign = 0; // TA_LEFT if ((nLayoutMode & TEXT_LAYOUT_BIDI_RTL) != TEXT_LAYOUT_DEFAULT) { diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index b2d0dde6820e..81fd6a399bdd 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -789,7 +789,7 @@ bool BitmapEx::Create( const ::com::sun::star::uno::Reference< { // 0 means get BitmapEx uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 ); - boost::scoped_ptr<BitmapEx> pBitmapEx((BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue())); + boost::scoped_ptr<BitmapEx> pBitmapEx(reinterpret_cast<BitmapEx*>( *reinterpret_cast<const sal_Int64*>(aAny.getValue()))); if( pBitmapEx ) { *this = *pBitmapEx; diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 24fed3716190..1da9c12da22e 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -1399,7 +1399,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { case( META_PIXEL_ACTION ): { - MetaPixelAction* pAct = (MetaPixelAction*) pAction; + const MetaPixelAction* pAct = static_cast<const MetaPixelAction*>(pAction); rOStm.WriteInt16( GDI_PIXEL_ACTION ); rOStm.WriteInt32( 18 ); @@ -1411,7 +1411,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_POINT_ACTION ): { - MetaPointAction* pAct = (MetaPointAction*) pAction; + const MetaPointAction* pAct = static_cast<const MetaPointAction*>(pAction); rOStm.WriteInt16( GDI_POINT_ACTION ); rOStm.WriteInt32( 12 ); @@ -1422,7 +1422,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_LINE_ACTION ): { - MetaLineAction* pAct = (MetaLineAction*) pAction; + const MetaLineAction* pAct = static_cast<const MetaLineAction*>(pAction); const LineInfo& rInfo = pAct->GetLineInfo(); const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle())); const bool bLineJoin(bFatLine && basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin()); @@ -1491,7 +1491,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_RECT_ACTION ): { - MetaRectAction* pAct = (MetaRectAction*) pAction; + const MetaRectAction* pAct = static_cast<const MetaRectAction*>(pAction); rOStm.WriteInt16( GDI_RECT_ACTION ); rOStm.WriteInt32( 28 ); @@ -1504,7 +1504,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_ROUNDRECT_ACTION ): { - MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction; + const MetaRoundRectAction* pAct = static_cast<const MetaRoundRectAction*>(pAction); rOStm.WriteInt16( GDI_RECT_ACTION ); rOStm.WriteInt32( 28 ); @@ -1517,7 +1517,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_ELLIPSE_ACTION ): { - MetaEllipseAction* pAct = (MetaEllipseAction*) pAction; + const MetaEllipseAction* pAct = static_cast<const MetaEllipseAction*>(pAction); rOStm.WriteInt16( GDI_ELLIPSE_ACTION ); rOStm.WriteInt32( 20 ); @@ -1528,7 +1528,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_ARC_ACTION ): { - MetaArcAction* pAct = (MetaArcAction*) pAction; + const MetaArcAction* pAct = static_cast<const MetaArcAction*>(pAction); rOStm.WriteInt16( GDI_ARC_ACTION ); rOStm.WriteInt32( 36 ); @@ -1541,7 +1541,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_PIE_ACTION ): { - MetaPieAction* pAct = (MetaPieAction*) pAction; + const MetaPieAction* pAct = static_cast<const MetaPieAction*>(pAction); rOStm.WriteInt16( GDI_PIE_ACTION ); rOStm.WriteInt32( 36 ); @@ -1554,10 +1554,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_CHORD_ACTION ): { - MetaChordAction* pAct = (MetaChordAction*) pAction; - Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(), + const MetaChordAction* pAct = static_cast<const MetaChordAction*>(pAction); + Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_CHORD ); - const sal_uInt16 nPoints = aChordPoly.GetSize(); + const sal_uInt16 nPoints = aChordPoly.GetSize(); rOStm.WriteInt16( GDI_POLYGON_ACTION ); rOStm.WriteInt32( ( 8 + ( nPoints << 3 ) ) ); @@ -1572,14 +1572,14 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_POLYLINE_ACTION ): { // #i102224# - MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction; + const MetaPolyLineAction* pAct = static_cast<const MetaPolyLineAction*>(pAction); // #i102224# Here the possible curved nature of Polygon was // ignored (for all those years). Adapted to at least write // a polygon representing the curve as good as possible - Polygon aSimplePoly; - pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); + Polygon aSimplePoly; + pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); const LineInfo& rInfo = pAct->GetLineInfo(); - const sal_uInt16 nPoints(aSimplePoly.GetSize()); + const sal_uInt16 nPoints(aSimplePoly.GetSize()); const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle())); const bool bLineJoin(bFatLine && basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin()); const bool bLineCap(bFatLine && com::sun::star::drawing::LineCap_BUTT != rInfo.GetLineCap()); @@ -1658,12 +1658,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_POLYGON_ACTION ): { - MetaPolygonAction* pAct = (MetaPolygonAction*)pAction; + const MetaPolygonAction* pAct = static_cast<const MetaPolygonAction*>(pAction); // #i102224# Here the possible curved nature of Polygon was // ignored (for all those years). Adapted to at least write // a polygon representing the curve as good as possible - Polygon aSimplePoly; - pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); + Polygon aSimplePoly; + pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); const sal_uInt16 nPoints(aSimplePoly.GetSize()); rOStm.WriteInt16( GDI_POLYGON_ACTION ); @@ -1685,7 +1685,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_POLYPOLYGON_ACTION ): { - MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction; + const MetaPolyPolygonAction* pAct = static_cast<const MetaPolyPolygonAction*>(pAction); ImplWritePolyPolyAction( rOStm, pAct->GetPolyPolygon() ); nCount++; @@ -1698,10 +1698,9 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXT_ACTION ): { - MetaTextAction* pAct = (MetaTextAction*) pAction; - OUString aUniText( pAct->GetText() ); - OString aText(OUStringToOString(aUniText, - rActualCharSet)); + const MetaTextAction* pAct = static_cast<const MetaTextAction*>(pAction); + OUString aUniText( pAct->GetText() ); + OString aText(OUStringToOString(aUniText, rActualCharSet)); const sal_Int32 nStrLen = aText.getLength(); if ( ImplWriteUnicodeComment( rOStm, aUniText ) ) @@ -1720,7 +1719,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTARRAY_ACTION ): { - MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction; + const MetaTextArrayAction* pAct = static_cast<const MetaTextArrayAction*>(pAction); OString aText(OUStringToOString(pAct->GetText(), rActualCharSet)); OUString aUniText = pAct->GetText().copy( pAct->GetIndex(), @@ -1764,11 +1763,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_STRETCHTEXT_ACTION ): { - MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction; - OUString aUniText( pAct->GetText() ); - OString aText(OUStringToOString(aUniText, - rActualCharSet)); - const sal_Int32 nStrLen = aText.getLength(); + const MetaStretchTextAction* pAct = static_cast<const MetaStretchTextAction*>(pAction); + OUString aUniText( pAct->GetText() ); + OString aText(OUStringToOString(aUniText, rActualCharSet)); + const sal_Int32 nStrLen = aText.getLength(); if ( ImplWriteUnicodeComment( rOStm, aUniText ) ) nCount++; @@ -1787,7 +1785,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMP_ACTION ): { - MetaBmpAction* pAct = (MetaBmpAction*) pAction; + const MetaBmpAction* pAct = static_cast<const MetaBmpAction*>(pAction); rOStm.WriteInt16( GDI_BITMAP_ACTION ); rOStm.WriteInt32( 12 ); @@ -1799,7 +1797,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPSCALE_ACTION ): { - MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction; + const MetaBmpScaleAction* pAct = static_cast<const MetaBmpScaleAction*>(pAction); rOStm.WriteInt16( GDI_BITMAPSCALE_ACTION ); rOStm.WriteInt32( 20 ); @@ -1812,7 +1810,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPSCALEPART_ACTION ): { - MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction; + const MetaBmpScalePartAction* pAct = static_cast<const MetaBmpScalePartAction*>(pAction); rOStm.WriteInt16( GDI_BITMAPSCALEPART_ACTION ); rOStm.WriteInt32( 36 ); @@ -1827,8 +1825,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPEX_ACTION ): { - MetaBmpExAction* pAct = (MetaBmpExAction*) pAction; - const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); + const MetaBmpExAction* pAct = static_cast<const MetaBmpExAction*>(pAction); + const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); rOStm.WriteInt16( GDI_BITMAP_ACTION ); rOStm.WriteInt32( 12 ); @@ -1840,8 +1838,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPEXSCALE_ACTION ): { - MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; - const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); + const MetaBmpExScaleAction* pAct = static_cast<const MetaBmpExScaleAction*>(pAction); + const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); rOStm.WriteInt16( GDI_BITMAPSCALE_ACTION ); rOStm.WriteInt32( 20 ); @@ -1854,8 +1852,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPEXSCALEPART_ACTION ): { - MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; - const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); + const MetaBmpExScalePartAction* pAct = static_cast<const MetaBmpExScalePartAction*>(pAction); + const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); rOStm.WriteInt16( GDI_BITMAPSCALEPART_ACTION ); rOStm.WriteInt32( 36 ); @@ -1870,8 +1868,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_GRADIENT_ACTION ): { - MetaGradientAction* pAct = (MetaGradientAction*) pAction; - const Gradient& rGrad = pAct->GetGradient(); + const MetaGradientAction* pAct = static_cast<const MetaGradientAction*>(pAction); + const Gradient& rGrad = pAct->GetGradient(); rOStm.WriteInt16( GDI_GRADIENT_ACTION ); rOStm.WriteInt32( 46 ); @@ -1891,8 +1889,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_GRADIENTEX_ACTION ): { - const MetaGradientExAction* pA = (MetaGradientExAction*) pAction; - sal_uLong nOldPos, nNewPos; + const MetaGradientExAction* pA = static_cast<const MetaGradientExAction*>(pAction); + sal_uLong nOldPos, nNewPos; // write RefPoint comment rOStm.WriteInt16( GDI_GRADIENTEX_COMMENT ); @@ -1918,8 +1916,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_WALLPAPER_ACTION ): { - MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction; - const Color& rColor = pAct->GetWallpaper().GetColor(); + const MetaWallpaperAction* pAct = static_cast<const MetaWallpaperAction*>(pAction); + const Color& rColor = pAct->GetWallpaper().GetColor(); ImplWritePushAction( rOStm ); ImplWriteLineColor( rOStm, rColor, 1 ); @@ -1938,9 +1936,9 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_CLIPREGION_ACTION ): { - MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction; - const Region& rRegion = pAct->GetRegion(); - Rectangle aClipRect; + const MetaClipRegionAction* pAct = static_cast<const MetaClipRegionAction*>(pAction); + const Region& rRegion = pAct->GetRegion(); + Rectangle aClipRect; rOStm.WriteInt16( GDI_CLIPREGION_ACTION ); rOStm.WriteInt32( 24 ); @@ -1965,7 +1963,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_ISECTRECTCLIPREGION_ACTION ): { - MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction; + const MetaISectRectClipRegionAction* pAct = static_cast<const MetaISectRectClipRegionAction*>(pAction); rOStm.WriteInt16( GDI_ISECTCLIPREGION_ACTION ); rOStm.WriteInt32( 20 ); @@ -1976,7 +1974,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_MOVECLIPREGION_ACTION ): { - MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction; + const MetaMoveClipRegionAction* pAct = static_cast<const MetaMoveClipRegionAction*>(pAction); rOStm.WriteInt16( GDI_MOVECLIPREGION_ACTION ); rOStm.WriteInt32( 12 ); @@ -1988,7 +1986,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_LINECOLOR_ACTION ): { - MetaLineColorAction* pAct = (MetaLineColorAction*) pAction; + const MetaLineColorAction* pAct = static_cast<const MetaLineColorAction*>(pAction); ImplWriteLineColor( rOStm, rLineCol = pAct->GetColor(), pAct->IsSetting() ? 1 : 0 ); nCount++; } @@ -1996,7 +1994,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_FILLCOLOR_ACTION ): { - MetaFillColorAction* pAct = (MetaFillColorAction*) pAction; + const MetaFillColorAction* pAct = static_cast<const MetaFillColorAction*>(pAction); ImplWriteFillColor( rOStm, pAct->GetColor(), pAct->IsSetting() ? 1 : 0 ); nCount++; } @@ -2004,7 +2002,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_FONT_ACTION ): { - rSaveVDev.SetFont( ( (MetaFontAction*) pAction )->GetFont() ); + rSaveVDev.SetFont( static_cast<const MetaFontAction*>(pAction)->GetFont() ); ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet ); nCount++; } @@ -2014,7 +2012,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { vcl::Font aSaveFont( rSaveVDev.GetFont() ); - aSaveFont.SetColor( ( (MetaTextColorAction*) pAction )->GetColor() ); + aSaveFont.SetColor( static_cast<const MetaTextColorAction*>(pAction)->GetColor() ); rSaveVDev.SetFont( aSaveFont ); ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet ); nCount++; @@ -2023,8 +2021,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTFILLCOLOR_ACTION ): { - MetaTextFillColorAction* pAct = (MetaTextFillColorAction*) pAction; - vcl::Font aSaveFont( rSaveVDev.GetFont() ); + const MetaTextFillColorAction* pAct = static_cast<const MetaTextFillColorAction*>(pAction); + vcl::Font aSaveFont( rSaveVDev.GetFont() ); if( pAct->IsSetting() ) aSaveFont.SetFillColor( pAct->GetColor() ); @@ -2041,7 +2039,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { vcl::Font aSaveFont( rSaveVDev.GetFont() ); - aSaveFont.SetAlign( ( (MetaTextAlignAction*) pAction )->GetTextAlign() ); + aSaveFont.SetAlign( static_cast<const MetaTextAlignAction*>(pAction)->GetTextAlign() ); rSaveVDev.SetFont( aSaveFont ); ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet ); nCount++; @@ -2050,7 +2048,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_MAPMODE_ACTION ): { - MetaMapModeAction* pAct = (MetaMapModeAction*) pAction; + const MetaMapModeAction* pAct = static_cast<const MetaMapModeAction*>(pAction); rOStm.WriteInt16( GDI_MAPMODE_ACTION ); rOStm.WriteInt32( 30 ); @@ -2093,7 +2091,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_RASTEROP_ACTION ): { - MetaRasterOpAction* pAct = (MetaRasterOpAction*) pAction; + const MetaRasterOpAction* pAct = static_cast<const MetaRasterOpAction*>(pAction); if( ( pAct->GetRasterOp() != ROP_0 ) && ( pAct->GetRasterOp() != ROP_1 ) ) { @@ -2145,10 +2143,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TRANSPARENT_ACTION ): { - const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon(); - const sal_Int16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence(); - const sal_Int16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10; - sal_uLong nOldPos, nNewPos; + const PolyPolygon& rPolyPoly = static_cast<const MetaTransparentAction*>(pAction)->GetPolyPolygon(); + const sal_Int16 nTrans = static_cast<const MetaTransparentAction*>(pAction)->GetTransparence(); + const sal_Int16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10; + sal_uLong nOldPos, nNewPos; // write transparence comment rOStm.WriteInt16( GDI_TRANSPARENT_COMMENT ); @@ -2204,7 +2202,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_FLOATTRANSPARENT_ACTION ): { - const MetaFloatTransparentAction* pA = (MetaFloatTransparentAction*) pAction; + const MetaFloatTransparentAction* pA = static_cast<const MetaFloatTransparentAction*>(pAction); const GDIMetaFile& rTransMtf = pA->GetGDIMetaFile(); const Point& rPos = pA->GetPoint(); const Size& rSize = pA->GetSize(); @@ -2266,10 +2264,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_HATCH_ACTION ): { - const MetaHatchAction* pA = (MetaHatchAction*) pAction; + const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pAction); const PolyPolygon& rPolyPoly = pA->GetPolyPolygon(); const Hatch& rHatch = pA->GetHatch(); - sal_uLong nOldPos, nNewPos, nAddCount; + sal_uLong nOldPos, nNewPos, nAddCount; // write hatch comment rOStm.WriteInt16( GDI_HATCH_COMMENT ); @@ -2309,10 +2307,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_REFPOINT_ACTION ): { - const MetaRefPointAction* pA = (MetaRefPointAction*) pAction; + const MetaRefPointAction* pA = static_cast<const MetaRefPointAction*>(pAction); const Point& rRefPoint = pA->GetRefPoint(); const bool bSet = pA->IsSetting(); - sal_uLong nOldPos, nNewPos; + sal_uLong nOldPos, nNewPos; // write RefPoint comment rOStm.WriteInt16( GDI_REFPOINT_COMMENT ); @@ -2338,9 +2336,9 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTLINECOLOR_ACTION ): { - const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction; + const MetaTextLineColorAction* pA = static_cast<const MetaTextLineColorAction*>(pAction); const Color& rColor = pA->GetColor(); - const bool bSet = pA->IsSetting(); + const bool bSet = pA->IsSetting(); sal_uLong nOldPos, nNewPos; // write RefPoint comment @@ -2367,12 +2365,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTLINE_ACTION ): { - const MetaTextLineAction* pA = (MetaTextLineAction*) pAction; + const MetaTextLineAction* pA = static_cast<const MetaTextLineAction*>(pAction); const Point& rStartPt = pA->GetStartPoint(); const sal_Int32 nWidth = (sal_Int32) pA->GetWidth(); const FontStrikeout eStrikeout = pA->GetStrikeout(); const FontUnderline eUnderline = pA->GetUnderline(); - sal_uLong nOldPos, nNewPos; + sal_uLong nOldPos, nNewPos; // write RefPoint comment rOStm.WriteInt16( GDI_TEXTLINE_COMMENT ); @@ -2401,9 +2399,9 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_COMMENT_ACTION ): { - const MetaCommentAction* pA = (MetaCommentAction*) pAction; + const MetaCommentAction* pA = static_cast<const MetaCommentAction*>(pAction); const sal_uInt32 nDataSize = pA->GetDataSize(); - sal_uLong nOldPos, nNewPos; + sal_uLong nOldPos, nNewPos; // write RefPoint comment rOStm.WriteInt16( GDI_COMMENT_COMMENT ); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 6d3d8a08a62c..ff71ff3212c9 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -374,7 +374,10 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) // flush output from time to time if( i++ > nSyncCount ) - ( (vcl::Window*) pOut )->Flush(), i = 0; + { + static_cast<vcl::Window*>( pOut )->Flush(); + i = 0; + } } pAction = NextAction(); @@ -839,7 +842,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect ) } else if( nType == META_CLIPREGION_ACTION ) { - MetaClipRegionAction* pOldAct = (MetaClipRegionAction*)pAct; + MetaClipRegionAction* pOldAct = static_cast<MetaClipRegionAction*>(pAct); Region aNewReg( aCurRect ); if( pOldAct->IsClipping() ) aNewReg.Intersect( pOldAct->GetRegion() ); @@ -941,7 +944,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) { case( META_PIXEL_ACTION ): { - MetaPixelAction* pAct = (MetaPixelAction*) pAction; + MetaPixelAction* pAct = static_cast<MetaPixelAction*>(pAction); aMtf.AddAction( new MetaPixelAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetColor() ) ); } @@ -949,14 +952,14 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_POINT_ACTION ): { - MetaPointAction* pAct = (MetaPointAction*) pAction; + MetaPointAction* pAct = static_cast<MetaPointAction*>(pAction); aMtf.AddAction( new MetaPointAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ) ) ); } break; case( META_LINE_ACTION ): { - MetaLineAction* pAct = (MetaLineAction*) pAction; + MetaLineAction* pAct = static_cast<MetaLineAction*>(pAction); aMtf.AddAction( new MetaLineAction( ImplGetRotatedPoint( pAct->GetStartPoint(), aRotAnchor, aRotOffset, fSin, fCos ), ImplGetRotatedPoint( pAct->GetEndPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetLineInfo() ) ); @@ -965,14 +968,14 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_RECT_ACTION ): { - MetaRectAction* pAct = (MetaRectAction*) pAction; + MetaRectAction* pAct = static_cast<MetaRectAction*>(pAction); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) ); } break; case( META_ROUNDRECT_ACTION ): { - MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction; + MetaRoundRectAction* pAct = static_cast<MetaRoundRectAction*>(pAction); const Polygon aRoundRectPoly( pAct->GetRect(), pAct->GetHorzRound(), pAct->GetVertRound() ); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aRoundRectPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) ); @@ -981,7 +984,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_ELLIPSE_ACTION ): { - MetaEllipseAction* pAct = (MetaEllipseAction*) pAction; + MetaEllipseAction* pAct = static_cast<MetaEllipseAction*>(pAction); const Polygon aEllipsePoly( pAct->GetRect().Center(), pAct->GetRect().GetWidth() >> 1, pAct->GetRect().GetHeight() >> 1 ); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aEllipsePoly, aRotAnchor, aRotOffset, fSin, fCos ) ) ); @@ -990,7 +993,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_ARC_ACTION ): { - MetaArcAction* pAct = (MetaArcAction*) pAction; + MetaArcAction* pAct = static_cast<MetaArcAction*>(pAction); const Polygon aArcPoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_ARC ); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aArcPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) ); @@ -999,7 +1002,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_PIE_ACTION ): { - MetaPieAction* pAct = (MetaPieAction*) pAction; + MetaPieAction* pAct = static_cast<MetaPieAction*>(pAction); const Polygon aPiePoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_PIE ); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aPiePoly, aRotAnchor, aRotOffset, fSin, fCos ) ) ); @@ -1008,7 +1011,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_CHORD_ACTION ): { - MetaChordAction* pAct = (MetaChordAction*) pAction; + MetaChordAction* pAct = static_cast<MetaChordAction*>(pAction); const Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_CHORD ); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aChordPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) ); @@ -1017,28 +1020,28 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_POLYLINE_ACTION ): { - MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction; + MetaPolyLineAction* pAct = static_cast<MetaPolyLineAction*>(pAction); aMtf.AddAction( new MetaPolyLineAction( ImplGetRotatedPolygon( pAct->GetPolygon(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetLineInfo() ) ); } break; case( META_POLYGON_ACTION ): { - MetaPolygonAction* pAct = (MetaPolygonAction*) pAction; + MetaPolygonAction* pAct = static_cast<MetaPolygonAction*>(pAction); aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( pAct->GetPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ) ); } break; case( META_POLYPOLYGON_ACTION ): { - MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction; + MetaPolyPolygonAction* pAct = static_cast<MetaPolyPolygonAction*>(pAction); aMtf.AddAction( new MetaPolyPolygonAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ) ); } break; case( META_TEXT_ACTION ): { - MetaTextAction* pAct = (MetaTextAction*) pAction; + MetaTextAction* pAct = static_cast<MetaTextAction*>(pAction); aMtf.AddAction( new MetaTextAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetText(), pAct->GetIndex(), pAct->GetLen() ) ); } @@ -1046,7 +1049,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_TEXTARRAY_ACTION ): { - MetaTextArrayAction* pAct = (MetaTextArrayAction*) pAction; + MetaTextArrayAction* pAct = static_cast<MetaTextArrayAction*>(pAction); aMtf.AddAction( new MetaTextArrayAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetText(), pAct->GetDXArray(), pAct->GetIndex(), pAct->GetLen() ) ); } @@ -1054,7 +1057,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_STRETCHTEXT_ACTION ): { - MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction; + MetaStretchTextAction* pAct = static_cast<MetaStretchTextAction*>(pAction); aMtf.AddAction( new MetaStretchTextAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetWidth(), pAct->GetText(), pAct->GetIndex(), pAct->GetLen() ) ); } @@ -1062,7 +1065,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_TEXTLINE_ACTION ): { - MetaTextLineAction* pAct = (MetaTextLineAction*) pAction; + MetaTextLineAction* pAct = static_cast<MetaTextLineAction*>(pAction); aMtf.AddAction( new MetaTextLineAction( ImplGetRotatedPoint( pAct->GetStartPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetWidth(), pAct->GetStrikeout(), pAct->GetUnderline(), pAct->GetOverline() ) ); } @@ -1070,7 +1073,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_BMPSCALE_ACTION ): { - MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction; + MetaBmpScaleAction* pAct = static_cast<MetaBmpScaleAction*>(pAction); Polygon aBmpPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetPoint(), pAct->GetSize() ), aRotAnchor, aRotOffset, fSin, fCos ) ); Rectangle aBmpRect( aBmpPoly.GetBoundRect() ); BitmapEx aBmpEx( pAct->GetBitmap() ); @@ -1083,7 +1086,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_BMPSCALEPART_ACTION ): { - MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction; + MetaBmpScalePartAction* pAct = static_cast<MetaBmpScalePartAction*>(pAction); Polygon aBmpPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetDestPoint(), pAct->GetDestSize() ), aRotAnchor, aRotOffset, fSin, fCos ) ); Rectangle aBmpRect( aBmpPoly.GetBoundRect() ); BitmapEx aBmpEx( pAct->GetBitmap() ); @@ -1097,7 +1100,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_BMPEXSCALE_ACTION ): { - MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; + MetaBmpExScaleAction* pAct = static_cast<MetaBmpExScaleAction*>(pAction); Polygon aBmpPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetPoint(), pAct->GetSize() ), aRotAnchor, aRotOffset, fSin, fCos ) ); Rectangle aBmpRect( aBmpPoly.GetBoundRect() ); BitmapEx aBmpEx( pAct->GetBitmapEx() ); @@ -1110,7 +1113,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_BMPEXSCALEPART_ACTION ): { - MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; + MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); Polygon aBmpPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetDestPoint(), pAct->GetDestSize() ), aRotAnchor, aRotOffset, fSin, fCos ) ); Rectangle aBmpRect( aBmpPoly.GetBoundRect() ); BitmapEx aBmpEx( pAct->GetBitmapEx() ); @@ -1124,7 +1127,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_GRADIENT_ACTION ): { - MetaGradientAction* pAct = (MetaGradientAction*) pAction; + MetaGradientAction* pAct = static_cast<MetaGradientAction*>(pAction); ImplAddGradientEx( aMtf, aMapVDev, ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ), @@ -1134,7 +1137,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_GRADIENTEX_ACTION ): { - MetaGradientExAction* pAct = (MetaGradientExAction*) pAction; + MetaGradientExAction* pAct = static_cast<MetaGradientExAction*>(pAction); aMtf.AddAction( new MetaGradientExAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetGradient() ) ); } @@ -1143,7 +1146,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) // Handle gradientex comment block correctly case( META_COMMENT_ACTION ): { - MetaCommentAction* pCommentAct = (MetaCommentAction*) pAction; + MetaCommentAction* pCommentAct = static_cast<MetaCommentAction*>(pAction); if( pCommentAct->GetComment() == "XGRAD_SEQ_BEGIN" ) { int nBeginComments( 1 ); @@ -1157,14 +1160,14 @@ void GDIMetaFile::Rotate( long nAngle10 ) if( META_GRADIENTEX_ACTION == nType ) { // Add rotated gradientex - MetaGradientExAction* pAct = (MetaGradientExAction*) pAction; + MetaGradientExAction* pAct = static_cast<MetaGradientExAction*>(pAction); ImplAddGradientEx( aMtf, aMapVDev, ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetGradient() ); } else if( META_COMMENT_ACTION == nType) { - MetaCommentAction* pAct = (MetaCommentAction*) pAction; + MetaCommentAction* pAct = static_cast<MetaCommentAction*>(pAction); if( pAct->GetComment() == "XGRAD_SEQ_END" ) { // handle nested blocks @@ -1231,7 +1234,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_HATCH_ACTION ): { - MetaHatchAction* pAct = (MetaHatchAction*) pAction; + MetaHatchAction* pAct = static_cast<MetaHatchAction*>(pAction); Hatch aHatch( pAct->GetHatch() ); aHatch.SetAngle( aHatch.GetAngle() + (sal_uInt16) nAngle10 ); @@ -1242,7 +1245,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_TRANSPARENT_ACTION ): { - MetaTransparentAction* pAct = (MetaTransparentAction*) pAction; + MetaTransparentAction* pAct = static_cast<MetaTransparentAction*>(pAction); aMtf.AddAction( new MetaTransparentAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->GetTransparence() ) ); } @@ -1250,7 +1253,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_FLOATTRANSPARENT_ACTION ): { - MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction; + MetaFloatTransparentAction* pAct = static_cast<MetaFloatTransparentAction*>(pAction); GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() ); Polygon aMtfPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetPoint(), pAct->GetSize() ), aRotAnchor, aRotOffset, fSin, fCos ) ); Rectangle aMtfRect( aMtfPoly.GetBoundRect() ); @@ -1263,7 +1266,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_EPS_ACTION ): { - MetaEPSAction* pAct = (MetaEPSAction*) pAction; + MetaEPSAction* pAct = static_cast<MetaEPSAction*>(pAction); GDIMetaFile aEPSMtf( pAct->GetSubstitute() ); Polygon aEPSPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetPoint(), pAct->GetSize() ), aRotAnchor, aRotOffset, fSin, fCos ) ); Rectangle aEPSRect( aEPSPoly.GetBoundRect() ); @@ -1276,7 +1279,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_CLIPREGION_ACTION ): { - MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction; + MetaClipRegionAction* pAct = static_cast<MetaClipRegionAction*>(pAction); if( pAct->IsClipping() && pAct->GetRegion().HasPolyPolygonOrB2DPolyPolygon() ) aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetAsPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), true ) ); @@ -1290,7 +1293,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_ISECTRECTCLIPREGION_ACTION ): { - MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction; + MetaISectRectClipRegionAction* pAct = static_cast<MetaISectRectClipRegionAction*>(pAction); aMtf.AddAction( new MetaISectRegionClipRegionAction(Region( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos )) ) ); @@ -1299,7 +1302,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_ISECTREGIONCLIPREGION_ACTION ): { - MetaISectRegionClipRegionAction* pAct = (MetaISectRegionClipRegionAction*) pAction; + MetaISectRegionClipRegionAction* pAct = static_cast<MetaISectRegionClipRegionAction*>(pAction); const Region& rRegion = pAct->GetRegion(); if( rRegion.HasPolyPolygonOrB2DPolyPolygon() ) @@ -1314,14 +1317,14 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_REFPOINT_ACTION ): { - MetaRefPointAction* pAct = (MetaRefPointAction*) pAction; + MetaRefPointAction* pAct = static_cast<MetaRefPointAction*>(pAction); aMtf.AddAction( new MetaRefPointAction( ImplGetRotatedPoint( pAct->GetRefPoint(), aRotAnchor, aRotOffset, fSin, fCos ), pAct->IsSetting() ) ); } break; case( META_FONT_ACTION ): { - MetaFontAction* pAct = (MetaFontAction*) pAction; + MetaFontAction* pAct = static_cast<MetaFontAction*>(pAction); vcl::Font aFont( pAct->GetFont() ); aFont.SetOrientation( aFont.GetOrientation() + (sal_uInt16) nAngle10 ); @@ -1421,7 +1424,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai { case( META_PIXEL_ACTION ): { - MetaPixelAction* pAct = (MetaPixelAction*) pAction; + MetaPixelAction* pAct = static_cast<MetaPixelAction*>(pAction); ImplActionBounds( aBound, Rectangle( OutputDevice::LogicToLogic( pAct->GetPoint(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aMapVDev.PixelToLogic( Size( 1, 1 ), GetPrefMapMode() ) ), @@ -1431,7 +1434,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_POINT_ACTION ): { - MetaPointAction* pAct = (MetaPointAction*) pAction; + MetaPointAction* pAct = static_cast<MetaPointAction*>(pAction); ImplActionBounds( aBound, Rectangle( OutputDevice::LogicToLogic( pAct->GetPoint(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aMapVDev.PixelToLogic( Size( 1, 1 ), GetPrefMapMode() ) ), @@ -1441,7 +1444,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_LINE_ACTION ): { - MetaLineAction* pAct = (MetaLineAction*) pAction; + MetaLineAction* pAct = static_cast<MetaLineAction*>(pAction); Point aP1( pAct->GetStartPoint() ), aP2( pAct->GetEndPoint() ); Rectangle aRect( aP1, aP2 ); aRect.Justify(); @@ -1460,28 +1463,28 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_RECT_ACTION ): { - MetaRectAction* pAct = (MetaRectAction*) pAction; + MetaRectAction* pAct = static_cast<MetaRectAction*>(pAction); ImplActionBounds( aBound, OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); } break; case( META_ROUNDRECT_ACTION ): { - MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction; + MetaRoundRectAction* pAct = static_cast<MetaRoundRectAction*>(pAction); ImplActionBounds( aBound, OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); } break; case( META_ELLIPSE_ACTION ): { - MetaEllipseAction* pAct = (MetaEllipseAction*) pAction; + MetaEllipseAction* pAct = static_cast<MetaEllipseAction*>(pAction); ImplActionBounds( aBound, OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); } break; case( META_ARC_ACTION ): { - MetaArcAction* pAct = (MetaArcAction*) pAction; + MetaArcAction* pAct = static_cast<MetaArcAction*>(pAction); // FIXME: this is imprecise // e.g. for small arcs the whole rectangle is WAY too large ImplActionBounds( aBound, OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); @@ -1490,7 +1493,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_PIE_ACTION ): { - MetaPieAction* pAct = (MetaPieAction*) pAction; + MetaPieAction* pAct = static_cast<MetaPieAction*>(pAction); // FIXME: this is imprecise // e.g. for small arcs the whole rectangle is WAY too large ImplActionBounds( aBound, OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); @@ -1499,7 +1502,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_CHORD_ACTION ): { - MetaChordAction* pAct = (MetaChordAction*) pAction; + MetaChordAction* pAct = static_cast<MetaChordAction*>(pAction); // FIXME: this is imprecise // e.g. for small arcs the whole rectangle is WAY too large ImplActionBounds( aBound, OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); @@ -1508,7 +1511,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_POLYLINE_ACTION ): { - MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction; + MetaPolyLineAction* pAct = static_cast<MetaPolyLineAction*>(pAction); Rectangle aRect( pAct->GetPolygon().GetBoundRect() ); if(pUseHairline) @@ -1525,7 +1528,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_POLYGON_ACTION ): { - MetaPolygonAction* pAct = (MetaPolygonAction*) pAction; + MetaPolygonAction* pAct = static_cast<MetaPolygonAction*>(pAction); Rectangle aRect( pAct->GetPolygon().GetBoundRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); } @@ -1533,7 +1536,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_POLYPOLYGON_ACTION ): { - MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction; + MetaPolyPolygonAction* pAct = static_cast<MetaPolyPolygonAction*>(pAction); Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, pUseHairline ); } @@ -1541,7 +1544,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_TEXT_ACTION ): { - MetaTextAction* pAct = (MetaTextAction*) pAction; + MetaTextAction* pAct = static_cast<MetaTextAction*>(pAction); Rectangle aRect; // hdu said base = index aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen() ); @@ -1553,7 +1556,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_TEXTARRAY_ACTION ): { - MetaTextArrayAction* pAct = (MetaTextArrayAction*) pAction; + MetaTextArrayAction* pAct = static_cast<MetaTextArrayAction*>(pAction); Rectangle aRect; // hdu said base = index aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(), @@ -1566,7 +1569,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_STRETCHTEXT_ACTION ): { - MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction; + MetaStretchTextAction* pAct = static_cast<MetaStretchTextAction*>(pAction); Rectangle aRect; // hdu said base = index aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(), @@ -1579,7 +1582,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_TEXTLINE_ACTION ): { - MetaTextLineAction* pAct = (MetaTextLineAction*) pAction; + MetaTextLineAction* pAct = static_cast<MetaTextLineAction*>(pAction); // measure a test string to get ascend and descent right static const sal_Unicode pStr[] = { 0xc4, 0x67, 0 }; OUString aStr( pStr ); @@ -1595,7 +1598,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_BMPSCALE_ACTION ): { - MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction; + MetaBmpScaleAction* pAct = static_cast<MetaBmpScaleAction*>(pAction); Rectangle aRect( pAct->GetPoint(), pAct->GetSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1603,7 +1606,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_BMPSCALEPART_ACTION ): { - MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction; + MetaBmpScalePartAction* pAct = static_cast<MetaBmpScalePartAction*>(pAction); Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1611,7 +1614,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_BMPEXSCALE_ACTION ): { - MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; + MetaBmpExScaleAction* pAct = static_cast<MetaBmpExScaleAction*>(pAction); Rectangle aRect( pAct->GetPoint(), pAct->GetSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1619,7 +1622,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_BMPEXSCALEPART_ACTION ): { - MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; + MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1627,7 +1630,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_GRADIENT_ACTION ): { - MetaGradientAction* pAct = (MetaGradientAction*) pAction; + MetaGradientAction* pAct = static_cast<MetaGradientAction*>(pAction); Rectangle aRect( pAct->GetRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1635,7 +1638,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_GRADIENTEX_ACTION ): { - MetaGradientExAction* pAct = (MetaGradientExAction*) pAction; + MetaGradientExAction* pAct = static_cast<MetaGradientExAction*>(pAction); Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1649,7 +1652,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_HATCH_ACTION ): { - MetaHatchAction* pAct = (MetaHatchAction*) pAction; + MetaHatchAction* pAct = static_cast<MetaHatchAction*>(pAction); Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1657,7 +1660,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_TRANSPARENT_ACTION ): { - MetaTransparentAction* pAct = (MetaTransparentAction*) pAction; + MetaTransparentAction* pAct = static_cast<MetaTransparentAction*>(pAction); Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1665,7 +1668,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_FLOATTRANSPARENT_ACTION ): { - MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction; + MetaFloatTransparentAction* pAct = static_cast<MetaFloatTransparentAction*>(pAction); // MetaFloatTransparentAction is defined limiting it's content Metafile // to it's geometry definition(Point, Size), so use these directly const Rectangle aRect( pAct->GetPoint(), pAct->GetSize() ); @@ -1675,7 +1678,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_EPS_ACTION ): { - MetaEPSAction* pAct = (MetaEPSAction*) pAction; + MetaEPSAction* pAct = static_cast<MetaEPSAction*>(pAction); Rectangle aRect( pAct->GetPoint(), pAct->GetSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1683,7 +1686,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_CLIPREGION_ACTION ): { - MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction; + MetaClipRegionAction* pAct = static_cast<MetaClipRegionAction*>(pAction); if( pAct->IsClipping() ) aClipStack.back() = OutputDevice::LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ); else @@ -1693,7 +1696,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_ISECTRECTCLIPREGION_ACTION ): { - MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction; + MetaISectRectClipRegionAction* pAct = static_cast<MetaISectRectClipRegionAction*>(pAction); Rectangle aRect( OutputDevice::LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) ); if( aClipStack.back().IsEmpty() ) aClipStack.back() = aRect; @@ -1704,7 +1707,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_ISECTREGIONCLIPREGION_ACTION ): { - MetaISectRegionClipRegionAction* pAct = (MetaISectRegionClipRegionAction*) pAction; + MetaISectRegionClipRegionAction* pAct = static_cast<MetaISectRegionClipRegionAction*>(pAction); Rectangle aRect( OutputDevice::LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) ); if( aClipStack.back().IsEmpty() ) aClipStack.back() = aRect; @@ -1715,7 +1718,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_BMP_ACTION ): { - MetaBmpAction* pAct = (MetaBmpAction*) pAction; + MetaBmpAction* pAct = static_cast<MetaBmpAction*>(pAction); Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmap().GetSizePixel() ) ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1723,7 +1726,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_BMPEX_ACTION ): { - MetaBmpExAction* pAct = (MetaBmpExAction*) pAction; + MetaBmpExAction* pAct = static_cast<MetaBmpExAction*>(pAction); Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmapEx().GetSizePixel() ) ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1731,7 +1734,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_MASK_ACTION ): { - MetaMaskAction* pAct = (MetaMaskAction*) pAction; + MetaMaskAction* pAct = static_cast<MetaMaskAction*>(pAction); Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmap().GetSizePixel() ) ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1739,7 +1742,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_MASKSCALE_ACTION ): { - MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction; + MetaMaskScalePartAction* pAct = static_cast<MetaMaskScalePartAction*>(pAction); Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1747,7 +1750,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_MASKSCALEPART_ACTION ): { - MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction; + MetaMaskScalePartAction* pAct = static_cast<MetaMaskScalePartAction*>(pAction); Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1755,7 +1758,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_WALLPAPER_ACTION ): { - MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction; + MetaWallpaperAction* pAct = static_cast<MetaWallpaperAction*>(pAction); Rectangle aRect( pAct->GetRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1763,7 +1766,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_TEXTRECT_ACTION ): { - MetaTextRectAction* pAct = (MetaTextRectAction*) pAction; + MetaTextRectAction* pAct = static_cast<MetaTextRectAction*>(pAction); Rectangle aRect( pAct->GetRect() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack, 0 ); } @@ -1771,7 +1774,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai case( META_MOVECLIPREGION_ACTION ): { - MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction; + MetaMoveClipRegionAction* pAct = static_cast<MetaMoveClipRegionAction*>(pAction); if( ! aClipStack.back().IsEmpty() ) { Size aDelta( pAct->GetHorzMove(), pAct->GetVertMove() ); @@ -1787,7 +1790,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, Rectangle* pHai if( nActionType == META_PUSH_ACTION ) { - MetaPushAction* pAct = (MetaPushAction*) pAction; + MetaPushAction* pAct = static_cast<MetaPushAction*>(pAction); aPushFlagStack.push_back( pAct->GetFlags() ); if( aPushFlagStack.back() & PUSH_CLIPREGION ) { @@ -1926,14 +1929,14 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol { case( META_PIXEL_ACTION ): { - MetaPixelAction* pAct = (MetaPixelAction*) pAction; + MetaPixelAction* pAct = static_cast<MetaPixelAction*>(pAction); aMtf.push_back( new MetaPixelAction( pAct->GetPoint(), pFncCol( pAct->GetColor(), pColParam ) ) ); } break; case( META_LINECOLOR_ACTION ): { - MetaLineColorAction* pAct = (MetaLineColorAction*) pAction; + MetaLineColorAction* pAct = static_cast<MetaLineColorAction*>(pAction); if( !pAct->IsSetting() ) pAct->Duplicate(); @@ -1946,7 +1949,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_FILLCOLOR_ACTION ): { - MetaFillColorAction* pAct = (MetaFillColorAction*) pAction; + MetaFillColorAction* pAct = static_cast<MetaFillColorAction*>(pAction); if( !pAct->IsSetting() ) pAct->Duplicate(); @@ -1959,14 +1962,14 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_TEXTCOLOR_ACTION ): { - MetaTextColorAction* pAct = (MetaTextColorAction*) pAction; + MetaTextColorAction* pAct = static_cast<MetaTextColorAction*>(pAction); aMtf.push_back( new MetaTextColorAction( pFncCol( pAct->GetColor(), pColParam ) ) ); } break; case( META_TEXTFILLCOLOR_ACTION ): { - MetaTextFillColorAction* pAct = (MetaTextFillColorAction*) pAction; + MetaTextFillColorAction* pAct = static_cast<MetaTextFillColorAction*>(pAction); if( !pAct->IsSetting() ) pAct->Duplicate(); @@ -1979,7 +1982,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_TEXTLINECOLOR_ACTION ): { - MetaTextLineColorAction* pAct = (MetaTextLineColorAction*) pAction; + MetaTextLineColorAction* pAct = static_cast<MetaTextLineColorAction*>(pAction); if( !pAct->IsSetting() ) pAct->Duplicate(); @@ -1992,7 +1995,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_OVERLINECOLOR_ACTION ): { - MetaOverlineColorAction* pAct = (MetaOverlineColorAction*) pAction; + MetaOverlineColorAction* pAct = static_cast<MetaOverlineColorAction*>(pAction); if( !pAct->IsSetting() ) pAct->Duplicate(); @@ -2005,7 +2008,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_FONT_ACTION ): { - MetaFontAction* pAct = (MetaFontAction*) pAction; + MetaFontAction* pAct = static_cast<MetaFontAction*>(pAction); vcl::Font aFont( pAct->GetFont() ); aFont.SetColor( pFncCol( aFont.GetColor(), pColParam ) ); @@ -2016,7 +2019,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_WALLPAPER_ACTION ): { - MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction; + MetaWallpaperAction* pAct = static_cast<MetaWallpaperAction*>(pAction); Wallpaper aWall( pAct->GetWallpaper() ); const Rectangle& rRect = pAct->GetRect(); @@ -2048,7 +2051,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_BMPSCALE_ACTION ): { - MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction; + MetaBmpScaleAction* pAct = static_cast<MetaBmpScaleAction*>(pAction); aMtf.push_back( new MetaBmpScaleAction( pAct->GetPoint(), pAct->GetSize(), pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ) ); } @@ -2056,7 +2059,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_BMPSCALEPART_ACTION ): { - MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction; + MetaBmpScalePartAction* pAct = static_cast<MetaBmpScalePartAction*>(pAction); aMtf.push_back( new MetaBmpScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), pAct->GetSrcPoint(), pAct->GetSrcSize(), pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ) @@ -2066,7 +2069,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_BMPEXSCALE_ACTION ): { - MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; + MetaBmpExScaleAction* pAct = static_cast<MetaBmpExScaleAction*>(pAction); aMtf.push_back( new MetaBmpExScaleAction( pAct->GetPoint(), pAct->GetSize(), pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ) ); @@ -2075,7 +2078,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_BMPEXSCALEPART_ACTION ): { - MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; + MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); aMtf.push_back( new MetaBmpExScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), pAct->GetSrcPoint(), pAct->GetSrcSize(), pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ) @@ -2085,7 +2088,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_MASKSCALE_ACTION ): { - MetaMaskScaleAction* pAct = (MetaMaskScaleAction*) pAction; + MetaMaskScaleAction* pAct = static_cast<MetaMaskScaleAction*>(pAction); aMtf.push_back( new MetaMaskScaleAction( pAct->GetPoint(), pAct->GetSize(), pAct->GetBitmap(), pFncCol( pAct->GetColor(), pColParam ) ) @@ -2095,7 +2098,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_MASKSCALEPART_ACTION ): { - MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction; + MetaMaskScalePartAction* pAct = static_cast<MetaMaskScalePartAction*>(pAction); aMtf.push_back( new MetaMaskScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), pAct->GetSrcPoint(), pAct->GetSrcSize(), pAct->GetBitmap(), @@ -2106,7 +2109,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_GRADIENT_ACTION ): { - MetaGradientAction* pAct = (MetaGradientAction*) pAction; + MetaGradientAction* pAct = static_cast<MetaGradientAction*>(pAction); Gradient aGradient( pAct->GetGradient() ); aGradient.SetStartColor( pFncCol( aGradient.GetStartColor(), pColParam ) ); @@ -2117,7 +2120,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_GRADIENTEX_ACTION ): { - MetaGradientExAction* pAct = (MetaGradientExAction*) pAction; + MetaGradientExAction* pAct = static_cast<MetaGradientExAction*>(pAction); Gradient aGradient( pAct->GetGradient() ); aGradient.SetStartColor( pFncCol( aGradient.GetStartColor(), pColParam ) ); @@ -2128,7 +2131,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_HATCH_ACTION ): { - MetaHatchAction* pAct = (MetaHatchAction*) pAction; + MetaHatchAction* pAct = static_cast<MetaHatchAction*>(pAction); Hatch aHatch( pAct->GetHatch() ); aHatch.SetColor( pFncCol( aHatch.GetColor(), pColParam ) ); @@ -2138,7 +2141,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_FLOATTRANSPARENT_ACTION ): { - MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction; + MetaFloatTransparentAction* pAct = static_cast<MetaFloatTransparentAction*>(pAction); GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() ); aTransMtf.ImplExchangeColors( pFncCol, pColParam, pFncBmp, pBmpParam ); @@ -2151,7 +2154,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol case( META_EPS_ACTION ): { - MetaEPSAction* pAct = (MetaEPSAction*) pAction; + MetaEPSAction* pAct = static_cast<MetaEPSAction*>(pAction); GDIMetaFile aSubst( pAct->GetSubstitute() ); aSubst.ImplExchangeColors( pFncCol, pColParam, pFncBmp, pBmpParam ); @@ -2354,7 +2357,7 @@ sal_uLong GDIMetaFile::GetChecksum() const { case( META_BMP_ACTION ): { - MetaBmpAction* pAct = (MetaBmpAction*) pAction; + MetaBmpAction* pAct = static_cast<MetaBmpAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2372,7 +2375,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_BMPSCALE_ACTION ): { - MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction; + MetaBmpScaleAction* pAct = static_cast<MetaBmpScaleAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2396,7 +2399,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_BMPSCALEPART_ACTION ): { - MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction; + MetaBmpScalePartAction* pAct = static_cast<MetaBmpScalePartAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2432,7 +2435,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_BMPEX_ACTION ): { - MetaBmpExAction* pAct = (MetaBmpExAction*) pAction; + MetaBmpExAction* pAct = static_cast<MetaBmpExAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2450,7 +2453,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_BMPEXSCALE_ACTION ): { - MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; + MetaBmpExScaleAction* pAct = static_cast<MetaBmpExScaleAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2474,7 +2477,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_BMPEXSCALEPART_ACTION ): { - MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; + MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2510,7 +2513,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_MASK_ACTION ): { - MetaMaskAction* pAct = (MetaMaskAction*) pAction; + MetaMaskAction* pAct = static_cast<MetaMaskAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2531,7 +2534,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_MASKSCALE_ACTION ): { - MetaMaskScaleAction* pAct = (MetaMaskScaleAction*) pAction; + MetaMaskScaleAction* pAct = static_cast<MetaMaskScaleAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2558,7 +2561,7 @@ sal_uLong GDIMetaFile::GetChecksum() const case( META_MASKSCALEPART_ACTION ): { - MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction; + MetaMaskScalePartAction* pAct = static_cast<MetaMaskScalePartAction*>(pAction); ShortToSVBT16( pAct->GetType(), aBT16 ); nCrc = rtl_crc32( nCrc, aBT16, 2 ); @@ -2597,14 +2600,14 @@ sal_uLong GDIMetaFile::GetChecksum() const case META_EPS_ACTION : { - MetaEPSAction* pAct = (MetaEPSAction*) pAction; + MetaEPSAction* pAct = static_cast<MetaEPSAction*>(pAction); nCrc = rtl_crc32( nCrc, pAct->GetLink().GetData(), pAct->GetLink().GetDataSize() ); } break; case META_CLIPREGION_ACTION : { - MetaClipRegionAction& rAct = dynamic_cast<MetaClipRegionAction&>(*pAction); + MetaClipRegionAction& rAct = static_cast<MetaClipRegionAction&>(*pAction); const Region& rRegion = rAct.GetRegion(); if(rRegion.HasPolyPolygonOrB2DPolyPolygon()) @@ -2695,35 +2698,35 @@ sal_uLong GDIMetaFile::GetSizeBytes() const // add sizes for large action content switch( pAction->GetType() ) { - case( META_BMP_ACTION ): nSizeBytes += ( (MetaBmpAction*) pAction )->GetBitmap().GetSizeBytes(); break; - case( META_BMPSCALE_ACTION ): nSizeBytes += ( (MetaBmpScaleAction*) pAction )->GetBitmap().GetSizeBytes(); break; - case( META_BMPSCALEPART_ACTION ): nSizeBytes += ( (MetaBmpScalePartAction*) pAction )->GetBitmap().GetSizeBytes(); break; + case( META_BMP_ACTION ): nSizeBytes += static_cast<MetaBmpAction*>( pAction )->GetBitmap().GetSizeBytes(); break; + case( META_BMPSCALE_ACTION ): nSizeBytes += static_cast<MetaBmpScaleAction*>( pAction )->GetBitmap().GetSizeBytes(); break; + case( META_BMPSCALEPART_ACTION ): nSizeBytes += static_cast<MetaBmpScalePartAction*>( pAction )->GetBitmap().GetSizeBytes(); break; - case( META_BMPEX_ACTION ): nSizeBytes += ( (MetaBmpExAction*) pAction )->GetBitmapEx().GetSizeBytes(); break; - case( META_BMPEXSCALE_ACTION ): nSizeBytes += ( (MetaBmpExScaleAction*) pAction )->GetBitmapEx().GetSizeBytes(); break; - case( META_BMPEXSCALEPART_ACTION ): nSizeBytes += ( (MetaBmpExScalePartAction*) pAction )->GetBitmapEx().GetSizeBytes(); break; + case( META_BMPEX_ACTION ): nSizeBytes += static_cast<MetaBmpExAction*>( pAction )->GetBitmapEx().GetSizeBytes(); break; + case( META_BMPEXSCALE_ACTION ): nSizeBytes += static_cast<MetaBmpExScaleAction*>( pAction )->GetBitmapEx().GetSizeBytes(); break; + case( META_BMPEXSCALEPART_ACTION ): nSizeBytes += static_cast<MetaBmpExScalePartAction*>( pAction )->GetBitmapEx().GetSizeBytes(); break; - case( META_MASK_ACTION ): nSizeBytes += ( (MetaMaskAction*) pAction )->GetBitmap().GetSizeBytes(); break; - case( META_MASKSCALE_ACTION ): nSizeBytes += ( (MetaMaskScaleAction*) pAction )->GetBitmap().GetSizeBytes(); break; - case( META_MASKSCALEPART_ACTION ): nSizeBytes += ( (MetaMaskScalePartAction*) pAction )->GetBitmap().GetSizeBytes(); break; + case( META_MASK_ACTION ): nSizeBytes += static_cast<MetaMaskAction*>( pAction )->GetBitmap().GetSizeBytes(); break; + case( META_MASKSCALE_ACTION ): nSizeBytes += static_cast<MetaMaskScaleAction*>( pAction )->GetBitmap().GetSizeBytes(); break; + case( META_MASKSCALEPART_ACTION ): nSizeBytes += static_cast<MetaMaskScalePartAction*>( pAction )->GetBitmap().GetSizeBytes(); break; - case( META_POLYLINE_ACTION ): nSizeBytes += ( ( (MetaPolyLineAction*) pAction )->GetPolygon().GetSize() * sizeof( Point ) ); break; - case( META_POLYGON_ACTION ): nSizeBytes += ( ( (MetaPolygonAction*) pAction )->GetPolygon().GetSize() * sizeof( Point ) ); break; + case( META_POLYLINE_ACTION ): nSizeBytes += static_cast<MetaPolyLineAction*>( pAction )->GetPolygon().GetSize() * sizeof( Point ); break; + case( META_POLYGON_ACTION ): nSizeBytes += static_cast<MetaPolygonAction*>( pAction )->GetPolygon().GetSize() * sizeof( Point ); break; case( META_POLYPOLYGON_ACTION ): { - const PolyPolygon& rPolyPoly = ( (MetaPolyPolygonAction*) pAction )->GetPolyPolygon(); + const PolyPolygon& rPolyPoly = static_cast<MetaPolyPolygonAction*>( pAction )->GetPolyPolygon(); for( sal_uInt16 n = 0; n < rPolyPoly.Count(); ++n ) nSizeBytes += ( rPolyPoly[ n ].GetSize() * sizeof( Point ) ); } break; - case( META_TEXT_ACTION ): nSizeBytes += ( ( (MetaTextAction*) pAction )->GetText().getLength() * sizeof( sal_Unicode ) ); break; - case( META_STRETCHTEXT_ACTION ): nSizeBytes += ( ( (MetaStretchTextAction*) pAction )->GetText().getLength() * sizeof( sal_Unicode ) ); break; - case( META_TEXTRECT_ACTION ): nSizeBytes += ( ( (MetaTextRectAction*) pAction )->GetText().getLength() * sizeof( sal_Unicode ) ); break; + case( META_TEXT_ACTION ): nSizeBytes += static_cast<MetaTextAction*>( pAction )->GetText().getLength() * sizeof( sal_Unicode ); break; + case( META_STRETCHTEXT_ACTION ): nSizeBytes += static_cast<MetaStretchTextAction*>( pAction )->GetText().getLength() * sizeof( sal_Unicode ); break; + case( META_TEXTRECT_ACTION ): nSizeBytes += static_cast<MetaTextRectAction*>( pAction )->GetText().getLength() * sizeof( sal_Unicode ); break; case( META_TEXTARRAY_ACTION ): { - MetaTextArrayAction* pTextArrayAction = (MetaTextArrayAction*) pAction; + MetaTextArrayAction* pTextArrayAction = static_cast<MetaTextArrayAction*>(pAction); nSizeBytes += ( pTextArrayAction->GetText().getLength() * sizeof( sal_Unicode ) ); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index f628f5595943..4fe916ac5ade 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -316,7 +316,7 @@ void Graphic::Save( SvStream& rOStm ) void Graphic::Assign( const SvDataCopyStream& rCopyStream ) { - *this = (const Graphic& ) rCopyStream; + *this = static_cast<const Graphic&>( rCopyStream ); } void Graphic::Clear() diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 096e67fa48ae..bf36ae962c1a 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -78,7 +78,7 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut, MapMode aTempMap( mpOut->GetMapMode() ); aTempMap.SetOrigin( Point() ); mpBackground->SetMapMode( aTempMap ); - ( (vcl::Window*) mpOut )->SaveBackground( maDispPt, maDispSz, Point(), *mpBackground ); + static_cast<vcl::Window*>( mpOut )->SaveBackground( maDispPt, maDispSz, Point(), *mpBackground ); mpBackground->SetMapMode( MapMode() ); } else @@ -282,7 +282,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ) delete pDev; if( mpOut->GetOutDevType() == OUTDEV_WINDOW ) - ( (vcl::Window*) mpOut )->Sync(); + static_cast<vcl::Window*>( mpOut )->Sync(); } } } @@ -296,7 +296,7 @@ void ImplAnimView::ImplRepaint() MapMode aTempMap( mpOut->GetMapMode() ); aTempMap.SetOrigin( Point() ); mpBackground->SetMapMode( aTempMap ); - ( (vcl::Window*) mpOut )->SaveBackground( maDispPt, maDispSz, Point(), *mpBackground ); + static_cast<vcl::Window*>( mpOut )->SaveBackground( maDispPt, maDispSz, Point(), *mpBackground ); mpBackground->SetMapMode( MapMode() ); } else diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 711229b92272..d48432941f0c 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -214,7 +214,7 @@ ImpGraphic::~ImpGraphic() { ImplClear(); - if( (sal_uLong) mpContext > 1UL ) + if( reinterpret_cast<sal_uLong>(mpContext) > 1UL ) delete mpContext; } diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 05a8bf51d615..e4ba7fcdb0d7 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -42,7 +42,9 @@ #define VECT_MAP( _def_pIn, _def_pOut, _def_nVal ) _def_pOut[_def_nVal]=(_def_pIn[_def_nVal]=((_def_nVal)*4L)+1L)+5L; #define BACK_MAP( _def_nVal ) ((((_def_nVal)+2)>>2)-1) -#define VECT_PROGRESS( _def_pProgress, _def_nVal ) if(_def_pProgress&&_def_pProgress->IsSet())(_def_pProgress->Call((void*)(sal_IntPtr)_def_nVal)); +#define VECT_PROGRESS( _def_pProgress, _def_nVal ) \ + if(_def_pProgress&&_def_pProgress->IsSet()) \ + (_def_pProgress->Call(reinterpret_cast<void*>(_def_nVal))); struct ChainMove { long nDX; long nDY; }; diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index faefe4b1e4ab..b1f2f5aac21d 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -316,8 +316,8 @@ void MetaPixelAction::Scale( double fScaleX, double fScaleY ) bool MetaPixelAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPt == ((MetaPixelAction&)rMetaAction).maPt ) && - ( maColor == ((MetaPixelAction&)rMetaAction).maColor ); + return ( maPt == static_cast<const MetaPixelAction&>(rMetaAction).maPt ) && + ( maColor == static_cast<const MetaPixelAction&>(rMetaAction).maColor ); } void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -371,7 +371,7 @@ void MetaPointAction::Scale( double fScaleX, double fScaleY ) bool MetaPointAction::Compare( const MetaAction& rMetaAction ) const { - return maPt == ((MetaPointAction&)rMetaAction).maPt; + return maPt == static_cast<const MetaPointAction&>(rMetaAction).maPt; } void MetaPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -438,9 +438,9 @@ void MetaLineAction::Scale( double fScaleX, double fScaleY ) bool MetaLineAction::Compare( const MetaAction& rMetaAction ) const { - return ( maLineInfo == ((MetaLineAction&)rMetaAction).maLineInfo ) && - ( maStartPt == ((MetaLineAction&)rMetaAction).maStartPt ) && - ( maEndPt == ((MetaLineAction&)rMetaAction).maEndPt ); + return ( maLineInfo == static_cast<const MetaLineAction&>(rMetaAction).maLineInfo ) && + ( maStartPt == static_cast<const MetaLineAction&>(rMetaAction).maStartPt ) && + ( maEndPt == static_cast<const MetaLineAction&>(rMetaAction).maEndPt ); } void MetaLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -504,7 +504,7 @@ void MetaRectAction::Scale( double fScaleX, double fScaleY ) bool MetaRectAction::Compare( const MetaAction& rMetaAction ) const { - return maRect == ((MetaRectAction&)rMetaAction).maRect; + return maRect == static_cast<const MetaRectAction&>(rMetaAction).maRect; } void MetaRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -563,9 +563,9 @@ void MetaRoundRectAction::Scale( double fScaleX, double fScaleY ) bool MetaRoundRectAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaRoundRectAction&)rMetaAction).maRect ) && - ( mnHorzRound == ((MetaRoundRectAction&)rMetaAction).mnHorzRound ) && - ( mnVertRound == ((MetaRoundRectAction&)rMetaAction).mnVertRound ); + return ( maRect == static_cast<const MetaRoundRectAction&>(rMetaAction).maRect ) && + ( mnHorzRound == static_cast<const MetaRoundRectAction&>(rMetaAction).mnHorzRound ) && + ( mnVertRound == static_cast<const MetaRoundRectAction&>(rMetaAction).mnVertRound ); } void MetaRoundRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -618,7 +618,7 @@ void MetaEllipseAction::Scale( double fScaleX, double fScaleY ) bool MetaEllipseAction::Compare( const MetaAction& rMetaAction ) const { - return maRect == ((MetaEllipseAction&)rMetaAction).maRect; + return maRect == static_cast<const MetaEllipseAction&>(rMetaAction).maRect; } void MetaEllipseAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -677,9 +677,9 @@ void MetaArcAction::Scale( double fScaleX, double fScaleY ) bool MetaArcAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaArcAction&)rMetaAction).maRect ) && - ( maStartPt == ((MetaArcAction&)rMetaAction).maStartPt ) && - ( maEndPt == ((MetaArcAction&)rMetaAction).maEndPt ); + return ( maRect == static_cast<const MetaArcAction&>(rMetaAction).maRect ) && + ( maStartPt == static_cast<const MetaArcAction&>(rMetaAction).maStartPt ) && + ( maEndPt == static_cast<const MetaArcAction&>(rMetaAction).maEndPt ); } void MetaArcAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -742,9 +742,9 @@ void MetaPieAction::Scale( double fScaleX, double fScaleY ) bool MetaPieAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaPieAction&)rMetaAction).maRect ) && - ( maStartPt == ((MetaPieAction&)rMetaAction).maStartPt ) && - ( maEndPt == ((MetaPieAction&)rMetaAction).maEndPt ); + return ( maRect == static_cast<const MetaPieAction&>(rMetaAction).maRect ) && + ( maStartPt == static_cast<const MetaPieAction&>(rMetaAction).maStartPt ) && + ( maEndPt == static_cast<const MetaPieAction&>(rMetaAction).maEndPt ); } void MetaPieAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -807,9 +807,9 @@ void MetaChordAction::Scale( double fScaleX, double fScaleY ) bool MetaChordAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaChordAction&)rMetaAction).maRect ) && - ( maStartPt == ((MetaChordAction&)rMetaAction).maStartPt ) && - ( maEndPt == ((MetaChordAction&)rMetaAction).maEndPt ); + return ( maRect == static_cast<const MetaChordAction&>(rMetaAction).maRect ) && + ( maStartPt == static_cast<const MetaChordAction&>(rMetaAction).maStartPt ) && + ( maEndPt == static_cast<const MetaChordAction&>(rMetaAction).maEndPt ); } void MetaChordAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -876,10 +876,10 @@ void MetaPolyLineAction::Scale( double fScaleX, double fScaleY ) bool MetaPolyLineAction::Compare( const MetaAction& rMetaAction ) const { bool bIsEqual = true; - if ( maLineInfo != ((MetaPolyLineAction&)rMetaAction).maLineInfo ) + if ( maLineInfo != static_cast<const MetaPolyLineAction&>(rMetaAction).maLineInfo ) bIsEqual = false; else - bIsEqual = maPoly.IsEqual(((MetaPolyLineAction&)rMetaAction).maPoly ); + bIsEqual = maPoly.IsEqual(static_cast<const MetaPolyLineAction&>(rMetaAction).maPoly ); return bIsEqual; } @@ -956,7 +956,7 @@ void MetaPolygonAction::Scale( double fScaleX, double fScaleY ) bool MetaPolygonAction::Compare( const MetaAction& rMetaAction ) const { - return maPoly.IsEqual(((MetaPolygonAction&)rMetaAction).maPoly ); + return maPoly.IsEqual(static_cast<const MetaPolygonAction&>(rMetaAction).maPoly ); } void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1026,7 +1026,7 @@ void MetaPolyPolygonAction::Scale( double fScaleX, double fScaleY ) bool MetaPolyPolygonAction::Compare( const MetaAction& rMetaAction ) const { - return maPolyPoly.IsEqual(((MetaPolyPolygonAction&)rMetaAction).maPolyPoly ); + return maPolyPoly.IsEqual(static_cast<const MetaPolyPolygonAction&>(rMetaAction).maPolyPoly ); } void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1130,10 +1130,10 @@ void MetaTextAction::Scale( double fScaleX, double fScaleY ) bool MetaTextAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPt == ((MetaTextAction&)rMetaAction).maPt ) && - ( maStr == ((MetaTextAction&)rMetaAction).maStr ) && - ( mnIndex == ((MetaTextAction&)rMetaAction).mnIndex ) && - ( mnLen == ((MetaTextAction&)rMetaAction).mnLen ); + return ( maPt == static_cast<const MetaTextAction&>(rMetaAction).maPt ) && + ( maStr == static_cast<const MetaTextAction&>(rMetaAction).maStr ) && + ( mnIndex == static_cast<const MetaTextAction&>(rMetaAction).mnIndex ) && + ( mnLen == static_cast<const MetaTextAction&>(rMetaAction).mnLen ); } void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1246,11 +1246,11 @@ void MetaTextArrayAction::Scale( double fScaleX, double fScaleY ) bool MetaTextArrayAction::Compare( const MetaAction& rMetaAction ) const { - return ( maStartPt == ((MetaTextArrayAction&)rMetaAction).maStartPt ) && - ( maStr == ((MetaTextArrayAction&)rMetaAction).maStr ) && - ( mnIndex == ((MetaTextArrayAction&)rMetaAction).mnIndex ) && - ( mnLen == ((MetaTextArrayAction&)rMetaAction).mnLen ) && - ( memcmp( mpDXAry, ((MetaTextArrayAction&)rMetaAction).mpDXAry, mnLen ) == 0 ); + return ( maStartPt == static_cast<const MetaTextArrayAction&>(rMetaAction).maStartPt ) && + ( maStr == static_cast<const MetaTextArrayAction&>(rMetaAction).maStr ) && + ( mnIndex == static_cast<const MetaTextArrayAction&>(rMetaAction).mnIndex ) && + ( mnLen == static_cast<const MetaTextArrayAction&>(rMetaAction).mnLen ) && + ( memcmp( mpDXAry, static_cast<const MetaTextArrayAction&>(rMetaAction).mpDXAry, mnLen ) == 0 ); } void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1381,11 +1381,11 @@ void MetaStretchTextAction::Scale( double fScaleX, double fScaleY ) bool MetaStretchTextAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPt == ((MetaStretchTextAction&)rMetaAction).maPt ) && - ( maStr == ((MetaStretchTextAction&)rMetaAction).maStr ) && - ( mnWidth == ((MetaStretchTextAction&)rMetaAction).mnWidth ) && - ( mnIndex == ((MetaStretchTextAction&)rMetaAction).mnIndex ) && - ( mnLen == ((MetaStretchTextAction&)rMetaAction).mnLen ); + return ( maPt == static_cast<const MetaStretchTextAction&>(rMetaAction).maPt ) && + ( maStr == static_cast<const MetaStretchTextAction&>(rMetaAction).maStr ) && + ( mnWidth == static_cast<const MetaStretchTextAction&>(rMetaAction).mnWidth ) && + ( mnIndex == static_cast<const MetaStretchTextAction&>(rMetaAction).mnIndex ) && + ( mnLen == static_cast<const MetaStretchTextAction&>(rMetaAction).mnLen ); } void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1458,9 +1458,9 @@ void MetaTextRectAction::Scale( double fScaleX, double fScaleY ) bool MetaTextRectAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaTextRectAction&)rMetaAction).maRect ) && - ( maStr == ((MetaTextRectAction&)rMetaAction).maStr ) && - ( mnStyle == ((MetaTextRectAction&)rMetaAction).mnStyle ); + return ( maRect == static_cast<const MetaTextRectAction&>(rMetaAction).maRect ) && + ( maStr == static_cast<const MetaTextRectAction&>(rMetaAction).maStr ) && + ( mnStyle == static_cast<const MetaTextRectAction&>(rMetaAction).mnStyle ); } void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1533,11 +1533,11 @@ void MetaTextLineAction::Scale( double fScaleX, double fScaleY ) bool MetaTextLineAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPos == ((MetaTextLineAction&)rMetaAction).maPos ) && - ( mnWidth == ((MetaTextLineAction&)rMetaAction).mnWidth ) && - ( meStrikeout == ((MetaTextLineAction&)rMetaAction).meStrikeout ) && - ( meUnderline == ((MetaTextLineAction&)rMetaAction).meUnderline ) && - ( meOverline == ((MetaTextLineAction&)rMetaAction).meOverline ); + return ( maPos == static_cast<const MetaTextLineAction&>(rMetaAction).maPos ) && + ( mnWidth == static_cast<const MetaTextLineAction&>(rMetaAction).mnWidth ) && + ( meStrikeout == static_cast<const MetaTextLineAction&>(rMetaAction).meStrikeout ) && + ( meUnderline == static_cast<const MetaTextLineAction&>(rMetaAction).meUnderline ) && + ( meOverline == static_cast<const MetaTextLineAction&>(rMetaAction).meOverline ); } void MetaTextLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1611,8 +1611,8 @@ void MetaBmpAction::Scale( double fScaleX, double fScaleY ) bool MetaBmpAction::Compare( const MetaAction& rMetaAction ) const { - return maBmp.IsEqual(((MetaBmpAction&)rMetaAction).maBmp ) && - ( maPt == ((MetaBmpAction&)rMetaAction).maPt ); + return maBmp.IsEqual(static_cast<const MetaBmpAction&>(rMetaAction).maBmp ) && + ( maPt == static_cast<const MetaBmpAction&>(rMetaAction).maPt ); } void MetaBmpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1675,9 +1675,9 @@ void MetaBmpScaleAction::Scale( double fScaleX, double fScaleY ) bool MetaBmpScaleAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmp.IsEqual(((MetaBmpScaleAction&)rMetaAction).maBmp )) && - ( maPt == ((MetaBmpScaleAction&)rMetaAction).maPt ) && - ( maSz == ((MetaBmpScaleAction&)rMetaAction).maSz ); + return ( maBmp.IsEqual(static_cast<const MetaBmpScaleAction&>(rMetaAction).maBmp )) && + ( maPt == static_cast<const MetaBmpScaleAction&>(rMetaAction).maPt ) && + ( maSz == static_cast<const MetaBmpScaleAction&>(rMetaAction).maSz ); } void MetaBmpScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1745,11 +1745,11 @@ void MetaBmpScalePartAction::Scale( double fScaleX, double fScaleY ) bool MetaBmpScalePartAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmp.IsEqual(((MetaBmpScalePartAction&)rMetaAction).maBmp )) && - ( maDstPt == ((MetaBmpScalePartAction&)rMetaAction).maDstPt ) && - ( maDstSz == ((MetaBmpScalePartAction&)rMetaAction).maDstSz ) && - ( maSrcPt == ((MetaBmpScalePartAction&)rMetaAction).maSrcPt ) && - ( maSrcSz == ((MetaBmpScalePartAction&)rMetaAction).maSrcSz ); + return ( maBmp.IsEqual(static_cast<const MetaBmpScalePartAction&>(rMetaAction).maBmp )) && + ( maDstPt == static_cast<const MetaBmpScalePartAction&>(rMetaAction).maDstPt ) && + ( maDstSz == static_cast<const MetaBmpScalePartAction&>(rMetaAction).maDstSz ) && + ( maSrcPt == static_cast<const MetaBmpScalePartAction&>(rMetaAction).maSrcPt ) && + ( maSrcSz == static_cast<const MetaBmpScalePartAction&>(rMetaAction).maSrcSz ); } void MetaBmpScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1813,8 +1813,8 @@ void MetaBmpExAction::Scale( double fScaleX, double fScaleY ) bool MetaBmpExAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmpEx.IsEqual(((MetaBmpExAction&)rMetaAction).maBmpEx )) && - ( maPt == ((MetaBmpExAction&)rMetaAction).maPt ); + return ( maBmpEx.IsEqual(static_cast<const MetaBmpExAction&>(rMetaAction).maBmpEx )) && + ( maPt == static_cast<const MetaBmpExAction&>(rMetaAction).maPt ); } void MetaBmpExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1877,9 +1877,9 @@ void MetaBmpExScaleAction::Scale( double fScaleX, double fScaleY ) bool MetaBmpExScaleAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmpEx.IsEqual(((MetaBmpExScaleAction&)rMetaAction).maBmpEx )) && - ( maPt == ((MetaBmpExScaleAction&)rMetaAction).maPt ) && - ( maSz == ((MetaBmpExScaleAction&)rMetaAction).maSz ); + return ( maBmpEx.IsEqual(static_cast<const MetaBmpExScaleAction&>(rMetaAction).maBmpEx )) && + ( maPt == static_cast<const MetaBmpExScaleAction&>(rMetaAction).maPt ) && + ( maSz == static_cast<const MetaBmpExScaleAction&>(rMetaAction).maSz ); } void MetaBmpExScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -1947,11 +1947,11 @@ void MetaBmpExScalePartAction::Scale( double fScaleX, double fScaleY ) bool MetaBmpExScalePartAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmpEx.IsEqual(((MetaBmpExScalePartAction&)rMetaAction).maBmpEx )) && - ( maDstPt == ((MetaBmpExScalePartAction&)rMetaAction).maDstPt ) && - ( maDstSz == ((MetaBmpExScalePartAction&)rMetaAction).maDstSz ) && - ( maSrcPt == ((MetaBmpExScalePartAction&)rMetaAction).maSrcPt ) && - ( maSrcSz == ((MetaBmpExScalePartAction&)rMetaAction).maSrcSz ); + return ( maBmpEx.IsEqual(static_cast<const MetaBmpExScalePartAction&>(rMetaAction).maBmpEx )) && + ( maDstPt == static_cast<const MetaBmpExScalePartAction&>(rMetaAction).maDstPt ) && + ( maDstSz == static_cast<const MetaBmpExScalePartAction&>(rMetaAction).maDstSz ) && + ( maSrcPt == static_cast<const MetaBmpExScalePartAction&>(rMetaAction).maSrcPt ) && + ( maSrcSz == static_cast<const MetaBmpExScalePartAction&>(rMetaAction).maSrcSz ); } void MetaBmpExScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2018,9 +2018,9 @@ void MetaMaskAction::Scale( double fScaleX, double fScaleY ) bool MetaMaskAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmp.IsEqual(((MetaMaskAction&)rMetaAction).maBmp )) && - ( maColor == ((MetaMaskAction&)rMetaAction).maColor ) && - ( maPt == ((MetaMaskAction&)rMetaAction).maPt ); + return ( maBmp.IsEqual(static_cast<const MetaMaskAction&>(rMetaAction).maBmp )) && + ( maColor == static_cast<const MetaMaskAction&>(rMetaAction).maColor ) && + ( maPt == static_cast<const MetaMaskAction&>(rMetaAction).maPt ); } void MetaMaskAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2085,10 +2085,10 @@ void MetaMaskScaleAction::Scale( double fScaleX, double fScaleY ) bool MetaMaskScaleAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmp.IsEqual(((MetaMaskScaleAction&)rMetaAction).maBmp )) && - ( maColor == ((MetaMaskScaleAction&)rMetaAction).maColor ) && - ( maPt == ((MetaMaskScaleAction&)rMetaAction).maPt ) && - ( maSz == ((MetaMaskScaleAction&)rMetaAction).maSz ); + return ( maBmp.IsEqual(static_cast<const MetaMaskScaleAction&>(rMetaAction).maBmp )) && + ( maColor == static_cast<const MetaMaskScaleAction&>(rMetaAction).maColor ) && + ( maPt == static_cast<const MetaMaskScaleAction&>(rMetaAction).maPt ) && + ( maSz == static_cast<const MetaMaskScaleAction&>(rMetaAction).maSz ); } void MetaMaskScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2158,12 +2158,12 @@ void MetaMaskScalePartAction::Scale( double fScaleX, double fScaleY ) bool MetaMaskScalePartAction::Compare( const MetaAction& rMetaAction ) const { - return ( maBmp.IsEqual(((MetaMaskScalePartAction&)rMetaAction).maBmp )) && - ( maColor == ((MetaMaskScalePartAction&)rMetaAction).maColor ) && - ( maDstPt == ((MetaMaskScalePartAction&)rMetaAction).maDstPt ) && - ( maDstSz == ((MetaMaskScalePartAction&)rMetaAction).maDstSz ) && - ( maSrcPt == ((MetaMaskScalePartAction&)rMetaAction).maSrcPt ) && - ( maSrcSz == ((MetaMaskScalePartAction&)rMetaAction).maSrcSz ); + return ( maBmp.IsEqual(static_cast<const MetaMaskScalePartAction&>(rMetaAction).maBmp )) && + ( maColor == static_cast<const MetaMaskScalePartAction&>(rMetaAction).maColor ) && + ( maDstPt == static_cast<const MetaMaskScalePartAction&>(rMetaAction).maDstPt ) && + ( maDstSz == static_cast<const MetaMaskScalePartAction&>(rMetaAction).maDstSz ) && + ( maSrcPt == static_cast<const MetaMaskScalePartAction&>(rMetaAction).maSrcPt ) && + ( maSrcSz == static_cast<const MetaMaskScalePartAction&>(rMetaAction).maSrcSz ); } void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2229,8 +2229,8 @@ void MetaGradientAction::Scale( double fScaleX, double fScaleY ) bool MetaGradientAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaGradientAction&)rMetaAction).maRect ) && - ( maGradient == ((MetaGradientAction&)rMetaAction).maGradient ); + return ( maRect == static_cast<const MetaGradientAction&>(rMetaAction).maRect ) && + ( maGradient == static_cast<const MetaGradientAction&>(rMetaAction).maGradient ); } void MetaGradientAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2290,8 +2290,8 @@ void MetaGradientExAction::Scale( double fScaleX, double fScaleY ) bool MetaGradientExAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPolyPoly == ((MetaGradientExAction&)rMetaAction).maPolyPoly ) && - ( maGradient == ((MetaGradientExAction&)rMetaAction).maGradient ); + return ( maPolyPoly == static_cast<const MetaGradientExAction&>(rMetaAction).maPolyPoly ) && + ( maGradient == static_cast<const MetaGradientExAction&>(rMetaAction).maGradient ); } void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2352,8 +2352,8 @@ void MetaHatchAction::Scale( double fScaleX, double fScaleY ) bool MetaHatchAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPolyPoly == ((MetaHatchAction&)rMetaAction).maPolyPoly ) && - ( maHatch == ((MetaHatchAction&)rMetaAction).maHatch ); + return ( maPolyPoly == static_cast<const MetaHatchAction&>(rMetaAction).maPolyPoly ) && + ( maHatch == static_cast<const MetaHatchAction&>(rMetaAction).maHatch ); } void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2414,8 +2414,8 @@ void MetaWallpaperAction::Scale( double fScaleX, double fScaleY ) bool MetaWallpaperAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRect == ((MetaWallpaperAction&)rMetaAction).maRect ) && - ( maWallpaper == ((MetaWallpaperAction&)rMetaAction).maWallpaper ); + return ( maRect == static_cast<const MetaWallpaperAction&>(rMetaAction).maRect ) && + ( maWallpaper == static_cast<const MetaWallpaperAction&>(rMetaAction).maWallpaper ); } void MetaWallpaperAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2473,8 +2473,8 @@ void MetaClipRegionAction::Scale( double fScaleX, double fScaleY ) bool MetaClipRegionAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRegion == ((MetaClipRegionAction&)rMetaAction).maRegion ) && - ( mbClip == ((MetaClipRegionAction&)rMetaAction).mbClip ); + return ( maRegion == static_cast<const MetaClipRegionAction&>(rMetaAction).maRegion ) && + ( mbClip == static_cast<const MetaClipRegionAction&>(rMetaAction).mbClip ); } void MetaClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2529,7 +2529,7 @@ void MetaISectRectClipRegionAction::Scale( double fScaleX, double fScaleY ) bool MetaISectRectClipRegionAction::Compare( const MetaAction& rMetaAction ) const { - return maRect == ((MetaISectRectClipRegionAction&)rMetaAction).maRect; + return maRect == static_cast<const MetaISectRectClipRegionAction&>(rMetaAction).maRect; } void MetaISectRectClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2582,7 +2582,7 @@ void MetaISectRegionClipRegionAction::Scale( double fScaleX, double fScaleY ) bool MetaISectRegionClipRegionAction::Compare( const MetaAction& rMetaAction ) const { - return maRegion == ((MetaISectRegionClipRegionAction&)rMetaAction).maRegion; + return maRegion == static_cast<const MetaISectRegionClipRegionAction&>(rMetaAction).maRegion; } void MetaISectRegionClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2633,8 +2633,8 @@ void MetaMoveClipRegionAction::Scale( double fScaleX, double fScaleY ) bool MetaMoveClipRegionAction::Compare( const MetaAction& rMetaAction ) const { - return ( mnHorzMove == ((MetaMoveClipRegionAction&)rMetaAction).mnHorzMove ) && - ( mnVertMove == ((MetaMoveClipRegionAction&)rMetaAction).mnVertMove ); + return ( mnHorzMove == static_cast<const MetaMoveClipRegionAction&>(rMetaAction).mnHorzMove ) && + ( mnVertMove == static_cast<const MetaMoveClipRegionAction&>(rMetaAction).mnVertMove ); } void MetaMoveClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2684,8 +2684,8 @@ MetaAction* MetaLineColorAction::Clone() bool MetaLineColorAction::Compare( const MetaAction& rMetaAction ) const { - return ( maColor == ((MetaLineColorAction&)rMetaAction).maColor ) && - ( mbSet == ((MetaLineColorAction&)rMetaAction).mbSet ); + return ( maColor == static_cast<const MetaLineColorAction&>(rMetaAction).maColor ) && + ( mbSet == static_cast<const MetaLineColorAction&>(rMetaAction).mbSet ); } void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2734,8 +2734,8 @@ MetaAction* MetaFillColorAction::Clone() bool MetaFillColorAction::Compare( const MetaAction& rMetaAction ) const { - return ( maColor == ((MetaFillColorAction&)rMetaAction).maColor ) && - ( mbSet == ((MetaFillColorAction&)rMetaAction).mbSet ); + return ( maColor == static_cast<const MetaFillColorAction&>(rMetaAction).maColor ) && + ( mbSet == static_cast<const MetaFillColorAction&>(rMetaAction).mbSet ); } void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2779,7 +2779,7 @@ MetaAction* MetaTextColorAction::Clone() bool MetaTextColorAction::Compare( const MetaAction& rMetaAction ) const { - return maColor == ((MetaTextColorAction&)rMetaAction).maColor; + return maColor == static_cast<const MetaTextColorAction&>(rMetaAction).maColor; } void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2826,8 +2826,8 @@ MetaAction* MetaTextFillColorAction::Clone() bool MetaTextFillColorAction::Compare( const MetaAction& rMetaAction ) const { - return ( maColor == ((MetaTextFillColorAction&)rMetaAction).maColor ) && - ( mbSet == ((MetaTextFillColorAction&)rMetaAction).mbSet ); + return ( maColor == static_cast<const MetaTextFillColorAction&>(rMetaAction).maColor ) && + ( mbSet == static_cast<const MetaTextFillColorAction&>(rMetaAction).mbSet ); } void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2876,8 +2876,8 @@ MetaAction* MetaTextLineColorAction::Clone() bool MetaTextLineColorAction::Compare( const MetaAction& rMetaAction ) const { - return ( maColor == ((MetaTextLineColorAction&)rMetaAction).maColor ) && - ( mbSet == ((MetaTextLineColorAction&)rMetaAction).mbSet ); + return ( maColor == static_cast<const MetaTextLineColorAction&>(rMetaAction).maColor ) && + ( mbSet == static_cast<const MetaTextLineColorAction&>(rMetaAction).mbSet ); } void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2926,8 +2926,8 @@ MetaAction* MetaOverlineColorAction::Clone() bool MetaOverlineColorAction::Compare( const MetaAction& rMetaAction ) const { - return ( maColor == ((MetaOverlineColorAction&)rMetaAction).maColor ) && - ( mbSet == ((MetaOverlineColorAction&)rMetaAction).mbSet ); + return ( maColor == static_cast<const MetaOverlineColorAction&>(rMetaAction).maColor ) && + ( mbSet == static_cast<const MetaOverlineColorAction&>(rMetaAction).mbSet ); } void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -2972,7 +2972,7 @@ MetaAction* MetaTextAlignAction::Clone() bool MetaTextAlignAction::Compare( const MetaAction& rMetaAction ) const { - return maAlign == ((MetaTextAlignAction&)rMetaAction).maAlign; + return maAlign == static_cast<const MetaTextAlignAction&>(rMetaAction).maAlign; } void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3024,7 +3024,7 @@ void MetaMapModeAction::Scale( double fScaleX, double fScaleY ) bool MetaMapModeAction::Compare( const MetaAction& rMetaAction ) const { - return maMapMode == ((MetaMapModeAction&)rMetaAction).maMapMode; + return maMapMode == static_cast<const MetaMapModeAction&>(rMetaAction).maMapMode; } void MetaMapModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3084,7 +3084,7 @@ void MetaFontAction::Scale( double fScaleX, double fScaleY ) bool MetaFontAction::Compare( const MetaAction& rMetaAction ) const { - return maFont == ((MetaFontAction&)rMetaAction).maFont; + return maFont == static_cast<const MetaFontAction&>(rMetaAction).maFont; } void MetaFontAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3133,7 +3133,7 @@ MetaAction* MetaPushAction::Clone() bool MetaPushAction::Compare( const MetaAction& rMetaAction ) const { - return mnFlags == ((MetaPushAction&)rMetaAction).mnFlags; + return mnFlags == static_cast<const MetaPushAction&>(rMetaAction).mnFlags; } void MetaPushAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3209,7 +3209,7 @@ MetaAction* MetaRasterOpAction::Clone() bool MetaRasterOpAction::Compare( const MetaAction& rMetaAction ) const { - return meRasterOp == ((MetaRasterOpAction&)rMetaAction).meRasterOp; + return meRasterOp == static_cast<const MetaRasterOpAction&>(rMetaAction).meRasterOp; } void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3266,8 +3266,8 @@ void MetaTransparentAction::Scale( double fScaleX, double fScaleY ) bool MetaTransparentAction::Compare( const MetaAction& rMetaAction ) const { - return ( maPolyPoly == ((MetaTransparentAction&)rMetaAction).maPolyPoly ) && - ( mnTransPercent == ((MetaTransparentAction&)rMetaAction).mnTransPercent ); + return ( maPolyPoly == static_cast<const MetaTransparentAction&>(rMetaAction).maPolyPoly ) && + ( mnTransPercent == static_cast<const MetaTransparentAction&>(rMetaAction).mnTransPercent ); } void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3341,10 +3341,10 @@ void MetaFloatTransparentAction::Scale( double fScaleX, double fScaleY ) bool MetaFloatTransparentAction::Compare( const MetaAction& rMetaAction ) const { - return ( maMtf == ((MetaFloatTransparentAction&)rMetaAction).maMtf ) && - ( maPoint == ((MetaFloatTransparentAction&)rMetaAction).maPoint ) && - ( maSize == ((MetaFloatTransparentAction&)rMetaAction).maSize ) && - ( maGradient == ((MetaFloatTransparentAction&)rMetaAction).maGradient ); + return ( maMtf == static_cast<const MetaFloatTransparentAction&>(rMetaAction).maMtf ) && + ( maPoint == static_cast<const MetaFloatTransparentAction&>(rMetaAction).maPoint ) && + ( maSize == static_cast<const MetaFloatTransparentAction&>(rMetaAction).maSize ) && + ( maGradient == static_cast<const MetaFloatTransparentAction&>(rMetaAction).maGradient ); } void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3410,10 +3410,10 @@ void MetaEPSAction::Scale( double fScaleX, double fScaleY ) bool MetaEPSAction::Compare( const MetaAction& rMetaAction ) const { - return ( maGfxLink.IsEqual(((MetaEPSAction&)rMetaAction).maGfxLink )) && - ( maSubst == ((MetaEPSAction&)rMetaAction).maSubst ) && - ( maPoint == ((MetaEPSAction&)rMetaAction).maPoint ) && - ( maSize == ((MetaEPSAction&)rMetaAction).maSize ); + return ( maGfxLink.IsEqual(static_cast<const MetaEPSAction&>(rMetaAction).maGfxLink )) && + ( maSubst == static_cast<const MetaEPSAction&>(rMetaAction).maSubst ) && + ( maPoint == static_cast<const MetaEPSAction&>(rMetaAction).maPoint ) && + ( maSize == static_cast<const MetaEPSAction&>(rMetaAction).maSize ); } void MetaEPSAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3467,8 +3467,8 @@ MetaAction* MetaRefPointAction::Clone() bool MetaRefPointAction::Compare( const MetaAction& rMetaAction ) const { - return ( maRefPoint == ((MetaRefPointAction&)rMetaAction).maRefPoint ) && - ( mbSet == ((MetaRefPointAction&)rMetaAction).mbSet ); + return ( maRefPoint == static_cast<const MetaRefPointAction&>(rMetaAction).maRefPoint ) && + ( mbSet == static_cast<const MetaRefPointAction&>(rMetaAction).mbSet ); } void MetaRefPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3664,10 +3664,10 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const { - return ( maComment == ((MetaCommentAction&)rMetaAction).maComment ) && - ( mnValue == ((MetaCommentAction&)rMetaAction).mnValue ) && - ( mnDataSize == ((MetaCommentAction&)rMetaAction).mnDataSize ) && - ( memcmp( mpData, ((MetaCommentAction&)rMetaAction).mpData, mnDataSize ) == 0 ); + return ( maComment == static_cast<const MetaCommentAction&>(rMetaAction).maComment ) && + ( mnValue == static_cast<const MetaCommentAction&>(rMetaAction).mnValue ) && + ( mnDataSize == static_cast<const MetaCommentAction&>(rMetaAction).mnDataSize ) && + ( memcmp( mpData, static_cast<const MetaCommentAction&>(rMetaAction).mpData, mnDataSize ) == 0 ); } void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3727,7 +3727,7 @@ MetaAction* MetaLayoutModeAction::Clone() bool MetaLayoutModeAction::Compare( const MetaAction& rMetaAction ) const { - return mnLayoutMode == ((MetaLayoutModeAction&)rMetaAction).mnLayoutMode; + return mnLayoutMode == static_cast<const MetaLayoutModeAction&>(rMetaAction).mnLayoutMode; } void MetaLayoutModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) @@ -3772,7 +3772,7 @@ MetaAction* MetaTextLanguageAction::Clone() bool MetaTextLanguageAction::Compare( const MetaAction& rMetaAction ) const { - return meTextLanguage == ((MetaTextLanguageAction&)rMetaAction).meTextLanguage; + return meTextLanguage == static_cast<const MetaTextLanguageAction&>(rMetaAction).meTextLanguage; } void MetaTextLanguageAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index a107eeb83c0f..2d0a4d0cf551 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -264,21 +264,21 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { case( META_PIXEL_ACTION ): { - const MetaPixelAction* pA = (const MetaPixelAction*) pAction; + const MetaPixelAction* pA = static_cast<const MetaPixelAction*>(pAction); m_rOuterFace.DrawPixel( pA->GetPoint(), pA->GetColor() ); } break; case( META_POINT_ACTION ): { - const MetaPointAction* pA = (const MetaPointAction*) pAction; + const MetaPointAction* pA = static_cast<const MetaPointAction*>(pAction); m_rOuterFace.DrawPixel( pA->GetPoint() ); } break; case( META_LINE_ACTION ): { - const MetaLineAction* pA = (const MetaLineAction*) pAction; + const MetaLineAction* pA = static_cast<const MetaLineAction*>(pAction); if ( pA->GetLineInfo().IsDefault() ) m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() ); else @@ -288,56 +288,56 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_RECT_ACTION ): { - const MetaRectAction* pA = (const MetaRectAction*) pAction; + const MetaRectAction* pA = static_cast<const MetaRectAction*>(pAction); m_rOuterFace.DrawRect( pA->GetRect() ); } break; case( META_ROUNDRECT_ACTION ): { - const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction; + const MetaRoundRectAction* pA = static_cast<const MetaRoundRectAction*>(pAction); m_rOuterFace.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() ); } break; case( META_ELLIPSE_ACTION ): { - const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction; + const MetaEllipseAction* pA = static_cast<const MetaEllipseAction*>(pAction); m_rOuterFace.DrawEllipse( pA->GetRect() ); } break; case( META_ARC_ACTION ): { - const MetaArcAction* pA = (const MetaArcAction*) pAction; + const MetaArcAction* pA = static_cast<const MetaArcAction*>(pAction); m_rOuterFace.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); } break; case( META_PIE_ACTION ): { - const MetaArcAction* pA = (const MetaArcAction*) pAction; + const MetaArcAction* pA = static_cast<const MetaArcAction*>(pAction); m_rOuterFace.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); } break; case( META_CHORD_ACTION ): { - const MetaChordAction* pA = (const MetaChordAction*) pAction; + const MetaChordAction* pA = static_cast<const MetaChordAction*>(pAction); m_rOuterFace.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() ); } break; case( META_POLYGON_ACTION ): { - const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction; + const MetaPolygonAction* pA = static_cast<const MetaPolygonAction*>(pAction); m_rOuterFace.DrawPolygon( pA->GetPolygon() ); } break; case( META_POLYLINE_ACTION ): { - const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction; + const MetaPolyLineAction* pA = static_cast<const MetaPolyLineAction*>(pAction); if ( pA->GetLineInfo().IsDefault() ) m_rOuterFace.DrawPolyLine( pA->GetPolygon() ); else @@ -347,14 +347,14 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_POLYPOLYGON_ACTION ): { - const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction; + const MetaPolyPolygonAction* pA = static_cast<const MetaPolyPolygonAction*>(pAction); m_rOuterFace.DrawPolyPolygon( pA->GetPolyPolygon() ); } break; case( META_GRADIENT_ACTION ): { - const MetaGradientAction* pA = (const MetaGradientAction*) pAction; + const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pAction); const Gradient& rGradient = pA->GetGradient(); if (lcl_canUsePDFAxialShading(rGradient)) { @@ -370,7 +370,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_GRADIENTEX_ACTION ): { - const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction; + const MetaGradientExAction* pA = static_cast<const MetaGradientExAction*>(pAction); const Gradient& rGradient = pA->GetGradient(); if (lcl_canUsePDFAxialShading(rGradient)) @@ -382,21 +382,21 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case META_HATCH_ACTION: { - const MetaHatchAction* pA = (const MetaHatchAction*) pAction; + const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pAction); m_rOuterFace.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() ); } break; case( META_TRANSPARENT_ACTION ): { - const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction; + const MetaTransparentAction* pA = static_cast<const MetaTransparentAction*>(pAction); m_rOuterFace.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() ); } break; case( META_FLOATTRANSPARENT_ACTION ): { - const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction; + const MetaFloatTransparentAction* pA = static_cast<const MetaFloatTransparentAction*>(pAction); GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() ); const Point& rPos = pA->GetPoint(); @@ -489,7 +489,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_EPS_ACTION ): { - const MetaEPSAction* pA = (const MetaEPSAction*) pAction; + const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pAction); const GDIMetaFile aSubstitute( pA->GetSubstitute() ); m_rOuterFace.Push(); @@ -512,7 +512,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_COMMENT_ACTION ): if( ! i_rContext.m_bTransparenciesWereRemoved ) { - const MetaCommentAction* pA = (const MetaCommentAction*) pAction; + const MetaCommentAction* pA = static_cast<const MetaCommentAction*>(pAction); if( pA->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_BEGIN")) { @@ -524,9 +524,9 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa pAction = aMtf.GetAction( i ); if( pAction->GetType() == META_GRADIENTEX_ACTION ) - pGradAction = (const MetaGradientExAction*) pAction; + pGradAction = static_cast<const MetaGradientExAction*>(pAction); else if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END")) ) + ( static_cast<const MetaCommentAction*>(pAction)->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END")) ) { bDone = true; } @@ -748,7 +748,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa pAction = aMtf.GetAction( i ); if ( pAction->GetType() == META_COMMENT_ACTION ) { - OString sComment( ((MetaCommentAction*)pAction)->GetComment() ); + OString sComment( static_cast<const MetaCommentAction*>(pAction)->GetComment() ); if (sComment == sSeqEnd) break; } @@ -758,7 +758,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa // state and must not be skipped else if( pAction->GetType() == META_FILLCOLOR_ACTION ) { - const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction; + const MetaFillColorAction* pMA = static_cast<const MetaFillColorAction*>(pAction); if( pMA->IsSetting() ) m_rOuterFace.SetFillColor( pMA->GetColor() ); else @@ -773,7 +773,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_BMP_ACTION ): { - const MetaBmpAction* pA = (const MetaBmpAction*) pAction; + const MetaBmpAction* pA = static_cast<const MetaBmpAction*>(pAction); BitmapEx aBitmapEx( pA->GetBitmap() ); Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); @@ -785,14 +785,14 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_BMPSCALE_ACTION ): { - const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction; + const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction); implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), pDummyVDev, i_rContext ); } break; case( META_BMPSCALEPART_ACTION ): { - const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction; + const MetaBmpScalePartAction* pA = static_cast<const MetaBmpScalePartAction*>(pAction); BitmapEx aBitmapEx( pA->GetBitmap() ); aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext ); @@ -801,7 +801,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_BMPEX_ACTION ): { - const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction; + const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pAction); BitmapEx aBitmapEx( pA->GetBitmapEx() ); Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); @@ -811,14 +811,14 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_BMPEXSCALE_ACTION ): { - const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction; + const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction); implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), pDummyVDev, i_rContext ); } break; case( META_BMPEXSCALEPART_ACTION ): { - const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction; + const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction); BitmapEx aBitmapEx( pA->GetBitmapEx() ); aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext ); @@ -835,35 +835,35 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_TEXT_ACTION ): { - const MetaTextAction* pA = (const MetaTextAction*) pAction; + const MetaTextAction* pA = static_cast<const MetaTextAction*>(pAction); m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) ) ); } break; case( META_TEXTRECT_ACTION ): { - const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction; + const MetaTextRectAction* pA = static_cast<const MetaTextRectAction*>(pAction); m_rOuterFace.DrawText( pA->GetRect(), pA->GetText(), pA->GetStyle() ); } break; case( META_TEXTARRAY_ACTION ): { - const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction; + const MetaTextArrayAction* pA = static_cast<const MetaTextArrayAction*>(pAction); m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() ); } break; case( META_STRETCHTEXT_ACTION ): { - const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction; + const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pAction); m_rOuterFace.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() ); } break; case( META_TEXTLINE_ACTION ): { - const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction; + const MetaTextLineAction* pA = static_cast<const MetaTextLineAction*>(pAction); m_rOuterFace.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() ); } @@ -871,7 +871,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_CLIPREGION_ACTION ): { - const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction; + const MetaClipRegionAction* pA = static_cast<const MetaClipRegionAction*>(pAction); if( pA->IsClipping() ) { @@ -890,14 +890,14 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_ISECTRECTCLIPREGION_ACTION ): { - const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction; + const MetaISectRectClipRegionAction* pA = static_cast<const MetaISectRectClipRegionAction*>(pAction); m_rOuterFace.IntersectClipRegion( pA->GetRect() ); } break; case( META_ISECTREGIONCLIPREGION_ACTION ): { - const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction; + const MetaISectRegionClipRegionAction* pA = static_cast<const MetaISectRegionClipRegionAction*>(pAction); Region aReg( pA->GetRegion() ); m_rOuterFace.IntersectClipRegion( aReg.GetAsB2DPolyPolygon() ); } @@ -905,7 +905,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_MOVECLIPREGION_ACTION ): { - const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction; + const MetaMoveClipRegionAction* pA = static_cast<const MetaMoveClipRegionAction*>(pAction); m_rOuterFace.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() ); } break; @@ -919,7 +919,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_LINECOLOR_ACTION ): { - const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction; + const MetaLineColorAction* pA = static_cast<const MetaLineColorAction*>(pAction); if( pA->IsSetting() ) m_rOuterFace.SetLineColor( pA->GetColor() ); @@ -930,7 +930,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_FILLCOLOR_ACTION ): { - const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction; + const MetaFillColorAction* pA = static_cast<const MetaFillColorAction*>(pAction); if( pA->IsSetting() ) m_rOuterFace.SetFillColor( pA->GetColor() ); @@ -941,7 +941,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_TEXTLINECOLOR_ACTION ): { - const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction; + const MetaTextLineColorAction* pA = static_cast<const MetaTextLineColorAction*>(pAction); if( pA->IsSetting() ) m_rOuterFace.SetTextLineColor( pA->GetColor() ); @@ -952,7 +952,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_OVERLINECOLOR_ACTION ): { - const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction; + const MetaOverlineColorAction* pA = static_cast<const MetaOverlineColorAction*>(pAction); if( pA->IsSetting() ) m_rOuterFace.SetOverlineColor( pA->GetColor() ); @@ -963,7 +963,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_TEXTFILLCOLOR_ACTION ): { - const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction; + const MetaTextFillColorAction* pA = static_cast<const MetaTextFillColorAction*>(pAction); if( pA->IsSetting() ) m_rOuterFace.SetTextFillColor( pA->GetColor() ); @@ -974,28 +974,28 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_TEXTCOLOR_ACTION ): { - const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction; + const MetaTextColorAction* pA = static_cast<const MetaTextColorAction*>(pAction); m_rOuterFace.SetTextColor( pA->GetColor() ); } break; case( META_TEXTALIGN_ACTION ): { - const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction; + const MetaTextAlignAction* pA = static_cast<const MetaTextAlignAction*>(pAction); m_rOuterFace.SetTextAlign( pA->GetTextAlign() ); } break; case( META_FONT_ACTION ): { - const MetaFontAction* pA = (const MetaFontAction*) pAction; + const MetaFontAction* pA = static_cast<const MetaFontAction*>(pAction); m_rOuterFace.SetFont( pA->GetFont() ); } break; case( META_PUSH_ACTION ): { - const MetaPushAction* pA = (const MetaPushAction*) pAction; + const MetaPushAction* pA = static_cast<const MetaPushAction*>(pAction); pDummyVDev->Push( pA->GetFlags() ); m_rOuterFace.Push( pA->GetFlags() ); @@ -1011,21 +1011,21 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case( META_LAYOUTMODE_ACTION ): { - const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction; + const MetaLayoutModeAction* pA = static_cast<const MetaLayoutModeAction*>(pAction); m_rOuterFace.SetLayoutMode( pA->GetLayoutMode() ); } break; case META_TEXTLANGUAGE_ACTION: { - const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction; + const MetaTextLanguageAction* pA = static_cast<const MetaTextLanguageAction*>(pAction); m_rOuterFace.SetDigitLanguage( pA->GetTextLanguage() ); } break; case( META_WALLPAPER_ACTION ): { - const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction; + const MetaWallpaperAction* pA = static_cast<const MetaWallpaperAction*>(pAction); m_rOuterFace.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() ); } break; diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 67a931236e18..5e218c93aedd 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -176,7 +176,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER ) mbScreenComp = false; else if ( pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) - mbScreenComp = ((VirtualDevice*)pOutDev)->mbScreenComp; + mbScreenComp = static_cast<const VirtualDevice*>(pOutDev)->mbScreenComp; meOutDevType = OUTDEV_VIRDEV; mbDevOutput = true; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 7d5330b5a6e4..fe1e901d75fc 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -517,7 +517,7 @@ void OutputDevice::ImplClearFontData( const bool bNewFontLists ) // also update child windows if needed if ( GetOutDevType() == OUTDEV_WINDOW ) { - vcl::Window* pChild = ((vcl::Window*)this)->mpWindowImpl->mpFirstChild; + vcl::Window* pChild = static_cast<vcl::Window*>(this)->mpWindowImpl->mpFirstChild; while ( pChild ) { pChild->ImplClearFontData( true ); @@ -553,7 +553,7 @@ void OutputDevice::ImplRefreshFontData( const bool bNewFontLists ) // also update child windows if needed if ( GetOutDevType() == OUTDEV_WINDOW ) { - vcl::Window* pChild = ((vcl::Window*)this)->mpWindowImpl->mpFirstChild; + vcl::Window* pChild = static_cast<vcl::Window*>(this)->mpWindowImpl->mpFirstChild; while ( pChild ) { pChild->ImplRefreshFontData( true ); diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index ff9140783c78..5c2f181abebf 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -682,8 +682,8 @@ void OutputDevice::SetMapMode() mbInitFont = true; if ( GetOutDevType() == OUTDEV_WINDOW ) { - if ( ((vcl::Window*)this)->mpWindowImpl->mpCursor ) - ((vcl::Window*)this)->mpWindowImpl->mpCursor->ImplNew(); + if ( static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor ) + static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor->ImplNew(); } // #106426# Adapt logical offset when changing mapmode @@ -786,8 +786,8 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode ) mbInitFont = true; if ( GetOutDevType() == OUTDEV_WINDOW ) { - if ( ((vcl::Window*)this)->mpWindowImpl->mpCursor ) - ((vcl::Window*)this)->mpWindowImpl->mpCursor->ImplNew(); + if ( static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor ) + static_cast<vcl::Window*>(this)->mpWindowImpl->mpCursor->ImplNew(); } // #106426# Adapt logical offset when changing mapmode diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 9c96710127e5..a5a19798a1da 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -726,7 +726,7 @@ void OutputDevice::ImplDrawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect } else { - if ( ((vcl::Window*)this)->mpWindowImpl->mpFrameWindow == ((vcl::Window*)pSrcDev)->mpWindowImpl->mpFrameWindow ) + if ( static_cast<vcl::Window*>(this)->mpWindowImpl->mpFrameWindow == static_cast<const vcl::Window*>(pSrcDev)->mpWindowImpl->mpFrameWindow ) pGraphics2 = NULL; else { diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index b02ebd84e365..0f3b416a79bb 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -280,16 +280,18 @@ sal_uInt16 Window::GetAccessibleChildWindowCount() // report the menubarwindow as a child of THE workwindow if( GetType() == WINDOW_BORDERWINDOW ) { - if( ((ImplBorderWindow *) this)->mpMenuBarWindow && - ((ImplBorderWindow *) this)->mpMenuBarWindow->IsVisible() + ImplBorderWindow *pBorderWindow = static_cast<ImplBorderWindow*>(this); + if( pBorderWindow->mpMenuBarWindow && + pBorderWindow->mpMenuBarWindow->IsVisible() ) --nChildren; } else if( GetType() == WINDOW_WORKWINDOW ) { - if( ((WorkWindow *) this)->GetMenuBar() && - ((WorkWindow *) this)->GetMenuBar()->GetWindow() && - ((WorkWindow *) this)->GetMenuBar()->GetWindow()->IsVisible() + WorkWindow *pWorkWindow = static_cast<WorkWindow*>(this); + if( pWorkWindow->GetMenuBar() && + pWorkWindow->GetMenuBar()->GetWindow() && + pWorkWindow->GetMenuBar()->GetWindow()->IsVisible() ) ++nChildren; } @@ -300,11 +302,11 @@ sal_uInt16 Window::GetAccessibleChildWindowCount() vcl::Window* Window::GetAccessibleChildWindow( sal_uInt16 n ) { // report the menubarwindow as a the first child of THE workwindow - if( GetType() == WINDOW_WORKWINDOW && ((WorkWindow *) this)->GetMenuBar() ) + if( GetType() == WINDOW_WORKWINDOW && static_cast<WorkWindow *>(this)->GetMenuBar() ) { if( n == 0 ) { - MenuBar *pMenuBar = ((WorkWindow *) this)->GetMenuBar(); + MenuBar *pMenuBar = static_cast<WorkWindow *>(this)->GetMenuBar(); if( pMenuBar->GetWindow() && pMenuBar->GetWindow()->IsVisible() ) return pMenuBar->GetWindow(); } diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index afc0be1ba9cc..ce43ffe03f05 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -363,7 +363,7 @@ bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons // call handler already on mouse down if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { - SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); + SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); pClientWindow->TitleButtonClick( TITLE_BUTTON_MENU ); } } @@ -413,7 +413,7 @@ bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { - SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); + SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); if ( true /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required pClientWindow->TitleButtonClick( TITLE_BUTTON_DOCKING ); else if ( pBorderWindow->GetStyle() & WB_ROLLABLE ) @@ -487,7 +487,7 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track { if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { - SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); + SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); if ( pClientWindow->IsRollUp() ) pClientWindow->RollDown(); else @@ -509,7 +509,7 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track { if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { - SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); + SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); pClientWindow->TitleButtonClick( TITLE_BUTTON_DOCKING ); } } @@ -537,7 +537,7 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track { if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { - SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); + SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); pClientWindow->TitleButtonClick( TITLE_BUTTON_HIDE ); } } @@ -568,7 +568,7 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track { if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { - SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); + SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); pClientWindow->SetPin( !pClientWindow->IsPinned() ); pClientWindow->Pin(); } @@ -594,8 +594,8 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track { if ( pBorderWindow->ImplGetClientWindow()->ImplIsFloatingWindow() ) { - if ( ((FloatingWindow*)pBorderWindow->ImplGetClientWindow())->IsInPopupMode() ) - ((FloatingWindow*)pBorderWindow->ImplGetClientWindow())->EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF ); + if ( static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->IsInPopupMode() ) + static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF ); } } } @@ -827,7 +827,7 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track aSize = aNewRect.GetSize(); aSize.Width() -= nBorderWidth; aSize.Height() -= nBorderHeight; - ((SystemWindow*)pBorderWindow->ImplGetClientWindow())->Resizing( aSize ); + static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow())->Resizing( aSize ); aSize.Width() += nBorderWidth; aSize.Height() += nBorderHeight; if ( aSize.Width() < nMinWidth ) @@ -1013,7 +1013,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei vcl::Window *pWin = NULL, *pCtrl = NULL; if (mpOutDev->GetOutDevType() == OUTDEV_WINDOW) - pWin = (vcl::Window*) mpOutDev; + pWin = static_cast<vcl::Window*>(mpOutDev); if (pWin) pCtrl = mpBorderWindow->GetWindow(WINDOW_CLIENT); @@ -1188,7 +1188,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* // control this border belongs to vcl::Window *pWin = NULL, *pCtrl = NULL; if( mpOutDev->GetOutDevType() == OUTDEV_WINDOW ) - pWin = (vcl::Window*) mpOutDev; + pWin = static_cast<vcl::Window*>(mpOutDev); ControlType aCtrlType = 0; ControlPart aCtrlPart = PART_ENTIRE_CONTROL; @@ -1303,7 +1303,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* // are passed, this might force a redraw though.... (TODO: improve) if ( (aCtrlType == CTRL_SPINBOX) && !pCtrl->IsNativeControlSupported( CTRL_SPINBOX, PART_BUTTON_UP ) ) { - Edit *pEdit = ((Edit*) pCtrl)->GetSubEdit(); + Edit *pEdit = static_cast<Edit*>(pCtrl)->GetSubEdit(); if ( pEdit ) pCtrl->Paint( Rectangle() ); // make sure the buttons are also drawn as they might overwrite the border } diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index a66ad77bbe36..edb66381a832 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -3276,7 +3276,7 @@ void VclBuilder::mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt1 if (rRow.size() > 1) { sal_IntPtr nValue = rRow[1].toInt32(); - rTarget.SetEntryData(nEntry, (void*)nValue); + rTarget.SetEntryData(nEntry, reinterpret_cast<void*>(nValue)); } } if (nActiveId < rStore.m_aEntries.size()) diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 8fdf1dbd5351..19d63b074e3f 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -618,7 +618,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, const StyleSettings& rStyleSettings, sal_uInt16 nStyle ) { - 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; const bool bMenuStyle = nStyle & FRAME_DRAW_MENU; @@ -1041,7 +1041,7 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo { Point aStart( rStart ), aStop( rStop ); const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings(); - vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? (vcl::Window*) mpOutDev: NULL; + vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(mpOutDev) : NULL; if(pWin) { ControlPart nPart = ( bVertical ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ ); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 1d35780ba0f6..c654423092cf 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -65,7 +65,7 @@ static OString ImplGetDialogText( Dialog* pDialog ) { aErrorStr.append(", "); aErrorStr.append(OUStringToOString( - ((MessBox*)pDialog)->GetMessText(), RTL_TEXTENCODING_UTF8)); + static_cast<MessBox*>(pDialog)->GetMessText(), RTL_TEXTENCODING_UTF8)); } return aErrorStr.makeStringAndClear(); } @@ -265,7 +265,7 @@ static PushButton* ImplGetDefaultButton( Dialog* pDialog ) { if ( pChild->ImplIsPushButton() ) { - PushButton* pPushButton = (PushButton*)pChild; + PushButton* pPushButton = static_cast<PushButton*>(pChild); if ( pPushButton->ImplIsDefButton() ) return pPushButton; } @@ -282,7 +282,7 @@ static PushButton* ImplGetOKButton( Dialog* pDialog ) while ( pChild ) { if ( pChild->GetType() == WINDOW_OKBUTTON ) - return (PushButton*)pChild; + return static_cast<PushButton*>(pChild); pChild = pChild->GetWindow( WINDOW_NEXT ); } @@ -297,7 +297,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog ) while ( pChild ) { if ( pChild->GetType() == WINDOW_CANCELBUTTON ) - return (PushButton*)pChild; + return static_cast<PushButton*>(pChild); pChild = pChild->GetWindow( WINDOW_NEXT ); } @@ -627,7 +627,7 @@ void Dialog::StateChanged( StateChangedType nType ) if ( ImplGetCancelButton( this ) || ImplGetOKButton( this ) ) { if ( ImplGetBorderWindow() ) - ((ImplBorderWindow*)ImplGetBorderWindow())->SetCloseButton(); + static_cast<ImplBorderWindow*>(ImplGetBorderWindow())->SetCloseButton(); } } @@ -1047,7 +1047,7 @@ void Dialog::SetModalInputMode( bool bModal, bool bSubModalDialogs ) while ( pOverlap ) { if ( pOverlap->IsDialog() ) - ((Dialog*)pOverlap)->SetModalInputMode( bModal, true ); + static_cast<Dialog*>(pOverlap)->SetModalInputMode( bModal, true ); pOverlap = pOverlap->mpWindowImpl->mpNext; } } diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index a43247d71313..77ac0f17f029 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -95,7 +95,7 @@ static vcl::Window* ImplGetSubChildWindow( vcl::Window* pParent, sal_uInt16 n, s // for a TabControl, remember the current TabPage for later use if ( pWindow->GetType() == WINDOW_TABCONTROL ) { - TabControl* pTabControl = ((TabControl*)pWindow); + TabControl* pTabControl = static_cast<TabControl*>(pWindow); // Check if the TabPage is a Child of the TabControl and still exists (by // walking all child windows); because it could be that the TabPage has been // destroyed already by a Dialog-Dtor, event that the TabControl still exists. @@ -480,8 +480,8 @@ void Window::ImplControlFocus( sal_uInt16 nFlags ) { if ( GetType() == WINDOW_RADIOBUTTON ) { - if ( !((RadioButton*)this)->IsChecked() ) - ((RadioButton*)this)->ImplCallClick( true, nFlags ); + if ( !static_cast<RadioButton*>(this)->IsChecked() ) + static_cast<RadioButton*>(this)->ImplCallClick( true, nFlags ); else ImplGrabFocus( nFlags ); } @@ -491,12 +491,12 @@ void Window::ImplControlFocus( sal_uInt16 nFlags ) if ( nFlags & GETFOCUS_UNIQUEMNEMONIC ) { if ( GetType() == WINDOW_CHECKBOX ) - ((CheckBox*)this)->ImplCheck(); + static_cast<CheckBox*>(this)->ImplCheck(); else if ( mpWindowImpl->mbPushButton ) { - ((PushButton*)this)->SetPressed( true ); - ((PushButton*)this)->SetPressed( false ); - ((PushButton*)this)->Click(); + static_cast<PushButton*>(this)->SetPressed( true ); + static_cast<PushButton*>(this)->SetPressed( false ); + static_cast<PushButton*>(this)->Click(); } } } @@ -505,8 +505,8 @@ void Window::ImplControlFocus( sal_uInt16 nFlags ) { if ( GetType() == WINDOW_RADIOBUTTON ) { - if ( !((RadioButton*)this)->IsChecked() ) - ((RadioButton*)this)->ImplCallClick( true, nFlags ); + if ( !static_cast<RadioButton*>(this)->IsChecked() ) + static_cast<RadioButton*>(this)->ImplCallClick( true, nFlags ); else ImplGrabFocus( nFlags ); } @@ -718,7 +718,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) { if ( mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow ) { - ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( false ); + static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( false ); mpWindowImpl->mpDlgCtrlDownWindow = NULL; return true; } @@ -930,18 +930,18 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) { if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow) ) { - ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( false ); + static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( false ); mpWindowImpl->mpDlgCtrlDownWindow = NULL; } - ((PushButton*)pButtonWindow)->SetPressed( true ); + static_cast<PushButton*>(pButtonWindow)->SetPressed( true ); mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow; } else if ( mpWindowImpl->mpDlgCtrlDownWindow == pButtonWindow ) { mpWindowImpl->mpDlgCtrlDownWindow = NULL; - ((PushButton*)pButtonWindow)->SetPressed( false ); - ((PushButton*)pButtonWindow)->Click(); + static_cast<PushButton*>(pButtonWindow)->SetPressed( false ); + static_cast<PushButton*>(pButtonWindow)->Click(); } return true; @@ -1022,7 +1022,7 @@ static void ImplDlgCtrlUpdateDefButton( vcl::Window* pParent, vcl::Window* pFocu { if ( pSWindow->ImplIsPushButton() ) { - PushButton* pPushButton = (PushButton*)pSWindow; + PushButton* pPushButton = static_cast<PushButton*>(pSWindow); if ( pPushButton->ImplIsDefButton() ) pOldDefButton = pPushButton; if ( pPushButton->HasChildPathFocus() ) @@ -1060,7 +1060,7 @@ void Window::ImplDlgCtrlFocusChanged( vcl::Window* pWindow, bool bGetFocus ) { if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus ) { - ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( false ); + static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( false ); mpWindowImpl->mpDlgCtrlDownWindow = NULL; } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index fa26164a7ecb..de43ab797673 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -1059,7 +1059,7 @@ void ImplDockingWindowWrapper::ToggleFloatingMode() // note: this must be done *before* notifying the // listeners to have the toolbox in the proper state if( GetWindow()->ImplIsDockingWindow() ) - ((DockingWindow*) GetWindow())->ToggleFloatingMode(); + static_cast<DockingWindow*>(GetWindow())->ToggleFloatingMode(); // now notify listeners GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_TOGGLEFLOATING ); @@ -1186,7 +1186,7 @@ IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd) GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); // set parameter for handler before destroying floating window - ImplPopupFloatWin *pPopupFloatWin = (ImplPopupFloatWin*) mpFloatWin; + ImplPopupFloatWin *pPopupFloatWin = static_cast<ImplPopupFloatWin*>(mpFloatWin); EndPopupModeData aData( pPopupFloatWin->GetTearOffPosition(), mpFloatWin->IsPopupModeTearOff() ); // before deleting change parent back, so we can delete the floating window alone @@ -1195,7 +1195,7 @@ IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd) if ( mpOldBorderWin ) { GetWindow()->SetParent( mpOldBorderWin ); - ((ImplBorderWindow*)mpOldBorderWin)->GetBorder( + static_cast<ImplBorderWindow*>(mpOldBorderWin)->GetBorder( GetWindow()->mpWindowImpl->mnLeftBorder, GetWindow()->mpWindowImpl->mnTopBorder, GetWindow()->mpWindowImpl->mnRightBorder, GetWindow()->mpWindowImpl->mnBottomBorder ); mpOldBorderWin->Resize(); @@ -1310,7 +1310,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) if ( mpOldBorderWin ) { GetWindow()->SetParent( mpOldBorderWin ); - ((ImplBorderWindow*)mpOldBorderWin)->GetBorder( + static_cast<ImplBorderWindow*>(mpOldBorderWin)->GetBorder( GetWindow()->mpWindowImpl->mnLeftBorder, GetWindow()->mpWindowImpl->mnTopBorder, GetWindow()->mpWindowImpl->mnRightBorder, GetWindow()->mpWindowImpl->mnBottomBorder ); mpOldBorderWin->Resize(); diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 4679fcc4bbae..83f0de88d7c4 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -805,7 +805,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) if ( mpOldBorderWin ) { SetParent( mpOldBorderWin ); - ((ImplBorderWindow*)mpOldBorderWin)->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); + static_cast<ImplBorderWindow*>(mpOldBorderWin)->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpOldBorderWin->Resize(); } mpWindowImpl->mpBorderWindow = mpOldBorderWin; diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 273dd5b2796e..b2340be34235 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -578,8 +578,8 @@ void FloatingWindow::SetTitleType( sal_uInt16 nTitle ) nTitleStyle = BORDERWINDOW_TITLE_POPUP; else // nTitle == FLOATWIN_TITLE_NONE nTitleStyle = BORDERWINDOW_TITLE_NONE; - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetTitleType( nTitleStyle, aOutSize ); - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetTitleType( nTitleStyle, aOutSize ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); } } diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 3a898f50d5c5..f448b0242500 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2024,7 +2024,7 @@ void MessageDialog::setButtonHandlers(VclButtonBox *pButtonBox) { case WINDOW_PUSHBUTTON: { - PushButton* pButton = (PushButton*)pChild; + PushButton* pButton = static_cast<PushButton*>(pChild); pButton->SetClickHdl(LINK(this, MessageDialog, ButtonHdl)); break; } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 21e16d3f1a20..0a96f9fd73ca 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -142,7 +142,7 @@ Menu::~Menu() // and make sure the MenuFloatingWindow knows about our destruction if ( pWindow ) { - MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow; + MenuFloatingWindow* pFloat = static_cast<MenuFloatingWindow*>(pWindow); if( pFloat->pMenu == this ) pFloat->pMenu = NULL; pWindow->SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >() ); @@ -775,7 +775,7 @@ void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) return; // same menu, nothing to do - if ( (PopupMenu*)pData->pSubMenu == pMenu ) + if ( dynamic_cast<PopupMenu*>(pData->pSubMenu) == pMenu ) return; // data exchange @@ -802,7 +802,7 @@ PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) - return (PopupMenu*)(pData->pSubMenu); + return static_cast<PopupMenu*>(pData->pSubMenu); else return NULL; } @@ -1688,7 +1688,7 @@ Size Menu::ImplCalcSize( const vcl::Window* pWin ) // account for the size of the close button, which actually is a toolbox // due to NWF this is variable - long nCloseButtonHeight = ((MenuBarWindow*) pWindow)->MinCloseButtonSize().Height(); + long nCloseButtonHeight = static_cast<MenuBarWindow*>(pWindow)->MinCloseButtonSize().Height(); if (aSz.Height() < nCloseButtonHeight) aSz.Height() = nCloseButtonHeight; } @@ -2243,7 +2243,7 @@ void Menu::ImplFillLayoutData() const } else { - MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow; + MenuFloatingWindow* pFloat = static_cast<MenuFloatingWindow*>(pWindow); ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, false, true ); } } @@ -2958,9 +2958,9 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_ { sal_uInt16 aPos; if (pSFrom->IsMenuBar()) - aPos = ((MenuBarWindow *) pSFrom->pWindow)->GetHighlightedItem(); + aPos = static_cast<MenuBarWindow *>(pSFrom->pWindow)->GetHighlightedItem(); else - aPos = ((MenuFloatingWindow *) pSFrom->pWindow)->GetHighlightedItem(); + aPos = static_cast<MenuFloatingWindow *>(pSFrom->pWindow)->GetHighlightedItem(); pWin->SetPosInParent( aPos ); // store position to be sent in SUBMENUDEACTIVATE pSFrom->ImplCallEventListeners( VCLEVENT_MENU_SUBMENUACTIVATE, aPos ); diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index c9770ca813f5..840c5e19e83c 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -223,7 +223,7 @@ IMPL_LINK_NOARG(MenuBarWindow, CloseHdl) // #i106052# call close hdl asynchronously to ease handler implementation // this avoids still being in the handler while the DecoToolBox already // gets destroyed - Application::PostUserEvent(((MenuBar*)pMenu)->GetCloseButtonClickHdl(), pMenu); + Application::PostUserEvent(static_cast<MenuBar*>(pMenu)->GetCloseButtonClickHdl(), pMenu); } else { @@ -278,12 +278,12 @@ IMPL_LINK( MenuBarWindow, ShowHideListener, VclWindowEvent*, pEvent ) IMPL_LINK_NOARG(MenuBarWindow, FloatHdl) { - return pMenu ? ((MenuBar*)pMenu)->GetFloatButtonClickHdl().Call( pMenu ) : 0; + return pMenu ? static_cast<MenuBar*>(pMenu)->GetFloatButtonClickHdl().Call( pMenu ) : 0; } IMPL_LINK_NOARG(MenuBarWindow, HideHdl) { - return pMenu ? ((MenuBar*)pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0; + return pMenu ? static_cast<MenuBar*>(pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0; } void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) @@ -296,9 +296,10 @@ void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) { KillActivePopup(); } - if ( pItemData->bEnabled && pItemData->pSubMenu && ( nHighlightedItem != ITEMPOS_INVALID ) && ( pItemData->pSubMenu != pActivePopup ) ) + if ( pItemData->bEnabled && pItemData->pSubMenu && ( nHighlightedItem != ITEMPOS_INVALID ) && + ( pItemData->pSubMenu != pActivePopup ) ) { - pActivePopup = (PopupMenu*)pItemData->pSubMenu; + pActivePopup = static_cast<PopupMenu*>(pItemData->pSubMenu); long nX = 0; MenuItemData* pData = 0; for ( sal_uLong n = 0; n < nHighlightedItem; n++ ) @@ -341,7 +342,7 @@ void MenuBarWindow::KillActivePopup() if ( pActivePopup ) { if( pActivePopup->pWindow != NULL ) - if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() ) + if( static_cast<FloatingWindow *>(pActivePopup->pWindow)->IsInCleanUp() ) return; // kill it later if ( pActivePopup->bInCallback ) @@ -713,7 +714,7 @@ bool MenuBarWindow::HandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu ) { if( GetParent()->GetWindow( WINDOW_CLIENT )->IsSystemWindow() ) { - SystemWindow *pSysWin = (SystemWindow*)GetParent()->GetWindow( WINDOW_CLIENT ); + SystemWindow *pSysWin = static_cast<SystemWindow*>(GetParent()->GetWindow( WINDOW_CLIENT )); if( pSysWin->GetTaskPaneList() ) if( pSysWin->GetTaskPaneList()->HandleKeyEvent( rKEvent ) ) return true; @@ -1000,7 +1001,7 @@ void MenuBarWindow::LayoutChanged() // depending on the native implementation or the displayable flag // the menubar windows is suppressed (ie, height=0) - if( !((MenuBar*) pMenu)->IsDisplayable() || + if( !static_cast<MenuBar*>(pMenu)->IsDisplayable() || ( pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar() ) ) nHeight = 0; diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index ad53c97a66f6..dab3dec3ff54 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -80,7 +80,7 @@ void MenuFloatingWindow::doShutdown() } if( i < nCount ) { - MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow(); + MenuFloatingWindow* pPWin = dynamic_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->ImplGetWindow()); if( pPWin ) pPWin->HighlightItem( i, false ); } @@ -284,7 +284,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) } if ( pItemData->bEnabled && pItemData->pSubMenu && pItemData->pSubMenu->GetItemCount() && ( pItemData->pSubMenu != pActivePopup ) ) { - pActivePopup = (PopupMenu*)pItemData->pSubMenu; + pActivePopup = static_cast<PopupMenu*>(pItemData->pSubMenu); long nY = nScrollerHeight+ImplGetStartY(); MenuItemData* pData = 0; for ( sal_uLong n = 0; n < nHighlightedItem; n++ ) @@ -334,7 +334,7 @@ IMPL_LINK_NOARG(MenuFloatingWindow, SubmenuClose) { if( pMenu && pMenu->pStartedFrom ) { - MenuFloatingWindow* pWin = (MenuFloatingWindow*) pMenu->pStartedFrom->GetWindow(); + MenuFloatingWindow* pWin = static_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->GetWindow()); if( pWin ) pWin->KillActivePopup(); } @@ -365,7 +365,7 @@ void MenuFloatingWindow::Execute() { ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu; + pSVData->maAppData.mpActivePopupMenu = static_cast<PopupMenu*>(pMenu); bInExecute = true; // bCallingSelect = false; @@ -408,7 +408,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) if ( pActivePopup && ( !pThisOnly || ( pThisOnly == pActivePopup ) ) ) { if( pActivePopup->pWindow != NULL ) - if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() ) + if( static_cast<FloatingWindow *>(pActivePopup->pWindow)->IsInCleanUp() ) return; // kill it later if ( pActivePopup->bInCallback ) pActivePopup->bCanceled = true; @@ -445,7 +445,7 @@ void MenuFloatingWindow::EndExecute() while (pWin && !pWin->bInExecute && pWin->pMenu->pStartedFrom && !pWin->pMenu->pStartedFrom->IsMenuBar()) { - pWin = ((PopupMenu*)pWin->pMenu->pStartedFrom)->ImplGetFloatingWindow(); + pWin = static_cast<PopupMenu*>(pWin->pMenu->pStartedFrom)->ImplGetFloatingWindow(); } if ( pWin ) pCleanUpFrom = pWin; @@ -596,7 +596,7 @@ void MenuFloatingWindow::ImplScroll( bool bUp ) long nHeight = GetOutputSizePixel().Height(); sal_uInt16 nLastVisible; - ((PopupMenu*)pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible ); + static_cast<PopupMenu*>(pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible ); if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID ) { bScrollDown = false; @@ -682,7 +682,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime } if( i < nCount ) { - MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow(); + MenuFloatingWindow* pPWin = dynamic_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->ImplGetWindow()); if( pPWin && pPWin->nHighlightedItem != i ) { pPWin->HighlightItem( i, true ); @@ -911,11 +911,11 @@ void MenuFloatingWindow::ImplCursorUpDown( bool bUp, bool bHomeEnd ) Size aOutSz = GetOutputSizePixel(); sal_uInt16 nLastVisible; - ((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); + static_cast<PopupMenu*>(pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); while ( n > nLastVisible ) { ImplScroll( false ); - ((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); + static_cast<PopupMenu*>(pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); } } ChangeHighlightItem( n, false ); @@ -965,7 +965,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) else { StopExecute(); - PopupMenu* pPopupMenu = (PopupMenu*)pMenu->pStartedFrom; + PopupMenu* pPopupMenu = static_cast<PopupMenu*>(pMenu->pStartedFrom); MenuFloatingWindow* pFloat = pPopupMenu->ImplGetFloatingWindow(); pFloat->GrabFocus(); pFloat->KillActivePopup(); @@ -985,7 +985,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) } else { - MenuFloatingWindow* pFloat = ((PopupMenu*)pMenu->pStartedFrom)->ImplGetFloatingWindow(); + MenuFloatingWindow* pFloat = static_cast<PopupMenu*>(pMenu->pStartedFrom)->ImplGetFloatingWindow(); pFloat->GrabFocus(); pFloat->KillActivePopup(); sal_uInt16 highlightItem = pFloat->GetHighlightedItem(); diff --git a/vcl/source/window/menuitemlist.cxx b/vcl/source/window/menuitemlist.cxx index 6699259e830f..10129d468885 100644 --- a/vcl/source/window/menuitemlist.cxx +++ b/vcl/source/window/menuitemlist.cxx @@ -34,7 +34,7 @@ MenuItemData::~MenuItemData() { if( pAutoSubMenu ) { - ((PopupMenu*)pAutoSubMenu)->pRefAutoSubMenu = NULL; + static_cast<PopupMenu*>(pAutoSubMenu)->pRefAutoSubMenu = NULL; delete pAutoSubMenu; pAutoSubMenu = NULL; } diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index c7d8bb1072f8..0a9ab7a5ad48 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -275,7 +275,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags ) { // #102158#, ignore grabfocus only if the floating parent grabs keyboard focus by itself (GrabsFocus()) // otherwise we cannot set the focus in a floating toolbox - if( ( (pParent->mpWindowImpl->mbFloatWin && ((FloatingWindow*)pParent)->GrabsFocus()) || ( pParent->GetStyle() & WB_SYSTEMFLOATWIN ) ) && !( pParent->GetStyle() & WB_MOVEABLE ) ) + if( ( (pParent->mpWindowImpl->mbFloatWin && static_cast<FloatingWindow*>(pParent)->GrabsFocus()) || ( pParent->GetStyle() & WB_SYSTEMFLOATWIN ) ) && !( pParent->GetStyle() & WB_MOVEABLE ) ) { bMustNotGrabFocus = true; break; diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx index 8c13006d5349..1bd7da5fc4cf 100644 --- a/vcl/source/window/resource.cxx +++ b/vcl/source/window/resource.cxx @@ -145,7 +145,7 @@ void Window::ImplLoadRes( const ResId& rResId ) if ( nObjMask & WINDOW_EXTRALONG ) { sal_uIntPtr nRes = ReadLongRes(); - SetData( (void*)nRes ); + SetData( reinterpret_cast<void*>(nRes) ); } if ( nObjMask & WINDOW_UNIQUEID ) SetUniqueId( ReadByteStringRes() ); diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index e89f1b6dcf1b..7126ee1f2175 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -51,8 +51,8 @@ void Window::SetSettings( const AllSettings& rSettings, bool bChild ) { mpWindowImpl->mpBorderWindow->SetSettings( rSettings, false ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, true ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, true ); } AllSettings aOldSettings(*mxSettings); @@ -86,8 +86,8 @@ void Window::UpdateSettings( const AllSettings& rSettings, bool bChild ) { mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, false ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, true ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, true ); } AllSettings aOldSettings(*mxSettings); diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index 62a6fb15203e..2f5efebe479d 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -193,7 +193,7 @@ Splitter* Splitter::ImplFindSibling() { if( pWin->ImplIsSplitter() ) { - pSplitter = (Splitter*) pWin; + pSplitter = static_cast<Splitter*>(pWin); if( pSplitter != this && IsHorizontal() != pSplitter->IsHorizontal() ) return pSplitter; } diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index cf6fef338580..d9fb863adfcc 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -836,7 +836,7 @@ SystemWindow* Window::GetSystemWindow() const const vcl::Window* pWin = this; while ( pWin && !pWin->IsSystemWindow() ) pWin = pWin->GetParent(); - return (SystemWindow*)pWin; + return static_cast<SystemWindow*>(const_cast<Window*>(pWin)); } static SystemWindow *ImplGetLastSystemWindow( vcl::Window *pWin ) @@ -849,7 +849,7 @@ static SystemWindow *ImplGetLastSystemWindow( vcl::Window *pWin ) while ( pMyParent ) { if ( pMyParent->IsSystemWindow() ) - pSysWin = (SystemWindow*)pMyParent; + pSysWin = static_cast<SystemWindow*>(pMyParent); pMyParent = pMyParent->GetParent(); } return pSysWin; @@ -991,7 +991,7 @@ void Window::SetParent( vcl::Window* pNewParent ) { if ( (GetType() == WINDOW_BORDERWINDOW) && (ImplGetWindow()->GetType() == WINDOW_FLOATINGWINDOW) ) - ((ImplBorderWindow*)this)->SetDisplayActive( mpWindowImpl->mpFrameData->mbHasFocus ); + static_cast<ImplBorderWindow*>(this)->SetDisplayActive( mpWindowImpl->mpFrameData->mbHasFocus ); } // when required give focus to new frame if diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 9adb1e1712e2..9f780e909b0e 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -455,7 +455,7 @@ void StatusBar::ImplDrawItem( bool bOffScreen, sal_uInt16 nPos, bool bDrawText, const OutputDevice *pOutDev = GetOutDev(); if ( !pOutDev->ImplIsRecordLayout() ) - ImplCallEventListeners( VCLEVENT_STATUSBAR_DRAWITEM, (void*) sal_IntPtr(pItem->mnId) ); + ImplCallEventListeners( VCLEVENT_STATUSBAR_DRAWITEM, reinterpret_cast<void*>(pItem->mnId) ); } void DrawProgress( vcl::Window* pWindow, const Point& rPos, @@ -919,7 +919,7 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth, if ( ImplIsItemUpdate() ) Invalidate(); - ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMADDED, (void*) sal_IntPtr(nItemId) ); + ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMADDED, reinterpret_cast<void*>(nItemId) ); } void StatusBar::RemoveItem( sal_uInt16 nItemId ) @@ -934,7 +934,7 @@ void StatusBar::RemoveItem( sal_uInt16 nItemId ) if ( ImplIsItemUpdate() ) Invalidate(); - ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMREMOVED, (void*) sal_IntPtr(nItemId) ); + ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMREMOVED, reinterpret_cast<void*>(nItemId) ); } } @@ -953,7 +953,7 @@ void StatusBar::ShowItem( sal_uInt16 nItemId ) if ( ImplIsItemUpdate() ) Invalidate(); - ImplCallEventListeners( VCLEVENT_STATUSBAR_SHOWITEM, (void*) sal_IntPtr(nItemId) ); + ImplCallEventListeners( VCLEVENT_STATUSBAR_SHOWITEM, reinterpret_cast<void*>(nItemId) ); } } } @@ -973,7 +973,7 @@ void StatusBar::HideItem( sal_uInt16 nItemId ) if ( ImplIsItemUpdate() ) Invalidate(); - ImplCallEventListeners( VCLEVENT_STATUSBAR_HIDEITEM, (void*) sal_IntPtr(nItemId) ); + ImplCallEventListeners( VCLEVENT_STATUSBAR_HIDEITEM, reinterpret_cast<void*>(nItemId) ); } } } @@ -1471,7 +1471,7 @@ void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const OUString& rName ) if ( pItem->maAccessibleName != rName ) { pItem->maAccessibleName = rName; - ImplCallEventListeners( VCLEVENT_STATUSBAR_NAMECHANGED, (void*) sal_IntPtr(pItem->mnId) ); + ImplCallEventListeners( VCLEVENT_STATUSBAR_NAMECHANGED, reinterpret_cast<void*>(pItem->mnId) ); } } } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index b509d455d1cf..78c31f1374e2 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -173,17 +173,17 @@ void SystemChildWindow::ImplTestJavaException( void* pEnv ) jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable"); jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;"); - jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage); - OUString ouMessage; + jstring jsMessage = static_cast<jstring>( pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage) ); + OUString ouMessage; - if(jsMessage) - { - const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); - ouMessage = OUString(jcMessage); - pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); - } + if(jsMessage) + { + const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); + ouMessage = OUString(jcMessage); + pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); + } - throw uno::RuntimeException(ouMessage); + throw uno::RuntimeException(ouMessage); } #else (void)pEnv; diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 9666c34ad3ba..6ecf711d75ac 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -121,7 +121,7 @@ bool SystemWindow::Notify( NotifyEvent& rNEvt ) { vcl::Window* pWin = ImplGetFrameWindow()->ImplGetWindow(); if( pWin && pWin->IsSystemWindow() ) - pMBar = ((SystemWindow*)pWin)->GetMenuBar(); + pMBar = static_cast<SystemWindow*>(pWin)->GetMenuBar(); } if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), false ) ) return true; @@ -150,7 +150,7 @@ bool SystemWindow::PreNotify( NotifyEvent& rNEvt ) { vcl::Window* pWin = ImplGetFrameWindow()->ImplGetWindow(); if( pWin && pWin->IsSystemWindow() ) - pTList = ((SystemWindow*)pWin)->mpImplData->mpTaskPaneList; + pTList = static_cast<SystemWindow*>(pWin)->mpImplData->mpTaskPaneList; } if( !pTList ) { @@ -161,7 +161,7 @@ bool SystemWindow::PreNotify( NotifyEvent& rNEvt ) { pWin = pWin->GetParent(); if( pWin && pWin->IsSystemWindow() ) - pSysWin = (SystemWindow*) pWin; + pSysWin = static_cast<SystemWindow*>(pWin); } pTList = pSysWin->mpImplData->mpTaskPaneList; } @@ -184,7 +184,7 @@ TaskPaneList* SystemWindow::GetTaskPaneList() { vcl::Window* pWin = ImplGetFrameWindow()->ImplGetWindow(); if ( pWin && pWin->IsSystemWindow() ) - pMBar = ((SystemWindow*)pWin)->GetMenuBar(); + pMBar = static_cast<SystemWindow*>(pWin)->GetMenuBar(); } if( pMBar ) mpImplData->mpTaskPaneList->AddWindow( pMBar->ImplGetWindow() ); @@ -303,7 +303,7 @@ void SystemWindow::ShowTitleButton( sal_uInt16 nButton, bool bVisible ) { mbDockBtn = bVisible; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetDockButton( bVisible ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetDockButton( bVisible ); } } else if ( nButton == TITLE_BUTTON_HIDE ) @@ -312,13 +312,13 @@ void SystemWindow::ShowTitleButton( sal_uInt16 nButton, bool bVisible ) { mbHideBtn = bVisible; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetHideButton( bVisible ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetHideButton( bVisible ); } } else if ( nButton == TITLE_BUTTON_MENU ) { if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuButton( bVisible ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuButton( bVisible ); } else return; @@ -338,7 +338,7 @@ void SystemWindow::SetPin( bool bPin ) { mbPinned = bPin; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetPin( bPin ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetPin( bPin ); } } @@ -353,7 +353,7 @@ void SystemWindow::RollUp() aSize.Width() = GetOutputSizePixel().Width(); mbRollUp = true; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( true, aSize ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetRollUp( true, aSize ); else SetOutputSizePixel( aSize ); mbRollFunc = false; @@ -366,7 +366,7 @@ void SystemWindow::RollDown() { mbRollUp = false; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( false, maOrgSize ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetRollUp( false, maOrgSize ); else SetOutputSizePixel( maOrgSize ); } @@ -377,7 +377,7 @@ void SystemWindow::SetMinOutputSizePixel( const Size& rSize ) maMinOutSize = rSize; if ( mpWindowImpl->mpBorderWindow ) { - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMinOutputSize( rSize.Width(), rSize.Height() ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMinOutputSize( rSize.Width(), rSize.Height() ); if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() ); } @@ -396,7 +396,7 @@ void SystemWindow::SetMaxOutputSizePixel( const Size& rSize ) mpImplData->maMaxOutSize = aSize; if ( mpWindowImpl->mpBorderWindow ) { - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMaxOutputSize( aSize.Width(), aSize.Height() ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMaxOutputSize( aSize.Width(), aSize.Height() ); if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() ); } @@ -902,11 +902,11 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar, const css::uno::Reference<css:: if ( pMenuBar ) { DBG_ASSERT( !pMenuBar->pWindow, "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" ); - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarWindow(pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar, rFrame)); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( pNewWindow = MenuBar::ImplCreate( mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar, rFrame)); ImplCallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, (void*) pMenuBar ); } else - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( NULL ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( NULL ); ImplToBottomChild(); if ( pOldMenuBar ) { @@ -949,9 +949,9 @@ void SystemWindow::SetMenuBarMode( sal_uInt16 nMode ) if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) ) { if ( nMode == MENUBAR_MODE_HIDE ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( true ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarMode( true ); else - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( false ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarMode( false ); } } } diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index f5cb91b4d57f..de4916708728 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -33,8 +33,8 @@ Point ImplTaskPaneListGetPos( const vcl::Window *w ) Point pos; if( w->ImplIsDockingWindow() ) { - pos = ((DockingWindow*)w)->GetPosPixel(); - vcl::Window *pF = ((DockingWindow*)w)->GetFloatingWindow(); + pos = static_cast<const DockingWindow*>(w)->GetPosPixel(); + vcl::Window *pF = static_cast<const DockingWindow*>(w)->GetFloatingWindow(); if( pF ) pos = pF->OutputToAbsoluteScreenPixel( pF->ScreenToOutputPixel( pos ) ); else diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 74ad67bf23af..e04def3b9e39 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -755,7 +755,7 @@ bool Window::AcquireGraphics() const OutputDevice* pReleaseOutDev = pSVData->maGDIData.mpLastWinGraphics; while ( pReleaseOutDev ) { - if ( ((vcl::Window*)pReleaseOutDev)->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame ) + if ( static_cast<vcl::Window*>(pReleaseOutDev)->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame ) break; pReleaseOutDev = pReleaseOutDev->mpPrevGraphics; } @@ -923,9 +923,9 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p // check for undecorated floating window if( // 1. floating windows that are not moveable/sizeable (only closeable allowed) ( !(nFrameStyle & ~SAL_FRAME_STYLE_CLOSEABLE) && - ( mpWindowImpl->mbFloatWin || ((GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)this)->mbFloatWindow) || (nStyle & WB_SYSTEMFLOATWIN) ) ) || + ( mpWindowImpl->mbFloatWin || ((GetType() == WINDOW_BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow) || (nStyle & WB_SYSTEMFLOATWIN) ) ) || // 2. borderwindows of floaters with ownerdraw decoration - ( ((GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) ) ) + ( ((GetType() == WINDOW_BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) ) ) { nFrameStyle = SAL_FRAME_STYLE_FLOAT; if( nStyle & WB_OWNERDRAWDECORATION ) @@ -2083,7 +2083,7 @@ void Window::SetBorderStyle( sal_uInt16 nBorderStyle ) else { if ( mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetBorderStyle( nBorderStyle ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetBorderStyle( nBorderStyle ); else mpWindowImpl->mpBorderWindow->SetBorderStyle( nBorderStyle ); } @@ -2096,7 +2096,7 @@ sal_uInt16 Window::GetBorderStyle() const if ( mpWindowImpl->mpBorderWindow ) { if ( mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW ) - return ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->GetBorderStyle(); + return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->GetBorderStyle(); else return mpWindowImpl->mpBorderWindow->GetBorderStyle(); } @@ -2110,7 +2110,7 @@ long Window::CalcTitleWidth() const if ( mpWindowImpl->mpBorderWindow ) { if ( mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW ) - return ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->CalcTitleWidth(); + return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->CalcTitleWidth(); else return mpWindowImpl->mpBorderWindow->CalcTitleWidth(); } @@ -2514,8 +2514,8 @@ void Window::Enable( bool bEnable, bool bChild ) { mpWindowImpl->mpBorderWindow->Enable( bEnable, false ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, true ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, true ); } // #i56102# restore app focus win in case the @@ -2576,8 +2576,8 @@ void Window::EnableInput( bool bEnable, bool bChild ) { mpWindowImpl->mpBorderWindow->EnableInput( bEnable, false ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, true ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, true ); } if ( (! bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled) || @@ -3645,7 +3645,7 @@ bool Window::HasActiveChildFrame() // but FloatingWindows carry this information in their TitleType... // TODO: avoid duplicate WinBits !!! if( pChildFrame && pChildFrame->ImplIsFloatingWindow() ) - bDecorated = ((FloatingWindow*) pChildFrame)->GetTitleType() != FLOATWIN_TITLE_NONE; + bDecorated = static_cast<FloatingWindow*>(pChildFrame)->GetTitleType() != FLOATWIN_TITLE_NONE; if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) ) if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() ) { diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 9d143f1aabdd..0067e5694de7 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -480,7 +480,7 @@ sal_uIntPtr Window::SaveFocus() ImplFocusDelData* pDelData = new ImplFocusDelData; pSVData->maWinData.mpFocusWin->ImplAddDel( pDelData ); pDelData->mpFocusWin = pSVData->maWinData.mpFocusWin; - return (sal_uIntPtr)(void*)pDelData; + return reinterpret_cast<sal_uIntPtr>(pDelData); } else return 0; @@ -493,7 +493,7 @@ bool Window::EndSaveFocus( sal_uIntPtr nSaveId, bool bRestore ) else { bool bOK = true; - ImplFocusDelData* pDelData = (ImplFocusDelData*)(void*)nSaveId; + ImplFocusDelData* pDelData = reinterpret_cast<ImplFocusDelData*>(nSaveId); if ( !pDelData->IsDead() ) { pDelData->mpFocusWin->ImplRemoveDel( pDelData ); diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx index 570b7478fa98..3eda064b9c7a 100644 --- a/vcl/source/window/window3.cxx +++ b/vcl/source/window/window3.cxx @@ -39,10 +39,10 @@ void Window::ImplAdjustNWFSizes() switch( GetType() ) { case WINDOW_CHECKBOX: - ((CheckBox*)this)->ImplSetMinimumNWFSize(); + static_cast<CheckBox*>(this)->ImplSetMinimumNWFSize(); break; case WINDOW_RADIOBUTTON: - ((RadioButton*)this)->ImplSetMinimumNWFSize(); + static_cast<RadioButton*>(this)->ImplSetMinimumNWFSize(); break; default: { diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 4c948b4fd0d6..50ca77c375e5 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -846,7 +846,7 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow ) // focus or the last time the focus. // the first floating window always has the focus vcl::Window* pChild = pSVData->maWinData.mpFirstFloat; - if( !pChild || ( pChild->ImplGetWindowImpl()->mbFloatWin && !((FloatingWindow *)pChild)->GrabsFocus() ) ) + if( !pChild || ( pChild->ImplGetWindowImpl()->mbFloatWin && !static_cast<FloatingWindow *>(pChild)->GrabsFocus() ) ) pChild = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin; else { @@ -1649,7 +1649,7 @@ static void ImplActivateFloatingWindows( vcl::Window* pWindow, bool bActive ) { if ( (pTempWindow->GetType() == WINDOW_BORDERWINDOW) && (pTempWindow->ImplGetWindow()->GetType() == WINDOW_FLOATINGWINDOW) ) - ((ImplBorderWindow*)pTempWindow)->SetDisplayActive( bActive ); + static_cast<ImplBorderWindow*>(pTempWindow)->SetDisplayActive( bActive ); } ImplActivateFloatingWindows( pTempWindow, bActive ); @@ -1834,9 +1834,9 @@ static long DelayedCloseEventLink( void* pCEvent, void* ) pEv->pWindow->ImplRemoveDel( &pEv->aDelData ); // dispatch to correct window type if( pEv->pWindow->IsSystemWindow() ) - ((SystemWindow*)pEv->pWindow)->Close(); + static_cast<SystemWindow*>(pEv->pWindow)->Close(); else if( pEv->pWindow->ImplIsDockingWindow() ) - ((DockingWindow*)pEv->pWindow)->Close(); + static_cast<DockingWindow*>(pEv->pWindow)->Close(); } delete pEv; @@ -2008,7 +2008,7 @@ static bool ImplHandleMenuEvent( vcl::Window* pWindow, SalMenuEvent* pEvent, sal } if( pWin ) { - MenuBar *pMenuBar = ((SystemWindow*) pWin)->GetMenuBar(); + MenuBar *pMenuBar = static_cast<SystemWindow*>(pWin)->GetMenuBar(); if( pMenuBar ) { switch( nEvent ) diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 307b6d5aae3f..c997bc656da8 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -846,7 +846,7 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData ) // Rename/retype pDummy to your likings (though X11 Pixmap is // prolly not a good idea, since it's accessed from // non-platform aware code in vcl/bitmap.hxx) - rData.aPixmap = (void*)mpDDB->ImplGetPixmap(); + rData.aPixmap = reinterpret_cast<void*>(mpDDB->ImplGetPixmap()); rData.mnWidth = mpDDB->ImplGetWidth (); rData.mnHeight = mpDDB->ImplGetHeight (); return true; diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 84859dad4b85..8059449c1371 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -227,7 +227,7 @@ extern "C" { Bool bRet = False; if( (pEvent->type == GraphicsExpose || pEvent->type == NoExpose) && - pEvent->xnoexpose.drawable == (Drawable)pFrameWindow ) + pEvent->xnoexpose.drawable == reinterpret_cast<Drawable>(pFrameWindow) ) { bRet = True; } @@ -263,7 +263,7 @@ void X11SalGraphics::YieldGraphicsExpose() do { - if( ! GetDisplay()->XIfEventWithTimeout( &aEvent, (XPointer)aWindow, GraphicsExposePredicate ) ) + if( ! GetDisplay()->XIfEventWithTimeout( &aEvent, reinterpret_cast<XPointer>(aWindow), GraphicsExposePredicate ) ) // this should not happen at all; still sometimes it happens break; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index b99c2aa9a899..0c072ce36913 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2405,10 +2405,10 @@ void X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent) { #if SAL_TYPES_SIZEOFLONG > 4 - void* pExtTextEvent = (void*)( (pEvent->data.l[0] & 0xffffffff) - | (pEvent->data.l[1] << 32) ); + void* pExtTextEvent = reinterpret_cast<void*>( (pEvent->data.l[0] & 0xffffffff) + | (pEvent->data.l[1] << 32) ); #else - void* pExtTextEvent = (void*)(pEvent->data.l[0]); + void* pExtTextEvent = reinterpret_cast<void*>(pEvent->data.l[0]); #endif sal_uInt16 nExtTextEventType = sal_uInt16(pEvent->data.l[2]); diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index b2eae95ea044..fb0d25897111 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -483,7 +483,7 @@ static void create_wrapper_for_child( static void handle_toolbox_buttonchange(VclWindowEvent const *pEvent) { vcl::Window* pWindow = pEvent->GetWindow(); - sal_Int32 index = (sal_Int32)(sal_IntPtr) pEvent->GetData(); + sal_Int32 index = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEvent->GetData()); if( pWindow && pWindow->IsReallyVisible() ) { diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 38e02484cb68..ffacb587dc90 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2721,7 +2721,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, // Now the tab itself if( nState & CTRL_STATE_ROLLOVER ) - g_object_set_data(G_OBJECT(pixmap),tabPrelitDataName,(gpointer)TRUE); + g_object_set_data(G_OBJECT(pixmap),tabPrelitDataName,reinterpret_cast<gpointer>(TRUE)); gtk_paint_extension( gWidgetData[m_nXScreen].gNotebookWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[m_nXScreen].gNotebookWidget, (char *)"tab", (tabRect.Left() - pixmapRect.Left()), (tabRect.Top() - pixmapRect.Top()), @@ -4166,7 +4166,7 @@ static void NWSetWidgetState( GtkWidget* widget, ControlState nState, GtkStateTy GTK_WIDGET_UNSET_FLAGS( widget, GTK_HAS_DEFAULT ); GTK_WIDGET_UNSET_FLAGS( widget, GTK_HAS_FOCUS ); GTK_WIDGET_UNSET_FLAGS( widget, GTK_SENSITIVE ); - GTK_WIDGET_SET_FLAGS( widget, gWidgetDefaultFlags[(long)widget] ); + GTK_WIDGET_SET_FLAGS( widget, gWidgetDefaultFlags[reinterpret_cast<long>(widget)] ); if ( nState & CTRL_STATE_DEFAULT ) GTK_WIDGET_SET_FLAGS( widget, GTK_HAS_DEFAULT ); @@ -4209,7 +4209,7 @@ static void NWAddWidgetToCacheWindow( GtkWidget* widget, SalX11Screen nScreen ) gtk_widget_ensure_style( widget ); // Store widget's default flags - gWidgetDefaultFlags[ (long)widget ] = GTK_WIDGET_FLAGS( widget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(widget) ] = GTK_WIDGET_FLAGS( widget ); } static void NWEnsureGTKButton( SalX11Screen nScreen ) @@ -4385,7 +4385,7 @@ static void NWEnsureGTKMenubar( SalX11Screen nScreen ) gtk_widget_realize( gWidgetData[nScreen].gMenuItemMenubarWidget ); gtk_widget_ensure_style( gWidgetData[nScreen].gMenuItemMenubarWidget ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemMenubarWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenubarWidget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gMenuItemMenubarWidget) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenubarWidget ); } } @@ -4425,12 +4425,12 @@ static void NWEnsureGTKMenu( SalX11Screen nScreen ) gtk_widget_realize( gWidgetData[nScreen].gImageMenuItem ); gtk_widget_ensure_style( gWidgetData[nScreen].gImageMenuItem ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuWidget ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenuWidget ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemCheckMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemCheckMenuWidget ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemRadioMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemRadioMenuWidget ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ); - gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gImageMenuItem ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gImageMenuItem ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gMenuWidget) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuWidget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gMenuItemMenuWidget) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenuWidget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gMenuItemCheckMenuWidget) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemCheckMenuWidget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gMenuItemRadioMenuWidget) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemRadioMenuWidget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gMenuItemSeparatorMenuWidget) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ); + gWidgetDefaultFlags[ reinterpret_cast<long>(gWidgetData[nScreen].gImageMenuItem) ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gImageMenuItem ); } } |