summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-10-28 01:57:34 +0200
committerJulien Nabet <serval2412@yahoo.fr>2012-10-28 09:46:29 +0100
commitbf7240d0676b4350892e01fa8c1ba5eb6a3913c6 (patch)
treef83b9fe2f956936b363ce2af02fcd4912dd0e33f /accessibility
parentcf0453d94b1af305ee385e9e2522bcc5e589530e (diff)
Resolves: fdo#56473 IDE: Crash when inserting a simple macro
Change-Id: I7bb6fe0005b9afa2d853a13a30d5b0c48ba8bdf2
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 9f48b1a1ae2c..620ff0f0aa09 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -2126,8 +2126,14 @@ void Document::notifySelectionChange( sal_Int32 nFirst, sal_Int32 nLast )
{
if ( nFirst < nLast )
{
- Paragraphs::iterator aEnd( ::std::min( m_xParagraphs->begin() + nLast, m_aVisibleEnd ) );
- for ( Paragraphs::iterator aIt = ::std::max( m_xParagraphs->begin() + nFirst, m_aVisibleBegin ); aIt < aEnd; ++aIt )
+ Paragraphs::iterator aItBound1 = m_xParagraphs->begin();
+ for (sal_Int32 i = 0; i < nLast && aItBound1 != m_xParagraphs->end() ; ++aItBound1);
+ 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);
+
+ for ( Paragraphs::iterator aIt = ::std::max( aItBound2, m_aVisibleBegin ); aIt != aEnd; ++aIt )
{
::rtl::Reference< ParagraphImpl > xParagraph( getParagraph( aIt ) );
if ( xParagraph.is() )