[Libreoffice-commits] core.git: chart2/source cui/source cui/uiconfig include/svx sc/source sd/source sw/source vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Mar 16 12:18:53 UTC 2018


 chart2/source/controller/main/ShapeController.cxx |    3 -
 cui/source/dialogs/dlgname.cxx                    |   33 +++-----------
 cui/source/factory/dlgfact.cxx                    |   13 +++--
 cui/source/factory/dlgfact.hxx                    |   11 +++-
 cui/source/inc/dlgname.hxx                        |   14 ++----
 cui/uiconfig/ui/objecttitledescdialog.ui          |   15 ++++--
 include/svx/svxdlg.hxx                            |    2 
 sc/source/ui/drawfunc/drawsh5.cxx                 |    4 +
 sd/source/ui/view/DocumentRenderer.cxx            |    3 -
 sd/source/ui/view/drawview.cxx                    |    3 -
 sd/source/ui/view/drviews2.cxx                    |   51 +++++++---------------
 sd/source/ui/view/drviews4.cxx                    |    3 -
 sd/source/ui/view/drviewse.cxx                    |   19 +++-----
 sd/source/ui/view/sdview4.cxx                     |    3 -
 sd/source/ui/view/viewshe2.cxx                    |    3 -
 sw/source/uibase/dochdl/gloshdl.cxx               |    5 --
 sw/source/uibase/shells/drwbassh.cxx              |    6 +-
 sw/source/uibase/shells/frmsh.cxx                 |    7 +--
 sw/source/uibase/shells/grfsh.cxx                 |    4 -
 sw/source/uibase/shells/tabsh.cxx                 |   14 ++----
 sw/source/uibase/uiview/view2.cxx                 |   21 +++------
 vcl/unx/gtk3/gtk3gtkinst.cxx                      |    9 +++
 22 files changed, 111 insertions(+), 135 deletions(-)

New commits:
commit fc86c38e4424f1e098c4422ee28fb0f106ce8558
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 16 09:29:50 2018 +0000

    weld SvxObjectTitleDescDialog
    
    Change-Id: Id08c201ee4377fe84618906725e7699d29dc1160
    Reviewed-on: https://gerrit.libreoffice.org/51395
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index fd4c8a6fb488..0fbb314ace5e 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -426,8 +426,9 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 if ( pFact )
                 {
+                    VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
                     ScopedVclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
-                        pFact->CreateSvxObjectTitleDescDialog( aTitle, aDescription ) );
+                        pFact->CreateSvxObjectTitleDescDialog(pChartWindow ? pChartWindow->GetFrameWeld() : nullptr, aTitle, aDescription ) );
                     if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
                     {
                         pDlg->GetTitle( aTitle );
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 3e9eb3d0d78b..148c7374df95 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -79,37 +79,22 @@ IMPL_LINK_NOARG(SvxObjectNameDialog, ModifyHdl, weld::Entry&, void)
 // #i68101#
 // Dialog for editing Object Title and Description
 
-SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
-    vcl::Window* pWindow,
-    const OUString& rTitle,
-    const OUString& rDescription) :
-    ModalDialog     ( pWindow, "ObjectTitleDescDialog", "cui/ui/objecttitledescdialog.ui" )
+SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle,
+    const OUString& rDescription)
+    : GenericDialogController(pParent, "cui/ui/objecttitledescdialog.ui", "ObjectTitleDescDialog")
+    , m_xEdtTitle(m_xBuilder->weld_entry("object_title_entry"))
+    , m_xEdtDescription(m_xBuilder->weld_text_view("desc_entry"))
 {
-    get(pEdtTitle, "object_title_entry");
-    get(pEdtDescription, "desc_entry");
     //lock height to initial height
-    pEdtDescription->set_height_request(pEdtDescription->get_preferred_size().Height());
+    m_xEdtDescription->set_size_request(-1, m_xEdtDescription->get_text_height() * 5);
     // set title & desc
-    pEdtTitle->SetText(rTitle);
-    pEdtDescription->SetText(rDescription);
+    m_xEdtTitle->set_text(rTitle);
+    m_xEdtDescription->set_text(rDescription);
 
     // activate title
-    pEdtTitle->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
+    m_xEdtTitle->select_region(0, -1);
 }
 
