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
21052ba2
Kaydet (Commit)
21052ba2
authored
Eki 27, 2017
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Allow decimalSeparatorAlternative in cclass_unicode::parseText(), tdf#81671
Change-Id: I0469027951e68d3c08f40c236db3865edbdaa3e0
üst
922a94f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
cclass_unicode.hxx
i18npool/inc/cclass_unicode.hxx
+1
-0
cclass_unicode_parser.cxx
.../source/characterclassification/cclass_unicode_parser.cxx
+13
-5
No files found.
i18npool/inc/cclass_unicode.hxx
Dosyayı görüntüle @
21052ba2
...
...
@@ -138,6 +138,7 @@ private:
ScanState
eState
;
sal_Unicode
cGroupSep
;
sal_Unicode
cDecimalSep
;
sal_Unicode
cDecimalSepAlt
;
/// Get corresponding KParseTokens flag for a character
static
sal_Int32
getParseTokensType
(
sal_uInt32
c
,
bool
isFirst
);
...
...
i18npool/source/characterclassification/cclass_unicode_parser.cxx
Dosyayı görüntüle @
21052ba2
...
...
@@ -433,18 +433,21 @@ void cclass_Unicode::initParserTable( const Locale& rLocale, sal_Int32 startChar
// specials
if
(
mxLocaleData
.
is
()
)
{
LocaleDataItem
aItem
=
mxLocaleData
->
getLocaleItem
(
aParserLocale
);
LocaleDataItem
2
aItem
=
mxLocaleData
->
getLocaleItem
2
(
aParserLocale
);
//!TODO: theoretically separators may be a string, adjustment would have to be
//! done here and in parsing and in ::rtl::math::stringToDouble()
cGroupSep
=
aItem
.
thousandSeparator
[
0
];
cDecimalSep
=
aItem
.
decimalSeparator
[
0
];
cDecimalSepAlt
=
aItem
.
decimalSeparatorAlternative
.
toChar
();
}
if
(
cGroupSep
<
nDefCnt
)
pTable
[
cGroupSep
]
|=
ParserFlags
::
VALUE
;
if
(
cDecimalSep
<
nDefCnt
)
pTable
[
cDecimalSep
]
|=
ParserFlags
::
CHAR_VALUE
|
ParserFlags
::
VALUE
;
if
(
cDecimalSepAlt
&&
cDecimalSepAlt
<
nDefCnt
)
pTable
[
cDecimalSepAlt
]
|=
ParserFlags
::
CHAR_VALUE
|
ParserFlags
::
VALUE
;
// Modify characters according to KParseTokens definitions.
{
...
...
@@ -593,6 +596,8 @@ ParserFlags cclass_Unicode::getFlagsExtended(sal_uInt32 const c)
return
ParserFlags
::
VALUE
;
else
if
(
c
==
cDecimalSep
)
return
ParserFlags
::
CHAR_VALUE
|
ParserFlags
::
VALUE
;
else
if
(
cDecimalSepAlt
&&
c
==
cDecimalSepAlt
)
return
ParserFlags
::
CHAR_VALUE
|
ParserFlags
::
VALUE
;
bool
bStart
=
(
eState
==
ssGetChar
||
eState
==
ssGetWordFirstChar
||
eState
==
ssRewindFromValue
||
eState
==
ssIgnoreLeadingInRewind
);
sal_Int32
nTypes
=
(
bStart
?
nStartTypes
:
nContTypes
);
...
...
@@ -704,6 +709,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
bool
bQuote
=
false
;
bool
bMightBeWord
=
true
;
bool
bMightBeWordLast
=
true
;
bool
bDecSepAltUsed
=
false
;
//! All the variables above (plus ParseResult) have to be resetted on ssRewindFromValue!
sal_Int32
nextCharIndex
(
nPos
);
// == index of nextChar
...
...
@@ -743,7 +749,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
else
r
.
TokenType
=
KParseType
::
ASC_NUMBER
;
}
else
if
(
current
==
cDecimalSep
)
else
if
(
current
==
cDecimalSep
||
(
bDecSepAltUsed
=
(
cDecimalSepAlt
&&
current
==
cDecimalSep
))
)
{
if
(
nextChar
)
++
nDecSeps
;
...
...
@@ -812,7 +818,8 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
}
if
(
nMask
&
ParserFlags
::
VALUE
)
{
if
(
current
==
cDecimalSep
&&
++
nDecSeps
>
1
)
if
((
current
==
cDecimalSep
||
(
bDecSepAltUsed
=
(
cDecimalSepAlt
&&
current
==
cDecimalSepAlt
)))
&&
++
nDecSeps
>
1
)
{
if
(
nCodePoints
==
2
)
eState
=
ssRewindFromValue
;
...
...
@@ -954,6 +961,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
bQuote
=
false
;
bMightBeWord
=
true
;
bMightBeWordLast
=
true
;
bDecSepAltUsed
=
false
;
}
else
{
...
...
@@ -1001,7 +1009,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
if
(
r
.
TokenType
&
KParseType
::
ASC_NUMBER
)
{
r
.
Value
=
rtl_math_uStringToDouble
(
rText
.
getStr
()
+
nPos
+
r
.
LeadingWhiteSpace
,
rText
.
getStr
()
+
r
.
EndPos
,
cDecimalSep
,
cGroupSep
,
nullptr
,
nullptr
);
rText
.
getStr
()
+
r
.
EndPos
,
(
bDecSepAltUsed
?
cDecimalSepAlt
:
cDecimalSep
)
,
cGroupSep
,
nullptr
,
nullptr
);
if
(
bMightBeWord
)
r
.
TokenType
|=
KParseType
::
IDENTNAME
;
}
...
...
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