/* -*- 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 .
*/
void PopupMenuControllerBase::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{ // Reset our members and set disposed flag
m_xFrame.clear();
m_xDispatch.clear();
m_xPopupMenu.clear();
}
// Add/remove status listener to get a status update once if ( xDispatch.is() )
{
xDispatch->addStatusListener( xStatusListener, aTargetURL );
xDispatch->removeStatusListener( xStatusListener, aTargetURL );
}
}
// XDispatchProvider
Reference< XDispatch > SAL_CALL
PopupMenuControllerBase::queryDispatch( const URL& /*aURL*/, const OUString& /*sTarget*/,
sal_Int32 /*nFlags*/ )
{ // must be implemented by subclass
std::unique_lock aLock( m_aMutex );
throwIfDisposed(aLock);
return Reference< XDispatch >();
}
Sequence< Reference< XDispatch > > SAL_CALL PopupMenuControllerBase::queryDispatches( constSequence< DispatchDescriptor >& lDescriptor )
{ // Create return list - which must have same size then the given descriptor // It's not allowed to pack it!
{
std::unique_lock aLock(m_aMutex);
throwIfDisposed(aLock);
}
// Step over all descriptors and try to get any dispatcher for it.
std::transform(lDescriptor.begin(), lDescriptor.end(), lDispatcher.getArray(),
[this](const DispatchDescriptor& rDesc) -> uno::Reference< frame::XDispatch > { return queryDispatch(rDesc.FeatureURL, rDesc.FrameName, rDesc.SearchFlags); });
return lDispatcher;
}
// XDispatch void SAL_CALL
PopupMenuControllerBase::dispatch( const URL& /*aURL*/, const Sequence< PropertyValue >& /*seqProperties*/ )
{ // must be implemented by subclass
std::unique_lock aLock( m_aMutex );
throwIfDisposed(aLock);
}
OUString PopupMenuControllerBase::determineBaseURL( std::u16string_view aURL )
{ // Just use the main part of the URL for popup menu controllers
OUString aMainURL( u"vnd.sun.star.popup:"_ustr );
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.