summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-15 11:52:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-15 16:59:42 +0100
commit0880fb5e3e455cbe5279c6f9cdcd0772cff11312 (patch)
treebc5656631d0e8306403baeb4540e15ec845d5bfa
parentd5670177aacde2d722cfba6fe8083544549533e0 (diff)
use GetPopupParent for editeng transient dialogs
Change-Id: Ie799643b68ea41b4c4d0d0493755d09d3983d9e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110934 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx2
-rw-r--r--cui/source/dialogs/thesdlg.cxx2
-rw-r--r--cui/source/factory/dlgfact.cxx4
-rw-r--r--cui/source/factory/dlgfact.hxx4
-rw-r--r--cui/source/inc/hangulhanjadlg.hxx2
-rw-r--r--cui/source/inc/thesdlg.hxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx7
-rw-r--r--editeng/source/editeng/textconv.cxx2
-rw-r--r--editeng/source/editeng/textconv.hxx4
-rw-r--r--editeng/source/misc/hangulhanja.cxx8
-rw-r--r--include/editeng/edtdlg.hxx4
-rw-r--r--include/editeng/hangulhanja.hxx4
-rw-r--r--include/vcl/weld.hxx7
-rw-r--r--vcl/inc/salvtables.hxx4
-rw-r--r--vcl/source/app/salvtables.cxx16
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx33
16 files changed, 55 insertions, 50 deletions
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index b2da62f49bd0..76c6bdd000a7 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -416,7 +416,7 @@ namespace svx
m_xListBox->set_help_id(HID_HANGULDLG_SUGGESTIONS_LIST);
}
- HangulHanjaConversionDialog::HangulHanjaConversionDialog(weld::Window* pParent)
+ HangulHanjaConversionDialog::HangulHanjaConversionDialog(weld::Widget* pParent)
: GenericDialogController(pParent, "cui/ui/hangulhanjaconversiondialog.ui", "HangulHanjaConversionDialog")
, m_bDocumentMode( true )
, m_xFind(m_xBuilder->weld_button("find"))
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 612f5fe019b2..19580b007616 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -234,7 +234,7 @@ IMPL_LINK_NOARG(SvxThesaurusDialog, SelectFirstHdl_Impl, void *, void)
// class SvxThesaurusDialog ----------------------------------------------
SvxThesaurusDialog::SvxThesaurusDialog(
- weld::Window* pParent,
+ weld::Widget* pParent,
uno::Reference< linguistic2::XThesaurus > const & xThes,
const OUString &rWord,
LanguageType nLanguage)
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index d10914440db5..d371224ffa20 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1066,12 +1066,12 @@ VclPtr<AbstractSvxCaptionDialog> AbstractDialogFactory_Impl::CreateCaptionDialog
return VclPtr<AbstractSvxCaptionDialog_Impl>::Create(std::make_shared<SvxCaptionTabDialog>(pParent, pView, nAnchorTypes));
}
-VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(weld::Window* pParent)
+VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(weld::Widget* pParent)
{
return VclPtr<AbstractHangulHanjaConversionDialog_Impl>::Create(std::make_unique<HangulHanjaConversionDialog>(pParent));
}
-VclPtr<AbstractThesaurusDialog> AbstractDialogFactory_Impl::CreateThesaurusDialog(weld::Window* pParent,
+VclPtr<AbstractThesaurusDialog> AbstractDialogFactory_Impl::CreateThesaurusDialog(weld::Widget* pParent,
css::uno::Reference<css::linguistic2::XThesaurus> xThesaurus,
const OUString &rWord, LanguageType nLanguage)
{
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 87ad9730b307..7d97167193b8 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -791,8 +791,8 @@ public:
virtual VclPtr<SfxAbstractPasteDialog> CreatePasteDialog(weld::Window* pParent) override;
virtual VclPtr<SfxAbstractLinksDialog> CreateLinksDialog(weld::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML = false, sfx2::SvBaseLink* p=nullptr) override;
- virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog(weld::Window* pParent) override;
- virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog(weld::Window*,
+ virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog(weld::Widget* pParent) override;
+ virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog(weld::Widget*,
css::uno::Reference<css::linguistic2::XThesaurus> xThesaurus,
const OUString &rWord, LanguageType nLanguage) override;
diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx
index 61d7f6317246..716efa0827b8 100644
--- a/cui/source/inc/hangulhanjadlg.hxx
+++ b/cui/source/inc/hangulhanjadlg.hxx
@@ -118,7 +118,7 @@ namespace svx
std::unique_ptr<weld::CheckButton> m_xHanjaOnly;
std::unique_ptr<weld::CheckButton> m_xReplaceByChar;
public:
- HangulHanjaConversionDialog(weld::Window* pParent);
+ HangulHanjaConversionDialog(weld::Widget* pParent);
virtual ~HangulHanjaConversionDialog() override;
public:
diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx
index 9953b6b30014..de085d678682 100644
--- a/cui/source/inc/thesdlg.hxx
+++ b/cui/source/inc/thesdlg.hxx
@@ -69,7 +69,7 @@ public:
void LookUp_Impl();
public:
- SvxThesaurusDialog(weld::Window* pParent,
+ SvxThesaurusDialog(weld::Widget* pParent,
css::uno::Reference< css::linguistic2::XThesaurus > const & xThesaurus,
const OUString &rWord, LanguageType nLanguage);
void SetWindowTitle( LanguageType nLanguage );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index e42a36c5e826..9e2a551e2481 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1561,7 +1561,9 @@ void ImpEditEngine::Convert( EditView* pEditView,
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pConvInfo->aConvStart )
bIsStart = true;
- TextConvWrapper aWrp( pEditView->GetWindow()->GetFrameWeld(),
+ tools::Rectangle aDummy;
+ pEditView->pImpEditView->DrawSelectionXOR();
+ TextConvWrapper aWrp( pEditView->pImpEditView->GetPopupParent(aDummy),
::comphelper::getProcessComponentContext(),
LanguageTag::convertToLocale( nSrcLang ),
LanguageTag::convertToLocale( nDestLang ),
@@ -2440,7 +2442,8 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
return EESpellState::ErrorFound;
EditAbstractDialogFactory* pFact = EditAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog(pEditView->GetWindow()->GetFrameWeld(), xThes,
+ tools::Rectangle aDummy;
+ ScopedVclPtr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog(pEditView->pImpEditView->GetPopupParent(aDummy), xThes,
aWord, GetLanguage( aCurSel.Max() ) ));
if (xDlg->Execute() == RET_OK)
{
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx
index 3caa1124ce2b..7c4ed9ddd89d 100644
--- a/editeng/source/editeng/textconv.cxx
+++ b/editeng/source/editeng/textconv.cxx
@@ -32,7 +32,7 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
using namespace com::sun::star::linguistic2;
-TextConvWrapper::TextConvWrapper( weld::Window* pWindow,
+TextConvWrapper::TextConvWrapper( weld::Widget* pWindow,
const Reference< XComponentContext >& rxContext,
const lang::Locale& rSourceLocale,
const lang::Locale& rTargetLocale,
diff --git a/editeng/source/editeng/textconv.hxx b/editeng/source/editeng/textconv.hxx
index 536c0c1674d8..6afb20acf966 100644
--- a/editeng/source/editeng/textconv.hxx
+++ b/editeng/source/editeng/textconv.hxx
@@ -38,7 +38,7 @@ class TextConvWrapper final : public editeng::HangulHanjaConversion
// starts from the cursor position
EditView * m_pEditView;
- weld::Window * m_pWin;
+ weld::Widget* m_pWin;
bool m_bStartChk;
bool m_bStartDone;
@@ -90,7 +90,7 @@ class TextConvWrapper final : public editeng::HangulHanjaConversion
public:
- TextConvWrapper(weld::Window* pWindow,
+ TextConvWrapper(weld::Widget* pWindow,
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::lang::Locale& rSourceLocale,
const css::lang::Locale& rTargetLocale,
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 1eac907e55b6..1b4911d4ccd4 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -67,7 +67,7 @@ namespace editeng
// general
VclPtr<AbstractHangulHanjaConversionDialog>
m_pConversionDialog; // the dialog to display for user interaction
- weld::Window* m_pUIParent; // the parent window for any UI we raise
+ weld::Widget* m_pUIParent; // the parent window for any UI we raise
Reference< XComponentContext >
m_xContext; // the service factory to use
Reference< XExtendedTextConversion >
@@ -117,7 +117,7 @@ namespace editeng
public:
HangulHanjaConversion_Impl(
- weld::Window* pUIParent,
+ weld::Widget* pUIParent,
const Reference< XComponentContext >& rxContext,
const lang::Locale& _rSourceLocale,
const lang::Locale& _rTargetLocale,
@@ -225,7 +225,7 @@ namespace editeng
HangulHanjaConversion_Impl::StringMap HangulHanjaConversion_Impl::m_aRecentlyUsedList = HangulHanjaConversion_Impl::StringMap();
- HangulHanjaConversion_Impl::HangulHanjaConversion_Impl( weld::Window* pUIParent,
+ HangulHanjaConversion_Impl::HangulHanjaConversion_Impl( weld::Widget* pUIParent,
const Reference< XComponentContext >& rxContext,
const lang::Locale& _rSourceLocale,
const lang::Locale& _rTargetLocale,
@@ -937,7 +937,7 @@ namespace editeng
bool HangulHanjaConversion::m_bTryBothDirectionsSave = false;
HHC::ConversionDirection HangulHanjaConversion::m_ePrimaryConversionDirectionSave = HHC::eHangulToHanja;
- HangulHanjaConversion::HangulHanjaConversion( weld::Window* pUIParent,
+ HangulHanjaConversion::HangulHanjaConversion( weld::Widget* pUIParent,
const Reference< XComponentContext >& rxContext,
const lang::Locale& _rSourceLocale, const lang::Locale& _rTargetLocale,
const vcl::Font* _pTargetFont,
diff --git a/include/editeng/edtdlg.hxx b/include/editeng/edtdlg.hxx
index 1cadb9978042..a9f616627aa3 100644
--- a/include/editeng/edtdlg.hxx
+++ b/include/editeng/edtdlg.hxx
@@ -93,7 +93,7 @@ class EDITENG_DLLPUBLIC EditAbstractDialogFactory : virtual public VclAbstractDi
public:
virtual ~EditAbstractDialogFactory() override; // needed for export of vtable
static EditAbstractDialogFactory* Create();
- virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog(weld::Window*,
+ virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog(weld::Widget*,
css::uno::Reference<css::linguistic2::XThesaurus> xThesaurus,
const OUString &rWord, LanguageType nLanguage) = 0;
@@ -101,7 +101,7 @@ public:
const OUString &rWord, LanguageType nLang,
css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper) = 0;
- virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog(weld::Window* pParent) = 0;
+ virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog(weld::Widget* pParent) = 0;
};
#endif
diff --git a/include/editeng/hangulhanja.hxx b/include/editeng/hangulhanja.hxx
index 202f44a1bb8e..25c7d0b1d354 100644
--- a/include/editeng/hangulhanja.hxx
+++ b/include/editeng/hangulhanja.hxx
@@ -27,7 +27,7 @@ namespace com::sun::star::lang { struct Locale; }
namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::uno { template <class E> class Sequence; }
namespace vcl { class Font; }
-namespace weld { class Window; }
+namespace weld { class Widget; }
namespace editeng
@@ -108,7 +108,7 @@ namespace editeng
public:
HangulHanjaConversion(
- weld::Window* pUIParent,
+ weld::Widget* pUIParent,
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::lang::Locale& _rSourceLocale,
const css::lang::Locale& _rTargetLocale,
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 6f734be32b6d..2c0c5f6b5724 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -287,6 +287,8 @@ public:
virtual void freeze() = 0;
virtual void thaw() = 0;
+ virtual void set_busy_cursor(bool bBusy) = 0;
+
virtual std::unique_ptr<Container> weld_parent() const = 0;
//iterate upwards through the hierarchy starting at this widgets parent,
@@ -476,7 +478,6 @@ protected:
public:
virtual void set_title(const OUString& rTitle) = 0;
virtual OUString get_title() const = 0;
- virtual void set_busy_cursor(bool bBusy) = 0;
virtual void window_move(int x, int y) = 0;
virtual void set_modal(bool bModal) = 0;
virtual bool get_modal() const = 0;
@@ -523,10 +524,10 @@ public:
class VCL_DLLPUBLIC WaitObject
{
private:
- weld::Window* m_pWindow;
+ weld::Widget* m_pWindow;
public:
- WaitObject(weld::Window* pWindow)
+ WaitObject(weld::Widget* pWindow)
: m_pWindow(pWindow)
{
if (m_pWindow)
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 11aab8917f7e..b8c5888572d0 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -337,6 +337,8 @@ public:
virtual void thaw() override;
+ virtual void set_busy_cursor(bool bBusy) override;
+
virtual std::unique_ptr<weld::Container> weld_parent() const override;
virtual ~SalInstanceWidget() override;
@@ -434,8 +436,6 @@ public:
void help();
- virtual void set_busy_cursor(bool bBusy) override;
-
virtual css::uno::Reference<css::awt::XWindow> GetXWindow() override;
virtual void resize_to_request() override;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 21c3e206fa88..378a43f54896 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -485,6 +485,14 @@ void SalInstanceWidget::freeze() { m_xWidget->SetUpdateMode(false); }
void SalInstanceWidget::thaw() { m_xWidget->SetUpdateMode(true); }
+void SalInstanceWidget::set_busy_cursor(bool bBusy)
+{
+ if (bBusy)
+ m_xWidget->EnterWait();
+ else
+ m_xWidget->LeaveWait();
+}
+
SalInstanceWidget::~SalInstanceWidget()
{
if (m_aMnemonicActivateHdl.IsSet())
@@ -1336,14 +1344,6 @@ void SalInstanceWindow::set_title(const OUString& rTitle) { m_xWindow->SetText(r
OUString SalInstanceWindow::get_title() const { return m_xWindow->GetText(); }
-void SalInstanceWindow::set_busy_cursor(bool bBusy)
-{
- if (bBusy)
- m_xWindow->EnterWait();
- else
- m_xWindow->LeaveWait();
-}
-
css::uno::Reference<css::awt::XWindow> SalInstanceWindow::GetXWindow()
{
css::uno::Reference<css::awt::XWindow> xWindow(m_xWindow->GetComponentInterface(),
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 8f0754d4325e..edffff102d48 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1922,6 +1922,18 @@ void LocalizeDecimalSeparator(GdkEventKey* pEvent)
}
}
+void set_cursor(GtkWidget* pWidget, const char *pName)
+{
+ if (!gtk_widget_get_realized(pWidget))
+ gtk_widget_realize(pWidget);
+ GdkDisplay *pDisplay = gtk_widget_get_display(pWidget);
+ GdkCursor *pCursor = pName ? gdk_cursor_new_from_name(pDisplay, pName) : nullptr;
+ gdk_window_set_cursor(gtk_widget_get_window(pWidget), pCursor);
+ gdk_display_flush(pDisplay);
+ if (pCursor)
+ g_object_unref(pCursor);
+}
+
class GtkInstanceWidget : public virtual weld::Widget
{
protected:
@@ -2994,6 +3006,11 @@ public:
gtk_widget_thaw_child_notify(m_pWidget);
}
+ virtual void set_busy_cursor(bool bBusy) override
+ {
+ set_cursor(m_pWidget, bBusy ? "progress" : nullptr);
+ }
+
virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override
{
if (!m_xDropTarget)
@@ -3925,17 +3942,6 @@ public:
}
};
- void set_cursor(GtkWidget* pWidget, const char *pName)
- {
- if (!gtk_widget_get_realized(pWidget))
- gtk_widget_realize(pWidget);
- GdkDisplay *pDisplay = gtk_widget_get_display(pWidget);
- GdkCursor *pCursor = pName ? gdk_cursor_new_from_name(pDisplay, pName) : nullptr;
- gdk_window_set_cursor(gtk_widget_get_window(pWidget), pCursor);
- gdk_display_flush(pDisplay);
- if (pCursor)
- g_object_unref(pCursor);
- }
}
namespace
@@ -4064,11 +4070,6 @@ public:
return css::uno::Reference<css::awt::XWindow>(m_xWindow.get());
}
- virtual void set_busy_cursor(bool bBusy) override
- {
- set_cursor(m_pWidget, bBusy ? "progress" : nullptr);
- }
-
virtual void set_modal(bool bModal) override
{
gtk_window_set_modal(m_pWindow, bModal);