svtools/source/control/valueacc.cxx |  163 ++++++++++++++++++------------------
 svtools/source/control/valueimp.hxx |   15 +--
 2 files changed, 90 insertions(+), 88 deletions(-)

New commits:
commit cfe63bf67f4a2c9943f5089781d5f26f78266913
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 24 17:17:34 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Feb 24 21:25:06 2025 +0100

    valueset a11y: Fix reported position
    
    ValueSetAcc::getBounds needs to report its bounding
    box within its parent.
    
    However, so far the returnded rectangle would always
    have a position of (0,0), which is wrong if the ValueSet
    isn't positioned at the top left of its parent.
    
    The ValueSetAcc::getLocationOnScreen logic to get
    the position relative to the parent and add the parent's
    absolute position is correct in theory, but was wrong
    because the position relative to the parent was incorrect.
    
    Instead, use weld::DrawingArea::get_accessible_location_on_screen
    for the ValueSet's DrawingArea to get the location on screen.
    
    In ValueSetAcc::getBounds, subtract the screen location of
    the parent to convert the absolute position to one relative
    in the parent (the opposite of what ValueSetAcc::getLocationOnScreen
    was doing before this commit).
    
    Without this, an incorrect position was e.g. seen
    for the following use case when using the qt6 VCL plugin:
    
    1) in Writer, open the "Format" -> "Paragraph" dialog
    2) go to the "Borders" tab
    3) start Accerciser
    4) in Accerciser's treeview of the LO a11y, navigate to the
       "Shadow Style" panel
    
    -> The correct area is highlighted on screen
    
    5) click on its "Position" label child
    
    -> The correct area is highlighted on screen.
    
    6) click on its list child
    
    -> The wrong area is highlighted on screen: The highlight
    rectangle's left edge is at the "Position" label again and
    it doesn't reach the end of the different shadow style (ValueSet)
    items.
    
    With this commit in place, the correct area is highlighted.
    
    Change-Id: Id31a321c6bec2a3ef9a1cbb2e5264eb6deabc57f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182112
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 290fa9f3c232..915582380f53 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -19,6 +19,7 @@
 
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/unohelp.hxx>
 #include <sal/log.hxx>
 #include <tools/debug.hxx>
 #include <comphelper/diagnose_ex.hxx>
@@ -700,17 +701,29 @@ awt::Rectangle SAL_CALL ValueSetAcc::getBounds()
 {
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
-    const Point         aOutPos;
 
+    weld::DrawingArea* pDrawingArea = mpValueSet->GetDrawingArea();
+    if (!pDrawingArea)
+        return css::awt::Rectangle();
+
+    const AbsoluteScreenPixelPoint aOutPos = 
pDrawingArea->get_accessible_location_on_screen();
     const Size aOutSize(mpValueSet->GetOutputSizePixel());
-    awt::Rectangle      aRet;
+    tools::Rectangle aBounds(aOutPos, aOutSize);
 
-    aRet.X = aOutPos.X();
-    aRet.Y = aOutPos.Y();
-    aRet.Width = aOutSize.Width();
-    aRet.Height = aOutSize.Height();
+    // subtract absolute parent pos to get relative pos in parent
+    uno::Reference<accessibility::XAccessible> xParent(getAccessibleParent());
+    if (xParent)
+    {
+        uno::Reference<accessibility::XAccessibleContext> 
xParentContext(xParent->getAccessibleContext());
+        uno::Reference<accessibility::XAccessibleComponent> 
xParentComponent(xParent->getAccessibleContext(), css::uno::UNO_QUERY);
+        if (xParentComponent.is())
+        {
+            awt::Point aParentPos = xParentComponent->getLocationOnScreen();
+            aBounds.Move(-aParentPos.X, - aParentPos.Y);
+        }
+    }
 
-    return aRet;
+    return vcl::unohelper::ConvertToAWTRect(aBounds);
 }
 
 awt::Point SAL_CALL ValueSetAcc::getLocation()
