/* -*- 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 .
*/
constchar cURLFormLetter[] = ".uno:DataSourceBrowser/FormLetter"; constchar cURLInsertContent[] = ".uno:DataSourceBrowser/InsertContent";//data into fields constchar cURLInsertColumns[] = ".uno:DataSourceBrowser/InsertColumns";//data into text constchar cURLDocumentDataSource[] = ".uno:DataSourceBrowser/DocumentDataSource";//current data source of the document constchar cInternalDBChangeNotification[] = ".uno::Writer/DataSourceChanged";
SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) :
m_pView(&rVw)
{
uno::Reference< frame::XFrame> xUnoFrame = m_pView->GetViewFrame().GetFrame().GetFrameInterface();
m_xIntercepted.set(xUnoFrame, uno::UNO_QUERY); if(m_xIntercepted.is())
{
osl_atomic_increment(&m_refCount);
m_xIntercepted->registerDispatchProviderInterceptor(static_cast<frame::XDispatchProviderInterceptor*>(this)); // this should make us the top-level dispatch-provider for the component, via a call to our // setDispatchProvider we should have got a fallback for requests we (i.e. our master) cannot fulfill
uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY); if (xInterceptedComponent.is())
xInterceptedComponent->addEventListener(static_cast<lang::XEventListener*>(this));
osl_atomic_decrement(&m_refCount);
}
}
// one of the URLs requires a special state... if (aURL.Complete == cURLDocumentDataSource)
{ const SwDBData& rData = m_pView->GetWrtShell().GetDBData();
// calls to statusChanged may call addStatusListener or removeStatusListener // so copy m_aStatusListenerVector on stack auto copyStatusListenerVector = m_aStatusListenerVector; for (auto & status : copyStatusListenerVector)
{
aEvent.FeatureURL = status.aURL; if (status.aURL.Complete != cURLDocumentDataSource) // the document's data source does not depend on the selection, so it's state does not change here
status.xListener->statusChanged( aEvent );
}
}
lang::EventObject aObject;
aObject.Source = getXWeak(); // calls to statusChanged may call addStatusListener or removeStatusListener // so copy m_aStatusListenerVector on stack auto copyStatusListenerVector = m_aStatusListenerVector; for (auto & status : copyStatusListenerVector)
{
status.xListener->disposing(aObject);
}
m_pView = nullptr;
}
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.