filter/source/pdf/impdialog.cxx | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-)
New commits: commit c6a2014aeb60fa14f9ff3bebccd358f2a55ce0be Author: Eloi Montañés <[email protected]> AuthorDate: Thu Oct 3 15:22:36 2024 +0200 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Mon Oct 14 04:05:35 2024 +0200 tdf#163359: Fix duplication of TSA URLs on Signing Dialog When using the Signing tab on the "Export as PDF" dialog, the TSA URLs will be appended to the ComboBox each time a certificate is selected. Thus, if a user selects a certificate and then another (or the same) is selected the ComboBox will end up with duplicated values. This patch moves the code to append the TSA URLs to the function that sets up the signing page, fixing the problem. Change-Id: I93d9cb61e10f18b0c33765d63a5ce47c92e588bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174424 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 12407f0668b042f5cbdffbddf65dc864c809d180) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174680 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index ff74f746527a..fbca61a89cfa 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -1769,6 +1769,24 @@ ImpPDFTabSigningPage::ImpPDFTabSigningPage(weld::Container* pPage, weld::DialogC mxPbSignCertSelect->set_sensitive(true); mxPbSignCertSelect->connect_clicked(LINK(this, ImpPDFTabSigningPage, ClickmaPbSignCertSelect)); mxPbSignCertClear->connect_clicked(LINK(this, ImpPDFTabSigningPage, ClickmaPbSignCertClear)); + + // Populate the TSA ComboBox + try + { + std::optional<css::uno::Sequence<OUString>> aTSAURLs(officecfg::Office::Common::Security::Scripting::TSAURLs::get()); + if (aTSAURLs) + { + const css::uno::Sequence<OUString>& rTSAURLs = *aTSAURLs; + for (auto const& elem : rTSAURLs) + { + mxLBSignTSA->append_text(elem); + } + } + } + catch (const uno::Exception &) + { + TOOLS_INFO_EXCEPTION("filter.pdf", "TSAURLsDialog::TSAURLsDialog()"); + } } ImpPDFTabSigningPage::~ImpPDFTabSigningPage() @@ -1798,23 +1816,6 @@ IMPL_LINK_NOARG(ImpPDFTabSigningPage, ClickmaPbSignCertSelect, weld::Button&, vo mxEdSignReason->set_sensitive(true); mxEdSignReason->set_text(aDescription); - try - { - std::optional<css::uno::Sequence<OUString>> aTSAURLs(officecfg::Office::Common::Security::Scripting::TSAURLs::get()); - if (aTSAURLs) - { - const css::uno::Sequence<OUString>& rTSAURLs = *aTSAURLs; - for (auto const& elem : rTSAURLs) - { - mxLBSignTSA->append_text(elem); - } - } - } - catch (const uno::Exception &) - { - TOOLS_INFO_EXCEPTION("filter.pdf", "TSAURLsDialog::TSAURLsDialog()"); - } - // If more than only the "None" entry is there, enable the ListBox if (mxLBSignTSA->get_count() > 1) mxLBSignTSA->set_sensitive(true);
