diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:14:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:14:18 +0100 |
commit | 43b137e1404acbd16649813e9d493ba97b8f509c (patch) | |
tree | 2e5827c0d60185c56603e66b1ea74a72230b9476 /svtools/source/dialogs | |
parent | c049c76fc521f2b55b39a6e9eb0f0092bcf6ef77 (diff) |
More loplugin:cstylecast: svtools
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: Ide9e7c53b554f0a36e2078a8823f5ef6fb5cc8fa
Diffstat (limited to 'svtools/source/dialogs')
-rw-r--r-- | svtools/source/dialogs/addresstemplate.cxx | 6 | ||||
-rw-r--r-- | svtools/source/dialogs/colrdlg.cxx | 2 | ||||
-rw-r--r-- | svtools/source/dialogs/roadmapwizard.cxx | 20 |
3 files changed, 14 insertions, 14 deletions
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index fd1c4a548285..b1df44bdf245 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -617,7 +617,7 @@ void AssignmentPersistentData::ImplCommit() // the logical names OUString sLogicalFieldNames(STR_LOGICAL_FIELD_NAMES); sal_Int32 nAdjustedTokenCount = comphelper::string::getTokenCount(sLogicalFieldNames, ';') + (m_pImpl->bOddFieldNumber ? 1 : 0); - DBG_ASSERT(nAdjustedTokenCount == (sal_Int32)m_pImpl->aFieldLabels.size(), + DBG_ASSERT(nAdjustedTokenCount == static_cast<sal_Int32>(m_pImpl->aFieldLabels.size()), "AddressBookSourceDialog::AddressBookSourceDialog: inconsistence between logical and UI field names!"); m_pImpl->aLogicalFieldNames.reserve(nAdjustedTokenCount); for (sal_Int32 i = 0; i<nAdjustedTokenCount; ++i) @@ -1049,8 +1049,8 @@ void AssignmentPersistentData::ImplCommit() // the new row for the focus sal_Int32 nNewFocusRow = nOldFocusRow + nDelta; // normalize - nNewFocusRow = std::min(nNewFocusRow, (sal_Int32)(FIELD_PAIRS_VISIBLE - 1), ::std::less< sal_Int32 >()); - nNewFocusRow = std::max(nNewFocusRow, (sal_Int32)0, ::std::less< sal_Int32 >()); + nNewFocusRow = std::min(nNewFocusRow, sal_Int32(FIELD_PAIRS_VISIBLE - 1), ::std::less< sal_Int32 >()); + nNewFocusRow = std::max(nNewFocusRow, sal_Int32(0), ::std::less< sal_Int32 >()); // set the new focus (in the same column) m_pImpl->pFields[nNewFocusRow * 2 + nOldFocusColumn]->GrabFocus(); } diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx index a0d4af23f78f..941f9bbaa779 100644 --- a/svtools/source/dialogs/colrdlg.cxx +++ b/svtools/source/dialogs/colrdlg.cxx @@ -74,7 +74,7 @@ short SvColorDialog::Execute() Sequence< PropertyValue > props( 2 ); props[0].Name = sColor; - props[0].Value <<= (sal_Int32) maColor.GetColor(); + props[0].Value <<= static_cast<sal_Int32>(maColor.GetColor()); props[1].Name = "Mode"; props[1].Value <<= static_cast<sal_Int16>(meMode); diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index 97c808a53f64..dae6e40897bb 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -205,12 +205,12 @@ namespace svt if ( m_pImpl->nActivePath != -1 ) nCurrentStatePathIndex = m_pImpl->getStateIndexInPath( getCurrentState(), m_pImpl->nActivePath ); - DBG_ASSERT( (sal_Int32)aNewPathPos->second.size() > nCurrentStatePathIndex, + DBG_ASSERT( static_cast<sal_Int32>(aNewPathPos->second.size()) > nCurrentStatePathIndex, "RoadmapWizard::activate: you cannot activate a path which has less states than we've already advanced!" ); // If this asserts, this for instance means that we are already in state number, say, 5 // of our current path, and the caller tries to activate a path which has less than 5 // states - if ( (sal_Int32)aNewPathPos->second.size() <= nCurrentStatePathIndex ) + if ( static_cast<sal_Int32>(aNewPathPos->second.size()) <= nCurrentStatePathIndex ) return; // assert that the current and the new path are equal, up to nCurrentStatePathIndex @@ -243,7 +243,7 @@ namespace svt return; // determine up to which index (in the new path) we have to display the items - RoadmapTypes::ItemIndex nUpperStepBoundary = (RoadmapTypes::ItemIndex)rActivePath.size(); + RoadmapTypes::ItemIndex nUpperStepBoundary = static_cast<RoadmapTypes::ItemIndex>(rActivePath.size()); bool bIncompletePath = false; if ( !m_pImpl->bActivePathIsDefinite ) { @@ -355,14 +355,14 @@ namespace svt sal_Int32 nNextStateIndex = nCurrentStatePathIndex + 1; - while ( ( nNextStateIndex < (sal_Int32)aActivePathPos->second.size() ) + while ( ( nNextStateIndex < static_cast<sal_Int32>(aActivePathPos->second.size()) ) && ( m_pImpl->aDisabledStates.find( aActivePathPos->second[ nNextStateIndex ] ) != m_pImpl->aDisabledStates.end() ) ) { ++nNextStateIndex; } - if ( nNextStateIndex >= (sal_Int32)aActivePathPos->second.size() ) + if ( nNextStateIndex >= static_cast<sal_Int32>(aActivePathPos->second.size()) ) // there is no next state in the current path (at least none which is enabled) return WZS_INVALID_STATE; @@ -453,8 +453,8 @@ namespace svt bool bResult = true; if ( nNewIndex > nCurrentIndex ) { - bResult = skipUntil( (WizardState)nCurItemId ); - WizardState nTemp = (WizardState)nCurItemId; + bResult = skipUntil( static_cast<WizardState>(nCurItemId) ); + WizardState nTemp = static_cast<WizardState>(nCurItemId); while( nTemp ) { if( m_pImpl->aDisabledStates.find( --nTemp ) != m_pImpl->aDisabledStates.end() ) @@ -462,7 +462,7 @@ namespace svt } } else - bResult = skipBackwardUntil( (WizardState)nCurItemId ); + bResult = skipBackwardUntil( static_cast<WizardState>(nCurItemId) ); if ( !bResult ) m_pImpl->pRoadmap->SelectRoadmapItemByID( getCurrentState() ); @@ -524,7 +524,7 @@ namespace svt } // if the state is currently in the roadmap, reflect it's new status - m_pImpl->pRoadmap->EnableRoadmapItem( (RoadmapTypes::ItemId)_nState, _bEnable ); + m_pImpl->pRoadmap->EnableRoadmapItem( static_cast<RoadmapTypes::ItemId>(_nState), _bEnable ); } @@ -555,7 +555,7 @@ namespace svt void RoadmapWizard::updateRoadmapItemLabel( WizardState _nState ) { const WizardPath& rActivePath( m_pImpl->aPaths[ m_pImpl->nActivePath ] ); - RoadmapTypes::ItemIndex nUpperStepBoundary = (RoadmapTypes::ItemIndex)rActivePath.size(); + RoadmapTypes::ItemIndex nUpperStepBoundary = static_cast<RoadmapTypes::ItemIndex>(rActivePath.size()); RoadmapTypes::ItemIndex nLoopUntil = ::std::max( nUpperStepBoundary, m_pImpl->pRoadmap->GetItemCount() ); sal_Int32 nCurrentStatePathIndex = -1; if ( m_pImpl->nActivePath != -1 ) |