diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-11-09 16:58:00 +0000 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-11-09 22:15:23 +0100 |
commit | a73c98a708ee41b8c4cf4f2063c5bc4b30044284 (patch) | |
tree | 60a07b21bb004b14fbc87921cb458133d16ede8a /accessibility | |
parent | 7cf93f92cc3c6126c1cbe4ccef7ec3f76f1a6ca9 (diff) |
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
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/extended/textwindowaccessibility.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 1e2da2e970c3..f25c46cf64f3 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( |