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
d55648b7
Kaydet (Commit)
d55648b7
authored
Eyl 25, 2014
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
FastSerializer: check for valid output stream in one place is enough
Change-Id: Id89fb1f0444331c2858a9795ae81dcdb875d3d2b
üst
cc3ac382
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
19 deletions
+1
-19
fastserializer.cxx
sax/source/tools/fastserializer.cxx
+0
-19
fshelper.cxx
sax/source/tools/fshelper.cxx
+1
-0
No files found.
sax/source/tools/fastserializer.cxx
Dosyayı görüntüle @
d55648b7
...
@@ -72,9 +72,6 @@ namespace sax_fastparser {
...
@@ -72,9 +72,6 @@ namespace sax_fastparser {
void
SAL_CALL
FastSaxSerializer
::
startDocument
(
)
throw
(
SAXException
,
RuntimeException
)
void
SAL_CALL
FastSaxSerializer
::
startDocument
(
)
throw
(
SAXException
,
RuntimeException
)
{
{
assert
(
mxOutputStream
.
is
());
// cannot do anything without that
if
(
!
mxOutputStream
.
is
())
return
;
rtl
::
ByteSequence
aXmlHeader
((
const
sal_Int8
*
)
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>
\n
"
,
56
);
rtl
::
ByteSequence
aXmlHeader
((
const
sal_Int8
*
)
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>
\n
"
,
56
);
writeBytes
(
toUnoSequence
(
aXmlHeader
));
writeBytes
(
toUnoSequence
(
aXmlHeader
));
}
}
...
@@ -112,9 +109,6 @@ namespace sax_fastparser {
...
@@ -112,9 +109,6 @@ namespace sax_fastparser {
void
SAL_CALL
FastSaxSerializer
::
endDocument
(
)
throw
(
SAXException
,
RuntimeException
)
void
SAL_CALL
FastSaxSerializer
::
endDocument
(
)
throw
(
SAXException
,
RuntimeException
)
{
{
if
(
!
mxOutputStream
.
is
())
return
;
maOutputStream
.
flush
();
maOutputStream
.
flush
();
mxOutputStream
->
writeBytes
(
maOutputData
);
mxOutputStream
->
writeBytes
(
maOutputData
);
}
}
...
@@ -151,9 +145,6 @@ namespace sax_fastparser {
...
@@ -151,9 +145,6 @@ namespace sax_fastparser {
void
SAL_CALL
FastSaxSerializer
::
startFastElement
(
::
sal_Int32
Element
,
const
Reference
<
XFastAttributeList
>&
Attribs
)
void
SAL_CALL
FastSaxSerializer
::
startFastElement
(
::
sal_Int32
Element
,
const
Reference
<
XFastAttributeList
>&
Attribs
)
throw
(
SAXException
,
RuntimeException
)
throw
(
SAXException
,
RuntimeException
)
{
{
if
(
!
mxOutputStream
.
is
())
return
;
if
(
!
maMarkStack
.
empty
()
)
if
(
!
maMarkStack
.
empty
()
)
maMarkStack
.
top
()
->
setCurrentElement
(
Element
);
maMarkStack
.
top
()
->
setCurrentElement
(
Element
);
...
@@ -172,9 +163,6 @@ namespace sax_fastparser {
...
@@ -172,9 +163,6 @@ namespace sax_fastparser {
void
SAL_CALL
FastSaxSerializer
::
endFastElement
(
::
sal_Int32
Element
)
void
SAL_CALL
FastSaxSerializer
::
endFastElement
(
::
sal_Int32
Element
)
throw
(
SAXException
,
RuntimeException
)
throw
(
SAXException
,
RuntimeException
)
{
{
if
(
!
mxOutputStream
.
is
())
return
;
#ifdef DBG_UTIL
#ifdef DBG_UTIL
assert
(
!
m_DebugStartedElements
.
empty
());
assert
(
!
m_DebugStartedElements
.
empty
());
// Well-formedness constraint: Element Type Match
// Well-formedness constraint: Element Type Match
...
@@ -192,9 +180,6 @@ namespace sax_fastparser {
...
@@ -192,9 +180,6 @@ namespace sax_fastparser {
void
SAL_CALL
FastSaxSerializer
::
singleFastElement
(
::
sal_Int32
Element
,
const
Reference
<
XFastAttributeList
>&
Attribs
)
void
SAL_CALL
FastSaxSerializer
::
singleFastElement
(
::
sal_Int32
Element
,
const
Reference
<
XFastAttributeList
>&
Attribs
)
throw
(
SAXException
,
RuntimeException
)
throw
(
SAXException
,
RuntimeException
)
{
{
if
(
!
mxOutputStream
.
is
())
return
;
if
(
!
maMarkStack
.
empty
()
)
if
(
!
maMarkStack
.
empty
()
)
maMarkStack
.
top
()
->
setCurrentElement
(
Element
);
maMarkStack
.
top
()
->
setCurrentElement
(
Element
);
...
@@ -209,9 +194,6 @@ namespace sax_fastparser {
...
@@ -209,9 +194,6 @@ namespace sax_fastparser {
void
SAL_CALL
FastSaxSerializer
::
characters
(
const
OUString
&
aChars
)
void
SAL_CALL
FastSaxSerializer
::
characters
(
const
OUString
&
aChars
)
throw
(
SAXException
,
RuntimeException
)
throw
(
SAXException
,
RuntimeException
)
{
{
if
(
!
mxOutputStream
.
is
())
return
;
write
(
aChars
);
write
(
aChars
);
}
}
...
@@ -219,7 +201,6 @@ namespace sax_fastparser {
...
@@ -219,7 +201,6 @@ namespace sax_fastparser {
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
{
mxOutputStream
=
xOutputStream
;
mxOutputStream
=
xOutputStream
;
assert
(
mxOutputStream
.
is
());
// cannot do anything without that
}
}
void
SAL_CALL
FastSaxSerializer
::
setFastTokenHandler
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XFastTokenHandler
>&
xFastTokenHandler
)
void
SAL_CALL
FastSaxSerializer
::
setFastTokenHandler
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XFastTokenHandler
>&
xFastTokenHandler
)
...
...
sax/source/tools/fshelper.cxx
Dosyayı görüntüle @
d55648b7
...
@@ -35,6 +35,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >&
...
@@ -35,6 +35,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >&
mxTokenHandler
=
css
::
xml
::
sax
::
FastTokenHandler
::
create
(
xContext
);
mxTokenHandler
=
css
::
xml
::
sax
::
FastTokenHandler
::
create
(
xContext
);
mpSerializer
->
setFastTokenHandler
(
mxTokenHandler
);
mpSerializer
->
setFastTokenHandler
(
mxTokenHandler
);
assert
(
xOutputStream
.
is
());
// cannot do anything without that
mpSerializer
->
setOutputStream
(
xOutputStream
);
mpSerializer
->
setOutputStream
(
xOutputStream
);
if
(
bWriteHeader
)
if
(
bWriteHeader
)
mpSerializer
->
startDocument
();
mpSerializer
->
startDocument
();
...
...
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