-SvxObjectTitleDescDialog::~SvxObjectTitleDescDialog()
-{
-    disposeOnce();
-}
-
-void SvxObjectTitleDescDialog::dispose()
-{
-    pEdtTitle.clear();
-    pEdtDescription.clear();
-    ModalDialog::dispose();
-}
-
-
 /*************************************************************************
 |*
 |* dialog for cancelling, saving or adding
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 33abcf354fea..2683c93264b3 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -127,7 +127,10 @@ short AbstractSvxObjectNameDialog_Impl::Execute()
     return m_xDlg->run();
 }
 
-IMPL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl);
+short AbstractSvxObjectTitleDescDialog_Impl::Execute()
+{
+    return m_xDlg->run();
+}
 
 IMPL_ABSTDLG_BASE(AbstractSvxMultiPathDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractSvxPathSelectDialog_Impl);
@@ -621,12 +624,12 @@ IMPL_LINK_NOARG(AbstractSvxObjectNameDialog_Impl, CheckNameHdl, SvxObjectNameDia
 
 void AbstractSvxObjectTitleDescDialog_Impl::GetTitle(OUString& rTitle)
 {
-    pDlg->GetTitle(rTitle);
+    rTitle = m_xDlg->GetTitle();
 }
 
 void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(OUString& rDescription)
 {
-    pDlg->GetDescription(rDescription);
+    rDescription = m_xDlg->GetDescription();
 }
 
 OUString AbstractSvxMultiPathDialog_Impl::GetPath() const
@@ -1112,9 +1115,9 @@ VclPtr<AbstractSvxObjectNameDialog> AbstractDialogFactory_Impl::CreateSvxObjectN
     return VclPtr<AbstractSvxObjectNameDialog_Impl>::Create(new SvxObjectNameDialog(pParent, rName));
 }
 
-VclPtr<AbstractSvxObjectTitleDescDialog> AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(const OUString& rTitle, const OUString& rDescription)
+VclPtr<AbstractSvxObjectTitleDescDialog> AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription)
 {
-    return VclPtr<AbstractSvxObjectTitleDescDialog_Impl>::Create(VclPtr<SvxObjectTitleDescDialog>::Create(nullptr, rTitle, rDescription));
+    return VclPtr<AbstractSvxObjectTitleDescDialog_Impl>::Create(new SvxObjectTitleDescDialog(pParent, rTitle, rDescription));
 }
 
 VclPtr<AbstractSvxMultiPathDialog> AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(vcl::Window* pParent)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index e21a3d895d1c..b0c22bb2f0b5 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -344,7 +344,14 @@ private:
 
 class AbstractSvxObjectTitleDescDialog_Impl :public AbstractSvxObjectTitleDescDialog
 {
-    DECL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl, SvxObjectTitleDescDialog)
+protected:
+    std::unique_ptr<SvxObjectTitleDescDialog> m_xDlg;
+public:
+    explicit AbstractSvxObjectTitleDescDialog_Impl(SvxObjectTitleDescDialog* p)
+        : m_xDlg(p)
+    {
+    }
+    virtual short Execute() override;
     virtual void GetTitle(OUString& rName) override;
     virtual void GetDescription(OUString& rName) override;
 };
@@ -574,7 +581,7 @@ public:
                                             const OUString& rName, const OUString& rDesc) override;
     // #i68101#
     virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) override;
-    virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(const OUString& rTitle, const OUString& rDescription) override;
+    virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) override;
 
     virtual VclPtr<AbstractSvxMultiPathDialog>    CreateSvxMultiPathDialog(vcl::Window* pParent) override;
     virtual VclPtr<AbstractSvxMultiPathDialog>    CreateSvxPathSelectDialog(vcl::Window* pParent) override;
diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx
index 73f66be6854b..bed7fa68b850 100644
--- a/cui/source/inc/dlgname.hxx
+++ b/cui/source/inc/dlgname.hxx
@@ -102,23 +102,21 @@ public:
 
 /** #i68101#
     Dialog for editing Object Title and Description */
