diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:02:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:02:44 +0100 |
commit | 6feb524aaf58009a55ea4d4e660c09b67adf26fa (patch) | |
tree | e55ba1ae5eb40b05100884850c14858ad351eb84 /svtools | |
parent | d9d92d20fdc414c5956290c10c4d473dcb836ceb (diff) |
More loplugin:cstylecast: svtools
Change-Id: Ia9517b20d6579a77a81906aff16068b732ada878
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/apearcfg.cxx | 8 | ||||
-rw-r--r-- | svtools/source/config/miscopt.cxx | 12 | ||||
-rw-r--r-- | svtools/source/config/printoptions.cxx | 6 | ||||
-rw-r--r-- | svtools/source/contnr/svlbitm.cxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/calendar.cxx | 6 | ||||
-rw-r--r-- | svtools/source/filter/SvFilterOptionsDialog.cxx | 2 | ||||
-rw-r--r-- | svtools/source/graphic/grfcache.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/imagemgr.cxx | 2 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlsupp.cxx | 2 | ||||
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 12 |
11 files changed, 30 insertions, 30 deletions
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index e74cbe33ae84..b98a8cbad17e 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -67,7 +67,7 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() { short nTmp; if (*pValues >>= nTmp) - nDragMode = (DragMode)nTmp; + nDragMode = static_cast<DragMode>(nTmp); break; } case 1: bMenuMouseFollow = *o3tl::doAccess<bool>(*pValues); break; //"Menu/FollowMouse", @@ -75,7 +75,7 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() { short nTmp; if (*pValues >>= nTmp) - nSnapMode = (SnapType)nTmp; //"Dialog/MousePositioning", + nSnapMode = static_cast<SnapType>(nTmp); //"Dialog/MousePositioning", break; } case 3: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton", @@ -129,9 +129,9 @@ void SvtTabAppearanceCfg::ImplCommit() { switch(nProp) { - case 0: pValues[nProp] <<= (short)nDragMode; break; // "Window/Drag", + case 0: pValues[nProp] <<= static_cast<short>(nDragMode); break; // "Window/Drag", case 1: pValues[nProp] <<= bMenuMouseFollow; break; // "Menu/FollowMouse", - case 2: pValues[nProp] <<= (short)nSnapMode; break; // "Dialog/MousePositioning", + case 2: pValues[nProp] <<= static_cast<short>(nSnapMode); break; // "Dialog/MousePositioning", case 3: pValues[nProp] <<= static_cast<short>(nMiddleMouse); break; // "Dialog/MiddleMouseButton", #if defined( UNX ) case 4: pValues[nProp] <<= bFontAntialiasing; break; // "FontAntialising/Enabled", diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index c5b029d4c8bd..904b53f5cd41 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -305,7 +305,7 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() { OSL_FAIL("Wrong type of \"Misc\\SidebarIconSize\"!" ); } else - m_nSidebarIconSize = (ToolBoxButtonSize)nTmp; + m_nSidebarIconSize = static_cast<ToolBoxButtonSize>(nTmp); m_bIsSidebarIconSizeRO = seqRO[nProperty]; break; } @@ -317,7 +317,7 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() { OSL_FAIL("Wrong type of \"Misc\\NotebookbarIconSize\"!" ); } else - m_nNotebookbarIconSize = (ToolBoxButtonSize)nTmp; + m_nNotebookbarIconSize = static_cast<ToolBoxButtonSize>(nTmp); m_bIsNotebookbarIconSizeRO = seqRO[nProperty]; break; } @@ -457,7 +457,7 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames ) { OSL_FAIL("Wrong type of \"Misc\\SidebarIconSize\"!" ); } else - m_nSidebarIconSize = (ToolBoxButtonSize)nTmp; + m_nSidebarIconSize = static_cast<ToolBoxButtonSize>(nTmp); } break; case PROPERTYHANDLE_NOTEBOOKBARICONSIZE : { @@ -466,7 +466,7 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames ) { OSL_FAIL("Wrong type of \"Misc\\NotebookbarIconSize\"!" ); } else - m_nNotebookbarIconSize = (ToolBoxButtonSize)nTmp; + m_nNotebookbarIconSize = static_cast<ToolBoxButtonSize>(nTmp); } break; case PROPERTYHANDLE_TOOLBOXSTYLE : { @@ -628,14 +628,14 @@ void SvtMiscOptions_Impl::ImplCommit() case PROPERTYHANDLE_SIDEBARICONSIZE : { if ( !m_bIsSidebarIconSizeRO ) - seqValues[nProperty] <<= (sal_uInt16)m_nSidebarIconSize; + seqValues[nProperty] <<= static_cast<sal_uInt16>(m_nSidebarIconSize); break; } case PROPERTYHANDLE_NOTEBOOKBARICONSIZE : { if ( !m_bIsNotebookbarIconSizeRO ) - seqValues[nProperty] <<= (sal_uInt16)m_nNotebookbarIconSize; + seqValues[nProperty] <<= static_cast<sal_uInt16>(m_nNotebookbarIconSize); break; } diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index b11458694d40..c84b3f867cfd 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -648,12 +648,12 @@ void SvtBasePrintOptions::SetPDFAsStandardPrintJobFormat( bool bState ) void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const { rOptions.SetReduceTransparency( IsReduceTransparency() ); - rOptions.SetReducedTransparencyMode( (PrinterTransparencyMode) GetReducedTransparencyMode() ); + rOptions.SetReducedTransparencyMode( static_cast<PrinterTransparencyMode>(GetReducedTransparencyMode()) ); rOptions.SetReduceGradients( IsReduceGradients() ); - rOptions.SetReducedGradientMode( (PrinterGradientMode) GetReducedGradientMode() ); + rOptions.SetReducedGradientMode( static_cast<PrinterGradientMode>(GetReducedGradientMode()) ); rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() ); rOptions.SetReduceBitmaps( IsReduceBitmaps() ); - rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() ); + rOptions.SetReducedBitmapMode( static_cast<PrinterBitmapMode>(GetReducedBitmapMode()) ); rOptions.SetReducedBitmapResolution( aDPIArray[ std::min( static_cast<sal_uInt16>(GetReducedBitmapResolution()), sal_uInt16( DPI_COUNT - 1 ) ) ] ); rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() ); rOptions.SetConvertToGreyscales( IsConvertToGreyscales() ); diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 968dc5402ac4..710cce12b686 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -39,7 +39,7 @@ void SvLBoxButtonData::InitData( bool _bRadioBtn, const Control* pCtrl ) { nWidth = nHeight = 0; - aBmps.resize((int)SvBmp::STATICIMAGE+1); + aBmps.resize(int(SvBmp::STATICIMAGE)+1); bDataOk = false; pImpl->bDefaultImages = true; @@ -91,7 +91,7 @@ SvBmp SvLBoxButtonData::GetIndex( SvItemStateFlags nItemState ) void SvLBoxButtonData::SetWidthAndHeight() { - Size aSize = aBmps[(int)SvBmp::UNCHECKED].GetSizePixel(); + Size aSize = aBmps[int(SvBmp::UNCHECKED)].GetSizePixel(); nWidth = aSize.Width(); nHeight = aSize.Height(); bDataOk = true; diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 39ba9d6c611f..5f1c37606785 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1224,7 +1224,7 @@ nAction DragDropMode SvTreeListBox::NotifyStartDrag( TransferDataContainer&, SvTreeListEntry* ) { - return (DragDropMode)0xffff; + return DragDropMode(0xffff); } bool SvTreeListBox::NotifyAcceptDrop( SvTreeListEntry* ) diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index b558629551c8..8daacf652f71 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -756,14 +756,14 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) nDeltaX = nDayX + (nDay * mnDayWidth); ImplDrawDate(rRenderContext, nDeltaX, nDayY, nDay + aTempDate.GetDay(), aTempDate.GetMonth(), aTempDate.GetYear(), - (DayOfWeek)((nDay + static_cast<sal_uInt16>(eStartDay)) % 7), true, nToday); + static_cast<DayOfWeek>((nDay + static_cast<sal_uInt16>(eStartDay)) % 7), true, nToday); } } for (nDay = 1; nDay <= nDaysInMonth; nDay++) { nDeltaX = nDayX + (nDayIndex * mnDayWidth); ImplDrawDate(rRenderContext, nDeltaX, nDayY, nDay, nMonth, nYear, - (DayOfWeek)((nDayIndex + static_cast<sal_uInt16>(eStartDay)) % 7), + static_cast<DayOfWeek>((nDayIndex + static_cast<sal_uInt16>(eStartDay)) % 7), false, nToday); if (nDayIndex == 6) { @@ -785,7 +785,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) nDeltaX = nDayX + (nDayIndex * mnDayWidth); ImplDrawDate(rRenderContext, nDeltaX, nDayY, nDay, aTempDate.GetMonth(), aTempDate.GetYear(), - (DayOfWeek)((nDayIndex + static_cast<sal_uInt16>(eStartDay)) % 7), + static_cast<DayOfWeek>((nDayIndex + static_cast<sal_uInt16>(eStartDay)) % 7), true, nToday); if (nDayIndex == 6) { diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx index 163de06fb880..d132af8d0734 100644 --- a/svtools/source/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter/SvFilterOptionsDialog.cxx @@ -273,7 +273,7 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp aPropertyName = "Metric"; else aPropertyName = "NonMetric"; - meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM ); + meFieldUnit = static_cast<FieldUnit>(aConfigItem.ReadInt32( aPropertyName, FUNIT_CM )); } } diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 5a420941e187..a0fc0f09cf99 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -64,7 +64,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) { const Graphic& rGraphic = rObj.GetGraphic(); - mnID1 = ( (sal_uLong) rGraphic.GetType() ) << 28; + mnID1 = static_cast<sal_uLong>(rGraphic.GetType()) << 28; switch( rGraphic.GetType() ) { @@ -93,7 +93,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) { const BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - mnID1 |= ( ( ( (sal_uLong) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff ); + mnID1 |= ( ( ( static_cast<sal_uLong>(aBmpEx.GetTransparentType()) << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff ); mnID2 = aBmpEx.GetSizePixel().Width(); mnID3 = aBmpEx.GetSizePixel().Height(); mnID4 = rGraphic.GetChecksum(); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 908fb0f2d278..31357e2558c5 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -365,7 +365,7 @@ static SvImageId GetImageId_Impl( const INetURLObject& rObject, bool bDetectFold return nImage; } else if ( aType == "image" ) - nImage = (SvImageId)aURLPath.getToken( 1, '/' ).toInt32(); + nImage = static_cast<SvImageId>(aURLPath.getToken( 1, '/' ).toInt32()); } else { diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index bda1cd41059c..6e4f4ffb81cc 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -30,7 +30,7 @@ static HTMLOptionEnum<HTMLScriptLanguage> const aScriptLangOptEnums[] = { OOO_STRING_SVTOOLS_HTML_LG_javascript, HTMLScriptLanguage::JavaScript }, { OOO_STRING_SVTOOLS_HTML_LG_javascript11, HTMLScriptLanguage::JavaScript }, { OOO_STRING_SVTOOLS_HTML_LG_livescript, HTMLScriptLanguage::JavaScript }, - { nullptr, (HTMLScriptLanguage)0 } + { nullptr, HTMLScriptLanguage(0) } }; void HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBaseURL, diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 290bfaab0aac..c32b067ea905 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -64,7 +64,7 @@ static HTMLOptionEnum<HTMLInputType> const aInputTypeOptEnums[] = { OOO_STRING_SVTOOLS_HTML_IT_image, HTMLInputType::Image }, { OOO_STRING_SVTOOLS_HTML_IT_reset, HTMLInputType::Reset }, { OOO_STRING_SVTOOLS_HTML_IT_button, HTMLInputType::Button }, - { nullptr, (HTMLInputType)0 } + { nullptr, HTMLInputType(0) } }; // <TABLE FRAME=xxx> @@ -79,7 +79,7 @@ static HTMLOptionEnum<HTMLTableFrame> const aTableFrameOptEnums[] = { OOO_STRING_SVTOOLS_HTML_TF_vsides, HTMLTableFrame::VSides }, { OOO_STRING_SVTOOLS_HTML_TF_box, HTMLTableFrame::Box }, { OOO_STRING_SVTOOLS_HTML_TF_border, HTMLTableFrame::Box }, - { nullptr, (HTMLTableFrame)0 } + { nullptr, HTMLTableFrame(0) } }; // <TABLE RULES=xxx> @@ -90,7 +90,7 @@ static HTMLOptionEnum<HTMLTableRules> const aTableRulesOptEnums[] = { OOO_STRING_SVTOOLS_HTML_TR_rows, HTMLTableRules::Rows }, { OOO_STRING_SVTOOLS_HTML_TR_cols, HTMLTableRules::Cols }, { OOO_STRING_SVTOOLS_HTML_TR_all, HTMLTableRules::All }, - { nullptr, (HTMLTableRules)0 } + { nullptr, HTMLTableRules(0) } }; @@ -1081,7 +1081,7 @@ HtmlTokenId HTMLParser::GetNextToken_() if( nRet >= HtmlTokenId::ONOFF_START ) { // and there is an off token, return off token instead - nRet = (HtmlTokenId)((int)nRet + 1); + nRet = static_cast<HtmlTokenId>(static_cast<int>(nRet) + 1); } else if( HtmlTokenId::LINEBREAK!=nRet ) { @@ -1152,7 +1152,7 @@ HtmlTokenId HTMLParser::GetNextToken_() // which lead to fdo#56772. if ((nRet >= HtmlTokenId::ONOFF_START) && aToken.endsWith("/")) { - mnPendingOffToken = (HtmlTokenId)((int)nRet + 1); // HtmlTokenId::<TOKEN>_ON -> HtmlTokenId::<TOKEN>_OFF + mnPendingOffToken = static_cast<HtmlTokenId>(static_cast<int>(nRet) + 1); // HtmlTokenId::<TOKEN>_ON -> HtmlTokenId::<TOKEN>_OFF aToken = aToken.replaceAt( aToken.getLength()-1, 1, ""); // remove trailing '/' } if( sal_Unicode(EOF) == nNextCh && rInput.eof() ) @@ -1873,7 +1873,7 @@ static HTMLOptionEnum<HtmlMeta> const aHTMLMetaNameTable[] = { OOO_STRING_SVTOOLS_HTML_META_refresh, HtmlMeta::Refresh }, { OOO_STRING_SVTOOLS_HTML_META_sdendnote, HtmlMeta::SDEndnote }, { OOO_STRING_SVTOOLS_HTML_META_sdfootnote, HtmlMeta::SDFootnote }, - { nullptr, (HtmlMeta)0 } + { nullptr, HtmlMeta(0) } }; |