This is an automated email from the ASF dual-hosted git repository. ardovm pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 3f92111ab5 Allow all links in online help documents 3f92111ab5 is described below commit 3f92111ab5ef2e1de0fe485b2d5a49cc683e1221 Author: Arrigo Marchiori <ard...@yahoo.it> AuthorDate: Sat Nov 11 22:31:43 2023 +0100 Allow all links in online help documents --- 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 f638aeeca8..21c6f09f2a 100644 --- a/main/sfx2/inc/sfx2/linkmgr.hxx +++ b/main/sfx2/inc/sfx2/linkmgr.hxx @@ -114,7 +114,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 b75b4ff6d6..e8aa0bc7a5 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) { } @@ -283,6 +283,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 9bd2d25971..7f0166534c 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