-class SvxObjectTitleDescDialog : public ModalDialog
+class SvxObjectTitleDescDialog : public weld::GenericDialogController
 {
 private:
     // title
-    VclPtr<Edit>           pEdtTitle;
+    std::unique_ptr<weld::Entry> m_xEdtTitle;
 
     // description
-    VclPtr<VclMultiLineEdit>  pEdtDescription;
+    std::unique_ptr<weld::TextView> m_xEdtDescription;
 
 public:
     // constructor
-    SvxObjectTitleDescDialog(vcl::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
-    virtual ~SvxObjectTitleDescDialog() override;
-    virtual void dispose() override;
+    SvxObjectTitleDescDialog(weld::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
     // data access
-    void GetTitle(OUString& rTitle) {rTitle = pEdtTitle->GetText(); }
-    void GetDescription(OUString& rDescription) {rDescription = pEdtDescription->GetText(); }
+    OUString GetTitle() const { return m_xEdtTitle->get_text(); }
+    OUString GetDescription() const { return m_xEdtDescription->get_text(); }
 };
 
 enum class SvxMessDialogButton {
diff --git a/cui/uiconfig/ui/objecttitledescdialog.ui b/cui/uiconfig/ui/objecttitledescdialog.ui
index 94f63b591fa2..0c08dcec8370 100644
--- a/cui/uiconfig/ui/objecttitledescdialog.ui
+++ b/cui/uiconfig/ui/objecttitledescdialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.2 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkTextBuffer" id="textbuffer1">
@@ -13,6 +13,9 @@
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="objecttitledescdialog|ObjectTitleDescDialog">Description</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox5">
@@ -86,10 +89,10 @@
               <object class="GtkLabel" id="object_title_label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="objecttitledescdialog|object_title_label">_Title:</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">object_title_entry</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -102,6 +105,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">•</property>
+                <property name="activates_default">True</property>
                 <property name="width_chars">55</property>
               </object>
               <packing>
@@ -114,9 +118,9 @@
               <object class="GtkLabel" id="desc_label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="objecttitledescdialog|desc_label">_Description:</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -130,7 +134,7 @@
                 <property name="can_focus">True</property>
                 <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkTextView" id="desc_entry:border">
+                  <object class="GtkTextView" id="desc_entry">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="wrap_mode">word</property>
@@ -158,5 +162,8 @@
       <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
     </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
 </interface>
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 4be48fffae50..94022f3e0df3 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -403,7 +403,7 @@ public:
 
     // #i68101#
     virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0;
-    virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(const OUString& rTitle, const OUString& rDescription) = 0;
+    virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) = 0;
 
     virtual VclPtr<AbstractSvxMultiPathDialog>    CreateSvxMultiPathDialog(vcl::Window* pParent) = 0 ;
     virtual VclPtr<AbstractSvxMultiPathDialog>    CreateSvxPathSelectDialog(vcl::Window* pParent) = 0 ;
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 52fd6c6b37ab..d78705c3163f 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -558,7 +558,9 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
 
                         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                         OSL_ENSURE(pFact, "Dialog creation failed!");
-                        ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
+                        vcl::Window* pWin = pViewData->GetActiveWin();
+                        ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(
+                                    pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aDescription));
                         OSL_ENSURE(pDlg, "Dialog creation failed!");
 
                         if(RET_OK == pDlg->Execute())
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index f70554442f34..c89213c5880d 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1282,8 +1282,7 @@ public:
                 // Show warning that the orientation could not be set.
                 if (pViewShell)
                 {
-                    vcl::Window* pWin = pViewShell->GetActiveWindow();
-                    std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                    std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pViewShell->GetFrameWeld(),
                                                                VclMessageType::Warning, VclButtonsType::OkCancel,
                                                                SdResId(STR_WARN_PRINTFORMAT_FAILURE)));
                     xWarn->set_default_response(RET_CANCEL);
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index d1b2832c2cc4..56a07fdb6486 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -433,8 +433,7 @@ bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAtt
     {
         if (IsPresObjSelected(false))
         {
-            vcl::Window* pWin = mpDrawViewShell->GetActiveWindow();
-            std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+            std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(mpDrawViewShell->GetFrameWeld(),
                                                           VclMessageType::Info, VclButtonsType::Ok,
                                                           SdResId(STR_ACTION_NOTPOSSIBLE)));
             xInfoBox->run();
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 940ac082849e..6ba5d833ee9b 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -954,8 +954,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -1002,8 +1001,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -1033,8 +1031,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected(true,true,true) )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -1556,8 +1553,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected(false) )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -1738,8 +1734,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if( !bDone )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
 #ifndef UNX
                                                               SdResId(STR_TWAIN_NO_SOURCE)
