svg export: check text hyperlink URLs the same way as shape ones
and have the slideshow open only http, https and mailto links same check as: commit34ec465717Date: Mon Mar 4 09:38:02 2019 +0100 Check svg URLs before exporting text hyperlinks exported since: commitb76628acb1Date: Sat Aug 11 22:23:22 2012 +0200 text export support for bullets and hyperlinks Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I826ffb43f0e809f91d1728a9a3b39ebec5b83d6e Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13498 Reviewed-by: Noel Grandin <noel.grandin@collabora.com> Tested-by: Jenkins CPCI <releng@collaboraoffice.com> (cherry picked from commit 5f9e522ae9b43a9f4777d86accd20cce02d8fad3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211595 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
committed by
Xisco Fauli
parent
f3f25e07f9
commit
5a201620b2
@@ -16217,7 +16217,17 @@ HyperlinkElement.prototype.handleClick = function( )
|
||||
var aWindowObject = document.defaultView;
|
||||
if( aWindowObject )
|
||||
{
|
||||
aWindowObject.open( this.sURL, this.sId );
|
||||
var sProtocol = '';
|
||||
try
|
||||
{
|
||||
sProtocol = new URL( this.sURL, document.baseURI ).protocol;
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
log( 'error: HyperlinkElement.handleClick: invalid url.' );
|
||||
}
|
||||
if( sProtocol === 'http:' || sProtocol === 'https:' || sProtocol === 'mailto:' )
|
||||
aWindowObject.open( this.sURL, this.sId );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <tools/fract.hxx>
|
||||
#include <tools/helpers.hxx>
|
||||
#include <tools/stream.hxx>
|
||||
#include <tools/urlobj.hxx>
|
||||
#include <xmloff/namespacemap.hxx>
|
||||
#include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
|
||||
#include <i18nlangtag/languagetag.hxx>
|
||||
@@ -1309,7 +1310,15 @@ bool SVGTextWriter::nextTextPortion()
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
sInfo += "url: " + mrExport.GetRelativeReference( sURL );
|
||||
#endif
|
||||
msUrl = mrExport.GetRelativeReference( sURL );
|
||||
// A link to a place in the presentation starts with '#'.
|
||||
INetURLObject aINetURLObject(sURL);
|
||||
if (sURL.startsWith("#")
|
||||
|| (!aINetURLObject.HasError()
|
||||
&& !aINetURLObject.IsExoticProtocol()
|
||||
&& aINetURLObject.GetProtocol() != INetProtocol::Javascript))
|
||||
msUrl = mrExport.GetRelativeReference( sURL );
|
||||
else
|
||||
msUrl.clear();
|
||||
if( !msUrl.isEmpty() )
|
||||
{
|
||||
implRegisterInterface( xPortionTextRange );
|
||||
|
||||
Reference in New Issue
Block a user