diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:25:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:25:38 +0100 |
commit | 029149e9b7aa8ad66dca2972e26385c831153c80 (patch) | |
tree | fd5cc80e4372eecd4e9d68b636a39ef406cd286c /desktop/source | |
parent | 6e8765b161a1c839fd303eecbd4ddd56f85b86ac (diff) |
More loplugin:cstylecast: desktop
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: I492363d79e443221b139f0c192a552cc5548ee4f
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 4 | ||||
-rw-r--r-- | desktop/source/deployment/dp_persmap.cxx | 10 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 10 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 6 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_extensionmanager.cxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | desktop/source/splash/splash.cxx | 6 |
8 files changed, 22 insertions, 22 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index afcdba68629f..5bfd5ed80a23 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -258,7 +258,7 @@ OUString CreateMD5FromString( const OUString& aMsg ) // Create hex-value string from the MD5 value to keep the string size minimal OUStringBuffer aBuffer( nMD5KeyLen * 2 + 1 ); for ( sal_uInt32 i = 0; i < nMD5KeyLen; i++ ) - aBuffer.append( (sal_Int32)pMD5KeyBuffer[i], 16 ); + aBuffer.append( static_cast<sal_Int32>(pMD5KeyBuffer[i]), 16 ); return aBuffer.makeStringAndClear(); } @@ -1216,7 +1216,7 @@ void PipeIpcThread::execute() } } - SAL_WARN( "desktop.app", "Error on accept: " << (int)nError); + SAL_WARN( "desktop.app", "Error on accept: " << static_cast<int>(nError)); TimeValue tval; tval.Seconds = 1; tval.Nanosec = 0; diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index ac45ea30142d..e254d9b67c0a 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -70,7 +70,7 @@ static OString encodeString( const OString& rStr) // short circuit for the simple non-encoded case while( --i >= 0) { - const unsigned char c = (unsigned char) *(pChar++); + const unsigned char c = static_cast<unsigned char>(*(pChar++)); if( c <= 0x0F ) break; if( c == '%') @@ -84,7 +84,7 @@ static OString encodeString( const OString& rStr) aEncStr.append( pChar - (nLen-i), nLen - i); while( --i >= 0) { - unsigned char c = (unsigned char) *(pChar++); + unsigned char c = static_cast<unsigned char>(*(pChar++)); if( c <= 0x0F ) { aEncStr.append( '%'); @@ -173,7 +173,7 @@ void PersistentMap::readAll() if( nBytesRead != sizeof(aHeaderBytes)) return; // check header magic - for( int i = 0; i < (int)sizeof(PmapMagic); ++i) + for( int i = 0; i < int(sizeof(PmapMagic)); ++i) if( aHeaderBytes[i] != PmapMagic[i]) return; @@ -237,13 +237,13 @@ void PersistentMap::flush() const OString aKeyString = encodeString( (*it).first); const sal_Int32 nKeyLen = aKeyString.getLength(); m_MapFile.write( aKeyString.getStr(), nKeyLen, nBytesWritten); - OSL_ASSERT( nKeyLen == (sal_Int32)nBytesWritten); + OSL_ASSERT( nKeyLen == static_cast<sal_Int32>(nBytesWritten)); m_MapFile.write( "\n", 1, nBytesWritten); // write line for value const OString& rValString = encodeString( (*it).second); const sal_Int32 nValLen = rValString.getLength(); m_MapFile.write( rValString.getStr(), nValLen, nBytesWritten); - OSL_ASSERT( nValLen == (sal_Int32)nBytesWritten); + OSL_ASSERT( nValLen == static_cast<sal_Int32>(nBytesWritten)); m_MapFile.write( "\n", 1, nBytesWritten); } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 780636352b5d..8d0c39d23a03 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -245,7 +245,7 @@ void ExtBoxWithBtns_Impl::SetButtonStatus(const TEntry_Impl& rEntry) MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos ) { - if ( nPos >= (long) getItemCount() ) + if ( nPos >= static_cast<long>(getItemCount()) ) return CMD_NONE; ScopedVclPtrInstance<PopupMenu> aPopup; @@ -802,7 +802,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleCloseBtn, Button*, void) IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface, void ) { ::osl::MutexGuard aGuard( m_aMutex ); - bool bLockInterface = (bool) _bLockInterface; + bool bLockInterface = static_cast<bool>(_bLockInterface); if ( m_bStartProgress && !m_bHasProgress ) m_aIdle.Start(); @@ -998,7 +998,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, TimeOutHdl, Timer *, void) } if ( m_pProgressBar->IsVisible() ) - m_pProgressBar->SetValue( (sal_uInt16) m_nProgress ); + m_pProgressBar->SetValue( static_cast<sal_uInt16>(m_nProgress) ); } } @@ -1159,7 +1159,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCancelBtn, Button*, void) IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface, void ) { ::osl::MutexGuard aGuard( m_aMutex ); - bool bLockInterface = (bool) _bLockInterface; + bool bLockInterface = static_cast<bool>(_bLockInterface); if ( m_bStartProgress && !m_bHasProgress ) m_aIdle.Start(); @@ -1312,7 +1312,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, TimeOutHdl, Timer *, void) } if ( m_pProgressBar->IsVisible() ) - m_pProgressBar->SetValue( (sal_uInt16) m_nProgress ); + m_pProgressBar->SetValue( static_cast<sal_uInt16>(m_nProgress) ); } } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 3adb6fd8acaf..1e2f7dc9d925 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -390,7 +390,7 @@ void ExtensionBox_Impl::selectEntry( const long nPos ) m_vEntries[ m_nActive ]->m_bActive = false; } - if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) ) + if ( ( nPos >= 0 ) && ( nPos < static_cast<long>(m_vEntries.size()) ) ) { m_bHasActive = true; m_nActive = nPos; @@ -663,7 +663,7 @@ bool ExtensionBox_Impl::HandleCursorKey( sal_uInt16 nKeyCode ) if ( nSelect < 0 ) nSelect = 0; - if ( nSelect >= (long) m_vEntries.size() ) + if ( nSelect >= static_cast<long>(m_vEntries.size()) ) nSelect = m_vEntries.size() - 1; selectEntry( nSelect ); @@ -1033,7 +1033,7 @@ void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage if ( nPos < m_nActive ) m_nActive -= 1; else if ( ( nPos == m_nActive ) && - ( nPos == (long) m_vEntries.size() ) ) + ( nPos == static_cast<long>(m_vEntries.size()) ) ) m_nActive -= 1; m_bHasActive = false; diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index 59fc80fc8160..8a2ede5822ca 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -174,7 +174,7 @@ public: virtual Size GetOptimalSize() const override; TEntry_Impl const & GetEntryData( long nPos ) { return m_vEntries[ nPos ]; } - long GetEntryCount() { return (long) m_vEntries.size(); } + long GetEntryCount() { return static_cast<long>(m_vEntries.size()); } tools::Rectangle GetEntryRect( const long nPos ) const; bool HasActive() { return m_bHasActive; } long PointToPos( const Point& rPos ); diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index b7b27575df95..f9f2eb7fa110 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1234,7 +1234,7 @@ sal_Bool ExtensionManager::synchronize( OUString sSynchronizingBundled(StrSyncRepository()); sSynchronizingBundled = sSynchronizingBundled.replaceAll("%NAME", "bundled"); dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled); - bModified |= (bool)getBundledRepository()->synchronize(xAbortChannel, xCmdEnv); + bModified |= static_cast<bool>(getBundledRepository()->synchronize(xAbortChannel, xCmdEnv)); progressBundled.update("\n\n"); //Always determine the active extension. diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 99c3f997ae68..7190b030ea9a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2075,7 +2075,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, { if (pViewShell->getPart() == nPart) { - nViewId = (sal_Int32)pViewShell->GetViewShellId(); + nViewId = static_cast<sal_Int32>(pViewShell->GetViewShellId()); doc_setView(pThis, nViewId); break; } @@ -2636,7 +2636,7 @@ static char* getFonts (const char* pCommand) while (pAry[nSizeCount]) { boost::property_tree::ptree aChild; - aChild.put("", (float)pAry[nSizeCount] / 10); + aChild.put("", static_cast<float>(pAry[nSizeCount]) / 10); aChildren.push_back(std::make_pair("", aChild)); nSizeCount++; } diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 60efbf57d979..4d5f31148d71 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -38,7 +38,7 @@ #include <vcl/introwin.hxx> #include <vcl/virdev.hxx> -#define NOT_LOADED ((long)-1) +#define NOT_LOADED (long(-1)) using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; @@ -473,7 +473,7 @@ void SplashScreen::SetScreenBitmap(BitmapEx &rBitmap) if ( nCount > 0 ) { // retrieve size from first screen - tools::Rectangle aScreenArea = Application::GetScreenPosSizePixel((unsigned int)0); + tools::Rectangle aScreenArea = Application::GetScreenPosSizePixel(static_cast<unsigned int>(0)); nWidth = aScreenArea.GetWidth(); nHeight = aScreenArea.GetHeight(); } @@ -516,7 +516,7 @@ void SplashScreen::determineProgressRatioValues( if ( nCount > 0 ) { // retrieve size from first screen - tools::Rectangle aScreenArea = Application::GetScreenPosSizePixel((unsigned int)0); + tools::Rectangle aScreenArea = Application::GetScreenPosSizePixel(static_cast<unsigned int>(0)); nWidth = aScreenArea.GetWidth(); nHeight = aScreenArea.GetHeight(); nScreenRatio = nHeight ? sal_Int32( rtl::math::round( double( nWidth ) / double( nHeight ), 2 ) * 100 ) : 0; |