diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-27 09:16:56 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-27 09:17:14 +0200 |
commit | 761b71bd20524bc1e495508a52c38a0bc6679a06 (patch) | |
tree | df2748fb11234c9b0dfb82828ce8d76459d185db /src/platformsupport | |
parent | 800941df899a4418d4ac6cebbcc31a40120167bc (diff) | |
parent | 14aa1f7d6ffea29647557f98e654355782f55e66 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/clipboard/qmacmime.mm | 19 | ||||
-rw-r--r-- | src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h | 23 | ||||
-rw-r--r-- | src/platformsupport/windowsuiautomation/uiatypes_p.h | 14 |
3 files changed, 54 insertions, 2 deletions
diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm index f425e34b39..76e9c8712c 100644 --- a/src/platformsupport/clipboard/qmacmime.mm +++ b/src/platformsupport/clipboard/qmacmime.mm @@ -435,8 +435,23 @@ QList<QByteArray> QMacPasteboardMimeUnicodeText::convertFromMime(const QString & if (flavor == QLatin1String("public.utf8-plain-text")) ret.append(string.toUtf8()); #if QT_CONFIG(textcodec) - else if (flavor == QLatin1String("public.utf16-plain-text")) - ret.append(QTextCodec::codecForName("UTF-16")->fromUnicode(string)); + else if (flavor == QLatin1String("public.utf16-plain-text")) { + QTextCodec::ConverterState state; +#if defined(Q_OS_MACOS) + // Some applications such as Microsoft Excel, don't deal well with + // a BOM present, so we follow the traditional approach of Qt on + // macOS to not generate public.utf16-plain-text with a BOM. + state.flags = QTextCodec::IgnoreHeader; +#else + // Whereas iOS applications will fail to paste if we do _not_ + // include a BOM in the public.utf16-plain-text content, most + // likely due to converting the data using NSUTF16StringEncoding + // which assumes big-endian byte order if there is no BOM. + state.flags = QTextCodec::DefaultConversion; +#endif + ret.append(QTextCodec::codecForName("UTF-16")->fromUnicode( + string.constData(), string.length(), &state)); + } #endif return ret; } diff --git a/src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h b/src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h index 64c54c694a..fd39b6ee33 100644 --- a/src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h +++ b/src/platformsupport/windowsuiautomation/uiaserverinterfaces_p.h @@ -360,4 +360,27 @@ __CRT_UUID_DECL(IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0 #endif #endif + +#ifndef __IWindowProvider_INTERFACE_DEFINED__ +#define __IWindowProvider_INTERFACE_DEFINED__ +DEFINE_GUID(IID_IWindowProvider, 0x987df77b, 0xdb06, 0x4d77, 0x8f,0x8a, 0x86,0xa9,0xc3,0xbb,0x90,0xb9); +MIDL_INTERFACE("987df77b-db06-4d77-8f8a-86a9c3bb90b9") +IWindowProvider : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE SetVisualState(enum WindowVisualState state) = 0; + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + virtual HRESULT STDMETHODCALLTYPE WaitForInputIdle(int milliseconds, __RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CanMaximize(__RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_CanMinimize(__RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsModal(__RPC__out BOOL *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_WindowVisualState(__RPC__out enum WindowVisualState *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_WindowInteractionState(__RPC__out enum WindowInteractionState *pRetVal) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsTopmost(__RPC__out BOOL *pRetVal) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IWindowProvider, 0x987df77b, 0xdb06, 0x4d77, 0x8f,0x8a, 0x86,0xa9,0xc3,0xbb,0x90,0xb9) +#endif +#endif + #endif diff --git a/src/platformsupport/windowsuiautomation/uiatypes_p.h b/src/platformsupport/windowsuiautomation/uiatypes_p.h index ea58417943..8ef71843a3 100644 --- a/src/platformsupport/windowsuiautomation/uiatypes_p.h +++ b/src/platformsupport/windowsuiautomation/uiatypes_p.h @@ -141,6 +141,20 @@ enum PropertyConditionFlags { PropertyConditionFlags_IgnoreCase = 1 }; +enum WindowVisualState { + WindowVisualState_Normal = 0, + WindowVisualState_Maximized = 1, + WindowVisualState_Minimized = 2 +}; + +enum WindowInteractionState { + WindowInteractionState_Running = 0, + WindowInteractionState_Closing = 1, + WindowInteractionState_ReadyForUserInteraction = 2, + WindowInteractionState_BlockedByModalWindow = 3, + WindowInteractionState_NotResponding = 4 +}; + struct UiaRect { double left; double top; |