@@ -729,24 +742,12 @@ awt::Point SAL_CALL ValueSetAcc::getLocationOnScreen()
 {
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
-    awt::Point aScreenLoc(0, 0);
 
-    uno::Reference<accessibility::XAccessible> xParent(getAccessibleParent());
-    if (xParent)
-    {
-        uno::Reference<accessibility::XAccessibleContext> 
xParentContext(xParent->getAccessibleContext());
-        uno::Reference<accessibility::XAccessibleComponent> 
xParentComponent(xParentContext, css::uno::UNO_QUERY);
-        OSL_ENSURE( xParentComponent.is(), "ValueSetAcc::getLocationOnScreen: 
no parent component!" );
-        if ( xParentComponent.is() )
-        {
-            awt::Point aParentScreenLoc( 
xParentComponent->getLocationOnScreen() );
-            awt::Point aOwnRelativeLoc( getLocation() );
-            aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
-            aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
-        }
-    }
+    weld::DrawingArea* pDrawingArea = mpValueSet->GetDrawingArea();
+    if (!pDrawingArea)
+        return css::awt::Point();
 
-    return aScreenLoc;
+    return 
vcl::unohelper::ConvertToAWTPoint(pDrawingArea->get_accessible_location_on_screen());
 }
 
 awt::Size SAL_CALL ValueSetAcc::getSize()
commit 7cfdf821078a1cfe8d77ebf39feebf3e7183abb8
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 24 15:20:26 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Feb 24 21:24:59 2025 +0100

    valueset a11y: Rename ValueItemAcc::mpParent to mpValueSetItem
    
    ... for the same reasons as
    
        Change-Id: I30b516c7654022d6e9a486361b30cc5e538951ce
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Feb 24 15:04:32 2025 +0100
    
            value set a11y: Rename ValueSetAcc::mpParent to mpValueSet
    
    did for ValueSetAcc.
    
    Also rename ValueItemAcc::ParentDestroyed to
    ValueItemAcc::ValueSetItemDestroyed accordingly.
    
    Change-Id: Ic682e27c35a78f9ff523074ff4edfd0b330783d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182099
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 15fe33d134e8..290fa9f3c232 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -49,7 +49,7 @@ ValueSetItem::~ValueSetItem()
 {
     if( mxAcc.is() )
     {
-        mxAcc->ParentDestroyed();
+        mxAcc->ValueSetItemDestroyed();
     }
 }
 
@@ -61,8 +61,8 @@ const rtl::Reference< ValueItemAcc > & 
ValueSetItem::GetAccessible( bool bIsTran
     return mxAcc;
 }
 
-ValueItemAcc::ValueItemAcc( ValueSetItem* pParent, bool 
bIsTransientChildrenDisabled ) :
-    mpParent( pParent ),
+ValueItemAcc::ValueItemAcc(ValueSetItem* pValueSetItem, bool 
bIsTransientChildrenDisabled) :
+    mpValueSetItem(pValueSetItem),
     mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled )
 {
 }
@@ -71,10 +71,10 @@ ValueItemAcc::~ValueItemAcc()
 {
 }
 
-void ValueItemAcc::ParentDestroyed()
+void ValueItemAcc::ValueSetItemDestroyed()
 {
     std::scoped_lock aGuard( maMutex );
-    mpParent = nullptr;
+    mpValueSetItem = nullptr;
 }
 
 uno::Reference< accessibility::XAccessibleContext > SAL_CALL 
ValueItemAcc::getAccessibleContext()
@@ -100,8 +100,8 @@ uno::Reference< accessibility::XAccessible > SAL_CALL 
ValueItemAcc::getAccessibl
     const SolarMutexGuard aSolarGuard;
     uno::Reference< accessibility::XAccessible >    xRet;
 
-    if( mpParent )
-        xRet = mpParent->mrParent.mxAccessible;
+    if (mpValueSetItem)
+        xRet = mpValueSetItem->mrParent.mxAccessible;
 
     return xRet;
 }
@@ -114,11 +114,11 @@ sal_Int64 SAL_CALL 
ValueItemAcc::getAccessibleIndexInParent()
     // parent.
     sal_Int64 nIndexInParent = -1;
 
