diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-07-24 16:19:36 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-07-26 14:25:28 +0200 |
commit | 20d7f29eabd72777ddbded0f1f11af40695da542 (patch) | |
tree | 18f8a148cb9020e0e798e810513a64e3c09ebc7f /sw | |
parent | f869a075e6db524adf1eb5ddf586ed1d320332aa (diff) |
Remove unneeded cast and use a temporary for repeated ones
Change-Id: I8f8fb4508cb7d093c835e1f00b0d6056c502e378
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index 006ff9798ed1..e18f89331639 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -140,23 +140,24 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, } nFac = std::max( long( MINZOOM ), nFac ); + const sal_uInt16 nZoomFac = static_cast<sal_uInt16>(nFac); SwViewOption aOpt( *pOpt ); if ( !GetViewFrame()->GetFrame().IsInPlace() ) { //Update MasterUsrPrefs and after that update the ViewOptions of the current View. if ( !bViewOnly && - (sal_uInt16(nFac) != pUsrPref->GetZoom() || - sal_uInt8 (eZoomType) != pUsrPref->GetZoomType()) ) + (nZoomFac != pUsrPref->GetZoom() || + eZoomType != pUsrPref->GetZoomType()) ) { - pUsrPref->SetZoom(sal_uInt16(nFac)); + pUsrPref->SetZoom(nZoomFac); pUsrPref->SetZoomType(eZoomType); SW_MOD()->ApplyUsrPref(*pUsrPref, 0, 0); pUsrPref->SetModified(); } - if ( pOpt->GetZoom() != (sal_uInt16) nFac ) + if ( pOpt->GetZoom() != nZoomFac ) { - aOpt.SetZoom ( sal_uInt16(nFac) ); + aOpt.SetZoom(nZoomFac); aOpt.SetReadonly(pOpt->IsReadonly()); m_pWrtShell->ApplyViewOptions( aOpt ); } @@ -185,9 +186,9 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, ((SwViewOption*)m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType ); CalcVisArea( rEditSize ); // for the recalculation of the viewable area } - else if ( sal_uInt16(nFac) != pOpt->GetZoom() ) + else if ( nZoomFac != pOpt->GetZoom() ) { - aOpt.SetZoom ( sal_uInt16(nFac) ); + aOpt.SetZoom( nZoomFac ); m_pWrtShell->ApplyViewOptions( aOpt ); } |