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
c71f8885
Kaydet (Commit)
c71f8885
authored
Ock 22, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sax: fastparser: use cppu::getCaughtException() to avoid sliced exceptions
Change-Id: I1cd932ae520ba20eff8ef447614e91e1cc2032f8
üst
f0d6e0e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
fastparser.cxx
sax/source/fastparser/fastparser.cxx
+11
-9
No files found.
sax/source/fastparser/fastparser.cxx
Dosyayı görüntüle @
c71f8885
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <osl/conditn.hxx>
#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.h>
#include <rtl/ref.hxx>
#include <rtl/ref.hxx>
...
@@ -169,7 +170,7 @@ struct Entity : public ParserData
...
@@ -169,7 +170,7 @@ struct Entity : public ParserData
// resource leaks), therefore any exception thrown by a UNO callback
// resource leaks), therefore any exception thrown by a UNO callback
// must be saved somewhere until the C-XmlParser is stopped.
// must be saved somewhere until the C-XmlParser is stopped.
::
com
::
sun
::
star
::
uno
::
Any
maSavedException
;
::
com
::
sun
::
star
::
uno
::
Any
maSavedException
;
void
saveException
(
const
Exception
&
e
);
void
saveException
(
const
Any
&
e
);
void
throwException
(
const
::
rtl
::
Reference
<
FastLocatorImpl
>
&
xDocumentLocator
,
void
throwException
(
const
::
rtl
::
Reference
<
FastLocatorImpl
>
&
xDocumentLocator
,
bool
mbDuringParse
);
bool
mbDuringParse
);
...
@@ -457,7 +458,7 @@ void Entity::startElement( Event *pEvent )
...
@@ -457,7 +458,7 @@ void Entity::startElement( Event *pEvent )
}
}
catch
(
const
Exception
&
e
)
catch
(
const
Exception
&
e
)
{
{
saveException
(
e
);
saveException
(
::
cppu
::
getCaughtException
()
);
}
}
}
}
...
@@ -476,7 +477,7 @@ void Entity::characters( const OUString& sChars )
...
@@ -476,7 +477,7 @@ void Entity::characters( const OUString& sChars )
}
}
catch
(
const
Exception
&
e
)
catch
(
const
Exception
&
e
)
{
{
saveException
(
e
);
saveException
(
::
cppu
::
getCaughtException
()
);
}
}
}
}
...
@@ -500,7 +501,7 @@ void Entity::endElement()
...
@@ -500,7 +501,7 @@ void Entity::endElement()
}
}
catch
(
const
Exception
&
e
)
catch
(
const
Exception
&
e
)
{
{
saveException
(
e
);
saveException
(
::
cppu
::
getCaughtException
()
);
}
}
maContextStack
.
pop
();
maContextStack
.
pop
();
}
}
...
@@ -591,13 +592,14 @@ void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumen
...
@@ -591,13 +592,14 @@ void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumen
// If multi-threaded, we need to push an EXCEPTION event, at
// If multi-threaded, we need to push an EXCEPTION event, at
// which point we transfer ownership of maSavedException to
// which point we transfer ownership of maSavedException to
// the consuming thread.
// the consuming thread.
void
Entity
::
saveException
(
const
Exception
&
e
)
void
Entity
::
saveException
(
const
Any
&
e
)
{
{
// fdo#81214 - allow the parser to run on after an exception,
// fdo#81214 - allow the parser to run on after an exception,
// unexpectedly some 'startElements' produce an UNO_QUERY_THROW
// unexpectedly some 'startElements' produce an UNO_QUERY_THROW
// for XComponent; and yet expect to continue parsing.
// for XComponent; and yet expect to continue parsing.
SAL_WARN
(
"sax"
,
"Unexpected exception from XML parser "
<<
e
.
Message
);
SAL_WARN
(
"sax"
,
"Unexpected exception from XML parser "
maSavedException
<<=
e
;
<<
e
.
get
<
Exception
>
().
Message
);
maSavedException
=
e
;
}
}
}
// namespace
}
// namespace
...
@@ -1134,9 +1136,9 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
...
@@ -1134,9 +1136,9 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
else
else
rEntity
.
startElement
(
&
rEvent
);
rEntity
.
startElement
(
&
rEvent
);
}
}
catch
(
const
Exception
&
e
)
catch
(
const
Exception
&
)
{
{
rEntity
.
saveException
(
e
);
rEntity
.
saveException
(
::
cppu
::
getCaughtException
()
);
}
}
}
}
...
...
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