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
9107bb35
Kaydet (Commit)
9107bb35
authored
Nis 20, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sanitize strings with invalid high/low surrogate sequences
Change-Id: I9ad1aa651b6971526dd924630fe5606b7632f2dc
üst
de4c419c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
ww8par3.cxx
sw/source/filter/ww8/ww8par3.cxx
+27
-1
No files found.
sw/source/filter/ww8/ww8par3.cxx
Dosyayı görüntüle @
9107bb35
...
...
@@ -79,6 +79,7 @@
#include <IMark.hxx>
#include <unotools/fltrcfg.hxx>
#include <rtl/surrogates.h>
#include <xmloff/odffields.hxx>
#include <stdio.h>
...
...
@@ -493,6 +494,31 @@ static void lcl_CopyGreaterEight(OUString &rDest, OUString &rSrc,
}
}
OUString
sanitizeString
(
const
OUString
&
rString
)
{
sal_Int32
i
=
0
;
while
(
i
<
rString
.
getLength
())
{
sal_Unicode
c
=
rString
[
i
];
if
(
isHighSurrogate
(
c
))
{
if
(
i
+
1
==
rString
.
getLength
()
||
!
isLowSurrogate
(
rString
[
i
+
1
]))
{
SAL_WARN
(
"sw.ww8"
,
"Surrogate error: high without low"
);
return
rString
.
copy
(
0
,
i
);
}
++
i
;
//skip correct low
}
if
(
isLowSurrogate
(
c
))
//bare low without preceeding high
{
SAL_WARN
(
"sw.ww8"
,
"Surrogate error: low without high"
);
return
rString
.
copy
(
0
,
i
);
}
++
i
;
}
return
rString
;
}
bool
WW8ListManager
::
ReadLVL
(
SwNumFmt
&
rNumFmt
,
SfxItemSet
*&
rpItemSet
,
sal_uInt16
nLevelStyle
,
bool
bSetStartNo
,
std
::
deque
<
bool
>
&
rNotReallyThere
,
sal_uInt16
nLevel
,
...
...
@@ -703,7 +729,7 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
// 4. den Nummerierungsstring einlesen: ergibt Prefix und Postfix
OUString
sNumString
(
read_uInt16_PascalString
(
rSt
));
OUString
sNumString
(
sanitizeString
(
read_uInt16_PascalString
(
rSt
)
));
// 5. gelesene Werte in Writer Syntax umwandeln
...
...
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