-    if( mpParent )
+    if (mpValueSetItem)
     {
         bool bDone = false;
 
-        sal_uInt16 nCount = mpParent->mrParent.ImplGetVisibleItemCount();
+        sal_uInt16 nCount = mpValueSetItem->mrParent.ImplGetVisibleItemCount();
         ValueSetItem* pItem;
         for (sal_uInt16 i=0; i<nCount && !bDone; i++)
         {
@@ -126,7 +126,7 @@ sal_Int64 SAL_CALL 
ValueItemAcc::getAccessibleIndexInParent()
             // just in case the number of children changes in the meantime.
             try
             {
-                pItem = mpParent->mrParent.ImplGetItem(i);
+                pItem = mpValueSetItem->mrParent.ImplGetItem(i);
             }
             catch (const lang::IndexOutOfBoundsException&)
             {
@@ -144,9 +144,9 @@ sal_Int64 SAL_CALL 
ValueItemAcc::getAccessibleIndexInParent()
     }
 
     //if this valueset contain a none field(common value is default), then we 
should increase the real index and set the noitem index value equal 0.
-    if ( mpParent && ( (mpParent->mrParent.GetStyle() & WB_NONEFIELD) != 0 ) )
+    if (mpValueSetItem && ((mpValueSetItem->mrParent.GetStyle() & 
WB_NONEFIELD) != 0))
     {
-        ValueSetItem* pFirstItem = mpParent->mrParent.ImplGetItem 
(VALUESET_ITEM_NONEITEM);
+        ValueSetItem* pFirstItem = 
mpValueSetItem->mrParent.ImplGetItem(VALUESET_ITEM_NONEITEM);
         if( pFirstItem && pFirstItem 
->GetAccessible(mbIsTransientChildrenDisabled).get() == this )
             nIndexInParent = 0;
         else
@@ -172,12 +172,12 @@ OUString SAL_CALL ValueItemAcc::getAccessibleName()
 {
     const SolarMutexGuard aSolarGuard;
 
-    if( mpParent )
+    if (mpValueSetItem)
     {
-        if (mpParent->maText.isEmpty())
-            return "Item " +  
OUString::number(static_cast<sal_Int32>(mpParent->mnId));
+        if (mpValueSetItem->maText.isEmpty())
+            return "Item " + 
OUString::number(static_cast<sal_Int32>(mpValueSetItem->mnId));
         else
-            return mpParent->maText;
+            return mpValueSetItem->maText;
     }
 
     return OUString();
@@ -195,7 +195,7 @@ sal_Int64 SAL_CALL ValueItemAcc::getAccessibleStateSet()
     const SolarMutexGuard aSolarGuard;
     sal_Int64 nStateSet = 0;
 
-    if( mpParent )
+    if (mpValueSetItem)
     {
         nStateSet |= accessibility::AccessibleStateType::ENABLED;
         nStateSet |= accessibility::AccessibleStateType::SENSITIVE;
@@ -207,11 +207,11 @@ sal_Int64 SAL_CALL ValueItemAcc::getAccessibleStateSet()
         nStateSet |= accessibility::AccessibleStateType::SELECTABLE;
         nStateSet |= accessibility::AccessibleStateType::FOCUSABLE;
 
-        if( mpParent->mrParent.GetSelectedItemId() == mpParent->mnId )
+        if (mpValueSetItem->mrParent.GetSelectedItemId() == 
mpValueSetItem->mnId)
         {
 
             nStateSet |= accessibility::AccessibleStateType::SELECTED;
-            if (mpParent->mrParent.HasChildFocus())
+            if (mpValueSetItem->mrParent.HasChildFocus())
                 nStateSet |= accessibility::AccessibleStateType::FOCUSED;
         }
     }
@@ -296,10 +296,10 @@ awt::Rectangle SAL_CALL ValueItemAcc::getBounds()
     const SolarMutexGuard aSolarGuard;
     awt::Rectangle      aRet;
 
-    if( mpParent )
+    if (mpValueSetItem)
     {
-        tools::Rectangle   aRect( 
mpParent->mrParent.GetItemRect(mpParent->mnId) );
-        tools::Rectangle   aParentRect( Point(), 
mpParent->mrParent.GetOutputSizePixel() );
+        tools::Rectangle 
aRect(mpValueSetItem->mrParent.GetItemRect(mpValueSetItem->mnId));
+        tools::Rectangle aParentRect(Point(), 
mpValueSetItem->mrParent.GetOutputSizePixel());
 
         aRect.Intersection( aParentRect );
 
@@ -328,10 +328,11 @@ awt::Point SAL_CALL ValueItemAcc::getLocationOnScreen()
     const SolarMutexGuard aSolarGuard;
     awt::Point          aRet;
 
-    if( mpParent )
+    if (mpValueSetItem)
     {
-        const Point aPos = 
mpParent->mrParent.GetItemRect(mpParent->mnId).TopLeft();
-        const Point 
aScreenPos(mpParent->mrParent.GetDrawingArea()->get_accessible_location_on_screen());
+        const Point aPos = 
mpValueSetItem->mrParent.GetItemRect(mpValueSetItem->mnId).TopLeft();
+        const Point aScreenPos(
+            
mpValueSetItem->mrParent.GetDrawingArea()->get_accessible_location_on_screen());
 
         aRet.X = aPos.X() + aScreenPos.X();
         aRet.Y = aPos.Y() + aScreenPos.Y();
@@ -365,8 +366,8 @@ sal_Int32 SAL_CALL ValueItemAcc::getForeground(  )
 sal_Int32 SAL_CALL ValueItemAcc::getBackground(  )
 {
     Color nColor;
-    if (mpParent && mpParent->meType == VALUESETITEM_COLOR)
-        nColor = mpParent->maColor;
+    if (mpValueSetItem && mpValueSetItem->meType == VALUESETITEM_COLOR)
+        nColor = mpValueSetItem->maColor;
     else
         nColor = 
Application::GetSettings().GetStyleSettings().GetWindowColor();
     return static_cast<sal_Int32>(nColor);
@@ -700,6 +701,7 @@ awt::Rectangle SAL_CALL ValueSetAcc::getBounds()
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
     const Point         aOutPos;
+
     const Size aOutSize(mpValueSet->GetOutputSizePixel());
     awt::Rectangle      aRet;
 
diff --git a/svtools/source/control/valueimp.hxx 
b/svtools/source/control/valueimp.hxx
index fb24c928168b..b4fdff85e56e 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -192,15 +192,15 @@ private:
     ::std::vector< css::uno::Reference<
         css::accessibility::XAccessibleEventListener > >                
mxEventListeners;
     std::mutex                                                          
maMutex;
-    ValueSetItem*                                                    mpParent;
+    ValueSetItem*                                                       
mpValueSetItem;
     bool                                                                
mbIsTransientChildrenDisabled;
 
 public:
 
-    ValueItemAcc(ValueSetItem* pParent, bool bIsTransientChildrenDisabled);
+    ValueItemAcc(ValueSetItem* pValueSetItem, bool 
bIsTransientChildrenDisabled);
     virtual ~ValueItemAcc() override;
 
-    void    ParentDestroyed();
+    void    ValueSetItemDestroyed();
 
     void    FireAccessibleEvent( short nEventId, const css::uno::Any& 
rOldValue, const css::uno::Any& rNewValue );
 
commit 8f0b672a1ac712c75227e9497aa812e17724638b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 24 15:04:32 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Feb 24 21:24:52 2025 +0100

    valueset a11y: Rename ValueSetAcc::mpParent to mpValueSet
    
    It is simply the ValueSet for which this ValueSetAcc is
    the accessible context.
    
    Having "parent" in the name seems to suggest that this is the
    (accessible) parent, which it is not, see
    ValueSetAcc::getAccessibleParent which gets the accessible
    parent of ValueSetAcc::mpParent for the actual parent.
    
    Also rename the ValueSetAcc::ThrowIfDisposed param
    accordingly.
    
    Change-Id: I30b516c7654022d6e9a486361b30cc5e538951ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182098
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index c8f9cafded65..15fe33d134e8 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -397,8 +397,8 @@ void ValueItemAcc::FireAccessibleEvent( short nEventId, 
const uno::Any& rOldValu
     }
 }
 
-ValueSetAcc::ValueSetAcc( ValueSet* pParent ) :
-    mpParent( pParent ),
+ValueSetAcc::ValueSetAcc(ValueSet* pValueSet) :
+    mpValueSet(pValueSet),
     mbIsFocused(false)
 {
 }
@@ -474,7 +474,7 @@ sal_Int64 SAL_CALL ValueSetAcc::getAccessibleChildCount()
     const SolarMutexGuard aSolarGuard;
     ThrowIfDisposed();
 
-    sal_Int64 nCount = mpParent->ImplGetVisibleItemCount();
+    sal_Int64 nCount = mpValueSet->ImplGetVisibleItemCount();
     if (HasNoneField())
         nCount += 1;
     return nCount;
@@ -502,7 +502,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL 
ValueSetAcc::getAccessible
 {
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
-    return mpParent->GetDrawingArea()->get_accessible_parent();
+    return mpValueSet->GetDrawingArea()->get_accessible_parent();
 }
 
 sal_Int64 SAL_CALL ValueSetAcc::getAccessibleIndexInParent()
@@ -554,9 +554,9 @@ OUString SAL_CALL ValueSetAcc::getAccessibleDescription()
     const SolarMutexGuard aSolarGuard;
     OUString              aRet;
 
-    if (mpParent)
+    if (mpValueSet)
     {
-        aRet = mpParent->GetAccessibleDescription();
+        aRet = mpValueSet->GetAccessibleDescription();
     }
 
     return aRet;
@@ -569,9 +569,9 @@ OUString SAL_CALL ValueSetAcc::getAccessibleName()
     const SolarMutexGuard aSolarGuard;
     OUString              aRet;
 
-    if (mpParent)
+    if (mpValueSet)
     {
-        aRet = mpParent->GetAccessibleName();
+        aRet = mpValueSet->GetAccessibleName();
     }
 
     return aRet;
@@ -581,7 +581,7 @@ uno::Reference< accessibility::XAccessibleRelationSet > 
SAL_CALL ValueSetAcc::ge
 {
     ThrowIfDisposed();
     SolarMutexGuard g;
-    return mpParent->GetDrawingArea()->get_accessible_relation_set();
+    return mpValueSet->GetDrawingArea()->get_accessible_relation_set();
 }
 
 sal_Int64 SAL_CALL ValueSetAcc::getAccessibleStateSet()
@@ -677,16 +677,16 @@ uno::Reference< accessibility::XAccessible > SAL_CALL 
ValueSetAcc::getAccessible
 {
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
-    const sal_uInt16                                    nItemId = 
mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
+    const sal_uInt16 nItemId = mpValueSet->GetItemId(Point(aPoint.X, 
aPoint.Y));
     uno::Reference< accessibility::XAccessible >    xRet;
 
     if ( nItemId )
     {
-        const size_t nItemPos = mpParent->GetItemPos( nItemId );
+        const size_t nItemPos = mpValueSet->GetItemPos(nItemId);
 
         if( VALUESET_ITEM_NONEITEM != nItemPos )
         {
-            ValueSetItem *const pItem = mpParent->mItemList[nItemPos].get();
+            ValueSetItem* const pItem = mpValueSet->mItemList[nItemPos].get();
             xRet = pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ 
);
         }
     }
@@ -700,7 +700,7 @@ awt::Rectangle SAL_CALL ValueSetAcc::getBounds()
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
     const Point         aOutPos;
-    const Size          aOutSize( mpParent->GetOutputSizePixel() );
+    const Size aOutSize(mpValueSet->GetOutputSizePixel());
     awt::Rectangle      aRet;
 
     aRet.X = aOutPos.X();
@@ -763,7 +763,7 @@ void SAL_CALL ValueSetAcc::grabFocus()
 {
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
-    mpParent->GrabFocus();
+    mpValueSet->GrabFocus();
 }
 
 sal_Int32 SAL_CALL ValueSetAcc::getForeground(  )
@@ -793,7 +793,7 @@ void SAL_CALL ValueSetAcc::selectAccessibleChild( sal_Int64 
nChildIndex )
     if(pItem == nullptr)
         throw lang::IndexOutOfBoundsException();
 
-    mpParent->SelectItem( pItem->mnId );
+    mpValueSet->SelectItem(pItem->mnId);
 }
 
 
@@ -810,7 +810,7 @@ sal_Bool SAL_CALL ValueSetAcc::isAccessibleChildSelected( 
sal_Int64 nChildIndex
     if (pItem == nullptr)
         throw lang::IndexOutOfBoundsException();
 
-    bool  bRet = mpParent->IsItemSelected( pItem->mnId );
+    bool bRet = mpValueSet->IsItemSelected(pItem->mnId);
     return bRet;
 }
 
@@ -819,7 +819,7 @@ void SAL_CALL ValueSetAcc::clearAccessibleSelection()
 {
     ThrowIfDisposed();
     const SolarMutexGuard aSolarGuard;
-    mpParent->SetNoSelection();
+    mpValueSet->SetNoSelection();
 }
 
 
@@ -840,7 +840,7 @@ sal_Int64 SAL_CALL 
ValueSetAcc::getSelectedAccessibleChildCount()
     {
         ValueSetItem* pItem = getItem (i);
 
-        if( pItem && mpParent->IsItemSelected( pItem->mnId ) )
+        if (pItem && mpValueSet->IsItemSelected(pItem->mnId))
             ++nRet;
     }
 
@@ -858,7 +858,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL 
ValueSetAcc::getSelectedAc
     {
         ValueSetItem* pItem = getItem(i);
 
-        if( pItem && mpParent->IsItemSelected( pItem->mnId ) && ( 
nSelectedChildIndex == static_cast< sal_Int64 >( nSel++ ) ) )
+        if (pItem && mpValueSet->IsItemSelected(pItem->mnId) && 
(nSelectedChildIndex == static_cast< sal_Int64 >(nSel++)))
             xRet = pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ 
);
     }
 
@@ -877,12 +877,12 @@ void SAL_CALL ValueSetAcc::deselectAccessibleChild( 
sal_Int64 nChildIndex )
     // Because of the single selection we can reset the whole selection when
     // the specified child is currently selected.
     if (isAccessibleChildSelected(nChildIndex))
-        mpParent->SetNoSelection();
+        mpValueSet->SetNoSelection();
 }
 
 void ValueSetAcc::Invalidate()
 {
-    mpParent = nullptr;
+    mpValueSet = nullptr;
 }
 
 void ValueSetAcc::disposing(std::unique_lock<std::mutex>& rGuard)
@@ -912,7 +912,7 @@ void ValueSetAcc::disposing(std::unique_lock<std::mutex>& 
rGuard)
 
 sal_uInt16 ValueSetAcc::getItemCount() const
 {
-    sal_uInt16 nCount = mpParent->ImplGetVisibleItemCount();
+    sal_uInt16 nCount = mpValueSet->ImplGetVisibleItemCount();
     // When the None-Item is visible then increase the number of items by
     // one.
     if (HasNoneField())
@@ -928,19 +928,19 @@ ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) 
const
     {
         if (nIndex == 0)
             // When present the first item is the then always visible none 
field.
-            pItem = mpParent->ImplGetItem (VALUESET_ITEM_NONEITEM);
+            pItem = mpValueSet->ImplGetItem(VALUESET_ITEM_NONEITEM);
         else
             // Shift down the index to compensate for the none field.
             nIndex -= 1;
     }
     if (pItem == nullptr)
-        pItem = mpParent->ImplGetItem (nIndex);
+        pItem = mpValueSet->ImplGetItem(nIndex);
 
     return pItem;
 }
 
 
-void ValueSetAcc::ThrowIfDisposed(bool bCheckParent)
+void ValueSetAcc::ThrowIfDisposed(bool bCheckValueSet)
 {
     if (m_bDisposed)
     {
@@ -950,17 +950,17 @@ void ValueSetAcc::ThrowIfDisposed(bool bCheckParent)
             getXWeak());
     }
 
-    if (bCheckParent && !mpParent)
+    if (bCheckValueSet && !mpValueSet)
     {
-        assert(false && "ValueSetAcc not disposed but mpParent == NULL");
-        throw css::uno::RuntimeException(u"ValueSetAcc not disposed but 
mpParent == NULL"_ustr);
+        assert(false && "ValueSetAcc not disposed but mpValueSet  == NULL");
+        throw css::uno::RuntimeException(u"ValueSetAcc not disposed but 
mpValueSet == NULL"_ustr);
     }
 }
 
 bool ValueSetAcc::HasNoneField() const
 {
-    assert(mpParent && "ValueSetAcc::HasNoneField called with mpParent==NULL");
-    return ((mpParent->GetStyle() & WB_NONEFIELD) != 0);
+    assert(mpValueSet && "ValueSetAcc::HasNoneField called with 
mpValueSet==NULL");
+    return ((mpValueSet->GetStyle() & WB_NONEFIELD) != 0);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/valueimp.hxx 
b/svtools/source/control/valueimp.hxx
index 89cfeb84f945..fb24c928168b 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -76,7 +76,7 @@ class ValueSetAcc final : public ValueSetAccComponentBase
 {
 public:
 
-    explicit ValueSetAcc(ValueSet* pParent);
+    explicit ValueSetAcc(ValueSet* pValueSet);
     virtual ~ValueSetAcc() override;
 
     void                FireAccessibleEvent( short nEventId, const 
css::uno::Any& rOldValue, const css::uno::Any& rNewValue );
@@ -139,7 +139,7 @@ public:
 private:
     ::std::vector< css::uno::Reference<
         css::accessibility::XAccessibleEventListener > >                
mxEventListeners;
-    ValueSet*                                                    mpParent;
+    ValueSet* mpValueSet;
     /// The current FOCUSED state.
     bool mbIsFocused;
 
@@ -168,11 +168,10 @@ private:
         DisposedException is thrown to inform the (indirect) caller of the
         foul deed.
         @param bCheckValueSet
-            Whether to also check that the ValueSet (parent)
-            is non-null.
+            Whether to also check that the ValueSet is non-null.
         @throws css::lang::DisposedException
     */
-    void ThrowIfDisposed(bool bCheckParent = true);
+    void ThrowIfDisposed(bool bCheckValueSet = true);
 
     /** Check whether the value set has a 'none' field, i.e. a field (button)
         that deselects any items (selects none of them).

Reply via email to