Description: Now that C++20 is the baseline for LibreOffice code, it is possible to use C++ features that are only available since C++20. One of the new features of C++20 is the availability of new functions for working with containers more conveniently. This EasyHack is about using contains(). See this commit: 06e3877dc2cf22e00d04b48453e9ab0b948c3ca2 Other than the first part, which is the introduction of contains(), you see changes like this for some variables of type map: - CPPUNIT_ASSERT(aMap.find("LocalURL") != aMap.end()); + CPPUNIT_ASSERT(aMap.contains("LocalURL")); Instead of searching for a specific key, and when reaching .end() concluding that the value is not there, the new code is simply using contains() function to check if the key is present in the map, or not. The actual map data type is SequenceAsHashMapBase, and is based on std::unordered_map. You can read more about contains() here: https://en.cppreference.com/w/cpp/container/map/contains Finding instances: You an use grep to find some instances. For example: $ git grep -n -i "map.find(" | grep "!=" | grep "end(" Working with IDEs: If your IDE is a few years old, there is a chance that it can not recognize contains(). Also, if you have built the project file before, you may have to rebuild the project again. This is needed to make sure that the project files contain the C++20 compatibility option, and not for example C++17. https://wiki.documentfoundation.org/Development/IDE In any case, you need to make sure that LibreOffice can be built correctly.
Luv Sharma committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a058fa6eb87dcc4a01dac14674e15ff3ba611ced tdf#158237 chart2: use c++20 contains() instead of find() and end() It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Steven Casey (SMCode) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a3df4852b8cc1a1445fdc1fe0057b94a5405376d tdf#158237 comphelper: Use C++20 contains() instead of find() and end() It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
AkshayWarrier committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/488cd78f3b30f8b43007a3250d0c11fd0416dde9 tdf#158237 comphelper: Use C++20 contains() instead of find() and end() It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sujatro Bhadra committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ddd5017410f4ec2f4860a27f4946e05458686afd tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Beeram_12 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7174403b03a7effe8bedf78368c09840b4fdf7a9 tdf#158237 use c++20 contains() instead of find() and end() It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
RMZeroFour committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/74299624ec810f9683326608ad398211cf51787b tdf#158237 Use contains instead of find-end It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Aaron Bourdeaux committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6c358c28c5cc2d1d8d8bb9d1238e3546a9bf3ce8 tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Zainab Abbasi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b00183ebb29d19cb59145a3d240554f8e3573a0b tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sohrab Kazak committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/84662e0454eddd928dfdf3cd8f7fe675db6a1fcf tdf#158237 Using C++20 contains instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sakura286 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7bd9aaccb99287e4e50fb18759edc7688502a1fb tdf#158237 comphelper: Use C++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Jack Honour committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a308151714a2bc811f6f147055175de9767d313a tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Simon Chenery committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c6fd44d819f77d499aa939e29c5206f04ac731f3 tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Simon Chenery committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/678f732d9cc5b9a73e633d77bd2d1ae34700ed3d tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan Buzea committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/991a7b44da24cce0a828ec8f2d7472ce76cbab79 tdf#158237 sw: use c++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan Buzea committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/905fa8f49d98d7ce986333b781f0462be6dfa49e tdf#158237 chart2: use c++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan Buzea committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eb8e6ddd6a4c2336c882644462aecc4359766695 tdf#158237 dbaccess: use c++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan Buzea committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9c0443de3981256ffdb438a4b5ac4f7dd68c574d tdf#158237 connectivity: use c++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Manish committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6c0b18e06a83648478a55db45783868f583936b0 tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Rosh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f5976b8d0b826c0273b616699d1af639beb9f2f1 tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Johann committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bf7ac07c04cb06316b745eb9716787b16c1314dd tdf#158237: Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
kkasliwal committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7994ecabf6841512fd2449d161686ace9221c60d tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Simon Chenery committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1fc03eaed2899ac041f660f54cb1facb71390ccf tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Simon Chenery committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eb955488499bcb92721ac6ec72b6fc95014915a0 tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Simon Chenery committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/321881ca09ccb84a8d8c12f2aa0df9f54b2521ae tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Devashish Gupta committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/81dfc7afcdc473bd655ff64038e8a449a9999c0c tdf#158237 Use C++20 contains() instead of find() and end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Nam Bui committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ffbc2198363c346c4bf14bb63c3dc99a54dd1f8e tdf#158237 C++20 contains() instead of find(), end() It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.