Kaydet (Commit) 950028c6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some more loplugin:cstylecast: svtools

Change-Id: I8d8b48b297fa3ce0bb9a81dd396cbdb253b84a80
üst 4423b09f
......@@ -1344,7 +1344,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel )
WriteDragServerInfo( rPosPixel, &aDDInfo );
pContainer->CopyAnyData( SOT_FORMATSTR_ID_TREELISTBOX,
(sal_Char*)&aDDInfo, sizeof(SvLBoxDDInfo) );
reinterpret_cast<char*>(&aDDInfo), sizeof(SvLBoxDDInfo) );
pDDSource = this;
pDDTarget = 0;
......
......@@ -75,6 +75,10 @@ public:
Fix( long l ) { x=(l<<FIX_POST); }
Fix( long Z, long N ) { x=(Z<<FIX_POST)/N; }
enum class Bits { Bits };
Fix(long bits, Bits): x(bits) {}
void SetInternVal( long nVal ) { x=nVal; }
long GetInternVal() const { return x; }
......@@ -140,26 +144,22 @@ inline Fix operator- ( const Fix& a )
inline Fix operator+ ( const Fix& a, const Fix& b )
{
long l = a.x+b.x;
return *((Fix*)&l);
return Fix(a.x+b.x, Fix::Bits::Bits);
}
inline Fix operator- ( const Fix& a, const Fix& b )
{
long l = a.x-b.x;
return *((Fix*)&l);
return Fix(a.x-b.x, Fix::Bits::Bits);
}
inline Fix operator* ( const Fix& a, const Fix& b )
{
long l=(a.x*b.x+FIX_ADD)>>FIX_POST;
return *((Fix*)&l);
return Fix((a.x*b.x+FIX_ADD)>>FIX_POST, Fix::Bits::Bits);
}
inline Fix operator/ ( const Fix& a, const Fix& b )
{
long l=(a.x<<FIX_POST)/b.x;
return *((Fix*)&l);
return Fix((a.x<<FIX_POST)/b.x, Fix::Bits::Bits);
}
inline FixCpx operator- ( const FixCpx& a )
......
......@@ -242,8 +242,8 @@ namespace svt
if ( s_hAccessibleImplementationModule != NULL )
{
const OUString sFactoryCreationFunc( "getSvtAccessibilityComponentFactory" );
s_pAccessibleFactoryFunc = (GetSvtAccessibilityComponentFactory)
osl_getFunctionSymbol( s_hAccessibleImplementationModule, sFactoryCreationFunc.pData );
s_pAccessibleFactoryFunc = reinterpret_cast<GetSvtAccessibilityComponentFactory>(
osl_getFunctionSymbol( s_hAccessibleImplementationModule, sFactoryCreationFunc.pData ));
}
OSL_ENSURE( s_pAccessibleFactoryFunc, "ac_registerClient: could not load the library, or not retrieve the needed symbol!" );
......
......@@ -350,7 +350,7 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co
if( maAny >>= aSeq )
{
boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC ));
boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( aSeq.getArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC ));
GDIMetaFile aMtf;
ReadGDIMetaFile( *pSrcStm, aMtf );
......@@ -380,7 +380,7 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co
if( maAny >>= aSeq )
{
boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC ));
boost::scoped_ptr<SvMemoryStream> pSrcStm(new SvMemoryStream( aSeq.getArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC ));
GDIMetaFile aMtf;
ReadGDIMetaFile( *pSrcStm, aMtf );
......
......@@ -208,7 +208,7 @@ int GetHTMLToken( const OUString& rName )
aSrch.pUToken = &rName;
aSrch.nToken = -1;
pFound = bsearch( (sal_Char *) &aSrch,
pFound = bsearch( &aSrch,
(void*) aHTMLTokenTab,
sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ),
sizeof( HTML_TokenEntry ),
......@@ -541,7 +541,7 @@ sal_Unicode GetHTMLCharName( const OUString& rName )
aSrch.pUName = &rName;
aSrch.cChar = USHRT_MAX;
if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
if( 0 != ( pFound = bsearch( &aSrch,
(void*) aHTMLCharNameTab,
sizeof( aHTMLCharNameTab) / sizeof( HTML_CharEntry ),
sizeof( HTML_CharEntry ),
......@@ -724,7 +724,7 @@ int GetHTMLOption( const OUString& rName )
aSrch.pUToken = &rName;
aSrch.nToken = -1;
if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
if( 0 != ( pFound = bsearch( &aSrch,
(void*) aHTMLOptionTab,
sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ),
sizeof( HTML_TokenEntry ),
......@@ -942,7 +942,7 @@ sal_uInt32 GetHTMLColor( const OUString& rName )
aSrch.pUName = &aLowerCase;
aSrch.nColor = HTML_NO_COLOR;
if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
if( 0 != ( pFound = bsearch( &aSrch,
(void*) aHTMLColorNameTab,
sizeof( aHTMLColorNameTab) / sizeof( HTML_ColorEntry ),
sizeof( HTML_ColorEntry ),
......
......@@ -1222,7 +1222,7 @@ int GetRTFToken( const OUString& rSearch )
aSrch.pUToken = &rSearch;
aSrch.nToken = -1;
if( 0 != ( pFound = bsearch( (char *) &aSrch,
if( 0 != ( pFound = bsearch( &aSrch,
(void*) aRTFTokenTab,
sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ),
sizeof( RTF_TokenEntry ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment