summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-25 09:59:16 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-12 22:06:19 -0400
commitc5cdfe39d3afca716e7b11f8f8e169ce378861ea (patch)
tree5b804fa2e78405afe16db734f88f24a7b9714209 /oox
parent0c4c31576fe03b3b59217bf9990b75f32d193d0d (diff)
update loplugin stylepolice to check local pointers vars
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> (cherry picked from commit e8fd5a07eca70912ddee45aaa34d434809b59fb7) Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx45
-rw-r--r--oox/source/drawingml/effectproperties.cxx10
-rw-r--r--oox/source/drawingml/fillproperties.cxx10
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx4
-rw-r--r--oox/source/export/drawingml.cxx6
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx6
7 files changed, 37 insertions, 48 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 709c627db722..a2c3b9bf8203 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -794,8 +794,8 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP
{
OUStringBuffer buf;
::sax::Converter::convertDuration( buf, aDuration );
- OUString pDuration = buf.makeStringAndClear();
- writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), pDuration );
+ OUString aDurationStr = buf.makeStringAndClear();
+ writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aDurationStr );
}
else if ( ( aprop[n].Value ) >>= aDateTime )
writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime );
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 1d0b78e82aeb..51b58da1a6aa 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -20,7 +20,6 @@
#include "diagramlayoutatoms.hxx"
#include <functional>
-#include <boost/bind.hpp>
#include <osl/diagnose.h>
#include <basegfx/numeric/ftools.hxx>
@@ -84,9 +83,9 @@ void LayoutAtom::dump(int level)
OSL_TRACE( "level = %d - %s of type %s", level,
OUSTRING_TO_CSTR( msName ),
typeid(*this).name() );
- const std::vector<LayoutAtomPtr>& pChildren=getChildren();
- std::for_each( pChildren.begin(), pChildren.end(),
- boost::bind( &LayoutAtom::dump, _1, level + 1 ) );
+ const std::vector<LayoutAtomPtr>& rChildren=getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
+ [level] (LayoutAtomPtr const& pAtom) { pAtom->dump(level + 1); } );
}
ForEachAtom::ForEachAtom(const Reference< XFastAttributeList >& xAttributes)
@@ -582,11 +581,9 @@ public:
void ShapeCreationVisitor::defaultVisit(LayoutAtom& rAtom)
{
- const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren();
- std::for_each( pChildren.begin(), pChildren.end(),
- boost::bind( &LayoutAtom::accept,
- _1,
- boost::ref(*this)) );
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
+ [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
void ShapeCreationVisitor::visit(ConstraintAtom& /*rAtom*/)
@@ -601,7 +598,7 @@ void ShapeCreationVisitor::visit(AlgAtom& rAtom)
void ShapeCreationVisitor::visit(ForEachAtom& rAtom)
{
- const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren();
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
sal_Int32 nChildren=1;
if( rAtom.iterator().mnPtType == XML_node )
@@ -610,10 +607,8 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom)
// attribute that is contained in diagram's
// getPointsPresNameMap()
ShallowPresNameVisitor aVisitor(mrDgm);
- std::for_each( pChildren.begin(), pChildren.end(),
- boost::bind( &LayoutAtom::accept,
- _1,
- boost::ref(aVisitor)) );
+ std::for_each( rChildren.begin(), rChildren.end(),
+ [&] (LayoutAtomPtr const& pAtom) { pAtom->accept(aVisitor); } );
nChildren = aVisitor.getCount();
}
@@ -626,10 +621,8 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom)
for( mnCurrIdx=0; mnCurrIdx<nCnt && nStep>0; mnCurrIdx+=nStep )
{
// TODO there is likely some conditions
- std::for_each( pChildren.begin(), pChildren.end(),
- boost::bind( &LayoutAtom::accept,
- _1,
- boost::ref(*this)) );
+ std::for_each( rChildren.begin(), rChildren.end(),
+ [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
// and restore idx
@@ -695,11 +688,9 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
void ShapeLayoutingVisitor::defaultVisit(LayoutAtom& rAtom)
{
// visit all children, one of them needs to be the layout algorithm
- const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren();
- std::for_each( pChildren.begin(), pChildren.end(),
- boost::bind( &LayoutAtom::accept,
- _1,
- boost::ref(*this)) );
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
+ [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
void ShapeLayoutingVisitor::visit(ConstraintAtom& /*rAtom*/)
@@ -736,11 +727,9 @@ void ShallowPresNameVisitor::defaultVisit(LayoutAtom& rAtom)
{
// visit all children, at least one of them needs to have proper
// name set
- const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren();
- std::for_each( pChildren.begin(), pChildren.end(),
- boost::bind( &LayoutAtom::accept,
- _1,
- boost::ref(*this)) );
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
+ [this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
void ShallowPresNameVisitor::visit(ConstraintAtom& /*rAtom*/)
diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx
index 3ec31e0f8b03..2dd529b834cb 100644
--- a/oox/source/drawingml/effectproperties.cxx
+++ b/oox/source/drawingml/effectproperties.cxx
@@ -73,9 +73,9 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
css::beans::PropertyValue Effect::getEffect()
{
- css::beans::PropertyValue pRet;
+ css::beans::PropertyValue aRet;
if( msName.isEmpty() )
- return pRet;
+ return aRet;
css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() );
sal_uInt32 i = 0;
@@ -86,10 +86,10 @@ css::beans::PropertyValue Effect::getEffect()
i++;
}
- pRet.Name = msName;
- pRet.Value = css::uno::Any( aSeq );
+ aRet.Name = msName;
+ aRet.Value = css::uno::Any( aSeq );
- return pRet;
+ return aRet;
}
} // namespace drawingml
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index a667bc5a4b19..64b5cf355cec 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -772,9 +772,9 @@ bool ArtisticEffectProperties::isEmpty() const
css::beans::PropertyValue ArtisticEffectProperties::getEffect()
{
- css::beans::PropertyValue pRet;
+ css::beans::PropertyValue aRet;
if( msName.isEmpty() )
- return pRet;
+ return aRet;
css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 );
sal_uInt32 i = 0;
@@ -797,10 +797,10 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect()
aSeq[i].Value = uno::makeAny( aGraphicSeq );
}
- pRet.Name = msName;
- pRet.Value = css::uno::Any( aSeq );
+ aRet.Name = msName;
+ aRet.Value = css::uno::Any( aSeq );
- return pRet;
+ return aRet;
}
void ArtisticEffectProperties::assignUsed( const ArtisticEffectProperties& rSourceProps )
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 397cabd2650d..5ecc2ecfaaa4 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -518,8 +518,8 @@ void TextParagraphProperties::dump() const
xStart->gotoEnd( sal_True );
Reference< XPropertySet > xPropSet( xRange, UNO_QUERY );
pushToPropSet( nullptr, xPropSet, emptyMap, nullptr, false, 0 );
- PropertySet pSet( xPropSet );
- pSet.dump();
+ PropertySet aPropSet( xPropSet );
+ aPropSet.dump();
}
#endif
} }
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 9c877574657b..9ac9c69d849c 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1765,12 +1765,12 @@ void DrawingML::WriteParagraphNumbering( Reference< XPropertySet > rXPropSet, sa
FSEND );
}
- OUString pAutoNumType = GetAutoNumType( nNumberingType, bSDot, bPBehind, bPBoth );
+ OUString aAutoNumType = GetAutoNumType( nNumberingType, bSDot, bPBehind, bPBoth );
- if (!pAutoNumType.isEmpty())
+ if (!aAutoNumType.isEmpty())
{
mpFS->singleElementNS(XML_a, XML_buAutoNum,
- XML_type, OUStringToOString(pAutoNumType, RTL_TEXTENCODING_UTF8).getStr(),
+ XML_type, OUStringToOString(aAutoNumType, RTL_TEXTENCODING_UTF8).getStr(),
XML_startAt, nStartWith > 1 ? IS(nStartWith) : nullptr,
FSEND);
}
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index c5ddf7654396..15925d911a60 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -433,9 +433,9 @@ namespace oox { namespace ppt {
//xParentNode
if( isCurrentElement( mnElement ) )
{
- NodePropertyMap & pProps(mpNode->getNodeProperties());
- pProps[ NP_DIRECTION ] = makeAny( mnDir == XML_cw );
- pProps[ NP_COLORINTERPOLATION ] = makeAny( mnColorSpace == XML_hsl ? AnimationColorSpace::HSL : AnimationColorSpace::RGB );
+ NodePropertyMap & rProps(mpNode->getNodeProperties());
+ rProps[ NP_DIRECTION ] = makeAny( mnDir == XML_cw );
+ rProps[ NP_COLORINTERPOLATION ] = makeAny( mnColorSpace == XML_hsl ? AnimationColorSpace::HSL : AnimationColorSpace::RGB );
const GraphicHelper& rGraphicHelper = getFilter().getGraphicHelper();
if( maToClr.isUsed() )
mpNode->setTo( Any( maToClr.getColor( rGraphicHelper ) ) );