diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2018-04-06 09:02:28 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2018-04-06 13:10:33 +0200 |
commit | a8e93f46df9feb7f7241826307af51befdb25d9e (patch) | |
tree | 96a80ea4ec6b47221e54292ab18a3f0da4c867b4 /poppler/FileSpec.cc | |
parent | 07180b86786cce95df4e2433a7cf3e006749a0f5 (diff) |
Make Object return const GooString pointer
This helps making sure noone is changing strings that belong to objects without us realizing.
In fact noone was doing except an ifdef for windows, fixed it to not modify the dict contents anymore
Diffstat (limited to 'poppler/FileSpec.cc')
-rw-r--r-- | poppler/FileSpec.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc index 89894e23..a5cb947a 100644 --- a/poppler/FileSpec.cc +++ b/poppler/FileSpec.cc @@ -9,6 +9,7 @@ // Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net> // Copyright (C) 2012, 2017 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2012 Hib Eris <hib@hiberis.nl> +// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -234,7 +235,7 @@ Object getFileSpecNameForPlatform (Object *fileSpec) // system-dependent path manipulation #ifdef _WIN32 int i, j; - GooString *name = fileName.getString(); + GooString *name = fileName.getString()->copy(); // "//...." --> "\...." // "/x/...." --> "x:\...." // "/server/share/...." --> "\\server\share\...." @@ -274,6 +275,7 @@ Object getFileSpecNameForPlatform (Object *fileSpec) name->del(i); } } + fileName = Object(name); #endif /* _WIN32 */ return fileName; |