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
1e661634
Kaydet (Commit)
1e661634
authored
Kas 10, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:nullptr (automatic rewrite)
Change-Id: I86546bcf9b476c73da2d6bff30ee1e56933f69c4
üst
51b45df6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
span.hxx
include/xmlreader/span.hxx
+3
-3
pad.cxx
xmlreader/source/pad.cxx
+2
-2
span.cxx
xmlreader/source/span.cxx
+1
-1
xmlreader.cxx
xmlreader/source/xmlreader.cxx
+15
-15
No files found.
include/xmlreader/span.hxx
Dosyayı görüntüle @
1e661634
...
...
@@ -35,7 +35,7 @@ struct OOO_DLLPUBLIC_XMLREADER Span {
char
const
*
begin
;
sal_Int32
length
;
inline
Span
()
:
begin
(
0
),
length
(
0
)
{}
inline
Span
()
:
begin
(
nullptr
),
length
(
0
)
{}
// init length to avoid compiler warnings
inline
Span
(
char
const
*
theBegin
,
sal_Int32
theLength
)
:
...
...
@@ -45,9 +45,9 @@ struct OOO_DLLPUBLIC_XMLREADER Span {
begin
(
literal
),
length
(
N
-
1
)
{}
inline
void
clear
()
throw
()
{
begin
=
0
;
}
inline
void
clear
()
throw
()
{
begin
=
nullptr
;
}
inline
bool
is
()
const
{
return
begin
!=
0
;
}
inline
bool
is
()
const
{
return
begin
!=
nullptr
;
}
inline
bool
equals
(
Span
const
&
text
)
const
{
return
length
==
text
.
length
...
...
xmlreader/source/pad.cxx
Dosyayı görüntüle @
1e661634
...
...
@@ -29,7 +29,7 @@ namespace xmlreader {
void
Pad
::
add
(
char
const
*
begin
,
sal_Int32
length
)
{
assert
(
begin
!=
0
&&
length
>=
0
&&
!
(
span_
.
is
()
&&
buffer_
.
getLength
()
!=
0
));
begin
!=
nullptr
&&
length
>=
0
&&
!
(
span_
.
is
()
&&
buffer_
.
getLength
()
!=
0
));
if
(
length
!=
0
)
{
flushSpan
();
if
(
buffer_
.
isEmpty
())
{
...
...
@@ -42,7 +42,7 @@ void Pad::add(char const * begin, sal_Int32 length) {
void
Pad
::
addEphemeral
(
char
const
*
begin
,
sal_Int32
length
)
{
assert
(
begin
!=
0
&&
length
>=
0
&&
!
(
span_
.
is
()
&&
buffer_
.
getLength
()
!=
0
));
begin
!=
nullptr
&&
length
>=
0
&&
!
(
span_
.
is
()
&&
buffer_
.
getLength
()
!=
0
));
if
(
length
!=
0
)
{
flushSpan
();
buffer_
.
append
(
begin
,
length
);
...
...
xmlreader/source/span.cxx
Dosyayı görüntüle @
1e661634
...
...
@@ -34,7 +34,7 @@ namespace xmlreader {
OUString
Span
::
convertFromUtf8
()
const
{
assert
(
is
());
rtl_uString
*
s
=
0
;
rtl_uString
*
s
=
nullptr
;
if
(
!
rtl_convertStringToUString
(
&
s
,
begin
,
length
,
RTL_TEXTENCODING_UTF8
,
(
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
|
...
...
xmlreader/source/xmlreader.cxx
Dosyayı görüntüle @
1e661634
...
...
@@ -56,9 +56,9 @@ bool isSpace(char c) {
XmlReader
::
XmlReader
(
char
const
*
sStr
,
size_t
nLength
)
:
fileUrl_
(
"stream"
)
,
fileHandle_
(
0
)
,
fileHandle_
(
nullptr
)
,
fileSize_
(
0
)
,
fileAddress_
(
0
)
,
fileAddress_
(
nullptr
)
{
namespaceIris_
.
push_back
(
Span
(
"http://www.w3.org/XML/1998/namespace"
));
namespaces_
.
push_back
(
NamespaceData
(
Span
(
"xml"
),
NAMESPACE_XML
));
...
...
@@ -70,7 +70,7 @@ XmlReader::XmlReader(char const *sStr, size_t nLength)
XmlReader
::
XmlReader
(
OUString
const
&
fileUrl
)
:
fileUrl_
(
fileUrl
)
,
fileHandle_
(
0
)
,
fileHandle_
(
nullptr
)
{
oslFileError
e
=
osl_openFile
(
fileUrl_
.
pData
,
&
fileHandle_
,
osl_File_OpenFlag_Read
);
...
...
@@ -164,7 +164,7 @@ XmlReader::Result XmlReader::nextItem(Text reportText, Span * data, int * nsId)
}
bool
XmlReader
::
nextAttribute
(
int
*
nsId
,
Span
*
localName
)
{
assert
(
nsId
!=
0
&&
localName
!=
0
);
assert
(
nsId
!=
nullptr
&&
localName
!=
nullptr
);
if
(
firstAttribute_
)
{
currentAttribute_
=
attributes_
.
begin
();
firstAttribute_
=
false
;
...
...
@@ -174,7 +174,7 @@ bool XmlReader::nextAttribute(int * nsId, Span * localName) {
if
(
currentAttribute_
==
attributes_
.
end
())
{
return
false
;
}
if
(
currentAttribute_
->
nameColon
==
0
)
{
if
(
currentAttribute_
->
nameColon
==
nullptr
)
{
*
nsId
=
NAMESPACE_NONE
;
*
localName
=
Span
(
currentAttribute_
->
nameBegin
,
...
...
@@ -361,7 +361,7 @@ Span XmlReader::scanCdataSection() {
}
bool
XmlReader
::
scanName
(
char
const
**
nameColon
)
{
assert
(
nameColon
!=
0
&&
*
nameColon
==
0
);
assert
(
nameColon
!=
nullptr
&&
*
nameColon
==
nullptr
);
for
(
char
const
*
begin
=
pos_
;;
++
pos_
)
{
switch
(
peek
())
{
case
'\0'
:
// i.e., EOF
...
...
@@ -383,7 +383,7 @@ bool XmlReader::scanName(char const ** nameColon) {
}
int
XmlReader
::
scanNamespaceIri
(
char
const
*
begin
,
char
const
*
end
)
{
assert
(
begin
!=
0
&&
begin
<=
end
);
assert
(
begin
!=
nullptr
&&
begin
<=
end
);
Span
iri
(
handleAttributeValue
(
begin
,
end
,
false
));
for
(
NamespaceIris
::
size_type
i
=
0
;
i
<
namespaceIris_
.
size
();
++
i
)
{
if
(
namespaceIris_
[
i
].
equals
(
iri
))
{
...
...
@@ -395,7 +395,7 @@ int XmlReader::scanNamespaceIri(char const * begin, char const * end) {
char
const
*
XmlReader
::
handleReference
(
char
const
*
position
,
char
const
*
end
)
{
assert
(
position
!=
0
&&
*
position
==
'&'
&&
position
<
end
);
assert
(
position
!=
nullptr
&&
*
position
==
'&'
&&
position
<
end
);
++
position
;
if
(
*
position
==
'#'
)
{
++
position
;
...
...
@@ -603,9 +603,9 @@ Span XmlReader::handleAttributeValue(
}
XmlReader
::
Result
XmlReader
::
handleStartTag
(
int
*
nsId
,
Span
*
localName
)
{
assert
(
nsId
!=
0
&&
localName
);
assert
(
nsId
!=
nullptr
&&
localName
);
char
const
*
nameBegin
=
pos_
;
char
const
*
nameColon
=
0
;
char
const
*
nameColon
=
nullptr
;
if
(
!
scanName
(
&
nameColon
))
{
throw
css
::
uno
::
RuntimeException
(
"bad tag name in "
+
fileUrl_
);
...
...
@@ -626,7 +626,7 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
"missing whitespace before attribute in "
+
fileUrl_
);
}
char
const
*
attrNameBegin
=
pos_
;
char
const
*
attrNameColon
=
0
;
char
const
*
attrNameColon
=
nullptr
;
if
(
!
scanName
(
&
attrNameColon
))
{
throw
css
::
uno
::
RuntimeException
(
"bad attribute name in "
+
fileUrl_
);
...
...
@@ -651,12 +651,12 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
}
char
const
*
valueEnd
=
pos_
+
i
;
pos_
+=
i
+
1
;
if
(
attrNameColon
==
0
&&
if
(
attrNameColon
==
nullptr
&&
Span
(
attrNameBegin
,
attrNameEnd
-
attrNameBegin
).
equals
(
"xmlns"
))
{
hasDefaultNs
=
true
;
defaultNsId
=
scanNamespaceIri
(
valueBegin
,
valueEnd
);
}
else
if
(
attrNameColon
!=
0
&&
}
else
if
(
attrNameColon
!=
nullptr
&&
Span
(
attrNameBegin
,
attrNameColon
-
attrNameBegin
).
equals
(
"xmlns"
))
{
...
...
@@ -690,7 +690,7 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
ElementData
(
Span
(
nameBegin
,
nameEnd
-
nameBegin
),
inheritedNamespaces
,
defaultNsId
));
if
(
nameColon
==
0
)
{
if
(
nameColon
==
nullptr
)
{
*
nsId
=
defaultNsId
;
*
localName
=
Span
(
nameBegin
,
nameEnd
-
nameBegin
);
}
else
{
...
...
@@ -706,7 +706,7 @@ XmlReader::Result XmlReader::handleEndTag() {
"spurious end tag in "
+
fileUrl_
);
}
char
const
*
nameBegin
=
pos_
;
char
const
*
nameColon
=
0
;
char
const
*
nameColon
=
nullptr
;
if
(
!
scanName
(
&
nameColon
)
||
!
elements_
.
top
().
name
.
equals
(
nameBegin
,
pos_
-
nameBegin
))
{
...
...
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