@@ -1816,8 +1811,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                             || aLayerName.isEmpty() )
                         {
                             // name already exists
-                            vcl::Window* pWin = GetParentWindow();
-                            std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                            std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
                                                                        VclMessageType::Warning, VclButtonsType::Ok,
                                                                        SdResId(STR_WARN_NAME_DUPLICATE)));
                             xWarn->run();
@@ -1985,8 +1979,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                              aLayerName != aOldLayerName) || aLayerName.isEmpty() )
                         {
                             // name already exists
-                            vcl::Window* pWin = GetParentWindow();
-                            std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                            std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
                                                                        VclMessageType::Warning, VclButtonsType::Ok,
                                                                        SdResId(STR_WARN_NAME_DUPLICATE)));
                             xWarn->run();
@@ -2468,8 +2461,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected( true, true, true ) )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2504,8 +2496,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialog creation failed!");
-                ::sd::Window* pWindow = GetActiveWindow();
-                ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(pWindow ? pWindow->GetFrameWeld() : nullptr, aName));
+                ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetFrameWeld(), aName));
                 OSL_ENSURE(pDlg, "Dialog creation failed!");
 
                 pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl));
@@ -2538,7 +2529,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialog creation failed!");
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
+                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(
+                            GetFrameWeld(), aTitle, aDescription));
                 OSL_ENSURE(pDlg, "Dialog creation failed!");
 
                 if(RET_OK == pDlg->Execute())
@@ -2591,8 +2583,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2611,8 +2602,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2634,8 +2624,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2658,8 +2647,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2682,8 +2670,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2727,8 +2714,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -2822,8 +2808,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected() )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 5638ab8e3bdf..a8e2621a1834 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -105,8 +105,7 @@ void DrawViewShell::DeleteActualLayer()
     // replace placeholder
     aString = aString.replaceFirst("$", rName);
 
-    vcl::Window* pWin = GetActiveWindow();
-    std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+    std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                    VclMessageType::Question, VclButtonsType::YesNo,
                                                    aString));
     if (xQueryBox->run() == RET_YES)
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 42f4f12e4d19..2c917163ace7 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -324,17 +324,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
                 if ( mpDrawView->GetMarkedObjectList().GetMarkCount() > 0 &&
                     !mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) )
                 {
-                    ::sd::Window* pWindow = GetActiveWindow();
                     if ( mpDrawView->IsPresObjSelected() )
                     {
-                        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                       VclMessageType::Info, VclButtonsType::Ok,
                                                                       SdResId(STR_ACTION_NOTPOSSIBLE)));
                         xInfoBox->run();
                     }
                     else
                     {
-                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                                        SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER)));
                         if (xQueryBox->run() == RET_YES )
