From 5a341e126709e3c9ef01680e116d5ce0d55d9f8c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 10 Mar 2018 17:00:23 +0100 Subject: Use for-range loops in drawinglayer and dtrans Change-Id: I4d3368e2ffa4d98c04d69b8f5ef485558d812fda Reviewed-on: https://gerrit.libreoffice.org/51047 Tested-by: Jenkins Reviewed-by: Julien Nabet --- dtrans/source/generic/clipboardmanager.cxx | 7 ++----- dtrans/source/win32/dtobj/FmtFilter.cxx | 13 +++++-------- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'dtrans') diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx index c916bd5e0b60..0106cccd372a 100644 --- a/dtrans/source/generic/clipboardmanager.cxx +++ b/dtrans/source/generic/clipboardmanager.cxx @@ -157,12 +157,9 @@ void SAL_CALL ClipboardManager::dispose() aGuard2.clear(); // dispose all clipboards still in list - ClipboardMap::iterator iter = aCopy.begin(); - ClipboardMap::iterator imax = aCopy.end(); - - for (; iter != imax; ++iter) + for (auto const& elem : aCopy) { - Reference< XComponent > xComponent(iter->second, UNO_QUERY); + Reference< XComponent > xComponent(elem.second, UNO_QUERY); if (xComponent.is()) { try diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index c4580337a9bf..f8d04091a368 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -347,10 +347,9 @@ size_t CalcSizeForStringListBuffer(const FileList_t& fileList) return 0; size_t size = 1; // one for the very final '\0' - FileList_t::const_iterator iter_end = fileList.end(); - for (FileList_t::const_iterator iter = fileList.begin(); iter != iter_end; ++iter) + for (auto const& elem : fileList) { - size += iter->length() + 1; // length including terminating '\0' + size += elem.length() + 1; // length including terminating '\0' } return (size * sizeof(FileList_t::value_type::value_type)); } @@ -366,12 +365,10 @@ ByteSequence_t FileListToByteSequence(const FileList_t& fileList) wchar_t* p = reinterpret_cast(bseq.getArray()); ZeroMemory(p, size); - FileList_t::const_iterator iter; - FileList_t::const_iterator iter_end = fileList.end(); - for (iter = fileList.begin(); iter != iter_end; ++iter) + for (auto const& elem : fileList) { - wcsncpy(p, iter->c_str(), iter->length()); - p += (iter->length() + 1); + wcsncpy(p, elem.c_str(), elem.length()); + p += (elem.length() + 1); } } return bseq; -- cgit