LibreOffice Module sfx2 (master) 1
linkmgr2.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <comphelper/string.hxx>
21#include <sfx2/linkmgr.hxx>
22#include <sfx2/sfxsids.hrc>
23#include <com/sun/star/document/UpdateDocMode.hpp>
24#include <osl/file.hxx>
25#include <sfx2/objsh.hxx>
26#include <svl/urihelper.hxx>
27#include <sot/formats.hxx>
28#include <tools/urlobj.hxx>
29#include <sot/exchange.hxx>
30#include <tools/debug.hxx>
32#include <vcl/svapp.hxx>
33#include <vcl/weld.hxx>
34#include <vcl/gdimtf.hxx>
35#include <sfx2/lnkbase.hxx>
36#include <sfx2/app.hxx>
37#include <vcl/graph.hxx>
38#include <svl/stritem.hxx>
39#include <svl/eitem.hxx>
40#include <svl/intitem.hxx>
42#include <vcl/dibtools.hxx>
45#include <vcl/GraphicLoader.hxx>
47
48#include "fileobj.hxx"
49#include "impldde.hxx"
50#include <sfx2/strings.hrc>
51#include <sfx2/sfxresid.hxx>
52
53#include <com/sun/star/lang/XComponent.hpp>
54#include <com/sun/star/util/XCloseable.hpp>
55
56using ::com::sun::star::uno::UNO_QUERY;
57using ::com::sun::star::uno::Reference;
58using ::com::sun::star::lang::XComponent;
59using ::com::sun::star::util::XCloseable;
60
61namespace sfx2
62{
63
64namespace {
65
66class SvxInternalLink : public sfx2::SvLinkSource
67{
68public:
69 SvxInternalLink() {}
70
71 virtual bool Connect( sfx2::SvBaseLink* ) override;
72};
73
74}
75
77 : pPersist( p )
78{
79}
80
82{
84 {
85 if( rTmp.is() )
86 {
87 rTmp->Disconnect();
88 rTmp->SetLinkManager( nullptr );
89 }
90 }
91}
92
93void LinkManager::InsertCachedComp(const Reference<XComponent>& xComp)
94{
95 maCachedComps.push_back(xComp);
96}
97
99{
100 for (const auto& rxCachedComp : maCachedComps)
101 {
102 Reference<XCloseable> xCloseable(rxCachedComp, UNO_QUERY);
103 if (!xCloseable.is())
104 continue;
105
106 xCloseable->close(true);
107 }
108 maCachedComps.clear();
109}
110
112{
113 // No duplicate links inserted
114 bool bFound = false;
115 for( size_t n = 0; n < aLinkTbl.size(); )
116 {
118 if( pLink == rTmp.get() )
119 {
120 rTmp->Disconnect();
121 rTmp->SetLinkManager( nullptr );
122 rTmp.clear();
123 bFound = true;
124 }
125
126 // Remove empty ones if they exist
127 if( !rTmp.is() )
128 {
129 aLinkTbl.erase( aLinkTbl.begin() + n );
130 if( bFound )
131 return ;
132 }
133 else
134 ++n;
135 }
136}
137
138void LinkManager::Remove( size_t nPos, size_t nCnt )
139{
140 if( !nCnt || nPos >= aLinkTbl.size() )
141 return;
142
143 if (sal::static_int_cast<size_t>(nPos + nCnt) > aLinkTbl.size())
144 nCnt = aLinkTbl.size() - nPos;
145
146 for( size_t n = nPos; n < nPos + nCnt; ++n)
147 {
149 if( rTmp.is() )
150 {
151 rTmp->Disconnect();
152 rTmp->SetLinkManager( nullptr );
153 }
154 }
155 aLinkTbl.erase( aLinkTbl.begin() + nPos, aLinkTbl.begin() + nPos + nCnt );
156}
157
159{
160 for( size_t n = 0; n < aLinkTbl.size(); ++n )
161 {
163 if( !rTmp.is() )
164 {
165 aLinkTbl.erase( aLinkTbl.begin() + n-- );
166 }
167 else if( pLink == rTmp.get() )
168 return false; // No duplicate links inserted
169 }
170
171 pLink->SetLinkManager( this );
172 aLinkTbl.emplace_back(pLink );
173 return true;
174}
175
177 SvBaseLinkObjectType nObjType,
178 SfxLinkUpdateMode nUpdateMode,
179 const OUString* pName )
180{
181 // This First
182 pLink->SetObjType( nObjType );
183 if( pName )
184 pLink->SetName( *pName );
185 pLink->SetUpdateMode( nUpdateMode );
186 return Insert( pLink );
187}
188
190 const OUString& rServer,
191 std::u16string_view rTopic,
192 std::u16string_view rItem )
193{
194 if( !isClientType( pLink->GetObjType() ) )
195 return;
196
197 OUString sCmd;
198 ::sfx2::MakeLnkName( sCmd, &rServer, rTopic, rItem );
199
201 pLink->SetName( sCmd );
202 Insert( pLink );
203}
204
206{
207 DBG_ASSERT( isClientType(pLink->GetObjType()), "no OBJECT_CLIENT_SO" );
208 if( !isClientType( pLink->GetObjType() ) )
209 return;
210
211 if( pLink->GetObjType() == SvBaseLinkObjectType::ClientSo )
213
214 Insert( pLink );
215}
216
217// Obtain the string for the dialog
219 OUString* pType,
220 OUString* pFile,
221 OUString* pLinkStr,
222 OUString* pFilter )
223{
224 bool bRet = false;
225 const OUString& sLNm( pLink->GetLinkSourceName() );
226 if( !sLNm.isEmpty() )
227 {
228 switch( pLink->GetObjType() )
229 {
233 {
234 sal_Int32 nPos = 0;
235 OUString sFile( sLNm.getToken( 0, ::sfx2::cTokenSeparator, nPos ) );
236 OUString sRange( sLNm.getToken( 0, ::sfx2::cTokenSeparator, nPos ) );
237
238 if( pFile )
239 *pFile = sFile;
240 if( pLinkStr )
241 *pLinkStr = sRange;
242 if( pFilter )
243 *pFilter = nPos == -1 ? OUString() : sLNm.copy(nPos);
244
245 if( pType )
246 {
247 SvBaseLinkObjectType nObjType = pLink->GetObjType();
248 *pType = SfxResId(
250 ? RID_SVXSTR_FILELINK
251 : RID_SVXSTR_GRAPHICLINK);
252 }
253 bRet = true;
254 }
255 break;
257 {
258 sal_Int32 nTmp = 0;
259 OUString sServer( sLNm.getToken( 0, cTokenSeparator, nTmp ) );
260 OUString sTopic( sLNm.getToken( 0, cTokenSeparator, nTmp ) );
261
262 if( pType )
263 *pType = sServer;
264 if( pFile )
265 *pFile = sTopic;
266 if( pLinkStr )
267 *pLinkStr = nTmp != -1 ? sLNm.copy(nTmp) : OUString();
268 bRet = true;
269 }
270 break;
271 default:
272 break;
273 }
274 }
275
276 return bRet;
277}
278
280 bool bAskUpdate,
281 bool bUpdateGrfLinks,
282 weld::Window* pParentWin )
283{
284 // First make a copy of the array in order to update links
285 // links in ... no contact between them!
286 std::vector<SvBaseLink*> aTmpArr;
287 for( size_t n = 0; n < aLinkTbl.size(); ++n )
288 {
290 if( !rLink.is() )
291 {
292 Remove( n-- );
293 continue;
294 }
295 aTmpArr.push_back( rLink.get() );
296 }
297
298 for(SvBaseLink* pLink : aTmpArr)
299 {
300 // search first in the array after the entry
301 bool bFound = false;
302 for(const tools::SvRef<SvBaseLink> & i : aLinkTbl)
303 if( pLink == i.get() )
304 {
305 bFound = true;
306 break;
307 }
308
309 if( !bFound )
310 continue; // was not available!
311
312 // Graphic-Links not to update yet
313 if( !pLink->IsVisible() ||
314 ( !bUpdateGrfLinks && SvBaseLinkObjectType::ClientGraphic == pLink->GetObjType() ))
315 continue;
316
317 if( bAskUpdate )
318 {
319 OUString aMsg = SfxResId(STR_QUERY_UPDATE_LINKS);
321 aMsg = aMsg.replaceFirst("%{filename}", aURL.GetLastName());
322
323 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParentWin,
324 VclMessageType::Question, VclButtonsType::YesNo, aMsg));
325 xQueryBox->set_default_response(RET_YES);
326
327 int nRet = xQueryBox->run();
328 if( RET_YES != nRet )
329 {
330 SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist();
331
332 if(pShell)
333 {
334 comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pShell->getEmbeddedObjectContainer();
335 rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
336 }
337
338 return ; // nothing should be updated
339 }
340 bAskUpdate = false; // once is enough
341 }
342
343 pLink->Update();
344 }
346}
347
349{
350 switch( pLink->GetObjType() )
351 {
355 return new SvFileObject;
357 return new SvxInternalLink;
359 return new SvDDEObject;
360 default:
361 return SvLinkSourceRef();
362 }
363}
364
366{
367 // no duplicate inserts
368 if( !pObj )
369 return false;
370
371 return aServerTbl.insert( pObj ).second;
372}
373
375{
376 aServerTbl.erase( pObj );
377}
378
379void MakeLnkName( OUString& rName, const OUString* pType, std::u16string_view rFile,
380 std::u16string_view rLink, const OUString* pFilter )
381{
382 if( pType )
383 {
384 rName = comphelper::string::strip(*pType, ' ')
385 + OUStringChar(cTokenSeparator);
386 }
387 else
388 rName.clear();
389
390 rName += rFile;
391
392 rName = comphelper::string::strip(rName, ' ')
393 + OUStringChar(cTokenSeparator);
394 rName = comphelper::string::strip(rName, ' ') + rLink;
395 if( pFilter )
396 {
397 rName += OUStringChar(cTokenSeparator) + *pFilter;
398 rName = comphelper::string::strip(rName, ' ');
399 }
400}
401
403{
404 SfxMedium* pMed = rServer.GetMedium();
405 if (!pMed)
406 return;
407
409 size_t n = rLinks.size();
410
411 for (size_t i = 0; i < n; ++i)
412 {
413 ::sfx2::SvBaseLink* p = rLinks[i].get();
414 OUString aType, aFile, aLink, aFilter;
415 if (!GetDisplayNames(p, &aType, &aFile, &aLink, &aFilter))
416 continue;
417
418 if (aType != "soffice")
419 // DDE connections between OOo apps are always named 'soffice'.
420 continue;
421
422 OUString aTmp;
423 OUString aURL = aFile;
424 if (osl::FileBase::getFileURLFromSystemPath(aFile, aTmp)
425 == osl::FileBase::E_None)
426 aURL = aTmp;
427
428 if (!aURL.equalsIgnoreAsciiCase(pMed->GetName()))
429 // This DDE link is not associated with this server shell... Skip it.
430 continue;
431
432 if (aLink.isEmpty())
433 continue;
434
435 LinkServerShell(aLink, rServer, *p);
436 }
437}
438
439void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink)
440{
441 ::sfx2::SvLinkSource* pSrvSrc = rServer.DdeCreateLinkSource(rPath);
442 if (pSrvSrc)
443 {
444 css::datatransfer::DataFlavor aFl;
446 rLink.SetObj(pSrvSrc);
447 pSrvSrc->AddDataAdvise(
448 &rLink, aFl.MimeType,
450 }
451}
452
454 sfx2::SvBaseLink& rLink, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm,
455 const OUString* pFilterNm, const OUString* pRange)
456{
457 if (!isClientType(rLink.GetObjType()))
458 return;
459
460 OUStringBuffer aBuf(64);
461 aBuf.append(rFileNm + OUStringChar(sfx2::cTokenSeparator));
462
463 if (pRange)
464 aBuf.append(*pRange);
465
466 if (pFilterNm)
467 {
468 aBuf.append(OUStringChar(sfx2::cTokenSeparator) + *pFilterNm);
469 }
470
471 OUString aCmd = aBuf.makeStringAndClear();
472 InsertLink(&rLink, nFileType, SfxLinkUpdateMode::ONCALL, &aCmd);
473}
474
475// A transfer is aborted, so cancel all download media
476// (for now this is only of interest for the file links!)
478{
479
480 const sfx2::SvBaseLinks& rLnks = GetLinks();
481 for( size_t n = rLnks.size(); n; )
482 {
483 const sfx2::SvBaseLink& rLnk = *rLnks[--n];
484 if (isClientFileType(rLnk.GetObjType()))
485 {
486 if (SvFileObject* pFileObj = static_cast<SvFileObject*>(rLnk.GetObj()))
487 pFileObj->CancelTransfers();
488 }
489 }
490}
491
492// For the purpose of sending Status information from the file object to
493// the base link, there exist a dedicated ClipBoardId. The SvData-object
494// gets the appropriate information as a string
495// For now this is required for file object in conjunction with JavaScript
496// - needs information about Load/Abort/Error
498{
499 static SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
500
501 if( nFormat == SotClipboardFormatId::NONE )
502 {
504 "StatusInfo from SvxInternalLink");
505 }
506 return nFormat;
507}
508
509bool LinkManager::GetGraphicFromAny(std::u16string_view rMimeType,
510 const css::uno::Any & rValue,
511 Graphic& rGraphic,
512 weld::Window* pParentWin)
513{
514 bool bRet = false;
515
516 if (!rValue.hasValue())
517 return bRet;
518
519 if (rValue.has<OUString>())
520 {
521 OUString sReferer;
523 if (sh && sh->HasName())
524 sReferer = sh->GetMedium()->GetName();
525
526 OUString sURL = rValue.get<OUString>();
528 rGraphic = vcl::graphic::loadFromURL(sURL, pParentWin);
529 if (rGraphic.IsNone())
530 rGraphic.SetDefaultType();
531 rGraphic.setOriginURL(sURL);
532 return true;
533 }
534 else if (rValue.has<css::uno::Sequence<sal_Int8>>())
535 {
536 auto aSeq = rValue.get<css::uno::Sequence<sal_Int8>>();
537
538 SvMemoryStream aMemStm( const_cast<sal_Int8 *>(aSeq.getConstArray()), aSeq.getLength(),
539 StreamMode::READ );
540 aMemStm.Seek( 0 );
541
542 switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) )
543 {
544 case SotClipboardFormatId::SVXB:
545 {
546 TypeSerializer aSerializer(aMemStm);
547 aSerializer.readGraphic(rGraphic);
548 bRet = true;
549 }
550 break;
551 case SotClipboardFormatId::GDIMETAFILE:
552 {
553 GDIMetaFile aMtf;
554 SvmReader aReader( aMemStm );
555 aReader.Read( aMtf );
556 rGraphic = aMtf;
557 bRet = true;
558 }
559 break;
560 case SotClipboardFormatId::BITMAP:
561 {
562 Bitmap aBmp;
563 ReadDIB(aBmp, aMemStm, true);
564 rGraphic = BitmapEx(aBmp);
565 bRet = true;
566 }
567 break;
568 default: break;
569 }
570 }
571 return bRet;
572}
573
574static OUString lcl_DDE_RelToAbs( const OUString& rTopic, std::u16string_view rBaseURL )
575{
576 OUString sRet;
577 INetURLObject aURL( rTopic );
578 if( INetProtocol::NotValid == aURL.GetProtocol() )
579 osl::FileBase::getFileURLFromSystemPath(rTopic, sRet);
580 if( sRet.isEmpty() )
582 return sRet;
583}
584
585bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
586{
587 SfxObjectShell* pFndShell = nullptr;
588 sal_uInt16 nUpdateMode = css::document::UpdateDocMode::NO_UPDATE;
589 OUString sTopic, sItem, sReferer;
590 LinkManager* pLinkMgr = pLink->GetLinkManager();
591 if (pLinkMgr && sfx2::LinkManager::GetDisplayNames(pLink, nullptr, &sTopic, &sItem) && !sTopic.isEmpty())
592 {
593 // first only loop over the DocumentShells the shells and find those
594 // with the name:
595 CharClass aCC( LanguageTag( LANGUAGE_SYSTEM) );
596
597 bool bFirst = true;
598 SfxObjectShell* pShell = pLinkMgr->GetPersist();
599 if( pShell && pShell->GetMedium() )
600 {
601 sReferer = pShell->GetMedium()->GetBaseURL();
602 const SfxUInt16Item* pItem = pShell->GetMedium()->GetItemSet().GetItem(SID_UPDATEDOCMODE, false);
603 if ( pItem )
604 nUpdateMode = pItem->GetValue();
605 }
606
607 OUString sNmURL(aCC.lowercase(lcl_DDE_RelToAbs(sTopic, sReferer)));
608
609 if ( !pShell )
610 {
611 bFirst = false;
612 pShell = SfxObjectShell::GetFirst( nullptr, false );
613 }
614
615 OUString sTmp;
616 while( pShell )
617 {
618 if( sTmp.isEmpty() )
619 {
620 sTmp = pShell->GetTitle( SFX_TITLE_FULLNAME );
621 sTmp = lcl_DDE_RelToAbs(sTmp, sReferer );
622 }
623
624
625 sTmp = aCC.lowercase( sTmp );
626 if( sTmp == sNmURL ) // we want these
627 {
628 pFndShell = pShell;
629 break;
630 }
631
632 if( bFirst )
633 {
634 bFirst = false;
635 pShell = SfxObjectShell::GetFirst( nullptr, false );
636 }
637 else
638 pShell = SfxObjectShell::GetNext( *pShell, nullptr, false );
639
640 sTmp.clear();
641 }
642 }
643
644 // empty topics are not allowed - which document is it
645 if( sTopic.isEmpty() )
646 return false;
647
648 if (pFndShell)
649 {
650 sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem );
651 if( pNewSrc )
652 {
653 css::datatransfer::DataFlavor aFl;
655
656 pLink->SetObj( pNewSrc );
657 pNewSrc->AddDataAdvise( pLink, aFl.MimeType,
660 : 0 );
661 return true;
662 }
663 }
664 else
665 {
666 // then try to download the file:
667 INetURLObject aURL( sTopic );
668 INetProtocol eOld = aURL.GetProtocol();
669 sTopic = lcl_DDE_RelToAbs( sTopic, sReferer );
670 aURL.SetURL( sTopic );
671 if( INetProtocol::NotValid != eOld ||
672 INetProtocol::Http != aURL.GetProtocol() )
673 {
674 SfxStringItem aName( SID_FILE_NAME, sTopic );
675 SfxBoolItem aMinimized(SID_MINIMIZED, true);
676 SfxBoolItem aHidden(SID_HIDDEN, true);
677 SfxStringItem aTarget( SID_TARGETNAME, "_blank" );
678 SfxStringItem aReferer( SID_REFERER, sReferer );
679 SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode );
680 SfxBoolItem aReadOnly(SID_DOC_READONLY, false);
681
682 // Disable automatic re-connection to avoid this link instance
683 // being destroyed at re-connection.
684 SfxBoolItem aDdeConnect(SID_DDE_RECONNECT_ONLOAD, false);
685
686 // #i14200# (DDE-link crashes wordprocessor)
687 SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
688 aArgs.Put(aReferer);
689 aArgs.Put(aTarget);
690 aArgs.Put(aHidden);
691 aArgs.Put(aMinimized);
692 aArgs.Put(aName);
693 aArgs.Put(aUpdate);
694 aArgs.Put(aReadOnly);
695 aArgs.Put(aDdeConnect);
696 Reference<XComponent> xComp = SfxObjectShell::CreateAndLoadComponent(aArgs);
697 pFndShell = SfxObjectShell::GetShellFromComponent(xComp);
698 if (xComp.is() && pFndShell && pLinkMgr)
699 {
700 pLinkMgr->InsertCachedComp(xComp);
701 sfx2::LinkManager::LinkServerShell(sItem, *pFndShell, *pLink);
702 return true;
703 }
704 }
705 }
706
707 return false;
708}
709
710}
711
712/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * pName
SfxApplication * SfxGetpApp()
Definition: app.hxx:231
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_uInt16 GetValue() const
bool IsNone() const
void SetDefaultType()
void setOriginURL(OUString const &rOriginURL)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
OUString GetBaseURL(bool bForSaving=false)
Definition: docfile.cxx:634
SfxItemSet & GetItemSet() const
Definition: docfile.cxx:3647
const OUString & GetName() const
Definition: docfile.cxx:3592
virtual ::sfx2::SvLinkSource * DdeCreateLinkSource(const OUString &rItem)
Definition: appdde.cxx:385
static css::uno::Reference< css::lang::XComponent > CreateAndLoadComponent(const SfxItemSet &rSet)
Definition: objxtor.cxx:1011
bool HasName() const
Definition: objsh.hxx:266
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
Definition: objxtor.cxx:1039
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
Definition: objxtor.cxx:452
SfxMedium * GetMedium() const
Definition: objsh.hxx:261
OUString GetTitle(sal_uInt16 nMaxLen=0) const
Definition: objmisc.cxx:710
virtual OUString getDocumentBaseURL() const override
Definition: objstor.cxx:3853
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
Definition: objxtor.cxx:427
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
Definition: objsh.hxx:635
static bool GetFormatDataFlavor(SotClipboardFormatId nFormat, css::datatransfer::DataFlavor &rFlavor)
static SotClipboardFormatId GetFormatIdFromMimeType(std::u16string_view rMimeType)
static SotClipboardFormatId RegisterFormatName(const OUString &rName)
SvStream & Read(GDIMetaFile &rMetaFile, ImplMetaReadData *pData=nullptr)
void readGraphic(Graphic &rGraphic)
size_type erase(const Value &x)
std::pair< const_iterator, bool > insert(Value &&x)
SfxObjectShell * GetPersist() const
Definition: linkmgr.hxx:89
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
Definition: linkmgr2.cxx:453
void CancelTransfers()
Definition: linkmgr2.cxx:477
bool InsertLink(SvBaseLink *pLink, SvBaseLinkObjectType nObjType, SfxLinkUpdateMode nUpdateType, const OUString *pName)
Definition: linkmgr2.cxx:176
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
Definition: linkmgr2.cxx:218
bool InsertServer(SvLinkSource *rObj)
Definition: linkmgr2.cxx:365
static SvLinkSourceRef CreateObj(SvBaseLink const *)
Definition: linkmgr2.cxx:348
void InsertDDELink(SvBaseLink *, const OUString &rServer, std::u16string_view rTopic, std::u16string_view rItem)
Definition: linkmgr2.cxx:189
SfxObjectShell * pPersist
Definition: linkmgr.hxx:63
static void LinkServerShell(const OUString &rPath, SfxObjectShell &rServer, ::sfx2::SvBaseLink &rLink)
Reconnect the server document shell to a DDE link object.
Definition: linkmgr2.cxx:439
void InsertCachedComp(const css::uno::Reference< css::lang::XComponent > &xComp)
Insert a component loaded during link update, which needs to be closed when the update is complete.
Definition: linkmgr2.cxx:93
bool Insert(SvBaseLink *pLink)
Definition: linkmgr2.cxx:158
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
Definition: linkmgr2.cxx:279
SvBaseLinks aLinkTbl
Definition: linkmgr.hxx:60
void RemoveServer(SvLinkSource *rObj)
Definition: linkmgr2.cxx:374
static SotClipboardFormatId RegisterStatusInfoId()
Definition: linkmgr2.cxx:497
void ReconnectDdeLink(SfxObjectShell &rServer)
Definition: linkmgr2.cxx:402
LinkManager(SfxObjectShell *pCacheCont)
Definition: linkmgr2.cxx:76
void CloseCachedComps()
Definition: linkmgr2.cxx:98
CompVector maCachedComps
Definition: linkmgr.hxx:58
bool GetGraphicFromAny(std::u16string_view rMimeType, const css::uno::Any &rValue, Graphic &rGrf, weld::Window *pParentWin)
Definition: linkmgr2.cxx:509
void Remove(SvBaseLink const *pLink)
Definition: linkmgr2.cxx:111
const SvBaseLinks & GetLinks() const
Definition: linkmgr.hxx:137
SvLinkSources aServerTbl
Definition: linkmgr.hxx:61
void AddDataAdvise(SvBaseLink *, const OUString &rMimeType, sal_uInt16 nAdviceMode)
Definition: linksrc.cxx:342
T * get() const
bool is() const
#define DBG_ASSERT(sCon, aError)
bool VCL_DLLPUBLIC ReadDIB(Bitmap &rTarget, SvStream &rIStm, bool bFileHeader, bool bMSOFormat=false)
URL aURL
SotClipboardFormatId
OUString aName
void * p
sal_Int64 n
sal_uInt16 nPos
Definition: linksrc.cxx:118
#define ADVISEMODE_ONLYONCE
Definition: linksrc.hxx:43
SvBaseLink * pLink
Definition: lnkbase2.cxx:81
Sequence< sal_Int8 > aSeq
Definition: lnkbase2.cxx:83
SfxLinkUpdateMode
Definition: lnkbase.hxx:38
aBuf
Definition: mgetempl.cxx:389
bool isUntrustedReferer(OUString const &referer)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
OString strip(const OString &rIn, char c)
int i
const sal_Unicode cTokenSeparator
Definition: linkmgr.hxx:172
SvBaseLinkObjectType
Definition: lnkbase.hxx:52
constexpr bool isClientFileType(SvBaseLinkObjectType t)
Definition: lnkbase.hxx:66
tools::SvRef< SvLinkSource > SvLinkSourceRef
Definition: linksrc.hxx:114
std::vector< tools::SvRef< SvBaseLink > > SvBaseLinks
Definition: linkmgr.hxx:50
void MakeLnkName(OUString &rName, const OUString *pType, std::u16string_view rFile, std::u16string_view rLink, const OUString *pFilter)
Definition: linkmgr2.cxx:379
constexpr bool isClientType(SvBaseLinkObjectType t)
Definition: lnkbase.hxx:62
static OUString lcl_DDE_RelToAbs(const OUString &rTopic, std::u16string_view rBaseURL)
Definition: linkmgr2.cxx:574
Graphic loadFromURL(OUString const &rURL, weld::Window *pParentWin)
#define SFX_TITLE_FULLNAME
Definition: objsh.hxx:114
OUString SfxResId(TranslateId aId)
Definition: sfxresid.cxx:22
signed char sal_Int8
INetProtocol
RET_YES