summaryrefslogtreecommitdiffstats
path: root/unoxml
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-10-04 18:09:56 +0200
committerMichael Stahl <mst@openoffice.org>2010-10-04 18:09:56 +0200
commitca5d8d7810fae5848f52aaa735720e3fd964ccaf (patch)
tree177c85dfc83d3c35ee8839d428a0e9cb66555d90 /unoxml
parentsw34bf01: FontTable::getFontEntry(): put shared_ptr into vector (diff)
parent#i10000# (diff)
downloadcore-ca5d8d7810fae5848f52aaa735720e3fd964ccaf.tar.gz
core-ca5d8d7810fae5848f52aaa735720e3fd964ccaf.zip
merge DEV300_m89
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/prj/d.lst2
-rw-r--r--unoxml/source/dom/node.cxx23
-rw-r--r--unoxml/source/rdf/librdf_services.cxx7
-rw-r--r--unoxml/source/rdf/makefile.mk8
-rw-r--r--unoxml/source/rdf/unordf.component43
-rw-r--r--unoxml/source/service/makefile.mk8
-rw-r--r--unoxml/source/service/services.cxx38
-rw-r--r--unoxml/source/service/unoxml.component43
8 files changed, 125 insertions, 47 deletions
diff --git a/unoxml/prj/d.lst b/unoxml/prj/d.lst
index e2bf5df03b34..4fcedbdba7a2 100644
--- a/unoxml/prj/d.lst
+++ b/unoxml/prj/d.lst
@@ -1,3 +1,5 @@
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
+..\%__SRC%\misc\unordf.component %_DEST%\xml%_EXT%\unordf.component
+..\%__SRC%\misc\unoxml.component %_DEST%\xml%_EXT%\unoxml.component
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index 412f9982fdc7..d4b317b425b3 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -43,13 +43,19 @@
#include "attr.hxx"
#include <com/sun/star/xml/sax/FastToken.hpp>
-
+#include "rtl/instance.hxx"
+#include "osl/mutex.hxx"
#include "../events/eventdispatcher.hxx"
#include "../events/mutationevent.hxx"
#include <boost/bind.hpp>
#include <algorithm>
+namespace {
+//see CNode::remove
+ struct NodeMutex: public ::rtl::Static<osl::Mutex, NodeMutex> {};
+}
+
namespace DOM
{
void pushContext(Context& io_rContext)
@@ -131,6 +137,18 @@ namespace DOM
void CNode::remove(const xmlNodePtr aNode)
{
+ //Using the guard here protects against races when at the same time
+ //CNode::get() is called. This fix helps in many cases but is still
+ //incorrect. remove is called from ~CNode. That is, while the object
+ //is being destructed it can still be obtained by calling CNode::get().
+ //Another bug currently prevents the correct destruction of CNodes. So
+ //the destructor is rarely called.
+ //
+ //Doing this right would probably mean to store WeakReferences in the
+ //map and also guard oder functions. To keep the risk at a minimum
+ //we keep this imperfect fix for the upcoming release and fix it later
+ //properly (http://qa.openoffice.org/issues/show_bug.cgi?id=113682)
+ ::osl::MutexGuard guard(NodeMutex::get());
nodemap_t::iterator i = CNode::theNodeMap.find(aNode);
if (i != CNode::theNodeMap.end())
{
@@ -145,7 +163,8 @@ namespace DOM
CNode* pNode = 0;
if (aNode == NULL)
return 0;
-
+ //see CNode::remove
+ ::osl::MutexGuard guard(NodeMutex::get());
//check whether there is already an instance for this node
nodemap_t::const_iterator i = CNode::theNodeMap.find(aNode);
if (i != CNode::theNodeMap.end())
diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx
index 03949934560d..08e776d214fe 100644
--- a/unoxml/source/rdf/librdf_services.cxx
+++ b/unoxml/source/rdf/librdf_services.cxx
@@ -72,12 +72,5 @@ extern "C" void * SAL_CALL component_getFactory(
implName, serviceManager, registryKey, entries);
}
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return ::cppu::component_writeInfoHelper(serviceManager, registryKey,
- entries);
-}
-
} // extern "C"
diff --git a/unoxml/source/rdf/makefile.mk b/unoxml/source/rdf/makefile.mk
index 3f6d7f445297..1dbcffb8b6ac 100644
--- a/unoxml/source/rdf/makefile.mk
+++ b/unoxml/source/rdf/makefile.mk
@@ -82,3 +82,11 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/unordf.component
+
+$(MISC)/unordf.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ unordf.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt unordf.component
diff --git a/unoxml/source/rdf/unordf.component b/unoxml/source/rdf/unordf.component
new file mode 100644
index 000000000000..a828e7b05d47
--- /dev/null
+++ b/unoxml/source/rdf/unordf.component
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="CBlankNode">
+ <service name="com.sun.star.rdf.BlankNode"/>
+ </implementation>
+ <implementation name="CLiteral">
+ <service name="com.sun.star.rdf.Literal"/>
+ </implementation>
+ <implementation name="CURI">
+ <service name="com.sun.star.rdf.URI"/>
+ </implementation>
+ <implementation name="librdf_Repository">
+ <service name="com.sun.star.rdf.Repository"/>
+ </implementation>
+</component>
diff --git a/unoxml/source/service/makefile.mk b/unoxml/source/service/makefile.mk
index 93aec0746323..5fbe62f67ec4 100644
--- a/unoxml/source/service/makefile.mk
+++ b/unoxml/source/service/makefile.mk
@@ -76,3 +76,11 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/unoxml.component
+
+$(MISC)/unoxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ unoxml.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt unoxml.component
diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx
index 218015852c83..6b1a2f6f0979 100644
--- a/unoxml/source/service/services.cxx
+++ b/unoxml/source/service/services.cxx
@@ -60,44 +60,6 @@ component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, u
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-sal_Bool SAL_CALL
-component_writeInfo(void * /*pServiceManager*/, void* pRegistryKey )
-{
- Reference< XRegistryKey > xKey(reinterpret_cast< XRegistryKey* >(pRegistryKey));
- Reference< XRegistryKey > xNewKey;
- OUString aImpl;
-
- // register DOM service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CDocumentBuilder::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CDocumentBuilder::_getSupportedServiceNames()[0]);
-
- // register DOM service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CSAXDocumentBuilder::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CSAXDocumentBuilder::_getSupportedServiceNames()[0]);
-
- // register XPath service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CXPathAPI::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CXPathAPI::_getSupportedServiceNames()[0]);
-
- // register EventTest service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CTestListener::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CTestListener::_getSupportedServiceNames()[0]);
-
- return sal_True;
-}
-
void* SAL_CALL
component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/)
{
diff --git a/unoxml/source/service/unoxml.component b/unoxml/source/service/unoxml.component
new file mode 100644
index 000000000000..d8c907e6475b
--- /dev/null
+++ b/unoxml/source/service/unoxml.component
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.xml.dom.DocumentBuilder">
+ <service name="com.sun.star.xml.dom.DocumentBuilder"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xml.dom.SAXDocumentBuilder">
+ <service name="com.sun.star.xml.dom.SAXDocumentBuilder"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xml.dom.events.TestListener">
+ <service name="com.sun.star.comp.xml.dom.events.TestListener"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xml.xpath.XPathAPI">
+ <service name="com.sun.star.xml.xpath.XPathAPI"/>
+ </implementation>
+</component>