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

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


The following commit(s) were added to refs/heads/AOO41X by this push:
     new c699bed3f7 Additional check
c699bed3f7 is described below

commit c699bed3f75e79bd64ddec9dec49f9e210eed281
Author: Arrigo Marchiori <[email protected]>
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 c8c6aab7e8..2787aba20e 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;
 

Reply via email to