warn about exotic protocols as well
authorCaolán McNamara <caolan.mcnamara@collabora.com>
Sat, 4 Nov 2023 19:57:51 +0000 (19:57 +0000)
committerRene Engelhard <rene@debian.org>
Tue, 28 Nov 2023 19:36:58 +0000 (20:36 +0100)
Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151834
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 1305f70cff8a81a58a5a6d9c96c5bb032005389e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159034
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 2e1bcbb550d54278b366ec619cc5280d44d6aba4)

Gbp-Pq: Name warn-about-exotic-protocols-as-well.diff

sw/source/filter/html/htmlplug.cxx
sw/source/filter/xml/xmltexti.cxx
tools/source/fsys/urlobj.cxx
xmloff/source/draw/ximpshap.cxx

index 733be35312d7dd07abce23d3a243b3ce9b028d4c..cc7273c0565a32e79e3410bb0690b5fd6ea0cb16 100644 (file)
@@ -1092,7 +1092,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 ) );
index 07f935f1695e836a34c6a68d02977f6d0fb7a926..40325dbf3e9353bcd702fa144453ce2109a17ca9 100644 (file)
@@ -859,7 +859,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",
index 8e6bdfd98845a81ae083b892b05302e2cd12e1d4..6af99a7b262cf3f89dece6aeb74fc217b3e2c111 100644 (file)
@@ -4765,7 +4765,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: */
index 2d6e4952f8b56d72a11c8eab2929e19b4c161cc2..ee91fe9f4f0ab7b9f784f68ab7cea29c5d3edb4e 100644 (file)
@@ -3291,7 +3291,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) );