summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/Library_acc.mk1
-rw-r--r--accessibility/inc/extended/AccessibleBrowseBox.hxx2
-rw-r--r--accessibility/inc/extended/AccessibleBrowseBoxBase.hxx12
-rw-r--r--accessibility/inc/extended/AccessibleGridControl.hxx5
-rw-r--r--accessibility/inc/extended/AccessibleGridControlBase.hxx24
-rw-r--r--accessibility/inc/extended/AccessibleGridControlTable.hxx7
-rw-r--r--accessibility/inc/extended/AccessibleGridControlTableCell.hxx4
-rw-r--r--accessibility/inc/extended/AccessibleIconView.hxx30
-rw-r--r--accessibility/inc/extended/accessibleeditbrowseboxcell.hxx6
-rw-r--r--accessibility/inc/extended/accessiblelistbox.hxx9
-rw-r--r--accessibility/inc/extended/textwindowaccessibility.hxx2
-rw-r--r--accessibility/inc/standard/vclxaccessiblelistitem.hxx2
-rw-r--r--accessibility/source/extended/AccessibleBrowseBox.cxx5
-rw-r--r--accessibility/source/extended/AccessibleBrowseBoxBase.cxx25
-rw-r--r--accessibility/source/extended/AccessibleGridControl.cxx56
-rw-r--r--accessibility/source/extended/AccessibleGridControlBase.cxx11
-rw-r--r--accessibility/source/extended/AccessibleGridControlHeader.cxx12
-rw-r--r--accessibility/source/extended/AccessibleGridControlTable.cxx60
-rw-r--r--accessibility/source/extended/AccessibleGridControlTableCell.cxx34
-rw-r--r--accessibility/source/extended/AccessibleIconView.cxx53
-rw-r--r--accessibility/source/extended/accessibleeditbrowseboxcell.cxx11
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx35
-rw-r--r--accessibility/source/extended/accessibletabbar.cxx3
-rw-r--r--accessibility/source/extended/accessibletabbarpagelist.cxx13
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx11
-rw-r--r--accessibility/source/helper/acc_factory.cxx13
-rw-r--r--accessibility/source/standard/accessiblemenubasecomponent.cxx21
-rw-r--r--accessibility/source/standard/vclxaccessibleedit.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblelist.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblelistitem.cxx5
-rw-r--r--accessibility/source/standard/vclxaccessiblestatusbar.cxx15
-rw-r--r--accessibility/source/standard/vclxaccessibletabcontrol.cxx10
-rw-r--r--accessibility/source/standard/vclxaccessibletoolbox.cxx4
33 files changed, 291 insertions, 214 deletions
diff --git a/accessibility/Library_acc.mk b/accessibility/Library_acc.mk
index 0926fee97e5d..34c4dc7eb0c5 100644
--- a/accessibility/Library_acc.mk
+++ b/accessibility/Library_acc.mk
@@ -62,6 +62,7 @@ $(eval $(call gb_Library_add_exception_objects,acc,\
accessibility/source/extended/accessibleeditbrowseboxcell \
accessibility/source/extended/accessibleiconchoicectrl \
accessibility/source/extended/accessibleiconchoicectrlentry \
+ accessibility/source/extended/AccessibleIconView \
accessibility/source/extended/accessiblelistbox \
accessibility/source/extended/accessiblelistboxentry \
accessibility/source/extended/accessibletablistbox \
diff --git a/accessibility/inc/extended/AccessibleBrowseBox.hxx b/accessibility/inc/extended/AccessibleBrowseBox.hxx
index e2d5de3f2600..ba00e00d6c91 100644
--- a/accessibility/inc/extended/AccessibleBrowseBox.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBox.hxx
@@ -206,7 +206,7 @@ private:
public:
AccessibleBrowseBoxAccess(
- const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > _xParent,
::vcl::IAccessibleTableProvider& _rBrowseBox
);
diff --git a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx
index 71cde0280ad2..7e9ada30ab86 100644
--- a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx
@@ -80,9 +80,9 @@ public:
@param _xFocusWindow The window that gets all the focus events.
@param eObjType Object type */
AccessibleBrowseBoxBase(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > xParent,
::vcl::IAccessibleTableProvider& rBrowseBox,
- const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
+ css::uno::Reference< css::awt::XWindow > _xFocusWindow,
AccessibleBrowseBoxObjType eObjType );
/** Constructor sets specified name and description.
@@ -93,12 +93,12 @@ public:
@param rName The name of this object.
@param rDescription The description text of this object. */
AccessibleBrowseBoxBase(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > xParent,
::vcl::IAccessibleTableProvider& rBrowseBox,
- const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
+ css::uno::Reference< css::awt::XWindow > _xFocusWindow,
AccessibleBrowseBoxObjType eObjType,
- const OUString& rName,
- const OUString& rDescription );
+ OUString rName,
+ OUString rDescription );
protected:
virtual ~AccessibleBrowseBoxBase() override;
diff --git a/accessibility/inc/extended/AccessibleGridControl.hxx b/accessibility/inc/extended/AccessibleGridControl.hxx
index 6fa1a91b4919..302f240ee65f 100644
--- a/accessibility/inc/extended/AccessibleGridControl.hxx
+++ b/accessibility/inc/extended/AccessibleGridControl.hxx
@@ -149,9 +149,6 @@ private:
/** The header bar for columns (first row of the table). */
rtl::Reference<AccessibleGridControlHeader> m_xColumnHeaderBar;
- /** The table cell child. */
- rtl::Reference<AccessibleGridControlTableCell> m_xCell;
-
/** @return The count of visible children. */
inline sal_Int32 implGetAccessibleChildCount();
};
@@ -174,7 +171,7 @@ private:
public:
AccessibleGridControlAccess(
- const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > _xParent,
::vcl::table::IAccessibleTable& _rTable
);
diff --git a/accessibility/inc/extended/AccessibleGridControlBase.hxx b/accessibility/inc/extended/AccessibleGridControlBase.hxx
index 361c8d4d59f6..8523b78926d6 100644
--- a/accessibility/inc/extended/AccessibleGridControlBase.hxx
+++ b/accessibility/inc/extended/AccessibleGridControlBase.hxx
@@ -61,12 +61,12 @@ class AccessibleGridControlBase :
public AccessibleGridControlImplHelper
{
public:
- /** Constructor sets specified name and description.
+ /** Constructor.
@param rxParent XAccessible interface of the parent object.
@param rTable The Table control.
@param eObjType Type of accessible table control. */
AccessibleGridControlBase(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > xParent,
::vcl::table::IAccessibleTable& rTable,
::vcl::table::AccessibleTableControlObjType eObjType );
@@ -188,10 +188,8 @@ public:
inline ::vcl::table::AccessibleTableControlObjType getType() const;
/** Commits an event to all listeners. */
- void commitEvent(
- sal_Int16 nEventId,
- const css::uno::Any& rNewValue,
- const css::uno::Any& rOldValue );
+ virtual void commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue);
/** @return TRUE, if the object is not disposed or disposing. */
bool isAlive() const;
@@ -227,10 +225,6 @@ protected:
/** @throws <type>DisposedException</type> If the object is not alive. */
void ensureIsAlive() const;
- /** Changes the name of the object (flat assignment, no notify).
- @attention This method requires a locked mutex. */
- inline void implSetName( const OUString& rName );
-
/** Locks all mutex's and calculates the bounding box relative to the
parent window.
@return The bounding box (VCL rect.) relative to the parent object.
@@ -257,10 +251,6 @@ protected:
::vcl::table::AccessibleTableControlObjType m_eObjType;
private:
- /** Localized name. */
- OUString m_aName;
- /** Localized description text. */
- OUString m_aDescription;
::comphelper::AccessibleEventNotifier::TClientId m_aClientId;
};
@@ -315,12 +305,6 @@ inline ::vcl::table::AccessibleTableControlObjType AccessibleGridControlBase::ge
return m_eObjType;
}
-inline void AccessibleGridControlBase::implSetName(
- const OUString& rName )
-{
- m_aName = rName;
-}
-
} // namespace accessibility
diff --git a/accessibility/inc/extended/AccessibleGridControlTable.hxx b/accessibility/inc/extended/AccessibleGridControlTable.hxx
index 73c4f6a19050..69e3d9229694 100644
--- a/accessibility/inc/extended/AccessibleGridControlTable.hxx
+++ b/accessibility/inc/extended/AccessibleGridControlTable.hxx
@@ -139,8 +139,11 @@ public:
/** @return The name of this class. */
virtual OUString SAL_CALL getImplementationName() override;
- /**@return m_pCellVector*/
- std::vector< rtl::Reference<AccessibleGridControlTableCell> >& getCellVector() { return m_aCellVector;}
+ // XComponent
+ virtual void SAL_CALL dispose() override;
+
+ virtual void commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue) override;
private:
// internal virtual methods
diff --git a/accessibility/inc/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/extended/AccessibleGridControlTableCell.hxx
index 77077183b54b..6e3ee3367ae8 100644
--- a/accessibility/inc/extended/AccessibleGridControlTableCell.hxx
+++ b/accessibility/inc/extended/AccessibleGridControlTableCell.hxx
@@ -40,6 +40,10 @@ namespace accessibility
// XAccessibleComponent
virtual void SAL_CALL grabFocus() override;
+ public:
+ // XAccessibleContext
+ virtual OUString SAL_CALL getAccessibleName() override;
+
protected:
AccessibleGridControlCell(
const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
diff --git a/accessibility/inc/extended/AccessibleIconView.hxx b/accessibility/inc/extended/AccessibleIconView.hxx
new file mode 100644
index 000000000000..d5ab5eafb198
--- /dev/null
+++ b/accessibility/inc/extended/AccessibleIconView.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#include <sal/config.h>
+
+#include "accessiblelistbox.hxx"
+
+namespace accessibility
+{
+class AccessibleIconView final : public AccessibleListBox
+{
+public:
+ AccessibleIconView(SvTreeListBox const& _rListBox,
+ const css::uno::Reference<css::accessibility::XAccessible>& _xParent);
+
+protected:
+ // VCLXAccessibleComponent
+ virtual void ProcessWindowEvent(const VclWindowEvent& rVclWindowEvent) override;
+};
+} // namespace accessibility
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx b/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx
index ea42155fd0eb..093a3ade4587 100644
--- a/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx
+++ b/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx
@@ -105,9 +105,9 @@ namespace accessibility
public:
EditBrowseBoxTableCellAccess(
- const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
- const css::uno::Reference< css::accessibility::XAccessible >& _rxControlAccessible,
- const css::uno::Reference< css::awt::XWindow >& _rxFocusWindow,
+ css::uno::Reference< css::accessibility::XAccessible > _xParent,
+ css::uno::Reference< css::accessibility::XAccessible > _xControlAccessible,
+ css::uno::Reference< css::awt::XWindow > _xFocusWindow,
::vcl::IAccessibleTableProvider& _rBrowseBox,
sal_Int32 _nRowPos,
sal_uInt16 _nColPos
diff --git a/accessibility/inc/extended/accessiblelistbox.hxx b/accessibility/inc/extended/accessiblelistbox.hxx
index 4f4104701709..40b01ea180a5 100644
--- a/accessibility/inc/extended/accessiblelistbox.hxx
+++ b/accessibility/inc/extended/accessiblelistbox.hxx
@@ -37,7 +37,7 @@ namespace accessibility
/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry
*/
- class AccessibleListBox final :
+ class AccessibleListBox :
public cppu::ImplHelper2<
css::accessibility::XAccessible,
css::accessibility::XAccessibleSelection>,
@@ -45,18 +45,17 @@ namespace accessibility
{
css::uno::Reference< css::accessibility::XAccessible > m_xParent;
-
- virtual ~AccessibleListBox() override;
-
// OComponentHelper overridables
/** this function is called upon disposing the component */
virtual void SAL_CALL disposing() override;
+ protected:
// VCLXAccessibleComponent
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override;
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override;
+ private:
VclPtr< SvTreeListBox > getListBox() const;
void RemoveChildEntries(SvTreeListEntry*);
@@ -73,6 +72,8 @@ namespace accessibility
AccessibleListBox( SvTreeListBox const & _rListBox,
const css::uno::Reference< css::accessibility::XAccessible >& _xParent );
+ virtual ~AccessibleListBox() override;
+
rtl::Reference<AccessibleListBoxEntry> implGetAccessible(SvTreeListEntry & rEntry);
// XTypeProvider
diff --git a/accessibility/inc/extended/textwindowaccessibility.hxx b/accessibility/inc/extended/textwindowaccessibility.hxx
index 43e52384a536..f5696d8bfb61 100644
--- a/accessibility/inc/extended/textwindowaccessibility.hxx
+++ b/accessibility/inc/extended/textwindowaccessibility.hxx
@@ -132,7 +132,7 @@ class Paragraph final:
private cppu::BaseMutex, public ParagraphBase, private ::comphelper::OCommonAccessibleText
{
public:
- Paragraph(::rtl::Reference< Document > const & rDocument,
+ Paragraph(::rtl::Reference< Document > xDocument,
Paragraphs::size_type nNumber);
// Not thread-safe.
diff --git a/accessibility/inc/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/standard/vclxaccessiblelistitem.hxx
index 4af3c5afd65e..6542d7b43425 100644
--- a/accessibility/inc/standard/vclxaccessiblelistitem.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelistitem.hxx
@@ -85,7 +85,7 @@ public:
is our parent accessible object
*/
VCLXAccessibleListItem(sal_Int32 _nIndexInParent,
- const rtl::Reference< VCLXAccessibleList >& _xParent);
+ rtl::Reference< VCLXAccessibleList > _xParent);
void NotifyAccessibleEvent( sal_Int16 _nEventId, const css::uno::Any& _aOldValue, const css::uno::Any& _aNewValue );
diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx
index 8c620b98260b..6bc4865c6d4d 100644
--- a/accessibility/source/extended/AccessibleBrowseBox.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBox.cxx
@@ -21,6 +21,7 @@
#include <extended/AccessibleBrowseBoxTable.hxx>
#include <extended/AccessibleBrowseBoxHeaderBar.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <utility>
#include <vcl/accessibletableprovider.hxx>
#include <toolkit/helper/convert.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -267,8 +268,8 @@ void AccessibleBrowseBox::commitHeaderBarEvent( sal_Int16 _nEventId,
// = AccessibleBrowseBoxAccess
-AccessibleBrowseBoxAccess::AccessibleBrowseBoxAccess( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, ::vcl::IAccessibleTableProvider& _rBrowseBox )
- :m_xParent( _rxParent )
+AccessibleBrowseBoxAccess::AccessibleBrowseBoxAccess( css::uno::Reference< css::accessibility::XAccessible > _xParent, ::vcl::IAccessibleTableProvider& _rBrowseBox )
+ :m_xParent(std::move( _xParent ))
,m_rBrowseBox( _rBrowseBox )
{
}
diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
index ee64200065d1..4b16293e5083 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
@@ -19,6 +19,7 @@
#include <extended/AccessibleBrowseBoxBase.hxx>
#include <toolkit/helper/convert.hxx>
+#include <utility>
#include <vcl/accessibletableprovider.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -49,14 +50,14 @@ using namespace com::sun::star::accessibility::AccessibleStateType;
// Ctor/Dtor/disposing
AccessibleBrowseBoxBase::AccessibleBrowseBoxBase(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > xParent,
::vcl::IAccessibleTableProvider& rBrowseBox,
- const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
+ css::uno::Reference< css::awt::XWindow > _xFocusWindow,
AccessibleBrowseBoxObjType eObjType ) :
AccessibleBrowseBoxImplHelper( m_aMutex ),
- mxParent( rxParent ),
+ mxParent(std::move( xParent )),
mpBrowseBox( &rBrowseBox ),
- m_xFocusWindow(_xFocusWindow),
+ m_xFocusWindow(std::move(_xFocusWindow)),
maName( rBrowseBox.GetAccessibleObjectName( eObjType ) ),
maDescription( rBrowseBox.GetAccessibleObjectDescription( eObjType ) ),
meObjType( eObjType ),
@@ -67,18 +68,18 @@ AccessibleBrowseBoxBase::AccessibleBrowseBoxBase(
}
AccessibleBrowseBoxBase::AccessibleBrowseBoxBase(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > rxParent,
::vcl::IAccessibleTableProvider& rBrowseBox,
- const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
+ css::uno::Reference< css::awt::XWindow > _xFocusWindow,
AccessibleBrowseBoxObjType eObjType,
- const OUString& rName,
- const OUString& rDescription ) :
+ OUString rName,
+ OUString rDescription ) :
AccessibleBrowseBoxImplHelper( m_aMutex ),
- mxParent( rxParent ),
+ mxParent(std::move( rxParent )),
mpBrowseBox( &rBrowseBox ),
- m_xFocusWindow(_xFocusWindow),
- maName( rName ),
- maDescription( rDescription ),
+ m_xFocusWindow(std::move(_xFocusWindow)),
+ maName(std::move( rName )),
+ maDescription(std::move( rDescription )),
meObjType( eObjType ),
m_aClientId(0)
{
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index c90cc0384b46..a3d016194a27 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -22,10 +22,9 @@
#include <extended/AccessibleGridControlHeader.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <toolkit/helper/convert.hxx>
+#include <utility>
#include <vcl/accessibletable.hxx>
#include <vcl/svapp.hxx>
@@ -59,11 +58,6 @@ void SAL_CALL AccessibleGridControl::disposing()
m_xTable->dispose();
m_xTable.clear();
}
- if ( m_xCell.is() )
- {
- m_xCell->dispose();
- m_xCell.clear();
- }
if ( m_xRowHeaderBar.is() )
{
m_xRowHeaderBar->dispose();
@@ -277,15 +271,10 @@ void AccessibleGridControl::commitCellEvent(sal_Int16 _nEventId,const Any& _rNew
css::uno::Reference< css::accessibility::XAccessible > xAccessible = getAccessibleChild(i);
if(css::uno::Reference< css::accessibility::XAccessible >(m_xTable) == xAccessible)
{
- std::vector< rtl::Reference<AccessibleGridControlTableCell> >& rCells =
- m_xTable->getCellVector();
- size_t nIndex = m_aTable.GetCurrentRow() * m_aTable.GetColumnCount()
- + m_aTable.GetCurrentColumn();
- if (nIndex < rCells.size() && rCells[nIndex])
- {
- m_xCell = rCells[nIndex];
- m_xCell->commitEvent( _nEventId, _rNewValue, _rOldValue );
- }
+ Reference<XAccessible> xCell = m_xTable->getAccessibleCellAt(
+ m_aTable.GetCurrentRow(), m_aTable.GetCurrentColumn());
+ AccessibleGridControlTableCell* pCell = static_cast<AccessibleGridControlTableCell*>(xCell.get());
+ pCell->commitEvent(_nEventId, _rNewValue, _rOldValue);
}
}
}
@@ -307,37 +296,10 @@ void AccessibleGridControl::commitTableEvent(sal_Int16 _nEventId,const Any& _rNe
const sal_Int32 nCurrentCol = m_aTable.GetCurrentColumn();
css::uno::Reference< css::accessibility::XAccessible > xChild;
if (nCurrentRow > -1 && nCurrentCol > -1)
- {
- sal_Int32 nColumnCount = m_aTable.GetColumnCount();
- xChild = m_xTable->getAccessibleChild(nCurrentRow * nColumnCount + nCurrentCol);
- }
+ xChild = m_xTable->getAccessibleCellAt(nCurrentRow, nCurrentCol);
+
m_xTable->commitEvent(_nEventId, Any(xChild),_rOldValue);
}
- else if(_nEventId == AccessibleEventId::TABLE_MODEL_CHANGED)
- {
- AccessibleTableModelChange aChange;
- if(_rNewValue >>= aChange)
- {
- if(aChange.Type == AccessibleTableModelChangeType::DELETE)
- {
- std::vector< rtl::Reference<AccessibleGridControlTableCell> >& rCells =
- m_xTable->getCellVector();
- int nColCount = m_aTable.GetColumnCount();
- // check valid index - entries are inserted lazily
- size_t const nStart = nColCount * aChange.FirstRow;
- size_t const nEnd = nColCount * aChange.LastRow;
- if (nStart < rCells.size())
- {
- m_xTable->getCellVector().erase(
- rCells.begin() + nStart,
- rCells.begin() + std::min(rCells.size(), nEnd));
- }
- m_xTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
- }
- else
- m_xTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
- }
- }
else
m_xTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
}
@@ -346,8 +308,8 @@ void AccessibleGridControl::commitTableEvent(sal_Int16 _nEventId,const Any& _rNe
AccessibleGridControlAccess::AccessibleGridControlAccess(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent, ::vcl::table::IAccessibleTable& rTable )
- : m_xParent( rxParent )
+ css::uno::Reference< css::accessibility::XAccessible > xParent, ::vcl::table::IAccessibleTable& rTable )
+ : m_xParent(std::move( xParent ))
, m_pTable( & rTable )
{
}
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx
index c118c70f7a32..6b7ce3fad417 100644
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -19,6 +19,7 @@
#include <extended/AccessibleGridControlBase.hxx>
#include <toolkit/helper/convert.hxx>
+#include <utility>
#include <vcl/accessibletable.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
@@ -47,15 +48,13 @@ using namespace com::sun::star::accessibility::AccessibleStateType;
AccessibleGridControlBase::AccessibleGridControlBase(
- const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
+ css::uno::Reference< css::accessibility::XAccessible > xParent,
::vcl::table::IAccessibleTable& rTable,
::vcl::table::AccessibleTableControlObjType eObjType ) :
AccessibleGridControlImplHelper( m_aMutex ),
- m_xParent( rxParent ),
+ m_xParent(std::move( xParent )),
m_aTable( rTable),
m_eObjType( eObjType ),
- m_aName( rTable.GetAccessibleObjectName( eObjType, 0, 0 ) ),
- m_aDescription( rTable.GetAccessibleObjectDescription( eObjType ) ),
m_aClientId(0)
{
}
@@ -135,7 +134,7 @@ OUString SAL_CALL AccessibleGridControlBase::getAccessibleDescription()
SolarMutexGuard g;
ensureIsAlive();
- return m_aDescription;
+ return m_aTable.GetAccessibleObjectDescription(m_eObjType);
}
OUString SAL_CALL AccessibleGridControlBase::getAccessibleName()
@@ -143,7 +142,7 @@ OUString SAL_CALL AccessibleGridControlBase::getAccessibleName()
SolarMutexGuard g;
ensureIsAlive();
- return m_aName;
+ return m_aTable.GetAccessibleObjectName(m_eObjType, 0, 0);
}
css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL
diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx
index 7c6c2df5925d..d88b3421812d 100644
--- a/accessibility/source/extended/AccessibleGridControlHeader.cxx
+++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx
@@ -74,11 +74,13 @@ AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex )
sal_Int32 SAL_CALL AccessibleGridControlHeader::getAccessibleIndexInParent()
{
- ensureIsAlive();
- if(m_eObjType == vcl::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader())
- return 1;
- else
- return 0;
+ SolarMutexGuard aSolarGuard;
+
+ ensureIsAlive();
+ if(m_eObjType == vcl::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader())
+ return 1;
+ else
+ return 0;
}
// XAccessibleComponent -------------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 8938ba83a122..00788cdf2d31 100644
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <extended/AccessibleGridControlTable.hxx>
#include <extended/AccessibleGridControlTableCell.hxx>
@@ -69,6 +72,8 @@ AccessibleGridControlTable::getAccessibleChild( sal_Int32 nChildIndex )
sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent()
{
+ SolarMutexGuard aSolarGuard;
+
ensureIsAlive();
if(m_aTable.HasRowHeader() && m_aTable.HasColHeader())
return 0;
@@ -181,18 +186,8 @@ Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getAccessibleCellA
ensureIsAlive();
ensureIsValidAddress( nRow, nColumn );
- sal_Int32 nCount = getAccessibleChildCount();
sal_Int32 nChildIndex = nRow*m_aTable.GetColumnCount() + nColumn;
- if(m_aCellVector.empty() || m_aCellVector.size() != static_cast<unsigned>(nCount))
- {
- m_aCellVector.resize(nCount);
- }
- if(!m_aCellVector[nChildIndex].is())
- {
- rtl::Reference<AccessibleGridControlTableCell> pCell = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn);
- m_aCellVector[nChildIndex] = pCell;
- }
- return m_aCellVector[nChildIndex];
+ return getAccessibleChild(nChildIndex);
}
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected(
@@ -295,6 +290,49 @@ OUString SAL_CALL AccessibleGridControlTable::getImplementationName()
return "com.sun.star.accessibility.AccessibleGridControlTable";
}
+void AccessibleGridControlTable::dispose()
+{
+ for (rtl::Reference<AccessibleGridControlTableCell>& rxCell : m_aCellVector)
+ {
+ if (rxCell.is())
+ {
+ rxCell->dispose();
+ rxCell.clear();
+ }
+ }
+
+ AccessibleGridControlTableBase::dispose();
+}
+
+void AccessibleGridControlTable::commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue)
+{
+ if (nEventId == AccessibleEventId::TABLE_MODEL_CHANGED)
+ {
+ AccessibleTableModelChange aChange;
+ if (rNewValue >>= aChange)
+ {
+ assert(aChange.Type != AccessibleTableModelChangeType::COLUMNS_REMOVED);
+
+ if (aChange.Type == AccessibleTableModelChangeType::ROWS_REMOVED)
+ {
+ int nColCount = m_aTable.GetColumnCount();
+ // check valid index - entries are inserted lazily
+ size_t const nStart = nColCount * aChange.FirstRow;
+ size_t const nEnd = nColCount * aChange.LastRow;
+ if (nStart < m_aCellVector.size())
+ {
+ m_aCellVector.erase(
+ m_aCellVector.begin() + nStart,
+ m_aCellVector.begin() + std::min(m_aCellVector.size(), nEnd));
+ }
+ }
+ }
+ }
+
+ AccessibleGridControlBase::commitEvent(nEventId, rNewValue, rOldValue);
+}
+
// internal virtual methods ---------------------------------------------------
tools::Rectangle AccessibleGridControlTable::implGetBoundingBox()
diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
index cb38725dd225..20bf37698e9d 100644
--- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
@@ -59,16 +59,6 @@ namespace accessibility
,m_nRowPos( _nRowPos )
,m_nColPos( _nColPos )
{
- // set accessible name here, because for that we need the position of the cell
- // and so the base class isn't capable of doing this
- OUString aAccName;
- if(_eType == TCTYPE_TABLECELL)
- aAccName = _rTable.GetAccessibleObjectName( TCTYPE_TABLECELL, _nRowPos, _nColPos );
- else if(_eType == TCTYPE_ROWHEADERCELL)
- aAccName = _rTable.GetAccessibleObjectName( TCTYPE_ROWHEADERCELL, _nRowPos, 0 );
- else if(_eType == TCTYPE_COLUMNHEADERCELL)
- aAccName = _rTable.GetAccessibleObjectName( TCTYPE_COLUMNHEADERCELL, 0, _nRowPos );
- implSetName( aAccName );
}
void SAL_CALL AccessibleGridControlCell::grabFocus()
@@ -78,6 +68,24 @@ namespace accessibility
m_aTable.GoToCell( m_nColPos, m_nRowPos );
}
+ OUString SAL_CALL AccessibleGridControlCell::getAccessibleName()
+ {
+ SolarMutexGuard g;
+
+ ensureIsAlive();
+
+ OUString sAccName;
+ if (m_eObjType == TCTYPE_TABLECELL)
+ sAccName = m_aTable.GetAccessibleObjectName(TCTYPE_TABLECELL, m_nRowPos, m_nColPos);
+ else if (m_eObjType == TCTYPE_ROWHEADERCELL)
+ sAccName = m_aTable.GetAccessibleObjectName(TCTYPE_ROWHEADERCELL, m_nRowPos, 0);
+ else if (m_eObjType == TCTYPE_COLUMNHEADERCELL)
+ sAccName = m_aTable.GetAccessibleObjectName(TCTYPE_COLUMNHEADERCELL, 0, m_nRowPos);
+ else
+ assert(false && "Unhandled table cell type");
+ return sAccName;
+ }
+
// implementation of a table cell
OUString AccessibleGridControlTableCell::implGetText()
{
@@ -254,20 +262,14 @@ namespace accessibility
OUString SAL_CALL AccessibleGridControlTableCell::getSelectedText( )
{
- SolarMutexGuard aSolarGuard;
-
return OUString();
}
sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionStart( )
{
- SolarMutexGuard aSolarGuard;
-
return 0;
}
sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionEnd( )
{
- SolarMutexGuard aSolarGuard;
-
return 0;
}
sal_Bool SAL_CALL AccessibleGridControlTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
diff --git a/accessibility/source/extended/AccessibleIconView.cxx b/accessibility/source/extended/AccessibleIconView.cxx
new file mode 100644
index 000000000000..6bc5c99e9243
--- /dev/null
+++ b/accessibility/source/extended/AccessibleIconView.cxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include <sal/config.h>
+
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+
+#include <toolkit/helper/convert.hxx>
+#include <vcl/event.hxx>
+
+#include <extended/AccessibleIconView.hxx>
+
+namespace accessibility
+{
+AccessibleIconView::AccessibleIconView(
+ SvTreeListBox const& _rListBox,
+ const css::uno::Reference<css::accessibility::XAccessible>& _xParent)
+ : AccessibleListBox(_rListBox, _xParent)
+{
+}
+
+void AccessibleIconView::ProcessWindowEvent(const VclWindowEvent& rVclWindowEvent)
+{
+ if (!isAlive())
+ return;
+
+ switch (rVclWindowEvent.GetId())
+ {
+ case VclEventId::WindowMouseMove:
+ if (MouseEvent* pMouseEvt = static_cast<MouseEvent*>(rVclWindowEvent.GetData()))
+ {
+ if (auto xChild = getAccessibleAtPoint(AWTPoint(pMouseEvt->GetPosPixel())))
+ {
+ // Allow announcing the element on mouse hover
+ css::uno::Any aNew(xChild);
+ NotifyAccessibleEvent(
+ css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, {}, aNew);
+ }
+ }
+ break;
+ default:
+ AccessibleListBox::ProcessWindowEvent(rVclWindowEvent);
+ }
+}
+} // namespace accessibility
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
index a582defcadd6..54f0696735f5 100644
--- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
+++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
@@ -22,6 +22,7 @@
#include <extended/accessibleeditbrowseboxcell.hxx>
#include <comphelper/processfactory.hxx>
+#include <utility>
#include <tools/diagnose_ex.h>
namespace accessibility
@@ -180,12 +181,12 @@ namespace accessibility
// EditBrowseBoxTableCell
EditBrowseBoxTableCellAccess::EditBrowseBoxTableCellAccess(
- const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, const css::uno::Reference< css::accessibility::XAccessible >& _rxControlAccessible,
- const css::uno::Reference< css::awt::XWindow >& _rxFocusWindow,
+ css::uno::Reference< css::accessibility::XAccessible > _xParent, css::uno::Reference< css::accessibility::XAccessible > _xControlAccessible,
+ css::uno::Reference< css::awt::XWindow > _xFocusWindow,
::vcl::IAccessibleTableProvider& _rBrowseBox, sal_Int32 _nRowPos, sal_uInt16 _nColPos )
- :m_xParent( _rxParent )
- ,m_xControlAccessible( _rxControlAccessible )
- ,m_xFocusWindow( _rxFocusWindow )
+ :m_xParent(std::move( _xParent ))
+ ,m_xControlAccessible(std::move( _xControlAccessible ))
+ ,m_xFocusWindow(std::move( _xFocusWindow ))
,m_pBrowseBox( &_rBrowseBox )
,m_nRowPos( _nRowPos )
,m_nColPos( _nColPos )
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index be1d98650324..2fff77b03699 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -439,33 +439,12 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- SvTreeListEntry* pEntry = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
if( getAccessibleRole() == AccessibleRole::TREE_ITEM )
{
return OUString();
}
- //want to count the real column number in the list box.
- sal_uInt16 iRealItemCount = 0;
- sal_uInt16 iCount = 0;
- sal_uInt16 iTotleItemCount = pEntry->ItemCount();
- while( iCount < iTotleItemCount )
- {
- const SvLBoxItem& rItem = pEntry->GetItem( iCount );
- if ( rItem.GetType() == SvLBoxItemType::String &&
- !static_cast<const SvLBoxString&>( rItem ).GetText().isEmpty() )
- {
- iRealItemCount++;
- }
- iCount++;
- }
- if(iRealItemCount<=1 )
- {
- return OUString();
- }
- else
- {
- return SvTreeListBox::SearchEntryTextWithHeadTitle( pEntry );
- }
+ return m_pTreeListBox->GetEntryAccessibleDescription(
+ m_pTreeListBox->GetEntryFromPath(m_aEntryPath));
}
OUString SAL_CALL AccessibleListBoxEntry::getAccessibleName( )
@@ -554,7 +533,7 @@ namespace accessibility
EnsureIsAlive();
SvTreeListEntry* pEntry = m_pTreeListBox->GetEntry( VCLPoint( _aPoint ) );
if ( !pEntry )
- throw RuntimeException();
+ throw RuntimeException("AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot be empty!");
Reference< XAccessible > xAcc;
uno::Reference<XAccessible> xListBox(m_wListBox);
@@ -878,7 +857,7 @@ namespace accessibility
SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
if ( !pParent )
- throw RuntimeException();
+ throw RuntimeException("AccessibleListBoxEntry::clearAccessibleSelection - pParent cannot be empty!");
sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
for ( sal_Int32 i = 0; i < nCount; ++i )
{
@@ -897,7 +876,7 @@ namespace accessibility
SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
if ( !pParent )
- throw RuntimeException();
+ throw RuntimeException("AccessibleListBoxEntry::selectAllAccessibleChildren - pParent cannot be empty!");
sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
for ( sal_Int32 i = 0; i < nCount; ++i )
{
@@ -918,7 +897,7 @@ namespace accessibility
SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
if ( !pParent )
- throw RuntimeException();
+ throw RuntimeException("AccessibleListBoxEntry::getSelectedAccessibleChildCount - pParent cannot be empty!");
nCount = m_pTreeListBox->GetLevelChildCount( pParent );
for ( i = 0; i < nCount; ++i )
{
@@ -945,7 +924,7 @@ namespace accessibility
SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
if ( !pParent )
- throw RuntimeException();
+ throw RuntimeException("AccessibleListBoxEntry::getSelectedAccessibleChild - pParent cannot be empty!");
nCount = m_pTreeListBox->GetLevelChildCount( pParent );
for ( i = 0; i < nCount; ++i )
{
diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx
index e983c1e47471..8bf2d7addc1d 100644
--- a/accessibility/source/extended/accessibletabbar.cxx
+++ b/accessibility/source/extended/accessibletabbar.cxx
@@ -30,6 +30,7 @@
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <o3tl/safeint.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <toolkit/awt/vclxfont.hxx>
@@ -228,7 +229,7 @@ namespace accessibility
{
OExternalLockGuard aGuard( this );
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
throw IndexOutOfBoundsException();
Reference< XAccessible > xChild = m_aAccessibleChildren[i];
diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx b/accessibility/source/extended/accessibletabbarpagelist.cxx
index 3c7f9976e0af..a65750fbd4b3 100644
--- a/accessibility/source/extended/accessibletabbarpagelist.cxx
+++ b/accessibility/source/extended/accessibletabbarpagelist.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <cppuhelper/supportsservice.hxx>
+#include <o3tl/safeint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <vcl/svapp.hxx>
@@ -73,7 +74,7 @@ namespace accessibility
{
NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -88,7 +89,7 @@ namespace accessibility
void AccessibleTabBarPageList::UpdatePageText( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
@@ -106,7 +107,7 @@ namespace accessibility
void AccessibleTabBarPageList::InsertChild( sal_Int32 i )
{
- if ( i < 0 || i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) > m_aAccessibleChildren.size() )
return;
// insert entry in child list
@@ -125,7 +126,7 @@ namespace accessibility
void AccessibleTabBarPageList::RemoveChild( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
// get the accessible of the removed page
@@ -150,8 +151,8 @@ namespace accessibility
void AccessibleTabBarPageList::MoveChild( sal_Int32 i, sal_Int32 j )
{
- if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) &&
- j >= 0 && j <= static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
+ if ( !(i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() &&
+ j >= 0 && o3tl::make_unsigned(j) <= m_aAccessibleChildren.size()) )
return;
if ( i < j )
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 4b37b1c78dd7..218ba33e6bae 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -33,6 +33,7 @@
#include <comphelper/accessibleeventnotifier.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <unotools/accessiblestatesethelper.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/txtattr.hxx>
#include <vcl/window.hxx>
@@ -79,10 +80,10 @@ void WindowListenerGuard::endListening()
}
}
-Paragraph::Paragraph(::rtl::Reference< Document > const & rDocument,
+Paragraph::Paragraph(::rtl::Reference< Document > xDocument,
Paragraphs::size_type nNumber):
ParagraphBase(m_aMutex),
- m_xDocument(rDocument),
+ m_xDocument(std::move(xDocument)),
m_nNumber(nNumber),
m_nClientId(0)
{
@@ -2097,9 +2098,9 @@ void Document::handleSelectionChangeNotification()
xParagraph->notifyEvent(
css::accessibility::AccessibleEventId::
CARET_CHANGED,
- css::uno::makeAny< ::sal_Int32 >(
+ css::uno::Any( ::sal_Int32 (
nNewLastPara == m_nSelectionLastPara
- ? m_nSelectionLastPos : 0),
+ ? m_nSelectionLastPos : 0)),
css::uno::Any(nNewLastPos));
}
}
@@ -2216,7 +2217,7 @@ void Document::disposeParagraphs()
// static
css::uno::Any Document::mapFontColor(::Color const & rColor)
{
- return css::uno::makeAny(rColor.GetRGBColor());
+ return css::uno::Any(rColor.GetRGBColor());
// FIXME keep transparency?
}
diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx
index 53ed173c15b2..10cc27f007c6 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -46,6 +46,7 @@
#include <extended/accessibletablistbox.hxx>
#include <extended/AccessibleBrowseBox.hxx>
#include <extended/accessibleiconchoicectrl.hxx>
+#include <extended/AccessibleIconView.hxx>
#include <extended/accessibletabbar.hxx>
#include <extended/accessiblelistbox.hxx>
#include <extended/AccessibleBrowseBoxHeaderBar.hxx>
@@ -156,6 +157,12 @@ public:
) const override;
virtual css::uno::Reference< css::accessibility::XAccessible >
+ createAccessibleIconView(
+ SvTreeListBox& _rListBox,
+ const css::uno::Reference< css::accessibility::XAccessible >& _xParent
+ ) const override;
+
+ virtual css::uno::Reference< css::accessibility::XAccessible >
createAccessibleBrowseBoxHeaderBar(
const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
vcl::IAccessibleTableProvider& _rOwningTable,
@@ -407,6 +414,12 @@ Reference< XAccessible > AccessibleFactory::createAccessibleTreeListBox(
return new AccessibleListBox( _rListBox, _xParent );
}
+Reference< XAccessible > AccessibleFactory::createAccessibleIconView(
+ SvTreeListBox& _rListBox, const Reference< XAccessible >& _xParent ) const
+{
+ return new AccessibleIconView( _rListBox, _xParent );
+}
+
Reference< XAccessible > AccessibleFactory::createAccessibleBrowseBoxHeaderBar(
const Reference< XAccessible >& rxParent, vcl::IAccessibleTableProvider& _rOwningTable,
AccessibleBrowseBoxObjType _eObjType ) const
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index bce5968c7cfc..f28bf8ad0570 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <cppuhelper/supportsservice.hxx>
+#include <o3tl/safeint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <vcl/menu.hxx>
#include <vcl/vclevent.hxx>
@@ -195,7 +196,7 @@ void OAccessibleMenuBaseComponent::SetChecked( bool bChecked )
void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 i, bool bEnabled )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -210,7 +211,7 @@ void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 i, bool bEnabled )
void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 i, bool bFocused )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -242,7 +243,7 @@ void OAccessibleMenuBaseComponent::UpdateSelected( sal_Int32 i, bool bSelected )
{
NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -257,7 +258,7 @@ void OAccessibleMenuBaseComponent::UpdateSelected( sal_Int32 i, bool bSelected )
void OAccessibleMenuBaseComponent::UpdateChecked( sal_Int32 i, bool bChecked )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -272,7 +273,7 @@ void OAccessibleMenuBaseComponent::UpdateChecked( sal_Int32 i, bool bChecked )
void OAccessibleMenuBaseComponent::UpdateAccessibleName( sal_Int32 i )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -287,7 +288,7 @@ void OAccessibleMenuBaseComponent::UpdateAccessibleName( sal_Int32 i )
void OAccessibleMenuBaseComponent::UpdateItemText( sal_Int32 i )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -376,12 +377,12 @@ Reference< XAccessible > OAccessibleMenuBaseComponent::GetChildAt( const awt::Po
void OAccessibleMenuBaseComponent::InsertChild( sal_Int32 i )
{
- if ( i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
- i = m_aAccessibleChildren.size();
-
if ( i < 0 )
return;
+ if ( o3tl::make_unsigned(i) > m_aAccessibleChildren.size() )
+ i = m_aAccessibleChildren.size();
+
// insert entry in child list
m_aAccessibleChildren.insert( m_aAccessibleChildren.begin() + i, Reference< XAccessible >() );
@@ -410,7 +411,7 @@ void OAccessibleMenuBaseComponent::InsertChild( sal_Int32 i )
void OAccessibleMenuBaseComponent::RemoveChild( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
// keep the accessible of the removed item
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx
index 87cfcdb62f30..d41c29737d62 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -135,7 +135,7 @@ OUString VCLXAccessibleEdit::implGetText()
sal_Unicode cEchoChar = pEdit->GetEchoChar();
if ( !cEchoChar )
cEchoChar = '*';
- OUStringBuffer sTmp;
+ OUStringBuffer sTmp(aText.getLength());
aText = comphelper::string::padToLength(sTmp, aText.getLength(),
cEchoChar).makeStringAndClear();
}
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index 353312e6bbae..bb81350f5dd0 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -547,7 +547,7 @@ Reference<XAccessible> SAL_CALL VCLXAccessibleList::getAccessibleChild (sal_Int3
Reference< XAccessible > xChild;
// search for the child
- if ( i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
xChild = CreateChild (i);
else
{
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx
index dea8682c127e..81a5cd1a2fcc 100644
--- a/accessibility/source/standard/vclxaccessiblelistitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <cppuhelper/supportsservice.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/toolkit/lstbox.hxx>
#include <vcl/unohelp2.hxx>
@@ -59,13 +60,13 @@ using namespace ::com::sun::star;
// Ctor() and Dtor()
-VCLXAccessibleListItem::VCLXAccessibleListItem(sal_Int32 _nIndexInParent, const rtl::Reference< VCLXAccessibleList >& _xParent)
+VCLXAccessibleListItem::VCLXAccessibleListItem(sal_Int32 _nIndexInParent, rtl::Reference< VCLXAccessibleList > _xParent)
: VCLXAccessibleListItem_BASE(m_aMutex)
, m_nIndexInParent(_nIndexInParent)
, m_bSelected(false)
, m_bVisible(false)
, m_nClientId(0)
- , m_xParent(_xParent)
+ , m_xParent(std::move(_xParent))
{
assert(m_xParent.is());
::accessibility::IComboListBoxHelper* pListBoxHelper = m_xParent->getListBoxHelper();
diff --git a/accessibility/source/standard/vclxaccessiblestatusbar.cxx b/accessibility/source/standard/vclxaccessiblestatusbar.cxx
index bd70676f58cc..d6e3e0ef5cad 100644
--- a/accessibility/source/standard/vclxaccessiblestatusbar.cxx
+++ b/accessibility/source/standard/vclxaccessiblestatusbar.cxx
@@ -22,6 +22,7 @@
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <o3tl/safeint.hxx>
#include <vcl/status.hxx>
#include <vcl/vclevent.hxx>
@@ -47,7 +48,7 @@ VCLXAccessibleStatusBar::VCLXAccessibleStatusBar( VCLXWindow* pVCLXWindow )
void VCLXAccessibleStatusBar::UpdateShowing( sal_Int32 i, bool bShowing )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -62,7 +63,7 @@ void VCLXAccessibleStatusBar::UpdateShowing( sal_Int32 i, bool bShowing )
void VCLXAccessibleStatusBar::UpdateItemName( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
@@ -80,7 +81,7 @@ void VCLXAccessibleStatusBar::UpdateItemName( sal_Int32 i )
void VCLXAccessibleStatusBar::UpdateItemText( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
@@ -98,7 +99,7 @@ void VCLXAccessibleStatusBar::UpdateItemText( sal_Int32 i )
void VCLXAccessibleStatusBar::InsertChild( sal_Int32 i )
{
- if ( i < 0 || i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) > m_aAccessibleChildren.size() )
return;
// insert entry in child list
@@ -117,7 +118,7 @@ void VCLXAccessibleStatusBar::InsertChild( sal_Int32 i )
void VCLXAccessibleStatusBar::RemoveChild( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
// get the accessible of the removed page
@@ -290,7 +291,7 @@ Reference< XAccessible > VCLXAccessibleStatusBar::getAccessibleChild( sal_Int32
{
OExternalLockGuard aGuard( this );
- if ( i < 0 || i >= static_cast<sal_Int32> (m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
throw IndexOutOfBoundsException();
Reference< XAccessible > xChild = m_aAccessibleChildren[i];
@@ -323,7 +324,7 @@ Reference< XAccessible > VCLXAccessibleStatusBar::getAccessibleAtPoint( const aw
{
sal_uInt16 nItemId = m_pStatusBar->GetItemId( VCLPoint( rPoint ) );
sal_Int32 nItemPos = m_pStatusBar->GetItemPos( nItemId );
- if ( nItemPos >= 0 && nItemPos < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( nItemPos >= 0 && o3tl::make_unsigned(nItemPos) < m_aAccessibleChildren.size() )
xChild = getAccessibleChild( nItemPos );
}
diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
index 20e2ff120cc3..c1ede974148b 100644
--- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx
+++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
@@ -72,7 +72,7 @@ void VCLXAccessibleTabControl::UpdateFocused()
void VCLXAccessibleTabControl::UpdateSelected( sal_Int32 i, bool bSelected )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -87,7 +87,7 @@ void VCLXAccessibleTabControl::UpdateSelected( sal_Int32 i, bool bSelected )
void VCLXAccessibleTabControl::UpdatePageText( sal_Int32 i )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -102,7 +102,7 @@ void VCLXAccessibleTabControl::UpdatePageText( sal_Int32 i )
void VCLXAccessibleTabControl::UpdateTabPage( sal_Int32 i, bool bNew )
{
- if ( i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
{
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
if ( xChild.is() )
@@ -117,7 +117,7 @@ void VCLXAccessibleTabControl::UpdateTabPage( sal_Int32 i, bool bNew )
void VCLXAccessibleTabControl::InsertChild( sal_Int32 i )
{
- if ( i < 0 || i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) > m_aAccessibleChildren.size() )
return;
// insert entry in child list
@@ -136,7 +136,7 @@ void VCLXAccessibleTabControl::InsertChild( sal_Int32 i )
void VCLXAccessibleTabControl::RemoveChild( sal_Int32 i )
{
- if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
return;
// get the accessible of the removed page
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index 50a600e3cbef..4e2059b61280 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -94,7 +94,7 @@ namespace
sal_Int32 getIndexInParent() const { return m_nIndexInParent; }
void setIndexInParent( sal_Int32 _nNewIndex ) { m_nIndexInParent = _nNewIndex; }
- static Sequence< sal_Int8 > getUnoTunnelId();
+ static const Sequence< sal_Int8 > & getUnoTunnelId();
public:
OToolBoxWindowItem(sal_Int32 _nIndexInParent,
@@ -132,7 +132,7 @@ namespace
return new OToolBoxWindowItemContext( m_nIndexInParent, getComponentContext(), _rxInnerContext, this, getParent() );
}
- Sequence< sal_Int8 > OToolBoxWindowItem::getUnoTunnelId()
+ const Sequence< sal_Int8 > & OToolBoxWindowItem::getUnoTunnelId()
{
static const comphelper::UnoIdInit implId;
return implId.getSeq();