dbaccess/source/ui/dlg/indexdialog.cxx | 1099 +++++++++++++++++----------------
 dbaccess/source/ui/inc/indexdialog.hxx |  140 ++--
 solenv/clang-format/excludelist        |    2 
 3 files changed, 639 insertions(+), 602 deletions(-)

New commits:
commit f4d0c1b096799e452e5acdfc0ee806bca7eea26e
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 13 15:32:17 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Feb 14 00:50:15 2026 +0100

    dbaccess: clang-format DbaIndexDialog code
    
    This in particular gets rid of one extra level
    of indentation.
    
    Change-Id: I6050671f67b74d30b841c154ff91be51842844a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199352
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx 
b/dbaccess/source/ui/dlg/indexdialog.cxx
index 25e09de6a8f2..535caed5cfb0 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -39,664 +39,705 @@
 
 namespace dbaui
 {
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdb;
+using namespace ::com::sun::star::lang;
+using namespace ::dbtools;
+
+// helper
+static bool operator==(const OIndexField& _rLHS, const OIndexField& _rRHS)
+{
+    return (_rLHS.sFieldName == _rRHS.sFieldName) && (_rLHS.bSortAscending == 
_rRHS.bSortAscending);
+}
+
+static bool operator==(const IndexFields& _rLHS, const IndexFields& _rRHS)
+{
+    return std::equal(_rLHS.begin(), _rLHS.end(), _rRHS.begin(), _rRHS.end());
+}
+
+static bool operator!=(const IndexFields& _rLHS, const IndexFields& _rRHS)
+{
+    return !(_rLHS == _rRHS);
+}
+
+// DbaIndexDialog
+DbaIndexDialog::DbaIndexDialog(weld::Window* pParent, const 
Sequence<OUString>& _rFieldNames,
+                               const Reference<XNameAccess>& _rxIndexes,
+                               const Reference<XConnection>& _rxConnection,
+                               const Reference<XComponentContext>& _rxContext)
+    : GenericDialogController(pParent, 
u"dbaccess/ui/indexdesigndialog.ui"_ustr,
+                              u"IndexDesignDialog"_ustr)
+    , m_xConnection(_rxConnection)
+    , m_bEditingActive(false)
+    , m_bEditAgain(false)
+    , m_bNoHandlerCall(false)
+    , m_xContext(_rxContext)
+    , m_xActions(m_xBuilder->weld_toolbar(u"ACTIONS"_ustr))
+    , m_xIndexList(m_xBuilder->weld_tree_view(u"INDEX_LIST"_ustr))
+    , m_xIndexDetails(m_xBuilder->weld_label(u"INDEX_DETAILS"_ustr))
+    , m_xDescriptionLabel(m_xBuilder->weld_label(u"DESC_LABEL"_ustr))
+    , m_xDescription(m_xBuilder->weld_label(u"DESCRIPTION"_ustr))
+    , m_xUnique(m_xBuilder->weld_check_button(u"UNIQUE"_ustr))
+    , m_xFieldsLabel(m_xBuilder->weld_label(u"FIELDS_LABEL"_ustr))
+    , m_xClose(m_xBuilder->weld_button(u"close"_ustr))
+    , m_xTable(m_xBuilder->weld_container(u"FIELDS"_ustr))
+    , m_xTableCtrlParent(m_xTable->CreateChildFrame())
+    , m_xFields(VclPtr<IndexFieldsControl>::Create(m_xTableCtrlParent))
+{
+    m_xIndexList->set_size_request(m_xIndexList->get_approximate_digit_width() 
* 17,
+                                   m_xIndexList->get_height_rows(12));
+
+    int nWidth = m_xIndexList->get_approximate_digit_width() * 60;
+    int nHeight = m_xIndexList->get_height_rows(8);
+    m_xTable->set_size_request(nWidth, nHeight);
+
+    m_xActions->connect_clicked(LINK(this, DbaIndexDialog, OnIndexAction));
 
-    using namespace ::com::sun::star::uno;
-    using namespace ::com::sun::star::container;
-    using namespace ::com::sun::star::sdbc;
-    using namespace ::com::sun::star::sdb;
-    using namespace ::com::sun::star::lang;
-    using namespace ::dbtools;
+    m_xIndexList->connect_selection_changed(LINK(this, DbaIndexDialog, 
OnIndexSelected));
+    m_xIndexList->connect_editing(LINK(this, DbaIndexDialog, OnEntryEditing),
+                                  LINK(this, DbaIndexDialog, OnEntryEdited));
 
-    // helper
-    static bool operator ==(const OIndexField& _rLHS, const OIndexField& _rRHS)
+    m_xFields->SetSizePixel(Size(nWidth, 100));
+    m_xFields->Init(_rFieldNames,
+                    ::dbtools::getBooleanDataSourceSetting(m_xConnection, 
"AddIndexAppendix"));
+    m_xFields->Show();
+
+    m_xIndexes.reset(new OIndexCollection());
+    try
     {
-        return  (_rLHS.sFieldName == _rRHS.sFieldName)
-            &&  (_rLHS.bSortAscending == _rRHS.bSortAscending);
+        m_xIndexes->attach(_rxIndexes);
     }
-
-    static bool operator ==(const IndexFields& _rLHS, const IndexFields& _rRHS)
+    catch (SQLException& e)
     {
-        return std::equal(_rLHS.begin(), _rLHS.end(), _rRHS.begin(), 
_rRHS.end());
+        ::dbtools::showError(SQLExceptionInfo(e), pParent->GetXWindow(), 
_rxContext);
     }
-
-    static bool operator !=(const IndexFields& _rLHS, const IndexFields& _rRHS)
+    catch (Exception&)
     {
-        return !(_rLHS == _rRHS);
+        OSL_FAIL("DbaIndexDialog::DbaIndexDialog: could not retrieve basic 
information from the "
+                 "UNO collection!");
     }
 
-    // DbaIndexDialog
-    DbaIndexDialog::DbaIndexDialog(weld::Window* pParent, const Sequence< 
OUString >& _rFieldNames,
-                                   const Reference< XNameAccess >& _rxIndexes,
-                                   const Reference< XConnection >& 
_rxConnection,
-                                   const Reference< XComponentContext >& 
_rxContext)
-        : GenericDialogController(pParent, 
u"dbaccess/ui/indexdesigndialog.ui"_ustr, u"IndexDesignDialog"_ustr)
-        , m_xConnection(_rxConnection)
-        , m_bEditingActive(false)
-        , m_bEditAgain(false)
-        , m_bNoHandlerCall(false)
-        , m_xContext(_rxContext)
-        , m_xActions(m_xBuilder->weld_toolbar(u"ACTIONS"_ustr))
-        , m_xIndexList(m_xBuilder->weld_tree_view(u"INDEX_LIST"_ustr))
-        , m_xIndexDetails(m_xBuilder->weld_label(u"INDEX_DETAILS"_ustr))
-        , m_xDescriptionLabel(m_xBuilder->weld_label(u"DESC_LABEL"_ustr))
-        , m_xDescription(m_xBuilder->weld_label(u"DESCRIPTION"_ustr))
-        , m_xUnique(m_xBuilder->weld_check_button(u"UNIQUE"_ustr))
-        , m_xFieldsLabel(m_xBuilder->weld_label(u"FIELDS_LABEL"_ustr))
-        , m_xClose(m_xBuilder->weld_button(u"close"_ustr))
-        , m_xTable(m_xBuilder->weld_container(u"FIELDS"_ustr))
-        , m_xTableCtrlParent(m_xTable->CreateChildFrame())
-        , m_xFields(VclPtr<IndexFieldsControl>::Create(m_xTableCtrlParent))
+    fillIndexList();
+
+    m_xUnique->connect_toggled(LINK(this, DbaIndexDialog, OnModifiedClick));
+    m_xFields->SetModifyHdl(LINK(this, DbaIndexDialog, OnModified));
+
+    m_xClose->connect_clicked(LINK(this, DbaIndexDialog, OnCloseDialog));
+
+    // if all of the indexes have an empty description, we're not interested 
in displaying it
+    bool bFound = false;
+    for (auto const& check : *m_xIndexes)
+    {
+        if (!check.sDescription.isEmpty())
+        {
+            bFound = true;
+            break;
+        }
+    }
+    if (!bFound)
     {
-        
m_xIndexList->set_size_request(m_xIndexList->get_approximate_digit_width() * 17,
-                                       m_xIndexList->get_height_rows(12));
+        // hide the controls which are necessary for the description
+        m_xDescription->hide();
+        m_xDescriptionLabel->hide();
+    }
+}
 
-        int nWidth = m_xIndexList->get_approximate_digit_width() * 60;
-        int nHeight = m_xIndexList->get_height_rows(8);
-        m_xTable->set_size_request(nWidth, nHeight);
+void DbaIndexDialog::updateToolbox()
+{
+    m_xActions->set_item_sensitive(u"ID_INDEX_NEW"_ustr, !m_bEditingActive);
 
-        m_xActions->connect_clicked(LINK(this, DbaIndexDialog, OnIndexAction));
+    int nSelected = m_xIndexList->get_selected_index();
+    bool bSelectedAnything = nSelected != -1;
+    if (bSelectedAnything)
+    {
+        // is the current entry modified?
+        Indexes::const_iterator aSelectedPos
+            = m_xIndexes->begin() + m_xIndexList->get_id(nSelected).toUInt32();
+        m_xActions->set_item_sensitive(u"ID_INDEX_SAVE"_ustr,
+                                       aSelectedPos->isModified() || 
aSelectedPos->isNew());
+        m_xActions->set_item_sensitive(u"ID_INDEX_RESET"_ustr,
+                                       aSelectedPos->isModified() || 
aSelectedPos->isNew());
+        bSelectedAnything = !aSelectedPos->bPrimaryKey;
+    }
+    else
+    {
+        m_xActions->set_item_sensitive(u"ID_INDEX_SAVE"_ustr, false);
+        m_xActions->set_item_sensitive(u"ID_INDEX_RESET"_ustr, false);
+    }
+    m_xActions->set_item_sensitive(u"ID_INDEX_DROP"_ustr, bSelectedAnything);
+    m_xActions->set_item_sensitive(u"ID_INDEX_RENAME"_ustr, bSelectedAnything);
+}
 
-        m_xIndexList->connect_selection_changed(LINK(this, DbaIndexDialog, 
OnIndexSelected));
-        m_xIndexList->connect_editing(LINK(this, DbaIndexDialog, 
OnEntryEditing),
-                                      LINK(this, DbaIndexDialog, 
OnEntryEdited));
+void DbaIndexDialog::fillIndexList()
+{
+    OUString aPKeyIcon(BMP_PKEYICON);
+    // fill the list with the index names
+    m_xIndexList->clear();
+    sal_uInt32 nPos = 0;
+    for (auto const& indexLoop : *m_xIndexes)
+    {
+        m_xIndexList->append(OUString::number(nPos), indexLoop.sName);
+        if (indexLoop.bPrimaryKey)
+            m_xIndexList->set_image(nPos, aPKeyIcon);
+        ++nPos;
+    }
 
-        m_xFields->SetSizePixel(Size(nWidth, 100));
-        m_xFields->Init(_rFieldNames, ::dbtools::getBooleanDataSourceSetting( 
m_xConnection, "AddIndexAppendix" ));
-        m_xFields->Show();
+    if (nPos)
+        m_xIndexList->select(0);
 
-        m_xIndexes.reset(new OIndexCollection());
-        try
-        {
-            m_xIndexes->attach(_rxIndexes);
-        }
-        catch(SQLException& e)
-        {
-            ::dbtools::showError(SQLExceptionInfo(e), pParent->GetXWindow(), 
_rxContext);
-        }
-        catch(Exception&)
-        {
-            OSL_FAIL("DbaIndexDialog::DbaIndexDialog: could not retrieve basic 
information from the UNO collection!");
-        }
+    IndexSelected();
+}
 
-        fillIndexList();
+DbaIndexDialog::~DbaIndexDialog()
+{
+    m_xIndexes.reset();
+    m_xFields.disposeAndClear();
+    m_xTableCtrlParent->dispose();
+    m_xTableCtrlParent.clear();
+}
 
-        m_xUnique->connect_toggled(LINK(this, DbaIndexDialog, 
OnModifiedClick));
-        m_xFields->SetModifyHdl(LINK(this, DbaIndexDialog, OnModified));
+bool DbaIndexDialog::implCommit(const weld::TreeIter* pEntry)
+{
+    assert(pEntry && "DbaIndexDialog::implCommit: invalid entry!");
 
-        m_xClose->connect_clicked(LINK(this, DbaIndexDialog, OnCloseDialog));
+    Indexes::iterator aCommitPos = m_xIndexes->begin() + 
m_xIndexList->get_id(*pEntry).toUInt32();
 
-        // if all of the indexes have an empty description, we're not 
interested in displaying it
-        bool bFound = false;
-        for (auto const& check : *m_xIndexes)
-        {
-            if (!check.sDescription.isEmpty())
-            {
-                bFound = true;
-                break;
-            }
-        }
-        if (!bFound)
-        {
-            // hide the controls which are necessary for the description
-            m_xDescription->hide();
-            m_xDescriptionLabel->hide();
-        }
-    }
+    // if it's not a new index, remove it
+    // (we can't modify indexes, only drop'n'insert)
+    if (!aCommitPos->isNew())
+        if (!implDropIndex(pEntry, false))
+            return false;
 
-    void DbaIndexDialog::updateToolbox()
+    // create the new index
+    SQLExceptionInfo aExceptionInfo;
+    try
     {
-        m_xActions->set_item_sensitive(u"ID_INDEX_NEW"_ustr, 
!m_bEditingActive);
-
-        int nSelected = m_xIndexList->get_selected_index();
-        bool bSelectedAnything = nSelected != -1;
-        if (bSelectedAnything)
-        {
-            // is the current entry modified?
-            Indexes::const_iterator aSelectedPos = m_xIndexes->begin() + 
m_xIndexList->get_id(nSelected).toUInt32();
-            m_xActions->set_item_sensitive(u"ID_INDEX_SAVE"_ustr, 
aSelectedPos->isModified() || aSelectedPos->isNew());
-            m_xActions->set_item_sensitive(u"ID_INDEX_RESET"_ustr, 
aSelectedPos->isModified() || aSelectedPos->isNew());
-            bSelectedAnything = !aSelectedPos->bPrimaryKey;
-        }
-        else
-        {
-            m_xActions->set_item_sensitive(u"ID_INDEX_SAVE"_ustr, false);
-            m_xActions->set_item_sensitive(u"ID_INDEX_RESET"_ustr, false);
-        }
-        m_xActions->set_item_sensitive(u"ID_INDEX_DROP"_ustr, 
bSelectedAnything);
-        m_xActions->set_item_sensitive(u"ID_INDEX_RENAME"_ustr, 
bSelectedAnything);
+        m_xIndexes->commitNewIndex(aCommitPos);
     }
-
-    void DbaIndexDialog::fillIndexList()
+    catch (SQLContext& e)
     {
-        OUString aPKeyIcon(BMP_PKEYICON);
-        // fill the list with the index names
-        m_xIndexList->clear();
-        sal_uInt32 nPos = 0;
-        for (auto const& indexLoop : *m_xIndexes)
-        {
-            m_xIndexList->append(OUString::number(nPos), indexLoop.sName);
-            if (indexLoop.bPrimaryKey)
-                m_xIndexList->set_image(nPos, aPKeyIcon);
-            ++nPos;
-        }
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
+    catch (SQLWarning& e)
+    {
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
+    catch (SQLException& e)
+    {
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
 
-        if (nPos)
-            m_xIndexList->select(0);
+    // reflect the new selection in the toolbox
+    updateToolbox();
 
-        IndexSelected();
+    if (aExceptionInfo.isValid())
+        showError(aExceptionInfo, m_xDialog->GetXWindow(), m_xContext);
+    else
+    {
+        m_xUnique->save_state();
+        m_xFields->SaveValue();
     }
 
-    DbaIndexDialog::~DbaIndexDialog( )
+    return !aExceptionInfo.isValid();
+}
+
+void DbaIndexDialog::OnNewIndex()
+{
+    // commit the current entry, if necessary
+    if (!implCommitPreviouslySelected())
+        return;
+
+    // get a new unique name for the new index
+    OUString sNewIndexName;
+    const OUString sNewIndexNameBase(DBA_RES(STR_LOGICAL_INDEX_NAME));
+    sal_Int32 i;
+
+    for (i = 1; i < 0x7FFFFFFF; ++i)
     {
-        m_xIndexes.reset();
-        m_xFields.disposeAndClear();
-        m_xTableCtrlParent->dispose();
-        m_xTableCtrlParent.clear();
+        sNewIndexName = sNewIndexNameBase + OUString::number(i);
+        if (m_xIndexes->end() == m_xIndexes->find(sNewIndexName))
+            break;
     }
-
-    bool DbaIndexDialog::implCommit(const weld::TreeIter* pEntry)
+    if (i == 0x7FFFFFFF)
     {
-        assert(pEntry && "DbaIndexDialog::implCommit: invalid entry!");
+        OSL_FAIL("DbaIndexDialog::OnNewIndex: no free index name found!");
+        // can't do anything ... of course we try another base, but this could 
end with the same result ...
+        return;
+    }
 
-        Indexes::iterator aCommitPos = m_xIndexes->begin() + 
m_xIndexList->get_id(*pEntry).toUInt32();
+    std::unique_ptr<weld::TreeIter> xNewEntry(m_xIndexList->make_iterator());
+    m_xIndexList->insert(nullptr, -1, &sNewIndexName, nullptr, nullptr, 
nullptr, false,
+                         xNewEntry.get());
+    m_xIndexes->insert(sNewIndexName);
+
+    // update the user data on the entries in the list box:
+    // they're iterators of the index collection, and thus they have changed 
when removing the index
+    m_xIndexList->all_foreach([this](weld::TreeIter& rEntry) {
+        Indexes::const_iterator aAfterInsertPos = 
m_xIndexes->find(m_xIndexList->get_text(rEntry));
+        OSL_ENSURE(aAfterInsertPos != m_xIndexes->end(),
+                   "DbaIndexDialog::OnNewIndex: problems with one of the 
entries!");
+        m_xIndexList->set_id(rEntry, OUString::number(aAfterInsertPos - 
m_xIndexes->begin()));
+        return false;
+    });
+
+    // select the entry and start in-place editing
+    m_bNoHandlerCall = true;
+    m_xIndexList->select(*xNewEntry);
+    m_bNoHandlerCall = false;
+    IndexSelected();
+    m_xIndexList->grab_focus();
+    m_xIndexList->start_editing(*xNewEntry);
+    updateToolbox();
+}
+
+void DbaIndexDialog::OnDropIndex(bool _bConfirm)
+{
+    std::unique_ptr<weld::TreeIter> xSelected = m_xIndexList->get_selected();
+    // the selected index
+    if (!xSelected)
+        return;
 
-        // if it's not a new index, remove it
-        // (we can't modify indexes, only drop'n'insert)
-        if (!aCommitPos->isNew())
-            if (!implDropIndex(pEntry, false))
-                return false;
+    // let the user confirm the drop
+    if (_bConfirm)
+    {
+        OUString sConfirm(DBA_RES(STR_CONFIRM_DROP_INDEX));
+        sConfirm = sConfirm.replaceFirst("$name$", 
m_xIndexList->get_text(*xSelected));
+        std::unique_ptr<weld::MessageDialog> 
xConfirm(Application::CreateMessageDialog(
+            m_xDialog.get(), VclMessageType::Question, VclButtonsType::YesNo, 
sConfirm));
+        if (RET_YES != xConfirm->run())
+            return;
+    }
 
-        // create the new index
-        SQLExceptionInfo aExceptionInfo;
-        try
-        {
-            m_xIndexes->commitNewIndex(aCommitPos);
-        }
-        catch(SQLContext& e) { aExceptionInfo = SQLExceptionInfo(e); }
-        catch(SQLWarning& e) { aExceptionInfo = SQLExceptionInfo(e); }
-        catch(SQLException& e) { aExceptionInfo = SQLExceptionInfo(e); }
+    // do the drop
+    implDropIndex(xSelected.get(), true);
 
-        // reflect the new selection in the toolbox
-        updateToolbox();
+    // reflect the new selection in the toolbox
+    updateToolbox();
+}
 
-        if (aExceptionInfo.isValid())
-            showError(aExceptionInfo, m_xDialog->GetXWindow(), m_xContext);
+bool DbaIndexDialog::implDropIndex(const weld::TreeIter* pEntry, bool 
_bRemoveFromCollection)
+{
+    // do the drop
+    Indexes::iterator aDropPos = m_xIndexes->begin() + 
m_xIndexList->get_id(*pEntry).toUInt32();
+    OSL_ENSURE(aDropPos != m_xIndexes->end(),
+               "DbaIndexDialog::OnDropIndex: did not find the index in my 
collection!");
+
+    SQLExceptionInfo aExceptionInfo;
+    bool bSuccess = false;
+    try
+    {
+        if (_bRemoveFromCollection)
+            bSuccess = m_xIndexes->drop(aDropPos);
         else
-        {
-            m_xUnique->save_state();
-            m_xFields->SaveValue();
-        }
-
-        return !aExceptionInfo.isValid();
+            bSuccess = m_xIndexes->dropNoRemove(aDropPos);
     }
-
-    void DbaIndexDialog::OnNewIndex()
+    catch (SQLContext& e)
     {
-        // commit the current entry, if necessary
-        if (!implCommitPreviouslySelected())
-            return;
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
+    catch (SQLWarning& e)
+    {
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
+    catch (SQLException& e)
+    {
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
 
-        // get a new unique name for the new index
-        OUString sNewIndexName;
-        const OUString sNewIndexNameBase(DBA_RES(STR_LOGICAL_INDEX_NAME));
-        sal_Int32 i;
+    if (aExceptionInfo.isValid())
+        showError(aExceptionInfo, m_xDialog->GetXWindow(), m_xContext);
+    else if (bSuccess && _bRemoveFromCollection)
+    {
+        m_bNoHandlerCall = true;
 
-        for ( i = 1; i < 0x7FFFFFFF; ++i )
-        {
-            sNewIndexName = sNewIndexNameBase + OUString::number(i);
-            if (m_xIndexes->end() == m_xIndexes->find(sNewIndexName))
-                break;
-        }
-        if (i == 0x7FFFFFFF)
-        {
-            OSL_FAIL("DbaIndexDialog::OnNewIndex: no free index name found!");
-            // can't do anything ... of course we try another base, but this 
could end with the same result ...
-            return;
-        }
+        // if the entry to remove is the selected on...
+        if (m_xPreviousSelection && m_xPreviousSelection->equal(*pEntry))
+            m_xPreviousSelection.reset();
+        m_xIndexList->remove(*pEntry);
 
-        std::unique_ptr<weld::TreeIter> 
xNewEntry(m_xIndexList->make_iterator());
-        m_xIndexList->insert(nullptr, -1, &sNewIndexName, nullptr, nullptr, 
nullptr, false, xNewEntry.get());
-        m_xIndexes->insert(sNewIndexName);
+        m_bNoHandlerCall = false;
 
         // update the user data on the entries in the list box:
         // they're iterators of the index collection, and thus they have 
changed when removing the index
-        m_xIndexList->all_foreach([this](weld::TreeIter& rEntry){
-            Indexes::const_iterator aAfterInsertPos = 
m_xIndexes->find(m_xIndexList->get_text(rEntry));
-            OSL_ENSURE(aAfterInsertPos != m_xIndexes->end(), 
"DbaIndexDialog::OnNewIndex: problems with one of the entries!");
-            m_xIndexList->set_id(rEntry, OUString::number(aAfterInsertPos - 
m_xIndexes->begin()));
+        m_xIndexList->all_foreach([this](weld::TreeIter& rEntry) {
+            Indexes::const_iterator aAfterDropPos
+                = m_xIndexes->find(m_xIndexList->get_text(rEntry));
+            OSL_ENSURE(aAfterDropPos != m_xIndexes->end(),
+                       "DbaIndexDialog::OnDropIndex: problems with one of the 
remaining entries!");
+            m_xIndexList->set_id(rEntry, OUString::number(aAfterDropPos - 
m_xIndexes->begin()));
             return false;
         });
 
-        // select the entry and start in-place editing
-        m_bNoHandlerCall = true;
-        m_xIndexList->select(*xNewEntry);
-        m_bNoHandlerCall = false;
+        // the Remove automatically selected another entry (if possible), but 
we disabled the calling of the handler
+        // to prevent that we missed something... call the handler directly
         IndexSelected();
-        m_xIndexList->grab_focus();
-        m_xIndexList->start_editing(*xNewEntry);
-        updateToolbox();
     }
 
-    void DbaIndexDialog::OnDropIndex(bool _bConfirm)
-    {
-        std::unique_ptr<weld::TreeIter> xSelected = 
m_xIndexList->get_selected();
-        // the selected index
-        if (!xSelected)
-            return;
+    return !aExceptionInfo.isValid();
+}
 
-        // let the user confirm the drop
-        if (_bConfirm)
-        {
-            OUString sConfirm(DBA_RES(STR_CONFIRM_DROP_INDEX));
-            sConfirm = sConfirm.replaceFirst("$name$", 
m_xIndexList->get_text(*xSelected));
-            std::unique_ptr<weld::MessageDialog> 
xConfirm(Application::CreateMessageDialog(m_xDialog.get(),
-                                                          
VclMessageType::Question, VclButtonsType::YesNo,
-                                                          sConfirm));
-            if (RET_YES != xConfirm->run())
-                return;
-        }
+void DbaIndexDialog::OnRenameIndex()
+{
+    // the selected iterator
+    std::unique_ptr<weld::TreeIter> xSelected = m_xIndexList->get_selected();
+    if (!xSelected)
+        return;
+
+    // save the changes made 'til here
+    // Upon leaving the edit mode, the control will be re-initialized with the
+    // settings from the current entry
+    implSaveModified(false);
+
+    m_xIndexList->grab_focus();
+    m_xIndexList->start_editing(*xSelected);
+    updateToolbox();
+}
+
+void DbaIndexDialog::OnSaveIndex()
+{
+    // the selected index
+    implCommitPreviouslySelected();
+    updateToolbox();
+}
 
-        // do the drop
-        implDropIndex(xSelected.get(), true);
+void DbaIndexDialog::OnResetIndex()
+{
+    // the selected index
+    std::unique_ptr<weld::TreeIter> xSelected = m_xIndexList->get_selected();
+    OSL_ENSURE(xSelected, "DbaIndexDialog::OnResetIndex: invalid call!");
+    if (!xSelected)
+        return;
 
-        // reflect the new selection in the toolbox
-        updateToolbox();
-    }
+    Indexes::iterator aResetPos = m_xIndexes->begin() + 
m_xIndexList->get_id(*xSelected).toUInt32();
 
-    bool DbaIndexDialog::implDropIndex(const weld::TreeIter* pEntry, bool 
_bRemoveFromCollection)
+    if (aResetPos->isNew())
     {
-        // do the drop
-        Indexes::iterator aDropPos = m_xIndexes->begin() + 
m_xIndexList->get_id(*pEntry).toUInt32();
-        OSL_ENSURE(aDropPos != m_xIndexes->end(), 
"DbaIndexDialog::OnDropIndex: did not find the index in my collection!");
-
-        SQLExceptionInfo aExceptionInfo;
-        bool bSuccess = false;
-        try
-        {
-            if (_bRemoveFromCollection)
-                bSuccess = m_xIndexes->drop(aDropPos);
-            else
-                bSuccess = m_xIndexes->dropNoRemove(aDropPos);
-        }
-        catch(SQLContext& e) { aExceptionInfo = SQLExceptionInfo(e); }
-        catch(SQLWarning& e) { aExceptionInfo = SQLExceptionInfo(e); }
-        catch(SQLException& e) { aExceptionInfo = SQLExceptionInfo(e); }
-
-        if (aExceptionInfo.isValid())
-            showError(aExceptionInfo, m_xDialog->GetXWindow(), m_xContext);
-        else if (bSuccess && _bRemoveFromCollection)
-        {
-            m_bNoHandlerCall = true;
-
-            // if the entry to remove is the selected on...
-            if (m_xPreviousSelection && m_xPreviousSelection->equal(*pEntry))
-                m_xPreviousSelection.reset();
-            m_xIndexList->remove(*pEntry);
-
-            m_bNoHandlerCall = false;
-
-            // update the user data on the entries in the list box:
-            // they're iterators of the index collection, and thus they have 
changed when removing the index
-            m_xIndexList->all_foreach([this](weld::TreeIter& rEntry){
-                Indexes::const_iterator aAfterDropPos = 
m_xIndexes->find(m_xIndexList->get_text(rEntry));
-                OSL_ENSURE(aAfterDropPos != m_xIndexes->end(), 
"DbaIndexDialog::OnDropIndex: problems with one of the remaining entries!");
-                m_xIndexList->set_id(rEntry, OUString::number(aAfterDropPos - 
m_xIndexes->begin()));
-                return false;
-            });
-
-            // the Remove automatically selected another entry (if possible), 
but we disabled the calling of the handler
-            // to prevent that we missed something... call the handler directly
-            IndexSelected();
-        }
-
-        return !aExceptionInfo.isValid();
+        OnDropIndex(false);
+        return;
     }
 
-    void DbaIndexDialog::OnRenameIndex()
+    SQLExceptionInfo aExceptionInfo;
+    try
     {
-        // the selected iterator
-        std::unique_ptr<weld::TreeIter> xSelected = 
m_xIndexList->get_selected();
-        if (!xSelected)
-            return;
-
-        // save the changes made 'til here
-        // Upon leaving the edit mode, the control will be re-initialized with 
the
-        // settings from the current entry
-        implSaveModified(false);
-
-        m_xIndexList->grab_focus();
-        m_xIndexList->start_editing(*xSelected);
-        updateToolbox();
+        m_xIndexes->resetIndex(aResetPos);
     }
-
-    void DbaIndexDialog::OnSaveIndex()
+    catch (SQLContext& e)
     {
-        // the selected index
-        implCommitPreviouslySelected();
-        updateToolbox();
+        aExceptionInfo = SQLExceptionInfo(e);
     }
-
-    void DbaIndexDialog::OnResetIndex()
+    catch (SQLWarning& e)
     {
-        // the selected index
-        std::unique_ptr<weld::TreeIter> xSelected = 
m_xIndexList->get_selected();
-        OSL_ENSURE(xSelected, "DbaIndexDialog::OnResetIndex: invalid call!");
-        if (!xSelected)
-            return;
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
+    catch (SQLException& e)
+    {
+        aExceptionInfo = SQLExceptionInfo(e);
+    }
 
-        Indexes::iterator aResetPos = m_xIndexes->begin() + 
m_xIndexList->get_id(*xSelected).toUInt32();
+    if (aExceptionInfo.isValid())
+        showError(aExceptionInfo, m_xDialog->GetXWindow(), m_xContext);
+    else
+        m_xIndexList->set_text(*xSelected, aResetPos->sName);
 
-        if (aResetPos->isNew())
-        {
-            OnDropIndex(false);
+    updateControls(xSelected.get());
+    updateToolbox();
+}
+
+IMPL_LINK(DbaIndexDialog, OnIndexAction, const OUString&, rClicked, void)
+{
+    if (rClicked == "ID_INDEX_NEW")
+        OnNewIndex();
+    else if (rClicked == "ID_INDEX_DROP")
+        OnDropIndex();
+    else if (rClicked == "ID_INDEX_RENAME")
+        OnRenameIndex();
+    else if (rClicked == "ID_INDEX_SAVE")
+        OnSaveIndex();
+    else if (rClicked == "ID_INDEX_RESET")
+        OnResetIndex();
+}
+
+IMPL_LINK_NOARG(DbaIndexDialog, OnCloseDialog, weld::Button&, void)
+{
+    if (m_bEditingActive)
+    {
+        OSL_ENSURE(!m_bEditAgain, "DbaIndexDialog::OnCloseDialog: somebody was 
faster than hell!");
+        // this means somebody entered a new name, which was invalid, which 
cause us to posted us an event,
+        // and before the event arrived the user clicked onto "close". VERY 
fast, this user...
+        m_xIndexList->end_editing();
+        if (m_bEditAgain)
+            // could not commit the new name (started a new - asynchronous - 
edit trial)
             return;
-        }
+    }
 
-        SQLExceptionInfo aExceptionInfo;
-        try
+    // the currently selected entry
+    std::unique_ptr<weld::TreeIter> xSelected = m_xIndexList->get_selected();
+    OSL_ENSURE(xSelected && m_xPreviousSelection && 
xSelected->equal(*m_xPreviousSelection),
+               "DbaIndexDialog::OnCloseDialog: inconsistence!");
+
+    sal_Int32 nResponse = RET_NO;
+    if (xSelected)
+    {
+        // the descriptor
+        Indexes::const_iterator aSelected
+            = m_xIndexes->begin() + 
m_xIndexList->get_id(*xSelected).toUInt32();
+        if (aSelected->isModified() || aSelected->isNew())
         {
-            m_xIndexes->resetIndex(aResetPos);
+            std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(
+                m_xDialog.get(), u"dbaccess/ui/saveindexdialog.ui"_ustr));
+            std::unique_ptr<weld::MessageDialog> xQuery(
+                xBuilder->weld_message_dialog(u"SaveIndexDialog"_ustr));
+            nResponse = xQuery->run();
         }
-        catch(SQLContext& e) { aExceptionInfo = SQLExceptionInfo(e); }
-        catch(SQLWarning& e) { aExceptionInfo = SQLExceptionInfo(e); }
-        catch(SQLException& e) { aExceptionInfo = SQLExceptionInfo(e); }
-
-        if (aExceptionInfo.isValid())
-            showError(aExceptionInfo, m_xDialog->GetXWindow(), m_xContext);
-        else
-            m_xIndexList->set_text(*xSelected, aResetPos->sName);
-
-        updateControls(xSelected.get());
-        updateToolbox();
     }
 
-    IMPL_LINK(DbaIndexDialog, OnIndexAction, const OUString&, rClicked, void)
+    switch (nResponse)
     {
-        if (rClicked == "ID_INDEX_NEW")
-            OnNewIndex();
-        else if (rClicked == "ID_INDEX_DROP")
-            OnDropIndex();
-        else if (rClicked == "ID_INDEX_RENAME")
-            OnRenameIndex();
-        else if (rClicked == "ID_INDEX_SAVE")
-            OnSaveIndex();
-        else if (rClicked == "ID_INDEX_RESET")
-            OnResetIndex();
+        case RET_YES:
+            if (!implCommitPreviouslySelected())
+                return;
+            break;
+        case RET_NO:
+            break;
+        default:
+            return;
     }
 
-    IMPL_LINK_NOARG(DbaIndexDialog, OnCloseDialog, weld::Button&, void)
-    {
-        if (m_bEditingActive)
-        {
-            OSL_ENSURE(!m_bEditAgain, "DbaIndexDialog::OnCloseDialog: somebody 
was faster than hell!");
-                // this means somebody entered a new name, which was invalid, 
which cause us to posted us an event,
-                // and before the event arrived the user clicked onto "close". 
VERY fast, this user...
-            m_xIndexList->end_editing();
-            if (m_bEditAgain)
-                // could not commit the new name (started a new - asynchronous 
- edit trial)
-                return;
-        }
+    m_xDialog->response(RET_OK);
+}
 
-        // the currently selected entry
-        std::unique_ptr<weld::TreeIter> xSelected = 
m_xIndexList->get_selected();
-        OSL_ENSURE(xSelected && m_xPreviousSelection && 
xSelected->equal(*m_xPreviousSelection), "DbaIndexDialog::OnCloseDialog: 
inconsistence!");
+IMPL_LINK(DbaIndexDialog, OnEditIndexAgain, void*, p, void)
+{
+    weld::TreeIter* pEntry = static_cast<weld::TreeIter*>(p);
+    m_bEditAgain = false;
+    m_xIndexList->grab_focus();
+    m_xIndexList->start_editing(*pEntry);
+    delete pEntry;
+}
+
+IMPL_LINK_NOARG(DbaIndexDialog, OnEntryEditing, const weld::TreeIter&, bool)
+{
+    m_bEditingActive = true;
+    return true;
+}
 
-        sal_Int32 nResponse = RET_NO;
-        if (xSelected)
-        {
-            // the descriptor
-            Indexes::const_iterator aSelected = m_xIndexes->begin() + 
m_xIndexList->get_id(*xSelected).toUInt32();
-            if (aSelected->isModified() || aSelected->isNew())
-            {
-                std::unique_ptr<weld::Builder> 
xBuilder(Application::CreateBuilder(m_xDialog.get(), 
u"dbaccess/ui/saveindexdialog.ui"_ustr));
-                std::unique_ptr<weld::MessageDialog> 
xQuery(xBuilder->weld_message_dialog(u"SaveIndexDialog"_ustr));
-                nResponse = xQuery->run();
-            }
-        }
+IMPL_LINK(DbaIndexDialog, OnEntryEdited, const IterString&, rIterString, bool)
+{
+    m_bEditingActive = false;
 
-        switch (nResponse)
-        {
-            case RET_YES:
-                if (!implCommitPreviouslySelected())
-                    return;
-                break;
-            case RET_NO:
-                break;
-            default:
-                return;
-        }
+    const weld::TreeIter& rEntry = rIterString.first;
+    OUString sNewName = rIterString.second;
 
-        m_xDialog->response(RET_OK);
-    }
+    Indexes::iterator aPosition = m_xIndexes->begin() + 
m_xIndexList->get_id(rEntry).toUInt32();
+
+    OSL_ENSURE(aPosition >= m_xIndexes->begin() && aPosition < 
m_xIndexes->end(),
+               "DbaIndexDialog::OnEntryEdited: invalid entry!");
 
-    IMPL_LINK(DbaIndexDialog, OnEditIndexAgain, void*, p, void)
+    Indexes::const_iterator aSameName = m_xIndexes->find(sNewName);
+    if (aSameName != aPosition && m_xIndexes->end() != aSameName)
     {
-        weld::TreeIter* pEntry = static_cast<weld::TreeIter*>(p);
-        m_bEditAgain = false;
-        m_xIndexList->grab_focus();
-        m_xIndexList->start_editing(*pEntry);
-        delete pEntry;
+        OUString sError(DBA_RES(STR_INDEX_NAME_ALREADY_USED));
+        sError = sError.replaceFirst("$name$", sNewName);
+        std::unique_ptr<weld::MessageDialog> 
xError(Application::CreateMessageDialog(
+            m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, 
sError));
+        xError->run();
+
+        updateToolbox();
+        m_bEditAgain = true;
+        std::unique_ptr<weld::TreeIter> 
xEntry(m_xIndexList->make_iterator(&rEntry));
+        Application::PostUserEvent(LINK(this, DbaIndexDialog, 
OnEditIndexAgain), xEntry.release());
+        return false;
     }
 
-    IMPL_LINK_NOARG(DbaIndexDialog, OnEntryEditing, const weld::TreeIter&, 
bool)
+    aPosition->sName = sNewName;
+
+    // rename can be done by a drop/insert combination only
+    if (aPosition->isNew())
     {
-        m_bEditingActive = true;
+        updateToolbox();
+        // no commitment needed here...
         return true;
     }
 
-    IMPL_LINK(DbaIndexDialog, OnEntryEdited, const IterString&, rIterString, 
bool)
+    if (aPosition->sName != aPosition->getOriginalName())
     {
-        m_bEditingActive = false;
-
-        const weld::TreeIter& rEntry = rIterString.first;
-        OUString sNewName = rIterString.second;
-
-        Indexes::iterator aPosition = m_xIndexes->begin() + 
m_xIndexList->get_id(rEntry).toUInt32();
-
-        OSL_ENSURE(aPosition >= m_xIndexes->begin() && aPosition < 
m_xIndexes->end(),
-            "DbaIndexDialog::OnEntryEdited: invalid entry!");
-
-        Indexes::const_iterator aSameName = m_xIndexes->find(sNewName);
-        if (aSameName != aPosition && m_xIndexes->end() != aSameName)
-        {
-            OUString sError(DBA_RES(STR_INDEX_NAME_ALREADY_USED));
-            sError = sError.replaceFirst("$name$", sNewName);
-            std::unique_ptr<weld::MessageDialog> 
xError(Application::CreateMessageDialog(m_xDialog.get(),
-                                                        
VclMessageType::Warning, VclButtonsType::Ok,
-                                                        sError));
-            xError->run();
-
-            updateToolbox();
-            m_bEditAgain = true;
-            std::unique_ptr<weld::TreeIter> 
xEntry(m_xIndexList->make_iterator(&rEntry));
-            Application::PostUserEvent(LINK(this, DbaIndexDialog, 
OnEditIndexAgain), xEntry.release());
-            return false;
-        }
-
-        aPosition->sName = sNewName;
-
-        // rename can be done by a drop/insert combination only
-        if (aPosition->isNew())
-        {
-            updateToolbox();
-            // no commitment needed here...
-            return true;
-        }
+        aPosition->setModified(true);
+        updateToolbox();
+    }
 
-        if (aPosition->sName != aPosition->getOriginalName())
-        {
-            aPosition->setModified(true);
-            updateToolbox();
-        }
+    return true;
+}
 
+bool DbaIndexDialog::implSaveModified(bool _bPlausibility)
+{
+    if (!m_xPreviousSelection)
         return true;
-    }
 
-    bool DbaIndexDialog::implSaveModified(bool _bPlausibility)
-    {
-        if (!m_xPreviousSelection)
-            return true;
+    // try to commit the previously selected index
+    if (m_xFields->IsModified() && !m_xFields->SaveModified())
+        return false;
 
-        // try to commit the previously selected index
-        if (m_xFields->IsModified() && !m_xFields->SaveModified())
-            return false;
+    Indexes::iterator aPreviouslySelected
+        = m_xIndexes->begin() + 
m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
 
-        Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + 
m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
+    // the unique flag
+    aPreviouslySelected->bUnique = m_xUnique->get_active();
+    if (m_xUnique->get_state_changed_from_saved())
+        aPreviouslySelected->setModified(true);
 
-        // the unique flag
-        aPreviouslySelected->bUnique = m_xUnique->get_active();
-        if (m_xUnique->get_state_changed_from_saved())
-            aPreviouslySelected->setModified(true);
+    // the fields
+    m_xFields->commitTo(aPreviouslySelected->aFields);
+    if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields)
+        aPreviouslySelected->setModified(true);
 
-        // the fields
-        m_xFields->commitTo(aPreviouslySelected->aFields);
-        if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields)
-            aPreviouslySelected->setModified(true);
+    // plausibility checks
+    if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected))
+        return false;
 
-        // plausibility checks
-        if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected))
-            return false;
+    return true;
+}
 
-        return true;
+bool DbaIndexDialog::implCheckPlausibility(const Indexes::const_iterator& 
_rPos)
+{
+    // need at least one field
+    if (_rPos->aFields.empty())
+    {
+        std::unique_ptr<weld::MessageDialog> xError(
+            Application::CreateMessageDialog(m_xDialog.get(), 
VclMessageType::Warning,
+                                             VclButtonsType::Ok, 
DBA_RES(STR_NEED_INDEX_FIELDS)));
+        xError->run();
+        m_xFields->GrabFocus();
+        return false;
     }
 
-    bool DbaIndexDialog::implCheckPlausibility(const Indexes::const_iterator& 
_rPos)
+    // no double fields
+    std::set<OUString> aExistentFields;
+    for (auto const& fieldCheck : _rPos->aFields)
     {
-        // need at least one field
-        if (_rPos->aFields.empty())
+        if (aExistentFields.end() != 
aExistentFields.find(fieldCheck.sFieldName))
         {
-            std::unique_ptr<weld::MessageDialog> 
xError(Application::CreateMessageDialog(m_xDialog.get(),
-                                                        
VclMessageType::Warning, VclButtonsType::Ok,
-                                                        
DBA_RES(STR_NEED_INDEX_FIELDS)));
+            // a column is specified twice ... won't work anyway, so prevent 
this here and now
+            OUString sMessage(DBA_RES(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME));
+            sMessage = sMessage.replaceFirst("$name$", fieldCheck.sFieldName);
+            std::unique_ptr<weld::MessageDialog> 
xError(Application::CreateMessageDialog(
+                m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, 
sMessage));
             xError->run();
             m_xFields->GrabFocus();
             return false;
         }
-
-        // no double fields
-        std::set< OUString > aExistentFields;
-        for (auto const& fieldCheck : _rPos->aFields)
-        {
-            if (aExistentFields.end() != 
aExistentFields.find(fieldCheck.sFieldName))
-            {
-                // a column is specified twice ... won't work anyway, so 
prevent this here and now
-                OUString sMessage(DBA_RES(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME));
-                sMessage = sMessage.replaceFirst("$name$", 
fieldCheck.sFieldName);
-                std::unique_ptr<weld::MessageDialog> 
xError(Application::CreateMessageDialog(m_xDialog.get(),
-                                                            
VclMessageType::Warning, VclButtonsType::Ok,
-                                                            sMessage));
-                xError->run();
-                m_xFields->GrabFocus();
-                return false;
-            }
-            aExistentFields.insert(fieldCheck.sFieldName);
-        }
-
-        return true;
+        aExistentFields.insert(fieldCheck.sFieldName);
     }
 
-    bool DbaIndexDialog::implCommitPreviouslySelected()
-    {
-        if (m_xPreviousSelection)
-        {
-            Indexes::const_iterator aPreviouslySelected = m_xIndexes->begin() 
+ m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
+    return true;
+}
 
-            if (!implSaveModified())
-                return false;
+bool DbaIndexDialog::implCommitPreviouslySelected()
+{
+    if (m_xPreviousSelection)
+    {
+        Indexes::const_iterator aPreviouslySelected
+            = m_xIndexes->begin() + 
m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
 
-            // commit the index (if necessary)
-            if (aPreviouslySelected->isModified() && 
!implCommit(m_xPreviousSelection.get()))
-                return false;
-        }
+        if (!implSaveModified())
+            return false;
 
-        return true;
+        // commit the index (if necessary)
+        if (aPreviouslySelected->isModified() && 
!implCommit(m_xPreviousSelection.get()))
+            return false;
     }
 
-    IMPL_LINK_NOARG(DbaIndexDialog, OnModifiedClick, weld::Toggleable&, void)
-    {
-        OnModified(*m_xFields);
-    }
+    return true;
+}
 
-    IMPL_LINK_NOARG( DbaIndexDialog, OnModified, IndexFieldsControl&, void )
-    {
-        assert(m_xPreviousSelection && "DbaIndexDialog, OnModified: invalid 
call!");
-        Indexes::iterator aPosition = m_xIndexes->begin() + 
m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
+IMPL_LINK_NOARG(DbaIndexDialog, OnModifiedClick, weld::Toggleable&, void)
+{
+    OnModified(*m_xFields);
+}
 
-        aPosition->setModified(true);
-        updateToolbox();
-    }
+IMPL_LINK_NOARG(DbaIndexDialog, OnModified, IndexFieldsControl&, void)
+{
+    assert(m_xPreviousSelection && "DbaIndexDialog, OnModified: invalid 
call!");
+    Indexes::iterator aPosition
+        = m_xIndexes->begin() + 
m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
 
-    void DbaIndexDialog::updateControls(const weld::TreeIter* pEntry)
+    aPosition->setModified(true);
+    updateToolbox();
+}
+
+void DbaIndexDialog::updateControls(const weld::TreeIter* pEntry)
+{
+    if (pEntry)
     {
-        if (pEntry)
-        {
-            // the descriptor of the selected index
-            Indexes::const_iterator aSelectedIndex = m_xIndexes->begin() + 
m_xIndexList->get_id(*pEntry).toUInt32();
+        // the descriptor of the selected index
+        Indexes::const_iterator aSelectedIndex
+            = m_xIndexes->begin() + m_xIndexList->get_id(*pEntry).toUInt32();
 
-            // fill the controls
-            m_xUnique->set_active(aSelectedIndex->bUnique);
-            m_xUnique->set_sensitive(!aSelectedIndex->bPrimaryKey);
-            m_xUnique->save_state();
+        // fill the controls
+        m_xUnique->set_active(aSelectedIndex->bUnique);
+        m_xUnique->set_sensitive(!aSelectedIndex->bPrimaryKey);
+        m_xUnique->save_state();
 
-            m_xFields->initializeFrom(std::vector(aSelectedIndex->aFields));
-            m_xFields->Enable(!aSelectedIndex->bPrimaryKey);
-            m_xFields->SaveValue();
+        m_xFields->initializeFrom(std::vector(aSelectedIndex->aFields));
+        m_xFields->Enable(!aSelectedIndex->bPrimaryKey);
+        m_xFields->SaveValue();
 
-            m_xDescription->set_label(aSelectedIndex->sDescription);
-            m_xDescription->set_sensitive(!aSelectedIndex->bPrimaryKey);
+        m_xDescription->set_label(aSelectedIndex->sDescription);
+        m_xDescription->set_sensitive(!aSelectedIndex->bPrimaryKey);
 
-            m_xDescriptionLabel->set_sensitive(!aSelectedIndex->bPrimaryKey);
-        }
-        else
-        {
-            m_xUnique->set_active(false);
-            m_xFields->initializeFrom(IndexFields());
-            m_xDescription->set_label(OUString());
-        }
+        m_xDescriptionLabel->set_sensitive(!aSelectedIndex->bPrimaryKey);
     }
-
-    void DbaIndexDialog::IndexSelected()
+    else
     {
-        if (m_bEditingActive)
-            m_xIndexList->end_editing();
+        m_xUnique->set_active(false);
+        m_xFields->initializeFrom(IndexFields());
+        m_xDescription->set_label(OUString());
+    }
+}
 
-        std::unique_ptr<weld::TreeIter> xSelected = 
m_xIndexList->get_selected();
+void DbaIndexDialog::IndexSelected()
+{
+    if (m_bEditingActive)
+        m_xIndexList->end_editing();
 
-        // commit the old data
-        if (m_xPreviousSelection && (!xSelected || 
!m_xPreviousSelection->equal(*xSelected)))
+    std::unique_ptr<weld::TreeIter> xSelected = m_xIndexList->get_selected();
+
+    // commit the old data
+    if (m_xPreviousSelection && (!xSelected || 
!m_xPreviousSelection->equal(*xSelected)))
+    {
+        // (this call may happen in case somebody ended an in-place edit with 
'return', so we need to check this before committing)
+        if (!implCommitPreviouslySelected())
         {
-            // (this call may happen in case somebody ended an in-place edit 
with 'return', so we need to check this before committing)
-            if (!implCommitPreviouslySelected())
-            {
-                m_bNoHandlerCall = true;
-                m_xIndexList->select(*m_xPreviousSelection);
-                m_bNoHandlerCall = false;
-                return;
-            }
+            m_bNoHandlerCall = true;
+            m_xIndexList->select(*m_xPreviousSelection);
+            m_bNoHandlerCall = false;
+            return;
         }
+    }
 
-        // disable/enable the detail controls
-        m_xIndexDetails->set_sensitive(xSelected != nullptr);
-        m_xUnique->set_sensitive(xSelected != nullptr);
-        m_xDescriptionLabel->set_sensitive(xSelected != nullptr);
-        m_xFieldsLabel->set_sensitive(xSelected != nullptr);
-        m_xFields->Enable(xSelected != nullptr);
+    // disable/enable the detail controls
+    m_xIndexDetails->set_sensitive(xSelected != nullptr);
+    m_xUnique->set_sensitive(xSelected != nullptr);
+    m_xDescriptionLabel->set_sensitive(xSelected != nullptr);
+    m_xFieldsLabel->set_sensitive(xSelected != nullptr);
+    m_xFields->Enable(xSelected != nullptr);
 
-        updateControls(xSelected.get());
-        if (xSelected)
-            m_xIndexList->grab_focus();
+    updateControls(xSelected.get());
+    if (xSelected)
+        m_xIndexList->grab_focus();
 
-        m_xPreviousSelection = std::move(xSelected);
+    m_xPreviousSelection = std::move(xSelected);
 
-        updateToolbox();
-    }
+    updateToolbox();
+}
 
-    IMPL_LINK_NOARG(DbaIndexDialog, OnIndexSelected, weld::TreeView&, void)
-    {
-        if (m_bNoHandlerCall)
-            return;
-        IndexSelected();
-    }
-}   // namespace dbaui
+IMPL_LINK_NOARG(DbaIndexDialog, OnIndexSelected, weld::TreeView&, void)
+{
+    if (m_bNoHandlerCall)
+        return;
+    IndexSelected();
+}
+} // namespace dbaui
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/inc/indexdialog.hxx 
b/dbaccess/source/ui/inc/indexdialog.hxx
index f8fc2ffe8972..da6a9d713f68 100644
--- a/dbaccess/source/ui/inc/indexdialog.hxx
+++ b/dbaccess/source/ui/inc/indexdialog.hxx
@@ -32,76 +32,74 @@
 
 namespace dbaui
 {
-    // DbaIndexDialog
-    class IndexFieldsControl;
-    class OIndexCollection;
-    class DbaIndexDialog final : public weld::GenericDialogController
-    {
-        css::uno::Reference< css::sdbc::XConnection > m_xConnection;
-
-        std::unique_ptr<OIndexCollection> m_xIndexes;
-        std::unique_ptr<weld::TreeIter> m_xPreviousSelection;
-        bool                            m_bEditingActive;
-        bool                            m_bEditAgain;
-        bool                            m_bNoHandlerCall;
-
-        css::uno::Reference< css::uno::XComponentContext >
-                                        m_xContext;
-
-        std::unique_ptr<weld::Toolbar> m_xActions;
-        std::unique_ptr<weld::TreeView> m_xIndexList;
-        std::unique_ptr<weld::Label> m_xIndexDetails;
-        std::unique_ptr<weld::Label> m_xDescriptionLabel;
-        std::unique_ptr<weld::Label> m_xDescription;
-        std::unique_ptr<weld::CheckButton> m_xUnique;
-        std::unique_ptr<weld::Label> m_xFieldsLabel;
-        std::unique_ptr<weld::Button> m_xClose;
-        std::unique_ptr<weld::Container> m_xTable;
-        css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
-        VclPtr<IndexFieldsControl> m_xFields;
-
-    public:
-        DbaIndexDialog(
-            weld::Window* _pParent,
-            const css::uno::Sequence< OUString >& _rFieldNames,
-            const css::uno::Reference< css::container::XNameAccess >& 
_rxIndexes,
-            const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
-            const css::uno::Reference< css::uno::XComponentContext >& 
_rxContext);
-        virtual ~DbaIndexDialog() override;
-
-        typedef std::pair<const weld::TreeIter&, OUString> IterString;
-    private:
-        void fillIndexList();
-        void updateToolbox();
-        void updateControls(const weld::TreeIter* pEntry);
-
-        void IndexSelected();
-
-        DECL_LINK( OnIndexSelected, weld::TreeView&, void );
-        DECL_LINK( OnIndexAction, const OUString&, void );
-        DECL_LINK( OnEntryEditing, const weld::TreeIter&, bool );
-        DECL_LINK( OnEntryEdited, const IterString&, bool );
-        DECL_LINK( OnModifiedClick, weld::Toggleable&, void );
-        DECL_LINK( OnModified, IndexFieldsControl&, void );
-        DECL_LINK( OnCloseDialog, weld::Button&, void );
-
-        DECL_LINK( OnEditIndexAgain, void*, void );
-
-        void OnNewIndex();
-        void OnDropIndex(bool _bConfirm = true);
-        void OnRenameIndex();
-        void OnSaveIndex();
-        void OnResetIndex();
-
-        bool implCommit(const weld::TreeIter* pEntry);
-        bool implSaveModified(bool _bPlausibility = true);
-        bool implCommitPreviouslySelected();
-
-        bool implDropIndex(const weld::TreeIter* pEntry, bool 
_bRemoveFromCollection);
-
-        bool implCheckPlausibility(const Indexes::const_iterator& _rPos);
-    };
-
-}   // namespace dbaui
+// DbaIndexDialog
+class IndexFieldsControl;
+class OIndexCollection;
+class DbaIndexDialog final : public weld::GenericDialogController
+{
+    css::uno::Reference<css::sdbc::XConnection> m_xConnection;
+
+    std::unique_ptr<OIndexCollection> m_xIndexes;
+    std::unique_ptr<weld::TreeIter> m_xPreviousSelection;
+    bool m_bEditingActive;
+    bool m_bEditAgain;
+    bool m_bNoHandlerCall;
+
+    css::uno::Reference<css::uno::XComponentContext> m_xContext;
+
+    std::unique_ptr<weld::Toolbar> m_xActions;
+    std::unique_ptr<weld::TreeView> m_xIndexList;
+    std::unique_ptr<weld::Label> m_xIndexDetails;
+    std::unique_ptr<weld::Label> m_xDescriptionLabel;
+    std::unique_ptr<weld::Label> m_xDescription;
+    std::unique_ptr<weld::CheckButton> m_xUnique;
+    std::unique_ptr<weld::Label> m_xFieldsLabel;
+    std::unique_ptr<weld::Button> m_xClose;
+    std::unique_ptr<weld::Container> m_xTable;
+    css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
+    VclPtr<IndexFieldsControl> m_xFields;
+
+public:
+    DbaIndexDialog(weld::Window* _pParent, const css::uno::Sequence<OUString>& 
_rFieldNames,
+                   const css::uno::Reference<css::container::XNameAccess>& 
_rxIndexes,
+                   const css::uno::Reference<css::sdbc::XConnection>& 
_rxConnection,
+                   const css::uno::Reference<css::uno::XComponentContext>& 
_rxContext);
+    virtual ~DbaIndexDialog() override;
+
+    typedef std::pair<const weld::TreeIter&, OUString> IterString;
+
+private:
+    void fillIndexList();
+    void updateToolbox();
+    void updateControls(const weld::TreeIter* pEntry);
+
+    void IndexSelected();
+
+    DECL_LINK(OnIndexSelected, weld::TreeView&, void);
+    DECL_LINK(OnIndexAction, const OUString&, void);
+    DECL_LINK(OnEntryEditing, const weld::TreeIter&, bool);
+    DECL_LINK(OnEntryEdited, const IterString&, bool);
+    DECL_LINK(OnModifiedClick, weld::Toggleable&, void);
+    DECL_LINK(OnModified, IndexFieldsControl&, void);
+    DECL_LINK(OnCloseDialog, weld::Button&, void);
+
+    DECL_LINK(OnEditIndexAgain, void*, void);
+
+    void OnNewIndex();
+    void OnDropIndex(bool _bConfirm = true);
+    void OnRenameIndex();
+    void OnSaveIndex();
+    void OnResetIndex();
+
+    bool implCommit(const weld::TreeIter* pEntry);
+    bool implSaveModified(bool _bPlausibility = true);
+    bool implCommitPreviouslySelected();
+
+    bool implDropIndex(const weld::TreeIter* pEntry, bool 
_bRemoveFromCollection);
+
+    bool implCheckPlausibility(const Indexes::const_iterator& _rPos);
+};
+
+} // namespace dbaui
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 316c13ea2ab6..e985ad473a92 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -2635,7 +2635,6 @@ dbaccess/source/ui/dlg/finteraction.cxx
 dbaccess/source/ui/dlg/finteraction.hxx
 dbaccess/source/ui/dlg/generalpage.cxx
 dbaccess/source/ui/dlg/generalpage.hxx
-dbaccess/source/ui/dlg/indexdialog.cxx
 dbaccess/source/ui/dlg/indexfieldscontrol.cxx
 dbaccess/source/ui/dlg/odbcconfig.cxx
 dbaccess/source/ui/dlg/odbcconfig.hxx
@@ -2740,7 +2739,6 @@ dbaccess/source/ui/inc/exsrcbrw.hxx
 dbaccess/source/ui/inc/formadapter.hxx
 dbaccess/source/ui/inc/imageprovider.hxx
 dbaccess/source/ui/inc/indexcollection.hxx
-dbaccess/source/ui/inc/indexdialog.hxx
 dbaccess/source/ui/inc/indexes.hxx
 dbaccess/source/ui/inc/indexfieldscontrol.hxx
 dbaccess/source/ui/inc/linkeddocuments.hxx

Reply via email to