/* -*- 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 .
*/
/** * Get special target. * @param targetIndex target index. * @param target Variant to get special target. * @return Result.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_target(long targetIndex, IUnknown** target)
{
SolarMutexGuard g;
try
{ if (target == nullptr) return E_FAIL;
Sequence<Reference<XAccessible>> xTargets = relation.TargetSet; int nCount = xTargets.getLength(); if (targetIndex >= nCount) return E_FAIL;
Reference<XAccessible> xTarget = xTargets[targetIndex]; if (!xTarget.is()) return E_FAIL;
IAccessible* pRet = CMAccessible::get_IAccessibleFromXAccessible(xTarget.get()); if (!pRet)
{
Reference<XAccessibleContext> xTargetContext = xTarget->getAccessibleContext(); if (!xTargetContext.is()) return E_FAIL;
Reference<XAccessible> xParent = xTargetContext->getAccessibleParent();
CMAccessible::g_pAccObjectManager->InsertAccObj(xTarget.get(), xParent.get());
pRet = CMAccessible::get_IAccessibleFromXAccessible(xTarget.get());
}
if (pRet)
{
*target = pRet;
pRet->AddRef(); return S_OK;
}
return E_FAIL;
} catch (...)
{ return E_FAIL;
}
}
/** * Get special targets. * @param maxTargets Special targets count. * @param target Variant to get special target. * @param nTargets Variant to accept actual target length. * @return Result.
*/
COM_DECLSPEC_NOTHROW STDMETHODIMP CAccRelation::get_targets(long, IUnknown** target, long* nTargets)
{
SolarMutexGuard g;
try
{ if (target == nullptr) return E_INVALIDARG; if (nTargets == nullptr) return E_INVALIDARG;
Sequence<Reference<XAccessible>> xTargets = relation.TargetSet; int nCount = xTargets.getLength();
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.