avmedia/source/gstreamer/gstframegrabber.cxx | 14 ++- dbaccess/source/core/dataaccess/ModelImpl.cxx | 3 external/gpgmepp/UnpackedTarball_gpgmepp.mk | 1 external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 | 32 ++++++++ external/liborcus/UnpackedTarball_liborcus.mk | 1 external/liborcus/cstdint.patch.0 | 40 ++++++++++ external/libpagemaker/UnpackedTarball_libpagemaker.mk | 6 + external/libpagemaker/cstdint.patch.0 | 10 ++ filter/source/xsltdialog/xmlfilterjar.hxx | 1 forms/source/component/EventThread.hxx | 1 fpicker/source/office/contentenumeration.hxx | 1 include/sal/log.hxx | 5 + include/sfx2/docmacromode.hxx | 5 + include/sfx2/objsh.hxx | 6 + include/sfx2/strings.hrc | 1 include/svtools/imageresourceaccess.hxx | 1 include/svx/hexcolorcontrol.hxx | 1 include/tools/urlobj.hxx | 5 + include/vcl/BitmapBuffer.hxx | 1 include/vcl/font/Feature.hxx | 1 io/source/acceptor/acc_pipe.cxx | 1 io/source/acceptor/acc_socket.cxx | 1 io/source/connector/connector.cxx | 1 sc/source/core/data/global.cxx | 7 + sd/source/ui/app/sdmod1.cxx | 29 ++++--- sfx2/source/doc/docmacromode.cxx | 8 +- sfx2/source/doc/iframe.cxx | 6 + sfx2/source/doc/objmisc.cxx | 35 ++++++++ sfx2/source/doc/objxtor.cxx | 1 sfx2/source/inc/objshimp.hxx | 3 sot/source/unoolestorage/xolesimplestorage.hxx | 1 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx | 1 sw/source/filter/html/htmlplug.cxx | 2 sw/source/filter/xml/xmltexti.cxx | 2 sw/source/uibase/docvw/OverlayRanges.hxx | 1 sw/source/uibase/docvw/ShadowOverlayObject.hxx | 1 sw/source/uibase/shells/drwtxtex.cxx | 8 -- sw/source/uibase/wrtsh/wrtsh2.cxx | 38 ++++++--- tools/source/fsys/urlobj.cxx | 9 ++ xmloff/source/draw/ximpshap.cxx | 2 xmlsecurity/CppunitTest_xmlsecurity_signing.mk | 1 xmlsecurity/source/gpg/SecurityEnvironment.hxx | 1 xmlsecurity/source/helper/ooxmlsecparser.hxx | 1 xmlsecurity/source/helper/xsecparser.hxx | 1 44 files changed, 249 insertions(+), 48 deletions(-)
New commits: commit 13a3d545f3095ff34a6765b0597e44afdb19de11 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Nov 22 21:14:41 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:51:09 2023 +0000 reuse AllowedLinkProtocolFromDocument in impress/draw Change-Id: I73ca4f087946a45dbf92d69a0dc1e769de9b5690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159843 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit f0942eed2eb328b04856f20613f5226d66b66a20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159759 Reviewed-by: Michael Stahl <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159884 Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 569fa7f755718a06f23d25b2132bf0400cec7a0f) (cherry picked from commit b60bd2dddc4b9d6d60615d61051a9f9ee5410851) (cherry picked from commit 8b244a0ce8a9170a1fd61e19a0c943230a741fbe) (cherry picked from commit 87535988868baac08173fc826dbb6c6cbdf91dd4) (cherry picked from commit fd809982a280218046ab7e6e6d24492420143e6c) (cherry picked from commit 56dd18f55d14939a1d5697e8580efd580bae0da7) (cherry picked from commit 5aa0ae5fffe3a6f98e2ae4a677a20a8f95d3eed3) (cherry picked from commit d0263e4735d37e52184e6e46c3c1405de9400e08) diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 3d84ddb0da56..8d42653545ea 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -32,6 +32,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <sfx2/templatedlg.hxx> +#include <svl/stritem.hxx> #include <editeng/eeitem.hxx> #include <svx/svxids.hrc> @@ -193,26 +194,32 @@ void SdModule::Execute(SfxRequest& rReq) { bool bIntercept = false; ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); - if (pDocShell) + ::sd::ViewShell* pViewShell = pDocShell ? pDocShell->GetViewShell() : nullptr; + if (pViewShell) { - ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); - if (pViewShell) + if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) ) { - if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) ) + // Prevent documents from opening while the slide + // show is running, except when this request comes + // from a shape interaction. + if (rReq.GetArgs() == nullptr) { - // Prevent documents from opening while the slide - // show is running, except when this request comes - // from a shape interaction. - if (rReq.GetArgs() == nullptr) - { - bIntercept = true; - } + bIntercept = true; } } } if (!bIntercept) { + if (const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(SID_FILE_NAME)) + { + if (!pViewShell || !SfxObjectShell::AllowedLinkProtocolFromDocument(pURLItem->GetValue(), + pViewShell->GetObjectShell(), + pViewShell->GetFrameWeld())) + { + return; + } + } SfxGetpApp()->ExecuteSlot(rReq, SfxGetpApp()->GetInterface()); } else commit 718cfe5efa7c2de05856c24238bfed3f5cb0b6dd Author: Caolán McNamara <[email protected]> AuthorDate: Wed Nov 15 11:39:24 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:51:00 2023 +0000 reuse AllowedLinkProtocolFromDocument in writer 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 <[email protected]> (cherry picked from commit e6a7537762e19fde446441edd10d301f9b37ce75) reuse AllowedLinkProtocolFromDocument in writer Change-Id: Iacf5e313fc6ca5f7d69ca6986a036f0e1ab1f2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159488 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 32535dfa82200b54296838b52285c054fbe5e51d) combine these hyperlink dispatchers into one call Change-Id: Icb7822e811013de648ccf2fbb23a5f0be9e29bb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159489 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 0df175ccc6ea542bc5801f631ff72bed187042eb) we can have just one LoadURL for writer Change-Id: Ia0162ee1c275292fcf200bad4662e4c2c6b7b972 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159557 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 521ca9cf6acbae96cf95d9740859c9682212013d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159858 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit e32b8601dbd63cf01497889601d6c9c1241106d6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159883 (cherry picked from commit 6d29ee15039a567ad5f70a3e51289fea93c1f64e) (cherry picked from commit 6708272c15941d94ab828a188e06a0addca1dd15) (cherry picked from commit 8423af18d7b8b82d106acede33720457071e79e9) (cherry picked from commit 6aa0be1d2905b77e567ca32446b61ab2e9bef0b1) (cherry picked from commit 583a30728042993d7fcacccf49c8e338150f2f44) (cherry picked from commit dd7e7a8b0004dc24c9880cc91368ed8512c35f01) (cherry picked from commit 782f9422888322f9ec54d98b6f31b5f372170ff7) (cherry picked from commit a739883e98fb86627a71133a1d4bec2743ff2632) diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 43df4605fe1d..2a65b7a93e7e 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -202,6 +202,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 @@ -418,8 +421,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/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index 1db36e733c0c..29950ba68ca1 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -103,6 +103,7 @@ #define STR_GB NC_("STR_GB", "GB") #define STR_QUERY_LASTVERSION NC_("STR_QUERY_LASTVERSION", "Cancel all changes?") #define STR_NO_WEBBROWSER_FOUND NC_("STR_NO_WEBBROWSER_FOUND", "Opening \"$(ARG1)\" failed with error code $(ARG2) and message: \"$(ARG3)\"\nMaybe no web browser could be found on your system. In that case, please check your Desktop Preferences or install a web browser (for example, Firefox) in the default location requested during the browser installation.") +#define STR_DANGEROUS_TO_OPEN NC_("STR_DANGEROUS_TO_OPEN", "It might be dangerous to open \"$(ARG1)\".\nDo you really want to open it?") #define STR_NO_ABS_URI_REF NC_("STR_NO_ABS_URI_REF", "\"$(ARG1)\" is not an absolute URL that can be passed to an external application to open it.") #define STR_GID_INTERN NC_("STR_GID_INTERN", "Internal") #define STR_GID_APPLICATION NC_("STR_GID_APPLICATION", "Application") diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index a225ea84bfc9..f28c4b5a682e 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -26,9 +26,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> @@ -38,6 +36,7 @@ #include <vcl/keycodes.hxx> #include <vcl/virdev.hxx> #include <vcl/weld.hxx> +#include <vcl/window.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <unotools/charclass.hxx> @@ -826,34 +825,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->GetWindow().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 c7418ef127fd..f372de7fe4b1 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -964,6 +964,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; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 60bdf16380be..0e3ba07c3973 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -545,12 +545,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(GetShell(), pURLField->GetURL(), LoadUrlFlags::NONE, + pURLField->GetTargetFrame()); } } break; diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 82d7c27cb0c6..b64e3625ab41 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -488,30 +488,24 @@ bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter ) return bRet; } -void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, - const OUString& rTargetFrameName ) +static void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter, + const OUString& rTargetFrameName) { - OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" ); - if( rURL.isEmpty() ) - return ; + SwDocShell* pDShell = rView.GetDocShell(); + OSL_ENSURE( pDShell, "No DocShell?!"); + SfxViewFrame* pViewFrame = rView.GetViewFrame(); - // The shell could be 0 also!!!!! - if ( dynamic_cast<const SwCursorShell*>( &rVSh) == nullptr ) + if (!SfxObjectShell::AllowedLinkProtocolFromDocument(rURL, pDShell, rView.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("#")) { - rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); + rView.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); 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) { @@ -526,7 +520,6 @@ 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 ); SfxStringItem aName( SID_FILE_NAME, rURL ); SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame ); @@ -552,6 +545,23 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, SfxCallMode::ASYNCHRON|SfxCallMode::RECORD ); } +void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter, + const OUString& rTargetFrameName ) +{ + OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" ); + if( rURL.isEmpty() ) + return ; + + // The shell could be 0 also!!!!! + if ( dynamic_cast<const SwCursorShell*>( &rVSh) == nullptr ) + return; + + //A CursorShell is always a WrtShell + SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh); + + ::LoadURL(rSh.GetView(), rURL, nFilter, rTargetFrameName); +} + void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk, const sal_uInt16 nAction ) { commit f0e537b956efde03e97d04f77b9dda62c9c3251c Author: Caolán McNamara <[email protected]> AuthorDate: Fri Nov 3 17:26:25 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:50:51 2023 +0000 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 <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit b6062623b4d69c79e90e9365ac7c5e7f11986793) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159046 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit cfe5672c069d6ed3a62dfc3370fdfbc80b6de434) (cherry picked from commit 5109649b65206ca6abd823fe2ccf07925e36d71b) (cherry picked from commit 01e7c1682b544266f7b85d58127e878484ea46b0) (cherry picked from commit ee4849d06b7db4dbb0bed9696c548ace8f8d8313) (cherry picked from commit 1b0c07506acadd615c560cbaa67f4bcb17132c24) (cherry picked from commit 1a30b62ac7c23dd12aee88f0b90d8a715c652475) (cherry picked from commit 3a376837d591f09e79b7c706aefa75853a777230) diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index d5c3b9b3e086..19d598cd9bd8 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -1139,7 +1139,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 bd4f13fb016c..b7aaa04bd6c0 100644 --- a/include/sfx2/docmacromode.hxx +++ b/include/sfx2/docmacromode.hxx @@ -261,7 +261,10 @@ 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 >& xContainter ); + /** checks the macro execution mode while loading the document. This must be called when the loading is effectively finished, but before any macro action @@ -288,7 +291,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 2a56ebe88e07..43df4605fe1d 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -418,6 +418,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 050fd823b4ee..a225ea84bfc9 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -26,7 +26,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> @@ -35,6 +37,7 @@ #include <svl/zformat.hxx> #include <vcl/keycodes.hxx> #include <vcl/virdev.hxx> +#include <vcl/weld.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <unotools/charclass.hxx> @@ -789,7 +792,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 ) { @@ -823,6 +826,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 2fa7b968fc41..8a617b1785c6 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -404,8 +404,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() ) @@ -415,7 +419,7 @@ namespace sfx2 } else { - if (m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() || m_xData->m_rDocumentAccess.macroCallsSeenWhileLoading()) + if (bHasMacros) { if (m_xData->m_rDocumentAccess.macroCallsSeenWhileLoading()) m_bNeedsContentSigned = true; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index f71358b568fa..c7418ef127fd 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -954,9 +954,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 510c35daf59f..a707bb7c4a27 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -237,6 +237,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 3d7b0b69c945..4afdd706d05e 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -91,7 +91,8 @@ struct SfxObjectShell_Impl : 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 881db19f9d4adb03584b37193a6bf88e12f7fbc6 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Nov 4 19:57:51 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:50:36 2023 +0000 warn about exotic protocols as well Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158902 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit aafe05584e601236e84a165f2816b187189cfb77) (cherry picked from commit 799f0225d7171e6c04324ace1f31c7fe976662a4) (cherry picked from commit ae06669597e5a485676ba4394822cba8bb88d394) (cherry picked from commit a7138808fbb8eb263af436ee4227cbe9c829b676) (cherry picked from commit 19316aacbb9f1774565a157d21e70c88c490cef6) (cherry picked from commit 13c0bdee068ad4af1f4e03461580ec7bddeb0d63) (cherry picked from commit f7f3aab1c9f49a4e56711c7fd3b32da793b00a43) Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index eb707040adb2..112975f98511 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1089,7 +1089,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::makeAny( sHRef ) ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 169cbdc1534d..caf300f239c6 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -856,7 +856,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 ab6e885639db..1ef2b7e0b2af 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4776,7 +4776,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 44b5177501f1..30c303690d97 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3269,7 +3269,7 @@ void SdXMLFloatingFrameShapeContext::StartElement( const css::uno::Reference< cs if( !maHref.isEmpty() ) { - if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(maHref).IsExoticProtocol()) GetImport().NotifyMacroEventRead(); xProps->setPropertyValue("FrameURL", Any(maHref) ); commit f682a61d5cef2d48a10d582a8109e2aa79cc35c6 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Nov 3 17:14:26 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:49:41 2023 +0000 add some protocols that don't make sense as floating frame targets Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158910 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 11ebdfef16501c6d35c3e3d0d62507f706557c71) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158901 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 73e90d15c48a8f148e4e8f024cdf1b397efbcc53) (cherry picked from commit b35aa37a5d1f32a419e7f311e415615808731acd) (cherry picked from commit 421be99a6b101ac4ec91ad95b48c50fa17e47d36) (cherry picked from commit fa390145228c9b9a044698fe4b7636c05210fda3) (cherry picked from commit e549b65636b31971d8fb7fafc92e683bdef35cb6) (cherry picked from commit eb42c9ad6473fb84fb5c02e522efe01e68e3ce43) (cherry picked from commit adb38d113f86b9972b2a3aa9fa67620f854526fa) Change-Id: Id900a5eef248731d1184c1df501a2cf7a2de7eb9 diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index 522dcca35fcd..67f241376537 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -920,6 +920,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 84d724f7c58f..c80547ec2eb5 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -38,6 +38,7 @@ #include <rtl/ref.hxx> #include <svtools/miscopt.hxx> #include <svl/ownlist.hxx> +#include <sal/log.hxx> #include <svl/itemprop.hxx> #include <sfx2/docfile.hxx> #include <sfx2/frmdescr.hxx> @@ -169,8 +170,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 64daa11c9415..ab6e885639db 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4771,4 +4771,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 b3299fe7ae71b0ed781284a49cb03e34af15fcc0 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Nov 3 14:20:07 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:48:52 2023 +0000 escape url passed to gstreamer Change-Id: I3c93ee34800cc8563370f75ef3ef6f8a9220e6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158895 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 2ee1167da1952b133280db2ae26eed6bf0303bc2) (cherry picked from commit a77d9c151f043f070512488d84f0b839f4ed4553) (cherry picked from commit 2b896a0ba8818804b89735bd7c8991fa8eb3d7b5) (cherry picked from commit 0f14350fe70907d4466bcef15bfe05865b37babd) (cherry picked from commit 9b7df77e3491add0919d8de993df0f40d7c58a70) (cherry picked from commit 714e464631533901314f3189ce293dca47bec20e) (cherry picked from commit cc41f40d696cec7c3ecec147b899d45d09f4629c) diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index bc183d563332..0135a78ed597 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -51,11 +51,9 @@ void FrameGrabber::disposePipeline() FrameGrabber::FrameGrabber( const OUString &rURL ) : FrameGrabber_BASE() { - 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 ); @@ -66,6 +64,12 @@ FrameGrabber::FrameGrabber( const OUString &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 371ed0f71d97844c13f26b615599853ae6888717 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Dec 1 17:01:10 2023 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Dec 3 20:47:56 2023 +0000 fix build for more recent compilers Change-Id: If726e049006ad1661eb1581748b11b1459803d9c diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk index 1b0468fc6f23..fc7ed88ac6d6 100644 --- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -33,5 +33,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ external/gpgmepp/gcc9.patch \ external/gpgmepp/version.patch \ external/gpgmepp/ubsan.patch \ + external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 new file mode 100644 index 000000000000..85131dde3bc1 --- /dev/null +++ b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 @@ -0,0 +1,32 @@ +From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001 +From: Jiri Kucera <[email protected]> +Date: Sun, 25 Jul 2021 11:35:54 +0200 +Subject: [PATCH] core: Support closefrom also for glibc. + +* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom. +-- + +Since 2.34, glibc introduces closefrom (the implementation +follows *BSD standard). + +Signed-off-by: Werner Koch <[email protected]> +--- + src/posix-io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/posix-io.c b/src/posix-io.c +index e712ef28..2a3a81fc 100644 +--- a/src/posix-io.c ++++ b/src/posix-io.c +@@ -485,7 +485,7 @@ + if (fd_list[i].fd > fd) + fd = fd_list[i].fd; + fd++; +-#ifdef __sun ++#if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__) + closefrom (fd); + max_fds = fd; + #else /*!__sun */ +-- +2.11.0 + diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index 8afdeba1aa7c..2723f9476b4b 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/gcc9.patch.0 \ external/liborcus/libtool.patch.0 \ external/liborcus/fix-pch.patch.0 \ + external/liborcus/cstdint.patch.0 \ )) $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ diff --git a/external/liborcus/cstdint.patch.0 b/external/liborcus/cstdint.patch.0 new file mode 100644 index 000000000000..0fc76b98d5c9 --- /dev/null +++ b/external/liborcus/cstdint.patch.0 @@ -0,0 +1,40 @@ +--- include/orcus/types.hpp ++++ include/orcus/types.hpp +@@ -16,6 +16,7 @@ + #pragma GCC diagnostic ignored "-Wshadow" + #endif + ++#include <cstdint> + #include <cstdlib> + #include <vector> + #include <string> +--- src/liborcus/orcus_xlsx.cpp ++++ src/liborcus/orcus_xlsx.cpp +@@ -31,6 +31,7 @@ + #include "spreadsheet_iface_util.hpp" + + #include <cstdlib> ++#include <limits> + #include <iostream> + #include <string> + #include <cstring> +--- src/liborcus/xls_xml_context.cpp ++++ ./src/liborcus/xls_xml_context.cpp +@@ -16,6 +16,7 @@ + #include <mdds/sorted_string_map.hpp> + + #include <iostream> ++#include <limits> + + using namespace std; + +--- src/liborcus/xlsx_revision_context.cpp ++++ src/liborcus/xlsx_revision_context.cpp +@@ -15,6 +15,7 @@ + #include "orcus/string_pool.hpp" + #include "orcus/global.hpp" + ++#include <limits> + #include <iostream> + + using namespace std; diff --git a/external/libpagemaker/UnpackedTarball_libpagemaker.mk b/external/libpagemaker/UnpackedTarball_libpagemaker.mk index 752d5c0ebe21..abe62a7e1045 100644 --- a/external/libpagemaker/UnpackedTarball_libpagemaker.mk +++ b/external/libpagemaker/UnpackedTarball_libpagemaker.mk @@ -11,6 +11,12 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libpagemaker)) $(eval $(call gb_UnpackedTarball_set_tarball,libpagemaker,$(PAGEMAKER_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_patchlevel,libpagemaker,1)) + $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libpagemaker)) +$(eval $(call gb_UnpackedTarball_add_patches,libpagemaker,\ + external/libpagemaker/cstdint.patch.0 \ +)) + # vim: set noet sw=4 ts=4: diff --git a/external/libpagemaker/cstdint.patch.0 b/external/libpagemaker/cstdint.patch.0 new file mode 100644 index 000000000000..f8fba20e6046 --- /dev/null +++ b/external/libpagemaker/cstdint.patch.0 @@ -0,0 +1,10 @@ +--- src/lib/Units.h 2023-05-29 10:21:08.022718509 +0100 ++++ src/lib/Units.h 2023-05-29 10:21:16.838724433 +0100 +@@ -10,6 +10,7 @@ + #ifndef LIBPAGEMAKER_UNITS_H + #define LIBPAGEMAKER_UNITS_H + ++#include <cstdint> + #include <string> + + // TODO: remove this pointless abstraction. diff --git a/filter/source/xsltdialog/xmlfilterjar.hxx b/filter/source/xsltdialog/xmlfilterjar.hxx index d9e20cd05847..d4a760366626 100644 --- a/filter/source/xsltdialog/xmlfilterjar.hxx +++ b/filter/source/xsltdialog/xmlfilterjar.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <memory> #include <vector> class filter_info_impl; diff --git a/forms/source/component/EventThread.hxx b/forms/source/component/EventThread.hxx index eb3062080d73..bb8d01c48a0b 100644 --- a/forms/source/component/EventThread.hxx +++ b/forms/source/component/EventThread.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> +#include <memory> #include <vector> #include <com/sun/star/lang/XEventListener.hpp> diff --git a/fpicker/source/office/contentenumeration.hxx b/fpicker/source/office/contentenumeration.hxx index 920a6d8f2b08..dc863cdef48d 100644 --- a/fpicker/source/office/contentenumeration.hxx +++ b/fpicker/source/office/contentenumeration.hxx @@ -25,6 +25,7 @@ #include <ucbhelper/content.hxx> #include <rtl/ustring.hxx> #include <tools/datetime.hxx> +#include <memory> namespace svt { diff --git a/include/sal/log.hxx b/include/sal/log.hxx index 00d533ab5495..f85c7d882134 100644 --- a/include/sal/log.hxx +++ b/include/sal/log.hxx @@ -161,7 +161,10 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) { @since LibreOffice 3.5 */ -#if defined _LIBCPP_VERSION || (defined _MSC_VER && _MSC_VER >= 1915) +#if defined _LIBCPP_VERSION \ + || (defined _GLIBCXX_RELEASE \ + && (_GLIBCXX_RELEASE >= 12 || (_GLIBCXX_RELEASE == 11 && __GLIBCXX__ > 20210428))) \ + || (defined _MSC_VER && _MSC_VER >= 1915) #define SAL_STREAM(stream) \ (::std::ostringstream() << stream).str() #else diff --git a/include/svtools/imageresourceaccess.hxx b/include/svtools/imageresourceaccess.hxx index 6adff39ae4aa..ef0e24f24c92 100644 --- a/include/svtools/imageresourceaccess.hxx +++ b/include/svtools/imageresourceaccess.hxx @@ -23,6 +23,7 @@ #include <svtools/svtdllapi.h> #include <com/sun/star/uno/Reference.hxx> +#include <memory> namespace com :: sun :: star :: io { class XInputStream; } namespace com :: sun :: star :: uno { class XComponentContext; } diff --git a/include/svx/hexcolorcontrol.hxx b/include/svx/hexcolorcontrol.hxx index 63b44992d370..ff5558555336 100644 --- a/include/svx/hexcolorcontrol.hxx +++ b/include/svx/hexcolorcontrol.hxx @@ -23,6 +23,7 @@ #include <svx/svxdllapi.h> #include <tools/color.hxx> #include <tools/link.hxx> +#include <memory> namespace weld { class Entry; } diff --git a/include/vcl/BitmapBuffer.hxx b/include/vcl/BitmapBuffer.hxx index 2a064951c447..0ab44f871073 100644 --- a/include/vcl/BitmapBuffer.hxx +++ b/include/vcl/BitmapBuffer.hxx @@ -24,6 +24,7 @@ #include <vcl/BitmapPalette.hxx> #include <vcl/ColorMask.hxx> #include <vcl/Scanline.hxx> +#include <memory> struct SalTwoRect; diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index b56ce19ba194..6723d00148ea 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@ -12,6 +12,7 @@ #include <vcl/dllapi.h> #include <rtl/ustring.hxx> +#include <cstdint> #include <vector> namespace vcl diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx index ad9ce09a20cb..f4f66fd20c2a 100644 --- a/io/source/acceptor/acc_pipe.cxx +++ b/io/source/acceptor/acc_pipe.cxx @@ -26,6 +26,7 @@ #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <cppuhelper/implbase.hxx> +#include <memory> using namespace ::osl; using namespace ::cppu; diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx index a72179ecb356..87a3d5df552a 100644 --- a/io/source/acceptor/acc_socket.cxx +++ b/io/source/acceptor/acc_socket.cxx @@ -19,6 +19,7 @@ #include "acceptor.hxx" +#include <memory> #include <unordered_set> #include <osl/mutex.hxx> diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index c21a34d17eac..f87eb594bfe9 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -33,6 +33,7 @@ #include <services.hxx> #include "connector.hxx" +#include <memory> #define IMPLEMENTATION_NAME "com.sun.star.comp.io.Connector" #define SERVICE_NAME "com.sun.star.connection.Connector" diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx b/sot/source/unoolestorage/xolesimplestorage.hxx index ef0214ba61c3..3169c9ccc1be 100644 --- a/sot/source/unoolestorage/xolesimplestorage.hxx +++ b/sot/source/unoolestorage/xolesimplestorage.hxx @@ -27,6 +27,7 @@ #include <cppuhelper/implbase.hxx> #include <osl/mutex.hxx> +#include <memory> namespace com::sun::star::container { class XNameAccess; } namespace com::sun::star::io { class XInputStream; } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx index 8407b084dbdc..22328900dc57 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx @@ -30,6 +30,7 @@ #include <cppuhelper/implbase.hxx> #include <comphelper/interfacecontainer2.hxx> #include <vcl/vclptr.hxx> +#include <memory> namespace textconversiondlgs diff --git a/sw/source/uibase/docvw/OverlayRanges.hxx b/sw/source/uibase/docvw/OverlayRanges.hxx index 7482deef8f97..8465feba500d 100644 --- a/sw/source/uibase/docvw/OverlayRanges.hxx +++ b/sw/source/uibase/docvw/OverlayRanges.hxx @@ -23,6 +23,7 @@ #include <svx/sdr/overlay/overlayobject.hxx> #include <basegfx/range/b2drange.hxx> +#include <memory> #include <vector> class SwView; diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.hxx b/sw/source/uibase/docvw/ShadowOverlayObject.hxx index ec2c7eaf44c1..ab90dede59e5 100644 --- a/sw/source/uibase/docvw/ShadowOverlayObject.hxx +++ b/sw/source/uibase/docvw/ShadowOverlayObject.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SW_SOURCE_UIBASE_DOCVW_SHADOWOVERLAYOBJECT_HXX #include <svx/sdr/overlay/overlayobject.hxx> +#include <memory> class SwView; diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk index 84e7a76c043b..3e6f73ab2fc3 100644 --- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk +++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk @@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,xmlsecurity_signing, \ unotest \ utl \ xmlsecurity \ + vcl \ )) $(eval $(call gb_CppunitTest_use_externals,xmlsecurity_signing,\ diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.hxx b/xmlsecurity/source/gpg/SecurityEnvironment.hxx index c815e0e1f5d2..d02cd1b3d430 100644 --- a/xmlsecurity/source/gpg/SecurityEnvironment.hxx +++ b/xmlsecurity/source/gpg/SecurityEnvironment.hxx @@ -17,6 +17,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <memory> namespace com::sun::star::security { class XCertificate; } namespace GpgME { class Context; } diff --git a/xmlsecurity/source/helper/ooxmlsecparser.hxx b/xmlsecurity/source/helper/ooxmlsecparser.hxx index 540028b22fc9..5fe6f53eb701 100644 --- a/xmlsecurity/source/helper/ooxmlsecparser.hxx +++ b/xmlsecurity/source/helper/ooxmlsecparser.hxx @@ -17,6 +17,7 @@ #include <xmloff/nmspmap.hxx> +#include <memory> #include <stack> class XSecController; diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx index 7674bf28b84d..a54bbdac37a5 100644 --- a/xmlsecurity/source/helper/xsecparser.hxx +++ b/xmlsecurity/source/helper/xsecparser.hxx @@ -27,6 +27,7 @@ #include <xmloff/nmspmap.hxx> +#include <memory> #include <stack> class XMLSignatureHelper;
