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

commit af36b5eda9c80def70d9603c4eac7c8ab03f1ffd
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Thu Apr 10 21:40:02 2025 +0200

    ScAreaLink::Refresh() asks the document's LinkManager for authorization
    
    (cherry picked from commit 1c61e590fbd8f549319bfe1cef4b58d693211c7e)
---
 main/sc/source/ui/docshell/arealink.cxx | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/main/sc/source/ui/docshell/arealink.cxx 
b/main/sc/source/ui/docshell/arealink.cxx
index e69ab4c850..052021dc4d 100644
--- a/main/sc/source/ui/docshell/arealink.cxx
+++ b/main/sc/source/ui/docshell/arealink.cxx
@@ -33,6 +33,7 @@
 #include <sfx2/fcontnr.hxx>
 #include <sfx2/sfxsids.hrc>
 #include <sfx2/linkmgr.hxx>
+#include <sfx2/viewfrm.hxx>
 #include <svl/stritem.hxx>
 #include <vcl/msgbox.hxx>
 
@@ -243,6 +244,20 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, 
const String& rNewFilter,
        if (!rNewFile.Len() || !rNewFilter.Len())
                return sal_False;
 
+       // Request for authorization
+       sfx2::LinkManager* pLinkMgr = 
pImpl->m_pDocSh->GetDocument()->GetLinkManager();
+       if ( pLinkMgr ) {
+               SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pImpl->m_pDocSh 
);
+               if ( pFrame ) {
+                       Window* pWindow = &pFrame->GetWindow();
+                       if ( pWindow ) {
+                               if ( !pLinkMgr->GetUserAllowsLinkUpdate( 
pWindow ) ) {
+                                       return sal_False;
+                               }
+                       }
+               }
+       }
+
     String aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
        sal_Bool bNewUrlName = (aNewUrl != aFileName);
 

Reply via email to