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
57c23f63
Kaydet (Commit)
57c23f63
authored
14 years ago
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xmlfix3: #i113682#: unoxml: CDocumentBuilder gets a member mutex
üst
e94a328a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
26 deletions
+48
-26
documentbuilder.cxx
unoxml/source/dom/documentbuilder.cxx
+36
-17
documentbuilder.hxx
unoxml/source/dom/documentbuilder.hxx
+12
-9
No files found.
unoxml/source/dom/documentbuilder.cxx
Dosyayı görüntüle @
57c23f63
...
...
@@ -25,9 +25,15 @@
*
************************************************************************/
#include "documentbuilder.hxx"
#include "node.hxx"
#include "document.hxx"
#include <documentbuilder.hxx>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <libxml/xmlerror.h>
#include <libxml/tree.h>
#include <rtl/alloc.h>
#include <rtl/memory.h>
...
...
@@ -35,17 +41,15 @@
#include <cppuhelper/implbase1.hxx>
#include <libxml/xmlerror.h>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <node.hxx>
#include <document.hxx>
using
::
rtl
::
OUStringBuffer
;
...
...
@@ -101,9 +105,10 @@ namespace DOM
};
CDocumentBuilder
::
CDocumentBuilder
(
const
Reference
<
XMultiServiceFactory
>&
xFactory
)
:
m_aFactory
(
xFactory
)
,
m_aEntityResolver
(
Reference
<
XEntityResolver
>
(
new
CDefaultEntityResolver
()))
CDocumentBuilder
::
CDocumentBuilder
(
Reference
<
XMultiServiceFactory
>
const
&
xFactory
)
:
m_xFactory
(
xFactory
)
,
m_xEntityResolver
(
new
CDefaultEntityResolver
())
{
// init libxml. libxml will protect itself against multiple
// initializations so there is no problem here if this gets
...
...
@@ -182,6 +187,8 @@ namespace DOM
Reference
<
XDocument
>
SAL_CALL
CDocumentBuilder
::
newDocument
()
throw
(
RuntimeException
)
{
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
// create a new document
xmlDocPtr
pDocument
=
xmlNewDoc
((
const
xmlChar
*
)
"1.0"
);
Reference
<
XDocument
>
const
xRet
(
...
...
@@ -328,6 +335,7 @@ namespace DOM
Reference
<
XDocument
>
SAL_CALL
CDocumentBuilder
::
parse
(
const
Reference
<
XInputStream
>&
is
)
throw
(
RuntimeException
,
SAXParseException
,
IOException
)
{
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
// encoding...
/*
...
...
@@ -366,6 +374,8 @@ namespace DOM
Reference
<
XDocument
>
SAL_CALL
CDocumentBuilder
::
parseSource
(
const
InputSource
&
is
)
throw
(
RuntimeException
,
SAXParseException
,
IOException
)
{
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
// if there is an encoding specified in the input source, use it
xmlCharEncoding
enc
=
XML_CHAR_ENCODING_NONE
;
if
(
is
.
sEncoding
.
getLength
()
>
0
)
{
...
...
@@ -396,6 +406,8 @@ namespace DOM
Reference
<
XDocument
>
SAL_CALL
CDocumentBuilder
::
parseURI
(
const
OUString
&
sUri
)
throw
(
RuntimeException
,
SAXParseException
,
IOException
)
{
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
xmlParserCtxtPtr
ctxt
=
xmlNewParserCtxt
();
ctxt
->
_private
=
this
;
ctxt
->
sax
->
error
=
error_func
;
...
...
@@ -414,22 +426,29 @@ namespace DOM
return
xRet
;
}
void
SAL_CALL
CDocumentBuilder
::
setEntityResolver
(
const
Reference
<
XEntityResolver
>&
er
)
void
SAL_CALL
CDocumentBuilder
::
setEntityResolver
(
Reference
<
XEntityResolver
>
const
&
xER
)
throw
(
RuntimeException
)
{
m_aEntityResolver
=
er
;
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
m_xEntityResolver
=
xER
;
}
Reference
<
XEntityResolver
>
SAL_CALL
CDocumentBuilder
::
getEntityResolver
()
throw
(
RuntimeException
)
{
return
m_aEntityResolver
;
}
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
return
m_xEntityResolver
;
}
void
SAL_CALL
CDocumentBuilder
::
setErrorHandler
(
const
Reference
<
XErrorHandler
>&
eh
)
void
SAL_CALL
CDocumentBuilder
::
setErrorHandler
(
Reference
<
XErrorHandler
>
const
&
xEH
)
throw
(
RuntimeException
)
{
m_aErrorHandler
=
eh
;
::
osl
::
MutexGuard
const
g
(
m_Mutex
);
m_xErrorHandler
=
xEH
;
}
}
This diff is collapsed.
Click to expand it.
unoxml/source/dom/documentbuilder.hxx
Dosyayı görüntüle @
57c23f63
...
...
@@ -25,16 +25,17 @@
*
************************************************************************/
#ifndef _DOCUMENTBUILDER_HXX
#define _DOCUMENTBUILDER_HXX
#ifndef
DOM
_DOCUMENTBUILDER_HXX
#define
DOM
_DOCUMENTBUILDER_HXX
#include <sal/types.h>
#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/xml/dom/XDOMImplementation.hpp>
...
...
@@ -44,10 +45,8 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "libxml/tree.h"
using
::
rtl
::
OUString
;
using
namespace
com
::
sun
::
star
::
uno
;
...
...
@@ -67,9 +66,11 @@ namespace DOM
:
public
CDocumentBuilder_Base
{
private
:
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
m_aFactory
;
Reference
<
XEntityResolver
>
m_aEntityResolver
;
Reference
<
XErrorHandler
>
m_aErrorHandler
;
::
osl
::
Mutex
m_Mutex
;
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
const
m_xFactory
;
Reference
<
XEntityResolver
>
m_xEntityResolver
;
Reference
<
XErrorHandler
>
m_xErrorHandler
;
public
:
...
...
@@ -79,7 +80,9 @@ namespace DOM
xFactory
);
// call for factory
static
Reference
<
XInterface
>
getInstance
(
const
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
xFactory
);
static
Reference
<
XInterface
>
getInstance
(
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
const
&
xFactory
);
// static helpers for service info and component management
static
const
char
*
aImplementationName
;
...
...
This diff is collapsed.
Click to expand it.
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