[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 97d3389f32a24f06113aad37058d24f2cbbc3026 Author: Caolán McNamara AuthorDate: Fri Dec 1 11:52:27 2023 + Commit: Caolán McNamara CommitDate: Fri Dec 1 18:07:00 2023 +0100 cid#1557920 COPY_INSTEAD_OF_MOVE a sample commit to test this Change-Id: Ibc1a1f75b908e245395a05e81c26158c67e36257 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160214 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index ce3b6c5dd694..fd7a21931c4f 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1243,8 +1243,7 @@ LOKDocumentFocusListener::getSelectedObject(const accessibility::AccessibleEvent uno::Reference< accessibility::XAccessible > xSelectedObject; if (isText(m_nDocumentType)) { -uno::Reference< accessibility::XAccessible > xSource(aEvent.Source, uno::UNO_QUERY); -xSelectedObject = xSource; +xSelectedObject = uno::Reference(aEvent.Source, uno::UNO_QUERY); } else {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docfile.cxx | 36 1 file changed, 16 insertions(+), 20 deletions(-) New commits: commit ef79b9c55828d39de3d86cedd125f2f32e6b259a Author: Mike Kaganski AuthorDate: Sun Nov 26 00:23:39 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Nov 26 18:17:07 2023 +0100 *DocumentLockFile ctor may throw ... e.g., when passed URL is invalid, as seen after opening https://bugs.documentfoundation.org/attachment.cgi?id=121217 using "Office Open XML Text" filter, which sets "RepairPackage" in the media descriptor, which makes the opened file unnamed. Since the code is called from SfxMedium dtor, this crashed on closing this file. Change-Id: I95f6b16f1421abd55e6739ed431878bb72cf3a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159964 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 3b975bb1add9..42fe7d72b8c5 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3227,23 +3227,21 @@ void SfxMedium::UnlockFile( bool bReleaseLockStream ) if ( !pImpl->m_bLocked ) return; -::svt::DocumentLockFile aLockFile( pImpl->m_aLogicName ); - try { -pImpl->m_bLocked = false; -// TODO/LATER: A warning could be shown in case the file is not the own one -aLockFile.RemoveFile(); -} -catch( const io::WrongFormatException& ) -{ +::svt::DocumentLockFile aLockFile(pImpl->m_aLogicName); + try +{ +pImpl->m_bLocked = false; +// TODO/LATER: A warning could be shown in case the file is not the own one +aLockFile.RemoveFile(); +} +catch (const io::WrongFormatException&) { // erase the empty or corrupt file aLockFile.RemoveFileDirectly(); } -catch( const uno::Exception& ) -{} } catch( const uno::Exception& ) {} @@ -3251,23 +3249,21 @@ void SfxMedium::UnlockFile( bool bReleaseLockStream ) if(!pImpl->m_bMSOLockFileCreated) return; -::svt::MSODocumentLockFile aMSOLockFile( pImpl->m_aLogicName ); - try { -pImpl->m_bLocked = false; -// TODO/LATER: A warning could be shown in case the file is not the own one -aMSOLockFile.RemoveFile(); -} -catch( const io::WrongFormatException& ) -{ +::svt::MSODocumentLockFile aMSOLockFile(pImpl->m_aLogicName); + try +{ +pImpl->m_bLocked = false; +// TODO/LATER: A warning could be shown in case the file is not the own one +aMSOLockFile.RemoveFile(); +} +catch (const io::WrongFormatException&) { // erase the empty or corrupt file aMSOLockFile.RemoveFileDirectly(); } -catch( const uno::Exception& ) -{} } catch( const uno::Exception& ) {}
[Libreoffice-commits] core.git: sfx2/source sw/source
sfx2/source/appl/appserv.cxx |9 + sw/source/uibase/wrtsh/wrtsh2.cxx |5 + 2 files changed, 10 insertions(+), 4 deletions(-) New commits: commit d7b33b1be8fee684e906f170f4001735c095056e Author: Caolán McNamara AuthorDate: Thu Nov 23 08:53:30 2023 + Commit: Caolán McNamara CommitDate: Thu Nov 23 11:48:55 2023 +0100 use SID_DOCFRAME for dialog parents if there is no SID_FILLFRAME if there is no other hint which avoids: sfx2/source/appl/appserv.cxx:314: no parent for dialogs without the need to add extra SID_FILLFRAME just to smuggle a default parent in. Change-Id: I99980c951a0046afa3cc22e02b4f79850e3b2736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159850 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index d58b62a9bf3b..9c1b3c9d2a57 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -256,6 +256,13 @@ namespace return xFrame; } +Reference GetDocFrame(const SfxRequest& rReq) +{ +const SfxFrameItem* pFrameItem = rReq.GetArg(SID_DOCFRAME); +SfxFrame* pFrame = pFrameItem ? pFrameItem->GetFrame() : nullptr; +return pFrame ? pFrame->GetFrameInterface() : nullptr; +} + class LicenseDialog : public weld::GenericDialogController { public: @@ -309,6 +316,8 @@ weld::Window* SfxRequest::GetFrameWeld() const } Reference xFrame(GetRequestFrame(*this)); +if (!xFrame) +xFrame = GetDocFrame(*this); if (!xFrame) { SAL_WARN("sfx.appl", "no parent for dialogs"); diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 029b728bb30a..3a9e51136fd0 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -597,8 +597,6 @@ static void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, if ((nFilter & LoadUrlFlags::NewView) && !comphelper::LibreOfficeKit::isActive()) aTargetFrameName.SetValue( "_blank" ); -SfxUnoFrameItem aDocFrame(SID_FILLFRAME, rViewFrame.GetFrame().GetFrameInterface()); - rViewFrame.GetDispatcher()->ExecuteList(SID_OPENDOC, SfxCallMode::ASYNCHRON|SfxCallMode::RECORD, { @@ -607,8 +605,7 @@ static void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, , , , -}, -{ } ); +}); } void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter,
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objstor.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 630ea24fa493be653686689b63692c104f2b0ae5 Author: Caolán McNamara AuthorDate: Fri Nov 10 19:14:18 2023 + Commit: Caolán McNamara CommitDate: Fri Nov 10 21:35:48 2023 +0100 ofz#64065 Abrt on config Change-Id: Idb76d58ab6036c9f38b0b76a3a240dcfb07d52a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159310 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 920e4476ab62..b39b5d14ee38 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3770,7 +3770,7 @@ void SfxObjectShell::SetMacroCallsSeenWhileLoading() bool SfxObjectShell::GetMacroCallsSeenWhileLoading() const { -if (officecfg::Office::Common::Security::Scripting::CheckDocumentEvents::get()) +if (utl::ConfigManager::IsFuzzing() || officecfg::Office::Common::Security::Scripting::CheckDocumentEvents::get()) return pImpl->m_bMacroCallsSeenWhileLoading; return false; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) New commits: commit 7a73eedf00541b5ba56b81e7d78faef4247f046f Author: Mike Kaganski AuthorDate: Thu Nov 9 16:12:45 2023 +0300 Commit: Mike Kaganski CommitDate: Thu Nov 9 18:37:26 2023 +0100 Fix USE_CONFIG_APPROVE_CONFIRMATION and USE_CONFIG_REJECT_CONFIRMATION They still showed UI in case of signed macros. Two decisions were made, to improve security of USE_CONFIG_APPROVE_CONFIRMATION: 1. In case of High macro security mode, valid but untrusted certificate will be automatically rejected (because it is not safe to automatically add trusted certificates) - so in this mode, USE_CONFIG_APPROVE_CONFIRMATION is the same as USE_CONFIG_REJECT_CONFIRMATION; 2. In case of Medium macro security mode, valid but untrusted certificate will not automatically allow macros execution, but will proceed to the following checks - which on Windows will try to check the source's Security Zone, and may disallow macros based on that. Only after Security Zone check the macros will be automatically allowed. Change-Id: I1a9c92c6b940b689599c5d106798ecfc691dad46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159214 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index d64b0b60697f..4e9311593aed 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -213,9 +213,12 @@ namespace sfx2 // should not ask any confirmations. FROM_LIST_AND_SIGNED_WARN should only allow // trusted signed macros at this point; so it may only ask for confirmation to add // certificates to trusted, and shouldn't show UI when trusted list is read-only. -const bool bAllowUI = nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN - && (nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE - || !SvtSecurityOptions::IsReadOnly(SvtSecurityOptions::EOption::MacroTrustedAuthors)); +const bool bAllowUI += nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN + && eAutoConfirm == eNoAutoConfirm + && (nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE + || !SvtSecurityOptions::IsReadOnly( + SvtSecurityOptions::EOption::MacroTrustedAuthors)); const bool bHasTrustedMacroSignature = m_xData->m_rDocumentAccess.hasTrustedScriptingSignature(bAllowUI ? rxInteraction : nullptr); if (bHasTrustedMacroSignature) @@ -227,9 +230,20 @@ namespace sfx2 || nSignatureState == SignatureState::NOTVALIDATED ) { // there is valid signature, but it is not from the trusted author -// this case includes explicit reject from user in the UI in cases of -// FROM_LIST_AND_SIGNED_WARN and ALWAYS_EXECUTE -return disallowMacroExecution(); +if (eAutoConfirm == eAutoConfirmApprove +&& nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE) +{ +// For ALWAYS_EXECUTE + eAutoConfirmApprove (USE_CONFIG_APPROVE_CONFIRMATION +// in Medium security mode), do not approve it right here; let Security Zone +// check below do its job first. +} +else +{ +// All other cases of valid but untrusted signatures should result in denied +// macros here. This includes explicit reject from user in the UI in cases +// of FROM_LIST_AND_SIGNED_WARN and ALWAYS_EXECUTE +return disallowMacroExecution(); +} } // Other values of nSignatureState would result in either rejected macros // (FROM_LIST_AND_SIGNED_*), or a confirmation.
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/linksrc.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit ef5828fb45e2b46a36b73260232dede3d98e22a4 Author: Szymon Kłos AuthorDate: Mon Nov 6 18:35:20 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Nov 9 09:40:40 2023 +0100 lok: fix crash on DDE Link modify 1. Open document with editable DDE Link section in 2 views 2. View A selects content containing section and copies that 3. View A is closed 4. View B tries to modify section Result: crash Avoid destroying SwTransferDdeLink in SwTransferable::~SwTransferable() what happens while calling RemoveDDELinkFormat in SwTransferDdeLink::DataChanged by keeping reference to it while iterating in SvLinkSource::NotifyDataChanged() Change-Id: Iba53a4c139f9d508d2f64bcc94b479761b84bf2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159040 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 131992c51040..3a1af228f6a4 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -287,7 +287,8 @@ void SvLinkSource::NotifyDataChanged() if( ( p->nAdviseModes & ADVISEMODE_NODATA ) || GetData( aVal, p->aDataMimeType, true ) ) { -p->xSink->DataChanged( p->aDataMimeType, aVal ); +tools::SvRef xLink(p->xSink); +xLink->DataChanged( p->aDataMimeType, aVal ); if ( !aIter.IsValidCurrValue( p ) ) continue;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/dispatch.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit a6f26b87a0c6b0bb7a92ed0878e7aaa57ec64260 Author: Szymon Kłos AuthorDate: Tue Nov 7 11:18:04 2023 +0100 Commit: Miklos Vajna CommitDate: Thu Nov 9 08:41:34 2023 +0100 lok: notebookbar: fix unit-copy-paste in online we can't remove hack in SfxDispatcher::Update_Impl yet because this made unit-copy-paste test in online broken reverts part of: commit 1a6d16cb14342f9a66f99960e96027af6e5369ef lok: notebookbar: query SID_NOTEBOOKBAR only when requested to switch UI Signed-off-by: Szymon Kłos Change-Id: I8cd801bbc912f2ab3f710f5c7133445f07c4e5de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159039 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 9134f8da574d..6a492bffda7e 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1120,8 +1120,7 @@ void SfxDispatcher::Update_Impl( bool bForce ) if ( xLayoutManager.is() ) xLayoutManager->unlock(); -if ( !comphelper::LibreOfficeKit::isActive() && -SfxViewShell::Current() && SfxViewShell::Current()->GetDispatcher() ) +if ( SfxViewShell::Current() && SfxViewShell::Current()->GetDispatcher() ) { const SfxPoolItem *pItem; SfxViewShell::Current()->GetDispatcher()->QueryState(SID_NOTEBOOKBAR, pItem);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) New commits: commit bfba46d90fc4146ab2a48d155d90dafc8c0a067e Author: Mike Kaganski AuthorDate: Wed Nov 8 10:17:42 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Nov 8 16:23:12 2023 +0100 Simplify a bit Change-Id: I05ef5346f5aab25b208aa058658353cf71e68e87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159103 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index ec23ebe62578..377c14517586 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -227,23 +227,17 @@ namespace sfx2 return disallowMacroExecution(); } } - -// at this point it is clear that the document is neither in secure location nor signed with trusted certificate -if ( ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN ) -|| ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_WARN ) -) -{ -return disallowMacroExecution(); -} } catch ( const Exception& ) { -if ( ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_WARN ) -|| ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN ) -) -{ -return disallowMacroExecution(); -} +DBG_UNHANDLED_EXCEPTION("sfx.doc"); +} + +// at this point it is clear that the document is neither in secure location nor signed with trusted certificate +if ((nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN) +|| (nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_WARN)) +{ +return disallowMacroExecution(); } #if defined(_WIN32)
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit f0df7c7c7fd4109937f21c2278f9a57e59c73761 Author: Mike Kaganski AuthorDate: Wed Nov 8 10:14:13 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Nov 8 16:22:57 2023 +0100 FROM_LIST_NO_WARN was handled above Change-Id: I88da25f5f2819edd78fb95573c619cd8e3187469 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159102 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index e2c1150c33ef..ec23ebe62578 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -238,8 +238,7 @@ namespace sfx2 } catch ( const Exception& ) { -if ( ( nMacroExecutionMode == MacroExecMode::FROM_LIST_NO_WARN ) -|| ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_WARN ) +if ( ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_WARN ) || ( nMacroExecutionMode == MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN ) ) {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 85a8c29e26f0bf48906312103e57246685d32c7e Author: Mike Kaganski AuthorDate: Wed Nov 8 09:35:46 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Nov 8 16:22:00 2023 +0100 tdf#158090: Limit signed document requirement to High security level Commit 1dc71daf7fa7204a98c75dac680af664ab9c8edb (Improve macro checks, 2021-01-28) introduced a new requirement, that trusted macro signature must be accompanied by valid document signature when the document has events calling macros, otherwise macros are not allowed. But this breaks multiple workflows, where security level is set to limit users' ability to run unsigned macros, where documents aren't signed. As the first step, limit the security hardening introduced in the said commit to High security level; in Medium security level, restore the previous behavior. The plan is to fix more inconsistencies later, and then introduce a new separate configuration to require document signature to allow trusted macros (enabled by default), so that the combination of its default value and the High default security level keep the hardened default security implemented currently, while allowing users to opt to the previous documented behavior. Change-Id: I71ff0e531f3a42fbee7828982e4fd39f0e9d6ea3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159101 Tested-by: Mike Kaganski Reviewed-by: Thorsten Behrens diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index ef9546365451..e2c1150c33ef 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -207,9 +207,9 @@ namespace sfx2 { return disallowMacroExecution(); } -else if ( m_xData->m_rDocumentAccess.macroCallsSeenWhileLoading() && - bHasTrustedMacroSignature && - !bHasValidContentSignature) +else if (nMacroExecutionMode != MacroExecMode::ALWAYS_EXECUTE + && m_xData->m_rDocumentAccess.macroCallsSeenWhileLoading() + && bHasTrustedMacroSignature && !bHasValidContentSignature) { // When macros are signed, and the document has events which call macros, the document content needs to be signed too. m_xData->m_bHasUnsignedContentError = true;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit cc948bae82e63928a70451c6e71beb67e07f06e4 Author: Mike Kaganski AuthorDate: Wed Nov 8 09:32:58 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Nov 8 11:39:34 2023 +0100 Add comments for the magic constants Change-Id: Ic35758357c18c9d172532819a3e8968fd66b26ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159100 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index e3fe09c35feb..ef9546365451 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -141,16 +141,16 @@ namespace sfx2 switch ( SvtSecurityOptions::GetMacroSecurityLevel() ) { -case 3: +case 3: // "Very high" nMacroExecutionMode = MacroExecMode::FROM_LIST_NO_WARN; break; -case 2: +case 2: // "High" nMacroExecutionMode = MacroExecMode::FROM_LIST_AND_SIGNED_WARN; break; -case 1: +case 1: // "Medium" nMacroExecutionMode = MacroExecMode::ALWAYS_EXECUTE; break; -case 0: +case 0: // "Low" nMacroExecutionMode = MacroExecMode::ALWAYS_EXECUTE_NO_WARN; break; default:
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 505f97b5b23954d689d55640977da6ec1af523b9 Author: Mike Kaganski AuthorDate: Tue Nov 7 13:38:33 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Nov 7 17:38:33 2023 +0100 Add a description comment Basically describing commit 71c6f438cecc3ce5e8060efe1df840652885701c (tdf#129311 don't allow temporary trusted certs, 2019-12-17). Change-Id: I4d947014b09412638560e9249f242cf6ff222cc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159069 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index ec56e3f529e7..637f137866ba 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -189,6 +189,13 @@ namespace sfx2 // check whether the document is signed with trusted certificate if ( nMacroExecutionMode != MacroExecMode::FROM_LIST ) { +// At this point, the possible values of nMacroExecutionMode are: ALWAYS_EXECUTE, +// FROM_LIST_AND_SIGNED_WARN (the default), FROM_LIST_AND_SIGNED_NO_WARN. +// ALWAYS_EXECUTE corresponds to the Medium security level; it should ask for +// confirmation when macros are unsigned or untrusted. FROM_LIST_AND_SIGNED_NO_WARN +// should not ask any confirmations. FROM_LIST_AND_SIGNED_WARN should only allow +// trusted signed macros at this point; so it may only ask for confirmation to add +// certificates to trusted, and shouldn't show UI when trusted list is read-only. // the trusted macro check will also retrieve the signature state ( small optimization ) const bool bAllowUI = nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN && (nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/openuriexternally.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 518df6a3bd6aa251dc4ad30ab3d04545513ae5c6 Author: Caolán McNamara AuthorDate: Tue Nov 7 12:35:47 2023 + Commit: Caolán McNamara CommitDate: Tue Nov 7 14:53:08 2023 +0100 make this a more straight forward yes/no question instead of an ok/cancel, and default to no Change-Id: If86ca1b29d0dd91018fdc8edd6482a6d9ef5c0e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159068 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index 680c2796bafa..bdf8d72766cc 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -94,10 +94,11 @@ IMPL_LINK_NOARG(URITools, onOpenURI, Timer*, void) SolarMutexGuard g; std::unique_ptr eb( Application::CreateMessageDialog( -mpDialogParent, VclMessageType::Warning, VclButtonsType::OkCancel, +mpDialogParent, VclMessageType::Warning, VclButtonsType::YesNo, SfxResId(STR_DANGEROUS_TO_OPEN))); eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", INetURLObject::decode(msURI, INetURLObject::DecodeMechanism::Unambiguous))); -if (eb->run() == RET_OK) { +eb->set_default_response(RET_NO); +if (eb->run() == RET_YES) { flags = 0; continue; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 6313e83a6f03540c1256e1e433cdf81b0913ff82 Author: Mike Kaganski AuthorDate: Tue Nov 7 10:55:48 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Nov 7 13:26:09 2023 +0100 Rename variable: The UI is not only to "add" author (i.e., modify config) It is mainly to allow macro execution for this unknown certificate once. The UI will even disable the option to add, when the config is read-only. Change-Id: Iebc526c23572dc7c0e94fac79fafc8b402d451c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159051 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 77c3e4ca22f9..ec56e3f529e7 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -190,10 +190,10 @@ namespace sfx2 if ( nMacroExecutionMode != MacroExecMode::FROM_LIST ) { // the trusted macro check will also retrieve the signature state ( small optimization ) -const bool bAllowUIToAddAuthor = nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN +const bool bAllowUI = nMacroExecutionMode != MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN && (nMacroExecutionMode == MacroExecMode::ALWAYS_EXECUTE || !SvtSecurityOptions::IsReadOnly(SvtSecurityOptions::EOption::MacroTrustedAuthors)); -const bool bHasTrustedMacroSignature = m_xData->m_rDocumentAccess.hasTrustedScriptingSignature(bAllowUIToAddAuthor); +const bool bHasTrustedMacroSignature = m_xData->m_rDocumentAccess.hasTrustedScriptingSignature(bAllowUI); SignatureState nSignatureState = m_xData->m_rDocumentAccess.getScriptingSignatureState(); if ( nSignatureState == SignatureState::BROKEN )
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit deeb9a9ea982501761e4d1b9118eea76f386f86e Author: Mike Kaganski AuthorDate: Tue Nov 7 10:09:23 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Nov 7 13:25:26 2023 +0100 getCurrentMacroExecMode returns sal_Int16 And that conforms the IDL definition of css::document::MacroExecMode Change-Id: I78ebfa94eb50552e7f4ecf3d64a0ac0556c56867 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159029 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index e25e97505181..77c3e4ca22f9 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -111,7 +111,7 @@ namespace sfx2 bool DocumentMacroMode::adjustMacroMode( const Reference< XInteractionHandler >& rxInteraction, bool bHasValidContentSignature ) { -sal_uInt16 nMacroExecutionMode = m_xData->m_rDocumentAccess.getCurrentMacroExecMode(); +sal_Int16 nMacroExecutionMode = m_xData->m_rDocumentAccess.getCurrentMacroExecMode(); if ( SvtSecurityOptions::IsMacroDisabled() ) {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 7842c935e056c243e87856b93714b0f38eddab2c Author: Mike Kaganski AuthorDate: Mon Nov 6 21:32:01 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Nov 7 05:22:05 2023 +0100 Simplify a bit XDocumentDigitalSignatures::isLocationTrusted would remove segments itself, as needed; this change not only simplifies this code, but also potentially allows to define not only trusted directories, but also individuals trusted files (if the UI would be adjusted). Change-Id: I0b0d60946d84a52479fcce5ce49d368cf53283fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159009 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 283b7cd49bd2..e25e97505181 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -173,9 +173,7 @@ namespace sfx2 Reference< XDocumentDigitalSignatures > xSignatures(DocumentDigitalSignatures::createDefault(::comphelper::getProcessComponentContext())); INetURLObject aURLReferer(sURL); -OUString aLocation; -if ( aURLReferer.removeSegment() ) -aLocation = aURLReferer.GetMainURL( INetURLObject::DecodeMechanism::NONE ); +OUString aLocation = aURLReferer.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) ) {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/workwin.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 019917b1451bc3f39ea9259df48e68cb098a0402 Author: Szymon Kłos AuthorDate: Sat Nov 4 19:20:46 2023 +0100 Commit: Szymon Kłos CommitDate: Mon Nov 6 10:05:00 2023 +0100 lok: notebookbar: reduce calls to SfxNotebookBar::IsActive - in LOK case toolbars in core doesn't make any difference - SfxNotebookBar::IsActive which reads config makes doc_setView slower, avoid it in LOK case then - it was used for hiding contextual toolbars - introduced in commit 9bc1ffa2153d2474b023e0860d3c9c68ee18727b tdf#125040 Make single mode toolbar context aware Signed-off-by: Szymon Kłos Change-Id: I63de48faf2f7e7f30f8b509455061ac20a788f8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158939 Tested-by: Jenkins diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 6ff260f2f88e..88b7cc016e3e 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1199,7 +1199,8 @@ void SfxWorkWindow::UpdateObjectBars_Impl2() // Iterate over all Toolboxes xLayoutManager->lock(); -const bool isNotebookBarActive = sfx2::SfxNotebookBar::IsActive(true); +const bool bForceDestroyToolbars = +comphelper::LibreOfficeKit::isActive() ? false : sfx2::SfxNotebookBar::IsActive(true); for ( auto const & n: aObjBarList ) { ToolbarId eId = n.eId; @@ -1213,7 +1214,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl2() // Is a ToolBox required in this context ? bool bModesMatching = (nUpdateMode != SfxVisibilityFlags::Invisible) && ((nTbxMode & nUpdateMode) == nUpdateMode); -if ( bDestroy || isNotebookBarActive) +if ( bDestroy || bForceDestroyToolbars) { OUString aTbxId = g_aTbxTypeName + GetResourceURLFromToolbarId(eId); xLayoutManager->destroyElement( aTbxId );
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/notebookbar/SfxNotebookBar.cxx |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 3d15de525534197960e9a9c64eba3ad2153aa113 Author: Szymon Kłos AuthorDate: Fri Nov 3 08:52:32 2023 +0100 Commit: Szymon Kłos CommitDate: Fri Nov 3 12:54:48 2023 +0100 lok: notebookbar: don't recreate toolbars too often commit 004512d87ab70587d95a708116a5c2f4b870565c notebookbar: allow to create multiple instances for online Changed SfxNotebookBar::StateMethod so in LOK case it always enter to the code block which is meant to be used for creating or reloading notebookbar. Change that so we check if notebookbar was initialized for given view already. Change-Id: Icfa1e572769043509479b7b98d055120ac3d1f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158872 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Szymon Kłos diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 0a21ffa98c8a..e9e85de271bd 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -377,11 +377,12 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, bool bChangedFile = sNewFile != sCurrentFile; +const SfxViewShell* pViewShell = SfxViewShell::Current(); +bool hasWeldedWrapper = m_pNotebookBarWeldedWrapper.find(pViewShell) != m_pNotebookBarWeldedWrapper.end(); + if ((!sFile.isEmpty() && bChangedFile) || !pNotebookBar || !pNotebookBar->IsVisible() -|| bReloadNotebookbar || comphelper::LibreOfficeKit::isActive()) +|| bReloadNotebookbar || (comphelper::LibreOfficeKit::isActive() && !hasWeldedWrapper)) { -const SfxViewShell* pViewShell = SfxViewShell::Current(); - // Notebookbar was loaded too early what caused: // * in LOK: Paste Special feature was incorrectly initialized // Skip first request so Notebookbar will be initialized after document was loaded @@ -418,8 +419,6 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, pNotebookBar = pSysWindow->GetNotebookBar(); pNotebookBar->Show(); - -bool hasWeldedWrapper = m_pNotebookBarWeldedWrapper.find(pViewShell) != m_pNotebookBarWeldedWrapper.end(); if ((!hasWeldedWrapper || bReloadNotebookbar) && pNotebookBar->IsWelded()) { sal_uInt64 nWindowId = reinterpret_cast(pViewShell);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/sfxbasemodel.cxx | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) New commits: commit dd278812a456148e6d4326f6013b738b48140bb0 Author: Mike Kaganski AuthorDate: Sat Oct 28 18:04:42 2023 +0300 Commit: Mike Kaganski CommitDate: Sat Oct 28 18:09:43 2023 +0200 Simplify a bit Change-Id: I50b7ec4a38a9489f2712bbe99fd3377c78f579b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158590 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 03a511fc2fe4..52436ef8d4d6 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3060,9 +3060,11 @@ void SfxBaseModel::impl_store( const OUString& sURL if( sURL.isEmpty() ) throw frame::IllegalArgumentIOException(); -bool bSaved = false; +if (!m_pData->m_pObjectShell) +return; + ::comphelper::SequenceAsHashMap aArgHash(seqArguments); -if ( !bSaveTo && m_pData->m_pObjectShell.is() && !sURL.isEmpty() +if ( !bSaveTo && !sURL.isEmpty() && !sURL.startsWith( "private:stream" ) && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) ) { @@ -3095,7 +3097,7 @@ void SfxBaseModel::impl_store( const OUString& sURL try { storeSelf( aArgHash.getAsConstPropertyValueList() ); -bSaved = true; +return; } catch( const lang::IllegalArgumentException& ) { @@ -3131,9 +3133,6 @@ void SfxBaseModel::impl_store( const OUString& sURL } } -if ( bSaved || !m_pData->m_pObjectShell.is() ) -return; - SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDoc : SfxEventHintId::SaveAsDoc, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ), m_pData->m_pObjectShell.get() ) );
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/sfxbasemodel.cxx | 106 --- 1 file changed, 56 insertions(+), 50 deletions(-) New commits: commit d2fccf0117a37f8aab8bb50ece419987f06af6b9 Author: Noel Grandin AuthorDate: Thu Oct 26 13:36:46 2023 +0200 Commit: Noel Grandin CommitDate: Thu Oct 26 19:02:53 2023 +0200 cool#6893 improve listeners in SfxBaseModel reduces CPU spent in UNO query'ing, and adds type-safety, which exposed a bug in SfxBaseModel::disposing Change-Id: I4b973f7dc38f491ce7a6281ad378e439b5450add Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158500 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b085342b1912..03a511fc2fe4 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -202,7 +203,13 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument OUString m_sURL ; OUString m_sRuntimeUID ; OUString m_aPreusedFilterName ; -comphelper::OMultiTypeInterfaceContainerHelper2 m_aInterfaceContainer; +comphelper::OInterfaceContainerHelper3 m_aPrintJobListeners; +comphelper::OInterfaceContainerHelper3 m_aEventListeners; +comphelper::OInterfaceContainerHelper3 m_aModifyListeners; +comphelper::OInterfaceContainerHelper3 m_aDocumentEventListeners1; +comphelper::OInterfaceContainerHelper3 m_aDocumentEventListeners2; +comphelper::OInterfaceContainerHelper3 m_aStorageChangeListeners; +comphelper::OInterfaceContainerHelper3 m_aCloseListeners; std::unordered_map, std::vector>> maShapeListeners; Reference< XInterface >m_xParent ; @@ -234,8 +241,14 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument IMPL_SfxBaseModel_DataContainer( ::osl::Mutex& rMutex, SfxObjectShell* pObjectShell ) : m_pObjectShell ( pObjectShell ) -, m_aInterfaceContainer ( rMutex) -, m_nControllerLockCount ( 0 ) +, m_aPrintJobListeners( rMutex) +, m_aEventListeners ( rMutex) +, m_aModifyListeners ( rMutex) +, m_aDocumentEventListeners1( rMutex ) +, m_aDocumentEventListeners2( rMutex ) +, m_aStorageChangeListeners ( rMutex ) +, m_aCloseListeners ( rMutex) +, m_nControllerLockCount ( 0 ) , m_bClosed ( false ) , m_bClosing ( false ) , m_bSaving ( false ) @@ -354,12 +367,9 @@ void SAL_CALL SfxPrintHelperListener_Impl::disposing( const lang::EventObject& ) void SAL_CALL SfxPrintHelperListener_Impl::printJobEvent( const view::PrintJobEvent& rEvent ) { -::comphelper::OInterfaceContainerHelper2* pContainer = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType::get()); -if ( pContainer!=nullptr ) +if ( m_pData->m_aPrintJobListeners.getLength() ) { -::comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); -while (pIterator.hasMoreElements()) - static_cast(pIterator.next())->printJobEvent( rEvent ); + m_pData->m_aPrintJobListeners.notifyEach(::XPrintJobListener::printJobEvent, rEvent); } } @@ -763,7 +773,13 @@ void SAL_CALL SfxBaseModel::dispose() } lang::EventObject aEvent( static_cast(this) ); -m_pData->m_aInterfaceContainer.disposeAndClear( aEvent ); +m_pData->m_aPrintJobListeners.disposeAndClear( aEvent ); +m_pData->m_aEventListeners.disposeAndClear( aEvent ); +m_pData->m_aModifyListeners.disposeAndClear( aEvent ); +m_pData->m_aDocumentEventListeners1.disposeAndClear( aEvent ); +m_pData->m_aDocumentEventListeners2.disposeAndClear( aEvent ); +m_pData->m_aStorageChangeListeners.disposeAndClear( aEvent ); +m_pData->m_aCloseListeners.disposeAndClear( aEvent ); m_pData->m_xDocumentProperties.clear(); @@ -790,7 +806,7 @@ void SAL_CALL SfxBaseModel::dispose() void SAL_CALL SfxBaseModel::addEventListener( const Reference< lang::XEventListener >& aListener ) { SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); -m_pData->m_aInterfaceContainer.addInterface( cppu::UnoType::get(), aListener ); +m_pData->m_aEventListeners.addInterface( aListener ); } @@ -800,7 +816,7 @@ void SAL_CALL SfxBaseModel::addEventListener( const Reference< lang::XEventListe void SAL_CALL SfxBaseModel::removeEventListener(
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/thumbnailviewacc.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit cee0425bf7377520845d7a32e8ccb4bc92f5d43d Author: Noel Grandin AuthorDate: Tue Oct 24 14:53:40 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 24 18:22:41 2023 +0200 suppress more IndexHint accessibility warning Change-Id: I45bc0bf74f4ebeeb4155006e67309cd476ebc3c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158388 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx index ac1e320be25b..0a0f843a52d2 100644 --- a/sfx2/source/control/thumbnailviewacc.cxx +++ b/sfx2/source/control/thumbnailviewacc.cxx @@ -520,6 +520,7 @@ void ThumbnailViewAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOld aEvtObject.Source = getXWeak(); aEvtObject.NewValue = rNewValue; aEvtObject.OldValue = rOldValue; +aEvtObject.IndexHint = -1; for (auto const& tmpListener : aTmpListeners) {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objserv.cxx |6 +++--- sfx2/source/doc/sfxbasemodel.cxx |5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) New commits: commit 2c213582376216eacb613e576314e0b9cba0aa04 Author: Mike Kaganski AuthorDate: Fri Oct 13 12:41:25 2023 +0300 Commit: Mike Kaganski CommitDate: Sat Oct 14 17:36:30 2023 +0200 Keep some information when switching between exceptions and ErrCodeMsg This simplifies debugging. Change-Id: I21ba175a039bed9a1f13d510b2c80eb6356417ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157908 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 7dddb84e5fac..fb62f3768163 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1109,11 +1109,11 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest ) catch( const task::ErrorCodeIOException& aErrorEx ) { TOOLS_WARN_EXCEPTION_IF(ErrCode(aErrorEx.ErrCode) != ERRCODE_IO_ABORT, "sfx.doc", "Fatal IO error during save"); -nErrorCode = ErrCode(aErrorEx.ErrCode); +nErrorCode = { ErrCode(aErrorEx.ErrCode), aErrorEx.Message }; } -catch( Exception& ) +catch( Exception& e ) { -nErrorCode = ERRCODE_IO_GENERAL; +nErrorCode = { ERRCODE_IO_GENERAL, e.Message }; } // by default versions should be preserved always except in case of an explicit diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index f4b1f8305588..99901fdac73f 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1697,8 +1697,7 @@ void SAL_CALL SfxBaseModel::storeSelf( constSequence< beans::PropertyValue > pParams.reset(); -ErrCodeMsg nErrCode = m_pData->m_pObjectShell->GetErrorIgnoreWarning() ? m_pData->m_pObjectShell->GetErrorIgnoreWarning() - : ERRCODE_IO_CANTWRITE; +ErrCodeMsg nErrCode = m_pData->m_pObjectShell->GetErrorIgnoreWarning(); m_pData->m_pObjectShell->ResetError(); if ( bRet ) @@ -1709,6 +1708,8 @@ void SAL_CALL SfxBaseModel::storeSelf( constSequence< beans::PropertyValue > } else { +if (!nErrCode) +nErrCode = ERRCODE_IO_CANTWRITE; // write the contents of the logger to the file SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocFailed, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objmisc.cxx | 49 1 file changed, 49 insertions(+) New commits: commit 0855520cced8662ba0a8cfdaccbe55a812b13c60 Author: Henry Castro AuthorDate: Wed Sep 6 10:30:27 2023 -0400 Commit: Henry Castro CommitDate: Mon Oct 9 19:52:30 2023 +0200 sfx2: invoke handler "LoadReadOnlyRequest" It will ask the user if open the Excel documents "read only" Signed-off-by: Henry Castro Change-Id: I909fb39709198e02496f8c522f477c077fb875e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156624 Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157730 Tested-by: Jenkins diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 69d0ac4b3bea..123d234734f7 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #include #include @@ -1098,6 +1099,54 @@ void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags ) bHasName = true; // the document is loaded, so the name should already available GetTitle( SFX_TITLE_DETECT ); InitOwnModel_Impl(); + +if (IsLoadReadonly()) +{ +OUString aFilterName; +if (const SfxStringItem* pFilterNameItem = +pMedium->GetItemSet().GetItem(SID_FILTER_NAME, false)) +aFilterName = pFilterNameItem->GetValue(); + +OUString aFileName; +if (const SfxStringItem* pFileNameItem = +pMedium->GetItemSet().GetItem(SID_FILE_NAME, false)) +{ +const INetURLObject aURL(pFileNameItem->GetValue()); +aFileName = aURL.getBase(INetURLObject::LAST_SEGMENT, true, + INetURLObject::DecodeMechanism::WithCharset); +} + +bool bSilent = false; +if (const SfxBoolItem* pSilentNameItem = +pMedium->GetItemSet().GetItem(SID_SILENT, false)) +bSilent = pSilentNameItem->GetValue(); + +if (!bSilent && aFilterName.indexOf("Excel") != -1) +{ +Reference xHandler(pMedium->GetInteractionHandler()); +if (xHandler.is()) +{ +beans::NamedValue aLoadReadOnlyRequest; +aLoadReadOnlyRequest.Name = "LoadReadOnlyRequest"; +aLoadReadOnlyRequest.Value <<= aFileName; + +Any aRequest(aLoadReadOnlyRequest); +rtl::Reference xRequest += new ucbhelper::SimpleInteractionRequest(aRequest, + ContinuationFlags::Approve | + ContinuationFlags::Disapprove); + +xHandler->handle(xRequest); + +if (xRequest->getResponse() == ContinuationFlags::Disapprove) +{ +SetSecurityOptOpenReadOnly(false); + pMedium->GetItemSet().Put(SfxBoolItem(SID_DOC_READONLY, false)); +} +} +} +} + pImpl->nFlagsInProgress &= ~SfxLoadedFlags::MAINDOCUMENT; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/commandpopup/CommandPopup.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 72d6287c586a2481c62bf21d88bb363ce584b8dd Author: Ilmari Lauhakangas AuthorDate: Sun Oct 8 22:34:15 2023 +0300 Commit: Ilmari Lauhakangas CommitDate: Mon Oct 9 17:47:34 2023 +0200 tdf#142524 Search Commands: use ▸ to indicate sequence Change-Id: I2a3a7c4db03dbfe53f2b71de7ee9b3df42a22866 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157689 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/sfx2/source/commandpopup/CommandPopup.cxx b/sfx2/source/commandpopup/CommandPopup.cxx index 8d68bd62bd76..0d948a4e84e6 100644 --- a/sfx2/source/commandpopup/CommandPopup.cxx +++ b/sfx2/source/commandpopup/CommandPopup.cxx @@ -51,6 +51,7 @@ MenuContentHandler::MenuContentHandler(uno::Reference const& xFra void MenuContentHandler::gatherMenuContent( uno::Reference const& xIndexAccess, MenuContent& rMenuContent) { +std::u16string_view aMenuLabelSeparator = AllSettings::GetLayoutRTL() ? u" ◂ " : u" ▸ "; for (sal_Int32 n = 0; n < xIndexAccess->getCount(); n++) { MenuContent aNewContent; @@ -85,7 +86,8 @@ void MenuContentHandler::gatherMenuContent( aNewContent.m_aMenuLabel = aLabel; if (!rMenuContent.m_aFullLabelWithPath.isEmpty()) -aNewContent.m_aFullLabelWithPath = rMenuContent.m_aFullLabelWithPath + " / "; +aNewContent.m_aFullLabelWithPath += rMenuContent.m_aFullLabelWithPath + aMenuLabelSeparator; aNewContent.m_aFullLabelWithPath += aNewContent.m_aMenuLabel; aNewContent.m_aSearchableMenuLabel = toLower(aNewContent.m_aFullLabelWithPath);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/SidebarController.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 6e6db2a3360d7ee89cae14cbcfe386e7425daf98 Author: Mihai Vasiliu AuthorDate: Thu Oct 5 16:28:02 2023 +0300 Commit: Caolán McNamara CommitDate: Fri Oct 6 10:43:03 2023 +0200 tdf#150639 Fix sidebar width too narrow The mnWidthOnSplitterButtonDown is initialized to 0 at program start. This makes every call to take the else case until the user manually changes the width, but some decks such as Master Slides have the mnMinimalWidth too low which makes them too narrow for the content they should display to the user. Change-Id: I8fc4924f70dedbdc8d162ceceb620ff80e59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157596 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 4798e1a33435..c6137d94d0e8 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -658,7 +658,12 @@ void SidebarController::OpenThenToggleDeck ( if(mnWidthOnSplitterButtonDown > 0 && mnWidthOnSplitterButtonDown > nRequestedWidth){ SetChildWindowWidth(mnWidthOnSplitterButtonDown); }else{ -SetChildWindowWidth(nRequestedWidth); +// tdf#150639 The mnWidthOnSplitterButtonDown is initialized to 0 at program start. +// This makes every call to take the else case until the user manually changes the +// width, but some decks such as Master Slides have the mnMinimalWidth too low which +// makes them too narrow for the content they should display to the user. +SetChildWindowWidth(nRequestedWidth > mnSavedSidebarWidth ? nRequestedWidth + : mnSavedSidebarWidth); } } }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/workwin.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2ecd4c009293f127ac09e5f4184330c4337cee49 Author: Miklos Vajna AuthorDate: Tue Oct 3 13:21:36 2023 +0200 Commit: Miklos Vajna CommitDate: Tue Oct 3 15:07:40 2023 +0200 sfx2: fix gcc dbgutil -Werror=unused-variable /home/vmiklos/git/libreoffice/master/sfx2/source/appl/workwin.cxx: In member function ‘void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16, bool)’: /home/vmiklos/git/libreoffice/master/sfx2/source/appl/workwin.cxx:1861:27: error: unused variable ‘pCW’ [-Werror=unused-variable] 1861 | if (SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId)) | ^~~ /home/vmiklos/git/libreoffice/master/sfx2/source/appl/workwin.cxx: In member function ‘void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16, bool, bool)’: /home/vmiklos/git/libreoffice/master/sfx2/source/appl/workwin.cxx:1990:27: error: unused variable ‘pCW’ [-Werror=unused-variable] 1990 | if (SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId)) | ^~~ Change-Id: Iecc60032459ca8a6543f3836f17b76b25939cda9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157516 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 9a4de102bb88..aadc401a8ee1 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1858,7 +1858,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus) } #ifdef DBG_UTIL -if (SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId)) +if (Get_BySaveId(aChildWins, nId)) { OSL_FAIL("The ChildWindow is not in context!"); } @@ -1987,7 +1987,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe } #ifdef DBG_UTIL -if (SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId)) +if (Get_BySaveId(aChildWins, nId)) { OSL_FAIL("The ChildWindow is not in context!"); }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/workwin.cxx | 135 --- 1 file changed, 28 insertions(+), 107 deletions(-) New commits: commit c5574385303a86b6f65002d6bc4ff074f9e84d49 Author: Mike Kaganski AuthorDate: Mon Oct 2 19:36:41 2023 +0300 Commit: Mike Kaganski CommitDate: Mon Oct 2 22:06:12 2023 +0200 Deduplicate and simplify some SfxWorkWindow methods Change-Id: Ibd7153454f1efd1d311ac99b9c2529958f4ca3e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157500 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 60d900ccb026..9a4de102bb88 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1748,24 +1748,26 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, } } +namespace +{ +template +SfxChildWin_Impl* Get_Impl(const std::vector>& rChildWins, + sal_uInt16 nId) +{ +for (auto& pChildWin : rChildWins) +if (pChildWin.get()->*Member == nId) +return pChildWin.get(); +return nullptr; +} +auto Get_ById = Get_Impl<_Impl::nId>; +auto Get_BySaveId = Get_Impl<_Impl::nSaveId>; +} void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, bool bEnabled, SfxVisibilityFlags nMode ) { sal_uInt16 nId = static_cast( lId & 0x ); -SfxChildWin_Impl *pCW=nullptr; - -if ( !pCW ) -{ -// If no Parent or the Parent us still unknown, then search here -sal_uInt16 nCount = aChildWins.size(); -for (sal_uInt16 n=0; nnSaveId == nId) -{ -pCW = aChildWins[n].get(); -break; -} -} +SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId); if ( !pCW ) { @@ -1787,16 +1789,9 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, bool bEnabled, S void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus) { -sal_uInt16 nCount = aChildWins.size(); -sal_uInt16 n; -for (n=0; nnId == nId) -break; - -if ( npWin; bool bCreationAllowed( true ); @@ -1863,12 +1858,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus) } #ifdef DBG_UTIL -nCount = aChildWins.size(); -for (n=0; nnSaveId == nId) -break; - -if ( n < nCount ) +if (SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId)) { OSL_FAIL("The ChildWindow is not in context!"); } @@ -1882,37 +1872,15 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus) bool SfxWorkWindow::HasChildWindow_Impl(sal_uInt16 nId) { -sal_uInt16 nCount = aChildWins.size(); -sal_uInt16 n; -for (n=0; nnSaveId == nId) -break; - -if (npWin; -return ( pChild && pCW->bCreate ); -} +if (const SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId)) +return ( pCW->pWin && pCW->bCreate ); return false; } bool SfxWorkWindow::IsFloating( sal_uInt16 nId ) { -SfxChildWin_Impl *pCW=nullptr; - -if ( !pCW ) -{ -// If no Parent or the Parent us still unknown, then search here -sal_uInt16 nCount = aChildWins.size(); -for (sal_uInt16 n=0; nnSaveId == nId) -{ -pCW = aChildWins[n].get(); -break; -} -} +SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId); if ( !pCW ) { @@ -1936,17 +1904,7 @@ bool SfxWorkWindow::IsFloating( sal_uInt16 nId ) bool SfxWorkWindow::KnowsChildWindow_Impl(sal_uInt16 nId) { -SfxChildWin_Impl *pCW=nullptr; -sal_uInt16 nCount = aChildWins.size(); -sal_uInt16 n; -for (n=0; nnSaveId == nId) - break; -} - -if (naInfo.nFlags & SfxChildWindowFlags::ALWAYSAVAILABLE) && !IsVisible_Impl( pCW->nVisibility ) ) return false; @@ -1959,21 +1917,7 @@ bool SfxWorkWindow::KnowsChildWindow_Impl(sal_uInt16 nId) void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, bool bOn, bool bSetFocus) { -SfxChildWin_Impl *pCW=nullptr; -SfxWorkWindow *pWork = nullptr; - -if ( !pCW ) -{ -// If no Parent or the Parent us still unknown, then search here -sal_uInt16 nCount = aChildWins.size(); -for (sal_uInt16 n=0; nnSaveId == nId) -{ -pCW = aChildWins[n].get(); -pWork = this; -break; -} -} +SfxChildWin_Impl* pCW = Get_BySaveId(aChildWins, nId); if ( !pCW ) { @@ -1981,29 +1925,17 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, bool bOn, bool bSetFocus // the Parent pCW = new SfxChildWin_Impl( nId ); InitializeChild_Impl( pCW ); -if ( !pWork || pCW->aInfo.nFlags & SfxChildWindowFlags::TASK ) -pWork = this; -pWork->aChildWins.push_back( std::unique_ptr(pCW) ); +aChildWins.push_back(
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objserv.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 4c76b9568a3d008219a3dc0818f2f6db2939e354 Author: Szymon Kłos AuthorDate: Mon Sep 11 12:54:34 2023 +0200 Commit: Szymon Kłos CommitDate: Mon Sep 18 16:28:18 2023 +0200 lok: don't convert save request to save as Don't force save as in LOK but report that file cannot be written. Without that we go through save as process which is used for export functionality and client's browser downloads the file in the end instead of uploading to the storage. Signed-off-by: Szymon Kłos Change-Id: I2784bfc25055934363c304b5f5a87ae4da620a4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156819 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157021 Tested-by: Jenkins diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index a9c39b006564..6308de92e3c6 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1039,6 +1039,17 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest ) aDispatchArgs ); bool bForceSaveAs = nId == SID_SAVEDOC && IsReadOnlyMedium(); + +if (comphelper::LibreOfficeKit::isActive() && bForceSaveAs) +{ +// Don't force save as in LOK but report that file cannot be written +// to avoid confusion with exporting for file download purpose + +throw task::ErrorCodeIOException( +"SfxObjectShell::ExecFile_Impl: ERRCODE_IO_CANTWRITE", +uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_CANTWRITE)); +} + const SfxSlot* pSlot = GetModule()->GetSlotPool()->GetSlot( bForceSaveAs ? SID_SAVEASDOC : nId ); if ( !pSlot ) throw uno::Exception("no slot", nullptr);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/dispatch.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d57861bc1526122024a8f8d9051582ca22e1d7be Author: Noel Grandin AuthorDate: Fri Sep 1 13:34:53 2023 +0200 Commit: Noel Grandin CommitDate: Fri Sep 1 18:47:29 2023 +0200 SAL_WARN->SAL_INFO in SfxDispatcher nobody cares if child window slot is missing Change-Id: I24978daa9a2770e8f0bd44b5b816f94b8d01da0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156407 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index f7ff0b75e4ec..af57a5e3ab2f 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1208,7 +1208,7 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne { sal_uInt32 nId = pIFace->GetChildWindowId(nNo); const SfxSlot *pSlot = pSlotPool->GetSlot( static_cast(nId) ); -SAL_WARN_IF( !pSlot, "sfx.control", "Childwindow slot missing: " << nId ); +SAL_INFO_IF( !pSlot, "sfx.control", "Childwindow slot missing: " << nId ); if ( bReadOnlyShell ) { // only show ChildWindows if their slot is allowed for readonly documents
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/StyleList.cxx | 59 ++- 1 file changed, 16 insertions(+), 43 deletions(-) New commits: commit ff66803ec9ec26c918ef652a1478ff9d7da0c97b Author: Noel Grandin AuthorDate: Fri Sep 1 09:52:30 2023 +0200 Commit: Noel Grandin CommitDate: Fri Sep 1 12:33:31 2023 +0200 Revert "tdf#100894 lots of Conditional formatting freeze calc Styles sidebar" This reverts commit 6fd755fb36472938757b2581cbe99f5e5fe1ae40. This causes tdf#157021, so revert until Caolán can look into it some more Change-Id: I4e25c72988468015ee3a76baf8ecdafc72c79d7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156376 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index b8faf8e79a88..b9f9c0c62237 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -735,40 +735,21 @@ static void lcl_Insert(weld::TreeView& rTreeView, const OUString& rName, SfxStyl rTreeView.insert(pParent, -1, , , nullptr, xDevice.get(), false, pRet); } -static void FillBox_Impl1(weld::TreeView& rBox, StyleTree_Impl* pEntry, SfxStyleFamily eStyleFamily, - const weld::TreeIter* pParent, SfxViewShell* pViewShell) +static void FillBox_Impl(weld::TreeView& rBox, StyleTree_Impl* pEntry, + const std::vector& rEntries, SfxStyleFamily eStyleFamily, + const weld::TreeIter* pParent, bool blcl_insert, SfxViewShell* pViewShell) { std::unique_ptr xResult = rBox.make_iterator(); const OUString& rName = pEntry->getName(); -lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), pViewShell); +if (blcl_insert) +lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), pViewShell); +else +rBox.insert(pParent, -1, , , nullptr, nullptr, false, xResult.get()); for (size_t i = 0; i < pEntry->getChildren().size(); ++i) -FillBox_Impl1(rBox, pEntry->getChildren()[i].get(), eStyleFamily, xResult.get(), - pViewShell); -} - -static void FillBox_Impl2(weld::TreeView& rBox, StyleTreeArr_Impl& rTreeArr, - const weld::TreeIter* pParent) -{ -rBox.bulk_insert_for_each(rTreeArr.size(), - [, ](weld::TreeIter& rIter, int nSourceIndex) { - const OUString& rName = rTreeArr[nSourceIndex]->getName(); - rBox.set_text(rIter, rName, 0); - rBox.set_id(rIter, rName); - }, - pParent); - -for (size_t i = 0; i < rTreeArr.size(); ++i) -{ -StyleTreeArr_Impl& rChildren = rTreeArr[i]->getChildren(); -if (rChildren.size()) -{ -std::unique_ptr iter = rBox.make_iterator(pParent); -rBox.iter_nth_child(*iter, i); -FillBox_Impl2(rBox, rChildren, iter.get()); -} -} +FillBox_Impl(rBox, pEntry->getChildren()[i].get(), rEntries, eStyleFamily, xResult.get(), + blcl_insert, pViewShell); } namespace SfxTemplate @@ -1064,17 +1045,13 @@ void StyleList::FillTreeBox(SfxStyleFamily eFam) bool blcl_insert = pViewShell && m_bModuleHasStylesHighlighterFeature && ((eFam == SfxStyleFamily::Para && m_bHighlightParaStyles) || (eFam == SfxStyleFamily::Char && m_bHighlightCharStyles)); -if (blcl_insert) -{ -for (sal_uInt16 i = 0; i < nCount; ++i) -FillBox_Impl1(*m_xTreeBox, aArr[i].get(), eFam, nullptr, pViewShell); -} -else -{ -FillBox_Impl2(*m_xTreeBox, aArr, nullptr); -} + for (sal_uInt16 i = 0; i < nCount; ++i) +{ +FillBox_Impl(*m_xTreeBox, aArr[i].get(), aEntries, eFam, nullptr, blcl_insert, pViewShell); aArr[i].reset(); +} + m_xTreeBox->columns_autosize(); m_pParentDialog->EnableItem("watercan", false); @@ -1270,12 +1247,8 @@ void StyleList::UpdateStyles(StyleFlags nFlags) } else { -m_xFmtLb->bulk_insert_for_each(nCount, - [, this](weld::TreeIter& rIter, int nSourceIndex) { - const OUString& rName = aStrings[nSourceIndex]; - m_xFmtLb->set_text(rIter, rName, 0); - m_xFmtLb->set_id(rIter, rName); - }); +for (nPos = 0; nPos < nCount; ++nPos) +m_xFmtLb->append(aStrings[nPos], aStrings[nPos]); } m_xFmtLb->columns_autosize();
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/charwin.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit d88779fc86385dde1215fd28b78a69eacc6b4f97 Author: Jim Raykowski AuthorDate: Thu Aug 31 10:06:21 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Sep 1 00:37:22 2023 +0200 tdf#156538 follow up: Use better tooltip activation rectangle This patch corrects the tooltip only being shown when the mouse pointer is in the top third of the window when using gtk3. Change-Id: I9d705c064bc4654ed660842215ffd59edc14891b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156358 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx index 999aa2e4a95d..475583c890b0 100644 --- a/sfx2/source/control/charwin.cxx +++ b/sfx2/source/control/charwin.cxx @@ -102,10 +102,9 @@ OUString SvxCharView::GetCharInfoText() OUString SvxCharView::RequestHelp(tools::Rectangle& rHelpRect) { -OUString sCharInfoText(GetCharInfoText()); -// Gtk3 requires a help rectangle be supplied for the tooltip to display, X11 does not. -mxVirDev->GetTextBoundRect(rHelpRect, sCharInfoText); -return sCharInfoText; +// Gtk3 requires a rectangle be specified for the tooltip to display, X11 does not. +rHelpRect = tools::Rectangle(Point(), GetOutputSizePixel()); +return GetCharInfoText(); } bool SvxCharView::MouseButtonDown(const MouseEvent& rMEvt)
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/Metadatable.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1eb683b6aff38d9b8226268f428600fa0d3ed58f Author: Julien Nabet AuthorDate: Mon Aug 28 14:50:38 2023 +0200 Commit: Julien Nabet CommitDate: Mon Aug 28 16:54:30 2023 +0200 incorrect usage of erase..remove idiom since commit 66a33ea9ef0ede9c90714455e6ad46197425f075 Replace list by vector in Metadatable (sfx2) Change-Id: I707dd27be91711e4f80d39c620a3b9784b5ef122 Reviewed-on: https://gerrit.libreoffice.org/43376 Tested-by: Jenkins Reviewed-by: Julien Nabet Tested-by: Julien Nabet Change-Id: I9be82687cc9d7302e5d0ebc7bb52bac74540ce50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156199 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 8360c3634089..493491a9f7c4 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -488,7 +488,7 @@ rmIter(XmlIdMap_t & i_rXmlIdMap, XmlIdMap_t::iterator const& i_rIter, { XmlIdVector_t & rVector( isContentFile(i_rStream) ? i_rIter->second.first : i_rIter->second.second ); -rVector.erase(std::remove(rVector.begin(), rVector.end(), _cast(i_rObject))); +rVector.erase(std::remove(rVector.begin(), rVector.end(), _cast(i_rObject)), rVector.end()); if (i_rIter->second.first.empty() && i_rIter->second.second.empty()) { i_rXmlIdMap.erase(i_rIter);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/StyleList.cxx | 59 --- 1 file changed, 43 insertions(+), 16 deletions(-) New commits: commit 6fd755fb36472938757b2581cbe99f5e5fe1ae40 Author: Noel Grandin AuthorDate: Tue Aug 22 14:44:38 2023 +0200 Commit: Noel Grandin CommitDate: Wed Aug 23 18:25:04 2023 +0200 tdf#100894 lots of Conditional formatting freeze calc Styles sidebar use bulk_insert_for_each to reduce time spent adding to treebox Takes it from "who knows, I gave up", to about 10 seconds on my machine Change-Id: I7cfa88c7378007f4f27c7177d1f7509656e4052a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155951 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index b9f9c0c62237..b8faf8e79a88 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -735,21 +735,40 @@ static void lcl_Insert(weld::TreeView& rTreeView, const OUString& rName, SfxStyl rTreeView.insert(pParent, -1, , , nullptr, xDevice.get(), false, pRet); } -static void FillBox_Impl(weld::TreeView& rBox, StyleTree_Impl* pEntry, - const std::vector& rEntries, SfxStyleFamily eStyleFamily, - const weld::TreeIter* pParent, bool blcl_insert, SfxViewShell* pViewShell) +static void FillBox_Impl1(weld::TreeView& rBox, StyleTree_Impl* pEntry, SfxStyleFamily eStyleFamily, + const weld::TreeIter* pParent, SfxViewShell* pViewShell) { std::unique_ptr xResult = rBox.make_iterator(); const OUString& rName = pEntry->getName(); -if (blcl_insert) -lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), pViewShell); -else -rBox.insert(pParent, -1, , , nullptr, nullptr, false, xResult.get()); +lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), pViewShell); for (size_t i = 0; i < pEntry->getChildren().size(); ++i) -FillBox_Impl(rBox, pEntry->getChildren()[i].get(), rEntries, eStyleFamily, xResult.get(), - blcl_insert, pViewShell); +FillBox_Impl1(rBox, pEntry->getChildren()[i].get(), eStyleFamily, xResult.get(), + pViewShell); +} + +static void FillBox_Impl2(weld::TreeView& rBox, StyleTreeArr_Impl& rTreeArr, + const weld::TreeIter* pParent) +{ +rBox.bulk_insert_for_each(rTreeArr.size(), + [, ](weld::TreeIter& rIter, int nSourceIndex) { + const OUString& rName = rTreeArr[nSourceIndex]->getName(); + rBox.set_text(rIter, rName, 0); + rBox.set_id(rIter, rName); + }, + pParent); + +for (size_t i = 0; i < rTreeArr.size(); ++i) +{ +StyleTreeArr_Impl& rChildren = rTreeArr[i]->getChildren(); +if (rChildren.size()) +{ +std::unique_ptr iter = rBox.make_iterator(pParent); +rBox.iter_nth_child(*iter, i); +FillBox_Impl2(rBox, rChildren, iter.get()); +} +} } namespace SfxTemplate @@ -1045,13 +1064,17 @@ void StyleList::FillTreeBox(SfxStyleFamily eFam) bool blcl_insert = pViewShell && m_bModuleHasStylesHighlighterFeature && ((eFam == SfxStyleFamily::Para && m_bHighlightParaStyles) || (eFam == SfxStyleFamily::Char && m_bHighlightCharStyles)); - -for (sal_uInt16 i = 0; i < nCount; ++i) +if (blcl_insert) { -FillBox_Impl(*m_xTreeBox, aArr[i].get(), aEntries, eFam, nullptr, blcl_insert, pViewShell); -aArr[i].reset(); +for (sal_uInt16 i = 0; i < nCount; ++i) +FillBox_Impl1(*m_xTreeBox, aArr[i].get(), eFam, nullptr, pViewShell); } - +else +{ +FillBox_Impl2(*m_xTreeBox, aArr, nullptr); +} +for (sal_uInt16 i = 0; i < nCount; ++i) +aArr[i].reset(); m_xTreeBox->columns_autosize(); m_pParentDialog->EnableItem("watercan", false); @@ -1247,8 +1270,12 @@ void StyleList::UpdateStyles(StyleFlags nFlags) } else { -for (nPos = 0; nPos < nCount; ++nPos) -m_xFmtLb->append(aStrings[nPos], aStrings[nPos]); +m_xFmtLb->bulk_insert_for_each(nCount, + [, this](weld::TreeIter& rIter, int nSourceIndex) { + const OUString& rName = aStrings[nSourceIndex]; + m_xFmtLb->set_text(rIter, rName, 0); + m_xFmtLb->set_id(rIter, rName); + }); } m_xFmtLb->columns_autosize();
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/lokhelper.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 20f6e960cda073012a56597bf6544524240ce246 Author: Miklos Vajna AuthorDate: Thu Aug 17 08:24:05 2023 +0200 Commit: Miklos Vajna CommitDate: Fri Aug 18 13:25:13 2023 +0200 sfx2: fix crash in SfxLokHelper::notifyOtherView() Crashreport signature: Fatal signal received: SIGSEGV code: 1 for address: 0x0 program/libmergedlo.so SfxLokHelper::notifyOtherView(SfxViewShell const*, SfxViewShell const*, int, boost::property_tree::basic_ptree > const&) sfx2/source/view/lokhelper.cxx:473 program/libmergedlo.so ImpEditView::ShowCursor(bool, bool) editeng/source/editeng/impedit.cxx:1423 program/../program/libsclo.so ScViewData::SetEditEngine(ScSplitPos, ScEditEngineDefaulter*, vcl::Window*, short, int) sc/source/ui/view/viewdata.cxx:1635 program/libsclo.so ScTabView::UpdateEditView() sc/source/ui/view/tabview3.cxx:2190 Change-Id: I219a1e9685db9bc3ea03d6ab67ff5db74aac9343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155823 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index a6d9ef825e35..5bf6e8a1a2c4 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -463,7 +463,7 @@ void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell c int nType, const boost::property_tree::ptree& rTree) { assert(pThisView != nullptr && "pThisView must be valid"); -if (DisableCallbacks::disabled()) +if (DisableCallbacks::disabled() || !pOtherView) return; const int viewId = SfxLokHelper::getView(pThisView);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ab4f4c9d5c621286cca38d103fe16ecaa4b649ab Author: Andrea Gelmini AuthorDate: Sat Aug 12 21:37:58 2023 +0200 Commit: Julien Nabet CommitDate: Sun Aug 13 11:11:32 2023 +0200 Fix typo Change-Id: I7e716a9a9c93b848a332c782f75db8e02f034416 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155642 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 18208bb8e919..b4935b0d0ca8 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -616,7 +616,7 @@ int LOKDocumentFocusListener::getCaretPosition() const // is skipped until the composition is over. // On the contrary the composition would be aborted, making dictation not possible. // Anyway when the text change has been performed by another view we are in due -// to upadate the clipboard content even if the user is in the middle of a composition. +// to update the clipboard content even if the user is in the middle of a composition. void LOKDocumentFocusListener::notifyFocusedParagraphChanged(bool force) { aboutView("LOKDocumentFocusListener::notifyFocusedParagraphChanged", this, m_pViewShell);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx | 54 ++-- 1 file changed, 32 insertions(+), 22 deletions(-) New commits: commit 166d3f204aad40f2cd023e4860200182dbe48d8f Author: Marco Cecchetti AuthorDate: Mon Jul 10 17:26:52 2023 +0200 Commit: Miklos Vajna CommitDate: Fri Aug 11 22:06:28 2023 +0200 Get LOKDocumentFocusListener to handle enable/disable a11y properly This patch fix the following problems: - Remove all children when accessibility is disabled - Update the currently focused paragraph when accessibility is enabled Change-Id: Ib65a14052ee8e0f965c0546897fd67641bba50ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155576 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index f204b03c3721..18208bb8e919 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -520,20 +520,23 @@ public: /// @throws lang::IndexOutOfBoundsException /// @throws uno::RuntimeException void detachRecursive( -const uno::Reference< accessibility::XAccessible >& xAccessible +const uno::Reference< accessibility::XAccessible >& xAccessible, +bool bForce = false ); /// @throws lang::IndexOutOfBoundsException /// @throws uno::RuntimeException void detachRecursive( -const uno::Reference< accessibility::XAccessibleContext >& xContext +const uno::Reference< accessibility::XAccessibleContext >& xContext, +bool bForce = false ); /// @throws lang::IndexOutOfBoundsException /// @throws uno::RuntimeException void detachRecursive( const uno::Reference< accessibility::XAccessibleContext >& xContext, -const sal_Int64 nStateSet +const sal_Int64 nStateSet, +bool bForce = false ); /// @throws lang::IndexOutOfBoundsException @@ -1030,25 +1033,30 @@ void LOKDocumentFocusListener::attachRecursive( { // Usually, when the document is loaded, a CARET_CHANGED accessibility event is automatically emitted // for the first paragraph. That allows to notify the paragraph content to the client, even if no input -// event occurred yet. However, in Cypress tests no accessibility event is automatically emitted until -// some input event occurs. So we use the following workaround to notify the content of the focused -// paragraph, without waiting for an input event. +// event occurred yet. However, when switching to a11y enabled in the client and in Cypress tests +// no accessibility event is automatically emitted until some input event occurs. +// So we use the following workaround to notify the content of the focused paragraph, +// without waiting for an input event. // Here we update the paragraph info related to the focused paragraph, // later when afterCallbackRegistered is executed we notify the paragraph content. sal_Int64 nChildCount = xContext->getAccessibleChildCount(); if (nChildCount > 0) { -uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild( 0 ) ); -if( xChild.is() ) +for (sal_Int64 n = 0; n < nChildCount; ++n) { -uno::Reference xAccText(xChild, uno::UNO_QUERY); -if (xAccText.is()) +uno::Reference< accessibility::XAccessible > xChild(xContext->getAccessibleChild(n)); +if (xChild.is()) { -sal_Int32 nPos = xAccText->getCaretPosition(); -if (nPos >= 0) +uno::Reference xAccText(xChild, uno::UNO_QUERY); +if (xAccText.is()) { -attachRecursive(xChild); -updateParagraphInfo(xAccText, false, "LOKDocumentFocusListener::attachRecursive(3)"); +sal_Int32 nPos = xAccText->getCaretPosition(); +if (nPos >= 0) +{ +attachRecursive(xChild); +updateParagraphInfo(xAccText, false, "LOKDocumentFocusListener::attachRecursive(3)"); +break; +} } } } @@ -1058,18 +1066,20 @@ void LOKDocumentFocusListener::attachRecursive( } void LOKDocumentFocusListener::detachRecursive( -const uno::Reference< accessibility::XAccessible >& xAccessible +const uno::Reference< accessibility::XAccessible >& xAccessible, +bool bForce ) { uno::Reference< accessibility::XAccessibleContext > xContext =
[Libreoffice-commits] core.git: sfx2/source sot/source starmath/source
sfx2/source/doc/graphhelp.cxx|2 +- sot/source/sdstor/stgstrms.cxx |4 ++-- sot/source/sdstor/ucbstorage.cxx |4 ++-- starmath/source/mathtype.cxx |2 +- 4 files changed, 6 insertions(+), 6 deletions(-) New commits: commit da54fbce1c9101925059b980a0d9fe441bf0461f Author: Noel Grandin AuthorDate: Wed Aug 9 16:38:55 2023 +0200 Commit: Noel Grandin CommitDate: Wed Aug 9 20:06:54 2023 +0200 use sal_uInt64 when dealing with stream position Change-Id: I2869e115941b3e1f52911d58d54ec1b2831d0524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155524 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 754d5692f8c7..7cfdf76fe60f 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -116,7 +116,7 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co pStream.Flush(); if ( !nFailed ) { -sal_Int32 nLength = pStream.TellEnd(); +sal_uInt64 nLength = pStream.TellEnd(); if ( nLength > 22 ) { HMETAFILE hMeta = SetMetaFileBitsEx( nLength - 22, diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index b58c2a7922d9..61682ead8ab0 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1300,8 +1300,8 @@ std::size_t StgTmpStrm::GetData( void* pData, std::size_t n ) std::size_t StgTmpStrm::PutData( const void* pData, std::size_t n ) { -sal_uInt32 nCur = Tell(); -sal_uInt32 nNew = nCur + n; +sal_uInt64 nCur = Tell(); +sal_uInt64 nNew = nCur + n; if( nNew > THRESHOLD && !m_pStrm ) { SetSize( nNew ); diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 8ded02a7b139..fa203acc1178 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -253,9 +253,9 @@ sal_Int64 SAL_CALL FileStreamWrapper_Impl::getPosition( ) std::scoped_lock aGuard( m_aMutex ); checkConnected(); -sal_uInt32 nPos = m_pSvStream->Tell(); +sal_uInt64 nPos = m_pSvStream->Tell(); checkError(); -return static_cast(nPos); +return nPos; } diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 56a666b969f3..aca49f034ad0 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -1915,7 +1915,7 @@ bool MathType::ConvertFromStarMath( SfxMedium& rMedium ) pS->WriteUChar( 0x01 ); pS->WriteUChar( 0x03 ); pS->WriteUChar( 0x00 ); -sal_uInt32 nSize = pS->Tell(); +sal_uInt64 nSize = pS->Tell(); nPendingAttributes=0; HandleNodes(pTree, 0);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/FocusManager.cxx | 42 --- 1 file changed, 29 insertions(+), 13 deletions(-) New commits: commit 383e68da6c429c243c1e7be6699acaa942b712bc Author: Jim Raykowski AuthorDate: Mon Aug 7 21:20:04 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Aug 8 21:21:03 2023 +0200 tdf#125797 Sidebar: Skip over disabled tabbar tabs This patch makes keyboard navigation of the sidebar tabbar skip over disabled tabs. Tabs become disabled when a document is set in read- only mode. They can also be disabled by user customization of the tabbar. Change-Id: Iafabfe27fbeaea60acf66527eafbb5396edaf647 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155442 Tested-by: Jenkins Reviewed-by: Rafael Lima diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index ee03a52a3c17..74a3a1ef0ff3 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -380,9 +380,19 @@ bool FocusManager::HandleKeyEvent( case PC_DeckToolBox: { -// Moves to the first deck activation button that is visible -sal_Int32 nIndex(1); -while(!maButtons[nIndex]->get_visible() && ++nIndex > 0); +// Moves to the first deck activation button that is visible and sensitive +sal_Int32 nIndex(0); +sal_Int32 nButtons(maButtons.size()); +if (nButtons > 1) +{ +nIndex = 1; +// Finds the next visible button that is sensitive +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && ++nIndex < nButtons); +// Wrap to the menu button when going past the last button +if (nIndex >= nButtons) +nIndex = 0; +} FocusButton(nIndex); bConsumed = true; } @@ -420,9 +430,10 @@ bool FocusManager::HandleKeyEvent( FocusDeckTitle(); else { -// Focus the last button. +// Set focus to the last visible sensitive button. sal_Int32 nIndex(maButtons.size()-1); -while(!maButtons[nIndex]->get_visible() && --nIndex > 0); +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && --nIndex > 0); FocusButton(nIndex); } bConsumed = true; @@ -439,8 +450,9 @@ bool FocusManager::HandleKeyEvent( else nIndex = aLocation.mnIndex - 1; -// Finds the previous visible button -while(!maButtons[nIndex]->get_visible() && --nIndex > 0); +// Finds the previous visible sensitive button +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && --nIndex > 0); FocusButton(nIndex); bConsumed = true; } @@ -470,14 +482,18 @@ bool FocusManager::HandleKeyEvent( if (rKeyCode.GetCode() == KEY_RIGHT) break; -sal_Int32 nIndex; -if (o3tl::make_unsigned(aLocation.mnIndex) >= maButtons.size() - 1) +sal_Int32 nButtons(maButtons.size()); + +sal_Int32 nIndex = aLocation.mnIndex + 1; +if (nIndex >= nButtons) nIndex = 0; -else -nIndex = aLocation.mnIndex + 1; -// Finds the next visible button -while(!maButtons[nIndex]->get_visible() && ++nIndex > 0); +// Finds the next visible sensitive button +while((!maButtons[nIndex]->get_visible() || + !maButtons[nIndex]->get_sensitive()) && ++nIndex < nButtons); +// Wrap to the menu button when going past the last button +if (nIndex >= nButtons) +nIndex = 0; FocusButton(nIndex); bConsumed = true; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/infobar.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 06f5e9160c0adfbaf60dadbb2751ec32163a5914 Author: Andrea Gelmini AuthorDate: Mon Jul 24 22:41:11 2023 +0200 Commit: Julien Nabet CommitDate: Sat Aug 5 10:17:10 2023 +0200 Fix typo Change-Id: Ic705d2b943b84a7589f4b2c7389a4a034b03770f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154877 Tested-by: Jenkins Reviewed-by: Patrick Luby Reviewed-by: Julien Nabet diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index 778b5e9b140e..2ab8704c1da4 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -114,8 +114,8 @@ void SfxInfoBarWindow::SetCloseButtonImage() drawinglayer::primitive2d::Primitive2DContainer aSeq(2); -// Draw backround. The right and bottom need to be extended by 1 or -// there will be a white line on both edges. +// Draw background. The right and bottom need to be extended by 1 or +// there will be a white line on both edges when Skia is enabled. B2DPolygon aPolygon; aPolygon.append(B2DPoint(aRect.Left(), aRect.Top())); aPolygon.append(B2DPoint(aRect.Right() + 1, aRect.Top()));
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/FocusManager.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fc3f787af1883ff05768c6975e7db126491adab4 Author: Andrea Gelmini AuthorDate: Sat Aug 5 04:35:49 2023 +0200 Commit: Julien Nabet CommitDate: Sat Aug 5 10:16:39 2023 +0200 Fix typo Change-Id: Iea0d313fd641927eb83f11364a0ea690e3e4c635 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155365 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index 75622cde0ae3..ee03a52a3c17 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -224,7 +224,7 @@ void FocusManager::FocusPanel ( } // Fallback to deck title should only be applicable when there is more than one panel, // or else it will never be possible to enter the panel contents when there's a single panel -// withouth a titlebar and expander +// without a titlebar and expander else if (bFallbackToDeckTitle && maPanels.size() > 1) { // The panel title is not visible, fall back to the deck
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/FocusManager.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit e2db54b9bf48b79802154d5fc9460fc432ea69a0 Author: Jim Raykowski AuthorDate: Thu Aug 3 21:26:44 2023 -0800 Commit: Jim Raykowski CommitDate: Fri Aug 4 18:24:16 2023 +0200 tdf#156557 Sidebar: Make Shift+Tab kb navigation behave as expected This patch makes Shift+Tab change keyboard focus to the last panel control of the previous panel when focus is currently on a panel title. It also makes Shift+Tab change keyboard focus to the Tabbar hamburger menu when focus is currently on the "Close Sidebar Deck" button. Change-Id: I3ff849655afc4f01dba2268055292eee573adf43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155333 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index d0c38461b9ae..b77d30a75ba3 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -297,6 +297,11 @@ bool FocusManager::MoveFocusInsideDeckTitle ( FocusPanelContent(0); bConsumed = true; } +else if (nDirection < 0) +{ +FocusButton(0); +bConsumed = true; +} break; default: break; @@ -369,6 +374,8 @@ bool FocusManager::HandleKeyEvent( { case PC_PanelTitle: case PC_PanelToolBox: +if (rKeyCode.IsShift()) +break; MoveFocusInsidePanel(aLocation, nDirection); bConsumed = true; break;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/lokhelper.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3bf0f056eb7eba1f3569f95731e1014384fc53dd Author: Miklos Vajna AuthorDate: Wed Aug 2 10:12:39 2023 +0200 Commit: Miklos Vajna CommitDate: Thu Aug 3 09:01:05 2023 +0200 sfx2: fix crash in SfxLokHelper::notifyOtherViews() Crashreport signature: program/libmergedlo.so SfxLokHelper::notifyOtherViews(SfxViewShell const*, int, boost::property_tree::basic_ptree > const&) sfx2/source/view/lokhelper.cxx:518 program/libmergedlo.so ImpEditView::ShowCursor(bool, bool) editeng/source/editeng/impedit.cxx:1447 program/libsclo.so ScViewData::SetEditEngine(ScSplitPos, ScEditEngineDefaulter*, vcl::Window*, short, int) sc/source/ui/view/viewdata.cxx:1635 program/libsclo.so ScTabView::UpdateEditView() sc/source/ui/view/tabview3.cxx:2190 program/libsclo.so ScTabView::extendTiledAreaIfNeeded() sc/source/ui/view/tabview.cxx:3098 program/libmergedlo.so doc_setClientVisibleArea desktop/source/lib/init.cxx:6248 The current view should ideally never be nullptr, but if that's the case, at least don't crash. Change-Id: I521faa54373d2ce5ffb0983bac6caf0705767fdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155275 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 0d598460d7c1..524bf7f7efda 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -505,7 +505,7 @@ void SfxLokHelper::notifyOtherViews(const SfxViewShell* pThisView, int nType, const boost::property_tree::ptree& rTree) { assert(pThisView != nullptr && "pThisView must be valid"); -if (DisableCallbacks::disabled()) +if (!pThisView || DisableCallbacks::disabled()) return; // Cache the payload so we only have to generate it once, at most.
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/unoctitm.cxx | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) New commits: commit 97a32713174a14758672d388de7627c71e2b70f8 Author: Aron Budea AuthorDate: Sat Jun 10 03:50:04 2023 +0200 Commit: Aron Budea CommitDate: Wed Jul 26 17:32:43 2023 +0200 lok: sfx2: fix change state "SheetRightToLeft" 2nd attempt This reverts commit 71e5f7e43471cc479ea1e818c813170a389964e6, and adds SheetRightToLeft in a different place. Change-Id: Id7001d06b247713de2e4dfe5076d156988e932d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152808 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit f44aed75f1c1f64c07651376fd2f638f61e0c3b1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154928 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 2feec75dac6c..20ae855ab6f3 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -932,21 +932,14 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "FormatPaintbrush" || aEvent.FeatureURL.Path == "FreezePanes" || aEvent.FeatureURL.Path == "Sidebar" || -aEvent.FeatureURL.Path == "SheetRightToLeft" || aEvent.FeatureURL.Path == "SpacePara1" || aEvent.FeatureURL.Path == "SpacePara15" || aEvent.FeatureURL.Path == "SpacePara2" || aEvent.FeatureURL.Path == "DataFilterAutoFilter") { bool bTemp = false; - -if (aEvent.IsEnabled) -{ -aEvent.State >>= bTemp; -aBuffer.append(bTemp); -} -else -aBuffer.append("disabled"); +aEvent.State >>= bTemp; +aBuffer.append(bTemp); } else if (aEvent.FeatureURL.Path == "CharFontName") { @@ -1193,7 +1186,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aBuffer.append(OUString::boolean(aBool)); } } -else if (aEvent.FeatureURL.Path == "ToggleMergeCells") +else if (aEvent.FeatureURL.Path == "ToggleMergeCells" || + aEvent.FeatureURL.Path == "SheetRightToLeft") { bool aBool;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/infobar.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit e7ff004892c950a863602e9380aef91a7ae2404d Author: Patrick Luby AuthorDate: Mon Jul 24 12:27:51 2023 -0400 Commit: Patrick Luby CommitDate: Mon Jul 24 21:14:14 2023 +0200 Regression: eliminate white lines in infobar's close button When drawing the close button's background, the right and bottom need to be extended by 1 or there will be a white line on both edges. Change-Id: I67dcad422c0f33af3035621cd624c1ddafc89d00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154871 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index 5bcb8b7e9a69..81e8ffe9d864 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -114,12 +114,13 @@ void SfxInfoBarWindow::SetCloseButtonImage() drawinglayer::primitive2d::Primitive2DContainer aSeq(2); -// background +// Draw backround. The right and bottom need to be extended by 1 or +// there will be a white line on both edges when Skia is enabled. B2DPolygon aPolygon; aPolygon.append(B2DPoint(aRect.Left(), aRect.Top())); -aPolygon.append(B2DPoint(aRect.Right(), aRect.Top())); -aPolygon.append(B2DPoint(aRect.Right(), aRect.Bottom())); -aPolygon.append(B2DPoint(aRect.Left(), aRect.Bottom())); +aPolygon.append(B2DPoint(aRect.Right() + 1, aRect.Top())); +aPolygon.append(B2DPoint(aRect.Right() + 1, aRect.Bottom() + 1)); +aPolygon.append(B2DPoint(aRect.Left(), aRect.Bottom() + 1)); aPolygon.setClosed(true); aSeq[0] = new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), m_aBackgroundColor);
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/appcfg.cxx | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) New commits: commit c5ae73c8f3abdb067e3cef0cb5565e1f00ae08ea Author: Mike Kaganski AuthorDate: Sun Jul 16 14:03:48 2023 +0200 Commit: Mike Kaganski CommitDate: Tue Jul 18 08:52:05 2023 +0200 Drop aSendSet ... which was never used, since its introduction in the initial import. Change-Id: If962e24663a53911977992e4d60fa8abe5b6ff75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154461 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 3c8fe3c124f6..681d4e2bd576 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -446,21 +446,15 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) void SfxApplication::SetOptions(const SfxItemSet ) { -SvtPathOptions aPathOptions; - -// Data is saved in DocInfo and IniManager - -SfxAllItemSet aSendSet( rSet ); - // PathName if ( const SfxAllEnumItem* pEnumItem = rSet.GetItemIfSet(SID_ATTR_PATHNAME)) { -sal_uInt32 nCount = pEnumItem->GetTextCount(); -OUString aNoChangeStr( ' ' ); -for( sal_uInt32 nPath=0; nPathGetTextCount(); +SvtPathOptions aPathOptions; +for( sal_uInt16 nPath=0; nPathGetTextByPos(static_cast(nPath)); -if ( sValue != aNoChangeStr ) +const OUString& sValue = pEnumItem->GetTextByPos(nPath); +if ( sValue != " " ) // "No change" string { switch( static_cast(nPath) ) { @@ -531,8 +525,6 @@ void SfxApplication::SetOptions(const SfxItemSet ) } } } - -aSendSet.ClearItem( SID_ATTR_PATHNAME ); } SetOptions_Impl( rSet );
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) New commits: commit ef1484c731140699f26d15f4cda36f1a81e73abe Author: Justin Luth AuthorDate: Fri Jul 7 13:53:01 2023 -0400 Commit: Justin Luth CommitDate: Tue Jul 18 00:00:15 2023 +0200 Revert "Revert "tdf#126006 sc SID_RELOAD: restart notebookbar"" This reverts commit d0bbc16b1715a3711d872a36c7e525e8d3811669. My laptop is failing to complete UITests all the time, so likely this patch wasn't to blame after all. Change-Id: I3fa9fbb8ffc8df1fd9e45f8bcb6489594a8c0c46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154199 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 196a18d3d335..0766eec86088 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -838,8 +838,18 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) UpdateDocument_Impl(); -if (vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()) == "com.sun.star.text.TextDocument") - sfx2::SfxNotebookBar::ReloadNotebookBar(u"modules/swriter/ui/"); +auto sModule = vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()); +OUString sReloadNotebookBar; +if (sModule == "com.sun.star.text.TextDocument") +sReloadNotebookBar = u"modules/swriter/ui/"; +else if (sModule == "com.sun.star.sheet.SpreadsheetDocument") +sReloadNotebookBar = u"modules/scalc/ui/"; +else if (sfx2::SfxNotebookBar::IsActive() + && sModule != "presentation.PresentationDocument" + && sModule != "com.sun.star.drawing.DrawingDocument") +{ +assert(false && "SID_RELOAD Notebookbar active, but not refreshed here"); +} try { @@ -878,6 +888,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // Propagate document closure. SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::CloseDoc, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) ); + +// tdf#126006 Calc needs to reload the notebookbar after closing the document +if (!sReloadNotebookBar.isEmpty()) + sfx2::SfxNotebookBar::ReloadNotebookBar(sReloadNotebookBar); } // Record as done
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/appcfg.cxx | 542 ++-- 1 file changed, 183 insertions(+), 359 deletions(-) New commits: commit ca460e654a1ee17d755cff6943f07bfa88da9a27 Author: Mike Kaganski AuthorDate: Mon Jul 17 19:39:02 2023 +0200 Commit: Mike Kaganski CommitDate: Mon Jul 17 22:21:50 2023 +0200 Simplify a bit Change-Id: I6c20a9809ee8cae27e8894c91266d82ea04540f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154534 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 41603134a225..3c8fe3c124f6 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -106,246 +107,156 @@ IMPL_LINK(SfxEventAsyncer_Impl, IdleHdl, Timer*, pAsyncIdle, void) delete this; } - -void SfxApplication::GetOptions( SfxItemSet& rSet ) +namespace +{ +template bool toSet(SfxItemSet& rSet, TypedWhichId wid) { -bool bRet = false; +return rSet.Put(Item(wid, Cfg::get())); +} +template +bool toSet_withDefault(SfxItemSet& rSet, TypedWhichId wid, Val&& defVal) +{ +return rSet.Put(Item(wid, Cfg::get().value_or(std::move(defVal; +} +template bool toSet_ifRW(SfxItemSet& rSet, TypedWhichId wid) +{ +return Cfg::isReadOnly() || toSet(rSet, wid); +} -const WhichRangesContainer& pRanges = rSet.GetRanges(); +template +void toCfg_ifSet(const SfxItemSet& rSet, TypedWhichId wid, + std::shared_ptr const& batch) +{ +if (const auto* pItem = rSet.GetItemIfSet(wid)) +Cfg::set(pItem->GetValue(), batch); +} +} -for (auto const & pRange : pRanges) +void SfxApplication::GetOptions( SfxItemSet& rSet ) +{ +SfxWhichIter iter(rSet); +for (auto nWhich = iter.FirstWhich(); nWhich; nWhich = iter.NextWhich()) { -for(sal_uInt16 nWhich = pRange.first; nWhich <= pRange.second; ++nWhich) +bool bRet = false; +switch(nWhich) { -switch(nWhich) -{ -case SID_ATTR_BUTTON_BIGSIZE : +case SID_ATTR_BUTTON_BIGSIZE: +if( rSet.Put( SfxBoolItem( SID_ATTR_BUTTON_BIGSIZE, SvtMiscOptions::AreCurrentSymbolsLarge() ) ) ) +bRet = true; +break; +case SID_ATTR_BACKUP: +bRet = true; +if (!officecfg::Office::Common::Save::Document::CreateBackup::isReadOnly()) +if (!rSet.Put( SfxBoolItem( SID_ATTR_BACKUP, + (officecfg::Office::Common::Save::Document::CreateBackup::get() && !comphelper::LibreOfficeKit::isActive()) ))) +bRet = false; +break; +case SID_ATTR_PRETTYPRINTING: +bRet = toSet_ifRW( +rSet, SID_ATTR_PRETTYPRINTING); +break; +case SID_ATTR_WARNALIENFORMAT: +bRet = toSet_ifRW( +rSet, SID_ATTR_WARNALIENFORMAT); +break; +case SID_ATTR_AUTOSAVE: +bRet = toSet_ifRW( +rSet, SID_ATTR_AUTOSAVE); +break; +case SID_ATTR_AUTOSAVEPROMPT: +bRet = toSet_ifRW( +rSet, SID_ATTR_AUTOSAVEPROMPT); +break; +case SID_ATTR_AUTOSAVEMINUTE: +bRet = toSet_ifRW( +rSet, SID_ATTR_AUTOSAVEMINUTE); +break; +case SID_ATTR_USERAUTOSAVE: +bRet = toSet_ifRW( +rSet, SID_ATTR_USERAUTOSAVE); +break; +case SID_ATTR_DOCINFO: +bRet = toSet_ifRW( +rSet, SID_ATTR_DOCINFO); +break; +case SID_ATTR_WORKINGSET: +bRet = toSet_ifRW( +rSet, SID_ATTR_WORKINGSET); +break; +case SID_ATTR_SAVEDOCVIEW: +bRet = toSet_ifRW( +rSet, SID_ATTR_SAVEDOCVIEW); +break; +case SID_ATTR_METRIC: +break; +case SID_HELPBALLOONS: +bRet = toSet(rSet, SID_HELPBALLOONS); +break; +case SID_HELPTIPS : +bRet = toSet(rSet, SID_HELPTIPS); +break; +case SID_HELP_STYLESHEET: +bRet = toSet(rSet, + SID_HELP_STYLESHEET); +break; +case SID_ATTR_UNDO_COUNT: +bRet = toSet(rSet, SID_ATTR_UNDO_COUNT); +break; +case SID_ATTR_QUICKLAUNCHER: +if ( ShutdownIcon::IsQuickstarterInstalled() ) { -if( rSet.Put( SfxBoolItem( SID_ATTR_BUTTON_BIGSIZE,
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/sidebar/ResourceManager.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 4ea4ce78d116757638b08a389d9c509c523085f3 Author: Hossein AuthorDate: Mon Jul 17 11:39:58 2023 +0200 Commit: Hossein CommitDate: Mon Jul 17 18:38:08 2023 +0200 Remove leftover debug code This fprintf was leftover from 1653bb9bffaa84a40b7d81a8277e887ea28df4e4 which came up with attachment 94167 from tdf#75059 in terminal output with just opening and closing in the official 7.5.1.2 binaries. Change-Id: Ib04b5f6dd3426e97a14b3c6f38b68481f1bf85b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154518 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 5974e20af488..7989d2820263 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -699,7 +699,6 @@ void ResourceManager::ReadLegacyAddons (const Reference& rxC rPanelDescriptor.mbShowForReadOnlyDocuments = false; rPanelDescriptor.mbWantsCanvas = false; rPanelDescriptor.mbWantsAWT = true; -fprintf(stderr, "THIS PLACE\n"); rPanelDescriptor.maContextList.AddContextDescription(Context(sModuleName, "any"), true, OUString()); } }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docfile.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit b6f3129569c22d9d139ca712dcf0db6dc2041565 Author: Justin Luth AuthorDate: Thu Jul 13 20:44:26 2023 -0400 Commit: Justin Luth CommitDate: Fri Jul 14 15:03:10 2023 +0200 tdf#143038: preserve extension on backup file This allows knowing what kind of backup this is, as well as allowing the same named document for every kind of file format to be retained in backup. Change-Id: Iff22802d73adad351cb129b402db7567f0af7c7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154407 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index d9379866deaa..0f14c4869207 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2664,7 +2664,9 @@ void SfxMedium::DoBackup_Impl() // save as ".bak" file INetURLObject aDest( aBakDir ); aDest.insertName( aSource.getName() ); -aDest.setExtension( u"bak" ); +const OUString sExt += aSource.hasExtension() ? aSource.getExtension() + ".bak" : OUString("bak"); +aDest.setExtension(sExt); OUString aFileName = aDest.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); // create a content for the source file
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/dinfdlg.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 45d7ffb7f238fbb8cf99cdcd386c496223915ab7 Author: Ashod Nakashian AuthorDate: Tue Jul 4 02:13:28 2023 -0400 Commit: Ashod Nakashian CommitDate: Thu Jul 6 11:25:04 2023 +0200 sfx2: disable setting password on text documents Since we can't preserve the password in a plain-text file, we should disable the ability to set/change it. Otherwise, it's misleading to users. Signed-off-by: Ashod Nakashian Change-Id: I3176243ddd2826eb07def1ff5ab251e33cb7125e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153917 Tested-by: Jenkins Reviewed-by: Jaume Pujantell diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index f8caa35aad90..800f912b2ac9 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1024,6 +1024,16 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) { m_xFileValEd->set_label(aName); m_xFileValEd->set_uri(aName); + +// Disable setting/changing password on text files. +// Perhaps this needs to be done for both Online and Desktop. +OUString sExtension(INetURLObject(rMainURL).getExtension()); +if (!sExtension.isEmpty()) +{ +sExtension = sExtension.toAsciiLowerCase(); +if (sExtension == "txt" || sExtension == "csv") +m_xChangePassBtn->set_sensitive(false); +} } else {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d2742b30968037a40eeb4679192c1706124965a5 Author: Andrea Gelmini AuthorDate: Wed Jul 5 11:11:07 2023 +0200 Commit: Julien Nabet CommitDate: Wed Jul 5 13:35:57 2023 +0200 Fix typo Change-Id: I72e6b45ab5ddd974c8f93633c5df511ca7cfdaf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154025 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 1a6cc15fc3fc..6965fc8d372f 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2325,7 +2325,7 @@ vcl::Window* SfxViewShell::GetEditWindowForActiveOLEObj() const OUString SfxViewShell::GetColorConfigName() const { -SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigName not overriden!"); +SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigName not overridden!"); return {}; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewprn.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit b88b9504503298996de1feaa3f86b1adf36563a2 Author: Xisco Fauli AuthorDate: Tue Jul 4 14:23:20 2023 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 4 16:24:31 2023 +0200 sfx2: fix crash in SfxViewShell::StartPrint See https://crashreport.libreoffice.org/stats/signature/SfxViewShell::StartPrint(com::sun::star::uno::Sequence%3Ccom::sun::star::beans::PropertyValue%3E%20const%20&,bool,bool) Change-Id: I3d10414d4cfd027bf80ceaf6692bb7f92269f6c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153965 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 5add9956abcb..5ada786ba108 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -609,8 +609,11 @@ void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rPr css::beans::PropertyValue* pJobNameVal = xNewController->getValue("JobName"); if (!pJobNameVal) { -xNewController->setValue("JobName", Any(GetObjectShell()->GetTitle(1))); -xNewController->setPrinterModified(mbPrinterSettingsModified); +if (SfxObjectShell* pDoc = GetObjectShell()) +{ +xNewController->setValue("JobName", Any(pDoc->GetTitle(1))); +xNewController->setPrinterModified(mbPrinterSettingsModified); +} } }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) New commits: commit d0bbc16b1715a3711d872a36c7e525e8d3811669 Author: Justin Luth AuthorDate: Sat Jul 1 11:30:46 2023 -0400 Commit: Justin Luth CommitDate: Sat Jul 1 18:59:58 2023 +0200 Revert "tdf#126006 sc SID_RELOAD: restart notebookbar" This reverts 24.2 commit 0211c88f884065aa179725bd2eb846edd4c5bb6b. Although it passed on Jenkins, my own computer seems to hang on UITests - both Writer and Calc. Change-Id: I57e8a176cce55a514490db81f211582c0ad86675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153829 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 0766eec86088..196a18d3d335 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -838,18 +838,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) UpdateDocument_Impl(); -auto sModule = vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()); -OUString sReloadNotebookBar; -if (sModule == "com.sun.star.text.TextDocument") -sReloadNotebookBar = u"modules/swriter/ui/"; -else if (sModule == "com.sun.star.sheet.SpreadsheetDocument") -sReloadNotebookBar = u"modules/scalc/ui/"; -else if (sfx2::SfxNotebookBar::IsActive() - && sModule != "presentation.PresentationDocument" - && sModule != "com.sun.star.drawing.DrawingDocument") -{ -assert(false && "SID_RELOAD Notebookbar active, but not refreshed here"); -} +if (vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()) == "com.sun.star.text.TextDocument") + sfx2::SfxNotebookBar::ReloadNotebookBar(u"modules/swriter/ui/"); try { @@ -888,10 +878,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // Propagate document closure. SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::CloseDoc, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) ); - -// tdf#126006 Calc needs to reload the notebookbar after closing the document -if (!sReloadNotebookBar.isEmpty()) - sfx2::SfxNotebookBar::ReloadNotebookBar(sReloadNotebookBar); } // Record as done
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) New commits: commit 0211c88f884065aa179725bd2eb846edd4c5bb6b Author: Justin Luth AuthorDate: Fri Jun 30 21:44:01 2023 -0400 Commit: Justin Luth CommitDate: Sat Jul 1 12:36:35 2023 +0200 tdf#126006 sc SID_RELOAD: restart notebookbar Change-Id: Icca41461d203615be58f9cf1214b82d70ee55ccb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153818 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 196a18d3d335..0766eec86088 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -838,8 +838,18 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) UpdateDocument_Impl(); -if (vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()) == "com.sun.star.text.TextDocument") - sfx2::SfxNotebookBar::ReloadNotebookBar(u"modules/swriter/ui/"); +auto sModule = vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()); +OUString sReloadNotebookBar; +if (sModule == "com.sun.star.text.TextDocument") +sReloadNotebookBar = u"modules/swriter/ui/"; +else if (sModule == "com.sun.star.sheet.SpreadsheetDocument") +sReloadNotebookBar = u"modules/scalc/ui/"; +else if (sfx2::SfxNotebookBar::IsActive() + && sModule != "presentation.PresentationDocument" + && sModule != "com.sun.star.drawing.DrawingDocument") +{ +assert(false && "SID_RELOAD Notebookbar active, but not refreshed here"); +} try { @@ -878,6 +888,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // Propagate document closure. SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::CloseDoc, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) ); + +// tdf#126006 Calc needs to reload the notebookbar after closing the document +if (!sReloadNotebookBar.isEmpty()) + sfx2::SfxNotebookBar::ReloadNotebookBar(sReloadNotebookBar); } // Record as done
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit c89b7f4a31298360e14663f3c192e4e832759a1f Author: Noel Grandin AuthorDate: Thu Jun 29 12:40:42 2023 +0200 Commit: Noel Grandin CommitDate: Thu Jun 29 17:15:50 2023 +0200 set->unordered_set which is more efficient, and we don't need ordering here Change-Id: I1af4412d94680f4449a2eb00168f6c4cef20bd06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153741 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index acdfd3d8f9dd..0d7d7f14ff99 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -107,6 +107,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -242,7 +243,7 @@ class LOKDocumentFocusListener : static constexpr sal_Int64 MAX_ATTACHABLE_CHILDREN = 30; const SfxViewShell* m_pViewShell; -std::set< uno::Reference< uno::XInterface > > m_aRefList; +std::unordered_set< uno::Reference< uno::XInterface > > m_aRefList; OUString m_sFocusedParagraph; bool m_bFocusedParagraphNotified; sal_Int32 m_nCaretPosition;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objserv.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 73ac60c4c3a209d23642ac4d0e8c4ac6dba22d86 Author: Justin Luth AuthorDate: Wed Jun 28 14:18:53 2023 -0400 Commit: Justin Luth CommitDate: Wed Jun 28 22:53:43 2023 +0200 tdf#148416 saveas: preserve loadreadonly with password If a document is set to load readonly, and that setting is password protected, then at least suggest using a password on save-as. Change-Id: I788da43733470e56af988e7c4b9f2cae01573e50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153726 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index f321cbfc74a7..caa1b800f41e 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1027,7 +1027,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest ) const SfxStringItem* pOldPasswordItem = SfxItemSet::GetItem(GetMedium()->GetItemSet(), SID_PASSWORD, false); const SfxUnoAnyItem* pOldEncryptionDataItem = SfxItemSet::GetItem(GetMedium()->GetItemSet(), SID_ENCRYPTIONDATA, false); -const bool bPreselectPassword = pOldPasswordItem || pOldEncryptionDataItem; +const bool bPreselectPassword += pOldPasswordItem || pOldEncryptionDataItem + || (IsLoadReadonly() + && (GetModifyPasswordHash() || GetModifyPasswordInfo().hasElements())); uno::Sequence< beans::PropertyValue > aDispatchArgs; if ( rReq.GetArgs() )
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 79241a1fd32ab03cd2bb34fb303ce7f2fa93e57e Author: Michael Stahl AuthorDate: Tue Jun 27 19:50:51 2023 +0200 Commit: Michael Stahl CommitDate: Wed Jun 28 11:23:22 2023 +0200 tdf#146547 sfx2: preserve modified state from read-only to editable SfxViewFrame::ExecReload_Impl() calls DoSaveCompleted() which resets the modified state, but in this case the document wasn't actually saved. Change-Id: I54f6508a652cc42a127bc59058c5b435dd1a25a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153676 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6cde535cc3c3..196a18d3d335 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -308,9 +308,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) m_pFrame->RemoveInfoBar(u"readonly"); if (m_pMed) { +bool const isEnableSetModified(m_pSh->IsEnableSetModified()); +m_pSh->EnableSetModified(false); // tdf#116066: DoSaveCompleted should be called after SetReadOnlyUI m_pSh->DoSaveCompleted(m_pMed); m_pSh->Broadcast(SfxHint(SfxHintId::ModeChanged)); +m_pSh->EnableSetModified(isEnableSetModified); } } }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/iframe.cxx | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) New commits: commit e55a1ca02b281d8a841361c1315b7e0ee7d75119 Author: Caolán McNamara AuthorDate: Tue Jun 20 10:20:36 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Jun 20 12:28:02 2023 +0200 Resolves: tdf#155750 allow private:factory urls in floating frames they create a new document so there isn't an associated location which would trigger the prompt to allow it so just allow factory urls Change-Id: I7b693bcfe5ac04aaed06905637ab3c1eba43c51f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153316 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 1db259994b50..507256aadf17 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -175,14 +175,18 @@ sal_Bool SAL_CALL IFrameObject::load( uno::Reference xParentFrame = xFrame->getCreator(); SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); -bool bUpdateAllowed(true); -if (pDoc) +const bool bIsFactoryURL = aTargetURL.Complete.startsWith("private:factory/"); +if (!bIsFactoryURL) { -comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer(); -bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); +bool bUpdateAllowed(true); +if (pDoc) +{ +comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer(); +bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); +} +if (!bUpdateAllowed) +return false; } -if (!bUpdateAllowed) -return false; OUString sReferer; if (pDoc && pDoc->HasName())
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/unoctitm.cxx | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit 71e5f7e43471cc479ea1e818c813170a389964e6 Author: Henry Castro AuthorDate: Thu Jun 1 11:04:13 2023 -0400 Commit: Henry Castro CommitDate: Tue Jun 20 00:41:35 2023 +0200 lok: sfx2: fix change state "SheetRightToLeft" The UNO command "SheetRightToLeft" can be disabled Signed-off-by: Henry Castro Change-Id: I54742c9d52eb52e36154e0aac2cdf440771eb177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152502 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit fc8270f06eca5ba2ba25673a424b36d9e352f62a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152546 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153267 Tested-by: Jenkins diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 1b0d1223a3b7..4495873a89af 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -938,8 +938,14 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "SpacePara2") { bool bTemp = false; -aEvent.State >>= bTemp; -aBuffer.append(bTemp); + +if (aEvent.IsEnabled) +{ +aEvent.State >>= bTemp; +aBuffer.append(bTemp); +} +else +aBuffer.append("disabled"); } else if (aEvent.FeatureURL.Path == "CharFontName") {
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objxtor.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 281bdb5a979f0516fe7a9cd35585fd3daf4021b1 Author: Stephan Bergmann AuthorDate: Mon Jun 19 14:39:59 2023 +0200 Commit: Stephan Bergmann CommitDate: Mon Jun 19 16:40:11 2023 +0200 Initialize SfxObjectShell::bRememberSignature ...introduced in 46722dbaa7795074e3c5043a76ae3f3a7782491e "tdf#155665 Adding option to remember signatures for each save", to avoid > sfx2/source/doc/objserv.cxx:1230:39: runtime error: load of value 190, which is not a valid value for type 'bool' > #0 in SfxObjectShell::ExecFile_Impl(SfxRequest&) at sfx2/source/doc/objserv.cxx:1230:39 > #1 in SfxStubSfxObjectShellExecFile_Impl(SfxShell*, SfxRequest&) at workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:220:1 > #2 in SfxShell::ExecuteSlot(SfxRequest&, SfxInterface const*) at sfx2/source/control/shell.cxx:456:9 > #3 in ScTabViewShell::ExecuteSave(SfxRequest&) at sc/source/ui/view/tabvwsha.cxx:840:34 > #4 in SfxStubScTabViewShellExecuteSave(SfxShell*, SfxRequest&) at workdir/SdiTarget/sc/sdi/scslots.hxx:1481:1 > #5 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) at sfx2/source/control/dispatch.cxx:254:9 > #6 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) at sfx2/source/control/dispatch.cxx:753:9 > #7 in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) at sfx2/source/control/bindings.cxx:1060:22 > #8 in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&) at sfx2/source/control/unoctitm.cxx:688:53 > #9 in SfxOfficeDispatch::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&) at sfx2/source/control/unoctitm.cxx:266:16 > #10 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference const&, com::sun::star::util::URL const&, bool, com::sun::star::uno::Sequence const&) at framework/source/services/dispatchhelper.cxx:163:30 > #11 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) at framework/source/services/dispatchhelper.cxx:120:16 > #12 in non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) at framework/source/services/dispatchhelper.cxx > #13 in unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference const&, rtl::OUString const&, com::sun::star::uno::Sequence const&) at unotest/source/cpp/macros_test.cxx:94:33 > #14 in testInvalidEntrySave::TestBody() at sc/qa/unit/tiledrendering/tiledrendering.cxx:2826:5 during CppunitTest_sc_tiledrendering Change-Id: Ie3a8453c0222cb0a2a239d6d9133a9aafe1e2870 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153265 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 397a9372089e..e46dda12580b 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -247,6 +247,7 @@ SfxObjectShell::SfxObjectShell( const SfxModelFlags i_nCreationFlags ) , bHasName(false) , bIsInGenerateThumbnail (false) , mbAvoidRecentDocs(false) +, bRememberSignature(false) { if (i_nCreationFlags & SfxModelFlags::EMBEDDED_OBJECT) eCreateMode = SfxObjectCreateMode::EMBEDDED; @@ -276,6 +277,7 @@ SfxObjectShell::SfxObjectShell(SfxObjectCreateMode eMode) , bHasName(false) , bIsInGenerateThumbnail(false) , mbAvoidRecentDocs(false) +, bRememberSignature(false) { }
[Libreoffice-commits] core.git: sfx2/source starmath/qa sw/qa vcl/qa xmlsecurity/qa
sfx2/source/doc/objembed.cxx|9 - sfx2/source/doc/objmisc.cxx |7 ++- sfx2/source/doc/objxtor.cxx |8 +++- starmath/qa/cppunit/test_cursor.cxx |1 + starmath/qa/cppunit/test_node.cxx |1 + starmath/qa/cppunit/test_nodetotextvisitors.cxx |1 + sw/qa/python/check_xmodifiable2.py |9 - vcl/qa/cppunit/filter/ipdf/ipdf.cxx |4 xmlsecurity/qa/unit/signing/signing.cxx |4 9 files changed, 36 insertions(+), 8 deletions(-) New commits: commit aca32a55456aa4e907b216fb490b3c15d26c3d55 Author: Michael Stahl AuthorDate: Fri Jun 16 14:51:13 2023 +0200 Commit: Michael Stahl CommitDate: Fri Jun 16 16:52:43 2023 +0200 tdf#146547 sfx2: allow read-only documents to be modified This is particularly useful for a Writer document that contains a section that is set to be editable in a read-only document, so that the user is warned when closing such a document without saving it. Originally this check was added in commit 27db57efc51487b3976fbf73df1868b8fb78d201 "CWS fwkbugfix05" "#i39869#: readonly docs should never become modified" but the actual problem there was that the read-only document was displayed in a wizard dialog, not in a document view, so let's instead check that the document is some kind of "internal" document. Also the dialog's Save button should do something, and since the document is read-only, a Save As dialog appears appropriate. Change-Id: I339cbe92a2c9eb74a1f5061246f921037a47f79c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153180 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index f2e91cef821e..1be515a6e704 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -84,8 +85,14 @@ void SfxObjectShell::SetVisArea( const tools::Rectangle & rVisArea ) pImpl->m_aVisArea = rVisArea; if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { -if ( IsEnableSetModified() ) +if (IsEnableSetModified() +// Base forms use EMBEDDED but they actually live in their own +// frame - resizing that shouldn't set it to modified. +&& pImpl->pBaseModel +&& pImpl->pBaseModel->getIdentifier() != "com.sun.star.sdb.FormDesign") +{ SetModified(); +} SfxGetpApp()->NotifyEvent(SfxEventHint( SfxEventHintId::VisAreaChanged, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this)); } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 6b86e2163ccb..d0f49831db0c 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -247,7 +247,12 @@ void SfxObjectShell::EnableSetModified( bool bEnable ) bool SfxObjectShell::IsEnableSetModified() const { -return pImpl->m_bEnableSetModified && !IsReadOnly(); +// tdf#146547 read-only does not prevent modified, instead try to prevent +// setting "internal" documents that may be displayed in some dialog but +// which the user didn't load or activate to modified. +return pImpl->m_bEnableSetModified && !IsPreview() +&& eCreateMode != SfxObjectCreateMode::ORGANIZER +&& eCreateMode != SfxObjectCreateMode::INTERNAL; } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index c7f34aeadc31..397a9372089e 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -565,7 +565,13 @@ bool SfxObjectShell::PrepareClose { // Save by each Dispatcher const SfxPoolItem *pPoolItem; -if ( IsSaveVersionOnClose() ) +if (IsReadOnly()) +{ +SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); +const SfxPoolItem* ppArgs[] = { , nullptr }; +pPoolItem = pFrame->GetBindings().ExecuteSynchron(SID_SAVEASDOC, ppArgs); +} +else if (IsSaveVersionOnClose()) { SfxStringItem aItem( SID_DOCINFO_COMMENTS, SfxResId(STR_AUTOMATICVERSION) ); SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI ); diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 56c673c1bd22..5f4c551675a1 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -58,6 +58,7 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); +xDocShRef->DoInitNew(); } void Test::tearDown() diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6faa71b93086dce838a2c80f8935df275955756d Author: Andrea Gelmini AuthorDate: Thu Jun 15 12:00:08 2023 +0200 Commit: Julien Nabet CommitDate: Fri Jun 16 08:41:43 2023 +0200 Fix typo Change-Id: I774554c7945d5560e229d6c94e9efbafd77deeca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153106 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index dcd522d61aee..acdfd3d8f9dd 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2318,7 +2318,7 @@ vcl::Window* SfxViewShell::GetEditWindowForActiveOLEObj() const ::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry) const { -SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overriden!"); +SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overridden!"); return {}; }
[Libreoffice-commits] core.git: sfx2/source sw/inc sw/source
sfx2/source/dialog/StyleList.cxx |3 +-- sw/inc/docstyle.hxx|2 +- sw/source/core/model/ThemeColorChanger.cxx |3 +++ sw/source/core/undo/unattr.cxx |9 + sw/source/uibase/app/docst.cxx |6 +++--- sw/source/uibase/app/docstyle.cxx |6 +- sw/source/uibase/shells/basesh.cxx |4 7 files changed, 22 insertions(+), 11 deletions(-) New commits: commit e229e13f9d5f1322986775399276f5503ebb83f7 Author: Maxim Monastirsky AuthorDate: Thu Jun 15 11:21:01 2023 +0300 Commit: Maxim Monastirsky CommitDate: Thu Jun 15 22:37:41 2023 +0200 tdf#103064 sw: improved notifications on style modification - More useful notification on undo - Added notifications for theme change and UNO API. Change-Id: I554dceff92f4f8a6dd5c39c6965b7de706ab6678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153110 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 0247e01e7340..bf9bf80d9db8 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -1565,8 +1565,7 @@ void StyleList::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) if (!m_bDontUpdate && nId != SfxHintId::Dying && (dynamic_cast() || dynamic_cast() -|| dynamic_cast() -|| nId == SfxHintId::StyleSheetModified)) +|| dynamic_cast())) { if (!pIdle) { diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx index d727245c059e..e71fb73c9828 100644 --- a/sw/inc/docstyle.hxx +++ b/sw/inc/docstyle.hxx @@ -99,7 +99,7 @@ public: which indicates that the indent attributes at a paragraph style should be reset in case that a list style is applied to the paragraph style and no indent attributes are applied. */ -voidSetItemSet( const SfxItemSet& rSet, +voidSetItemSet( const SfxItemSet& rSet, const bool bBroadcast = true, const bool bResetIndentAttrsAtParagraphStyle = false ); virtual SfxItemSet& GetItemSet() override; diff --git a/sw/source/core/model/ThemeColorChanger.cxx b/sw/source/core/model/ThemeColorChanger.cxx index caf4de1787ce..03fe47641bf3 100644 --- a/sw/source/core/model/ThemeColorChanger.cxx +++ b/sw/source/core/model/ThemeColorChanger.cxx @@ -430,7 +430,10 @@ void ThemeColorChanger::apply(std::shared_ptr const& pColorSet) bChanged = changeBackground(rAttrSet, *pNewSet, *pColorSet) || bChanged; if (bChanged) +{ pDocument->ChgFormat(*pTextFormatCollection, *pNewSet); + pPool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetModified, *pStyle)); +} } pStyle = static_cast(pPool->Next()); } diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 9b6a12a43707..acc1503ee35c 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -226,6 +226,15 @@ void SwUndoFormatAttr::UndoImpl(::sw::UndoRedoContext & rContext) if ( RES_FLYFRMFMT == m_nFormatWhich || RES_DRAWFRMFMT == m_nFormatWhich ) { rContext.SetSelections(static_cast(pFormat), nullptr); } + +SfxStyleFamily nFamily = SfxStyleFamily::None; +if (RES_TXTFMTCOLL == m_nFormatWhich || RES_CONDTXTFMTCOLL == m_nFormatWhich) +nFamily = SfxStyleFamily::Para; +else if (RES_CHRFMT == m_nFormatWhich) +nFamily = SfxStyleFamily::Char; + +if (pFormat && nFamily != SfxStyleFamily::None) +rContext.GetDoc().BroadcastStyleOperation(pFormat->GetName(), nFamily, SfxHintId::StyleSheetModified); } // Check if it is still in Doc diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index d4a05bf2a173..2016d712e9a7 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -594,7 +594,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void) ::SfxToSwPageDescAttr( *pWrtShell, aSet ); // reset indent attributes at paragraph style, if a list style // will be applied and no indent attributes will be applied. -m_xTmp->SetItemSet( aSet, true ); +m_xTmp->SetItemSet( aSet, false, true ); } else { @@ -614,7 +614,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void) ::ConvertAttrGenToChar(aTmpSet, m_xTmp->GetItemSet()); } -m_xTmp->SetItemSet( aTmpSet ); +m_xTmp->SetItemSet( aTmpSet, false ); if( SfxStyleFamily::Page == m_nFamily && SvtCTLOptions::IsCTLFontEnabled() ) { @@ -667,7 +667,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void) SfxItemSet aTmpSet(*m_pDlg->GetOutputItemSet()); aTmpSet.ClearItem(XATTR_FILLSTYLE); -
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objstor.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit 3b294f6139028014e72379ebe8eda24a2bd32195 Author: Caolán McNamara AuthorDate: Thu Jun 8 20:53:16 2023 +0100 Commit: Michael Meeks CommitDate: Thu Jun 8 23:29:29 2023 +0200 restore, not clear, existing interaction handler after save put things back the way they were found. In this case I want it back to the original state, because a) lok sets its own interaction handler on load b) at framework/source/loadenv/loadenv.cxx:1137 Because that handler supports XInitialization we show the window early c) that happens to be before the menubar is set d) so the menubar changes the size of the window after it is shown e) so Window::ImplPosSizeWindow calls ImplInvalidateFrameRegion(nullptr, InvalidateFlags::Children) f) which sets ImplPaintFlags::PaintAllChildren on the PaintFlags of the workwindow g) which means that when a SwEditWin calls PaintImmediately vcl sees that flag on its WorkWindow grandparent and calls ImplCallPaint with the grandparent, not the SwEditWin. It happens that the grandparent has no LokId so that does nothing. if we clear this interaction on save, then the next joiner instead has no interaction so gets the default one which does not support XInitialization, so the window is not shown before menubar is added, so when it is shown it is already at the final size, so there is no ImplInvalidateFrameRegion and so no ImplPaintFlags::PaintAllChildren bits on the WorkWindow, so PaintImmediately on SwEditWin calls that Invalidate, which is special cased to broadcast the invalidation as a real thing Change-Id: Ie3fde4c53476aada2b1fdabb1dc70b08485074b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152772 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 4dee93d1e917..ba1ea30e0436 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2609,10 +2609,15 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) // an interaction handler here can acquire only in case of GUI Saving // and should be removed after the saving is done +Any aOriginalInteract; css::uno::Reference< XInteractionHandler > xInteract; const SfxUnoAnyItem* pxInteractionItem = SfxItemSet::GetItem(pArgs, SID_INTERACTIONHANDLER, false); if ( pxInteractionItem && ( pxInteractionItem->GetValue() >>= xInteract ) && xInteract.is() ) +{ +if (const SfxUnoAnyItem *pItem = pMediumTmp->GetItemSet()->GetItemIfSet(SID_INTERACTIONHANDLER, false)) +aOriginalInteract = pItem->GetValue(); pMediumTmp->GetItemSet()->Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, Any( xInteract ) ) ); +} const SfxBoolItem* pNoFileSync = pArgs->GetItem(SID_NO_FILE_SYNC, false); if (pNoFileSync && pNoFileSync->GetValue()) @@ -2625,7 +2630,10 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) if( pMediumTmp->GetItemSet() ) { -pMediumTmp->GetItemSet()->ClearItem( SID_INTERACTIONHANDLER ); +if (aOriginalInteract.hasValue()) + pMediumTmp->GetItemSet()->Put(SfxUnoAnyItem(SID_INTERACTIONHANDLER, aOriginalInteract)); +else +pMediumTmp->GetItemSet()->ClearItem(SID_INTERACTIONHANDLER); pMediumTmp->GetItemSet()->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); }
[Libreoffice-commits] core.git: sfx2/source starmath/qa
sfx2/source/doc/objmisc.cxx |3 +-- starmath/qa/cppunit/test_cursor.cxx |1 - starmath/qa/cppunit/test_node.cxx |1 - starmath/qa/cppunit/test_nodetotextvisitors.cxx |1 - 4 files changed, 1 insertion(+), 5 deletions(-) New commits: commit 4d5fe05d3926d8106f47cac2cfdefac8ec7b36d7 Author: Julien Nabet AuthorDate: Tue Jun 6 19:40:00 2023 +0200 Commit: Julien Nabet CommitDate: Tue Jun 6 21:42:20 2023 +0200 Revert "tdf#146547 Mark read-only docs as modified" This reverts commit e7e9991fd06ba2e0484ae5e6b6acc323ab8bf66b. It generated tdf#155638 "Forms: Form couldn't be closed after it has been opened" Change-Id: I854c194c718cae51fd0081534570269332d119c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152685 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index dd639c36900d..6b86e2163ccb 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -247,8 +247,7 @@ void SfxObjectShell::EnableSetModified( bool bEnable ) bool SfxObjectShell::IsEnableSetModified() const { -// Don't allow when user explicitly requested read only (IsLoadReadonly() or IsOriginallyLoadedReadOnlyMedium()) -return pImpl->m_bEnableSetModified && ! (IsLoadReadonly() || IsOriginallyLoadedReadOnlyMedium()); +return pImpl->m_bEnableSetModified && !IsReadOnly(); } diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 5f4c551675a1..56c673c1bd22 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -58,7 +58,6 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); -xDocShRef->DoInitNew(); } void Test::tearDown() diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index af9ff177f38f..f16f195aa8bc 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -53,7 +53,6 @@ void NodeTest::setUp() mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY); -mxDocShell->DoInitNew(); } void NodeTest::tearDown() diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index 11ef5affcc4c..6f714321de82 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -91,7 +91,6 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); -xDocShRef->DoInitNew(); } void Test::tearDown()
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docfile.cxx | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) New commits: commit 6fc8a48691bfa011c8b09e560196c5d3b98fdb76 Author: Michael Stahl AuthorDate: Tue Jun 6 16:20:45 2023 +0200 Commit: Michael Stahl CommitDate: Tue Jun 6 19:12:07 2023 +0200 sfx2: SfxMedium::Transfer_Impl() ignore exceptions when getting props Somehow (bisected to commit bc48f2656c9a7bc1f41541bff66ec2c4496466a4) this throws an exception now when getting "Title" when storing a new file to a WebDAV server (the server naturally replies with 404). There is already a fallback to get the filename, so just ignore exceptions here so the transfer can succeed. Change-Id: Ic609f2a4f5a67670b2d8eeb74680730053a7d3a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152678 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index f43213b67e97..d9379866deaa 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2426,11 +2426,18 @@ void SfxMedium::Transfer_Impl() // LongName wasn't defined anywhere, only used here... get the Title instead // as it's less probably empty OUString aFileName; -Any aAny = aDestContent.getPropertyValue("Title"); -aAny >>= aFileName; -aAny = aDestContent.getPropertyValue( "ObjectId" ); OUString sObjectId; -aAny >>= sObjectId; +try +{ +Any aAny = aDestContent.getPropertyValue("Title"); +aAny >>= aFileName; +aAny = aDestContent.getPropertyValue("ObjectId"); +aAny >>= sObjectId; +} +catch (uno::Exception const&) +{ +SAL_INFO("sfx.doc", "exception while getting Title or ObjectId"); +} if ( aFileName.isEmpty() ) aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset );
[Libreoffice-commits] core.git: sfx2/source sw/inc sw/qa sw/source
sfx2/source/control/thumbnailviewitem.cxx |4 ++-- sw/inc/crstate.hxx|2 +- sw/inc/editsh.hxx |2 +- sw/inc/tgrditem.hxx |6 +++--- sw/qa/core/layout/flycnt.cxx |4 ++-- sw/source/core/access/accdoc.cxx |2 +- sw/source/core/access/accportions.cxx |2 +- sw/source/core/doc/doc.cxx| 11 ++- sw/source/core/edit/editsh.cxx|4 ++-- sw/source/core/inc/txtfrm.hxx | 10 +- sw/source/core/layout/atrfrm.cxx |2 +- sw/source/core/layout/layact.cxx |8 sw/source/core/text/frmpaint.cxx |4 ++-- sw/source/core/text/itradj.cxx|6 +++--- sw/source/core/text/itrcrsr.cxx |2 +- sw/source/core/text/itrtxt.hxx|4 ++-- sw/source/core/text/txtfrm.cxx| 10 +- sw/source/core/text/widorp.cxx|8 sw/source/ui/misc/pggrid.cxx |2 +- 19 files changed, 47 insertions(+), 46 deletions(-) New commits: commit 2f5bffafe4f653aa4ce86f7a27305587680cba58 Author: Bogdan B AuthorDate: Fri Nov 25 00:16:27 2022 +0100 Commit: Hossein CommitDate: Mon Jun 5 13:53:16 2023 +0200 tdf#152431 Fix line count resets to zero after 65535 GetLineCount was a sal_uInt16 value, that allows only 65535 lines to be counted. This is changed to sal_Int32 and also the underlying data type for the lines number is changed from sal_uLong to sal_Int32, but not for pages number. With this change, the maximum possible line number is now increased to 2^31-1 = 2,147,483,647. Change-Id: Ibee2d24e638204133f0ef085564016543f73d351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143173 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index ca092bc18e1c..8b2b8a4ea2a4 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -227,9 +227,9 @@ void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const Thumbnai rSeq.resize(nFinalPrimCount); // Create the text primitives -sal_uInt16 nLineStart = 0; +sal_Int32 nLineStart = 0; OUString aText(aOrigText); -for (sal_uInt16 i=0; i < aTextEngine.GetLineCount(0); ++i) +for (sal_Int32 i=0; i < aTextEngine.GetLineCount(0); ++i) { sal_Int32 nLineLength = aTextEngine.GetLineLen(0, i); double nLineWidth = aTextDev.getTextWidth (aText, nLineStart, nLineLength); diff --git a/sw/inc/crstate.hxx b/sw/inc/crstate.hxx index 9b223319fd93..acf13bfe45d7 100644 --- a/sw/inc/crstate.hxx +++ b/sw/inc/crstate.hxx @@ -108,7 +108,7 @@ enum class SwSPExtendRange : sal_uInt8 struct SwSpecialPos { sal_Int32 nCharOfst; -sal_uInt16 nLineOfst; +sal_Int32 nLineOfst; SwSPExtendRange nExtendRange; // #i27615# diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 8711b132c745..41650792e10b 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -856,7 +856,7 @@ public: bool IsOutlineMovable( SwOutlineNodes::size_type nIdx ) const; bool IsOutlineCopyable( SwOutlineNodes::size_type nIdx ) const; -sal_uInt16 GetLineCount(); +sal_Int32 GetLineCount(); /// Query and set footnote-text/number. Set... to current SSelection! bool GetCurFootnote( SwFormatFootnote* pToFillFootnote = nullptr ); diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx index 4afcb24d9d92..3c37018192a4 100644 --- a/sw/inc/tgrditem.hxx +++ b/sw/inc/tgrditem.hxx @@ -33,7 +33,7 @@ class SW_DLLPUBLIC SwTextGridItem final : public SfxPoolItem { private: Color m_aColor; -sal_uInt16 m_nLines; +sal_Int32 m_nLines; sal_uInt16 m_nBaseHeight; sal_uInt16 m_nRubyHeight; SwTextGrid m_eGridType; @@ -69,8 +69,8 @@ public: const Color& GetColor() const { return m_aColor; } void SetColor( const Color& rCol ) { m_aColor = rCol; } -sal_uInt16 GetLines() const { return m_nLines; } -void SetLines( sal_uInt16 nNew ) { m_nLines = nNew; } +sal_Int32 GetLines() const { return m_nLines; } +void SetLines( sal_Int32 nNew ) { m_nLines = nNew; } sal_uInt16 GetBaseHeight() const { return m_nBaseHeight; } void SetBaseHeight( sal_uInt16 nNew ) { m_nBaseHeight = nNew; } diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx index 5ed28f38aa5a..7d89a34ac914 100644 --- a/sw/qa/core/layout/flycnt.cxx +++ b/sw/qa/core/layout/flycnt.cxx @@ -438,7 +438,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyWidow) // - Expected: 6 // - Actual : 7 // i.e. widow control was disabled, layout didn't match Word. -CPPUNIT_ASSERT_EQUAL(static_cast(6), pText1->GetThisLines()); +CPPUNIT_ASSERT_EQUAL(static_cast(6), pText1->GetThisLines()); auto pPage2 =
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/recentdocsviewitem.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit f8036f2f5238adf227d0ffa646e503f0446bb37b Author: Heiko Tietze AuthorDate: Wed May 24 12:05:45 2023 +0200 Commit: Heiko Tietze CommitDate: Fri Jun 2 16:07:39 2023 +0200 Resolves tdf#155200 - Don't scale overlay images in start center Thumbnails don't change their size so overlay must not too Change-Id: I83ff2bb60ec619686b583180ebabe194c4a77b23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152193 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 5c7c6ccfd507..9af2c114988f 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -213,6 +213,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri aThumbnail = TemplateLocalView::scaleImg(aThumbnail, nThumbnailSize, nThumbnailSize); BitmapEx aModule = getModuleOverlay(rURL); +aModule.Scale(Size(48,48)); //tdf#155200: Thumbnails don't change their size so overlay must not too if (!aModule.IsEmpty()) { const Size aSize(aThumbnail.GetSizePixel());
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewsh.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 845054aa25b7cba1daa1ff30b142d549027299bd Author: Caolán McNamara AuthorDate: Wed May 31 19:56:24 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 2 11:31:22 2023 +0200 WaE: fix more warnings I see with gcc-13.1.1 Change-Id: I8f1087cb98991363ec78a21a90a55724ba3628ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152466 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152528 Tested-by: Jenkins diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index a818a98380bb..e21afa252762 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -502,7 +502,7 @@ void LOKDocumentFocusListener::notifyEvent( const accessibility::AccessibleEvent if (attribute.Name == "CharHeight" || attribute.Name == "CharWeight") { -float fValue; +float fValue(0.0); attribute.Value >>= fValue; sValue = OUString::number(fValue); } @@ -514,7 +514,7 @@ void LOKDocumentFocusListener::notifyEvent( const accessibility::AccessibleEvent } else if (attribute.Name == "CharUnderline") { -sal_Int16 nValue; +sal_Int16 nValue(0); attribute.Value >>= nValue; sValue = OUString::number(nValue); } @@ -524,7 +524,7 @@ void LOKDocumentFocusListener::notifyEvent( const accessibility::AccessibleEvent } else if (attribute.Name == "Rsid") { -sal_uInt32 nValue; +sal_uInt32 nValue(0); attribute.Value >>= nValue; sValue = OUString::number(nValue); }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewimp.hxx |3 +++ sfx2/source/view/viewsh.cxx | 18 +- 2 files changed, 20 insertions(+), 1 deletion(-) New commits: commit f1ec565d4843284e43614d208b006420732b98e8 Author: Caolán McNamara AuthorDate: Wed May 31 09:54:48 2023 +0100 Commit: Caolán McNamara CommitDate: Wed May 31 15:10:35 2023 +0200 Resolves: tdf#109149 don't poll the Default Printer Name on every query We are queried on every change, so on every keystroke, and we are only using this to fill in the printername inside the label of "Print Directly (printer-name)" On Printer::GetDefaultPrinterName() is implemented with GetDefaultPrinter so don't call this excessively. 5 mins seems a reasonable refresh time. Change-Id: I71e87f26ed022241e09f9ab0eed94d09648ec9b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152415 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 54e8267be658..aa0394591069 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -28,6 +28,7 @@ #include #include #include +#include #include class SfxBaseController; @@ -41,6 +42,8 @@ struct SfxViewShell_Impl aInterceptorContainer; SfxShellArr_Impl aArr; Size aMargin; +OUString m_sDefaultPrinterName; +std::chrono::steady_clock::time_point m_nDefaultPrinterNameFetchTime; bool m_bHasPrintOptions; sal_uInt16 m_nFamily; ::rtl::Reference m_pController; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 934a12f0b5ba..4e414d9c65bf 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -706,7 +706,23 @@ void SfxViewShell::GetState_Impl( SfxItemSet ) if ( pPrinter != nullptr ) aPrinterName = pPrinter->GetName(); else -aPrinterName = Printer::GetDefaultPrinterName(); +{ +// tdf#109149 don't poll the Default Printer Name on every query. +// We are queried on every change, so on every +// keystroke, and we are only using this to fill in the +// printername inside the label of "Print Directly (printer-name)" +// On Printer::GetDefaultPrinterName() is implemented with +// GetDefaultPrinter so don't call this excessively. 5 mins +// seems a reasonable refresh time. +std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); +std::chrono::minutes five_mins(5); +if (now > pImpl->m_nDefaultPrinterNameFetchTime + five_mins) +{ +pImpl->m_sDefaultPrinterName = Printer::GetDefaultPrinterName(); +pImpl->m_nDefaultPrinterNameFetchTime = now; +} +aPrinterName = pImpl->m_sDefaultPrinterName; +} if ( !aPrinterName.isEmpty() ) { uno::Reference < frame::XFrame > xFrame( rFrame.GetFrame().GetFrameInterface() );
[Libreoffice-commits] core.git: sfx2/source starmath/qa
sfx2/source/doc/objmisc.cxx |3 ++- starmath/qa/cppunit/test_cursor.cxx |1 + starmath/qa/cppunit/test_node.cxx |1 + starmath/qa/cppunit/test_nodetotextvisitors.cxx |1 + 4 files changed, 5 insertions(+), 1 deletion(-) New commits: commit e7e9991fd06ba2e0484ae5e6b6acc323ab8bf66b Author: Samuel Mehrbrodt AuthorDate: Mon May 8 15:41:27 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon May 22 14:30:10 2023 +0200 tdf#146547 Mark read-only docs as modified when an editable section is changed. Change-Id: I588b09f160974d3a3833bfa011fd07f2ee496616 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151535 Tested-by: Samuel Mehrbrodt Reviewed-by: Samuel Mehrbrodt diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 6b86e2163ccb..dd639c36900d 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -247,7 +247,8 @@ void SfxObjectShell::EnableSetModified( bool bEnable ) bool SfxObjectShell::IsEnableSetModified() const { -return pImpl->m_bEnableSetModified && !IsReadOnly(); +// Don't allow when user explicitly requested read only (IsLoadReadonly() or IsOriginallyLoadedReadOnlyMedium()) +return pImpl->m_bEnableSetModified && ! (IsLoadReadonly() || IsOriginallyLoadedReadOnlyMedium()); } diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 56c673c1bd22..5f4c551675a1 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -58,6 +58,7 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); +xDocShRef->DoInitNew(); } void Test::tearDown() diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index f16f195aa8bc..af9ff177f38f 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -53,6 +53,7 @@ void NodeTest::setUp() mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY); +mxDocShell->DoInitNew(); } void NodeTest::tearDown() diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index 6f714321de82..11ef5affcc4c 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -91,6 +91,7 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); +xDocShRef->DoInitNew(); } void Test::tearDown()
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 52e8b4cae2ee5249e2c3dccecaba4802d0aa50a5 Author: Szymon Kłos AuthorDate: Tue May 9 13:05:06 2023 +0200 Commit: Szymon Kłos CommitDate: Wed May 17 13:21:47 2023 +0200 navigator: use toggle available for all apps Change-Id: I3136071ee943b120ebb2ad6491c91d8ebbcd6244 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151573 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151752 Tested-by: Jenkins diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index bf42fc5de078..f6e8378290ed 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3419,8 +3419,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest ) if (comphelper::LibreOfficeKit::isActive()) { ShowChildWindow(SID_SIDEBAR); -OUString panelId = "SdNavigatorPanel"; -::sfx2::sidebar::Sidebar::TogglePanel(panelId, GetFrame().GetFrameInterface()); +::sfx2::sidebar::Sidebar::ShowDeck(u"NavigatorDeck", this, true); rReq.Done(); return; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/lokhelper.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 8abce26253f3ba6bf74ba419775bf2b4a2f23546 Author: Szymon Kłos AuthorDate: Mon Feb 13 13:05:26 2023 +0100 Commit: Henry Castro CommitDate: Fri May 12 13:22:02 2023 +0200 lok: escape notifyWindow message File properties dialog contains problematic characters. In lok case and nl language it was constructing incorrect message so boost JSON parser was throwing an exception and dialog was not created correctly. Change-Id: I7e81c9407fcbf57355c0890c9540ce1f828904e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146900 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150042 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150389 Tested-by: Jenkins diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 6f7f9ee60dd2..22b5ccc10b34 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -579,8 +579,9 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, { if (!rItem.first.isEmpty() && !rItem.second.isEmpty()) { -aPayload.append(", \"" + rItem.first + "\": \"" + -rItem.second + "\""); +auto aFirst = rItem.first.replaceAll("\"", "\\\""); +auto aSecond = rItem.second.replaceAll("\"", "\\\""); +aPayload.append(", \"" + aFirst + "\": \"" + aSecond + "\""); } } aPayload.append('}');
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/guisaveas.cxx | 34 ++ 1 file changed, 34 insertions(+) New commits: commit 99a88c9e55872214ce01d89447d18708e47e956b Author: Justin Luth AuthorDate: Thu May 11 15:28:55 2023 -0400 Commit: Justin Luth CommitDate: Fri May 12 02:00:56 2023 +0200 tdf#134901: update print statistics on PDF export From a modern point of view, a PDF export could be considered a print event. If one agrees with that point of view, then updating the print statistics whenever a PDF is generated makes sense. That is what the bug report requested, and what this patch does. That is what MS Word does also. Downsides: -there is no setting for a user to disagree with this bug's POV. -doesn't work for Send - Email a PDF -open a doc: export to PDF: close -> "Do you want to save changes?" -I tested on --headless --convert-to pdf -> no problems -a setting does exist to avoid modified status by printing. -that setting defaults to avoid modifying the status - YAY! -the print date is changed even if the export fails -NEEDS to be changed before export: time needed in PDF itself -didn't seem important enough to waste the time coding it. -for real printers the old print date is restored on failure. Change-Id: I0d1387c1c2c925f3be772c5bdad7187f9f6a4d7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151682 Reviewed-by: Justin Luth Tested-by: Jenkins Tested-by: Justin Luth diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 3785585b44d8..b6d4ce61d8a6 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -70,7 +70,9 @@ #include #include #include +#include +#include #include #include #include @@ -1732,6 +1734,38 @@ bool SfxStoringHelper::FinishGUIStoreModel(::comphelper::SequenceAsHashMap::cons DocumentSettingsGuard aSettingsGuard( aModelData.GetModel(), aModelData.IsRecommendReadOnly(), nStoreMode & EXPORT_REQUESTED ); +// Treat attempted PDF export like a print: update document print statistics +if ((nStoreMode & PDFEXPORT_REQUESTED) && SfxViewShell::Current()) +{ +SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell(); +const bool bWasEnableSetModified = pDocShell && pDocShell->IsEnableSetModified(); +bool bResetESM = false; + +if (bWasEnableSetModified +&& !officecfg::Office::Common::Print::PrintingModifiesDocument::get()) +{ +pDocShell->EnableSetModified(false); // don't let export mark document as modified +bResetESM = true; +} + +uno::Reference xDPS( +aModelData.GetModel(), uno::UNO_QUERY_THROW); +uno::Reference xDocProps(xDPS->getDocumentProperties()); +xDocProps->setPrintDate(DateTime(DateTime::SYSTEM).GetUNODateTime()); + +OUString sPrintedBy(SfxResId(STR_SFX_FILTERNAME_PDF)); +if (pDocShell && pDocShell->IsUseUserData()) +{ +const OUString& sFullName = SvtUserOptions().GetFullName(); +if (!sFullName.isEmpty()) +sPrintedBy += ": " + sFullName; +} +xDocProps->setPrintedBy(sPrintedBy); + +if (bResetESM) +pDocShell->EnableSetModified(true); +} + OSL_ENSURE( aModelData.GetMediaDescr().find( OUString( "Password" ) ) == aModelData.GetMediaDescr().end(), "The Password property of MediaDescriptor should not be used here!" ); if ( officecfg::Office::Common::Save::Document::EditProperty::get() && ( !aModelData.GetStorable()->hasLocation()
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/printhelper.cxx | 43 +++- 1 file changed, 12 insertions(+), 31 deletions(-) New commits: commit 7acdb3c81f168321977e56995b27f0fe0c36dc1e Author: Julien Nabet AuthorDate: Sun May 7 17:49:31 2023 +0200 Commit: Julien Nabet CommitDate: Sun May 7 19:12:46 2023 +0200 Simplify some initializations in sfx2/source/doc/printhelper.cxx Change-Id: Ia85598b6558f8f34187f40d6f5e5285bbc28abf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151471 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 732aca4f3a33..6ca15e6cdbd9 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -266,37 +267,17 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() if ( !pPrinter ) return uno::Sequence< beans::PropertyValue >(); -uno::Sequence< beans::PropertyValue > aPrinter(8); - -aPrinter.getArray()[7].Name = "CanSetPaperSize"; -aPrinter.getArray()[7].Value <<= pPrinter->HasSupport( PrinterSupport::SetPaperSize ); - -aPrinter.getArray()[6].Name = "CanSetPaperFormat"; -aPrinter.getArray()[6].Value <<= pPrinter->HasSupport( PrinterSupport::SetPaper ); - -aPrinter.getArray()[5].Name = "CanSetPaperOrientation"; -aPrinter.getArray()[5].Value <<= pPrinter->HasSupport( PrinterSupport::SetOrientation ); - -aPrinter.getArray()[4].Name = "IsBusy"; -aPrinter.getArray()[4].Value <<= pPrinter->IsPrinting(); - -aPrinter.getArray()[3].Name = "PaperSize"; -awt::Size aSize = impl_Size_Object2Struct(pPrinter->GetPaperSize() ); -aPrinter.getArray()[3].Value <<= aSize; - -aPrinter.getArray()[2].Name = "PaperFormat"; -view::PaperFormat eFormat = convertToPaperFormat(pPrinter->GetPaper()); -aPrinter.getArray()[2].Value <<= eFormat; - -aPrinter.getArray()[1].Name = "PaperOrientation"; -view::PaperOrientation eOrient = static_cast(pPrinter->GetOrientation()); -aPrinter.getArray()[1].Value <<= eOrient; - -aPrinter.getArray()[0].Name = "Name"; -OUString sStringTemp = pPrinter->GetName() ; -aPrinter.getArray()[0].Value <<= sStringTemp; - -return aPrinter; +return +{ +comphelper::makePropertyValue("Name", pPrinter->GetName()), +comphelper::makePropertyValue("PaperOrientation", static_cast(pPrinter->GetOrientation())), +comphelper::makePropertyValue("PaperFormat", convertToPaperFormat(pPrinter->GetPaper())), +comphelper::makePropertyValue("PaperSize", impl_Size_Object2Struct(pPrinter->GetPaperSize() )), +comphelper::makePropertyValue("IsBusy", pPrinter->IsPrinting()), +comphelper::makePropertyValue("CanSetPaperOrientation", pPrinter->HasSupport( PrinterSupport::SetOrientation )), +comphelper::makePropertyValue("CanSetPaperFormat", pPrinter->HasSupport( PrinterSupport::SetPaper )), +comphelper::makePropertyValue("CanSetPaperSize", pPrinter->HasSupport( PrinterSupport::SetPaperSize )) +}; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/appdispatchprovider.cxx |2 +- sfx2/source/appl/macroloader.cxx |2 +- sfx2/source/control/thumbnailview.cxx|3 +-- sfx2/source/control/thumbnailviewacc.cxx |4 ++-- sfx2/source/control/unoctitm.cxx |2 +- sfx2/source/dialog/backingcomp.cxx | 14 +++--- sfx2/source/doc/SfxDocumentMetaData.cxx |2 +- sfx2/source/doc/sfxbasemodel.cxx |4 ++-- sfx2/source/notify/globalevents.cxx |8 sfx2/source/sidebar/SidebarPanelBase.cxx |2 +- sfx2/source/sidebar/Theme.cxx|4 ++-- sfx2/source/view/ipclient.cxx|4 ++-- sfx2/source/view/sfxbasecontroller.cxx | 10 +- 13 files changed, 30 insertions(+), 31 deletions(-) New commits: commit bad7f6376f96a008c1b1a77d262953c13eb8442b Author: Mike Kaganski AuthorDate: Sun Apr 23 20:14:42 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Apr 30 18:53:26 2023 +0200 Use getXWeak in sfx2 Change-Id: I364f13308adf8b3257e53da2bc6576088bb958f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150867 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx index 0ac4f59d88d1..363aa391d568 100644 --- a/sfx2/source/appl/appdispatchprovider.cxx +++ b/sfx2/source/appl/appdispatchprovider.cxx @@ -81,7 +81,7 @@ void SfxAppDispatchProvider::initialize( if (aArguments.getLength() != 1 || !(aArguments[0] >>= f)) { throw css::lang::IllegalArgumentException( "SfxAppDispatchProvider::initialize expects one XFrame argument", -static_cast(this), 0); +getXWeak(), 0); } m_xFrame = f; } diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index bf6dd7669b39..da9f83a2b7c1 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -133,7 +133,7 @@ void SAL_CALL SfxMacroLoader::dispatchWithNotification( // executed a macro instead! frame::DispatchResultEvent aEvent; -aEvent.Source = static_cast< ::cppu::OWeakObject* >(this); +aEvent.Source = getXWeak(); if( nErr == ERRCODE_NONE ) aEvent.State = frame::DispatchResultState::SUCCESS; else diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 8ec9b80ea6d4..e48dea30e7d5 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -1115,8 +1115,7 @@ void ThumbnailView::SelectItem( sal_uInt16 nItemId ) if( pItemAcc ) { css::uno::Any aOldAny, aNewAny; -aNewAny <<= css::uno::Reference< css::uno::XInterface >( -static_cast< ::cppu::OWeakObject* >( pItemAcc )); +aNewAny <<= css::uno::Reference(getXWeak( pItemAcc )); ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny ); } diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx index f4ec85e5a89a..54a3af71fb93 100644 --- a/sfx2/source/control/thumbnailviewacc.cxx +++ b/sfx2/source/control/thumbnailviewacc.cxx @@ -490,7 +490,7 @@ void ThumbnailViewAcc::ThrowIfDisposed() SAL_WARN("sfx", "Calling disposed object. Throwing exception:"); throw lang::DisposedException ( "object has been already disposed", -static_cast(this)); +getXWeak()); } else { @@ -523,7 +523,7 @@ void ThumbnailViewAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOld accessibility::AccessibleEventObject aEvtObject; aEvtObject.EventId = nEventId; -aEvtObject.Source = static_cast(this); +aEvtObject.Source = getXWeak(); aEvtObject.NewValue = rNewValue; aEvtObject.OldValue = rOldValue; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index e7b84138e436..bfc155599a17 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -115,7 +115,7 @@ static void InterceptLOKStateChangeEvent( sal_uInt16 nSID, SfxViewFrame* pViewFr void SfxStatusDispatcher::ReleaseAll() { css::lang::EventObject aObject; -aObject.Source = static_cast(this); +aObject.Source = getXWeak(); std::unique_lock aGuard(maMutex); maListeners.disposeAndClear( aGuard, aObject ); } diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 845435ddc4f4..2f3dc01744fc 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -329,12 +329,12 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f if (m_xFrame.is()) throw css::uno::RuntimeException( "already attached", -static_cast< ::cppu::OWeakObject* >(this)); +getXWeak()); if (!xFrame.is()) throw
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit ed4d4d47ea322236199b1f8ff97ddd945b099cbe Author: Michael Stahl AuthorDate: Wed Apr 26 16:15:32 2023 +0200 Commit: Michael Stahl CommitDate: Thu Apr 27 15:44:57 2023 +0200 tdf#151715 sfx2: do not use FORCERELOAD for document stored in /tmp This does not fix the actual bug, but is a workaround for a bug somewhere in the Notebookbar code that was exposed by commit 5b5fb5e9c0580ecb70cf65882865bdaf16498fa5 "sfx2: do reload on SID_EDITDOC in SfxViewFrame::ExecReload_Impl()". For an ODF file, the Notebookbar is switched to editable by the call to SetReadOnlyUI() from ReadOnlyUIGuard, but the XLS file takes a different path and SetReadOnlyUI() is called in line 819. Here the SfxViewFrame is not yet connected to the SfxObjectShell so unsurprisingly it does not affect the UI; more surprising is that moving the call to around line 859 leads to the SfxHintId::ModeChanged event being handled in SfxViewFrame::Notify() with lots of things invalidated, but the NotebookBar is entirely unimpressed by that. Change-Id: I16f321bb3444eeae76348e20816af02938c3f46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151089 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e5bf83088468..d62090bad118 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -596,7 +596,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } rReq.AppendItem( SfxBoolItem(SID_FORCERELOAD, -rReq.GetSlot() == SID_EDITDOC || bNeedsReload) ); +(rReq.GetSlot() == SID_EDITDOC + // tdf#151715 exclude files loaded from /tmp to avoid Notebookbar bugs + && (!pSh->IsOriginallyReadOnlyMedium() || pSh->IsOriginallyLoadedReadOnlyMedium())) +|| bNeedsReload) ); rReq.AppendItem( SfxBoolItem( SID_SILENT, true )); [[fallthrough]]; //TODO ???
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/StyleList.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0f83cbe27b95d991ce171a961950645a1ef67d7a Author: Mike Kaganski AuthorDate: Thu Apr 27 08:26:55 2023 +0200 Commit: Mike Kaganski CommitDate: Thu Apr 27 09:41:34 2023 +0200 Avoid temporary OUString creation Change-Id: I1cebcc2cbd36ed83d4898e222929c872f46c08d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151028 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 7b17137363a7..27481e062590 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -100,7 +100,7 @@ Color ColorHash(std::u16string_view rString) static std::vector aSaturationArray{ 0.90, 0.75, 0.60 }; static std::vector aLightnessArray = aSaturationArray; -sal_uInt32 nStringHash = OUString(rString).hashCode(); +sal_uInt32 nStringHash = rtl_ustr_hashCode_WithLength(rString.data(), rString.length()); double nHue = nStringHash % 359; double nSaturation = aSaturationArray[nStringHash / 360 % aSaturationArray.size()];
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/StyleList.cxx | 42 ++- 1 file changed, 11 insertions(+), 31 deletions(-) New commits: commit 2ff85183b959c05134a2737d6d14afd1882f2ba3 Author: Jim Raykowski AuthorDate: Wed Apr 26 17:16:20 2023 -0800 Commit: Tomaž Vajngerl CommitDate: Thu Apr 27 07:36:30 2023 +0200 tdf#38194 Use a hashed string HSL color approach for style name color creation New magic for style name color creation. Change-Id: Ia6eec2dcf04fc2c3c38276bf6eaed73598505947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151079 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index ce2d2f9bb7d0..7b17137363a7 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -63,6 +63,7 @@ #include #include +#include using namespace css; using namespace css::beans; @@ -94,42 +95,21 @@ public: namespace { -Color ColorHash(const OUString& rString) +Color ColorHash(std::u16string_view rString) { -// method 1 -//Color aColor(rString.hashCode() & 0xFF); +static std::vector aSaturationArray{ 0.90, 0.75, 0.60 }; +static std::vector aLightnessArray = aSaturationArray; -// method 2 borrowed from https://github.com/RolandR/ColorHash/blob/master/colorhash.js -//sal_Int32 nSum = 0; +sal_uInt32 nStringHash = OUString(rString).hashCode(); -//for (int i = 0; i < rString.getLength(); i++) -//{ -//nSum += rString[i]; -//} +double nHue = nStringHash % 359; +double nSaturation = aSaturationArray[nStringHash / 360 % aSaturationArray.size()]; +double nLightness += aLightnessArray[nStringHash / 360 / aSaturationArray.size() % aLightnessArray.size()]; -//sal_uInt8 nRed = OUString("0." + OUString(OUString::number(std::sin(nSum + 1))).copy(6)).toDouble() * 256; -//sal_uInt8 nGreen = OUString("0." + OUString(OUString::number(std::sin(nSum + 2))).copy(6)).toDouble() * 256; -//sal_uInt8 nBlue = OUString("0." + OUString(OUString::number(std::sin(nSum + 3))).copy(6)).toDouble() * 256; +basegfx::BColor aHSLColor(nHue, nSaturation, nLightness); -//Color aColor(nRed, nGreen, nBlue); - -// method 3 std::hash -//const std::hash hasher; -//Color aColor(hasher(rString) & 0xFF); - -// method 4 -sal_uInt32 nLen = rString.getLength(); -sal_uInt32 nHashCode = nLen; -while (nLen > 0) -{ -nHashCode = (nHashCode * 107) + rString[nLen - 1]; -nLen--; -} -sal_uInt32 nColor = nHashCode & 0xFF; -Color aColor(ColorTransparency, nColor); -aColor.ApplyTintOrShade(5000); - -return aColor; +return Color(basegfx::utils::hsl2rgb(aHSLColor)); } // used to disallow the default character style in the styles highlighter character styles color map
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/iframe.cxx| 15 --- sfx2/source/inc/eventsupplier.hxx |1 + 2 files changed, 5 insertions(+), 11 deletions(-) New commits: commit 6d6c39f27bad19db7ec60d822e73cdeac9f4d69f Author: Caolán McNamara AuthorDate: Thu Apr 20 20:58:21 2023 +0100 Commit: Caolán McNamara CommitDate: Wed Apr 26 17:23:35 2023 +0200 assume IFrame script/macro support isn't needed seems undocumented at least Change-Id: I316e4f4f25ddb7cf6b7bac4d856a721b987207a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150710 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 812153990c32..1db259994b50 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -168,23 +168,16 @@ sal_Bool SAL_CALL IFrameObject::load( uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) ); xTrans->parseStrict( aTargetURL ); +INetURLObject aURLObject(aTargetURL.Complete); +if (aURLObject.GetProtocol() == INetProtocol::Macro || aURLObject.isSchemeEqualTo(u"vnd.sun.star.script")) +return false; + uno::Reference xParentFrame = xFrame->getCreator(); SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); -if (INetURLObject(aTargetURL.Complete).GetProtocol() == INetProtocol::Macro) -{ -if (pDoc && !pDoc->AdjustMacroMode()) -return false; -} - -if (!SfxEvents_Impl::isScriptURLAllowed(aTargetURL.Complete)) -return false; - bool bUpdateAllowed(true); if (pDoc) { -// perhaps should only check for file targets, but lets default to making it strong -// unless there is a known need to distinguish comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer(); bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); } diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index 316b3b1836d7..56aa8f95e75f 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -81,6 +81,7 @@ public: SfxObjectShell* i_document ); static void Execute( css::uno::Sequence < css::beans::PropertyValue > const & aEventData, const css::document::DocumentEvent& aTrigger, SfxObjectShell* pDoc ); +private: /// Check if script URL whitelist exists, and if so, if current script url is part of it static bool isScriptURLAllowed(const OUString& aScriptURL); };
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/dispatch.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 57a676cf951eaa65831b32b080cf3da013bf60fb Author: Mike Kaganski AuthorDate: Wed Apr 26 10:52:54 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Apr 26 11:12:28 2023 +0200 Related: tdf#155017 Stop after the first pop in case the shell was not on stack After commit 271f17a6022c64cbbe9befbc66a9eaaa0567d569 (tdf#155017: make sure that the correct shell is popped from SfxDispatcher, 2023-04-26). This restores the previous logic for a hypothetical case of a pop without POP_UNTIL scheduled for a shell, which was not on the stack (so that it wasn't removed in the code added in the commit mentioned above); I haven't a reproducer, but it definitely can happen, given how things work here. So I try to avoid breaking it even further :-) Change-Id: Ied0a1406881fbefe3cf069f816c50da03a41dcd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151034 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index e78789e56271..88377c073155 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1346,6 +1346,13 @@ void SfxDispatcher::FlushImpl() // Mark the moved Shell aToDoCopy.push_front(SfxToDo_Impl(false, i->bDelete, false, *pPopped)); +if (!i->bUntil) +{ +// We get here only when the requested shell was not on the stack. +// I don't know how correct to pop a single random other shell and exit +// in this case, but I just make sure that the previous logic is kept. +break; +} } DBG_ASSERT( bFound, "wrong SfxShell popped" ); }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/dispatch.cxx | 20 1 file changed, 16 insertions(+), 4 deletions(-) New commits: commit 271f17a6022c64cbbe9befbc66a9eaaa0567d569 Author: Mike Kaganski AuthorDate: Tue Apr 25 20:58:30 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Apr 26 06:40:50 2023 +0200 tdf#155017: make sure that the correct shell is popped from SfxDispatcher Honestly, I don't quite understand the idea of using the stack of shells in SfxDispatcher, when the order of addition of shells there does not match the order of removal. After opening the bugdoc, SfxDispatcher has these shells in xImp->aStack (from top to bottom): [8] SwWebView [7] SwWebTableShell [6] SwWebTextShell [5] SwWebListShell [4] FmFormShell [3] SwWebDocShell [2] SfxViewFrame [1] SwModule [0] SfxApplication SfxViewFrame dtor calls ReleaseObjectShell_Impl. * First of all, it calls PopShellAndSubShells_Impl for SfxViewShell; * Then it calls SfxDispatcher::Pop for SfxObjectShell; * Then it calls SfxDispatcher::RemoveShell_Impl for SfxModule; * Then SfxObjectShell is destroyed; * And finally, SfxDispatcher::SetDisableFlags is called. PopShellAndSubShells_Impl (for SfxViewShell) finds the passed SwWebView at the top of the stack (pos. 8), and removes it. SfxDispatcher::Pop for SfxObjectShell queues removal of the passed SwWebDocShell *without* SfxDispatcherPopFlags::POP_UNTIL mode. SfxDispatcher::RemoveShell_Impl first calls Flush, which actually executes the queued actions. At this point, an SwWebTableShell (pos. 7) is the top of the stack; SfxDispatcher::FlushImpl will pop it, and stop (because there was no SfxDispatcherPopFlags::POP_UNTIL at the previous step), so the intended removal of SwWebDocShell (which is at pos. 3) will not happen. Then RemoveShell_Impl will proceed searching for the specific shell (SwModule), and removing specifically that (at pos. 1). At the moment of destruction of object shell, the dispatcher's stack looks like this: [5] SwWebTextShell [4] SwWebListShell [3] FmFormShell [2] SwWebDocShell <-- The problem is here [1] SfxViewFrame [0] SfxApplication and pos.2 points to a destructed object. Finally, SetDisableFlags iterates all the shells still in the stack, setting their flags - and obviously accessing already destroyed object. In debug builds, this crashes reliably; in release builds, where dtors do not fill memory, the access of the just-destroyed objects likely often goes unnoticed. In different documents, the order and the set of shells there is different, e.g. an empty Writer document would have view shell just above object shell, resulting in correct removal of the object shell. I don't know what strategy is intended here. I decided to implement a small change, that makes sure that without POP_UNTIL, popping a shell removes exactly that shell that was requested for removal. Change-Id: I670d024056a5b32d5485f00a4799a8b0bacb6485 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151003 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index b1bb3c7aed27..e78789e56271 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1321,12 +1321,25 @@ void SfxDispatcher::FlushImpl() else { // Actually pop -SfxShell* pPopped = nullptr; bool bFound = false; -do +if (!i->bUntil) +{ +// pop exactly the requested shell +if (auto it = std::find(xImp->aStack.begin(), xImp->aStack.end(), i->pCluster); +it != xImp->aStack.end()) +{ +xImp->aStack.erase(it); +i->pCluster->SetDisableFlags(SfxDisableFlags::NONE); +bFound = true; + +// Mark the moved Shell +aToDoCopy.push_front(SfxToDo_Impl(false, i->bDelete, false, *i->pCluster)); +} +} +while (!bFound) { DBG_ASSERT( !xImp->aStack.empty(), "popping from empty stack" ); -pPopped = xImp->aStack.back(); +SfxShell* pPopped = xImp->aStack.back(); xImp->aStack.pop_back(); pPopped->SetDisableFlags( SfxDisableFlags::NONE ); bFound = (pPopped == i->pCluster); @@ -1334,7 +1347,6 @@ void SfxDispatcher::FlushImpl() // Mark the moved Shell aToDoCopy.push_front(SfxToDo_Impl(false, i->bDelete, false, *pPopped)); } -while(i->bUntil && !bFound); DBG_ASSERT(
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/accessibility/AccessibilityIssue.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 8ce01e886db5c9968909eda0cab93b5f41634f34 Author: Caolán McNamara AuthorDate: Sat Apr 22 21:36:24 2023 +0100 Commit: Caolán McNamara CommitDate: Sun Apr 23 14:07:29 2023 +0200 cid#1524748 Uninitialized pointer field Change-Id: I50becae790146538b5996df15301456d83af2ffd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150811 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/accessibility/AccessibilityIssue.cxx b/sfx2/source/accessibility/AccessibilityIssue.cxx index aa58c3924476..eba2c1931d85 100644 --- a/sfx2/source/accessibility/AccessibilityIssue.cxx +++ b/sfx2/source/accessibility/AccessibilityIssue.cxx @@ -14,6 +14,7 @@ namespace sfx { AccessibilityIssue::AccessibilityIssue(AccessibilityIssueID eIssueID) : m_eIssueID(eIssueID) +, m_pParent(nullptr) { }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/filedlghelper.cxx | 12 ++-- sfx2/source/dialog/filedlgimpl.hxx |2 +- 2 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 04d7c46b0585a730452b8b5f2ed010096df9a3a8 Author: Julien Nabet AuthorDate: Thu Apr 20 12:45:53 2023 +0200 Commit: Julien Nabet CommitDate: Thu Apr 20 15:15:52 2023 +0200 Typo getCurentSfxFilter->getCurrentSfxFilter in sfx2/filedgimpl-helper Change-Id: Ia428e81e9ebefcac521354d1eccb39f891fa9656 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150685 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 1cab715a79ff..5b799bc4e169 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -357,7 +357,7 @@ void FileDialogHelper_Impl::SaveLastUsedFilter() Any( getFilterWithExtension( getFilter() ) ) ); } -std::shared_ptr FileDialogHelper_Impl::getCurentSfxFilter() +std::shared_ptr FileDialogHelper_Impl::getCurrentSfxFilter() { OUString aFilterName = getCurrentFilterUIName(); @@ -445,7 +445,7 @@ void FileDialogHelper_Impl::updateFilterOptionsBox() updateExtendedControl( ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS, -CheckFilterOptionsCapability( getCurentSfxFilter() ) +CheckFilterOptionsCapability( getCurrentSfxFilter() ) ); } @@ -469,7 +469,7 @@ void FileDialogHelper_Impl::updateExportButton() OUString sLabel = maButtonLabel; // filter with options -> append ellipses on export button label -if ( CheckFilterOptionsCapability( getCurentSfxFilter() ) ) +if ( CheckFilterOptionsCapability( getCurrentSfxFilter() ) ) sLabel += "..."; if ( sOldLabel != sLabel ) @@ -501,7 +501,7 @@ void FileDialogHelper_Impl::updateSelectionBox() if ( bSelectionBoxFound ) { -std::shared_ptr pFilter = getCurentSfxFilter(); +std::shared_ptr pFilter = getCurrentSfxFilter(); mbSelectionFltrEnabled = updateExtendedControl( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SfxFilterFlags::SUPPORTSSELECTION ) ) ); @@ -517,7 +517,7 @@ void FileDialogHelper_Impl::enablePasswordBox( bool bInit ) bool bWasEnabled = mbIsPwdEnabled; -std::shared_ptr pCurrentFilter = getCurentSfxFilter(); +std::shared_ptr pCurrentFilter = getCurrentSfxFilter(); mbIsPwdEnabled = updateExtendedControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & SfxFilterFlags::ENCRYPTION ) @@ -1517,7 +1517,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector& rpURLList, // set the filter getRealFilter( rFilter ); -std::shared_ptr pCurrentFilter = getCurentSfxFilter(); +std::shared_ptr pCurrentFilter = getCurrentSfxFilter(); // fill the rpURLList implGetAndCacheFiles( mxFileDlg, rpURLList ); diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index e5910790cc01..20a4cc42f382 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -112,7 +112,7 @@ namespace sfx2 voidloadConfig(); voidsaveConfig(); -std::shared_ptrgetCurentSfxFilter(); +std::shared_ptrgetCurrentSfxFilter(); boolupdateExtendedControl( sal_Int16 _nExtendedControlId, bool _bEnable ); ErrCode getGraphic( const OUString& rURL, Graphic& rGraphic ) const;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/dialog/StyleList.cxx | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) New commits: commit a7e1924a694e3a8616aa2db41ab08e0d80a51e5b Author: Xisco Fauli AuthorDate: Wed Apr 19 12:45:01 2023 +0200 Commit: Xisco Fauli CommitDate: Wed Apr 19 13:58:24 2023 +0200 sfx2: fix crash in StyleList::CustomRenderHdl GetFamilyItem() might return nullptr See https://crashreport.libreoffice.org/stats/signature/StyleList::CustomRenderHdl(std::tuple%3COutputDevice%20&,tools::Rectangle%20const%20&,bool,rtl::OUString%20const%20&%3E) Change-Id: I099f045232aac710c4f26148de5e798d00ecc7ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150602 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index be63cb5c6e31..dd8475052578 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -1556,21 +1556,24 @@ IMPL_LINK(StyleList, CustomRenderHdl, weld::TreeView::render_args, aPayload, voi if (pStyleManager) { -const SfxStyleFamilyItem* pItem = GetFamilyItem(); -SfxStyleSheetBase* pStyleSheet = pStyleManager->Search(rId, pItem->GetFamily()); - -if (pStyleSheet) +if (const SfxStyleFamilyItem* pItem = GetFamilyItem()) { -rRenderContext.Push(vcl::PushFlags::ALL); -// tdf#119919 - show "hidden" styles as disabled to not move children onto root node -if (pStyleSheet->IsHidden()) -rRenderContext.SetTextColor(rStyleSettings.GetDisableColor()); - -sal_Int32 nSize = aRect.GetHeight(); -std::unique_ptr pStylePreviewRenderer( -pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize)); -bSuccess = pStylePreviewRenderer->recalculate() && pStylePreviewRenderer->render(aRect); -rRenderContext.Pop(); +SfxStyleSheetBase* pStyleSheet = pStyleManager->Search(rId, pItem->GetFamily()); + +if (pStyleSheet) +{ +rRenderContext.Push(vcl::PushFlags::ALL); +// tdf#119919 - show "hidden" styles as disabled to not move children onto root node +if (pStyleSheet->IsHidden()) + rRenderContext.SetTextColor(rStyleSettings.GetDisableColor()); + +sal_Int32 nSize = aRect.GetHeight(); +std::unique_ptr pStylePreviewRenderer( +pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize)); +bSuccess += pStylePreviewRenderer->recalculate() && pStylePreviewRenderer->render(aRect); +rRenderContext.Pop(); +} } }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/control/thumbnailviewacc.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit 86bbf9a4eca0e96b282f656c7dc0cf11ff80c9f9 Author: Michael Weghorn AuthorDate: Fri Apr 14 17:33:13 2023 +0300 Commit: Michael Weghorn CommitDate: Sat Apr 15 05:38:19 2023 +0200 a11y: Report focusable and focused state for ThumbnailViewItem Basically the same as Change-Id I3f14047fe721c4a2bc0c6acb2d32f185d0eed204 "a11y: Report focusable and focused state for ValueSetItem", but for `ThumbnailViewItemAcc`. Makes Orca with the qt6 VCL plugin announce the selected/focused item in the recent documents view in the LO start center. Change-Id: I8ab259ce6649904b42367ac30e4efbd6ab62cb6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150419 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx index f157b155cddd..f4ec85e5a89a 100644 --- a/sfx2/source/control/thumbnailviewacc.cxx +++ b/sfx2/source/control/thumbnailviewacc.cxx @@ -677,15 +677,14 @@ sal_Int64 SAL_CALL ThumbnailViewItemAcc::getAccessibleStateSet() if ( !mbIsTransientChildrenDisabled ) nStateSet |= accessibility::AccessibleStateType::TRANSIENT; -// SELECTABLE nStateSet |= accessibility::AccessibleStateType::SELECTABLE; -// pStateSet->AddState( accessibility::AccessibleStateType::FOCUSABLE ); +nStateSet |= accessibility::AccessibleStateType::FOCUSABLE; -// SELECTED if( mpParent->isSelected() ) { nStateSet |= accessibility::AccessibleStateType::SELECTED; -// pStateSet->AddState( accessibility::AccessibleStateType::FOCUSED ); +if (mpParent->mrParent.HasChildFocus()) +nStateSet |= accessibility::AccessibleStateType::FOCUSED; } }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/iframe.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 52aa46468531918eabfa2031dedf50377ae72cf7 Author: Caolán McNamara AuthorDate: Thu Apr 13 11:49:18 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Apr 13 16:45:29 2023 +0200 query getUserAllowsLinkUpdate for the case of content in a floating frame similarly to how it works for the more common "normal" embedded objects Change-Id: I83e38dfa2f84907c2de9680e91f779d34864a9ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149971 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 0bea24b14c69..812153990c32 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -180,6 +180,17 @@ sal_Bool SAL_CALL IFrameObject::load( if (!SfxEvents_Impl::isScriptURLAllowed(aTargetURL.Complete)) return false; +bool bUpdateAllowed(true); +if (pDoc) +{ +// perhaps should only check for file targets, but lets default to making it strong +// unless there is a known need to distinguish +comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer(); +bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); +} +if (!bUpdateAllowed) +return false; + OUString sReferer; if (pDoc && pDoc->HasName()) sReferer = pDoc->GetMedium()->GetName();
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/iframe.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit dde90d1d06ab5f660d8f2cc729587698361e6748 Author: Caolán McNamara AuthorDate: Tue Apr 11 10:13:37 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 11 16:33:53 2023 +0200 set Referer on loading IFrames so tools, options, security, options, "block any links from document not..." applies to their contents. Change-Id: I04839aea6b07a4a76ac147a85045939ccd9c3c79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150221 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index b30063ee382e..3502a116c299 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -167,10 +168,11 @@ sal_Bool SAL_CALL IFrameObject::load( uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) ); xTrans->parseStrict( aTargetURL ); +uno::Reference xParentFrame = xFrame->getCreator(); +SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); + if (INetURLObject(aTargetURL.Complete).GetProtocol() == INetProtocol::Macro) { -uno::Reference xParentFrame = xFrame->getCreator(); -SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); if (pDoc && !pDoc->AdjustMacroMode()) return false; } @@ -178,6 +180,10 @@ sal_Bool SAL_CALL IFrameObject::load( if (!SfxEvents_Impl::isScriptURLAllowed(aTargetURL.Complete)) return false; +OUString sReferer; +if (pDoc && pDoc->HasName()) +sReferer = pDoc->GetMedium()->GetName(); + DBG_ASSERT( !mxFrame.is(), "Frame already existing!" ); VclPtr pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); VclPtr pWin = VclPtr::Create( pParent, maFrmDescr.IsFrameBorderOn() ); @@ -204,7 +210,8 @@ sal_Bool SAL_CALL IFrameObject::load( uno::Sequence < beans::PropertyValue > aProps{ comphelper::makePropertyValue("PluginMode", sal_Int16(2)), comphelper::makePropertyValue("ReadOnly", true), -comphelper::makePropertyValue("InteractionHandler", xInteractionHandler) +comphelper::makePropertyValue("InteractionHandler", xInteractionHandler), +comphelper::makePropertyValue("Referer", sReferer) }; uno::Reference < frame::XDispatch > xDisp = mxFrame->queryDispatch( aTargetURL, "_self", 0 ); if ( xDisp.is() )
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/iframe.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 2da7cb9462a98d37191132b6eec13a3ab0da147a Author: Caolán McNamara AuthorDate: Fri Apr 7 16:44:39 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Apr 7 22:50:57 2023 +0200 set an InteractionHandler with the embedded frame as dialog parent for any warning dialogs that may appear Change-Id: Ibb8f90b60cb1af625b0dc57d2f9fd01964fa9bba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150128 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 8d1504979e3e..b30063ee382e 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -199,9 +200,11 @@ sal_Bool SAL_CALL IFrameObject::load( if ( xFramesSupplier.is() ) mxFrame->setCreator( xFramesSupplier ); +uno::Reference xInteractionHandler(task::InteractionHandler::createWithParent(mxContext, xWin)); uno::Sequence < beans::PropertyValue > aProps{ comphelper::makePropertyValue("PluginMode", sal_Int16(2)), -comphelper::makePropertyValue("ReadOnly", true) +comphelper::makePropertyValue("ReadOnly", true), +comphelper::makePropertyValue("InteractionHandler", xInteractionHandler) }; uno::Reference < frame::XDispatch > xDisp = mxFrame->queryDispatch( aTargetURL, "_self", 0 ); if ( xDisp.is() )
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/shutdownicon.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 94ec3df7733dfbc5f48bc1d1a5f0578572749400 Author: Caolán McNamara AuthorDate: Fri Apr 7 12:33:54 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Apr 7 15:12:51 2023 +0200 set m_bSystemDialogs just once Change-Id: I4ae32628e79902e4ce5534797cacd9ba9e8a177a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150124 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 9490c52d23be..ae214842f61f 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -142,11 +142,10 @@ void ShutdownIcon::deInitSystray() ShutdownIcon::ShutdownIcon( css::uno::Reference< XComponentContext > xContext ) : m_bVeto ( false ), m_bListenForTermination ( false ), -m_bSystemDialogs( false ), + m_bSystemDialogs(officecfg::Office::Common::Misc::UseSystemFileDialog::get()), m_xContext(std::move( xContext )), m_bInitialized( false ) { -m_bSystemDialogs = officecfg::Office::Common::Misc::UseSystemFileDialog::get(); } ShutdownIcon::~ShutdownIcon()
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/linkmgr2.cxx |6 ++ sfx2/source/appl/newhelp.cxx | 11 +++ sfx2/source/appl/sfxhelp.cxx |5 + sfx2/source/control/unoctitm.cxx |4 +--- sfx2/source/dialog/splitwin.cxx| 15 +++ sfx2/source/doc/DocumentMetadataAccess.cxx |3 +-- sfx2/source/view/viewfrm.cxx | 10 +- 7 files changed, 20 insertions(+), 34 deletions(-) New commits: commit 1c8d43d8a9062dbe2cff52b61414e8be6d3b646d Author: Noel Grandin AuthorDate: Thu Mar 30 10:17:04 2023 +0200 Commit: Noel Grandin CommitDate: Thu Mar 30 09:45:16 2023 + loplugin:stringadd in sfx2 when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I72c2afa0b6bddfe00fe09f34eb1b1bf2177461d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149747 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 977ed98518fe..aeefbf10da20 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -458,16 +458,14 @@ void LinkManager::InsertFileLink( return; OUStringBuffer aBuf(64); -aBuf.append(rFileNm); -aBuf.append(sfx2::cTokenSeparator); +aBuf.append(rFileNm + OUStringChar(sfx2::cTokenSeparator)); if (pRange) aBuf.append(*pRange); if (pFilterNm) { -aBuf.append(sfx2::cTokenSeparator); -aBuf.append(*pFilterNm); +aBuf.append(OUStringChar(sfx2::cTokenSeparator) + *pFilterNm); } OUString aCmd = aBuf.makeStringAndClear(); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index fe84c8f44a17..dcd710e16704 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -575,8 +575,7 @@ void IndexTabPage_Impl::InitializeIndex() try { -OUStringBuffer aURL(HELP_URL); -aURL.append(sFactory); +OUStringBuffer aURL(HELP_URL + sFactory); AppendConfigToken(aURL, true); Content aCnt( aURL.makeStringAndClear(), Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); @@ -1002,9 +1001,7 @@ void SearchTabPage_Impl::Search() std::unique_ptr xWaitCursor(new weld::WaitObject(m_pIdxWin->GetFrameWeld())); ClearSearchResults(); RememberSearchText( aSearchText ); -OUStringBuffer aSearchURL(HELP_URL); -aSearchURL.append(aFactory); -aSearchURL.append(HELP_SEARCH_TAG); +OUStringBuffer aSearchURL(HELP_URL + aFactory + HELP_SEARCH_TAG); if (!m_xFullWordsCB->get_active()) aSearchText = sfx2::PrepareSearchString( aSearchText, xBreakIterator, true ); aSearchURL.append(aSearchText); @@ -1216,9 +1213,7 @@ OUString SfxHelpWindow_Impl::buildHelpURL(std::u16string_view sFactory, std::u16string_view sAnchor) { OUStringBuffer sHelpURL(256); -sHelpURL.append(HELP_URL); -sHelpURL.append(sFactory); -sHelpURL.append(sContent); +sHelpURL.append(HELP_URL + sFactory + sContent); AppendConfigToken(sHelpURL, true/*bUseQuestionMark*/); if (!sAnchor.empty()) sHelpURL.append(sAnchor); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 01b35d5ca0c9..d49c76e822a8 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -524,10 +524,7 @@ OUString SfxHelp::CreateHelpURL_Impl( const OUString& aCommandURL, const OUStrin AppendConfigToken( aHelpURL, true ); if ( bHasAnchor ) -{ -aHelpURL.append('#'); -aHelpURL.append(aAnchor); -} +aHelpURL.append("#" + aAnchor); return aHelpURL.makeStringAndClear(); } diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index c340db4005fe..346528d4b0d9 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -893,9 +893,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra if (!comphelper::LibreOfficeKit::isActive()) return; -OUStringBuffer aBuffer; -aBuffer.append(aEvent.FeatureURL.Complete); -aBuffer.append(u'='); +OUStringBuffer aBuffer(aEvent.FeatureURL.Complete + "="); if (aEvent.FeatureURL.Path == "Bold" || aEvent.FeatureURL.Path == "CenterPara" || diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 2abedce119a4..aac6c294b7ff 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -298,12 +298,12 @@ void SfxSplitWindow::dispose() void SfxSplitWindow::SaveConfig_Impl() { // Save configuration -OUStringBuffer aWinData; -aWinData.append('V'); -aWinData.append(static_cast(VERSION)); -aWinData.append(','); -aWinData.append(static_cast(pEmptyWin->nState)); -aWinData.append(','); +OUStringBuffer aWinData
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/objstor.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 0bd23b624035f0796fb161feadf948fd730b7cf8 Author: Caolán McNamara AuthorDate: Wed Mar 29 14:54:36 2023 +0100 Commit: Caolán McNamara CommitDate: Wed Mar 29 15:29:01 2023 + crashtesting: xSource seen as empty reference #17 0x7f42f14f1662 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #18 0x7f42ef64c68f in com::sun::star::uno::Reference::operator-> (this=) at core/include/com/sun/star/uno/Reference.h:385 __PRETTY_FUNCTION__ = { } #19 SfxObjectShell::CopyStoragesOfUnknownMediaType (xSource=..., xTarget=uno::Reference to (OStorage *) 0x561536cddad8, rExceptions=empty uno::Sequence) at core/sfx2/source/doc/objstor.cxx:3566 aSubElementNames = uninitialized uno::SequencePython Exception 'NoneType' object is not iterable: bResult = true #20 0x7f42ef65551d in SfxObjectShell::SaveAsChildren (this=this@entry=0x561536dad540, rMedium=...) at core/sfx2/source/doc/objstor.cxx:3328 xStorage = uno::Reference to (OStorage *) 0x561536cddad8 AutoSaveEvent = false lArgs = { = {m_aMap = std::__debug::unordered_map with 2 elements = {[{maString = "AutoSaveEvent", mnHashCode = 528032507}] = uno::Any(void), [{maString = "FilterName", mnHashCode = -1339490047}] = uno::Any("string": "draw8")}}, static PROP_ABORTED = {{str = Python Exception 'NoneType' object has no attribute 'lazy_string': , more = {refCount = 1073741824, length = 7, buffer = u"Aborted"}}}, static PROP_ASTEMPLATE = , static PROP_COMPONENTDATA = , static PROP_DOCUMENTSERVICE = {{str = "DocumentService", more = {refCount = 1073741824, length = 15, buffer = u"DocumentService"}}}, static PROP_ENCRYPTIONDATA = , static PROP_FILENAME = , static PROP_FILTERNAME = , static PROP_FILTERPROVIDER = , static PROP_FILTEROPTIONS = , static PROP_FRAME = , static PROP_FRAMENAME = , static PROP_HIDDEN = , static PROP_INPUTSTREAM = , static PROP_INTERACTIONHANDLER = , static PROP_AUTHENTICATIONHANDLER = , static PROP_JUMPMARK = , static PROP_MACROEXECUTIONMODE = , static PROP_MEDIATYPE = , static PROP_MINIMIZED = , static PROP_NOAUTOSAVE = , static PROP_OPENNEWVIEW = , static PROP_OUTPUTSTREAM = , static PROP_PASSWORD = , static PROP_POSTDATA = , static PROP_PREVIEW = , static PROP_READONLY = , static PROP_REFERRER = , static PROP_REPLACEABLE = , static PROP_SALVAGEDFILE = , static PROP_SILENT = , static PROP_STATUSINDICATOR = , static PROP_STREAM = , static PROP_STREAMFOROUTPUT = , static PROP_TEMPLATENAME = , static PROP_TITLE = , static PROP_TYPENAME = , static PROP_UCBCONTENT = , static PROP_UPDATEDOCMODE = , static PROP_URL = , static PROP_VERSION = , static PROP_DOCUMENTTITLE = , static PROP_MODEL = , static PROP_VIEWONLY = , static PROP_DOCUMENTBASEURL = , static PROP_SUGGESTEDSAVEASNAME = , static PROP_AUTOSAVEEVENT = } aExceptions = empty uno::Sequence #21 0x7f42ef6555fd in SfxObjectShell::SaveAs (this=this@entry=0x561536dad540, rMedium=...) at core/sfx2/source/doc/objstor.cxx:160 Change-Id: Ie9bb49a8ebff6d985e93c7738da241ff8d61ff2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149724 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 2cc7c3c932f0..4dee93d1e917 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3558,6 +3558,12 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType(const uno::Reference< embed: const uno::Reference< embed::XStorage >& xTarget, const uno::Sequence& rExceptions) { +if (!xSource.is()) +{ +SAL_WARN( "sfx.doc", "SfxObjectShell::GetStorage() failed"); +return false; +} + // This method does not commit the target storage and should not do it bool bResult = true;
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docfile.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 20132d64bbd448950bcbd2b0d31504d5025ac6c7 Author: Jaume Pujantell AuthorDate: Wed Mar 29 14:32:55 2023 +0200 Commit: Andras Timar CommitDate: Wed Mar 29 15:20:45 2023 + tdf#149064 ensure interaction handler is present when transfering with webDAV Change-Id: I7a31f708e6fe01f07c7187aacd4657b5c6156c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149722 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 6b33abb1c3ee..f43213b67e97 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2367,7 +2367,8 @@ void SfxMedium::Transfer_Impl() // a special case, an interaction handler should be used for // authentication in case it is available Reference< css::ucb::XCommandEnvironment > xComEnv; -Reference< css::task::XInteractionHandler > xInteractionHandler = GetInteractionHandler(); +bool bForceInteractionHandler = GetURLObject().isAnyKnownWebDAVScheme(); +Reference< css::task::XInteractionHandler > xInteractionHandler = GetInteractionHandler(bForceInteractionHandler); if (xInteractionHandler.is()) xComEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< css::ucb::XProgressHandler >() );
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/iframe.cxx|4 sfx2/source/inc/eventsupplier.hxx |1 - 2 files changed, 4 insertions(+), 1 deletion(-) New commits: commit 288c0920a8475f9f2c537212e04aa7649192ad8c Author: Samuel Mehrbrodt AuthorDate: Mon Feb 27 15:27:24 2023 +0100 Commit: Samuel Mehrbrodt CommitDate: Mon Mar 6 07:56:18 2023 + Check iframe target for allowed document URLs Change-Id: I00e4192becbc160282a43ab89dcd269f3d1012d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147919 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index e4ea73d707d6..5672f3edbcf5 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -46,6 +46,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -173,6 +174,9 @@ sal_Bool SAL_CALL IFrameObject::load( return false; } +if (!SfxEvents_Impl::isScriptURLAllowed(aTargetURL.Complete)) +return false; + DBG_ASSERT( !mxFrame.is(), "Frame already existing!" ); VclPtr pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); VclPtr pWin = VclPtr::Create( pParent, maFrmDescr.IsFrameBorderOn() ); diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index 56aa8f95e75f..316b3b1836d7 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -81,7 +81,6 @@ public: SfxObjectShell* i_document ); static void Execute( css::uno::Sequence < css::beans::PropertyValue > const & aEventData, const css::document::DocumentEvent& aTrigger, SfxObjectShell* pDoc ); -private: /// Check if script URL whitelist exists, and if so, if current script url is part of it static bool isScriptURLAllowed(const OUString& aScriptURL); };
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/doctemplates.cxx | 347 ++- 1 file changed, 130 insertions(+), 217 deletions(-) New commits: commit aa189d601146ce8c44127e98e87935c90cec98cb Author: Noel Grandin AuthorDate: Tue Feb 28 14:07:06 2023 +0200 Commit: Noel Grandin CommitDate: Wed Mar 1 08:40:50 2023 + merge SfxDocTplService and SfxDocTplService_Impl no need for the pimpl pattern here Change-Id: I8b18df1dc4769bc6f3cc49c1d59910a0cd61d471 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147969 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 80b7b600871c..06f125ec9e15 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -177,8 +177,57 @@ public: { return uno::Reference(); } }; -class SfxDocTplService_Impl +class SfxDocTplService : public ::cppu::WeakImplHelper< css::lang::XLocalizable, css::frame::XDocumentTemplates, css::lang::XServiceInfo > { +public: +explicit SfxDocTplService( const css::uno::Reference < uno::XComponentContext >& xContext ); +virtual ~SfxDocTplService() override; + +virtual OUString SAL_CALL getImplementationName() override +{ +return "com.sun.star.comp.sfx2.DocumentTemplates"; +} + +virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override +{ +return cppu::supportsService(this, ServiceName); +} + +virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override +{ +css::uno::Sequence< OUString > aSeq { "com.sun.star.frame.DocumentTemplates" }; +return aSeq; +} + + +// --- XLocalizable --- +void SAL_CALL setLocale( const css::lang::Locale & eLocale ) override; +css::lang::Locale SAL_CALL getLocale() override; + +// --- XDocumentTemplates --- +css::uno::Reference< css::ucb::XContent > SAL_CALL getContent() override; +sal_Bool SAL_CALL storeTemplate( const OUString& GroupName, + const OUString& TemplateName, + const css::uno::Reference< css::frame::XStorable >& Storable ) override; +sal_Bool SAL_CALL addTemplate( const OUString& GroupName, + const OUString& TemplateName, + const OUString& SourceURL ) override; +sal_Bool SAL_CALL removeTemplate( const OUString& GroupName, +const OUString& TemplateName ) override; +sal_Bool SAL_CALL renameTemplate( const OUString& GroupName, +const OUString& OldTemplateName, +const OUString& NewTemplateName ) override; +sal_Bool SAL_CALL addGroup( const OUString& GroupName ) override; +sal_Bool SAL_CALL removeGroup( const OUString& GroupName ) override; +sal_Bool SAL_CALL renameGroup( const OUString& OldGroupName, + const OUString& NewGroupName ) override; +void SAL_CALL update() override; + +private: +boolinit() { if ( !mbIsInitialized ) init_Impl(); return mbIsInitialized; } + +voiddoUpdate(); + uno::Reference< XComponentContext > mxContext; uno::Reference< XCommandEnvironment >maCmdEnv; uno::Reference< XDocumentProperties> m_xDocProps; @@ -278,36 +327,6 @@ class SfxDocTplService_Impl //return true if rURL is a path (or subpath of) a dir which is not a user path //which implies neither it or its contents can be removed boolisInternalTemplateDir(const OUString& rURL) const; -public: -explicitSfxDocTplService_Impl( const uno::Reference< XComponentContext > & xContext ); -~SfxDocTplService_Impl(); - -boolinit() { if ( !mbIsInitialized ) init_Impl(); return mbIsInitialized; } -const Content& getContent() const { return maRootContent; } - -voidsetLocale( const lang::Locale & rLocale ); -lang::LocalegetLocale(); - -boolstoreTemplate( const OUString& rGroupName, - const OUString& rTemplateName, - const uno::Reference< frame::XStorable >& rStorable ); - -booladdTemplate( const OUString& rGroupName, - const OUString& rTemplateName, -
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docfile.cxx | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) New commits: commit 81d0b3569fc49525feba61fb2f81c90e152cbb30 Author: Mike Kaganski AuthorDate: Mon Feb 27 10:05:48 2023 +0300 Commit: Mike Kaganski CommitDate: Mon Feb 27 08:09:02 2023 + Simplify a bit Change-Id: I78f5dd63a70d52e7e0b257eed1c668bead2039d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147856 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index c81b79e8ec4e..6b33abb1c3ee 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -633,11 +633,19 @@ Reference < XContent > SfxMedium::GetContent() const OUString SfxMedium::GetBaseURL( bool bForSaving ) { +if (bForSaving) +{ +bool bIsRemote = IsRemote(); +if ((bIsRemote && !officecfg::Office::Common::Save::URL::Internet::get()) +|| (!bIsRemote && !officecfg::Office::Common::Save::URL::FileSystem::get())) +return OUString(); +} + +if (const SfxStringItem* pBaseURLItem = GetItemSet()->GetItem(SID_DOC_BASEURL)) +return pBaseURLItem->GetValue(); + OUString aBaseURL; -const SfxStringItem* pBaseURLItem = GetItemSet()->GetItem(SID_DOC_BASEURL); -if ( pBaseURLItem ) -aBaseURL = pBaseURLItem->GetValue(); -else if (!utl::ConfigManager::IsFuzzing() && GetContent().is()) +if (!utl::ConfigManager::IsFuzzing() && GetContent().is()) { try { @@ -651,15 +659,6 @@ OUString SfxMedium::GetBaseURL( bool bForSaving ) if ( aBaseURL.isEmpty() ) aBaseURL = GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); } - -if ( bForSaving ) -{ -bool bIsRemote = IsRemote(); -if( (bIsRemote && !officecfg::Office::Common::Save::URL::Internet::get()) -|| (!pImpl->m_bRemote && !officecfg::Office::Common::Save::URL::FileSystem::get()) ) -return OUString(); -} - return aBaseURL; }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/doctempl.cxx | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) New commits: commit 3950df2b87f4657f196d56828a782e66c86ff790 Author: Noel Grandin AuthorDate: Mon Feb 20 14:43:59 2023 +0200 Commit: Noel Grandin CommitDate: Wed Feb 22 06:24:33 2023 + osl::Mutex->std::mutex in SfxDocTemplate_Impl Change-Id: Iaf1530a34841ca1140599cea6d941aa2200ade66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147326 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index b585e8fef58f..d1aa03259983 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -19,10 +19,10 @@ #include +#include #include #include -#include #include #include @@ -174,7 +174,7 @@ class SfxDocTemplate_Impl : public SvRefBase uno::Reference< XPersist > mxInfo; uno::Reference< XDocumentTemplates > mxTemplates; -::osl::MutexmaMutex; +std::mutex maMutex; OUStringmaRootURL; OUStringmaStandardGroup; std::vector> maRegions; @@ -197,9 +197,10 @@ public: voidDecrementLock(); boolConstruct( ); -voidCreateFromHierarchy( Content ); +voidCreateFromHierarchy( std::unique_lock& rGuard, Content ); voidReInitFromComponent(); -voidAddRegion( const OUString& rTitle, +voidAddRegion( std::unique_lock& rGuard, + const OUString& rTitle, Content& rContent ); voidRescan(); @@ -1435,14 +1436,14 @@ SfxDocTemplate_Impl::~SfxDocTemplate_Impl() void SfxDocTemplate_Impl::IncrementLock() { -::osl::MutexGuard aGuard( maMutex ); +std::unique_lock aGuard( maMutex ); mnLockCounter++; } void SfxDocTemplate_Impl::DecrementLock() { -::osl::MutexGuard aGuard( maMutex ); +std::unique_lock aGuard( maMutex ); if ( mnLockCounter ) mnLockCounter--; } @@ -1481,7 +1482,8 @@ void SfxDocTemplate_Impl::DeleteRegion( size_t nIndex ) /* AddRegion adds a Region to the RegionList */ -void SfxDocTemplate_Impl::AddRegion( const OUString& rTitle, +void SfxDocTemplate_Impl::AddRegion( std::unique_lock& /*rGuard*/, + const OUString& rTitle, Content& rContent ) { auto pRegion = std::make_unique( this, rTitle ); @@ -1517,7 +1519,7 @@ void SfxDocTemplate_Impl::AddRegion( const OUString& rTitle, } -void SfxDocTemplate_Impl::CreateFromHierarchy( Content ) +void SfxDocTemplate_Impl::CreateFromHierarchy( std::unique_lock& rGuard, Content ) { uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps { TITLE }; @@ -1551,7 +1553,7 @@ void SfxDocTemplate_Impl::CreateFromHierarchy( Content ) const OUString aId = xContentAccess->queryContentIdentifierString(); Content aContent( aId, aCmdEnv, comphelper::getProcessComponentContext() ); -AddRegion( xRow->getString( 1 ), aContent ); +AddRegion( rGuard, xRow->getString( 1 ), aContent ); } } catch ( Exception& ) {} @@ -1560,7 +1562,7 @@ void SfxDocTemplate_Impl::CreateFromHierarchy( Content ) bool SfxDocTemplate_Impl::Construct( ) { -::osl::MutexGuard aGuard( maMutex ); +std::unique_lock aGuard( maMutex ); if ( mbConstructed ) return true; @@ -1587,7 +1589,7 @@ bool SfxDocTemplate_Impl::Construct( ) maStandardGroup = DocTemplLocaleHelper::GetStandardGroupString(); Content aTemplRoot( aRootContent, aCmdEnv, xContext ); -CreateFromHierarchy( aTemplRoot ); +CreateFromHierarchy( aGuard, aTemplRoot ); return true; } @@ -1602,15 +1604,14 @@ void SfxDocTemplate_Impl::ReInitFromComponent() uno::Reference < XCommandEnvironment > aCmdEnv; Content aTemplRoot( aRootContent, aCmdEnv, comphelper::getProcessComponentContext() ); Clear(); -CreateFromHierarchy( aTemplRoot ); +std::unique_lock aGuard(maMutex); +CreateFromHierarchy( aGuard, aTemplRoot ); } } bool SfxDocTemplate_Impl::InsertRegion( std::unique_ptr pNew, size_t nPos ) { -::osl::MutexGuard aGuard( maMutex ); - // return false (not inserted) if the entry already exists for (auto const& pRegion : maRegions) if ( pRegion->Compare( pNew.get() ) == 0 ) @@ -1649,7 +1650,8 @@ void SfxDocTemplate_Impl::Rescan() uno::Reference < XCommandEnvironment > aCmdEnv; Content aTemplRoot( aRootContent, aCmdEnv, comphelper::getProcessComponentContext() ); -CreateFromHierarchy( aTemplRoot ); +std::unique_lock aGuard(maMutex); +CreateFromHierarchy( aGuard, aTemplRoot );
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/docmacromode.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 8d8d01140c299e49afd188a9b7e1ac2860099e8c Author: Samuel Mehrbrodt AuthorDate: Mon Jan 30 14:36:25 2023 +0100 Commit: Samuel Mehrbrodt CommitDate: Thu Feb 9 15:21:38 2023 + Remove unused field Change-Id: I6eda3b236c5b270c75947ca3313987e467d05982 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146693 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index b7bdd816f79e..a231daba348f 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -72,12 +72,10 @@ namespace sfx2 struct DocumentMacroMode_Data { IMacroDocumentAccess& m_rDocumentAccess; -boolm_bDocMacroDisabledMessageShown; bool m_bHasUnsignedContentError; explicit DocumentMacroMode_Data( IMacroDocumentAccess& rDocumentAccess ) :m_rDocumentAccess( rDocumentAccess ) -,m_bDocMacroDisabledMessageShown( false ) ,m_bHasUnsignedContentError( false ) { }
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/doc/guisaveas.cxx|7 +++ sfx2/source/doc/sfxbasemodel.cxx |6 ++ 2 files changed, 13 insertions(+) New commits: commit f16f69f719b7efa99a2b3a4d73dffc2777d5d425 Author: Szymon Kłos AuthorDate: Mon Jan 23 14:32:15 2023 +0100 Commit: Szymon Kłos CommitDate: Mon Feb 6 16:30:59 2023 + lok: send status for file export dialogs Change-Id: I21530abc89808beb4c794f912e9453d8552c3b01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146006 Reviewed-by: Ashod Nakashian Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146573 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index dc32d10c103b..cdda49e10b72 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -674,12 +674,19 @@ IMPL_LINK( ModelData_Impl, OptionsDialogClosedHdl, css::ui::dialogs::DialogClose { if (pEvt->DialogResult == RET_OK && m_xFilterProperties) { +if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() ) +SfxViewShell::Current()->libreOfficeKitViewCallback( LOK_CALLBACK_EXPORT_FILE, "PENDING" ); + const uno::Sequence< beans::PropertyValue > aPropsFromDialog = m_xFilterProperties->getPropertyValues(); for ( const auto& rProp : aPropsFromDialog ) GetMediaDescr()[rProp.Name] = rProp.Value; m_pOwner->CallFinishGUIStoreModel(); } +else if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() ) +{ +SfxViewShell::Current()->libreOfficeKitViewCallback( LOK_CALLBACK_EXPORT_FILE, "ABORT" ); +} } sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus ) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index bcdc9f1be845..dcc559fc4f87 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -63,6 +63,7 @@ #include #include +#include #include #include #include @@ -132,6 +133,8 @@ #include #include +#include + // namespaces @@ -3208,6 +3211,9 @@ void SfxBaseModel::impl_store( const OUString& sURL SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDocFailed : SfxEventHintId::SaveAsDocFailed, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED), m_pData->m_pObjectShell.get() ) ); +if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() ) +SfxViewShell::Current()->libreOfficeKitViewCallback( LOK_CALLBACK_EXPORT_FILE, "ERROR" ); + std::stringstream aErrCode; aErrCode << nErrCode; throw task::ErrorCodeIOException(
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/viewfrm.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 9f698ac2d8d4db274793678efdfbcdde15347e31 Author: Samuel Mehrbrodt AuthorDate: Thu Feb 2 08:37:36 2023 +0100 Commit: Samuel Mehrbrodt CommitDate: Thu Feb 2 08:59:15 2023 + Fix interchanged strings for macros disabled Change-Id: Ie53b455506a55cf07ecade84f484c3f4c1925f8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146487 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index f45075112606..a3b3e551a9db 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1326,9 +1326,9 @@ void SfxViewFrame::AppendContainsMacrosInfobar() if (bHasDocumentMacros || bHasBoundConfigEvents) { -auto aResId = STR_MACROS_DISABLED; +auto aResId = STR_CONTAINS_MACROS; if (SvtSecurityOptions::IsMacroDisabled()) -aResId = STR_CONTAINS_MACROS; +aResId = STR_MACROS_DISABLED; else if (pObjImpl->aMacroMode.hasUnsignedContentError()) aResId = STR_MACROS_DISABLED_CONTENT_UNSIGNED; auto pInfoBar = AppendInfoBar("macro", SfxResId(STR_MACROS_DISABLED_TITLE),