diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-11 17:36:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-11 17:36:30 +0100 |
commit | a31b7a941eee06efaa92a54a49c955c914fd20aa (patch) | |
tree | caf9278892179474d0eb683de30ce4732c10412b | |
parent | eaa9142fa7a107f5f47d547f4807caa7e4c99b1e (diff) |
loplugin:redundantcast: sw
(after a to-be-committed improved loplugin:cstylecast would have rewritten the
C-style casts into static_casts)
Change-Id: If1bdd1a1b03fd0f705e1167c3ca8139799350f20
-rw-r--r-- | sw/source/core/fields/cellfml.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/usrfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaparagraphformat.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageMarginControl.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/utlui/attrdesc.cxx | 2 |
10 files changed, 13 insertions, 14 deletions
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index f4a30868686b..ea2a4eaef9ca 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -649,7 +649,7 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTa // JP 16.02.99: SplitMergeBoxNm take care of the name themself // JP 22.02.99: Linux compiler needs cast // JP 28.06.99: rel. BoxName has no preceding tablename! - if( fnFormula != (FnScanFormula)&SwTableFormula::SplitMergeBoxNm_ && + if( fnFormula != &SwTableFormula::SplitMergeBoxNm_ && m_sFormula.getLength()>(nStt+1) && cRelIdentifier != m_sFormula[nStt+1] && (nSeparator = m_sFormula.indexOf( '.', nStt ))>=0 && nSeparator < nEnd ) @@ -662,7 +662,7 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTa sTableNm = sTableNm.copy( 0, nSeparator - nStt ); // when creating a formula the table name is unwanted - if( fnFormula != (FnScanFormula)&SwTableFormula::MakeFormula_ ) + if( fnFormula != &SwTableFormula::MakeFormula_ ) aStr += sTableNm; nStt = nSeparator; diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index 845d02de6582..061bb5cbb72c 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -280,7 +280,7 @@ bool SwUserFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const switch( nWhichId ) { case FIELD_PROP_DOUBLE: - rAny <<= (double) nValue; + rAny <<= nValue; break; case FIELD_PROP_PAR2: rAny <<= aContent; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 5aefbf9acb11..ffadc4a88d86 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -2497,7 +2497,7 @@ Any SwXTextColumns::getPropertyValue( const OUString& rPropertyName ) aRet <<= nSepLineHeightRelative; break; case WID_TXTCOL_LINE_ALIGN: - aRet <<= (style::VerticalAlignment)nSepLineVertAlign; + aRet <<= nSepLineVertAlign; break; case WID_TXTCOL_LINE_IS_ON: aRet <<= bSepLineIsOn; diff --git a/sw/source/ui/vba/vbaparagraphformat.cxx b/sw/source/ui/vba/vbaparagraphformat.cxx index 0e5c8f50ef64..33df1d9bff40 100644 --- a/sw/source/ui/vba/vbaparagraphformat.cxx +++ b/sw/source/ui/vba/vbaparagraphformat.cxx @@ -54,7 +54,7 @@ sal_Int32 SAL_CALL SwVbaParagraphFormat::getAlignment() void SAL_CALL SwVbaParagraphFormat::setAlignment( sal_Int32 _alignment ) { - style::ParagraphAdjust aParaAdjust = ( style::ParagraphAdjust ) getOOoAlignment( _alignment ); + style::ParagraphAdjust aParaAdjust = getOOoAlignment( _alignment ); mxParaProps->setPropertyValue("ParaAdjust", uno::makeAny( aParaAdjust ) ); } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index c414b3c05368..48fca81e24ec 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -689,7 +689,7 @@ sal_uInt16 SwDocShell::Edit( else nMask = SFXSTYLEBIT_USERDEF; - pStyle = &m_xBasePool->Make( rName, (SfxStyleFamily)nFamily, nMask ); + pStyle = &m_xBasePool->Make( rName, nFamily, nMask ); // set the current one as Parent SwDocStyleSheet* pDStyle = static_cast<SwDocStyleSheet*>(pStyle); @@ -781,7 +781,7 @@ sal_uInt16 SwDocShell::Edit( } else { - pStyle = m_xBasePool->Find( rName, (SfxStyleFamily)nFamily ); + pStyle = m_xBasePool->Find( rName, nFamily ); SAL_WARN_IF( !pStyle, "sw.ui", "Style not found" ); } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 748c4b2136fe..872ad7b79653 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -824,7 +824,7 @@ static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView // to the OOo setting or the system setting explicitly // and/or a better handling of the script type. i18n::UnicodeScript eType = !rInBuffer.isEmpty() ? - (i18n::UnicodeScript)GetAppCharClass().getScript( rInBuffer, 0 ) : + GetAppCharClass().getScript( rInBuffer, 0 ) : i18n::UnicodeScript_kScriptCount; bool bSystemIsNonLatin = false; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 6275fc7f9421..dd62e7aff9ff 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -803,7 +803,7 @@ ASK_ESCAPE: (SID_TEXTDIRECTION_TOP_TO_BOTTOM == nSlotId); else { - text::WritingMode eMode = (text::WritingMode) + text::WritingMode eMode = aEditAttr.Get( SDRATTR_TEXTDIRECTION ).GetValue(); if( nSlotId == SID_TEXTDIRECTION_LEFT_TO_RIGHT ) diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 11449958ec52..ac6f5556e6db 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -262,8 +262,8 @@ void PageMarginControl::SetMetricFieldMaxValues( const Size& rPageSize ) const long nMT = m_pTopMarginEdit->Denormalize( m_pTopMarginEdit->GetValue( FUNIT_TWIP ) ); const long nMB = m_pBottomMarginEdit->Denormalize( m_pBottomMarginEdit->GetValue( FUNIT_TWIP ) ); - const long nPH = LogicToLogic( rPageSize.Height(), (MapUnit)m_eUnit, MapUnit::MapTwip ); - const long nPW = LogicToLogic( rPageSize.Width(), (MapUnit)m_eUnit, MapUnit::MapTwip ); + const long nPH = LogicToLogic( rPageSize.Height(), m_eUnit, MapUnit::MapTwip ); + const long nPW = LogicToLogic( rPageSize.Width(), m_eUnit, MapUnit::MapTwip ); // Left long nMax = nPW - nMR - MINBODY; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 7a53443d5d2a..8bdf70217905 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -2305,8 +2305,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) case SID_ATTR_PAGE_BITMAP: { SfxItemSet aSet = rDesc.GetMaster().GetAttrSet(); - drawing::FillStyle eXFS = (drawing::FillStyle) - aSet.GetItem(XATTR_FILLSTYLE)->GetValue(); + drawing::FillStyle eXFS = aSet.GetItem(XATTR_FILLSTYLE)->GetValue(); XFillStyleItem aFillStyleItem( eXFS ); aFillStyleItem.SetWhich( SID_ATTR_PAGE_FILLSTYLE ); rSet.Put(aFillStyleItem); diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx index a2d027240a4e..5f9cbf1369a1 100644 --- a/sw/source/uibase/utlui/attrdesc.cxx +++ b/sw/source/uibase/utlui/attrdesc.cxx @@ -302,7 +302,7 @@ bool SwFormatSurround::GetPresentation ) const { const char* pId = nullptr; - switch ( (css::text::WrapTextMode)GetValue() ) + switch ( GetValue() ) { case css::text::WrapTextMode_NONE: pId = STR_SURROUND_NONE; |