diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:13:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:13:55 +0100 |
commit | c049c76fc521f2b55b39a6e9eb0f0092bcf6ef77 (patch) | |
tree | 2bc2c059a6f6a175a0c0e5321887adc077fef419 /svx/source/svdraw/svdedtv2.cxx | |
parent | 0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (diff) |
More loplugin:cstylecast: svx
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: I100e6c14cbf1d780f0e5ebca6b0c9e71ce1caaf7
Diffstat (limited to 'svx/source/svdraw/svdedtv2.cxx')
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 5d5e7dfaa631..1ebde1442249 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -840,35 +840,35 @@ void SdrEditView::DistributeMarkedObjects() { // calculate room in-between sal_Int32 nWidth = GetAllMarkedBoundRect().GetWidth() + 1; - double fStepWidth = ((double)nWidth - (double)nFullLength) / (double)(aEntryList.size() - 1); - double fStepStart = (double)aEntryList[ 0 ]->mnPos; - fStepStart += fStepWidth + (double)((aEntryList[ 0 ]->mnLength + aEntryList[ 1 ]->mnLength) / 2); + double fStepWidth = (static_cast<double>(nWidth) - static_cast<double>(nFullLength)) / static_cast<double>(aEntryList.size() - 1); + double fStepStart = static_cast<double>(aEntryList[ 0 ]->mnPos); + fStepStart += fStepWidth + static_cast<double>((aEntryList[ 0 ]->mnLength + aEntryList[ 1 ]->mnLength) / 2); // move entries 1..n-1 for( size_t i = 1, n = aEntryList.size()-1; i < n; ++i ) { ImpDistributeEntry* pCurr = aEntryList[ i ]; ImpDistributeEntry* pNext = aEntryList[ i + 1]; - sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos; + sal_Int32 nDelta = static_cast<sal_Int32>(fStepStart + 0.5) - pCurr->mnPos; if( bUndo ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj)); pCurr->mpObj->Move(Size(nDelta, 0)); - fStepStart += fStepWidth + (double)((pCurr->mnLength + pNext->mnLength) / 2); + fStepStart += fStepWidth + static_cast<double>((pCurr->mnLength + pNext->mnLength) / 2); } } else { // calculate distances sal_Int32 nWidth = aEntryList[ aEntryList.size() - 1 ]->mnPos - aEntryList[ 0 ]->mnPos; - double fStepWidth = (double)nWidth / (double)(aEntryList.size() - 1); - double fStepStart = (double)aEntryList[ 0 ]->mnPos; + double fStepWidth = static_cast<double>(nWidth) / static_cast<double>(aEntryList.size() - 1); + double fStepStart = static_cast<double>(aEntryList[ 0 ]->mnPos); fStepStart += fStepWidth; // move entries 1..n-1 for( size_t i = 1 ; i < aEntryList.size()-1 ; ++i ) { ImpDistributeEntry* pCurr = aEntryList[ i ]; - sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos; + sal_Int32 nDelta = static_cast<sal_Int32>(fStepStart + 0.5) - pCurr->mnPos; if( bUndo ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj)); pCurr->mpObj->Move(Size(nDelta, 0)); @@ -935,35 +935,35 @@ void SdrEditView::DistributeMarkedObjects() { // calculate room in-between sal_Int32 nHeight = GetAllMarkedBoundRect().GetHeight() + 1; - double fStepWidth = ((double)nHeight - (double)nFullLength) / (double)(aEntryList.size() - 1); - double fStepStart = (double)aEntryList[ 0 ]->mnPos; - fStepStart += fStepWidth + (double)((aEntryList[ 0 ]->mnLength + aEntryList[ 1 ]->mnLength) / 2); + double fStepWidth = (static_cast<double>(nHeight) - static_cast<double>(nFullLength)) / static_cast<double>(aEntryList.size() - 1); + double fStepStart = static_cast<double>(aEntryList[ 0 ]->mnPos); + fStepStart += fStepWidth + static_cast<double>((aEntryList[ 0 ]->mnLength + aEntryList[ 1 ]->mnLength) / 2); // move entries 1..n-1 for( size_t i = 1, n = aEntryList.size()-1; i < n; ++i) { ImpDistributeEntry* pCurr = aEntryList[ i ]; ImpDistributeEntry* pNext = aEntryList[ i + 1 ]; - sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos; + sal_Int32 nDelta = static_cast<sal_Int32>(fStepStart + 0.5) - pCurr->mnPos; if( bUndo ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj)); pCurr->mpObj->Move(Size(0, nDelta)); - fStepStart += fStepWidth + (double)((pCurr->mnLength + pNext->mnLength) / 2); + fStepStart += fStepWidth + static_cast<double>((pCurr->mnLength + pNext->mnLength) / 2); } } else { // calculate distances sal_Int32 nHeight = aEntryList[ aEntryList.size() - 1 ]->mnPos - aEntryList[ 0 ]->mnPos; - double fStepWidth = (double)nHeight / (double)(aEntryList.size() - 1); - double fStepStart = (double)aEntryList[ 0 ]->mnPos; + double fStepWidth = static_cast<double>(nHeight) / static_cast<double>(aEntryList.size() - 1); + double fStepStart = static_cast<double>(aEntryList[ 0 ]->mnPos); fStepStart += fStepWidth; // move entries 1..n-1 for(size_t i = 1, n = aEntryList.size()-1; i < n; ++i) { ImpDistributeEntry* pCurr = aEntryList[ i ]; - sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos; + sal_Int32 nDelta = static_cast<sal_Int32>(fStepStart + 0.5) - pCurr->mnPos; if( bUndo ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj)); pCurr->mpObj->Move(Size(0, nDelta)); |