diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-05 15:16:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 09:21:58 +0000 |
commit | 0c82dff153d92150729815b919854a9a350aa031 (patch) | |
tree | 9bda3cba13d9534460b2fe7919b00009e8ffd425 | |
parent | 9458ce11084579b020650fecb1165052c16ee556 (diff) |
loplugin:singlevalfields
Change-Id: Ia681765aa1da5c80a3dbe91b7376af841a9c9ec1
Reviewed-on: https://gerrit.libreoffice.org/36145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 7 | ||||
-rw-r--r-- | compilerplugins/clang/singlevalfields.cxx | 13 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 8 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 1 | ||||
-rw-r--r-- | include/filter/msfilter/msdffimp.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdetc.hxx | 3 | ||||
-rw-r--r-- | include/vcl/status.hxx | 1 | ||||
-rw-r--r-- | oox/inc/drawingml/table/tableproperties.hxx | 30 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablecontext.cxx | 13 | ||||
-rw-r--r-- | oox/source/drawingml/table/tableproperties.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx | 1 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimpit.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 6 |
17 files changed, 47 insertions, 58 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 8e9e47025ca4..6aafbc0fa370 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -349,7 +349,8 @@ private: public: BasicLibInfo(); - bool& IsReference() { return bReference; } + bool IsReference() const { return bReference; } + void SetReference(bool b) { bReference = b; } bool IsExtern() const { return aStorageName != szImbedded; } @@ -436,7 +437,7 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) { bool bReferenz; rSStream.ReadCharAsBool( bReferenz ); - pInfo->IsReference() = bReferenz; + pInfo->SetReference(bReferenz); } rSStream.Seek( nEndPos ); @@ -1081,7 +1082,7 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const OUString& rLibName, { pLibInfo->GetLib()->SetModified( false ); // Don't save in this case pLibInfo->SetRelStorageName( OUString() ); - pLibInfo->IsReference() = true; + pLibInfo->SetReference(true); } else { diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx index c858954745f9..e096b7f96178 100644 --- a/compilerplugins/clang/singlevalfields.cxx +++ b/compilerplugins/clang/singlevalfields.cxx @@ -465,21 +465,16 @@ std::string SingleValFields::getExprValue(const Expr* arg) if (!arg) return "?"; arg = arg->IgnoreParenCasts(); - // workaround bug in clang - if (isa<ParenListExpr>(arg)) - return "?"; // ignore this, it seems to trigger an infinite recursion - if (isa<UnaryExprOrTypeTraitExpr>(arg)) { + if (isa<UnaryExprOrTypeTraitExpr>(arg)) + return "?"; + if (arg->isValueDependent()) return "?"; - } APSInt x1; if (arg->EvaluateAsInt(x1, compiler.getASTContext())) - { return x1.toString(10); - } - if (isa<CXXNullPtrLiteralExpr>(arg)) { + if (isa<CXXNullPtrLiteralExpr>(arg)) return "0"; - } return "?"; } diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index b99c5e2a3bef..a31eaefc5739 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -420,7 +420,7 @@ public: Size& GetSize() { return aOutSz; } const Size& GetSize() const { return aOutSz; } - PortionKind& GetKind() { return nKind; } + void SetKind(PortionKind n) { nKind = n; } PortionKind GetKind() const { return nKind; } void SetRightToLeftLevel( sal_uInt8 n ) { nRightToLeftLevel = n; } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ba3520c00572..4e656233dac0 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -995,7 +995,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) aCurrentTab.nTabPortion = nTmpPortion; } - pPortion->GetKind() = PortionKind::TAB; + pPortion->SetKind(PortionKind::TAB); pPortion->SetExtraValue( aCurrentTab.aTabStop.GetFill() ); pPortion->GetSize().Width() = aCurrentTab.nTabPos - (nTmpWidth+nStartX); @@ -1030,7 +1030,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pPortion->GetSize().Width() = 0; bEOL = true; bLineBreak = true; - pPortion->GetKind() = PortionKind::LINEBREAK; + pPortion->SetKind( PortionKind::LINEBREAK ); bCompressedChars = false; EditLine::CharPosArrayType& rArray = pLine->GetCharPosArray(); size_t nPos = nTmpPos - pLine->GetStart(); @@ -1080,7 +1080,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) EditLine::CharPosArrayType& rArray = pLine->GetCharPosArray(); size_t nPos = nTmpPos - pLine->GetStart(); rArray.insert(rArray.begin()+nPos, pPortion->GetSize().Width()); - pPortion->GetKind() = cChar ? PortionKind::TEXT : PortionKind::FIELD; + pPortion->SetKind( cChar ? PortionKind::TEXT : PortionKind::FIELD ); // If this is the first token on the line, // and nTmpWidth > aPaperSize.Width, => infinite loop! if ( ( nTmpWidth >= nXWidth ) && ( nTmpPortion == pLine->GetStartPortion() ) ) @@ -2018,7 +2018,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te { // A portion for inserting the separator ... TextPortion* pHyphPortion = new TextPortion( 0 ); - pHyphPortion->GetKind() = PortionKind::HYPHENATOR; + pHyphPortion->SetKind( PortionKind::HYPHENATOR ); OUString aHyphText(CH_HYPH); if ( (cAlternateReplChar || cAlternateExtraChar) && bAltFullRight ) // alternation after the break doesn't supported { diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 02c01d70cca3..e8bc66a8372d 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -5524,7 +5524,6 @@ void SvxMSDffManager::StoreShapeOrder(sal_uLong nId, rOrder.nTxBxComp = nTxBx; rOrder.pObj = pObject; rOrder.pFly = pFly; - rOrder.nHdFtSection = 0; } } } diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx index c8f6ba051333..92a7b9843052 100644 --- a/include/filter/msfilter/msdffimp.hxx +++ b/include/filter/msfilter/msdffimp.hxx @@ -764,15 +764,13 @@ struct SvxMSDffShapeOrder SwFlyFrameFormat* pFly; ///< format of frame that was inserted as a replacement ///< for a Sdr-Text object in Writer - needed for ///< chaining! - short nHdFtSection; ///< used by Writer to find out if linked frames are in - ///< the same header or footer of the same section SdrObject* pObj; ///< pointer to the draw object (or NULL if not used) // Approach: In the Ctor of SvxMSDffManager only the shape ids are stored in // the shape order array. The Text-Box number and the object // pointer are only stored if the shape is really imported. explicit SvxMSDffShapeOrder( sal_uLong nId ): - nShapeId( nId ), nTxBxComp( 0 ), pFly( nullptr ), nHdFtSection( 0 ), pObj( nullptr ){} + nShapeId( nId ), nTxBxComp( 0 ), pFly( nullptr ), pObj( nullptr ){} bool operator<( const SvxMSDffShapeOrder& rEntry ) const { return (nTxBxComp < rEntry.nTxBxComp); } diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index 0ed14863454c..021d61077dc2 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -66,7 +66,6 @@ class SVX_DLLPUBLIC SdrEngineDefaults { friend class SdrAttrObj; Color aFontColor; - size_t nFontHeight; Fraction aMapFraction; private: @@ -82,7 +81,7 @@ public: // see below for further details). The default setting 847/100mm corresponds to about // 24 Point. If e.g. one would use Twips (SetMapUnit(MapUnit::MapTwip)) (20 Twip = 1 Point) // instead, one would need to set the font height to 480, in order to get a 24 Point height. - static size_t GetFontHeight() { return GetDefaults().nFontHeight; } + static size_t GetFontHeight() { return 847; } // The MapMode is needed for the global Outliner. // Incidentally, every newly instantiated SdrModel is assigned this MapMode by default. diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx index 1b27844b318b..362280e28de5 100644 --- a/include/vcl/status.hxx +++ b/include/vcl/status.hxx @@ -70,7 +70,6 @@ private: long mnDY; long mnCalcHeight; long mnTextY; - long mnItemY; sal_uInt16 mnCurItemId; sal_uInt16 mnPercent; sal_uInt16 mnPercentCount; diff --git a/oox/inc/drawingml/table/tableproperties.hxx b/oox/inc/drawingml/table/tableproperties.hxx index cf4d0cd2afcf..578230daa876 100644 --- a/oox/inc/drawingml/table/tableproperties.hxx +++ b/oox/inc/drawingml/table/tableproperties.hxx @@ -38,18 +38,23 @@ public: TableProperties(); ~TableProperties(); - std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; }; - std::vector< TableRow >& getTableRows() { return mvTableRows; }; - - OUString& getStyleId(){ return maStyleId; }; - std::shared_ptr< TableStyle >& getTableStyle(){ return mpTableStyle; }; - bool& isRtl(){ return mbRtl; }; - bool& isFirstRow(){ return mbFirstRow; }; - bool& isFirstCol(){ return mbFirstCol; }; - bool& isLastRow(){ return mbLastRow; }; - bool& isLastCol(){ return mbLastCol; }; - bool& isBandRow(){ return mbBandRow; }; - bool& isBandCol(){ return mbBandCol; }; + std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; }; + std::vector< TableRow >& getTableRows() { return mvTableRows; }; + + OUString& getStyleId() { return maStyleId; }; + std::shared_ptr< TableStyle >& getTableStyle() { return mpTableStyle; }; + bool isFirstRow() const { return mbFirstRow; }; + void setFirstRow(bool b) { mbFirstRow = b; }; + bool isFirstCol() const { return mbFirstCol; }; + void setFirstCol(bool b) { mbFirstCol = b; }; + bool isLastRow() const { return mbLastRow; }; + void setLastRow(bool b) { mbLastRow = b; }; + bool isLastCol() const { return mbLastCol; }; + void setLastCol(bool b) { mbLastCol = b; }; + bool isBandRow() const { return mbBandRow; }; + void setBandRow(bool b) { mbBandRow = b; }; + bool isBandCol() const { return mbBandCol; }; + void setBandCol(bool b) { mbBandCol = b; }; void pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::beans::XPropertySet > & xPropSet, @@ -64,7 +69,6 @@ private: std::vector< sal_Int32 > mvTableGrid; std::vector< TableRow > mvTableRows; - bool mbRtl; bool mbFirstRow; bool mbFirstCol; bool mbLastRow; diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx index 9e4cd315e62f..c3c5f48b18a9 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -50,13 +50,12 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r { case A_TOKEN( tblPr ): // CT_TableProperties { - mrTableProperties.isRtl() = rAttribs.getBool( XML_rtl, false ); - mrTableProperties.isFirstRow() = rAttribs.getBool( XML_firstRow, false ); - mrTableProperties.isFirstCol() = rAttribs.getBool( XML_firstCol, false ); - mrTableProperties.isLastRow() = rAttribs.getBool( XML_lastRow, false ); - mrTableProperties.isLastCol() = rAttribs.getBool( XML_lastCol, false ); - mrTableProperties.isBandRow() = rAttribs.getBool( XML_bandRow, false ); - mrTableProperties.isBandCol() = rAttribs.getBool( XML_bandCol, false ); + mrTableProperties.setFirstRow( rAttribs.getBool( XML_firstRow, false ) ); + mrTableProperties.setFirstCol( rAttribs.getBool( XML_firstCol, false ) ); + mrTableProperties.setLastRow( rAttribs.getBool( XML_lastRow, false ) ); + mrTableProperties.setLastCol( rAttribs.getBool( XML_lastCol, false ) ); + mrTableProperties.setBandRow( rAttribs.getBool( XML_bandRow, false ) ); + mrTableProperties.setBandCol( rAttribs.getBool( XML_bandCol, false ) ); } break; case A_TOKEN( tableStyle ): // CT_TableStyle diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 053572a7bc08..d4c5bdc56d39 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -40,8 +40,7 @@ using namespace ::com::sun::star::table; namespace oox { namespace drawingml { namespace table { TableProperties::TableProperties() -: mbRtl( false ) -, mbFirstRow( false ) +: mbFirstRow( false ) , mbFirstCol( false ) , mbLastRow( false ) , mbLastCol( false ) diff --git a/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx b/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx index 05eb4b876df8..09fe26d72520 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx @@ -80,7 +80,6 @@ public: private: SlideSorter& mrSlideSorter; bool mbIsVisible; - const sal_Int32 mnLayerIndex; SharedILayerInvalidator mpLayerInvalidator; // Center of the insertion indicator. Point maLocation; diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index 036ebc2c15a2..32dbf8920819 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -61,11 +61,11 @@ namespace sd { namespace slidesorter { namespace view { //===== InsertionIndicatorOverlay =========================================== const static sal_Int32 gnShadowBorder = 3; +const static sal_Int32 gnLayerIndex = 2; InsertionIndicatorOverlay::InsertionIndicatorOverlay (SlideSorter& rSlideSorter) : mrSlideSorter(rSlideSorter), mbIsVisible(false), - mnLayerIndex(2), mpLayerInvalidator(), maLocation(), maIcon(), @@ -326,7 +326,7 @@ void InsertionIndicatorOverlay::Show() mrSlideSorter.GetView().GetLayeredDevice()); if (pLayeredDevice) { - pLayeredDevice->RegisterPainter(shared_from_this(), mnLayerIndex); + pLayeredDevice->RegisterPainter(shared_from_this(), gnLayerIndex); if (mpLayerInvalidator) mpLayerInvalidator->Invalidate(GetBoundingBox()); } @@ -345,7 +345,7 @@ void InsertionIndicatorOverlay::Hide() { if (mpLayerInvalidator) mpLayerInvalidator->Invalidate(GetBoundingBox()); - pLayeredDevice->RemovePainter(shared_from_this(), mnLayerIndex); + pLayeredDevice->RemovePainter(shared_from_this(), gnLayerIndex); } } } diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 9187f2c1d386..42c9432c96a7 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -341,7 +341,6 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) SdrEngineDefaults::SdrEngineDefaults(): aFontColor(COL_AUTO), - nFontHeight(847), // 847/100mm = ca. 24 Point aMapFraction(1,1) { } diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 97c8275a2f58..adec1835221d 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -56,10 +56,11 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; using uno::Any; +static const sal_uInt16 nUnknownWhich = RES_UNKNOWNATR_CONTAINER; + SvXMLImportItemMapper::SvXMLImportItemMapper( SvXMLItemMapEntriesRef const & rMapEntries ) : - mrMapEntries( rMapEntries ), - nUnknownWhich( RES_UNKNOWNATR_CONTAINER ) + mrMapEntries( rMapEntries ) { } diff --git a/sw/source/filter/xml/xmlimpit.hxx b/sw/source/filter/xml/xmlimpit.hxx index 91bbfaab18f6..47a367fdd9ca 100644 --- a/sw/source/filter/xml/xmlimpit.hxx +++ b/sw/source/filter/xml/xmlimpit.hxx @@ -35,7 +35,6 @@ class SvXMLImportItemMapper { protected: SvXMLItemMapEntriesRef mrMapEntries; - sal_uInt16 nUnknownWhich; public: explicit SvXMLImportItemMapper( SvXMLItemMapEntriesRef const & rMapEntries ); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 9b27520a6fbc..be5f53e311ea 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -131,7 +131,6 @@ void StatusBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnDX = 0; mnDY = 0; mnCalcHeight = 0; - mnItemY = STATUSBAR_OFFSET_Y; mnTextY = STATUSBAR_OFFSET_TEXTY; ImplInitSettings(); @@ -303,7 +302,7 @@ tools::Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const { aRect.Left() = pItem->mnX; aRect.Right() = aRect.Left() + pItem->mnWidth + pItem->mnExtraWidth; - aRect.Top() = mnItemY; + aRect.Top() = STATUSBAR_OFFSET_Y; aRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y; } } @@ -590,7 +589,7 @@ void StatusBar::ImplCalcProgressRect() // calculate progress frame maPrgsFrameRect.Left() = maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET; - maPrgsFrameRect.Top() = mnItemY; + maPrgsFrameRect.Top() = STATUSBAR_OFFSET_Y; maPrgsFrameRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y; // calculate size of progress rects @@ -735,7 +734,6 @@ void StatusBar::Resize() mnDY = aSize.Height(); mnCalcHeight = mnDY; - mnItemY = STATUSBAR_OFFSET_Y; mnTextY = (mnCalcHeight-GetTextHeight())/2; // provoke re-formatting |