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, 18 Mar 2025 17:53:50 +0000 (18:53 +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>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159881
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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 63827207508f20b8b64f2dc1a9ad6a9b4894a205..94d3c49292924f78058406cbb6ad3c878c126659 100644 (file)
@@ -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 ) );
index 57481604f6da5accab812e55fe9ddc7daccd6985..33fa5e9049b4edcf69b39ccc47b1c0a28e54b1ff 100644 (file)
@@ -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",
index 4a7411623dee96114b903193c981a08e38ceed89..947c653a52e2e052d118e1c7a94ee49763bd8014 100644 (file)
@@ -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: */
index 02fef6949c317985fadd719784ac902b02e13af7..41c93d58426ab302b299eae50578c8ae2e8e79ff 100644 (file)
@@ -3175,7 +3175,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) );