From ff85b2c3d19136ea4d66f6555158e2a52da6e413 Mon Sep 17 00:00:00 2001 From: elixir Date: Mon, 1 Apr 2013 01:58:31 +0530 Subject: fdo#38838 : Replacement of String with OUString in core/chart2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7abf9649a0c5997cebfe3463ce9b633ab59bf3b0 Reviewed-on: https://gerrit.libreoffice.org/3142 Reviewed-by: Luboš Luňák Tested-by: Luboš Luňák --- chart2/source/controller/dialogs/DataBrowser.cxx | 32 +++++++++++----------- chart2/source/controller/dialogs/DataBrowser.hxx | 4 +-- chart2/source/controller/dialogs/res_ErrorBar.cxx | 16 +++++------ chart2/source/controller/dialogs/tp_DataSource.cxx | 30 ++++++++++---------- 4 files changed, 41 insertions(+), 41 deletions(-) (limited to 'chart2/source/controller') diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index a291c5506628..86df2bbe2c3f 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -160,7 +160,7 @@ public: void SetWidth( sal_Int32 nWidth ); void SetChartType( const Reference< chart2::XChartType > & xChartType, bool bSwapXAndYAxis ); - void SetSeriesName( const String & rName ); + void SetSeriesName( const OUString & rName ); void SetRange( sal_Int32 nStartCol, sal_Int32 nEndCol ); void SetPixelPosX( sal_Int32 nPos ); @@ -309,7 +309,7 @@ void SeriesHeader::SetChartType( m_spSymbol->SetImage( GetChartTypeImage( xChartType, bSwapXAndYAxis ) ); } -void SeriesHeader::SetSeriesName( const String & rName ) +void SeriesHeader::SetSeriesName( const OUString & rName ) { m_spSeriesName->SetText( rName ); } @@ -616,7 +616,7 @@ void DataBrowser::RenewTable() spHeader->SetColor( Color( nColor )); spHeader->SetChartType( aIt->m_xChartType, aIt->m_bSwapXAndYAxis ); spHeader->SetSeriesName( - String( DataSeriesHelper::getDataSeriesLabel( + OUString( DataSeriesHelper::getDataSeriesLabel( aIt->m_xDataSeries, (aIt->m_xChartType.is() ? aIt->m_xChartType->getRoleOfSequenceForSeriesLabel() : @@ -635,22 +635,22 @@ void DataBrowser::RenewTable() Invalidate(); } -String DataBrowser::GetColString( sal_Int32 nColumnId ) const +OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const { OSL_ASSERT( m_apDataBrowserModel.get()); if( nColumnId > 0 ) - return String( m_apDataBrowserModel->getRoleOfColumn( static_cast< sal_Int32 >( nColumnId ) - 1 )); - return String(); + return OUString( m_apDataBrowserModel->getRoleOfColumn( static_cast< sal_Int32 >( nColumnId ) - 1 )); + return OUString(); } -String DataBrowser::GetRowString( sal_Int32 nRow ) const +OUString DataBrowser::GetRowString( sal_Int32 nRow ) const { return OUString::valueOf(nRow + 1); } String DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const { - String aResult; + OUString aResult; if( nColumnId == 0 ) { @@ -800,9 +800,9 @@ bool DataBrowser::IsDataValid() { sal_uInt32 nDummy = 0; double fDummy = 0.0; - String aText( m_aNumberEditField.GetText()); + OUString aText( m_aNumberEditField.GetText()); - if( aText.Len() > 0 && + if( !aText.isEmpty() && m_spNumberFormatterWrapper.get() && m_spNumberFormatterWrapper->getSvNumberFormatter() && ! m_spNumberFormatterWrapper->getSvNumberFormatter()->IsNumberFormat( @@ -1082,9 +1082,9 @@ void DataBrowser::InitController( { if( rController == m_rTextEditController ) { - String aText( GetCellText( nRow, nCol ) ); + OUString aText( GetCellText( nRow, nCol ) ); m_aTextEditField.SetText( aText ); - m_aTextEditField.SetSelection( Selection( 0, aText.Len() )); + m_aTextEditField.SetSelection( Selection( 0, aText.getLength() )); } else if( rController == m_rNumberEditController ) { @@ -1094,8 +1094,8 @@ void DataBrowser::InitController( m_aNumberEditField.SetTextValue( String()); else m_aNumberEditField.SetValue( GetCellNumber( nRow, nCol ) ); - String aText( m_aNumberEditField.GetText()); - m_aNumberEditField.SetSelection( Selection( 0, aText.Len())); + OUString aText( m_aNumberEditField.GetText()); + m_aNumberEditField.SetSelection( Selection( 0, aText.getLength())); } else { @@ -1153,10 +1153,10 @@ sal_Bool DataBrowser::SaveModified() { sal_uInt32 nDummy = 0; double fDummy = 0.0; - String aText( m_aNumberEditField.GetText()); + OUString aText( m_aNumberEditField.GetText()); // an empty string is valid, if no numberformatter exists, all // values are treated as valid - if( aText.Len() > 0 && pSvNumberFormatter && + if( !aText.isEmpty() && pSvNumberFormatter && ! pSvNumberFormatter->IsNumberFormat( aText, nDummy, fDummy ) ) { bChangeValid = sal_False; diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx index f155ab311605..3d5a5b88a586 100644 --- a/chart2/source/controller/dialogs/DataBrowser.hxx +++ b/chart2/source/controller/dialogs/DataBrowser.hxx @@ -181,8 +181,8 @@ private: void RenewTable(); void ImplAdjustHeaderControls(); - String GetColString( sal_Int32 nColumnId ) const; - String GetRowString( sal_Int32 nRow ) const; + OUString GetColString( sal_Int32 nColumnId ) const; + OUString GetRowString( sal_Int32 nRow ) const; DECL_LINK( SeriesHeaderGotFocus, impl::SeriesHeaderEdit* ); DECL_LINK( SeriesHeaderChanged, impl::SeriesHeaderEdit* ); diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 31f945a8d985..713bb089ed83 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -268,7 +268,7 @@ void ErrorBarResources::UpdateControlStates() ( m_aRbFunction.IsChecked()) && ( m_aLbFunction.GetSelectEntryPos() == CHART_LB_FUNCTION_ERROR_MARGIN )); bool bIsPercentage( m_aRbPercent.IsChecked() || bIsErrorMargin ); - String aCustomUnit; + OUString aCustomUnit; if( bIsPercentage ) { @@ -602,7 +602,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) m_bRangePosUnique = ( aState != SFX_ITEM_DONTCARE ); if( aState == SFX_ITEM_SET ) { - String sRangePositive = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue(); + OUString sRangePositive = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue(); m_aEdRangePositive.SetText( sRangePositive ); } @@ -610,11 +610,11 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) m_bRangeNegUnique = ( aState != SFX_ITEM_DONTCARE ); if( aState == SFX_ITEM_SET ) { - String sRangeNegative = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue(); + OUString sRangeNegative = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue(); m_aEdRangeNegative.SetText( sRangeNegative ); if( m_eErrorKind == CHERROR_RANGE && - sRangeNegative.Len() > 0 && - sRangeNegative.Equals( m_aEdRangePositive.GetText())) + !sRangeNegative.isEmpty() && + sRangeNegative == m_aEdRangePositive.GetText() ) m_aCbSyncPosNeg.Check(); } @@ -632,13 +632,13 @@ sal_Bool ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const { if( m_eErrorKind == CHERROR_RANGE ) { - String aPosRange; - String aNegRange; + OUString aPosRange; + OUString aNegRange; if( m_bHasInternalDataProvider ) { // the strings aPosRange/aNegRange have to be set to a non-empty // arbitrary string to generate error-bar sequences - aPosRange.Assign( sal_Unicode('x')); + aPosRange = OUString("x"); aNegRange = aPosRange; } else diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 35fe3500c49a..9413046a7d15 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -60,17 +60,17 @@ namespace const OUString lcl_aLabelRole( "label" ); -String lcl_GetRoleLBEntry( +OUString lcl_GetRoleLBEntry( const OUString & rRole, const OUString & rRange ) { - String aEntry( rRole ); - aEntry += '\t'; - aEntry += String( - ::chart::DialogModel::ConvertRoleFromInternalToUI( rRole )); - aEntry += '\t'; - aEntry += String( rRange ); - - return aEntry; + OUStringBuffer aEntry( rRole ); + aEntry.append( "\t" ); + aEntry.append( OUString( + ::chart::DialogModel::ConvertRoleFromInternalToUI( rRole )) ); + aEntry.append( "\t" ); + aEntry.append(OUString( rRange )); + + return aEntry.makeStringAndClear(); } void lcl_UpdateCurrentRange( @@ -91,10 +91,10 @@ bool lcl_UpdateCurrentSeriesName( pEntry->m_xDataSeries.is() && pEntry->m_xChartType.is()) { - String aLabel( ::chart::DataSeriesHelper::getDataSeriesLabel( + OUString aLabel( ::chart::DataSeriesHelper::getDataSeriesLabel( pEntry->m_xDataSeries, pEntry->m_xChartType->getRoleOfSequenceForSeriesLabel())); - if( aLabel.Len()) + if( !aLabel.isEmpty()) { rOutListBox.SetEntryText( pEntry, aLabel ); bResult = true; @@ -469,8 +469,8 @@ void DataSourceTabPage::fillSeriesListBox() for( ::std::vector< DialogModel::tSeriesWithChartTypeByName >::const_iterator aIt = aSeries.begin(); aIt != aSeries.end(); ++aIt ) { - String aLabel( (*aIt).first ); - if( !aLabel.Len()) + OUString aLabel( (*aIt).first ); + if( aLabel.isEmpty()) { if( nUnnamedSeriesIndex > 1 ) { @@ -480,11 +480,11 @@ void DataSourceTabPage::fillSeriesListBox() const OUString aReplacementStr( "%NUMBER" ); sal_Int32 nIndex = aResString.indexOf( aReplacementStr ); if( nIndex != -1 ) - aLabel = String( aResString.replaceAt( + aLabel = OUString( aResString.replaceAt( nIndex, aReplacementStr.getLength(), OUString::valueOf(nUnnamedSeriesIndex))); } - if( aLabel.Len() == 0 ) + if( aLabel.isEmpty() ) aLabel = String( ::chart::SchResId( STR_DATA_UNNAMED_SERIES )); ++nUnnamedSeriesIndex; -- cgit