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
1e04280b
Kaydet (Commit)
1e04280b
authored
Ock 07, 2012
tarafından
August Sodora
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refactor readLine in scanner
üst
db1faf48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
25 deletions
+39
-25
scanner.cxx
basic/source/comp/scanner.cxx
+38
-25
scanner.hxx
basic/source/inc/scanner.hxx
+1
-0
No files found.
basic/source/comp/scanner.cxx
Dosyayı görüntüle @
1e04280b
...
@@ -178,6 +178,40 @@ void SbiScanner::scanGoto()
...
@@ -178,6 +178,40 @@ void SbiScanner::scanGoto()
}
}
}
}
bool
SbiScanner
::
readLine
()
{
if
(
nBufPos
>=
aBuf
.
getLength
())
return
false
;
sal_Int32
n
=
nBufPos
;
sal_Int32
nLen
=
aBuf
.
getLength
();
while
(
n
<
nLen
&&
aBuf
[
n
]
!=
'\r'
&&
aBuf
[
n
]
!=
'\n'
)
++
n
;
// Trim trailing whitespace
sal_Int32
nEnd
=
n
;
while
(
nBufPos
<
nEnd
&&
theBasicCharClass
::
get
().
isWhitespace
(
aBuf
[
nEnd
-
1
]))
--
nEnd
;
aLine
=
aBuf
.
copy
(
nBufPos
,
nEnd
-
nBufPos
);
// Fast-forward past the line ending
if
(
n
+
1
<
nLen
&&
aBuf
[
n
]
==
'\r'
&&
aBuf
[
n
+
1
]
==
'\n'
)
n
+=
2
;
else
if
(
n
<
nLen
)
n
++
;
nBufPos
=
n
;
pLine
=
aLine
.
getStr
();
++
nLine
;
nCol
=
nCol1
=
nCol2
=
0
;
nColLock
=
0
;
return
true
;
}
bool
SbiScanner
::
NextSym
()
bool
SbiScanner
::
NextSym
()
{
{
// memorize for the EOLN-case
// memorize for the EOLN-case
...
@@ -195,33 +229,12 @@ bool SbiScanner::NextSym()
...
@@ -195,33 +229,12 @@ bool SbiScanner::NextSym()
// read in line?
// read in line?
if
(
!
pLine
)
if
(
!
pLine
)
{
{
sal_Int32
n
=
nBufPos
;
if
(
!
readLine
())
sal_Int32
nLen
=
aBuf
.
getLength
();
if
(
nBufPos
>=
nLen
)
return
false
;
return
false
;
const
sal_Unicode
*
p2
=
aBuf
.
getStr
();
p2
+=
n
;
while
(
(
n
<
nLen
)
&&
(
*
p2
!=
'\n'
)
&&
(
*
p2
!=
'\r'
)
)
p2
++
,
n
++
;
// #163944# ignore trailing whitespace
sal_Int32
nCopyEndPos
=
n
;
while
(
(
nBufPos
<
nCopyEndPos
)
&&
theBasicCharClass
::
get
().
isWhitespace
(
aBuf
[
nCopyEndPos
-
1
]
)
)
--
nCopyEndPos
;
aLine
=
aBuf
.
copy
(
nBufPos
,
nCopyEndPos
-
nBufPos
);
if
(
n
<
nLen
)
{
if
(
*
p2
==
'\r'
&&
*
(
p2
+
1
)
==
'\n'
)
n
+=
2
;
else
n
++
;
}
nBufPos
=
n
;
pLine
=
aLine
.
getStr
();
nOldLine
=
++
nLine
;
nCol
=
nCol1
=
nCol2
=
nOldCol1
=
nOldCol2
=
0
;
nColLock
=
0
;
}
nOldLine
=
nLine
;
nOldCol1
=
nOldCol2
=
0
;
}
while
(
theBasicCharClass
::
get
().
isWhitespace
(
*
pLine
)
)
while
(
theBasicCharClass
::
get
().
isWhitespace
(
*
pLine
)
)
pLine
++
,
nCol
++
,
bSpaces
=
true
;
pLine
++
,
nCol
++
,
bSpaces
=
true
;
...
...
basic/source/inc/scanner.hxx
Dosyayı görüntüle @
1e04280b
...
@@ -48,6 +48,7 @@ class SbiScanner
...
@@ -48,6 +48,7 @@ class SbiScanner
void
scanAlphanumeric
();
void
scanAlphanumeric
();
void
scanGoto
();
void
scanGoto
();
bool
readLine
();
protected
:
protected
:
::
rtl
::
OUString
aSym
;
::
rtl
::
OUString
aSym
;
String
aError
;
String
aError
;
...
...
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