summaryrefslogtreecommitdiff
path: root/writerfilter
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 /writerfilter
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 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx13
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx7
-rw-r--r--writerfilter/source/dmapper/TableManager.cxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx13
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx7
5 files changed, 16 insertions, 31 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d9edde3eaf22..a8a3d80bdade 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5405,15 +5405,12 @@ void DomainMapper_Impl::ImportGraphic(const writerfilter::Reference< Properties
*/
if(IsSdtEndBefore())
{
- if(xPropertySet.is())
+ if(xPropertySet.is() && bHasGrabBag)
{
- if (bHasGrabBag)
- {
- uno::Sequence<beans::PropertyValue> aFrameGrabBag( comphelper::InitPropertySequence({
- { "SdtEndBefore", uno::Any(true) }
- }));
- xPropertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aFrameGrabBag));
- }
+ uno::Sequence<beans::PropertyValue> aFrameGrabBag( comphelper::InitPropertySequence({
+ { "SdtEndBefore", uno::Any(true) }
+ }));
+ xPropertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aFrameGrabBag));
}
}
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 64c47bfac84b..7a803e321bc5 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1535,11 +1535,8 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp
if( pStyleNames[nStyle].startsWith( cListLabel, &sSuffix ) )
{
sal_Int32 nSuffix = sSuffix.toInt32();
- if( nSuffix > 0 )
- {
- if( nSuffix > nStyleFound )
- nStyleFound = nSuffix;
- }
+ if( nSuffix > 0 && nSuffix > nStyleFound )
+ nStyleFound = nSuffix;
}
}
sListLabel = cListLabel + OUString::number( ++nStyleFound );
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index aa173cbffa2f..5ff7f26af824 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -125,11 +125,8 @@ void TableManager::utext(const sal_uInt8* data, std::size_t len)
void TableManager::text(const sal_uInt8* data, std::size_t len)
{
// optimization: cell/row end characters are the last characters in a run
- if (len > 0)
- {
- if (data[len - 1] == 0x7)
- handle0x7();
- }
+ if (len > 0 && data[len - 1] == 0x7)
+ handle0x7();
}
void TableManager::handle0x7()
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index eb4dcbcd41a7..8f0ad98c9702 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -783,15 +783,12 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS
beans::PropertyValue embeddingsTemp;
// This will add all .xlsx and .bin to grabbag list.
- if(bFound)
+ if(bFound && mxEmbeddings.is())
{
- if(mxEmbeddings.is())
- {
- embeddingsTemp.Name = embeddingsTarget;
- embeddingsTemp.Value <<= mxEmbeddings;
- aEmbeddings.push_back(embeddingsTemp);
- mxEmbeddings.clear();
- }
+ embeddingsTemp.Name = embeddingsTarget;
+ embeddingsTemp.Value <<= mxEmbeddings;
+ aEmbeddings.push_back(embeddingsTemp);
+ mxEmbeddings.clear();
}
bFound = false;
bHeaderFooterFound = false;
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 2c0c1a64d515..b38330ca26c8 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -891,11 +891,8 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
}
// Handle horizontal flip.
- if (obFlipH == true)
- {
- if (xPropertySet.is())
- xPropertySet->setPropertyValue("IsMirrored", uno::makeAny(true));
- }
+ if (obFlipH == true && xPropertySet.is())
+ xPropertySet->setPropertyValue("IsMirrored", uno::makeAny(true));
return;
}