diff options
author | Noel Grandin <noel@peralex.com> | 2013-08-28 14:37:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-08-29 09:30:18 +0200 |
commit | 35c24f9b6e08ef1328df01b2d3d11ef518897130 (patch) | |
tree | 17efd9777af84854e0f85cba759c92041875f4de /sfx2/source | |
parent | bdef90e108bdb557dcb207a15862453ec24645e1 (diff) |
convert chunk of sfx internal code from String to OUString
Change-Id: Ibf728d8a80d62cb3b2bfa985d4e685b9749f7ab8
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/explorer/nochaos.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inet/inettbc.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/menu/mnuitem.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/menu/mnumgr.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/menu/virtmenu.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/notify/eventsupplier.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/statbar/stbitem.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/frame.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/view/printer.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 46 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 12 |
14 files changed, 95 insertions, 95 deletions
diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index 82de6fc93941..baa7ec019ee0 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -193,7 +193,7 @@ CntStaticPoolDefaults_Impl::CntStaticPoolDefaults_Impl( CntItemPool* /*pPool*/ ) memset( m_ppDefaults, 0, sizeof( SfxPoolItem* ) * m_nItems ); memset( m_pItemInfos, 0, sizeof( SfxItemInfo ) * m_nItems ); Insert( - new SfxStringItem( WID_CHAOS_START, String() ), + new SfxStringItem( WID_CHAOS_START, OUString() ), 0, SFX_ITEM_POOLABLE ); } diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 3d96fb23c606..4c28036747ee 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -83,20 +83,20 @@ SvtURLBox* SfxURLToolBoxControl_Impl::GetURLBox() const void SfxURLToolBoxControl_Impl::OpenURL( const OUString& rName, sal_Bool /*bNew*/ ) const { - String aName; - String aFilter; - String aOptions; + OUString aName; + OUString aFilter; + OUString aOptions; INetURLObject aObj( rName ); if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) { - String aBaseURL = GetURLBox()->GetBaseURL(); + OUString aBaseURL = GetURLBox()->GetBaseURL(); aName = SvtURLBox::ParseSmart( rName, aBaseURL, SvtPathOptions().GetWorkPath() ); } else aName = rName; - if ( !aName.Len() ) + if ( aName.isEmpty() ) return; Reference< XDispatchProvider > xDispatchProvider( getFrameInterface(), UNO_QUERY ); @@ -117,7 +117,7 @@ void SfxURLToolBoxControl_Impl::OpenURL( const OUString& rName, sal_Bool /*bNew* aArgs[1].Name = OUString( "FileName" ); aArgs[1].Value = makeAny( OUString( aName )); - if ( aFilter.Len() ) + if ( !aFilter.isEmpty() ) { aArgs.realloc( 4 ); aArgs[2].Name = OUString("FilterOptions"); @@ -167,9 +167,9 @@ Window* SfxURLToolBoxControl_Impl::CreateItemWindow( Window* pParent ) IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, SelectHdl) { SvtURLBox* pURLBox = GetURLBox(); - String aName( pURLBox->GetURL() ); + OUString aName( pURLBox->GetURL() ); - if ( !pURLBox->IsTravelSelect() && aName.Len() ) + if ( !pURLBox->IsTravelSelect() && !aName.isEmpty() ) OpenURL( aName, sal_False ); return 1L; @@ -247,7 +247,7 @@ void SfxURLToolBoxControl_Impl::StateChanged } const SfxStringItem *pURL = PTR_CAST(SfxStringItem,pState); - String aRep( pURL->GetValue() ); + OUString aRep( pURL->GetValue() ); INetURLObject aURL( aRep ); INetProtocol eProt = aURL.GetProtocol(); if ( eProt == INET_PROT_FILE ) diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index bce9158f4475..5b3f08447c9b 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -210,18 +210,18 @@ void SfxMenuControl::StateChanged else if ( ( b_ShowStrings || bIsObjMenu ) && pState->ISA(SfxStringItem) ) { // Get MenuText from SfxStringItem - String aStr( ((const SfxStringItem*)pState)->GetValue() ); - if ( aStr.CompareToAscii("($1)",4) == COMPARE_EQUAL ) + OUString aStr( ((const SfxStringItem*)pState)->GetValue() ); + if ( aStr.startsWith("($1)") ) { - String aEntry(SfxResId(STR_UPDATEDOC).toString()); - aEntry += ' '; - aEntry += aStr.Copy(4); + OUString aEntry(SfxResId(STR_UPDATEDOC).toString()); + aEntry += " "; + aEntry += aStr.copy(4); aStr = aEntry; } - else if ( aStr.CompareToAscii("($2)",4) == COMPARE_EQUAL ) + else if ( aStr.startsWith("($2)") ) { - String aEntry(SfxResId(STR_CLOSEDOC_ANDRETURN).toString()); - aEntry += aStr.Copy(4); + OUString aEntry(SfxResId(STR_CLOSEDOC_ANDRETURN).toString()); + aEntry += aStr.copy(4); aStr = aEntry; } @@ -363,8 +363,8 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) } } - String aCmd( pActMenu->GetItemCommand( nItemId ) ); - if ( !bImageSet && aCmd.Len() ) + OUString aCmd( pActMenu->GetItemCommand( nItemId ) ); + if ( !bImageSet && !aCmd.isEmpty() ) { Image aImage = SvFileInformationManager::GetImage( INetURLObject(aCmd), sal_False ); @@ -413,9 +413,9 @@ SfxUnoMenuControl::~SfxUnoMenuControl() long Select_Impl( void* /*pHdl*/, void* pVoid ) { Menu* pMenu = (Menu*)pVoid; - String aURL( pMenu->GetItemCommand( pMenu->GetCurItemId() ) ); + OUString aURL( pMenu->GetItemCommand( pMenu->GetCurItemId() ) ); - if( !aURL.Len() ) + if( aURL.isEmpty() ) return 0; Reference < ::com::sun::star::frame::XDesktop2 > xDesktop = diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index 0a2f0ca5d963..23c917c9ebac 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -140,7 +140,7 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl ) osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp ); Graphic aGraphic; - const String aFilterName( IMP_PNG ); + const OUString aFilterName( IMP_PNG ); if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) ) { aRes = Image( aGraphic.GetBitmapEx() ); @@ -157,16 +157,16 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) PopupMenu* pThesSubMenu = 0; SfxPoolItem *pItem = 0; pBindings->QueryState( SID_THES, pItem ); - String aThesLookUpStr; + OUString aThesLookUpStr; SfxStringItem *pStrItem = dynamic_cast< SfxStringItem * >(pItem); - xub_StrLen nDelimPos = STRING_LEN; + sal_Int32 nDelimPos = STRING_LEN; if (pStrItem) { aThesLookUpStr = pStrItem->GetValue(); - nDelimPos = aThesLookUpStr.SearchBackward( '#' ); + nDelimPos = aThesLookUpStr.lastIndexOf( '#' ); } delete pItem; - if (aThesLookUpStr.Len() > 0 && nDelimPos != STRING_NOTFOUND) + if ( !aThesLookUpStr.isEmpty() && nDelimPos != -1 ) { // get synonym list for sub menu std::vector< OUString > aSynonyms; @@ -185,9 +185,9 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) SvtLinguConfig aCfg; Image aImage; - String sThesImplName( aHelper.GetThesImplName( aLocale ) ); + OUString sThesImplName( aHelper.GetThesImplName( aLocale ) ); OUString aSynonymsImageUrl( aCfg.GetSynonymsContextImage( sThesImplName ) ); - if (sThesImplName.Len() > 0 && !aSynonymsImageUrl.isEmpty()) + if (!sThesImplName.isEmpty() && !aSynonymsImageUrl.isEmpty()) aImage = Image( lcl_GetImageFromPngUrl( aSynonymsImageUrl ) ); for (sal_uInt16 i = 0; (size_t)i < nNumSynonyms; ++i) @@ -195,7 +195,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) //! item ids should start with values > 0, since 0 has special meaning const sal_uInt16 nId = i + 1; - String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) ); + OUString aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) ); pThesSubMenu->InsertItem( nId, aItemText ); OUString aCmd(".uno:ThesaurusFromContext?WordReplace:string=" ); aCmd += aItemText; @@ -230,8 +230,8 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) IMPL_LINK( SfxMenuManager, Select, Menu *, pSelMenu ) { sal_uInt16 nId = (sal_uInt16) pSelMenu->GetCurItemId(); - String aCommand = pSelMenu->GetItemCommand( nId ); - if ( !aCommand.Len() && pBindings ) + OUString aCommand = pSelMenu->GetItemCommand( nId ); + if ( aCommand.isEmpty() && pBindings ) { const SfxSlot* pSlot = SfxSlotPool::GetSlotPool( pBindings->GetDispatcher()->GetFrame() ).GetSlot( nId ); if ( pSlot && pSlot->pUnoName ) @@ -240,7 +240,7 @@ IMPL_LINK( SfxMenuManager, Select, Menu *, pSelMenu ) } } - if ( aCommand.Len() ) + if ( !aCommand.isEmpty() ) { pBindings->ExecuteCommand_Impl( aCommand ); } diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 164184a43c77..a706f6680b60 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -357,7 +357,7 @@ void SfxVirtualMenu::CreateFromSVMenu() DELETEZ( pPopup ); } - const String sItemText = pSVMenu->GetItemText(nSlotId); + const OUString sItemText = pSVMenu->GetItemText(nSlotId); if ( pPopup ) { @@ -410,8 +410,8 @@ void SfxVirtualMenu::CreateFromSVMenu() case MENUITEM_STRINGIMAGE: { SfxMenuControl *pMnuCtrl=0; - String aCmd( pSVMenu->GetItemCommand( nSlotId ) ); - if ( aCmd.Len() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) ) + OUString aCmd( pSVMenu->GetItemCommand( nSlotId ) ); + if ( !aCmd.isEmpty() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) ) { // try to create control via comand name pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, *pBindings, this ); diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index e567793584c2..1967c63ffcf9 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -398,7 +398,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const uno::Any& rElement, SfxObjectShe if ( aLibrary == "application" ) aLibrary = SFX_APP()->GetName(); else - aLibrary = OUString(); + aLibrary = ""; pMacro = new SvxMacro( aMacroName, aLibrary, eType ); } else if ( eType == EXTENDED_STYPE ) @@ -443,7 +443,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i { sal_Int32 nHashPos = aScript.indexOf( '/', 8 ); sal_Int32 nArgsPos = aScript.indexOf( '(' ); - if ( ( nHashPos != STRING_NOTFOUND ) && ( nHashPos < nArgsPos ) ) + if ( ( nHashPos != -1 ) && ( nHashPos < nArgsPos ) ) { OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET ) ); if ( aBasMgrName == "." ) @@ -463,7 +463,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i else if ( !aMacroName.isEmpty() ) { aScript = OUString( MACRO_PRFIX ); - if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarDesktop")) && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")) ) + if ( aLibrary != SFX_APP()->GetName() && aLibrary != "StarDesktop" && aLibrary != "application" ) aScript += OUString('.'); aScript += OUString('/'); @@ -474,12 +474,12 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i // wrong properties return; - if (!aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("document"))) + if (aLibrary != "document") { - if ( aLibrary.isEmpty() || (pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() )) ) - aLibrary = OUString("document"); + if ( aLibrary.isEmpty() || (pDoc && ( aLibrary == pDoc->GetTitle( SFX_TITLE_APINAME ) || aLibrary == pDoc->GetTitle() )) ) + aLibrary = "document"; else - aLibrary = OUString("application"); + aLibrary = "application"; } o_normalizedDescriptor.put( PROP_SCRIPT, aScript ); diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index f2d4a437b29c..ce0dd6f59099 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -353,8 +353,8 @@ void Deck::ShowPanel (const Panel& rPanel) const char* GetWindowClassification (const Window* pWindow) { - const String& rsName (pWindow->GetText()); - if (rsName.Len() > 0) + const OUString& rsName (pWindow->GetText()); + if (!rsName.isEmpty()) { return ::rtl::OUStringToOString(rsName, RTL_TEXTENCODING_ASCII_US).getStr(); } diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 0f0a05c1a53b..3b6e5580447d 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -453,7 +453,7 @@ void SfxStatusBarControl::StateChanged { DBG_ASSERT( eState != SFX_ITEM_AVAILABLE || pState->ISA(SfxVoidItem), "wrong SfxPoolItem subclass in SfxStatusBarControl" ); - pBar->SetItemText( nSID, String() ); + pBar->SetItemText( nSID, OUString() ); } } diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 674bc0f8d0de..e1999d506ed7 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -405,7 +405,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) GetParentFrame(); const SfxMedium *pMed = pDoc->GetMedium(); - GetDescriptor()->SetActualURL( String(pMed->GetOrigURL()) ); + GetDescriptor()->SetActualURL( pMed->GetOrigURL() ); SFX_ITEMSET_ARG( pMed->GetItemSet(), pItem, SfxBoolItem, SID_EDITDOC, sal_False ); sal_Bool bEditable = ( !pItem || pItem->GetValue() ); @@ -416,7 +416,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) SfxItemSet* pItemSet = pMed->GetItemSet(); const SfxFilter* pFilter = pMed->GetOrigFilter(); - String aFilter; + OUString aFilter; if ( pFilter ) aFilter = pFilter->GetFilterName(); @@ -432,7 +432,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) if ( pRefererItem ) pSet->Put( *pRefererItem ); else - pSet->Put( SfxStringItem( SID_REFERER, String() ) ); + pSet->Put( SfxStringItem( SID_REFERER, OUString() ) ); if ( pOptionsItem ) pSet->Put( *pOptionsItem ); @@ -467,11 +467,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const if ( !GetParentFrame() ) { // An empty string for 'No Target' - rList.push_back( String() ); - rList.push_back( String( "_top" ) ); - rList.push_back( String( "_parent" ) ); - rList.push_back( String( "_blank" ) ); - rList.push_back( String( "_self" ) ); + rList.push_back( OUString() ); + rList.push_back( OUString( "_top" ) ); + rList.push_back( OUString( "_parent" ) ); + rList.push_back( OUString( "_blank" ) ); + rList.push_back( OUString( "_self" ) ); } SfxViewFrame* pView = GetCurrentViewFrame(); diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index ddd0e75b8fe9..7127e9f34291 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -135,7 +135,7 @@ SfxPrinter::SfxPrinter( SfxItemSet* pTheOptions, Printer ( rPrinterName ), pOptions ( pTheOptions ), - bKnown ( String( GetName() ) == rPrinterName ) + bKnown ( GetName() == rPrinterName ) { pImpl = new SfxPrinter_Impl; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index a054ba4dfad4..b6b04da468dd 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -606,7 +606,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) SfxMedium *pMedium = xOldObj->GetMedium(); // Remove Frameset before the FramesetView may disappear - String aURL; + OUString aURL; if (pURLItem) aURL = pURLItem->GetValue(); else @@ -687,7 +687,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if ( pURLItem ) pNewSet->Put( SfxStringItem( SID_REFERER, pMedium->GetName() ) ); else - pNewSet->Put( SfxStringItem( SID_REFERER, String() ) ); + pNewSet->Put( SfxStringItem( SID_REFERER, OUString() ) ); xOldObj->CancelTransfers(); @@ -1000,7 +1000,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pShUndoMgr->GetUndoActionCount() ) { - String aTmp(SvtResId(STR_UNDO).toString()); + OUString aTmp(SvtResId(STR_UNDO).toString()); aTmp+= pShUndoMgr->GetUndoActionComment(0); rSet.Put( SfxStringItem( SID_UNDO, aTmp ) ); } @@ -1009,7 +1009,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pShUndoMgr->GetRedoActionCount() ) { - String aTmp(SvtResId(STR_REDO).toString()); + OUString aTmp(SvtResId(STR_REDO).toString()); aTmp += pShUndoMgr->GetRedoActionComment(0); rSet.Put( SfxStringItem( SID_REDO, aTmp ) ); } @@ -1019,7 +1019,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pTarget && pShUndoMgr->GetRepeatActionCount() && pShUndoMgr->CanRepeat(*pTarget) ) { - String aTmp(SvtResId(STR_REPEAT).toString()); + OUString aTmp(SvtResId(STR_REPEAT).toString()); aTmp += pShUndoMgr->GetRepeatActionComment(*pTarget); rSet.Put( SfxStringItem( SID_REPEAT, aTmp ) ); } @@ -2055,20 +2055,20 @@ void SfxViewFrame::SaveCurrentViewData_Impl( const sal_uInt16 i_nNewViewId ) // determine the logical (API) view name const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() ); const sal_uInt16 nCurViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); - const String sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName(); + const OUString sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName(); const sal_uInt16 nNewViewNo = rDocFactory.GetViewNo_Impl( i_nNewViewId, 0 ); - const String sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName(); - if ( ( sCurrentViewName.Len() == 0 ) || ( sNewViewName.Len() == 0 ) ) + const OUString sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName(); + if ( sCurrentViewName.isEmpty() || sNewViewName.isEmpty() ) { // can't say anything about the view, the respective application did not yet migrate its code to // named view factories => bail out OSL_FAIL( "SfxViewFrame::SaveCurrentViewData_Impl: views without API names? Shouldn't happen anymore?" ); return; } - OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" ); + OSL_ENSURE( sNewViewName != sCurrentViewName, "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" ); // save the view data only when we're moving from a non-print-preview to the print-preview view - if ( !sNewViewName.EqualsAscii( "PrintPreview" ) ) + if ( sNewViewName != "PrintPreview" ) return; // retrieve the view data from the view @@ -2491,7 +2491,7 @@ OUString SfxViewFrame::GetActualPresentationURL_Impl() const { if ( xObjSh.Is() ) return xObjSh->GetMedium()->GetName(); - return String(); + return OUString(); } void SfxViewFrame::SetModalMode( sal_Bool bModal ) @@ -2548,7 +2548,7 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sal_Bool nLine++; } - DBG_ASSERTWARNING( nStartPos != STRING_NOTFOUND, "CutLines: Start row not found!" ); + DBG_ASSERTWARNING( nStartPos != -1, "CutLines: Start row not found!" ); if ( nStartPos != -1 ) { @@ -2598,16 +2598,16 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) SfxRequest aReq( SID_BASICCHOOSER, SFX_CALLMODE_SYNCHRON, pSfxApp->GetPool() ); aReq.AppendItem( SfxBoolItem(SID_RECORDMACRO,sal_True) ); const SfxPoolItem* pRet = SFX_APP()->ExecuteSlot( aReq ); - String aScriptURL; + OUString aScriptURL; if ( pRet ) aScriptURL = ((SfxStringItem*)pRet)->GetValue(); - if ( aScriptURL.Len() ) + if ( !aScriptURL.isEmpty() ) { // parse scriptURL - String aLibName; - String aModuleName; - String aMacroName; - String aLocation; + OUString aLibName; + OUString aModuleName; + OUString aMacroName; + OUString aLocation; Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< com::sun::star::uri::XUriReferenceFactory > xFactory = com::sun::star::uri::UriReferenceFactory::create( xContext ); @@ -2631,12 +2631,12 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) } BasicManager* pBasMgr = 0; - if ( aLocation.EqualsIgnoreCaseAscii( "application" ) ) + if ( aLocation.equalsIgnoreAsciiCase( "application" ) ) { // application basic pBasMgr = pSfxApp->GetBasicManager(); } - else if ( aLocation.EqualsIgnoreCaseAscii( "document" ) ) + else if ( aLocation.equalsIgnoreAsciiCase( "document" ) ) { pBasMgr = GetObjectShell()->GetBasicManager(); } @@ -2663,11 +2663,11 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) // open lib container and break operation if it couldn't be opened com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer > xLibCont; - if ( aLocation.EqualsIgnoreCaseAscii( "application" ) ) + if ( aLocation.equalsIgnoreAsciiCase( "application" ) ) { xLibCont = SFX_APP()->GetBasicContainer(); } - else if ( aLocation.EqualsIgnoreCaseAscii( "document" ) ) + else if ( aLocation.equalsIgnoreAsciiCase( "document" ) ) { xLibCont = GetObjectShell()->GetBasicContainer(); } @@ -2757,7 +2757,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) SfxDispatcher* pDispat = pViewFrame ? pViewFrame->GetDispatcher() : NULL; if ( pDispat ) { - SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLibName, aModuleName, String(), String() ); + SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLibName, aModuleName, OUString(), OUString() ); pDispat->Execute( SID_BASICIDE_UPDATEMODULESOURCE, SFX_CALLMODE_SYNCHRON, &aInfoItem, 0L ); } } diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 0614a75ff72d..5c84445b7591 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -129,7 +129,7 @@ void SfxViewFrame::UpdateTitle() const SfxMedium *pMedium = pObjSh->GetMedium(); - String aURL; + OUString aURL; GetFrame(); // -Wall required?? if ( pObjSh->HasName() ) { @@ -142,10 +142,10 @@ void SfxViewFrame::UpdateTitle() pImp->aActualURL = aURL; // SbxObjects name - String aSbxName = pObjSh->SfxShell::GetName(); + OUString aSbxName = pObjSh->SfxShell::GetName(); if ( IsVisible() ) { - aSbxName += ':'; + aSbxName += ":"; aSbxName += OUString::number(pImp->nDocViewNo); } @@ -208,7 +208,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) case SID_NEWDOCDIRECT : { SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, sal_False); - String aFactName; + OUString aFactName; if ( pFactoryItem ) aFactName = pFactoryItem->GetValue(); else if ( !pImp->aFactoryName.isEmpty() ) @@ -220,7 +220,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) } SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() ); - String aFact = OUString("private:factory/"); + OUString aFact("private:factory/"); aFact += aFactName; aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) ); aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, &GetFrame() ) ); @@ -297,7 +297,7 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) { if ( !pImp->aFactoryName.isEmpty() ) { - String aFact = OUString("private:factory/"); + OUString aFact("private:factory/"); aFact += pImp->aFactoryName; rSet.Put( SfxStringItem( nWhich, aFact ) ); } diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index df4af58b932a..cd5758fe18f9 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -545,8 +545,8 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) } // For the MAC to have its "temporary of class String" in next if() - String aTempPrtName = pNewPrinter->GetName(); - String aDocPrtName = pDocPrinter->GetName(); + OUString aTempPrtName = pNewPrinter->GetName(); + OUString aDocPrtName = pDocPrinter->GetName(); // Was the printer selection changed from Default to Specific // or the other way around? @@ -632,8 +632,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro SfxPrinter* pDocPrt = GetPrinter(sal_False); JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup(); if( bIsDirect ) - aJobSetup.SetValue( String( "IsQuickJob" ), - String( "true" ) ); + aJobSetup.SetValue( OUString( "IsQuickJob" ), + OUString( "true" ) ); Printer::PrintJob( pController, aJobSetup ); } @@ -666,7 +666,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // no help button in dialogs if called from the help window // (pressing help button would exchange the current page inside the help // document that is going to be printed!) - String aHelpFilterName( "writer_web_HTML_help" ); + OUString aHelpFilterName( "writer_web_HTML_help" ); SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium(); const SfxFilter* pFilter = pMedium ? pMedium->GetFilter() : NULL; sal_Bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName ); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 273fcb55a60b..c31595ffe26c 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -527,11 +527,11 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) SFX_REQUEST_ARG(rReq, pMailRecipient, SfxStringItem, SID_MAIL_RECIPIENT, sal_False ); if ( pMailRecipient ) { - String aRecipient( pMailRecipient->GetValue() ); - String aMailToStr(OUString("mailto:")); + OUString aRecipient( pMailRecipient->GetValue() ); + OUString aMailToStr("mailto:"); - if ( aRecipient.Search( aMailToStr ) == 0 ) - aRecipient = aRecipient.Erase( 0, aMailToStr.Len() ); + if ( aRecipient.indexOf( aMailToStr ) == 0 ) + aRecipient = aRecipient.copy( aMailToStr.getLength() ); aModel.AddAddress( aRecipient, SfxMailModel::ROLE_TO ); } SFX_REQUEST_ARG(rReq, pMailDocType, SfxStringItem, SID_TYPE_NAME, sal_False ); @@ -1927,7 +1927,7 @@ void Change( Menu* pMenu, SfxViewShell* pView ) for ( sal_uInt16 nPos=0; nPos<nCount; ++nPos ) { sal_uInt16 nId = pMenu->GetItemId(nPos); - String aCmd = pMenu->GetItemCommand(nId); + OUString aCmd = pMenu->GetItemCommand(nId); PopupMenu* pPopup = pMenu->GetPopupMenu(nId); if ( pPopup ) { @@ -1935,7 +1935,7 @@ void Change( Menu* pMenu, SfxViewShell* pView ) } else if ( nId < 5000 ) { - if ( aCmd.CompareToAscii(".uno:", 5) == 0 ) + if ( aCmd.startsWith(".uno:") ) { for (sal_uInt16 nIdx=0;;) { |