Allow starts-/endsWith* to also return the rest of the matched string
...as there are many cases where the code later wants to obtain this part, and esp. for the string literal variants it is awkward to calculate the length of the literal again if this is coded with a following copy() call. Adapt some code to use this new feature. (Strictly speaking, the @since tags for the---backwards-compatibly---modified functions are no longer accurate of course. Also, clean up some sal_Bool and SAL_THROWS(()) that are unnecesssary cargo-cult here, and where the clean-up should have no practical compatibility consequences.) Change-Id: I43e5c578c8c4b44cb47fd08f170b5c69322ad641
This commit is contained in:
parent
bb20def9f6
commit
57af2ee947
@ -1398,9 +1398,11 @@ rtl::Reference< Node > Access::getParentNode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtl::Reference< ChildAccess > Access::getChild(OUString const & name) {
|
rtl::Reference< ChildAccess > Access::getChild(OUString const & name) {
|
||||||
if (getNode()->kind() == Node::KIND_LOCALIZED_PROPERTY && name.match("*")) {
|
OUString locale;
|
||||||
OUString locale(name.copy(1));
|
if (getNode()->kind() == Node::KIND_LOCALIZED_PROPERTY
|
||||||
if (locale.match("*")) {
|
&& name.startsWith("*", &locale))
|
||||||
|
{
|
||||||
|
if (locale.startsWith("*")) {
|
||||||
SAL_WARN(
|
SAL_WARN(
|
||||||
"configmgr",
|
"configmgr",
|
||||||
("access best-matching localized property value via"
|
("access best-matching localized property value via"
|
||||||
@ -1443,7 +1445,7 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) {
|
|||||||
i != children.end(); ++i)
|
i != children.end(); ++i)
|
||||||
{
|
{
|
||||||
OUString name2((*i)->getNameInternal());
|
OUString name2((*i)->getNameInternal());
|
||||||
if (name2.match(locale) &&
|
if (name2.startsWith(locale) &&
|
||||||
(name2.getLength() == locale.getLength() ||
|
(name2.getLength() == locale.getLength() ||
|
||||||
name2[locale.getLength()] == '-' ||
|
name2[locale.getLength()] == '-' ||
|
||||||
name2[locale.getLength()] == '_'))
|
name2[locale.getLength()] == '_'))
|
||||||
|
@ -43,9 +43,7 @@
|
|||||||
#include "osl/mutex.hxx"
|
#include "osl/mutex.hxx"
|
||||||
#include "rtl/bootstrap.hxx"
|
#include "rtl/bootstrap.hxx"
|
||||||
#include "rtl/ref.hxx"
|
#include "rtl/ref.hxx"
|
||||||
#include "rtl/string.h"
|
|
||||||
#include "rtl/ustrbuf.hxx"
|
#include "rtl/ustrbuf.hxx"
|
||||||
#include "rtl/ustring.h"
|
|
||||||
#include "rtl/ustring.hxx"
|
#include "rtl/ustring.hxx"
|
||||||
#include "rtl/instance.hxx"
|
#include "rtl/instance.hxx"
|
||||||
#include "sal/log.hxx"
|
#include "sal/log.hxx"
|
||||||
@ -639,9 +637,7 @@ void Components::parseFiles(
|
|||||||
parseFiles(layer, extension, parseFile, stat.getFileURL(), true);
|
parseFiles(layer, extension, parseFile, stat.getFileURL(), true);
|
||||||
} else {
|
} else {
|
||||||
OUString file(stat.getFileName());
|
OUString file(stat.getFileName());
|
||||||
if (file.getLength() >= extension.getLength() &&
|
if (file.endsWith(extension)) {
|
||||||
file.match(extension, file.getLength() - extension.getLength()))
|
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
parseFileLeniently(
|
parseFileLeniently(
|
||||||
parseFile, stat.getFileURL(), layer, data_, 0, 0, 0);
|
parseFile, stat.getFileURL(), layer, data_, 0, 0, 0);
|
||||||
@ -718,14 +714,8 @@ void Components::parseXcdFiles(int layer, OUString const & url) {
|
|||||||
}
|
}
|
||||||
if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
|
if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
|
||||||
OUString file(stat.getFileName());
|
OUString file(stat.getFileName());
|
||||||
if (file.getLength() >= RTL_CONSTASCII_LENGTH(".xcd") &&
|
OUString name;
|
||||||
file.matchAsciiL(
|
if (file.endsWith(".xcd", &name)) {
|
||||||
RTL_CONSTASCII_STRINGPARAM(".xcd"),
|
|
||||||
file.getLength() - RTL_CONSTASCII_LENGTH(".xcd")))
|
|
||||||
{
|
|
||||||
OUString name(
|
|
||||||
file.copy(
|
|
||||||
0, file.getLength() - RTL_CONSTASCII_LENGTH(".xcd")));
|
|
||||||
existingDeps.insert(name);
|
existingDeps.insert(name);
|
||||||
rtl::Reference< ParseManager > manager;
|
rtl::Reference< ParseManager > manager;
|
||||||
try {
|
try {
|
||||||
|
@ -682,15 +682,22 @@ public:
|
|||||||
/**
|
/**
|
||||||
Check whether this string starts with a given substring.
|
Check whether this string starts with a given substring.
|
||||||
|
|
||||||
@param str the substring to be compared
|
@param str the substring to be compared
|
||||||
|
|
||||||
|
@param rest if non-null, and this function returns true, then assign a
|
||||||
|
copy of the remainder of this string to *rest
|
||||||
|
|
||||||
@return true if and only if the given str appears as a substring at the
|
@return true if and only if the given str appears as a substring at the
|
||||||
start of this string
|
start of this string
|
||||||
|
|
||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
bool startsWith(OString const & str) const {
|
bool startsWith(OString const & str, OString * rest = 0) const {
|
||||||
return match(str, 0);
|
bool b = match(str, 0);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(str.getLength());
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -699,25 +706,37 @@ public:
|
|||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
typename internal::ConstCharArrayDetector< T, bool >::Type startsWith( T& literal ) const
|
typename internal::ConstCharArrayDetector< T, bool >::Type startsWith(
|
||||||
|
T & literal, OString * rest = 0) const
|
||||||
{
|
{
|
||||||
RTL_STRING_CONST_FUNCTION
|
RTL_STRING_CONST_FUNCTION
|
||||||
return match(literal, 0);
|
bool b = match(literal, 0);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(internal::ConstCharArrayDetector< T, void >::size - 1);
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check whether this string ends with a given substring.
|
Check whether this string ends with a given substring.
|
||||||
|
|
||||||
@param str the substring to be compared
|
@param str the substring to be compared
|
||||||
|
|
||||||
|
@param rest if non-null, and this function returns true, then assign a
|
||||||
|
copy of the remainder of this string to *rest
|
||||||
|
|
||||||
@return true if and only if the given str appears as a substring at the
|
@return true if and only if the given str appears as a substring at the
|
||||||
end of this string
|
end of this string
|
||||||
|
|
||||||
@since LibreOffice 3.6
|
@since LibreOffice 3.6
|
||||||
*/
|
*/
|
||||||
bool endsWith(OString const & str) const {
|
bool endsWith(OString const & str, OString * rest = 0) const {
|
||||||
return str.getLength() <= getLength()
|
bool b = str.getLength() <= getLength()
|
||||||
&& match(str, getLength() - str.getLength());
|
&& match(str, getLength() - str.getLength());
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(0, getLength() - str.getLength());
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -726,12 +745,20 @@ public:
|
|||||||
@since LibreOffice 3.6
|
@since LibreOffice 3.6
|
||||||
*/
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
typename internal::ConstCharArrayDetector< T, bool >::Type endsWith( T& literal ) const
|
typename internal::ConstCharArrayDetector< T, bool >::Type endsWith(
|
||||||
|
T & literal, OString * rest = 0) const
|
||||||
{
|
{
|
||||||
RTL_STRING_CONST_FUNCTION
|
RTL_STRING_CONST_FUNCTION
|
||||||
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
||||||
return internal::ConstCharArrayDetector< T, void >::size - 1 <= getLength()
|
bool b = internal::ConstCharArrayDetector< T, void >::size - 1 <= getLength()
|
||||||
&& match(literal, getLength() - ( internal::ConstCharArrayDetector< T, void >::size - 1 ));
|
&& match(literal, getLength() - ( internal::ConstCharArrayDetector< T, void >::size - 1 ));
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(
|
||||||
|
0,
|
||||||
|
(getLength()
|
||||||
|
- (internal::ConstCharArrayDetector< T, void >::size - 1)));
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -923,15 +923,22 @@ public:
|
|||||||
/**
|
/**
|
||||||
Check whether this string starts with a given substring.
|
Check whether this string starts with a given substring.
|
||||||
|
|
||||||
@param str the substring to be compared
|
@param str the substring to be compared
|
||||||
|
|
||||||
|
@param rest if non-null, and this function returns true, then assign a
|
||||||
|
copy of the remainder of this string to *rest
|
||||||
|
|
||||||
@return true if and only if the given str appears as a substring at the
|
@return true if and only if the given str appears as a substring at the
|
||||||
start of this string
|
start of this string
|
||||||
|
|
||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
bool startsWith(OUString const & str) const {
|
bool startsWith(OUString const & str, OUString * rest = 0) const {
|
||||||
return match(str, 0);
|
bool b = match(str, 0);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(str.getLength());
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -940,12 +947,17 @@ public:
|
|||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
typename internal::ConstCharArrayDetector< T, bool >::Type startsWith( T& literal ) const
|
typename internal::ConstCharArrayDetector< T, bool >::Type startsWith(
|
||||||
|
T & literal, OUString * rest = 0) const
|
||||||
{
|
{
|
||||||
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
||||||
return internal::ConstCharArrayDetector< T, void >::size - 1 <= pData->length
|
bool b = internal::ConstCharArrayDetector< T, void >::size - 1 <= pData->length
|
||||||
&& rtl_ustr_asciil_reverseEquals_WithLength( pData->buffer, literal,
|
&& rtl_ustr_asciil_reverseEquals_WithLength( pData->buffer, literal,
|
||||||
internal::ConstCharArrayDetector< T, void >::size - 1);
|
internal::ConstCharArrayDetector< T, void >::size - 1);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(internal::ConstCharArrayDetector< T, void >::size - 1);
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -956,14 +968,25 @@ public:
|
|||||||
values between 97 and 122 (ASCII a-z).
|
values between 97 and 122 (ASCII a-z).
|
||||||
This function can't be used for language specific comparison.
|
This function can't be used for language specific comparison.
|
||||||
|
|
||||||
@param str the object (substring) to be compared.
|
@param str the substring to be compared
|
||||||
@return true if this string starts with str, ignoring the case of ASCII
|
|
||||||
letters ("A"--"Z" and "a"--"z"); otherwise, false is returned
|
@param rest if non-null, and this function returns true, then assign a
|
||||||
|
copy of the remainder of this string to *rest
|
||||||
|
|
||||||
|
@return true if and only if the given str appears as a substring at the
|
||||||
|
start of this string, ignoring the case of ASCII letters ("A"--"Z" and
|
||||||
|
"a"--"z")
|
||||||
|
|
||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
sal_Bool startsWithIgnoreAsciiCase( const OUString & str ) const SAL_THROW(())
|
bool startsWithIgnoreAsciiCase(OUString const & str, OUString * rest = 0)
|
||||||
|
const
|
||||||
{
|
{
|
||||||
return matchIgnoreAsciiCase(str, 0);
|
bool b = matchIgnoreAsciiCase(str, 0);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(str.getLength());
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -972,29 +995,41 @@ public:
|
|||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
typename internal::ConstCharArrayDetector< T, bool >::Type startsWithIgnoreAsciiCase( T& literal ) const SAL_THROW(())
|
typename internal::ConstCharArrayDetector< T, bool >::Type
|
||||||
|
startsWithIgnoreAsciiCase(T & literal, OUString * rest = 0) const
|
||||||
{
|
{
|
||||||
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
||||||
return (rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
|
bool b = (rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
|
||||||
pData->buffer,
|
pData->buffer,
|
||||||
internal::ConstCharArrayDetector< T, void >::size - 1, literal,
|
internal::ConstCharArrayDetector< T, void >::size - 1, literal,
|
||||||
internal::ConstCharArrayDetector< T, void >::size - 1)
|
internal::ConstCharArrayDetector< T, void >::size - 1)
|
||||||
== 0);
|
== 0);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(internal::ConstCharArrayDetector< T, void >::size - 1);
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check whether this string ends with a given substring.
|
Check whether this string ends with a given substring.
|
||||||
|
|
||||||
@param str the substring to be compared
|
@param str the substring to be compared
|
||||||
|
|
||||||
|
@param rest if non-null, and this function returns true, then assign a
|
||||||
|
copy of the remainder of this string to *rest
|
||||||
|
|
||||||
@return true if and only if the given str appears as a substring at the
|
@return true if and only if the given str appears as a substring at the
|
||||||
end of this string
|
end of this string
|
||||||
|
|
||||||
@since LibreOffice 3.6
|
@since LibreOffice 3.6
|
||||||
*/
|
*/
|
||||||
bool endsWith(OUString const & str) const {
|
bool endsWith(OUString const & str, OUString * rest = 0) const {
|
||||||
return str.getLength() <= getLength()
|
bool b = str.getLength() <= getLength()
|
||||||
&& match(str, getLength() - str.getLength());
|
&& match(str, getLength() - str.getLength());
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(0, getLength() - str.getLength());
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1003,13 +1038,21 @@ public:
|
|||||||
@since LibreOffice 3.6
|
@since LibreOffice 3.6
|
||||||
*/
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
typename internal::ConstCharArrayDetector< T, bool >::Type endsWith( T& literal ) const
|
typename internal::ConstCharArrayDetector< T, bool >::Type
|
||||||
|
endsWith(T & literal, OUString * rest = 0) const
|
||||||
{
|
{
|
||||||
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
||||||
return internal::ConstCharArrayDetector< T, void >::size - 1 <= pData->length
|
bool b = internal::ConstCharArrayDetector< T, void >::size - 1 <= pData->length
|
||||||
&& rtl_ustr_asciil_reverseEquals_WithLength(
|
&& rtl_ustr_asciil_reverseEquals_WithLength(
|
||||||
pData->buffer + pData->length - ( internal::ConstCharArrayDetector< T, void >::size - 1 ), literal,
|
pData->buffer + pData->length - ( internal::ConstCharArrayDetector< T, void >::size - 1 ), literal,
|
||||||
internal::ConstCharArrayDetector< T, void >::size - 1);
|
internal::ConstCharArrayDetector< T, void >::size - 1);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(
|
||||||
|
0,
|
||||||
|
(getLength()
|
||||||
|
- (internal::ConstCharArrayDetector< T, void >::size - 1)));
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1040,15 +1083,25 @@ public:
|
|||||||
values between 97 and 122 (ASCII a-z).
|
values between 97 and 122 (ASCII a-z).
|
||||||
This function can't be used for language specific comparison.
|
This function can't be used for language specific comparison.
|
||||||
|
|
||||||
@param str the object (substring) to be compared.
|
@param str the substring to be compared
|
||||||
@return true if this string ends with str, ignoring the case of ASCII
|
|
||||||
letters ("A"--"Z" and "a"--"z"); otherwise, false is returned
|
@param rest if non-null, and this function returns true, then assign a
|
||||||
|
copy of the remainder of this string to *rest
|
||||||
|
|
||||||
|
@return true if and only if the given str appears as a substring at the
|
||||||
|
end of this string, ignoring the case of ASCII letters ("A"--"Z" and
|
||||||
|
"a"--"z")
|
||||||
|
|
||||||
@since LibreOffice 3.6
|
@since LibreOffice 3.6
|
||||||
*/
|
*/
|
||||||
sal_Bool endsWithIgnoreAsciiCase( const OUString & str ) const SAL_THROW(())
|
bool endsWithIgnoreAsciiCase(OUString const & str, OUString * rest) const
|
||||||
{
|
{
|
||||||
return str.getLength() <= getLength()
|
bool b = str.getLength() <= getLength()
|
||||||
&& matchIgnoreAsciiCase(str, getLength() - str.getLength());
|
&& matchIgnoreAsciiCase(str, getLength() - str.getLength());
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(0, getLength() - str.getLength());
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1057,15 +1110,23 @@ public:
|
|||||||
@since LibreOffice 3.6
|
@since LibreOffice 3.6
|
||||||
*/
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
typename internal::ConstCharArrayDetector< T, bool >::Type endsWithIgnoreAsciiCase( T& literal ) const SAL_THROW(())
|
typename internal::ConstCharArrayDetector< T, bool >::Type
|
||||||
|
endsWithIgnoreAsciiCase(T & literal, OUString * rest = 0) const
|
||||||
{
|
{
|
||||||
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
|
||||||
return internal::ConstCharArrayDetector< T, void >::size - 1 <= pData->length
|
bool b = internal::ConstCharArrayDetector< T, void >::size - 1 <= pData->length
|
||||||
&& (rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
|
&& (rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
|
||||||
pData->buffer + pData->length - ( internal::ConstCharArrayDetector< T, void >::size - 1 ),
|
pData->buffer + pData->length - ( internal::ConstCharArrayDetector< T, void >::size - 1 ),
|
||||||
internal::ConstCharArrayDetector< T, void >::size - 1, literal,
|
internal::ConstCharArrayDetector< T, void >::size - 1, literal,
|
||||||
internal::ConstCharArrayDetector< T, void >::size - 1)
|
internal::ConstCharArrayDetector< T, void >::size - 1)
|
||||||
== 0);
|
== 0);
|
||||||
|
if (b && rest != 0) {
|
||||||
|
*rest = copy(
|
||||||
|
0,
|
||||||
|
(getLength()
|
||||||
|
- (internal::ConstCharArrayDetector< T, void >::size - 1)));
|
||||||
|
}
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -261,9 +261,7 @@ unoidl::detail::SourceProviderEntity * findEntity_(
|
|||||||
assert(data != 0);
|
assert(data != 0);
|
||||||
assert(name != 0);
|
assert(name != 0);
|
||||||
OUString n;
|
OUString n;
|
||||||
if (name->startsWith(".")) {
|
if (!name->startsWith(".", &n)) {
|
||||||
n = name->copy(1);
|
|
||||||
} else {
|
|
||||||
for (std::vector<OUString>::const_reverse_iterator i(data->modules.rbegin());
|
for (std::vector<OUString>::const_reverse_iterator i(data->modules.rbegin());
|
||||||
i != data->modules.rend(); ++i)
|
i != data->modules.rend(); ++i)
|
||||||
{
|
{
|
||||||
@ -345,7 +343,7 @@ Found findEntity(
|
|||||||
static_cast<unoidl::TypedefEntity *>(e->entity.get())
|
static_cast<unoidl::TypedefEntity *>(e->entity.get())
|
||||||
->getType());
|
->getType());
|
||||||
typeNucleus = t;
|
typeNucleus = t;
|
||||||
while (typeNucleus.startsWith("[]")) {
|
while (typeNucleus.startsWith("[]", &typeNucleus)) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
error(
|
error(
|
||||||
location, yyscanner,
|
location, yyscanner,
|
||||||
@ -363,7 +361,6 @@ Found findEntity(
|
|||||||
return FOUND_ERROR;
|
return FOUND_ERROR;
|
||||||
}
|
}
|
||||||
++rank;
|
++rank;
|
||||||
typeNucleus = typeNucleus.copy(2);
|
|
||||||
}
|
}
|
||||||
sal_Int32 i = typeNucleus.indexOf('<');
|
sal_Int32 i = typeNucleus.indexOf('<');
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
|
@ -91,9 +91,8 @@ OUString decomposeType(
|
|||||||
OUString nucl(type);
|
OUString nucl(type);
|
||||||
*rank = 0;
|
*rank = 0;
|
||||||
typeArguments->clear();
|
typeArguments->clear();
|
||||||
while (nucl.startsWith("[]")) {
|
while (nucl.startsWith("[]", &nucl)) {
|
||||||
++*rank;
|
++*rank;
|
||||||
nucl = nucl.copy(2);
|
|
||||||
}
|
}
|
||||||
sal_Int32 i = nucl.indexOf('<');
|
sal_Int32 i = nucl.indexOf('<');
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
|
@ -57,12 +57,11 @@ void badUsage() {
|
|||||||
OUString getArgumentUri(sal_uInt32 argument, bool * entities) {
|
OUString getArgumentUri(sal_uInt32 argument, bool * entities) {
|
||||||
OUString arg;
|
OUString arg;
|
||||||
rtl_getAppCommandArg(argument, &arg.pData);
|
rtl_getAppCommandArg(argument, &arg.pData);
|
||||||
if (arg.startsWith("@")) {
|
if (arg.startsWith("@", &arg)) {
|
||||||
if (entities == 0) {
|
if (entities == 0) {
|
||||||
badUsage();
|
badUsage();
|
||||||
}
|
}
|
||||||
*entities = true;
|
*entities = true;
|
||||||
arg = arg.copy(1);
|
|
||||||
} else if (entities != 0) {
|
} else if (entities != 0) {
|
||||||
*entities = false;
|
*entities = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user