Skip to content

Commit

Permalink
Allow all links in online help documents
Browse files Browse the repository at this point in the history
  • Loading branch information
ardovm committed Nov 11, 2023
1 parent 259093b commit 3f92111
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions main/sfx2/inc/sfx2/linkmgr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 10 additions & 2 deletions main/sfx2/source/appl/linkmgr2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions main/sw/source/ui/app/docsh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f92111

Please sign in to comment.