sc/source/ui/dbgui/scuiimoptdlg.cxx                |    8 ++++++++
 sc/source/ui/inc/scuiimoptdlg.hxx                  |    1 +
 vcl/jsdialog/enabled.cxx                           |    2 ++
 writerperfect/inc/WPFTEncodingDialog.hxx           |    2 ++
 writerperfect/source/common/WPFTEncodingDialog.cxx |   10 ++++++++++
 5 files changed, 23 insertions(+)

New commits:
commit 0a8e62a0b28d616a3645861e4126ee97ffbc31da
Author:     Skyler Grey <skyler.g...@collabora.com>
AuthorDate: Thu Sep 26 13:50:28 2024 +0000
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Oct 21 10:34:29 2024 +0200

    fix(lok): Expose the import options dialog
    
    In a very similar way to the character encoding dialog, handled in
    Ibd36e695e733e07053bb6e22a510ac988be3ded2, we need to see this dialog
    before the document opens.
    
    I've used the same trick, where I've made the dialog into a JSDialog and
    registered an early listener, but I haven't asynced it as it's never
    useful to have more than 1 person using it at once.
    
    Change-Id: I1a61660523ae2d4812890b62d16f0e6cef133e67
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174269
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit 335bb5b39c03b7ef7d7426259b41d479ff9ea7f0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174951
    Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx 
b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 535bb52c0576..8cfa1e8b9e00 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -30,6 +30,7 @@
 #include <svx/txencbox.hxx>
 #include <o3tl/string_view.hxx>
 #include <utility>
+#include <vcl/svapp.hxx>
 
 // ScDelimiterTable
 
@@ -258,6 +259,13 @@ ScImportOptionsDlg::ScImportOptionsDlg(weld::Window* 
pParent, bool bAscii,
     // optional title:
     if (pStrTitle)
         m_xDialog->set_title(*pStrTitle);
+
+    m_xDialog->SetInstallLOKNotifierHdl(LINK(this, ScImportOptionsDlg, 
InstallLOKNotifierHdl));
+}
+
+IMPL_STATIC_LINK_NOARG(ScImportOptionsDlg, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+    return GetpApp();
 }
 
 ScImportOptionsDlg::~ScImportOptionsDlg()
diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx 
b/sc/source/ui/inc/scuiimoptdlg.hxx
index 7728c3e8067f..c1c8c6e47e88 100644
--- a/sc/source/ui/inc/scuiimoptdlg.hxx
+++ b/sc/source/ui/inc/scuiimoptdlg.hxx
@@ -69,6 +69,7 @@ private:
 
     DECL_LINK(FixedWidthHdl, weld::Toggleable&, void);
     DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
+    DECL_STATIC_LINK(ScImportOptionsDlg, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 93ee95617120..231c6fe2d3cf 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -122,6 +122,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
         || rUIFile == u"modules/scalc/ui/groupdialog.ui"
         || rUIFile == u"modules/scalc/ui/headerfootercontent.ui"
         || rUIFile == u"modules/scalc/ui/headerfooterdialog.ui"
+        || rUIFile == u"modules/scalc/ui/imoptdialog.ui"
         || rUIFile == u"modules/scalc/ui/insertcells.ui"
         || rUIFile == u"modules/scalc/ui/managenamesdialog.ui"
         || rUIFile == u"modules/scalc/ui/movingaveragedialog.ui"
commit 60fef0bfeb6df6512da07db899315f3480be3796
Author:     Skyler Grey <skyler.g...@collabora.com>
AuthorDate: Thu Sep 26 13:50:28 2024 +0000
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Oct 21 10:34:18 2024 +0200

    fix(lok): Expose the character encoding dialog
    
    The character encoding dialog appears when importing a dialog with an
    ambiguous character encoding. At the point when it appears, the document
    isn't loaded, so we have to handle it in a similar way to the text
    import dialog or password prompt dialog, allowing it to function early.
    
    It's also required to make the dialog into a jsdialog, as tunneled
    dialogs do not work this early in the document loading process.
    
    I have not asynced the dialog here because there's no point. I did write
    code where I set up a dialog factory to do this similar to how other
    modules (sw, sc, sd, etc.) handle dialogs and make them async.
    Unfortunately, this dialog is not useful with multiple users, since as
    it's used on opening a document. It may, in the future, be useful to
    someone to make a patch that asyncs the other writerperfect dialog (epub
    export) so I have uploaded and abandoned my dialog factory patch as
    Id8ec474510f3c8637639ad59331156c6e75dafb4.
    
    Documents that require this dialog, whether async or not, cause crashes
    when someone opens the document before the first person has finished
    responding to this dialog. I still consider this behavior better than
    crashing whenever we attempt to show this dialog at all.
    
    Change-Id: Ibd36e695e733e07053bb6e22a510ac988be3ded2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174044
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit 283f771b92a14c06871c931b01174622b855abe5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174950
    Tested-by: Jenkins

diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index e29fe6137886..93ee95617120 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -279,6 +279,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
         || rUIFile == u"filter/ui/warnpdfdialog.ui"
         // writerperfect
         || rUIFile == u"writerperfect/ui/exportepub.ui"
+        || rUIFile == u"writerperfect/ui/wpftencodingdialog.ui"
         // xmlsec
         || rUIFile == u"xmlsec/ui/certgeneral.ui"
         || rUIFile == u"xmlsec/ui/certpage.ui"
diff --git a/writerperfect/inc/WPFTEncodingDialog.hxx 
b/writerperfect/inc/WPFTEncodingDialog.hxx
index f84b1b273635..62fb817842ba 100644
--- a/writerperfect/inc/WPFTEncodingDialog.hxx
+++ b/writerperfect/inc/WPFTEncodingDialog.hxx
@@ -37,6 +37,8 @@ private:
 
 private:
     DECL_DLLPRIVATE_LINK(CancelHdl, weld::Button&, void);
+    DECL_STATIC_LINK(WPFTEncodingDialog, InstallLOKNotifierHdl, void*,
+                     vcl::ILibreOfficeKitNotifier*);
 
     WPFTEncodingDialog(WPFTEncodingDialog const&) = delete;
     WPFTEncodingDialog& operator=(WPFTEncodingDialog const&) = delete;
diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx 
b/writerperfect/source/common/WPFTEncodingDialog.cxx
index 8a8fd6255ea6..dc440929dcea 100644
--- a/writerperfect/source/common/WPFTEncodingDialog.cxx
+++ b/writerperfect/source/common/WPFTEncodingDialog.cxx
@@ -25,6 +25,8 @@
 
 #include <WPFTEncodingDialog.hxx>
 
+#include <vcl/svapp.hxx>
+
 namespace writerperfect
 {
 namespace
@@ -105,6 +107,14 @@ WPFTEncodingDialog::WPFTEncodingDialog(weld::Window* 
pParent, const OUString& ti
     selectEncoding(*m_xLbCharset, encoding);
 
     m_xDialog->set_title(title);
+
+    m_xDialog->SetInstallLOKNotifierHdl(LINK(this, WPFTEncodingDialog, 
InstallLOKNotifierHdl));
+}
+
+IMPL_STATIC_LINK_NOARG(WPFTEncodingDialog, InstallLOKNotifierHdl, void*,
+                       vcl::ILibreOfficeKitNotifier*)
+{
+    return GetpApp();
 }
 
 WPFTEncodingDialog::~WPFTEncodingDialog() {}

Reply via email to