diff options
author | Gergő Mocsi <gmocsi91@gmail.com> | 2013-02-20 04:33:49 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-02-22 09:48:50 +0000 |
commit | 1da3af5f1eb6a32fd0ab10da7cf2f8ddb298a3a1 (patch) | |
tree | 11991caeeb5fb6f8a70b617430f09944e41398b0 /dbaccess/source/ui | |
parent | fc090acf829d0053c0a611acd73f08b51128031d (diff) |
fdo#38838, ::rtl::OUString, String to OUString
I have cleared out String and ::rtl::OUString calls in module dbaccess/source/core/misc.
It was mainly file dbaccess/source/core/misc/dnstypes.cxx , and it's usages. There are
still some calls in dbaccess for this class(ODnsTypeCollection), that needs refactoring
(eg. in file DbAdminImpl.cxx, method "String ODbDataSourceAdministrationHelper::getConnectionURL() const").
Remaining calls will be my next task (in module dbaccess). I also clear out deprecated macro
RTL_CONSTASCII_USTRINGPARAM every time I find one. The class I've mentioned above
(ODnsTypeCollector) is OK.
Change-Id: Ia0f3bb8cc649d1ecf8decc093f8a1a20ee23c33c
Reviewed-on: https://gerrit.libreoffice.org/2289
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 205 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.hxx | 48 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 46 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 28 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 153 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.hxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 51 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.hxx | 18 |
11 files changed, 285 insertions, 290 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index cc9622490766..c21c1616373f 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -164,25 +164,25 @@ namespace DatabaseObject = ::com::sun::star::sdb::application::DatabaseObject; namespace DatabaseObjectContainer = ::com::sun::star::sdb::application::DatabaseObjectContainer; //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OApplicationController::getImplementationName() throw( RuntimeException ) +OUString SAL_CALL OApplicationController::getImplementationName() throw( RuntimeException ) { return getImplementationName_Static(); } //------------------------------------------------------------------------------ -::rtl::OUString OApplicationController::getImplementationName_Static() throw( RuntimeException ) +OUString OApplicationController::getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString(SERVICE_SDB_APPLICATIONCONTROLLER); + return OUString(SERVICE_SDB_APPLICATIONCONTROLLER); } //------------------------------------------------------------------------------ -Sequence< ::rtl::OUString> OApplicationController::getSupportedServiceNames_Static(void) throw( RuntimeException ) +Sequence< OUString> OApplicationController::getSupportedServiceNames_Static(void) throw( RuntimeException ) { - Sequence< ::rtl::OUString> aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.application.DefaultViewController")); + Sequence< OUString> aSupported(1); + aSupported.getArray()[0] = OUString("com.sun.star.sdb.application.DefaultViewController"); return aSupported; } //------------------------------------------------------------------------- -Sequence< ::rtl::OUString> SAL_CALL OApplicationController::getSupportedServiceNames() throw(RuntimeException) +Sequence< OUString> SAL_CALL OApplicationController::getSupportedServiceNames() throw(RuntimeException) { return getSupportedServiceNames_Static(); } @@ -386,7 +386,7 @@ void SAL_CALL OApplicationController::disposing() if ( m_xDataSource.is() ) { - m_xDataSource->removePropertyChangeListener(::rtl::OUString(), this); + m_xDataSource->removePropertyChangeListener(OUString(), this); m_xDataSource->removePropertyChangeListener(PROPERTY_INFO, this); m_xDataSource->removePropertyChangeListener(PROPERTY_URL, this); m_xDataSource->removePropertyChangeListener(PROPERTY_ISPASSWORDREQUIRED, this); @@ -406,13 +406,13 @@ void SAL_CALL OApplicationController::disposing() if ( m_xModel.is() ) { - ::rtl::OUString sUrl = m_xModel->getURL(); + OUString sUrl = m_xModel->getURL(); if ( !sUrl.isEmpty() ) { ::comphelper::NamedValueCollection aArgs( m_xModel->getArgs() ); if ( true == aArgs.getOrDefault( "PickListEntry", true ) ) { - ::rtl::OUString aFilter; + OUString aFilter; INetURLObject aURL( m_xModel->getURL() ); const SfxFilter* pFilter = getStandardDatabaseFilter(); if ( pFilter ) @@ -423,7 +423,7 @@ void SAL_CALL OApplicationController::disposing() aURL.GetURLNoPass( INetURLObject::NO_DECODE ), aFilter, getStrippedDatabaseName(), - ::rtl::OUString() ); + OUString() ); } } @@ -531,7 +531,7 @@ sal_Bool SAL_CALL OApplicationController::suspend(sal_Bool bSuspend) throw( Runt if ( xBroadcaster.is() ) { xBroadcaster->notifyDocumentEvent( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnPrepareViewClosing" ) ), + OUString("OnPrepareViewClosing"), this, Any() ); @@ -660,7 +660,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = xEnumAccess.is(); if ( aReturn.bEnabled ) { - const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_xContext); + const OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_xContext); aReturn.bEnabled = !sReportEngineServiceName.isEmpty(); if ( aReturn.bEnabled ) { @@ -746,7 +746,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = xEnumAccess.is(); if ( aReturn.bEnabled ) { - static ::rtl::OUString s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory")); + static OUString s_sReportDesign("com.sun.star.report.pentaho.SOReportJobFactory"); Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(s_sReportDesign); aReturn.bEnabled = xEnumDrivers.is() && xEnumDrivers->hasMoreElements(); } @@ -804,10 +804,10 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const && ( getContainer()->isALeafSelected() ) ) { - ::std::vector< ::rtl::OUString > aSelected; + ::std::vector< OUString > aSelected; getSelectionElementNames( aSelected ); bool bAlterableViews = true; - for ( ::std::vector< ::rtl::OUString >::const_iterator selectedName = aSelected.begin(); + for ( ::std::vector< OUString >::const_iterator selectedName = aSelected.begin(); bAlterableViews && ( selectedName != aSelected.end() ) ; ++selectedName ) @@ -898,12 +898,12 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - ::rtl::OUString sURL; + OUString sURL; m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sURL; - ::rtl::OUString sDSTypeName; + OUString sDSTypeName; if ( m_aTypeCollection.isEmbeddedDatabase( sURL ) ) { - sDSTypeName = String( ModuleRes( RID_STR_EMBEDDED_DATABASE ) ); + sDSTypeName = OUString( ModuleRes( RID_STR_EMBEDDED_DATABASE ) ); } else { @@ -916,20 +916,20 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - ::rtl::OUString sURL; + OUString sURL; m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sURL; - String sDatabaseName; - String sHostName; + OUString sDatabaseName; + OUString sHostName; sal_Int32 nPortNumber( -1 ); m_aTypeCollection.extractHostNamePort( sURL, sDatabaseName, sHostName, nPortNumber ); - if ( !sDatabaseName.Len() ) + if ( !sDatabaseName.getLength() ) sDatabaseName = m_aTypeCollection.cutPrefix( sURL ); if ( m_aTypeCollection.isFileSystemBased(sURL) ) { sDatabaseName = SvtPathOptions().SubstituteVariable( sDatabaseName ); - if ( sDatabaseName.Len() ) + if ( sDatabaseName.getLength() ) { ::svt::OFileNotation aFileNotation(sDatabaseName); // set this decoded URL as text @@ -937,7 +937,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const } } - if ( sDatabaseName.Len() == 0 ) + if ( sDatabaseName.getLength() == 0 ) sDatabaseName = m_aTypeCollection.getTypeDisplayName( sURL ); aReturn.sTitle = sDatabaseName; @@ -952,10 +952,10 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - ::rtl::OUString sURL; + OUString sURL; m_xDataSource->getPropertyValue( PROPERTY_URL ) >>= sURL; - String sHostName, sDatabaseName; + OUString sHostName, sDatabaseName; sal_Int32 nPortNumber = -1; m_aTypeCollection.extractHostNamePort( sURL, sDatabaseName, sHostName, nPortNumber ); aReturn.sTitle = sHostName; @@ -1044,7 +1044,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case E_TABLE: { // get the selected tablename - ::std::vector< ::rtl::OUString > aList; + ::std::vector< OUString > aList; getSelectionElementNames( aList ); if ( !aList.empty() ) m_aTableCopyHelper.SetTableNameForAppend( *aList.begin() ); @@ -1061,9 +1061,9 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa break; default: { - ::std::vector< ::rtl::OUString> aList; + ::std::vector< OUString> aList; getSelectionElementNames(aList); - ::rtl::OUString sFolderNameToInsertInto; + OUString sFolderNameToInsertInto; if ( !aList.empty() ) { Reference< XHierarchicalNameAccess > xContainer(getElements(eType),UNO_QUERY); @@ -1092,7 +1092,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa ::std::vector<SotFormatStringId> aFormatIds; getSupportedFormats(getContainer()->getElementType(),aFormatIds); const ::std::vector<SotFormatStringId>::iterator aEnd = aFormatIds.end(); - ::rtl::OUString sEmpty; + OUString sEmpty; for (::std::vector<SotFormatStringId>::iterator aIter = aFormatIds.begin();aIter != aEnd; ++aIter) pDlg->Insert(*aIter,sEmpty); @@ -1126,16 +1126,16 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa switch(_nId) { case SID_HELP_INDEX: - aURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:HelpIndex")); + aURL.Complete = OUString(".uno:HelpIndex"); break; case SID_OPENDOC: - aURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open")); + aURL.Complete = OUString(".uno:Open"); break; } if ( m_xUrlTransformer.is() ) m_xUrlTransformer->parseStrict( aURL ); - Reference < XDispatch > xDisp = xProv->queryDispatch( aURL, String(), 0 ); + Reference < XDispatch > xDisp = xProv->queryDispatch( aURL, OUString(), 0 ); if ( xDisp.is() ) xDisp->dispatch( aURL, Sequence < PropertyValue >() ); } @@ -1157,7 +1157,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case ID_BROWSER_SAVEASDOC: { - ::rtl::OUString sUrl; + OUString sUrl; if ( m_xModel.is() ) sUrl = m_xModel->getURL(); if ( sUrl.isEmpty() ) @@ -1252,7 +1252,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa eType = E_QUERY; break; case ID_NEW_QUERY_DESIGN: - aCreationArgs.put( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True ); + aCreationArgs.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True ); // run through case ID_NEW_QUERY_SQL: eType = E_QUERY; @@ -1277,7 +1277,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case SID_APP_NEW_FOLDER: { ElementType eType = getContainer()->getElementType(); - ::rtl::OUString sName = getContainer()->getQualifiedName( NULL ); + OUString sName = getContainer()->getQualifiedName( NULL ); insertHierachyElement(eType,sName); } break; @@ -1290,11 +1290,11 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa QueryDesigner aDesigner( getORB(), this, getFrame(), true ); ::comphelper::NamedValueCollection aCreationArgs; - aCreationArgs.put( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId ); + aCreationArgs.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId ); const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource, aCreationArgs ), UNO_QUERY ); - onDocumentOpened( ::rtl::OUString(), E_QUERY, E_OPEN_DESIGN, xComponent, NULL ); + onDocumentOpened( OUString(), E_QUERY, E_OPEN_DESIGN, xComponent, NULL ); } } break; @@ -1337,7 +1337,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case SID_DB_APP_DSRELDESIGN: { Reference< XComponent > xRelationDesigner; - if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) ) + if ( !m_pSubComponentManager->activateSubFrame( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) ) { SharedConnection xConnection( ensureConnection() ); if ( xConnection.is() ) @@ -1346,7 +1346,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource ), UNO_QUERY ); - onDocumentOpened( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, NULL ); + onDocumentOpened( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, NULL ); } } } @@ -1355,7 +1355,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa { SharedConnection xConnection( ensureConnection() ); if ( xConnection.is() ) - openDialog(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.UserAdministrationDialog"))); + openDialog(OUString("com.sun.star.sdb.UserAdministrationDialog")); } break; case SID_DB_APP_TABLEFILTER: @@ -1370,11 +1370,11 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa askToReconnect(); break; case SID_DB_APP_DSADVANCED_SETTINGS: - openDialog(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.AdvancedDatabaseSettingsDialog"))); + openDialog(OUString("com.sun.star.sdb.AdvancedDatabaseSettingsDialog")); askToReconnect(); break; case SID_DB_APP_DSCONNECTION_TYPE: - openDialog(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DataSourceTypeChangeDialog"))); + openDialog(OUString("com.sun.star.sdb.DataSourceTypeChangeDialog")); askToReconnect(); break; case ID_DIRECT_SQL: @@ -1414,7 +1414,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case SID_MAIL_SENDDOC: { SfxMailModel aSendMail; - if ( aSendMail.AttachDocument(rtl::OUString(),getModel(), rtl::OUString()) == SfxMailModel::SEND_MAIL_OK ) + if ( aSendMail.AttachDocument(OUString(),getModel(), OUString()) == SfxMailModel::SEND_MAIL_OK ) aSendMail.Send( getFrame() ); } break; @@ -1555,7 +1555,7 @@ void SAL_CALL OApplicationController::elementInserted( const ContainerEvent& _rE OSL_ENSURE(getContainer(),"View is NULL! -> GPF"); if ( getContainer() ) { - ::rtl::OUString sName; + OUString sName; _rEvent.Accessor >>= sName; ElementType eType = getElementType(xContainer); @@ -1589,7 +1589,7 @@ void SAL_CALL OApplicationController::elementRemoved( const ContainerEvent& _rEv if ( ::std::find(m_aCurrentContainers.begin(),m_aCurrentContainers.end(),xContainer) != m_aCurrentContainers.end() ) { OSL_ENSURE(getContainer(),"View is NULL! -> GPF"); - ::rtl::OUString sName; + OUString sName; _rEvent.Accessor >>= sName; ElementType eType = getElementType(xContainer); switch( eType ) @@ -1603,7 +1603,7 @@ void SAL_CALL OApplicationController::elementRemoved( const ContainerEvent& _rEv Reference<XContent> xContent(xContainer,UNO_QUERY); if ( xContent.is() ) { - sName = xContent->getIdentifier()->getContentIdentifier() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + sName; + sName = xContent->getIdentifier()->getContentIdentifier() + OUString("/") + sName; } } break; @@ -1623,13 +1623,13 @@ void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rE if ( ::std::find(m_aCurrentContainers.begin(),m_aCurrentContainers.end(),xContainer) != m_aCurrentContainers.end() ) { OSL_ENSURE(getContainer(),"View is NULL! -> GPF"); - ::rtl::OUString sName; + OUString sName; try { _rEvent.Accessor >>= sName; Reference<XConnection> xConnection; Reference<XPropertySet> xProp(_rEvent.Element,UNO_QUERY); - ::rtl::OUString sNewName; + OUString sNewName; ElementType eType = getElementType(xContainer); switch( eType ) @@ -1647,7 +1647,7 @@ void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rE Reference<XContent> xContent(xContainer,UNO_QUERY); if ( xContent.is() ) { - sName = xContent->getIdentifier()->getContentIdentifier() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + sName; + sName = xContent->getIdentifier()->getContentIdentifier() + OUString("/") + sName; } } break; @@ -1664,22 +1664,22 @@ void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rE } namespace { - ::rtl::OUString lcl_getToolBarResource(ElementType _eType) + OUString lcl_getToolBarResource(ElementType _eType) { - ::rtl::OUString sToolbar; + OUString sToolbar; switch(_eType) { case E_TABLE: - sToolbar = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/tableobjectbar" )); + sToolbar = OUString("private:resource/toolbar/tableobjectbar"); break; case E_QUERY: - sToolbar = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/queryobjectbar" )); + sToolbar = OUString("private:resource/toolbar/queryobjectbar"); break; case E_FORM: - sToolbar = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/formobjectbar" )); + sToolbar = OUString("private:resource/toolbar/formobjectbar"); break; case E_REPORT: - sToolbar = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/reportobjectbar" )); + sToolbar = OUString("private:resource/toolbar/reportobjectbar"); break; case E_NONE: break; @@ -1724,8 +1724,8 @@ sal_Bool OApplicationController::onContainerSelect(ElementType _eType) Reference< XLayoutManager > xLayoutManager = getLayoutManager( getFrame() ); if ( xLayoutManager.is() ) { - ::rtl::OUString sToolbar = lcl_getToolBarResource(_eType); - ::rtl::OUString sDestroyToolbar = lcl_getToolBarResource(m_eCurrentType); + OUString sToolbar = lcl_getToolBarResource(_eType); + OUString sDestroyToolbar = lcl_getToolBarResource(m_eCurrentType); xLayoutManager->lock(); xLayoutManager->destroyElement( sDestroyToolbar ); @@ -1748,7 +1748,7 @@ sal_Bool OApplicationController::onContainerSelect(ElementType _eType) SelectionByElementType::iterator pendingSelection = m_aPendingSelection.find( _eType ); if ( pendingSelection != m_aPendingSelection.end() ) { - Sequence< ::rtl::OUString > aSelected( pendingSelection->second.size() ); + Sequence< OUString > aSelected( pendingSelection->second.size() ); ::std::copy( pendingSelection->second.begin(), pendingSelection->second.end(), aSelected.getArray() ); getContainer()->selectElements( aSelected ); @@ -1783,7 +1783,7 @@ bool OApplicationController::onEntryDoubleClick( SvTreeListBox& _rTree ) return false; // not handled } // ----------------------------------------------------------------------------- -bool OApplicationController::impl_isAlterableView_nothrow( const ::rtl::OUString& _rTableOrViewName ) const +bool OApplicationController::impl_isAlterableView_nothrow( const OUString& _rTableOrViewName ) const { OSL_PRECOND( m_xDataSourceConnection.is(), "OApplicationController::impl_isAlterableView_nothrow: no connection!" ); @@ -1809,14 +1809,14 @@ bool OApplicationController::impl_isAlterableView_nothrow( const ::rtl::OUString } // ----------------------------------------------------------------------------- -Reference< XComponent > OApplicationController::openElement(const ::rtl::OUString& _sName, ElementType _eType, +Reference< XComponent > OApplicationController::openElement(const OUString& _sName, ElementType _eType, ElementOpenMode _eOpenMode, sal_uInt16 _nInstigatorCommand ) { return openElementWithArguments( _sName, _eType, _eOpenMode, _nInstigatorCommand, ::comphelper::NamedValueCollection() ); } // ----------------------------------------------------------------------------- -Reference< XComponent > OApplicationController::openElementWithArguments( const ::rtl::OUString& _sName, ElementType _eType, +Reference< XComponent > OApplicationController::openElementWithArguments( const OUString& _sName, ElementType _eType, ElementOpenMode _eOpenMode, sal_uInt16 _nInstigatorCommand, const ::comphelper::NamedValueCollection& _rAdditionalArguments ) { OSL_PRECOND( getContainer(), "OApplicationController::openElementWithArguments: no view!" ); @@ -1901,7 +1901,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const if ( bAddViewTypeArg ) { const bool bQueryGraphicalMode =( _nInstigatorCommand != SID_DB_APP_EDIT_SQL_VIEW ); - aArguments.put( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, bQueryGraphicalMode ); + aArguments.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, bQueryGraphicalMode ); } } @@ -1909,8 +1909,8 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const { pDesigner.reset( new ResultSetBrowser( getORB(), this, m_aCurrentFrame.getFrame(), _eType == E_TABLE ) ); - if ( !aArguments.has( (::rtl::OUString)PROPERTY_SHOWMENU ) ) - aArguments.put( (::rtl::OUString)PROPERTY_SHOWMENU, makeAny( (sal_Bool)sal_True ) ); + if ( !aArguments.has( (OUString)PROPERTY_SHOWMENU ) ) + aArguments.put( (OUString)PROPERTY_SHOWMENU, makeAny( (sal_Bool)sal_True ) ); aDataSource <<= getDatabaseName(); } @@ -1962,7 +1962,7 @@ void OApplicationController::newElementWithPilot( ElementType _eType ) if ( aHelper->isConnected() ) { sal_Int32 nCommandType = -1; - const ::rtl::OUString sCurrentSelected( getCurrentlySelectedName( nCommandType ) ); + const OUString sCurrentSelected( getCurrentlySelectedName( nCommandType ) ); if ( E_REPORT == _eType ) aHelper->newReportWithPilot( nCommandType, sCurrentSelected ); else @@ -2047,7 +2047,7 @@ Reference< XComponent > OApplicationController::newElement( ElementType _eType, } if ( xComponent.is() ) - onDocumentOpened( ::rtl::OUString(), _eType, E_OPEN_DESIGN, xComponent, o_rDocumentDefinition ); + onDocumentOpened( OUString(), _eType, E_OPEN_DESIGN, xComponent, o_rDocumentDefinition ); return xComponent; } @@ -2081,7 +2081,7 @@ void OApplicationController::renameEntry() ::osl::MutexGuard aGuard( getMutex() ); OSL_ENSURE(getContainer(),"View is NULL! -> GPF"); - ::std::vector< ::rtl::OUString> aList; + ::std::vector< OUString> aList; getSelectionElementNames(aList); Reference< XNameAccess > xContainer = getElements(getContainer()->getElementType()); @@ -2108,13 +2108,13 @@ void OApplicationController::renameEntry() Reference<XHierarchicalNameContainer> xHNames(xContainer, UNO_QUERY); if ( xHNames.is() ) { - String sLabel; + OUString sLabel; if ( eType == E_FORM ) - sLabel = String(ModuleRes( STR_FRM_LABEL )); + sLabel = OUString(ModuleRes( STR_FRM_LABEL )); else - sLabel = String(ModuleRes( STR_RPT_LABEL )); + sLabel = OUString(ModuleRes( STR_RPT_LABEL )); - ::rtl::OUString sName = *aList.begin(); + OUString sName = *aList.begin(); if ( xHNames->hasByHierarchicalName(sName) ) { xRename.set(xHNames->getByHierarchicalName(sName),UNO_QUERY); @@ -2128,7 +2128,7 @@ void OApplicationController::renameEntry() Reference<XPropertySet>(xRename,UNO_QUERY)->getPropertyValue(PROPERTY_NAME) >>= sName; } } - pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), String() ) ); + pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), OUString() ) ); aDialog.reset( new OSaveAsDlg( getView(), getORB(), sName, sLabel, *pNameChecker, SAD_TITLE_RENAME ) ); } @@ -2167,19 +2167,19 @@ void OApplicationController::renameEntry() { try { - ::rtl::OUString sNewName; + OUString sNewName; if ( eType == E_TABLE ) { - ::rtl::OUString sName = aDialog->getName(); - ::rtl::OUString sCatalog = aDialog->getCatalog(); - ::rtl::OUString sSchema = aDialog->getSchema(); + OUString sName = aDialog->getName(); + OUString sCatalog = aDialog->getCatalog(); + OUString sSchema = aDialog->getSchema(); sNewName = ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sName, sal_False, ::dbtools::eInDataManipulation ); } else sNewName = aDialog->getName(); - ::rtl::OUString sOldName = *aList.begin(); + OUString sOldName = *aList.begin(); if ( eType == E_FORM || eType == E_REPORT ) { Reference<XContent> xContent(xRename,UNO_QUERY); @@ -2207,10 +2207,9 @@ void OApplicationController::renameEntry() } catch(const ElementExistException& e) { - rtl::OUString sStatus("S1000"); - String sMsg = String( ModuleRes( STR_NAME_ALREADY_EXISTS ) ); - sMsg.SearchAndReplace(rtl::OUString('#'), e.Message); - showError(SQLExceptionInfo(SQLException(sMsg, e.Context, sStatus, 0, Any()))); + OUString sStatus("S1000"); + OUString sMsg = OUString( ModuleRes( STR_NAME_ALREADY_EXISTS ) ); + showError(SQLExceptionInfo(SQLException(sMsg.replaceAll(OUString('#'), e.Message), e.Context, sStatus, 0, Any()))); } catch(const Exception& ) { @@ -2245,13 +2244,13 @@ void OApplicationController::onSelectionChanged() const ElementType eType = pView->getElementType(); if ( pView->isALeafSelected() ) { - const ::rtl::OUString sName = pView->getQualifiedName( NULL /* means 'first selected' */ ); + const OUString sName = pView->getQualifiedName( NULL /* means 'first selected' */ ); showPreviewFor( eType, sName ); } } } // ----------------------------------------------------------------------------- -void OApplicationController::showPreviewFor(const ElementType _eType,const ::rtl::OUString& _sName) +void OApplicationController::showPreviewFor(const ElementType _eType,const OUString& _sName) { if ( m_ePreviewMode == E_PREVIEWNONE ) return; @@ -2382,13 +2381,13 @@ sal_Bool OApplicationController::isCommandEnabled(sal_uInt16 _nCommandId) const } // ----------------------------------------------------------------------------- -sal_Bool OApplicationController::isCommandEnabled( const ::rtl::OUString& _rCompleteCommandURL ) const +sal_Bool OApplicationController::isCommandEnabled( const OUString& _rCompleteCommandURL ) const { return OApplicationController_CBASE::isCommandEnabled( _rCompleteCommandURL ); } // ----------------------------------------------------------------------------- -sal_uInt16 OApplicationController::registerCommandURL( const ::rtl::OUString& _rCompleteCommandURL ) +sal_uInt16 OApplicationController::registerCommandURL( const OUString& _rCompleteCommandURL ) { return OApplicationController_CBASE::registerCommandURL( _rCompleteCommandURL ); } @@ -2488,7 +2487,7 @@ sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const if ( nAction != DND_ACTION_NONE ) { SvTreeListEntry* pHitEntry = pView->getEntry(_rEvt.maPosPixel); - ::rtl::OUString sName; + OUString sName; if ( pHitEntry ) { sName = pView->getQualifiedName( pHitEntry ); @@ -2539,7 +2538,7 @@ sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt ) m_aAsyncDrop.nAction = _rEvt.mnAction; m_aAsyncDrop.bError = sal_False; m_aAsyncDrop.bHtml = sal_False; - m_aAsyncDrop.aUrl = ::rtl::OUString(); + m_aAsyncDrop.aUrl = OUString(); // loop through the available formats and see what we can do ... @@ -2564,7 +2563,7 @@ sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt ) m_aAsyncDrop.aDroppedData[daComponent] >>= xContent; if ( xContent.is() ) { - ::rtl::OUString sName = xContent->getIdentifier()->getContentIdentifier(); + OUString sName = xContent->getIdentifier()->getContentIdentifier(); sal_Int32 nIndex = 0; sName = sName.copy(sName.getToken(0,'/',nIndex).getLength() + 1); if ( m_aAsyncDrop.aUrl.Len() >= sName.getLength() && 0 == sName.compareTo(m_aAsyncDrop.aUrl,sName.getLength()) ) @@ -2684,9 +2683,9 @@ IMPL_LINK( OApplicationController, OnFirstControllerConnected, void*, /**/ ) return 0L; SQLWarning aWarning; - aWarning.Message = String( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS ) ); + aWarning.Message = OUString( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS ) ); SQLException aDetail; - aDetail.Message = String( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS_DETAIL ) ); + aDetail.Message = OUString( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS_DETAIL ) ); aWarning.NextException <<= aDetail; Reference< XExecutableDialog > xDialog = ErrorMessageDialog::create( getORB(), "", NULL, makeAny( aWarning ) ); @@ -2727,7 +2726,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel > return sal_False; } - const ::rtl::OUString aPropertyNames[] = + const OUString aPropertyNames[] = { PROPERTY_URL, PROPERTY_USER }; @@ -2783,9 +2782,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel > { // to get the 'modified' for the data source ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) ); - if ( aLayoutInfo.has( (rtl::OUString)INFO_PREVIEW ) ) + if ( aLayoutInfo.has( (OUString)INFO_PREVIEW ) ) { - const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( (rtl::OUString)INFO_PREVIEW, (sal_Int32)0 ) ); + const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( (OUString)INFO_PREVIEW, (sal_Int32)0 ) ); m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode ); if ( getView() ) getContainer()->switchPreview( m_ePreviewMode ); @@ -2816,13 +2815,13 @@ void OApplicationController::containerFound( const Reference< XContainer >& _xCo } } // ----------------------------------------------------------------------------- -::rtl::OUString OApplicationController::getCurrentlySelectedName(sal_Int32& _rnCommandType) const +OUString OApplicationController::getCurrentlySelectedName(sal_Int32& _rnCommandType) const { _rnCommandType = ( (getContainer()->getElementType() == E_QUERY) ? CommandType::QUERY : ( (getContainer()->getElementType() == E_TABLE) ? CommandType::TABLE : -1 )); - ::rtl::OUString sName; + OUString sName; if ( _rnCommandType != -1 ) { try @@ -2855,7 +2854,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); - Sequence< ::rtl::OUString> aSelection; + Sequence< OUString> aSelection; if ( !_aSelection.hasValue() || !getView() ) { getContainer()->selectElements(aSelection); @@ -2944,10 +2943,10 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer default: case DatabaseObjectContainer::DATA_SOURCE: { - ::rtl::OUString sMessage( - rtl::OUString( + OUString sMessage( + OUString( String(ModuleRes(RID_STR_UNSUPPORTED_OBJECT_TYPE))). - replaceFirst("$type$", ::rtl::OUString::valueOf(sal_Int32(pObject->Type)))); + replaceFirst("$type$", OUString::valueOf(sal_Int32(pObject->Type)))); throw IllegalArgumentException(sMessage, *this, sal_Int16( pObject - aSelectedObjects.getConstArray() )); } } @@ -2960,7 +2959,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer { if ( sel->first == m_eCurrentType ) { - Sequence< ::rtl::OUString > aSelected( sel->second.size() ); + Sequence< OUString > aSelected( sel->second.size() ); ::std::copy( sel->second.begin(), sel->second.end(), aSelected.getArray() ); getContainer()->selectElements( aSelected ); } @@ -3010,7 +3009,7 @@ void OApplicationController::impl_migrateScripts_nothrow() { try { - ::rtl::OUString sDialogService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.application.MacroMigrationWizard" ) ); + OUString sDialogService("com.sun.star.sdb.application.MacroMigrationWizard"); ::comphelper::ComponentContext aContext( getORB() ); Sequence< Any > aDialogArgs(1); aDialogArgs[0] <<= Reference< XOfficeDatabaseDocument >( m_xModel, UNO_QUERY_THROW ); diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index 6584ce395a01..db827015973c 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -131,7 +131,7 @@ namespace dbaui ::std::auto_ptr< SelectionNotifier > m_pSelectionNotifier; - typedef ::std::map< ElementType, ::std::vector< ::rtl::OUString > > SelectionByElementType; + typedef ::std::map< ElementType, ::std::vector< OUString > > SelectionByElementType; SelectionByElementType m_aPendingSelection; private: @@ -143,13 +143,13 @@ namespace dbaui @return the database name */ - ::rtl::OUString getDatabaseName() const; + OUString getDatabaseName() const; /** returns the stripped database name. @return The stripped database name either the registered naem or if it is a file url the last segment. */ - ::rtl::OUString getStrippedDatabaseName() const; + OUString getStrippedDatabaseName() const; /** return the element type for given container @param _xContainer The container where the element type has to be found @@ -169,7 +169,7 @@ namespace dbaui @return the form or report model will only be returned, otherwise <NULL/> */ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > openElement( - const ::rtl::OUString& _sName, + const OUString& _sName, ElementType _eType, ElementOpenMode _eOpenMode, sal_uInt16 _nInstigatorCommand = 0 @@ -178,7 +178,7 @@ namespace dbaui /** opens a new sub frame with a table/query/form/report/view, passing additional arguments */ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > openElementWithArguments( - const ::rtl::OUString& _sName, + const OUString& _sName, ElementType _eType, ElementOpenMode _eOpenMode, sal_uInt16 _nInstigatorCommand, @@ -211,7 +211,7 @@ namespace dbaui @param _sName The name of the query. */ - void convertToView(const ::rtl::OUString& _sName); + void convertToView(const OUString& _sName); /** checks if the connection for the selected data source is read only. If the connection doesn't exist, <TRUE/> will be returned. @return @@ -220,7 +220,7 @@ namespace dbaui sal_Bool isConnectionReadOnly() const; /// fills the list with the selected entries. - void getSelectionElementNames( ::std::vector< ::rtl::OUString>& _rNames ) const; + void getSelectionElementNames( ::std::vector< OUString>& _rNames ) const; /// deletes the entries selected. void deleteEntries(); @@ -237,14 +237,14 @@ namespace dbaui determines whether the user must confirm the deletion */ void deleteObjects( ElementType _eType, - const ::std::vector< ::rtl::OUString>& _rList, + const ::std::vector< OUString>& _rList, bool _bConfirm ); /** deletes tables. @param _rList The list of tables. */ - void deleteTables(const ::std::vector< ::rtl::OUString>& _rList); + void deleteTables(const ::std::vector< OUString>& _rList); /// copies the current object into clipboard TransferableHelper* copyObject(); @@ -306,7 +306,7 @@ namespace dbaui @param _sServiceName The serivce name of the dialog to be executed. */ - void openDialog(const ::rtl::OUString& _sServiceName); + void openDialog(const OUString& _sServiceName); /** opens the administration dialog for the selected data source */ @@ -329,7 +329,7 @@ namespace dbaui /** remember a newly opened sub document for later access */ void onDocumentOpened( - const ::rtl::OUString& _rName, + const OUString& _rName, const sal_Int32 _nType, const ElementOpenMode _eMode, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _xDocument, @@ -374,11 +374,11 @@ namespace dbaui * * \return the name of the currently table or query. If the tables or query container is selected otherwise an empty string will be returned. */ - ::rtl::OUString getCurrentlySelectedName(sal_Int32& _rnCommandType) const; + OUString getCurrentlySelectedName(sal_Int32& _rnCommandType) const; /** shows the preview for the given entry */ - void showPreviewFor( const ElementType _eType,const ::rtl::OUString& _sName ); + void showPreviewFor( const ElementType _eType,const OUString& _sName ); /** called we were attached to a frame @@ -388,7 +388,7 @@ namespace dbaui void onAttachedFrame(); /// determines whether the given table name denotes a view which can be altered - bool impl_isAlterableView_nothrow( const ::rtl::OUString& _rTableOrViewName ) const; + bool impl_isAlterableView_nothrow( const OUString& _rTableOrViewName ) const; /** does the macro/script migration, where macros/scripts in forms/reports are moved to the database document itself. @@ -398,7 +398,7 @@ namespace dbaui /** verifies the object type denotes a valid DatabaseObject, and the object name denotes an existing object of this type. Throws if not. */ - void impl_validateObjectTypeAndName_throw( const sal_Int32 _nObjectType, const ::boost::optional< ::rtl::OUString >& i_rObjectName ); + void impl_validateObjectTypeAndName_throw( const sal_Int32 _nObjectType, const ::boost::optional< OUString >& i_rObjectName ); protected: // ---------------------------------------------------------------- @@ -430,11 +430,11 @@ namespace dbaui DECLARE_XTYPEPROVIDER( ) // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // need by registration - static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); @@ -459,10 +459,10 @@ namespace dbaui virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > > SAL_CALL getSubComponents() throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isConnected( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL connect( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::beans::Pair< ::sal_Int32, ::rtl::OUString > SAL_CALL identifySubComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& SubComponent ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::beans::Pair< ::sal_Int32, OUString > SAL_CALL identifySubComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& SubComponent ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL closeSubComponents( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL loadComponent( ::sal_Int32 ObjectType, const ::rtl::OUString& ObjectName, ::sal_Bool ForEditing ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL loadComponentWithArguments( ::sal_Int32 ObjectType, const ::rtl::OUString& ObjectName, ::sal_Bool ForEditing, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL loadComponent( ::sal_Int32 ObjectType, const OUString& ObjectName, ::sal_Bool ForEditing ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL loadComponentWithArguments( ::sal_Int32 ObjectType, const OUString& ObjectName, ::sal_Bool ForEditing, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL createComponent( ::sal_Int32 ObjectType, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_DocumentDefinition ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > SAL_CALL createComponentWithArguments( ::sal_Int32 ObjectType, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_DocumentDefinition ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); @@ -514,8 +514,8 @@ namespace dbaui virtual void executeUnChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); virtual void executeChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); virtual sal_Bool isCommandEnabled(sal_uInt16 _nCommandId) const; - virtual sal_Bool isCommandEnabled( const ::rtl::OUString& _rCompleteCommandURL ) const; - virtual sal_uInt16 registerCommandURL( const ::rtl::OUString& _rCompleteCommandURL ); + virtual sal_Bool isCommandEnabled( const OUString& _rCompleteCommandURL ) const; + virtual sal_uInt16 registerCommandURL( const OUString& _rCompleteCommandURL ); virtual void notifyHiContrastChanged(); virtual sal_Bool isDataSourceReadOnly() const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 77cfece9653c..2437f74a6c75 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -139,49 +139,49 @@ namespace dbaui switch( eType ) { case ::dbaccess::DST_DBASE: - m_aFT_Connection.SetText(String(ModuleRes(STR_DBASE_PATH_OR_FILE))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_DBASE_PATH_OR_FILE))); m_aConnectionURL.SetHelpId(HID_DSADMIN_DBASE_PATH); break; case ::dbaccess::DST_FLAT: - m_aFT_Connection.SetText(String(ModuleRes(STR_FLAT_PATH_OR_FILE))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_FLAT_PATH_OR_FILE))); m_aConnectionURL.SetHelpId(HID_DSADMIN_FLAT_PATH); break; case ::dbaccess::DST_CALC: - m_aFT_Connection.SetText(String(ModuleRes(STR_CALC_PATH_OR_FILE))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_CALC_PATH_OR_FILE))); m_aConnectionURL.SetHelpId(HID_DSADMIN_CALC_PATH); break; case ::dbaccess::DST_ADO: - m_aFT_Connection.SetText(String(ModuleRes(STR_COMMONURL))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_COMMONURL))); break; case ::dbaccess::DST_MSACCESS: case ::dbaccess::DST_MSACCESS_2007: - m_aFT_Connection.SetText(String(ModuleRes(STR_MSACCESS_MDB_FILE))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_MSACCESS_MDB_FILE))); m_aConnectionURL.SetHelpId(HID_DSADMIN_MSACCESS_MDB_FILE); break; case ::dbaccess::DST_MYSQL_NATIVE: case ::dbaccess::DST_MYSQL_JDBC: - m_aFT_Connection.SetText(String(ModuleRes(STR_MYSQL_DATABASE_NAME))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_MYSQL_DATABASE_NAME))); m_aConnectionURL.SetHelpId( HID_DSADMIN_MYSQL_DATABASE ); break; case ::dbaccess::DST_ORACLE_JDBC: - m_aFT_Connection.SetText(String(ModuleRes(STR_ORACLE_DATABASE_NAME))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_ORACLE_DATABASE_NAME))); m_aConnectionURL.SetHelpId(HID_DSADMIN_ORACLE_DATABASE); break; case ::dbaccess::DST_MYSQL_ODBC: case ::dbaccess::DST_ODBC: - m_aFT_Connection.SetText(String(ModuleRes(STR_NAME_OF_ODBC_DATASOURCE))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_NAME_OF_ODBC_DATASOURCE))); m_aConnectionURL.SetHelpId( eType == ::dbaccess::DST_MYSQL_ODBC ? HID_DSADMIN_MYSQL_ODBC_DATASOURCE : HID_DSADMIN_ODBC_DATASOURCE); break; case ::dbaccess::DST_LDAP: - m_aFT_Connection.SetText(String(ModuleRes(STR_HOSTNAME))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_HOSTNAME))); m_aConnectionURL.SetHelpId( HID_DSADMIN_LDAP_HOSTNAME ); break; case ::dbaccess::DST_MOZILLA: - m_aFT_Connection.SetText(String(ModuleRes(STR_MOZILLA_PROFILE_NAME))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_MOZILLA_PROFILE_NAME))); m_aConnectionURL.SetHelpId( HID_DSADMIN_MOZILLA_PROFILE_NAME ); break; case ::dbaccess::DST_THUNDERBIRD: - m_aFT_Connection.SetText(String(ModuleRes(STR_THUNDERBIRD_PROFILE_NAME))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_THUNDERBIRD_PROFILE_NAME))); m_aConnectionURL.SetHelpId( HID_DSADMIN_THUNDERBIRD_PROFILE_NAME ); break; case ::dbaccess::DST_OUTLOOK: @@ -191,19 +191,19 @@ namespace dbaui case ::dbaccess::DST_EVOLUTION_LDAP: case ::dbaccess::DST_KAB: case ::dbaccess::DST_MACAB: - m_aFT_Connection.SetText(String(ModuleRes(STR_NO_ADDITIONAL_SETTINGS))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_NO_ADDITIONAL_SETTINGS))); { - String sText = m_aFT_Connection.GetText(); - sText.SearchAndReplaceAscii("%test",m_aTestConnection.GetText()); - String sTemp; - sText.SearchAndReplaceAscii("~",sTemp); + OUString sText = m_aFT_Connection.GetText(); + sText = sText.replaceAll("%test",m_aTestConnection.GetText()); + OUString sTemp; + sText = sText.replaceAll("~",sTemp); m_aFT_Connection.SetText(sText); } m_aConnectionURL.Hide(); break; case ::dbaccess::DST_JDBC: default: - m_aFT_Connection.SetText(String(ModuleRes(STR_COMMONURL))); + m_aFT_Connection.SetText(OUString(ModuleRes(STR_COMMONURL))); break; } @@ -233,14 +233,14 @@ namespace dbaui m_aUserName.SetText(pUidItem->GetValue()); m_aPasswordRequired.Check(pAllowEmptyPwd->GetValue()); - String sUrl = pUrlItem->GetValue(); + OUString sUrl = pUrlItem->GetValue(); setURL( sUrl ); const sal_Bool bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC; - if ( !pJdbcDrvItem->GetValue().Len() ) + if ( !pJdbcDrvItem->GetValue().getLength() ) { - String sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); - if ( sDefaultJdbcDriverName.Len() ) + OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); + if ( sDefaultJdbcDriverName.getLength() ) { m_aJavaDriver.SetText(sDefaultJdbcDriverName); m_aJavaDriver.SetModifyFlag(); @@ -294,7 +294,7 @@ namespace dbaui if (m_aUserName.GetText() != m_aUserName.GetSavedValue()) { _rSet.Put(SfxStringItem(DSID_USER, m_aUserName.GetText())); - _rSet.Put(SfxStringItem(DSID_PASSWORD, String())); + _rSet.Put(SfxStringItem(DSID_PASSWORD, OUString())); bChangedSomething = sal_True; } @@ -328,7 +328,7 @@ namespace dbaui const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String(), WB_OK | WB_DEF_OK, mt ); + OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); aMsg.Execute(); return 0L; } diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index fa86f15622f0..0eb325abc851 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -166,7 +166,7 @@ DBG_NAME(OTextConnectionPageSetup) ,m_aCBUseSSL (this, ModuleRes(CB_WIZ_USESSL)) { SetControlFontWeight(&m_aFTHeaderText); - m_aFTDefaultPortNumber.SetText(String(ModuleRes(STR_LDAP_DEFAULT))); + m_aFTDefaultPortNumber.SetText(OUString(ModuleRes(STR_LDAP_DEFAULT))); m_aETHostServer.SetModifyHdl(getControlModifiedLink()); m_aETBaseDN.SetModifyHdl(getControlModifiedLink()); m_aNFPortNumber.SetModifyHdl(getControlModifiedLink()); @@ -190,7 +190,7 @@ DBG_NAME(OTextConnectionPageSetup) pCollection = pCollectionItem->getCollection(); OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !"); - String sUrl = pCollection->getPrefix( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap:"))); + OUString sUrl = pCollection->getPrefix( ::rtl::OUString("sdbc:address:ldap:")); sUrl += m_aETHostServer.GetText(); _rSet.Put(SfxStringItem(DSID_CONNECTURL, sUrl)); bChangedSomething = sal_True; @@ -422,10 +422,10 @@ DBG_NAME(OMySQLIntroPageSetup) ,m_aPBTestJavaDriver (this, ModuleRes(PB_AUTOTESTDRIVERCLASS)) ,m_nPortId(_nPortId) { - m_aFTDriverClass.SetText(String(ModuleRes(_nDriverClassId))); + m_aFTDriverClass.SetText(OUString(ModuleRes(_nDriverClassId))); - m_aFTDefaultPortNumber.SetText(String(ModuleRes(_nDefaultPortResId))); - String sHelpText = String(ModuleRes(_nHelpTextResId)); + m_aFTDefaultPortNumber.SetText(OUString(ModuleRes(_nDefaultPortResId))); + OUString sHelpText = OUString(ModuleRes(_nHelpTextResId)); m_aFTHelpText.SetText(sHelpText); //TODO this code snippet is redundant SetHeaderText(FT_AUTOWIZARDHEADER, _nHeaderTextResId); @@ -440,7 +440,7 @@ DBG_NAME(OMySQLIntroPageSetup) SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; - if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len() ) + if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength() ) { m_sDefaultJdbcDriverName = pTypeCollection->getJavaDriverClass(pUrlItem->GetValue()); } @@ -567,7 +567,7 @@ DBG_NAME(OMySQLIntroPageSetup) const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String(), WB_OK | WB_DEF_OK, mt ); + OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); aMsg.Execute(); return 0L; } @@ -635,10 +635,10 @@ DBG_NAME(OMySQLIntroPageSetup) if ( bValid ) { - if ( !pDrvItem->GetValue().Len() ) + if ( !pDrvItem->GetValue().getLength() ) { - String sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); - if ( sDefaultJdbcDriverName.Len() ) + OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); + if ( sDefaultJdbcDriverName.getLength() ) { m_aETDriverClass.SetText(sDefaultJdbcDriverName); m_aETDriverClass.SetModifyFlag(); @@ -650,7 +650,7 @@ DBG_NAME(OMySQLIntroPageSetup) m_aETDriverClass.ClearModifyFlag(); } } - sal_Bool bEnable = pDrvItem->GetValue().Len() != 0; + sal_Bool bEnable = pDrvItem->GetValue().getLength() != 0; m_aPBTestJavaDriver.Enable(bEnable); OConnectionTabPageSetup::implInitControls(_rSet, _bSaveValue); @@ -686,7 +686,7 @@ DBG_NAME(OMySQLIntroPageSetup) } sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; - OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); + OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() ); aMsg.Execute(); return 0L; } @@ -828,7 +828,7 @@ DBG_NAME(OAuthentificationPageSetup) if (m_aETUserName.GetText() != m_aETUserName.GetSavedValue()) { _rSet.Put(SfxStringItem(DSID_USER, m_aETUserName.GetText())); - _rSet.Put(SfxStringItem(DSID_PASSWORD, String())); + _rSet.Put(SfxStringItem(DSID_PASSWORD, OUString())); bChangedSomething = sal_True; } fillBool(_rSet,&m_aCBPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething); @@ -856,7 +856,7 @@ DBG_NAME(OFinalDBPageSetup) { DBG_CTOR(OFinalDBPageSetup,NULL); - String stext = m_aFTFinalHeader.GetText(); + OUString stext = m_aFTFinalHeader.GetText(); SetControlFontWeight(&m_aFTFinalHeader); m_aCBOpenAfterwards.SetClickHdl(LINK(this, OFinalDBPageSetup, OnOpenSelected)); m_aCBStartTableWizard.SetClickHdl(getControlModifiedLink()); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index 006d23656245..2d50d1bae75d 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -181,7 +181,7 @@ namespace dbaui Edit m_aETDriverClass; PushButton m_aPBTestJavaDriver; - String m_sDefaultJdbcDriverName; + OUString m_sDefaultJdbcDriverName; sal_uInt16 m_nPortId; }; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 329faf48e4b6..9962d6f09bc4 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -107,7 +107,7 @@ namespace return bCorrectType; } - void lcl_putProperty(const Reference< XPropertySet >& _rxSet, const ::rtl::OUString& _rName, const Any& _rValue) + void lcl_putProperty(const Reference< XPropertySet >& _rxSet, const OUString& _rName, const Any& _rValue) { try { @@ -126,17 +126,17 @@ namespace } - String lcl_createHostWithPort(const SfxStringItem* _pHostName,const SfxInt32Item* _pPortNumber) + OUString lcl_createHostWithPort(const SfxStringItem* _pHostName,const SfxInt32Item* _pPortNumber) { - String sNewUrl; + OUString sNewUrl; - if ( _pHostName && _pHostName->GetValue().Len() ) + if ( _pHostName && _pHostName->GetValue().getLength() ) sNewUrl = _pHostName->GetValue(); if ( _pPortNumber ) { - sNewUrl += rtl::OUString::createFromAscii(":"); - sNewUrl += String::CreateFromInt32(_pPortNumber->GetValue()); + sNewUrl += OUString::createFromAscii(":"); + sNewUrl += OUString::number(_pPortNumber->GetValue()); } return sNewUrl; @@ -182,30 +182,30 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_AS_BEFORE_CORRNAME, INFO_AS_BEFORE_CORRELATION_NAME ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CHECK_REQUIRED_FIELDS, INFO_FORMS_CHECK_REQUIRED_FIELDS ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_ESCAPE_DATETIME, INFO_ESCAPE_DATETIME ) ); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PRIMARY_KEY_SUPPORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrimaryKeySupport" ) ) ) ); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PRIMARY_KEY_SUPPORT, OUString("PrimaryKeySupport"))); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PARAMETERNAMESUBST, INFO_PARAMETERNAMESUBST)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_IGNOREDRIVER_PRIV, INFO_IGNOREDRIVER_PRIV)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_BOOLEANCOMPARISON, PROPERTY_BOOLEANCOMPARISONMODE)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_ENABLEOUTERJOIN, PROPERTY_ENABLEOUTERJOIN)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CATALOG, PROPERTY_USECATALOGINSELECT)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_SCHEMA, PROPERTY_USESCHEMAINSELECT)); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_INDEXAPPENDIX, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AddIndexAppendix")))); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOSLINEENDS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreferDosLikeLineEnds" ) ) ) ); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SOCKET, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalSocket" ) ) ) ); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPipe" ) ) ) ); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_RESPECTRESULTSETTYPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RespectDriverResultSetType" ) ) ) ); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_MAX_ROW_SCAN, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxRowScan" ) ) ) ); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_INDEXAPPENDIX, OUString("AddIndexAppendix"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOSLINEENDS, OUString("PreferDosLikeLineEnds"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SOCKET, OUString("LocalSocket"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, OUString("NamedPipe"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_RESPECTRESULTSETTYPE, OUString("RespectDriverResultSetType"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_MAX_ROW_SCAN, OUString("MaxRowScan"))); // extra settings for odbc m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_USECATALOG, INFO_USECATALOG)); // extra settings for a ldap address book m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_BASEDN, INFO_CONN_LDAP_BASEDN)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_ROWCOUNT, INFO_CONN_LDAP_ROWCOUNT)); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_USESSL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseSSL")))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_USESSL, OUString("UseSSL"))); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOCUMENT_URL, PROPERTY_URL)); // oracle - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_IGNORECURRENCY, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreCurrency")))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_IGNORECURRENCY, OUString("IgnoreCurrency"))); try { @@ -213,7 +213,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer } catch(const Exception&) { - ShowServiceNotAvailableError(_pParent->GetParent(), String("com.sun.star.sdb.DatabaseContext"), sal_True); + ShowServiceNotAvailableError(_pParent->GetParent(), OUString("com.sun.star.sdb.DatabaseContext"), sal_True); } } //------------------------------------------------------------------------- @@ -228,20 +228,20 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert // user: DSID_USER -> "user" SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pUser, SfxStringItem, DSID_USER, sal_True); - if (pUser && pUser->GetValue().Len()) + if (pUser && pUser->GetValue().getLength()) aReturn.push_back( - PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")), 0, - makeAny(::rtl::OUString(pUser->GetValue())), PropertyState_DIRECT_VALUE)); + PropertyValue( OUString("user"), 0, + makeAny(OUString(pUser->GetValue())), PropertyState_DIRECT_VALUE)); // check if the connection type requires a password if (hasAuthentication(*m_pItemSetHelper->getOutputSet())) { // password: DSID_PASSWORD -> "password" SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPassword, SfxStringItem, DSID_PASSWORD, sal_True); - String sPassword = pPassword ? pPassword->GetValue() : String(); + OUString sPassword = pPassword ? pPassword->GetValue() : OUString(); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPasswordRequired, SfxBoolItem, DSID_PASSWORDREQUIRED, sal_True); // if the set does not contain a password, but the item set says it requires one, ask the user - if ((!pPassword || !pPassword->GetValue().Len()) && (pPasswordRequired && pPasswordRequired->GetValue())) + if ((!pPassword || !pPassword->GetValue().getLength()) && (pPasswordRequired && pPasswordRequired->GetValue())) { SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pName, SfxStringItem, DSID_NAME, sal_True); @@ -255,16 +255,16 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert xHandler = Reference< XInteractionHandler >( task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); } - String sName = pName ? pName->GetValue() : String(); - String sLoginRequest(ModuleRes(STR_ENTER_CONNECTION_PASSWORD)); - ::rtl::OUString sTemp = sName; + OUString sName = pName ? pName->GetValue() : OUString(); + OUString sLoginRequest(ModuleRes(STR_ENTER_CONNECTION_PASSWORD)); + OUString sTemp = sName; sName = ::dbaui::getStrippedDatabaseName(NULL,sTemp); - if ( sName.Len() ) - sLoginRequest.SearchAndReplaceAscii("$name$", sName); + if ( sName.getLength() ) + sLoginRequest.replaceAll("$name$", sName); else { - sLoginRequest.SearchAndReplaceAscii("\"$name$\"", String()); - sLoginRequest.SearchAndReplaceAscii("$name$", String()); // just to be sure that in other languages the string will be deleted + sLoginRequest.replaceAll("\"$name$\"", OUString()); + sLoginRequest.replaceAll("$name$", OUString()); // just to be sure that in other languages the string will be deleted } // the request @@ -274,7 +274,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert aRequest.HasRealm = aRequest.HasAccount = sal_False; // aRequest.Realm aRequest.HasUserName = pUser != 0; - aRequest.UserName = pUser ? rtl::OUString(pUser->GetValue()) : ::rtl::OUString(); + aRequest.UserName = pUser ? OUString(pUser->GetValue()) : OUString(); aRequest.HasPassword = sal_True; //aRequest.Password aRequest.HasAccount = sal_False; @@ -313,10 +313,10 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert m_pItemSetHelper->getWriteOutputSet()->Put(SfxStringItem(DSID_PASSWORD, sPassword)); } - if (sPassword.Len()) + if (sPassword.getLength()) aReturn.push_back( - PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password")), 0, - makeAny(::rtl::OUString(sPassword)), PropertyState_DIRECT_VALUE)); + PropertyValue( OUString("password"), 0, + makeAny(OUString(sPassword)), PropertyState_DIRECT_VALUE)); } if ( !aReturn.empty() ) @@ -337,9 +337,9 @@ void ODbDataSourceAdministrationHelper::successfullyConnected() if (hasAuthentication(*m_pItemSetHelper->getOutputSet())) { SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPassword, SfxStringItem, DSID_PASSWORD, sal_True); - if (pPassword && (0 != pPassword->GetValue().Len())) + if (pPassword && (0 != pPassword->GetValue().getLength())) { - ::rtl::OUString sPassword = pPassword->GetValue(); + OUString sPassword = pPassword->GetValue(); Reference< XPropertySet > xCurrentDatasource = getCurrentDataSource(); lcl_putProperty(xCurrentDatasource,m_aDirectPropTranslator[DSID_PASSWORD], makeAny(sPassword)); @@ -386,7 +386,7 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver() return getDriver(getConnectionURL()); } // ----------------------------------------------------------------------------- -Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::OUString& _sURL) +Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const OUString& _sURL) { // get the global DriverManager Reference< XConnectionPool > xDriverManager; @@ -401,8 +401,8 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::O catch (const Exception& e) { // wrap the exception into an SQLException - SQLException aSQLWrapper(e.Message, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any()); - throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, makeAny(aSQLWrapper)); + SQLException aSQLWrapper(e.Message, getORB(), OUString("S1000"), 0, Any()); + throw SQLException(sCurrentActionError, getORB(), OUString("S1000"), 0, makeAny(aSQLWrapper)); } @@ -412,7 +412,7 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::O sCurrentActionError = String(ModuleRes(STR_NOREGISTEREDDRIVER)); sCurrentActionError.SearchAndReplaceAscii("#connurl#", _sURL); // will be caught and translated into an SQLContext exception - throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any()); + throw SQLException(sCurrentActionError, getORB(), OUString("S1000"), 0, Any()); } return xDriver; } @@ -425,7 +425,7 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc Reference<XInterface> xIn(m_aDataSourceOrName,UNO_QUERY); if ( !xIn.is() ) { - ::rtl::OUString sCurrentDatasource; + OUString sCurrentDatasource; m_aDataSourceOrName >>= sCurrentDatasource; OSL_ENSURE(!sCurrentDatasource.isEmpty(),"No datasource name given!"); try @@ -453,7 +453,7 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc return m_xDatasource; } //------------------------------------------------------------------------- -::rtl::OUString ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet ) +OUString ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet ) { SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True ); OSL_ENSURE( pConnectURL , "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" ); @@ -473,7 +473,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const { String sNewUrl; - ::rtl::OUString eType = getDatasourceType(*m_pItemSetHelper->getOutputSet()); + OUString eType = getDatasourceType(*m_pItemSetHelper->getOutputSet()); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); @@ -492,8 +492,8 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const case ::dbaccess::DST_MSACCESS: case ::dbaccess::DST_MSACCESS_2007: { - ::rtl::OUString sFileName = pCollection->cutPrefix(pUrlItem->GetValue()); - ::rtl::OUString sNewFileName; + OUString sFileName = pCollection->cutPrefix(pUrlItem->GetValue()); + OUString sNewFileName; if ( ::osl::FileBase::getSystemPathFromFileURL( sFileName, sNewFileName ) == ::osl::FileBase::E_None ) { sNewUrl += String(sNewFileName); @@ -507,17 +507,16 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_MYSQL_PORTNUMBER, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pDatabaseName, SfxStringItem, DSID_DATABASENAME, sal_True); sNewUrl = lcl_createHostWithPort(pHostName,pPortNumber); - String sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : String(); - if ( !sDatabaseName.Len() && pUrlItem ) + OUString sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : OUString(); + if ( !sDatabaseName.getLength() && pUrlItem ) sDatabaseName = pCollection->cutPrefix( pUrlItem->GetValue() ); // TODO: what's that? Why is the database name transported via the URL Item? // Huh? Anybody there? // OJ: It is needed when the connection properties are changed. There the URL is used for every type. - if ( sDatabaseName.Len() ) + if ( sDatabaseName.getLength() ) { - sNewUrl += rtl::OUString::createFromAscii("/"); - sNewUrl += sDatabaseName; + sNewUrl += OUString::createFromAscii("/") + sDatabaseName; } } break; @@ -526,17 +525,15 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_ORACLE_PORTNUMBER, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pDatabaseName, SfxStringItem, DSID_DATABASENAME, sal_True); - if ( pHostName && pHostName->GetValue().Len() ) + if ( pHostName && pHostName->GetValue().getLength() ) { - sNewUrl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("@")); - sNewUrl += lcl_createHostWithPort(pHostName,pPortNumber); - String sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : String(); - if ( !sDatabaseName.Len() && pUrlItem ) + sNewUrl = OUString("@") + lcl_createHostWithPort(pHostName,pPortNumber); + OUString sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : OUString(); + if ( !sDatabaseName.getLength() && pUrlItem ) sDatabaseName = pCollection->cutPrefix( pUrlItem->GetValue() ); - if ( sDatabaseName.Len() ) + if ( sDatabaseName.getLength() ) { - sNewUrl += rtl::OUString::createFromAscii(":"); - sNewUrl += sDatabaseName; + sNewUrl += OUString::createFromAscii(":") + sDatabaseName; } } else @@ -579,7 +576,7 @@ DECLARE_STL_SET( PropertyValue, PropertyValueLess, PropertyValueSet); //........................................................................ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPropertySet >& _rxSource, SfxItemSet& _rDest) { - Sequence< ::rtl::OUString > aTableFitler; + Sequence< OUString > aTableFitler; if (_rxSource.is()) { @@ -623,7 +620,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr if (0 == pAdditionalInfo->Name.compareToAscii("JDBCDRV")) { // compatibility PropertyValue aCompatibility(*pAdditionalInfo); - aCompatibility.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass")); + aCompatibility.Name = OUString("JavaDriverClass"); aInfos.insert(aCompatibility); } else @@ -675,7 +672,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r try { xInfo = _rxDest->getPropertySetInfo(); } catch(Exception&) { } - const ::rtl::OUString sUrlProp(RTL_CONSTASCII_USTRINGPARAM("URL")); + const OUString sUrlProp("URL"); // ----------------------------- // transfer the direct properties for ( ConstMapInt2StringIterator aDirect = m_aDirectPropTranslator.begin(); @@ -696,8 +693,8 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r { if ( sUrlProp == aDirect->second ) { - Any aValue(makeAny(::rtl::OUString(getConnectionURL()))); - // aValue <<= ::rtl::OUString(); + Any aValue(makeAny(OUString(getConnectionURL()))); + // aValue <<= OUString(); lcl_putProperty(_rxDest, aDirect->second,aValue); } else @@ -732,7 +729,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS // us) // first determine which of all the items are relevant for the data source (depends on the connection url) - ::rtl::OUString eType = getDatasourceType(_rSource); + OUString eType = getDatasourceType(_rSource); ::std::vector< sal_Int32> aDetailIds; ODriversSettings::getSupportedIndirectSettings(eType, getORB(), aDetailIds); @@ -748,7 +745,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS { if ( aTranslation->second == INFO_CHARSET ) { - ::rtl::OUString sCharSet; + OUString sCharSet; implTranslateProperty(pCurrent) >>= sCharSet; if ( !sCharSet.isEmpty() ) aRelevantSettings.insert(PropertyValue(aTranslation->second, 0, makeAny(sCharSet), PropertyState_DIRECT_VALUE)); @@ -812,7 +809,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS if (aIndirectProps.end() != aIndirectProps.find(aPreserved->second)) { #if OSL_DEBUG_LEVEL > 0 - const ::rtl::OUString sName = aPreserved->second; + const OUString sName = aPreserved->second; #endif aRemoveIndexes.push_back(aPreserved->first - nPositionCorrector); ++nPositionCorrector; @@ -830,7 +827,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS const PropertyValue* pWhatsLeftEnd = pWhatsLeft + _rInfo.getLength(); for (; pWhatsLeft != pWhatsLeftEnd; ++pWhatsLeft) { - ::rtl::OUString sLookAtIt = pWhatsLeft->Name; + OUString sLookAtIt = pWhatsLeft->Name; } #endif } @@ -842,7 +839,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS // here we have a special entry for types from oracle if ( aTypeSettings.getLength() ) { - aRelevantSettings.insert(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeInfoSettings")), 0, makeAny(aTypeSettings), PropertyState_DIRECT_VALUE)); + aRelevantSettings.insert(PropertyValue(OUString("TypeInfoSettings"), 0, makeAny(aTypeSettings), PropertyState_DIRECT_VALUE)); } // check which values are still left ('cause they were not present in the original sequence, but are to be set) @@ -859,7 +856,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS { if ( aLoop->Name == INFO_CHARSET ) { - ::rtl::OUString sCharSet; + OUString sCharSet; aLoop->Value >>= sCharSet; if ( !sCharSet.isEmpty() ) *pAppendValues = *aLoop; @@ -883,7 +880,7 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem* if ( pStringItem ) { - aValue <<= ::rtl::OUString( pStringItem->GetValue().GetBuffer() ); + aValue <<= OUString( pStringItem->GetValue().getStr() ); } else if ( pBoolItem ) { @@ -913,7 +910,7 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem* return aValue; } //------------------------------------------------------------------------- -void ODbDataSourceAdministrationHelper::implTranslateProperty(const Reference< XPropertySet >& _rxSet, const ::rtl::OUString& _rName, const SfxPoolItem* _pItem) +void ODbDataSourceAdministrationHelper::implTranslateProperty(const Reference< XPropertySet >& _rxSet, const OUString& _rName, const SfxPoolItem* _pItem) { Any aValue = implTranslateProperty(_pItem); lcl_putProperty(_rxSet, _rName,aValue); @@ -923,7 +920,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty(const Reference< X //------------------------------------------------------------------------- ::rtl::OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId ) { - ::rtl::OUString aString; + OUString aString; MapInt2String::const_iterator aPos = m_aDirectPropTranslator.find( _nId ); if ( m_aDirectPropTranslator.end() != aPos ) @@ -950,7 +947,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet case TypeClass_STRING: if ( implCheckItemType( _rSet, _nId, SfxStringItem::StaticType() ) ) { - ::rtl::OUString sValue; + OUString sValue; _rValue >>= sValue; _rSet.Put(SfxStringItem(_nId, sValue)); } @@ -1025,7 +1022,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet { case TypeClass_STRING: { - Sequence< ::rtl::OUString > aStringList; + Sequence< OUString > aStringList; _rValue >>= aStringList; _rSet.Put(OStringListItem(_nId, aStringList)); } @@ -1065,7 +1062,7 @@ String ODbDataSourceAdministrationHelper::getDocumentUrl(SfxItemSet& _rDest) // ----------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) { - ::rtl::OUString eType = getDatasourceType(_rDest); + OUString eType = getDatasourceType(_rDest); SFX_ITEMSET_GET(_rDest, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(_rDest, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); @@ -1077,8 +1074,8 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) sal_uInt16 nPortNumberId = 0; sal_Int32 nPortNumber = -1; - String sNewHostName; - String sUrlPart; + OUString sNewHostName; + OUString sUrlPart; pCollection->extractHostNamePort(pUrlItem->GetValue(),sUrlPart,sNewHostName,nPortNumber); const ::dbaccess::DATASOURCE_TYPE eTy = pCollection->determineType(eType); @@ -1099,7 +1096,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) break; } - if ( sUrlPart.Len() ) + if ( sUrlPart.getLength() ) { if ( eTy == ::dbaccess::DST_MYSQL_NATIVE ) { @@ -1107,13 +1104,13 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) } else { - String sNewUrl = pCollection->getPrefix(eType); + OUString sNewUrl = pCollection->getPrefix(eType); sNewUrl += sUrlPart; _rDest.Put( SfxStringItem( DSID_CONNECTURL, sNewUrl ) ); } } - if ( sNewHostName.Len() ) + if ( sNewHostName.getLength() ) _rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName)); if ( nPortNumber != -1 && nPortNumberId != 0 ) diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index 2fe1bfd98a6b..983878c1c3ba 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -41,8 +41,8 @@ namespace dbaui { void convert(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> & xContext, const ::dbaccess::ODsnTypeCollection* _pCollection, - const ::rtl::OUString& _sOldURLPrefix, - const ::rtl::OUString& _sNewURLPrefix, + const OUString& _sOldURLPrefix, + const OUString& _sNewURLPrefix, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDatasource); }; class IItemSetHelper; @@ -52,7 +52,7 @@ namespace dbaui class ODbDataSourceAdministrationHelper { public: - DECLARE_STL_MAP(sal_Int32, ::rtl::OUString, ::std::less< sal_Int32 >, MapInt2String); + DECLARE_STL_MAP(sal_Int32, OUString, ::std::less< sal_Int32 >, MapInt2String); private: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > @@ -63,7 +63,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; ::com::sun::star::uno::Any m_aDataSourceOrName; - typedef ::std::set< ::rtl::OUString > StringSet; + typedef ::std::set< OUString > StringSet; typedef StringSet::const_iterator ConstStringSetIterator; @@ -101,7 +101,7 @@ namespace dbaui /** return the corresponding driver for the selected URL */ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(const ::rtl::OUString& _sURL); + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(const OUString& _sURL); /** returns the data source the dialog is currently working with */ @@ -114,7 +114,7 @@ namespace dbaui /** extracts the connection type from the given set<p/> The connection type is determined by the value of the DSN item, analyzed by the TypeCollection item. */ - static ::rtl::OUString getDatasourceType( const SfxItemSet& _rSet ); + static OUString getDatasourceType( const SfxItemSet& _rSet ); /** returns the connection URL @return @@ -160,7 +160,7 @@ namespace dbaui ::com::sun::star::uno::Any implTranslateProperty(const SfxPoolItem* _pItem); /// translate the given SfxPoolItem into an <type scope="com.sun.star.Any">uno</type>, set it (under the given name) on the given property set - void implTranslateProperty(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxSet, const ::rtl::OUString& _rName, const SfxPoolItem* _pItem); + void implTranslateProperty(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxSet, const OUString& _rName, const SfxPoolItem* _pItem); /** check if the data source described by the given set needs authentication<p/> The return value depends on the data source type only. diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 0c62704e41c4..56780f8c0a19 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -272,7 +272,7 @@ namespace dbaui SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; - if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len()) + if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength()) m_sDsn = pTypeCollection->cutPrefix(pUrlItem->GetValue()); // get the other relevant items @@ -505,11 +505,11 @@ namespace dbaui SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; - if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len() ) + if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength() ) { m_sDefaultJdbcDriverName = pTypeCollection->getJavaDriverClass(pUrlItem->GetValue()); } - if ( m_sDefaultJdbcDriverName.Len() ) + if ( m_sDefaultJdbcDriverName.getLength() ) { m_aEDDriverClass.SetModifyHdl(getControlModifiedLink()); m_aEDDriverClass.SetModifyHdl(LINK(this, OGeneralSpecialJDBCDetailsPage, OnEditModified)); @@ -935,7 +935,7 @@ namespace dbaui //------------------------------------------------------------------------ SfxTabPage* ODriversSettings::CreateSpecialSettingsPage( Window* _pParent, const SfxItemSet& _rAttrSet ) { - ::rtl::OUString eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet ); + OUString eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet ); DataSourceMetaData aMetaData( eType ); return new SpecialSettingsPage( _pParent, _rAttrSet, aMetaData ); } diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index c4d7f52874e4..9e1a3e792e7a 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -217,7 +217,7 @@ namespace dbaui Edit m_aEDDriverClass; PushButton m_aTestJavaDriver; - String m_sDefaultJdbcDriverName; + OUString m_sDefaultJdbcDriverName; sal_uInt16 m_nPortId; bool m_bUseClass; }; diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 29d725282472..38f807dcd6a2 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -96,13 +96,13 @@ namespace dbaui // If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); if ( nCreateNewDBIndex == -1 ) - nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")) ); + nCreateNewDBIndex = m_pCollection->getIndexOf( OUString("sdbc:dbase:") ); bool bHideCreateNew = ( nCreateNewDBIndex == -1 ); // also, if our application policies tell us to hide the option, do it ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithComponentContext( ::comphelper::getProcessComponentContext(), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.DataAccess/Policies/Features/Base" ) ) + OUString("/org.openoffice.Office.DataAccess/Policies/Features/Base") ) ); sal_Bool bAllowCreateLocalDatabase( sal_True ); OSL_VERIFY( aConfig.getNodeValue( "CreateLocalDatabase" ) >>= bAllowCreateLocalDatabase ); @@ -152,10 +152,10 @@ namespace dbaui { struct DisplayedType { - ::rtl::OUString eType; + OUString eType; String sDisplayName; - DisplayedType( const ::rtl::OUString& _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { } + DisplayedType( const OUString& _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { } }; typedef ::std::vector< DisplayedType > DisplayedTypes; @@ -186,10 +186,10 @@ namespace dbaui ++aTypeLoop ) { - const ::rtl::OUString sURLPrefix = aTypeLoop.getURLPrefix(); + const OUString sURLPrefix = aTypeLoop.getURLPrefix(); if ( !sURLPrefix.isEmpty() ) { - String sDisplayName = aTypeLoop.getDisplayName(); + OUString sDisplayName = aTypeLoop.getDisplayName(); if ( m_pDatasourceType->GetEntryPos( sDisplayName ) == LISTBOX_ENTRY_NOTFOUND && approveDataSourceType( sURLPrefix, sDisplayName ) ) { @@ -211,17 +211,16 @@ namespace dbaui //------------------------------------------------------------------------- - void OGeneralPage::setParentTitle(const ::rtl::OUString& _sURLPrefix) + void OGeneralPage::setParentTitle(const OUString& _sURLPrefix) { if (!m_DBWizardMode) { - const String sName = m_pCollection->getTypeDisplayName(_sURLPrefix); + const OUString sName = m_pCollection->getTypeDisplayName(_sURLPrefix); if ( m_pAdminDialog ) { LocalResourceAccess aStringResAccess( PAGE_GENERAL, RSC_TABPAGE ); - String sMessage = String(ModuleRes(STR_PARENTTITLE)); - sMessage.SearchAndReplaceAscii("#",sName); - m_pAdminDialog->setTitle(sMessage); + OUString sMessage = OUString(ModuleRes(STR_PARENTTITLE)); + m_pAdminDialog->setTitle(sMessage.replaceAll("#",sName)); } } } @@ -247,7 +246,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::switchMessage(const ::rtl::OUString& _sURLPrefix) + void OGeneralPage::switchMessage(const OUString& _sURLPrefix) { SPECIAL_MESSAGE eMessage = smNone; if ( _sURLPrefix.isEmpty()/*_eType == m_eNotSupportedKnownType*/ ) @@ -274,7 +273,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::onTypeSelected(const ::rtl::OUString& _sURLPrefix) + void OGeneralPage::onTypeSelected(const OUString& _sURLPrefix) { // the new URL text as indicated by the selection history implSetCurrentType( _sURLPrefix ); @@ -357,12 +356,12 @@ namespace dbaui sConnectURL = pUrlItem->GetValue(); } - ::rtl::OUString eOldSelection = m_eCurrentSelection; + OUString eOldSelection = m_eCurrentSelection; m_eNotSupportedKnownType = ::dbaccess::DST_UNKNOWN; - implSetCurrentType( ::rtl::OUString() ); + implSetCurrentType( OUString() ); // compare the DSN prefix with the registered ones - String sDisplayName; + OUString sDisplayName; if (m_pCollection && bValid) { @@ -384,7 +383,7 @@ namespace dbaui } if (m_aRB_CreateDatabase.IsChecked() && m_DBWizardMode) - sDisplayName = m_pCollection->getTypeDisplayName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jdbc:"))); + sDisplayName = m_pCollection->getTypeDisplayName( OUString("jdbc:")); m_pDatasourceType->SelectEntry(sDisplayName); // notify our listener that our type selection has changed (if so) @@ -407,7 +406,7 @@ namespace dbaui // representative for all MySQl databases) // Also, embedded databases (embedded HSQL, at the moment), are not to appear in the list of // databases to connect to. - bool OGeneralPage::approveDataSourceType( const ::rtl::OUString& _sURLPrefix, String& _inout_rDisplayName ) + bool OGeneralPage::approveDataSourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ) { const ::dbaccess::DATASOURCE_TYPE eType = m_pCollection->determineType(_sURLPrefix); @@ -440,12 +439,12 @@ namespace dbaui if ( eType == ::dbaccess::DST_EMBEDDED_HSQLDB ) _inout_rDisplayName = String(); - return _inout_rDisplayName.Len() > 0; + return _inout_rDisplayName.getLength() > 0; } // ----------------------------------------------------------------------- - void OGeneralPage::insertDatasourceTypeEntryData(const ::rtl::OUString& _sType, String sDisplayName) + void OGeneralPage::insertDatasourceTypeEntryData(const OUString& _sType, String sDisplayName) { // insert a (temporary) entry sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName); @@ -476,7 +475,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::implSetCurrentType( const ::rtl::OUString& _eType ) + void OGeneralPage::implSetCurrentType( const OUString& _eType ) { if ( _eType == m_eCurrentSelection ) return; @@ -488,7 +487,7 @@ namespace dbaui void OGeneralPage::Reset(const SfxItemSet& _rCoreAttrs) { // reset all locale data - implSetCurrentType( ::rtl::OUString() ); + implSetCurrentType( OUString() ); // this ensures that our type selection link will be called, even if the new is is the same as the // current one OGenericAdministrationPage::Reset(_rCoreAttrs); @@ -504,7 +503,7 @@ namespace dbaui { if ( m_aRB_CreateDatabase.IsChecked() ) { - _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")))); + _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, OUString("sdbc:dbase:"))); bChangedSomething = sal_True; bCommitTypeSelection = false; } @@ -521,7 +520,7 @@ namespace dbaui if ( bCommitTypeSelection ) { sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); - ::rtl::OUString sURLPrefix = m_aURLPrefixes[nEntry]; + OUString sURLPrefix = m_aURLPrefixes[nEntry]; if (m_DBWizardMode) { if ( ( m_pDatasourceType->GetSavedValue() != nEntry ) @@ -551,7 +550,7 @@ namespace dbaui { // get the type from the entry data sal_Int16 nSelected = _pBox->GetSelectEntryPos(); - const ::rtl::OUString sURLPrefix = m_aURLPrefixes[nSelected]; + const OUString sURLPrefix = m_aURLPrefixes[nSelected]; setParentTitle(sURLPrefix); // let the impl method do all the stuff @@ -596,7 +595,7 @@ namespace dbaui { ::sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, - 0, rtl::OUString::createFromAscii("sdatabase") ); + 0, OUString::createFromAscii("sdatabase") ); const SfxFilter* pFilter = getStandardDatabaseFilter(); if ( pFilter ) { diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 684c5a36c4ec..13ca0a82dc5a 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -80,12 +80,12 @@ namespace dbaui ::svt::ControlDependencyManager m_aControlDependencies; - ::std::vector< ::rtl::OUString> m_aURLPrefixes; + ::std::vector< OUString> m_aURLPrefixes; ::dbaccess::ODsnTypeCollection* m_pCollection; /// the DSN type collection instance - ::rtl::OUString m_eCurrentSelection; /// currently selected type + OUString m_eCurrentSelection; /// currently selected type ::dbaccess::DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered .... enum SPECIAL_MESSAGE @@ -101,8 +101,8 @@ namespace dbaui Link m_aChooseDocumentHandler; /// to be called when a recent document has been definately chosen sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted bool m_bInitTypeList : 1; - bool approveDataSourceType( const ::rtl::OUString& _sURLPrefix, String& _inout_rDisplayName ); - void insertDatasourceTypeEntryData(const ::rtl::OUString& _sType, String sDisplayName); + bool approveDataSourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); + void insertDatasourceTypeEntryData(const OUString& _sType, String sDisplayName); public: static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet, sal_Bool _bDBWizardMode = sal_False); @@ -117,7 +117,7 @@ namespace dbaui DocumentDescriptor GetSelectedDocument() const; /// get the currently selected datasource type - ::rtl::OUString GetSelectedType() const { return m_eCurrentSelection; } + OUString GetSelectedType() const { return m_eCurrentSelection; } protected: // SfxTabPage overridables @@ -135,15 +135,15 @@ namespace dbaui protected: - void onTypeSelected(const ::rtl::OUString& _sURLPrefix); + void onTypeSelected(const OUString& _sURLPrefix); void initializeTypeList(); - void implSetCurrentType( const ::rtl::OUString& _eType ); + void implSetCurrentType( const OUString& _eType ); - void switchMessage(const ::rtl::OUString& _sURLPrefix); + void switchMessage(const OUString& _sURLPrefix); /// sets the title of the parent dialog - void setParentTitle(const ::rtl::OUString& _sURLPrefix); + void setParentTitle(const OUString& _sURLPrefix); DECL_LINK(OnDatasourceTypeSelected, ListBox*); DECL_LINK(OnSetupModeSelected, RadioButton*); |