summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-08 15:49:56 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-08 17:05:41 +0100
commita507d54e4e0764de951ae3de5a0b8b994a4ce7d7 (patch)
tree05ae9cea36463deb1fa382e267522a00ad6e68ac /sc/source/filter/excel
parent732d630c3d2a168c725c18e4dd8df7a0a4f85566 (diff)
Use std::set::count instead of std::set::find + iterator comparison
std::set::contains from C++20 is not here yet :-) Change-Id: I50b5db2d44cb0effa64ab89a16205145883ce374 Reviewed-on: https://gerrit.libreoffice.org/68922 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r--sc/source/filter/excel/xepivotxml.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx
index eed70122dfd8..30fadd4ad722 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -279,8 +279,6 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr
}
}
- auto aDPTypeEnd = aDPTypes.cend();
-
auto pAttList = sax_fastparser::FastSerializerHelper::createAttrList();
// TODO In same cases, disable listing of items, as it is done in MS Excel.
// Exporting savePivotCacheRecordsXml method needs to be updated accordingly
@@ -289,10 +287,10 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr
std::set<ScDPItemData::Type> aDPTypesWithoutBlank = aDPTypes;
aDPTypesWithoutBlank.erase(ScDPItemData::Empty);
- const bool isContainsString
- = aDPTypesWithoutBlank.find(ScDPItemData::String) != aDPTypesWithoutBlank.end();
- bool isContainsBlank = aDPTypes.find(ScDPItemData::Empty) != aDPTypeEnd;
- bool isContainsNumber = !isContainsDate && aDPTypesWithoutBlank.find(ScDPItemData::Value) != aDPTypesWithoutBlank.end();
+ const bool isContainsString = aDPTypesWithoutBlank.count(ScDPItemData::String) > 0;
+ const bool isContainsBlank = aDPTypes.count(ScDPItemData::Empty) > 0;
+ const bool isContainsNumber
+ = !isContainsDate && aDPTypesWithoutBlank.count(ScDPItemData::Value) > 0;
bool isContainsNonDate = !(isContainsDate && aDPTypesWithoutBlank.size() <= 1);
// XML_containsSemiMixedTypes possible values: