summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-25 09:59:16 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-26 10:55:58 +0000
commite8fd5a07eca70912ddee45aaa34d434809b59fb7 (patch)
treed5dc890d12987cad73f5e64301f823ba23a97f2d /oox
parenttdf#98163 Flush ressources at CustomShapes during import (diff)
downloadcore-e8fd5a07eca70912ddee45aaa34d434809b59fb7.tar.gz
core-e8fd5a07eca70912ddee45aaa34d434809b59fb7.zip
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. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx22
-rw-r--r--oox/source/drawingml/effectproperties.cxx10
-rw-r--r--oox/source/drawingml/fillproperties.cxx10
-rw-r--r--oox/source/drawingml/shape.cxx16
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx4
-rw-r--r--oox/source/export/drawingml.cxx6
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx6
8 files changed, 39 insertions, 39 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 40bd20a469d1..a3cd57606e8e 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -785,8 +785,8 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie
{
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 5e50ce7a00be..51b58da1a6aa 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -83,8 +83,8 @@ 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(),
+ const std::vector<LayoutAtomPtr>& rChildren=getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
[level] (LayoutAtomPtr const& pAtom) { pAtom->dump(level + 1); } );
}
@@ -581,8 +581,8 @@ public:
void ShapeCreationVisitor::defaultVisit(LayoutAtom& rAtom)
{
- const std::vector<LayoutAtomPtr>& pChildren=rAtom.getChildren();
- std::for_each( pChildren.begin(), pChildren.end(),
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
[this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
@@ -598,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 )
@@ -607,7 +607,7 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom)
// attribute that is contained in diagram's
// getPointsPresNameMap()
ShallowPresNameVisitor aVisitor(mrDgm);
- std::for_each( pChildren.begin(), pChildren.end(),
+ std::for_each( rChildren.begin(), rChildren.end(),
[&] (LayoutAtomPtr const& pAtom) { pAtom->accept(aVisitor); } );
nChildren = aVisitor.getCount();
}
@@ -621,7 +621,7 @@ 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(),
+ std::for_each( rChildren.begin(), rChildren.end(),
[this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
@@ -688,8 +688,8 @@ 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(),
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
[this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
@@ -727,8 +727,8 @@ 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(),
+ const std::vector<LayoutAtomPtr>& rChildren=rAtom.getChildren();
+ std::for_each( rChildren.begin(), rChildren.end(),
[this] (LayoutAtomPtr const& pAtom) { pAtom->accept(*this); } );
}
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 a86d7c0237e2..338b8233dff6 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/shape.cxx b/oox/source/drawingml/shape.cxx
index 29e439958349..fb5a30a2c649 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1221,8 +1221,8 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
return xShape;
// Stream in which to place the rendered shape
- SvMemoryStream pTempStream;
- Reference < io::XStream > xStream( new utl::OStreamWrapper( pTempStream ) );
+ SvMemoryStream aTempStream;
+ Reference < io::XStream > xStream( new utl::OStreamWrapper( aTempStream ) );
Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
// Rendering format
@@ -1258,11 +1258,11 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
xGraphicExporter->setSourceDocument( xSourceDoc );
xGraphicExporter->filter( aDescriptor );
- pTempStream.Seek( STREAM_SEEK_TO_BEGIN );
+ aTempStream.Seek( STREAM_SEEK_TO_BEGIN );
Graphic aGraphic;
GraphicFilter aFilter( false );
- if ( aFilter.ImportGraphic( aGraphic, "", pTempStream, GRFILTER_FORMAT_NOTFOUND, nullptr, GraphicFilterImportFlags::NONE, static_cast < Sequence < PropertyValue >* > ( nullptr ) ) != GRFILTER_OK )
+ if ( aFilter.ImportGraphic( aGraphic, "", aTempStream, GRFILTER_FORMAT_NOTFOUND, nullptr, GraphicFilterImportFlags::NONE, static_cast < Sequence < PropertyValue >* > ( nullptr ) ) != GRFILTER_OK )
{
SAL_WARN( "oox.drawingml", OSL_THIS_FUNC
<< "Unable to import rendered stream into graphic object" );
@@ -1409,10 +1409,10 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >&
void Shape::putPropertyToGrabBag( const OUString& sPropertyName, const Any& aPropertyValue )
{
- PropertyValue pNewProperty;
- pNewProperty.Name = sPropertyName;
- pNewProperty.Value = aPropertyValue;
- putPropertyToGrabBag( pNewProperty );
+ PropertyValue aNewProperty;
+ aNewProperty.Name = sPropertyName;
+ aNewProperty.Value = aPropertyValue;
+ putPropertyToGrabBag( aNewProperty );
}
void Shape::putPropertyToGrabBag( const PropertyValue& pProperty )
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 9627333164a4..20b9d3881c07 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -519,8 +519,8 @@ void TextParagraphProperties::dump() const
xStart->gotoEnd( 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 6c4de9bc5ee9..87dd2e14b56f 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1824,12 +1824,12 @@ void DrawingML::WriteParagraphNumbering( const Reference< XPropertySet >& rXProp
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 ) ) );