core.git: Branch 'distro/collabora/co-24.04' - filter/source filter/uiconfig offapi/com offapi/UnoApi_offapi.mk sc/inc sc/qa sc/source sd/qa sw/qa
filter/source/pdf/impdialog.cxx | 62 +++--- filter/source/pdf/impdialog.hxx | 12 - filter/source/pdf/pdfexport.cxx |9 filter/uiconfig/ui/pdfgeneralpage.ui | 62 ++ offapi/UnoApi_offapi.mk |1 offapi/com/sun/star/sheet/XSheetRange.idl | 42 sc/inc/viewuno.hxx|5 ++ sc/qa/uitest/calc_tests4/exportToPDF.py |2 sc/source/ui/unoobj/docuno.cxx| 13 +- sc/source/ui/unoobj/viewuno.cxx | 32 +++ sc/source/ui/view/printfun.cxx|2 sd/qa/uitest/impress_tests/exportToPDF.py |2 sw/qa/uitest/writer_tests4/exportToPDF.py |2 13 files changed, 217 insertions(+), 29 deletions(-) New commits: commit a46035b12f0af264e3a4fc0e4e219eda538142a7 Author: NickWingate AuthorDate: Tue Aug 29 15:31:08 2023 +0100 Commit: Andras Timar CommitDate: Mon Jan 15 19:47:39 2024 +0100 Add export sheet range option to calc User can specify which sheets to export e.g. '2-5,7' exports sheets 2,3,4,5,7. Note: this is different from exporting pages as one sheet may contain several pages worth of content. Also fix a bug where exporting only a selected sheet causes the next sheet to be exported. e.g.: Sheet 1 is empty, Sheet 2 has content. Exporting Sheet 1 results in Sheet 2's content being exported Signed-off-by: NickWingate Change-Id: Iecd42188ddbbbcd70eb37bec80783e29e3cb5b19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156255 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159686 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index c7149b0ca534..c4e133297e95 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -108,8 +108,10 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property mbCanCopyOrExtract( false ), mbCanExtractForAccessibility( true ), -mbIsRangeChecked( false ), +mbIsPageRangeChecked( false ), msPageRange( ' ' ), +mbIsSheetRangeChecked( false ), +msSheetRange( ' ' ), mbSelectionIsChecked( false ), mbExportRelativeFsysLinks( false ), @@ -506,8 +508,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() comphelper::makePropertyValue("RestrictPermissions", mbRestrictPermissions), comphelper::makePropertyValue("PreparedPermissionPassword", maPreparedOwnerPassword) }; -if( mbIsRangeChecked ) +if( mbIsPageRangeChecked ) aRet.push_back(comphelper::makePropertyValue("PageRange", msPageRange)); +if( mbIsSheetRangeChecked ) +aRet.push_back(comphelper::makePropertyValue("SheetRange", msSheetRange)); else if( mbSelectionIsChecked ) aRet.push_back(comphelper::makePropertyValue("Selection", maSelection)); @@ -531,9 +535,11 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mbIsWriter(false) , mpParent(nullptr) , mxRbAll(m_xBuilder->weld_radio_button("all")) -, mxRbRange(m_xBuilder->weld_radio_button("range")) +, mxRbPageRange(m_xBuilder->weld_radio_button("pagerange")) +, mxRbSheetRange(m_xBuilder->weld_radio_button("sheetrange")) , mxRbSelection(m_xBuilder->weld_radio_button("selection")) , mxEdPages(m_xBuilder->weld_entry("pages")) +, mxEdSheets(m_xBuilder->weld_entry("sheets")) , mxRbLosslessCompression(m_xBuilder->weld_radio_button("losslesscompress")) , mxRbJPEGCompression(m_xBuilder->weld_radio_button("jpegcompress")) , mxQualityFrame(m_xBuilder->weld_widget("qualityframe")) @@ -564,7 +570,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mxFtWatermark(m_xBuilder->weld_label("watermarklabel")) , mxEdWatermark(m_xBuilder->weld_entry("watermarkentry")) , mxSlidesFt(m_xBuilder->weld_label("slides")) -, mxSheetsFt(m_xBuilder->weld_label("selectedsheets")) +, mxSheetsSelectionFt(m_xBuilder->weld_label("selectedsheets")) { } @@ -579,11 +585,13 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mpParent = pParent; // init this class data -mxRbRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); +mxRbPageRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); +mxRbSheetRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleSheetsHdl ) ); mxRbAll->set_active(true); mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) ); TogglePagesHdl(); +ToggleSheetsHdl(); mxRbSelection->set_sensitive( pParent->mbSelectionPresent ); if (
core.git: filter/source filter/uiconfig offapi/com offapi/UnoApi_offapi.mk sc/inc sc/qa sc/source sd/qa sw/qa
filter/source/pdf/impdialog.cxx | 62 +++--- filter/source/pdf/impdialog.hxx | 12 - filter/source/pdf/pdfexport.cxx |9 filter/uiconfig/ui/pdfgeneralpage.ui | 62 ++ offapi/UnoApi_offapi.mk |1 offapi/com/sun/star/sheet/XSheetRange.idl | 42 sc/inc/viewuno.hxx|5 ++ sc/qa/uitest/calc_tests4/exportToPDF.py |2 sc/source/ui/unoobj/docuno.cxx| 13 +- sc/source/ui/unoobj/viewuno.cxx | 32 +++ sc/source/ui/view/printfun.cxx|2 sd/qa/uitest/impress_tests/exportToPDF.py |2 sw/qa/uitest/writer_tests4/exportToPDF.py |2 13 files changed, 217 insertions(+), 29 deletions(-) New commits: commit 13bd849f60286c49457c290218e5b7acf9cadba8 Author: NickWingate AuthorDate: Tue Aug 29 15:31:08 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Dec 21 10:49:16 2023 +0100 Add export sheet range option to calc User can specify which sheets to export e.g. '2-5,7' exports sheets 2,3,4,5,7. Note: this is different from exporting pages as one sheet may contain several pages worth of content. Also fix a bug where exporting only a selected sheet causes the next sheet to be exported. e.g.: Sheet 1 is empty, Sheet 2 has content. Exporting Sheet 1 results in Sheet 2's content being exported Signed-off-by: NickWingate Change-Id: Iecd42188ddbbbcd70eb37bec80783e29e3cb5b19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156255 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159686 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index c7149b0ca534..c4e133297e95 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -108,8 +108,10 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property mbCanCopyOrExtract( false ), mbCanExtractForAccessibility( true ), -mbIsRangeChecked( false ), +mbIsPageRangeChecked( false ), msPageRange( ' ' ), +mbIsSheetRangeChecked( false ), +msSheetRange( ' ' ), mbSelectionIsChecked( false ), mbExportRelativeFsysLinks( false ), @@ -506,8 +508,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() comphelper::makePropertyValue("RestrictPermissions", mbRestrictPermissions), comphelper::makePropertyValue("PreparedPermissionPassword", maPreparedOwnerPassword) }; -if( mbIsRangeChecked ) +if( mbIsPageRangeChecked ) aRet.push_back(comphelper::makePropertyValue("PageRange", msPageRange)); +if( mbIsSheetRangeChecked ) +aRet.push_back(comphelper::makePropertyValue("SheetRange", msSheetRange)); else if( mbSelectionIsChecked ) aRet.push_back(comphelper::makePropertyValue("Selection", maSelection)); @@ -531,9 +535,11 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mbIsWriter(false) , mpParent(nullptr) , mxRbAll(m_xBuilder->weld_radio_button("all")) -, mxRbRange(m_xBuilder->weld_radio_button("range")) +, mxRbPageRange(m_xBuilder->weld_radio_button("pagerange")) +, mxRbSheetRange(m_xBuilder->weld_radio_button("sheetrange")) , mxRbSelection(m_xBuilder->weld_radio_button("selection")) , mxEdPages(m_xBuilder->weld_entry("pages")) +, mxEdSheets(m_xBuilder->weld_entry("sheets")) , mxRbLosslessCompression(m_xBuilder->weld_radio_button("losslesscompress")) , mxRbJPEGCompression(m_xBuilder->weld_radio_button("jpegcompress")) , mxQualityFrame(m_xBuilder->weld_widget("qualityframe")) @@ -564,7 +570,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mxFtWatermark(m_xBuilder->weld_label("watermarklabel")) , mxEdWatermark(m_xBuilder->weld_entry("watermarkentry")) , mxSlidesFt(m_xBuilder->weld_label("slides")) -, mxSheetsFt(m_xBuilder->weld_label("selectedsheets")) +, mxSheetsSelectionFt(m_xBuilder->weld_label("selectedsheets")) { } @@ -579,11 +585,13 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mpParent = pParent; // init this class data -mxRbRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); +mxRbPageRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); +mxRbSheetRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleSheetsHdl ) ); mxRbAll->set_active(true); mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) ); TogglePagesHdl(); +ToggleSheetsHdl(); mxRbSelection->set_sensitive( pParent->mbSelectionPresent ); if (
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - filter/source filter/uiconfig offapi/com offapi/UnoApi_offapi.mk sc/inc sc/qa sc/source sd/qa sw/qa
filter/source/pdf/impdialog.cxx | 62 +++--- filter/source/pdf/impdialog.hxx | 12 - filter/source/pdf/pdfexport.cxx |9 filter/uiconfig/ui/pdfgeneralpage.ui | 62 ++ offapi/UnoApi_offapi.mk |1 offapi/com/sun/star/sheet/XSheetRange.idl | 42 sc/inc/viewuno.hxx|5 ++ sc/qa/uitest/calc_tests4/exportToPDF.py |2 sc/source/ui/unoobj/docuno.cxx| 13 +- sc/source/ui/unoobj/viewuno.cxx | 32 +++ sc/source/ui/view/printfun.cxx|2 sd/qa/uitest/impress_tests/exportToPDF.py |2 sw/qa/uitest/writer_tests4/exportToPDF.py |2 13 files changed, 217 insertions(+), 29 deletions(-) New commits: commit dd9f787875a9a953d1fb84de44e04fd2a0c2f8c1 Author: NickWingate AuthorDate: Tue Aug 29 15:31:08 2023 +0100 Commit: Szymon Kłos CommitDate: Fri Sep 8 15:04:41 2023 +0200 Add export sheet range option to calc User can specify which sheets to export e.g. '2-5,7' exports sheets 2,3,4,5,7. Note: this is different from exporting pages as one sheet may contain several pages worth of content. Also fix a bug where exporting only a selected sheet causes the next sheet to be exported. e.g.: Sheet 1 is empty, Sheet 2 has content. Exporting Sheet 1 results in Sheet 2's content being exported Signed-off-by: NickWingate Change-Id: Iecd42188ddbbbcd70eb37bec80783e29e3cb5b19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156255 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 2723afbf0ab8..d9f3f3576a4e 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -106,8 +106,10 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property mbCanCopyOrExtract( false ), mbCanExtractForAccessibility( true ), -mbIsRangeChecked( false ), +mbIsPageRangeChecked( false ), msPageRange( ' ' ), +mbIsSheetRangeChecked( false ), +msSheetRange( ' ' ), mbSelectionIsChecked( false ), mbExportRelativeFsysLinks( false ), @@ -492,8 +494,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() comphelper::makePropertyValue("RestrictPermissions", mbRestrictPermissions), comphelper::makePropertyValue("PreparedPermissionPassword", maPreparedOwnerPassword) }; -if( mbIsRangeChecked ) +if( mbIsPageRangeChecked ) aRet.push_back(comphelper::makePropertyValue("PageRange", msPageRange)); +if( mbIsSheetRangeChecked ) +aRet.push_back(comphelper::makePropertyValue("SheetRange", msSheetRange)); else if( mbSelectionIsChecked ) aRet.push_back(comphelper::makePropertyValue("Selection", maSelection)); @@ -517,9 +521,11 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mbIsWriter(false) , mpParent(nullptr) , mxRbAll(m_xBuilder->weld_radio_button("all")) -, mxRbRange(m_xBuilder->weld_radio_button("range")) +, mxRbPageRange(m_xBuilder->weld_radio_button("pagerange")) +, mxRbSheetRange(m_xBuilder->weld_radio_button("sheetrange")) , mxRbSelection(m_xBuilder->weld_radio_button("selection")) , mxEdPages(m_xBuilder->weld_entry("pages")) +, mxEdSheets(m_xBuilder->weld_entry("sheets")) , mxRbLosslessCompression(m_xBuilder->weld_radio_button("losslesscompress")) , mxRbJPEGCompression(m_xBuilder->weld_radio_button("jpegcompress")) , mxQualityFrame(m_xBuilder->weld_widget("qualityframe")) @@ -550,7 +556,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC , mxFtWatermark(m_xBuilder->weld_label("watermarklabel")) , mxEdWatermark(m_xBuilder->weld_entry("watermarkentry")) , mxSlidesFt(m_xBuilder->weld_label("slides")) -, mxSheetsFt(m_xBuilder->weld_label("selectedsheets")) +, mxSheetsSelectionFt(m_xBuilder->weld_label("selectedsheets")) { } @@ -565,11 +571,13 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mpParent = pParent; // init this class data -mxRbRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); +mxRbPageRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); +mxRbSheetRange->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleSheetsHdl ) ); mxRbAll->set_active(true); mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) ); TogglePagesHdl(); +ToggleSheetsHdl(); mxRbSelection->set_sensitive( pParent->mbSelectionPresent ); if ( pParent->mbSelectionPresent ) @@ -654,7 +662,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) if (
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - filter/source include/sfx2 sfx2/source vcl/jsdialog
filter/source/pdf/impdialog.cxx | 73 filter/source/pdf/impdialog.hxx |4 ++ include/sfx2/passwd.hxx |6 +++ sfx2/source/dialog/passwd.cxx | 30 vcl/jsdialog/enabled.cxx|1 5 files changed, 78 insertions(+), 36 deletions(-) New commits: commit 7166529189ad2044e71cfe9528185a87d96b4baa Author: NickWingate AuthorDate: Wed Dec 28 17:27:31 2022 + Commit: Andras Timar CommitDate: Thu Jan 19 14:40:26 2023 +0100 Make PDFExport Password Subdialog Async Dialog in File>Export As PDF>Security>Set Password Close subdialog when parent dialog is closed Signed-off-by: NickWingate Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index fd68322f1a23..159271f8a6f8 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -1156,6 +1156,10 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage() { +if (mpPasswordDialog) +mpPasswordDialog->response(RET_CANCEL); +if (mpUnsupportedMsgDialog) +mpUnsupportedMsgDialog->response(RET_CANCEL); } std::unique_ptr ImpPDFTabSecurityPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet) @@ -1246,40 +1250,51 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* pParent IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void) { -SfxPasswordDialog aPwdDialog(m_xContainer.get(), ); -aPwdDialog.SetMinLen(0); -aPwdDialog.ShowMinLengthText(false); -aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); -aPwdDialog.set_title(msStrSetPwd); -aPwdDialog.SetGroup2Text(msOwnerPwdTitle); -aPwdDialog.AllowAsciiOnly(); -if (aPwdDialog.run() == RET_OK) // OK issued get password and set it -{ -OUString aUserPW(aPwdDialog.GetPassword()); -OUString aOwnerPW(aPwdDialog.GetPassword2()); +if(mpPasswordDialog) +mpPasswordDialog->response(RET_CANCEL); -mbHaveUserPassword = !aUserPW.isEmpty(); -mbHaveOwnerPassword = !aOwnerPW.isEmpty(); +mpPasswordDialog = std::make_shared(m_xContainer.get(), ); -mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); -if (!mxPreparedPasswords.is()) { -OUString msg; -ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TODO: handle failure -std::unique_ptr( -Application::CreateMessageDialog( -GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)) -->run(); -return; -} +mpPasswordDialog->SetMinLen(0); +mpPasswordDialog->ShowMinLengthText(false); +mpPasswordDialog->ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); +mpPasswordDialog->set_title(msStrSetPwd); +mpPasswordDialog->SetGroup2Text(msOwnerPwdTitle); +mpPasswordDialog->AllowAsciiOnly(); + +mpPasswordDialog->PreRun(); -if( mbHaveOwnerPassword ) +weld::DialogController::runAsync(mpPasswordDialog, [this](sal_Int32 response){ +if (response == RET_OK) { -maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW ); +OUString aUserPW(mpPasswordDialog->GetPassword()); +OUString aOwnerPW(mpPasswordDialog->GetPassword2()); + +mbHaveUserPassword = !aUserPW.isEmpty(); +mbHaveOwnerPassword = !aOwnerPW.isEmpty(); + +mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); +if (!mxPreparedPasswords.is()) +{ +OUString msg; +ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TODO: handle failure +mpUnsupportedMsgDialog = std::shared_ptr( +Application::CreateMessageDialog( +GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)); + +mpUnsupportedMsgDialog->runAsync(mpUnsupportedMsgDialog, [](sal_Int32){ }); +return; +} + +if( mbHaveOwnerPassword ) +maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW ); +else +maPreparedOwnerPassword = Sequence< NamedValue >(); } -else -maPreparedOwnerPassword = Sequence< NamedValue >(); -} -
[Libreoffice-commits] core.git: filter/source include/sfx2 sfx2/source vcl/jsdialog
filter/source/pdf/impdialog.cxx | 73 filter/source/pdf/impdialog.hxx |4 ++ include/sfx2/passwd.hxx |6 +++ sfx2/source/dialog/passwd.cxx | 30 vcl/jsdialog/enabled.cxx|1 5 files changed, 78 insertions(+), 36 deletions(-) New commits: commit 7ebe5e19fb379c88b8e455693a23fd9036c1b517 Author: NickWingate AuthorDate: Wed Dec 28 17:27:31 2022 + Commit: Andras Timar CommitDate: Thu Jan 19 12:48:06 2023 + Make PDFExport Password Subdialog Async Dialog in File>Export As PDF>Security>Set Password Close subdialog when parent dialog is closed Signed-off-by: NickWingate Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 4a03de89fdef..2516342cde70 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -1171,6 +1171,10 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage() { +if (mpPasswordDialog) +mpPasswordDialog->response(RET_CANCEL); +if (mpUnsupportedMsgDialog) +mpUnsupportedMsgDialog->response(RET_CANCEL); } std::unique_ptr ImpPDFTabSecurityPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet) @@ -1261,40 +1265,51 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* pParent IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void) { -SfxPasswordDialog aPwdDialog(m_xContainer.get(), ); -aPwdDialog.SetMinLen(0); -aPwdDialog.ShowMinLengthText(false); -aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); -aPwdDialog.set_title(msStrSetPwd); -aPwdDialog.SetGroup2Text(msOwnerPwdTitle); -aPwdDialog.AllowAsciiOnly(); -if (aPwdDialog.run() == RET_OK) // OK issued get password and set it -{ -OUString aUserPW(aPwdDialog.GetPassword()); -OUString aOwnerPW(aPwdDialog.GetPassword2()); +if(mpPasswordDialog) +mpPasswordDialog->response(RET_CANCEL); -mbHaveUserPassword = !aUserPW.isEmpty(); -mbHaveOwnerPassword = !aOwnerPW.isEmpty(); +mpPasswordDialog = std::make_shared(m_xContainer.get(), ); -mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); -if (!mxPreparedPasswords.is()) { -OUString msg; -ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TODO: handle failure -std::unique_ptr( -Application::CreateMessageDialog( -GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)) -->run(); -return; -} +mpPasswordDialog->SetMinLen(0); +mpPasswordDialog->ShowMinLengthText(false); +mpPasswordDialog->ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); +mpPasswordDialog->set_title(msStrSetPwd); +mpPasswordDialog->SetGroup2Text(msOwnerPwdTitle); +mpPasswordDialog->AllowAsciiOnly(); + +mpPasswordDialog->PreRun(); -if( mbHaveOwnerPassword ) +weld::DialogController::runAsync(mpPasswordDialog, [this](sal_Int32 response){ +if (response == RET_OK) { -maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW ); +OUString aUserPW(mpPasswordDialog->GetPassword()); +OUString aOwnerPW(mpPasswordDialog->GetPassword2()); + +mbHaveUserPassword = !aUserPW.isEmpty(); +mbHaveOwnerPassword = !aOwnerPW.isEmpty(); + +mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); +if (!mxPreparedPasswords.is()) +{ +OUString msg; +ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TODO: handle failure +mpUnsupportedMsgDialog = std::shared_ptr( +Application::CreateMessageDialog( +GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)); + +mpUnsupportedMsgDialog->runAsync(mpUnsupportedMsgDialog, [](sal_Int32){ }); +return; +} + +if( mbHaveOwnerPassword ) +maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW ); +else +maPreparedOwnerPassword = Sequence< NamedValue >(); } -else -maPreparedOwnerPassword = Sequence< NamedValue >(); -} -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - filter/source include/sfx2 sfx2/source vcl/jsdialog
filter/source/pdf/impdialog.cxx | 76 filter/source/pdf/impdialog.hxx |4 ++ include/sfx2/passwd.hxx |6 +++ sfx2/source/dialog/passwd.cxx | 30 --- vcl/jsdialog/enabled.cxx|4 +- 5 files changed, 81 insertions(+), 39 deletions(-) New commits: commit 6213ede2d6f3b9ae8c386d48cbcb99ce74b74c98 Author: NickWingate AuthorDate: Wed Dec 28 17:27:31 2022 + Commit: Andras Timar CommitDate: Wed Jan 18 22:03:24 2023 + Make PDFExport Password Subdialog Async Dialog in File>Export As PDF>Security>Set Password Close subdialog when parent dialog is closed Signed-off-by: NickWingate Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 5552b92e3efe..57f284a6379b 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -1161,6 +1161,10 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage() { +if (mpPasswordDialog) +mpPasswordDialog->response(RET_CANCEL); +if (mpUnsupportedMsgDialog) +mpUnsupportedMsgDialog->response(RET_CANCEL); } std::unique_ptr ImpPDFTabSecurityPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet) @@ -1251,40 +1255,52 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* pParent IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void) { -SfxPasswordDialog aPwdDialog(m_xContainer.get(), ); -aPwdDialog.SetMinLen(0); -aPwdDialog.ShowMinLengthText(false); -aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); -aPwdDialog.set_title(msStrSetPwd); -aPwdDialog.SetGroup2Text(msOwnerPwdTitle); -aPwdDialog.AllowAsciiOnly(); -if (aPwdDialog.run() == RET_OK) // OK issued get password and set it -{ -OUString aUserPW(aPwdDialog.GetPassword()); -OUString aOwnerPW(aPwdDialog.GetPassword2()); +if(mpPasswordDialog) +mpPasswordDialog->response(RET_CANCEL); -mbHaveUserPassword = !aUserPW.isEmpty(); -mbHaveOwnerPassword = !aOwnerPW.isEmpty(); +mpPasswordDialog = std::make_shared(m_xContainer.get(), ); -mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); -if (!mxPreparedPasswords.is()) { -OUString msg; -ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TODO: handle failure -std::unique_ptr( -Application::CreateMessageDialog( -GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)) -->run(); -return; -} +mpPasswordDialog->SetMinLen(0); +mpPasswordDialog->ShowMinLengthText(false); +mpPasswordDialog->ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); +mpPasswordDialog->set_title(msStrSetPwd); +mpPasswordDialog->SetGroup2Text(msOwnerPwdTitle); +mpPasswordDialog->AllowAsciiOnly(); -if( mbHaveOwnerPassword ) +mpPasswordDialog->PreRun(); + +weld::DialogController::runAsync(mpPasswordDialog, [this](sal_Int32 response){ +if (response == RET_OK) { -maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW ); -} -else -maPreparedOwnerPassword = Sequence< NamedValue >(); -} -enablePermissionControls(); +OUString aUserPW(mpPasswordDialog->GetPassword()); +OUString aOwnerPW(mpPasswordDialog->GetPassword2()); + +mbHaveUserPassword = !aUserPW.isEmpty(); +mbHaveOwnerPassword = !aOwnerPW.isEmpty(); + +mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); +if (!mxPreparedPasswords.is()) { +OUString msg; +ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TODO: handle failure +mpUnsupportedMsgDialog = std::shared_ptr( +Application::CreateMessageDialog( +GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)); + +mpUnsupportedMsgDialog->runAsync(mpUnsupportedMsgDialog, [](sal_Int32){ }); +return; +} + +if( mbHaveOwnerPassword ) +{ +maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW ); +} +else +maPreparedOwnerPassword = Sequence< NamedValue >(); +} +if (response != RET_CANCEL) +
[Libreoffice-commits] core.git: filter/source include/LibreOfficeKit include/sfx2 include/svtools libreofficekit/source offapi/com sfx2/inc sfx2/source vcl/jsdialog
filter/source/pdf/impdialog.cxx |7 filter/source/pdf/impdialog.hxx |2 filter/source/pdf/pdfdialog.cxx | 24 ++ filter/source/pdf/pdfdialog.hxx | 13 + include/LibreOfficeKit/LibreOfficeKitEnums.h | 10 + include/sfx2/viewsh.hxx |6 include/svtools/genericasyncunodialog.hxx| 132 ++ libreofficekit/source/gtk/lokdocview.cxx |1 offapi/com/sun/star/document/PDFDialog.idl |1 sfx2/inc/guisaveas.hxx | 32 +++ sfx2/source/doc/guisaveas.cxx| 246 +++ sfx2/source/doc/objserv.cxx | 15 + sfx2/source/view/ipclient.cxx|3 vcl/jsdialog/enabled.cxx |9 14 files changed, 419 insertions(+), 82 deletions(-) New commits: commit 89f5912ad2eee786508414791653a017206a7c04 Author: NickWingate AuthorDate: Thu Sep 22 09:02:42 2022 +0100 Commit: Andras Timar CommitDate: Tue Dec 20 03:11:16 2022 + Async PDFExport dialog and parent methods Filter dialogs are all called generically from guisaveas.cxx in GUIStoreModel() Signed-off-by: NickWingate Change-Id: Idfbe85c09f84d4a7cf3f00b9704d5af94868a051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140403 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144511 Tested-by: Jenkins diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index fd68322f1a23..a02412ac6caa 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -541,6 +541,8 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() { +if (mxPasswordUnusedWarnDialog) +mxPasswordUnusedWarnDialog->response(RET_CANCEL); } void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) @@ -871,10 +873,11 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHa // if a password was set, inform the user that this will not be used if (pSecPage && pSecPage->hasPassword()) { -std::unique_ptr xBox(Application::CreateMessageDialog(m_xContainer.get(), +mxPasswordUnusedWarnDialog = + std::shared_ptr(Application::CreateMessageDialog(m_xContainer.get(), VclMessageType::Warning, VclButtonsType::Ok, FilterResId(STR_WARN_PASSWORD_PDFA))); -xBox->run(); +mxPasswordUnusedWarnDialog->runAsync(mxPasswordUnusedWarnDialog, [] (sal_uInt32){ }); } } else diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 828422bdc63e..d0d63bccc86b 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -232,6 +232,8 @@ class ImpPDFTabGeneralPage : public SfxTabPage DECL_LINK(TogglePDFVersionOrUniversalAccessibilityHandle, weld::Toggleable&, void); +std::shared_ptr mxPasswordUnusedWarnDialog; + public: ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index 7c3e5dda1956..c036fc747b2a 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -62,6 +62,13 @@ std::unique_ptr PDFDialog::createDialog(const css::uno:: return nullptr; } +std::shared_ptr PDFDialog::createAsyncDialog(const css::uno::Reference& rParent) +{ +if( mxSrcDoc.is() ) +return std::make_shared(Application::GetFrameWeld(rParent), maFilterData, mxSrcDoc); +return nullptr; +} + void PDFDialog::executedDialog( sal_Int16 nExecutionResult ) { if (nExecutionResult && m_xDialog) @@ -69,6 +76,23 @@ void PDFDialog::executedDialog( sal_Int16 nExecutionResult ) destroyDialog(); } +void PDFDialog::runAsync(const css::uno::Reference< css::ui::dialogs::XDialogClosedListener >& xListener) +{ +SfxTabDialogController::runAsync(m_xAsyncDialog, [this, xListener](sal_Int32 nResponse) { +executedAsyncDialog( m_xAsyncDialog, nResponse ); +css::ui::dialogs::DialogClosedEvent aEvent; +aEvent.DialogResult = nResponse; +xListener->dialogClosed( aEvent ); +destroyAsyncDialog(); +}); +} + +void PDFDialog::executedAsyncDialog( std::shared_ptr xAsyncDialog, sal_Int32 nExecutionResult ) +{ +if (nExecutionResult && xAsyncDialog) +maFilterData = static_cast(xAsyncDialog.get())->GetFilterData(); +} + Reference< XPropertySetInfo > SAL_CALL PDFDialog::getPropertySetInfo() { Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); diff --git
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - filter/source include/LibreOfficeKit include/sfx2 include/svtools libreofficekit/source offapi/com sfx2/inc sfx2/source vcl/jsdialo
filter/source/pdf/impdialog.cxx |7 filter/source/pdf/impdialog.hxx |2 filter/source/pdf/pdfdialog.cxx | 24 ++ filter/source/pdf/pdfdialog.hxx | 13 + include/LibreOfficeKit/LibreOfficeKitEnums.h | 10 + include/sfx2/viewsh.hxx |6 include/svtools/genericasyncunodialog.hxx| 132 ++ libreofficekit/source/gtk/lokdocview.cxx |1 offapi/com/sun/star/document/PDFDialog.idl |1 sfx2/inc/guisaveas.hxx | 32 +++ sfx2/source/doc/guisaveas.cxx| 246 +++ sfx2/source/doc/objserv.cxx | 15 + sfx2/source/view/ipclient.cxx|3 vcl/jsdialog/enabled.cxx | 11 + 14 files changed, 420 insertions(+), 83 deletions(-) New commits: commit 1cd26a6c1868eb213593efe06a0ba737c934a688 Author: NickWingate AuthorDate: Thu Sep 22 09:02:42 2022 +0100 Commit: Andras Timar CommitDate: Wed Dec 14 12:44:40 2022 + Async PDFExport dialog and parent methods Filter dialogs are all called generically from guisaveas.cxx in GUIStoreModel() Signed-off-by: NickWingate Change-Id: Idfbe85c09f84d4a7cf3f00b9704d5af94868a051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140403 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index bd8db83692a0..e00c6e33209a 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -537,6 +537,8 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() { +if (mxPasswordUnusedWarnDialog) +mxPasswordUnusedWarnDialog->response(RET_CANCEL); } void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) @@ -861,10 +863,11 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHa // if a password was set, inform the user that this will not be used if (pSecPage && pSecPage->hasPassword()) { -std::unique_ptr xBox(Application::CreateMessageDialog(m_xContainer.get(), +mxPasswordUnusedWarnDialog = + std::shared_ptr(Application::CreateMessageDialog(m_xContainer.get(), VclMessageType::Warning, VclButtonsType::Ok, PDFFilterResId(STR_WARN_PASSWORD_PDFA))); -xBox->run(); +mxPasswordUnusedWarnDialog->runAsync(mxPasswordUnusedWarnDialog, [] (sal_uInt32){ }); } } else diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 219d47e6d613..2e7a13df9290 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -232,6 +232,8 @@ class ImpPDFTabGeneralPage : public SfxTabPage DECL_LINK(TogglePDFVersionOrUniversalAccessibilityHandle, weld::Toggleable&, void); +std::shared_ptr mxPasswordUnusedWarnDialog; + public: ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index 7c3e5dda1956..c036fc747b2a 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -62,6 +62,13 @@ std::unique_ptr PDFDialog::createDialog(const css::uno:: return nullptr; } +std::shared_ptr PDFDialog::createAsyncDialog(const css::uno::Reference& rParent) +{ +if( mxSrcDoc.is() ) +return std::make_shared(Application::GetFrameWeld(rParent), maFilterData, mxSrcDoc); +return nullptr; +} + void PDFDialog::executedDialog( sal_Int16 nExecutionResult ) { if (nExecutionResult && m_xDialog) @@ -69,6 +76,23 @@ void PDFDialog::executedDialog( sal_Int16 nExecutionResult ) destroyDialog(); } +void PDFDialog::runAsync(const css::uno::Reference< css::ui::dialogs::XDialogClosedListener >& xListener) +{ +SfxTabDialogController::runAsync(m_xAsyncDialog, [this, xListener](sal_Int32 nResponse) { +executedAsyncDialog( m_xAsyncDialog, nResponse ); +css::ui::dialogs::DialogClosedEvent aEvent; +aEvent.DialogResult = nResponse; +xListener->dialogClosed( aEvent ); +destroyAsyncDialog(); +}); +} + +void PDFDialog::executedAsyncDialog( std::shared_ptr xAsyncDialog, sal_Int32 nExecutionResult ) +{ +if (nExecutionResult && xAsyncDialog) +maFilterData = static_cast(xAsyncDialog.get())->GetFilterData(); +} + Reference< XPropertySetInfo > SAL_CALL PDFDialog::getPropertySetInfo() { Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); diff --git a/filter/source/pdf/pdfdialog.hxx b/filter/source/pdf/pdfdialog.hxx index fcfd1d0976bd..2410192a2617 100644
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/dinfdlg.cxx | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) New commits: commit 346cda683763aa352cf67a035340e48133790f7f Author: NickWingate AuthorDate: Fri Aug 12 09:48:18 2022 +0100 Commit: Szymon Kłos CommitDate: Sun Nov 20 11:25:50 2022 +0100 Fix opening duration custom property shows text Before saving a duration custom property and then closing and opening file props wouldn't show the duration type and value and instead blank text Signed-off-by: NickWingate Change-Id: Ie6536dd75151db40f335985c1ce92236ce77ddc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138180 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142986 Tested-by: Jenkins diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 9cb911c469e0..eec2e4ca980d 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1796,17 +1796,14 @@ void CustomPropertiesWindow::ReloadLinesContent() pLine->m_xDurationField->SetDuration(aTmpDuration); } -if (nType != Custom_Type_Duration) +if (Custom_Type_Boolean == nType) { -if (Custom_Type_Boolean == nType) -{ -if (bTmpValue) -pLine->m_xYesNoButton->CheckYes(); -else -pLine->m_xYesNoButton->CheckNo(); -} -pLine->m_xTypeBox->set_active_id(OUString::number(nType)); +if (bTmpValue) +pLine->m_xYesNoButton->CheckYes(); +else +pLine->m_xYesNoButton->CheckNo(); } +pLine->m_xTypeBox->set_active_id(OUString::number(nType)); pLine->DoTypeHdl(*pLine->m_xTypeBox); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/control/tabctrl.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit d7f00522a2dd84b05371920ebbcf6f81323a666f Author: NickWingate AuthorDate: Fri Aug 12 09:51:34 2022 +0100 Commit: Szymon Kłos CommitDate: Sun Nov 20 10:42:51 2022 +0100 Fix sending empty tab pages to online Previously this assumed page ids were sequential if a page is removed then its id returns an empty page. Fetching window child also worked based on iterations and not comparing actual ids so another possibility for empty pages. Signed-off-by: NickWingate Change-Id: I908f58665a9429ca4b66f346108030926a599d7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138181 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142976 Tested-by: Jenkins diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index b5d4d4cde0e2..b2f86b3cd9a5 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2228,9 +2228,9 @@ void TabControl::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) { auto childrenNode = rJsonWriter.startArray("children"); -for (int i = 0; i < GetChildCount(); i++) +for (auto id : GetPageIDs()) { -vcl::Window* pChild = GetChild(i); +TabPage* pChild = GetTabPage(id); if (pChild) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - include/sfx2 sfx2/source vcl/jsdialog vcl/source
include/sfx2/dinfdlg.hxx | 19 ++ sfx2/source/dialog/dinfdlg.cxx | 115 +++-- vcl/jsdialog/enabled.cxx |9 ++- vcl/source/control/tabctrl.cxx |4 - 4 files changed, 95 insertions(+), 52 deletions(-) New commits: commit 858a25e9709b855bdac6d6e373ae837051b42ab7 Author: NickWingate AuthorDate: Tue Aug 9 10:54:40 2022 +0100 Commit: Szymon Kłos CommitDate: Tue Aug 16 16:03:46 2022 +0200 Enable File Properties for JSDialogs - Disable security tab as protect/password subdialog not fully async-ed - Disable custom property tab as still unstable - Hide Digital signatures button - Make duration dialog async - Set location as file name Signed-off-by: NickWingate Change-Id: I5843bb7737af8dd6b7d3af273ddd8997f2e35e10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138010 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index 40cbd82c7762..c1b5519e90ac 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -275,11 +275,28 @@ public: ~CustomPropertiesTimeField(); }; +class DurationDialog_Impl : public weld::GenericDialogController +{ +std::unique_ptr m_xNegativeCB; +std::unique_ptr m_xYearNF; +std::unique_ptr m_xMonthNF; +std::unique_ptr m_xDayNF; +std::unique_ptr m_xHourNF; +std::unique_ptr m_xMinuteNF; +std::unique_ptr m_xSecondNF; +std::unique_ptr m_xMSecondNF; + +public: +DurationDialog_Impl(weld::Widget* pParent, const css::util::Duration& rDuration); +css::util::Duration GetDuration() const; +}; + class CustomPropertiesDurationField { css::util::Duration m_aDuration; std::unique_ptrm_xEntry; std::unique_ptr m_xEditButton; +std::shared_ptr m_xDurationDialog; DECL_LINK(ClickHdl, weld::Button&, void); public: @@ -290,6 +307,8 @@ public: const css::util::Duration& GetDuration() const { return m_aDuration; } void set_visible(bool bVisible); + +~CustomPropertiesDurationField(); }; class CustomPropertiesYesNoButton diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 818948f99461..05c91dccf581 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -705,6 +706,8 @@ SfxDocumentPage::SfxDocumentPage(weld::Container* pPage, weld::DialogController* ImplCheckPasswordState(); m_xChangePassBtn->connect_clicked( LINK( this, SfxDocumentPage, ChangePassHdl ) ); m_xSignatureBtn->connect_clicked( LINK( this, SfxDocumentPage, SignatureHdl ) ); +if (comphelper::LibreOfficeKit::isActive()) +m_xSignatureBtn->hide(); m_xDeleteBtn->connect_clicked( LINK( this, SfxDocumentPage, DeleteHdl ) ); m_xImagePreferredDpiCheckButton->connect_toggled(LINK(this, SfxDocumentPage, ImagePreferredDPICheckBoxClicked)); @@ -983,26 +986,36 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) m_xShowTypeFT->set_label( aDescription ); // determine location -aURL.SetSmartURL( aFile); -if ( aURL.GetProtocol() == INetProtocol::File ) +// online we don't know file location so we just set it as the name +if (comphelper::LibreOfficeKit::isActive()) { -INetURLObject aPath( aURL ); -aPath.setFinalSlash(); -aPath.removeSegment(); -// we know it's a folder -> don't need the final slash, but it's better for WB_PATHELLIPSIS -aPath.removeFinalSlash(); -OUString aText( aPath.PathToFileName() ); //! (pb) MaxLen? -m_xFileValEd->set_label(aText); -OUString aURLStr; -osl::FileBase::getFileURLFromSystemPath(aText, aURLStr); -m_xFileValEd->set_uri(aURLStr); +m_xFileValEd->set_label(aName); +m_xFileValEd->set_uri(aName); } -else if (aURL.GetProtocol() != INetProtocol::PrivSoffice) +else { -m_xFileValEd->set_label(aURL.GetPartBeforeLastName()); -m_xFileValEd->set_uri(m_xFileValEd->get_label()); +aURL.SetSmartURL( aFile); +if ( aURL.GetProtocol() == INetProtocol::File ) +{ +INetURLObject aPath( aURL ); +aPath.setFinalSlash(); +aPath.removeSegment(); +// we know it's a folder -> don't need the final slash, but it's better for WB_PATHELLIPSIS +aPath.removeFinalSlash(); +OUString aText( aPath.PathToFileName() ); //! (pb) MaxLen? +m_xFileValEd->set_label(aText); +OUString aURLStr; +osl::FileBase::getFileURLFromSystemPath(aText, aURLStr); +m_xFileValEd->set_uri(aURLStr); +} +else if (aURL.GetProtocol() != INetProtocol::PrivSoffice) +{ +m_xFileValEd->set_label(aURL.GetPartBeforeLastName()); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sfx2/source
sfx2/source/dialog/dinfdlg.cxx | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) New commits: commit 4666a1b52028ba60f80ad93a756f95bb174dbe7b Author: NickWingate AuthorDate: Fri Aug 12 09:48:18 2022 +0100 Commit: Szymon Kłos CommitDate: Tue Aug 16 12:40:37 2022 +0200 Fix opening duration custom property shows text Before saving a duration custom property and then closing and opening file props wouldn't show the duration type and value and instead blank text Signed-off-by: NickWingate Change-Id: Ie6536dd75151db40f335985c1ce92236ce77ddc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138180 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 2a32e9c03dc9..818948f99461 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1799,17 +1799,14 @@ void CustomPropertiesWindow::ReloadLinesContent() pLine->m_xDurationField->SetDuration(aTmpDuration); } -if (nType != Custom_Type_Duration) +if (Custom_Type_Boolean == nType) { -if (Custom_Type_Boolean == nType) -{ -if (bTmpValue) -pLine->m_xYesNoButton->CheckYes(); -else -pLine->m_xYesNoButton->CheckNo(); -} -pLine->m_xTypeBox->set_active_id(OUString::number(nType)); +if (bTmpValue) +pLine->m_xYesNoButton->CheckYes(); +else +pLine->m_xYesNoButton->CheckNo(); } +pLine->m_xTypeBox->set_active_id(OUString::number(nType)); pLine->DoTypeHdl(*pLine->m_xTypeBox); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - cui/source cui/uiconfig include/svx vcl/jsdialog
cui/source/dialogs/dlgname.cxx | 12 ++ cui/source/factory/dlgfact.cxx | 26 ++- cui/source/factory/dlgfact.hxx |9 - cui/source/inc/cuitabarea.hxx |7 cui/source/inc/dlgname.hxx |8 cui/source/tabpages/tpcolor.cxx | 55 cui/uiconfig/ui/queryduplicatedialog.ui |2 - include/svx/svxdlg.hxx |2 + vcl/jsdialog/enabled.cxx|4 +- vcl/jsdialog/jsdialogbuilder.cxx|1 10 files changed, 101 insertions(+), 25 deletions(-) New commits: commit 7741b21f98e22a654962a5fdae165508cc90a7df Author: NickWingate AuthorDate: Tue Mar 15 19:22:12 2022 + Commit: Gökay ŞATIR CommitDate: Wed Apr 20 10:23:22 2022 +0200 Make name dialog async Including making the warning subdialog async Signed-off-by: NickWingate Change-Id: If3560a86ac349f0f6a5bc0ac19ba405ac4f04b36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131654 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx index ffa540bbca5b..fd0e3953e98e 100644 --- a/cui/source/dialogs/dlgname.cxx +++ b/cui/source/dialogs/dlgname.cxx @@ -36,6 +36,18 @@ SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, const m_xEdtName->select_region(0, -1); ModifyHdl(*m_xEdtName); m_xEdtName->connect_changed(LINK(this, SvxNameDialog, ModifyHdl)); + +m_xBtnOK->connect_clicked(LINK(this, SvxNameDialog, OkHdl)); +} + +IMPL_LINK_NOARG(SvxNameDialog, OkHdl, weld::Button&, void) +{ +if (m_aOkHdl.IsSet()) +{ +m_aOkHdl.Call(*this); +return; +} +m_xDialog->response(RET_OK); } IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl, weld::Entry&, void) diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 7ee30c9b621a..ac715423dba3 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -221,6 +221,16 @@ short AbstractSvxNameDialog_Impl::Execute() return m_xDlg->run(); } +bool AbstractSvxNameDialog_Impl::StartExecuteAsync(AsyncContext ) +{ +return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + +void AbstractSvxNameDialog_Impl::Response(int response) +{ +m_xDlg->response(response); +} + // #i68101# short AbstractSvxObjectNameDialog_Impl::Execute() { @@ -749,6 +759,15 @@ void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const LinkSetCheckNameHdl( Link(), bCheckImmediately ); } +void AbstractSvxNameDialog_Impl::SetOkHdl(const Link& rLink) +{ +aOkHdl = rLink; +if( rLink.IsSet() ) +m_xDlg->SetOkHdl( LINK(this, AbstractSvxNameDialog_Impl, OkHdl) ); +else +m_xDlg->SetOkHdl( Link() ); +} + void AbstractSvxNameDialog_Impl::SetCheckNameTooltipHdl( const Link& rLink) { aCheckNameTooltipHdl = rLink; @@ -778,6 +797,11 @@ IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, CheckNameHdl, SvxNameDialog&, bool) return aCheckNameHdl.Call(*this); } +IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, OkHdl, SvxNameDialog&, void) +{ +aOkHdl.Call(*this); +} + IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, CheckNameTooltipHdl, SvxNameDialog&, OUString) { return aCheckNameTooltipHdl.Call(*this); @@ -1258,7 +1282,7 @@ VclPtr AbstractDialogFactory_Impl::CreateSvxEditDictionaryDia VclPtr AbstractDialogFactory_Impl::CreateSvxNameDialog(weld::Window* pParent, const OUString& rName, const OUString& rDesc) { -return VclPtr::Create(std::make_unique(pParent, rName, rDesc)); +return VclPtr::Create(std::make_shared(pParent, rName, rDesc)); } VclPtr AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index b39e29efe821..c4679ba7b7e1 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -436,23 +436,28 @@ class SvxNameDialog; class AbstractSvxNameDialog_Impl :public AbstractSvxNameDialog { public: -explicit AbstractSvxNameDialog_Impl(std::unique_ptr p) +explicit AbstractSvxNameDialog_Impl(std::shared_ptr p) : m_xDlg(std::move(p)) { } virtual short Execute() override; +virtual bool StartExecuteAsync(AsyncContext ) override; virtual voidGetName( OUString& rName ) override ; virtual voidSetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) override ; +virtual voidSetOkHdl( const Link& rLink ) override; +virtual voidResponse( int response ) override; virtual voidSetCheckNameTooltipHdl( const Link& rLink ) override ; virtual voidSetEditHelpId(const OString&) override ; //from class Window virtual voidSetHelpId( const OString& ) override ; virtual voidSetText( const
[Libreoffice-commits] core.git: filter/source include/svx svx/source sw/source
filter/source/pdf/impdialog.cxx| 48 ++--- filter/source/pdf/impdialog.hxx|5 ++ include/svx/AccessibilityCheckDialog.hxx |1 svx/source/dialog/AccessibilityCheckDialog.cxx |9 +--- sw/source/uibase/shells/basesh.cxx |4 +- 5 files changed, 36 insertions(+), 31 deletions(-) New commits: commit a1f9fea520f5b3f5d54a284886aa531693f32e7a Author: NickWingate AuthorDate: Wed Feb 23 14:11:49 2022 + Commit: Andras Timar CommitDate: Thu Apr 14 08:53:39 2022 +0200 Make accessibility check dialog async Signed-off-by: NickWingate Change-Id: I88913b3d7e580a1d8c69a39454f2598e11ba43ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130438 Reviewed-by: Szymon Kłos Reviewed-by: Michael Meeks Reviewed-by: Mert Tumer Tested-by: Jenkins CollaboraOffice (cherry picked from commit 61fed0c4fe53738254d116543417f1c7028a0f39) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130451 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index c1a3c94d5a85..d35396b40e14 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -271,6 +271,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property GetOKButton().set_label(sOkButtonText); GetCancelButton().connect_clicked(LINK(this, ImpPDFTabDialog, CancelHdl)); +GetOKButton().connect_clicked(LINK(this, ImpPDFTabDialog, OkHdl)); // remove the reset button, not needed in this tabbed dialog RemoveResetButton(); @@ -313,10 +314,37 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl, weld::Button&, void) m_xDialog->response(RET_CANCEL); } +IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, void) +{ +if (getGeneralPage()->IsPdfUaSelected()) +{ +SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); +if (pShell) +{ +sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); +if (!aCollection.getIssues().empty()) +{ +mpAccessibilityCheckDialog = std::make_shared(mpParent, aCollection); +weld::DialogController::runAsync(mpAccessibilityCheckDialog, [this](sal_Int32 retValue){ +m_xDialog->response(retValue); +}); +} +} +} +else +{ +m_xDialog->response(RET_OK); +} +} + ImpPDFTabDialog::~ImpPDFTabDialog() { maConfigItem.WriteModifiedConfig(); maConfigI18N.WriteModifiedConfig(); +if (mpAccessibilityCheckDialog) +{ +mpAccessibilityCheckDialog->response(RET_CANCEL); +} } void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage) @@ -345,26 +373,6 @@ void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage) } } -short ImpPDFTabDialog::Ok( ) -{ -// here the whole mechanism of the base class is not used -// when Ok is hit, the user means 'convert to PDF', so simply close with ok - -if (getGeneralPage()->IsPdfUaSelected()) -{ -SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); -if (pShell) -{ -sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); -if (!aCollection.getIssues().empty()) -{ -svx::AccessibilityCheckDialog aDialog(mpParent, aCollection); -return aDialog.run(); -} -} -} -return RET_OK; -} Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() { diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 9682adbc111d..219d47e6d613 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include @@ -66,6 +67,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController Any maSelection; DECL_LINK(CancelHdl, weld::Button&, void); +DECL_LINK(OkHdl, weld::Button&, void); // the following data are the configuration used throughout the dialog and pages boolmbIsPresentation; @@ -123,6 +125,8 @@ class ImpPDFTabDialog final : public SfxTabDialogController boolmbCanExtractForAccessibility; css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords; +std::shared_ptr< svx::AccessibilityCheckDialog > mpAccessibilityCheckDialog; + boolmbIsRangeChecked; OUStringmsPageRange; boolmbSelectionIsChecked; @@ -163,7 +167,6 @@ public: private: virtual voidPageCreated(const OString& rId, SfxTabPage& rPage) override; -virtual short Ok()
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - filter/source include/svx svx/source sw/source
filter/source/pdf/impdialog.cxx| 48 ++--- filter/source/pdf/impdialog.hxx|5 ++ include/svx/AccessibilityCheckDialog.hxx |1 svx/source/dialog/AccessibilityCheckDialog.cxx |9 +--- sw/source/uibase/shells/basesh.cxx |4 +- 5 files changed, 36 insertions(+), 31 deletions(-) New commits: commit 1c11ca079e8668bb461112f52304fc4eb786afda Author: NickWingate AuthorDate: Wed Feb 23 14:11:49 2022 + Commit: Andras Timar CommitDate: Wed Mar 30 15:29:52 2022 +0200 Make accessibility check dialog async Signed-off-by: NickWingate Change-Id: I88913b3d7e580a1d8c69a39454f2598e11ba43ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130438 Reviewed-by: Szymon Kłos Reviewed-by: Michael Meeks Reviewed-by: Mert Tumer Tested-by: Jenkins CollaboraOffice (cherry picked from commit 61fed0c4fe53738254d116543417f1c7028a0f39) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132185 Reviewed-by: Andras Timar diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index c1a3c94d5a85..d35396b40e14 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -271,6 +271,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property GetOKButton().set_label(sOkButtonText); GetCancelButton().connect_clicked(LINK(this, ImpPDFTabDialog, CancelHdl)); +GetOKButton().connect_clicked(LINK(this, ImpPDFTabDialog, OkHdl)); // remove the reset button, not needed in this tabbed dialog RemoveResetButton(); @@ -313,10 +314,37 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl, weld::Button&, void) m_xDialog->response(RET_CANCEL); } +IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, void) +{ +if (getGeneralPage()->IsPdfUaSelected()) +{ +SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); +if (pShell) +{ +sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); +if (!aCollection.getIssues().empty()) +{ +mpAccessibilityCheckDialog = std::make_shared(mpParent, aCollection); +weld::DialogController::runAsync(mpAccessibilityCheckDialog, [this](sal_Int32 retValue){ +m_xDialog->response(retValue); +}); +} +} +} +else +{ +m_xDialog->response(RET_OK); +} +} + ImpPDFTabDialog::~ImpPDFTabDialog() { maConfigItem.WriteModifiedConfig(); maConfigI18N.WriteModifiedConfig(); +if (mpAccessibilityCheckDialog) +{ +mpAccessibilityCheckDialog->response(RET_CANCEL); +} } void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage) @@ -345,26 +373,6 @@ void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage) } } -short ImpPDFTabDialog::Ok( ) -{ -// here the whole mechanism of the base class is not used -// when Ok is hit, the user means 'convert to PDF', so simply close with ok - -if (getGeneralPage()->IsPdfUaSelected()) -{ -SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); -if (pShell) -{ -sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); -if (!aCollection.getIssues().empty()) -{ -svx::AccessibilityCheckDialog aDialog(mpParent, aCollection); -return aDialog.run(); -} -} -} -return RET_OK; -} Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() { diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 9682adbc111d..219d47e6d613 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include @@ -66,6 +67,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController Any maSelection; DECL_LINK(CancelHdl, weld::Button&, void); +DECL_LINK(OkHdl, weld::Button&, void); // the following data are the configuration used throughout the dialog and pages boolmbIsPresentation; @@ -123,6 +125,8 @@ class ImpPDFTabDialog final : public SfxTabDialogController boolmbCanExtractForAccessibility; css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords; +std::shared_ptr< svx::AccessibilityCheckDialog > mpAccessibilityCheckDialog; + boolmbIsRangeChecked; OUStringmsPageRange; boolmbSelectionIsChecked; @@ -163,7 +167,6 @@ public: private: virtual voidPageCreated(const OString& rId, SfxTabPage& rPage) override; -virtual short Ok() override; }; diff
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - filter/source include/svx svx/source sw/source
filter/source/pdf/impdialog.cxx| 48 ++--- filter/source/pdf/impdialog.hxx|5 ++ include/svx/AccessibilityCheckDialog.hxx |1 svx/source/dialog/AccessibilityCheckDialog.cxx | 10 + sw/source/uibase/shells/basesh.cxx |4 +- 5 files changed, 37 insertions(+), 31 deletions(-) New commits: commit 61fed0c4fe53738254d116543417f1c7028a0f39 Author: NickWingate AuthorDate: Wed Feb 23 14:11:49 2022 + Commit: Mert Tumer CommitDate: Thu Feb 24 08:43:31 2022 +0100 Make accessibility check dialog async Signed-off-by: NickWingate Change-Id: I88913b3d7e580a1d8c69a39454f2598e11ba43ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130438 Reviewed-by: Szymon Kłos Reviewed-by: Michael Meeks Reviewed-by: Mert Tumer Tested-by: Jenkins CollaboraOffice diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 31f712c47edf..8eda392710bd 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -271,6 +271,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue GetOKButton().set_label(sOkButtonText); GetCancelButton().connect_clicked(LINK(this, ImpPDFTabDialog, CancelHdl)); +GetOKButton().connect_clicked(LINK(this, ImpPDFTabDialog, OkHdl)); // remove the reset button, not needed in this tabbed dialog RemoveResetButton(); @@ -313,10 +314,37 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl, weld::Button&, void) m_xDialog->response(RET_CANCEL); } +IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, void) +{ +if (getGeneralPage()->IsPdfUaSelected()) +{ +SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); +if (pShell) +{ +sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); +if (!aCollection.getIssues().empty()) +{ +mpAccessibilityCheckDialog = std::make_shared(mpParent, aCollection); +weld::DialogController::runAsync(mpAccessibilityCheckDialog, [this](sal_Int32 retValue){ +m_xDialog->response(retValue); +}); +} +} +} +else +{ +m_xDialog->response(RET_OK); +} +} + ImpPDFTabDialog::~ImpPDFTabDialog() { maConfigItem.WriteModifiedConfig(); maConfigI18N.WriteModifiedConfig(); +if (mpAccessibilityCheckDialog) +{ +mpAccessibilityCheckDialog->response(RET_CANCEL); +} } void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage) @@ -345,26 +373,6 @@ void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage) } } -short ImpPDFTabDialog::Ok( ) -{ -// here the whole mechanism of the base class is not used -// when Ok is hit, the user means 'convert to PDF', so simply close with ok - -if (getGeneralPage()->IsPdfUaSelected()) -{ -SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); -if (pShell) -{ -sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); -if (!aCollection.getIssues().empty()) -{ -svx::AccessibilityCheckDialog aDialog(mpParent, aCollection); -return aDialog.run(); -} -} -} -return RET_OK; -} Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() { diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 17fb57890655..c9d116ed2803 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -21,6 +21,7 @@ #define INCLUDED_FILTER_SOURCE_PDF_IMPDIALOG_HXX #include +#include #include #include @@ -67,6 +68,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController Any maSelection; DECL_LINK(CancelHdl, weld::Button&, void); +DECL_LINK(OkHdl, weld::Button&, void); // the following data are the configuration used throughout the dialog and pages boolmbIsPresentation; @@ -124,6 +126,8 @@ class ImpPDFTabDialog final : public SfxTabDialogController boolmbCanExtractForAccessibility; css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords; +std::shared_ptr< svx::AccessibilityCheckDialog > mpAccessibilityCheckDialog; + boolmbIsRangeChecked; OUStringmsPageRange; boolmbSelectionIsChecked; @@ -164,7 +168,6 @@ public: private: virtual voidPageCreated(const OString& rId, SfxTabPage& rPage) override; -virtual short Ok() override; }; diff --git a/include/svx/AccessibilityCheckDialog.hxx b/include/svx/AccessibilityCheckDialog.hxx index 5227cbee2699..e3e1e201f227 100644