summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-01 13:14:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-08 07:37:40 +0100
commit7f48fa8152bd3320af7276d811b752c5a762dcce (patch)
treea95f2aec74a17050e825eb78833ee8f0274cb728 /xmloff/source/text
parentf10b7e820844d94b4dbec3dcaf24392275940914 (diff)
loplugin:collapseif in tools..xmloff
Change-Id: Iea1227a9f13a0a618d9bb6b0bbedaa5ce8d1a4f5 Reviewed-on: https://gerrit.libreoffice.org/62732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLIndexMarkExport.cxx14
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx7
2 files changed, 6 insertions, 15 deletions
diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx
index bfeb4a845d9f..a236b7e4dfcb 100644
--- a/xmloff/source/text/XMLIndexMarkExport.cxx
+++ b/xmloff/source/text/XMLIndexMarkExport.cxx
@@ -191,12 +191,9 @@ static void lcl_ExportPropertyString( SvXMLExport& rExport,
rAny = rPropSet->getPropertyValue( sProperty );
OUString sValue;
- if( rAny >>= sValue )
+ if( (rAny >>= sValue) && !sValue.isEmpty() )
{
- if( !sValue.isEmpty() )
- {
- rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, sValue );
- }
+ rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, sValue );
}
}
@@ -209,12 +206,9 @@ static void lcl_ExportPropertyBool( SvXMLExport& rExport,
rAny = rPropSet->getPropertyValue( sProperty );
bool bValue;
- if( rAny >>= bValue )
+ if( (rAny >>= bValue) && bValue )
{
- if( bValue )
- {
- rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, XML_TRUE );
- }
+ rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, XML_TRUE );
}
}
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index a23caf149fde..134f81f9daeb 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1332,11 +1332,8 @@ bool XMLTextFrameContext::CreateIfNotThere( css::uno::Reference < css::beans::XP
{
SvXMLImportContext *pContext = m_xImplContext.get();
XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl*>( pContext );
- if( pImpl )
- {
- if( pImpl->CreateIfNotThere() )
- rPropSet = pImpl->GetPropSet();
- }
+ if( pImpl && pImpl->CreateIfNotThere() )
+ rPropSet = pImpl->GetPropSet();
return rPropSet.is();
}