summaryrefslogtreecommitdiff
path: root/writerfilter
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 /writerfilter
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 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx45
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx8
2 files changed, 26 insertions, 27 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index cfb90a0dd060..372e71fcc6d9 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1224,20 +1224,20 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP
try
{
// If we are in comments, then disable CharGrabBag, comment text doesn't support that.
- uno::Sequence< beans::PropertyValue > pValues = pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!m_bIsInComments);
- sal_Int32 len = pValues.getLength();
+ uno::Sequence< beans::PropertyValue > aValues = pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!m_bIsInComments);
+ sal_Int32 len = aValues.getLength();
if (m_bStartTOC || m_bStartIndex || m_bStartBibliography)
for( int i =0; i < len; ++i )
{
- if (pValues[i].Name == "CharHidden")
- pValues[i].Value = uno::makeAny(sal_False);
+ if (aValues[i].Name == "CharHidden")
+ aValues[i].Value = uno::makeAny(false);
}
uno::Reference< text::XTextRange > xTextRange;
if (m_aTextAppendStack.top().xInsertPosition.is())
{
- xTextRange = xTextAppend->insertTextPortion(rString, pValues, m_aTextAppendStack.top().xInsertPosition);
+ xTextRange = xTextAppend->insertTextPortion(rString, aValues, m_aTextAppendStack.top().xInsertPosition);
m_aTextAppendStack.top().xCursor->gotoRange(xTextRange->getEnd(), true);
}
else
@@ -1246,7 +1246,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP
{
if(m_bInHeaderFooterImport && !m_bStartTOCHeaderFooter)
{
- xTextRange = xTextAppend->appendTextPortion(rString, pValues);
+ xTextRange = xTextAppend->appendTextPortion(rString, aValues);
}
else
{
@@ -1258,7 +1258,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP
{
if (m_bStartIndex || m_bStartBibliography || m_bStartGenericField)
xTOCTextCursor->goLeft(1, false);
- xTextRange = xTextAppend->insertTextPortion(rString, pValues, xTOCTextCursor);
+ xTextRange = xTextAppend->insertTextPortion(rString, aValues, xTOCTextCursor);
SAL_WARN_IF(!xTextRange.is(), "writerfilter.dmapper", "insertTextPortion failed");
if (!xTextRange.is())
throw uno::Exception("insertTextPortion failed", nullptr);
@@ -1268,7 +1268,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP
}
else
{
- xTextRange = xTextAppend->appendTextPortion(rString, pValues);
+ xTextRange = xTextAppend->appendTextPortion(rString, aValues);
xTOCTextCursor = xTextAppend->createTextCursor();
xTOCTextCursor->gotoRange(xTextRange->getEnd(), false);
}
@@ -1276,7 +1276,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, PropertyMapP
}
}
else
- xTextRange = xTextAppend->appendTextPortion(rString, pValues);
+ xTextRange = xTextAppend->appendTextPortion(rString, aValues);
}
CheckRedline( xTextRange );
@@ -1501,7 +1501,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
//switch on header/footer use
xPageStyle->setPropertyValue(
getPropertyName(ePropIsOn),
- uno::makeAny(sal_True));
+ uno::makeAny(true));
if (bFirst)
{
@@ -1510,7 +1510,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
{
// This is a first page and has a follow style, then enable the header/footer there as well to be consistent.
uno::Reference<beans::XPropertySet> xFollowStyle(GetPageStyles()->getByName(aFollowStyle), uno::UNO_QUERY);
- xFollowStyle->setPropertyValue(getPropertyName(ePropIsOn), uno::makeAny(sal_True));
+ xFollowStyle->setPropertyValue(getPropertyName(ePropIsOn), uno::makeAny(true));
}
}
@@ -1925,7 +1925,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
uno::Reference<text::XTextContent> xTextContent(xShape, uno::UNO_QUERY_THROW);
uno::Reference<text::XTextRange> xTextRange(xTextAppend->createTextCursorByRange(xTextAppend->getEnd()), uno::UNO_QUERY_THROW);
- xTextAppend->insertTextContent(xTextRange, xTextContent, sal_False);
+ xTextAppend->insertTextContent(xTextRange, xTextContent, false);
uno::Reference<beans::XPropertySet> xPropertySet(xTextContent, uno::UNO_QUERY);
// we need to re-set this value to xTextContent, then only values are preserved.
@@ -2174,7 +2174,7 @@ style::NumberingType::
CHARS_CYRILLIC_LOWER_LETTER_N_SR*/
};
- for( sal_uInt32 nNum = 0; nNum < sizeof(aNumberingPairs)/sizeof( NumberingPairs ); ++nNum)
+ for( sal_uInt32 nNum = 0; nNum < SAL_N_ELEMENTS(aNumberingPairs); ++nNum)
{
if( /*sCommand*/sNumber.equalsAscii(aNumberingPairs[nNum].cWordName ))
{
@@ -2929,7 +2929,7 @@ void DomainMapper_Impl::handleFieldAsk
uno::makeAny( sHint ));
xFieldProperties->setPropertyValue(getPropertyName(PROP_SUB_TYPE), uno::makeAny(text::SetVariableType::STRING));
// The ASK has no field value to display
- xFieldProperties->setPropertyValue(getPropertyName(PROP_IS_VISIBLE), uno::makeAny(sal_False));
+ xFieldProperties->setPropertyValue(getPropertyName(PROP_IS_VISIBLE), uno::makeAny(false));
}
else
{
@@ -3105,8 +3105,7 @@ void DomainMapper_Impl::handleAuthor
//search for a field mapping
OUString sFieldServiceName;
sal_uInt16 nMap = 0;
- for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap);
- ++nMap )
+ for( ; nMap < SAL_N_ELEMENTS(aDocProperties); ++nMap )
{
if ((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) && (!xPropertySetInfo->hasPropertyByName(rFirstParam)))
{
@@ -3447,8 +3446,8 @@ void DomainMapper_Impl::handleToc
if(xCrsr.is() && xText.is())
{
xCrsr->gotoEnd(false);
- xText->insertString(xCrsr, sMarker, sal_False);
- xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, sal_False);
+ xText->insertString(xCrsr, sMarker, false);
+ xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, false);
xTOCMarkerCursor = xCrsr;
}
}
@@ -4120,7 +4119,7 @@ void DomainMapper_Impl::CloseFieldCommand()
if(xCrsr.is() && xText.is())
{
xCrsr->gotoEnd(false);
- xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, sal_False);
+ xText->insertTextContent(uno::Reference< text::XTextRange >( xCrsr, uno::UNO_QUERY_THROW ), xToInsert, false);
}
}
}
@@ -4207,9 +4206,9 @@ void DomainMapper_Impl::CloseFieldCommand()
uno::Reference< text::XTextCursor > xCrsr = xTextAppend->createTextCursorByRange(pContext->GetStartRange());
if (xTextContent.is())
{
- xTextAppend->insertTextContent(xCrsr,xTextContent, sal_True);
+ xTextAppend->insertTextContent(xCrsr,xTextContent, true);
}
- const uno::Reference<uno::XInterface> xContent(xTextContent);
+ uno::Reference<uno::XInterface> xContent(xTextContent);
uno::Reference< text::XFormField> xFormField(xContent, uno::UNO_QUERY);
xFormField->setFieldType(aCode);
m_bStartGenericField = true;
@@ -4471,9 +4470,9 @@ void DomainMapper_Impl::PopFieldContext()
}
else
{
- xTOCMarkerCursor->goLeft(1,sal_True);
+ xTOCMarkerCursor->goLeft(1,true);
xTOCMarkerCursor->setString(OUString());
- xTOCMarkerCursor->goLeft(1,sal_True);
+ xTOCMarkerCursor->goLeft(1,true);
xTOCMarkerCursor->setString(OUString());
}
}
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 034ccafa9350..00517d857399 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -465,9 +465,9 @@ void GraphicImport::handleWrapTextValue(sal_uInt32 nVal)
void GraphicImport::putPropertyToFrameGrabBag( const OUString& sPropertyName, const uno::Any& aPropertyValue )
{
- beans::PropertyValue pProperty;
- pProperty.Name = sPropertyName;
- pProperty.Value = aPropertyValue;
+ beans::PropertyValue aProperty;
+ aProperty.Name = sPropertyName;
+ aProperty.Value = aPropertyValue;
if (!m_xShape.is())
return;
@@ -493,7 +493,7 @@ void GraphicImport::putPropertyToFrameGrabBag( const OUString& sPropertyName, co
uno::Sequence<beans::PropertyValue> aTmp;
xSet->getPropertyValue(aGrabBagPropName) >>= aTmp;
std::vector<beans::PropertyValue> aGrabBag(comphelper::sequenceToContainer<std::vector<beans::PropertyValue> >(aTmp));
- aGrabBag.push_back(pProperty);
+ aGrabBag.push_back(aProperty);
xSet->setPropertyValue(aGrabBagPropName, uno::makeAny(comphelper::containerToSequence(aGrabBag)));
}