summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/winrt')
-rw-r--r--src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp7
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.cpp15
2 files changed, 13 insertions, 9 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp
index e70d06860c..c2f884055d 100644
--- a/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp
+++ b/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp
@@ -171,10 +171,11 @@ void QWinRTPlatformMessageDialogHelper::hide()
HRESULT QWinRTPlatformMessageDialogHelper::onInvoked(ABI::Windows::UI::Popups::IUICommand *command)
{
- HSTRING hLabel;
+ HString hLabel;
UINT32 labelLength;
- command->get_Label(&hLabel);
- QString label = QString::fromWCharArray(::WindowsGetStringRawBuffer(hLabel, &labelLength));
+ command->get_Label(hLabel.GetAddressOf());
+ PCWSTR rawString = hLabel.GetRawBuffer(&labelLength);
+ QString label = QString::fromWCharArray(rawString, labelLength);
int buttonId = -1;
for (int i = QPlatformDialogHelper::FirstButton; i < QPlatformDialogHelper::LastButton; i<<=1) {
if ( options()->standardButtons() & i ) {
diff --git a/src/plugins/platforms/winrt/qwinrtservices.cpp b/src/plugins/platforms/winrt/qwinrtservices.cpp
index 73c090351b..b0f9247d36 100644
--- a/src/plugins/platforms/winrt/qwinrtservices.cpp
+++ b/src/plugins/platforms/winrt/qwinrtservices.cpp
@@ -81,9 +81,11 @@ bool QWinRTServices::openUrl(const QUrl &url)
return QPlatformServices::openUrl(url);
IUriRuntimeClass *uri;
- QString urlString = url.toString(); HSTRING uriString; HSTRING_HEADER header;
- WindowsCreateStringReference((const wchar_t*)urlString.utf16(), urlString.length(), &header, &uriString);
- m_uriFactory->CreateUri(uriString, &uri);
+ QString urlString = url.toString();
+ // ### TODO: Replace with HStringReference when WP8.0 support is removed
+ HString uriString;
+ uriString.Set((const wchar_t*)urlString.utf16(), urlString.length());
+ m_uriFactory->CreateUri(uriString.Get(), &uri);
if (!uri)
return false;
@@ -107,10 +109,11 @@ bool QWinRTServices::openDocument(const QUrl &url)
return QPlatformServices::openDocument(url);
const QString pathString = QDir::toNativeSeparators(url.toLocalFile());
- HSTRING_HEADER header; HSTRING path;
- WindowsCreateStringReference((const wchar_t*)pathString.utf16(), pathString.length(), &header, &path);
+ // ### TODO: Replace with HStringReference when WP8.0 support is removed
+ HString path;
+ path.Set((const wchar_t*)pathString.utf16(), pathString.length());
IAsyncOperation<StorageFile*> *fileOp;
- m_fileFactory->GetFileFromPathAsync(path, &fileOp);
+ m_fileFactory->GetFileFromPathAsync(path.Get(), &fileOp);
if (!fileOp)
return false;