avmedia/source/gstreamer/gstframegrabber.cxx | 14 ++++--- cui/source/dialogs/SpellDialog.cxx | 2 - dbaccess/source/core/dataaccess/ModelImpl.cxx | 3 + editeng/source/uno/unotext.cxx | 5 ++ embeddedobj/source/commonembedding/persistence.cxx | 24 +++++++----- external/python3/ExternalPackage_python3.mk | 2 - framework/qa/cppunit/dispatchtest.cxx | 3 - include/sfx2/docmacromode.hxx | 4 +- include/sfx2/objsh.hxx | 6 +++ include/svx/unoshape.hxx | 6 ++- include/tools/urlobj.hxx | 5 ++ reportdesign/source/core/sdr/ReportDrawPage.cxx | 2 - sc/source/core/data/global.cxx | 6 ++- sc/source/ui/view/formatsh.cxx | 2 - sc/source/ui/view/viewdata.cxx | 34 +++++++++++++++-- sfx2/source/appl/openuriexternally.cxx | 5 +- sfx2/source/doc/docmacromode.cxx | 8 +++- sfx2/source/doc/iframe.cxx | 5 ++ sfx2/source/doc/objmisc.cxx | 35 +++++++++++++++++- sfx2/source/doc/objxtor.cxx | 1 sfx2/source/inc/objshimp.hxx | 3 + svx/source/unodraw/shapeimpl.hxx | 7 ++- svx/source/unodraw/unomod.cxx | 6 ++- svx/source/unodraw/unopage.cxx | 14 +++---- svx/source/unodraw/unoshap4.cxx | 40 +++++++++++---------- sw/inc/swurl.hxx | 5 ++ sw/source/core/frmedt/feshview.cxx | 7 ++- sw/source/core/text/pormulti.cxx | 13 ++++-- sw/source/filter/html/htmlplug.cxx | 2 - sw/source/filter/xml/xmltexti.cxx | 2 - sw/source/uibase/shells/drwtxtex.cxx | 8 +--- sw/source/uibase/uiview/viewport.cxx | 5 +- sw/source/uibase/wrtsh/wrtsh2.cxx | 29 ++++++++++----- tools/source/fsys/urlobj.cxx | 9 ++++ unotools/source/config/securityoptions.cxx | 15 +++++++ vcl/source/window/window2.cxx | 6 +++ xmloff/source/draw/ximpshap.cxx | 6 ++- 37 files changed, 258 insertions(+), 91 deletions(-)
New commits: commit 92194c444fde0aeee3a43efc696e9227c5dc614d Author: Noel Grandin <noelgran...@collabora.co.uk> AuthorDate: Wed Nov 15 10:03:13 2023 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Nov 21 10:57:08 2023 +0100 tdf#158094 Can't remove trusted certificate in Macro Security regression from commit 6ed8c5a0f19901ab413c6610649326b2475c3a8c Author: Noel Grandin <noelgran...@gmail.com> Date: Sun Jul 25 21:35:05 2021 +0200 use officecfg for security options where I accidentally dropped the chunk of code that removes existing entries. Change-Id: I0b183d3c4dc55d5671b4f172e02afd2e4422a37e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159431 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit def8f7699661f3ca9d763b6bd5e81759cf5b4e12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159585 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit e4e351a01898565ac9d4d01606074fc11b322456) diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 4749065fb431..7c9282fefff1 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -25,6 +25,9 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XHierarchicalNameAccess.hpp> +#include <com/sun/star/util/XChangesBatch.hpp> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <tools/urlobj.hxx> @@ -243,6 +246,18 @@ void SetTrustedAuthors( const std::vector< Certificate >& rAuthors ) // return; Reference<css::container::XHierarchicalNameAccess> xHierarchyAccess = utl::ConfigManager::acquireTree(u"Office.Common/Security/Scripting"); + + // first, clear existing entries + { + Reference<css::container::XNameContainer> xCont; + xHierarchyAccess->getByHierarchicalName(PROPERTYNAME_MACRO_TRUSTEDAUTHORS) >>= xCont; + const Sequence< OUString > aNames = xCont->getElementNames(); + Reference<css::util::XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); + for (const OUString& rName : aNames) + xCont->removeByName(rName); + xBatch->commitChanges(); + } + sal_Int32 nCnt = rAuthors.size(); for( sal_Int32 i = 0; i < nCnt; ++i ) { commit 85bbaa2310ae2a5431e56722427d617a0efa2d68 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Nov 15 21:01:48 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 21:49:17 2023 +0100 combine these hyperlink dispatchers into one call Change-Id: Icb7822e811013de648ccf2fbb23a5f0be9e29bb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159489 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 0df175ccc6ea542bc5801f631ff72bed187042eb) diff --git a/sw/inc/swurl.hxx b/sw/inc/swurl.hxx index 87375f30c8b7..ec88a639a4e9 100644 --- a/sw/inc/swurl.hxx +++ b/sw/inc/swurl.hxx @@ -23,6 +23,7 @@ #include <o3tl/typed_flags_set.hxx> class SwViewShell; +class SwView; enum class LoadUrlFlags { NONE = 0x00, @@ -35,6 +36,10 @@ namespace o3tl { void LoadURL( SwViewShell& rSh, const OUString& rName, LoadUrlFlags nFilter, const OUString& rTargetFrameName ); +void LoadURL( SwView& rView, const OUString& rName, + LoadUrlFlags nFilter, const OUString& rTargetFrameName ); + + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index c84ee7bd9af4..f31c3980ad94 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -533,12 +533,8 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) const SvxFieldData* pField = pOLV->GetFieldAtCursor(); if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField)) { - SfxStringItem aUrl(SID_FILE_NAME, pURLField->GetURL()); - SfxStringItem aTarget(SID_TARGETNAME, pURLField->GetTargetFrame()); - SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, false); - SfxBoolItem aBrowsing(SID_BROWSE, true); - GetView().GetViewFrame()->GetDispatcher()->ExecuteList( - SID_OPENDOC, SfxCallMode::SYNCHRON, { &aUrl, &aTarget, &aNewView, &aBrowsing }); + ::LoadURL(GetView(), pURLField->GetURL(), LoadUrlFlags::NONE, + pURLField->GetTargetFrame()); } } break; diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 0bc6ebcdb31f..7a264dd6e09d 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -516,9 +516,16 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, //A CursorShell is always a WrtShell SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh); - SwDocShell* pDShell = rSh.GetView().GetDocShell(); + ::LoadURL(rSh.GetView(), rURL, nFilter, rTargetFrameName); + +} + +void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, + const OUString& rTargetFrameName) +{ + SwDocShell* pDShell = rView.GetDocShell(); OSL_ENSURE( pDShell, "No DocShell?!"); - SfxViewFrame& rViewFrame = *rSh.GetView().GetViewFrame(); + SfxViewFrame& rViewFrame = *rView.GetViewFrame(); if (!SfxObjectShell::AllowedLinkProtocolFromDocument(rURL, pDShell, rViewFrame.GetFrameWeld())) return; @@ -527,7 +534,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, // unless we are jumping to a TOC mark. if (comphelper::LibreOfficeKit::isActive() && !rURL.startsWith("#")) { - rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); + rView.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); return; } commit c0ba267c344afee52b7d0bb1cb29ce14077ce59e Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Nov 15 12:55:58 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 21:48:54 2023 +0100 reuse AllowedLinkProtocolFromDocument in writer Change-Id: Iacf5e313fc6ca5f7d69ca6986a036f0e1ab1f2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159488 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 32535dfa82200b54296838b52285c054fbe5e51d) diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index e9d47e1db0c2..0bc6ebcdb31f 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -513,6 +513,16 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, if ( dynamic_cast<const SwCursorShell*>( &rVSh) == nullptr ) return; + //A CursorShell is always a WrtShell + SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh); + + SwDocShell* pDShell = rSh.GetView().GetDocShell(); + OSL_ENSURE( pDShell, "No DocShell?!"); + SfxViewFrame& rViewFrame = *rSh.GetView().GetViewFrame(); + + if (!SfxObjectShell::AllowedLinkProtocolFromDocument(rURL, pDShell, rViewFrame.GetFrameWeld())) + return; + // We are doing tiledRendering, let the client handles the URL loading, // unless we are jumping to a TOC mark. if (comphelper::LibreOfficeKit::isActive() && !rURL.startsWith("#")) @@ -521,11 +531,6 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, return; } - //A CursorShell is always a WrtShell - SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh); - - SwDocShell* pDShell = rSh.GetView().GetDocShell(); - OSL_ENSURE( pDShell, "No DocShell?!"); OUString sTargetFrame(rTargetFrameName); if (sTargetFrame.isEmpty() && pDShell) { @@ -540,8 +545,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, OUString sReferer; if( pDShell && pDShell->GetMedium() ) sReferer = pDShell->GetMedium()->GetName(); - SfxViewFrame* pViewFrame = rSh.GetView().GetViewFrame(); - SfxFrameItem aView( SID_DOCFRAME, pViewFrame ); + SfxFrameItem aView( SID_DOCFRAME, &rViewFrame ); SfxStringItem aName( SID_FILE_NAME, rURL ); SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame ); SfxStringItem aReferer( SID_REFERER, sReferer ); @@ -562,7 +566,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, nullptr }; - pViewFrame->GetDispatcher()->GetBindings()->Execute( SID_OPENDOC, aArr, + rViewFrame.GetDispatcher()->GetBindings()->Execute( SID_OPENDOC, aArr, SfxCallMode::ASYNCHRON|SfxCallMode::RECORD ); } commit fc597936329125be029273bf4e64565867de6954 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Nov 15 11:39:24 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 21:20:17 2023 +0100 reorg calc hyperlink check to reuse elsewhere Change-Id: I20ae3c5df15502c3a0a366fb4a2924c06ffac3d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit e6a7537762e19fde446441edd10d301f9b37ce75) diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index f633265f44a1..27a4c1874071 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -200,6 +200,9 @@ private: SAL_DLLPRIVATE bool SaveTo_Impl(SfxMedium &rMedium, const SfxItemSet* pSet ); + // true if the document had macros (or similar) on load to trigger warning user + SAL_DLLPRIVATE bool GetHadCheckedMacrosOnLoad() const; + protected: SfxObjectShell(SfxObjectCreateMode); SfxObjectShell(SfxModelFlags); // see sfxmodelfactory.hxx @@ -427,8 +430,8 @@ public: void SetMacroCallsSeenWhileLoading(); bool GetMacroCallsSeenWhileLoading() const; - // true if the document had macros (or similar) on load to trigger warning user - bool GetHadCheckedMacrosOnLoad() const; + // true if this type of link, from a document, is allowed by the user to be passed to uno:OpenDoc + static bool AllowedLinkProtocolFromDocument(const OUString& rUrl, SfxObjectShell* pObjShell, weld::Window* pDialogParent); const css::uno::Sequence< css::beans::PropertyValue >& GetModifyPasswordInfo() const; bool SetModifyPasswordInfo( const css::uno::Sequence< css::beans::PropertyValue >& aInfo ); diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 447a6451971b..a28d4d1917e4 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -29,9 +29,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objsh.hxx> -#include <sfx2/sfxresid.hxx> #include <sfx2/sfxsids.hrc> -#include <sfx2/strings.hrc> #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> #include <svl/intitem.hxx> @@ -857,34 +855,8 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, bool bIgno aUrlName = aNewUrlName; } - if (INetURLObject(aUrlName).IsExoticProtocol()) - { - // Default to ignoring exotic protocols - bool bAllow = false; - if (pObjShell) - { - // If the document had macros when loaded then follow the allowed macro-mode - if (pObjShell->GetHadCheckedMacrosOnLoad()) - bAllow = pObjShell->AdjustMacroMode(); - else // otherwise ask the user, defaulting to cancel - { - assert(pFrame && "if we have pObjShell we have pFrame"); - //Reuse URITools::onOpenURI warning string - std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pFrame->GetFrameWeld(), - VclMessageType::Warning, VclButtonsType::YesNo, - SfxResId(STR_DANGEROUS_TO_OPEN))); - xQueryBox->set_primary_text(xQueryBox->get_primary_text().replaceFirst("$(ARG1)", - INetURLObject::decode(aUrlName, INetURLObject::DecodeMechanism::Unambiguous))); - xQueryBox->set_default_response(RET_NO); - bAllow = xQueryBox->run() == RET_YES; - } - } - if (!bAllow) - { - SAL_WARN("sc", "ScGlobal::OpenURL ignoring: " << aUrlName); - return; - } - } + if (!SfxObjectShell::AllowedLinkProtocolFromDocument(aUrlName, pObjShell, pFrame ? pFrame->GetFrameWeld() : nullptr)) + return; SfxStringItem aUrl( SID_FILE_NAME, aUrlName ); SfxStringItem aTarget( SID_TARGETNAME, rTarget ); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index ee5e59847a78..86f587c20bec 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -961,6 +961,33 @@ bool SfxObjectShell::GetHadCheckedMacrosOnLoad() const return pImpl->m_bHadCheckedMacrosOnLoad; } +bool SfxObjectShell::AllowedLinkProtocolFromDocument(const OUString& rUrl, SfxObjectShell* pObjShell, weld::Window* pDialogParent) +{ + if (!INetURLObject(rUrl).IsExoticProtocol()) + return true; + // Default to ignoring exotic protocols + bool bAllow = false; + if (pObjShell) + { + // If the document had macros when loaded then follow the allowed macro-mode + if (pObjShell->GetHadCheckedMacrosOnLoad()) + bAllow = pObjShell->AdjustMacroMode(); + else // otherwise ask the user, defaulting to cancel + { + //Reuse URITools::onOpenURI warning string + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pDialogParent, + VclMessageType::Warning, VclButtonsType::YesNo, + SfxResId(STR_DANGEROUS_TO_OPEN))); + xQueryBox->set_primary_text(xQueryBox->get_primary_text().replaceFirst("$(ARG1)", + INetURLObject::decode(rUrl, INetURLObject::DecodeMechanism::Unambiguous))); + xQueryBox->set_default_response(RET_NO); + bAllow = xQueryBox->run() == RET_YES; + } + } + SAL_WARN_IF(!bAllow, "sfx.appl", "SfxObjectShell::AllowedLinkProtocolFromDocument ignoring: " << rUrl); + return bAllow; +} + void SfxObjectShell::CheckEncryption_Impl( const uno::Reference< task::XInteractionHandler >& xHandler ) { OUString aVersion; commit 0ec96c3e81e9fbd4c9228eaa64aefe502ebe62d5 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Nov 3 17:26:25 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 21:20:16 2023 +0100 default to ignoring libreoffice special-purpose protocols in calc hyperlink Change-Id: Ib9f62be3acc05f24ca234dec0fec21e24579e9de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158911 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit b6062623b4d69c79e90e9365ac7c5e7f11986793) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159045 Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 672716d09c54cb6fdd59baa7da4b8393cf104cd2) diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 5a4078fccfb9..c6a4fe7989ac 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -1123,7 +1123,8 @@ bool ODatabaseModelImpl::checkMacrosOnLoading() { Reference< XInteractionHandler > xInteraction; xInteraction = m_aMediaDescriptor.getOrDefault( "InteractionHandler", xInteraction ); - return m_aMacroMode.checkMacrosOnLoading( xInteraction ); + const bool bHasMacros = m_aMacroMode.hasMacros(); + return m_aMacroMode.checkMacrosOnLoading(xInteraction, false /*HasValidContentSignature*/, bHasMacros); } void ODatabaseModelImpl::resetMacroExecutionMode() diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx index 7ed42f6a14dd..0acb44cbfbb1 100644 --- a/include/sfx2/docmacromode.hxx +++ b/include/sfx2/docmacromode.hxx @@ -264,6 +264,8 @@ namespace sfx2 */ static bool storageHasMacros( const css::uno::Reference< css::embed::XStorage >& _rxStorage ); + bool hasMacros() const; + static bool containerHasBasicMacros( const css::uno::Reference< css::script::XLibraryContainer >& xContainer ); /** checks the macro execution mode while loading the document. @@ -291,7 +293,7 @@ namespace sfx2 bool checkMacrosOnLoading( const css::uno::Reference< css::task::XInteractionHandler >& _rxInteraction, - bool bHasValidContentSignature = false + bool bHasValidContentSignature, bool bHasMacros ); private: diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 428995bff493..f633265f44a1 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -427,6 +427,9 @@ public: void SetMacroCallsSeenWhileLoading(); bool GetMacroCallsSeenWhileLoading() const; + // true if the document had macros (or similar) on load to trigger warning user + bool GetHadCheckedMacrosOnLoad() const; + const css::uno::Sequence< css::beans::PropertyValue >& GetModifyPasswordInfo() const; bool SetModifyPasswordInfo( const css::uno::Sequence< css::beans::PropertyValue >& aInfo ); diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index a7b63ce1eb40..447a6451971b 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -29,7 +29,9 @@ #include <sfx2/docfile.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objsh.hxx> +#include <sfx2/sfxresid.hxx> #include <sfx2/sfxsids.hrc> +#include <sfx2/strings.hrc> #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> #include <svl/intitem.hxx> @@ -41,6 +43,7 @@ #include <vcl/virdev.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <unotools/charclass.hxx> #include <unotools/securityoptions.hxx> #include <osl/diagnose.h> @@ -820,7 +823,7 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, bool bIgno OUString aUrlName( rURL ); SfxViewFrame* pFrame = nullptr; - const SfxObjectShell* pObjShell = nullptr; + SfxObjectShell* pObjShell = nullptr; OUString aReferName; if ( pScActiveViewShell ) { @@ -854,6 +857,35 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, bool bIgno aUrlName = aNewUrlName; } + if (INetURLObject(aUrlName).IsExoticProtocol()) + { + // Default to ignoring exotic protocols + bool bAllow = false; + if (pObjShell) + { + // If the document had macros when loaded then follow the allowed macro-mode + if (pObjShell->GetHadCheckedMacrosOnLoad()) + bAllow = pObjShell->AdjustMacroMode(); + else // otherwise ask the user, defaulting to cancel + { + assert(pFrame && "if we have pObjShell we have pFrame"); + //Reuse URITools::onOpenURI warning string + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pFrame->GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::YesNo, + SfxResId(STR_DANGEROUS_TO_OPEN))); + xQueryBox->set_primary_text(xQueryBox->get_primary_text().replaceFirst("$(ARG1)", + INetURLObject::decode(aUrlName, INetURLObject::DecodeMechanism::Unambiguous))); + xQueryBox->set_default_response(RET_NO); + bAllow = xQueryBox->run() == RET_YES; + } + } + if (!bAllow) + { + SAL_WARN("sc", "ScGlobal::OpenURL ignoring: " << aUrlName); + return; + } + } + SfxStringItem aUrl( SID_FILE_NAME, aUrlName ); SfxStringItem aTarget( SID_TARGETNAME, rTarget ); if ( nScClickMouseModifier & KEY_SHIFT ) // control-click -> into new window diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 3a868411375d..9b42a0d2273f 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -400,8 +400,12 @@ namespace sfx2 return bHasMacros; } + bool DocumentMacroMode::hasMacros() const + { + return m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() || m_xData->m_rDocumentAccess.macroCallsSeenWhileLoading(); + } - bool DocumentMacroMode::checkMacrosOnLoading( const Reference< XInteractionHandler >& rxInteraction, bool bHasValidContentSignature ) + bool DocumentMacroMode::checkMacrosOnLoading( const Reference< XInteractionHandler >& rxInteraction, bool bHasValidContentSignature, bool bHasMacros ) { bool bAllow = false; if ( SvtSecurityOptions::IsMacroDisabled() ) @@ -411,7 +415,7 @@ namespace sfx2 } else { - if (m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() || m_xData->m_rDocumentAccess.macroCallsSeenWhileLoading()) + if (bHasMacros) { bAllow = adjustMacroMode( rxInteraction, bHasValidContentSignature ); } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 873ab8b9ba26..ee5e59847a78 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -951,9 +951,15 @@ void SfxObjectShell::CheckSecurityOnLoading_Impl() // check macro security const bool bHasValidContentSignature = HasValidSignatures(); - pImpl->aMacroMode.checkMacrosOnLoading( xInteraction, bHasValidContentSignature ); + const bool bHasMacros = pImpl->aMacroMode.hasMacros(); + pImpl->aMacroMode.checkMacrosOnLoading( xInteraction, bHasValidContentSignature, bHasMacros ); + pImpl->m_bHadCheckedMacrosOnLoad = bHasMacros; } +bool SfxObjectShell::GetHadCheckedMacrosOnLoad() const +{ + return pImpl->m_bHadCheckedMacrosOnLoad; +} void SfxObjectShell::CheckEncryption_Impl( const uno::Reference< task::XInteractionHandler >& xHandler ) { diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index c83a446a8b22..9d3c5c5bd49e 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -210,6 +210,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,m_bAllowShareControlFileClean( true ) ,m_bConfigOptionsChecked( false ) ,m_bMacroCallsSeenWhileLoading( false ) + ,m_bHadCheckedMacrosOnLoad( false ) ,lErr(ERRCODE_NONE) ,nEventId ( SfxEventHintId::NONE ) ,nLoadedFlags ( SfxLoadedFlags::ALL ) diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index 46db158984ac..f6f84d6f40e2 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -90,7 +90,8 @@ struct SfxObjectShell_Impl final : public ::sfx2::IMacroDocumentAccess m_bSharedXMLFlag:1, // whether the document should be edited in shared mode m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file m_bConfigOptionsChecked:1, // whether or not the user options are checked after the Options dialog is closed. - m_bMacroCallsSeenWhileLoading:1; // whether or not the user options are checked after the Options dialog is closed. + m_bMacroCallsSeenWhileLoading:1, // whether or not macro calls were seen when loading document. + m_bHadCheckedMacrosOnLoad:1; // if document contained macros (or calls) when loaded IndexBitSet aBitSet; ErrCode lErr; commit 1c3f844ab512a444030371425fe4a7570e06a77d Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Nov 7 12:35:47 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 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 <caolan.mcnam...@collabora.com> (cherry picked from commit 518df6a3bd6aa251dc4ad30ab3d04545513ae5c6) diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index a8aed34fcfdf..7b11b8aac182 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<weld::MessageDialog> 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; } commit d3b712deb5246a647257bde23107f2aeb1143cb1 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Nov 4 19:57:51 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 2023 +0100 warn about exotic protocols as well Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151834 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 1305f70cff8a81a58a5a6d9c96c5bb032005389e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159034 Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 2e1bcbb550d54278b366ec619cc5280d44d6aba4) diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 63827207508f..94d3c4929292 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1121,7 +1121,7 @@ void SwHTMLParser::InsertFloatingFrame() OUString sHRef = aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); - if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(sHRef).IsExoticProtocol()) NotifyMacroEventRead(); xSet->setPropertyValue("FrameURL", uno::Any( sHRef ) ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 57481604f6da..33fa5e9049b4 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -826,7 +826,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra OUString sHRef = URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ); - if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(sHRef).IsExoticProtocol()) GetXMLImport().NotifyMacroEventRead(); xSet->setPropertyValue("FrameURL", diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 4a7411623dee..947c653a52e2 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4832,7 +4832,8 @@ bool INetURLObject::IsExoticProtocol() const return m_eScheme == INetProtocol::Slot || m_eScheme == INetProtocol::Macro || m_eScheme == INetProtocol::Uno || - isSchemeEqualTo(u"vnd.sun.star.script"); + isSchemeEqualTo(u"vnd.sun.star.script") || + isSchemeEqualTo(u"service"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 6e0ad663fdad..3c9f366a12ab 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3179,7 +3179,7 @@ void SdXMLFloatingFrameShapeContext::startFastElement (sal_Int32 /*nElement*/, if( !maHref.isEmpty() ) { - if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(maHref).IsExoticProtocol()) GetImport().NotifyMacroEventRead(); xProps->setPropertyValue("FrameURL", Any(maHref) ); commit 934fbcae983187f577ea6141485e0df1991f7856 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Nov 3 17:14:26 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 2023 +0100 add some protocols that don't make sense as floating frame targets Change-Id: Id900a5eef248731d1184c1df501a2cf7a2de7eb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158910 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 11ebdfef16501c6d35c3e3d0d62507f706557c71) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158900 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit bab433911bdecb344f7ea94dbd00690241a08c54) diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index 9d6820ddf241..dfd658722826 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -915,6 +915,11 @@ public: void changeScheme(INetProtocol eTargetScheme); + // INetProtocol::Macro, INetProtocol::Uno, INetProtocol::Slot, + // vnd.sun.star.script, etc. All the types of URLs which shouldn't + // be accepted from an outside controlled source + bool IsExoticProtocol() const; + private: // General Structure: diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 52962c4be75d..0c2f58044b62 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -168,8 +168,11 @@ sal_Bool SAL_CALL IFrameObject::load( xTrans->parseStrict( aTargetURL ); INetURLObject aURLObject(aTargetURL.Complete); - if (aURLObject.GetProtocol() == INetProtocol::Macro || aURLObject.isSchemeEqualTo(u"vnd.sun.star.script")) + if (aURLObject.IsExoticProtocol()) + { + SAL_WARN("sfx", "IFrameObject::load ignoring: " << aTargetURL.Complete); return false; + } uno::Reference<frame::XFramesSupplier> xParentFrame = xFrame->getCreator(); SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 00e3207b2d3b..4a7411623dee 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4827,4 +4827,12 @@ OUString INetURLObject::CutExtension() ? aTheExtension : OUString(); } +bool INetURLObject::IsExoticProtocol() const +{ + return m_eScheme == INetProtocol::Slot || + m_eScheme == INetProtocol::Macro || + m_eScheme == INetProtocol::Uno || + isSchemeEqualTo(u"vnd.sun.star.script"); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 3ec80e28eeb85beb056959b40ceb2f149b5ac3cb Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Nov 3 14:20:07 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 2023 +0100 escape url passed to gstreamer Change-Id: I3c93ee34800cc8563370f75ef3ef6f8a9220e6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158894 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit f41dcadf6492a6ffd32696d50f818e44355b9ad9) diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index ece799d87530..25170a296e66 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -50,11 +50,9 @@ void FrameGrabber::disposePipeline() FrameGrabber::FrameGrabber( std::u16string_view rURL ) { - gchar *pPipelineStr; - pPipelineStr = g_strdup_printf( - "uridecodebin uri=%s ! videoconvert ! videoscale ! appsink " - "name=sink caps=\"video/x-raw,format=RGB,pixel-aspect-ratio=1/1\"", - OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr() ); + const char pPipelineStr[] = + "uridecodebin name=source ! videoconvert ! videoscale ! appsink " + "name=sink caps=\"video/x-raw,format=RGB,pixel-aspect-ratio=1/1\""; GError *pError = nullptr; mpPipeline = gst_parse_launch( pPipelineStr, &pError ); @@ -65,6 +63,12 @@ FrameGrabber::FrameGrabber( std::u16string_view rURL ) } if( mpPipeline ) { + + if (GstElement *pUriDecode = gst_bin_get_by_name(GST_BIN(mpPipeline), "source")) + g_object_set(pUriDecode, "uri", OUStringToOString(rURL, RTL_TEXTENCODING_UTF8).getStr(), nullptr); + else + g_warning("Missing 'source' element in gstreamer pipeline"); + // pre-roll switch( gst_element_set_state( mpPipeline, GST_STATE_PAUSED ) ) { case GST_STATE_CHANGE_FAILURE: commit f2438eda2cf41aba61a3f303dd5b4e9d0792855f Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Oct 16 15:21:03 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 2023 +0100 check earlier on loading ole objects if parent doc is untrusted referer Change-Id: Ib1169d5c40ca87f789c71b48124754e073895fcd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158054 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 7273de2730022deb37a8c7f2fedbe7fc4551f9b5) diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index f0de9cc6b21f..8365b7453e69 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -54,11 +54,12 @@ #include <comphelper/mimeconfighelper.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/propertyvalue.hxx> +#include <unotools/configmgr.hxx> #include <unotools/mediadescriptor.hxx> +#include <unotools/securityoptions.hxx> #include <tools/diagnose_ex.h> #include <sal/log.hxx> -#include <unotools/configmgr.hxx> #include "persistence.hxx" using namespace ::com::sun::star; @@ -361,14 +362,8 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() return xDocument; } - uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() { - uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xContext, GetDocumentServiceName(), - m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); - - uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY_THROW ); - sal_Int32 nLen = m_bLinkHasPassword ? 3 : 2; uno::Sequence< beans::PropertyValue > aArgs( m_aDocMediaDescriptor.getLength() + nLen ); auto pArgs = aArgs.getArray(); @@ -390,10 +385,22 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() for ( sal_Int32 nInd = 0; nInd < m_aDocMediaDescriptor.getLength(); nInd++ ) { + // return early if this document is not trusted to open links + if (m_aDocMediaDescriptor[nInd].Name == utl::MediaDescriptor::PROP_REFERRER) + { + OUString referer; + m_aDocMediaDescriptor[nInd].Value >>= referer; + if (SvtSecurityOptions::isUntrustedReferer(referer)) + return nullptr; + } pArgs[nInd+nLen].Name = m_aDocMediaDescriptor[nInd].Name; pArgs[nInd+nLen].Value = m_aDocMediaDescriptor[nInd].Value; } + uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xContext, GetDocumentServiceName(), + m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) ); + uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY_THROW ); + try { handleLinkedOLE(CopyBackToOLELink::CopyLinkToTemp); @@ -437,7 +444,6 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() } - OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) const { OUString aFilterName = GetPresetFilterName(); commit f01fbaad67996c4253420bd6988606907520b8fd Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Oct 16 13:25:29 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 2023 +0100 retain Referer information available in OCommonEmbeddedObject ctor Change-Id: I2cb901e81de3b7db73cd2088348ddad46ae603dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158052 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 267be127f2899f2e1b1f15b5a06707a9b83fcab4) diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 65e88266a78f..f0de9cc6b21f 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -79,7 +79,7 @@ uno::Sequence< beans::PropertyValue > GetValuableArgs_Impl( const uno::Sequence< || prop.Name == "StartPresentation" || prop.Name == "RepairPackage" || prop.Name == "StatusIndicator" || prop.Name == "ViewData" || prop.Name == "ViewId" || prop.Name == "MacroExecutionMode" - || prop.Name == "UpdateDocMode" + || prop.Name == "UpdateDocMode" || prop.Name == "Referer" || (prop.Name == "DocumentBaseURL" && bCanUseDocumentBaseURL) ) { aResult.realloc( ++nResLen ); diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 0d6573546bbe..7172c524ccca 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -479,7 +479,7 @@ void SvxOle2Shape::createLink( const OUString& aLinkURL ) awt::Size aSz = xObj->getVisualAreaSize( pOle2Obj->GetAspect() ); aRect.SetSize( Size( aSz.Width, aSz.Height ) ); } - catch( embed::NoVisualAreaSizeException& ) + catch (const uno::Exception&) {} pOle2Obj->SetLogicRect( aRect ); } commit 170edf783a0363fd66c4f82b75a0890ea9c77816 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Sep 6 10:05:23 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 20:40:31 2023 +0100 add referer to ole objects so we can identify what document is requesting their contents extends: commit 5668e73beb30b95abc6520b7432c54972ca3ab2c Date: Wed Nov 20 14:43:45 2013 +0100 avmedia: Implement "block untrusted referer links" feature See f0a9ca24fd4bf79cac908bf0d6fdb8905dc504db "rhbz#887420 Implement 'block untrusted referer links' feature" for details. This adds some further /*TODO?*/ comments, and one known problem (marked /*TODO!*/) is that movies/sounds are not blocked during a slideshow presentation. to these objects too, namely OLE2Shape and derivatives AppletShape, FrameShape and PluginShape so in paranoid mode we won't load the contents of such objects from documents considered "untrusted". Change-Id: I6d988035d0cd09fd3fade5f6885fe336c95579ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156598 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit 125cf1525361c6cd699574f60b4cf12868188568) diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index 3185d958a0e9..af192e15d369 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -603,6 +603,8 @@ public: // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API class SVXCORE_DLLPUBLIC SvxOle2Shape : public SvxShapeText { +private: + OUString referer_; protected: // override these for special property handling in subcasses. Return true if property is handled virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; @@ -612,8 +614,8 @@ protected: SvGlobalName GetClassName_Impl(OUString& rHexCLSID); public: - SvxOle2Shape(SdrObject* pObj); - SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet); + SvxOle2Shape(SdrObject* pObj, OUString referer); + SvxOle2Shape(SdrObject* pObject, OUString referer, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet); virtual ~SvxOle2Shape() noexcept override; bool createObject( const SvGlobalName &aClassName ); diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx index b89c3dac284b..3b2ad7d708b5 100644 --- a/reportdesign/source/core/sdr/ReportDrawPage.cxx +++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx @@ -122,7 +122,7 @@ uno::Reference< drawing::XShape > OReportDrawPage::CreateShape( SdrObject *pObj awt::Size aSz( aTmp.Width(), aTmp.Height() ); xObj->setVisualAreaSize( nAspect, aSz ); } - rtl::Reference<SvxOle2Shape> pShape = new SvxOle2Shape( pObj ); + rtl::Reference<SvxOle2Shape> pShape = new SvxOle2Shape( pObj, "" /*TODO?*/ ); xShape = pShape; pShape->setShapeKind(pObj->GetObjIdentifier()); } diff --git a/svx/source/unodraw/shapeimpl.hxx b/svx/source/unodraw/shapeimpl.hxx index 68189814fe6a..ce67e16bb572 100644 --- a/svx/source/unodraw/shapeimpl.hxx +++ b/svx/source/unodraw/shapeimpl.hxx @@ -36,7 +36,7 @@ protected: virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; public: - explicit SvxPluginShape(SdrObject* pObj); + explicit SvxPluginShape(SdrObject* pObj, OUString referer); virtual ~SvxPluginShape() noexcept override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; @@ -46,6 +46,7 @@ public: virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override; }; + class SvxAppletShape : public SvxOle2Shape { protected: @@ -54,7 +55,7 @@ protected: virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; public: - explicit SvxAppletShape(SdrObject* pObj); + explicit SvxAppletShape(SdrObject* pObj, OUString referer); virtual ~SvxAppletShape() noexcept override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; @@ -76,7 +77,7 @@ protected: css::uno::Any& rValue) override; public: - explicit SvxFrameShape(SdrObject* pObj); + explicit SvxFrameShape(SdrObject* pObj, OUString referer); virtual ~SvxFrameShape() noexcept override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index b36eb09a5caa..4a562caeadad 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -210,7 +210,11 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstanceWi { OUString arg; if ((ServiceSpecifier == "com.sun.star.drawing.GraphicObjectShape" - || ServiceSpecifier == "com.sun.star.drawing.MediaShape") + || ServiceSpecifier == "com.sun.star.drawing.AppletShape" + || ServiceSpecifier == "com.sun.star.drawing.FrameShape" + || ServiceSpecifier == "com.sun.star.drawing.OLE2Shape" + || ServiceSpecifier == "com.sun.star.drawing.MediaShape" + || ServiceSpecifier == "com.sun.star.drawing.PluginShape") && Arguments.getLength() == 1 && (Arguments[0] >>= arg)) { return create(ServiceSpecifier, arg); diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index ee91c36c9afe..ff7c2238f234 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -691,13 +691,13 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n pRet = new SvxGraphicObject( pObj ); break; case SdrObjKind::OLEPluginFrame: - pRet = new SvxFrameShape( pObj ); + pRet = new SvxFrameShape( pObj, referer ); break; case SdrObjKind::OLE2Applet: - pRet = new SvxAppletShape( pObj ); + pRet = new SvxAppletShape( pObj, referer ); break; case SdrObjKind::OLE2Plugin: - pRet = new SvxPluginShape( pObj ); + pRet = new SvxPluginShape( pObj, referer ); break; case SdrObjKind::OLE2: { @@ -725,17 +725,17 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n if( aPluginClassId == aClassId ) { - pRet = new SvxPluginShape( pObj ); + pRet = new SvxPluginShape( pObj, referer ); nType = SdrObjKind::OLE2Plugin; } else if( aAppletClassId == aClassId ) { - pRet = new SvxAppletShape( pObj ); + pRet = new SvxAppletShape( pObj, referer ); nType = SdrObjKind::OLE2Applet; } else if( aIFrameClassId == aClassId ) { - pRet = new SvxFrameShape( pObj ); + pRet = new SvxFrameShape( pObj, referer ); nType = SdrObjKind::OLEPluginFrame; } } @@ -745,7 +745,7 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n if( pRet == nullptr ) { SvxUnoPropertyMapProvider& rSvxMapProvider = getSvxMapProvider(); - pRet = new SvxOle2Shape( pObj, rSvxMapProvider.GetMap(SVXMAP_OLE2), rSvxMapProvider.GetPropertySet(SVXMAP_OLE2, SdrObject::GetGlobalDrawObjectItemPool()) ); + pRet = new SvxOle2Shape( pObj, referer, rSvxMapProvider.GetMap(SVXMAP_OLE2), rSvxMapProvider.GetPropertySet(SVXMAP_OLE2, SdrObject::GetGlobalDrawObjectItemPool()) ); } } break; diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 18ce14f5e22d..0d6573546bbe 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -63,14 +63,16 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; -SvxOle2Shape::SvxOle2Shape(SdrObject* pObject) -: SvxShapeText( pObject, getSvxMapProvider().GetMap(SVXMAP_OLE2), - getSvxMapProvider().GetPropertySet(SVXMAP_OLE2,SdrObject::GetGlobalDrawObjectItemPool()) ) +SvxOle2Shape::SvxOle2Shape(SdrObject* pObject, OUString referer) + : SvxShapeText(pObject, getSvxMapProvider().GetMap(SVXMAP_OLE2), + getSvxMapProvider().GetPropertySet(SVXMAP_OLE2,SdrObject::GetGlobalDrawObjectItemPool())) + , referer_(std::move(referer)) { } -SvxOle2Shape::SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet) -: SvxShapeText( pObject, pPropertyMap, pPropertySet ) +SvxOle2Shape::SvxOle2Shape(SdrObject* pObject, OUString referer, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet) + : SvxShapeText(pObject, pPropertyMap, pPropertySet) + , referer_(std::move(referer)) { } @@ -447,16 +449,18 @@ void SvxOle2Shape::createLink( const OUString& aLinkURL ) ::comphelper::IEmbeddedHelper* pPersist = GetSdrObject()->getSdrModelFromSdrObject().GetPersist(); - uno::Sequence< beans::PropertyValue > aMediaDescr{ comphelper::makePropertyValue("URL", - aLinkURL) }; + uno::Sequence< beans::PropertyValue > aMediaDescr{ + comphelper::makePropertyValue("URL", aLinkURL), + comphelper::makePropertyValue("Referer", referer_) + }; uno::Reference< task::XInteractionHandler > xInteraction = pPersist->getInteractionHandler(); if ( xInteraction.is() ) { - aMediaDescr.realloc( 2 ); + aMediaDescr.realloc( 3 ); auto pMediaDescr = aMediaDescr.getArray(); - pMediaDescr[1].Name = "InteractionHandler"; - pMediaDescr[1].Value <<= xInteraction; + pMediaDescr[2].Name = "InteractionHandler"; + pMediaDescr[2].Value <<= xInteraction; } //TODO/LATER: how to cope with creation failure?! @@ -557,8 +561,8 @@ OUString SvxOle2Shape::GetAndClearInitialFrameURL() return OUString(); } -SvxAppletShape::SvxAppletShape(SdrObject* pObject) - : SvxOle2Shape( pObject, getSvxMapProvider().GetMap(SVXMAP_APPLET), getSvxMapProvider().GetPropertySet(SVXMAP_APPLET, SdrObject::GetGlobalDrawObjectItemPool()) ) +SvxAppletShape::SvxAppletShape(SdrObject* pObject, OUString referer) + : SvxOle2Shape(pObject, std::move(referer), getSvxMapProvider().GetMap(SVXMAP_APPLET), getSvxMapProvider().GetPropertySet(SVXMAP_APPLET, SdrObject::GetGlobalDrawObjectItemPool())) { SetShapeType( "com.sun.star.drawing.AppletShape" ); } @@ -628,8 +632,8 @@ bool SvxAppletShape::getPropertyValueImpl( const OUString& rName, const SfxItemP } } -SvxPluginShape::SvxPluginShape(SdrObject* pObject) - : SvxOle2Shape( pObject, getSvxMapProvider().GetMap(SVXMAP_PLUGIN), getSvxMapProvider().GetPropertySet(SVXMAP_PLUGIN, SdrObject::GetGlobalDrawObjectItemPool()) ) +SvxPluginShape::SvxPluginShape(SdrObject* pObject, OUString referer) + : SvxOle2Shape(pObject, std::move(referer), getSvxMapProvider().GetMap(SVXMAP_PLUGIN), getSvxMapProvider().GetPropertySet(SVXMAP_PLUGIN, SdrObject::GetGlobalDrawObjectItemPool())) { SetShapeType( "com.sun.star.drawing.PluginShape" ); } @@ -699,9 +703,8 @@ bool SvxPluginShape::getPropertyValueImpl( const OUString& rName, const SfxItemP } } - -SvxFrameShape::SvxFrameShape(SdrObject* pObject) -: SvxOle2Shape( pObject, getSvxMapProvider().GetMap(SVXMAP_FRAME), getSvxMapProvider().GetPropertySet(SVXMAP_FRAME, SdrObject::GetGlobalDrawObjectItemPool()) ) +SvxFrameShape::SvxFrameShape(SdrObject* pObject, OUString referer) + : SvxOle2Shape(pObject, std::move(referer), getSvxMapProvider().GetMap(SVXMAP_FRAME), getSvxMapProvider().GetPropertySet(SVXMAP_FRAME, SdrObject::GetGlobalDrawObjectItemPool())) { SetShapeType( "com.sun.star.drawing.FrameShape" ); } @@ -782,6 +785,7 @@ bool SvxFrameShape::getPropertyValueImpl(const OUString& rName, const SfxItemPro return SvxOle2Shape::getPropertyValueImpl( rName, pProperty, rValue ); } } + SvxMediaShape::SvxMediaShape(SdrObject* pObj, OUString const & referer) : SvxShape( pObj, getSvxMapProvider().GetMap(SVXMAP_MEDIA), getSvxMapProvider().GetPropertySet(SVXMAP_MEDIA, SdrObject::GetGlobalDrawObjectItemPool()) ), referer_(referer) diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 02fef6949c31..6e0ad663fdad 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -497,7 +497,11 @@ void SdXMLShapeContext::AddShape(OUString const & serviceName) xShape.set(xServiceFact->createInstance("com.sun.star.drawing.temporaryForXMLImportOLE2Shape"), uno::UNO_QUERY); } else if (serviceName == "com.sun.star.drawing.GraphicObjectShape" + || serviceName == "com.sun.star.drawing.AppletShape" + || serviceName == "com.sun.star.drawing.FrameShape" || serviceName == "com.sun.star.drawing.MediaShape" + || serviceName == "com.sun.star.drawing.OLE2Shape" + || serviceName == "com.sun.star.drawing.PluginShape" || serviceName == "com.sun.star.presentation.MediaShape") { xShape.set( xServiceFact->createInstanceWithArguments(serviceName, { css::uno::Any(GetImport().GetDocumentBase()) }), commit 427412429a9b891a11eb23c2c6876782552f6433 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Nov 2 12:18:05 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:31 2023 +0100 crash seen in EditView::GetTransferable in calc if (pColor->getComplexColor().getType() == model::ColorType::Unused) (gdb) print pColor $10 = <optimized out> but: (gdb) print *pSet $12 = {_vptr.SfxItemSet = 0x7f7cd56f3198 <vtable for SfxItemSet+16>, m_pPool = 0x31e7d880, m_pParent = 0x0, m_ppItems = 0x33ecece0, m_pWhichRanges = { m_pairs = 0x7f7cd47b2480 <svl::Items_t<(unsigned short)4008, (unsigned short)4064>::value>, m_size = 1, m_bOwnRanges = false}, m_nCount = 1, m_bItemsFixed = false} (gdb) print *(pSet->m_ppItems) $11 = (const SfxPoolItem *) 0x0 so, apparent null deref of pColor #0 SvxUnoTextRangeBase::_getOnePropertyStates (pSet=0x7ffe47b3ded0, pMap=0x7f7cd5a50600 <ImplGetSvxTextPortionPropertyMap()::aSvxTextPortionPropertyMap+384>, rState=@0x38ae2d4c: com::sun::star::beans::PropertyState::PropertyState_DIRECT_VALUE) at editeng/source/uno/unotext.cxx:1179 #1 0x00007f7cd1e6f5be in SvxUnoTextRangeBase::_getPropertyStates (this=0x3543bc00, PropertyName=..., nPara=nPara@entry=-1) at editeng/source/uno/unotext.cxx:1057 #2 0x00007f7cd1e6fa12 in SvxUnoTextRangeBase::getPropertyStates (this=<optimized out>, aPropertyName=...) at editeng/source/uno/unotext.cxx:1031 #3 0x00007f7cd41e723b in (anonymous namespace)::FilterPropertiesInfo_Impl::FillPropertyStateArray (this=this@entry=0x32e94820, rPropStates=std::vector of length 0, capacity 0, rPropSet=..., rPropMapper=..., bDefault=bDefault@entry=false, pOnlyTheseProps=pOnlyTheseProps@entry=0x0) at xmloff/source/style/xmlexppr.cxx:327 #4 0x00007f7cd41e9230 in SvXMLExportPropertyMapper::Filter_ (this=this@entry=0x34dc72a0, rExport=..., xPropSet=..., bDefault=bDefault@entry=false, bEnableFoFontFamily=bEnableFoFontFamily@entry=false, pOnlyTheseProps=0x0) at xmloff/source/style/xmlexppr.cxx:651 #5 0x00007f7cd41ea026 in SvXMLExportPropertyMapper::Filter (this=this@entry=0x34dc72a0, rExport=..., rPropSet=..., bEnableFoFontFamily=bEnableFoFontFamily@entry=false, pOnlyTheseProps=pOnlyTheseProps@entry=0x0) at xmloff/source/style/xmlexppr.cxx:526 #6 0x00007f7cd42dbbcd in XMLTextParagraphExport::Add (this=this@entry=0x37110830, nFamily=nFamily@entry=XmlStyleFamily::TEXT_TEXT, rPropSet=..., aAddStates=..., bDontSeek=bDontSeek@entry=false) at xmloff/source/text/txtparae.cxx:685 #7 0x00007f7cd42dd09f in XMLTextParagraphExport::exportTextRange (this=this@entry=0x37110830, rTextRange=..., bAutoStyles=bAutoStyles@entry=true, rPrevCharIsSpace=@0x7ffe47b3eef0: true, openFieldMark=@0x7ffe47b3ec34: XMLTextParagraphExport::NONE) at xmloff/source/text/txtparae.cxx:3731 #8 0x00007f7cd42e57df in XMLTextParagraphExport::exportTextRangeEnumeration (this=this@entry=0x37110830, rTextEnum=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, rPrevCharIsSpace=@0x7ffe47b3eef0: true) at xmloff/source/text/txtparae.cxx:2438 #9 0x00007f7cd42ea746 in XMLTextParagraphExport::exportParagraph (this=this@entry=0x37110830, rTextContent=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, rPropSetHelper=..., eExtensionNS=<optimized out>) at xmloff/source/text/txtparae.cxx:2378 #10 0x00007f7cd42e0634 in XMLTextParagraphExport::exportTextContentEnumeration (this=this@entry=0x37110830, rContEnum=..., bAutoStyles=bAutoStyles@entry=true, rBaseSection=..., bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, pRangePropSet=<optimized out>, eExtensionNS=<optimized out>) at xmloff/source/text/txtparae.cxx:2008 #11 0x00007f7cd42e113a in XMLTextParagraphExport::exportText (this=this@entry=0x37110830, rText=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, eExtensionNS=eExtensionNS@entry=TextPNS::ODF) at xmloff/source/text/txtparae.cxx:1762 #12 0x00007f7cd1e78669 in XMLTextParagraphExport::collectTextAutoStyles (bExportParagraph=true, bIsProgress=false, rText=..., this=<optimized out>) at include/xmloff/txtparae.hxx:459 #13 (anonymous namespace)::SvxXMLTextExportComponent::ExportAutoStyles_ (this=0x7f7cb4522930) at editeng/source/xml/xmltxtexp.cxx:341 #14 0x00007f7cd406121c in SvXMLExport::ImplExportAutoStyles (this=this@entry=0x7f7cb4522930) at xmloff/source/core/xmlexp.cxx:1127 #15 0x00007f7cd40645f5 in SvXMLExport::exportDoc (this=0x7f7cb4522930, eClass=<optimized out>) at xmloff/source/core/xmlexp.cxx:1380 #16 0x00007f7cd1e78d64 in SvxWriteXML (rEditEngine=..., rStream=..., rSel=...) at editeng/source/xml/xmltxtexp.cxx:321 #17 0x00007f7cd1da1d0c in ImpEditEngine::WriteXML (this=this@entry=0x34f87990, rOutput=..., rSel=...) at editeng/source/editeng/impedit4.cxx:270 #18 0x00007f7cd1d88881 in ImpEditEngine::CreateTransferable (this=0x34f87990, rSelection=...) at editeng/source/editeng/impedit2.cxx:3843 #19 0x00007f7cd1d4c091 in EditEngine::CreateTransferable (this=<optimized out>, rSelection=...) at editeng/source/editeng/editeng.cxx:816 #20 0x00007f7cd1d5c91a in EditView::GetTransferable (this=0x33eb8190) at editeng/source/editeng/editview.cxx:662 #21 0x00007f7cc2c03eac in ScModelObj::getSelection (this=<optimized out>) at sc/source/ui/unoobj/docuno.cxx:904 Change-Id: Idb8cbbebe02188678f9c1b17e80cf89feffa9de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158803 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit b50681f8da6fbc57db07d488c6e76e33fcd59147) diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index bf085c647c0e..f722327b86b5 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1138,6 +1138,11 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const Sf // Theme & effects can be DEFAULT_VALUE, even if the same pool item has a color // which is a DIRECT_VALUE. const SvxColorItem* pColor = pSet->GetItem<SvxColorItem>(EE_CHAR_COLOR); + if (!pColor) + { + SAL_WARN("editeng", "Missing EE_CHAR_COLOR SvxColorItem"); + return false; + } switch (pMap->nMemberId) { case MID_COLOR_THEME_INDEX: commit e7b89305521ef66e98c7c141d8144362fa0ed7c8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Nov 12 19:49:40 2023 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:31 2023 +0100 ofz#64106 Null-dereference READ Change-Id: Ie279f9f54fa6cc7fcc6add9b737d2c5dc248a236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159349 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 9fc42afd17e9115b488401f64804479e7a76a300) diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index af80d856daed..01ebd222a039 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -315,8 +315,9 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar ) void SwView::CheckVisArea() { - m_pHScrollbar->SetAuto( m_pWrtShell->GetViewOptions()->getBrowseMode() && - !GetViewFrame()->GetFrame().IsInPlace() ); + if (m_pHScrollbar) + m_pHScrollbar->SetAuto( m_pWrtShell->GetViewOptions()->getBrowseMode() && + !GetViewFrame()->GetFrame().IsInPlace() ); if ( IsDocumentBorder() ) { if ( m_aVisArea.Left() != DOCUMENTBORDER || commit f6364b917c0d1a648962252a6bbf26e052120959 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Oct 26 12:47:21 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:31 2023 +0100 null-deref seen in ScTabView::UpdateEditView #0 0x00007f2bcc41df63 in ScViewData::GetCurYForTab (this=this@entry=0x3502d0b8, nTabIndex=nTabIndex@entry=6) at libreoffice/sc/source/ui/view/viewdata.cxx:1443 #1 0x00007f2bcc3ebf02 in ScTabView::UpdateEditView (this=this@entry=0x3502d0b0) at libreoffice/sc/source/ui/view/tabview3.cxx:2185 #2 0x00007f2bcc3ec636 in ScTabView::UpdateFormulas (this=this@entry=0x3502d0b0, nStartCol=nStartCol@entry=-1, nStartRow=nStartRow@entry=-1, nEndCol=nEndCol@entry=-1, nEndRow=nEndRow@entry=-1) at libreoffice/sc/source/ui/view/tabview3.cxx:2327 #3 0x00007f2bcc40735c in ScTabViewShell::Notify (this=0x3502cf20, rBC=..., rHint=...) at libreoffice/sc/source/ui/view/tabvwsh5.cxx:216 #4 0x00007f2bdc1885a9 in SfxBroadcaster::Broadcast (this=this@entry=0x31e31430, rHint=...) at libreoffice/svl/source/notify/SfxBroadcaster.cxx:40 #5 0x00007f2bcc022e6d in ScDocShell::PostDataChanged (this=this@entry=0x31e31430) at libreoffice/sc/source/ui/docshell/docsh3.cxx:95 #6 0x00007f2bcc0101aa in ScDocShell::SetDocumentModified (this=0x31e31430) at libreoffice/sc/source/ui/docshell/docsh.cxx:3015 #7 0x00007f2bcc010df3 in ScDocShellModificator::SetDocumentModified (this=this@entry=0x7fff2d168da0) at libreoffice/sc/source/ui/docshell/docsh.cxx:3330 #8 0x00007f2bcc040c1a in ScDocShell::MoveTable (this=this@entry=0x31e31430, nSrcTab=<optimized out>, nDestTab=<optimized out>, bCopy=bCopy@entry=false, bRecord=bRecord@entry=false) at libreoffice/sc/source/ui/docshell/docsh5.cxx:1010 #9 0x00007f2bcc441a41 in ScViewFunc::MoveTable (this=this@entry=0x333d0fe0, nDestDocNo=nDestDocNo@entry=0, nDestTab=nDestTab@entry=7, bCopy=bCopy@entry=false, pNewTabName=pNewTabName@entry=0x7fff2d169068) at libreoffice/sc/source/ui/view/viewfun2.cxx:3117 #10 0x00007f2bcc418459 in ScTabViewShell::ExecuteTable (this=0x333d0e50, rReq=...) at libreoffice/sc/source/ui/view/tabvwshf.cxx:593 #11 0x00007f2bdbd3d96f in SfxDispatcher::Call_Impl (this=this@entry=0x33379ed0, rShell=..., rSlot=..., rReq=..., bRecord=<optimized out>) at libreoffice/sfx2/source/control/dispatch.cxx:254 #12 0x00007f2bdbd427ee in SfxDispatcher::Execute_ (this=this@entry=0x33379ed0, rShell=..., rSlot=..., rReq=..., eCallMode=eCallMode@entry=SfxCallMode::RECORD) at libreoffice/sfx2/source/control/dispatch.cxx:753 #13 0x00007f2bdbd45a33 in SfxDispatcher::Execute (this=0x33379ed0, nSlot=<optimized out>, nCall=nCall@entry=SfxCallMode::RECORD, pArgs=pArgs@entry=0x7fff2d1694a0, pInternalArgs=pInternalArgs@entry=0x7fff2d169460, nModi=nModi@entry=0) at libreoffice/sfx2/source/control/dispatch.cxx:813 #14 0x00007f2bdbd83c0f in SfxDispatchController_Impl::dispatch (this=<optimized out>, aURL=..., aArgs=..., rListener=...) we have nulls in here for hidden sheets Change-Id: I8f1295e67552f3ec9306a031aaecd0838e18d98d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158502 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit ce8920448c05594f37f09c7a42ae3f3c7ccb7a1e) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index ae68a5dfc725..cae58203f706 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1432,7 +1432,13 @@ SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())) || !maTabData[nTabIndex]) return -1; - return maTabData[nTabIndex]->nCurX; + ScViewDataTable* pTabData = maTabData[nTabIndex].get(); + if (!pTabData) + { + SAL_WARN("sc.viewdata", "ScViewData::GetCurXForTab : hidden sheet = " << nTabIndex); + return -1; + } + return pTabData->nCurX; } SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const @@ -1440,7 +1446,13 @@ SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size()))) return -1; - return maTabData[nTabIndex]->nCurY; + ScViewDataTable* pTabData = maTabData[nTabIndex].get(); + if (!pTabData) + { + SAL_WARN("sc.viewdata", "ScViewData::GetCurYForTab : hidden sheet = " << nTabIndex); + return -1; + } + return pTabData->nCurY; } void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex ) @@ -1448,7 +1460,14 @@ void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex ) if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size()))) return; - maTabData[nTabIndex]->nCurX = nNewCurX; + ScViewDataTable* pTabData = maTabData[nTabIndex].get(); + if (!pTabData) + { + SAL_WARN("sc.viewdata", "ScViewData::SetCurXForTab : hidden sheet = " << nTabIndex); + return; + } + + pTabData->nCurX = nNewCurX; } void ScViewData::SetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex ) @@ -1456,7 +1475,14 @@ void ScViewData::SetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex ) if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size()))) return; - maTabData[nTabIndex]->nCurY = nNewCurY; + ScViewDataTable* pTabData = maTabData[nTabIndex].get(); + if (!pTabData) + { + SAL_WARN("sc.viewdata", "ScViewData::SetCurYForTab : hidden sheet = " << nTabIndex); + return; + } + + pTabData->nCurY = nNewCurY; } void ScViewData::SetMaxTiledCol( SCCOL nNewMaxCol ) commit 8191268fab81a7570f0748e236d202f83d299742 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Oct 26 12:18:37 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:31 2023 +0100 crash seen in Window::ImplTrackTimerHdl #0 vcl::Window::ImplTrackTimerHdl (this=0x3403b0a0, pTimer=<optimized out>) at libreoffice/vcl/source/window/window2.cxx:231 #1 0x00007f2bdd31f5e7 in Scheduler::CallbackTaskScheduling () at libreoffice/vcl/source/app/scheduler.cxx:485 #2 0x00007f2bdd4e5176 in SalTimer::CallCallback (this=<optimized out>) at libreoffice/vcl/inc/saltimer.hxx:54 #3 SvpSalInstance::CheckTimeout (this=this@entry=0x261ef40, bExecuteTimers=bExecuteTimers@entry=true) at libreoffice/vcl/headless/svpinst.cxx:212 #4 0x00007f2bdd4e713d in SvpSalInstance::ImplYield (this=this@entry=0x261ef40, bWait=bWait@entry=true, bHandleAllCurrentEvents=bHandleAllCurrentEvents@entry=false) at libreoffice/vcl/headless/svpinst.cxx:453 #5 0x00007f2bdd4e74a0 in SvpSalInstance::DoYield (this=0x261ef40, bWait=<optimized out>, bHandleAllCurrentEvents=<optimized out>) at libreoffice/vcl/headless/svpinst.cxx:525 Change-Id: I66ec56603aeb8a7fe855253b961dafb0bc7b875e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158441 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 455a1775ccef305cfb96cc5f67c8ee47b7f3a2ae) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index ad7677195dab..8bbab7bbf969 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -220,6 +220,12 @@ void Window::InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlag IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer, void ) { + if (!mpWindowImpl) + { + SAL_WARN("vcl", "ImplTrackTimerHdl has outlived dispose"); + return; + } + ImplSVData* pSVData = ImplGetSVData(); // if Button-Repeat we have to change the timeout commit 7672bee7e318ca5c5df2bca06d57f38f8df56647 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Oct 18 16:47:20 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:31 2023 +0100 crashreporting: svx::SentenceEditWindow_Impl::CreateSpellPortions() cui/source/dialogs/SpellDialog.cxx:2005 aRet[ aRet.size() - 1 ].sText += aLeftOverText; presumably aRet is empty() here a) don't bother appending if aLeftOverText is empty() b) don't crah if aRet is empty() and aLeftOverText is not Change-Id: Ie9a9585f572d8afb17183b479fb6f2cce5952aa7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158124 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit e7e5b43c4906d9f0e199f689addc29aa98916e6e) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index e233dffff354..f051fa27e0d3 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1991,7 +1991,7 @@ svx::SpellPortions SentenceEditWindow_Impl::CreateSpellPortions() const aPortion2.sText = aLeftOverText.makeStringAndClear(); aRet.push_back( aPortion2 ); } - else + else if (!aLeftOverText.isEmpty() && !aRet.empty()) { // we just need to append the left-over text to the last portion (which had no errors) aRet[ aRet.size() - 1 ].sText += aLeftOverText; } commit 1cd5a11e0f89cd969174c5a5082d8a09862c41b1 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Oct 16 17:01:59 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:31 2023 +0100 ofz#63295 Null-dereference READ Change-Id: Ib8bfa814099c1c1f3d65b18026ea812c80b6e9c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158058 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 00904f994a2f03638ec7f284396aeb730746e68d) diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index b407264a2797..48b8ccc1fd04 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -2503,7 +2503,7 @@ SwLinePortion* SwTextFormatter::MakeRestPortion( const SwLineLayout* pLine, pTmp = new SwDoubleLinePortion( *pCreate, nMultiPos ); else if( pHelpMulti->IsBidi() ) pTmp = new SwBidiPortion( nMultiPos, pCreate->nLevel ); - else if (IsIncompleteRuby(*pHelpMulti)) + else if (IsIncompleteRuby(*pHelpMulti) && pCreate->pAttr) { TextFrameIndex nRubyOffset = static_cast<const SwRubyPortion*>(pHelpMulti)->GetRubyOffset(); pTmp = new SwRubyPortion( *pCreate, *GetInfo().GetFont(), commit 83575b2a14e99bd962ef2a2f46ae5bc5a22856cb Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Oct 10 21:23:43 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:30 2023 +0100 make CppunitTest_framework_dispatch reliable the appearance of 2 interceptions is reproducible for me on linux with make CppunitTest_framework_dispatch VALGRIND=memcheck 1st time #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0 #7 framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:110 #8 non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:0 #9 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:94 #10 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172 2nd time #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0 #7 SfxStateCache::GetSlotServer(SfxDispatcher&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&) at core/sfx2/source/control/statcach.cxx:263 #8 SfxBindings::UpdateSlotServer_Impl() at core/sfx2/source/control/bindings.cxx:1083 #9 SfxBindings::NextJob_Impl(Timer const*) at core/sfx2/source/control/bindings.cxx:1254 #10 SfxBindings::NextJob(Timer*) at core/sfx2/source/control/bindings.cxx:1222 #11 SfxBindings::LinkStubNextJob(void*, Timer*) at core/sfx2/source/control/bindings.cxx:1219 #12 Link<Timer*, void>::Call(Timer*) const at core/include/tools/link.hxx:111 #13 Timer::Invoke() at core/vcl/source/app/timer.cxx:76 #14 Scheduler::CallbackTaskScheduling() at core/vcl/source/app/scheduler.cxx:480 #15 SalTimer::CallCallback() at core/vcl/inc/saltimer.hxx:55 #16 SvpSalInstance::CheckTimeout(bool) at core/vcl/headless/svpinst.cxx:161 #17 SvpSalInstance::ImplYield(bool, bool) at core/vcl/headless/svpinst.cxx:399 #18 SvpSalInstance::DoYield(bool, bool) at core/vcl/headless/svpinst.cxx:471 #19 ImplYield(bool, bool) at core/vcl/source/app/svapp.cxx:377 #20 Scheduler::ProcessEventsToIdle() at core/vcl/source/app/svapp.cxx:407 #21 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:95 #22 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172 setting bold/italic will invalidate the slot for the property and timer starts to update the normal listeners to those properties which might kick in on a slower run. Change-Id: Ib37e61c0fbed463f8974d476158e54a0160a2c92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157798 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 30c582a7202b1403e260af933258d456e7280a19) diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx index 16a4ecb517f1..46d28e6e18d7 100644 --- a/framework/qa/cppunit/dispatchtest.cxx +++ b/framework/qa/cppunit/dispatchtest.cxx @@ -174,10 +174,9 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) xRegistration->registerDispatchProviderInterceptor(pInterceptor); dispatchCommand(mxComponent, ".uno:Bold", {}); - CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected()); + CPPUNIT_ASSERT_GREATER(0, pInterceptor->getExpected()); CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected()); dispatchCommand(mxComponent, ".uno:Italic", {}); - CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected()); // This was 1: MyInterceptor::queryDispatch() was called for .uno:Italic. CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected()); } commit 51da0a783f8ca43d0d747b7928d1cae99d5f7e5a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Oct 10 16:29:16 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:30 2023 +0100 tdf#154142 null-deref in SfxUndoManager::SetMaxUndoActionCount Change-Id: I09cfbccb5f2ffa009a3e40157c9373b7e10864dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157764 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 6cfd36a392ec3710304ff3df3cb0f42e0d8b53d9) diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 913915a20dc8..48503d6394e0 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -140,7 +140,7 @@ ScFormatShell::ScFormatShell(ScViewData& rData) : SetPool( &pTabViewShell->GetPool() ); SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager(); SetUndoManager( pMgr ); - if ( !rViewData.GetDocument().IsUndoEnabled() ) + if (pMgr && !rViewData.GetDocument().IsUndoEnabled()) { pMgr->SetMaxUndoActionCount( 0 ); } commit 5213ffce56de4d864a4eac857a1228a9a6f4fc46 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Sep 25 11:15:36 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:30 2023 +0100 ofz#62688 Null-dereference READ in SwRubyPortion::SwRubyPortion seen with fodt2pdf fuzzer Change-Id: If761f5ecc473f4c936db82f3fcb7dd891e82573f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157243 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit cc564cea7eda29ed7e98ea27056f3ab57a6e2027) diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 518294e12d9b..b407264a2797 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -2383,6 +2383,11 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, return bRet; } +static bool IsIncompleteRuby(const SwMultiPortion& rHelpMulti) +{ + return rHelpMulti.IsRuby() && static_cast<const SwRubyPortion&>(rHelpMulti).GetRubyOffset() < TextFrameIndex(COMPLETE_STRING); +} + // When a fieldportion at the end of line breaks and needs a following // fieldportion in the next line, then the "restportion" of the formatinfo // has to be set. Normally this happens during the formatting of the first @@ -2491,19 +2496,19 @@ SwLinePortion* SwTextFormatter::MakeRestPortion( const SwLineLayout* pLine, if (!pCreate) return pRest; - if( pRest || nMultiPos > nPosition || ( pHelpMulti->IsRuby() && - static_cast<const SwRubyPortion*>(pHelpMulti)->GetRubyOffset() < TextFrameIndex(COMPLETE_STRING))) + if( pRest || nMultiPos > nPosition || IsIncompleteRuby(*pHelpMulti)) { SwMultiPortion* pTmp; if( pHelpMulti->IsDouble() ) pTmp = new SwDoubleLinePortion( *pCreate, nMultiPos ); else if( pHelpMulti->IsBidi() ) pTmp = new SwBidiPortion( nMultiPos, pCreate->nLevel ); - else if( pHelpMulti->IsRuby() ) + else if (IsIncompleteRuby(*pHelpMulti)) { + TextFrameIndex nRubyOffset = static_cast<const SwRubyPortion*>(pHelpMulti)->GetRubyOffset(); pTmp = new SwRubyPortion( *pCreate, *GetInfo().GetFont(), m_pFrame->GetDoc().getIDocumentSettingAccess(), - nMultiPos, static_cast<const SwRubyPortion*>(pHelpMulti)->GetRubyOffset(), + nMultiPos, nRubyOffset, GetInfo() ); } else if( pHelpMulti->HasRotation() ) commit 03af02b554fb3d8e42673123ba5253b09baef43a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Sep 14 20:18:55 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:30 2023 +0100 crashreporting: apparent null deref at SwFEShell::IsShapeDefaultHoriTextDirR2L https: //crashreport.libreoffice.org/stats/crash_details/73028951-19a0-409b-89d2-a080495df925 Change-Id: I440465a3c7d5b98ecdd1c5f1973a2b8f64d6772e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156931 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 105d1c010c4dc3caedf66a2080045c9c5f6fb9e3) diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 8369004ac3c5..f0e9ad4e868f 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -3323,8 +3323,11 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr ) { // determine page frame of the frame the shape is anchored. - const SwFrame* pAnchorFrame = - static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrame( pSdrObj ); + const SwContact* pContact = GetUserCall(pSdrObj); + OSL_ENSURE( pContact, "<SwFEShell::IsShapeDefaultHoriTextDirR2L(..)> - missing contact!" ); + if (!pContact) + return false; + const SwFrame* pAnchorFrame = static_cast<const SwDrawContact*>(pContact)->GetAnchorFrame( pSdrObj ); OSL_ENSURE( pAnchorFrame, "inconsistent model - no anchor at shape!"); if ( pAnchorFrame ) { commit 0373b6a30aa3ddef87c89c3588477caebcba4698 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Nov 8 11:55:51 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Nov 20 19:28:22 2023 +0100 python3: name gdb pretty-printer after .so, not .bin So it works not only with instdir/program/python but also with soffice in-process python. Change-Id: I5c3643ef4a7ca0f25df3c6f51d11ff98c27f4bd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159148 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit a2fabc78a4ba12ad8df6b040783be0fa22aefa54) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159049 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> (cherry picked from commit c4a57f59d56312bbdcb507ecbf13b75c6c6db1dc) diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index 9987ab138792..ec6568756c23 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -48,7 +48,7 @@ else $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so)) -$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin-gdb.py,Tools/gdb/libpython.py)) +$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d).so.1.0-gdb.py,Tools/gdb/libpython.py)) # Unfortunately the python build system does not allow to explicitly enable or # disable these, it just tries to build them and then prints which did not