[Libreoffice-commits] core.git: svx/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Apr 4 11:17:41 UTC 2018


 svx/source/accessibility/AccessibleTextHelper.cxx |   58 +++++-----------------
 1 file changed, 14 insertions(+), 44 deletions(-)

New commits:
commit 891e41fac81fbd8d5cdb277b26639abfd25a7143
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Apr 4 11:23:22 2018 +0200

    dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren
    
    ever since
        commit 60f11adb950e4f9645cc9ecb0f5af8235cc97366
        Date:   Wed Nov 27 13:03:45 2013 +0000
        Integrate branch of IAccessible2
    
    Change-Id: Ie175277badc07cf79eadbeef5a75857b914876d9
    Reviewed-on: https://gerrit.libreoffice.org/52370
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index 8f59f7ceee0d..9f1061bf0cac 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -757,58 +757,28 @@ namespace accessibility
         try
         {
             SvxTextForwarder& rCacheTF = GetTextForwarder();
-            SvxViewForwarder& rCacheVF = GetViewForwarder();
-
-            tools::Rectangle aViewArea = rCacheVF.GetVisArea();
-
-            if( IsActive() )
-            {
-                // maybe the edit view scrolls, adapt aViewArea
-                tools::Rectangle aEditViewArea = GetEditViewForwarder().GetVisArea();
-                aViewArea += aEditViewArea.TopLeft();
-
-                // now determine intersection
-                aViewArea.Intersection( aEditViewArea );
-            }
-
-            tools::Rectangle aTmpBB, aParaBB;
-            bool bFirstChild = true;
-            sal_Int32 nCurrPara;
             sal_Int32 nParas=rCacheTF.GetParagraphCount();
 
-            mnFirstVisibleChild = -1;
+            mnFirstVisibleChild = nParas ? 0 : -1;
             mnLastVisibleChild = -2;
 
-            for( nCurrPara=0; nCurrPara<nParas; ++nCurrPara )
+            if (mxFrontEnd.is() && bBroadcastEvents)
             {
-                DBG_ASSERT(nCurrPara >= 0,
-                           "AccessibleTextHelper_Impl::UpdateVisibleChildren: index value overflow");
-
-                aTmpBB = rCacheTF.GetParaBounds( nCurrPara );
-
-                // convert to screen coordinates
-                aParaBB = ::accessibility::AccessibleEditableTextPara::LogicToPixel( aTmpBB, rCacheTF.GetMapMode(), rCacheVF );
-                // at least partially visible
-                if( bFirstChild )
+                for( sal_Int32 nCurrPara=0; nCurrPara<nParas; ++nCurrPara )
                 {
-                    bFirstChild = false;
-                    mnFirstVisibleChild = nCurrPara;
-                }
-
-                mnLastVisibleChild = nCurrPara;
-
-                // child not yet created?
-                ::accessibility::AccessibleParaManager::WeakChild aChild( maParaManager.GetChild(nCurrPara) );
-                if( aChild.second.Width == 0 &&
-                    aChild.second.Height == 0 &&
-                    mxFrontEnd.is() &&
-                    bBroadcastEvents )
-                {
-                    GotPropertyEvent( uno::makeAny( maParaManager.CreateChild( nCurrPara - mnFirstVisibleChild,
-                                                                               mxFrontEnd, GetEditSource(), nCurrPara ).first ),
-                                      AccessibleEventId::CHILD );
+                    // child not yet created?
+                    ::accessibility::AccessibleParaManager::WeakChild aChild( maParaManager.GetChild(nCurrPara) );
+                    if( aChild.second.Width == 0 &&
+                        aChild.second.Height == 0 )
+                    {
+                        GotPropertyEvent( uno::makeAny( maParaManager.CreateChild( nCurrPara - mnFirstVisibleChild,
+                                                                                   mxFrontEnd, GetEditSource(), nCurrPara ).first ),
+                                          AccessibleEventId::CHILD );
+                    }
                 }
             }
+
+            mnLastVisibleChild = nParas - 1;
         }
         catch( const uno::Exception& )
         {


More information about the Libreoffice-commits mailing list