include/svtools/addresstemplate.hxx        |    1 
 svtools/source/dialogs/addresstemplate.cxx |   86 +++++++++++++----------------
 vcl/qt5/QtInstanceBuilder.cxx              |    1 
 3 files changed, 41 insertions(+), 47 deletions(-)

New commits:
commit 7fac8458e35620b9855cc6c68a9675159a849b65
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Apr 11 22:21:59 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Apr 12 01:28:10 2025 +0200

    tdf#130857 qt weld: Support "Address Book Assignment" dlg
    
    This means that native Qt widgets are used for that dialog
    now when using the qt5 or qt6 VCL plugin and starting LO with
    environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
    
    The dialog can be triggered from Writer using
    "Tools" -> "Address Book Source".
    
    Change-Id: I6d6bbbe12afc8bc31fa8416b5688c010e4a9fd8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184080
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index 0adbc7682a5f..027d1c6c6606 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -126,6 +126,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
         u"sfx/ui/printeroptionsdialog.ui"_ustr,
         u"sfx/ui/querysavedialog.ui"_ustr,
         u"sfx/ui/safemodequerydialog.ui"_ustr,
+        u"svt/ui/addresstemplatedialog.ui"_ustr,
         u"svt/ui/printersetupdialog.ui"_ustr,
         u"svt/ui/restartdialog.ui"_ustr,
         u"svx/ui/compressgraphicdialog.ui"_ustr,
commit b03bf3bbb1457671110f1cd9c503eacdb6441da5
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Apr 11 22:14:54 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Apr 12 01:28:03 2025 +0200

    tdf#130857 address book source dialog: No more do delayed initialization
    
    Posting a user event and initialize things when that
    event gets processed doesn't work with the qt6 VCL
    plugin when using native widgets (for which support
    will be added in an upcoming commit). There, the
    user event only gets processed after the dialog gets
    closed, and then results in a crash when support for
    the dialog is declared in
    QtInstanceBuilder::IsUIFileSupported.
    
    This seems similar to the scenario in
    
        commit 29d6065d9a687f1d86f26f53587e108f8c951a4a
        Author: Michael Weghorn <[email protected]>
        Date:   Mon Sep 16 15:21:01 2024 +0200
    
            sfx2: Synchronously set control state in file picker on all 
platforms
    
    As was done there, do the work right away instead.
    Should that result in any unresponsiveness for certain
    scenarios, those will have to be examined more closely.
    
    (At least with the Bibliography database used for the data
    source, all seems fine.)
    
    Change-Id: Ic2d35df49b683c27c2b505018374f421699f6711
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184079
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/svtools/addresstemplate.hxx 
b/include/svtools/addresstemplate.hxx
index 04ce8d9be68d..d7f1b6517b2f 100644
--- a/include/svtools/addresstemplate.hxx
+++ b/include/svtools/addresstemplate.hxx
@@ -99,7 +99,6 @@ namespace svt
         DECL_DLLPRIVATE_LINK(OnComboLoseFocus, weld::Widget&, void);
         DECL_DLLPRIVATE_LINK(OnComboSelect, weld::ComboBox&, void);
         DECL_DLLPRIVATE_LINK(OnOkClicked, weld::Button&, void);
-        DECL_DLLPRIVATE_LINK(OnDelayedInitialize, void*, void);
 
         // string to display for "no selection"
         const OUString         m_sNoFieldSelection;
diff --git a/svtools/source/dialogs/addresstemplate.cxx 
b/svtools/source/dialogs/addresstemplate.cxx
index 150e79ac85c9..8877108e899d 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -606,10 +606,14 @@ void AssignmentPersistentData::ImplCommit()
         for (sal_Int32 i = 0; i<nAdjustedTokenCount; ++i)
             
m_pImpl->aLogicalFieldNames.push_back(sLogicalFieldNames.getToken(0, ';', 
nIdx));
 
-        Application::PostUserEvent(LINK(this, AddressBookSourceDialog, 
OnDelayedInitialize), nullptr, false);
+        // load the initial data from the configuration
+        loadConfiguration();
+        resetTables();
+            // will reset the tables/fields implicitly
 
-        // so the dialog will at least show up before we do the loading of the
-        // configuration data and the (maybe time consuming) analysis of the 
data source/table to select
+        if ( !m_pImpl->bWorkingPersistent )
+            if ( m_pImpl->pFields[0] )
+                m_pImpl->pFields[0]->grab_focus();
 
         if (m_pImpl->bWorkingPersistent)
             return;
