From df79717d978ab642e50aa5c8034e2b6afab99e1f Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 15 Apr 2008 12:03:30 +0000 Subject: INTEGRATION: CWS aqua11y01 (1.2.26); FILE MERGED 2007/12/18 13:39:33 fne 1.2.26.1: #i82877# retrieve visible line count dynamically ( was general problem ) --- .../accessibility/standard/vclxaccessiblelist.hxx | 3 +- .../source/standard/vclxaccessiblelist.cxx | 36 ++++++++++++++-------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx index 979ec905a..1130a5bd2 100644 --- a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx +++ b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: vclxaccessiblelist.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -224,6 +224,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxNewAcc); private: void notifyVisibleStates(sal_Bool _bSetNew ); + void UpdateVisibleLineCount(); }; #endif diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 6369f5b79..658039398 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: vclxaccessiblelist.cxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -95,18 +95,7 @@ VCLXAccessibleList::VCLXAccessibleList (VCLXWindow* pVCLWindow, BoxType aBoxType break; } } - if ( m_pListBoxHelper ) - { - if ( (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN ) - m_nVisibleLineCount = m_pListBoxHelper->GetDisplayLineCount(); - else - { - USHORT nCols = 0, - nLines = 0; - m_pListBoxHelper->GetMaxVisColumnsAndLines (nCols, nLines); - m_nVisibleLineCount = nLines; - } - } + UpdateVisibleLineCount(); USHORT nCount = static_cast(getAccessibleChildCount()); m_aAccessibleChildren.reserve(nCount); @@ -187,6 +176,7 @@ void VCLXAccessibleList::notifyVisibleStates(sal_Bool _bSetNew ) ListItems::iterator aIter = m_aAccessibleChildren.begin(); ListItems::iterator aEnd = m_aAccessibleChildren.end(); + UpdateVisibleLineCount(); // adjust the index inside the VCLXAccessibleListItem for (;aIter != aEnd ; ++aIter) { @@ -353,6 +343,7 @@ Reference VCLXAccessibleList::CreateChild (sal_Int32 i) pItem->SetSelected( bNowSelected ); // Set the child's VISIBLE state. + UpdateVisibleLineCount(); USHORT nTopEntry = 0; if ( m_pListBoxHelper ) nTopEntry = m_pListBoxHelper->GetTopEntry(); @@ -499,6 +490,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleList::getAccessibleAt( const awt Reference< XAccessible > xChild; if ( m_pListBoxHelper ) { + UpdateVisibleLineCount(); if ( contains( rPoint ) && m_nVisibleLineCount > 0 ) { Point aPos = VCLPoint( rPoint ); @@ -537,6 +529,23 @@ Sequence< ::rtl::OUString > VCLXAccessibleList::getSupportedServiceNames (void) return aNames; } // ----------------------------------------------------------------------------- + +void VCLXAccessibleList::UpdateVisibleLineCount() +{ + if ( m_pListBoxHelper ) + { + if ( (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN ) + m_nVisibleLineCount = m_pListBoxHelper->GetDisplayLineCount(); + else + { + USHORT nCols = 0, + nLines = 0; + m_pListBoxHelper->GetMaxVisColumnsAndLines (nCols, nLines); + m_nVisibleLineCount = nLines; + } + } +} + // ----------------------------------------------------------------------------- void VCLXAccessibleList::UpdateEntryRange_Impl() { @@ -549,6 +558,7 @@ void VCLXAccessibleList::UpdateEntryRange_Impl() nTop = m_pListBoxHelper->GetTopEntry(); if ( nTop != m_nLastTopEntry ) { + UpdateVisibleLineCount(); sal_Int32 nBegin = Min( m_nLastTopEntry, nTop ); sal_Int32 nEnd = Max( m_nLastTopEntry + m_nVisibleLineCount, nTop + m_nVisibleLineCount ); for (USHORT i = static_cast(nBegin); (i <= static_cast(nEnd)); ++i) -- cgit v1.2.3