tdf#141538 Make Remove button work in Select Address List dialog

... of the Mail Merge Wizard with non-GTK3 backends

This works around the different return value of
TreeView::get_selected_text()

Change-Id: Id7542f8e73731ffe5d133703f0bd0d0ebf26b89f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113747
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index f30a39a..f57e5a2 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -52,6 +52,7 @@
#include <svl/urihelper.hxx>
#include <strings.hrc>
#include <view.hxx>
#include <comphelper/string.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -304,8 +305,11 @@ IMPL_LINK_NOARG(SwAddressListDialog, RemoveHdl_Impl, weld::Button&, void)
    if (xQuery->run() != RET_YES)
        return;

    // tdf#141538: Split content of TreeView row to make removal work on non-GTK vclplugs
    std::vector<OUString> aSplitColumns = comphelper::string::split(m_xListLB->get_selected_text(), '\t');

    // Remove data source connection
    SwDBManager::RevokeDataSource(m_xListLB->get_selected_text());
    SwDBManager::RevokeDataSource(aSplitColumns.front());
    // Remove item from the list
    m_xListLB->remove(nEntry);
    // If this was the last item, disable the Remove & Edit buttons and enable Create