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
03e96dd2
Kaydet (Commit)
03e96dd2
authored
Nis 14, 2014
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
toupper YMD for better input check visibility
Change-Id: I24a01860bd019c3bf6e36c1e9df16e6ae6aa0ace
üst
625c595f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
+35
-4
optgdlg.cxx
cui/source/options/optgdlg.cxx
+35
-4
No files found.
cui/source/options/optgdlg.cxx
Dosyayı görüntüle @
03e96dd2
...
@@ -1668,13 +1668,16 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox )
...
@@ -1668,13 +1668,16 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox )
IMPL_LINK
(
OfaLanguagesTabPage
,
DatePatternsHdl
,
Edit
*
,
pEd
)
IMPL_LINK
(
OfaLanguagesTabPage
,
DatePatternsHdl
,
Edit
*
,
pEd
)
{
{
OUString
aPatterns
(
pEd
->
GetText
());
const
OUString
aPatterns
(
pEd
->
GetText
());
OUStringBuffer
aBuf
(
aPatterns
);
sal_Int32
nChar
=
0
;
bool
bValid
=
true
;
bool
bValid
=
true
;
bool
bModified
=
false
;
if
(
!
aPatterns
.
isEmpty
())
if
(
!
aPatterns
.
isEmpty
())
{
{
for
(
sal_Int32
nIndex
=
0
;
nIndex
>=
0
&&
bValid
;
/*nop*/
)
for
(
sal_Int32
nIndex
=
0
;
nIndex
>=
0
&&
bValid
;
++
nChar
)
{
{
OUString
aPat
(
aPatterns
.
getToken
(
0
,
';'
,
nIndex
));
const
OUString
aPat
(
aPatterns
.
getToken
(
0
,
';'
,
nIndex
));
if
(
aPat
.
isEmpty
()
&&
nIndex
<
0
)
if
(
aPat
.
isEmpty
()
&&
nIndex
<
0
)
{
{
// Indicating failure when about to append a pattern is too
// Indicating failure when about to append a pattern is too
...
@@ -1691,37 +1694,65 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, pEd )
...
@@ -1691,37 +1694,65 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, pEd )
bool
bSep
=
true
;
bool
bSep
=
true
;
for
(
sal_Int32
i
=
0
;
i
<
aPat
.
getLength
()
&&
bValid
;
/*nop*/
)
for
(
sal_Int32
i
=
0
;
i
<
aPat
.
getLength
()
&&
bValid
;
/*nop*/
)
{
{
sal_uInt32
c
=
aPat
.
iterateCodePoints
(
&
i
);
const
sal_Int32
j
=
i
;
const
sal_uInt32
c
=
aPat
.
iterateCodePoints
(
&
i
);
// Only one Y,M,D per pattern, separated by any character(s).
// Only one Y,M,D per pattern, separated by any character(s).
switch
(
c
)
switch
(
c
)
{
{
case
'y'
:
case
'Y'
:
case
'Y'
:
if
(
bY
||
!
bSep
)
if
(
bY
||
!
bSep
)
bValid
=
false
;
bValid
=
false
;
else
if
(
c
==
'y'
)
{
aBuf
[
nChar
]
=
'Y'
;
bModified
=
true
;
}
bY
=
true
;
bY
=
true
;
bSep
=
false
;
bSep
=
false
;
break
;
break
;
case
'm'
:
case
'M'
:
case
'M'
:
if
(
bM
||
!
bSep
)
if
(
bM
||
!
bSep
)
bValid
=
false
;
bValid
=
false
;
else
if
(
c
==
'm'
)
{
aBuf
[
nChar
]
=
'M'
;
bModified
=
true
;
}
bM
=
true
;
bM
=
true
;
bSep
=
false
;
bSep
=
false
;
break
;
break
;
case
'd'
:
case
'D'
:
case
'D'
:
if
(
bD
||
!
bSep
)
if
(
bD
||
!
bSep
)
bValid
=
false
;
bValid
=
false
;
else
if
(
c
==
'd'
)
{
aBuf
[
nChar
]
=
'D'
;
bModified
=
true
;
}
bD
=
true
;
bD
=
true
;
bSep
=
false
;
bSep
=
false
;
break
;
break
;
default
:
default
:
bSep
=
true
;
bSep
=
true
;
}
}
nChar
+=
i
-
j
;
}
}
// At least one of Y,M,D
// At least one of Y,M,D
bValid
&=
(
bY
||
bM
||
bD
);
bValid
&=
(
bY
||
bM
||
bD
);
}
}
}
}
}
}
if
(
bModified
)
{
// Do not use SetText(...,GetSelection()) because internally the
// reference's pointer of the selection is obtained resulting in the
// entire text being selected at the end.
Selection
aSelection
(
pEd
->
GetSelection
());
pEd
->
SetText
(
aBuf
.
makeStringAndClear
(),
aSelection
);
}
if
(
bValid
)
if
(
bValid
)
{
{
pEd
->
SetControlForeground
();
pEd
->
SetControlForeground
();
...
...
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