summaryrefslogtreecommitdiffstats
path: root/src/io
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
commit169dff19d4da8d76e69b8e896aa25b0013639c03 (patch)
treea0c070fa95188b5cde708ac285e6a2db9df4a83f /src/io
parentAvoid creating a new document before opening an old document. (diff)
downloadinkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz
inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip
modernize loops
Diffstat (limited to 'src/io')
-rw-r--r--src/io/resource-manager.cpp10
-rw-r--r--src/io/stream/inkscapestream.cpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/io/resource-manager.cpp b/src/io/resource-manager.cpp
index ada60390e..48ef6ff76 100644
--- a/src/io/resource-manager.cpp
+++ b/src/io/resource-manager.cpp
@@ -260,8 +260,8 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us
Glib::RefPtr<Gtk::RecentManager> recentMgr = Gtk::RecentManager::get_default();
std::vector< Glib::RefPtr<Gtk::RecentInfo> > recentItems = recentMgr->get_items();
- for ( std::vector< Glib::RefPtr<Gtk::RecentInfo> >::iterator it = recentItems.begin(); it != recentItems.end(); ++it ) {
- Glib::ustring uri = (*it)->get_uri();
+ for (auto & recentItem : recentItems) {
+ Glib::ustring uri = recentItem->get_uri();
std::string scheme = Glib::uri_parse_scheme(uri);
if ( scheme == "file" ) {
try {
@@ -278,11 +278,11 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us
}
// At the moment we expect this list to contain file:// references, or simple relative or absolute paths.
- for ( std::vector<Glib::ustring>::const_iterator it = brokenLinks.begin(); it != brokenLinks.end(); ++it ) {
+ for (const auto & brokenLink : brokenLinks) {
// TODO debug g_message("========{%s}", it->c_str());
std::string uri;
- if ( extractFilepath( *it, uri ) || reconstructFilepath( *it, uri ) ) {
+ if ( extractFilepath( brokenLink, uri ) || reconstructFilepath( brokenLink, uri ) ) {
// We were able to get some path. Check it
std::string origPath = uri;
@@ -315,7 +315,7 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us
bool isAbsolute = Glib::path_is_absolute( uri );
Glib::ustring replacement = isAbsolute ? Glib::filename_to_uri( uri ) : Glib::filename_to_utf8( uri );
- result[*it] = replacement;
+ result[brokenLink] = replacement;
}
}
}
diff --git a/src/io/stream/inkscapestream.cpp b/src/io/stream/inkscapestream.cpp
index 56ef7854e..bc6dc1d7f 100644
--- a/src/io/stream/inkscapestream.cpp
+++ b/src/io/stream/inkscapestream.cpp
@@ -508,8 +508,8 @@ Writer &BasicWriter::writeUString(const Glib::ustring &str)
*/
Writer &BasicWriter::writeStdString(const std::string &str)
{
- for (auto it = str.begin(); it != str.end(); ++it) {
- put(*it);
+ for (char it : str) {
+ put(it);
}
return *this;
}