accessibility/source/extended/textwindowaccessibility.cxx |   22 +++++++-------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit a73c98a708ee41b8c4cf4f2063c5bc4b30044284
Author: Michael Meeks <michael.me...@suse.com>
Date:   Fri Nov 9 16:58:00 2012 +0000

    Better fix for fdo#56473, Crash when inserting a simple macro
    
    old code used to use XCell->setString, new code uses rDoc.SetString which 
by default tries to detect number formats. The ScColumn::SetString that 
eventually
    gets called seems to do lots of additional checks ( and apparently even if
    an ScSetStringParam instance with mbDetectNumberFormat ( false ) was passed
    it seems that it will still try to detect decimal number formats. With that
    in mind I restore and un-unoified version of what XCell->setString used do
    
    Change-Id: Ifaef74c78b198f492a390a3d5dc1721622a01ea4

diff --git a/accessibility/source/extended/textwindowaccessibility.cxx 
b/accessibility/source/extended/textwindowaccessibility.cxx
index 1e2da2e..f25c46c 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include <accessibility/extended/textwindowaccessibility.hxx>
 #include "comphelper/accessibleeventnotifier.hxx"
 #include "unotools/accessiblerelationsethelper.hxx"
@@ -2124,18 +2123,19 @@ void Document::handleSelectionChangeNotification()
 
 void Document::notifySelectionChange( sal_Int32 nFirst, sal_Int32 nLast )
 {
-    if ( nFirst < nLast )
+    nFirst = std::max( nFirst, sal_Int32( 0 ) );
+    nLast = std::min( nLast, sal_Int32( m_xParagraphs->size() ) );
+    Paragraphs::iterator iFirst(m_xParagraphs->begin() + nFirst);
+    Paragraphs::iterator iLast(m_xParagraphs->begin() + nLast);
+    if ( iFirst < m_aVisibleBegin )
+        iFirst = m_aVisibleBegin;
+    if ( iLast > m_aVisibleEnd )
+        iLast = m_aVisibleEnd;
+    if ( iFirst < iLast )
     {
-        Paragraphs::iterator aItBound1 = m_xParagraphs->begin();
-        for (sal_Int32 i = 0; i < nLast  && aItBound1 !=  m_xParagraphs->end() 
; ++aItBound1, ++i);
-        Paragraphs::iterator aEnd( ::std::min( aItBound1, m_aVisibleEnd ) );
-
-        Paragraphs::iterator aItBound2 = m_xParagraphs->begin();
-        for (sal_Int32 i = 0; i < nFirst && aItBound2 !=  m_xParagraphs->end() 
; ++aItBound2, ++i);
-
-        for ( Paragraphs::iterator aIt = ::std::max( aItBound2, 
m_aVisibleBegin ); aIt != aEnd; ++aIt )
+        for ( Paragraphs::iterator i = iFirst; i != iLast; i++ )
         {
-            ::rtl::Reference< ParagraphImpl > xParagraph( getParagraph( aIt ) 
);
+            ::rtl::Reference< ParagraphImpl > xParagraph( getParagraph( i ) );
             if ( xParagraph.is() )
             {
                 xParagraph->notifyEvent(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to