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
4300656d
Kaydet (Commit)
4300656d
authored
Agu 30, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert XmlReader::State to scoped enum
Change-Id: I8020843ad238ac3487f7f2781693ca619db5e1b3
üst
9cd59f77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
xmlreader.hxx
include/xmlreader/xmlreader.hxx
+1
-3
xmlreader.cxx
xmlreader/source/xmlreader.cxx
+14
-14
No files found.
include/xmlreader/xmlreader.hxx
Dosyayı görüntüle @
4300656d
...
...
@@ -127,9 +127,7 @@ private:
typedef
std
::
vector
<
AttributeData
>
Attributes
;
enum
State
{
STATE_CONTENT
,
STATE_START_TAG
,
STATE_END_TAG
,
STATE_EMPTY_ELEMENT_TAG
,
STATE_DONE
};
enum
class
State
{
Content
,
StartTag
,
EndTag
,
EmptyElementTag
,
Done
};
SAL_DLLPRIVATE
inline
char
read
()
{
return
pos_
==
end_
?
'\0'
:
*
pos_
++
;
}
...
...
xmlreader/source/xmlreader.cxx
Dosyayı görüntüle @
4300656d
...
...
@@ -64,7 +64,7 @@ XmlReader::XmlReader(char const *sStr, size_t nLength)
namespaces_
.
push_back
(
NamespaceData
(
Span
(
"xml"
),
NAMESPACE_XML
));
pos_
=
sStr
;
end_
=
pos_
+
nLength
;
state_
=
S
TATE_CONTENT
;
state_
=
S
tate
::
Content
;
firstAttribute_
=
true
;
}
...
...
@@ -104,7 +104,7 @@ XmlReader::XmlReader(OUString const & fileUrl)
namespaces_
.
push_back
(
NamespaceData
(
Span
(
"xml"
),
NAMESPACE_XML
));
pos_
=
static_cast
<
char
*
>
(
fileAddress_
);
end_
=
pos_
+
fileSize_
;
state_
=
S
TATE_CONTENT
;
state_
=
S
tate
::
Content
;
firstAttribute_
=
true
;
}
...
...
@@ -142,7 +142,7 @@ int XmlReader::registerNamespaceIri(Span const & iri) {
XmlReader
::
Result
XmlReader
::
nextItem
(
Text
reportText
,
Span
*
data
,
int
*
nsId
)
{
switch
(
state_
)
{
case
S
TATE_CONTENT
:
case
S
tate
:
:
Content
:
switch
(
reportText
)
{
case
Text
:
:
NONE
:
return
handleSkippedText
(
data
,
nsId
);
...
...
@@ -151,14 +151,14 @@ XmlReader::Result XmlReader::nextItem(Text reportText, Span * data, int * nsId)
case
Text
:
:
Normalized
:
return
handleNormalizedText
(
data
);
}
case
S
TATE_START_TAG
:
case
S
tate
:
:
StartTag
:
return
handleStartTag
(
nsId
,
data
);
case
S
TATE_END_TAG
:
case
S
tate
:
:
EndTag
:
return
handleEndTag
();
case
S
TATE_EMPTY_ELEMENT_TAG
:
case
S
tate
:
:
EmptyElementTag
:
handleElementEnd
();
return
Result
::
End
;
default
:
// S
TATE_DONE
default
:
// S
tate::Done
return
Result
::
Done
;
}
}
...
...
@@ -676,10 +676,10 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
}
firstAttribute_
=
true
;
if
(
peek
()
==
'/'
)
{
state_
=
S
TATE_EMPTY_ELEMENT_TAG
;
state_
=
S
tate
::
EmptyElementTag
;
++
pos_
;
}
else
{
state_
=
S
TATE_CONTENT
;
state_
=
S
tate
::
Content
;
}
if
(
peek
()
!=
'>'
)
{
throw
css
::
uno
::
RuntimeException
(
...
...
@@ -727,7 +727,7 @@ void XmlReader::handleElementEnd() {
assert
(
!
elements_
.
empty
());
namespaces_
.
resize
(
elements_
.
top
().
inheritedNamespaces
);
elements_
.
pop
();
state_
=
elements_
.
empty
()
?
S
TATE_DONE
:
STATE_CONTENT
;
state_
=
elements_
.
empty
()
?
S
tate
::
Done
:
State
::
Content
;
}
XmlReader
::
Result
XmlReader
::
handleSkippedText
(
Span
*
data
,
int
*
nsId
)
{
...
...
@@ -797,7 +797,7 @@ XmlReader::Result XmlReader::handleRawText(Span * text) {
case
'/'
:
*
text
=
pad_
.
get
();
++
pos_
;
state_
=
S
TATE_END_TAG
;
state_
=
S
tate
::
EndTag
;
return
Result
::
Text
;
case
'?'
:
++
pos_
;
...
...
@@ -806,7 +806,7 @@ XmlReader::Result XmlReader::handleRawText(Span * text) {
break
;
default
:
*
text
=
pad_
.
get
();
state_
=
S
TATE_START_TAG
;
state_
=
S
tate
::
StartTag
;
return
Result
::
Text
;
}
break
;
...
...
@@ -914,7 +914,7 @@ XmlReader::Result XmlReader::handleNormalizedText(Span * text) {
++
pos_
;
pad_
.
add
(
flowBegin
,
flowEnd
-
flowBegin
);
*
text
=
pad_
.
get
();
state_
=
S
TATE_END_TAG
;
state_
=
S
tate
::
EndTag
;
return
Result
::
Text
;
case
'?'
:
++
pos_
;
...
...
@@ -924,7 +924,7 @@ XmlReader::Result XmlReader::handleNormalizedText(Span * text) {
default
:
pad_
.
add
(
flowBegin
,
flowEnd
-
flowBegin
);
*
text
=
pad_
.
get
();
state_
=
S
TATE_START_TAG
;
state_
=
S
tate
::
StartTag
;
return
Result
::
Text
;
}
break
;
...
...
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