/* -*- 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 .
*/
bool SvLinkSource_EntryIter_Impl::IsValidCurrValue( SvLinkSource_Entry_Impl const * pEntry )
{ if ( nPos >= aArr.size() ) returnfalse; if (aArr[nPos] != pEntry) returnfalse; for (autoconst & i : rOrigArr.mvData) if (i.get() == pEntry) returntrue; returnfalse;
}
SvLinkSource_Entry_Impl* SvLinkSource_EntryIter_Impl::Next()
{
SvLinkSource_Entry_Impl* pRet = nullptr; if( nPos + 1 < static_cast<sal_uInt16>(aArr.size()) )
{
++nPos; if( rOrigArr.size() == aArr.size() &&
rOrigArr[ nPos ] == aArr[ nPos ] )
pRet = aArr[ nPos ]; else
{ // then we must search the current (or the next) in the orig do {
pRet = aArr[ nPos ]; for (autoconst & i : rOrigArr.mvData) if (i.get() == pRet) return pRet;
pRet = nullptr;
++nPos;
} while( nPos < aArr.size() );
// notify the sink, the mime type is not // a selection criterion void SvLinkSource::DataChanged( const OUString & rMimeType, const css::uno::Any & rVal )
{ if( pImpl->nTimeout && !rVal.hasValue() )
{ // only when no data was included // fire all data to the sink, independent of the requested format
pImpl->aDataMimeType = rMimeType;
StartTimer( pImpl->pTimer, this, pImpl->nTimeout ); // New timeout
} else
{
SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); for( SvLinkSource_Entry_Impl* p = aIter.Curr(); p; p = aIter.Next() )
{ if( p->bIsDataSink )
{
p->xSink->DataChanged( rMimeType, rVal );
// only one link is correct void SvLinkSource::AddConnectAdvise( SvBaseLink * pLink )
{
SvLinkSource_Entry_Impl* pNew = new SvLinkSource_Entry_Impl( pLink );
pImpl->aArr.push_back( pNew );
}
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.