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
e48b9b29
Kaydet (Commit)
e48b9b29
authored
Ock 05, 2018
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sax: remove that odd Entity copy constructor
Change-Id: I7929ccf751d37f65975d6412e28d34bec4421c07
üst
60b7024e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
32 deletions
+19
-32
fastparser.cxx
sax/source/fastparser/fastparser.cxx
+19
-32
No files found.
sax/source/fastparser/fastparser.cxx
Dosyayı görüntüle @
e48b9b29
...
@@ -188,7 +188,8 @@ struct Entity : public ParserData
...
@@ -188,7 +188,8 @@ struct Entity : public ParserData
maNamespaceDefines
;
maNamespaceDefines
;
explicit
Entity
(
const
ParserData
&
rData
);
explicit
Entity
(
const
ParserData
&
rData
);
Entity
(
const
Entity
&
rEntity
);
Entity
(
const
Entity
&
rEntity
)
=
delete
;
Entity
&
operator
=
(
const
Entity
&
rEntity
)
=
delete
;
void
startElement
(
Event
const
*
pEvent
);
void
startElement
(
Event
const
*
pEvent
);
void
characters
(
const
OUString
&
sChars
);
void
characters
(
const
OUString
&
sChars
);
void
endElement
();
void
endElement
();
...
@@ -238,7 +239,7 @@ public:
...
@@ -238,7 +239,7 @@ public:
void
callbackCharacters
(
const
xmlChar
*
s
,
int
nLen
);
void
callbackCharacters
(
const
xmlChar
*
s
,
int
nLen
);
void
callbackProcessingInstruction
(
const
xmlChar
*
target
,
const
xmlChar
*
data
);
void
callbackProcessingInstruction
(
const
xmlChar
*
target
,
const
xmlChar
*
data
);
void
pushEntity
(
const
Entity
&
rEntity
);
void
pushEntity
(
const
ParserData
&
,
xml
::
sax
::
InputSource
const
&
);
void
popEntity
();
void
popEntity
();
Entity
&
getEntity
()
{
return
*
mpTop
;
}
Entity
&
getEntity
()
{
return
*
mpTop
;
}
void
parse
();
void
parse
();
...
@@ -382,22 +383,6 @@ Entity::Entity(const ParserData& rData)
...
@@ -382,22 +383,6 @@ Entity::Entity(const ParserData& rData)
{
{
}
}
Entity
::
Entity
(
const
Entity
&
e
)
:
ParserData
(
e
)
,
mnProducedEventsSize
(
0
)
,
mxProducedEvents
()
,
mbEnableThreads
(
e
.
mbEnableThreads
)
,
maStructSource
(
e
.
maStructSource
)
,
mpParser
(
e
.
mpParser
)
,
maConverter
(
e
.
maConverter
)
,
maSavedException
(
e
.
maSavedException
)
,
maNamespaceStack
(
e
.
maNamespaceStack
)
,
maContextStack
(
e
.
maContextStack
)
,
maNamespaceCount
(
e
.
maNamespaceCount
)
,
maNamespaceDefines
(
e
.
maNamespaceDefines
)
{
}
void
Entity
::
startElement
(
Event
const
*
pEvent
)
void
Entity
::
startElement
(
Event
const
*
pEvent
)
{
{
const
sal_Int32
&
nElementToken
=
pEvent
->
mnElementToken
;
const
sal_Int32
&
nElementToken
=
pEvent
->
mnElementToken
;
...
@@ -758,24 +743,14 @@ namespace
...
@@ -758,24 +743,14 @@ namespace
* the file-specific initialization work. (During a parser run, external files may be opened)
* the file-specific initialization work. (During a parser run, external files may be opened)
*
*
****************/
****************/
void
FastSaxParserImpl
::
parseStream
(
const
InputSource
&
ma
StructSource
)
void
FastSaxParserImpl
::
parseStream
(
const
InputSource
&
r
StructSource
)
{
{
xmlInitParser
();
xmlInitParser
();
// Only one text at one time
// Only one text at one time
MutexGuard
guard
(
maMutex
);
MutexGuard
guard
(
maMutex
);
Entity
entity
(
maData
);
pushEntity
(
maData
,
rStructSource
);
entity
.
maStructSource
=
maStructSource
;
if
(
!
entity
.
maStructSource
.
aInputStream
.
is
()
)
throw
SAXException
(
"No input source"
,
Reference
<
XInterface
>
(),
Any
()
);
entity
.
maConverter
.
setInputStream
(
entity
.
maStructSource
.
aInputStream
);
if
(
!
entity
.
maStructSource
.
sEncoding
.
isEmpty
()
)
entity
.
maConverter
.
setEncoding
(
OUStringToOString
(
entity
.
maStructSource
.
sEncoding
,
RTL_TEXTENCODING_ASCII_US
)
);
pushEntity
(
entity
);
Entity
&
rEntity
=
getEntity
();
Entity
&
rEntity
=
getEntity
();
ParserCleanup
aEnsureFree
(
*
this
,
rEntity
);
ParserCleanup
aEnsureFree
(
*
this
,
rEntity
);
...
@@ -988,10 +963,22 @@ bool FastSaxParserImpl::consume(EventList& rEventList)
...
@@ -988,10 +963,22 @@ bool FastSaxParserImpl::consume(EventList& rEventList)
return
true
;
return
true
;
}
}
void
FastSaxParserImpl
::
pushEntity
(
const
Entity
&
rEntity
)
void
FastSaxParserImpl
::
pushEntity
(
const
ParserData
&
rEntityData
,
xml
::
sax
::
InputSource
const
&
rSource
)
{
{
maEntities
.
push
(
rEntity
);
if
(
!
rSource
.
aInputStream
.
is
())
throw
SAXException
(
"No input source"
,
Reference
<
XInterface
>
(),
Any
());
maEntities
.
emplace
(
rEntityData
);
mpTop
=
&
maEntities
.
top
();
mpTop
=
&
maEntities
.
top
();
mpTop
->
maStructSource
=
rSource
;
mpTop
->
maConverter
.
setInputStream
(
mpTop
->
maStructSource
.
aInputStream
);
if
(
!
mpTop
->
maStructSource
.
sEncoding
.
isEmpty
())
{
mpTop
->
maConverter
.
setEncoding
(
OUStringToOString
(
mpTop
->
maStructSource
.
sEncoding
,
RTL_TEXTENCODING_ASCII_US
));
}
}
}
void
FastSaxParserImpl
::
popEntity
()
void
FastSaxParserImpl
::
popEntity
()
...
...
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