summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-23 09:47:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-23 09:48:10 +0000
commited76d1d3504c92bff6bb3e6417e4440572fcd959 (patch)
tree6d06b4a20bef5acf0c1a4118685f09acdd27fbb7 /sw
parenta61c4ae9cef23a53ea88f957e090bd5ee9b28ca6 (diff)
loplugins:redundantcast teach it about c-style typedef casts
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c Reviewed-on: https://gerrit.libreoffice.org/35558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docbasic.cxx2
-rw-r--r--sw/source/core/doc/htmltbl.cxx8
-rw-r--r--sw/source/core/edit/editsh.cxx4
-rw-r--r--sw/source/core/inc/swfont.hxx2
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/unocore/unoidx.cxx2
-rw-r--r--sw/source/core/unocore/unosett.cxx2
-rw-r--r--sw/source/filter/html/htmlform.cxx18
-rw-r--r--sw/source/filter/html/htmlnumreader.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx14
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx4
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx4
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx4
-rw-r--r--sw/source/uibase/inc/toxmgr.hxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx2
16 files changed, 37 insertions, 37 deletions
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index e513260595c6..dd27799b79f2 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -60,7 +60,7 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs )
pUnoArgs[i] <<= (sal_Int16)pVar->GetUShort();
break;
case SbxLONG:
- pUnoArgs[i] <<= (sal_Int32)pVar->GetLong();
+ pUnoArgs[i] <<= pVar->GetLong();
break;
default:
pUnoArgs[i].clear();
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 3009976b54ca..de8e83857a08 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1256,8 +1256,8 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
(sal_uInt16)((nColMinD * m_nRelTabWidth) / m_nMin) );
}
- nAbs = nAbs + (sal_uInt16)pColumn->GetAbsColWidth();
- nRel = nRel + (sal_uInt16)pColumn->GetRelColWidth();
+ nAbs = nAbs + pColumn->GetAbsColWidth();
+ nRel = nRel + pColumn->GetRelColWidth();
}
pColumn = GetColumn( m_nCols-1 );
pColumn->SetAbsColWidth( nAbsTabWidth - nAbs );
@@ -1293,8 +1293,8 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
(sal_uInt16)((((nColMinD-nRealColMin) * nDistRel) / nDistMin) + nRealColMin) );
}
- nAbs = nAbs + (sal_uInt16)pColumn->GetAbsColWidth();
- nRel = nRel + (sal_uInt16)pColumn->GetRelColWidth();
+ nAbs = nAbs + pColumn->GetAbsColWidth();
+ nRel = nRel + pColumn->GetRelColWidth();
}
pColumn = GetColumn( m_nCols-1 );
pColumn->SetAbsColWidth( nAbsTabWidth - nAbs );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 27f439796fc6..4772f2d756d0 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -957,9 +957,9 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData )
ShowCursor();
const sal_Int32 nDiff = nNewCursorPos - rPos.nContent.GetIndex();
if( 0 > nDiff )
- Left( (sal_Int32)-nDiff, CRSR_SKIP_CHARS );
+ Left( -nDiff, CRSR_SKIP_CHARS );
else if( 0 < nDiff )
- Right( (sal_Int32)nDiff, CRSR_SKIP_CHARS );
+ Right( nDiff, CRSR_SKIP_CHARS );
SetOverwriteCursor( rData.IsCursorOverwrite() );
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 39a302fc6cde..faf5a8bc5adb 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -795,7 +795,7 @@ inline void SwSubFont::SetLanguage( LanguageType eNewLang )
{
m_pMagic = nullptr;
if( eNewLang == LANGUAGE_SYSTEM )
- eNewLang = (LanguageType)GetAppLanguage();
+ eNewLang = GetAppLanguage();
SvxFont::SetLanguage( eNewLang );
}
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 4fe42f288f1d..2f4a79fa1afa 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1602,7 +1602,7 @@ sal_Int32 SwTextFormatInfo::ScanPortionEnd( const sal_Int32 nStart,
sal_Int32 i = nStart;
// Used for decimal tab handling:
- const sal_Unicode cTabDec = GetLastTab() ? (sal_Unicode)GetTabDecimal() : 0;
+ const sal_Unicode cTabDec = GetLastTab() ? GetTabDecimal() : 0;
const sal_Unicode cThousandSep = ',' == cTabDec ? '.' : ',';
// #i45951# German (Switzerland) uses ' as thousand separator
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 8ddf22514b49..cb26ad4a6d1b 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -427,7 +427,7 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
: SwClient(const_cast<SwModify*>(static_cast<SwModify const *>(pTyp)))
, m_aForm(rForm)
, m_aTitle(rTitle)
- , m_eLanguage((LanguageType)::GetAppLanguage())
+ , m_eLanguage(::GetAppLanguage())
, m_nCreateType(nCreaType)
, m_nOLEOptions(SwTOOElements::NONE)
, m_eCaptionDisplay(CAPTION_COMPLETE)
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 9253c31ec499..ee0a34f6fefa 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -3049,7 +3049,7 @@ SwXDocumentIndex::TokenAccess_Impl::getByIndex(sal_Int32 nIndex)
sal_Int32 nPos = (convertTwipToMm100(aToken.nTabStopPosition));
if(nPos < 0)
nPos = 0;
- pArr[1].Value <<= (sal_Int32)nPos;
+ pArr[1].Value <<= nPos;
}
pArr[2].Name = "TabStopFillCharacter";
pArr[2].Value <<= OUString(aToken.cTabFillChar);
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index a93842984e58..a15c03043c4d 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -2048,7 +2048,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
}
}
sal_Int16 eOrient = pSetVOrient ?
- (sal_Int16)pSetVOrient->GetVertOrient() : text::VertOrientation::NONE;
+ pSetVOrient->GetVertOrient() : text::VertOrientation::NONE;
aFormat.SetGraphicBrush( pSetBrush, pSetSize, text::VertOrientation::NONE == eOrient ? nullptr : &eOrient );
}
}
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 110a67c201e6..67dc1883d838 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -1141,11 +1141,11 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
nVertOri = text::VertOrientation::NONE;
break;
}
- aTmp <<= (sal_Int16)nVertOri ;
+ aTmp <<= nVertOri ;
xShapePropSet->setPropertyValue("VertOrient", aTmp );
}
- aTmp <<= (sal_Int16)nAnchorType ;
+ aTmp <<= nAnchorType ;
xShapePropSet->setPropertyValue("AnchorType", aTmp );
if( text::TextContentAnchorType_AT_PAGE == nAnchorType )
@@ -1169,17 +1169,17 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
{
aTmp <<= (sal_Int16)text::HoriOrientation::NONE;
xShapePropSet->setPropertyValue("HoriOrient", aTmp );
- aTmp <<= (sal_Int32)nXPos ;
+ aTmp <<= nXPos ;
xShapePropSet->setPropertyValue("HoriOrientPosition", aTmp );
aTmp <<= (sal_Int16)text::VertOrientation::NONE;
xShapePropSet->setPropertyValue("VertOrient", aTmp );
- aTmp <<= (sal_Int32)nYPos ;
+ aTmp <<= nYPos ;
xShapePropSet->setPropertyValue("VertOrientPosition", aTmp );
}
if( bSetSurround )
{
- aTmp <<= (sal_Int16)nSurround ;
+ aTmp <<= nSurround ;
xShapePropSet->setPropertyValue("Surround", aTmp );
}
@@ -1621,7 +1621,7 @@ void SwHTMLParser::InsertInput()
{
if( nTabIndex >= TABINDEX_MIN && nTabIndex <= TABINDEX_MAX )
{
- aTmp <<= (sal_Int16) (sal_Int16)nTabIndex ;
+ aTmp <<= (sal_Int16)nTabIndex ;
xPropSet->setPropertyValue("TabIndex", aTmp );
}
@@ -1655,7 +1655,7 @@ void SwHTMLParser::InsertInput()
// vorhergehenden Gruppe gehoert.
if( HTMLInputType::Checkbox == eType )
{
- aTmp <<= (sal_Int16) nChecked ;
+ aTmp <<= nChecked ;
xPropSet->setPropertyValue("DefaultState", aTmp );
}
@@ -1734,7 +1734,7 @@ void SwHTMLParser::InsertInput()
xPropSet->setPropertyValue("DefaultText", aTmp );
if( nMaxLen != 0 )
{
- aTmp <<= (sal_Int16) nMaxLen ;
+ aTmp <<= nMaxLen ;
xPropSet->setPropertyValue("MaxTextLen", aTmp );
}
}
@@ -1833,7 +1833,7 @@ void SwHTMLParser::InsertInput()
if( HTMLInputType::Radio == eType )
{
- aTmp <<= (sal_Int16) nChecked ;
+ aTmp <<= nChecked ;
xPropSet->setPropertyValue("DefaultState", aTmp );
}
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index 6704369dc64f..ab291b56925d 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -293,7 +293,7 @@ void SwHTMLParser::NewNumBulList( int nToken )
}
if( aPropInfo.m_bBullet )
{
- aNumFormat.SetBulletChar( (sal_Unicode)aPropInfo.m_cBulletChar );
+ aNumFormat.SetBulletChar( aPropInfo.m_cBulletChar );
bChangeNumFormat = true;
}
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 0d2e021545a7..8ee1a2fd38d3 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2793,7 +2793,7 @@ void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop)
else
{
m_aTabStop.append(OOO_STRING_SVTOOLS_RTF_DEFTAB);
- m_aTabStop.append((sal_Int32)rTabStop[0].GetTabPos());
+ m_aTabStop.append(rTabStop[0].GetTabPos());
}
}
}
@@ -2859,11 +2859,11 @@ void RtfAttributeOutput::ParaNumRule_Impl(const SwTextNode* pTextNd, sal_Int32 n
{
m_aStyles.append((sal_Int32)8);
m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SOUTLVL);
- m_aStyles.append((sal_Int32)nLvl);
+ m_aStyles.append(nLvl);
m_aStyles.append('}');
}
else
- m_aStyles.append((sal_Int32)nLvl);
+ m_aStyles.append(nLvl);
}
else
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB "}");
@@ -3712,13 +3712,13 @@ static OString ExportPICT(const SwFlyFrameFormat* pFlyFrameFormat, const Size& r
aRet.append((sal_Int32)((100 * rRendered.Height()) / nYCroppedSize));
aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPL);
- aRet.append((sal_Int32)rCr.GetLeft());
+ aRet.append(rCr.GetLeft());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPR);
- aRet.append((sal_Int32)rCr.GetRight());
+ aRet.append(rCr.GetRight());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPT);
- aRet.append((sal_Int32)rCr.GetTop());
+ aRet.append(rCr.GetTop());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPB);
- aRet.append((sal_Int32)rCr.GetBottom());
+ aRet.append(rCr.GetBottom());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICW);
aRet.append((sal_Int32)rMapped.Width());
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index f79de76257a1..21a60dabdfdd 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1333,11 +1333,11 @@ void WW8AttributeOutput::SectionLineNumbering( sal_uLong nRestartNo, const SwLin
{
// sprmSNLnnMod - activate Line Numbering and define Modulo
SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::sprmSNLnnMod );
- SwWW8Writer::InsUInt16( *m_rWW8Export.pO, (sal_uInt16)rLnNumInfo.GetCountBy() );
+ SwWW8Writer::InsUInt16( *m_rWW8Export.pO, rLnNumInfo.GetCountBy() );
// sprmSDxaLnn - xPosition of Line Number
SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::sprmSDxaLnn );
- SwWW8Writer::InsUInt16( *m_rWW8Export.pO, (sal_uInt16)rLnNumInfo.GetPosFromLeft() );
+ SwWW8Writer::InsUInt16( *m_rWW8Export.pO, rLnNumInfo.GetPosFromLeft() );
// sprmSLnc - restart number: 0 per page, 1 per section, 2 never restart
if ( nRestartNo || !rLnNumInfo.IsRestartEachPage() )
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 5c28432bf060..97c8275a2f58 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -284,10 +284,10 @@ bool SvXMLImportItemMapper::PutXMLValue(
switch( nMemberId )
{
case MID_L_MARGIN:
- rLRSpace.SetTextLeft( (sal_Int32)nAbs, (sal_uInt16)nProp );
+ rLRSpace.SetTextLeft( nAbs, (sal_uInt16)nProp );
break;
case MID_R_MARGIN:
- rLRSpace.SetRight( (sal_Int32)nAbs, (sal_uInt16)nProp );
+ rLRSpace.SetRight( nAbs, (sal_uInt16)nProp );
break;
}
}
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 68a70d0fcf75..253872f847d9 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -339,9 +339,9 @@ static SwFieldGroupRgn const aWebRanges[] =
};
if (bHtmlMode)
- return aWebRanges[(sal_uInt16)nGrpId];
+ return aWebRanges[nGrpId];
else
- return aRanges[(sal_uInt16)nGrpId];
+ return aRanges[nGrpId];
}
// determine GroupId
diff --git a/sw/source/uibase/inc/toxmgr.hxx b/sw/source/uibase/inc/toxmgr.hxx
index dc173313a62c..65dd2e5ebe48 100644
--- a/sw/source/uibase/inc/toxmgr.hxx
+++ b/sw/source/uibase/inc/toxmgr.hxx
@@ -74,7 +74,7 @@ public:
m_nContent(SwTOXElement::Mark | SwTOXElement::OutlineLevel),
m_nIndexOptions(SwTOIOptions::SameEntry|SwTOIOptions::FF|SwTOIOptions::CaseSensitive),
m_nOLEOptions(SwTOOElements::NONE),
- m_eLanguage((LanguageType)::GetAppLanguage()),
+ m_eLanguage(::GetAppLanguage()),
m_eCaptionDisplay(CAPTION_COMPLETE),
m_nLevel(MAXLEVEL),
m_bFromObjectNames(false),
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index c4bc01bc5498..558350d63e10 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -923,7 +923,7 @@ void SwView::Execute(SfxRequest &rReq)
{
ScopedVclPtrInstance< SwGotoPageDlg > aDlg (&GetViewFrame()->GetWindow(), &GetViewFrame()->GetBindings());
if(aDlg->Execute() == RET_OK)
- GetWrtShell().GotoPage((sal_uInt16)aDlg->GetPageSelection(), true);
+ GetWrtShell().GotoPage(aDlg->GetPageSelection(), true);
}
break;
case FN_EDIT_CURRENT_TOX: