include/vcl/weld.hxx                              |    3 
 sc/source/ui/dbgui/dbnamdlg.cxx                   |  408 ++++++++++------------
 sc/source/ui/inc/dbnamdlg.hxx                     |   68 +--
 sc/source/ui/inc/reffact.hxx                      |    2 
 sc/source/ui/view/reffact.cxx                     |    4 
 sc/source/ui/view/tabvwshc.cxx                    |   23 -
 sc/uiconfig/scalc/ui/definedatabaserangedialog.ui |  199 ++++++----
 solenv/sanitizers/ui/modules/scalc.suppr          |    3 
 vcl/source/app/salvtables.cxx                     |   10 
 vcl/unx/gtk3/gtk3gtkinst.cxx                      |   10 
 10 files changed, 397 insertions(+), 333 deletions(-)

New commits:
commit 5dfc4fd2af11322dfbface30fd66c1ce553a0703
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Apr 11 12:05:07 2019 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Apr 11 22:18:01 2019 +0200

    weld ScDbNameDlg
    
    Change-Id: I676909cbb4067ce69d5327403dd25cc80c4cbc4b
    Reviewed-on: https://gerrit.libreoffice.org/70593
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 4074df14b8c7..77205ced1f69 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -285,11 +285,14 @@ public:
     virtual int get_vscroll_width() const = 0;
 };
 
+class Label;
+
 class VCL_DLLPUBLIC Frame : virtual public Container
 {
 public:
     virtual void set_label(const OUString& rText) = 0;
     virtual OUString get_label() const = 0;
+    virtual std::unique_ptr<Label> weld_label_widget() const = 0;
 };
 
 class VCL_DLLPUBLIC Notebook : virtual public Container
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 067666be2152..0299367a240f 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -56,8 +56,8 @@ namespace
 class DBSaveData
 {
 public:
-    DBSaveData( Edit& rEd, CheckBox& rHdr, CheckBox& rTot, CheckBox& rSize, 
CheckBox& rFmt,
-                            CheckBox& rStrip, ScRange& rArea )
+    DBSaveData( formula::WeldRefEdit& rEd, weld::CheckButton& rHdr, 
weld::CheckButton& rTot, weld::CheckButton& rSize, weld::CheckButton& rFmt,
+                            weld::CheckButton& rStrip, ScRange& rArea )
         : rEdAssign(rEd)
         , rBtnHeader(rHdr)
         , rBtnTotals(rTot)
@@ -77,12 +77,12 @@ public:
     void Restore();
 
 private:
-    Edit&       rEdAssign;
-    CheckBox&   rBtnHeader;
-    CheckBox&   rBtnTotals;
-    CheckBox&   rBtnSize;
-    CheckBox&   rBtnFormat;
-    CheckBox&   rBtnStrip;
+    formula::WeldRefEdit& rEdAssign;
+    weld::CheckButton& rBtnHeader;
+    weld::CheckButton& rBtnTotals;
+    weld::CheckButton& rBtnSize;
+    weld::CheckButton& rBtnFormat;
+    weld::CheckButton& rBtnStrip;
     ScRange&    rCurArea;
     OUString    aStr;
     ScRange     aArea;
@@ -98,11 +98,11 @@ void DBSaveData::Save()
 {
     aArea   = rCurArea;
     aStr    = rEdAssign.GetText();
-    bHeader = rBtnHeader.IsChecked();
-    bTotals = rBtnTotals.IsChecked();
-    bSize   = rBtnSize.IsChecked();
-    bFormat = rBtnFormat.IsChecked();
-    bStrip  = rBtnStrip.IsChecked();
+    bHeader = rBtnHeader.get_active();
+    bTotals = rBtnTotals.get_active();
+    bSize   = rBtnSize.get_active();
+    bFormat = rBtnFormat.get_active();
+    bStrip  = rBtnStrip.get_active();
     bDirty  = true;
 }
 
@@ -112,103 +112,81 @@ void DBSaveData::Restore()
     {
         rCurArea = aArea;
         rEdAssign.SetText( aStr );
-        rBtnHeader.Check ( bHeader );
-        rBtnTotals.Check ( bTotals );
-        rBtnSize.Check   ( bSize );
-        rBtnFormat.Check ( bFormat );
-        rBtnStrip.Check  ( bStrip );
+        rBtnHeader.set_active ( bHeader );
+        rBtnTotals.set_active ( bTotals );
+        rBtnSize.set_active   ( bSize );
+        rBtnFormat.set_active ( bFormat );
+        rBtnStrip.set_active  ( bStrip );
         bDirty = false;
     }
 }
 
 //  class ScDbNameDlg
 
-ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* 
pParent,
+ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
     ScViewData* ptrViewData)
-    : ScAnyRefDlg(pB, pCW, pParent,
-        "DefineDatabaseRangeDialog",
-            "modules/scalc/ui/definedatabaserangedialog.ui")
+    : ScAnyRefDlgController(pB, pCW, pParent,
+        "modules/scalc/ui/definedatabaserangedialog.ui", 
"DefineDatabaseRangeDialog")
     , pViewData(ptrViewData)
     , pDoc(ptrViewData->GetDocument())
     , bRefInputMode(false)
     , aAddrDetails(pDoc->GetAddressConvention(), 0, 0)
     , aLocalDbCol(*(pDoc->GetDBCollection()))
+    , m_xEdName(m_xBuilder->weld_entry_tree_view("entrygrid", "entry", 
"entry-list"))
+    , m_xAssignFrame(m_xBuilder->weld_frame("RangeFrame"))
+    , m_xEdAssign(new formula::WeldRefEdit(m_xBuilder->weld_entry("assign")))
+    , m_xRbAssign(new 
formula::WeldRefButton(m_xBuilder->weld_button("assignrb")))
+    , m_xOptions(m_xBuilder->weld_widget("Options"))
+    , m_xBtnHeader(m_xBuilder->weld_check_button("ContainsColumnLabels"))
+    , m_xBtnTotals(m_xBuilder->weld_check_button("ContainsTotalsRow"))
+    , m_xBtnDoSize(m_xBuilder->weld_check_button("InsertOrDeleteCells"))
+    , m_xBtnKeepFmt(m_xBuilder->weld_check_button("KeepFormatting"))
+    , m_xBtnStripData(m_xBuilder->weld_check_button("DontSaveImportedData"))
+    , m_xFTSource(m_xBuilder->weld_label("Source"))
+    , m_xFTOperations(m_xBuilder->weld_label("Operations"))
+    , m_xBtnOk(m_xBuilder->weld_button("ok"))
+    , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
+    , m_xBtnAdd(m_xBuilder->weld_button("add"))
+    , m_xBtnRemove(m_xBuilder->weld_button("delete"))
+    , m_xModifyPB(m_xBuilder->weld_button("modify"))
+    , m_xInvalidFT(m_xBuilder->weld_label("invalid"))
+    , m_xFrameLabel(m_xAssignFrame->weld_label_widget())
+    , m_xExpander(m_xBuilder->weld_expander("more"))
 {
-    get(m_pEdName, "entry");
-    m_pEdName->set_height_request(m_pEdName->GetOptimalSize().Height() + 
m_pEdName->GetTextHeight() * 8);
-    get(m_pEdAssign, "assign");
-    get(m_pAssignFrame, "RangeFrame");
-    m_pEdAssign->SetReferences(this, m_pAssignFrame->get_label_widget());
-    get(m_pRbAssign, "assignrb");
-    m_pRbAssign->SetReferences(this, m_pEdAssign);
-    get(m_pOptions, "Options");
-    get(m_pBtnHeader, "ContainsColumnLabels");
-    get(m_pBtnTotals, "ContainsTotalsRow");
-    get(m_pBtnDoSize, "InsertOrDeleteCells");
-    get(m_pBtnKeepFmt, "KeepFormatting");
-    get(m_pBtnStripData, "DontSaveImportedData");
-    get(m_pFTSource, "Source");
-    get(m_pFTOperations, "Operations");
-    get(m_pBtnOk, "ok");
-    get(m_pBtnCancel, "cancel");
-    get(m_pBtnAdd, "add");
-    aStrAdd = m_pBtnAdd->GetText();
-    aStrModify = get<vcl::Window>("modify")->GetText();
-    get(m_pBtnRemove, "delete");
-    aStrInvalid = get<vcl::Window>("invalid")->GetText();
-
-    m_pFTSource->SetStyle(m_pFTSource->GetStyle() | WB_NOLABEL);
-    m_pFTOperations->SetStyle(m_pFTOperations->GetStyle() | WB_NOLABEL);
+    m_xEdName->set_height_request_by_rows(8);
+    m_xEdAssign->SetReferences(this, m_xFrameLabel.get());
+    m_xRbAssign->SetReferences(this, m_xEdAssign.get());
+    aStrAdd = m_xBtnAdd->get_label();
+    aStrModify = m_xModifyPB->get_label();
+    aStrInvalid = m_xInvalidFT->get_label();
 
     //  so that the strings in the resource can stay with fixed texts:
-    aStrSource      = m_pFTSource->GetText();
-    aStrOperations  = m_pFTOperations->GetText();
+    aStrSource      = m_xFTSource->get_label();
+    aStrOperations  = m_xFTOperations->get_label();
 
-    pSaveObj = new DBSaveData( *m_pEdAssign, *m_pBtnHeader, *m_pBtnTotals,
-                        *m_pBtnDoSize, *m_pBtnKeepFmt, *m_pBtnStripData, 
theCurArea );
+    pSaveObj = new DBSaveData( *m_xEdAssign, *m_xBtnHeader, *m_xBtnTotals,
+                        *m_xBtnDoSize, *m_xBtnKeepFmt, *m_xBtnStripData, 
theCurArea );
     Init();
 }
 
 ScDbNameDlg::~ScDbNameDlg()
 {
-    disposeOnce();
-}
-
-void ScDbNameDlg::dispose()
-{
     DELETEZ( pSaveObj );
-    m_pEdName.clear();
-    m_pAssignFrame.clear();
-    m_pEdAssign.clear();
-    m_pRbAssign.clear();
-    m_pOptions.clear();
-    m_pBtnHeader.clear();
-    m_pBtnTotals.clear();
-    m_pBtnDoSize.clear();
-    m_pBtnKeepFmt.clear();
-    m_pBtnStripData.clear();
-    m_pFTSource.clear();
-    m_pFTOperations.clear();
-    m_pBtnOk.clear();
-    m_pBtnCancel.clear();
-    m_pBtnAdd.clear();
-    m_pBtnRemove.clear();
-    ScAnyRefDlg::dispose();
 }
 
 void ScDbNameDlg::Init()
 {
-    m_pBtnHeader->Check();          // Default: with column headers
-    m_pBtnTotals->Check( false );   // Default: without totals row
-    m_pBtnDoSize->Check();
-    m_pBtnKeepFmt->Check();
-
-    m_pBtnOk->SetClickHdl      ( LINK( this, ScDbNameDlg, OkBtnHdl ) );
-    m_pBtnCancel->SetClickHdl  ( LINK( this, ScDbNameDlg, CancelBtnHdl ) );
-    m_pBtnAdd->SetClickHdl     ( LINK( this, ScDbNameDlg, AddBtnHdl ) );
-    m_pBtnRemove->SetClickHdl  ( LINK( this, ScDbNameDlg, RemoveBtnHdl ) );
-    m_pEdName->SetModifyHdl    ( LINK( this, ScDbNameDlg, NameModifyHdl ) );
-    m_pEdAssign->SetModifyHdl  ( LINK( this, ScDbNameDlg, AssModifyHdl ) );
+    m_xBtnHeader->set_active(true);          // Default: with column headers
+    m_xBtnTotals->set_active( false );   // Default: without totals row
+    m_xBtnDoSize->set_active(true);
+    m_xBtnKeepFmt->set_active(true);
+
+    m_xBtnOk->connect_clicked      ( LINK( this, ScDbNameDlg, OkBtnHdl ) );
+    m_xBtnCancel->connect_clicked  ( LINK( this, ScDbNameDlg, CancelBtnHdl ) );
+    m_xBtnAdd->connect_clicked     ( LINK( this, ScDbNameDlg, AddBtnHdl ) );
+    m_xBtnRemove->connect_clicked  ( LINK( this, ScDbNameDlg, RemoveBtnHdl ) );
+    m_xEdName->connect_changed( LINK( this, ScDbNameDlg, NameModifyHdl ) );
+    m_xEdAssign->SetModifyHdl  ( LINK( this, ScDbNameDlg, AssModifyHdl ) );
     UpdateNames();
 
     OUString  theAreaStr;
@@ -254,24 +232,24 @@ void ScDbNameDlg::Init()
                 {
                     OUString aDBName = pDBData->GetName();
                     if ( aDBName != STR_DB_LOCAL_NONAME )
-                        m_pEdName->SetText(aDBName);
+                        m_xEdName->set_entry_text(aDBName);
 
-                    m_pBtnHeader->Check( pDBData->HasHeader() );
-                    m_pBtnTotals->Check( pDBData->HasTotals() );
-                    m_pBtnDoSize->Check( pDBData->IsDoSize() );
-                    m_pBtnKeepFmt->Check( pDBData->IsKeepFmt() );
-                    m_pBtnStripData->Check( pDBData->IsStripData() );
+                    m_xBtnHeader->set_active( pDBData->HasHeader() );
+                    m_xBtnTotals->set_active( pDBData->HasTotals() );
+                    m_xBtnDoSize->set_active( pDBData->IsDoSize() );
+                    m_xBtnKeepFmt->set_active( pDBData->IsKeepFmt() );
+                    m_xBtnStripData->set_active( pDBData->IsStripData() );
                     SetInfoStrings( pDBData );
                 }
             }
         }
     }
 
-    m_pEdAssign->SetText( theAreaStr );
-    m_pEdName->GrabFocus();
+    m_xEdAssign->SetText( theAreaStr );
+    m_xEdName->grab_focus();
     bSaved = true;
     pSaveObj->Save();
-    NameModifyHdl( *m_pEdName );
+    NameModifyHdl( *m_xEdName );
 }
 
 void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
@@ -283,7 +261,7 @@ void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
         aBuf.append(' ');
         aBuf.append(pDBData->GetSourceString());
     }
-    m_pFTSource->SetText(aBuf.makeStringAndClear());
+    m_xFTSource->set_label(aBuf.makeStringAndClear());
 
     aBuf.append(aStrOperations);
     if (pDBData)
@@ -291,7 +269,7 @@ void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
         aBuf.append(' ');
         aBuf.append(pDBData->GetOperations());
     }
-    m_pFTOperations->SetText(aBuf.makeStringAndClear());
+    m_xFTOperations->set_label(aBuf.makeStringAndClear());
 }
 
 // Transfer of a table area selected with the mouse, which is then displayed
@@ -299,30 +277,30 @@ void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData 
)
 
 void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
 {
-    if ( m_pEdAssign->IsEnabled() )
+    if (m_xEdAssign->GetWidget()->get_sensitive())
     {
         if ( rRef.aStart != rRef.aEnd )
-            RefInputStart(m_pEdAssign);
+            RefInputStart(m_xEdAssign.get());
 
         theCurArea = rRef;
 
         OUString aRefStr(theCurArea.Format(ScRefFlags::RANGE_ABS_3D, pDocP, 
aAddrDetails));
-        m_pEdAssign->SetRefString( aRefStr );
-        m_pOptions->Enable();
-        m_pBtnAdd->Enable();
+        m_xEdAssign->SetRefString( aRefStr );
+        m_xOptions->set_sensitive(true);
+        m_xBtnAdd->set_sensitive(true);
         bSaved = true;
         pSaveObj->Save();
     }
 }
 
-bool ScDbNameDlg::Close()
+void ScDbNameDlg::Close()
 {
-    return DoClose( ScDbNameDlgWrapper::GetChildWindowId() );
+    DoClose( ScDbNameDlgWrapper::GetChildWindowId() );
 }
 
 void ScDbNameDlg::SetActive()
 {
-    m_pEdAssign->GrabFocus();
+    m_xEdAssign->GrabFocus();
 
     //  No NameModifyHdl, because otherwise areas can not be changed
     //  (the old content would be displayed again after the reference 
selection is pulled)
@@ -337,25 +315,24 @@ void ScDbNameDlg::UpdateNames()
 
     const DBsType& rDBs = aLocalDbCol.getNamedDBs();
 
-    m_pEdName->SetUpdateMode( false );
+    m_xEdName->freeze();
 
-    m_pEdName->Clear();
-    m_pEdAssign->SetText( EMPTY_OUSTRING );
+    m_xEdName->clear();
+    m_xEdAssign->SetText( EMPTY_OUSTRING );
 
     if (!rDBs.empty())
     {
         for (const auto& rxDB : rDBs)
-            m_pEdName->InsertEntry(rxDB->GetName());
+            m_xEdName->append_text(rxDB->GetName());
     }
     else
     {
-        m_pBtnAdd->SetText( aStrAdd );
-        m_pBtnAdd->Disable();
-        m_pBtnRemove->Disable();
+        m_xBtnAdd->set_label( aStrAdd );
+        m_xBtnAdd->set_sensitive(false);
+        m_xBtnRemove->set_sensitive(false);
     }
 
-    m_pEdName->SetUpdateMode( true );
-    m_pEdName->Invalidate();
+    m_xEdName->thaw();
 }
 
 void ScDbNameDlg::UpdateDBData( const OUString& rStrName )
@@ -375,20 +352,20 @@ void ScDbNameDlg::UpdateDBData( const OUString& rStrName )
         theCurArea = ScRange( ScAddress( nColStart, nRowStart, nTab ),
                               ScAddress( nColEnd,   nRowEnd,   nTab ) );
         OUString theArea(theCurArea.Format(ScRefFlags::RANGE_ABS_3D, pDoc, 
aAddrDetails));
-        m_pEdAssign->SetText( theArea );
-        m_pBtnAdd->SetText( aStrModify );
-        m_pBtnHeader->Check( pData->HasHeader() );
-        m_pBtnTotals->Check( pData->HasTotals() );
-        m_pBtnDoSize->Check( pData->IsDoSize() );
-        m_pBtnKeepFmt->Check( pData->IsKeepFmt() );
-        m_pBtnStripData->Check( pData->IsStripData() );
+        m_xEdAssign->SetText( theArea );
+        m_xBtnAdd->set_label( aStrModify );
+        m_xBtnHeader->set_active( pData->HasHeader() );
+        m_xBtnTotals->set_active( pData->HasTotals() );
+        m_xBtnDoSize->set_active( pData->IsDoSize() );
+        m_xBtnKeepFmt->set_active( pData->IsKeepFmt() );
+        m_xBtnStripData->set_active( pData->IsStripData() );
         SetInfoStrings( pData );
     }
 
-    m_pBtnAdd->SetText( aStrModify );
-    m_pBtnAdd->Enable();
-    m_pBtnRemove->Enable();
-    m_pOptions->Enable();
+    m_xBtnAdd->set_label( aStrModify );
+    m_xBtnAdd->set_sensitive(true);
+    m_xBtnRemove->set_sensitive(true);
+    m_xOptions->set_sensitive(true);
 }
 
 bool ScDbNameDlg::IsRefInputMode() const
@@ -398,9 +375,9 @@ bool ScDbNameDlg::IsRefInputMode() const
 
 // Handler:
 
-IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, Button*, void)
+IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button&, void)
 {
-    AddBtnHdl( nullptr );
+    AddBtnHdl(*m_xBtnAdd);
 
     // Pass the changes and the remove list to the view: both are
     // transferred as a reference only, so that no dead memory can
@@ -411,18 +388,18 @@ IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, Button*, void)
         aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
     }
 
-    Close();
+    response(RET_OK);
 }
 
-IMPL_LINK_NOARG(ScDbNameDlg, CancelBtnHdl, Button*, void)
+IMPL_LINK_NOARG(ScDbNameDlg, CancelBtnHdl, weld::Button&, void)
 {
-    Close();
+    response(RET_CANCEL);
 }
 
-IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
+IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void)
 {
-    OUString  aNewName = comphelper::string::strip(m_pEdName->GetText(), ' ');
-    OUString  aNewArea = m_pEdAssign->GetText();
+    OUString aNewName = 
comphelper::string::strip(m_xEdName->get_active_text(), ' ');
+    OUString aNewArea = m_xEdAssign->GetText();
 
     if ( !aNewName.isEmpty() && !aNewArea.isEmpty() )
     {
@@ -430,7 +407,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
         {
             //  because editing can be done now, parsing is needed first
             ScRange aTmpRange;
-            OUString aText = m_pEdAssign->GetText();
+            OUString aText = m_xEdAssign->GetText();
             if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & 
ScRefFlags::VALID )
             {
                 theCurArea = aTmpRange;
@@ -445,11 +422,11 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
                     pOldEntry->MoveTo( aStart.Tab(), aStart.Col(), 
aStart.Row(),
                                                         aEnd.Col(), aEnd.Row() 
);
                     pOldEntry->SetByRow( true );
-                    pOldEntry->SetHeader( m_pBtnHeader->IsChecked() );
-                    pOldEntry->SetTotals( m_pBtnTotals->IsChecked() );
-                    pOldEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
-                    pOldEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
-                    pOldEntry->SetStripData( m_pBtnStripData->IsChecked() );
+                    pOldEntry->SetHeader( m_xBtnHeader->get_active() );
+                    pOldEntry->SetTotals( m_xBtnTotals->get_active() );
+                    pOldEntry->SetDoSize( m_xBtnDoSize->get_active() );
+                    pOldEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
+                    pOldEntry->SetStripData( m_xBtnStripData->get_active() );
                 }
                 else
                 {
@@ -458,11 +435,11 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
                     std::unique_ptr<ScDBData> pNewEntry(new ScDBData( 
aNewName, aStart.Tab(),
                                                         aStart.Col(), 
aStart.Row(),
                                                         aEnd.Col(), aEnd.Row(),
-                                                        true, 
m_pBtnHeader->IsChecked(),
-                                                        
m_pBtnTotals->IsChecked() ));
-                    pNewEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
-                    pNewEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
-                    pNewEntry->SetStripData( m_pBtnStripData->IsChecked() );
+                                                        true, 
m_xBtnHeader->get_active(),
+                                                        
m_xBtnTotals->get_active() ));
+                    pNewEntry->SetDoSize( m_xBtnDoSize->get_active() );
+                    pNewEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
+                    pNewEntry->SetStripData( m_xBtnStripData->get_active() );
 
                     bool ins = 
aLocalDbCol.getNamedDBs().insert(std::move(pNewEntry));
                     assert(ins); (void)ins;
@@ -470,35 +447,35 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
 
                 UpdateNames();
 
-                m_pEdName->SetText( EMPTY_OUSTRING );
-                m_pEdName->GrabFocus();
-                m_pBtnAdd->SetText( aStrAdd );
-                m_pBtnAdd->Disable();
-                m_pBtnRemove->Disable();
-                m_pEdAssign->SetText( EMPTY_OUSTRING );
-                m_pBtnHeader->Check();             // Default: with column 
headers
-                m_pBtnTotals->Check( false );      // Default: without totals 
row
-                m_pBtnDoSize->Check( false );
-                m_pBtnKeepFmt->Check( false );
-                m_pBtnStripData->Check( false );
+                m_xEdName->set_entry_text( EMPTY_OUSTRING );
+                m_xEdName->grab_focus();
+                m_xBtnAdd->set_label( aStrAdd );
+                m_xBtnAdd->set_sensitive(false);
+                m_xBtnRemove->set_sensitive(false);
+                m_xEdAssign->SetText( EMPTY_OUSTRING );
+                m_xBtnHeader->set_active(true);             // Default: with 
column headers
+                m_xBtnTotals->set_active( false );      // Default: without 
totals row
+                m_xBtnDoSize->set_active( false );
+                m_xBtnKeepFmt->set_active( false );
+                m_xBtnStripData->set_active( false );
                 SetInfoStrings( nullptr );     // empty
                 theCurArea = ScRange();
                 bSaved = true;
                 pSaveObj->Save();
-                NameModifyHdl( *m_pEdName );
+                NameModifyHdl( *m_xEdName );
             }
             else
             {
-                ERRORBOX(GetFrameWeld(), aStrInvalid);
-                m_pEdAssign->SetSelection( Selection( 0, SELECTION_MAX ) );
-                m_pEdAssign->GrabFocus();
+                ERRORBOX(m_xDialog.get(), aStrInvalid);
+                m_xEdAssign->SelectAll();
+                m_xEdAssign->GrabFocus();
             }
         }
         else
         {
-            ERRORBOX(GetFrameWeld(), ScResId(STR_INVALIDNAME));
-            m_pEdName->SetSelection( Selection( 0, SELECTION_MAX ) );
-            m_pEdName->GrabFocus();
+            ERRORBOX(m_xDialog.get(), ScResId(STR_INVALIDNAME));
+            m_xEdName->select_entry_region(0, -1);
+            m_xEdName->grab_focus();
         }
     }
 }
@@ -518,9 +495,9 @@ public:
 
 }
 
-IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, Button*, void)
+IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, weld::Button&, void)
 {
-    OUString aStrEntry = m_pEdName->GetText();
+    OUString aStrEntry = m_xEdName->get_active_text();
     ScDBCollection::NamedDBs& rDBs = aLocalDbCol.getNamedDBs();
     ScDBCollection::NamedDBs::iterator itr =
         ::std::find_if(rDBs.begin(), rDBs.end(), FindByName(aStrEntry));
@@ -529,7 +506,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, Button*, void)
     {
         OUString aStrDelMsg = ScResId( STR_QUERY_DELENTRY );
         OUString sMsg{ aStrDelMsg.getToken(0, '#') + aStrEntry + 
aStrDelMsg.getToken(1, '#') };
-        std::unique_ptr<weld::MessageDialog> 
xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
+        std::unique_ptr<weld::MessageDialog> 
xQueryBox(Application::CreateMessageDialog(m_xDialog.get(),
                                                        
VclMessageType::Question, VclButtonsType::YesNo,
                                                        sMsg));
         xQueryBox->set_default_response(RET_YES);
@@ -546,40 +523,39 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, Button*, void)
 
             UpdateNames();
 
-            m_pEdName->SetText( EMPTY_OUSTRING );
-            m_pEdName->GrabFocus();
-            m_pBtnAdd->SetText( aStrAdd );
-            m_pBtnAdd->Disable();
-            m_pBtnRemove->Disable();
-            m_pEdAssign->SetText( EMPTY_OUSTRING );
+            m_xEdName->set_entry_text( EMPTY_OUSTRING );
+            m_xEdName->grab_focus();
+            m_xBtnAdd->set_label( aStrAdd );
+            m_xBtnAdd->set_sensitive(false);
+            m_xBtnRemove->set_sensitive(false);
+            m_xEdAssign->SetText( EMPTY_OUSTRING );
             theCurArea = ScRange();
-            m_pBtnHeader->Check();             // Default: with column headers
-            m_pBtnTotals->Check( false );      // Default: without totals row
-            m_pBtnDoSize->Check( false );
-            m_pBtnKeepFmt->Check( false );
-            m_pBtnStripData->Check( false );
+            m_xBtnHeader->set_active(true);             // Default: with 
column headers
+            m_xBtnTotals->set_active( false );      // Default: without totals 
row
+            m_xBtnDoSize->set_active( false );
+            m_xBtnKeepFmt->set_active( false );
+            m_xBtnStripData->set_active( false );
             SetInfoStrings( nullptr );     // empty
             bSaved=false;
             pSaveObj->Restore();
-            NameModifyHdl( *m_pEdName );
+            NameModifyHdl( *m_xEdName );
         }
     }
 }
 
-IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl, Edit&, void)
+IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl, weld::ComboBox&, void)
 {
-    OUString  theName     = m_pEdName->GetText();
-    bool    bNameFound  = (COMBOBOX_ENTRY_NOTFOUND
-                           != m_pEdName->GetEntryPos( theName ));
+    OUString  theName     = m_xEdName->get_active_text();
+    bool    bNameFound  = m_xEdName->find_text(theName) != -1;
 
     if ( theName.isEmpty() )
     {
-        if (m_pBtnAdd->GetText() != aStrAdd)
-            m_pBtnAdd->SetText( aStrAdd );
-        m_pBtnAdd->Disable();
-        m_pBtnRemove->Disable();
-        m_pAssignFrame->Disable();
-        m_pOptions->Disable();
+        if (m_xBtnAdd->get_label() != aStrAdd)
+            m_xBtnAdd->set_label( aStrAdd );
+        m_xBtnAdd->set_sensitive(false);
+        m_xBtnRemove->set_sensitive(false);
+        m_xAssignFrame->set_sensitive(false);
+        m_xOptions->set_sensitive(false);
         //bSaved=sal_False;
         //pSaveObj->Restore();
         //@BugID 54702 enable/disable in the base class only
@@ -590,8 +566,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl, Edit&, void)
     {
         if ( bNameFound )
         {
-            if (m_pBtnAdd->GetText() != aStrModify)
-                m_pBtnAdd->SetText( aStrModify );
+            if (m_xBtnAdd->get_label() != aStrModify)
+                m_xBtnAdd->set_label( aStrModify );
 
             if(!bSaved)
             {
@@ -602,63 +578,63 @@ IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl, Edit&, void)
         }
         else
         {
-            if (m_pBtnAdd->GetText() != aStrAdd)
-                m_pBtnAdd->SetText( aStrAdd );
+            if (m_xBtnAdd->get_label() != aStrAdd)
+                m_xBtnAdd->set_label( aStrAdd );
 
             bSaved=false;
             pSaveObj->Restore();
 
-            if ( !m_pEdAssign->GetText().isEmpty() )
+            if ( !m_xEdAssign->GetText().isEmpty() )
             {
-                m_pBtnAdd->Enable();
-                m_pOptions->Enable();
+                m_xBtnAdd->set_sensitive(true);
+                m_xOptions->set_sensitive(true);
             }
             else
             {
-                m_pBtnAdd->Disable();
-                m_pOptions->Disable();
+                m_xBtnAdd->set_sensitive(false);
+                m_xOptions->set_sensitive(false);
             }
-            m_pBtnRemove->Disable();
+            m_xBtnRemove->set_sensitive(false);
         }
 
-        m_pAssignFrame->Enable();
+        m_xAssignFrame->set_sensitive(true);
 
         //@BugID 54702 enable/disable in the base class only
-        //SFX_APPWINDOW->Enable();
+        //SFX_APPWINDOW->set_sensitive(true);
         bRefInputMode = true;
     }
 }
 
-IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl, Edit&, void)
+IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl, formula::WeldRefEdit&, void)
 {
     //  parse here for Save(), etc.
 
     ScRange aTmpRange;
-    OUString aText = m_pEdAssign->GetText();
+    OUString aText = m_xEdAssign->GetText();
     if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & ScRefFlags::VALID )
         theCurArea = aTmpRange;
 
-    if (!aText.isEmpty() && !m_pEdName->GetText().isEmpty())
+    if (!aText.isEmpty() && !m_xEdName->get_active_text().isEmpty())
     {
-        m_pBtnAdd->Enable();
-        m_pBtnHeader->Enable();
-        m_pBtnTotals->Enable();
-        m_pBtnDoSize->Enable();
-        m_pBtnKeepFmt->Enable();
-        m_pBtnStripData->Enable();
-        m_pFTSource->Enable();
-        m_pFTOperations->Enable();
+        m_xBtnAdd->set_sensitive(true);
+        m_xBtnHeader->set_sensitive(true);
+        m_xBtnTotals->set_sensitive(true);
+        m_xBtnDoSize->set_sensitive(true);
+        m_xBtnKeepFmt->set_sensitive(true);
+        m_xBtnStripData->set_sensitive(true);
+        m_xFTSource->set_sensitive(true);
+        m_xFTOperations->set_sensitive(true);
     }
     else
     {
-        m_pBtnAdd->Disable();
-        m_pBtnHeader->Disable();
-        m_pBtnTotals->Disable();
-        m_pBtnDoSize->Disable();
-        m_pBtnKeepFmt->Disable();
-        m_pBtnStripData->Disable();
-        m_pFTSource->Disable();
-        m_pFTOperations->Disable();
+        m_xBtnAdd->set_sensitive(false);
+        m_xBtnHeader->set_sensitive(false);
+        m_xBtnTotals->set_sensitive(false);
+        m_xBtnDoSize->set_sensitive(false);
+        m_xBtnKeepFmt->set_sensitive(false);
+        m_xBtnStripData->set_sensitive(false);
+        m_xFTSource->set_sensitive(false);
+        m_xFTOperations->set_sensitive(false);
     }
 }
 
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index 70b41eab3836..60e9511c0877 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -32,41 +32,20 @@
 class ScViewData;
 class ScDocument;
 
-class ScDbNameDlg : public ScAnyRefDlg
+class ScDbNameDlg : public ScAnyRefDlgController
 {
 public:
-                    ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, 
vcl::Window* pParent,
-                                 ScViewData*    ptrViewData );
-                    virtual ~ScDbNameDlg() override;
-    virtual void    dispose() override;
+    ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
+                ScViewData* ptrViewData);
+    virtual ~ScDbNameDlg() override;
 
     virtual void    SetReference( const ScRange& rRef, ScDocument* pDoc ) 
override;
 
     virtual bool    IsRefInputMode() const override;
     virtual void    SetActive() override;
-    virtual bool    Close() override;
+    virtual void    Close() override;
 
 private:
-    VclPtr<ComboBox>           m_pEdName;
-
-    VclPtr<VclFrame>           m_pAssignFrame;
-    VclPtr<formula::RefEdit>   m_pEdAssign;
-    VclPtr<formula::RefButton> m_pRbAssign;
-
-    VclPtr<VclContainer>       m_pOptions;
-    VclPtr<CheckBox>           m_pBtnHeader;
-    VclPtr<CheckBox>           m_pBtnTotals;
-    VclPtr<CheckBox>           m_pBtnDoSize;
-    VclPtr<CheckBox>           m_pBtnKeepFmt;
-    VclPtr<CheckBox>           m_pBtnStripData;
-    VclPtr<FixedText>          m_pFTSource;
-    VclPtr<FixedText>          m_pFTOperations;
-
-    VclPtr<OKButton>           m_pBtnOk;
-    VclPtr<CancelButton>       m_pBtnCancel;
-    VclPtr<PushButton>         m_pBtnAdd;
-    VclPtr<PushButton>         m_pBtnRemove;
-
     bool            bSaved;
 
     OUString        aStrAdd;
@@ -85,18 +64,43 @@ private:
     ScRange         theCurArea;
     std::vector<ScRange> aRemoveList;
 
+    std::unique_ptr<weld::EntryTreeView> m_xEdName;
+
+    std::unique_ptr<weld::Frame> m_xAssignFrame;
+    std::unique_ptr<formula::WeldRefEdit> m_xEdAssign;
+    std::unique_ptr<formula::WeldRefButton> m_xRbAssign;
+
+    std::unique_ptr<weld::Widget> m_xOptions;
+    std::unique_ptr<weld::CheckButton> m_xBtnHeader;
+    std::unique_ptr<weld::CheckButton> m_xBtnTotals;
+    std::unique_ptr<weld::CheckButton> m_xBtnDoSize;
+    std::unique_ptr<weld::CheckButton> m_xBtnKeepFmt;
+    std::unique_ptr<weld::CheckButton> m_xBtnStripData;
+    std::unique_ptr<weld::Label> m_xFTSource;
+    std::unique_ptr<weld::Label> m_xFTOperations;
+
+    std::unique_ptr<weld::Button> m_xBtnOk;
+    std::unique_ptr<weld::Button> m_xBtnCancel;
+    std::unique_ptr<weld::Button> m_xBtnAdd;
+    std::unique_ptr<weld::Button> m_xBtnRemove;
+
+    std::unique_ptr<weld::Button> m_xModifyPB;
+    std::unique_ptr<weld::Label> m_xInvalidFT;
+
+    std::unique_ptr<weld::Label> m_xFrameLabel;
+    std::unique_ptr<weld::Expander> m_xExpander;
 private:
     void            Init();
     void            UpdateNames();
     void            UpdateDBData( const OUString& rStrName );
     void            SetInfoStrings( const ScDBData* pDBData );
 
-    DECL_LINK( CancelBtnHdl, Button*, void );
-    DECL_LINK( OkBtnHdl, Button*, void );
-    DECL_LINK( AddBtnHdl, Button*, void );
-    DECL_LINK( RemoveBtnHdl, Button*, void );
-    DECL_LINK( NameModifyHdl, Edit&, void );
-    DECL_LINK( AssModifyHdl, Edit&, void );
+    DECL_LINK( CancelBtnHdl, weld::Button&, void );
+    DECL_LINK( OkBtnHdl, weld::Button&, void );
+    DECL_LINK( AddBtnHdl, weld::Button&, void );
+    DECL_LINK( RemoveBtnHdl, weld::Button&, void );
+    DECL_LINK( NameModifyHdl, weld::ComboBox&, void );
+    DECL_LINK( AssModifyHdl, formula::WeldRefEdit&, void );
 };
 
 #endif // INCLUDED_SC_SOURCE_UI_INC_DBNAMDLG_HXX
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index e874cc9bbb57..79a873f31115 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -53,7 +53,7 @@ DECL_WRAPPER_WITHID(ScPivotLayoutWrapper)
 DECL_WRAPPER_WITHID(ScTabOpDlgWrapper)
 DECL_WRAPPER_WITHID(ScFilterDlgWrapper)
 DECL_WRAPPER_WITHID(ScSpecialFilterDlgWrapper)
