mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
Merge pull request #1139 from ONLYOFFICE/patch/hotfix/v8.0.1
Fix bug 65991
This commit is contained in:
@ -36,6 +36,7 @@
|
||||
# include <Shobjidl.h>
|
||||
#endif
|
||||
#include "filechooser.h"
|
||||
#include "utils.h"
|
||||
|
||||
using std::wstring;
|
||||
#ifndef __OS_WIN_XP
|
||||
@ -248,6 +249,7 @@ QStringList Win::openWinFileChooser(QWidget *parent,
|
||||
|
||||
QStringList filenames;
|
||||
HWND parent_hwnd = (parent) ? (HWND)parent->winId() : nullptr;
|
||||
WindowHelper::toggleLayoutDirection(parent_hwnd);
|
||||
nativeFileDialog(parent_hwnd,
|
||||
mode,
|
||||
filenames,
|
||||
@ -258,5 +260,6 @@ QStringList Win::openWinFileChooser(QWidget *parent,
|
||||
sel_filter,
|
||||
sel_multiple);
|
||||
|
||||
WindowHelper::toggleLayoutDirection(parent_hwnd);
|
||||
return filenames;
|
||||
}
|
||||
|
||||
@ -397,6 +397,7 @@ QDialog::DialogCode PrintDialog::exec()
|
||||
PrintDialogCallback clb(&dialog_was_changed);
|
||||
dlg.lpCallback = static_cast<IPrintDialogCallback*>(&clb);
|
||||
|
||||
WindowHelper::toggleLayoutDirection(parent_hwnd);
|
||||
QDialog::DialogCode exit_code = QDialog::DialogCode::Rejected;
|
||||
HRESULT hr = PrintDlgEx(&dlg);
|
||||
if (hr == S_OK) {
|
||||
@ -485,6 +486,7 @@ QDialog::DialogCode PrintDialog::exec()
|
||||
}
|
||||
GlobalFree(page_ranges);
|
||||
|
||||
WindowHelper::toggleLayoutDirection(parent_hwnd);
|
||||
return exit_code;
|
||||
}
|
||||
|
||||
|
||||
@ -1004,6 +1004,16 @@ namespace WindowHelper {
|
||||
::SetActiveWindow(hwnd);
|
||||
::AttachThreadInput(frgID, appID, FALSE);
|
||||
}
|
||||
|
||||
auto toggleLayoutDirection(HWND hwnd) -> void
|
||||
{
|
||||
LONG exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
if (exstyle & WS_EX_LAYOUTRTL)
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, exstyle & ~WS_EX_LAYOUTRTL);
|
||||
else
|
||||
if (AscAppManager::isRtlEnabled())
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, exstyle | WS_EX_LAYOUTRTL);
|
||||
}
|
||||
#endif
|
||||
|
||||
auto correctWindowMinimumSize(const QRect& windowrect, const QSize& minsize) -> QSize
|
||||
|
||||
@ -159,6 +159,7 @@ namespace WindowHelper {
|
||||
auto correctModalOrder(HWND windowhandle, HWND modalhandle) -> void;
|
||||
auto adjustWindowRect(HWND, double, LPRECT) -> void;
|
||||
auto bringToTop(HWND) -> void;
|
||||
auto toggleLayoutDirection(HWND hwnd) -> void;
|
||||
#endif
|
||||
|
||||
auto correctWindowMinimumSize(const QRect&, const QSize&) -> QSize;
|
||||
|
||||
Reference in New Issue
Block a user