@@ -368,17 +367,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
                 if ( nMarkCnt > 0 && !b3DObjMarked &&
                      (!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) )
                 {
-                    ::sd::Window* pWindow = GetActiveWindow();
                     if ( mpDrawView->IsPresObjSelected() )
                     {
-                        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                       VclMessageType::Info, VclButtonsType::Ok,
                                                                       SdResId(STR_ACTION_NOTPOSSIBLE)));
                         xInfoBox->run();
                     }
                     else
                     {
-                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                                        SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER)));
                         if (xQueryBox->run() == RET_YES)
@@ -683,8 +681,7 @@ void DrawViewShell::FuDeleteSelectedObjects()
     // placeholders which cannot be deleted selected
     if (mpDrawView->IsPresObjSelected(false, true, false, true))
     {
-        ::sd::Window* pWindow = GetActiveWindow();
-        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                       VclMessageType::Info, VclButtonsType::Ok,
                                                       SdResId(STR_ACTION_NOTPOSSIBLE)));
         xInfoBox->run();
@@ -796,8 +793,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
@@ -821,8 +817,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
         {
             if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
             {
-                ::sd::Window* pWindow = GetActiveWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SdResId(STR_ACTION_NOTPOSSIBLE)));
                 xInfoBox->run();
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 1fa41a3485dc..a3368f593acc 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -377,8 +377,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void)
     if( !mpViewSh )
         return;
 
-    vcl::Window* pWindow = mpViewSh->GetActiveWindow();
-    SfxErrorContext aEc( ERRCTX_ERROR, pWindow ? pWindow->GetFrameWeld() : nullptr, RID_SO_ERRCTX );
+    SfxErrorContext aEc( ERRCTX_ERROR, mpViewSh->GetFrameWeld(), RID_SO_ERRCTX );
     ErrCode nError = ERRCODE_NONE;
 
     ::std::vector< OUString >::const_iterator aIter( maDropFileVector.begin() );
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 6a2d2eec54e2..b7fe8861223e 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -717,8 +717,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
 {
     ErrCode aErrCode = ERRCODE_NONE;
 
-    vcl::Window* pWindow = GetActiveWindow();
-    SfxErrorContext aEC(ERRCTX_SO_DOVERB, pWindow ? pWindow->GetFrameWeld() : nullptr, RID_SO_ERRCTX);
+    SfxErrorContext aEC(ERRCTX_SO_DOVERB, GetFrameWeld(), RID_SO_ERRCTX);
     bool bAbort = false;
     GetDocSh()->SetWaitCursor( true );
     SfxViewShell* pViewShell = GetViewShell();
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index d7da1c1abf56..92ec03527b71 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -321,7 +321,7 @@ bool SwGlossaryHdl::NewGlossary(const OUString& rName, const OUString& rShortNam
                             rCfg.IsSaveRelFile(), pOnlyText );
     if(nSuccess == sal_uInt16(-1) )
     {
-        std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWrtShell->GetView().GetWindow()->GetFrameWeld(),
+        std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWrtShell->GetView().GetFrameWeld(),
                                                                                    VclMessageType::Info, VclButtonsType::Ok, SwResId(STR_ERR_INSERT_GLOS)));
         xBox->run();
     }
@@ -477,8 +477,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
             }
             OUString aTmp( SwResId(STR_NOGLOS));
             aTmp = aTmp.replaceFirst("%1", aShortName);
-            vcl::Window* pWin = pWrtShell->GetView().GetWindow();
-            std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+            std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWrtShell->GetView().GetFrameWeld(),
                                                           VclMessageType::Info, VclButtonsType::Ok,
                                                           aTmp));
             xInfoBox->run();
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index d3539e472820..9e6fca607df5 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -515,8 +515,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialog creation failed!");
-                vcl::Window* pWin = GetView().GetWindow();
-                ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, aName));
+                ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
                 OSL_ENSURE(pDlg, "Dialog creation failed!");
 
                 pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl));
