diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-19 15:20:39 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-01 10:08:36 +0200 |
commit | a952bd8aacba91ed654f11da07cbf0059d378918 (patch) | |
tree | c0fdd92d645df903db778c0b2606ac41be8a2e80 /extensions/source/bibliography | |
parent | de6a35f52276b601a8ebc68fbcfd28ad2db84f6f (diff) |
convert extensions module from String to OUString
Change-Id: Ia0cb9fe1eaebdd295fb1742074fe2c48be61c077
Diffstat (limited to 'extensions/source/bibliography')
-rw-r--r-- | extensions/source/bibliography/bibload.cxx | 16 | ||||
-rw-r--r-- | extensions/source/bibliography/bibview.cxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 36 | ||||
-rw-r--r-- | extensions/source/bibliography/framectr.cxx | 26 | ||||
-rw-r--r-- | extensions/source/bibliography/general.cxx | 14 | ||||
-rw-r--r-- | extensions/source/bibliography/general.hxx | 16 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.cxx | 8 |
7 files changed, 61 insertions, 61 deletions
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 9dbb7be0469b..adb0046e962f 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -233,8 +233,8 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString m_pBibMod = OpenBibModul(); - String aURLStr( rURL ); - String aPartName = aURLStr.GetToken( 1, '/' ); + OUString aURLStr( rURL ); + OUString aPartName = aURLStr.getToken( 1, '/' ); Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY); if(xPrSet.is()) { @@ -242,7 +242,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString aTitle <<= BibResId(RID_BIB_STR_FRAME_TITLE).toString(); xPrSet->setPropertyValue("Title", aTitle); } - if(aPartName.EqualsAscii("View") || aPartName.EqualsAscii("View1")) + if(aPartName == "View" || aPartName == "View1") { loadView(rFrame, rURL, rArgs, rListener); } @@ -421,14 +421,14 @@ Reference< XResultSet > BibliographyLoader::GetDataCursor() const } static OUString lcl_AddProperty(Reference< XNameAccess > xColumns, - const Mapping* pMapping, const String& rColumnName) + const Mapping* pMapping, const OUString& rColumnName) { - String sColumnName(rColumnName); + OUString sColumnName(rColumnName); if(pMapping) { for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - if(pMapping->aColumnPairs[nEntry].sLogicalColumnName == OUString(rColumnName)) + if(pMapping->aColumnPairs[nEntry].sLogicalColumnName == rColumnName) { sColumnName = pMapping->aColumnPairs[nEntry].sRealColumnName; break; @@ -462,7 +462,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw if (!xColumns.is()) return aRet; - String sIdentifierMapping = pDatMan->GetIdentifierMapping(); + OUString sIdentifierMapping = pDatMan->GetIdentifierMapping(); OUString sId = sIdentifierMapping; Reference< sdb::XColumn > xColumn; if (xColumns->hasByName(sId)) @@ -480,7 +480,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw const Mapping* pMapping = pConfig->GetMapping(aBibDesc); for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - const String sColName = pConfig->GetDefColumnName( + const OUString sColName = pConfig->GetDefColumnName( nEntry); pValues[nEntry].Name = sColName; pValues[nEntry].Value <<= lcl_AddProperty(xColumns, pMapping, sColName); diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx index 9063b8031bd8..30023e2e36be 100644 --- a/extensions/source/bibliography/bibview.cxx +++ b/extensions/source/bibliography/bibview.cxx @@ -121,8 +121,8 @@ namespace bib // "delayed" GetFocus() because GetFocus() is initially called before GeneralPage is created m_pGeneralPage->GrabFocus(); - String sErrorString( m_pGeneralPage->GetErrorString() ); - if ( sErrorString.Len() ) + OUString sErrorString( m_pGeneralPage->GetErrorString() ); + if ( !sErrorString.isEmpty() ) { sal_Bool bExecute = BibModul::GetConfig()->IsShowColumnAssignmentWarning(); if(!m_pDatMan->HasActiveConnection()) @@ -133,7 +133,7 @@ namespace bib } else if(bExecute) { - sErrorString += '\n'; + sErrorString += "\n"; sErrorString += BIB_RESSTR(RID_MAP_QUESTION); QueryBox aQuery( this, WB_YES_NO, sErrorString ); aQuery.SetDefaultCheckBoxText(); diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index dbaa913ac0b5..30315f80b13b 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -261,7 +261,7 @@ class MappingDialog_Impl : public ModalDialog FixedText aCustom5FT; ListBox aCustom5LB; ListBox* aListBoxes[COLUMN_COUNT]; - String sNone; + OUString sNone; sal_Bool bModified; @@ -398,8 +398,8 @@ MappingDialog_Impl::MappingDialog_Impl(Window* pParent, BibDataManager* pMan) : aCustom5FT.SetText(BIB_RESSTR(ST_CUSTOM5)); aOKBT.SetClickHdl(LINK(this, MappingDialog_Impl, OkHdl)); - String sTitle = GetText(); - sTitle.SearchAndReplace(OUString("%1"), pDatMan->getActiveDataTable(), 0); + OUString sTitle = GetText(); + sTitle = sTitle.replaceFirst("%1", pDatMan->getActiveDataTable()); SetText(sTitle); aListBoxes[0] = &aIdentifierLB; @@ -500,14 +500,14 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl) if(bModified) { Mapping aNew; - aNew.sTableName = String(pDatMan->getActiveDataTable()); - aNew.sURL = String(pDatMan->getActiveDataSource()); + aNew.sTableName = pDatMan->getActiveDataTable(); + aNew.sURL = pDatMan->getActiveDataSource(); sal_uInt16 nWriteIndex = 0; BibConfig* pConfig = BibModul::GetConfig(); for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - String sSel = aListBoxes[nEntry]->GetSelectEntry(); + OUString sSel = aListBoxes[nEntry]->GetSelectEntry(); if(sSel != sNone) { aNew.aColumnPairs[nWriteIndex].sRealColumnName = sSel; @@ -535,8 +535,8 @@ class DBChangeDialog_Impl : public ModalDialog SvTabListBox aSelectionLB; HeaderBar aSelectionHB; DBChangeDialogConfig_Impl aConfig; - String aEntryST; - String aURLST; + OUString aEntryST; + OUString aURLST; BibDataManager* pDatMan; @@ -545,7 +545,7 @@ public: DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ); ~DBChangeDialog_Impl(); - String GetCurrentURL()const; + OUString GetCurrentURL()const; }; DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) : @@ -607,9 +607,9 @@ DBChangeDialog_Impl::~DBChangeDialog_Impl() { } -String DBChangeDialog_Impl::GetCurrentURL()const +OUString DBChangeDialog_Impl::GetCurrentURL()const { - String sRet; + OUString sRet; SvTreeListEntry* pEntry = aSelectionLB.FirstSelected(); if(pEntry) { @@ -647,8 +647,8 @@ void BibInterceptorHelper::ReleaseInterceptor() { Reference< XDispatch > xReturn; - String aCommand( aURL.Path ); - if ( aCommand.EqualsAscii("FormSlots/ConfirmDeletion") ) + OUString aCommand( aURL.Path ); + if ( aCommand == "FormSlots/ConfirmDeletion" ) xReturn = xFormDispatch; else if ( xSlaveDispatchProvider.is() ) @@ -1042,9 +1042,9 @@ void BibDataManager::startQueryWith(const OUString& rQuery) aQueryString+=getQueryField(); aQueryString+=aQuoteChar; aQueryString+=" like '"; - String sQuery(rQuery); - sQuery.SearchAndReplaceAll('?','_'); - sQuery.SearchAndReplaceAll('*','%'); + OUString sQuery(rQuery); + sQuery = sQuery.replaceAll("?","_"); + sQuery = sQuery.replaceAll("*","%"); aQueryString += sQuery; aQueryString+="%'"; } @@ -1587,8 +1587,8 @@ OUString BibDataManager::CreateDBChangeDialog(Window* pParent) DBChangeDialog_Impl * pDlg = new DBChangeDialog_Impl(pParent, this ); if(RET_OK == pDlg->Execute()) { - String sNewURL = pDlg->GetCurrentURL(); - if(sNewURL != String(getActiveDataSource())) + OUString sNewURL = pDlg->GetCurrentURL(); + if(sNewURL != getActiveDataSource()) { uRet = sNewURL; } diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index f254d28db79d..8683d936f9ad 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -422,16 +422,16 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen Window* pParent = VCLUnoHelper::GetWindow( xWindow ); WaitObject aWaitObject( pParent ); - String aCommand( _rURL.Path); - if(aCommand.EqualsAscii("Bib/Mapping")) + OUString aCommand( _rURL.Path); + if(aCommand == "Bib/Mapping") { pDatMan->CreateMappingDialog(pParent); } - else if(aCommand.EqualsAscii("Bib/source")) + else if(aCommand == "Bib/source") { ChangeDataSource(aArgs); } - else if(aCommand.EqualsAscii("Bib/sdbsource")) + else if(aCommand == "Bib/sdbsource") { OUString aURL = pDatMan->CreateDBChangeDialog(pParent); if(!aURL.isEmpty()) @@ -450,7 +450,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } } } - else if(aCommand.EqualsAscii("Bib/autoFilter")) + else if(aCommand == "Bib/autoFilter") { sal_uInt16 nCount = aStatusListeners.size(); for ( sal_uInt16 n=0; n<nCount; n++ ) @@ -480,7 +480,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen pConfig->setQueryField(aQueryField); pDatMan->startQueryWith(aQuery); } - else if(aCommand.EqualsAscii("Bib/standardFilter")) + else if(aCommand == "Bib/standardFilter") { try { @@ -518,17 +518,17 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } } } - else if(aCommand.EqualsAscii("Bib/removeFilter")) + else if(aCommand == "Bib/removeFilter") { RemoveFilter(); } - else if( _rURL.Complete == "slot:5503" || aCommand.EqualsAscii("CloseDoc") ) + else if( _rURL.Complete == "slot:5503" || aCommand == "CloseDoc" ) { Application::PostUserEvent( STATIC_LINK( this, BibFrameController_Impl, DisposeHdl ), 0 ); } - else if(aCommand.EqualsAscii("Bib/InsertRecord")) + else if(aCommand == "Bib/InsertRecord") { Reference<form::runtime::XFormController > xFormCtrl = pDatMan->GetFormController(); if(SaveModified(xFormCtrl)) @@ -547,7 +547,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } } } - else if(aCommand.EqualsAscii("Bib/DeleteRecord")) + else if(aCommand == "Bib/DeleteRecord") { Reference< ::com::sun::star::sdbc::XResultSet > xCursor(pDatMan->getForm(), UNO_QUERY); Reference< XResultSetUpdate > xUpdateCursor(xCursor, UNO_QUERY); @@ -609,7 +609,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } } } - else if(aCommand.EqualsAscii("Cut")) + else if(aCommand == "Cut") { Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) ); if(pChild) @@ -618,7 +618,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen pChild->KeyInput( aEvent ); } } - else if(aCommand.EqualsAscii("Copy")) + else if(aCommand == "Copy") { Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) ); if(pChild) @@ -627,7 +627,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen pChild->KeyInput( aEvent ); } } - else if(aCommand.EqualsAscii("Paste")) + else if(aCommand == "Paste") { Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) ); if(pChild) diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 44bcb19b52a6..c42f004e1be6 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -391,8 +391,8 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan): xFormCtrl->setContainer(xCtrlContnr); xFormCtrl->activateTabOrder(); - if(sTableErrorString.Len()) - sTableErrorString.Insert(sErrorPrefix, 0); + if(!sTableErrorString.isEmpty()) + sTableErrorString = sErrorPrefix + sTableErrorString; } //----------------------------------------------------------------------------- BibGeneralPage::~BibGeneralPage() @@ -432,7 +432,7 @@ void BibGeneralPage::CommitActiveControl() } //----------------------------------------------------------------------------- void BibGeneralPage::AddControlWithError( const OUString& rColumnName, const ::Point& rPos, const ::Size& rSize, - String& rErrorString, String aColumnUIName, const OString& sHelpId, sal_uInt16 nIndexInFTArray ) + OUString& rErrorString, OUString aColumnUIName, const OString& sHelpId, sal_uInt16 nIndexInFTArray ) { // adds also the XControl and creates a map entry in nFT2CtrlMap[] for mapping between control and FT @@ -447,15 +447,15 @@ void BibGeneralPage::AddControlWithError( const OUString& rColumnName, const ::P } else { - if( rErrorString.Len() ) - rErrorString += '\n'; + if( !rErrorString.isEmpty() ) + rErrorString += "\n"; rErrorString += MnemonicGenerator::EraseAllMnemonicChars( aColumnUIName ); } } //----------------------------------------------------------------------------- uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( - const String& rName, + const OUString& rName, ::Point rPos, ::Size rSize, const OString& sHelpId, sal_Int16& rIndex ) { uno::Reference< awt::XControlModel > xCtrModel; @@ -615,7 +615,7 @@ void BibGeneralPage::Resize() void BibGeneralPage::InitFixedTexts( void ) { - String aFixedStrings[ FIELD_COUNT ] = + OUString aFixedStrings[ FIELD_COUNT ] = { BIB_RESSTR( ST_IDENTIFIER ), BIB_RESSTR( ST_AUTHTYPE ), diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx index f9b97db7f5ef..a0c3ee1f3c33 100644 --- a/extensions/source/bibliography/general.hxx +++ b/extensions/source/bibliography/general.hxx @@ -102,11 +102,11 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage Size aStdSize; Point aBasePos; - String aBibTypeArr[ TYPE_COUNT ]; - String sErrorPrefix; - String sTableErrorString; + OUString aBibTypeArr[ TYPE_COUNT ]; + OUString sErrorPrefix; + OUString sTableErrorString; - String sTypeColumnName; + OUString sTypeColumnName; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > xCtrlContnr; @@ -124,11 +124,11 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage BibDataManager* pDatMan; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > - AddXControl( const String& rName, Point aPos, Size aSize, const OString& sHelpId, + AddXControl( const OUString& rName, Point aPos, Size aSize, const OString& sHelpId, sal_Int16& rIndex ); void AddControlWithError( const OUString& rColumnName, const Point& rPos, - const Size& rSize, String& rErrorString, String aColumnUIName, + const Size& rSize, OUString& rErrorString, OUString aColumnUIName, const OString& sHelpId, sal_uInt16 nIndexInFTArray ); void AdjustScrollbars(); @@ -143,7 +143,7 @@ public: BibGeneralPage(Window* pParent, BibDataManager* pDatMan); virtual ~BibGeneralPage(); - inline const String& GetErrorString() const; + inline const OUString& GetErrorString() const; inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >& GetTypeListBoxModel() const; @@ -167,7 +167,7 @@ public: }; -inline const String& BibGeneralPage::GetErrorString() const +inline const OUString& BibGeneralPage::GetErrorString() const { return sTableErrorString; } diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 0c3c90b1b6f9..9b5139c72ee0 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -107,7 +107,7 @@ void BibTBListBoxListener::statusChanged(const ::com::sun::star::frame::FeatureS OUString aEntry; for( sal_uInt32 i=0; i<nCount; i++ ) { - aEntry = String(pStringArray[i]); + aEntry = pStringArray[i]; pToolBar->InsertSourceEntry(aEntry); } pToolBar->UpdateSourceList(sal_True); @@ -144,7 +144,7 @@ void BibTBQueryMenuListener::statusChanged(const frame::FeatureStateEvent& rEvt) sal_uInt32 nCount = pStringSeq->getLength(); for( sal_uInt32 i=0; i<nCount; i++ ) { - sal_uInt16 nID=pToolBar->InsertFilterItem(String(pStringArray[i])); + sal_uInt16 nID = pToolBar->InsertFilterItem(pStringArray[i]); if(pStringArray[i]==rEvt.FeatureDescriptor) { pToolBar->SelectFilterItem(nID); @@ -173,7 +173,7 @@ void BibTBEditListener::statusChanged(const frame::FeatureStateEvent& rEvt)throw uno::Any aState=rEvt.State; if(aState.getValueType()==::getCppuType((const OUString*)0)) { - String aStr = String(*(OUString*) aState.getValue()); + OUString aStr = *(OUString*) aState.getValue(); pToolBar->SetQueryString(aStr); } } @@ -468,7 +468,7 @@ IMPL_LINK( BibToolBar, SendSelHdl, Timer*,/*pT*/) Sequence<PropertyValue> aPropVal(1); PropertyValue* pPropertyVal = (PropertyValue*)aPropVal.getConstArray(); pPropertyVal[0].Name = "DataSourceName"; - String aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource.GetSelectEntry() ) ); + OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource.GetSelectEntry() ) ); OUString aSelection = aEntry; pPropertyVal[0].Value <<= aSelection; SendDispatch(TBC_LB_SOURCE,aPropVal); |