You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ha...@apache.org on 2015/03/24 18:05:34 UTC
svn commit: r1668939 - in /openoffice/trunk/main/svtools:
inc/svtools/treelist.hxx source/contnr/svtreebx.cxx
Author: hanya
Date: Tue Mar 24 17:05:34 2015
New Revision: 1668939
URL: http://svn.apache.org/r1668939
Log:
#i125147# check the pointer while get accessible state set
Modified:
openoffice/trunk/main/svtools/inc/svtools/treelist.hxx
openoffice/trunk/main/svtools/source/contnr/svtreebx.cxx
Modified: openoffice/trunk/main/svtools/inc/svtools/treelist.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/inc/svtools/treelist.hxx?rev=1668939&r1=1668938&r2=1668939&view=diff
==============================================================================
--- openoffice/trunk/main/svtools/inc/svtools/treelist.hxx (original)
+++ openoffice/trunk/main/svtools/inc/svtools/treelist.hxx Tue Mar 24 17:05:34 2015
@@ -411,14 +411,14 @@ inline sal_Bool SvListView::IsSelected(
DBG_ASSERT(pEntry,"IsExpanded:No Entry");
SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pData,"Entry not in Table");
- return pData->IsSelected();
+ return pData && pData->IsSelected();
}
inline sal_Bool SvListView::HasEntryFocus( SvListEntry* pEntry ) const
{
DBG_ASSERT(pEntry,"IsExpanded:No Entry");
SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pData,"Entry not in Table");
- return pData->HasFocus();
+ return pData && pData->HasFocus();
}
inline void SvListView::SetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus ) const
{
Modified: openoffice/trunk/main/svtools/source/contnr/svtreebx.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/source/contnr/svtreebx.cxx?rev=1668939&r1=1668938&r2=1668939&view=diff
==============================================================================
--- openoffice/trunk/main/svtools/source/contnr/svtreebx.cxx (original)
+++ openoffice/trunk/main/svtools/source/contnr/svtreebx.cxx Tue Mar 24 17:05:34 2015
@@ -2757,32 +2757,32 @@ void SvTreeListBox::FillAccessibleEntryS
{
DBG_ASSERT( pEntry, "SvTreeListBox::FillAccessibleEntryStateSet: invalid entry" );
- if ( pEntry->HasChildsOnDemand() || pEntry->HasChilds() )
- {
- rStateSet.AddState( AccessibleStateType::EXPANDABLE );
- if ( IsExpanded( pEntry ) )
- rStateSet.AddState( (sal_Int16)AccessibleStateType::EXPANDED );
- }
+ if ( pEntry )
+ {
+ if ( pEntry->HasChildsOnDemand() || pEntry->HasChilds() )
+ {
+ rStateSet.AddState( AccessibleStateType::EXPANDABLE );
+ if ( IsExpanded( pEntry ) )
+ rStateSet.AddState( (sal_Int16)AccessibleStateType::EXPANDED );
+ }
- if ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED )
- rStateSet.AddState( AccessibleStateType::CHECKED );
- if ( IsEntryVisible( pEntry ) )
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- if ( IsSelected( pEntry ) )
- rStateSet.AddState( AccessibleStateType::SELECTED );
- if ( IsEnabled() )
- {
- rStateSet.AddState( AccessibleStateType::ENABLED );
- rStateSet.AddState( AccessibleStateType::FOCUSABLE );
- rStateSet.AddState( AccessibleStateType::SELECTABLE );
- SvViewDataEntry* pViewDataNewCur = 0;
- if( pEntry )
- {
- pViewDataNewCur= GetViewDataEntry(pEntry);
- if(pViewDataNewCur->HasFocus())
- rStateSet.AddState( AccessibleStateType::FOCUSED );
- }
- }
+ if ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED )
+ rStateSet.AddState( AccessibleStateType::CHECKED );
+ if ( IsEntryVisible( pEntry ) )
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ if ( IsSelected( pEntry ) )
+ rStateSet.AddState( AccessibleStateType::SELECTED );
+ if ( IsEnabled() )
+ {
+ rStateSet.AddState( AccessibleStateType::ENABLED );
+ rStateSet.AddState( AccessibleStateType::FOCUSABLE );
+ rStateSet.AddState( AccessibleStateType::SELECTABLE );
+ SvViewDataEntry* pViewDataNewCur = 0;
+ pViewDataNewCur = GetViewDataEntry(pEntry);
+ if( pViewDataNewCur && pViewDataNewCur->HasFocus() )
+ rStateSet.AddState( AccessibleStateType::FOCUSED );
+ }
+ }
}
Rectangle SvTreeListBox::GetBoundingRect( SvLBoxEntry* pEntry )