diff options
-rw-r--r-- | include/svx/svdetc.hxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/ctredlin.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/docrecovery.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 8 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcols.cxx | 6 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 10 | ||||
-rw-r--r-- | svx/source/form/filtnav.cxx | 48 | ||||
-rw-r--r-- | svx/source/form/navigatortree.cxx | 42 | ||||
-rw-r--r-- | svx/source/items/customshapeitem.cxx | 42 | ||||
-rw-r--r-- | svx/source/sdr/properties/itemsettools.cxx | 14 | ||||
-rw-r--r-- | svx/source/svdraw/svdglev.cxx | 38 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdpoev.cxx | 18 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/XPropertyTable.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 14 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 4 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 8 |
22 files changed, 143 insertions, 143 deletions
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index ee9e0e5bef6c..27683824e12b 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -248,7 +248,7 @@ inline SdrGlobalData& GetSdrGlobalData() if (*ppAppData==NULL) { *ppAppData=new SdrGlobalData; } - return *((SdrGlobalData*)*ppAppData); + return *static_cast<SdrGlobalData*>(*ppAppData); } namespace sdr diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 586077f1a404..3cd2d2628c2b 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -53,7 +53,7 @@ SvxRedlinEntry::SvxRedlinEntry() SvxRedlinEntry::~SvxRedlinEntry() { - RedlinData* pRedDat=(RedlinData*) GetUserData(); + RedlinData* pRedDat=static_cast<RedlinData*>(GetUserData()); delete pRedDat; } @@ -130,8 +130,8 @@ sal_Int32 SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRi { if(nDatePos==GetSortedCol()) { - RedlinData *pLeftData=(RedlinData *)(pLeft->GetUserData()); - RedlinData *pRightData=(RedlinData *)(pRight->GetUserData()); + RedlinData *pLeftData=static_cast<RedlinData *>(pLeft->GetUserData()); + RedlinData *pRightData=static_cast<RedlinData *>(pRight->GetUserData()); if(pLeftData!=NULL && pRightData!=NULL) { diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index f7c8075ff0f4..ec5941f234f4 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -744,7 +744,7 @@ void RecovDocListEntry::Paint( const OUString* pTxt = 0; RecovDocList* pList = static_cast< RecovDocList* >(&aDevice); - TURLInfo* pInfo = (TURLInfo*)pEntry->GetUserData(); + TURLInfo* pInfo = static_cast<TURLInfo*>(pEntry->GetUserData()); switch(pInfo->RecoveryState) { case E_SUCCESSFULLY_RECOVERED : @@ -1088,7 +1088,7 @@ void RecoveryDialog::updateItems() if ( !pEntry ) continue; - TURLInfo* pInfo = (TURLInfo*)pEntry->GetUserData(); + TURLInfo* pInfo = static_cast<TURLInfo*>(pEntry->GetUserData()); if ( !pInfo ) continue; @@ -1112,7 +1112,7 @@ void RecoveryDialog::stepNext(TURLInfo* pItem) if (!pEntry) continue; - TURLInfo* pInfo = (TURLInfo*)pEntry->GetUserData(); + TURLInfo* pInfo = static_cast<TURLInfo*>(pEntry->GetUserData()); if (pInfo->ID != pItem->ID) continue; diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 8d460e0042b4..97c2ce0ecec1 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -273,7 +273,7 @@ void SvxRubyDialog::ClearCharStyleList() for(sal_uInt16 i = 0; i < m_pCharStyleLB->GetEntryCount(); i++) { void* pData = m_pCharStyleLB->GetEntryData(i); - delete (OUString*)pData; + delete static_cast<OUString*>(pData); } m_pCharStyleLB->Clear(); } @@ -456,7 +456,7 @@ void SvxRubyDialog::Update() } if(nPosition > -2 && pProps[nProp].Name == cRubyIsAbove ) { - bool bTmp = *(sal_Bool*)pProps[nProp].Value.getValue(); + bool bTmp = *static_cast<sal_Bool const *>(pProps[nProp].Value.getValue()); if(!nRuby) nPosition = bTmp ? 0 : 1; else if( (!nPosition && !bTmp) || (nPosition == 1 && bTmp) ) @@ -490,7 +490,7 @@ void SvxRubyDialog::Update() { for(sal_uInt16 i = 0; i < m_pCharStyleLB->GetEntryCount(); i++) { - const OUString* pCoreName = (const OUString*)m_pCharStyleLB->GetEntryData(i); + const OUString* pCoreName = static_cast<const OUString*>(m_pCharStyleLB->GetEntryData(i)); if(pCoreName && sCharStyleName == *pCoreName) { m_pCharStyleLB->SelectEntryPos(i); @@ -621,7 +621,7 @@ IMPL_LINK_NOARG(SvxRubyDialog, CharStyleHdl_Impl) AssertOneEntry(); OUString sStyleName; if(LISTBOX_ENTRY_NOTFOUND != m_pCharStyleLB->GetSelectEntryPos()) - sStyleName = *(OUString*) m_pCharStyleLB->GetSelectEntryData(); + sStyleName = *static_cast<OUString*>(m_pCharStyleLB->GetSelectEntryData()); Sequence<PropertyValues>& aRubyValues = pImpl->GetRubyValues(); for(sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) { diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx index 02b11a909522..0f4669279431 100644 --- a/svx/source/fmcomp/gridcols.cxx +++ b/svx/source/fmcomp/gridcols.cxx @@ -49,7 +49,7 @@ const ::comphelper::StringSequence& getColumnTypes() // Vergleichen von PropertyInfo extern "C" int SAL_CALL NameCompare(const void* pFirst, const void* pSecond) { - return ((OUString*)pFirst)->compareTo(*(OUString*)pSecond); + return static_cast<OUString const *>(pFirst)->compareTo(*static_cast<OUString const *>(pSecond)); } namespace @@ -58,8 +58,8 @@ namespace sal_Int32 lcl_findPos(const OUString& aStr, const Sequence< OUString>& rList) { const OUString* pStrList = rList.getConstArray(); - OUString* pResult = (OUString*) bsearch(&aStr, (void*)pStrList, rList.getLength(), sizeof(OUString), - &NameCompare); + OUString* pResult = static_cast<OUString*>(bsearch(&aStr, (void*)pStrList, rList.getLength(), sizeof(OUString), + &NameCompare)); if (pResult) return (pResult - pStrList); diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 60fb2cc05071..84a3bde94af9 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -3445,7 +3445,7 @@ void DbGridControl::BeginCursorAction() { if (m_pFieldListeners) { - ColumnFieldValueListeners* pListeners = (ColumnFieldValueListeners*)m_pFieldListeners; + ColumnFieldValueListeners* pListeners = static_cast<ColumnFieldValueListeners*>(m_pFieldListeners); ColumnFieldValueListeners::const_iterator aIter = pListeners->begin(); while (aIter != pListeners->end()) { @@ -3464,7 +3464,7 @@ void DbGridControl::EndCursorAction() { if (m_pFieldListeners) { - ColumnFieldValueListeners* pListeners = (ColumnFieldValueListeners*)m_pFieldListeners; + ColumnFieldValueListeners* pListeners = static_cast<ColumnFieldValueListeners*>(m_pFieldListeners); ColumnFieldValueListeners::const_iterator aIter = pListeners->begin(); while (aIter != pListeners->end()) { @@ -3481,7 +3481,7 @@ void DbGridControl::EndCursorAction() void DbGridControl::ConnectToFields() { - ColumnFieldValueListeners* pListeners = (ColumnFieldValueListeners*)m_pFieldListeners; + ColumnFieldValueListeners* pListeners = static_cast<ColumnFieldValueListeners*>(m_pFieldListeners); DBG_ASSERT(!pListeners || pListeners->empty(), "DbGridControl::ConnectToFields : please call DisconnectFromFields first !"); if (!pListeners) @@ -3513,7 +3513,7 @@ void DbGridControl::DisconnectFromFields() if (!m_pFieldListeners) return; - ColumnFieldValueListeners* pListeners = (ColumnFieldValueListeners*)m_pFieldListeners; + ColumnFieldValueListeners* pListeners = static_cast<ColumnFieldValueListeners*>(m_pFieldListeners); while (!pListeners->empty()) { #ifdef DBG_UTIL @@ -3558,7 +3558,7 @@ void DbGridControl::FieldValueChanged(sal_uInt16 _nId, const PropertyChangeEvent void DbGridControl::FieldListenerDisposing(sal_uInt16 _nId) { - ColumnFieldValueListeners* pListeners = (ColumnFieldValueListeners*)m_pFieldListeners; + ColumnFieldValueListeners* pListeners = static_cast<ColumnFieldValueListeners*>(m_pFieldListeners); if (!pListeners) { OSL_FAIL("DbGridControl::FieldListenerDisposing : invalid call (have no listener array) !"); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 5d4d7a6ffebd..03132a72c56b 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1024,7 +1024,7 @@ const int nxDBmp = 12; void FmFilterItemsString::Paint( const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) { - FmFilterItems* pRow = (FmFilterItems*)pEntry->GetUserData(); + FmFilterItems* pRow = static_cast<FmFilterItems*>(pEntry->GetUserData()); FmFormItem* pForm = static_cast<FmFormItem*>(pRow->GetParent()); // current filter is significant painted @@ -1188,7 +1188,7 @@ bool FmFilterNavigator::EditingEntry( SvTreeListEntry* pEntry, Selection& rSelec if (!SvTreeListBox::EditingEntry( pEntry, rSelection )) return false; - return pEntry && ((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem); + return pEntry && static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItem); } @@ -1200,7 +1200,7 @@ bool FmFilterNavigator::EditedEntry( SvTreeListEntry* pEntry, const OUString& rN if (EditingCanceled()) return true; - DBG_ASSERT(((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem), + DBG_ASSERT(static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItem), "FmFilterNavigator::EditedEntry() wrong entry"); OUString aText(comphelper::string::strip(rNewText, ' ')); @@ -1213,7 +1213,7 @@ bool FmFilterNavigator::EditedEntry( SvTreeListEntry* pEntry, const OUString& rN { OUString aErrorMsg; - if (m_pModel->ValidateText((FmFilterItem*)pEntry->GetUserData(), aText, aErrorMsg)) + if (m_pModel->ValidateText(static_cast<FmFilterItem*>(pEntry->GetUserData()), aText, aErrorMsg)) { GrabFocus(); // this will set the text at the FmFilterItem, as well as update any filter controls @@ -1241,7 +1241,7 @@ bool FmFilterNavigator::EditedEntry( SvTreeListEntry* pEntry, const OUString& rN IMPL_LINK( FmFilterNavigator, OnRemove, SvTreeListEntry*, pEntry ) { // now remove the entry - m_pModel->Remove((FmFilterData*) pEntry->GetUserData()); + m_pModel->Remove(static_cast<FmFilterData*>(pEntry->GetUserData())); return 0L; } @@ -1341,7 +1341,7 @@ sal_Int8 FmFilterNavigator::AcceptDrop( const AcceptDropEvent& rEvt ) if (!pDropTarget) return DND_ACTION_NONE; - FmFilterData* pData = (FmFilterData*)pDropTarget->GetUserData(); + FmFilterData* pData = static_cast<FmFilterData*>(pDropTarget->GetUserData()); FmFormItem* pForm = NULL; if (pData->ISA(FmFilterItem)) { @@ -1409,9 +1409,9 @@ void FmFilterNavigator::InitEntry(SvTreeListEntry* pEntry, SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); SvLBoxString* pString = NULL; - if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem)) - pString = new FmFilterString(pEntry, 0, rStr, ((FmFilterItem*)pEntry->GetUserData())->GetFieldName()); - else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItems)) + if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItem)) + pString = new FmFilterString(pEntry, 0, rStr, static_cast<FmFilterItem*>(pEntry->GetUserData())->GetFieldName()); + else if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItems)) pString = new FmFilterItemsString(pEntry, 0, rStr ); if (pString) @@ -1429,12 +1429,12 @@ bool FmFilterNavigator::Select( SvTreeListEntry* pEntry, bool bSelect ) if (bSelect) { FmFormItem* pFormItem = NULL; - if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem)) + if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItem)) pFormItem = static_cast<FmFormItem*>(static_cast<FmFilterItem*>(pEntry->GetUserData())->GetParent()->GetParent()); - else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItems)) + else if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItems)) pFormItem = static_cast<FmFormItem*>(static_cast<FmFilterItem*>(pEntry->GetUserData())->GetParent()->GetParent()); - else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFormItem)) - pFormItem = (FmFormItem*)pEntry->GetUserData(); + else if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFormItem)) + pFormItem = static_cast<FmFormItem*>(pEntry->GetUserData()); if (pFormItem) { @@ -1442,7 +1442,7 @@ bool FmFilterNavigator::Select( SvTreeListEntry* pEntry, bool bSelect ) if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItem)) m_pModel->SetCurrentItems(static_cast<FmFilterItems*>(static_cast<FmFilterItem*>(pEntry->GetUserData())->GetParent())); else if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFilterItems)) - m_pModel->SetCurrentItems((FmFilterItems*)pEntry->GetUserData()); + m_pModel->SetCurrentItems(static_cast<FmFilterItems*>(pEntry->GetUserData())); else if (static_cast<FmFilterData*>(pEntry->GetUserData())->ISA(FmFormItem)) m_pModel->SetCurrentController(static_cast<FmFormItem*>(pEntry->GetUserData())->GetController()); } @@ -1489,7 +1489,7 @@ SvTreeListEntry* FmFilterNavigator::FindEntry(const FmFilterData* pItem) const { for (pEntry = First(); pEntry != NULL; pEntry = Next( pEntry )) { - FmFilterData* pEntryItem = (FmFilterData*)pEntry->GetUserData(); + FmFilterData* pEntryItem = static_cast<FmFilterData*>(pEntry->GetUserData()); if (pEntryItem == pItem) break; } @@ -1534,7 +1534,7 @@ FmFormItem* FmFilterNavigator::getSelectedFilterItems(::std::vector<FmFilterItem bHandled && pEntry != NULL; pEntry = NextSelected(pEntry)) { - FmFilterItem* pFilter = PTR_CAST(FmFilterItem, (FmFilterData*)pEntry->GetUserData()); + FmFilterItem* pFilter = PTR_CAST(FmFilterItem, static_cast<FmFilterData*>(pEntry->GetUserData())); if (pFilter) { FmFormItem* pForm = PTR_CAST(FmFormItem,pFilter->GetParent()->GetParent()); @@ -1643,9 +1643,9 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt ) pEntry = NextSelected(pEntry)) { // don't delete forms - FmFormItem* pForm = PTR_CAST(FmFormItem, (FmFilterData*)pEntry->GetUserData()); + FmFormItem* pForm = PTR_CAST(FmFormItem, static_cast<FmFilterData*>(pEntry->GetUserData())); if (!pForm) - aSelectList.push_back((FmFilterData*)pEntry->GetUserData()); + aSelectList.push_back(static_cast<FmFilterData*>(pEntry->GetUserData())); } if (aSelectList.size() == 1) { @@ -1662,7 +1662,7 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt ) aContextMenu.EnableItem( SID_FM_DELETE, !aSelectList.empty() ); - bool bEdit = PTR_CAST(FmFilterItem, (FmFilterData*)pClicked->GetUserData()) != NULL && + bool bEdit = PTR_CAST(FmFilterItem, static_cast<FmFilterData*>(pClicked->GetUserData())) != NULL && IsSelected(pClicked) && GetSelectionCount() == 1; aContextMenu.EnableItem( SID_FM_FILTER_EDIT, @@ -1690,9 +1690,9 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt ) else aText = "IS NOT NULL"; - m_pModel->ValidateText((FmFilterItem*)pClicked->GetUserData(), + m_pModel->ValidateText(static_cast<FmFilterItem*>(pClicked->GetUserData()), aText, aErrorMsg); - m_pModel->SetTextForItem((FmFilterItem*)pClicked->GetUserData(), aText); + m_pModel->SetTextForItem(static_cast<FmFilterItem*>(pClicked->GetUserData()), aText); } break; case SID_FM_DELETE: { @@ -1825,11 +1825,11 @@ void FmFilterNavigator::DeleteSelection() pEntry != NULL; pEntry = NextSelected(pEntry)) { - FmFilterItem* pFilterItem = PTR_CAST(FmFilterItem, (FmFilterData*)pEntry->GetUserData()); + FmFilterItem* pFilterItem = PTR_CAST(FmFilterItem, static_cast<FmFilterData*>(pEntry->GetUserData())); if (pFilterItem && IsSelected(GetParent(pEntry))) continue; - FmFormItem* pForm = PTR_CAST(FmFormItem, (FmFilterData*)pEntry->GetUserData()); + FmFormItem* pForm = PTR_CAST(FmFormItem, static_cast<FmFilterData*>(pEntry->GetUserData())); if (!pForm) aEntryList.push_back(pEntry); } @@ -1841,7 +1841,7 @@ void FmFilterNavigator::DeleteSelection() // link problems with operator == i.base() != aEntryList.rend().base(); ++i) { - m_pModel->Remove((FmFilterData*)(*i)->GetUserData()); + m_pModel->Remove(static_cast<FmFilterData*>((*i)->GetUserData())); } } diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 7ba0bf774c0a..46a444d35bff 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -408,7 +408,7 @@ namespace svxform { aContextMenu.SetPopupMenu( SID_FM_CHANGECONTROLTYPE, FmXFormShell::GetConversionMenu() ); #if OSL_DEBUG_LEVEL > 0 - FmControlData* pCurrent = (FmControlData*)(*m_arrCurrentSelection.begin())->GetUserData(); + FmControlData* pCurrent = static_cast<FmControlData*>((*m_arrCurrentSelection.begin())->GetUserData()); OSL_ENSURE( pFormShell->GetImpl()->isSolelySelected( pCurrent->GetFormComponent() ), "NavigatorTree::Command: inconsistency between the navigator selection, and the selection as the shell knows it!" ); #endif @@ -477,7 +477,7 @@ namespace svxform SvTreeListEntry* pSelectedForm = *m_arrCurrentSelection.begin(); DBG_ASSERT( IsFormEntry(pSelectedForm), "NavigatorTree::Command: This entry must be a FormEntry." ); - FmFormData* pFormData = (FmFormData*)pSelectedForm->GetUserData(); + FmFormData* pFormData = static_cast<FmFormData*>(pSelectedForm->GetUserData()); Reference< XForm > xForm( pFormData->GetFormIface()); Reference< XTabControllerModel > xTabController(xForm, UNO_QUERY); @@ -513,7 +513,7 @@ namespace svxform default: if (FmXFormShell::isControlConversionSlot(nSlotId)) { - FmControlData* pCurrent = (FmControlData*)(*m_arrCurrentSelection.begin())->GetUserData(); + FmControlData* pCurrent = static_cast<FmControlData*>((*m_arrCurrentSelection.begin())->GetUserData()); if ( pFormShell->GetImpl()->executeControlConversionSlot( pCurrent->GetFormComponent(), nSlotId ) ) ShowSelectionProperties(); } @@ -534,7 +534,7 @@ namespace svxform SvTreeListEntry* pCurEntry = First(); while( pCurEntry ) { - FmEntryData* pCurEntryData = (FmEntryData*)pCurEntry->GetUserData(); + FmEntryData* pCurEntryData = static_cast<FmEntryData*>(pCurEntry->GetUserData()); if( pCurEntryData && pCurEntryData->IsEqualWithoutChildren(pEntryData) ) return pCurEntry; @@ -680,14 +680,14 @@ namespace svxform bool NavigatorTree::IsFormEntry( SvTreeListEntry* pEntry ) { - FmEntryData* pEntryData = (FmEntryData*)pEntry->GetUserData(); + FmEntryData* pEntryData = static_cast<FmEntryData*>(pEntry->GetUserData()); return !pEntryData || pEntryData->ISA(FmFormData); } bool NavigatorTree::IsFormComponentEntry( SvTreeListEntry* pEntry ) { - FmEntryData* pEntryData = (FmEntryData*)pEntry->GetUserData(); + FmEntryData* pEntryData = static_cast<FmEntryData*>(pEntry->GetUserData()); return pEntryData && pEntryData->ISA(FmControlData); } @@ -1016,7 +1016,7 @@ namespace svxform // some data for the target bool bDropTargetIsForm = IsFormEntry(_pTargetEntry); - FmFormData* pTargetData = bDropTargetIsForm ? (FmFormData*)_pTargetEntry->GetUserData() : NULL; + FmFormData* pTargetData = bDropTargetIsForm ? static_cast<FmFormData*>(_pTargetEntry->GetUserData()) : NULL; DBG_ASSERT( DND_ACTION_COPY != _nAction, "NavigatorTree::implExecuteDataTransfer: somebody changed the logics!" ); @@ -1055,7 +1055,7 @@ namespace svxform DBG_ASSERT(GetParent(pCurrent) != NULL, "NavigatorTree::implExecuteDataTransfer: invalid entry"); // don't drag root - FmEntryData* pCurrentUserData = (FmEntryData*)pCurrent->GetUserData(); + FmEntryData* pCurrentUserData = static_cast<FmEntryData*>(pCurrent->GetUserData()); Reference< XChild > xCurrentChild(pCurrentUserData->GetChildIFace(), UNO_QUERY); Reference< XIndexContainer > xContainer(xCurrentChild->getParent(), UNO_QUERY); @@ -1320,7 +1320,7 @@ namespace svxform if( !IsFormEntry(pParentEntry) ) return; - FmFormData* pParentFormData = (FmFormData*)pParentEntry->GetUserData(); + FmFormData* pParentFormData = static_cast<FmFormData*>(pParentEntry->GetUserData()); // create new form @@ -1384,7 +1384,7 @@ namespace svxform if (!IsFormEntry(pParentEntry)) return NULL; - FmFormData* pParentFormData = (FmFormData*)pParentEntry->GetUserData();; + FmFormData* pParentFormData = static_cast<FmFormData*>(pParentEntry->GetUserData()); Reference< XForm > xParentForm( pParentFormData->GetFormIface()); @@ -1464,7 +1464,7 @@ namespace svxform return true; GrabFocus(); - FmEntryData* pEntryData = (FmEntryData*)pEntry->GetUserData(); + FmEntryData* pEntryData = static_cast<FmEntryData*>(pEntry->GetUserData()); bool bRes = GetNavModel()->Rename( pEntryData, rNewText); if( !bRes ) { @@ -1607,12 +1607,12 @@ namespace svxform { if (m_nFormsSelected > 0) { // exactly one form is selected - FmFormData* pFormData = (FmFormData*)(*m_arrCurrentSelection.begin())->GetUserData(); + FmFormData* pFormData = static_cast<FmFormData*>((*m_arrCurrentSelection.begin())->GetUserData()); aSelection.insert( Reference< XInterface >( pFormData->GetFormIface(), UNO_QUERY ) ); } else { // exactly one control is selected (whatever hidden or normal) - FmEntryData* pEntryData = (FmEntryData*)(*m_arrCurrentSelection.begin())->GetUserData(); + FmEntryData* pEntryData = static_cast<FmEntryData*>((*m_arrCurrentSelection.begin())->GetUserData()); aSelection.insert( Reference< XInterface >( pEntryData->GetElement(), UNO_QUERY ) ); } @@ -1625,7 +1625,7 @@ namespace svxform SvLBoxEntrySortedArray::const_iterator it = m_arrCurrentSelection.begin(); for ( sal_Int32 i = 0; i < m_nFormsSelected; ++i ) { - FmFormData* pFormData = (FmFormData*)(*it)->GetUserData(); + FmFormData* pFormData = static_cast<FmFormData*>((*it)->GetUserData()); aSelection.insert( pFormData->GetPropertySet().get() ); ++it; } @@ -1637,7 +1637,7 @@ namespace svxform SvLBoxEntrySortedArray::const_iterator it = m_arrCurrentSelection.begin(); for ( sal_Int32 i = 0; i < m_nHiddenControls; ++i ) { - FmEntryData* pEntryData = (FmEntryData*)(*it)->GetUserData(); + FmEntryData* pEntryData = static_cast<FmEntryData*>((*it)->GetUserData()); aSelection.insert( pEntryData->GetPropertySet().get() ); ++it; } @@ -1784,7 +1784,7 @@ namespace svxform for (SvLBoxEntrySortedArray::const_iterator it = m_arrCurrentSelection.begin(); it != m_arrCurrentSelection.end(); ++it) { - FmEntryData* pCurrent = (FmEntryData*)((*it)->GetUserData()); + FmEntryData* pCurrent = static_cast<FmEntryData*>((*it)->GetUserData()); // if the entry still has children, we skipped deletion of one of those children. // This may for instance be because the shape is in a hidden layer, where we're unable @@ -1829,7 +1829,7 @@ namespace svxform else { ++m_nControlsSelected; - if (IsHiddenControl((FmEntryData*)(pSelectionLoop->GetUserData()))) + if (IsHiddenControl(static_cast<FmEntryData*>(pSelectionLoop->GetUserData()))) ++m_nHiddenControls; } } @@ -1894,7 +1894,7 @@ namespace svxform SvTreeListEntry* pSelection = FirstSelected(); while (pSelection) { - FmEntryData* pCurrent = (FmEntryData*)pSelection->GetUserData(); + FmEntryData* pCurrent = static_cast<FmEntryData*>(pSelection->GetUserData()); if (pCurrent != NULL) { FmEntryDataArray::iterator it = arredToSelect.find(pCurrent); @@ -1927,7 +1927,7 @@ namespace svxform SvTreeListEntry* pLoop = First(); while( pLoop ) { - FmEntryData* pCurEntryData = (FmEntryData*)pLoop->GetUserData(); + FmEntryData* pCurEntryData = static_cast<FmEntryData*>(pLoop->GetUserData()); FmEntryDataArray::iterator it = arredToSelect.find(pCurEntryData); if ( it != arredToSelect.end() ) { @@ -1975,12 +1975,12 @@ namespace svxform SvTreeListEntry* pSelectionLoop = *it; // When form selection, mark all controls of form if (IsFormEntry(pSelectionLoop) && (pSelectionLoop != m_pRootEntry)) - MarkViewObj((FmFormData*)pSelectionLoop->GetUserData(), true, false); + MarkViewObj(static_cast<FmFormData*>(pSelectionLoop->GetUserData()), true, false); // When control selection, mark Control-SdrObjects else if (IsFormComponentEntry(pSelectionLoop)) { - FmControlData* pControlData = (FmControlData*)pSelectionLoop->GetUserData(); + FmControlData* pControlData = static_cast<FmControlData*>(pSelectionLoop->GetUserData()); if (pControlData) { diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index d543feadae17..3af285edaefe 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -56,10 +56,10 @@ SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( const uno::Sequence< bea } if ( rPropVal.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) ) { - uno::Sequence< beans::PropertyValue >& rPropSeq = *( uno::Sequence< beans::PropertyValue >*)rPropVal.Value.getValue(); + uno::Sequence< beans::PropertyValue > const & rPropSeq = *static_cast<uno::Sequence< beans::PropertyValue > const *>(rPropVal.Value.getValue()); for ( j = 0; j < rPropSeq.getLength(); j++ ) { - beans::PropertyValue& rPropVal2 = rPropSeq[ j ]; + beans::PropertyValue const & rPropVal2 = rPropSeq[ j ]; aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = j; } } @@ -95,9 +95,9 @@ com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( co PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) ); if ( aHashIter != aPropPairHashMap.end() ) { - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue()); - pRet = &rSecSequence[ (*aHashIter).second ].Value; + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pSeqAny->getValue()); + pRet = const_cast<css::uno::Any *>(&rSecSequence[ (*aHashIter).second ].Value); } } } @@ -115,8 +115,8 @@ const com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByNa PropertyPairHashMap::const_iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) ); if ( aHashIter != aPropPairHashMap.end() ) { - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue()); + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pSeqAny->getValue()); pRet = &rSecSequence[ (*aHashIter).second ].Value; } } @@ -132,8 +132,8 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const com::sun::star::beans:: sal_Int32 i; if ( pAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) ) { // old property is a sequence->each entry has to be removed from the HashPairMap - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pAny->getValue()); + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pAny->getValue()); for ( i = 0; i < rSecSequence.getLength(); i++ ) { PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rPropVal.Name, rSecSequence[ i ].Name ) ) ); @@ -144,11 +144,11 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const com::sun::star::beans:: *pAny = rPropVal.Value; if ( rPropVal.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) ) { // the new property is a sequence->each entry has to be inserted into the HashPairMap - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pAny->getValue()); + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pAny->getValue()); for ( i = 0; i < rSecSequence.getLength(); i++ ) { - beans::PropertyValue& rPropVal2 = rSecSequence[ i ]; + beans::PropertyValue const & rPropVal2 = rSecSequence[ i ]; aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = i; } } @@ -201,18 +201,18 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const OUString& rSequenceName PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropVal.Name ) ) ); if ( aHashIter != aPropPairHashMap.end() ) { - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue()); - rSecSequence[ (*aHashIter).second ].Value = rPropVal.Value; + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pSeqAny->getValue()); + const_cast<css::uno::Sequence<css::beans::PropertyValue> &>(rSecSequence)[ (*aHashIter).second ].Value = rPropVal.Value; } else { - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue()); + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pSeqAny->getValue()); sal_Int32 nCount = rSecSequence.getLength(); - rSecSequence.realloc( nCount + 1 ); - rSecSequence[ nCount ] = rPropVal; + const_cast<css::uno::Sequence<css::beans::PropertyValue> &>(rSecSequence).realloc( nCount + 1 ); + const_cast<css::uno::Sequence<css::beans::PropertyValue> &>(rSecSequence)[ nCount ] = rPropVal; aPropPairHashMap[ PropertyPair( rSequenceName, rPropVal.Name ) ] = nCount; } @@ -233,8 +233,8 @@ void SdrCustomShapeGeometryItem::ClearPropertyValue( const OUString& rPropName ) { if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) ) { - ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = - *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue()); + ::com::sun::star::uno::Sequence < beans::PropertyValue > const & rSecSequence = + *static_cast<css::uno::Sequence < beans::PropertyValue > const *>(pSeqAny->getValue()); sal_Int32 i; for ( i = 0; i < rSecSequence.getLength(); i++ ) diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx index c044c322e88b..e6d72d0c0814 100644 --- a/svx/source/sdr/properties/itemsettools.cxx +++ b/svx/source/sdr/properties/itemsettools.cxx @@ -40,7 +40,7 @@ namespace sdr SdrObjListIter aIter(static_cast<const SdrObjGroup&>(rObj), IM_DEEPNOGROUPS); mpData = new RectangleVector; DBG_ASSERT(mpData, "ItemChangeBroadcaster: No memory (!)"); - ((RectangleVector*)mpData)->reserve(aIter.Count()); + static_cast<RectangleVector*>(mpData)->reserve(aIter.Count()); while(aIter.IsMore()) { @@ -48,11 +48,11 @@ namespace sdr if(pObj) { - ((RectangleVector*)mpData)->push_back(pObj->GetLastBoundRect()); + static_cast<RectangleVector*>(mpData)->push_back(pObj->GetLastBoundRect()); } } - mnCount = ((RectangleVector*)mpData)->size(); + mnCount = static_cast<RectangleVector*>(mpData)->size(); } else { @@ -65,11 +65,11 @@ namespace sdr { if(mnCount > 1) { - delete ((RectangleVector*)mpData); + delete static_cast<RectangleVector*>(mpData); } else { - delete ((Rectangle*)mpData); + delete static_cast<Rectangle*>(mpData); } } @@ -78,11 +78,11 @@ namespace sdr { if(mnCount > 1) { - return (*((RectangleVector*)mpData))[nIndex]; + return (*static_cast<RectangleVector*>(mpData))[nIndex]; } else { - return *((Rectangle*)mpData); + return *static_cast<Rectangle*>(mpData); } } } // end of namespace properties diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index abd7259e721a..af3d31ea38e2 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -88,11 +88,11 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, co static void ImpGetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnThisEsc, const void* pnRet, const void*, const void*) { - sal_uInt16& nRet=*(sal_uInt16*)pnRet; + sal_uInt16& nRet=*const_cast<sal_uInt16 *>(static_cast<sal_uInt16 const *>(pnRet)); if (nRet!=FUZZY) { sal_uInt16 nEsc = rGP.GetEscDir(); - bool bOn = (nEsc & *(sal_uInt16*)pnThisEsc) != 0; - bool& bFirst=*(bool*)pbFirst; + bool bOn = (nEsc & *static_cast<sal_uInt16 const *>(pnThisEsc)) != 0; + bool& bFirst=*const_cast<bool *>(static_cast<bool const *>(pbFirst)); if (bFirst) { nRet = bOn ? 1 : 0; bFirst = false; @@ -113,8 +113,8 @@ SDR_TRISTATE SdrGlueEditView::IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) cons static void ImpSetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pnThisEsc, const void* pbOn, const void*, const void*, const void*) { sal_uInt16 nEsc=rGP.GetEscDir(); - if (*(bool*)pbOn) nEsc|=*(sal_uInt16*)pnThisEsc; - else nEsc&=~*(sal_uInt16*)pnThisEsc; + if (*static_cast<bool const *>(pbOn)) nEsc|=*static_cast<sal_uInt16 const *>(pnThisEsc); + else nEsc&=~*static_cast<sal_uInt16 const *>(pnThisEsc); rGP.SetEscDir(nEsc); } @@ -130,10 +130,10 @@ void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, bool bOn) static void ImpGetPercent(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnRet, const void*, const void*, const void*) { - sal_uInt16& nRet=*(sal_uInt16*)pnRet; + sal_uInt16& nRet=*const_cast<sal_uInt16 *>(static_cast<sal_uInt16 const *>(pnRet)); if (nRet!=FUZZY) { bool bOn=rGP.IsPercent(); - bool& bFirst=*(bool*)pbFirst; + bool& bFirst=*const_cast<bool *>(static_cast<bool const *>(pbFirst)); if (bFirst) { nRet=sal_uInt16(bOn); bFirst=false; } else if ((nRet!=0)!=bOn) nRet=FUZZY; } @@ -151,7 +151,7 @@ SDR_TRISTATE SdrGlueEditView::IsMarkedGluePointsPercent() const static void ImpSetPercent(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbOn, const void*, const void*, const void*, const void*) { Point aPos(rGP.GetAbsolutePos(*pObj)); - rGP.SetPercent(*(bool*)pbOn); + rGP.SetPercent(*static_cast<bool const *>(pbOn)); rGP.SetAbsolutePos(aPos,*pObj); } @@ -167,9 +167,9 @@ void SdrGlueEditView::SetMarkedGluePointsPercent(bool bOn) static void ImpGetAlign(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pbDontCare, const void* pbVert, const void* pnRet, const void*) { - sal_uInt16& nRet=*(sal_uInt16*)pnRet; - bool& bDontCare=*(bool*)pbDontCare; - bool bVert=*(bool*)pbVert; + sal_uInt16& nRet=*const_cast<sal_uInt16 *>(static_cast<sal_uInt16 const *>(pnRet)); + bool& bDontCare=*const_cast<bool *>(static_cast<bool const *>(pbDontCare)); + bool bVert=*static_cast<bool const *>(pbVert); if (!bDontCare) { sal_uInt16 nAlg=0; if (bVert) { @@ -177,7 +177,7 @@ static void ImpGetAlign(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void } else { nAlg=rGP.GetHorzAlign(); } - bool& bFirst=*(bool*)pbFirst; + bool& bFirst=*const_cast<bool *>(static_cast<bool const *>(pbFirst)); if (bFirst) { nRet=nAlg; bFirst=false; } else if (nRet!=nAlg) { if (bVert) { @@ -203,10 +203,10 @@ sal_uInt16 SdrGlueEditView::GetMarkedGluePointsAlign(bool bVert) const static void ImpSetAlign(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbVert, const void* pnAlign, const void*, const void*, const void*) { Point aPos(rGP.GetAbsolutePos(*pObj)); - if (*(bool*)pbVert) { // bVert? - rGP.SetVertAlign(*(sal_uInt16*)pnAlign); + if (*static_cast<bool const *>(pbVert)) { // bVert? + rGP.SetVertAlign(*static_cast<sal_uInt16 const *>(pnAlign)); } else { - rGP.SetHorzAlign(*(sal_uInt16*)pnAlign); + rGP.SetHorzAlign(*static_cast<sal_uInt16 const *>(pnAlign)); } rGP.SetAbsolutePos(aPos,*pObj); } @@ -353,8 +353,8 @@ void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const vo static void ImpMove(Point& rPt, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/) { - rPt.X()+=((const Size*)p1)->Width(); - rPt.Y()+=((const Size*)p1)->Height(); + rPt.X()+=static_cast<const Size*>(p1)->Width(); + rPt.Y()+=static_cast<const Size*>(p1)->Height(); } void SdrGlueEditView::MoveMarkedGluePoints(const Size& rSiz, bool bCopy) @@ -373,7 +373,7 @@ void SdrGlueEditView::MoveMarkedGluePoints(const Size& rSiz, bool bCopy) static void ImpResize(Point& rPt, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/) { - ResizePoint(rPt,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3); + ResizePoint(rPt,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3)); } void SdrGlueEditView::ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy) @@ -392,7 +392,7 @@ void SdrGlueEditView::ResizeMarkedGluePoints(const Point& rRef, const Fraction& static void ImpRotate(Point& rPt, const void* p1, const void* /*p2*/, const void* p3, const void* p4, const void* /*p5*/) { - RotatePoint(rPt,*(const Point*)p1,*(const double*)p3,*(const double*)p4); + RotatePoint(rPt,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4)); } void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, long nAngle, bool bCopy) diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 6f7a078cb9f7..eb26d567af7f 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1803,8 +1803,8 @@ struct ImplHdlAndIndex // single objects and re-sorting polygon handles intuitively extern "C" int SAL_CALL ImplSortHdlFunc( const void* pVoid1, const void* pVoid2 ) { - const ImplHdlAndIndex* p1 = (ImplHdlAndIndex*)pVoid1; - const ImplHdlAndIndex* p2 = (ImplHdlAndIndex*)pVoid2; + const ImplHdlAndIndex* p1 = static_cast<ImplHdlAndIndex const *>(pVoid1); + const ImplHdlAndIndex* p2 = static_cast<ImplHdlAndIndex const *>(pVoid2); if(p1->mpHdl->GetObj() == p2->mpHdl->GetObj()) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 51c713d2aeb3..14eac04bd5fd 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1803,7 +1803,7 @@ OString SdrObject::stringify() const SfxItemSet aSet(GetMergedItemSet()); aSet.InvalidateDefaultItems(); aSet.Store(aStream, true); - aString.append((const char *)aStream.GetBuffer(), aStream.GetEndOfData()); + aString.append(static_cast<const char *>(aStream.GetBuffer()), aStream.GetEndOfData()); return aString.makeStringAndClear(); } diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index 603274af647d..7a33186a843b 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -655,9 +655,9 @@ void SdrPolyEditView::ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* static void ImpMove(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/) { - MovePoint(rPt,*(const Size*)p1); - if (pC1!=NULL) MovePoint(*pC1,*(const Size*)p1); - if (pC2!=NULL) MovePoint(*pC2,*(const Size*)p1); + MovePoint(rPt,*static_cast<const Size*>(p1)); + if (pC1!=NULL) MovePoint(*pC1,*static_cast<const Size*>(p1)); + if (pC2!=NULL) MovePoint(*pC2,*static_cast<const Size*>(p1)); } void SdrPolyEditView::MoveMarkedPoints(const Size& rSiz) @@ -672,9 +672,9 @@ void SdrPolyEditView::MoveMarkedPoints(const Size& rSiz) static void ImpResize(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/) { - ResizePoint(rPt,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3); - if (pC1!=NULL) ResizePoint(*pC1,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3); - if (pC2!=NULL) ResizePoint(*pC2,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3); + ResizePoint(rPt,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3)); + if (pC1!=NULL) ResizePoint(*pC1,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3)); + if (pC2!=NULL) ResizePoint(*pC2,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3)); } void SdrPolyEditView::ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact) @@ -689,9 +689,9 @@ void SdrPolyEditView::ResizeMarkedPoints(const Point& rRef, const Fraction& xFac static void ImpRotate(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* /*p2*/, const void* p3, const void* p4, const void* /*p5*/) { - RotatePoint(rPt,*(const Point*)p1,*(const double*)p3,*(const double*)p4); - if (pC1!=NULL) RotatePoint(*pC1,*(const Point*)p1,*(const double*)p3,*(const double*)p4); - if (pC2!=NULL) RotatePoint(*pC2,*(const Point*)p1,*(const double*)p3,*(const double*)p4); + RotatePoint(rPt,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4)); + if (pC1!=NULL) RotatePoint(*pC1,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4)); + if (pC2!=NULL) RotatePoint(*pC2,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4)); } void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, long nAngle) diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index fe096cb280a9..356f45d7d58a 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1051,7 +1051,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& if(rValue.getValueType() != cppu::UnoType<TableBorder>::get()) break; - const TableBorder* pBorder = (const TableBorder* )rValue.getValue(); + const TableBorder* pBorder = static_cast<const TableBorder*>(rValue.getValue()); if( pBorder == NULL ) break; diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 7633b6a88b78..c889e98f6fbf 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -681,7 +681,7 @@ IMPL_LINK(FillControl,SelectFillTypeHdl,ListBox *,pBox) aArgsFillStyle[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")); aXFillStyleItem.QueryValue(a); aArgsFillStyle[0].Value = a; - ((SvxFillToolBoxControl*)GetData())->Dispatch(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillStyle")), aArgsFillStyle); + static_cast<SvxFillToolBoxControl*>(GetData())->Dispatch(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillStyle")), aArgsFillStyle); } mpLbFillType->Selected(); @@ -840,14 +840,14 @@ IMPL_LINK(FillControl, SelectFillAttrHdl, ListBox *, pBox) aArgsFillStyle[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillStyle")); aXFillStyleItem.QueryValue(a); aArgsFillStyle[0].Value = a; - ((SvxFillToolBoxControl*)GetData())->Dispatch(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillStyle")), aArgsFillStyle); + static_cast<SvxFillToolBoxControl*>(GetData())->Dispatch(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillStyle")), aArgsFillStyle); mbFillTypeChanged = false; } // second set fill attribute when a change was detected and prepared if(aFillAttrCommand.getLength()) { - ((SvxFillToolBoxControl*)GetData())->Dispatch(aFillAttrCommand, aArgsFillAttr); + static_cast<SvxFillToolBoxControl*>(GetData())->Dispatch(aFillAttrCommand, aArgsFillAttr); } // release focus. Needed to get focus automatically back to EditView diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index e772e09e47df..da04cd6628dc 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -191,7 +191,7 @@ DictionaryEntry* DictionaryList::getEntryOnPos( sal_Int32 nPos ) const DictionaryEntry* pEntry=0; SvTreeListEntry* pLBEntry = GetEntryOnPos( nPos ); if(pLBEntry) - pEntry = (DictionaryEntry*)pLBEntry->GetUserData(); + pEntry = static_cast<DictionaryEntry*>(pLBEntry->GetUserData()); return pEntry; } diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index 7017ece26380..c689c7f5be6f 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -346,7 +346,7 @@ XPropertyEntry* SvxUnoXLineEndTable::getEntry( const OUString& rName, const uno: return NULL; basegfx::B2DPolyPolygon aPolyPolygon; - drawing::PolyPolygonBezierCoords* pCoords = (drawing::PolyPolygonBezierCoords*)rAny.getValue(); + drawing::PolyPolygonBezierCoords const * pCoords = static_cast<drawing::PolyPolygonBezierCoords const *>(rAny.getValue()); if( pCoords->Coordinates.getLength() > 0 ) aPolyPolygon = basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( *pCoords ); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 12f8e55afe1e..27e7ace02276 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1062,7 +1062,7 @@ bool SvxShapePolyPolygon::setPropertyValueImpl( const OUString& rName, const Sfx { if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0) ) ) { - basegfx::B2DPolyPolygon aNewPolyPolygon(ImplSvxPointSequenceSequenceToB2DPolyPolygon( (drawing::PointSequenceSequence*)rValue.getValue())); + basegfx::B2DPolyPolygon aNewPolyPolygon(ImplSvxPointSequenceSequenceToB2DPolyPolygon( static_cast<drawing::PointSequenceSequence const *>(rValue.getValue()))); SetPolygon(aNewPolyPolygon); return true; } @@ -1078,7 +1078,7 @@ bool SvxShapePolyPolygon::setPropertyValueImpl( const OUString& rName, const Sfx basegfx::B2DHomMatrix aNewHomogenMatrix; mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon); - aNewPolyPolygon = ImplSvxPointSequenceSequenceToB2DPolyPolygon((drawing::PointSequenceSequence*)rValue.getValue()); + aNewPolyPolygon = ImplSvxPointSequenceSequenceToB2DPolyPolygon(static_cast<drawing::PointSequenceSequence const *>(rValue.getValue())); mpObj->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon); } return true; @@ -1089,7 +1089,7 @@ bool SvxShapePolyPolygon::setPropertyValueImpl( const OUString& rName, const Sfx { if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0) )) { - drawing::PointSequence* pSequence = (drawing::PointSequence*)rValue.getValue(); + drawing::PointSequence const * pSequence = static_cast<drawing::PointSequence const *>(rValue.getValue()); // prepare new polygon basegfx::B2DPolygon aNewPolygon; @@ -1291,7 +1291,7 @@ bool SvxShapePolyPolygonBezier::setPropertyValueImpl( const OUString& rName, con { basegfx::B2DPolyPolygon aNewPolyPolygon( basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( - *(drawing::PolyPolygonBezierCoords*)rValue.getValue())); + *static_cast<drawing::PolyPolygonBezierCoords const *>(rValue.getValue()))); SetPolygon(aNewPolyPolygon); return true; } @@ -1308,7 +1308,7 @@ bool SvxShapePolyPolygonBezier::setPropertyValueImpl( const OUString& rName, con mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon); aNewPolyPolygon = basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( - *(drawing::PolyPolygonBezierCoords*)rValue.getValue()); + *static_cast<drawing::PolyPolygonBezierCoords const *>(rValue.getValue())); mpObj->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon); } return true; @@ -1424,11 +1424,11 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte { if( rValue.getValueType() == ::getCppuType(( const uno::Sequence< sal_Int8 >*)0) ) { - uno::Sequence<sal_Int8>* pSeq( (uno::Sequence<sal_Int8>*)rValue.getValue() ); + uno::Sequence<sal_Int8> const * pSeq( static_cast<uno::Sequence<sal_Int8> const *>(rValue.getValue()) ); SvMemoryStream aMemStm; Graphic aGraphic; - aMemStm.SetBuffer( pSeq->getArray(), pSeq->getLength(), false, pSeq->getLength() ); + aMemStm.SetBuffer( const_cast<css::uno::Sequence<sal_Int8> *>(pSeq)->getArray(), pSeq->getLength(), false, pSeq->getLength() ); if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE ) { diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 48f236392d0f..5a2fac6321b6 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2292,13 +2292,13 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl { // get polygpon data from PointSequenceSequence aNewPolyPolygon = basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon( - *(const drawing::PointSequenceSequence*)rValue.getValue()); + *static_cast<const drawing::PointSequenceSequence*>(rValue.getValue())); } else if( rValue.getValueType() == cppu::UnoType<drawing::PolyPolygonBezierCoords>::get()) { // get polygpon data from PolyPolygonBezierCoords aNewPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( - *(const drawing::PolyPolygonBezierCoords*)rValue.getValue()); + *static_cast<const drawing::PolyPolygonBezierCoords*>(rValue.getValue())); } if(aNewPolyPolygon.count()) diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index d28867ebc435..bc3ee582fd24 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -353,7 +353,7 @@ sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUStri return nErr; } aOStm.Seek(STREAM_SEEK_TO_END); - css::uno::Sequence<sal_Int8> aOStmSeq( (sal_Int8*) aOStm.GetData(),aOStm.Tell() ); + css::uno::Sequence<sal_Int8> aOStmSeq( static_cast<sal_Int8 const *>(aOStm.GetData()),aOStm.Tell() ); OUStringBuffer aStrBuffer; ::sax::Converter::encodeBase64(aStrBuffer,aOStmSeq); rOUString = aMimeType + ";base64," + aStrBuffer.makeStringAndClear(); diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 042dc736195a..8a9c6450f17c 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -1330,7 +1330,7 @@ bool XLineStartItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 if( rVal.getValueType() != cppu::UnoType<com::sun::star::drawing::PolyPolygonBezierCoords>::get()) return false; - com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue(); + com::sun::star::drawing::PolyPolygonBezierCoords const * pCoords = static_cast<com::sun::star::drawing::PolyPolygonBezierCoords const *>(rVal.getValue()); if( pCoords->Coordinates.getLength() > 0 ) { maPolyPolygon = basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( *pCoords ); @@ -1892,7 +1892,7 @@ bool XLineEndItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 n if( rVal.getValueType() != cppu::UnoType<com::sun::star::drawing::PolyPolygonBezierCoords>::get()) return false; - com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue(); + com::sun::star::drawing::PolyPolygonBezierCoords const * pCoords = static_cast<com::sun::star::drawing::PolyPolygonBezierCoords const *>(rVal.getValue()); if( pCoords->Coordinates.getLength() > 0 ) { maPolyPolygon = basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( *pCoords ); @@ -2052,7 +2052,7 @@ bool XLineStartCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal if( !rVal.hasValue() || rVal.getValueType() != ::getCppuBooleanType() ) return false; - SetValue( *(sal_Bool*)rVal.getValue() ); + SetValue( *static_cast<sal_Bool const *>(rVal.getValue()) ); return true; } @@ -2103,7 +2103,7 @@ bool XLineEndCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u if( !rVal.hasValue() || rVal.getValueType() != ::getCppuBooleanType() ) return false; - SetValue( *(sal_Bool*)rVal.getValue() ); + SetValue( *static_cast<sal_Bool const *>(rVal.getValue()) ); return true; } |