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
a9d9b1e0
Kaydet (Commit)
a9d9b1e0
authored
Eyl 16, 2015
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use positioned getToken in ScAsciiOptions::ReadFromString (1)
Change-Id: I59f1ff177e197db07ac9a9a33487d04c2a5e768e
üst
1353be80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
33 deletions
+26
-33
asciiopt.cxx
sc/source/ui/dbgui/asciiopt.cxx
+26
-33
No files found.
sc/source/ui/dbgui/asciiopt.cxx
Dosyayı görüntüle @
a9d9b1e0
...
@@ -197,49 +197,45 @@ static OUString lcl_decodeSepString( const OUString & rSepNums, bool & o_bMergeF
...
@@ -197,49 +197,45 @@ static OUString lcl_decodeSepString( const OUString & rSepNums, bool & o_bMergeF
void
ScAsciiOptions
::
ReadFromString
(
const
OUString
&
rString
)
void
ScAsciiOptions
::
ReadFromString
(
const
OUString
&
rString
)
{
{
sal_Int32
nCount
=
comphelper
::
string
::
getTokenCount
(
rString
,
','
);
sal_Int32
nPos
=
rString
.
isEmpty
()
?
-
1
:
0
;
OUString
aToken
;
// Field separator.
//
Token 0:
Field separator.
if
(
n
Count
>=
1
)
if
(
n
Pos
>=
0
)
{
{
bFixedLen
=
bMergeFieldSeps
=
false
;
bFixedLen
=
bMergeFieldSeps
=
false
;
aToken
=
rString
.
getToken
(
0
,
','
);
const
OUString
aToken
=
rString
.
getToken
(
0
,
','
,
nPos
);
if
(
aToken
==
pStrFix
)
if
(
aToken
==
pStrFix
)
bFixedLen
=
true
;
bFixedLen
=
true
;
aFieldSeps
=
lcl_decodeSepString
(
aToken
,
bMergeFieldSeps
);
aFieldSeps
=
lcl_decodeSepString
(
aToken
,
bMergeFieldSeps
);
}
}
// Text separator.
// T
oken 1: T
ext separator.
if
(
n
Count
>=
2
)
if
(
n
Pos
>=
0
)
{
{
aToken
=
rString
.
getToken
(
1
,
','
);
const
sal_Int32
nVal
=
rString
.
getToken
(
0
,
','
,
nPos
).
toInt32
();
sal_Int32
nVal
=
aToken
.
toInt32
();
cTextSep
=
static_cast
<
sal_Unicode
>
(
nVal
);
cTextSep
=
(
sal_Unicode
)
nVal
;
}
}
// Text encoding.
// T
oken 2: T
ext encoding.
if
(
n
Count
>=
3
)
if
(
n
Pos
>=
0
)
{
{
aToken
=
rString
.
getToken
(
2
,
','
);
eCharSet
=
ScGlobal
::
GetCharsetValue
(
rString
.
getToken
(
0
,
','
,
nPos
)
);
eCharSet
=
ScGlobal
::
GetCharsetValue
(
aToken
);
}
}
// Number of start row.
//
Token 3:
Number of start row.
if
(
n
Count
>=
4
)
if
(
n
Pos
>=
0
)
{
{
aToken
=
rString
.
getToken
(
3
,
','
);
nStartRow
=
rString
.
getToken
(
0
,
','
,
nPos
).
toInt32
();
nStartRow
=
aToken
.
toInt32
();
}
}
// Column info.
//
Token 4:
Column info.
if
(
n
Count
>=
5
)
if
(
n
Pos
>=
0
)
{
{
delete
[]
pColStart
;
delete
[]
pColStart
;
delete
[]
pColFormat
;
delete
[]
pColFormat
;
aToken
=
rString
.
getToken
(
4
,
','
);
const
OUString
aToken
=
rString
.
getToken
(
0
,
','
,
nPos
);
sal_Int32
nSub
=
comphelper
::
string
::
getTokenCount
(
aToken
,
'/'
);
sal_Int32
nSub
=
comphelper
::
string
::
getTokenCount
(
aToken
,
'/'
);
nInfoCount
=
nSub
/
2
;
nInfoCount
=
nSub
/
2
;
if
(
nInfoCount
)
if
(
nInfoCount
)
...
@@ -259,25 +255,22 @@ void ScAsciiOptions::ReadFromString( const OUString& rString )
...
@@ -259,25 +255,22 @@ void ScAsciiOptions::ReadFromString( const OUString& rString )
}
}
}
}
//
Language
//
Token 5: Language.
if
(
n
Count
>=
6
)
if
(
n
Pos
>=
0
)
{
{
aToken
=
rString
.
getToken
(
5
,
','
);
eLang
=
static_cast
<
LanguageType
>
(
rString
.
getToken
(
0
,
','
,
nPos
).
toInt32
());
eLang
=
static_cast
<
LanguageType
>
(
aToken
.
toInt32
());
}
}
// Import quoted field as text.
//
Token 6:
Import quoted field as text.
if
(
n
Count
>=
7
)
if
(
n
Pos
>=
0
)
{
{
aToken
=
rString
.
getToken
(
6
,
','
);
bQuotedFieldAsText
=
rString
.
getToken
(
0
,
','
,
nPos
)
==
"true"
;
bQuotedFieldAsText
=
aToken
==
"true"
;
}
}
// Detect special numbers.
//
Token 7:
Detect special numbers.
if
(
n
Count
>=
8
)
if
(
n
Pos
>=
0
)
{
{
aToken
=
rString
.
getToken
(
7
,
','
);
bDetectSpecialNumber
=
rString
.
getToken
(
0
,
','
,
nPos
)
==
"true"
;
bDetectSpecialNumber
=
aToken
==
"true"
;
}
}
else
else
bDetectSpecialNumber
=
true
;
// default of versions that didn't add the parameter
bDetectSpecialNumber
=
true
;
// default of versions that didn't add the parameter
...
...
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