summaryrefslogtreecommitdiff
path: root/desktop/source/deployment
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:25:38 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:25:38 +0100
commit029149e9b7aa8ad66dca2972e26385c831153c80 (patch)
treefd5cc80e4372eecd4e9d68b636a39ef406cd286c /desktop/source/deployment
parent6e8765b161a1c839fd303eecbd4ddd56f85b86ac (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/deployment')
-rw-r--r--desktop/source/deployment/dp_persmap.cxx10
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx10
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx6
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx2
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx2
5 files changed, 15 insertions, 15 deletions
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.