diff options
author | Karl Berry <karl@freefriends.org> | 2017-01-31 18:37:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-01-31 18:37:40 +0000 |
commit | 4c245316c293169ee655c8e2f922b4bee454f9bc (patch) | |
tree | 2d3b72165f3e7e1298df8dad8b52f119a42228dc /Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp | |
parent | 54a2f67f996dceca3c89276dea798f746b3cacaf (diff) |
import original dvisvgm-2.1
git-svn-id: svn://tug.org/texlive/trunk@43102 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp')
-rw-r--r-- | Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp index 34efddfac4e..ad09f800d7e 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DvisvgmSpecialHandler.cpp @@ -2,7 +2,7 @@ ** DvisvgmSpecialHandler.cpp ** ** ** ** This file is part of dvisvgm -- a fast DVI to SVG converter ** -** Copyright (C) 2005-2016 Martin Gieseking <martin.gieseking@uos.de> ** +** Copyright (C) 2005-2017 Martin Gieseking <martin.gieseking@uos.de> ** ** ** ** This program is free software; you can redistribute it and/or ** ** modify it under the terms of the GNU General Public License as ** @@ -21,13 +21,13 @@ #include <config.h> #include <cstring> #include <utility> -#include "DvisvgmSpecialHandler.h" -#include "InputBuffer.h" -#include "InputReader.h" -#include "Length.h" -#include "SpecialActions.h" -#include "XMLNode.h" -#include "XMLString.h" +#include "DvisvgmSpecialHandler.hpp" +#include "InputBuffer.hpp" +#include "InputReader.hpp" +#include "Length.hpp" +#include "SpecialActions.hpp" +#include "XMLNode.hpp" +#include "XMLString.hpp" using namespace std; @@ -76,7 +76,7 @@ void DvisvgmSpecialHandler::preprocessRawSet (InputReader &ir) { throw SpecialException("redefinition of SVG fragment '" + id + "'"); } pair<string, StringVector> entry(id, StringVector()); - pair<MacroMap::iterator, bool> state = _macros.insert(entry); + pair<MacroMap::iterator, bool> state = _macros.emplace(move(entry)); _currentMacro = state.first; } @@ -92,7 +92,7 @@ void DvisvgmSpecialHandler::preprocessRaw (InputReader &ir) { return; string str = ir.getLine(); if (!str.empty()) - _currentMacro->second.push_back(string("P")+str); + _currentMacro->second.emplace_back(string("P")+str); } @@ -101,7 +101,7 @@ void DvisvgmSpecialHandler::preprocessRawDef (InputReader &ir) { return; string str = ir.getLine(); if (!str.empty()) - _currentMacro->second.push_back(string("D")+str); + _currentMacro->second.emplace_back(string("D")+str); } @@ -225,10 +225,10 @@ void DvisvgmSpecialHandler::processRawPut (InputReader &ir, SpecialActions &acti if (it == _macros.end()) throw SpecialException("undefined SVG fragment '" + id + "' referenced"); - StringVector &defs = it->second; - for (StringVector::iterator defs_it=defs.begin(); defs_it != defs.end(); ++defs_it) { - char &type = defs_it->at(0); - string def = defs_it->substr(1); + StringVector &defvector = it->second; + for (string &defstr : defvector) { + char &type = defstr[0]; + string def = defstr.substr(1); if ((type == 'P' || type == 'D') && !def.empty()) { expand_constants(def, actions); if (type == 'P') @@ -331,12 +331,12 @@ void DvisvgmSpecialHandler::dviPreprocessingFinished () { void DvisvgmSpecialHandler::dviEndPage (unsigned, SpecialActions&) { - for (MacroMap::iterator map_it=_macros.begin(); map_it != _macros.end(); ++map_it) { - StringVector &vec = map_it->second; - for (StringVector::iterator str_it=vec.begin(); str_it != vec.end(); ++str_it) { + for (auto &strvecpair : _macros) { + StringVector &vec = strvecpair.second; + for (string &str : vec) { // activate locked parts of a pattern again - if (str_it->at(0) == 'L') - str_it->at(0) = 'D'; + if (str[0] == 'L') + str[0] = 'D'; } } } |