From 610b2b94b33b0fc2d79cd515f9e293ca1c2610e8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 15 Nov 2013 11:05:19 +0200 Subject: remove unnecessary use of OUString constructor when assigning change code like aStr = OUString("xxxx"); to aStr = "xxxx"; Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4 --- sw/source/ui/ribbar/workctrl.cxx | 10 ++++------ sw/source/ui/uiview/view.cxx | 24 ++++++++++++------------ sw/source/ui/uno/unodoc.cxx | 6 +++--- sw/source/ui/utlui/viewlayoutctrl.cxx | 2 +- sw/source/ui/vba/vbacheckbox.cxx | 2 +- 5 files changed, 21 insertions(+), 23 deletions(-) (limited to 'sw/source/ui') diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index 948d5c776a36..5dd71951ecb7 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -77,8 +77,7 @@ SwTbxInsertCtrl::~SwTbxInsertCtrl() void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException) { ToolBox& rTbx = GetToolBox(); - OUString aSlotURL( "slot:" ); - aSlotURL += OUString::number( nLastSlotId); + OUString aSlotURL = "slot:" + OUString::number( nLastSlotId); Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() ); rTbx.SetItemImage(GetId(), aImage); @@ -103,8 +102,7 @@ void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/, if( nLastSlotId ) nId = nLastSlotId; - OUString aSlotURL( "slot:" ); - aSlotURL += OUString::number( nId); + OUString aSlotURL = "slot:" + OUString::number( nId); ToolBox& rBox = GetToolBox(); Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() ); rBox.SetItemImage(GetId(), aImage); @@ -564,7 +562,7 @@ IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet) SfxBoolItem aNext(FN_SCROLL_NEXT_PREV, NID_NEXT == nSet); Any a; Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = OUString( "ScrollNextPrev" ); + aArgs[0].Name = "ScrollNextPrev"; aNext.QueryValue( a ); aArgs[0].Value = a; SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ), @@ -739,7 +737,7 @@ void SwZoomBox_Impl::Select() { Any a; Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = OUString( "PreviewZoom" ); + aArgs[0].Name = "PreviewZoom"; aItem.QueryValue( a ); aArgs[0].Value = a; SfxToolBoxControl::Dispatch( diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index c7930b8c1291..701ea542c54b 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1477,56 +1477,56 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe beans::PropertyValue *pValue = rSequence.getArray(); sal_uInt16 nViewID( GetViewFrame()->GetCurViewId()); - pValue->Name = OUString( "ViewId" ); + pValue->Name = "ViewId"; OUStringBuffer sBuffer ( OUString( "view" ) ); ::sax::Converter::convertNumber(sBuffer, static_cast(nViewID)); pValue->Value <<= sBuffer.makeStringAndClear(); pValue++;nIndex++; - pValue->Name = OUString( "ViewLeft" ); + pValue->Name = "ViewLeft"; pValue->Value <<= TWIP_TO_MM100 ( rRect.Left() ); pValue++;nIndex++; - pValue->Name = OUString( "ViewTop" ); + pValue->Name = "ViewTop"; pValue->Value <<= TWIP_TO_MM100 ( rRect.Top() ); pValue++;nIndex++; - pValue->Name = OUString( "VisibleLeft" ); + pValue->Name = "VisibleLeft"; pValue->Value <<= TWIP_TO_MM100 ( rVis.Left() ); pValue++;nIndex++; - pValue->Name = OUString( "VisibleTop" ); + pValue->Name = "VisibleTop"; pValue->Value <<= TWIP_TO_MM100 ( rVis.Top() ); pValue++;nIndex++; - pValue->Name = OUString( "VisibleRight" ); + pValue->Name = "VisibleRight"; pValue->Value <<= TWIP_TO_MM100 ( bBrowse ? LONG_MIN : rVis.Right() ); pValue++;nIndex++; - pValue->Name = OUString( "VisibleBottom" ); + pValue->Name = "VisibleBottom"; pValue->Value <<= TWIP_TO_MM100 ( bBrowse ? LONG_MIN : rVis.Bottom() ); pValue++;nIndex++; - pValue->Name = OUString( "ZoomType" ); + pValue->Name = "ZoomType"; const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType()); pValue->Value <<= nZoomType; pValue++;nIndex++; - pValue->Name = OUString( "ViewLayoutColumns" ); + pValue->Name = "ViewLayoutColumns"; const sal_Int16 nViewLayoutColumns = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetViewLayoutColumns()); pValue->Value <<= nViewLayoutColumns; pValue++;nIndex++; - pValue->Name = OUString( "ViewLayoutBookMode" ); + pValue->Name = "ViewLayoutBookMode"; const sal_Bool bIsViewLayoutBookMode = m_pWrtShell->GetViewOptions()->IsViewLayoutBookMode(); pValue->Value.setValue( &bIsViewLayoutBookMode, ::getBooleanCppuType() ); pValue++;nIndex++; - pValue->Name = OUString( "ZoomFactor" ); + pValue->Name = "ZoomFactor"; pValue->Value <<= static_cast < sal_Int16 > (m_pWrtShell->GetViewOptions()->GetZoom()); pValue++;nIndex++; - pValue->Name = OUString( "IsSelectedFrame" ); + pValue->Name = "IsSelectedFrame"; const sal_Bool bIsSelected = FRMTYPE_NONE == m_pWrtShell->GetSelFrmType() ? sal_False : sal_True; pValue->Value.setValue ( &bIsSelected, ::getBooleanCppuType() ); nIndex++; diff --git a/sw/source/ui/uno/unodoc.cxx b/sw/source/ui/uno/unodoc.cxx index a190eff2f41f..60f31baaa639 100644 --- a/sw/source/ui/uno/unodoc.cxx +++ b/sw/source/ui/uno/unodoc.cxx @@ -37,7 +37,7 @@ uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() thr // resolved by rtti! uno::Sequence< OUString > aRet ( 1 ); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( "com.sun.star.text.TextDocument" ); + pArray[0] = "com.sun.star.text.TextDocument"; return aRet; } @@ -66,7 +66,7 @@ uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() thro // resolved by rtti! uno::Sequence< OUString > aRet ( 1 ); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( "com.sun.star.text.WebDocument" ); + pArray[0] = "com.sun.star.text.WebDocument"; return aRet; } @@ -93,7 +93,7 @@ uno::Sequence< OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() t { uno::Sequence< OUString > aRet ( 1 ); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( "com.sun.star.text.GlobalDocument" ); + pArray[0] = "com.sun.star.text.GlobalDocument"; return aRet; } diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx index 87bd107c4e59..01a8985c6961 100644 --- a/sw/source/ui/utlui/viewlayoutctrl.cxx +++ b/sw/source/ui/utlui/viewlayoutctrl.cxx @@ -155,7 +155,7 @@ sal_Bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt ) aViewLayout.QueryValue( a ); ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); - aArgs[0].Name = OUString( "ViewLayout" ); + aArgs[0].Name = "ViewLayout"; aArgs[0].Value = a; execute( aArgs ); diff --git a/sw/source/ui/vba/vbacheckbox.cxx b/sw/source/ui/vba/vbacheckbox.cxx index f5d6e9c9ee29..90e6ba981572 100644 --- a/sw/source/ui/vba/vbacheckbox.cxx +++ b/sw/source/ui/vba/vbacheckbox.cxx @@ -79,7 +79,7 @@ SwVbaCheckBox::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = OUString( "ooo.vba.word.CheckBox" ); + aServiceNames[ 0 ] = "ooo.vba.word.CheckBox"; } return aServiceNames; } -- cgit v1.2.3