/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// only for internal management struct ImplBaseLinkData
{ struct tClientType
{ // applies for all links
SotClipboardFormatId nCntntType; // Update Format // Not Ole-Links bool bIntrnlLnk; // It is an internal link
SfxLinkUpdateMode nUpdateMode; // UpdateMode
};
// It is going to be an OLE-Link,
pImplData->ClientType.nUpdateMode = nUpdateMode;
pImplData->ClientType.nCntntType = nContentType;
pImplData->ClientType.bIntrnlLnk = false;
}
auto cfName = [&sTopic](const DdeTopic* p) { return p->GetName() == sTopic; }; auto it = std::find_if(rTopics.begin(), rTopics.end(), cfName); if (it == rTopics.end())
{ // Topic not found? // then we try once to create it if (elem->MakeTopic(sTopic))
it = std::find_if(rTopics.begin(), rTopics.end(), cfName);
} if (it != rTopics.end()) return *it; break;
}
} return nullptr;
}
if( !pObj )
{
DBG_ASSERT( pObj, "Where is my left-most object" ); return;
}
if( SvBaseLinkObjectType::DdeExternal == mnObjType )
{
sal_uInt16 nItemStt = 0;
DdeTopic* pTopic = FindTopic( aLinkName, &nItemStt ); if( pTopic )
{ // then we have it all together // MM_TODO how do I get the name
OUString aStr = aLinkName; // xLinkName->GetDisplayName();
aStr = aStr.copy( nItemStt );
pImplData->DDEType.pItem = new ImplDdeItem( *this, aStr );
pTopic->InsertItem( pImplData->DDEType.pItem );
// store the Advice
xObj = pObj;
}
} elseif( pObj->Connect( this ) )
xObj = pObj;
}
if( SvBaseLinkObjectType::ClientDde == mnObjType )
{
OUString sServer; if( sfx2::LinkManager::GetDisplayNames( this, &sServer ) &&
sServer == Application::GetAppName() ) // internal Link !!!
{ // so that the Internal link can be created!
mnObjType = SvBaseLinkObjectType::Internal;
xObj = sfx2::LinkManager::CreateObj( this );
pImplData->ClientType.bIntrnlLnk = true;
mnObjType = SvBaseLinkObjectType::ClientDde; // so we know what it once was!
} else
{
pImplData->ClientType.bIntrnlLnk = false;
xObj = sfx2::LinkManager::CreateObj( this );
}
} elseif( isClientType(mnObjType) )
xObj = sfx2::LinkManager::CreateObj( this );
ImplDdeItem::~ImplDdeItem()
{
bIsInDTOR = true; // So that no-one gets the idea to delete the pointer when Disconnecting!
tools::SvRef<SvBaseLink> aRef( pLink );
aRef->Disconnect();
}
DdeData* ImplDdeItem::Get( SotClipboardFormatId nFormat )
{ if( pLink->GetObj() )
{ // is it still valid? if( bIsValidData && nFormat == aData.GetFormat() ) return &aData;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.