targeted string re-work
Change-Id: Ic547a05d2540a9fb70a38b3717cb4e87726a74a5
This commit is contained in:
parent
11ccf6b59c
commit
bcce59d5ff
3 changed files with 41 additions and 46 deletions
|
@ -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(RTL_CONSTASCII_USTRINGPARAM("CBlankNode::initialize: "
|
||||
"must give exactly 1 argument")), *this, 1);
|
||||
::rtl::OUString("CBlankNode::initialize: "
|
||||
"must give exactly 1 argument"), *this, 1);
|
||||
}
|
||||
|
||||
::rtl::OUString arg;
|
||||
if (!(aArguments[0] >>= arg)) {
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CBlankNode::initialize: "
|
||||
"argument must be string")), *this, 0);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CBlankNode::initialize: "
|
||||
"argument is not valid blank node ID")), *this, 0);
|
||||
::rtl::OUString("CBlankNode::initialize: "
|
||||
"argument is not valid blank node ID"), *this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,15 +136,13 @@ void SAL_CALL CBlankNode::initialize(const css::uno::Sequence< ::com::sun::star:
|
|||
namespace comp_CBlankNode {
|
||||
|
||||
::rtl::OUString SAL_CALL _getImplementationName() {
|
||||
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"CBlankNode"));
|
||||
return ::rtl::OUString( "CBlankNode");
|
||||
}
|
||||
|
||||
css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
|
||||
{
|
||||
css::uno::Sequence< ::rtl::OUString > s(1);
|
||||
s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"com.sun.star.rdf.BlankNode"));
|
||||
s[0] = ::rtl::OUString( "com.sun.star.rdf.BlankNode");
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
@ -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(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: "
|
||||
"must give 1 or 2 argument(s)")), *this, 2);
|
||||
::rtl::OUString("CLiteral::initialize: "
|
||||
"must give 1 or 2 argument(s)"), *this, 2);
|
||||
}
|
||||
|
||||
::rtl::OUString arg0;
|
||||
if (!(aArguments[0] >>= arg0)) {
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: "
|
||||
"argument must be string")), *this, 0);
|
||||
::rtl::OUString("CLiteral::initialize: "
|
||||
"argument must be string"), *this, 0);
|
||||
}
|
||||
//FIXME: what is legal?
|
||||
if (true) {
|
||||
m_Value = arg0;
|
||||
} else {
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: "
|
||||
"argument is not valid literal value")), *this, 0);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: "
|
||||
"argument is not valid language")), *this, 1);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: "
|
||||
"argument is null")), *this, 1);
|
||||
::rtl::OUString("CLiteral::initialize: "
|
||||
"argument is null"), *this, 1);
|
||||
}
|
||||
} else {
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLiteral::initialize: "
|
||||
"argument must be string or URI")), *this, 1);
|
||||
::rtl::OUString("CLiteral::initialize: "
|
||||
"argument must be string or URI"), *this, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -199,15 +199,13 @@ css::uno::Reference< css::rdf::XURI > SAL_CALL CLiteral::getDatatype() throw (cs
|
|||
namespace comp_CLiteral {
|
||||
|
||||
::rtl::OUString SAL_CALL _getImplementationName() {
|
||||
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"CLiteral"));
|
||||
return ::rtl::OUString( "CLiteral");
|
||||
}
|
||||
|
||||
css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
|
||||
{
|
||||
css::uno::Sequence< ::rtl::OUString > s(1);
|
||||
s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"com.sun.star.rdf.Literal"));
|
||||
s[0] = ::rtl::OUString( "com.sun.star.rdf.Literal");
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
@ -738,8 +738,8 @@ void SAL_CALL CURI::initFromConstant(const sal_Int16 i_Constant)
|
|||
|
||||
default:
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"invalid URIs constant argument")), *this, 0);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"must give 1 or 2 argument(s)")), *this, 2);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"must give 1 int argument")), *this, 1);
|
||||
::rtl::OUString("CURI::initialize: "
|
||||
"must give 1 int argument"), *this, 1);
|
||||
}
|
||||
initFromConstant(arg);
|
||||
return;
|
||||
}
|
||||
if (!(aArguments[0] >>= arg0)) {
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"argument must be string or short")), *this, 0);
|
||||
::rtl::OUString("CURI::initialize: "
|
||||
"argument must be string or short"), *this, 0);
|
||||
}
|
||||
if (len > 1) {
|
||||
if (!(aArguments[1] >>= arg1)) {
|
||||
throw css::lang::IllegalArgumentException(
|
||||
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"argument must be string")), *this, 1);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"argument not splittable: no separator [#/:]")), *this, 0);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"argument is not valid namespace")), *this, 0);
|
||||
::rtl::OUString("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(RTL_CONSTASCII_USTRINGPARAM("CURI::initialize: "
|
||||
"argument is not valid local name")), *this, 1);
|
||||
::rtl::OUString("CURI::initialize: "
|
||||
"argument is not valid local name"), *this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -845,15 +845,14 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< ::com::sun::star::uno::
|
|||
namespace comp_CURI {
|
||||
|
||||
::rtl::OUString SAL_CALL _getImplementationName() {
|
||||
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"CURI"));
|
||||
return ::rtl::OUString(
|
||||
"CURI");
|
||||
}
|
||||
|
||||
css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
|
||||
{
|
||||
css::uno::Sequence< ::rtl::OUString > s(1);
|
||||
s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"com.sun.star.rdf.URI"));
|
||||
s[0] = ::rtl::OUString( "com.sun.star.rdf.URI");
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue