/* -*- 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 .
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::SetHostNames( LPCOLESTR szContainerApp, LPCOLESTR szContainerObj )
{ // the code should be ignored for links if ( !m_aFileName.getLength() )
{
m_pDocHolder->setTitle(OUString(o3tl::toU(szContainerObj)));
m_pDocHolder->setContainerName(OUString(o3tl::toU(szContainerApp)));
}
/** * Well, this is a not so very inefficient way to deliver *
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::DoVerb( LONG iVerb,
LPMSG,
IOleClientSite *pActiveSite, LONG,
HWND,
LPCRECT )
{ // no locking is used since the OLE must use the same thread always if ( m_bIsInVerbHandling ) return OLEOBJ_S_CANNOT_DOVERB_NOW;
// an object can not handle any Verbs in Hands off mode if ( m_pMasterStorage == nullptr || m_pOwnStream == nullptr ) return OLE_E_CANT_BINDTOSOURCE;
BooleanGuard_Impl aGuard( m_bIsInVerbHandling );
if ( iVerb == OLEIVERB_PRIMARY )
{ if ( m_aFileName.getLength() )
{ // that should be a link
iVerb = OLEIVERB_OPEN;
} else
iVerb = OLEIVERB_SHOW;
}
try
{ switch(iVerb) { case OLEIVERB_DISCARDUNDOSTATE: // free any undostate? break; case OLEIVERB_INPLACEACTIVATE:
OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
return m_pDocHolder->InPlaceActivate(pActiveSite,FALSE); case OLEIVERB_UIACTIVATE:
OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
return m_pDocHolder->InPlaceActivate(pActiveSite,TRUE); case OLEIVERB_PRIMARY: case OLEIVERB_SHOW:
OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
if(m_pDocHolder->isActive()) return NOERROR; //Already active
[[fallthrough]]; case OLEIVERB_OPEN:
OSL_ENSURE(m_pDocHolder,"no document to open");
// the commented code could be useful in case // outer window would be resized depending from inner one // RECTL aEmbArea; // m_pDocHolder->GetVisArea( &aEmbArea ); // m_pDocHolder->show(); // m_pDocHolder->SetVisArea( &aEmbArea );
// in case of links the containers does not provide client site sometimes
hr = Save( static_cast<LPCOLESTR>(nullptr), FALSE ); // triggers saving to the link location
SaveCompleted(o3tl::toW(aPreservFileName.getStr()));
}
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 ist noch experimentell.