Clean up C-style casts from pointers to void
Change-Id: If8783896136470a0664f1cbac061e30576ef96a4
This commit is contained in:
@@ -25,7 +25,7 @@ OString extractFromStream(SvMemoryStream& rStream)
|
||||
rStream.WriteChar('\0');
|
||||
rStream.Flush();
|
||||
rStream.Seek(STREAM_SEEK_TO_BEGIN);
|
||||
return OString((const sal_Char*)rStream.GetBuffer());
|
||||
return OString(static_cast<const sal_Char*>(rStream.GetBuffer()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -66,11 +66,11 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
|
||||
{
|
||||
case 0: *pValues >>= nScaleFactor; break; //"FontScaling",
|
||||
case 1: *pValues >>= nDragMode; break; //"Window/Drag",
|
||||
case 2: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
|
||||
case 2: bMenuMouseFollow = *static_cast<sal_Bool const *>(pValues->getValue()); break; //"Menu/FollowMouse",
|
||||
case 3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
|
||||
case 4: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
|
||||
#if defined( UNX )
|
||||
case 5: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
|
||||
case 5: bFontAntialiasing = *static_cast<sal_Bool const *>(pValues->getValue()); break; // "FontAntialising/Enabled",
|
||||
case 6: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
|
||||
#endif
|
||||
}
|
||||
|
@@ -350,7 +350,7 @@ IMPL_LINK( ColorConfig_Impl, DataChangedEventListener, VclWindowEvent*, pEvent )
|
||||
{
|
||||
if ( pEvent->GetId() == VCLEVENT_APPLICATION_DATACHANGED )
|
||||
{
|
||||
DataChangedEvent* pData = (DataChangedEvent*)(pEvent->GetData());
|
||||
DataChangedEvent* pData = static_cast<DataChangedEvent*>(pEvent->GetData());
|
||||
if ( (pData->GetType() == DataChangedEventType::SETTINGS) &&
|
||||
(pData->GetFlags() & AllSettingsFlags::STYLE) )
|
||||
{
|
||||
|
@@ -546,7 +546,7 @@ IMPL_LINK( ExtendedColorConfig_Impl, DataChangedEventListener, VclWindowEvent*,
|
||||
{
|
||||
if ( pEvent->GetId() == VCLEVENT_APPLICATION_DATACHANGED )
|
||||
{
|
||||
DataChangedEvent* pData = (DataChangedEvent*)(pEvent->GetData());
|
||||
DataChangedEvent* pData = static_cast<DataChangedEvent*>(pEvent->GetData());
|
||||
if ( (pData->GetType() == DataChangedEventType::SETTINGS) &&
|
||||
(pData->GetFlags() & AllSettingsFlags::STYLE) )
|
||||
{
|
||||
|
@@ -57,7 +57,7 @@ SvtFontSubstConfig::SvtFontSubstConfig() :
|
||||
Sequence<Any> aValues = GetProperties(aNames);
|
||||
DBG_ASSERT(aValues.getConstArray()[0].hasValue(), "no value available");
|
||||
if(aValues.getConstArray()[0].hasValue())
|
||||
bIsEnabled = *(sal_Bool*)aValues.getConstArray()[0].getValue();
|
||||
bIsEnabled = *static_cast<sal_Bool const *>(aValues.getConstArray()[0].getValue());
|
||||
|
||||
OUString sPropPrefix(cFontPairs);
|
||||
Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, CONFIG_NAME_LOCAL_PATH);
|
||||
@@ -83,8 +83,8 @@ SvtFontSubstConfig::SvtFontSubstConfig() :
|
||||
SubstitutionStruct* pInsert = new SubstitutionStruct;
|
||||
pNodeValues[nName++] >>= pInsert->sFont;
|
||||
pNodeValues[nName++] >>= pInsert->sReplaceBy;
|
||||
pInsert->bReplaceAlways = *(sal_Bool*)pNodeValues[nName++].getValue();
|
||||
pInsert->bReplaceOnScreenOnly = *(sal_Bool*)pNodeValues[nName++].getValue();
|
||||
pInsert->bReplaceAlways = *static_cast<sal_Bool const *>(pNodeValues[nName++].getValue());
|
||||
pInsert->bReplaceOnScreenOnly = *static_cast<sal_Bool const *>(pNodeValues[nName++].getValue());
|
||||
pImpl->aSubstArr.push_back(pInsert);
|
||||
}
|
||||
}
|
||||
|
@@ -129,11 +129,11 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
|
||||
switch(nProp)
|
||||
{
|
||||
case 0:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_UNKNOWN_TAGS;
|
||||
break;//"Import/UnknownTag",
|
||||
case 1:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY;
|
||||
break;//"Import/FontSetting",
|
||||
case 2: pValues[nProp] >>= pImp->aFontSizeArr[0]; break;//"Import/FontSize/Size_1",
|
||||
@@ -159,19 +159,19 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_STAR_BASIC;
|
||||
break;//"Export/Basic",
|
||||
case 11:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_PRINT_LAYOUT_EXTENSION;
|
||||
break;//"Export/PrintLayout",
|
||||
case 12:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_LOCAL_GRF;
|
||||
break;//"Export/LocalGraphic",
|
||||
case 13:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_IS_BASIC_WARNING;
|
||||
break;//"Export/Warning"
|
||||
|
||||
@@ -180,7 +180,7 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
|
||||
break;//"Export/Encoding"
|
||||
|
||||
case 15:
|
||||
if(*(sal_Bool*)pValues[nProp].getValue())
|
||||
if(*static_cast<sal_Bool const *>(pValues[nProp].getValue()))
|
||||
pImp->nFlags |= HTMLCFG_NUMBERS_ENGLISH_US;
|
||||
break;//"Import/NumbersEnglishUS"
|
||||
}
|
||||
|
@@ -826,7 +826,7 @@ void ViewTabListBox_Impl::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEn
|
||||
void ViewTabListBox_Impl::ClearAll()
|
||||
{
|
||||
for ( sal_uInt16 i = 0; i < GetEntryCount(); ++i )
|
||||
delete (SvtContentEntry*)GetEntry(i)->GetUserData();
|
||||
delete static_cast<SvtContentEntry*>(GetEntry(i)->GetUserData());
|
||||
Clear();
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ void ViewTabListBox_Impl::DeleteEntries()
|
||||
pEntry = NextSelected( pEntry );
|
||||
|
||||
if ( pCurEntry->GetUserData() )
|
||||
aURL = ( (SvtContentEntry*)pCurEntry->GetUserData() )->maURL;
|
||||
aURL = static_cast<SvtContentEntry*>(pCurEntry->GetUserData())->maURL;
|
||||
|
||||
if ( aURL.isEmpty() )
|
||||
continue;
|
||||
@@ -889,7 +889,7 @@ void ViewTabListBox_Impl::DeleteEntries()
|
||||
{
|
||||
if ( Kill( aURL ) )
|
||||
{
|
||||
delete (SvtContentEntry*)pCurEntry->GetUserData();
|
||||
delete static_cast<SvtContentEntry*>(pCurEntry->GetUserData());
|
||||
GetModel()->Remove( pCurEntry );
|
||||
mpParent->EntryRemoved( aURL );
|
||||
}
|
||||
@@ -904,7 +904,7 @@ bool ViewTabListBox_Impl::EditedEntry( SvTreeListEntry* pEntry,
|
||||
bool bRet = false;
|
||||
|
||||
OUString aURL;
|
||||
SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData();
|
||||
SvtContentEntry* pData = static_cast<SvtContentEntry*>(pEntry->GetUserData());
|
||||
|
||||
if ( pData )
|
||||
aURL = pData->maURL;
|
||||
@@ -1021,7 +1021,7 @@ OUString ViewTabListBox_Impl::GetAccessibleObjectDescription( ::svt::AccessibleB
|
||||
SvTreeListEntry* pEntry = GetEntry( nRow );
|
||||
if ( pEntry )
|
||||
{
|
||||
SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData();
|
||||
SvtContentEntry* pData = static_cast<SvtContentEntry*>(pEntry->GetUserData());
|
||||
if ( pData )
|
||||
{
|
||||
const OUString sVar1( "%1" );
|
||||
@@ -1121,7 +1121,7 @@ OUString SvtFileView::GetURL( SvTreeListEntry* pEntry ) const
|
||||
{
|
||||
OUString aURL;
|
||||
if ( pEntry && pEntry->GetUserData() )
|
||||
aURL = ( (SvtContentEntry*)pEntry->GetUserData() )->maURL;
|
||||
aURL = static_cast<SvtContentEntry*>(pEntry->GetUserData())->maURL;
|
||||
return aURL;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1132,7 @@ OUString SvtFileView::GetCurrentURL() const
|
||||
OUString aURL;
|
||||
SvTreeListEntry* pEntry = mpImp->mpView->FirstSelected();
|
||||
if ( pEntry && pEntry->GetUserData() )
|
||||
aURL = ( (SvtContentEntry*)pEntry->GetUserData() )->maURL;
|
||||
aURL = static_cast<SvtContentEntry*>(pEntry->GetUserData())->maURL;
|
||||
return aURL;
|
||||
}
|
||||
|
||||
@@ -2036,7 +2036,7 @@ void SvtFileView_Impl::Resort_Impl( sal_Int16 nColumn, bool bAscending )
|
||||
OUString aEntryURL;
|
||||
SvTreeListEntry* pEntry = mpView->GetCurEntry();
|
||||
if ( pEntry && pEntry->GetUserData() )
|
||||
aEntryURL = ( (SvtContentEntry*)pEntry->GetUserData() )->maURL;
|
||||
aEntryURL = static_cast<SvtContentEntry*>(pEntry->GetUserData())->maURL;
|
||||
|
||||
mnSortColumn = nColumn;
|
||||
mbAscending = bAscending;
|
||||
|
@@ -703,13 +703,13 @@ sal_Handle FontList::GetFirstFontInfo(const OUString& rName) const
|
||||
|
||||
sal_Handle FontList::GetNextFontInfo( sal_Handle hFontInfo ) const
|
||||
{
|
||||
ImplFontListFontInfo* pInfo = (ImplFontListFontInfo*)(void*)hFontInfo;
|
||||
ImplFontListFontInfo* pInfo = static_cast<ImplFontListFontInfo*>((void*)hFontInfo);
|
||||
return (sal_Handle)(pInfo->mpNext);
|
||||
}
|
||||
|
||||
const vcl::FontInfo& FontList::GetFontInfo( sal_Handle hFontInfo ) const
|
||||
{
|
||||
ImplFontListFontInfo* pInfo = (ImplFontListFontInfo*)(void*)hFontInfo;
|
||||
ImplFontListFontInfo* pInfo = static_cast<ImplFontListFontInfo*>((void*)hFontInfo);
|
||||
return *pInfo;
|
||||
}
|
||||
|
||||
|
@@ -205,7 +205,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL Graphic::getDIB( ) throw (uno::RuntimeExce
|
||||
SvMemoryStream aMem;
|
||||
|
||||
WriteDIB(mpGraphic->GetBitmapEx().GetBitmap(), aMem, false, true);
|
||||
return ::com::sun::star::uno::Sequence<sal_Int8>( (sal_Int8*) aMem.GetData(), aMem.Tell() );
|
||||
return ::com::sun::star::uno::Sequence<sal_Int8>( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -224,7 +224,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL Graphic::getMaskDIB( ) throw (uno::Runtime
|
||||
SvMemoryStream aMem;
|
||||
|
||||
WriteDIB(mpGraphic->GetBitmapEx().GetMask(), aMem, false, true);
|
||||
return ::com::sun::star::uno::Sequence<sal_Int8>( (sal_Int8*) aMem.GetData(), aMem.Tell() );
|
||||
return ::com::sun::star::uno::Sequence<sal_Int8>( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -511,7 +511,7 @@ void TransferDataContainer::CopyINetImage( const INetImage& rINtImg )
|
||||
SvMemoryStream aMemStm( 1024, 1024 );
|
||||
aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 );
|
||||
rINtImg.Write( aMemStm, SotClipboardFormatId::INET_IMAGE );
|
||||
CopyAnyData( SotClipboardFormatId::INET_IMAGE, (sal_Char*)aMemStm.GetData(),
|
||||
CopyAnyData( SotClipboardFormatId::INET_IMAGE, static_cast<sal_Char const *>(aMemStm.GetData()),
|
||||
aMemStm.Seek( STREAM_SEEK_TO_END ) );
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ void TransferDataContainer::CopyImageMap( const ImageMap& rImgMap )
|
||||
SvMemoryStream aMemStm( 8192, 8192 );
|
||||
aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 );
|
||||
rImgMap.Write( aMemStm, OUString() );
|
||||
CopyAnyData( SotClipboardFormatId::SVIM, (sal_Char*)aMemStm.GetData(),
|
||||
CopyAnyData( SotClipboardFormatId::SVIM, static_cast<sal_Char const *>(aMemStm.GetData()),
|
||||
aMemStm.Seek( STREAM_SEEK_TO_END ) );
|
||||
}
|
||||
|
||||
|
@@ -164,8 +164,8 @@ extern "C"
|
||||
|
||||
static int SAL_CALL HTMLKeyCompare( const void *pFirst, const void *pSecond)
|
||||
{
|
||||
HTML_TokenEntry* pFirstEntry = (HTML_TokenEntry*)pFirst;
|
||||
HTML_TokenEntry* pSecondEntry = (HTML_TokenEntry*)pSecond;
|
||||
HTML_TokenEntry const * pFirstEntry = static_cast<HTML_TokenEntry const *>(pFirst);
|
||||
HTML_TokenEntry const * pSecondEntry = static_cast<HTML_TokenEntry const *>(pSecond);
|
||||
int nRet = 0;
|
||||
if( -1 == pFirstEntry->nToken )
|
||||
{
|
||||
@@ -214,7 +214,7 @@ int GetHTMLToken( const OUString& rName )
|
||||
sizeof( HTML_TokenEntry ),
|
||||
HTMLKeyCompare );
|
||||
if( 0 != pFound )
|
||||
nRet = ((HTML_TokenEntry*)pFound)->nToken;
|
||||
nRet = static_cast<HTML_TokenEntry*>(pFound)->nToken;
|
||||
return nRet;
|
||||
}
|
||||
|
||||
@@ -501,8 +501,8 @@ extern "C"
|
||||
|
||||
static int SAL_CALL HTMLCharNameCompare( const void *pFirst, const void *pSecond)
|
||||
{
|
||||
HTML_CharEntry* pFirstEntry = (HTML_CharEntry*)pFirst;
|
||||
HTML_CharEntry* pSecondEntry = (HTML_CharEntry*)pSecond;
|
||||
HTML_CharEntry const * pFirstEntry = static_cast<HTML_CharEntry const *>(pFirst);
|
||||
HTML_CharEntry const * pSecondEntry = static_cast<HTML_CharEntry const *>(pSecond);
|
||||
int nRet = 0;
|
||||
if( USHRT_MAX == pFirstEntry->cChar )
|
||||
{
|
||||
@@ -546,7 +546,7 @@ sal_Unicode GetHTMLCharName( const OUString& rName )
|
||||
sizeof( aHTMLCharNameTab) / sizeof( HTML_CharEntry ),
|
||||
sizeof( HTML_CharEntry ),
|
||||
HTMLCharNameCompare )))
|
||||
cRet = ((HTML_CharEntry*)pFound)->cChar;
|
||||
cRet = static_cast<HTML_CharEntry*>(pFound)->cChar;
|
||||
return cRet;
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ int GetHTMLOption( const OUString& rName )
|
||||
sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ),
|
||||
sizeof( HTML_TokenEntry ),
|
||||
HTMLKeyCompare )))
|
||||
nRet = ((HTML_TokenEntry*)pFound)->nToken;
|
||||
nRet = static_cast<HTML_TokenEntry*>(pFound)->nToken;
|
||||
return nRet;
|
||||
}
|
||||
|
||||
@@ -900,8 +900,8 @@ extern "C"
|
||||
|
||||
static int SAL_CALL HTMLColorNameCompare( const void *pFirst, const void *pSecond)
|
||||
{
|
||||
HTML_ColorEntry* pFirstEntry = (HTML_ColorEntry*)pFirst;
|
||||
HTML_ColorEntry* pSecondEntry = (HTML_ColorEntry*)pSecond;
|
||||
HTML_ColorEntry const * pFirstEntry = static_cast<HTML_ColorEntry const *>(pFirst);
|
||||
HTML_ColorEntry const * pSecondEntry = static_cast<HTML_ColorEntry const *>(pSecond);
|
||||
int nRet = 0;
|
||||
if( HTML_NO_COLOR == pFirstEntry->nColor )
|
||||
{
|
||||
@@ -947,7 +947,7 @@ sal_uInt32 GetHTMLColor( const OUString& rName )
|
||||
sizeof( aHTMLColorNameTab) / sizeof( HTML_ColorEntry ),
|
||||
sizeof( HTML_ColorEntry ),
|
||||
HTMLColorNameCompare )))
|
||||
nRet = ((HTML_ColorEntry*)pFound)->nColor;
|
||||
nRet = static_cast<HTML_ColorEntry*>(pFound)->nColor;
|
||||
|
||||
return nRet;
|
||||
}
|
||||
|
@@ -1179,25 +1179,25 @@ extern "C" {
|
||||
static int SAL_CALL RTFKeyCompare( const void *pFirst, const void *pSecond)
|
||||
{
|
||||
int nRet = 0;
|
||||
if( -1 == ((RTF_TokenEntry*)pFirst)->nToken )
|
||||
if( -1 == static_cast<RTF_TokenEntry const *>(pFirst)->nToken )
|
||||
{
|
||||
if( -1 == ((RTF_TokenEntry*)pSecond)->nToken )
|
||||
nRet = ((RTF_TokenEntry*)pFirst)->pUToken->compareTo(
|
||||
*((RTF_TokenEntry*)pSecond)->pUToken );
|
||||
if( -1 == static_cast<RTF_TokenEntry const *>(pSecond)->nToken )
|
||||
nRet = static_cast<RTF_TokenEntry const *>(pFirst)->pUToken->compareTo(
|
||||
*static_cast<RTF_TokenEntry const *>(pSecond)->pUToken );
|
||||
else
|
||||
{
|
||||
nRet = ((RTF_TokenEntry*)pFirst)->pUToken->compareToIgnoreAsciiCaseAscii(
|
||||
((RTF_TokenEntry*)pSecond)->sToken );
|
||||
nRet = static_cast<RTF_TokenEntry const *>(pFirst)->pUToken->compareToIgnoreAsciiCaseAscii(
|
||||
static_cast<RTF_TokenEntry const *>(pSecond)->sToken );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( -1 == ((RTF_TokenEntry*)pSecond)->nToken )
|
||||
nRet = -1 * ((RTF_TokenEntry*)pSecond)->pUToken->compareToIgnoreAsciiCaseAscii(
|
||||
((RTF_TokenEntry*)pFirst)->sToken );
|
||||
if( -1 == static_cast<RTF_TokenEntry const *>(pSecond)->nToken )
|
||||
nRet = -1 * static_cast<RTF_TokenEntry const *>(pSecond)->pUToken->compareToIgnoreAsciiCaseAscii(
|
||||
static_cast<RTF_TokenEntry const *>(pFirst)->sToken );
|
||||
else
|
||||
nRet = strcmp( ((RTF_TokenEntry*)pFirst)->sToken,
|
||||
((RTF_TokenEntry*)pSecond)->sToken );
|
||||
nRet = strcmp( static_cast<RTF_TokenEntry const *>(pFirst)->sToken,
|
||||
static_cast<RTF_TokenEntry const *>(pSecond)->sToken );
|
||||
}
|
||||
|
||||
return nRet;
|
||||
@@ -1227,7 +1227,7 @@ int GetRTFToken( const OUString& rSearch )
|
||||
sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ),
|
||||
sizeof( RTF_TokenEntry ),
|
||||
RTFKeyCompare )))
|
||||
nRet = ((RTF_TokenEntry*)pFound)->nToken;
|
||||
nRet = static_cast<RTF_TokenEntry*>(pFound)->nToken;
|
||||
|
||||
return nRet;
|
||||
}
|
||||
|
@@ -483,7 +483,7 @@ void TreeControlPeer::ChangeNodesSelection( const Any& rSelection, bool bSelect,
|
||||
{
|
||||
if( rSelection.getValueType() == ::getCppuType( (const Sequence< Reference< XTreeNode > > *) 0 ) )
|
||||
{
|
||||
const Sequence< Reference< XTreeNode > >& rSeq( *(const Sequence< Reference< XTreeNode > > *)rSelection.getValue() );
|
||||
const Sequence< Reference< XTreeNode > >& rSeq( *static_cast<const Sequence< Reference< XTreeNode > > *>(rSelection.getValue()) );
|
||||
nCount = rSeq.getLength();
|
||||
if( nCount )
|
||||
pNodes = rSeq.getConstArray();
|
||||
|
Reference in New Issue
Block a user