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
db72a45a
Kaydet (Commit)
db72a45a
authored
Ock 23, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1158493 Uninitialized scalar field
Change-Id: I26de8ab1fa4a20bc08e800f04716507469430612
üst
78ea0133
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
39 deletions
+43
-39
saxwriter.cxx
sax/source/expatwrap/saxwriter.cxx
+43
-39
No files found.
sax/source/expatwrap/saxwriter.cxx
Dosyayı görüntüle @
db72a45a
...
@@ -874,15 +874,19 @@ class SAXWriter :
...
@@ -874,15 +874,19 @@ class SAXWriter :
XServiceInfo
>
XServiceInfo
>
{
{
public
:
public
:
SAXWriter
(
)
:
SAXWriter
()
m_seqStartElement
(),
:
m_seqStartElement
()
mp_SaxWriterHelper
(
NULL
),
,
m_pSaxWriterHelper
(
NULL
)
m_bForceLineBreak
(
sal_False
),
,
m_bDocStarted
(
false
)
m_bAllowLineBreak
(
sal_False
)
,
m_bIsCDATA
(
false
)
{}
,
m_bForceLineBreak
(
false
)
,
m_bAllowLineBreak
(
false
)
,
m_nLevel
(
0
)
{
}
~
SAXWriter
()
~
SAXWriter
()
{
{
delete
m
p_
SaxWriterHelper
;
delete
m
_p
SaxWriterHelper
;
}
}
public
:
// XActiveDataSource
public
:
// XActiveDataSource
...
@@ -890,14 +894,14 @@ public: // XActiveDataSource
...
@@ -890,14 +894,14 @@ public: // XActiveDataSource
throw
(
RuntimeException
)
throw
(
RuntimeException
)
{
{
// temporary: set same stream again to clear buffer
// temporary: set same stream again to clear buffer
if
(
m_out
==
aStream
&&
m
p_
SaxWriterHelper
&&
m_bDocStarted
)
if
(
m_out
==
aStream
&&
m
_p
SaxWriterHelper
&&
m_bDocStarted
)
m
p_
SaxWriterHelper
->
clearBuffer
();
m
_p
SaxWriterHelper
->
clearBuffer
();
else
else
{
{
m_out
=
aStream
;
m_out
=
aStream
;
delete
m
p_
SaxWriterHelper
;
delete
m
_p
SaxWriterHelper
;
m
p_
SaxWriterHelper
=
new
SaxWriterHelper
(
m_out
);
m
_p
SaxWriterHelper
=
new
SaxWriterHelper
(
m_out
);
m_bDocStarted
=
sal_False
;
m_bDocStarted
=
sal_False
;
m_nLevel
=
0
;
m_nLevel
=
0
;
m_bIsCDATA
=
sal_False
;
m_bIsCDATA
=
sal_False
;
...
@@ -955,7 +959,7 @@ private:
...
@@ -955,7 +959,7 @@ private:
Reference
<
XOutputStream
>
m_out
;
Reference
<
XOutputStream
>
m_out
;
Sequence
<
sal_Int8
>
m_seqStartElement
;
Sequence
<
sal_Int8
>
m_seqStartElement
;
SaxWriterHelper
*
m
p_
SaxWriterHelper
;
SaxWriterHelper
*
m
_p
SaxWriterHelper
;
// Status information
// Status information
sal_Bool
m_bDocStarted
:
1
;
sal_Bool
m_bDocStarted
:
1
;
...
@@ -968,11 +972,11 @@ private:
...
@@ -968,11 +972,11 @@ private:
sal_Int32
SAXWriter
::
getIndentPrefixLength
(
sal_Int32
nFirstLineBreakOccurrence
)
throw
()
sal_Int32
SAXWriter
::
getIndentPrefixLength
(
sal_Int32
nFirstLineBreakOccurrence
)
throw
()
{
{
sal_Int32
nLength
=-
1
;
sal_Int32
nLength
=-
1
;
if
(
m
p_
SaxWriterHelper
)
if
(
m
_p
SaxWriterHelper
)
{
{
if
(
m_bForceLineBreak
||
if
(
m_bForceLineBreak
||
(
m_bAllowLineBreak
&&
(
m_bAllowLineBreak
&&
((
nFirstLineBreakOccurrence
+
m
p_
SaxWriterHelper
->
GetLastColumnCount
())
>
MAXCOLUMNCOUNT
))
)
((
nFirstLineBreakOccurrence
+
m
_p
SaxWriterHelper
->
GetLastColumnCount
())
>
MAXCOLUMNCOUNT
))
)
nLength
=
m_nLevel
;
nLength
=
m_nLevel
;
}
}
m_bForceLineBreak
=
sal_False
;
m_bForceLineBreak
=
sal_False
;
...
@@ -1007,11 +1011,11 @@ Sequence< OUString > SAXWriter::getSupportedServiceNames(void) throw ()
...
@@ -1007,11 +1011,11 @@ Sequence< OUString > SAXWriter::getSupportedServiceNames(void) throw ()
void
SAXWriter
::
startDocument
()
throw
(
SAXException
,
RuntimeException
)
void
SAXWriter
::
startDocument
()
throw
(
SAXException
,
RuntimeException
)
{
{
if
(
m_bDocStarted
||
!
m_out
.
is
()
||
!
m
p_
SaxWriterHelper
)
{
if
(
m_bDocStarted
||
!
m_out
.
is
()
||
!
m
_p
SaxWriterHelper
)
{
throw
SAXException
();
throw
SAXException
();
}
}
m_bDocStarted
=
sal_True
;
m_bDocStarted
=
sal_True
;
m
p_
SaxWriterHelper
->
startDocument
();
m
_p
SaxWriterHelper
->
startDocument
();
}
}
...
@@ -1028,7 +1032,7 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
...
@@ -1028,7 +1032,7 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
OUString
(
"unexpected end of document"
),
OUString
(
"unexpected end of document"
),
Reference
<
XInterface
>
()
,
Any
()
);
Reference
<
XInterface
>
()
,
Any
()
);
}
}
m
p_
SaxWriterHelper
->
endDocument
();
m
_p
SaxWriterHelper
->
endDocument
();
try
try
{
{
m_out
->
closeOutput
();
m_out
->
closeOutput
();
...
@@ -1094,9 +1098,9 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
...
@@ -1094,9 +1098,9 @@ void SAXWriter::startElement(const OUString& aName, const Reference< XAttributeL
// write into sequence
// write into sequence
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
SaxInvalidCharacterError
eRet
(
m
p_
SaxWriterHelper
->
startElement
(
aName
,
xAttribs
));
SaxInvalidCharacterError
eRet
(
m
_p
SaxWriterHelper
->
startElement
(
aName
,
xAttribs
));
m_nLevel
++
;
m_nLevel
++
;
...
@@ -1128,13 +1132,13 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime
...
@@ -1128,13 +1132,13 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime
// check here because Helper's endElement is not always called
// check here because Helper's endElement is not always called
#ifdef DBG_UTIL
#ifdef DBG_UTIL
assert
(
!
m
p_
SaxWriterHelper
->
m_DebugStartedElements
.
empty
());
assert
(
!
m
_p
SaxWriterHelper
->
m_DebugStartedElements
.
empty
());
// Well-formedness constraint: Element Type Match
// Well-formedness constraint: Element Type Match
assert
(
aName
==
m
p_
SaxWriterHelper
->
m_DebugStartedElements
.
top
());
assert
(
aName
==
m
_p
SaxWriterHelper
->
m_DebugStartedElements
.
top
());
m
p_
SaxWriterHelper
->
m_DebugStartedElements
.
pop
();
m
_p
SaxWriterHelper
->
m_DebugStartedElements
.
pop
();
#endif
#endif
if
(
m
p_
SaxWriterHelper
->
FinishEmptyElement
()
)
if
(
m
_p
SaxWriterHelper
->
FinishEmptyElement
()
)
m_bForceLineBreak
=
sal_False
;
m_bForceLineBreak
=
sal_False
;
else
else
{
{
...
@@ -1145,9 +1149,9 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime
...
@@ -1145,9 +1149,9 @@ void SAXWriter::endElement(const OUString& aName) throw (SAXException, Runtime
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
bRet
=
m
p_
SaxWriterHelper
->
endElement
(
aName
);
bRet
=
m
_p
SaxWriterHelper
->
endElement
(
aName
);
}
}
if
(
!
bRet
)
if
(
!
bRet
)
...
@@ -1171,7 +1175,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
...
@@ -1171,7 +1175,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
if
(
!
aChars
.
isEmpty
()
)
if
(
!
aChars
.
isEmpty
()
)
{
{
if
(
m_bIsCDATA
)
if
(
m_bIsCDATA
)
bThrowException
=
!
m
p_
SaxWriterHelper
->
writeString
(
aChars
,
sal_False
,
sal_False
);
bThrowException
=
!
m
_p
SaxWriterHelper
->
writeString
(
aChars
,
sal_False
,
sal_False
);
else
else
{
{
// Note : nFirstLineBreakOccurrence is not exact, because we don't know, how
// Note : nFirstLineBreakOccurrence is not exact, because we don't know, how
...
@@ -1195,11 +1199,11 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
...
@@ -1195,11 +1199,11 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
if
(
nIndentPrefix
>=
0
)
if
(
nIndentPrefix
>=
0
)
{
{
if
(
isFirstCharWhitespace
(
aChars
.
getStr
()
)
)
if
(
isFirstCharWhitespace
(
aChars
.
getStr
()
)
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nIndentPrefix
-
1
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nIndentPrefix
-
1
);
else
else
m
p_
SaxWriterHelper
->
insertIndentation
(
nIndentPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nIndentPrefix
);
}
}
bThrowException
=
!
m
p_
SaxWriterHelper
->
writeString
(
aChars
,
sal_True
,
sal_False
);
bThrowException
=
!
m
_p
SaxWriterHelper
->
writeString
(
aChars
,
sal_True
,
sal_False
);
}
}
}
}
if
(
bThrowException
)
if
(
bThrowException
)
...
@@ -1245,9 +1249,9 @@ void SAXWriter::processingInstruction(const OUString& aTarget, const OUString& a
...
@@ -1245,9 +1249,9 @@ void SAXWriter::processingInstruction(const OUString& aTarget, const OUString& a
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
if
(
!
m
p_
SaxWriterHelper
->
processingInstruction
(
aTarget
,
aData
))
if
(
!
m
_p
SaxWriterHelper
->
processingInstruction
(
aTarget
,
aData
))
{
{
SAXException
except
;
SAXException
except
;
except
.
Message
=
"Invalid character during XML-Export"
;
except
.
Message
=
"Invalid character during XML-Export"
;
...
@@ -1272,9 +1276,9 @@ void SAXWriter::startCDATA(void) throw(SAXException, RuntimeException)
...
@@ -1272,9 +1276,9 @@ void SAXWriter::startCDATA(void) throw(SAXException, RuntimeException)
sal_Int32
nLength
=
9
;
sal_Int32
nLength
=
9
;
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
p_
SaxWriterHelper
->
startCDATA
();
m
_p
SaxWriterHelper
->
startCDATA
();
m_bIsCDATA
=
sal_True
;
m_bIsCDATA
=
sal_True
;
}
}
...
@@ -1291,9 +1295,9 @@ void SAXWriter::endCDATA(void) throw (RuntimeException)
...
@@ -1291,9 +1295,9 @@ void SAXWriter::endCDATA(void) throw (RuntimeException)
sal_Int32
nLength
=
3
;
sal_Int32
nLength
=
3
;
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
p_
SaxWriterHelper
->
endCDATA
();
m
_p
SaxWriterHelper
->
endCDATA
();
m_bIsCDATA
=
sal_False
;
m_bIsCDATA
=
sal_False
;
}
}
...
@@ -1317,9 +1321,9 @@ void SAXWriter::comment(const OUString& sComment) throw(SAXException, RuntimeExc
...
@@ -1317,9 +1321,9 @@ void SAXWriter::comment(const OUString& sComment) throw(SAXException, RuntimeExc
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
if
(
!
m
p_
SaxWriterHelper
->
comment
(
sComment
))
if
(
!
m
_p
SaxWriterHelper
->
comment
(
sComment
))
{
{
SAXException
except
;
SAXException
except
;
except
.
Message
=
"Invalid character during XML-Export"
;
except
.
Message
=
"Invalid character during XML-Export"
;
...
@@ -1358,9 +1362,9 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
...
@@ -1358,9 +1362,9 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
sal_Int32
nPrefix
=
getIndentPrefixLength
(
nLength
);
if
(
nPrefix
>=
0
)
if
(
nPrefix
>=
0
)
m
p_
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
m
_p
SaxWriterHelper
->
insertIndentation
(
nPrefix
);
if
(
!
m
p_
SaxWriterHelper
->
writeString
(
sString
,
sal_False
,
sal_False
))
if
(
!
m
_p
SaxWriterHelper
->
writeString
(
sString
,
sal_False
,
sal_False
))
{
{
SAXException
except
;
SAXException
except
;
except
.
Message
=
"Invalid character during XML-Export"
;
except
.
Message
=
"Invalid character during XML-Export"
;
...
...
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