summaryrefslogtreecommitdiff
path: root/sw/source/filter
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 /sw/source/filter
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 'sw/source/filter')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx9
-rw-r--r--sw/source/filter/ww8/docxexport.cxx36
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx23
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx36
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx8
6 files changed, 58 insertions, 60 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4caf0318315e..f18858886c49 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4736,9 +4736,8 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
{
// get interoperability information about embedded objects
uno::Reference< beans::XPropertySet > xPropSet( m_rExport.m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
uno::Sequence< beans::PropertyValue > aGrabBag, aObjectsInteropList,aObjectInteropAttributes;
- xPropSet->getPropertyValue( pName ) >>= aGrabBag;
+ xPropSet->getPropertyValue( UNO_NAME_MISC_OBJ_INTEROPGRABBAG ) >>= aGrabBag;
for( sal_Int32 i=0; i < aGrabBag.getLength(); ++i )
if ( aGrabBag[i].Name == "EmbeddedObjects" )
{
@@ -5032,12 +5031,12 @@ bool DocxAttributeOutput::IsDiagram( const SdrObject* sdrObject )
// if the shape doesn't have the InteropGrabBag property, it's not a diagram
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( !xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( !xPropSetInfo->hasPropertyByName( aName ) )
return false;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aName ) >>= propList;
for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp )
{
// if we find any of the diagram components, it's a diagram
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 1be1c997471b..0e501c0d21f4 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -894,11 +894,11 @@ void DocxExport::WriteSettings()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aGrabBagName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( xPropSetInfo->hasPropertyByName( aGrabBagName ) )
{
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aGrabBagName ) >>= propList;
for( sal_Int32 i=0; i < propList.getLength(); ++i )
{
if ( propList[i].Name == "ThemeFontLangProps" )
@@ -973,13 +973,13 @@ void DocxExport::WriteTheme()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( !xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( !xPropSetInfo->hasPropertyByName( aName ) )
return;
uno::Reference<xml::dom::XDocument> themeDom;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aName ) >>= propList;
for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp )
{
OUString propName = propList[nProp].Name;
@@ -1011,14 +1011,14 @@ void DocxExport::WriteGlossary()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( !xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( !xPropSetInfo->hasPropertyByName( aName ) )
return;
uno::Reference<xml::dom::XDocument> glossaryDocDom;
uno::Sequence< uno::Sequence< uno::Any> > glossaryDomList;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aName ) >>= propList;
sal_Int32 collectedProperties = 0;
for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp )
{
@@ -1082,14 +1082,14 @@ void DocxExport::WriteCustomXml()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( !xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( !xPropSetInfo->hasPropertyByName( aName ) )
return;
uno::Sequence<uno::Reference<xml::dom::XDocument> > customXmlDomlist;
uno::Sequence<uno::Reference<xml::dom::XDocument> > customXmlDomPropslist;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aName ) >>= propList;
for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp )
{
OUString propName = propList[nProp].Name;
@@ -1153,14 +1153,14 @@ void DocxExport::WriteActiveX()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( !xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( !xPropSetInfo->hasPropertyByName( aName ) )
return;
uno::Sequence<uno::Reference<xml::dom::XDocument> > activeXDomlist;
uno::Sequence<uno::Reference<io::XInputStream> > activeXBinList;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aName ) >>= propList;
for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp )
{
OUString propName = propList[nProp].Name;
@@ -1247,13 +1247,13 @@ void DocxExport::WriteEmbeddings()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
- if ( !xPropSetInfo->hasPropertyByName( pName ) )
+ OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+ if ( !xPropSetInfo->hasPropertyByName( aName ) )
return;
uno::Sequence< beans::PropertyValue > embeddingsList;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue( pName ) >>= propList;
+ xPropSet->getPropertyValue( aName ) >>= propList;
for ( sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp )
{
OUString propName = propList[nProp].Name;
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 6518f4f126f2..191a9b9cff49 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -287,8 +287,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
m_pImpl->m_bParagraphHasDrawing = true;
m_pImpl->m_pSerializer->startElementNS(XML_w, XML_drawing, FSEND);
- const SvxLRSpaceItem pLRSpaceItem = pFrameFormat->GetLRSpace(false);
- const SvxULSpaceItem pULSpaceItem = pFrameFormat->GetULSpace(false);
+ const SvxLRSpaceItem aLRSpaceItem = pFrameFormat->GetLRSpace(false);
+ const SvxULSpaceItem aULSpaceItem = pFrameFormat->GetULSpace(false);
bool isAnchor;
@@ -364,10 +364,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
lclMovePositionWithRotation(aPos, rSize, pObj->GetRotateAngle());
}
attrList->add(XML_behindDoc, bOpaque ? "0" : "1");
- attrList->add(XML_distT, OString::number(TwipsToEMU(pULSpaceItem.GetUpper()) - nTopExt).getStr());
- attrList->add(XML_distB, OString::number(TwipsToEMU(pULSpaceItem.GetLower()) - nBottomExt).getStr());
- attrList->add(XML_distL, OString::number(TwipsToEMU(pLRSpaceItem.GetLeft()) - nLeftExt).getStr());
- attrList->add(XML_distR, OString::number(TwipsToEMU(pLRSpaceItem.GetRight()) - nRightExt).getStr());
+ attrList->add(XML_distT, OString::number(TwipsToEMU(aULSpaceItem.GetUpper()) - nTopExt).getStr());
+ attrList->add(XML_distB, OString::number(TwipsToEMU(aULSpaceItem.GetLower()) - nBottomExt).getStr());
+ attrList->add(XML_distL, OString::number(TwipsToEMU(aLRSpaceItem.GetLeft()) - nLeftExt).getStr());
+ attrList->add(XML_distR, OString::number(TwipsToEMU(aLRSpaceItem.GetRight()) - nRightExt).getStr());
attrList->add(XML_simplePos, "0");
attrList->add(XML_locked, "0");
attrList->add(XML_layoutInCell, "1");
@@ -556,10 +556,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
else
{
sax_fastparser::FastAttributeList* aAttrList = sax_fastparser::FastSerializerHelper::createAttrList();
- aAttrList->add(XML_distT, OString::number(TwipsToEMU(pULSpaceItem.GetUpper())).getStr());
- aAttrList->add(XML_distB, OString::number(TwipsToEMU(pULSpaceItem.GetLower())).getStr());
- aAttrList->add(XML_distL, OString::number(TwipsToEMU(pLRSpaceItem.GetLeft())).getStr());
- aAttrList->add(XML_distR, OString::number(TwipsToEMU(pLRSpaceItem.GetRight())).getStr());
+ aAttrList->add(XML_distT, OString::number(TwipsToEMU(aULSpaceItem.GetUpper())).getStr());
+ aAttrList->add(XML_distB, OString::number(TwipsToEMU(aULSpaceItem.GetLower())).getStr());
+ aAttrList->add(XML_distL, OString::number(TwipsToEMU(aLRSpaceItem.GetLeft())).getStr());
+ aAttrList->add(XML_distR, OString::number(TwipsToEMU(aLRSpaceItem.GetRight())).getStr());
const SdrObject* pObj = pFrameFormat->FindRealSdrObject();
if (pObj != nullptr)
{
@@ -1120,9 +1120,8 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrameFormat
uno::Sequence< uno::Any > diagramDrawing;
// retrieve the doms from the GrabBag
- OUString pName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
uno::Sequence< beans::PropertyValue > propList;
- xPropSet->getPropertyValue(pName) >>= propList;
+ xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList;
for (sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp)
{
OUString propName = propList[nProp].Name;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 4e088f1ed645..6e97113a543f 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3846,7 +3846,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat
if (rGraphic.GetType()==GRAPHIC_NONE)
return;
- ConvertDataFormat pConvertDestinationFormat = ConvertDataFormat::WMF;
+ ConvertDataFormat aConvertDestinationFormat = ConvertDataFormat::WMF;
const sal_Char* pConvertDestinationBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
GfxLink aGraphicLink;
@@ -3883,7 +3883,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat
break;
case GFX_LINK_TYPE_NATIVE_GIF:
// GIF is not supported by RTF, but we override default conversion to WMF, PNG seems fits better here.
- pConvertDestinationFormat = ConvertDataFormat::PNG;
+ aConvertDestinationFormat = ConvertDataFormat::PNG;
pConvertDestinationBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP;
break;
default:
@@ -3994,7 +3994,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat
else
{
aStream.Seek(0);
- if (GraphicConverter::Export(aStream, rGraphic, pConvertDestinationFormat) != ERRCODE_NONE)
+ if (GraphicConverter::Export(aStream, rGraphic, aConvertDestinationFormat) != ERRCODE_NONE)
SAL_WARN("sw.rtf", "failed to export the graphic");
pBLIPType = pConvertDestinationBLIPType;
aStream.Seek(STREAM_SEEK_TO_END);
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index ba0d4f03894a..1c5b24813d6f 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1565,14 +1565,14 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition,
// #i25545#
// #i100132# - a number format does not have to exist on given list level
- SwNumFormat pFormat(rLFOInfo.pNumRule->Get(nLevel));
+ SwNumFormat aFormat(rLFOInfo.pNumRule->Get(nLevel));
if (rReader.IsRightToLeft() && nLastLFOPosition != nLFOPosition) {
- if ( pFormat.GetNumAdjust() == SVX_ADJUST_RIGHT)
- pFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- else if ( pFormat.GetNumAdjust() == SVX_ADJUST_LEFT)
- pFormat.SetNumAdjust(SVX_ADJUST_RIGHT);
- rLFOInfo.pNumRule->Set(nLevel, pFormat);
+ if ( aFormat.GetNumAdjust() == SVX_ADJUST_RIGHT)
+ aFormat.SetNumAdjust(SVX_ADJUST_LEFT);
+ else if ( aFormat.GetNumAdjust() == SVX_ADJUST_LEFT)
+ aFormat.SetNumAdjust(SVX_ADJUST_RIGHT);
+ rLFOInfo.pNumRule->Set(nLevel, aFormat);
}
nLastLFOPosition = nLFOPosition;
/*
@@ -2318,11 +2318,11 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString,
{
case RES_CHRATR_COLOR:
{
- OUString pNm;
- if (xPropSetInfo->hasPropertyByName(pNm = "TextColor"))
+ OUString aNm;
+ if (xPropSetInfo->hasPropertyByName(aNm = "TextColor"))
{
aTmp <<= (sal_Int32)static_cast<const SvxColorItem*>(pItem)->GetValue().GetColor();
- rPropSet->setPropertyValue(pNm, aTmp);
+ rPropSet->setPropertyValue(aNm, aTmp);
}
}
aFont.SetColor(static_cast<const SvxColorItem*>(pItem)->GetValue());
@@ -2330,26 +2330,26 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString,
case RES_CHRATR_FONT:
{
const SvxFontItem *pFontItem = static_cast<const SvxFontItem *>(pItem);
- OUString pNm;
- if (xPropSetInfo->hasPropertyByName(pNm = "FontStyleName"))
+ OUString aNm;
+ if (xPropSetInfo->hasPropertyByName(aNm = "FontStyleName"))
{
aTmp <<= OUString( pFontItem->GetStyleName());
- rPropSet->setPropertyValue( pNm, aTmp );
+ rPropSet->setPropertyValue( aNm, aTmp );
}
- if (xPropSetInfo->hasPropertyByName(pNm = "FontFamily"))
+ if (xPropSetInfo->hasPropertyByName(aNm = "FontFamily"))
{
aTmp <<= (sal_Int16)pFontItem->GetFamily();
- rPropSet->setPropertyValue( pNm, aTmp );
+ rPropSet->setPropertyValue( aNm, aTmp );
}
- if (xPropSetInfo->hasPropertyByName(pNm = "FontCharset"))
+ if (xPropSetInfo->hasPropertyByName(aNm = "FontCharset"))
{
aTmp <<= (sal_Int16)pFontItem->GetCharSet();
- rPropSet->setPropertyValue( pNm, aTmp );
+ rPropSet->setPropertyValue( aNm, aTmp );
}
- if (xPropSetInfo->hasPropertyByName(pNm = "FontPitch"))
+ if (xPropSetInfo->hasPropertyByName(aNm = "FontPitch"))
{
aTmp <<= (sal_Int16)pFontItem->GetPitch();
- rPropSet->setPropertyValue( pNm, aTmp );
+ rPropSet->setPropertyValue( aNm, aTmp );
}
aTmp <<= OUString( pFontItem->GetFamilyName());
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index afb28097453d..bdeb1946833d 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -531,8 +531,8 @@ sal_uInt16 SwWW8ImplReader::End_Field()
aFieldPam, m_aFieldStack.back().GetBookmarkName(), ODF_FORMTEXT ) );
OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?");
if (pFieldmark!=nullptr) {
- const IFieldmark::parameter_map_t& pParametersToAdd = m_aFieldStack.back().getParameters();
- pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end());
+ const IFieldmark::parameter_map_t& rParametersToAdd = m_aFieldStack.back().getParameters();
+ pFieldmark->GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
}
}
break;
@@ -604,8 +604,8 @@ sal_uInt16 SwWW8ImplReader::End_Field()
ODF_UNHANDLED );
if ( pFieldmark )
{
- const IFieldmark::parameter_map_t& pParametersToAdd = m_aFieldStack.back().getParameters();
- pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end());
+ const IFieldmark::parameter_map_t& rParametersToAdd = m_aFieldStack.back().getParameters();
+ pFieldmark->GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
OUString sFieldId = OUString::number( m_aFieldStack.back().mnFieldId );
pFieldmark->GetParameters()->insert(
std::pair< OUString, uno::Any > (