From 0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 12 Jan 2018 20:13:41 +0100 Subject: More loplugin:cstylecast: sw auto-rewrite with "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e --- sw/inc/htmltbl.hxx | 2 +- sw/inc/redline.hxx | 6 +++--- sw/inc/swtable.hxx | 2 +- sw/inc/viewsh.hxx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx index b344eed5d4c9..d2cdb61fec9c 100644 --- a/sw/inc/htmltbl.hxx +++ b/sw/inc/htmltbl.hxx @@ -432,7 +432,7 @@ inline void SwHTMLTableLayout::SetCell( std::unique_ptr p inline long SwHTMLTableLayout::GetBrowseWidthMin() const { - return (long)( (!m_nWidthOption || m_bPrcWidthOption) ? m_nMin : m_nRelTabWidth ); + return static_cast( (!m_nWidthOption || m_bPrcWidthOption) ? m_nMin : m_nRelTabWidth ); } void SwHTMLTableLayout::SetInhBorderWidths( sal_uInt16 nLeft, sal_uInt16 nRight ) diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 0ea5412a6592..2aefe871f750 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -140,7 +140,7 @@ public: { return !operator==( rCmp ); } RedlineType_t GetType() const - { return ((RedlineType_t)(eType & nsRedlineType_t::REDLINE_NO_FLAG_MASK)); } + { return static_cast(eType & nsRedlineType_t::REDLINE_NO_FLAG_MASK); } std::size_t GetAuthor() const { return nAuthor; } const OUString& GetComment() const { return sComment; } @@ -151,7 +151,7 @@ public: void SetTimeStamp( const DateTime& rDT ) { aStamp = rDT; } void SetAutoFormatFlag() - { eType = (RedlineType_t)(eType | nsRedlineType_t::REDLINE_FORM_AUTOFMT); } + { eType = static_cast(eType | nsRedlineType_t::REDLINE_FORM_AUTOFMT); } bool CanCombine( const SwRedlineData& rCmp ) const; // ExtraData gets copied, the pointer is therefore not taken over by @@ -221,7 +221,7 @@ public: const DateTime& GetTimeStamp( sal_uInt16 nPos = 0) const; RedlineType_t GetRealType( sal_uInt16 nPos = 0 ) const; RedlineType_t GetType( sal_uInt16 nPos = 0) const - { return ( (RedlineType_t)(GetRealType( nPos ) & nsRedlineType_t::REDLINE_NO_FLAG_MASK)); } + { return static_cast(GetRealType( nPos ) & nsRedlineType_t::REDLINE_NO_FLAG_MASK); } const OUString& GetComment( sal_uInt16 nPos = 0 ) const; void SetComment( const OUString& rS ) { pRedlineData->SetComment( rS ); } diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index bc9e2f219cc3..1d240de469ba 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -194,7 +194,7 @@ public: /// Set the new table style name for this table. void SetTableStyleName(const OUString& rName) { maTableStyleName = rName; } - sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), m_nRowsToRepeat ); } + sal_uInt16 GetRowsToRepeat() const { return std::min( static_cast(GetTabLines().size()), m_nRowsToRepeat ); } void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { m_nRowsToRepeat = nNumOfRows; } bool IsHeadline( const SwTableLine& rLine ) const; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 566653342451..e3329b4c931d 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -87,8 +87,8 @@ namespace vcl // Define for flags needed in ctor or layers below. // Currently the Preview flag is needed for DrawPage. -#define VSHELLFLAG_ISPREVIEW ((long)0x1) -#define VSHELLFLAG_SHARELAYOUT ((long)0x2) +#define VSHELLFLAG_ISPREVIEW (long(0x1)) +#define VSHELLFLAG_SHARELAYOUT (long(0x2)) typedef std::shared_ptr SwRootFramePtr; class SW_DLLPUBLIC SwViewShell : public sw::Ring -- cgit