@@ -998,18 +1002,6 @@ void AssignmentPersistentData::ImplCommit()
             pBox->set_active(0);
     }
 
-    IMPL_LINK_NOARG(AddressBookSourceDialog, OnDelayedInitialize, void*, void)
-    {
-        // load the initial data from the configuration
-        loadConfiguration();
-        resetTables();
-            // will reset the tables/fields implicitly
-
-        if ( !m_pImpl->bWorkingPersistent )
-            if ( m_pImpl->pFields[0] )
-                m_pImpl->pFields[0]->grab_focus();
-    }
-
     IMPL_LINK(AddressBookSourceDialog, OnComboSelect, weld::ComboBox&, rBox, 
void)
     {
         if (&rBox == m_xDatasource.get())
commit bb7cbdb74fa8b27f525a8a8b4ef54aaa0832cc56
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Apr 11 21:28:40 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Apr 12 01:27:56 2025 +0200

    svtools: Use initializer list to fill vector
    
    The dialog is the "Tools" -> "Address Book Source"
    one in Writer.
    
    Change-Id: I2838377ac98a22307ffa3e25629c481373c4dd0c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184078
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/svtools/source/dialogs/addresstemplate.cxx 
b/svtools/source/dialogs/addresstemplate.cxx
index 0a211b641e19..150e79ac85c9 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -511,37 +511,39 @@ void AssignmentPersistentData::ImplCommit()
         // should be adjustable with a rather small effort.)
 
         // initialize the strings for the field labels
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_FIRSTNAME ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_LASTNAME ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_COMPANY));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_DEPARTMENT ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_STREET ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_ZIPCODE ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_CITY ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_STATE));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_COUNTRY ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_HOMETEL ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_WORKTEL ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_OFFICETEL));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_MOBILE));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_TELOTHER));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_PAGER));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_FAX ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_EMAIL ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_URL ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_TITLE ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_POSITION ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_INITIALS ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_ADDRFORM ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_SALUTATION ));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_ID));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_CALENDAR));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_INVITE));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_NOTE));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_USER1));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_USER2));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_USER3));
-        m_pImpl->aFieldLabels.push_back( SvtResId( STR_FIELD_USER4));
+        m_pImpl->aFieldLabels = {
+            SvtResId(STR_FIELD_FIRSTNAME),
+            SvtResId(STR_FIELD_LASTNAME),
+            SvtResId(STR_FIELD_COMPANY),
+            SvtResId(STR_FIELD_DEPARTMENT),
+            SvtResId(STR_FIELD_STREET),
+            SvtResId(STR_FIELD_ZIPCODE),
+            SvtResId(STR_FIELD_CITY),
+            SvtResId(STR_FIELD_STATE),
+            SvtResId(STR_FIELD_COUNTRY),
+            SvtResId(STR_FIELD_HOMETEL),
+            SvtResId(STR_FIELD_WORKTEL),
+            SvtResId(STR_FIELD_OFFICETEL),
+            SvtResId(STR_FIELD_MOBILE),
+            SvtResId(STR_FIELD_TELOTHER),
+            SvtResId(STR_FIELD_PAGER),
+            SvtResId(STR_FIELD_FAX),
+            SvtResId(STR_FIELD_EMAIL),
+            SvtResId(STR_FIELD_URL),
+            SvtResId(STR_FIELD_TITLE ),
+            SvtResId(STR_FIELD_POSITION),
+            SvtResId(STR_FIELD_INITIALS),
+            SvtResId(STR_FIELD_ADDRFORM),
+            SvtResId(STR_FIELD_SALUTATION),
+            SvtResId(STR_FIELD_ID),
+            SvtResId(STR_FIELD_CALENDAR),
+            SvtResId(STR_FIELD_INVITE),
+            SvtResId(STR_FIELD_NOTE),
+            SvtResId(STR_FIELD_USER1),
+            SvtResId(STR_FIELD_USER2),
+            SvtResId(STR_FIELD_USER3),
+            SvtResId(STR_FIELD_USER4)
+        };
 
         tools::Long nLabelWidth = 0;
         tools::Long nListBoxWidth = 
m_pImpl->pFields[0]->get_approximate_digit_width() * 18;

Reply via email to