[Libreoffice-commits] .: sc/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Thu Aug 16 01:36:37 PDT 2012
sc/source/ui/dbgui/pfiltdlg.cxx | 22 ++++++++-------
sc/source/ui/dbgui/tpsort.cxx | 58 +++++++++++++++++++++-------------------
sc/source/ui/dbgui/tpsubt.cxx | 16 ++++++-----
sc/source/ui/inc/tpsort.hxx | 14 ++++-----
sc/source/ui/inc/tpsubt.hxx | 4 +-
5 files changed, 61 insertions(+), 53 deletions(-)
New commits:
commit 2ba8fe1e28fef76b1efea5f401360b38f720dbcf
Author: Bence Babati <b.baabsi at gmail.com>
Date: Wed Aug 15 10:46:08 2012 +0200
String to OUString
Change-Id: I424a3e91cd6163907e364c7d6f40e19d8bf12b48
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index a661795..b23df01 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -162,7 +162,7 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
if ( pViewData && pDoc )
{
- String theAreaStr;
+ rtl::OUString theAreaStr;
ScRange theCurArea ( ScAddress( theQueryData.nCol1,
theQueryData.nRow1,
nSrcTab ),
@@ -290,7 +290,7 @@ void ScPivotFilterDlg::FillFieldLists()
if ( pDoc )
{
- String aFieldName;
+ rtl::OUString aFieldName;
SCTAB nTab = nSrcTab;
SCCOL nFirstCol = theQueryData.nCol1;
SCROW nFirstRow = theQueryData.nRow1;
@@ -301,11 +301,13 @@ void ScPivotFilterDlg::FillFieldLists()
for ( col=nFirstCol; col<=nMaxCol; col++ )
{
pDoc->GetString( col, nFirstRow, nTab, aFieldName );
- if ( aFieldName.Len() == 0 )
+ if ( aFieldName.isEmpty() )
{
- aFieldName = aStrColumn;
- aFieldName += ' ';
- aFieldName += ScColToAlpha( col );
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(aStrColumn);
+ aBuf.append(sal_Unicode(' '));
+ aBuf.append(ScColToAlpha(col));
+ aFieldName = aBuf.makeStringAndClear();
}
aLbField1.InsertEntry( aFieldName, i );
aLbField2.InsertEntry( aFieldName, i );
@@ -325,7 +327,7 @@ void ScPivotFilterDlg::UpdateValueList( sal_uInt16 nList )
ComboBox* pValList = aValueEdArr[nList-1];
sal_uInt16 nFieldSelPos = aFieldLbArr[nList-1]->GetSelectEntryPos();
sal_uInt16 nListPos = 0;
- String aCurValue = pValList->GetText();
+ rtl::OUString aCurValue = pValList->GetText();
pValList->Clear();
pValList->InsertEntry( aStrNotEmpty, 0 );
@@ -565,9 +567,9 @@ IMPL_LINK( ScPivotFilterDlg, CheckBoxHdl, CheckBox*, pBox )
for (sal_uInt16 i=0; i<=MAXCOL; i++)
DELETEZ( pEntryLists[i] );
- String aCurVal1 = aEdVal1.GetText();
- String aCurVal2 = aEdVal2.GetText();
- String aCurVal3 = aEdVal3.GetText();
+ rtl::OUString aCurVal1 = aEdVal1.GetText();
+ rtl::OUString aCurVal2 = aEdVal2.GetText();
+ rtl::OUString aCurVal3 = aEdVal3.GetText();
UpdateValueList( 1 );
UpdateValueList( 2 );
UpdateValueList( 3 );
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 41c6e9f..9c235c6 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -91,9 +91,9 @@ ScTabPageSortFields::ScTabPageSortFields( Window* pParent,
ScResId( RID_SCPAGE_SORT_FIELDS ),
rArgSet ),
//
- aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
- aStrColumn ( ScResId( SCSTR_COLUMN ) ),
- aStrRow ( ScResId( SCSTR_ROW ) ),
+ aStrUndefined ( SC_RESSTR( SCSTR_UNDEFINED ) ),
+ aStrColumn ( SC_RESSTR( SCSTR_COLUMN ) ),
+ aStrRow ( SC_RESSTR( SCSTR_ROW ) ),
//
nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ),
pDlg ( (ScSortDlg*)(GetParent()->GetParent()) ),
@@ -350,18 +350,20 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
if ( bSortByRows )
{
- String aFieldName;
+ rtl::OUString aFieldName;
SCCOL nMaxCol = aSortData.nCol2;
SCCOL col;
for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
{
pDoc->GetString( col, nFirstSortRow, nTab, aFieldName );
- if ( !bHasHeader || (aFieldName.Len() == 0) )
+ if ( !bHasHeader || aFieldName.isEmpty() )
{
- aFieldName = aStrColumn;
- aFieldName += ' ';
- aFieldName += ScColToAlpha( col );
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(aStrColumn);
+ aBuf.append(sal_Unicode(' '));
+ aBuf.append(ScColToAlpha(col));
+ aFieldName = aBuf.makeStringAndClear();
}
nFieldArr.push_back( col );
@@ -373,18 +375,20 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
}
else
{
- String aFieldName;
+ rtl::OUString aFieldName;
SCROW nMaxRow = aSortData.nRow2;
SCROW row;
for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS; row++ )
{
pDoc->GetString( nFirstSortCol, row, nTab, aFieldName );
- if ( !bHasHeader || (aFieldName.Len() == 0) )
+ if ( !bHasHeader || aFieldName.isEmpty() )
{
- aFieldName = aStrRow;
- aFieldName += ' ';
- aFieldName += String::CreateFromInt32( row+1 );
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(aStrRow);
+ aBuf.append(sal_Unicode(' '));
+ aBuf.append(row+1);
+ aFieldName = aBuf.makeStringAndClear();
}
nFieldArr.push_back( row );
@@ -424,7 +428,7 @@ sal_uInt16 ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField )
IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
{
- String aSelEntry = pLb->GetSelectEntry();
+ rtl::OUString aSelEntry = pLb->GetSelectEntry();
ScSortKeyItems::iterator pIter;
sal_uInt16 nSortKeyIndex = nSortKeyCount;
@@ -506,9 +510,9 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent,
aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ),
aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ),
//
- aStrRowLabel ( ScResId( STR_ROW_LABEL ) ),
- aStrColLabel ( ScResId( STR_COL_LABEL ) ),
- aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
+ aStrRowLabel ( SC_RESSTR( STR_ROW_LABEL ) ),
+ aStrColLabel ( SC_RESSTR( STR_COL_LABEL ) ),
+ aStrUndefined ( SC_RESSTR( SCSTR_UNDEFINED ) ),
//
nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ),
aSortData ( ((const ScSortItem&)
@@ -538,7 +542,7 @@ ScTabPageSortOptions::~ScTabPageSortOptions()
sal_uInt16 nEntries = aLbOutPos.GetEntryCount();
for ( sal_uInt16 i=1; i<nEntries; i++ )
- delete (String*)aLbOutPos.GetEntryData( i );
+ delete (rtl::OUString*)aLbOutPos.GetEntryData( i );
delete pColRes;
delete pColWrap; //! not if from document
@@ -574,9 +578,9 @@ void ScTabPageSortOptions::Init()
{
String theArea;
ScDBCollection* pDBColl = pDoc->GetDBCollection();
- String theDbArea;
+ rtl::OUString theDbArea;
const SCTAB nCurTab = pViewData->GetTabNo();
- String theDbName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME));
+ rtl::OUString theDbName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME));
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
aLbOutPos.Clear();
@@ -584,15 +588,15 @@ void ScTabPageSortOptions::Init()
aLbOutPos.Disable();
ScAreaNameIterator aIter( pDoc );
- String aName;
+ rtl::OUString aName;
ScRange aRange;
- String aRefStr;
+ rtl::OUString aRefStr;
while ( aIter.Next( aName, aRange ) )
{
sal_uInt16 nInsert = aLbOutPos.InsertEntry( aName );
aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv );
- aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) );
+ aLbOutPos.SetEntryData( nInsert, new rtl::OUString( aRefStr ) );
}
aLbOutPos.SelectEntryPos( 0 );
@@ -685,7 +689,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
if ( pDoc && !aSortData.bInplace )
{
- String aStr;
+ rtl::OUString aStr;
sal_uInt16 nFormat = (aSortData.nDestTab != pViewData->GetTabNo())
? SCR_ABS_3D
: SCR_ABS;
@@ -745,7 +749,7 @@ sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
aNewSortData.aCollatorLocale = MsLangId::convertLanguageToLocale( eLang, false );
// get algorithm
- String sAlg;
+ rtl::OUString sAlg;
if ( eLang != LANGUAGE_SYSTEM )
{
uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms(
@@ -893,7 +897,7 @@ IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb )
{
if ( pLb == &aLbOutPos )
{
- String aString;
+ rtl::OUString aString;
sal_uInt16 nSelPos = aLbOutPos.GetSelectEntryPos();
if ( nSelPos > 0 )
@@ -925,7 +929,7 @@ void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd )
{
if ( pEd == &aEdOutPos )
{
- String theCurPosStr = aEdOutPos.GetText();
+ String theCurPosStr = aEdOutPos.GetText();
sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() );
if ( SCA_VALID == (nResult & SCA_VALID) )
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index c2bc52f..510f348 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -55,8 +55,8 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
aLbColumns ( this, ScResId( WND_COLUMNS ) ),
aFtFunctions ( this, ScResId( FT_FUNCTIONS ) ),
aLbFunctions ( this, ScResId( LB_FUNCTIONS ) ),
- aStrNone ( ScResId( SCSTR_NONE ) ),
- aStrColumn ( ScResId( SCSTR_COLUMN ) ),
+ aStrNone ( SC_RESSTR( SCSTR_NONE ) ),
+ aStrColumn ( SC_RESSTR( SCSTR_COLUMN ) ),
pViewData ( NULL ),
pDoc ( NULL ),
nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
@@ -276,7 +276,7 @@ void ScTpSubTotalGroup::FillListBoxes()
SCCOL nMaxCol = rSubTotalData.nCol2;
SCCOL col;
sal_uInt16 i=0;
- String aFieldName;
+ rtl::OUString aFieldName;
aLbGroup.Clear();
aLbColumns.Clear();
@@ -286,11 +286,13 @@ void ScTpSubTotalGroup::FillListBoxes()
for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
{
pDoc->GetString( col, nFirstRow, nTab, aFieldName );
- if ( aFieldName.Len() == 0 )
+ if ( aFieldName.isEmpty() )
{
- aFieldName = aStrColumn;
- aFieldName += ' ';
- aFieldName += ::ScColToAlpha( col ); // from global.hxx
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(aStrColumn);
+ aBuf.append(sal_Unicode(' '));
+ aBuf.append(ScColToAlpha(col));
+ aFieldName = aBuf.makeStringAndClear();
}
nFieldArr[i] = col;
aLbGroup.InsertEntry( aFieldName, i+1 );
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 75315e7..3ba9c52 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -77,9 +77,9 @@ protected:
virtual int DeactivatePage ( SfxItemSet* pSet = 0);
private:
- String aStrUndefined;
- String aStrColumn;
- String aStrRow;
+ rtl::OUString aStrUndefined;
+ rtl::OUString aStrColumn;
+ rtl::OUString aStrRow;
const sal_uInt16 nWhichSort;
ScSortDlg* pDlg;
@@ -161,10 +161,10 @@ private:
RadioButton aBtnTopDown;
RadioButton aBtnLeftRight;
- String aStrRowLabel;
- String aStrColLabel;
- String aStrUndefined;
- String aStrAreaLabel;
+ rtl::OUString aStrRowLabel;
+ rtl::OUString aStrColLabel;
+ rtl::OUString aStrUndefined;
+ rtl::OUString aStrAreaLabel;
const sal_uInt16 nWhichSort;
ScSortParam aSortData;
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index d3f987e..0e937b4 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -66,8 +66,8 @@ protected:
SvxCheckListBox aLbColumns;
FixedText aFtFunctions;
ListBox aLbFunctions;
- const String aStrNone;
- const String aStrColumn;
+ const rtl::OUString aStrNone;
+ const rtl::OUString aStrColumn;
ScViewData* pViewData;
ScDocument* pDoc;
More information about the Libreoffice-commits
mailing list