You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2026/07/18 21:08:15 UTC

(openoffice) 01/02: Additional check

This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 790b7d8dbfa2f03410fde1f40a6e0410d47b42be
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Sat Jul 18 16:34:37 2026 +0200

    Additional check
    
    (cherry picked from commit 040baae65323da00a837571412055ec32f31a97c)
---
 main/sc/source/ui/docshell/dbdocimp.cxx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/main/sc/source/ui/docshell/dbdocimp.cxx b/main/sc/source/ui/docshell/dbdocimp.cxx
index d62fe28f6b..92c5d6240e 100644
--- a/main/sc/source/ui/docshell/dbdocimp.cxx
+++ b/main/sc/source/ui/docshell/dbdocimp.cxx
@@ -32,9 +32,11 @@
 #include <comphelper/types.hxx>
 #include <vcl/msgbox.hxx>
 #include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
 #include <svx/dataaccessdescriptor.hxx>
 #include <sfx2/viewfrm.hxx>
 
+#include <com/sun/star/document/XLinkAuthorizer.hpp>
 #include <com/sun/star/sdb/CommandType.hpp>
 #include <com/sun/star/sdb/XCompletedExecution.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
@@ -138,6 +140,14 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
 {
 	ScDocument* pDoc = rDocShell.GetDocument();
 
+	INetURLObject aURL( rParam.aDBName );
+	if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) {
+		::com::sun::star::uno::Reference< ::com::sun::star::document::XLinkAuthorizer > xLinkAuthorizer( pDoc->GetDocumentShell()->GetModel(), ::com::sun::star::uno::UNO_QUERY );
+		if ( xLinkAuthorizer.is() && ! xLinkAuthorizer->authorizeLinks( rParam.aDBName ) ) {
+			return sal_False;
+		}
+	}
+
 	if (bRecord && !pDoc->IsUndoEnabled())
 		bRecord = sal_False;