summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp
index b10e7c0c9da..5881a8f8af6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp
@@ -2,7 +2,7 @@
** CMapManager.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 **
@@ -20,22 +20,16 @@
#include <config.h>
#include <sstream>
-#include "CMap.h"
-#include "CMapManager.h"
-#include "CMapReader.h"
-#include "FileFinder.h"
-#include "Font.h"
-#include "Message.h"
+#include "CMap.hpp"
+#include "CMapManager.hpp"
+#include "CMapReader.hpp"
+#include "FileFinder.hpp"
+#include "Font.hpp"
+#include "Message.hpp"
using namespace std;
-CMapManager::~CMapManager () {
- for (CMaps::iterator it=_cmaps.begin(); it != _cmaps.end(); ++it)
- delete it->second;
-}
-
-
CMapManager& CMapManager::instance () {
static CMapManager cmm;
return cmm;
@@ -46,7 +40,7 @@ CMapManager& CMapManager::instance () {
CMap* CMapManager::lookup (const string &name) {
CMaps::iterator it = _cmaps.find(name);
if (it != _cmaps.end())
- return it->second;
+ return it->second.get();
if (_includedCMaps.find(name) != _includedCMaps.end()) {
_level = 0;
@@ -63,7 +57,7 @@ CMap* CMapManager::lookup (const string &name) {
else if (name == "unicode")
cmap = new UnicodeCMap;
if (cmap) {
- _cmaps[name] = cmap;
+ _cmaps[name].reset(cmap);
return cmap;
}
// Load cmap data of file <name> and also process all cmaps referenced by operator "usecmap".
@@ -78,7 +72,7 @@ CMap* CMapManager::lookup (const string &name) {
_level = 1;
Message::wstream(true) << "CMap file '" << name << "' not found\n";
}
- _cmaps[name] = cmap;
+ _cmaps[name].reset(cmap);
}
catch (const CMapReaderException &e) {
Message::estream(true) << "CMap file " << name << ": " << e.what() << "\n";
@@ -130,7 +124,7 @@ const CMap* CMapManager::findCompatibleBaseFontMap (const PhysicalFont *font, co
for (size_t i=0; i < charmapIDs.size(); i++) {
if (enc->id == charmapIDs[i]) {
string cmapname = ro+"-"+enc->encname;
- if (is_unicode_map || FileFinder::lookup(cmapname, "cmap", false)) {
+ if (is_unicode_map || FileFinder::instance().lookup(cmapname, "cmap", false)) {
charmapID = enc->id;
return is_unicode_map ? cmap : lookup(cmapname);
}