diff options
Diffstat (limited to 'sc/source/ui/drawfunc/fuins1.cxx')
-rw-r--r-- | sc/source/ui/drawfunc/fuins1.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 72886789b448..9b51a62c5b2a 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -22,6 +22,7 @@ #include <officecfg/Office/Common.hxx> #include <editeng/sizeitem.hxx> #include <sal/log.hxx> +#include <sfx2/lokhelper.hxx> #include <sfx2/opengrf.hxx> #include <sfx2/viewfrm.hxx> #include <svx/svdograf.hxx> @@ -48,6 +49,9 @@ #include <globstr.hrc> #include <comphelper/lok.hxx> +#include <tools/hostfilter.hxx> +#include <tools/urlobj.hxx> + #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/media/XPlayer.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> @@ -279,6 +283,13 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell& rViewSh, if ( pReqArgs->GetItemState( FN_PARAM_1, true, &pItem ) == SfxItemState::SET ) bAsLink = static_cast<const SfxBoolItem*>(pItem)->GetValue(); + if (comphelper::LibreOfficeKit::isActive()) + { + INetURLObject aURL(aFileName); + if (INetProtocol::File != aURL.GetProtocol() && HostFilter::isForbidden(aURL.GetHost())) + SfxLokHelper::sendNetworkAccessError("insert"); + } + Graphic aGraphic; ErrCode nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, aGraphic, &GraphicFilter::GetGraphicFilter() ); if ( nError == ERRCODE_NONE ) |