Files
libreoffice/toolkit/source/controls/stdtabcontroller.cxx

396 lines
14 KiB
C++
Raw Normal View History

/* -*- 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 .
*/
2000-09-18 16:07:07 +00:00
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XVclContainerPeer.hpp>
#include <toolkit/controls/stdtabcontroller.hxx>
#include <toolkit/controls/stdtabcontrollermodel.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/macros.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <rtl/uuid.h>
#include <tools/debug.hxx>
Missing solar mutex ...as witnessed by the triggered assert MSVCR90!wassert+0x641 vcllo!ImplDbgTestSolarMutex+0x72 [c:\lo\core\vcl\source\app\dbggui.cxx @ 1750] tllo!DbgFunc+0x47a [c:\lo\core\tools\source\debug\debug.cxx @ 1120] vcllo!DbgTestSolarMutex+0xd [c:\lo\core\solver\wntmsci12\inc\tools\debug.hxx @ 295] vcllo!OutputDevice::ImplInitClipRegion+0x2d [c:\lo\core\vcl\source\gdi\outdev.cxx @ 913] vcllo!Window::Invert+0xef [c:\lo\core\vcl\source\window\window2.cxx @ 411] vcllo!ImplCursorInvert+0x437 [c:\lo\core\vcl\source\window\cursor.cxx @ 120] vcllo!Cursor::ImplRestore+0x27 [c:\lo\core\vcl\source\window\cursor.cxx @ 159] vcllo!Cursor::ImplDoHide+0x40 [c:\lo\core\vcl\source\window\cursor.cxx @ 216] vcllo!Cursor::ImplHide+0x3c [c:\lo\core\vcl\source\window\cursor.cxx @ 234] vcllo!Window::ImplGrabFocus+0x4aa [c:\lo\core\vcl\source\window\window.cxx @ 4053] vcllo!Window::GrabFocus+0x52 [c:\lo\core\vcl\source\window\window.cxx @ 7544] tklo!StdTabController::ImplActivateControl+0x1fe [c:\lo\core\toolkit\source\controls\stdtabcontroller.cxx @ 152] tklo!StdTabController::activateFirst+0x45 [c:\lo\core\toolkit\source\controls\stdtabcontroller.cxx @ 354] msci_uno!`anonymous namespace'::callVirtualMethod+0x8a [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 76] msci_uno!`anonymous namespace'::cpp_call+0x4b3 [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 257] msci_uno!bridges::cpp_uno::shared::unoInterfaceProxyDispatch+0x321 [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 438] binaryurp_uno!binaryurp::IncomingRequest::execute_throw+0xaa8 [c:\lo\core\binaryurp\source\incomingrequest.cxx @ 245] binaryurp_uno!binaryurp::IncomingRequest::execute+0xe0 [c:\lo\core\binaryurp\source\incomingrequest.cxx @ 74] binaryurp_uno!request+0x6b [c:\lo\core\binaryurp\source\reader.cxx @ 85] cppu3!cppu_threadpool::JobQueue::enter+0x28d [c:\lo\core\cppu\source\threadpool\jobqueue.cxx @ 115] cppu3!cppu_threadpool::ORequestThread::run+0xc6 [c:\lo\core\cppu\source\threadpool\thread.cxx @ 175] cppu3!threadFunc+0x18 [c:\lo\core\solver\wntmsci12\inc\osl\thread.hxx @ 187] sal3!oslWorkerWrapperFunction+0x23 [c:\lo\core\sal\osl\w32\thread.c @ 60] during JunitTest_toolkit_unoapi on Windows (which does not use a headless mode for those tests). Whether locking the class instance's GetMutex() is really necessary here I do not know, but at least be careful to lock the global solar mutex first. Change-Id: Icbd7936f4bf8433ef6a36912566d43361e911429
2013-03-22 19:13:34 +01:00
#include <vcl/svapp.hxx>
2000-09-18 16:07:07 +00:00
#include <vcl/window.hxx>
2000-11-02 10:12:12 +00:00
#include <comphelper/sequence.hxx>
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
2000-09-18 16:07:07 +00:00
// ----------------------------------------------------
// class StdTabController
// ----------------------------------------------------
StdTabController::StdTabController()
{
}
StdTabController::~StdTabController()
{
}
bool StdTabController::ImplCreateComponentSequence(
Sequence< Reference< XControl > >& rControls,
const Sequence< Reference< XControlModel > >& rModels,
Sequence< Reference< XWindow > >& rComponents,
Sequence< Any>* pTabStops,
bool bPeerComponent ) const
2000-09-18 16:07:07 +00:00
{
bool bOK = true;
2000-09-18 16:07:07 +00:00
// Get only the requested controls
2001-01-24 14:00:58 +00:00
sal_Int32 nModels = rModels.getLength();
2000-09-18 16:07:07 +00:00
if (nModels != rControls.getLength())
{
Sequence< Reference< XControl > > aSeq( nModels );
const Reference< XControlModel >* pModels = rModels.getConstArray();
Reference< XControl > xCurrentControl;
2000-09-18 16:07:07 +00:00
2001-01-24 14:00:58 +00:00
sal_Int32 nRealControls = 0;
for (sal_Int32 n = 0; n < nModels; ++n, ++pModels)
2000-09-18 16:07:07 +00:00
{
xCurrentControl = FindControl(rControls, *pModels);
2000-09-18 16:07:07 +00:00
if (xCurrentControl.is())
aSeq.getArray()[nRealControls++] = xCurrentControl;
}
aSeq.realloc(nRealControls);
rControls = aSeq;
}
#ifdef DBG_UTIL
DBG_ASSERT( rControls.getLength() <= rModels.getLength(), "StdTabController:ImplCreateComponentSequence: inconsistence!" );
// there may be less controls than models, but never more controls than models
#endif
2000-09-18 16:07:07 +00:00
const Reference< XControl > * pControls = rControls.getConstArray();
2000-09-18 16:07:07 +00:00
sal_uInt32 nCtrls = rControls.getLength();
rComponents.realloc( nCtrls );
Reference< XWindow > * pComps = rComponents.getArray();
Any* pTabs = NULL;
2000-09-18 16:07:07 +00:00
if ( pTabStops )
{
*pTabStops = Sequence< Any>( nCtrls );
2000-09-18 16:07:07 +00:00
pTabs = pTabStops->getArray();
}
for ( sal_uInt32 n = 0; bOK && ( n < nCtrls ); n++ )
{
// Get the matching control for this model
Reference< XControl > xCtrl(pControls[n]);
2000-09-18 16:07:07 +00:00
if ( xCtrl.is() )
{
if (bPeerComponent)
pComps[n] = Reference< XWindow > (xCtrl->getPeer(), UNO_QUERY);
2000-09-18 16:07:07 +00:00
else
pComps[n] = Reference< XWindow > (xCtrl, UNO_QUERY);
2000-09-18 16:07:07 +00:00
// TabStop-Property
2000-09-18 16:07:07 +00:00
if ( pTabs )
{
// opt: Constant String for TabStop name
static const OUString aTabStopName( "Tabstop" );
2000-09-18 16:07:07 +00:00
Reference< XPropertySet > xPSet( xCtrl->getModel(), UNO_QUERY );
Reference< XPropertySetInfo > xInfo = xPSet->getPropertySetInfo();
2000-09-18 16:07:07 +00:00
if( xInfo->hasPropertyByName( aTabStopName ) )
*pTabs++ = xPSet->getPropertyValue( aTabStopName );
else
++pTabs;
2000-09-18 16:07:07 +00:00
}
}
else
{
2011-03-08 13:47:42 +01:00
OSL_TRACE( "ImplCreateComponentSequence: Control not found" );
bOK = false;
2000-09-18 16:07:07 +00:00
}
}
return bOK;
}
void StdTabController::ImplActivateControl( bool bFirst ) const
2000-09-18 16:07:07 +00:00
{
// HACK due to bug #53688#, map controls onto an interface if remote controls may occur
Reference< XTabController > xTabController(const_cast< ::cppu::OWeakObject* >(static_cast< const ::cppu::OWeakObject* >(this)), UNO_QUERY);
Sequence< Reference< XControl > > aCtrls = xTabController->getControls();
const Reference< XControl > * pControls = aCtrls.getConstArray();
2000-09-18 16:07:07 +00:00
sal_uInt32 nCount = aCtrls.getLength();
for ( sal_uInt32 n = bFirst ? 0 : nCount; bFirst ? n < nCount : n != 0; )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nCtrl = bFirst ? n++ : --n;
DBG_ASSERT( pControls[nCtrl].is(), "Control nicht im Container!" );
2000-09-18 16:07:07 +00:00
if ( pControls[nCtrl].is() )
{
Reference< XWindowPeer > xCP = pControls[nCtrl]->getPeer();
2000-09-18 16:07:07 +00:00
if ( xCP.is() )
{
VCLXWindow* pC = VCLXWindow::GetImplementation( xCP );
if ( pC && pC->GetWindow() && ( pC->GetWindow()->GetStyle() & WB_TABSTOP ) )
{
pC->GetWindow()->GrabFocus();
break;
}
}
}
}
}
// XInterface
Any StdTabController::queryAggregation( const Type & rType ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
Any aRet = ::cppu::queryInterface( rType,
(static_cast< XTabController* >(this)),
(static_cast< XServiceInfo* >(this)),
(static_cast< XTypeProvider* >(this)) );
2000-09-18 16:07:07 +00:00
return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType ));
}
// XTypeProvider
2000-09-18 16:07:07 +00:00
IMPL_XTYPEPROVIDER_START( StdTabController )
getCppuType( ( Reference< XTabController>* ) NULL ),
getCppuType( ( Reference< XServiceInfo>* ) NULL )
2000-09-18 16:07:07 +00:00
IMPL_XTYPEPROVIDER_END
void StdTabController::setModel( const Reference< XTabControllerModel >& Model ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
mxModel = Model;
}
Reference< XTabControllerModel > StdTabController::getModel( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
return mxModel;
}
void StdTabController::setContainer( const Reference< XControlContainer >& Container ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
mxControlContainer = Container;
}
Reference< XControlContainer > StdTabController::getContainer( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
return mxControlContainer;
}
Sequence< Reference< XControl > > StdTabController::getControls( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
Sequence< Reference< XControl > > aSeq;
2000-09-18 16:07:07 +00:00
if ( mxControlContainer.is() )
{
Sequence< Reference< XControlModel > > aModels = mxModel->getControlModels();
const Reference< XControlModel > * pModels = aModels.getConstArray();
2000-09-18 16:07:07 +00:00
Sequence< Reference< XControl > > xCtrls = mxControlContainer->getControls();
2000-09-18 16:07:07 +00:00
sal_uInt32 nCtrls = aModels.getLength();
aSeq = Sequence< Reference< XControl > >( nCtrls );
2000-09-18 16:07:07 +00:00
for ( sal_uInt32 n = 0; n < nCtrls; n++ )
{
Reference< XControlModel > xCtrlModel = pModels[n];
// Search matching Control for this Model
Reference< XControl > xCtrl = FindControl( xCtrls, xCtrlModel );
2000-09-18 16:07:07 +00:00
aSeq.getArray()[n] = xCtrl;
}
}
return aSeq;
}
void StdTabController::autoTabOrder( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
DBG_ASSERT( mxControlContainer.is(), "autoTabOrder: No ControlContainer!" );
if ( !mxControlContainer.is() )
return;
Sequence< Reference< XControlModel > > aSeq = mxModel->getControlModels();
Sequence< Reference< XWindow > > aCompSeq;
2000-09-18 16:07:07 +00:00
// This may return a TabController, which returns desired list of controls faster
Reference< XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), UNO_QUERY);
Sequence< Reference< XControl > > aControls = xTabController->getControls();
2000-09-18 16:07:07 +00:00
// #58317# Some Models may be missing from the Container. Plus there is a
// autoTabOrder call later on.
if( !ImplCreateComponentSequence( aControls, aSeq, aCompSeq, NULL, false ) )
2000-09-18 16:07:07 +00:00
return;
sal_uInt32 nCtrls = aCompSeq.getLength();
Reference< XWindow > * pComponents = aCompSeq.getArray();
2000-09-18 16:07:07 +00:00
// insert sort algorithm
2000-09-18 16:07:07 +00:00
ComponentEntryList aCtrls;
size_t n;
2000-09-18 16:07:07 +00:00
for ( n = 0; n < nCtrls; n++ )
{
XWindow* pC = (XWindow*)pComponents[n].get();
2000-09-18 16:07:07 +00:00
ComponentEntry* pE = new ComponentEntry;
pE->pComponent = pC;
awt::Rectangle aPosSize = pC->getPosSize();
2000-09-18 16:07:07 +00:00
pE->aPos.X() = aPosSize.X;
pE->aPos.Y() = aPosSize.Y;
sal_uInt16 nPos;
for ( nPos = 0; nPos < aCtrls.size(); nPos++ )
2000-09-18 16:07:07 +00:00
{
ComponentEntry* pEntry = aCtrls[ nPos ];
if ( ( pEntry->aPos.Y() > pE->aPos.Y() ) ||
( ( pEntry->aPos.Y() == pE->aPos.Y() ) && ( pEntry->aPos.X() > pE->aPos.X() ) ) )
break;
2000-09-18 16:07:07 +00:00
}
if ( nPos < aCtrls.size() ) {
ComponentEntryList::iterator it = aCtrls.begin();
::std::advance( it, nPos );
aCtrls.insert( it, pE );
} else {
aCtrls.push_back( pE );
}
2000-09-18 16:07:07 +00:00
}
Sequence< Reference< XControlModel > > aNewSeq( nCtrls );
2000-09-18 16:07:07 +00:00
for ( n = 0; n < nCtrls; n++ )
{
ComponentEntry* pE = aCtrls[ n ];
Reference< XControl > xUC( pE->pComponent, UNO_QUERY );
2000-09-18 16:07:07 +00:00
aNewSeq.getArray()[n] = xUC->getModel();
delete pE;
}
aCtrls.clear();
2000-09-18 16:07:07 +00:00
mxModel->setControlModels( aNewSeq );
}
void StdTabController::activateTabOrder( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
// Activate tab order for the control container
2000-09-18 16:07:07 +00:00
Reference< XControl > xC( mxControlContainer, UNO_QUERY );
Reference< XVclContainerPeer > xVclContainerPeer;
if ( xC.is() )
xVclContainerPeer = xVclContainerPeer.query( xC->getPeer() );
if ( !xC.is() || !xVclContainerPeer.is() )
2000-09-18 16:07:07 +00:00
return;
// This may return a TabController, which returns desired list of controls faster
Reference< XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), UNO_QUERY);
2000-09-18 16:07:07 +00:00
// Get a flattened list of controls sequences
Sequence< Reference< XControlModel > > aModels = mxModel->getControlModels();
Sequence< Reference< XWindow > > aCompSeq;
Sequence< Any> aTabSeq;
2000-09-18 16:07:07 +00:00
// DG: For the sake of optimization, retrieve Controls from getControls(),
// this may sound counterproductive, but leads to performance improvements
// in practical scenarios (Forms)
Sequence< Reference< XControl > > aControls = xTabController->getControls();
2000-09-18 16:07:07 +00:00
// #58317# Some Models may be missing from the Container. Plus there is a
// autoTabOrder call later on.
if( !ImplCreateComponentSequence( aControls, aModels, aCompSeq, &aTabSeq, true ) )
2000-09-18 16:07:07 +00:00
return;
xVclContainerPeer->setTabOrder( aCompSeq, aTabSeq, mxModel->getGroupControl() );
OUString aName;
Sequence< Reference< XControlModel > > aThisGroupModels;
Sequence< Reference< XWindow > > aControlComponents;
2000-09-18 16:07:07 +00:00
sal_uInt32 nGroups = mxModel->getGroupCount();
for ( sal_uInt32 nG = 0; nG < nGroups; nG++ )
{
mxModel->getGroup( nG, aThisGroupModels, aName );
aControls = xTabController->getControls();
// ImplCreateComponentSequence has a really strange semantics regarding it's first parameter:
// upon method entry, it expects a super set of the controls which it returns
// this means we need to completely fill this sequence with all available controls before
// calling into ImplCreateComponentSequence
aControlComponents.realloc( 0 );
ImplCreateComponentSequence( aControls, aThisGroupModels, aControlComponents, NULL, true );
xVclContainerPeer->setGroup( aControlComponents );
2000-09-18 16:07:07 +00:00
}
}
void StdTabController::activateFirst( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
Missing solar mutex ...as witnessed by the triggered assert MSVCR90!wassert+0x641 vcllo!ImplDbgTestSolarMutex+0x72 [c:\lo\core\vcl\source\app\dbggui.cxx @ 1750] tllo!DbgFunc+0x47a [c:\lo\core\tools\source\debug\debug.cxx @ 1120] vcllo!DbgTestSolarMutex+0xd [c:\lo\core\solver\wntmsci12\inc\tools\debug.hxx @ 295] vcllo!OutputDevice::ImplInitClipRegion+0x2d [c:\lo\core\vcl\source\gdi\outdev.cxx @ 913] vcllo!Window::Invert+0xef [c:\lo\core\vcl\source\window\window2.cxx @ 411] vcllo!ImplCursorInvert+0x437 [c:\lo\core\vcl\source\window\cursor.cxx @ 120] vcllo!Cursor::ImplRestore+0x27 [c:\lo\core\vcl\source\window\cursor.cxx @ 159] vcllo!Cursor::ImplDoHide+0x40 [c:\lo\core\vcl\source\window\cursor.cxx @ 216] vcllo!Cursor::ImplHide+0x3c [c:\lo\core\vcl\source\window\cursor.cxx @ 234] vcllo!Window::ImplGrabFocus+0x4aa [c:\lo\core\vcl\source\window\window.cxx @ 4053] vcllo!Window::GrabFocus+0x52 [c:\lo\core\vcl\source\window\window.cxx @ 7544] tklo!StdTabController::ImplActivateControl+0x1fe [c:\lo\core\toolkit\source\controls\stdtabcontroller.cxx @ 152] tklo!StdTabController::activateFirst+0x45 [c:\lo\core\toolkit\source\controls\stdtabcontroller.cxx @ 354] msci_uno!`anonymous namespace'::callVirtualMethod+0x8a [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 76] msci_uno!`anonymous namespace'::cpp_call+0x4b3 [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 257] msci_uno!bridges::cpp_uno::shared::unoInterfaceProxyDispatch+0x321 [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 438] binaryurp_uno!binaryurp::IncomingRequest::execute_throw+0xaa8 [c:\lo\core\binaryurp\source\incomingrequest.cxx @ 245] binaryurp_uno!binaryurp::IncomingRequest::execute+0xe0 [c:\lo\core\binaryurp\source\incomingrequest.cxx @ 74] binaryurp_uno!request+0x6b [c:\lo\core\binaryurp\source\reader.cxx @ 85] cppu3!cppu_threadpool::JobQueue::enter+0x28d [c:\lo\core\cppu\source\threadpool\jobqueue.cxx @ 115] cppu3!cppu_threadpool::ORequestThread::run+0xc6 [c:\lo\core\cppu\source\threadpool\thread.cxx @ 175] cppu3!threadFunc+0x18 [c:\lo\core\solver\wntmsci12\inc\osl\thread.hxx @ 187] sal3!oslWorkerWrapperFunction+0x23 [c:\lo\core\sal\osl\w32\thread.c @ 60] during JunitTest_toolkit_unoapi on Windows (which does not use a headless mode for those tests). Whether locking the class instance's GetMutex() is really necessary here I do not know, but at least be careful to lock the global solar mutex first. Change-Id: Icbd7936f4bf8433ef6a36912566d43361e911429
2013-03-22 19:13:34 +01:00
SolarMutexGuard aSolarGuard;
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); //TODO: necessary?
2000-09-18 16:07:07 +00:00
ImplActivateControl( true );
2000-09-18 16:07:07 +00:00
}
void StdTabController::activateLast( ) throw(RuntimeException)
2000-09-18 16:07:07 +00:00
{
Missing solar mutex ...as witnessed by the triggered assert MSVCR90!wassert+0x641 vcllo!ImplDbgTestSolarMutex+0x72 [c:\lo\core\vcl\source\app\dbggui.cxx @ 1750] tllo!DbgFunc+0x47a [c:\lo\core\tools\source\debug\debug.cxx @ 1120] vcllo!DbgTestSolarMutex+0xd [c:\lo\core\solver\wntmsci12\inc\tools\debug.hxx @ 295] vcllo!OutputDevice::ImplInitClipRegion+0x2d [c:\lo\core\vcl\source\gdi\outdev.cxx @ 913] vcllo!Window::Invert+0xef [c:\lo\core\vcl\source\window\window2.cxx @ 411] vcllo!ImplCursorInvert+0x437 [c:\lo\core\vcl\source\window\cursor.cxx @ 120] vcllo!Cursor::ImplRestore+0x27 [c:\lo\core\vcl\source\window\cursor.cxx @ 159] vcllo!Cursor::ImplDoHide+0x40 [c:\lo\core\vcl\source\window\cursor.cxx @ 216] vcllo!Cursor::ImplHide+0x3c [c:\lo\core\vcl\source\window\cursor.cxx @ 234] vcllo!Window::ImplGrabFocus+0x4aa [c:\lo\core\vcl\source\window\window.cxx @ 4053] vcllo!Window::GrabFocus+0x52 [c:\lo\core\vcl\source\window\window.cxx @ 7544] tklo!StdTabController::ImplActivateControl+0x1fe [c:\lo\core\toolkit\source\controls\stdtabcontroller.cxx @ 152] tklo!StdTabController::activateFirst+0x45 [c:\lo\core\toolkit\source\controls\stdtabcontroller.cxx @ 354] msci_uno!`anonymous namespace'::callVirtualMethod+0x8a [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 76] msci_uno!`anonymous namespace'::cpp_call+0x4b3 [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 257] msci_uno!bridges::cpp_uno::shared::unoInterfaceProxyDispatch+0x321 [c:\lo\core\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx @ 438] binaryurp_uno!binaryurp::IncomingRequest::execute_throw+0xaa8 [c:\lo\core\binaryurp\source\incomingrequest.cxx @ 245] binaryurp_uno!binaryurp::IncomingRequest::execute+0xe0 [c:\lo\core\binaryurp\source\incomingrequest.cxx @ 74] binaryurp_uno!request+0x6b [c:\lo\core\binaryurp\source\reader.cxx @ 85] cppu3!cppu_threadpool::JobQueue::enter+0x28d [c:\lo\core\cppu\source\threadpool\jobqueue.cxx @ 115] cppu3!cppu_threadpool::ORequestThread::run+0xc6 [c:\lo\core\cppu\source\threadpool\thread.cxx @ 175] cppu3!threadFunc+0x18 [c:\lo\core\solver\wntmsci12\inc\osl\thread.hxx @ 187] sal3!oslWorkerWrapperFunction+0x23 [c:\lo\core\sal\osl\w32\thread.c @ 60] during JunitTest_toolkit_unoapi on Windows (which does not use a headless mode for those tests). Whether locking the class instance's GetMutex() is really necessary here I do not know, but at least be careful to lock the global solar mutex first. Change-Id: Icbd7936f4bf8433ef6a36912566d43361e911429
2013-03-22 19:13:34 +01:00
SolarMutexGuard aSolarGuard;
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); //TODO: necessary?
2000-09-18 16:07:07 +00:00
ImplActivateControl( false );
2000-09-18 16:07:07 +00:00
}
Reference< XControl > StdTabController::FindControl( Sequence< Reference< XControl > >& rCtrls,
const Reference< XControlModel > & rxCtrlModel )
{
DBG_ASSERT( rxCtrlModel.is(), "ImplFindControl - welches ?!" );
const Reference< XControl > * pCtrls = rCtrls.getConstArray();
sal_Int32 nCtrls = rCtrls.getLength();
for ( sal_Int32 n = 0; n < nCtrls; n++ )
{
Reference< XControlModel > xModel(pCtrls[n].is() ? pCtrls[n]->getModel() : Reference< XControlModel > ());
if ( (XControlModel*)xModel.get() == (XControlModel*)rxCtrlModel.get() )
{
Reference< XControl > xCtrl( pCtrls[n] );
::comphelper::removeElementAt( rCtrls, n );
return xCtrl;
}
}
return Reference< XControl > ();
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
stardiv_Toolkit_StdTabController_get_implementation(
css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new StdTabController());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */