tdf#130857 chart2: Don't modify dialog modality while it's shown
RangeSelectionListenerParent::enableRangeChoosing both sets the
dialog's visibility and modality. So far, it was first setting
the modality and then the visibility.
However, changing the modality while the dialog is shown
doesn't work as expected when using the qt6 vcl plugin
with native Qt widgets with upcoming commit
Change-Id: I53cbd9061ef473deba2124f17976f24b11c1712a
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Jul 22 17:27:01 2026 +0200
tdf#130857 qt weld: Support chart "Data Ranges" dialog
in place and would result in an inability to select the
data area as the main window would remain insensitive/disabled
for the following case:
* start Calc
* "Insert" -> "Chart"
* confirm with "Finish"
* with chart still selected, press the context menu key
(or click with right mouse button) to open the context menu
* select the "Data Ranges..." context menu entry
* in the "Data Range" tab, press the "Select data range" button
* try to click into the document and drag to make a selection
The native Qt implementation wouldn't require changing
modality back and forth, but gtk3 and the gen vcl plugin
would show the same problem as described above when not
setting the dialog to non-modal in the case it gets hidden.
Make all of them work by setting the modality, but always
doing that while the dialog is hidden (not shown), i.e.
either before showing it or after hiding it.
Change-Id: Ia368a919c497d51c4560536995e90f60e3b85768
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208493
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -71,8 +71,12 @@ void RangeSelectionListenerParent::enableRangeChoosing(bool bEnable, weld::Dialo
|
||||
weld::Assistant* pAss = dynamic_cast<weld::Assistant*>(pDlg);
|
||||
if (pAss && bEnable)
|
||||
m_sRestorePageIdent = pAss->get_current_page_ident();
|
||||
if (bEnable)
|
||||
pDlg->hide();
|
||||
// set modality while the dialog is hidden
|
||||
pDlg->set_modal(!bEnable);
|
||||
pDlg->set_visible(!bEnable);
|
||||
if (!bEnable)
|
||||
pDlg->show();
|
||||
if (pAss && !bEnable)
|
||||
pAss->set_current_page(m_sRestorePageIdent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user