diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h index 0dd40d7..f4a9a64 100644 --- a/qt5/src/poppler-private.h +++ b/qt5/src/poppler-private.h @@ -86,11 +86,7 @@ namespace Poppler { m_filePath = filePath; #ifdef _WIN32 - wchar_t *fileName = new WCHAR[filePath.length()]; - std::wstring wstr = (const wchar_t *)filePath.utf16(); - int length = wstr._Copy_s(fileName, filePath.length(), filePath.length()); - doc = new PDFDoc(fileName, length, ownerPassword, userPassword); - delete[] fileName; + doc = new PDFDoc((wchar_t *)filePath.utf16(), filePath.length(), ownerPassword, userPassword); #else GooString *fileName = new GooString(QFile::encodeName(filePath)); doc = new PDFDoc(fileName, ownerPassword, userPassword);