From d772f4cada5c0b78299c2d7f178504ce283b49e3 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 6 Oct 2010 09:56:29 +0200 Subject: include redland.h instead of librdf.h Oh, how I love non-self-contained headers! --- unoxml/source/rdf/librdf_repository.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index a7e50e7e232d..329c96e0ae35 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include -- cgit From 7d5fc9037287286857aa8506df1c661667ca0b41 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 6 Oct 2010 09:58:34 +0200 Subject: remove duplicate includes --- unoxml/source/rdf/librdf_repository.cxx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 329c96e0ae35..aaf911cc393b 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -39,6 +39,8 @@ #include #include +#include + #include #include @@ -64,19 +66,6 @@ #include #include #include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include /** -- cgit From 92586f4e0be870a22b95824c2d2a5cd5cdbebee6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 7 Oct 2010 11:39:11 +0100 Subject: #i112783# ownership cycles in unoxml --- unoxml/source/dom/document.cxx | 38 -------------------------------------- unoxml/source/dom/document.hxx | 5 ----- unoxml/source/dom/node.cxx | 16 ++++------------ 3 files changed, 4 insertions(+), 55 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 656aa1cbef6c..fcd43832adf0 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -53,50 +53,12 @@ namespace DOM { - void CDocument::addnode(xmlNodePtr aNode) - { - if (aNode != (xmlNodePtr)m_aDocPtr) - { - Reference< XNode >* nref = new Reference< XNode >(CNode::get(aNode)); - m_aNodeRefList.push_back(nref); - } - } - CDocument::~CDocument() { - Reference< XNode >* pRef; - nodereflist_t::const_iterator r = m_aNodeRefList.begin(); - while (r!=m_aNodeRefList.end()) - { - pRef = *r; - delete pRef; - r++; - } - - // get rid of leftover instances, if anybody still holds a - // reference to one of these, it will be invalid! - /* - CNode* aNode = 0; - nodelist_t::const_iterator i = m_aNodeList.begin(); - while (i!=m_aNodeList.end()) - { - aNode = CNode::get(*i, sal_False); - if (aNode != 0) - { - // CNode::remove(*i); - // delete will remove - delete aNode; - } - i++; - } - */ - xmlFreeDoc(m_aDocPtr); - } CDocument::CDocument(xmlDocPtr aDocPtr): - m_aNodeRefList(), m_aDocPtr(aDocPtr), m_streamListeners() { diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx index b653619031a1..3fe593ff2b24 100644 --- a/unoxml/source/dom/document.hxx +++ b/unoxml/source/dom/document.hxx @@ -72,12 +72,9 @@ namespace DOM XActiveDataControl, XActiveDataSource, XSAXSerializable, XFastSAXSerializable> { friend class CNode; - typedef std::list< Reference< XNode >* > nodereflist_t; typedef set< Reference< XStreamListener > > listenerlist_t; private: - nodereflist_t m_aNodeRefList; - xmlDocPtr m_aDocPtr; // datacontrol/source state @@ -87,8 +84,6 @@ namespace DOM protected: CDocument(xmlDocPtr aDocPtr); - void addnode(xmlNodePtr aNode); - public: virtual ~CDocument(); diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index fb4a6bf508b3..d4b317b425b3 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -228,7 +228,7 @@ namespace DOM // m_aNodeType = NodeType::NOTATION_NODE; pNode = static_cast< CNode* >(new CAttr((xmlAttrPtr)aNode)); break; - // unsopported node types + // unsupported node types case XML_HTML_DOCUMENT_NODE: case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: @@ -238,18 +238,10 @@ namespace DOM pNode = 0; break; } - } - if ( pNode != 0 ) - { - if(CNode::theNodeMap.insert(nodemap_t::value_type(aNode, pNode)).second) + + if ( pNode != 0 ) { - // insertion done, register node with document - xmlDocPtr doc = aNode->doc; - if( doc != NULL) - { - CDocument* pDoc = static_cast< CDocument* >(CNode::get((xmlNodePtr)doc)); - pDoc->addnode(aNode); - } else + if(!CNode::theNodeMap.insert(nodemap_t::value_type(aNode, pNode)).second) { // if insertion failed, delete the new instance and return null delete pNode; -- cgit From 46a924d34890f64e168ab247bcdad47cfc44a889 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Tue, 12 Oct 2010 15:56:41 +0200 Subject: Add vim/emacs modelines to all source files Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail 1286706307.1871.1399280959@webmail.messagingengine.com) Signed-off-by: Sebastian Spaeth --- unoxml/source/dom/attr.cxx | 3 +++ unoxml/source/dom/attributesmap.cxx | 3 +++ unoxml/source/dom/cdatasection.cxx | 3 +++ unoxml/source/dom/characterdata.cxx | 2 ++ unoxml/source/dom/childlist.cxx | 3 +++ unoxml/source/dom/comment.cxx | 3 +++ unoxml/source/dom/document.cxx | 3 +++ unoxml/source/dom/documentbuilder.cxx | 3 +++ unoxml/source/dom/documentfragment.cxx | 3 +++ unoxml/source/dom/documenttype.cxx | 3 +++ unoxml/source/dom/domimplementation.cxx | 3 +++ unoxml/source/dom/element.cxx | 3 +++ unoxml/source/dom/elementlist.cxx | 3 +++ unoxml/source/dom/entitiesmap.cxx | 3 +++ unoxml/source/dom/entity.cxx | 3 +++ unoxml/source/dom/entityreference.cxx | 3 +++ unoxml/source/dom/node.cxx | 2 ++ unoxml/source/dom/notation.cxx | 3 +++ unoxml/source/dom/notationsmap.cxx | 3 +++ unoxml/source/dom/processinginstruction.cxx | 3 +++ unoxml/source/dom/saxbuilder.cxx | 3 +++ unoxml/source/dom/text.cxx | 3 +++ unoxml/source/events/event.cxx | 3 +++ unoxml/source/events/eventdispatcher.cxx | 3 +++ unoxml/source/events/mouseevent.cxx | 2 ++ unoxml/source/events/mutationevent.cxx | 2 ++ unoxml/source/events/testlistener.cxx | 3 +++ unoxml/source/events/uievent.cxx | 3 +++ unoxml/source/rdf/CBlankNode.cxx | 2 ++ unoxml/source/rdf/CLiteral.cxx | 2 ++ unoxml/source/rdf/CURI.cxx | 2 ++ unoxml/source/rdf/librdf_repository.cxx | 2 ++ unoxml/source/rdf/librdf_services.cxx | 2 ++ unoxml/source/service/services.cxx | 3 +++ unoxml/source/xpath/nodelist.cxx | 2 ++ unoxml/source/xpath/xpathapi.cxx | 3 +++ unoxml/source/xpath/xpathobject.cxx | 2 ++ unoxml/test/domtest.cxx | 2 ++ 38 files changed, 102 insertions(+) (limited to 'unoxml') diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx index a1773a7db99f..b357bec51785 100644 --- a/unoxml/source/dom/attr.cxx +++ b/unoxml/source/dom/attr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -151,3 +152,5 @@ namespace DOM } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/attributesmap.cxx b/unoxml/source/dom/attributesmap.cxx index c411365cf1b0..16b9f87bf3f9 100644 --- a/unoxml/source/dom/attributesmap.cxx +++ b/unoxml/source/dom/attributesmap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -209,3 +210,5 @@ namespace DOM // return Reference< XNode >(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/cdatasection.cxx b/unoxml/source/dom/cdatasection.cxx index 7c775484770c..2f432138c0e0 100644 --- a/unoxml/source/dom/cdatasection.cxx +++ b/unoxml/source/dom/cdatasection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,3 +59,5 @@ namespace DOM return CCharacterData::getData(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index 8a8407678272..c5e09540b79c 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -231,3 +232,4 @@ namespace DOM } // namspace DOM +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/childlist.cxx b/unoxml/source/dom/childlist.cxx index aaa6e157225d..22189c29d3eb 100644 --- a/unoxml/source/dom/childlist.cxx +++ b/unoxml/source/dom/childlist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ namespace DOM return aNode; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/comment.cxx b/unoxml/source/dom/comment.cxx index f0f14a2d944a..4b7dd5a72154 100644 --- a/unoxml/source/dom/comment.cxx +++ b/unoxml/source/dom/comment.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,5 @@ namespace DOM return CCharacterData::getData(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index fcd43832adf0..d405a79a808f 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -711,3 +712,5 @@ namespace DOM fastSaxify(aContext); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 484c04b7f23b..3f6d67d53811 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -427,3 +428,5 @@ namespace DOM m_aErrorHandler = eh; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/documentfragment.cxx b/unoxml/source/dom/documentfragment.cxx index a3f5ac40b5aa..9e93449b001c 100644 --- a/unoxml/source/dom/documentfragment.cxx +++ b/unoxml/source/dom/documentfragment.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ namespace DOM return OUString(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/documenttype.cxx b/unoxml/source/dom/documenttype.cxx index bc5004dfd23c..8179221afba7 100644 --- a/unoxml/source/dom/documenttype.cxx +++ b/unoxml/source/dom/documenttype.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,3 +126,5 @@ namespace DOM return OUString(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/domimplementation.cxx b/unoxml/source/dom/domimplementation.cxx index 5d80147e7fb6..f2a7ed9b112d 100644 --- a/unoxml/source/dom/domimplementation.cxx +++ b/unoxml/source/dom/domimplementation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,5 @@ namespace DOM return sal_False; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 7de79e39e3e4..2c4264f07cf3 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -647,3 +648,5 @@ namespace DOM } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx index 8db7b2d3bcb4..15a870aed933 100644 --- a/unoxml/source/dom/elementlist.cxx +++ b/unoxml/source/dom/elementlist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,3 +132,5 @@ namespace DOM m_bRebuild = sal_True; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/entitiesmap.cxx b/unoxml/source/dom/entitiesmap.cxx index 98db3d2c7395..9233aa42d194 100644 --- a/unoxml/source/dom/entitiesmap.cxx +++ b/unoxml/source/dom/entitiesmap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,3 +99,5 @@ namespace DOM return Reference< XNode >(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/entity.cxx b/unoxml/source/dom/entity.cxx index de711ae62d8d..f9e8fc2564bc 100644 --- a/unoxml/source/dom/entity.cxx +++ b/unoxml/source/dom/entity.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -88,3 +89,5 @@ namespace DOM return OUString(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/entityreference.cxx b/unoxml/source/dom/entityreference.cxx index 6cdce0c8ed3d..1bfe018e8694 100644 --- a/unoxml/source/dom/entityreference.cxx +++ b/unoxml/source/dom/entityreference.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ namespace DOM return OUString(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index d4b317b425b3..1c8cf054a27b 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1017,3 +1018,4 @@ namespace DOM } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/notation.cxx b/unoxml/source/dom/notation.cxx index 9781b6877eef..c9c869b3e657 100644 --- a/unoxml/source/dom/notation.cxx +++ b/unoxml/source/dom/notation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,5 @@ namespace DOM return OUString(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/notationsmap.cxx b/unoxml/source/dom/notationsmap.cxx index 477d40277374..e34d7ca1ae9d 100644 --- a/unoxml/source/dom/notationsmap.cxx +++ b/unoxml/source/dom/notationsmap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,5 @@ throw (RuntimeException) return Reference< XNode >(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/processinginstruction.cxx b/unoxml/source/dom/processinginstruction.cxx index 37e52086cbd8..f999e36f695e 100644 --- a/unoxml/source/dom/processinginstruction.cxx +++ b/unoxml/source/dom/processinginstruction.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,3 +91,5 @@ namespace DOM return getData(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index e968eee3e2f6..7f64f8924334 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -351,3 +352,5 @@ namespace DOM m_aLocator = aLocator; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/text.cxx b/unoxml/source/dom/text.cxx index d60fcf234ebf..a10ba9944702 100644 --- a/unoxml/source/dom/text.cxx +++ b/unoxml/source/dom/text.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ namespace DOM } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/event.cxx b/unoxml/source/events/event.cxx index 1d41bbba9911..3f6bcc6515ec 100644 --- a/unoxml/source/events/event.cxx +++ b/unoxml/source/events/event.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "event.hxx" namespace DOM { namespace events @@ -60,3 +61,5 @@ namespace DOM { namespace events } }} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx index 4b1c1548bf38..3c1033347bc3 100644 --- a/unoxml/source/events/eventdispatcher.cxx +++ b/unoxml/source/events/eventdispatcher.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "eventdispatcher.hxx" #include "event.hxx" #include "mutationevent.hxx" @@ -196,3 +197,5 @@ namespace DOM { namespace events { return sal_True; } }} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/mouseevent.cxx b/unoxml/source/events/mouseevent.cxx index 362a1149ba72..d18d3eaae782 100644 --- a/unoxml/source/events/mouseevent.cxx +++ b/unoxml/source/events/mouseevent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "mouseevent.hxx" namespace DOM { namespace events @@ -147,3 +148,4 @@ namespace DOM { namespace events } }} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/mutationevent.cxx b/unoxml/source/events/mutationevent.cxx index bc06cb2af61a..46cf61162134 100644 --- a/unoxml/source/events/mutationevent.cxx +++ b/unoxml/source/events/mutationevent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "mutationevent.hxx" namespace DOM { namespace events @@ -98,3 +99,4 @@ namespace DOM { namespace events } }} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx index 64806c84017d..7c65d4ca606d 100644 --- a/unoxml/source/events/testlistener.cxx +++ b/unoxml/source/events/testlistener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -135,3 +136,5 @@ namespace DOM { namespace events } }} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/uievent.cxx b/unoxml/source/events/uievent.cxx index 29d2e10e57dc..881d8147aa17 100644 --- a/unoxml/source/events/uievent.cxx +++ b/unoxml/source/events/uievent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "event.hxx" #include "uievent.hxx" @@ -79,3 +80,5 @@ namespace DOM { namespace events CEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg); } }} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/CBlankNode.cxx b/unoxml/source/rdf/CBlankNode.cxx index 483269002fdc..19f114ea7c07 100644 --- a/unoxml/source/rdf/CBlankNode.cxx +++ b/unoxml/source/rdf/CBlankNode.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -156,3 +157,4 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL _create( } // closing component helper namespace +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/CLiteral.cxx b/unoxml/source/rdf/CLiteral.cxx index 30c72ccc841e..08ebb0a4775c 100644 --- a/unoxml/source/rdf/CLiteral.cxx +++ b/unoxml/source/rdf/CLiteral.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -219,3 +220,4 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL _create( } // closing component helper namespace +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/CURI.cxx b/unoxml/source/rdf/CURI.cxx index 03ce85872635..7d154876aa3a 100644 --- a/unoxml/source/rdf/CURI.cxx +++ b/unoxml/source/rdf/CURI.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -865,3 +866,4 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL _create( } // closing component helper namespace +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index aaf911cc393b..0a3f875e1897 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2235,3 +2236,4 @@ uno::Reference< uno::XInterface > SAL_CALL _create( } // closing component helper namespace +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx index 03949934560d..aaa32a837ae7 100644 --- a/unoxml/source/rdf/librdf_services.cxx +++ b/unoxml/source/rdf/librdf_services.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,3 +82,4 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( } // extern "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx index 218015852c83..00cb14c00cc4 100644 --- a/unoxml/source/service/services.cxx +++ b/unoxml/source/service/services.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -151,3 +152,5 @@ component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, } } // extern "C" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index dd44d8bfcc06..5ae839a4e09b 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,4 @@ namespace XPath } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 80666d9e2031..296629fedeea 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -398,3 +399,5 @@ namespace XPath } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 083d19080c4b..3a68cfd34ce0 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -155,3 +156,4 @@ namespace XPath } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/test/domtest.cxx b/unoxml/test/domtest.cxx index 5d3c2fa212dc..9871846eaea5 100644 --- a/unoxml/test/domtest.cxx +++ b/unoxml/test/domtest.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -397,3 +398,4 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SerializerTest, "SerializerTest"); // to let the user the possibility to also register some functions by hand. NOADDITIONAL; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From b0c951dcc330f4ad49c0da5173c8966654f99d7b Mon Sep 17 00:00:00 2001 From: "J. Graeme Lingard" Date: Wed, 13 Oct 2010 17:56:16 +0100 Subject: Remove redundant include directives & comments --- unoxml/source/events/eventdispatcher.hxx | 1 - 1 file changed, 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/events/eventdispatcher.hxx b/unoxml/source/events/eventdispatcher.hxx index 2af5884842f6..7c7978bb8b06 100644 --- a/unoxml/source/events/eventdispatcher.hxx +++ b/unoxml/source/events/eventdispatcher.hxx @@ -1,5 +1,4 @@ -//#include #include #include -- cgit From 2c8fc9289fe3e6d96adf564bff79a7dbfa3a6f0d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Oct 2010 11:40:14 +0100 Subject: fdo#30825# someone needs to hold the originating node --- unoxml/source/xpath/xpathapi.cxx | 2 +- unoxml/source/xpath/xpathobject.cxx | 4 ++-- unoxml/source/xpath/xpathobject.hxx | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 296629fedeea..22307f4e52ae 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -353,7 +353,7 @@ namespace XPath throw XPathException(); } xmlXPathFreeContext(xpathCtx); - Reference< XXPathObject > aObj(new CXPathObject(xpathObj)); + Reference< XXPathObject > aObj(new CXPathObject(xpathObj, contextNode)); return aObj; } diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 3a68cfd34ce0..8d5343edbe97 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -32,8 +32,8 @@ namespace XPath { - CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj) - : m_pXPathObj(xpathObj, xmlXPathFreeObject) + CXPathObject::CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode) + : m_pXPathObj(xpathObj, xmlXPathFreeObject), m_xContextNode(contextNode) { switch (m_pXPathObj->type) { diff --git a/unoxml/source/xpath/xpathobject.hxx b/unoxml/source/xpath/xpathobject.hxx index 8e256bc8a994..348fae8e21e6 100644 --- a/unoxml/source/xpath/xpathobject.hxx +++ b/unoxml/source/xpath/xpathobject.hxx @@ -52,10 +52,11 @@ namespace XPath { private: boost::shared_ptr m_pXPathObj; + const Reference< XNode > m_xContextNode; XPathObjectType m_xPathObjectType; public: - CXPathObject(xmlXPathObjectPtr xpathObj); + CXPathObject(xmlXPathObjectPtr xpathObj, const Reference< XNode >& contextNode); /** get object type -- cgit From 0e70d593ef28636a54f204b9a395e73f2308f4c4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Oct 2010 13:04:33 +0100 Subject: fdo#30825# fix more ownership issues --- unoxml/source/xpath/nodelist.cxx | 3 ++- unoxml/source/xpath/nodelist.hxx | 3 ++- unoxml/source/xpath/xpathobject.cxx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index 5ae839a4e09b..4d7241e5b738 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -31,8 +31,9 @@ namespace XPath { - CNodeList::CNodeList(boost::shared_ptr& rxpathObj) + CNodeList::CNodeList(boost::shared_ptr& rxpathObj, const Reference< XNode >& contextNode) : m_pNodeSet(0) + , m_xContextNode(contextNode) { if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) { diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx index 68f419f10174..110e048b103c 100644 --- a/unoxml/source/xpath/nodelist.hxx +++ b/unoxml/source/xpath/nodelist.hxx @@ -53,10 +53,11 @@ namespace XPath { private: boost::shared_ptr m_pXPathObj; + const Reference< XNode > m_xContextNode; xmlNodeSetPtr m_pNodeSet; public: - CNodeList(boost::shared_ptr &rxpathObj); + CNodeList(boost::shared_ptr &rxpathObj, const Reference< XNode >& contextNode); /** The number of nodes in the list. */ diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 8d5343edbe97..1e20179a0d01 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -86,7 +86,7 @@ namespace XPath */ Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException) { - return Reference< XNodeList >(new CNodeList(m_pXPathObj)); + return Reference< XNodeList >(new CNodeList(m_pXPathObj, m_xContextNode)); } /** -- cgit From 3d45bbeb3a1bffb334c34725c224154ec1b4606b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Oct 2010 17:30:04 +0100 Subject: fix some more ownerships --- unoxml/source/xpath/xpathapi.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/xpath/xpathapi.hxx b/unoxml/source/xpath/xpathapi.hxx index fdfff24353cc..b2415d70c81b 100644 --- a/unoxml/source/xpath/xpathapi.hxx +++ b/unoxml/source/xpath/xpathapi.hxx @@ -69,7 +69,7 @@ namespace XPath private: nsmap_t m_nsmap; - const Reference < XMultiServiceFactory >& m_aFactory; + const Reference < XMultiServiceFactory > m_aFactory; extensions_t m_extensions; public: -- cgit From 876b99ce56c8d725cc207ca03433b3cb99dfb3eb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Oct 2010 20:45:55 +0100 Subject: WaE: fix init order --- unoxml/source/xpath/nodelist.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index 4d7241e5b738..734df439eb24 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -32,8 +32,8 @@ namespace XPath { CNodeList::CNodeList(boost::shared_ptr& rxpathObj, const Reference< XNode >& contextNode) - : m_pNodeSet(0) - , m_xContextNode(contextNode) + : m_xContextNode(contextNode) + , m_pNodeSet(0) { if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) { -- cgit From 8c97ec61d74261b4dd18b6f65f70be92dd85a794 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 27 Oct 2010 13:03:58 +0100 Subject: add modelines to .hxx files as well --- unoxml/source/dom/attr.hxx | 3 +++ unoxml/source/dom/attributesmap.hxx | 3 +++ unoxml/source/dom/cdatasection.hxx | 3 +++ unoxml/source/dom/characterdata.hxx | 3 +++ unoxml/source/dom/childlist.hxx | 3 +++ unoxml/source/dom/comment.hxx | 3 +++ unoxml/source/dom/document.hxx | 3 +++ unoxml/source/dom/documentbuilder.hxx | 3 +++ unoxml/source/dom/documentfragment.hxx | 2 ++ unoxml/source/dom/documenttype.hxx | 3 +++ unoxml/source/dom/domimplementation.hxx | 3 +++ unoxml/source/dom/element.hxx | 3 +++ unoxml/source/dom/elementlist.hxx | 3 +++ unoxml/source/dom/entitiesmap.hxx | 3 +++ unoxml/source/dom/entity.hxx | 3 +++ unoxml/source/dom/entityreference.hxx | 3 +++ unoxml/source/dom/node.hxx | 3 +++ unoxml/source/dom/notation.hxx | 3 +++ unoxml/source/dom/notationsmap.hxx | 3 +++ unoxml/source/dom/processinginstruction.hxx | 3 +++ unoxml/source/dom/saxbuilder.hxx | 3 +++ unoxml/source/dom/text.hxx | 3 +++ unoxml/source/events/event.hxx | 3 +++ unoxml/source/events/eventdispatcher.hxx | 3 +++ unoxml/source/events/mouseevent.hxx | 3 +++ unoxml/source/events/mutationevent.hxx | 3 +++ unoxml/source/events/testlistener.hxx | 3 +++ unoxml/source/events/uievent.hxx | 3 +++ unoxml/source/rdf/CNodes.hxx | 2 ++ unoxml/source/rdf/librdf_repository.hxx | 2 ++ unoxml/source/xpath/nodelist.hxx | 3 +++ unoxml/source/xpath/xpathapi.hxx | 3 +++ unoxml/source/xpath/xpathobject.hxx | 3 +++ 33 files changed, 96 insertions(+) (limited to 'unoxml') diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx index b79927b46037..75876e68d269 100644 --- a/unoxml/source/dom/attr.hxx +++ b/unoxml/source/dom/attr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -208,3 +209,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/attributesmap.hxx b/unoxml/source/dom/attributesmap.hxx index d19b517251a0..fb91c168c7bc 100644 --- a/unoxml/source/dom/attributesmap.hxx +++ b/unoxml/source/dom/attributesmap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/cdatasection.hxx b/unoxml/source/dom/cdatasection.hxx index 400b2a6a02d3..5480a96cbf1d 100644 --- a/unoxml/source/dom/cdatasection.hxx +++ b/unoxml/source/dom/cdatasection.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -228,3 +229,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/characterdata.hxx b/unoxml/source/dom/characterdata.hxx index 4ff1da570f7c..71bdee336c8f 100644 --- a/unoxml/source/dom/characterdata.hxx +++ b/unoxml/source/dom/characterdata.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -237,3 +238,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/childlist.hxx b/unoxml/source/dom/childlist.hxx index 89b73ff2e113..794b0bc309e3 100644 --- a/unoxml/source/dom/childlist.hxx +++ b/unoxml/source/dom/childlist.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,3 +63,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/comment.hxx b/unoxml/source/dom/comment.hxx index 196c7460399e..400914811a34 100644 --- a/unoxml/source/dom/comment.hxx +++ b/unoxml/source/dom/comment.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -220,3 +221,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx index 3fe593ff2b24..645a6675c7ca 100644 --- a/unoxml/source/dom/document.hxx +++ b/unoxml/source/dom/document.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -359,3 +360,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/documentbuilder.hxx b/unoxml/source/dom/documentbuilder.hxx index 7f5a2079a051..2b53796b41da 100644 --- a/unoxml/source/dom/documentbuilder.hxx +++ b/unoxml/source/dom/documentbuilder.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -155,3 +156,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/documentfragment.hxx b/unoxml/source/dom/documentfragment.hxx index 7649f6368c9a..49b2372c6a4f 100644 --- a/unoxml/source/dom/documentfragment.hxx +++ b/unoxml/source/dom/documentfragment.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -177,3 +178,4 @@ namespace DOM } #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/documenttype.hxx b/unoxml/source/dom/documenttype.hxx index 4ea6d0c89219..5472db62a0fa 100644 --- a/unoxml/source/dom/documenttype.hxx +++ b/unoxml/source/dom/documenttype.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -215,3 +216,5 @@ namespace DOM }; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/domimplementation.hxx b/unoxml/source/dom/domimplementation.hxx index e0282fa8e3f4..55c0cd309648 100644 --- a/unoxml/source/dom/domimplementation.hxx +++ b/unoxml/source/dom/domimplementation.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,3 +72,5 @@ namespace DOM }; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/element.hxx b/unoxml/source/dom/element.hxx index d0df7102f12f..71d005ba97a2 100644 --- a/unoxml/source/dom/element.hxx +++ b/unoxml/source/dom/element.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -294,3 +295,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/elementlist.hxx b/unoxml/source/dom/elementlist.hxx index 0ebfd2722eea..82568064eca0 100644 --- a/unoxml/source/dom/elementlist.hxx +++ b/unoxml/source/dom/elementlist.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,3 +85,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/entitiesmap.hxx b/unoxml/source/dom/entitiesmap.hxx index 8480f1e0eecd..a2590a0e1168 100644 --- a/unoxml/source/dom/entitiesmap.hxx +++ b/unoxml/source/dom/entitiesmap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/entity.hxx b/unoxml/source/dom/entity.hxx index 0343a13dda16..7c8b063b216a 100644 --- a/unoxml/source/dom/entity.hxx +++ b/unoxml/source/dom/entity.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/entityreference.hxx b/unoxml/source/dom/entityreference.hxx index 1ab8217bc628..a7dc7598be43 100644 --- a/unoxml/source/dom/entityreference.hxx +++ b/unoxml/source/dom/entityreference.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -174,3 +175,5 @@ namespace DOM }; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/node.hxx b/unoxml/source/dom/node.hxx index a4397e7053fd..be84ee49087c 100644 --- a/unoxml/source/dom/node.hxx +++ b/unoxml/source/dom/node.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -352,3 +353,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/notation.hxx b/unoxml/source/dom/notation.hxx index a8fdf7994fc4..523a8408a981 100644 --- a/unoxml/source/dom/notation.hxx +++ b/unoxml/source/dom/notation.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -189,3 +190,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/notationsmap.hxx b/unoxml/source/dom/notationsmap.hxx index 9c950c64de4c..d02c09f9ac9e 100644 --- a/unoxml/source/dom/notationsmap.hxx +++ b/unoxml/source/dom/notationsmap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/processinginstruction.hxx b/unoxml/source/dom/processinginstruction.hxx index b794d31e159d..d1be64bc5f05 100644 --- a/unoxml/source/dom/processinginstruction.hxx +++ b/unoxml/source/dom/processinginstruction.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -196,3 +197,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/saxbuilder.hxx b/unoxml/source/dom/saxbuilder.hxx index c243877aae2b..68cadbb872f8 100644 --- a/unoxml/source/dom/saxbuilder.hxx +++ b/unoxml/source/dom/saxbuilder.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -148,3 +149,5 @@ namespace DOM } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/dom/text.hxx b/unoxml/source/dom/text.hxx index a99f4ff2aa5d..e7dcfca32c04 100644 --- a/unoxml/source/dom/text.hxx +++ b/unoxml/source/dom/text.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -239,3 +240,5 @@ namespace DOM }; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/event.hxx b/unoxml/source/events/event.hxx index 3620d84374dc..578be586a5cc 100644 --- a/unoxml/source/events/event.hxx +++ b/unoxml/source/events/event.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef __EVENT_HXX #define __EVENT_HXX @@ -68,3 +69,5 @@ public: }; }} #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/eventdispatcher.hxx b/unoxml/source/events/eventdispatcher.hxx index 7c7978bb8b06..cd8f7fd608d6 100644 --- a/unoxml/source/events/eventdispatcher.hxx +++ b/unoxml/source/events/eventdispatcher.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include #include @@ -48,3 +49,5 @@ public: sal_Bool bCapture); }; }} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/mouseevent.hxx b/unoxml/source/events/mouseevent.hxx index d70f1c1ac605..76b5189edd3d 100644 --- a/unoxml/source/events/mouseevent.hxx +++ b/unoxml/source/events/mouseevent.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef __MOUSEEVENT_HXX #define __MOUSEEVENT_HXX @@ -90,3 +91,5 @@ public: }; }} #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/mutationevent.hxx b/unoxml/source/events/mutationevent.hxx index e28613ad5df9..f096dbc178a8 100644 --- a/unoxml/source/events/mutationevent.hxx +++ b/unoxml/source/events/mutationevent.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef __MUTATIONEVENT_HXX #define __MUTATIONEVENT_HXX @@ -64,3 +65,5 @@ public: }; }} #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/testlistener.hxx b/unoxml/source/events/testlistener.hxx index b6d6abdc700f..088c8278622a 100644 --- a/unoxml/source/events/testlistener.hxx +++ b/unoxml/source/events/testlistener.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -104,3 +105,5 @@ namespace DOM { namespace events }} #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/events/uievent.hxx b/unoxml/source/events/uievent.hxx index f7c5806e48e0..fdfeae5b395f 100644 --- a/unoxml/source/events/uievent.hxx +++ b/unoxml/source/events/uievent.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef __UIEVENT_HXX #define __UIEVENT_HXX @@ -53,3 +54,5 @@ public: }; }} #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/CNodes.hxx b/unoxml/source/rdf/CNodes.hxx index f9ba6bb9048c..46e8daa3eb89 100644 --- a/unoxml/source/rdf/CNodes.hxx +++ b/unoxml/source/rdf/CNodes.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,3 +73,4 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL _create( css::uno::Referenc #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/rdf/librdf_repository.hxx b/unoxml/source/rdf/librdf_repository.hxx index 0af918a1eabe..10bff77ac7a9 100644 --- a/unoxml/source/rdf/librdf_repository.hxx +++ b/unoxml/source/rdf/librdf_repository.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL _create( css::uno::Referenc #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx index 110e048b103c..de0b1d287155 100644 --- a/unoxml/source/xpath/nodelist.hxx +++ b/unoxml/source/xpath/nodelist.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ namespace XPath } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/xpath/xpathapi.hxx b/unoxml/source/xpath/xpathapi.hxx index b2415d70c81b..67f744950a3f 100644 --- a/unoxml/source/xpath/xpathapi.hxx +++ b/unoxml/source/xpath/xpathapi.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,3 +141,5 @@ namespace XPath } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoxml/source/xpath/xpathobject.hxx b/unoxml/source/xpath/xpathobject.hxx index 348fae8e21e6..b8eda758bc58 100644 --- a/unoxml/source/xpath/xpathobject.hxx +++ b/unoxml/source/xpath/xpathobject.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -112,3 +113,5 @@ namespace XPath } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From 6072f27fecff80f6c2e78c44f61068495e61fb2c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 26 Nov 2010 21:35:36 +0000 Subject: cppcheck: use prefix variant --- unoxml/source/dom/saxbuilder.cxx | 12 ++++++------ unoxml/source/xpath/xpathapi.cxx | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 7f64f8924334..50b611445d7c 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -263,10 +263,8 @@ namespace DOM attr_qname = a->first; attr_value = a->second; idx = attr_qname.indexOf(':'); - if(idx != -1) - { + if (idx != -1) aPrefix = attr_qname.copy(0, idx); - } else aPrefix = OUString(); @@ -275,11 +273,13 @@ namespace DOM { // set attribute with namespace aElement->setAttributeNS(result->second, attr_qname, attr_value); - } else { + } + else + { // set attribute without namespace aElement->setAttribute(attr_qname, attr_value); - } - a++; + } + ++a; } m_aNSStack.push(aNSMap); } diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 22307f4e52ae..aa83217797d1 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -134,7 +134,7 @@ namespace XPath p = (xmlChar*)oprefix.getStr(); u = (xmlChar*)ouri.getStr(); xmlXPathRegisterNs(ctx, p, u); - i++; + ++i; } } @@ -185,7 +185,7 @@ namespace XPath reinterpret_cast( sal::static_int_cast(aHandle.variableData))); } - i++; + ++i; } } -- cgit From 36c323e365c3b480f10a2bb6c6227a4592f70c2a Mon Sep 17 00:00:00 2001 From: Gert Faller Date: Sat, 27 Nov 2010 10:13:34 +0100 Subject: RTL_CONSTASCII_USTRINGPARAM in filters 3-4 --- unoxml/source/dom/cdatasection.cxx | 2 +- unoxml/source/dom/characterdata.cxx | 4 ++-- unoxml/source/dom/comment.cxx | 2 +- unoxml/source/dom/document.cxx | 10 +++++----- unoxml/source/dom/documentbuilder.cxx | 4 ++-- unoxml/source/dom/documentfragment.cxx | 2 +- unoxml/source/dom/element.cxx | 20 ++++++++++---------- unoxml/source/dom/elementlist.cxx | 2 +- unoxml/source/dom/node.cxx | 12 ++++++------ unoxml/source/dom/saxbuilder.cxx | 8 ++++---- unoxml/source/dom/text.cxx | 2 +- unoxml/source/events/testlistener.cxx | 10 +++++----- unoxml/source/rdf/librdf_repository.cxx | 18 +++++++----------- unoxml/source/xpath/xpathapi.cxx | 6 +++--- unoxml/test/domtest.cxx | 2 +- 15 files changed, 50 insertions(+), 54 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/cdatasection.cxx b/unoxml/source/dom/cdatasection.cxx index 2f432138c0e0..1bb7d6d72f19 100644 --- a/unoxml/source/dom/cdatasection.cxx +++ b/unoxml/source/dom/cdatasection.cxx @@ -51,7 +51,7 @@ namespace DOM OUString SAL_CALL CCDATASection::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#cdata-section"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#cdata-section")); } OUString SAL_CALL CCDATASection::getNodeValue() throw (RuntimeException) diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index c5e09540b79c..060d33d3f546 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -41,9 +41,9 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMCharacterDataModified")), UNO_QUERY); + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMCharacterDataModified"))), UNO_QUERY); event->initMutationEvent( - OUString::createFromAscii("DOMCharacterDataModified"), + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMCharacterDataModified")), sal_True, sal_False, Reference< XNode >(), prevValue, newValue, OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); diff --git a/unoxml/source/dom/comment.cxx b/unoxml/source/dom/comment.cxx index 4b7dd5a72154..d7a8ff605f43 100644 --- a/unoxml/source/dom/comment.cxx +++ b/unoxml/source/dom/comment.cxx @@ -49,7 +49,7 @@ namespace DOM OUString SAL_CALL CComment::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#comment"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#comment")); } OUString SAL_CALL CComment::getNodeValue() throw (RuntimeException) diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index d405a79a808f..30bf37620472 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -504,7 +504,7 @@ namespace DOM { if (aNsPrefix.getLength() > 0) - aQName = aNsPrefix + OUString::createFromAscii(":") + aQName; + aQName = aNsPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aQName; newElement = createElementNS(aNsUri, aQName); } else @@ -524,7 +524,7 @@ namespace DOM if (aAttrUri.getLength() > 0) { if (aAttrPrefix.getLength() > 0) - aAttrName = aAttrPrefix + OUString::createFromAscii(":") + aAttrName; + aAttrName = aAttrPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aAttrName; newElement->setAttributeNS(aAttrUri, aAttrName, curAttr->getValue()); } else @@ -590,8 +590,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMNodeInsertedIntoDocument")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMNodeInsertedIntoDocument") + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument")) , sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -601,7 +601,7 @@ namespace DOM } OUString SAL_CALL CDocument::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#document"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#document")); } OUString SAL_CALL CDocument::getNodeValue() throw (RuntimeException) { diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 3f6d67d53811..1c7f3140a33e 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -297,7 +297,7 @@ namespace DOM // default warning handler triggers assertion static void warning_func(void * ctx, const char * /*msg*/, ...) { - OUStringBuffer buf(OUString::createFromAscii("libxml2 warning\n")); + OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 warning\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, msg.getStr()); @@ -306,7 +306,7 @@ namespace DOM // default error handler triggers assertion static void error_func(void * ctx, const char * /*msg*/, ...) { - OUStringBuffer buf(OUString::createFromAscii("libxml2 error\n")); + OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, msg.getStr()); diff --git a/unoxml/source/dom/documentfragment.cxx b/unoxml/source/dom/documentfragment.cxx index 9e93449b001c..00c344f77bad 100644 --- a/unoxml/source/dom/documentfragment.cxx +++ b/unoxml/source/dom/documentfragment.cxx @@ -37,7 +37,7 @@ namespace DOM } OUString SAL_CALL CDocumentFragment::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#document-fragment"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#document-fragment")); } OUString SAL_CALL CDocumentFragment::getNodeValue() throw (RuntimeException) { diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 2c4264f07cf3..1f86e33c9185 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -53,7 +53,7 @@ namespace DOM if (!i_xHandler.is()) throw RuntimeException(); comphelper::AttributeList *pAttrs = new comphelper::AttributeList(); - OUString type = OUString::createFromAscii(""); + OUString type = OUString(); // add namespace definitions to attributes for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != 0; pNs = pNs->next) { const xmlChar *pPrefix = pNs->prefix; @@ -61,8 +61,8 @@ namespace DOM strlen(reinterpret_cast(pPrefix)), RTL_TEXTENCODING_UTF8); OUString name = (prefix.equalsAscii("")) - ? OUString::createFromAscii("xmlns") - : OUString::createFromAscii("xmlns:") + prefix; + ? OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns")) + : OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:")) + prefix; const xmlChar *pHref = pNs->href; OUString val(reinterpret_cast(pHref), strlen(reinterpret_cast(pHref)), @@ -463,8 +463,8 @@ namespace DOM // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, Reference< XNode >(aAttr, UNO_QUERY), OUString(), aAttr->getValue(), aAttr->getName(), AttrChangeType_ADDITION); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -518,8 +518,8 @@ namespace DOM Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, Reference< XNode >(getAttributeNode(name), UNO_QUERY), oldValue, value, name, aChangeType); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -588,8 +588,8 @@ namespace DOM // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), sal_True, sal_False, + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString((char*)xLName, strlen((char*)xLName), RTL_TEXTENCODING_UTF8)), UNO_QUERY), oldValue, value, qualifiedName, aChangeType); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -632,7 +632,7 @@ namespace DOM void SAL_CALL CElement::setElementName(const OUString& aName) throw (RuntimeException, DOMException) { - if (aName.getLength() > 0 && aName.indexOf(OUString::createFromAscii(":")) < 0) + if (aName.getLength() > 0 && aName.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM(":"))) < 0) { OString oName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8); xmlChar *xName = (xmlChar*)oName.getStr(); diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx index 15a870aed933..5b0d96758459 100644 --- a/unoxml/source/dom/elementlist.cxx +++ b/unoxml/source/dom/elementlist.cxx @@ -66,7 +66,7 @@ namespace DOM // get the XNode Reference< XNode > xNode(CNode::get(static_cast(pElement)->m_aNodePtr)); Reference< XEventTarget > xTarget(xNode, UNO_QUERY_THROW); - OUString aType = OUString::createFromAscii("DOMSubtreeModified"); + OUString aType(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified")); sal_Bool capture = sal_False; xTarget->addEventListener(aType, Reference< XEventListener >(this), capture); } catch (Exception &e){ diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 1c8cf054a27b..79f42b6fd1f9 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -466,8 +466,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMNodeInserted")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMNodeInserted") + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInserted"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInserted")) , sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -861,8 +861,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMNodeRemoved")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMNodeRemoved"), sal_True, + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeRemoved"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeRemoved")), sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -950,8 +950,8 @@ namespace DOM // target is _this_ node Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMSubtreeModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMSubtreeModified"), sal_True, + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified")), sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 50b611445d7c..d6d87754eb6a 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -164,7 +164,7 @@ namespace DOM throw SAXException(); Reference< XDocumentBuilder > aBuilder(m_aServiceManager->createInstance( - OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), UNO_QUERY_THROW); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.DocumentBuilder"))), UNO_QUERY_THROW); Reference< XDocument > aDocument = aBuilder->newDocument(); m_aNodeStack.push(Reference< XNode >(aDocument, UNO_QUERY)); m_aDocument = aDocument; @@ -210,12 +210,12 @@ namespace DOM attr_qname = attribs->getNameByIndex(i); attr_value = attribs->getValueByIndex(i); // new prefix mapping - if (attr_qname.indexOf(OUString::createFromAscii("xmlns:")) == 0) + if (attr_qname.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:"))) == 0) { newprefix = attr_qname.copy(attr_qname.indexOf(':')+1); aNSMap.insert(NSMap::value_type(newprefix, attr_value)); } - else if (attr_qname == OUString::createFromAscii("xmlns")) + else if (attr_qname == OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns"))) { // new default prefix aNSMap.insert(NSMap::value_type(OUString(), attr_value)); @@ -300,7 +300,7 @@ namespace DOM OUString aRefName; OUString aPrefix = aElement->getPrefix(); if (aPrefix.getLength() > 0) - aRefName = aPrefix + OUString::createFromAscii(":") + aElement->getTagName(); + aRefName = aPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aElement->getTagName(); else aRefName = aElement->getTagName(); if (aRefName != aName) // consistency check diff --git a/unoxml/source/dom/text.cxx b/unoxml/source/dom/text.cxx index a10ba9944702..520adf3b77e3 100644 --- a/unoxml/source/dom/text.cxx +++ b/unoxml/source/dom/text.cxx @@ -54,7 +54,7 @@ namespace DOM OUString SAL_CALL CText::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#text"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#text")); } void SAL_CALL CText::fastSaxify( Context& io_rContext ) diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx index 7c65d4ca606d..ee307fa27220 100644 --- a/unoxml/source/events/testlistener.cxx +++ b/unoxml/source/events/testlistener.cxx @@ -92,21 +92,21 @@ namespace DOM { namespace events void SAL_CALL CTestListener::initialize(const Sequence< Any >& args) throw(RuntimeException) { if (args.getLength() < 3) throw IllegalArgumentException( - OUString::createFromAscii("Wrong number of arguments"), Reference< XInterface >(), 0); + OUString(RTL_CONSTASCII_USTRINGPARAM("Wrong number of arguments")), Reference< XInterface >(), 0); Reference aTarget; if(! (args[0] >>= aTarget)) throw IllegalArgumentException( - OUString::createFromAscii("Illegal argument 1"), Reference< XInterface >(), 1); + OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 1")), Reference< XInterface >(), 1); OUString aType; if (! (args[1] >>= aType)) - throw IllegalArgumentException(OUString::createFromAscii("Illegal argument 2"), Reference< XInterface >(), 2); + throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 2")), Reference< XInterface >(), 2); sal_Bool bCapture = sal_False; if(! (args[2] >>= bCapture)) throw IllegalArgumentException( - OUString::createFromAscii("Illegal argument 3"), Reference< XInterface >(), 3); + OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 3")), Reference< XInterface >(), 3); - if(! (args[3] >>= m_name)) m_name = OUString::createFromAscii(""); + if(! (args[3] >>= m_name)) m_name = OUString(RTL_CONSTASCII_USTRINGPARAM("")); m_target = aTarget; m_type = aType; diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 0a3f875e1897..2519fd29e411 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1382,14 +1382,10 @@ void SAL_CALL librdf_Repository::setStatementRDFa( throw (uno::RuntimeException, lang::IllegalArgumentException, rdf::RepositoryException) { - static const ::rtl::OUString s_cell( - ::rtl::OUString::createFromAscii("com.sun.star.table.Cell")); - static const ::rtl::OUString s_cellprops( // for writer - ::rtl::OUString::createFromAscii("com.sun.star.text.CellProperties")); - static const ::rtl::OUString s_paragraph( - ::rtl::OUString::createFromAscii("com.sun.star.text.Paragraph")); - static const ::rtl::OUString s_bookmark( - ::rtl::OUString::createFromAscii("com.sun.star.text.Bookmark")); + static const ::rtl::OUString s_cell(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.Cell")); + static const ::rtl::OUString s_cellprops(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.CellProperties")); // for writer + static const ::rtl::OUString s_paragraph(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Paragraph")); + static const ::rtl::OUString s_bookmark(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark")); static const ::rtl::OUString s_meta( ::rtl::OUString::createFromAscii( "com.sun.star.text.InContentMetadata")); @@ -1444,7 +1440,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "ensureMetadataReference did not"), *this); } ::rtl::OUString const sXmlId(mdref.First + - ::rtl::OUString::createFromAscii("#") + mdref.Second); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); uno::Reference xXmlId; try { xXmlId.set( rdf::URI::create(m_xContext, @@ -1508,7 +1504,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, try { xXmlId.set( rdf::URI::create(m_xContext, ::rtl::OUString::createFromAscii(s_nsOOo) - + mdref.First + ::rtl::OUString::createFromAscii("#") + + mdref.First + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second), uno::UNO_QUERY_THROW); } catch (lang::IllegalArgumentException & iae) { @@ -1536,7 +1532,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, return beans::Pair< uno::Sequence, sal_Bool >(); } ::rtl::OUString const sXmlId(mdref.First + - ::rtl::OUString::createFromAscii("#") + mdref.Second); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); uno::Reference xXmlId; try { xXmlId.set( rdf::URI::create(m_xContext, diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index aa83217797d1..a800cefc5f52 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -279,7 +279,7 @@ namespace XPath va_end(args); ::rtl::OUStringBuffer buf( - OUString::createFromAscii("libxml2 error:\n")); + OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error:\n"))); buf.appendAscii(str); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); @@ -290,11 +290,11 @@ namespace XPath { (void) userData; ::rtl::OUStringBuffer buf( - OUString::createFromAscii("libxml2 error:\n")); + OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error:\n"))); if (error) { buf.append(make_error_message(error)); } else { - buf.append(OUString::createFromAscii("no error argument!")); + buf.append(OUString(RTL_CONSTASCII_USTRINGPARAM("no error argument!"))); } OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); diff --git a/unoxml/test/domtest.cxx b/unoxml/test/domtest.cxx index 9871846eaea5..ff44e2b9dc3e 100644 --- a/unoxml/test/domtest.cxx +++ b/unoxml/test/domtest.cxx @@ -311,7 +311,7 @@ struct SerializerTest : public CppUnit::TestFixture CPPUNIT_ASSERT_MESSAGE( "Converting ini file to URL", osl_getFileURLFromSystemPath( - (sBaseDir+rtl::OUString::createFromAscii("unoxml_unittest_test.ini")).pData, + (sBaseDir+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unoxml_unittest_test.ini"))).pData, &aIniUrl.pData ) == osl_File_E_None ); mxCtx = ::cppu::defaultBootstrap_InitialComponentContext(aIniUrl); -- cgit From a39d1f2cb5b63d155b17acf6d73034ab0272b2a2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 27 Nov 2010 12:41:14 +0000 Subject: cppcheck: use prefix form --- unoxml/source/dom/document.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 30bf37620472..60b044c7f43e 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -142,7 +142,7 @@ namespace DOM while (iter1 != m_streamListeners.end()) { Reference< XStreamListener > aListener = *iter1; aListener->started(); - iter1++; + ++iter1; } // setup libxml IO and write data to output stream @@ -156,7 +156,7 @@ namespace DOM while (iter2 != m_streamListeners.end()) { Reference< XStreamListener > aListener = *iter2; aListener->closed(); - iter2++; + ++iter2; } } -- cgit From 17e4b5ee63d8ba0a597d1b490c5a1d28b35b350b Mon Sep 17 00:00:00 2001 From: Gert Faller Date: Sat, 27 Nov 2010 17:35:06 +0100 Subject: RTL_CONSTASCII_USTRINGPARAM in filters 8 (build problem in sal ?) --- unoxml/source/dom/cdatasection.cxx | 2 +- unoxml/source/dom/characterdata.cxx | 4 ++-- unoxml/source/dom/comment.cxx | 2 +- unoxml/source/dom/document.cxx | 10 +++++----- unoxml/source/dom/documentbuilder.cxx | 4 ++-- unoxml/source/dom/documentfragment.cxx | 2 +- unoxml/source/dom/element.cxx | 20 ++++++++++---------- unoxml/source/dom/elementlist.cxx | 2 +- unoxml/source/dom/node.cxx | 12 ++++++------ unoxml/source/dom/saxbuilder.cxx | 8 ++++---- unoxml/source/dom/text.cxx | 2 +- unoxml/source/events/testlistener.cxx | 10 +++++----- unoxml/source/rdf/librdf_repository.cxx | 18 +++++++++++------- unoxml/source/xpath/xpathapi.cxx | 6 +++--- 14 files changed, 53 insertions(+), 49 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/cdatasection.cxx b/unoxml/source/dom/cdatasection.cxx index 1bb7d6d72f19..2f432138c0e0 100644 --- a/unoxml/source/dom/cdatasection.cxx +++ b/unoxml/source/dom/cdatasection.cxx @@ -51,7 +51,7 @@ namespace DOM OUString SAL_CALL CCDATASection::getNodeName()throw (RuntimeException) { - return OUString(RTL_CONSTASCII_USTRINGPARAM("#cdata-section")); + return OUString::createFromAscii("#cdata-section"); } OUString SAL_CALL CCDATASection::getNodeValue() throw (RuntimeException) diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index 060d33d3f546..c5e09540b79c 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -41,9 +41,9 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMCharacterDataModified"))), UNO_QUERY); + OUString::createFromAscii("DOMCharacterDataModified")), UNO_QUERY); event->initMutationEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMCharacterDataModified")), + OUString::createFromAscii("DOMCharacterDataModified"), sal_True, sal_False, Reference< XNode >(), prevValue, newValue, OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); diff --git a/unoxml/source/dom/comment.cxx b/unoxml/source/dom/comment.cxx index d7a8ff605f43..4b7dd5a72154 100644 --- a/unoxml/source/dom/comment.cxx +++ b/unoxml/source/dom/comment.cxx @@ -49,7 +49,7 @@ namespace DOM OUString SAL_CALL CComment::getNodeName()throw (RuntimeException) { - return OUString(RTL_CONSTASCII_USTRINGPARAM("#comment")); + return OUString::createFromAscii("#comment"); } OUString SAL_CALL CComment::getNodeValue() throw (RuntimeException) diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 60b044c7f43e..30cdbbb34056 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -504,7 +504,7 @@ namespace DOM { if (aNsPrefix.getLength() > 0) - aQName = aNsPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aQName; + aQName = aNsPrefix + OUString::createFromAscii(":") + aQName; newElement = createElementNS(aNsUri, aQName); } else @@ -524,7 +524,7 @@ namespace DOM if (aAttrUri.getLength() > 0) { if (aAttrPrefix.getLength() > 0) - aAttrName = aAttrPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aAttrName; + aAttrName = aAttrPrefix + OUString::createFromAscii(":") + aAttrName; newElement->setAttributeNS(aAttrUri, aAttrName, curAttr->getValue()); } else @@ -590,8 +590,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument")) + OUString::createFromAscii("DOMNodeInsertedIntoDocument")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMNodeInsertedIntoDocument") , sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -601,7 +601,7 @@ namespace DOM } OUString SAL_CALL CDocument::getNodeName()throw (RuntimeException) { - return OUString(RTL_CONSTASCII_USTRINGPARAM("#document")); + return OUString::createFromAscii("#document"); } OUString SAL_CALL CDocument::getNodeValue() throw (RuntimeException) { diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 1c7f3140a33e..3f6d67d53811 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -297,7 +297,7 @@ namespace DOM // default warning handler triggers assertion static void warning_func(void * ctx, const char * /*msg*/, ...) { - OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 warning\n"))); + OUStringBuffer buf(OUString::createFromAscii("libxml2 warning\n")); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, msg.getStr()); @@ -306,7 +306,7 @@ namespace DOM // default error handler triggers assertion static void error_func(void * ctx, const char * /*msg*/, ...) { - OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error\n"))); + OUStringBuffer buf(OUString::createFromAscii("libxml2 error\n")); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, msg.getStr()); diff --git a/unoxml/source/dom/documentfragment.cxx b/unoxml/source/dom/documentfragment.cxx index 00c344f77bad..9e93449b001c 100644 --- a/unoxml/source/dom/documentfragment.cxx +++ b/unoxml/source/dom/documentfragment.cxx @@ -37,7 +37,7 @@ namespace DOM } OUString SAL_CALL CDocumentFragment::getNodeName()throw (RuntimeException) { - return OUString(RTL_CONSTASCII_USTRINGPARAM("#document-fragment")); + return OUString::createFromAscii("#document-fragment"); } OUString SAL_CALL CDocumentFragment::getNodeValue() throw (RuntimeException) { diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 1f86e33c9185..2c4264f07cf3 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -53,7 +53,7 @@ namespace DOM if (!i_xHandler.is()) throw RuntimeException(); comphelper::AttributeList *pAttrs = new comphelper::AttributeList(); - OUString type = OUString(); + OUString type = OUString::createFromAscii(""); // add namespace definitions to attributes for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != 0; pNs = pNs->next) { const xmlChar *pPrefix = pNs->prefix; @@ -61,8 +61,8 @@ namespace DOM strlen(reinterpret_cast(pPrefix)), RTL_TEXTENCODING_UTF8); OUString name = (prefix.equalsAscii("")) - ? OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns")) - : OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:")) + prefix; + ? OUString::createFromAscii("xmlns") + : OUString::createFromAscii("xmlns:") + prefix; const xmlChar *pHref = pNs->href; OUString val(reinterpret_cast(pHref), strlen(reinterpret_cast(pHref)), @@ -463,8 +463,8 @@ namespace DOM // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), + OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), sal_True, sal_False, Reference< XNode >(aAttr, UNO_QUERY), OUString(), aAttr->getValue(), aAttr->getName(), AttrChangeType_ADDITION); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -518,8 +518,8 @@ namespace DOM Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), + OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), sal_True, sal_False, Reference< XNode >(getAttributeNode(name), UNO_QUERY), oldValue, value, name, aChangeType); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -588,8 +588,8 @@ namespace DOM // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, + OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), sal_True, sal_False, Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString((char*)xLName, strlen((char*)xLName), RTL_TEXTENCODING_UTF8)), UNO_QUERY), oldValue, value, qualifiedName, aChangeType); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -632,7 +632,7 @@ namespace DOM void SAL_CALL CElement::setElementName(const OUString& aName) throw (RuntimeException, DOMException) { - if (aName.getLength() > 0 && aName.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM(":"))) < 0) + if (aName.getLength() > 0 && aName.indexOf(OUString::createFromAscii(":")) < 0) { OString oName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8); xmlChar *xName = (xmlChar*)oName.getStr(); diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx index 5b0d96758459..15a870aed933 100644 --- a/unoxml/source/dom/elementlist.cxx +++ b/unoxml/source/dom/elementlist.cxx @@ -66,7 +66,7 @@ namespace DOM // get the XNode Reference< XNode > xNode(CNode::get(static_cast(pElement)->m_aNodePtr)); Reference< XEventTarget > xTarget(xNode, UNO_QUERY_THROW); - OUString aType(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified")); + OUString aType = OUString::createFromAscii("DOMSubtreeModified"); sal_Bool capture = sal_False; xTarget->addEventListener(aType, Reference< XEventListener >(this), capture); } catch (Exception &e){ diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 79f42b6fd1f9..1c8cf054a27b 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -466,8 +466,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInserted"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInserted")) + OUString::createFromAscii("DOMNodeInserted")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMNodeInserted") , sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -861,8 +861,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeRemoved"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeRemoved")), sal_True, + OUString::createFromAscii("DOMNodeRemoved")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMNodeRemoved"), sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -950,8 +950,8 @@ namespace DOM // target is _this_ node Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified"))), UNO_QUERY); - event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified")), sal_True, + OUString::createFromAscii("DOMSubtreeModified")), UNO_QUERY); + event->initMutationEvent(OUString::createFromAscii("DOMSubtreeModified"), sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index d6d87754eb6a..50b611445d7c 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -164,7 +164,7 @@ namespace DOM throw SAXException(); Reference< XDocumentBuilder > aBuilder(m_aServiceManager->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.DocumentBuilder"))), UNO_QUERY_THROW); + OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), UNO_QUERY_THROW); Reference< XDocument > aDocument = aBuilder->newDocument(); m_aNodeStack.push(Reference< XNode >(aDocument, UNO_QUERY)); m_aDocument = aDocument; @@ -210,12 +210,12 @@ namespace DOM attr_qname = attribs->getNameByIndex(i); attr_value = attribs->getValueByIndex(i); // new prefix mapping - if (attr_qname.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:"))) == 0) + if (attr_qname.indexOf(OUString::createFromAscii("xmlns:")) == 0) { newprefix = attr_qname.copy(attr_qname.indexOf(':')+1); aNSMap.insert(NSMap::value_type(newprefix, attr_value)); } - else if (attr_qname == OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns"))) + else if (attr_qname == OUString::createFromAscii("xmlns")) { // new default prefix aNSMap.insert(NSMap::value_type(OUString(), attr_value)); @@ -300,7 +300,7 @@ namespace DOM OUString aRefName; OUString aPrefix = aElement->getPrefix(); if (aPrefix.getLength() > 0) - aRefName = aPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aElement->getTagName(); + aRefName = aPrefix + OUString::createFromAscii(":") + aElement->getTagName(); else aRefName = aElement->getTagName(); if (aRefName != aName) // consistency check diff --git a/unoxml/source/dom/text.cxx b/unoxml/source/dom/text.cxx index 520adf3b77e3..a10ba9944702 100644 --- a/unoxml/source/dom/text.cxx +++ b/unoxml/source/dom/text.cxx @@ -54,7 +54,7 @@ namespace DOM OUString SAL_CALL CText::getNodeName()throw (RuntimeException) { - return OUString(RTL_CONSTASCII_USTRINGPARAM("#text")); + return OUString::createFromAscii("#text"); } void SAL_CALL CText::fastSaxify( Context& io_rContext ) diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx index ee307fa27220..7c65d4ca606d 100644 --- a/unoxml/source/events/testlistener.cxx +++ b/unoxml/source/events/testlistener.cxx @@ -92,21 +92,21 @@ namespace DOM { namespace events void SAL_CALL CTestListener::initialize(const Sequence< Any >& args) throw(RuntimeException) { if (args.getLength() < 3) throw IllegalArgumentException( - OUString(RTL_CONSTASCII_USTRINGPARAM("Wrong number of arguments")), Reference< XInterface >(), 0); + OUString::createFromAscii("Wrong number of arguments"), Reference< XInterface >(), 0); Reference aTarget; if(! (args[0] >>= aTarget)) throw IllegalArgumentException( - OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 1")), Reference< XInterface >(), 1); + OUString::createFromAscii("Illegal argument 1"), Reference< XInterface >(), 1); OUString aType; if (! (args[1] >>= aType)) - throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 2")), Reference< XInterface >(), 2); + throw IllegalArgumentException(OUString::createFromAscii("Illegal argument 2"), Reference< XInterface >(), 2); sal_Bool bCapture = sal_False; if(! (args[2] >>= bCapture)) throw IllegalArgumentException( - OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 3")), Reference< XInterface >(), 3); + OUString::createFromAscii("Illegal argument 3"), Reference< XInterface >(), 3); - if(! (args[3] >>= m_name)) m_name = OUString(RTL_CONSTASCII_USTRINGPARAM("")); + if(! (args[3] >>= m_name)) m_name = OUString::createFromAscii(""); m_target = aTarget; m_type = aType; diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 2519fd29e411..0a3f875e1897 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1382,10 +1382,14 @@ void SAL_CALL librdf_Repository::setStatementRDFa( throw (uno::RuntimeException, lang::IllegalArgumentException, rdf::RepositoryException) { - static const ::rtl::OUString s_cell(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.Cell")); - static const ::rtl::OUString s_cellprops(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.CellProperties")); // for writer - static const ::rtl::OUString s_paragraph(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Paragraph")); - static const ::rtl::OUString s_bookmark(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark")); + static const ::rtl::OUString s_cell( + ::rtl::OUString::createFromAscii("com.sun.star.table.Cell")); + static const ::rtl::OUString s_cellprops( // for writer + ::rtl::OUString::createFromAscii("com.sun.star.text.CellProperties")); + static const ::rtl::OUString s_paragraph( + ::rtl::OUString::createFromAscii("com.sun.star.text.Paragraph")); + static const ::rtl::OUString s_bookmark( + ::rtl::OUString::createFromAscii("com.sun.star.text.Bookmark")); static const ::rtl::OUString s_meta( ::rtl::OUString::createFromAscii( "com.sun.star.text.InContentMetadata")); @@ -1440,7 +1444,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "ensureMetadataReference did not"), *this); } ::rtl::OUString const sXmlId(mdref.First + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); + ::rtl::OUString::createFromAscii("#") + mdref.Second); uno::Reference xXmlId; try { xXmlId.set( rdf::URI::create(m_xContext, @@ -1504,7 +1508,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, try { xXmlId.set( rdf::URI::create(m_xContext, ::rtl::OUString::createFromAscii(s_nsOOo) - + mdref.First + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + + mdref.First + ::rtl::OUString::createFromAscii("#") + mdref.Second), uno::UNO_QUERY_THROW); } catch (lang::IllegalArgumentException & iae) { @@ -1532,7 +1536,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, return beans::Pair< uno::Sequence, sal_Bool >(); } ::rtl::OUString const sXmlId(mdref.First + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); + ::rtl::OUString::createFromAscii("#") + mdref.Second); uno::Reference xXmlId; try { xXmlId.set( rdf::URI::create(m_xContext, diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index a800cefc5f52..aa83217797d1 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -279,7 +279,7 @@ namespace XPath va_end(args); ::rtl::OUStringBuffer buf( - OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error:\n"))); + OUString::createFromAscii("libxml2 error:\n")); buf.appendAscii(str); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); @@ -290,11 +290,11 @@ namespace XPath { (void) userData; ::rtl::OUStringBuffer buf( - OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error:\n"))); + OUString::createFromAscii("libxml2 error:\n")); if (error) { buf.append(make_error_message(error)); } else { - buf.append(OUString(RTL_CONSTASCII_USTRINGPARAM("no error argument!"))); + buf.append(OUString::createFromAscii("no error argument!")); } OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); -- cgit From 3f8861ce64ba6b43b7871c0a365a145bfa1bbf08 Mon Sep 17 00:00:00 2001 From: Gert Faller Date: Sun, 28 Nov 2010 18:35:13 +0100 Subject: RTL_CONSTASCII_USTRINGPARAM in filters 12 --- unoxml/source/dom/cdatasection.cxx | 2 +- unoxml/source/dom/characterdata.cxx | 4 ++-- unoxml/source/dom/comment.cxx | 2 +- unoxml/source/dom/document.cxx | 10 +++++----- unoxml/source/dom/documentbuilder.cxx | 4 ++-- unoxml/source/dom/documentfragment.cxx | 2 +- unoxml/source/dom/element.cxx | 20 ++++++++++---------- unoxml/source/dom/elementlist.cxx | 2 +- unoxml/source/dom/node.cxx | 12 ++++++------ unoxml/source/dom/saxbuilder.cxx | 8 ++++---- unoxml/source/dom/text.cxx | 2 +- unoxml/source/events/testlistener.cxx | 10 +++++----- unoxml/source/rdf/librdf_repository.cxx | 18 +++++++----------- unoxml/source/xpath/xpathapi.cxx | 6 +++--- 14 files changed, 49 insertions(+), 53 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/cdatasection.cxx b/unoxml/source/dom/cdatasection.cxx index 2f432138c0e0..1bb7d6d72f19 100644 --- a/unoxml/source/dom/cdatasection.cxx +++ b/unoxml/source/dom/cdatasection.cxx @@ -51,7 +51,7 @@ namespace DOM OUString SAL_CALL CCDATASection::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#cdata-section"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#cdata-section")); } OUString SAL_CALL CCDATASection::getNodeValue() throw (RuntimeException) diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index c5e09540b79c..060d33d3f546 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -41,9 +41,9 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMCharacterDataModified")), UNO_QUERY); + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMCharacterDataModified"))), UNO_QUERY); event->initMutationEvent( - OUString::createFromAscii("DOMCharacterDataModified"), + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMCharacterDataModified")), sal_True, sal_False, Reference< XNode >(), prevValue, newValue, OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); diff --git a/unoxml/source/dom/comment.cxx b/unoxml/source/dom/comment.cxx index 4b7dd5a72154..d7a8ff605f43 100644 --- a/unoxml/source/dom/comment.cxx +++ b/unoxml/source/dom/comment.cxx @@ -49,7 +49,7 @@ namespace DOM OUString SAL_CALL CComment::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#comment"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#comment")); } OUString SAL_CALL CComment::getNodeValue() throw (RuntimeException) diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 30cdbbb34056..60b044c7f43e 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -504,7 +504,7 @@ namespace DOM { if (aNsPrefix.getLength() > 0) - aQName = aNsPrefix + OUString::createFromAscii(":") + aQName; + aQName = aNsPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aQName; newElement = createElementNS(aNsUri, aQName); } else @@ -524,7 +524,7 @@ namespace DOM if (aAttrUri.getLength() > 0) { if (aAttrPrefix.getLength() > 0) - aAttrName = aAttrPrefix + OUString::createFromAscii(":") + aAttrName; + aAttrName = aAttrPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aAttrName; newElement->setAttributeNS(aAttrUri, aAttrName, curAttr->getValue()); } else @@ -590,8 +590,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMNodeInsertedIntoDocument")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMNodeInsertedIntoDocument") + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument")) , sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -601,7 +601,7 @@ namespace DOM } OUString SAL_CALL CDocument::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#document"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#document")); } OUString SAL_CALL CDocument::getNodeValue() throw (RuntimeException) { diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 3f6d67d53811..1c7f3140a33e 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -297,7 +297,7 @@ namespace DOM // default warning handler triggers assertion static void warning_func(void * ctx, const char * /*msg*/, ...) { - OUStringBuffer buf(OUString::createFromAscii("libxml2 warning\n")); + OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 warning\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, msg.getStr()); @@ -306,7 +306,7 @@ namespace DOM // default error handler triggers assertion static void error_func(void * ctx, const char * /*msg*/, ...) { - OUStringBuffer buf(OUString::createFromAscii("libxml2 error\n")); + OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, msg.getStr()); diff --git a/unoxml/source/dom/documentfragment.cxx b/unoxml/source/dom/documentfragment.cxx index 9e93449b001c..00c344f77bad 100644 --- a/unoxml/source/dom/documentfragment.cxx +++ b/unoxml/source/dom/documentfragment.cxx @@ -37,7 +37,7 @@ namespace DOM } OUString SAL_CALL CDocumentFragment::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#document-fragment"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#document-fragment")); } OUString SAL_CALL CDocumentFragment::getNodeValue() throw (RuntimeException) { diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 2c4264f07cf3..1f86e33c9185 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -53,7 +53,7 @@ namespace DOM if (!i_xHandler.is()) throw RuntimeException(); comphelper::AttributeList *pAttrs = new comphelper::AttributeList(); - OUString type = OUString::createFromAscii(""); + OUString type = OUString(); // add namespace definitions to attributes for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != 0; pNs = pNs->next) { const xmlChar *pPrefix = pNs->prefix; @@ -61,8 +61,8 @@ namespace DOM strlen(reinterpret_cast(pPrefix)), RTL_TEXTENCODING_UTF8); OUString name = (prefix.equalsAscii("")) - ? OUString::createFromAscii("xmlns") - : OUString::createFromAscii("xmlns:") + prefix; + ? OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns")) + : OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:")) + prefix; const xmlChar *pHref = pNs->href; OUString val(reinterpret_cast(pHref), strlen(reinterpret_cast(pHref)), @@ -463,8 +463,8 @@ namespace DOM // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, Reference< XNode >(aAttr, UNO_QUERY), OUString(), aAttr->getValue(), aAttr->getName(), AttrChangeType_ADDITION); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -518,8 +518,8 @@ namespace DOM Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, Reference< XNode >(getAttributeNode(name), UNO_QUERY), oldValue, value, name, aChangeType); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -588,8 +588,8 @@ namespace DOM // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMAttrModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMAttrModified"), sal_True, sal_False, + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAttrModified")), sal_True, sal_False, Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString((char*)xLName, strlen((char*)xLName), RTL_TEXTENCODING_UTF8)), UNO_QUERY), oldValue, value, qualifiedName, aChangeType); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -632,7 +632,7 @@ namespace DOM void SAL_CALL CElement::setElementName(const OUString& aName) throw (RuntimeException, DOMException) { - if (aName.getLength() > 0 && aName.indexOf(OUString::createFromAscii(":")) < 0) + if (aName.getLength() > 0 && aName.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM(":"))) < 0) { OString oName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8); xmlChar *xName = (xmlChar*)oName.getStr(); diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx index 15a870aed933..5b0d96758459 100644 --- a/unoxml/source/dom/elementlist.cxx +++ b/unoxml/source/dom/elementlist.cxx @@ -66,7 +66,7 @@ namespace DOM // get the XNode Reference< XNode > xNode(CNode::get(static_cast(pElement)->m_aNodePtr)); Reference< XEventTarget > xTarget(xNode, UNO_QUERY_THROW); - OUString aType = OUString::createFromAscii("DOMSubtreeModified"); + OUString aType(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified")); sal_Bool capture = sal_False; xTarget->addEventListener(aType, Reference< XEventListener >(this), capture); } catch (Exception &e){ diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 1c8cf054a27b..79f42b6fd1f9 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -466,8 +466,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMNodeInserted")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMNodeInserted") + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInserted"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInserted")) , sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -861,8 +861,8 @@ namespace DOM { Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMNodeRemoved")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMNodeRemoved"), sal_True, + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeRemoved"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeRemoved")), sal_True, sal_False, Reference< XNode >(CNode::get(m_aNodePtr)), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); @@ -950,8 +950,8 @@ namespace DOM // target is _this_ node Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( - OUString::createFromAscii("DOMSubtreeModified")), UNO_QUERY); - event->initMutationEvent(OUString::createFromAscii("DOMSubtreeModified"), sal_True, + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified"))), UNO_QUERY); + event->initMutationEvent(OUString(RTL_CONSTASCII_USTRINGPARAM("DOMSubtreeModified")), sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); dispatchEvent(Reference< XEvent >(event, UNO_QUERY)); diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 50b611445d7c..d6d87754eb6a 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -164,7 +164,7 @@ namespace DOM throw SAXException(); Reference< XDocumentBuilder > aBuilder(m_aServiceManager->createInstance( - OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), UNO_QUERY_THROW); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.DocumentBuilder"))), UNO_QUERY_THROW); Reference< XDocument > aDocument = aBuilder->newDocument(); m_aNodeStack.push(Reference< XNode >(aDocument, UNO_QUERY)); m_aDocument = aDocument; @@ -210,12 +210,12 @@ namespace DOM attr_qname = attribs->getNameByIndex(i); attr_value = attribs->getValueByIndex(i); // new prefix mapping - if (attr_qname.indexOf(OUString::createFromAscii("xmlns:")) == 0) + if (attr_qname.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:"))) == 0) { newprefix = attr_qname.copy(attr_qname.indexOf(':')+1); aNSMap.insert(NSMap::value_type(newprefix, attr_value)); } - else if (attr_qname == OUString::createFromAscii("xmlns")) + else if (attr_qname == OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns"))) { // new default prefix aNSMap.insert(NSMap::value_type(OUString(), attr_value)); @@ -300,7 +300,7 @@ namespace DOM OUString aRefName; OUString aPrefix = aElement->getPrefix(); if (aPrefix.getLength() > 0) - aRefName = aPrefix + OUString::createFromAscii(":") + aElement->getTagName(); + aRefName = aPrefix + OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + aElement->getTagName(); else aRefName = aElement->getTagName(); if (aRefName != aName) // consistency check diff --git a/unoxml/source/dom/text.cxx b/unoxml/source/dom/text.cxx index a10ba9944702..520adf3b77e3 100644 --- a/unoxml/source/dom/text.cxx +++ b/unoxml/source/dom/text.cxx @@ -54,7 +54,7 @@ namespace DOM OUString SAL_CALL CText::getNodeName()throw (RuntimeException) { - return OUString::createFromAscii("#text"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("#text")); } void SAL_CALL CText::fastSaxify( Context& io_rContext ) diff --git a/unoxml/source/events/testlistener.cxx b/unoxml/source/events/testlistener.cxx index 7c65d4ca606d..ee307fa27220 100644 --- a/unoxml/source/events/testlistener.cxx +++ b/unoxml/source/events/testlistener.cxx @@ -92,21 +92,21 @@ namespace DOM { namespace events void SAL_CALL CTestListener::initialize(const Sequence< Any >& args) throw(RuntimeException) { if (args.getLength() < 3) throw IllegalArgumentException( - OUString::createFromAscii("Wrong number of arguments"), Reference< XInterface >(), 0); + OUString(RTL_CONSTASCII_USTRINGPARAM("Wrong number of arguments")), Reference< XInterface >(), 0); Reference aTarget; if(! (args[0] >>= aTarget)) throw IllegalArgumentException( - OUString::createFromAscii("Illegal argument 1"), Reference< XInterface >(), 1); + OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 1")), Reference< XInterface >(), 1); OUString aType; if (! (args[1] >>= aType)) - throw IllegalArgumentException(OUString::createFromAscii("Illegal argument 2"), Reference< XInterface >(), 2); + throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 2")), Reference< XInterface >(), 2); sal_Bool bCapture = sal_False; if(! (args[2] >>= bCapture)) throw IllegalArgumentException( - OUString::createFromAscii("Illegal argument 3"), Reference< XInterface >(), 3); + OUString(RTL_CONSTASCII_USTRINGPARAM("Illegal argument 3")), Reference< XInterface >(), 3); - if(! (args[3] >>= m_name)) m_name = OUString::createFromAscii(""); + if(! (args[3] >>= m_name)) m_name = OUString(RTL_CONSTASCII_USTRINGPARAM("")); m_target = aTarget; m_type = aType; diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 0a3f875e1897..2519fd29e411 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1382,14 +1382,10 @@ void SAL_CALL librdf_Repository::setStatementRDFa( throw (uno::RuntimeException, lang::IllegalArgumentException, rdf::RepositoryException) { - static const ::rtl::OUString s_cell( - ::rtl::OUString::createFromAscii("com.sun.star.table.Cell")); - static const ::rtl::OUString s_cellprops( // for writer - ::rtl::OUString::createFromAscii("com.sun.star.text.CellProperties")); - static const ::rtl::OUString s_paragraph( - ::rtl::OUString::createFromAscii("com.sun.star.text.Paragraph")); - static const ::rtl::OUString s_bookmark( - ::rtl::OUString::createFromAscii("com.sun.star.text.Bookmark")); + static const ::rtl::OUString s_cell(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.Cell")); + static const ::rtl::OUString s_cellprops(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.CellProperties")); // for writer + static const ::rtl::OUString s_paragraph(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Paragraph")); + static const ::rtl::OUString s_bookmark(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark")); static const ::rtl::OUString s_meta( ::rtl::OUString::createFromAscii( "com.sun.star.text.InContentMetadata")); @@ -1444,7 +1440,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "ensureMetadataReference did not"), *this); } ::rtl::OUString const sXmlId(mdref.First + - ::rtl::OUString::createFromAscii("#") + mdref.Second); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); uno::Reference xXmlId; try { xXmlId.set( rdf::URI::create(m_xContext, @@ -1508,7 +1504,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, try { xXmlId.set( rdf::URI::create(m_xContext, ::rtl::OUString::createFromAscii(s_nsOOo) - + mdref.First + ::rtl::OUString::createFromAscii("#") + + mdref.First + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second), uno::UNO_QUERY_THROW); } catch (lang::IllegalArgumentException & iae) { @@ -1536,7 +1532,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, return beans::Pair< uno::Sequence, sal_Bool >(); } ::rtl::OUString const sXmlId(mdref.First + - ::rtl::OUString::createFromAscii("#") + mdref.Second); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); uno::Reference xXmlId; try { xXmlId.set( rdf::URI::create(m_xContext, diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index aa83217797d1..a800cefc5f52 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -279,7 +279,7 @@ namespace XPath va_end(args); ::rtl::OUStringBuffer buf( - OUString::createFromAscii("libxml2 error:\n")); + OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error:\n"))); buf.appendAscii(str); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); @@ -290,11 +290,11 @@ namespace XPath { (void) userData; ::rtl::OUStringBuffer buf( - OUString::createFromAscii("libxml2 error:\n")); + OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error:\n"))); if (error) { buf.append(make_error_message(error)); } else { - buf.append(OUString::createFromAscii("no error argument!")); + buf.append(OUString(RTL_CONSTASCII_USTRINGPARAM("no error argument!"))); } OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); -- cgit From 0a4c0a6a07340651724379a19ffd42a1472dcde6 Mon Sep 17 00:00:00 2001 From: Gert Faller Date: Tue, 30 Nov 2010 22:54:03 +0100 Subject: RTL_CONSTASCII_USTRINGPARAM in filters 16 --- unoxml/source/rdf/CBlankNode.cxx | 12 +- unoxml/source/rdf/CLiteral.cxx | 24 +- unoxml/source/rdf/CURI.cxx | 32 +-- unoxml/source/rdf/librdf_repository.cxx | 390 ++++++++++++++++---------------- 4 files changed, 229 insertions(+), 229 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/rdf/CBlankNode.cxx b/unoxml/source/rdf/CBlankNode.cxx index 19f114ea7c07..62d5978b3846 100644 --- a/unoxml/source/rdf/CBlankNode.cxx +++ b/unoxml/source/rdf/CBlankNode.cxx @@ -101,15 +101,15 @@ void SAL_CALL CBlankNode::initialize(const css::uno::Sequence< ::com::sun::star: { if (aArguments.getLength() != 1) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CBlankNode::initialize: " - "must give exactly 1 argument"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CBlankNode::initialize: " + "must give exactly 1 argument")), *this, 1); } ::rtl::OUString arg; if (!(aArguments[0] >>= arg)) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CBlankNode::initialize: " - "argument must be string"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CBlankNode::initialize: " + "argument must be string")), *this, 0); } //FIXME: what is legal? @@ -117,8 +117,8 @@ void SAL_CALL CBlankNode::initialize(const css::uno::Sequence< ::com::sun::star: m_NodeID = arg; } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CBlankNode::initialize: " - "argument is not valid blank node ID"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CBlankNode::initialize: " + "argument is not valid blank node ID")), *this, 0); } } diff --git a/unoxml/source/rdf/CLiteral.cxx b/unoxml/source/rdf/CLiteral.cxx index 08ebb0a4775c..6867d71ed1c8 100644 --- a/unoxml/source/rdf/CLiteral.cxx +++ b/unoxml/source/rdf/CLiteral.cxx @@ -111,23 +111,23 @@ void SAL_CALL CLiteral::initialize(const css::uno::Sequence< ::com::sun::star::u const sal_Int32 len( aArguments.getLength() ); if (len < 1 || len > 2) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CLiteral::initialize: " - "must give 1 or 2 argument(s)"), *this, 2); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: " + "must give 1 or 2 argument(s)")), *this, 2); } ::rtl::OUString arg0; if (!(aArguments[0] >>= arg0)) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CLiteral::initialize: " - "argument must be string"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: " + "argument must be string")), *this, 0); } //FIXME: what is legal? if (true) { m_Value = arg0; } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CLiteral::initialize: " - "argument is not valid literal value"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: " + "argument is not valid literal value")), *this, 0); } if (len > 1) { @@ -138,21 +138,21 @@ void SAL_CALL CLiteral::initialize(const css::uno::Sequence< ::com::sun::star::u m_Language = arg1; } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CLiteral::initialize: " - "argument is not valid language"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: " + "argument is not valid language")), *this, 1); } } else if ((aArguments[1] >>= xURI)) { if (xURI.is()) { m_xDatatype = xURI; } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CLiteral::initialize: " - "argument is null"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: " + "argument is null")), *this, 1); } } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CLiteral::initialize: " - "argument must be string or URI"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: " + "argument must be string or URI")), *this, 1); } } } diff --git a/unoxml/source/rdf/CURI.cxx b/unoxml/source/rdf/CURI.cxx index 7d154876aa3a..414267ffe795 100644 --- a/unoxml/source/rdf/CURI.cxx +++ b/unoxml/source/rdf/CURI.cxx @@ -738,8 +738,8 @@ void SAL_CALL CURI::initFromConstant(const sal_Int16 i_Constant) default: throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "invalid URIs constant argument"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "invalid URIs constant argument")), *this, 0); } m_Namespace = ::rtl::OUString::createFromAscii(ns).intern(); m_LocalName = ::rtl::OUString::createFromAscii(ln).intern(); @@ -752,8 +752,8 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< ::com::sun::star::uno:: sal_Int32 len = aArguments.getLength(); if ((len < 1) || (len > 2)) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "must give 1 or 2 argument(s)"), *this, 2); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "must give 1 or 2 argument(s)")), *this, 2); } sal_Int16 arg(0); @@ -763,22 +763,22 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< ::com::sun::star::uno:: // integer argument: constant from rdf::URIs if (len != 1) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "must give 1 int argument"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "must give 1 int argument")), *this, 1); } initFromConstant(arg); return; } if (!(aArguments[0] >>= arg0)) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "argument must be string or short"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "argument must be string or short")), *this, 0); } if (len > 1) { if (!(aArguments[1] >>= arg1)) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "argument must be string"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "argument must be string")), *this, 1); } // just append the parameters and then split them again; seems simplest arg0 = arg0 + arg1; @@ -798,8 +798,8 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< ::com::sun::star::uno:: } } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "argument not splittable: no separator [#/:]"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "argument not splittable: no separator [#/:]")), *this, 0); } //FIXME: what is legal? @@ -807,16 +807,16 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< ::com::sun::star::uno:: m_Namespace = arg0; } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "argument is not valid namespace"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "argument is not valid namespace")), *this, 0); } //FIXME: what is legal? if (true) { m_LocalName = arg1; } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("CURI::initialize: " - "argument is not valid local name"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: " + "argument is not valid local name")), *this, 1); } } diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 2519fd29e411..caf6c19dfd32 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -479,12 +479,12 @@ throw (uno::RuntimeException, container::NoSuchElementException, librdf_statement *pStmt( librdf_stream_get_object(m_pStream.get()) ); if (!pStmt) { - rdf::QueryException e(::rtl::OUString::createFromAscii( + rdf::QueryException e(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_GraphResult::nextElement: " - "librdf_stream_get_object failed"), *this); - throw lang::WrappedTargetException(::rtl::OUString::createFromAscii( + "librdf_stream_get_object failed")), *this); + throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_GraphResult::nextElement: " - "librdf_stream_get_object failed"), *this, + "librdf_stream_get_object failed")), *this, uno::makeAny(e)); } // NB: pCtxt may be null here if this is result of a graph query @@ -593,12 +593,12 @@ throw (uno::RuntimeException, container::NoSuchElementException, if (librdf_query_results_get_bindings(m_pQueryResult.get(), NULL, pNodes.get())) { - rdf::QueryException e(::rtl::OUString::createFromAscii( + rdf::QueryException e(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_QuerySelectResult::nextElement: " - "librdf_query_results_get_bindings failed"), *this); - throw lang::WrappedTargetException(::rtl::OUString::createFromAscii( + "librdf_query_results_get_bindings failed")), *this); + throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_QuerySelectResult::nextElement: " - "librdf_query_results_get_bindings failed"), *this, + "librdf_query_results_get_bindings failed")), *this, uno::makeAny(e)); } uno::Sequence< uno::Reference< rdf::XNode > > ret(count); @@ -717,8 +717,8 @@ throw (uno::RuntimeException, { uno::Reference< rdf::XRepository > xRep( m_wRep ); if (!xRep.is()) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( - "librdf_NamedGraph::clear: repository is gone"), *this); + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_NamedGraph::clear: repository is gone")), *this); } try { m_pRep->clearGraph(m_xName); @@ -736,8 +736,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, { uno::Reference< rdf::XRepository > xRep( m_wRep ); if (!xRep.is()) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( - "librdf_NamedGraph::addStatement: repository is gone"), *this); + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_NamedGraph::addStatement: repository is gone")), *this); } m_pRep->addStatementGraph(i_xSubject, i_xPredicate, i_xObject, m_xName); } @@ -751,8 +751,8 @@ throw (uno::RuntimeException, { uno::Reference< rdf::XRepository > xRep( m_wRep ); if (!xRep.is()) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( - "librdf_NamedGraph::removeStatements: repository is gone"), *this); + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_NamedGraph::removeStatements: repository is gone")), *this); } m_pRep->removeStatementsGraph(i_xSubject, i_xPredicate, i_xObject, m_xName); } @@ -767,8 +767,8 @@ throw (uno::RuntimeException, { uno::Reference< rdf::XRepository > xRep( m_wRep ); if (!xRep.is()) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( - "librdf_NamedGraph::getStatements: repository is gone"), *this); + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_NamedGraph::getStatements: repository is gone")), *this); } return m_pRep->getStatementsGraph( i_xSubject, i_xPredicate, i_xObject, m_xName); @@ -849,15 +849,15 @@ throw (uno::RuntimeException) librdf_new_node_from_blank_identifier(m_pWorld.get(), NULL), safe_librdf_free_node); if (!pNode) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::createBlankNode: " - "librdf_new_node_from_blank_identifier failed"), *this); + "librdf_new_node_from_blank_identifier failed")), *this); } const unsigned char * id (librdf_node_get_blank_identifier(pNode.get())); if (!id) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::createBlankNode: " - "librdf_node_get_blank_identifier failed"), *this); + "librdf_node_get_blank_identifier failed")), *this); } const ::rtl::OUString nodeID(::rtl::OUString::createFromAscii( reinterpret_cast(id))); @@ -865,9 +865,9 @@ throw (uno::RuntimeException) return rdf::BlankNode::create(m_xContext, nodeID); } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::createBlankNode: " - "illegal blank node label"), *this, uno::makeAny(iae)); + "illegal blank node label")), *this, uno::makeAny(iae)); } } @@ -891,44 +891,44 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::osl::MutexGuard g(m_aMutex); if (!i_xInStream.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "stream is null"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "stream is null")), *this, 1); } //FIXME: other formats if (i_Format != rdf::FileFormat::RDF_XML) { throw datatransfer::UnsupportedFlavorException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "file format not supported"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "file format not supported")), *this); } if (!i_xGraphName.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "graph name is null"), *this, 2); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "graph name is null")), *this, 2); } if (i_xGraphName->getStringValue().matchAsciiL(s_nsOOo, sizeof(s_nsOOo)-1)) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "URI is reserved"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "URI is reserved")), *this, 0); } if (formatNeedsBaseURI(i_Format) && !i_xBaseURI.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "base URI is null"), *this, 3); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "base URI is null")), *this, 3); } OSL_ENSURE(i_xBaseURI.is(), "no base uri"); const ::rtl::OUString baseURIU( i_xBaseURI->getStringValue() ); if (baseURIU.indexOf('#') >= 0) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "base URI is not absolute"), *this, 3); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "base URI is not absolute")), *this, 3); } const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); if (m_NamedGraphs.find(contextU) != m_NamedGraphs.end()) { throw container::ElementExistException( - ::rtl::OUString::createFromAscii("librdf_Repository::importGraph: " - "graph with given URI exists"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::importGraph: " + "graph with given URI exists")), *this); } const ::rtl::OString context( ::rtl::OUStringToOString(contextU, RTL_TEXTENCODING_UTF8) ); @@ -938,9 +938,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, reinterpret_cast (context.getStr())), safe_librdf_free_node); if (!pContext) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::importGraph: " - "librdf_new_node_from_uri_string failed"), *this); + "librdf_new_node_from_uri_string failed")), *this); } const ::rtl::OString baseURI( @@ -950,18 +950,18 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, reinterpret_cast (baseURI.getStr())), safe_librdf_free_uri); if (!pBaseURI) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::importGraph: " - "librdf_new_uri failed"), *this); + "librdf_new_uri failed")), *this); } const boost::shared_ptr pParser( librdf_new_parser(m_pWorld.get(), "rdfxml", NULL, NULL), safe_librdf_free_parser); if (!pParser) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::importGraph: " - "librdf_new_parser failed"), *this); + "librdf_new_parser failed")), *this); } uno::Sequence buf; @@ -976,17 +976,17 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, buf.getLength(), pBaseURI.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::ParseException(::rtl::OUString::createFromAscii( + throw rdf::ParseException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::importGraph: " - "librdf_parser_parse_counted_string_as_stream failed"), *this); + "librdf_parser_parse_counted_string_as_stream failed")), *this); } m_NamedGraphs.insert(std::make_pair(contextU, new librdf_NamedGraph(this, i_xGraphName))); if (librdf_model_context_add_statements(m_pModel.get(), pContext.get(), pStream.get())) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::importGraph: " - "librdf_model_context_add_statements failed"), *this); + "librdf_model_context_add_statements failed")), *this); } return getGraph(i_xGraphName); } @@ -1004,38 +1004,38 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::osl::MutexGuard g(m_aMutex); if (!i_xOutStream.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::exportGraph: " - "stream is null"), *this, 1); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::exportGraph: " + "stream is null")), *this, 1); } // FIXME: other formats if (i_Format != rdf::FileFormat::RDF_XML) { throw datatransfer::UnsupportedFlavorException( - ::rtl::OUString::createFromAscii("librdf_Repository::exportGraph: " - "file format not supported"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::exportGraph: " + "file format not supported")), *this); } if (!i_xGraphName.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::exportGraph: " - "graph name is null"), *this, 2); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::exportGraph: " + "graph name is null")), *this, 2); } if (formatNeedsBaseURI(i_Format) && !i_xBaseURI.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::exportGraph: " - "base URI is null"), *this, 3); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::exportGraph: " + "base URI is null")), *this, 3); } OSL_ENSURE(i_xBaseURI.is(), "no base uri"); const ::rtl::OUString baseURIU( i_xBaseURI->getStringValue() ); if (baseURIU.indexOf('#') >= 0) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::exportGraph: " - "base URI is not absolute"), *this, 3); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::exportGraph: " + "base URI is not absolute")), *this, 3); } const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); if (m_NamedGraphs.find(contextU) == m_NamedGraphs.end()) { throw container::NoSuchElementException( - ::rtl::OUString::createFromAscii("librdf_Repository::exportGraph: " - "no graph with given URI exists"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::exportGraph: " + "no graph with given URI exists")), *this); } const ::rtl::OString context( ::rtl::OUStringToOString(contextU, RTL_TEXTENCODING_UTF8) ); @@ -1045,9 +1045,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, reinterpret_cast (context.getStr())), safe_librdf_free_node); if (!pContext) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_new_node_from_uri_string failed"), *this); + "librdf_new_node_from_uri_string failed")), *this); } const ::rtl::OString baseURI( ::rtl::OUStringToOString(baseURIU, RTL_TEXTENCODING_UTF8) ); @@ -1056,18 +1056,18 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, reinterpret_cast (baseURI.getStr())), safe_librdf_free_uri); if (!pBaseURI) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_new_uri failed"), *this); + "librdf_new_uri failed")), *this); } const boost::shared_ptr pStream( librdf_model_context_as_stream(m_pModel.get(), pContext.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_model_context_as_stream failed"), *this); + "librdf_model_context_as_stream failed")), *this); } // const char *format("rdfxml"); const char *format("rdfxml-abbrev"); @@ -1075,9 +1075,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, librdf_new_serializer(m_pWorld.get(), format, NULL, NULL), safe_librdf_free_serializer); if (!pSerializer) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_new_serializer failed"), *this); + "librdf_new_serializer failed")), *this); } const boost::shared_ptr pRelativeURI( @@ -1097,26 +1097,26 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, reinterpret_cast ("1"), NULL, 0), safe_librdf_free_node); if (!pWriteBaseURI || !pRelativeURI || !p0 || !p1) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_new_uri or librdf_new_node_from_literal failed"), *this); + "librdf_new_uri or librdf_new_node_from_literal failed")), *this); } // make URIs relative to base URI if (librdf_serializer_set_feature(pSerializer.get(), pRelativeURI.get(), p1.get())) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_serializer_set_feature relativeURIs failed"), *this); + "librdf_serializer_set_feature relativeURIs failed")), *this); } // but do not write the base URI to the file! if (librdf_serializer_set_feature(pSerializer.get(), pWriteBaseURI.get(), p0.get())) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_serializer_set_feature writeBaseURI failed"), *this); + "librdf_serializer_set_feature writeBaseURI failed")), *this); } size_t length; @@ -1124,9 +1124,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, librdf_serializer_serialize_stream_to_counted_string( pSerializer.get(), pBaseURI.get(), pStream.get(), &length), free); if (!pBuf) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::exportGraph: " - "librdf_serializer_serialize_stream_to_counted_string failed"), + "librdf_serializer_serialize_stream_to_counted_string failed")), *this); } const uno::Sequence buf( @@ -1156,8 +1156,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::osl::MutexGuard g(m_aMutex); if (!i_xGraphName.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::getGraph: " - "URI is null"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::getGraph: " + "URI is null")), *this, 0); } const NamedGraphMap_t::iterator iter( m_NamedGraphs.find(i_xGraphName->getStringValue()) ); @@ -1176,14 +1176,14 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::osl::MutexGuard g(m_aMutex); if (!i_xGraphName.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::createGraph: " - "URI is null"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::createGraph: " + "URI is null")), *this, 0); } if (i_xGraphName->getStringValue().matchAsciiL(s_nsOOo, sizeof(s_nsOOo)-1)) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::createGraph: " - "URI is reserved"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::createGraph: " + "URI is reserved")), *this, 0); } // NB: librdf does not have a concept of graphs as such; @@ -1192,8 +1192,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); if (m_NamedGraphs.find(contextU) != m_NamedGraphs.end()) { throw container::ElementExistException( - ::rtl::OUString::createFromAscii("librdf_Repository::createGraph: " - "graph with given URI exists"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::createGraph: " + "graph with given URI exists")), *this); } m_NamedGraphs.insert(std::make_pair(contextU, new librdf_NamedGraph(this, i_xGraphName))); @@ -1246,9 +1246,9 @@ throw (uno::RuntimeException, rdf::RepositoryException) librdf_model_find_statements(m_pModel.get(), pStatement.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatements: " - "librdf_model_find_statements failed"), *this); + "librdf_model_find_statements failed")), *this); } return new librdf_GraphResult(this, m_aMutex, pStream, @@ -1268,17 +1268,17 @@ throw (uno::RuntimeException, rdf::QueryException, rdf::RepositoryException) reinterpret_cast (query.getStr()), NULL), safe_librdf_free_query); if (!pQuery) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::querySelect: " - "librdf_new_query failed"), *this); + "librdf_new_query failed")), *this); } const boost::shared_ptr pResults( librdf_model_query_execute(m_pModel.get(), pQuery.get()), safe_librdf_free_query_results); if (!pResults || !librdf_query_results_is_bindings(pResults.get())) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::querySelect: " - "query result is null or not bindings"), *this); + "query result is null or not bindings")), *this); } const int count( librdf_query_results_get_bindings_count(pResults.get()) ); @@ -1288,9 +1288,9 @@ throw (uno::RuntimeException, rdf::QueryException, rdf::RepositoryException) const char* name( librdf_query_results_get_binding_name( pResults.get(), i) ); if (!name) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::querySelect: " - "binding is null"), *this); + "binding is null")), *this); } names[i] = ::rtl::OUString::createFromAscii(name); @@ -1300,9 +1300,9 @@ throw (uno::RuntimeException, rdf::QueryException, rdf::RepositoryException) pQuery, pResults, names); } else { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::querySelect: " - "librdf_query_results_get_bindings_count failed"), *this); + "librdf_query_results_get_bindings_count failed")), *this); } } @@ -1318,25 +1318,25 @@ throw (uno::RuntimeException, rdf::QueryException, rdf::RepositoryException) reinterpret_cast (query.getStr()), NULL), safe_librdf_free_query); if (!pQuery) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::queryConstruct: " - "librdf_new_query failed"), *this); + "librdf_new_query failed")), *this); } const boost::shared_ptr pResults( librdf_model_query_execute(m_pModel.get(), pQuery.get()), safe_librdf_free_query_results); if (!pResults || !librdf_query_results_is_graph(pResults.get())) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::queryConstruct: " - "query result is null or not graph"), *this); + "query result is null or not graph")), *this); } const boost::shared_ptr pStream( librdf_query_results_as_stream(pResults.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::queryConstruct: " - "librdf_query_results_as_stream failed"), *this); + "librdf_query_results_as_stream failed")), *this); } return new librdf_GraphResult(this, m_aMutex, pStream, @@ -1356,17 +1356,17 @@ throw (uno::RuntimeException, rdf::QueryException, rdf::RepositoryException) reinterpret_cast (query.getStr()), NULL), safe_librdf_free_query); if (!pQuery) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::queryAsk: " - "librdf_new_query failed"), *this); + "librdf_new_query failed")), *this); } const boost::shared_ptr pResults( librdf_model_query_execute(m_pModel.get(), pQuery.get()), safe_librdf_free_query_results); if (!pResults || !librdf_query_results_is_boolean(pResults.get())) { - throw rdf::QueryException(::rtl::OUString::createFromAscii( + throw rdf::QueryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::queryAsk: " - "query result is null or not boolean"), *this); + "query result is null or not boolean")), *this); } return librdf_query_results_get_boolean(pResults.get()) ? sal_True : sal_False; @@ -1386,29 +1386,29 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, static const ::rtl::OUString s_cellprops(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.CellProperties")); // for writer static const ::rtl::OUString s_paragraph(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Paragraph")); static const ::rtl::OUString s_bookmark(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark")); - static const ::rtl::OUString s_meta( ::rtl::OUString::createFromAscii( + static const ::rtl::OUString s_meta( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.InContentMetadata")); if (!i_xSubject.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::setStatementRDFa: Subject is null"), *this, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::setStatementRDFa: Subject is null")), *this, 0); } if (!i_rPredicates.getLength()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::setStatementRDFa: no Predicates"), + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::setStatementRDFa: no Predicates")), *this, 1); } for (sal_Int32 i = 0; i < i_rPredicates.getLength(); ++i) { if (!i_rPredicates[i].is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "librdf_Repository::setStatementRDFa: Predicate is null"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::setStatementRDFa: Predicate is null")), *this, 1); } } if (!i_xObject.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::setStatementRDFa: Object is null"), *this, 2); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::setStatementRDFa: Object is null")), *this, 2); } const uno::Reference xService(i_xObject, uno::UNO_QUERY_THROW); @@ -1427,17 +1427,17 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, xTextRange = xTextContent->getAnchor(); } if (!xTextRange.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " - "Object does not support RDFa"), *this, 2); + "Object does not support RDFa")), *this, 2); } // ensure that the metadatable has an XML ID i_xObject->ensureMetadataReference(); const beans::StringPair mdref( i_xObject->getMetadataReference() ); if (mdref.First.equalsAscii("") || mdref.Second.equalsAscii("")) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " - "ensureMetadataReference did not"), *this); + "ensureMetadataReference did not")), *this); } ::rtl::OUString const sXmlId(mdref.First + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second); @@ -1448,9 +1448,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, uno::UNO_QUERY_THROW); } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " - "cannot create URI for XML ID"), *this, uno::makeAny(iae)); + "cannot create URI for XML ID")), *this, uno::makeAny(iae)); } ::osl::MutexGuard g(m_aMutex); @@ -1469,9 +1469,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " - "cannot create literal"), *this, uno::makeAny(iae)); + "cannot create literal")), *this, uno::makeAny(iae)); } removeStatementRDFa(i_xObject); if (i_rRDFaContent.getLength() == 0) { @@ -1491,8 +1491,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, rdf::RepositoryException) { if (!i_xElement.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::removeStatementRDFa: Element is null"), + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::removeStatementRDFa: Element is null")), *this, 0); } @@ -1509,9 +1509,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, uno::UNO_QUERY_THROW); } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatementRDFa: " - "cannot create URI for XML ID"), *this, uno::makeAny(iae)); + "cannot create URI for XML ID")), *this, uno::makeAny(iae)); } // clearGraph does locking, not needed here clearGraph(xXmlId, true); @@ -1524,8 +1524,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, rdf::RepositoryException) { if (!i_xElement.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::getStatementRDFa: Element is null"), *this, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::getStatementRDFa: Element is null")), *this, 0); } const beans::StringPair mdref( i_xElement->getMetadataReference() ); if (mdref.First.equalsAscii("") || mdref.Second.equalsAscii("")) { @@ -1540,9 +1540,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, uno::UNO_QUERY_THROW); } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatementRDFa: " - "cannot create URI for XML ID"), *this, uno::makeAny(iae)); + "cannot create URI for XML ID")), *this, uno::makeAny(iae)); } ::osl::MutexGuard g(m_aMutex); @@ -1606,16 +1606,16 @@ throw (uno::RuntimeException, rdf::RepositoryException) librdf_model_find_statements(m_pModel.get(), pStatement.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatementsRDFa: " - "librdf_model_find_statements failed"), *this); + "librdf_model_find_statements failed")), *this); } if (librdf_stream_add_map(pStream.get(), rdfa_context_stream_map_handler, 0, 0)) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatementsRDFa: " - "librdf_stream_add_map failed"), *this); + "librdf_stream_add_map failed")), *this); } return new librdf_GraphResult(this, m_aMutex, pStream, @@ -1645,16 +1645,16 @@ const NamedGraphMap_t::iterator SAL_CALL librdf_Repository::clearGraph( { if (!i_xGraphName.is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("librdf_Repository::clearGraph: " - "URI is null"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::clearGraph: " + "URI is null")), *this, 0); } ::osl::MutexGuard g(m_aMutex); const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); const NamedGraphMap_t::iterator iter( m_NamedGraphs.find(contextU) ); if (!i_Internal && iter == m_NamedGraphs.end()) { throw container::NoSuchElementException( - ::rtl::OUString::createFromAscii("librdf_Repository::clearGraph: " - "no graph with given URI exists"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::clearGraph: " + "no graph with given URI exists")), *this); } const ::rtl::OString context( ::rtl::OUStringToOString(contextU, RTL_TEXTENCODING_UTF8) ); @@ -1664,15 +1664,15 @@ const NamedGraphMap_t::iterator SAL_CALL librdf_Repository::clearGraph( reinterpret_cast (context.getStr())), safe_librdf_free_node); if (!pContext) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::clearGraph: " - "librdf_new_node_from_uri_string failed"), *this); + "librdf_new_node_from_uri_string failed")), *this); } if (librdf_model_context_remove_statements(m_pModel.get(), pContext.get())) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::clearGraph: " - "librdf_model_context_remove_statements failed"), *this); + "librdf_model_context_remove_statements failed")), *this); } return iter; } @@ -1687,25 +1687,25 @@ void SAL_CALL librdf_Repository::addStatementGraph( // container::NoSuchElementException, rdf::RepositoryException) { if (!i_xSubject.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::addStatement: Subject is null"), *this, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::addStatement: Subject is null")), *this, 0); } if (!i_xPredicate.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::addStatement: Predicate is null"), + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::addStatement: Predicate is null")), *this, 1); } if (!i_xObject.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "librdf_Repository::addStatement: Object is null"), *this, 2); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_Repository::addStatement: Object is null")), *this, 2); } ::osl::MutexGuard g(m_aMutex); const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); if (!i_Internal && (m_NamedGraphs.find(contextU) == m_NamedGraphs.end())) { throw container::NoSuchElementException( - ::rtl::OUString::createFromAscii("librdf_Repository::addStatement: " - "no graph with given URI exists"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("librdf_Repository::addStatement: " + "no graph with given URI exists")), *this); } const ::rtl::OString context( ::rtl::OUStringToOString(contextU, RTL_TEXTENCODING_UTF8) ); @@ -1715,9 +1715,9 @@ void SAL_CALL librdf_Repository::addStatementGraph( reinterpret_cast (context.getStr())), safe_librdf_free_node); if (!pContext) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::addStatement: " - "librdf_new_node_from_uri_string failed"), *this); + "librdf_new_node_from_uri_string failed")), *this); } const boost::shared_ptr pStatement( m_TypeConverter.mkStatement(m_pWorld.get(), @@ -1739,9 +1739,9 @@ void SAL_CALL librdf_Repository::addStatementGraph( if (librdf_model_context_add_statement(m_pModel.get(), pContext.get(), pStatement.get())) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::addStatement: " - "librdf_model_context_add_statement failed"), *this); + "librdf_model_context_add_statement failed")), *this); } } @@ -1764,9 +1764,9 @@ void SAL_CALL librdf_Repository::removeStatementsGraph( const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); if (m_NamedGraphs.find(contextU) == m_NamedGraphs.end()) { throw container::NoSuchElementException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatements: " - "no graph with given URI exists"), *this); + "no graph with given URI exists")), *this); } const ::rtl::OString context( ::rtl::OUStringToOString(contextU, RTL_TEXTENCODING_UTF8) ); @@ -1776,9 +1776,9 @@ void SAL_CALL librdf_Repository::removeStatementsGraph( reinterpret_cast (context.getStr())), safe_librdf_free_node); if (!pContext) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatements: " - "librdf_new_node_from_uri_string failed"), *this); + "librdf_new_node_from_uri_string failed")), *this); } const boost::shared_ptr pStatement( m_TypeConverter.mkStatement(m_pWorld.get(), @@ -1791,24 +1791,24 @@ void SAL_CALL librdf_Repository::removeStatementsGraph( pStatement.get(), pContext.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatements: " - "librdf_model_find_statements_in_context failed"), *this); + "librdf_model_find_statements_in_context failed")), *this); } if (!librdf_stream_end(pStream.get())) { do { librdf_statement *pStmt( librdf_stream_get_object(pStream.get()) ); if (!pStmt) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatements: " - "librdf_stream_get_object failed"), *this); + "librdf_stream_get_object failed")), *this); } if (librdf_model_context_remove_statement(m_pModel.get(), pContext.get(), pStmt)) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatements: " - "librdf_model_context_remove_statement failed"), *this); + "librdf_model_context_remove_statement failed")), *this); } } while (!librdf_stream_next(pStream.get())); } @@ -1841,9 +1841,9 @@ librdf_Repository::getStatementsGraph( const ::rtl::OUString contextU( i_xGraphName->getStringValue() ); if (!i_Internal && (m_NamedGraphs.find(contextU) == m_NamedGraphs.end())) { throw container::NoSuchElementException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatements: " - "no graph with given URI exists"), *this); + "no graph with given URI exists")), *this); } const ::rtl::OString context( ::rtl::OUStringToOString(contextU, RTL_TEXTENCODING_UTF8) ); @@ -1853,9 +1853,9 @@ librdf_Repository::getStatementsGraph( reinterpret_cast (context.getStr())), safe_librdf_free_node); if (!pContext) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatements: " - "librdf_new_node_from_uri_string failed"), *this); + "librdf_new_node_from_uri_string failed")), *this); } const boost::shared_ptr pStatement( m_TypeConverter.mkStatement(m_pWorld.get(), @@ -1868,9 +1868,9 @@ librdf_Repository::getStatementsGraph( pStatement.get(), pContext.get()), safe_librdf_free_stream); if (!pStream) { - throw rdf::RepositoryException(::rtl::OUString::createFromAscii( + throw rdf::RepositoryException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatements: " - "librdf_model_find_statements_in_context failed"), *this); + "librdf_model_find_statements_in_context failed")), *this); } // librdf_model_find_statements_in_context is buggy and does not put @@ -1883,8 +1883,8 @@ librdf_world *librdf_TypeConverter::createWorld() const // create and initialize world librdf_world *pWorld( librdf_new_world() ); if (!pWorld) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( - "librdf_TypeConverter::createWorld: librdf_new_world failed"), + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_TypeConverter::createWorld: librdf_new_world failed")), m_rRep); } //FIXME logger, digest, features? @@ -1908,8 +1908,8 @@ librdf_TypeConverter::createStorage(librdf_world *i_pWorld) const librdf_new_storage(i_pWorld, "hashes", NULL, "contexts='yes',hash-type='memory'") ); if (!pStorage) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( - "librdf_TypeConverter::createStorage: librdf_new_storage failed"), + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_TypeConverter::createStorage: librdf_new_storage failed")), m_rRep); } return pStorage; @@ -1920,8 +1920,8 @@ librdf_model *librdf_TypeConverter::createModel( { librdf_model *pRepository( librdf_new_model(i_pWorld, i_pStorage, NULL) ); if (!pRepository) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( - "librdf_TypeConverter::createModel: librdf_new_model failed"), + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_TypeConverter::createModel: librdf_new_model failed")), m_rRep); } //FIXME @@ -1952,8 +1952,8 @@ librdf_uri* librdf_TypeConverter::mkURI( librdf_world* i_pWorld, librdf_uri *pURI( librdf_new_uri(i_pWorld, reinterpret_cast(uri.getStr()))); if (!pURI) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( - "librdf_TypeConverter::mkURI: librdf_new_uri failed"), 0); + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "librdf_TypeConverter::mkURI: librdf_new_uri failed")), 0); } return pURI; } @@ -1972,9 +1972,9 @@ librdf_node* librdf_TypeConverter::mkResource( librdf_world* i_pWorld, librdf_new_node_from_blank_identifier(i_pWorld, reinterpret_cast (label.getStr()))); if (!pNode) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::mkResource: " - "librdf_new_node_from_blank_identifier failed"), 0); + "librdf_new_node_from_blank_identifier failed")), 0); } return pNode; } else { // assumption: everything else is URI @@ -1985,9 +1985,9 @@ librdf_node* librdf_TypeConverter::mkResource( librdf_world* i_pWorld, librdf_new_node_from_uri_string(i_pWorld, reinterpret_cast (uri.getStr()))); if (!pNode) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::mkResource: " - "librdf_new_node_from_uri_string failed"), 0); + "librdf_new_node_from_uri_string failed")), 0); } return pNode; } @@ -2038,9 +2038,9 @@ librdf_node* librdf_TypeConverter::mkNode( librdf_world* i_pWorld, } } if (!ret) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::mkNode: " - "librdf_new_node_from_literal failed"), 0); + "librdf_new_node_from_literal failed")), 0); } return ret; } @@ -2071,9 +2071,9 @@ librdf_statement* librdf_TypeConverter::mkStatement( librdf_world* i_pWorld, librdf_statement* pStatement( librdf_new_statement_from_nodes(i_pWorld, pSubject, pPredicate, pObject) ); if (!pStatement) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::mkStatement: " - "librdf_new_statement_from_nodes failed"), 0); + "librdf_new_statement_from_nodes failed")), 0); } return pStatement; } @@ -2084,9 +2084,9 @@ librdf_TypeConverter::convertToXURI(librdf_uri* i_pURI) const if (!i_pURI) return 0; const unsigned char* uri( librdf_uri_as_string(i_pURI) ); if (!uri) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXURI: " - "librdf_uri_as_string failed"), m_rRep); + "librdf_uri_as_string failed")), m_rRep); } ::rtl::OUString uriU( ::rtl::OStringToOUString( ::rtl::OString(reinterpret_cast(uri)), @@ -2095,9 +2095,9 @@ librdf_TypeConverter::convertToXURI(librdf_uri* i_pURI) const return rdf::URI::create(m_xContext, uriU); } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXURI: " - "illegal uri"), m_rRep, uno::makeAny(iae)); + "illegal uri")), m_rRep, uno::makeAny(iae)); } } @@ -2108,9 +2108,9 @@ librdf_TypeConverter::convertToXURI(librdf_node* i_pNode) const if (librdf_node_is_resource(i_pNode)) { librdf_uri* pURI( librdf_node_get_uri(i_pNode) ); if (!pURI) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXURI: " - "resource has no uri"), m_rRep); + "resource has no uri")), m_rRep); } return convertToXURI(pURI); } else { @@ -2126,9 +2126,9 @@ librdf_TypeConverter::convertToXResource(librdf_node* i_pNode) const if (librdf_node_is_blank(i_pNode)) { const unsigned char* label( librdf_node_get_blank_identifier(i_pNode) ); if (!label) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXResource: " - "blank node has no label"), m_rRep); + "blank node has no label")), m_rRep); } ::rtl::OUString labelU( ::rtl::OStringToOUString( ::rtl::OString(reinterpret_cast(label)), @@ -2138,9 +2138,9 @@ librdf_TypeConverter::convertToXResource(librdf_node* i_pNode) const rdf::BlankNode::create(m_xContext, labelU), uno::UNO_QUERY); } catch (lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXResource: " - "illegal blank node label"), m_rRep, uno::makeAny(iae)); + "illegal blank node label")), m_rRep, uno::makeAny(iae)); } } else { return uno::Reference(convertToXURI(i_pNode), @@ -2158,9 +2158,9 @@ librdf_TypeConverter::convertToXNode(librdf_node* i_pNode) const } const unsigned char* value( librdf_node_get_literal_value(i_pNode) ); if (!value) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXNode: " - "literal has no value"), m_rRep); + "literal has no value")), m_rRep); } const char * lang( librdf_node_get_literal_value_language(i_pNode) ); librdf_uri* pType( -- cgit From b84c11696a4a283767258c4ae97c209833162eff Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 10 Dec 2010 13:01:44 +0000 Subject: valgrind: unoxml leaks like a sieve --- unoxml/source/dom/element.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 1f86e33c9185..cc8bde8fd0cd 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -209,8 +209,10 @@ namespace DOM { OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8); xmlChar *xValue = xmlGetProp(m_aNodePtr, (xmlChar*)o1.getStr()); - if (xValue != NULL) { + if (xValue != NULL) + { aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8); + xmlFree(xValue); } } return aValue; @@ -269,7 +271,8 @@ namespace DOM OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8); xmlChar *xNS = (xmlChar*)o2.getStr(); xmlChar *xValue = (xmlChar*)xmlGetNsProp(m_aNodePtr, xName, xNS); - if (xValue != NULL) { + if (xValue != NULL) + { aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8); xmlFree(xValue); } @@ -511,6 +514,7 @@ namespace DOM else { oldValue = OUString((char*)xOld, strlen((char*)xOld), RTL_TEXTENCODING_UTF8); + xmlFree(xOld); xmlSetProp(m_aNodePtr, xName, xValue); } @@ -583,6 +587,7 @@ namespace DOM else { oldValue = OUString((char *)xOld, strlen((char *)xOld), RTL_TEXTENCODING_UTF8); + xmlFree(xOld); xmlSetNsProp(m_aNodePtr, pNs, xLName, xValue); } // dispatch DOMAttrModified event -- cgit From 69994bc72e552c1d7fb15be20caa5e979af2c28c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Dec 2010 16:32:09 +0000 Subject: cppcheck: prefer prefix variant --- unoxml/source/events/eventdispatcher.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx index 3c1033347bc3..b08a080cbfdb 100644 --- a/unoxml/source/events/eventdispatcher.cxx +++ b/unoxml/source/events/eventdispatcher.cxx @@ -47,11 +47,11 @@ namespace DOM { namespace events { if ((iter->second).is() && iter->second == aListener) { ListenerMap::iterator tmp_iter = iter; - iter++; + ++iter; pMap->erase(tmp_iter); } else - iter++; + ++iter; } } } @@ -67,7 +67,7 @@ namespace DOM { namespace events { ListenerMap *pMap = tIter->second; ListenerMap::const_iterator iter = pMap->lower_bound(pNode); ListenerMap::const_iterator ibound = pMap->upper_bound(pNode); - for( ; iter != ibound; iter++ ) + for( ; iter != ibound; ++iter ) { if((iter->second).is()) (iter->second)->handleEvent(xEvent); @@ -163,7 +163,7 @@ namespace DOM { namespace events { // start at the root inode = captureVector.end(); - inode--; + --inode; if (inode != captureVector.end()) { // capturing phase: @@ -174,7 +174,7 @@ namespace DOM { namespace events { pEvent->m_currentTarget = Reference< XEventTarget >(DOM::CNode::get(*inode)); callListeners(*inode, aType, xEvent, sal_True); if (pEvent->m_canceled) return sal_True; - inode--; + --inode; } // target phase @@ -182,7 +182,7 @@ namespace DOM { namespace events { callListeners(*inode, aType, xEvent, sal_False); if (pEvent->m_canceled) return sal_True; // bubbeling phase - inode++; + ++inode; if (aEvent->getBubbles()) { pEvent->m_phase = PhaseType_BUBBLING_PHASE; while (inode != captureVector.end()) @@ -190,7 +190,7 @@ namespace DOM { namespace events { pEvent->m_currentTarget = Reference< XEventTarget >(DOM::CNode::get(*inode)); callListeners(*inode, aType, xEvent, sal_False); if (pEvent->m_canceled) return sal_True; - inode++; + ++inode; } } } -- cgit From a3f6cded87000e53cb0a1cea004888276f0cd201 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 16 Jan 2011 14:12:26 +0000 Subject: equalsAsciiL faster than equalsAscii & comparetoAscii(const sal_Char*) --- unoxml/source/dom/document.cxx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 60b044c7f43e..09e3cafc66fc 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -612,29 +612,29 @@ namespace DOM { events::CEvent *pEvent = 0; if ( - aType.compareToAscii("DOMSubtreeModified") == 0|| - aType.compareToAscii("DOMNodeInserted") == 0|| - aType.compareToAscii("DOMNodeRemoved") == 0|| - aType.compareToAscii("DOMNodeRemovedFromDocument") == 0|| - aType.compareToAscii("DOMNodeInsertedIntoDocument") == 0|| - aType.compareToAscii("DOMAttrModified") == 0|| - aType.compareToAscii("DOMCharacterDataModified") == 0) + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMSubtreeModified")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMNodeInserted")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMNodeRemoved")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMNodeRemovedFromDocument")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMNodeInsertedIntoDocument")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMAttrModified")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMCharacterDataModified"))) { pEvent = new events::CMutationEvent; } else if ( - aType.compareToAscii("DOMFocusIn") == 0|| - aType.compareToAscii("DOMFocusOut") == 0|| - aType.compareToAscii("DOMActivate") == 0) + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMFocusIn")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMFocusOut")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMActivate"))) { pEvent = new events::CUIEvent; } else if ( - aType.compareToAscii("click") == 0|| - aType.compareToAscii("mousedown") == 0|| - aType.compareToAscii("mouseup") == 0|| - aType.compareToAscii("mouseover") == 0|| - aType.compareToAscii("mousemove") == 0|| - aType.compareToAscii("mouseout") == 0 ) + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("click")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("mousedown")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("mouseup")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("mouseover")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("mousemove")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("mouseout")) ) { pEvent = new events::CMouseEvent; } -- cgit From ca5d4067c9997c6f7cffee0d6bda43eb3e378126 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 18 Jan 2011 12:10:32 +0000 Subject: free ctxt *after* taking lastError details --- unoxml/source/dom/documentbuilder.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 1c7f3140a33e..6c9d52b955b9 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -314,13 +314,13 @@ namespace DOM } // extern "C" - void throwEx(xmlParserCtxtPtr ctxt) { - OUString msg = make_error_message(ctxt); - xmlFreeParserCtxt(ctxt); + void throwEx(xmlParserCtxtPtr ctxt) + { com::sun::star::xml::sax::SAXParseException saxex; - saxex.Message = msg; + saxex.Message = make_error_message(ctxt); saxex.LineNumber = static_cast(ctxt->lastError.line); saxex.ColumnNumber = static_cast(ctxt->lastError.int2); + xmlFreeParserCtxt(ctxt); throw saxex; } -- cgit From fa646ceffa3dfd04ea7cc45733e4fa368ff3dd13 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 Jan 2011 14:47:29 +0000 Subject: WaE: gcc 4.6.0 various warnings --- unoxml/source/dom/documentbuilder.cxx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 6c9d52b955b9..b65fffc632da 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -360,17 +360,9 @@ namespace DOM return Reference< XDocument >(static_cast< CDocument* >(CNode::get((xmlNodePtr)pDoc))); } - Reference< XDocument > SAL_CALL CDocumentBuilder::parseSource(const InputSource& is) + Reference< XDocument > SAL_CALL CDocumentBuilder::parseSource(const InputSource& /*is*/) throw (RuntimeException, SAXParseException, IOException) { - // if there is an encoding specified in the input source, use it - xmlCharEncoding enc = XML_CHAR_ENCODING_NONE; - if (is.sEncoding.getLength() > 0) { - OString oEncstr = OUStringToOString(is.sEncoding, RTL_TEXTENCODING_UTF8); - char *encstr = (char*) oEncstr.getStr(); - enc = xmlParseCharEncoding(encstr); - } - // set up parser context xmlParserCtxtPtr ctxt = xmlNewParserCtxt(); // register error functions to prevent errors being printed -- cgit From e0239bdc6a6389be727c341ad4b9a95c689277a6 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Fri, 28 Jan 2011 15:40:51 +0100 Subject: Replace empty equalsAscii() with getLength(). --- unoxml/source/dom/element.cxx | 2 +- unoxml/source/rdf/CLiteral.cxx | 2 +- unoxml/source/rdf/librdf_repository.cxx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index cc8bde8fd0cd..804e8473f2a7 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -60,7 +60,7 @@ namespace DOM OUString prefix(reinterpret_cast(pPrefix), strlen(reinterpret_cast(pPrefix)), RTL_TEXTENCODING_UTF8); - OUString name = (prefix.equalsAscii("")) + OUString name = (prefix.getLength() == 0) ? OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns")) : OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:")) + prefix; const xmlChar *pHref = pNs->href; diff --git a/unoxml/source/rdf/CLiteral.cxx b/unoxml/source/rdf/CLiteral.cxx index 6867d71ed1c8..549cee2146f4 100644 --- a/unoxml/source/rdf/CLiteral.cxx +++ b/unoxml/source/rdf/CLiteral.cxx @@ -160,7 +160,7 @@ void SAL_CALL CLiteral::initialize(const css::uno::Sequence< ::com::sun::star::u // ::com::sun::star::rdf::XNode: ::rtl::OUString SAL_CALL CLiteral::getStringValue() throw (css::uno::RuntimeException) { - if (!m_Language.equalsAscii("")) { + if (m_Language.getLength()) { ::rtl::OUStringBuffer buf(m_Value); buf.appendAscii("@"); buf.append(m_Language); diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index caf6c19dfd32..fa5b065d068b 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1434,7 +1434,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, // ensure that the metadatable has an XML ID i_xObject->ensureMetadataReference(); const beans::StringPair mdref( i_xObject->getMetadataReference() ); - if (mdref.First.equalsAscii("") || mdref.Second.equalsAscii("")) { + if ((mdref.First.getLength() == 0) || (mdref.Second.getLength() == 0)) { throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " "ensureMetadataReference did not")), *this); @@ -1497,7 +1497,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } const beans::StringPair mdref( i_xElement->getMetadataReference() ); - if (mdref.First.equalsAscii("") || mdref.Second.equalsAscii("")) { + if ((mdref.First.getLength() == 0) || (mdref.Second.getLength() == 0)) { return; // nothing to do... } uno::Reference xXmlId; @@ -1528,7 +1528,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "librdf_Repository::getStatementRDFa: Element is null")), *this, 0); } const beans::StringPair mdref( i_xElement->getMetadataReference() ); - if (mdref.First.equalsAscii("") || mdref.Second.equalsAscii("")) { + if ((mdref.First.getLength() == 0) || (mdref.Second.getLength() == 0)) { return beans::Pair< uno::Sequence, sal_Bool >(); } ::rtl::OUString const sXmlId(mdref.First + -- cgit From c49b647c0ad2b5f7e729b4b8f4d4c21629d0be0c Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Sun, 6 Feb 2011 10:37:38 +0100 Subject: sgi hash containers -> boost unordered containers --- unoxml/source/dom/node.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/node.hxx b/unoxml/source/dom/node.hxx index be84ee49087c..d880eab60c75 100644 --- a/unoxml/source/dom/node.hxx +++ b/unoxml/source/dom/node.hxx @@ -56,7 +56,7 @@ #include #include -#include +#include using ::rtl::OUString; using ::rtl::OString; @@ -92,7 +92,7 @@ namespace DOM }; typedef std::vector< std::vector > NamespaceVectorType; - typedef std::hash_map< OUString, + typedef boost::unordered_map< OUString, sal_Int32, rtl::OUStringHash > NamespaceMapType; -- cgit From c7647b7767f70dc9679719ed2484b74b5040c6b5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 24 Feb 2011 20:46:16 +0000 Subject: remove empty TESTSHL2LIB --- unoxml/test/makefile.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/test/makefile.mk b/unoxml/test/makefile.mk index 11fe8884befd..790a34a6a71b 100644 --- a/unoxml/test/makefile.mk +++ b/unoxml/test/makefile.mk @@ -64,7 +64,6 @@ SHL1STDLIBS= \ $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPUNITLIB) \ - $(TESTSHL2LIB) \ $(CPPULIB) \ $(SAXLIB) \ $(SALLIB)\ -- cgit From ac22bf0d8ad4ebc06772a5de07759c38e7c8df0a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 1 Mar 2011 14:54:42 +0000 Subject: avoid implicit cast --- unoxml/source/dom/characterdata.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx index 060d33d3f546..0ee8bb4b65cd 100644 --- a/unoxml/source/dom/characterdata.cxx +++ b/unoxml/source/dom/characterdata.cxx @@ -80,7 +80,7 @@ namespace DOM { // get current data OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr)); - OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8); + OUString tmp(rtl::OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0) { DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; @@ -142,7 +142,7 @@ namespace DOM { // get current data OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr)); - OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8); + OUString tmp(rtl::OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0) { DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; @@ -172,7 +172,7 @@ namespace DOM { // get current data OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr)); - OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8); + OUString tmp(rtl::OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0){ DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; @@ -218,7 +218,7 @@ namespace DOM { // get current data OString aData((const sal_Char*)xmlNodeGetContent(m_aNodePtr)); - OUString tmp(aData, aData.getLength(), RTL_TEXTENCODING_UTF8); + OUString tmp(rtl::OStringToOUString(aData, RTL_TEXTENCODING_UTF8)); if (offset > tmp.getLength() || offset < 0 || count < 0) { DOMException e; e.Code = DOMExceptionType_INDEX_SIZE_ERR; -- cgit From e2cb41babdcc39ba9224f2cddf7d0eb84dd25368 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 2 Mar 2011 11:09:41 +0000 Subject: Resolves: fdo#33701 ensure node outlives path The xpath on destruction needs the xmldoc to exist, so the reference to the doc-owning nodelist needs to be the first reference listed in the class in order that its dtor is called *after* the xpath dtor --- unoxml/source/xpath/nodelist.cxx | 4 ++-- unoxml/source/xpath/nodelist.hxx | 4 ++-- unoxml/source/xpath/xpathobject.cxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx index 734df439eb24..49a1484939d2 100644 --- a/unoxml/source/xpath/nodelist.cxx +++ b/unoxml/source/xpath/nodelist.cxx @@ -31,8 +31,8 @@ namespace XPath { - CNodeList::CNodeList(boost::shared_ptr& rxpathObj, const Reference< XNode >& contextNode) - : m_xContextNode(contextNode) + CNodeList::CNodeList(const Reference< XNode >& rContextNode, boost::shared_ptr& rxpathObj) + : m_xContextNode(rContextNode) , m_pNodeSet(0) { if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx index de0b1d287155..af8770199dda 100644 --- a/unoxml/source/xpath/nodelist.hxx +++ b/unoxml/source/xpath/nodelist.hxx @@ -53,12 +53,12 @@ namespace XPath class CNodeList : public cppu::WeakImplHelper1< XNodeList > { private: - boost::shared_ptr m_pXPathObj; const Reference< XNode > m_xContextNode; + boost::shared_ptr m_pXPathObj; xmlNodeSetPtr m_pNodeSet; public: - CNodeList(boost::shared_ptr &rxpathObj, const Reference< XNode >& contextNode); + CNodeList(const Reference< XNode >& contextNode, boost::shared_ptr &rxpathObj); /** The number of nodes in the list. */ diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx index 1e20179a0d01..c33eeb6477dc 100644 --- a/unoxml/source/xpath/xpathobject.cxx +++ b/unoxml/source/xpath/xpathobject.cxx @@ -86,7 +86,7 @@ namespace XPath */ Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException) { - return Reference< XNodeList >(new CNodeList(m_pXPathObj, m_xContextNode)); + return Reference< XNodeList >(new CNodeList(m_xContextNode, m_pXPathObj)); } /** -- cgit From 7d669e4cdc6ddcb680ffb4f05b18a8925a76a6b0 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 12 Mar 2011 11:43:16 +0100 Subject: Move OSL_ENSURE(false,...) to OSL_FAIL(...) --- unoxml/source/rdf/librdf_repository.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index fa5b065d068b..5fdf2788f8ad 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1554,7 +1554,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, while (xIter->hasMoreElements()) { rdf::Statement stmt; if (!(xIter->nextElement() >>= stmt)) { - OSL_ENSURE(false, "getStatementRDFa: result of wrong type?"); + OSL_FAIL("getStatementRDFa: result of wrong type?"); } else { ret.push_back(stmt); } @@ -2033,7 +2033,7 @@ librdf_node* librdf_TypeConverter::mkNode( librdf_world* i_pWorld, (lang.getStr()), 0); } else { - OSL_ENSURE(false, "mkNode: invalid literal"); + OSL_FAIL("mkNode: invalid literal"); return 0; } } @@ -2114,7 +2114,7 @@ librdf_TypeConverter::convertToXURI(librdf_node* i_pNode) const } return convertToXURI(pURI); } else { - OSL_ENSURE(false, "convertToXURI: unknown librdf_node"); + OSL_FAIL("convertToXURI: unknown librdf_node"); return 0; } } -- cgit From 05745bb195bd54933dbc2333fde1b147f894c0ea Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 19 Mar 2011 14:08:24 +0100 Subject: Move OSL_ENSURE(sal_False,...) to OSL_FAIL(...) --- unoxml/source/dom/documentbuilder.cxx | 10 +++++----- unoxml/source/dom/elementlist.cxx | 2 +- unoxml/source/xpath/xpathapi.cxx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index b65fffc632da..c1cefe1efc9c 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -94,7 +94,7 @@ namespace DOM is.aInputStream = aContent.openStream(); } catch (com::sun::star::uno::Exception) { - OSL_ENSURE(sal_False, "exception in default entity resolver"); + OSL_FAIL("exception in default entity resolver"); is.aInputStream = Reference< XInputStream >(); } return is; @@ -228,7 +228,7 @@ namespace DOM return nread; } catch (com::sun::star::uno::Exception& ex) { (void) ex; - OSL_ENSURE(sal_False, OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr()); + OSL_FAIL(OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr()); return -1; } } @@ -248,7 +248,7 @@ namespace DOM return 0; } catch (com::sun::star::uno::Exception& ex) { (void) ex; - OSL_ENSURE(sal_False, OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr()); + OSL_FAIL(OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr()); return -1; } } @@ -300,7 +300,7 @@ namespace DOM OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 warning\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, msg.getStr()); + OSL_FAIL(msg.getStr()); } // default error handler triggers assertion @@ -309,7 +309,7 @@ namespace DOM OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 error\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, msg.getStr()); + OSL_FAIL(msg.getStr()); } } // extern "C" diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx index 5b0d96758459..f458b1928d23 100644 --- a/unoxml/source/dom/elementlist.cxx +++ b/unoxml/source/dom/elementlist.cxx @@ -72,7 +72,7 @@ namespace DOM } catch (Exception &e){ OString aMsg("Exception caught while registering NodeList as listener:\n"); aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, aMsg.getStr()); + OSL_FAIL(aMsg.getStr()); } } diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index a800cefc5f52..ee729a9451e3 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -283,7 +283,7 @@ namespace XPath buf.appendAscii(str); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, msg.getStr()); + OSL_FAIL(msg.getStr()); } static void structured_error_func(void * userData, xmlErrorPtr error) @@ -298,7 +298,7 @@ namespace XPath } OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, msg.getStr()); + OSL_FAIL(msg.getStr()); } } // extern "C" -- cgit From 42d30393e52184c2564f0967d8e6a78294df7f28 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 23 Mar 2011 19:59:04 +0000 Subject: get rid of hash_map include --- unoxml/source/dom/node.hxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/node.hxx b/unoxml/source/dom/node.hxx index 999c311b3ef3..3d0ff86afab7 100644 --- a/unoxml/source/dom/node.hxx +++ b/unoxml/source/dom/node.hxx @@ -29,8 +29,6 @@ #ifndef DOM_NODE_HXX #define DOM_NODE_HXX -#include - #include #include -- cgit From aed8ab570a0517faf4464868f57ea6fb3e4f3f21 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Fri, 25 Mar 2011 16:32:08 +0100 Subject: fd#35667: disable checkSPARQL() in complex.unoxml.RDFRepositoryTest --- unoxml/qa/complex/unoxml/RDFRepositoryTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java index d047ef77440e..ebf6af691343 100644 --- a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java +++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java @@ -361,7 +361,9 @@ public class RDFRepositoryTest } } - @Test public void checkSPARQL() + // fd#35667 disabling for now, because test fails + // @Test + public void checkSPARQL() { try { -- cgit From 8c3acb7cc3d8e7c579a34e151f4e795f474b1cf2 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Fri, 25 Mar 2011 16:53:42 +0100 Subject: fd#35668: disable testXDocumentBuilder() in complex.unoxml.DOMTest --- unoxml/qa/complex/unoxml/DOMTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/qa/complex/unoxml/DOMTest.java b/unoxml/qa/complex/unoxml/DOMTest.java index e7efad8ab5a7..ba276e0fc53c 100644 --- a/unoxml/qa/complex/unoxml/DOMTest.java +++ b/unoxml/qa/complex/unoxml/DOMTest.java @@ -98,7 +98,9 @@ public class DOMTest //FIXME TODO } - @Test public void testXDocumentBuilder() throws Exception + // fd#35668 disabled, this crashes LibreOffice + //@Test + public void testXDocumentBuilder() throws Exception { XDocumentBuilder xBuilder = UnoRuntime.queryInterface(XDocumentBuilder.class, -- cgit From 0811263e65e1ed48700adc9916bcdef9ab950b37 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 29 Mar 2011 09:11:06 +0200 Subject: this is just a warning, not error --- unoxml/source/dom/documentbuilder.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 8015133ed87f..87124657a454 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -296,7 +296,7 @@ namespace DOM OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 warning\n"))); buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx))); OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); - OSL_FAIL(msg.getStr()); + OSL_TRACE(msg.getStr()); } // default error handler triggers assertion -- cgit From 40f952a1527f999dd9bc137878ca53a6792ab409 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 29 Mar 2011 09:12:54 +0200 Subject: change the function's description too --- unoxml/source/dom/documentbuilder.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 87124657a454..f950964320c8 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -290,7 +290,7 @@ namespace DOM } #endif - // default warning handler triggers assertion + // default warning handler does not trigger assertion static void warning_func(void * ctx, const char * /*msg*/, ...) { OUStringBuffer buf(OUString(RTL_CONSTASCII_USTRINGPARAM("libxml2 warning\n"))); -- cgit From 38483573ba892b5cb6f69f038d114ab66b95fd71 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Apr 2011 09:58:32 +0100 Subject: catch by const reference --- unoxml/source/dom/documentbuilder.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index f950964320c8..8b38fd36fe44 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -83,7 +83,7 @@ namespace DOM Content aContent(sSystemId, aEnvironment); is.aInputStream = aContent.openStream(); - } catch (com::sun::star::uno::Exception) { + } catch (const com::sun::star::uno::Exception&) { OSL_FAIL("exception in default entity resolver"); is.aInputStream = Reference< XInputStream >(); } -- cgit From 7c4fbccee7b3776242d21c5980ce671b162821b0 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Wed, 20 Apr 2011 21:03:55 +0200 Subject: Easyhack: Add visibility markup to all component_get* functions --- unoxml/source/rdf/librdf_services.cxx | 6 ++---- unoxml/source/service/services.cxx | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx index 62201475cee3..03b2b1e39eec 100644 --- a/unoxml/source/rdf/librdf_services.cxx +++ b/unoxml/source/rdf/librdf_services.cxx @@ -39,8 +39,7 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL -component_getImplementationEnvironment(const sal_Char **o_ppEnvironmentTypeName, +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char **o_ppEnvironmentTypeName, uno_Environment ** /* ppEnvironment */) { *o_ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; @@ -66,8 +65,7 @@ static ::cppu::ImplementationEntry const entries[] = { { 0, 0, 0, 0, 0, 0 } }; -SAL_DLLPUBLIC_EXPORT void * SAL_CALL -component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const char * implName, void * serviceManager, void * registryKey) { return ::cppu::component_getFactoryHelper( diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx index 44c988ede39b..b81c363931fa 100644 --- a/unoxml/source/service/services.cxx +++ b/unoxml/source/service/services.cxx @@ -55,14 +55,12 @@ using namespace ::com::sun::star::registry; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL -component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, uno_Environment ** /*ppEnvironment */) +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, uno_Environment ** /*ppEnvironment */) { *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -SAL_DLLPUBLIC_EXPORT void* SAL_CALL -component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/) +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/) { void* pReturn = NULL ; if ( pImplementationName && pServiceManager ) -- cgit From cff30e58bf33d693c508a7af71f9f1c8adc58c03 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 28 Apr 2011 17:57:31 +0200 Subject: unoxml-fix-empty-xmlns.diff: crasher in xml parser --- unoxml/source/dom/node.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 7ab6336aefdf..b4645bc0b578 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -87,8 +87,9 @@ namespace DOM // add node's namespaces to current context for (xmlNsPtr pNs = pNode->nsDef; pNs != 0; pNs = pNs->next) { const xmlChar *pPrefix = pNs->prefix; + // prefix can be NULL when xmlns attribute is empty (xmlns="") OString prefix(reinterpret_cast(pPrefix), - strlen(reinterpret_cast(pPrefix))); + pPrefix ? strlen(reinterpret_cast(pPrefix)) : 0); const xmlChar *pHref = pNs->href; OUString val(reinterpret_cast(pHref), strlen(reinterpret_cast(pHref)), -- cgit From 2108d136b976342505e64f46d0b7a4ccf68b7299 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Mon, 16 May 2011 01:40:30 +0200 Subject: fdo#35668: do not manually free parser context * reenable complex.unoxml.DOMTest testXDocumentBuilder() * do not manually free parser context, there is a shared_ptr for that --- unoxml/qa/complex/unoxml/DOMTest.java | 3 +-- unoxml/source/dom/documentbuilder.cxx | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'unoxml') diff --git a/unoxml/qa/complex/unoxml/DOMTest.java b/unoxml/qa/complex/unoxml/DOMTest.java index ba276e0fc53c..d4b9a5fcf3b6 100644 --- a/unoxml/qa/complex/unoxml/DOMTest.java +++ b/unoxml/qa/complex/unoxml/DOMTest.java @@ -98,8 +98,7 @@ public class DOMTest //FIXME TODO } - // fd#35668 disabled, this crashes LibreOffice - //@Test + @Test public void testXDocumentBuilder() throws Exception { XDocumentBuilder xBuilder = diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 8b38fd36fe44..b5c19d0a5a40 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -316,7 +316,6 @@ namespace DOM saxex.Message = make_error_message(ctxt); saxex.LineNumber = static_cast(ctxt->lastError.line); saxex.ColumnNumber = static_cast(ctxt->lastError.int2); - xmlFreeParserCtxt(ctxt); throw saxex; } -- cgit From 80840b8b59f8a013d5f8da930d51c8639c2d9673 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Mon, 16 May 2011 01:40:30 +0200 Subject: fdo#35668: do not manually free parser context * reenable complex.unoxml.DOMTest testXDocumentBuilder() * do not manually free parser context, there is a shared_ptr for that --- unoxml/qa/complex/unoxml/DOMTest.java | 3 +-- unoxml/source/dom/documentbuilder.cxx | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'unoxml') diff --git a/unoxml/qa/complex/unoxml/DOMTest.java b/unoxml/qa/complex/unoxml/DOMTest.java index ba276e0fc53c..d4b9a5fcf3b6 100644 --- a/unoxml/qa/complex/unoxml/DOMTest.java +++ b/unoxml/qa/complex/unoxml/DOMTest.java @@ -98,8 +98,7 @@ public class DOMTest //FIXME TODO } - // fd#35668 disabled, this crashes LibreOffice - //@Test + @Test public void testXDocumentBuilder() throws Exception { XDocumentBuilder xBuilder = diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index f950964320c8..0f240399bfed 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -316,7 +316,6 @@ namespace DOM saxex.Message = make_error_message(ctxt); saxex.LineNumber = static_cast(ctxt->lastError.line); saxex.ColumnNumber = static_cast(ctxt->lastError.int2); - xmlFreeParserCtxt(ctxt); throw saxex; } -- cgit From bdc6b3c6da58a7fd4386e36577345ada1a86def1 Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Mon, 16 May 2011 22:22:59 +0200 Subject: WaE (picky) - noeol --- unoxml/source/events/eventdispatcher.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/events/eventdispatcher.hxx b/unoxml/source/events/eventdispatcher.hxx index 9fca309035dd..9f007ff25066 100644 --- a/unoxml/source/events/eventdispatcher.hxx +++ b/unoxml/source/events/eventdispatcher.hxx @@ -94,4 +94,4 @@ public: #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From 38b66985693f103b7210ffb4e419d4604ac35a25 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Sun, 22 May 2011 17:04:15 +0200 Subject: fdo#35667: renable complex.unoxml.RDFRepositoryTest checkSPARQL() as it works --- unoxml/qa/complex/unoxml/RDFRepositoryTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'unoxml') diff --git a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java index ebf6af691343..0e51ca927dd1 100644 --- a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java +++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java @@ -361,8 +361,7 @@ public class RDFRepositoryTest } } - // fd#35667 disabling for now, because test fails - // @Test + @Test public void checkSPARQL() { try { -- cgit From 1f4d84f40e00967084ac4b7845b1e3599bef5075 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 2 Jun 2011 00:18:25 +0100 Subject: swap in the standard template for this --- unoxml/source/dom/node.cxx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index b4645bc0b578..8cbcfc534a7d 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -43,6 +43,8 @@ #include +#include + #include #include #include @@ -54,19 +56,9 @@ using namespace ::com::sun::star; - -namespace { - struct UnoTunnelId - : public ::rtl::StaticWithInit< Sequence, UnoTunnelId > - { - Sequence operator() () - { - Sequence ret(16); - rtl_createUuid( - reinterpret_cast(ret.getArray()), 0, sal_True); - return ret; - } - }; +namespace +{ + class theCNodeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theCNodeUnoTunnelId > {}; } namespace DOM @@ -192,7 +184,7 @@ namespace DOM if (!xUnoTunnel.is()) { return 0; } CNode *const pCNode( reinterpret_cast< CNode* >( ::sal::static_int_cast< sal_IntPtr >( - xUnoTunnel->getSomething(UnoTunnelId::get())))); + xUnoTunnel->getSomething(theCNodeUnoTunnelId::get().getSeq())))); return pCNode; } @@ -1053,7 +1045,7 @@ namespace DOM throw (RuntimeException) { if ((rId.getLength() == 16) && - (0 == rtl_compareMemory(UnoTunnelId::get().getConstArray(), + (0 == rtl_compareMemory(theCNodeUnoTunnelId::get().getSeq().getConstArray(), rId.getConstArray(), 16))) { return ::sal::static_int_cast< sal_Int64 >( -- cgit From 655d930476045a2de7f3ead4768bb75df8cf7c82 Mon Sep 17 00:00:00 2001 From: Korrawit Pruegsanusak Date: Sun, 12 Jun 2011 16:40:20 +0700 Subject: Code cleanup * Remove dead code * Fix comment typos Released under LGPLv3+/MPL --- unoxml/source/dom/element.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 4211bb4878f2..9259caa318e0 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -579,7 +579,7 @@ namespace DOM reinterpret_cast(res)).get()), UNO_QUERY_THROW); - // attribute adition event + // attribute addition event // dispatch DOMAttrModified event Reference< XDocumentEvent > docevent(getOwnerDocument(), UNO_QUERY); Reference< XMutationEvent > event(docevent->createEvent( -- cgit From 9318741208ac10efe85d2e70752f859ba0664539 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 11 Jun 2011 00:14:13 +0100 Subject: createFromAscii -> RTL_CONSTASCII_USTRINGPARAM --- unoxml/source/dom/document.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 43ce284f40ee..50f4dc1c52e2 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -908,7 +908,7 @@ namespace DOM OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument"))), UNO_QUERY_THROW); event->initMutationEvent( - OUString::createFromAscii("DOMNodeInsertedIntoDocument") + OUString(RTL_CONSTASCII_USTRINGPARAM("DOMNodeInsertedIntoDocument")) , sal_True, sal_False, Reference< XNode >(), OUString(), OUString(), OUString(), (AttrChangeType)0 ); Reference< XEventTarget > const xDocET(xDocument, UNO_QUERY); -- cgit