summaryrefslogtreecommitdiff
path: root/qt5
diff options
context:
space:
mode:
authorBogdan Cristea <cristeab@gmail.com>2014-01-27 20:06:11 +0100
committerAlbert Astals Cid <aacid@kde.org>2014-01-27 20:06:11 +0100
commit31edf585e62f4e91b7b64295cc8b978ac466ce58 (patch)
tree90ca1d2087e54928e50c6f74bfd171e89f13df38 /qt5
parent834cd18e3ddfda44a11316290f7eee98cd871305 (diff)
[qt] Improve compilation under Win 8 with Visual Studio 2012
Bug #73111
Diffstat (limited to 'qt5')
-rw-r--r--qt5/src/poppler-private.h6
-rw-r--r--qt5/tests/stress-threads-qt5.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h
index 0a132f07..6eb96122 100644
--- a/qt5/src/poppler-private.h
+++ b/qt5/src/poppler-private.h
@@ -7,6 +7,7 @@
* Copyright (C) 2011 Hib Eris <hib@hiberis.nl>
* Copyright (C) 2012, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
* Copyright (C) 2013 Anthony Granger <grangeranthony@gmail.com>
+ * Copyright (C) 2014 Bogdan Cristea <cristeab@gmail.com>
* Inspired on code by
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es>
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
@@ -84,9 +85,10 @@ namespace Poppler {
init();
m_filePath = filePath;
-#if defined(_WIN32)
+#ifdef _WIN32
wchar_t *fileName = new WCHAR[filePath.length()];
- int length = filePath.toWCharArray(fileName);
+ 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;
#else
diff --git a/qt5/tests/stress-threads-qt5.cpp b/qt5/tests/stress-threads-qt5.cpp
index 2a24a351..36d75dc4 100644
--- a/qt5/tests/stress-threads-qt5.cpp
+++ b/qt5/tests/stress-threads-qt5.cpp
@@ -1,5 +1,10 @@
+#ifndef _WIN32
#include <unistd.h>
+#else
+#include <Windows.h>
+#define sleep Sleep
+#endif
#include <time.h>
#include <poppler-qt5.h>