[Libreoffice-commits] .: 2 commits - filter/source unoxml/source writerperfect/source
Thomas Arnhold
tarnhold at kemper.freedesktop.org
Fri Jan 28 06:44:31 PST 2011
filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 2 -
filter/source/xmlfilterdetect/filterdetect.cxx | 25 ++++----------------
unoxml/source/dom/element.cxx | 2 -
unoxml/source/rdf/CLiteral.cxx | 2 -
unoxml/source/rdf/librdf_repository.cxx | 6 ++--
writerperfect/source/wpgimp/WPGImportFilter.cxx | 2 -
6 files changed, 12 insertions(+), 27 deletions(-)
New commits:
commit 56c0e39841e79b3e7b0f65ed6b3c8512c81937bd
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Fri Jan 28 15:43:08 2011 +0100
Remove some dead code.
diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx
index a0e708a..2f50eec 100644
--- a/filter/source/xmlfilterdetect/filterdetect.cxx
+++ b/filter/source/xmlfilterdetect/filterdetect.cxx
@@ -106,7 +106,6 @@ Reference< com::sun::star::frame::XModel > xModel;
com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xInStream;
::rtl::OUString temp;
- //OSL_ENSURE( sal_False, " starting Detect" );
const PropertyValue * pValue = aArguments.getConstArray();
sal_Int32 nLength;
::rtl::OString resultString;
@@ -115,20 +114,13 @@ Reference< com::sun::star::frame::XModel > xModel;
sal_Int32 location=nLength;
for ( sal_Int32 i = 0 ; i < nLength; i++)
{
- //OSL_ENSURE( sal_False, ::rtl::OUStringToOString(pValue[i].Name,RTL_TEXTENCODING_ASCII_US).getStr() );
if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) )
{
- //pValue[i].Value >>= originalTypeName;
- location=i;
- // OSL_ENSURE( sal_False, ::rtl::OUStringToOString(sTypeName,RTL_TEXTENCODING_ASCII_US).getStr() );
-
+ location=i;
}
else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) )
{
-
pValue[i].Value >>= sUrl;
- //OSL_ENSURE( sal_False, ::rtl::OUStringToOString(sUrl,RTL_TEXTENCODING_ASCII_US).getStr() );
-
}
else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
{
@@ -198,8 +190,6 @@ Reference< com::sun::star::frame::XModel > xModel;
}
aArguments[location].Value <<=sTypeName;
}
- // OSL_ENSURE( sal_False, ::rtl::OUStringToOString(sTypeName,RTL_TEXTENCODING_ASCII_US).getStr() );
-
return sTypeName;
}
@@ -213,7 +203,6 @@ Reference< com::sun::star::frame::XModel > xModel;
if((clipBoardFormat.match(OUString( RTL_CONSTASCII_USTRINGPARAM( "doctype:" )))))
{
::rtl::OString tryStr = ::rtl::OUStringToOString(clipBoardFormat.copy(8),RTL_TEXTENCODING_ASCII_US).getStr();
- // OSL_ENSURE( sal_False, tryStr);
if (resultString.indexOf(tryStr) >= 0)
{
sTypeName = checkType;
commit 6755f943143f34c9747640df68060fb96cad90b1
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Fri Jan 28 15:40:51 2011 +0100
Replace empty equalsAscii() with getLength().
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index ce9f94b..a204c8e 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -151,7 +151,7 @@ sal_Bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star
//********************
//Template Loading if Required
//********************
- if (!msTemplateName.equalsAscii("")){
+ if (msTemplateName.getLength()){
Reference< XStyleFamiliesSupplier > xstylefamiliessupplier(mxDoc, UNO_QUERY);
Reference< XNameAccess >xName;
diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx
index 133b1f2..a0e708a 100644
--- a/filter/source/xmlfilterdetect/filterdetect.cxx
+++ b/filter/source/xmlfilterdetect/filterdetect.cxx
@@ -163,18 +163,18 @@ Reference< com::sun::star::frame::XModel > xModel;
sal_Int32 new_nlength=0;
sal_Int32 i = 0 ;
- while( (i < nLength) && (sTypeName.equalsAscii("")))
+ while( (i < nLength) && (sTypeName.getLength() == 0))
{
Any elem = xTypeCont->getByName(myTypes[i]);
elem >>=lProps;
new_nlength = lProps.getLength();
sal_Int32 j =0;
- while( j < new_nlength && sTypeName.equalsAscii(""))
+ while( j < new_nlength && (sTypeName.getLength() == 0))
{
::rtl::OUString tmpStr;
lProps[j].Value >>=tmpStr;
- if((lProps[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat"))) && (!tmpStr.equalsAscii("")) )
+ if((lProps[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat"))) && tmpStr.getLength() )
{
sTypeName = supportedByType(tmpStr,resultString, myTypes[i]);
}
@@ -189,11 +189,7 @@ Reference< com::sun::star::frame::XModel > xModel;
{
OSL_ENSURE( sal_False, "An Exception occurred while opening File stream" );
}
- if(sTypeName.equalsAscii(""))
- {
- //sTypeName=::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("writer_Flat_XML_File"));
- }
- else
+ if (sTypeName.getLength())
{
if ( location == aArguments.getLength() )
{
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx
index 00fe33a..07f6800 100644
--- a/unoxml/source/dom/element.cxx
+++ b/unoxml/source/dom/element.cxx
@@ -60,7 +60,7 @@ namespace DOM
OUString prefix(reinterpret_cast<const sal_Char*>(pPrefix),
strlen(reinterpret_cast<const char*>(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 f402521..7ad3b24 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 0200d6a..d26fda8 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<rdf::XURI> 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<rdf::Statement>, sal_Bool >();
}
::rtl::OUString const sXmlId(mdref.First +
diff --git a/writerperfect/source/wpgimp/WPGImportFilter.cxx b/writerperfect/source/wpgimp/WPGImportFilter.cxx
index 8a1f92d..1d68590 100644
--- a/writerperfect/source/wpgimp/WPGImportFilter.cxx
+++ b/writerperfect/source/wpgimp/WPGImportFilter.cxx
@@ -175,7 +175,7 @@ OUString SAL_CALL WPGImportFilter::detect( com::sun::star::uno::Sequence< Proper
if (input)
delete input;
- if (!sTypeName.equalsAscii(""))
+ if (sTypeName.getLength())
{
if ( location == Descriptor.getLength() )
{
More information about the Libreoffice-commits
mailing list