@@ -546,7 +545,8 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialog creation failed!");
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
+                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
+                            aTitle, aDescription));
                 OSL_ENSURE(pDlg, "Dialog creation failed!");
 
                 if(RET_OK == pDlg->Execute())
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 7c564e11f1c4..cd43b0c097ec 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -635,9 +635,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                 OUString aName(rSh.GetFlyName());
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 assert(pFact);
-                vcl::Window* pWin = GetView().GetWindow();
                 ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(
-                    pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, aName));
+                    pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
 
                 assert(pDlg);
 
@@ -663,8 +662,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                 assert(pFact);
                 ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(
-                    pFact->CreateSvxObjectTitleDescDialog( aTitle,
-                                                           aDescription ));
+                    pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
+                        aTitle, aDescription ));
                 assert(pDlg);
 
                 if ( pDlg->Execute() == RET_OK )
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index aede5a6798f5..089cb51830e2 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -158,10 +158,10 @@ void SwGrfShell::Execute(SfxRequest &rReq)
             short nState = RET_CANCEL;
             if (aGraphicAttr != GraphicAttr()) // the image has been modified
             {
-                vcl::Window* pWin = GetView().GetWindow();
+                weld::Window* pWin = GetView().GetFrameWeld();
                 if (pWin)
                 {
-                    nState = GraphicHelper::HasToSaveTransformedImage(pWin->GetFrameWeld());
+                    nState = GraphicHelper::HasToSaveTransformedImage(pWin);
                 }
             }
             else
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 87cc52214879..53cd6789fd7f 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -763,8 +763,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                         break;
                     case TableMergeErr::TooComplex:
                     {
-                        vcl::Window* pWin = GetView().GetWindow();
-                        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetView().GetFrameWeld(),
                                                                       VclMessageType::Info, VclButtonsType::Ok,
                                                                       SwResId(STR_ERR_TABLE_MERGE)));
                         xInfoBox->run();
@@ -827,7 +826,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
             OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-            ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(GetView().GetViewFrame()->GetWindow().GetFrameWeld(), &rSh));
+            ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(GetView().GetFrameWeld(), &rSh));
             OSL_ENSURE(pDlg, "Dialog creation failed!");
             pDlg->Execute();
             break;
@@ -949,8 +948,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
             if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline())
             {
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                vcl::Window* pWin =  GetView().GetWindow();
-                ScopedVclPtr<SvxAbstractInsRowColDlg> pDlg(pFact ? pFact->CreateSvxInsRowColDlg(pWin ? pWin->GetFrameWeld() : nullptr,
+                ScopedVclPtr<SvxAbstractInsRowColDlg> pDlg(pFact ? pFact->CreateSvxInsRowColDlg(GetView().GetFrameWeld(),
                                                                                                 nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : nullptr);
 
                 if( pDlg.get() && (pDlg->Execute() == 1) )
@@ -990,8 +988,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                 if( pFact )
                 {
                     const long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY;
-                    vcl::Window* pWin =  GetView().GetWindow();
-                    ScopedVclPtr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog(pWin ? pWin->GetFrameWeld() : nullptr, rSh.IsTableVertical(), nMaxVert));
+                    ScopedVclPtr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert));
                     if( pDlg && (pDlg->Execute() == RET_OK) )
                     {
                         nCount = pDlg->GetCount();
@@ -1036,8 +1033,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-                vcl::Window* pWin = GetView().GetWindow();
-                ScopedVclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog(pWin ? pWin->GetFrameWeld() : nullptr, rSh));
+                ScopedVclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog(GetView().GetFrameWeld(), rSh));
                 OSL_ENSURE(pDlg, "Dialog creation failed!");
                 pDlg->Execute();
                 rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, static_cast<sal_uInt16>(pDlg->GetSplitMode()) ) );
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 5fde9cc1f392..ba09eba84464 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -228,8 +228,7 @@ ErrCode SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
             const sal_uInt16 aRotation = aMetadata.getRotation();
             if (aRotation != 0)
             {
-                vcl::Window* pWin = GetWindow();
-                std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr, "modules/swriter/ui/queryrotateintostandarddialog.ui"));
+                std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/queryrotateintostandarddialog.ui"));
                 std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryRotateIntoStandardOrientationDialog"));
                 if (xQueryBox->run() == RET_YES)
                 {
@@ -428,9 +427,8 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
             // really store as link only?
             if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
             {
-                vcl::Window* pWin = GetWindow();
-                SvxLinkWarningDialog aWarnDlg(pWin ? pWin->GetFrameWeld() : nullptr, pFileDlg->GetPath());
-                if(aWarnDlg.run() != RET_OK)
+                SvxLinkWarningDialog aWarnDlg(GetFrameWeld(), pFileDlg->GetPath());
+                if (aWarnDlg.run() != RET_OK)
                     bAsLink=false; // don't store as link
             }
         }
@@ -485,8 +483,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
         {
             if( bShowError )
             {
-                vcl::Window* pWin = GetWindow();
-                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                               VclMessageType::Info, VclButtonsType::Ok,
                                                               SwResId(pResId)));
                 xInfoBox->run();
@@ -563,8 +560,7 @@ void SwView::Execute(SfxRequest &rReq)
                 {
                     OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
                     // xmlsec05:    new password dialog
-                    weld::Window* pParent = GetViewFrame()->GetWindow().GetFrameWeld();
-                    SfxPasswordDialog aPasswdDlg(pParent);
+                    SfxPasswordDialog aPasswdDlg(GetFrameWeld());
                     aPasswdDlg.SetMinLen(1);
                     //#i69751# the result of Execute() can be ignored
                     (void)aPasswdDlg.execute();
@@ -604,8 +600,7 @@ void SwView::Execute(SfxRequest &rReq)
 
             // xmlsec05:    new password dialog
             //              message box for wrong password
-            weld::Window* pParent = GetViewFrame()->GetWindow().GetFrameWeld();
-            SfxPasswordDialog aPasswdDlg(pParent);
+            SfxPasswordDialog aPasswdDlg(GetFrameWeld());
             aPasswdDlg.SetMinLen(1);
             if (!aPasswd.getLength())
                 aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM);
@@ -2286,7 +2281,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
             if ( lcl_NeedAdditionalDataSource( xDBContext ) )
             {
                 // no data sources are available - create a new one
-                std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetViewFrame()->GetWindow().GetFrameWeld(), "modules/swriter/ui/datasourcesunavailabledialog.ui"));
+                std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/datasourcesunavailabledialog.ui"));
                 std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("DataSourcesUnavailableDialog"));
                 // no cancel allowed
                 if (RET_OK != xQuery->run())
@@ -2334,7 +2329,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
             OUString sSource;
             if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
             {
-                std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetViewFrame()->GetWindow().GetFrameWeld(), "modules/swriter/ui/warndatasourcedialog.ui"));
+                std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/warndatasourcedialog.ui"));
                 std::unique_ptr<weld::MessageDialog> xWarning(xBuilder->weld_message_dialog("WarnDataSourceDialog"));
                 OUString sTmp(xWarning->get_primary_text());
                 xWarning->set_primary_text(sTmp.replaceFirst("%1", sSource));
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index a7c0ac3824e6..3b54fbbb3415 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2423,6 +2423,15 @@ public:
     {
     }
 
+    virtual void set_size_request(int nWidth, int nHeight) override
+    {
+        GtkWidget* pParent = gtk_widget_get_parent(m_pWidget);
+        if (GTK_IS_SCROLLED_WINDOW(pParent))
+            gtk_widget_set_size_request(pParent, nWidth, nHeight);
+        else
+            gtk_widget_set_size_request(m_pWidget, nWidth, nHeight);
+    }
+
     virtual void set_text(const OUString& rText) override
     {
         GtkTextBuffer* pBuffer = gtk_text_view_get_buffer(m_pTextView);


More information about the Libreoffice-commits mailing list