Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
874f2e53
Kaydet (Commit)
874f2e53
authored
Şub 03, 2012
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
WrongList::TextInserted: fix STL crash
vector iterators and insert don't mix well (regression from
dfbf0cab
)
üst
aa233337
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
edtspell.cxx
editeng/source/editeng/edtspell.cxx
+20
-17
No files found.
editeng/source/editeng/edtspell.cxx
Dosyayı görüntüle @
874f2e53
...
...
@@ -242,48 +242,51 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 nNew, sal_Bool bPosIsS
nInvalidEnd
=
nPos
+
nNew
;
}
for
(
WrongList
::
iterator
i
=
begin
();
i
!=
end
();
++
i
)
for
(
WrongList
::
size_type
i
=
0
;
i
<
size
();
++
i
)
{
WrongRange
&
rWrong
=
(
*
this
)[
i
];
// why does this thing derive vector?
sal_Bool
bRefIsValid
=
sal_True
;
if
(
i
->
nEnd
>=
nPos
)
if
(
rWrong
.
nEnd
>=
nPos
)
{
// Move all Wrongs after the insert position...
if
(
i
->
nStart
>
nPos
)
if
(
rWrong
.
nStart
>
nPos
)
{
i
->
nStart
+=
nNew
;
i
->
nEnd
+=
nNew
;
rWrong
.
nStart
+=
nNew
;
rWrong
.
nEnd
+=
nNew
;
}
// 1: Starts before and goes until nPos...
else
if
(
i
->
nEnd
==
nPos
)
else
if
(
rWrong
.
nEnd
==
nPos
)
{
// Should be halted at a blank!
if
(
!
bPosIsSep
)
i
->
nEnd
+=
nNew
;
rWrong
.
nEnd
+=
nNew
;
}
// 2: Starts before and goes until after nPos...
else
if
(
i
->
nStart
<
nPos
&&
i
->
nEnd
>
nPos
)
else
if
(
(
rWrong
.
nStart
<
nPos
)
&&
(
rWrong
.
nEnd
>
nPos
)
)
{
i
->
nEnd
+=
nNew
;
rWrong
.
nEnd
+=
nNew
;
// When a separator remove and re-examine the Wrong
if
(
bPosIsSep
)
{
// Split Wrong...
WrongRange
aNewWrong
(
i
->
nStart
,
nPos
);
i
->
nStart
=
nPos
+
1
;
insert
(
i
,
aNewWrong
);
bRefIsValid
=
sal_False
;
// Reference no longer valid after Insert, the other was inserted in front of this position
WrongRange
aNewWrong
(
rWrong
.
nStart
,
nPos
);
rWrong
.
nStart
=
nPos
+
1
;
insert
(
begin
()
+
i
,
aNewWrong
);
// Reference no longer valid after Insert, the other
// was inserted in front of this position
bRefIsValid
=
false
;
++
i
;
// Not this again...
}
}
// 3: Attribute starts at position ..
else
if
(
i
->
nStart
==
nPos
)
else
if
(
rWrong
.
nStart
==
nPos
)
{
i
->
nEnd
+=
nNew
;
rWrong
.
nEnd
+=
nNew
;
if
(
bPosIsSep
)
++
(
i
->
nStart
);
++
(
rWrong
.
nStart
);
}
}
SAL_WARN_IF
(
bRefIsValid
&&
i
->
nStart
>=
i
->
nEnd
,
"editeng"
,
SAL_WARN_IF
(
bRefIsValid
&&
rWrong
.
nStart
>=
rWrong
.
nEnd
,
"editeng"
,
"TextInserted, WrongRange: Start >= End?!"
);
(
void
)
bRefIsValid
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment