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 8d6615f28d Allow all links in online help documents
8d6615f28d is described below
commit 8d6615f28d01df78e9f2f2960da8966119e07945
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Sat Nov 11 22:31:43 2023 +0100
Allow all links in online help documents
(cherry picked from commit 3f92111ab5ef2e1de0fe485b2d5a49cc683e1221)
---
main/sfx2/inc/sfx2/linkmgr.hxx | 3 +++
main/sfx2/source/appl/linkmgr2.cxx | 12 ++++++++++--
main/sw/source/ui/app/docsh.cxx | 6 ++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/main/sfx2/inc/sfx2/linkmgr.hxx b/main/sfx2/inc/sfx2/linkmgr.hxx
index bbfc311fbe..d70bf00656 100644
--- a/main/sfx2/inc/sfx2/linkmgr.hxx
+++ b/main/sfx2/inc/sfx2/linkmgr.hxx
@@ -115,7 +115,10 @@ public:
sal_Bool GetUserAllowsLinkUpdate(Window *pParent);
// Automatically ask user about update all links, on first insert
+ // If we already asked the user, we forget about it and will ask again.
void SetAutoAskUpdateAllLinks();
+ // Never ask the user: just update all links
+ void SetNeverAskUpdateAllLinks();
void UpdateAllLinks( sal_Bool bAskUpdate = sal_True,
sal_Bool
bCallErrHdl = sal_True,
diff --git a/main/sfx2/source/appl/linkmgr2.cxx
b/main/sfx2/source/appl/linkmgr2.cxx
index a9bba335e6..4c47a6178a 100644
--- a/main/sfx2/source/appl/linkmgr2.cxx
+++ b/main/sfx2/source/appl/linkmgr2.cxx
@@ -66,8 +66,8 @@ SV_IMPL_PTRARR( SvBaseLinks, SvBaseLinkRefPtr )
LinkManager::LinkManager(SfxObjectShell* p)
: pPersist(p),
- mUpdateAsked(sal_False),
- mAutoAskUpdateAllLinks(sal_False)
+ mAutoAskUpdateAllLinks(sal_False),
+ mUpdateAsked(sal_False)
{
}
@@ -282,6 +282,14 @@ sal_Bool LinkManager::GetDisplayNames( const SvBaseLink *
pLink,
void LinkManager::SetAutoAskUpdateAllLinks()
{
mAutoAskUpdateAllLinks = sal_True;
+ mUpdateAsked = sal_False;
+}
+
+void LinkManager::SetNeverAskUpdateAllLinks()
+{
+ mAutoAskUpdateAllLinks = sal_False;
+ mAllowUpdate = sal_True;
+ mUpdateAsked = sal_True;
}
sal_Bool LinkManager::GetUserAllowsLinkUpdate(Window *pParentWin)
diff --git a/main/sw/source/ui/app/docsh.cxx b/main/sw/source/ui/app/docsh.cxx
index 45ba5f9369..10904099fe 100644
--- a/main/sw/source/ui/app/docsh.cxx
+++ b/main/sw/source/ui/app/docsh.cxx
@@ -255,6 +255,12 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
// Restore the pool default if reading a saved document.
mpDoc->RemoveAllFmtLanguageDependencies();
+ // Trust links on help documents
+ String aFileName( rMedium.GetName() );
+ if (aFileName.SearchAscii("vnd.sun.star.help://") == 0) {
+ mpDoc->GetLinkManager().SetNeverAskUpdateAllLinks();
+ }
+
sal_uLong nErr = pRdr->Read( *pRead );
// Evtl. ein altes Doc weg