summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2023-05-05 00:22:18 +0200
committerAlbert Astals Cid <aacid@kde.org>2023-05-05 00:22:18 +0200
commit47856547b9b56c037049e48453f9ae65aa266a26 (patch)
tree11912bd013e9d80f80edad573c47d33f7ec7fe16
parent1e4488b2b44a56b35dee8e0bf9e33453523eb2ed (diff)
GooString -> std::string
-rw-r--r--poppler/GlobalParamsWin.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index d862775e..2e676bc2 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -336,9 +336,6 @@ static GooString *replaceSuffix(GooString *path, const char *suffixA, const char
void GlobalParams::setupBaseFonts(const char *dir)
{
- const char *dataRoot = popplerDataDir ? popplerDataDir : POPPLER_DATADIR;
- GooString *fileName = nullptr;
-
if (baseFontsInitialized)
return;
baseFontsInitialized = true;
@@ -375,11 +372,11 @@ void GlobalParams::setupBaseFonts(const char *dir)
sysFonts->scanWindowsFonts(winFontDir);
}
- fileName = new GooString(dataRoot);
- fileName->append("/cidfmap");
+ const char *dataRoot = popplerDataDir ? popplerDataDir : POPPLER_DATADIR;
+ const std::string fileName = std::string(dataRoot).append("/cidfmap");
// try to open file
- const std::unique_ptr<GooFile> file = GooFile::open(fileName->toStr());
+ const std::unique_ptr<GooFile> file = GooFile::open(fileName);
if (file) {
Parser *parser;
@@ -405,8 +402,6 @@ void GlobalParams::setupBaseFonts(const char *dir)
}
}
delete parser;
- } else {
- delete fileName;
}
}