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
2c1c0168
Kaydet (Commit)
2c1c0168
authored
Eyl 08, 2018
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid getTokenCount()
Change-Id: Idb1eff48c33a8bd9c5119c1caa6ee01202d1d374
üst
41bcf613
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
36 deletions
+24
-36
scuiimoptdlg.cxx
sc/source/ui/dbgui/scuiimoptdlg.cxx
+24
-36
No files found.
sc/source/ui/dbgui/scuiimoptdlg.cxx
Dosyayı görüntüle @
2c1c0168
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#include <scresid.hxx>
#include <scresid.hxx>
#include <strings.hrc>
#include <strings.hrc>
#include <strings.hxx>
#include <strings.hxx>
#include <comphelper/string.hxx>
#include <officecfg/Office/Calc.hxx>
#include <officecfg/Office/Calc.hxx>
#include <osl/thread.h>
#include <osl/thread.h>
#include <rtl/tencinfo.h>
#include <rtl/tencinfo.h>
...
@@ -36,65 +35,54 @@ class ScDelimiterTable
...
@@ -36,65 +35,54 @@ class ScDelimiterTable
public
:
public
:
explicit
ScDelimiterTable
(
const
OUString
&
rDelTab
)
explicit
ScDelimiterTable
(
const
OUString
&
rDelTab
)
:
theDelTab
(
rDelTab
),
:
theDelTab
(
rDelTab
),
nCount
(
comphelper
::
string
::
getTokenCount
(
rDelTab
,
'\t'
)
),
nDelIdx
(
0
)
nIter
(
0
)
{}
{}
sal_uInt16
GetCode
(
const
OUString
&
rDelimiter
)
const
;
sal_uInt16
GetCode
(
const
OUString
&
rDelimiter
)
const
;
OUString
GetDelimiter
(
sal_Unicode
nCode
)
const
;
OUString
GetDelimiter
(
sal_Unicode
nCode
)
const
;
OUString
FirstDel
()
{
n
Iter
=
0
;
return
theDelTab
.
getToken
(
nIter
,
cSep
);
}
OUString
FirstDel
()
{
n
DelIdx
=
0
;
return
theDelTab
.
getToken
(
0
,
cSep
,
nDelIdx
);
}
OUString
NextDel
()
{
nIter
+=
2
;
return
theDelTab
.
getToken
(
nIter
,
cSep
);
}
OUString
NextDel
()
{
return
theDelTab
.
getToken
(
1
,
cSep
,
nDelIdx
);
}
private
:
private
:
const
OUString
theDelTab
;
const
OUString
theDelTab
;
static
const
sal_Unicode
cSep
=
'\t'
;
static
constexpr
sal_Unicode
cSep
{
'\t'
};
const
sal_Int32
nCount
;
sal_Int32
nDelIdx
;
sal_Int32
nIter
;
};
};
sal_uInt16
ScDelimiterTable
::
GetCode
(
const
OUString
&
rDel
)
const
sal_uInt16
ScDelimiterTable
::
GetCode
(
const
OUString
&
rDel
)
const
{
{
sal_Unicode
nCode
=
0
;
if
(
!
theDelTab
.
isEmpty
())
if
(
nCount
>=
2
)
{
{
sal_Int32
i
=
0
;
sal_Int32
nIdx
{
0
};
while
(
i
<
nCount
)
{
// Check even tokens: start from 0 and then skip 1 token at each iteration
if
(
rDel
==
theDelTab
.
getToken
(
i
,
cSep
)
)
if
(
rDel
!=
theDelTab
.
getToken
(
0
,
cSep
,
nIdx
))
{
while
(
nIdx
>
0
&&
rDel
!=
theDelTab
.
getToken
(
1
,
cSep
,
nIdx
));
nCode
=
static_cast
<
sal_Unicode
>
(
theDelTab
.
getToken
(
i
+
1
,
cSep
).
toInt32
());
i
=
nCount
;
if
(
nIdx
>
0
)
}
return
static_cast
<
sal_Unicode
>
(
theDelTab
.
getToken
(
0
,
cSep
,
nIdx
).
toInt32
());
else
i
+=
2
;
}
}
}
return
nCode
;
return
0
;
}
}
OUString
ScDelimiterTable
::
GetDelimiter
(
sal_Unicode
nCode
)
const
OUString
ScDelimiterTable
::
GetDelimiter
(
sal_Unicode
nCode
)
const
{
{
OUString
aStrDel
;
if
(
!
theDelTab
.
isEmpty
())
if
(
nCount
>=
2
)
{
{
sal_Int32
i
=
0
;
sal_Int32
nIdx
{
0
};
while
(
i
<
nCount
)
// Check odd tokens: start from 1 and then skip 1 token at each iteration
do
{
{
if
(
nCode
==
static_cast
<
sal_Unicode
>
(
theDelTab
.
getToken
(
i
+
1
,
cSep
).
toInt32
())
)
sal_Int32
nPrevIdx
{
nIdx
};
{
if
(
nCode
==
static_cast
<
sal_Unicode
>
(
theDelTab
.
getToken
(
1
,
cSep
,
nIdx
).
toInt32
()))
aStrDel
=
theDelTab
.
getToken
(
i
,
cSep
);
return
theDelTab
.
getToken
(
0
,
cSep
,
nPrevIdx
);
i
=
nCount
;
}
else
i
+=
2
;
}
}
while
(
nIdx
>
0
);
}
}
return
aStrDel
;
return
OUString
()
;
}
}
// ScImportOptionsDlg
// ScImportOptionsDlg
...
...
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