-DECL_WRAPPER_WITHID(ScDbNameDlgWrapper)
+DECL_WRAPPER_WITHID_CONTROLLER(ScDbNameDlgWrapper)
 DECL_WRAPPER_WITHID(ScConsolidateDlgWrapper)
 DECL_WRAPPER_WITHID(ScPrintAreasDlgWrapper)
 DECL_WRAPPER_WITHID(ScColRowNameRangesDlgWrapper)
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 4522ab15d6fd..7d23436d4885 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -41,7 +41,7 @@ SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, 
SID_OPENDLG_PIVOTTABLE )
 SFX_IMPL_MODELESSDIALOG_WITHID(ScTabOpDlgWrapper, SID_OPENDLG_TABOP )
 SFX_IMPL_MODELESSDIALOG_WITHID(ScFilterDlgWrapper, SID_FILTER )
 SFX_IMPL_MODELESSDIALOG_WITHID(ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
-SFX_IMPL_MODELESSDIALOG_WITHID(ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
+SFX_IMPL_CHILDWINDOW_WITHID(ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
 SFX_IMPL_MODELESSDIALOG_WITHID(ScConsolidateDlgWrapper, 
SID_OPENDLG_CONSOLIDATE )
 SFX_IMPL_MODELESSDIALOG_WITHID(ScPrintAreasDlgWrapper, 
SID_OPENDLG_EDIT_PRINTAREA )
 SFX_IMPL_MODELESSDIALOG_WITHID(ScColRowNameRangesDlgWrapper, 
SID_DEFINE_COLROWNAMERANGES )
@@ -139,7 +139,7 @@ IMPL_CHILD_CTOR( ScFilterDlgWrapper, SID_FILTER )
 
 IMPL_CHILD_CTOR( ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
 
-IMPL_CHILD_CTOR( ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
+IMPL_CONTROLLER_CHILD_CTOR( ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
 
 IMPL_CHILD_CTOR( ScColRowNameRangesDlgWrapper, SID_DEFINE_COLROWNAMERANGES )
 
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 8b39b9c7580a..8fb5c9cdd546 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -188,18 +188,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
         }
         break;
 
-        case SID_DEFINE_DBNAME:
-        {
-            // when called for an existing range, then mark
-            GetDBData( true, SC_DB_OLD );
-            const ScMarkData& rMark = GetViewData().GetMarkData();
-            if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
-                MarkDataArea( false );
-
-            pResult = VclPtr<ScDbNameDlg>::Create( pB, pCW, pParent, 
&GetViewData() );
-        }
-        break;
-
         case SID_SPECIAL_FILTER:
         {
             ScQueryParam    aQueryParam;
@@ -496,6 +484,17 @@ std::unique_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
         case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
             xResult.reset(new ScRandomNumberGeneratorDialog(pB, pCW, pParent, 
&GetViewData()));
             break;
+        case SID_DEFINE_DBNAME:
+        {
+            // when called for an existing range, then mark
+            GetDBData( true, SC_DB_OLD );
+            const ScMarkData& rMark = GetViewData().GetMarkData();
+            if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
+                MarkDataArea( false );
+
+            xResult.reset(new ScDbNameDlg(pB, pCW, pParent, &GetViewData()));
+            break;
+        }
     }
 
     if (xResult)
diff --git a/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui 
b/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
index 175ac486bc2f..4cedef27471d 100644
--- a/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
+++ b/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
@@ -1,18 +1,88 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkTreeStore" id="liststore1">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkDialog" id="DefineDatabaseRangeDialog">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
     <property name="title" translatable="yes" 
context="definedatabaserangedialog|DefineDatabaseRangeDialog">Define Database 
Range</property>
+    <property name="resizable">False</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkBox" id="box1">
             <property name="visible">True</property>
@@ -38,17 +108,62 @@
                     <property name="top_padding">6</property>
                     <property name="left_padding">12</property>
                     <child>
-                      <object class="VclComboBoxText" id="entry">
+                      <object class="GtkGrid" id="entrygrid">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
-                        <property name="has_entry">True</property>
-                        <property name="dropdown">False</property>
-                        <child internal-child="entry">
-                          <object class="GtkEntry" id="ComboBoxText-entry">
+                        <property name="row_spacing">3</property>
+                        <child>
+                          <object class="GtkScrolledWindow">
+                            <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                            <property 
name="vscrollbar_policy">always</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+                              <object class="GtkTreeView" id="entry-list">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                                <property name="model">liststore1</property>
+                                <property 
name="headers_visible">False</property>
+                                <property 
name="headers_clickable">False</property>
+                                <property name="search_column">0</property>
+                                <property 
name="show_expanders">False</property>
+                                <child internal-child="selection">
+                                  <object class="GtkTreeSelection" 
id="treeview-selection3"/>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" 
id="treeviewcolumn3">
+                                    <child>
+                                      <object class="GtkCellRendererText" 
id="cellrenderertext3"/>
+                                      <attributes>
+                                        <attribute name="text">0</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="entry">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
+                            <property name="activates_default">True</property>
                           </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                          </packing>
                         </child>
                       </object>
                     </child>
@@ -91,10 +206,11 @@
                         <property name="can_focus">False</property>
                         <property name="spacing">12</property>
                         <child>
-                          <object class="foruilo-RefEdit" id="assign">
+                          <object class="GtkEntry" id="assign">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
+                            <property name="activates_default">True</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -103,7 +219,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="foruilo-RefButton" id="assignrb">
+                          <object class="GtkButton" id="assignrb">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="receives_default">True</property>
@@ -292,8 +408,8 @@
                           <object class="GtkLabel" id="Source">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" 
context="definedatabaserangedialog|Source">Source:</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -305,8 +421,8 @@
                           <object class="GtkLabel" id="Operations">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" 
context="definedatabaserangedialog|Operations">Operations:</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -318,8 +434,8 @@
                           <object class="GtkLabel" id="invalid">
                             <property name="can_focus">False</property>
                             <property name="no_show_all">True</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes" 
context="definedatabaserangedialog|invalid">Invalid range</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -352,63 +468,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="ok">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="help">
-                <property name="label">gtk-help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
-                <property name="secondary">True</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
       </object>
     </child>
     <action-widgets>
diff --git a/solenv/sanitizers/ui/modules/scalc.suppr 
b/solenv/sanitizers/ui/modules/scalc.suppr
index fdf4d4ac0fed..76b986f6089a 100644
--- a/solenv/sanitizers/ui/modules/scalc.suppr
+++ b/solenv/sanitizers/ui/modules/scalc.suppr
@@ -70,6 +70,9 @@ 
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://foruilo-RefEdit[@id='assign'
 sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkLabel[@id='Source'] 
orphan-label
 sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkLabel[@id='Operations'] 
orphan-label
 sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkLabel[@id='invalid'] 
orphan-label
+sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkButton[@id='assignrb'] 
button-no-label
+sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkEntry[@id='assign'] 
no-labelled-by
+sc/uiconfig/scalc/ui/definedatabaserangedialog.ui://GtkEntry[@id='entry'] 
no-labelled-by
 sc/uiconfig/scalc/ui/definename.ui://GtkLabel[@id='label'] orphan-label
 sc/uiconfig/scalc/ui/definename.ui://GtkButton[@id='refbutton'] button-no-label
 sc/uiconfig/scalc/ui/deletecolumnentry.ui:GtkGrid[@id='grid']/GtkBox/GtkLabel 
orphan-label
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 431aa0c1904e..310254b1cfeb 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1236,6 +1236,8 @@ public:
     {
         return m_xFrame->get_label();
     }
+
+    virtual std::unique_ptr<weld::Label> weld_label_widget() const override;
 };
 
 class SalInstanceScrolledWindow : public SalInstanceContainer, public virtual 
weld::ScrolledWindow
@@ -3774,6 +3776,14 @@ public:
     }
 };
 
+std::unique_ptr<weld::Label> SalInstanceFrame::weld_label_widget() const
+{
+    FixedText* pLabel = dynamic_cast<FixedText*>(m_xFrame->get_label_widget());
+    if (!pLabel)
+        return nullptr;
+    return std::make_unique<SalInstanceLabel>(pLabel, m_pBuilder, false);
+}
+
 class SalInstanceTextView : public SalInstanceContainer, public virtual 
weld::TextView
 {
 private:
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 1747184c3ac1..19a3ed29edc4 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3128,6 +3128,8 @@ public:
         const gchar* pStr = gtk_frame_get_label(m_pFrame);
         return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
     }
+
+    virtual std::unique_ptr<weld::Label> weld_label_widget() const override;
 };
 
 static GType crippled_viewport_get_type();
@@ -7540,6 +7542,14 @@ public:
     }
 };
 
+std::unique_ptr<weld::Label> GtkInstanceFrame::weld_label_widget() const
+{
+    GtkWidget* pLabel = gtk_frame_get_label_widget(m_pFrame);
+    if (!pLabel || !GTK_IS_LABEL(pLabel))
+        return nullptr;
+    return std::make_unique<GtkInstanceLabel>(GTK_LABEL(pLabel), m_pBuilder, 
false);
+}
+
 class GtkInstanceTextView : public GtkInstanceContainer, public virtual 
weld::TextView
 {
 private:
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to