lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / accessibility / source / extended / accessiblebrowseboxcell.cxx
blob6240238379bf250ab0e9000233550487461dc7e9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/types.h>
21 #include <vcl/accessibletableprovider.hxx>
22 #include <extended/accessiblebrowseboxcell.hxx>
24 namespace accessibility
26 using namespace ::com::sun::star::uno;
27 using namespace ::com::sun::star::awt;
28 using namespace ::com::sun::star::accessibility;
29 using namespace ::svt;
31 // AccessibleBrowseBoxCell
32 AccessibleBrowseBoxCell::AccessibleBrowseBoxCell(
33 const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, ::vcl::IAccessibleTableProvider& _rBrowseBox,
34 const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
35 sal_Int32 _nRowPos, sal_uInt16 _nColPos, ::vcl::AccessibleBrowseBoxObjType _eType )
36 :AccessibleBrowseBoxBase( _rxParent, _rBrowseBox, _xFocusWindow, _eType )
37 ,m_nRowPos( _nRowPos )
38 ,m_nColPos( _nColPos )
40 // set accessible name here, because for that we need the position of the cell
41 // and so the base class isn't capable of doing this
42 sal_Int32 nPos = _nRowPos * _rBrowseBox.GetColumnCount() + _nColPos;
43 OUString aAccName = _rBrowseBox.GetAccessibleObjectName( vcl::BBTYPE_TABLECELL, nPos );
44 implSetName( aAccName );
47 AccessibleBrowseBoxCell::~AccessibleBrowseBoxCell()
51 void SAL_CALL AccessibleBrowseBoxCell::grabFocus()
53 SolarMethodGuard aGuard(getMutex());
54 ensureIsAlive();
56 mpBrowseBox->GoToCell( m_nRowPos, m_nColPos );
59 ::tools::Rectangle AccessibleBrowseBoxCell::implGetBoundingBox()
61 return mpBrowseBox->GetFieldRectPixelAbs( m_nRowPos, m_nColPos, false, false );
64 ::tools::Rectangle AccessibleBrowseBoxCell::implGetBoundingBoxOnScreen()
66 return mpBrowseBox->GetFieldRectPixelAbs( m_nRowPos, m_nColPos, false );
68 } // namespace accessibility
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */