diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-18 21:34:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-20 09:06:52 +0100 |
commit | 950028c6e3b20ee686e47fdf990de89377aaf92a (patch) | |
tree | 5b38178db6d0b5ddaff87e571c24acb7e35d7fe0 /svtools | |
parent | 4423b09f69a744610faf7aca35649f5bdeb3cf7a (diff) |
Some more loplugin:cstylecast: svtools
Change-Id: I8d8b48b297fa3ce0bb9a81dd396cbdb253b84a80
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/dialogs/mcvmath.hxx | 16 | ||||
-rw-r--r-- | svtools/source/misc/svtaccessiblefactory.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/transfer.cxx | 4 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlkywd.cxx | 8 | ||||
-rw-r--r-- | svtools/source/svrtf/rtfkeywd.cxx | 2 |
6 files changed, 18 insertions, 18 deletions
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index d3d36146cb52..707b7bbd74ff 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -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; diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index a6a1079abed4..a4ce6bd5f801 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -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 ) diff --git a/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx index 02f9dfb212ce..4c6cdf7def9d 100644 --- a/svtools/source/misc/svtaccessiblefactory.cxx +++ b/svtools/source/misc/svtaccessiblefactory.cxx @@ -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!" ); diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 9e1e6f6bc7e8..255ba7fe3bb7 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -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 ); diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx index 4c0fde74217f..4acc586d00ee 100644 --- a/svtools/source/svhtml/htmlkywd.cxx +++ b/svtools/source/svhtml/htmlkywd.cxx @@ -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 ), diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index ef032a547009..164cfb55a1c0 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -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 ), |