summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-07 13:22:22 +0200
committerNoel Grandin <noel@peralex.com>2013-10-08 10:03:12 +0200
commita81219450f4d94213b355c6812032b36c9037aa2 (patch)
treeab417ffafcb6ce74418bc3de8c948440e2d928a2 /sc
parente4c4280b276d38e111064bda00049d04c8fe6e39 (diff)
convert sc/source/ui/drawfunc/*.cxx from String to OUString
Change-Id: Ib8cb6018e30040ae8ad19acfa3f342e2c102652d
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx12
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx22
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx12
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx4
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx12
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx2
8 files changed, 31 insertions, 37 deletions
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index ee9305c8dc7a..9697dce6017e 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -334,7 +334,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
pItemSet->Put ( aItem, SID_ATTR_MACROITEM );
SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
- aNamesItem.AddEvent( ScResId(RID_SCSTR_ONCLICK), String(), SFX_EVENT_MOUSECLICK_OBJECT );
+ aNamesItem.AddEvent( ScResId(RID_SCSTR_ONCLICK), OUString(), SFX_EVENT_MOUSECLICK_OBJECT );
pItemSet->Put( aNamesItem, SID_EVENTCONFIG );
com::sun::star::uno::Reference < com::sun::star::frame::XFrame > xFrame;
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 02965d508550..e2c1d6c3d7b7 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -154,9 +154,9 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, sal_True, &pItem ) == SFX_ITEM_SET )
{
const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem;
- const String& rName = pHyper->GetName();
- const String& rURL = pHyper->GetURL();
- const String& rTarget = pHyper->GetTargetFrame();
+ const OUString& rName = pHyper->GetName();
+ const OUString& rURL = pHyper->GetURL();
+ const OUString& rTarget = pHyper->GetTargetFrame();
SvxLinkInsertMode eMode = pHyper->GetInsertMode();
sal_Bool bDone = false;
@@ -201,7 +201,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
aAny <<= aTmp;
xPropSet->setPropertyValue( sPropTargetURL, aAny );
- if( rTarget.Len() && xInfo->hasPropertyByName( sPropTargetFrame ) )
+ if( !rTarget.isEmpty() && xInfo->hasPropertyByName( sPropTargetFrame ) )
{
aAny <<= OUString(rTarget);
xPropSet->setPropertyValue( sPropTargetFrame, aAny );
@@ -526,9 +526,9 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
// ScUndoRenameObject can be used until there is a common action for all objects.
if(OBJ_OLE2 == nObjType)
{
- const String aPersistName = static_cast<SdrOle2Obj*>(pSelected)->GetPersistName();
+ const OUString aPersistName = static_cast<SdrOle2Obj*>(pSelected)->GetPersistName();
- if(aPersistName.Len())
+ if(!aPersistName.isEmpty())
{
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRenameObject(pDocSh, aPersistName, pSelected->GetName(), aName));
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index a734f21e0821..581aafc65a4e 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -230,7 +230,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
if ( pFontItem )
{
- String aFontName(pFontItem->GetValue());
+ OUString aFontName(pFontItem->GetValue());
Font aFont(aFontName, Size(1,1)); // Size nur wg. CTOR
aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetName(),
aFont.GetStyleName(), aFont.GetPitch(),
@@ -262,9 +262,9 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, sal_True, &pItem ) == SFX_ITEM_SET )
{
const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem;
- const String& rName = pHyper->GetName();
- const String& rURL = pHyper->GetURL();
- const String& rTarget = pHyper->GetTargetFrame();
+ const OUString& rName = pHyper->GetName();
+ const OUString& rURL = pHyper->GetURL();
+ const OUString& rTarget = pHyper->GetTargetFrame();
SvxLinkInsertMode eMode = pHyper->GetInsertMode();
sal_Bool bDone = false;
@@ -344,11 +344,11 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_THES:
{
- String aReplaceText;
+ OUString aReplaceText;
SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, false );
if (pItem2)
aReplaceText = pItem2->GetValue();
- if (aReplaceText.Len() > 0)
+ if (!aReplaceText.isEmpty())
ReplaceTextWithSynonym( pOutView->GetEditView(), aReplaceText );
}
break;
@@ -403,8 +403,8 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if (!bField)
{
// use selected text as name for urls
- String sReturn = pOutView->GetSelected();
- sReturn.Erase(255);
+ OUString sReturn = pOutView->GetSelected();
+ sReturn = sReturn.copy(0, 255);
aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
}
}
@@ -635,16 +635,16 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
{
if (bUpdate)
pOutliner->SetUpdateMode( false );
- String aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
+ OUString aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
pOutliner->GetUndoManager().EnterListAction( aName, aName );
bChanged = sal_True;
}
- String aFieldText = rEditEng.GetText( aFieldSel );
+ OUString aFieldText = rEditEng.GetText( aFieldSel );
pOutliner->QuickInsertText( aFieldText, aFieldSel );
if ( nPar == aSel.nEndPara )
{
- nNewEnd = sal::static_int_cast<xub_StrLen>( nNewEnd + aFieldText.Len() );
+ nNewEnd = sal::static_int_cast<xub_StrLen>( nNewEnd + aFieldText.getLength() );
--nNewEnd;
}
}
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index b30af3caf23e..2ffa3abc22e6 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -94,7 +94,7 @@ void SC_DLLPUBLIC ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& r
//------------------------------------------------------------------------
static void lcl_InsertGraphic( const Graphic& rGraphic,
- const String& rFileName, const String& rFilterName, sal_Bool bAsLink, sal_Bool bApi,
+ const OUString& rFileName, const OUString& rFilterName, sal_Bool bAsLink, sal_Bool bApi,
ScTabViewShell* pViewSh, Window* pWindow, SdrView* pView )
{
// set the size so the graphic has its original pixel size
@@ -135,7 +135,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
// Path is no longer used as name for the graphics object
ScDrawLayer* pLayer = (ScDrawLayer*) pView->GetModel();
- String aName = pLayer->GetNewGraphicName(); // "Graphics"
+ OUString aName = pLayer->GetNewGraphicName(); // "Graphics"
pObj->SetName(aName);
// don't select if from (dispatch) API, to allow subsequent cell operations
@@ -214,9 +214,9 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
if ( pReqArgs &&
pReqArgs->GetItemState( SID_INSERT_GRAPHIC, sal_True, &pItem ) == SFX_ITEM_SET )
{
- String aFileName = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aFileName = ((const SfxStringItem*)pItem)->GetValue();
- String aFilterName;
+ OUString aFilterName;
if ( pReqArgs->GetItemState( FN_PARAM_FILTER, sal_True, &pItem ) == SFX_ITEM_SET )
aFilterName = ((const SfxStringItem*)pItem)->GetValue();
@@ -241,8 +241,8 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
int nError = aDlg.GetGraphic(aGraphic);
if( nError == GRFILTER_OK )
{
- String aFileName = aDlg.GetPath();
- String aFilterName = aDlg.GetCurrentFilter();
+ OUString aFileName = aDlg.GetPath();
+ OUString aFilterName = aDlg.GetCurrentFilter();
sal_Bool bAsLink = aDlg.IsAsLink();
// really store as link only?
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 5a127d5b412d..946be4767fd7 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -164,7 +164,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
else
{
- String sURL, sTarget;
+ OUString sURL, sTarget;
if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER))
{
// Support for imported Excel docs
@@ -253,7 +253,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
// open hyperlink, if found at object or in object's text
- if ( sURL.Len() > 0 )
+ if ( !sURL.isEmpty() )
{
ScGlobal::OpenURL( sURL, sTarget );
pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 0a42f79106a1..b1b95a85c1ac 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -85,7 +85,7 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
if(pCalcUndo)
{
- const String aUndoStr = ScGlobal::GetRscString( STR_UNDO_EDITNOTE );
+ const OUString aUndoStr = ScGlobal::GetRscString( STR_UNDO_EDITNOTE );
pUndoMgr->EnterListAction( aUndoStr, aUndoStr );
/* Note has been created before editing, if first undo action is
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 6276575cd712..fc270c7a2609 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -55,9 +55,7 @@ public:
if( pPageView )
{
SdrGrafObj* pNewObj = (SdrGrafObj*) m_pObj->Clone();
- String aStr( m_pView->GetDescriptionOfMarkedObjects() );
- aStr.Append( sal_Unicode(' ') );
- aStr.Append( String( "External Edit" ) );
+ OUString aStr = m_pView->GetDescriptionOfMarkedObjects() + " External Edit";
m_pView->BegUndo( aStr );
pNewObj->SetGraphicObject( aGraphic );
m_pView->ReplaceObjectAtView( m_pObj, *pPageView, pNewObj );
@@ -145,10 +143,7 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
if( pPageView )
{
SdrGrafObj* pFilteredObj = (SdrGrafObj*) pObj->Clone();
- String aStr( pView->GetDescriptionOfMarkedObjects() );
-
- aStr.Append( sal_Unicode(' ') );
- aStr.Append( String( ScResId( SCSTR_UNDO_GRAFFILTER ) ) );
+ OUString aStr = pView->GetDescriptionOfMarkedObjects() + " " + OUString(ScResId( SCSTR_UNDO_GRAFFILTER ));
pView->BegUndo( aStr );
pFilteredObj->SetGraphicObject( aFilterObj );
pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
@@ -232,8 +227,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
{
SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
SdrPageView* pPageView = pView->GetSdrPageView();
- String aUndoString( pView->GetDescriptionOfMarkedObjects() );
- aUndoString += String( " Compress" );
+ OUString aUndoString = pView->GetDescriptionOfMarkedObjects() + " Compress";
pView->BegUndo( aUndoString );
pView->ReplaceObjectAtView( pObj, *pPageView, pNewObject );
pView->EndUndo();
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 9537f376876d..5e03dbd4e760 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -48,7 +48,7 @@ ScMediaShell::ScMediaShell(ScViewData* pData) :
ScDrawShell(pData)
{
SetHelpId(HID_SCSHELL_MEDIA);
- SetName( String( ScResId( SCSTR_MEDIASHELL ) ) );
+ SetName( OUString( ScResId( SCSTR_MEDIASHELL ) ) );
SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Media));
}