dbaccess/source/core/dataaccess/ContentHelper.cxx | 47 +++------------ dbaccess/source/core/dataaccess/ModelImpl.cxx | 24 ++----- dbaccess/source/core/dataaccess/ModelImpl.hxx | 2 dbaccess/source/core/dataaccess/SharedConnection.hxx | 10 +-- dbaccess/source/core/dataaccess/bookmarkcontainer.cxx | 10 +-- dbaccess/source/core/dataaccess/commandcontainer.cxx | 4 - dbaccess/source/core/dataaccess/commanddefinition.cxx | 10 +-- dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx | 18 ++--- 8 files changed, 48 insertions(+), 77 deletions(-)
New commits: commit 188c2d34422936a6a19dcbb7ffc3e77bfebaee33 Author: Marcos Paulo de Souza <marcos.souza....@gmail.com> Date: Sat Jan 19 13:36:05 2013 -0200 Remove more STRINGPARAM macros from dbaccess Change-Id: I5a5af27d7c980f6b71011c33531a49a82d79fbc8 Reviewed-on: https://gerrit.libreoffice.org/1771 Reviewed-by: Olivier Hallot <olivier.hal...@alta.org.br> Tested-by: Olivier Hallot <olivier.hal...@alta.org.br> diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index 20a535f..87b6480 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -93,10 +93,8 @@ IMPLEMENT_IMPLEMENTATION_ID(OContentHelper) Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); - ::rtl::OUStringBuffer aIdentifier; - aIdentifier.appendAscii( "private:" ); - aIdentifier.append( impl_getHierarchicalName( true ) ); - return new ::ucbhelper::ContentIdentifier( aIdentifier.makeStringAndClear() ); + OUString aIdentifier( "private:" + impl_getHierarchicalName( true ) ); + return new ::ucbhelper::ContentIdentifier( aIdentifier ); } ::rtl::OUString OContentHelper::impl_getHierarchicalName( bool _includingRootContainer ) const @@ -114,9 +112,7 @@ Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw xProp->getPropertyValue( PROPERTY_NAME ) >>= sName; ::rtl::OUString sPrevious = aHierarchicalName.makeStringAndClear(); - aHierarchicalName.append( sName ); - aHierarchicalName.append( sal_Unicode( '/' ) ); - aHierarchicalName.append( sPrevious ); + aHierarchicalName.append( sName + "/" + sPrevious ); } } ::rtl::OUString sHierarchicalName( aHierarchicalName.makeStringAndClear() ); @@ -352,28 +348,19 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue if ( rValue.Name == "ContentType" ) { // Read-only property! - aRet[ n ] <<= IllegalAccessException( - ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Property is read-only!") - ), + aRet[ n ] <<= IllegalAccessException("Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsDocument" ) { // Read-only property! - aRet[ n ] <<= IllegalAccessException( - ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Property is read-only!") - ), + aRet[ n ] <<= IllegalAccessException("Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsFolder" ) { // Read-only property! - aRet[ n ] <<= IllegalAccessException( - ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Property is read-only!") - ), + aRet[ n ] <<= IllegalAccessException("Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "Title" ) @@ -407,20 +394,14 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue } else { - aRet[ n ] <<= IllegalTypeException( - ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Property value has wrong type!") - ), + aRet[ n ] <<= IllegalTypeException("Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } else { - aRet[ n ] <<= Exception( - ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("No property set for storing the value!") - ), + aRet[ n ] <<= Exception("No property set for storing the value!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -478,28 +459,24 @@ Reference< XRow > OContentHelper::getPropertyValues( const Sequence< Property >& { // Append all Core Properties. xRow->appendString ( - Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")), - -1, + Property( "ContentType", -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), PropertyAttribute::BOUND | PropertyAttribute::READONLY ), getContentType() ); xRow->appendString ( - Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" )), - -1, + Property( "Title", -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), PropertyAttribute::BOUND ), m_pImpl->m_aProps.aTitle ); xRow->appendBoolean( - Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsDocument")), - -1, + Property( "IsDocument", -1, getCppuBooleanType(), PropertyAttribute::BOUND | PropertyAttribute::READONLY ), m_pImpl->m_aProps.bIsDocument ); xRow->appendBoolean( - Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")), - -1, + Property( "IsFolder", -1, getCppuBooleanType(), PropertyAttribute::BOUND | PropertyAttribute::READONLY ), diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 01546fa..49a0736 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -294,7 +294,7 @@ bool DocumentStorageAccess::commitEmbeddedStorage( bool _bPreventRootCommits ) bool bSuccess = false; try { - NamedStorages::const_iterator pos = m_aExposedStorages.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "database" ) ) ); + NamedStorages::const_iterator pos = m_aExposedStorages.find( "database" ); if ( pos != m_aExposedStorages.end() ) bSuccess = tools::stor::commitStorageIfWriteable( pos->second ); } @@ -360,7 +360,7 @@ void SAL_CALL DocumentStorageAccess::commited( const css::lang::EventObject& aEv Reference< XStorage > xStorage( aEvent.Source, UNO_QUERY ); // check if this is the dedicated "database" sub storage - NamedStorages::const_iterator pos = m_aExposedStorages.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "database" ) ) ); + NamedStorages::const_iterator pos = m_aExposedStorages.find( "database" ); if ( ( pos != m_aExposedStorages.end() ) && ( pos->second == xStorage ) ) @@ -430,9 +430,9 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& { // some kind of default DBG_CTOR(ODatabaseModelImpl,NULL); - m_sConnectURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jdbc:")); + m_sConnectURL = "jdbc:"; m_aTableFilter.realloc(1); - m_aTableFilter[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")); + m_aTableFilter[0] = "%"; impl_construct_nothrow(); } @@ -490,14 +490,8 @@ void ODatabaseModelImpl::impl_construct_nothrow() *pAllowedType++ = ::getCppuType( static_cast< Sequence< Any >* >( NULL ) ); Sequence< Any > aInitArgs( 2 ); - aInitArgs[0] <<= NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutomaticAddition" ) ), - makeAny( (sal_Bool)sal_True ) - ); - aInitArgs[1] <<= NamedValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowedTypes" ) ), - makeAny( aAllowedTypes ) - ); + aInitArgs[0] <<= NamedValue("AutomaticAddition", makeAny( (sal_Bool)sal_True )); + aInitArgs[1] <<= NamedValue("AllowedTypes", makeAny( aAllowedTypes )); m_xSettings.set( m_aContext.createComponentWithArguments( "com.sun.star.beans.PropertyBag", aInitArgs ), UNO_QUERY_THROW ); @@ -1050,9 +1044,9 @@ const AsciiPropertyValue* ODatabaseModelImpl::getDefaultDataSourceSettings() AsciiPropertyValue( "Extension", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "CharSet", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "HeaderLine", makeAny( (sal_Bool)sal_True ) ), - AsciiPropertyValue( "FieldDelimiter", makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "," ) ) ) ), - AsciiPropertyValue( "StringDelimiter", makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\"" ) ) ) ), - AsciiPropertyValue( "DecimalDelimiter", makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ), + AsciiPropertyValue( "FieldDelimiter", makeAny( OUString( "," ) ) ), + AsciiPropertyValue( "StringDelimiter", makeAny( OUString( "\"" ) ) ), + AsciiPropertyValue( "DecimalDelimiter", makeAny( OUString( "." ) ) ), AsciiPropertyValue( "ThousandDelimiter", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "ShowDeleted", makeAny( (sal_Bool)sal_False ) ), // known ODBC settings diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index e3c94e3..2bff3c2 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -561,7 +561,7 @@ public: inline void checkDisposed() const { if ( !m_pImpl.is() ) - throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Component is already disposed.")), getThis() ); + throw ::com::sun::star::lang::DisposedException( "Component is already disposed.", getThis() ); } inline void lockModify() diff --git a/dbaccess/source/core/dataaccess/SharedConnection.hxx b/dbaccess/source/core/dataaccess/SharedConnection.hxx index 2237d2a..d81e501 100644 --- a/dbaccess/source/core/dataaccess/SharedConnection.hxx +++ b/dbaccess/source/core/dataaccess/SharedConnection.hxx @@ -90,23 +90,23 @@ namespace dbaccess // XConnection virtual void SAL_CALL setAutoCommit( sal_Bool /*autoCommit*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - throw ::com::sun::star::sdbc::SQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This call is not allowed when sharing connections.")),*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S10000")),0,::com::sun::star::uno::Any()); + throw ::com::sun::star::sdbc::SQLException("This call is not allowed when sharing connections.",*this,"S10000",0,::com::sun::star::uno::Any()); } virtual void SAL_CALL setReadOnly( sal_Bool /*readOnly*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - throw ::com::sun::star::sdbc::SQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This call is not allowed when sharing connections.")),*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S10000")),0,::com::sun::star::uno::Any()); + throw ::com::sun::star::sdbc::SQLException("This call is not allowed when sharing connections.",*this,"S10000",0,::com::sun::star::uno::Any()); } virtual void SAL_CALL setCatalog( const ::rtl::OUString& /*catalog*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - throw ::com::sun::star::sdbc::SQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This call is not allowed when sharing connections.")),*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S10000")),0,::com::sun::star::uno::Any()); + throw ::com::sun::star::sdbc::SQLException("This call is not allowed when sharing connections.",*this,"S10000",0,::com::sun::star::uno::Any()); } virtual void SAL_CALL setTransactionIsolation( sal_Int32 /*level*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - throw ::com::sun::star::sdbc::SQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This call is not allowed when sharing connections.")),*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S10000")),0,::com::sun::star::uno::Any()); + throw ::com::sun::star::sdbc::SQLException("This call is not allowed when sharing connections.",*this,"S10000",0,::com::sun::star::uno::Any()); } virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - throw ::com::sun::star::sdbc::SQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This call is not allowed when sharing connections.")),*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S10000")),0,::com::sun::star::uno::Any()); + throw ::com::sun::star::sdbc::SQLException("This call is not allowed when sharing connections.",*this,"S10000",0,::com::sun::star::uno::Any()); } // XConnection virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx index dfd80d978..d58f5c3 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx @@ -85,9 +85,9 @@ OBookmarkContainer::~OBookmarkContainer() } // XServiceInfo -::rtl::OUString SAL_CALL OBookmarkContainer::getImplementationName( ) throw(RuntimeException) +OUString SAL_CALL OBookmarkContainer::getImplementationName( ) throw(RuntimeException) { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OBookmarkContainer")); + return OUString("com.sun.star.comp.dba.OBookmarkContainer"); } sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) @@ -97,10 +97,10 @@ sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _r return findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) throw(RuntimeException) +Sequence< OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) throw(RuntimeException) { - Sequence< ::rtl::OUString > aReturn(1); - aReturn.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DefinitionContainer")); + Sequence< OUString > aReturn(1); + aReturn.getArray()[0] = "com.sun.star.sdb.DefinitionContainer"; return aReturn; } diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx b/dbaccess/source/core/dataaccess/commandcontainer.cxx index 91683f7..5258372 100644 --- a/dbaccess/source/core/dataaccess/commandcontainer.cxx +++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx @@ -81,9 +81,9 @@ Reference< XInterface > SAL_CALL OCommandContainer::createInstance( ) throw (Exc return m_aContext.createComponent( (::rtl::OUString)( m_bTables ? SERVICE_SDB_TABLEDEFINITION : SERVICE_SDB_COMMAND_DEFINITION ) ); } -::rtl::OUString OCommandContainer::determineContentType() const +OUString OCommandContainer::determineContentType() const { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.org.openoffice.DatabaseCommandDefinitionContainer" ) ); + return OUString( "application/vnd.org.openoffice.DatabaseCommandDefinitionContainer" ); } } // namespace dbaccess diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx index 964e6df..a6998f4 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.cxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx @@ -102,9 +102,9 @@ IMPLEMENT_GETTYPES2(OCommandDefinition,OCommandDefinition_Base,OComponentDefinit IMPLEMENT_FORWARD_XINTERFACE2( OCommandDefinition,OComponentDefinition,OCommandDefinition_Base) IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP) -::rtl::OUString OCommandDefinition::getImplementationName_static( ) throw(RuntimeException) +OUString OCommandDefinition::getImplementationName_static( ) throw(RuntimeException) { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OCommandDefinition")); + return OUString("com.sun.star.comp.dba.OCommandDefinition"); } ::rtl::OUString SAL_CALL OCommandDefinition::getImplementationName( ) throw(RuntimeException) @@ -112,12 +112,12 @@ IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP return getImplementationName_static(); } -Sequence< ::rtl::OUString > OCommandDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) +Sequence< OUString > OCommandDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) { - Sequence< ::rtl::OUString > aServices(3); + Sequence< OUString > aServices(3); aServices.getArray()[0] = SERVICE_SDB_QUERYDEFINITION; aServices.getArray()[1] = SERVICE_SDB_COMMAND_DEFINITION; - aServices.getArray()[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.Content")); + aServices.getArray()[2] = "com.sun.star.ucb.Content"; return aServices; } diff --git a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx index 27f7b18..197742c 100644 --- a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx +++ b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx @@ -182,9 +182,9 @@ namespace dbaccess IMPLEMENT_FORWARD_XTYPEPROVIDER2( DataAccessDescriptor, DataAccessDescriptor_TypeBase, DataAccessDescriptor_PropertyBase ); - ::rtl::OUString SAL_CALL DataAccessDescriptor::getImplementationName() throw (RuntimeException) + OUString SAL_CALL DataAccessDescriptor::getImplementationName() throw (RuntimeException) { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.dba.DataAccessDescriptor" ) ); + return OUString( "com.sun.star.comp.dba.DataAccessDescriptor" ); } ::sal_Bool SAL_CALL DataAccessDescriptor::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) @@ -195,10 +195,10 @@ namespace dbaccess return ::std::find( pStart, pEnd, rServiceName ) != pEnd; } - Sequence< ::rtl::OUString > SAL_CALL DataAccessDescriptor::getSupportedServiceNames( ) throw (RuntimeException) + Sequence< OUString > SAL_CALL DataAccessDescriptor::getSupportedServiceNames( ) throw (RuntimeException) { - Sequence< ::rtl::OUString > aServices(1); - aServices[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.DataAccessDescriptor" ) ); + Sequence< OUString > aServices(1); + aServices[0] = "com.sun.star.sdb.DataAccessDescriptor"; return aServices; } @@ -260,9 +260,9 @@ namespace dbaccess { } - ::rtl::OUString DataAccessDescriptorFactory::getSingletonName_static() + OUString DataAccessDescriptorFactory::getSingletonName_static() { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.DataAccessDescriptorFactory" ) ); + return OUString( "com.sun.star.sdb.DataAccessDescriptorFactory" ); } Sequence< ::rtl::OUString > DataAccessDescriptorFactory::getSupportedServiceNames_static() throw( RuntimeException ) @@ -272,9 +272,9 @@ namespace dbaccess return aServices; } - ::rtl::OUString DataAccessDescriptorFactory::getImplementationName_static() throw( RuntimeException ) + OUString DataAccessDescriptorFactory::getImplementationName_static() throw( RuntimeException ) { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.dba.DataAccessDescriptorFactory" ) ); + return OUString( "com.sun.star.comp.dba.DataAccessDescriptorFactory" ); } Reference< XInterface > DataAccessDescriptorFactory::Create( const Reference< XComponentContext >& _rxContext ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits