convert sw/source/core/unocore/*.cxx from String to OUString

Change-Id: I4af097f36d47452dc992f8965f74dd707c2c08a9
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index a25cf93..91345de 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -82,9 +82,9 @@ sal_Bool UCB_CopyFile( const OUString& rURL, const OUString& rNewURL, sal_Bool b
    try
    {
        INetURLObject aURL( rNewURL );
        String sName( aURL.GetName() );
        OUString sName( aURL.GetName() );
        aURL.removeSegment();
        String sMainURL( aURL.GetMainURL(INetURLObject::NO_DECODE) );
        OUString sMainURL( aURL.GetMainURL(INetURLObject::NO_DECODE) );

        ucbhelper::Content aTempContent( sMainURL,
                                ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 8805a0e..0a2b827 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -55,14 +55,14 @@ using namespace ::com::sun::star;

// from unotbl.cxx
extern void sw_GetCellPosition( const OUString &rCellName, sal_Int32 &rColumn, sal_Int32 &rRow);
extern String sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow );
extern int sw_CompareCellsByColFirst( const String &rCellName1, const String &rCellName2 );
extern int sw_CompareCellsByRowFirst( const String &rCellName1, const String &rCellName2 );
extern OUString sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow );
extern int sw_CompareCellsByColFirst( const OUString &rCellName1, const OUString &rCellName2 );
extern int sw_CompareCellsByRowFirst( const OUString &rCellName1, const OUString &rCellName2 );
extern int sw_CompareCellRanges(
        const String &rRange1StartCell, const String &rRange1EndCell,
        const String &rRange2StartCell, const String &rRange2EndCell,
        const OUString &rRange1StartCell, const OUString &rRange1EndCell,
        const OUString &rRange2StartCell, const OUString &rRange2EndCell,
        sal_Bool bCmpColsFirst );
extern void sw_NormalizeRange( String &rCell1, String &rCell2 );
extern void sw_NormalizeRange( OUString &rCell1, OUString &rCell2 );

//static
void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc )
@@ -210,10 +210,10 @@ bool FillRangeDescriptor(
        const OUString &rCellRangeName )
{
    xub_StrLen nToken = -1 == rCellRangeName.indexOf('.') ? 0 : 1;
    String aCellRangeNoTableName( rCellRangeName.getToken( nToken, '.' ) );
    String aTLName( aCellRangeNoTableName.GetToken(0, ':') );  // name of top left cell
    String aBRName( aCellRangeNoTableName.GetToken(1, ':') );  // name of bottom right cell
    if(!aTLName.Len() || !aBRName.Len())
    OUString aCellRangeNoTableName( rCellRangeName.getToken( nToken, '.' ) );
    OUString aTLName( aCellRangeNoTableName.getToken(0, ':') );  // name of top left cell
    OUString aBRName( aCellRangeNoTableName.getToken(1, ':') );  // name of bottom right cell
    if(aTLName.isEmpty() || aBRName.isEmpty())
        return false;

    rDesc.nTop = rDesc.nLeft = rDesc.nBottom = rDesc.nRight = -1;
@@ -230,15 +230,15 @@ bool FillRangeDescriptor(
    return true;
}

static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
static OUString GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
{
    String aRes;
    OUString aRes;

    //!! see also SwXTextTableCursor::getRangeName

    SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(&rTblCrsr);
    if (!pUnoTblCrsr)
        return String();
        return OUString();
    pUnoTblCrsr->MakeBoxSels();

    const SwStartNode*  pStart;
@@ -268,7 +268,7 @@ static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
        }

        aRes = pStartBox->GetName();
        aRes += (sal_Unicode)':';
        aRes += ":";
        if (pEndBox)
            aRes += pEndBox->GetName();
        else
@@ -278,24 +278,24 @@ static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
    return aRes;
}

static String GetRangeRepFromTableAndCells( const String &rTableName,
        const String &rStartCell, const String &rEndCell,
static OUString GetRangeRepFromTableAndCells( const OUString &rTableName,
        const OUString &rStartCell, const OUString &rEndCell,
        sal_Bool bForceEndCellName )
{
    OSL_ENSURE( rTableName.Len(), "table name missing" );
    OSL_ENSURE( rStartCell.Len(), "cell name missing" );
    String aRes( rTableName );
    aRes += (sal_Unicode) '.';
    OSL_ENSURE( !rTableName.isEmpty(), "table name missing" );
    OSL_ENSURE( !rStartCell.isEmpty(), "cell name missing" );
    OUString aRes( rTableName );
    aRes += ".";
    aRes += rStartCell;

    if (rEndCell.Len())
    if (!rEndCell.isEmpty())
    {
        aRes += (sal_Unicode) ':';
        aRes += ":";
        aRes += rEndCell;
    }
    else if (bForceEndCellName)
    {
        aRes += (sal_Unicode) ':';
        aRes += ":";
        aRes += rStartCell;
    }

@@ -304,17 +304,17 @@ static String GetRangeRepFromTableAndCells( const String &rTableName,

static bool GetTableAndCellsFromRangeRep(
        const OUString &rRangeRepresentation,
        String &rTblName,
        String &rStartCell,
        String &rEndCell,
        OUString &rTblName,
        OUString &rStartCell,
        OUString &rEndCell,
        bool bSortStartEndCells = true )
{
    // parse range representation for table name and cell/range names
    // accepted format sth like: "Table1.A2:C5" , "Table2.A2.1:B3.2"
    String aTblName;    // table name
    OUString aTblName;    // table name
    OUString aRange;    // cell range
    String aStartCell;  // name of top left cell
    String aEndCell;    // name of bottom right cell
    OUString aStartCell;  // name of top left cell
    OUString aEndCell;    // name of bottom right cell
    sal_Int32 nIdx = rRangeRepresentation.indexOf( '.' );
    if (nIdx >= 0)
    {
@@ -330,7 +330,7 @@ static bool GetTableAndCellsFromRangeRep(
            // (does not check for normalization here)
            if (bSortStartEndCells && 1 == sw_CompareCellsByColFirst( aStartCell, aEndCell ))
            {
                String aTmp( aStartCell );
                OUString aTmp( aStartCell );
                aStartCell  = aEndCell;
                aEndCell    = aTmp;
            }
@@ -341,8 +341,8 @@ static bool GetTableAndCellsFromRangeRep(
        }
    }

    bool bSuccess = aTblName.Len() != 0 &&
                        aStartCell.Len() != 0 && aEndCell.Len() != 0;
    bool bSuccess = !aTblName.isEmpty() &&
                        !aStartCell.isEmpty() && !aEndCell.isEmpty();
    if (bSuccess)
    {
        rTblName    = aTblName;
@@ -381,9 +381,9 @@ static void GetFormatAndCreateCursorFromRangeRep(
        SwUnoCrsr   **ppUnoCrsr )   // will be set to cursor spanning the cell range
                                    // (cursor will be created!)
{
    String aTblName;    // table name
    String aStartCell;  // name of top left cell
    String aEndCell;    // name of bottom right cell
    OUString aTblName;    // table name
    OUString aStartCell;  // name of top left cell
    OUString aEndCell;    // name of bottom right cell
    bool bNamesFound = GetTableAndCellsFromRangeRep( rRangeRepresentation,
                                  aTblName, aStartCell, aEndCell );

@@ -456,7 +456,7 @@ static bool GetSubranges( const OUString &rRangeRepresentation,
        uno::Sequence< OUString > &rSubRanges, bool bNormalize )
{
    bool bRes = true;
    String aRangesStr( rRangeRepresentation );
    OUString aRangesStr( rRangeRepresentation );
    xub_StrLen nLen = comphelper::string::getTokenCount(aRangesStr, ';');
    uno::Sequence< OUString > aRanges( nLen );

@@ -464,15 +464,15 @@ static bool GetSubranges( const OUString &rRangeRepresentation,
    if (nLen != 0)
    {
        OUString *pRanges = aRanges.getArray();
        String aFirstTable;
        OUString aFirstTable;
        for ( xub_StrLen i = 0;  i < nLen && bRes;  ++i)
        {
            String aRange( aRangesStr.GetToken( i, ';' ) );
            if (aRange.Len())
            OUString aRange( aRangesStr.getToken( i, ';' ) );
            if (!aRange.isEmpty())
            {
                pRanges[nCnt] = aRange;

                String aTableName, aStartCell, aEndCell;
                OUString aTableName, aStartCell, aEndCell;
                if (!GetTableAndCellsFromRangeRep( aRange,
                                                   aTableName, aStartCell, aEndCell ))
                    bRes = false;
@@ -505,27 +505,27 @@ static void SortSubranges( uno::Sequence< OUString > &rSubRanges, sal_Bool bCmpB
    sal_Int32 nLen = rSubRanges.getLength();
    OUString *pSubRanges = rSubRanges.getArray();

    String aSmallestTblName;
    String aSmallestStartCell;
    String aSmallestEndCell;
    OUString aSmallestTblName;
    OUString aSmallestStartCell;
    OUString aSmallestEndCell;

    for (sal_Int32 i = 0;  i < nLen;  ++i)
    {
        sal_Int32 nIdxOfSmallest = i;
        GetTableAndCellsFromRangeRep( pSubRanges[nIdxOfSmallest],
                aSmallestTblName, aSmallestStartCell, aSmallestEndCell );
        if (aSmallestEndCell.Len() == 0)
        if (aSmallestEndCell.isEmpty())
            aSmallestEndCell = aSmallestStartCell;

        for (sal_Int32 k = i+1;  k < nLen;  ++k)
        {
            // get cell names for sub range
            String aTblName;
            String aStartCell;
            String aEndCell;
            OUString aTblName;
            OUString aStartCell;
            OUString aEndCell;
            GetTableAndCellsFromRangeRep( pSubRanges[k],
                    aTblName, aStartCell, aEndCell );
            if (aEndCell.Len() == 0)
            if (aEndCell.isEmpty())
                aEndCell = aStartCell;

            // compare cell ranges ( is the new one smaller? )
@@ -626,7 +626,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
    {
        //try to correct the range here
        //work around wrong writer ranges ( see Issue 58464 )
        String aChartTableName;
        OUString aChartTableName;

        const SwNodes& rNodes = pDoc->GetNodes();
        for( sal_uLong nN = rNodes.Count(); nN--; )
@@ -645,7 +645,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
            }
        }

        if( aChartTableName.Len() )
        if( !aChartTableName.isEmpty() )
        {
            //the wrong range is still shifted one row down
            //thus the first row is missing and an invalid row at the end is added.
@@ -661,8 +661,8 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
            aDesc.nTop      -= 1;
            aDesc.nBottom   -= 1;

            String aNewStartCell( sw_GetCellName( aDesc.nLeft, aDesc.nTop ) );
            String aNewEndCell( sw_GetCellName( aDesc.nRight, aDesc.nBottom ) );
            OUString aNewStartCell( sw_GetCellName( aDesc.nLeft, aDesc.nTop ) );
            OUString aNewEndCell( sw_GetCellName( aDesc.nRight, aDesc.nBottom ) );
            aRangeRepresentation = GetRangeRepFromTableAndCells(
                        aChartTableName, aNewStartCell, aNewEndCell, sal_True );
            bOk = GetSubranges( aRangeRepresentation, aSubRanges, sal_True );
@@ -716,7 +716,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
            sal_Int32 nSubRanges = aSubRanges.getLength();
            for (sal_Int32 i = 0;  i < nSubRanges;  ++i)
            {
                String aTblName, aStartCell, aEndCell;
                OUString aTblName, aStartCell, aEndCell;
                bool bOk2 = GetTableAndCellsFromRangeRep(
                                    pSubRanges[i], aTblName, aStartCell, aEndCell );
                (void) bOk2;
@@ -883,24 +883,23 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
                    aDataDesc.nBottom   = oi;
                    aDataDesc.nRight    = aDataDesc.nLeft + aDataLen[oi] - 1;
                }
                String aBaseName( pTblFmt->GetName() );
                aBaseName += '.';
                OUString aBaseName =  pTblFmt->GetName() + ".";
                //
                String aLabelRange;
                OUString aLabelRange;
                if (aLabelIdx[oi] != -1)
                {
                    aLabelRange += aBaseName;
                    aLabelRange += sw_GetCellName( aLabelDesc.nLeft, aLabelDesc.nTop );
                    aLabelRange += ':';
                    aLabelRange += ":";
                    aLabelRange += sw_GetCellName( aLabelDesc.nRight, aLabelDesc.nBottom );
                }
                //
                String aDataRange;
                OUString aDataRange;
                if (aDataStartIdx[oi] != -1)
                {
                    aDataRange += aBaseName;
                    aDataRange += sw_GetCellName( aDataDesc.nLeft, aDataDesc.nTop );
                    aDataRange += ':';
                    aDataRange += ":";
                    aDataRange += sw_GetCellName( aDataDesc.nRight, aDataDesc.nBottom );
                }

@@ -1021,7 +1020,7 @@ OUString SwChartDataProvider::GetBrokenCellRangeForExport(
    if (-1 == rCellRangeRepresentation.indexOf( ';' ))
    {
        // get current cell and table names
        String aTblName, aStartCell, aEndCell;
        OUString aTblName, aStartCell, aEndCell;
        GetTableAndCellsFromRangeRep( rCellRangeRepresentation,
            aTblName, aStartCell, aEndCell, false );
        sal_Int32 nStartCol = -1, nStartRow = -1, nEndCol = -1, nEndRow = -1;
@@ -1065,7 +1064,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume

    SwFrmFmt *pTableFmt = 0;
    SwTable  *pTable    = 0;
    String    aTableName;
    OUString  aTableName;
    sal_Int32 nTableRows = 0;
    sal_Int32 nTableCols = 0;

@@ -1075,7 +1074,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
    uno::Sequence< sal_Int32 > aSequenceMapping( nNumDS_LDS );
    sal_Int32 *pSequenceMapping = aSequenceMapping.getArray();

    String aCellRanges;
    OUString aCellRanges;
    sal_Int16 nDtaSrcIsColumns = -1;// -1: don't know yet, 0: false, 1: true  -2: neither
    sal_Int32 nLabelSeqLen  = -1;   // used to see if labels are always used or not and have
                                    // the expected size of 1 (i.e. if FirstCellAsLabel can
@@ -1110,14 +1109,14 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume

        // get table and cell names for label and values data sequences
        // (start and end cell will be sorted, i.e. start cell <= end cell)
        String aLabelTblName, aLabelStartCell, aLabelEndCell;
        String aValuesTblName, aValuesStartCell, aValuesEndCell;
        String aLabelRange, aValuesRange;
        OUString aLabelTblName, aLabelStartCell, aLabelEndCell;
        OUString aValuesTblName, aValuesStartCell, aValuesEndCell;
        OUString aLabelRange, aValuesRange;
        if (xCurLabel.is())
            aLabelRange = xCurLabel->getSourceRangeRepresentation();
        if (xCurValues.is())
            aValuesRange = xCurValues->getSourceRangeRepresentation();
        if ((aLabelRange.Len() && !GetTableAndCellsFromRangeRep( aLabelRange,
        if ((!aLabelRange.isEmpty() && !GetTableAndCellsFromRangeRep( aLabelRange,
                aLabelTblName, aLabelStartCell, aLabelEndCell ))  ||
            !GetTableAndCellsFromRangeRep( aValuesRange,
                aValuesTblName, aValuesStartCell, aValuesEndCell ))
@@ -1126,11 +1125,11 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
        }

        // make sure all sequences use the same table
        if (!aTableName.Len())
        if (aTableName.isEmpty())
            aTableName = aValuesTblName;  // get initial value to compare with
        if (!aTableName.Len() ||
        if (aTableName.isEmpty() ||
             aTableName != aValuesTblName ||
            (aLabelTblName.Len() && aTableName != aLabelTblName))
            (!aLabelTblName.isEmpty() && aTableName != aLabelTblName))
        {
            return aResult; // failed -> return empty property sequence
        }
@@ -1140,8 +1139,8 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
        // first and last cell used in both sequences
        //
        sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
        String aCell( aLabelStartCell.Len() ? aLabelStartCell : aValuesStartCell );
        OSL_ENSURE( aCell.Len() , "start cell missing?" );
        OUString aCell( !aLabelStartCell.isEmpty() ? aLabelStartCell : aValuesStartCell );
        OSL_ENSURE( !aCell.isEmpty() , "start cell missing?" );
        sw_GetCellPosition( aCell, nFirstCol, nFirstRow);
        sw_GetCellPosition( aValuesEndCell, nLastCol, nLastRow);
        //
@@ -1195,7 +1194,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
            for (sal_Int32 i = 0;  i < nTableRows;  ++i)
                aMap[i].resize( nTableCols );
            //
            if (aLabelStartCell.Len() && aLabelEndCell.Len())
            if (!aLabelStartCell.isEmpty() && !aLabelEndCell.isEmpty())
            {
                sal_Int32 nStartCol = -1, nStartRow = -1, nEndCol = -1, nEndRow = -1;
                sw_GetCellPosition( aLabelStartCell, nStartCol, nStartRow );
@@ -1217,7 +1216,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
                    }
                }
            }
            if (aValuesStartCell.Len() && aValuesEndCell.Len())
            if (!aValuesStartCell.isEmpty() && !aValuesEndCell.isEmpty())
            {
                sal_Int32 nStartCol = -1, nStartRow = -1, nEndCol = -1, nEndRow = -1;
                sw_GetCellPosition( aValuesStartCell, nStartCol, nStartRow );
@@ -1269,9 +1268,8 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume

    // build value for 'CellRangeRepresentation'
    //
    String aCellRangeBase( aTableName );
    aCellRangeBase += '.';
    String aCurRange;
    OUString aCellRangeBase = aTableName + ".";
    OUString aCurRange;
    for (sal_Int32 i = 0;  i < nTableRows;  ++i)
    {
        for (sal_Int32 k = 0;  k < nTableCols;  ++k)
@@ -1293,14 +1291,14 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
                    ++nColIndex1;
                    ++nColSubLen;
                }
                String aStartCell( sw_GetCellName( k, i ) );
                String aEndCell( sw_GetCellName( k + nColSubLen - 1, i + nRowSubLen - 1) );
                OUString aStartCell( sw_GetCellName( k, i ) );
                OUString aEndCell( sw_GetCellName( k + nColSubLen - 1, i + nRowSubLen - 1) );
                aCurRange = aCellRangeBase;
                aCurRange += aStartCell;
                aCurRange += ':';
                aCurRange += ":";
                aCurRange += aEndCell;
                if (aCellRanges.Len())
                    aCellRanges += ';';
                if (!aCellRanges.isEmpty())
                    aCellRanges += ";";
                aCellRanges += aCurRange;

                // clear already found sub-range from map
@@ -1407,7 +1405,7 @@ uno::Reference< chart2::data::XDataSequence > SwChartDataProvider::Impl_createDa
        throw lang::IllegalArgumentException();

    // check that cursors point and mark are in a single row or column.
    String aCellRange( GetCellRangeName( *pTblFmt, *pUnoCrsr ) );
    OUString aCellRange( GetCellRangeName( *pTblFmt, *pUnoCrsr ) );
    SwRangeDescriptor aDesc;
    FillRangeDescriptor( aDesc, aCellRange );
    if (aDesc.nTop != aDesc.nBottom  &&  aDesc.nLeft != aDesc.nRight)
@@ -1765,7 +1763,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
        throw lang::DisposedException();

    OUString aRes;
    String aRangeRepresentation( rRangeRepresentation );
    OUString aRangeRepresentation( rRangeRepresentation );

    // multiple ranges are delimeted by a ';' like in
    // "Table1.A1:A4;Table1.C2:C5" the same table must be used in all ranges!
@@ -1773,7 +1771,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
    SwTable* pFirstFoundTable = 0;  // to check that only one table will be used
    for (sal_uInt16 i = 0;  i < nNumRanges;  ++i)
    {
        String aRange( aRangeRepresentation.GetToken(i, ';') );
        OUString aRange( aRangeRepresentation.getToken(i, ';') );
        SwFrmFmt    *pTblFmt  = 0;      // pointer to table format
        GetFormatAndCreateCursorFromRangeRep( pDoc, aRange, &pTblFmt, NULL );
        if (!pTblFmt)
@@ -1788,9 +1786,9 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
        if (pTable != pFirstFoundTable)
            throw lang::IllegalArgumentException();

        String aTblName;
        String aStartCell;
        String aEndCell;
        OUString aTblName;
        OUString aStartCell;
        OUString aEndCell;
        if (!GetTableAndCellsFromRangeRep( aRange, aTblName, aStartCell, aEndCell ))
            throw lang::IllegalArgumentException();

@@ -1806,7 +1804,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
        aCellRange.aUpperLeft.nColumn   = nCol;
        aCellRange.aUpperLeft.nRow      = nRow;
        aCellRange.aUpperLeft.bIsEmpty  = false;
        if (aStartCell != aEndCell && aEndCell.Len() != 0)
        if (aStartCell != aEndCell && !aEndCell.isEmpty())
        {
            sw_GetCellPosition( aEndCell, nCol, nRow );
            if (nCol < 0 || nRow < 0)
@@ -1833,7 +1831,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const OUString& rXML
        throw lang::DisposedException();

    OUString aRes;
    String aXMLRange( rXMLRange );
    OUString aXMLRange( rXMLRange );

    // multiple ranges are delimeted by a ' ' like in
    // "Table1.$A$1:.$A$4 Table1.$C$2:.$C$5" the same table must be used in all ranges!
@@ -1841,7 +1839,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const OUString& rXML
    OUString aFirstFoundTable; // to check that only one table will be used
    for (sal_uInt16 i = 0;  i < nNumRanges;  ++i)
    {
        String aRange( aXMLRange.GetToken(i, ' ') );
        OUString aRange( aXMLRange.getToken(i, ' ') );

        //!! following objects and function are implemented in XMLRangeHelper.?xx
        //!! which is a copy of the respective file from chart2 !!
@@ -2077,14 +2075,14 @@ OUString SAL_CALL SwChartDataSequence::getSourceRangeRepresentation(  )
    if (bDisposed)
        throw lang::DisposedException();

    String aRes;
    OUString aRes;
    SwFrmFmt* pTblFmt = GetFrmFmt();
    if (pTblFmt)
    {
        aRes = pTblFmt->GetName();
        String aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
        OSL_ENSURE( aCellRange.Len() != 0, "failed to get cell range" );
        aRes += (sal_Unicode) '.';
        OUString aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
        OSL_ENSURE( !aCellRange.isEmpty(), "failed to get cell range" );
        aRes += ".";
        aRes += aCellRange;
    }
    return aRes;
@@ -2109,8 +2107,8 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
            throw uno::RuntimeException();
        else
        {
            String aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
            OSL_ENSURE( aCellRange.Len() != 0, "failed to get cell range" );
            OUString aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
            OSL_ENSURE( !aCellRange.isEmpty(), "failed to get cell range" );
            bOk = FillRangeDescriptor( aDesc, aCellRange );
            OSL_ENSURE( bOk, "falied to get SwRangeDescriptor" );
        }
@@ -2122,7 +2120,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
            OSL_ENSURE( nColSpan == 1 || nRowSpan == 1,
                    "unexpected range of selected cells" );

            String aTxt;    // label text to be returned
            OUString aTxt;    // label text to be returned
            bool bReturnEmptyTxt = false;
            bool bUseCol = true;
            if (eLabelOrigin == chart2::data::LabelOrigin_COLUMN)
@@ -2171,8 +2169,8 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
                        // start of number found?
                        if (pBuf < pEnd && ('0' <= *pBuf && *pBuf <= '9'))
                        {
                            String aRplc;
                            String aNew;
                            OUString aRplc;
                            OUString aNew;
                            if (bUseCol)
                            {
                                aRplc = OUString("%COLUMNLETTER");
@@ -2183,9 +2181,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
                                aRplc = OUString("%ROWNUMBER");
                                aNew = OUString(pBuf, (aCellName.getStr() + nLen) - pBuf);
                            }
                            xub_StrLen nPos = aTxt.Search( aRplc );
                            if (nPos != STRING_NOTFOUND)
                                aTxt = aTxt.Replace( nPos, aRplc.Len(), aNew );
                            aTxt = aTxt.replaceFirst( aRplc, aNew );
                        }
                    }
                }
@@ -2523,7 +2519,7 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
        throw lang::DisposedException();

#if OSL_DEBUG_LEVEL > 1
    String aBoxName( rBox.GetName() );
    OUString aBoxName( rBox.GetName() );
#endif

    // to be set if the last box of the data-sequence was removed here
@@ -2544,8 +2540,8 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
        sal_Int32 nPointRow = -1, nPointCol = -1;
        sal_Int32 nMarkRow  = -1, nMarkCol  = -1;
        const SwTable* pTable = SwTable::FindTable( GetFrmFmt() );
        String aPointCellName( pTable->GetTblBox( pPointStartNode->GetIndex() )->GetName() );
        String aMarkCellName( pTable->GetTblBox( pMarkStartNode->GetIndex() )->GetName() );
        OUString aPointCellName( pTable->GetTblBox( pPointStartNode->GetIndex() )->GetName() );
        OUString aMarkCellName( pTable->GetTblBox( pMarkStartNode->GetIndex() )->GetName() );

        sw_GetCellPosition( aPointCellName, nPointCol, nPointRow );
        sw_GetCellPosition( aMarkCellName,  nMarkCol,  nMarkRow );
@@ -2588,7 +2584,7 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
            nRow += bMoveUp ? -1 : +1;
        if (bMoveHorizontal)
            nCol += bMoveLeft ? -1 : +1;
        String aNewCellName = sw_GetCellName( nCol, nRow );
        OUString aNewCellName = sw_GetCellName( nCol, nRow );
        SwTableBox* pNewBox = (SwTableBox*) pTable->GetTblBox( aNewCellName );

        if (pNewBox)    // set new position (cell range) to use
@@ -2682,11 +2678,11 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
    //
    pStartNd = pUnoTblCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode();
    pEndBox = pTable->GetTblBox( pStartNd->GetIndex() );
    const String aEndBox( pEndBox->GetName() );
    const OUString aEndBox( pEndBox->GetName() );
    //
    pStartNd = pUnoTblCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode();
    pStartBox = pTable->GetTblBox( pStartNd->GetIndex() );
    const String aStartBox( pStartBox->GetName() );
    const OUString aStartBox( pStartBox->GetName() );
    //
    OUString aCellRange( aStartBox );     // note that cell range here takes the newly added rows/cols already into account
    aCellRange += ":";
@@ -2694,8 +2690,8 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
    SwRangeDescriptor aDesc;
    FillRangeDescriptor( aDesc, aCellRange );

    String aNewStartCell;
    String aNewEndCell;
    OUString aNewStartCell;
    OUString aNewEndCell;
    if (bExtendCol && aDesc.nBottom + 1 == nFirstNew)
    {
        // new column cells adjacent to the bottom of the
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index a5d86ef..1493b37 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -495,8 +495,8 @@ uno::Sequence<OUString>     SwXServiceProvider::GetAllServiceNames()
    sal_uInt16 n = 0;
    for(sal_uInt16 i = 0; i < nEntries; i++)
    {
        String sProv(OUString::createFromAscii(aProvNamesId[i].pName));
        if(sProv.Len())
        OUString sProv(OUString::createFromAscii(aProvNamesId[i].pName));
        if(!sProv.isEmpty())
        {
            pArray[n] = sProv;
            n++;
@@ -1488,7 +1488,7 @@ uno::Any SwXTextSections::getByName(const OUString& Name)
    uno::Any aRet;
    if(IsValid())
    {
        String aName(Name);
        OUString aName(Name);
        SwSectionFmts& rFmts = GetDoc()->GetSections();
        uno::Reference< XTextSection >  xSect;
        for(sal_uInt16 i = 0; i < rFmts.size(); i++)
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 6e4358e..596b7e1 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -338,7 +338,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
                if (!pTmpNode)
                    pTmpNode = rPam.GetNode()->GetTxtNode();

                String sRet;
                OUString sRet;
                if ( pTmpNode && pTmpNode->GetNum() )
                {
                    sRet = pTmpNode->GetNumString();
@@ -426,7 +426,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
                    // #i91601#
                    else if ( rEntry.nWID == FN_UNO_LIST_ID )
                    {
                        const String sListId = pTxtNd->GetListId();
                        const OUString sListId = pTxtNd->GetListId();
                        *pAny <<= OUString(sListId);
                    }
                    else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 20d04cf..ddf185a 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -602,14 +602,14 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
    {
        OUString uTmp;
        rValue >>= uTmp;
        String sTypeName(uTmp);
        OUString sTypeName(uTmp);
        SwFieldType * pType2 = m_pImpl->m_pDoc->GetFldType(
                m_pImpl->m_nResTypeId, sTypeName, sal_False);

        String sTable(SW_RES(STR_POOLCOLL_LABEL_TABLE));
        String sDrawing(SW_RES(STR_POOLCOLL_LABEL_DRAWING));
        String sFrame(SW_RES(STR_POOLCOLL_LABEL_FRAME));
        String sIllustration(SW_RES(STR_POOLCOLL_LABEL_ABB));
        OUString sTable(SW_RES(STR_POOLCOLL_LABEL_TABLE));
        OUString sDrawing(SW_RES(STR_POOLCOLL_LABEL_DRAWING));
        OUString sFrame(SW_RES(STR_POOLCOLL_LABEL_FRAME));
        OUString sIllustration(SW_RES(STR_POOLCOLL_LABEL_ABB));

        if(pType2 ||
            (RES_SETEXPFLD == m_pImpl->m_nResTypeId &&
@@ -2608,8 +2608,8 @@ static sal_uInt16 lcl_GetIdByName( OUString& rName, OUString& rTypeName )
    {
        nResId = RES_SETEXPFLD;

        String sFldTypName( rName.getToken( 1, '.' ));
        String sUIName( SwStyleNameMapper::GetSpecialExtraUIName( sFldTypName ) );
        OUString sFldTypName( rName.getToken( 1, '.' ));
        OUString sUIName( SwStyleNameMapper::GetSpecialExtraUIName( sFldTypName ) );

        if( sUIName != sFldTypName )
            rName = comphelper::string::setToken(rName, 1, '.', sUIName);
@@ -2997,12 +2997,5 @@ void SwXFieldEnumeration::Impl::Modify(
        m_pDoc = 0;
}

String& GetString( const uno::Any& rAny, String& rStr )
{
    OUString aStr;
    rAny >>= aStr;
    rStr = String( aStr );
    return rStr;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 8f84bf4..fa0dc91 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1241,7 +1241,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
                    }
                    SwPaM aGrfPaM(*pGrfNode);
                    Graphic aGraphic( xGraphic );
                    pFmt->GetDoc()->ReRead( aGrfPaM, String(), String(), &aGraphic, 0 );
                    pFmt->GetDoc()->ReRead( aGrfPaM, OUString(), OUString(), &aGraphic, 0 );
                }
            }
        }
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 69526c9..84aedbb 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -288,7 +288,7 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException)
    }
    else if (m_pImpl->m_bIsDescriptor)
    {
        m_pImpl->m_sLabel = String(aLabel);
        m_pImpl->m_sLabel = aLabel;
    }
    else
    {
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 25b51b9..c2efe98 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -714,7 +714,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
        {
            // convert file-format/API/external programmatic english name
            // to internal UI name before usage
            String aName( SwStyleNameMapper::GetSpecialExtraUIName(
            OUString aName( SwStyleNameMapper::GetSpecialExtraUIName(
                                lcl_AnyToString(rValue) ) );
            rTOXBase.SetSequenceName( aName );
        }
@@ -1024,7 +1024,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
                // convert internal UI name to
                // file-format/API/external programmatic english name
                // before usage
                String aName( SwStyleNameMapper::GetSpecialExtraProgName(
                OUString aName( SwStyleNameMapper::GetSpecialExtraProgName(
                                    pTOXBase->GetSequenceName() ) );
                aRet <<= OUString( aName );
            }
@@ -2454,7 +2454,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
    if(!IsValid())
        throw uno::RuntimeException();

    String sToFind(rName);
    OUString sToFind(rName);
    const SwSectionFmts& rFmts = GetDoc()->GetSections();
    for( sal_uInt16 n = 0; n < rFmts.size(); ++n )
    {
@@ -2521,7 +2521,7 @@ throw (uno::RuntimeException)
    if(!IsValid())
        throw uno::RuntimeException();

    String sToFind(rName);
    OUString sToFind(rName);
    const SwSectionFmts& rFmts = GetDoc()->GetSections();
    for( sal_uInt16 n = 0; n < rFmts.size(); ++n )
    {
@@ -2618,13 +2618,13 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,

    const sal_Int32 nStyles = aSeq.getLength();
    const OUString* pStyles = aSeq.getConstArray();
    String sSetStyles;
    OUString sSetStyles;
    OUString aString;
    for(sal_Int32 i = 0; i < nStyles; i++)
    {
        if(i)
        {
            sSetStyles += TOX_STYLE_DELIMITER;
            sSetStyles += OUString(TOX_STYLE_DELIMITER);
        }
        SwStyleNameMapper::FillUIName(pStyles[i], aString,
                nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true);
@@ -2653,7 +2653,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,

    SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );

    const String& rStyles =
    const OUString& rStyles =
        rTOXBase.GetStyleNames(static_cast<sal_uInt16>(nIndex));
    const sal_uInt16 nStyles = comphelper::string::getTokenCount(rStyles, TOX_STYLE_DELIMITER);
    uno::Sequence<OUString> aStyles(nStyles);
@@ -2662,7 +2662,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
    for(sal_uInt16 i = 0; i < nStyles; i++)
    {
        SwStyleNameMapper::FillProgName(
            rStyles.GetToken(i, TOX_STYLE_DELIMITER),
            rStyles.getToken(i, TOX_STYLE_DELIMITER),
            aString,
            nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
            true);
@@ -2769,7 +2769,7 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
        throw lang::IllegalArgumentException();
    }

    String sPattern;
    OUString sPattern;
    const sal_Int32 nTokens = aSeq.getLength();
    const beans::PropertyValues* pTokens = aSeq.getConstArray();
    for(sal_Int32 i = 0; i < nTokens; i++)
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index d1d338c..8e93ef6d 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -173,7 +173,7 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
#endif
    WriterRef xWrt;
    // TODO/MBA: looks like a BaseURL doesn't make sense here
    SwReaderWriter::GetWriter( OUString(FILTER_TEXT_DLG), String(), xWrt );
    SwReaderWriter::GetWriter( OUString(FILTER_TEXT_DLG), OUString(), xWrt );
    if( xWrt.Is() )
    {
        SwWriter aWriter( aStream, rPam );
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index e93189e..c14ab21 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1702,7 +1702,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
    }
    if (!rString.isEmpty())
    {
        String aText(rString);
        OUString aText(rString);
        const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR(
                    *pDoc, rCursor, aText, false ) );
        OSL_ENSURE( bSuccess, "DocInsertStringSplitCR" );
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 957eb12..f7ea3a3 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -633,11 +633,10 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
                }
                else
                {
                    String sLinkFileName(pSectionData->GetLinkFileName());
                    OUString sLinkFileName(pSectionData->GetLinkFileName());
                    if (pSectionData->GetType() != DDE_LINK_SECTION)
                    {
                        sLinkFileName = sfx2::cTokenSeparator;
                        sLinkFileName += sfx2::cTokenSeparator;
                        sLinkFileName = OUString(sfx2::cTokenSeparator) + OUString(sfx2::cTokenSeparator);
                        pSectionData->SetType(DDE_LINK_SECTION);
                    }
                    sLinkFileName = comphelper::string::setToken(sLinkFileName,
@@ -1710,7 +1709,7 @@ throw (uno::RuntimeException)
    {
        SwSection *const pSect = pFmt->GetSection();
        SwSectionData aSection(*pSect);
        String sNewName(rName);
        OUString sNewName(rName);
        aSection.SetSectionName(sNewName);

        const SwSectionFmts& rFmts = pFmt->GetDoc()->GetSections();
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 3ade2c6..c6508d1 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -421,14 +421,14 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons
                {
                    OUString uTmp;
                    aValue >>= uTmp;
                    aFtnInfo.aQuoVadis = String(uTmp);
                    aFtnInfo.aQuoVadis = uTmp;
                }
                break;
                case WID_BEGIN_NOTICE:
                {
                    OUString uTmp;
                    aValue >>= uTmp;
                    aFtnInfo.aErgoSum = String(uTmp);
                    aFtnInfo.aErgoSum = uTmp;
                }
                break;
            }
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index bacc481..74dca12 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -532,7 +532,7 @@ void SwXTextSearch::setSearchString(const OUString& rString)
                                        throw( uno::RuntimeException )
{
    SolarMutexGuard aGuard;
    sSearchText = String(rString);
    sSearchText = rString;
}

OUString SwXTextSearch::getReplaceString(void) throw( uno::RuntimeException )
@@ -544,7 +544,7 @@ OUString SwXTextSearch::getReplaceString(void) throw( uno::RuntimeException )
void SwXTextSearch::setReplaceString(const OUString& rReplaceString) throw( uno::RuntimeException )
{
    SolarMutexGuard aGuard;
    sReplaceText = String(rReplaceString);
    sReplaceText = rReplaceString;
}

uno::Reference< beans::XPropertySetInfo >  SwXTextSearch::getPropertySetInfo(void) throw( uno::RuntimeException )
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 7e12c92..4e70054 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -269,7 +269,7 @@ static uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimp
        {
            const SfxItemSet& rSet = pFmt->GetAttrSet();
            const SfxPoolItem* pItem;
            String sPDesc;
            OUString sPDesc;
            if(SFX_ITEM_SET == rSet.GetItemState(RES_PAGEDESC, sal_False, &pItem))
            {
                const SwPageDesc* pDsc = ((const SwFmtPageDesc*)pItem)->GetPageDesc();
@@ -401,7 +401,7 @@ void sw_GetCellPosition(const OUString &rCellName,
 * @param rCellName2 e.g. "A1" (non-empty string with valid cell name)
 * @return -1 if cell_1 < cell_2; 0 if both cells are equal; +1 if cell_1 > cell_2
 */
int sw_CompareCellsByRowFirst( const String &rCellName1, const String &rCellName2 )
int sw_CompareCellsByRowFirst( const OUString &rCellName1, const OUString &rCellName2 )
{
    sal_Int32 nCol1 = -1, nRow1 = -1, nCol2 = -1, nRow2 = -1;
    sw_GetCellPosition( rCellName1, nCol1, nRow1 );
@@ -424,7 +424,7 @@ int sw_CompareCellsByRowFirst( const String &rCellName1, const String &rCellName
 * @param rCellName2 e.g. "A1" (non-empty string with valid cell name)
 * @return -1 if cell_1 < cell_2; 0 if both cells are equal; +1 if cell_1 > cell_2
 */
int sw_CompareCellsByColFirst( const String &rCellName1, const String &rCellName2 )
int sw_CompareCellsByColFirst( const OUString &rCellName1, const OUString &rCellName2 )
{
    sal_Int32 nCol1 = -1, nRow1 = -1, nCol2 = -1, nRow2 = -1;
    sw_GetCellPosition( rCellName1, nCol1, nRow1 );
@@ -452,11 +452,11 @@ int sw_CompareCellsByColFirst( const String &rCellName1, const String &rCellName
 * @return -1 if cell_range_1 < cell_range_2; 0 if both cell ranges are equal; +1 if cell_range_1 > cell_range_2
 */
int sw_CompareCellRanges(
        const String &rRange1StartCell, const String &rRange1EndCell,
        const String &rRange2StartCell, const String &rRange2EndCell,
        const OUString &rRange1StartCell, const OUString &rRange1EndCell,
        const OUString &rRange2StartCell, const OUString &rRange2EndCell,
        sal_Bool bCmpColsFirst )
{
    int (*pCompareCells)( const String &, const String & ) =
    int (*pCompareCells)( const OUString &, const OUString & ) =
            bCmpColsFirst ? &sw_CompareCellsByColFirst : &sw_CompareCellsByRowFirst;

    int nCmpResStartCells = pCompareCells( rRange1StartCell, rRange2StartCell );
@@ -543,7 +543,7 @@ const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const 
 * @param [IN,OUT] rCell1 cell name (will be modified to upper-left corner), e.g. "A1" (non-empty string with valid cell name)
 * @param [IN,OUT] rCell2 cell name (will be modified to lower-right corner), e.g. "A1" (non-empty string with valid cell name)
 */
void sw_NormalizeRange(String &rCell1, String &rCell2)
void sw_NormalizeRange(OUString &rCell1, OUString &rCell2)
{
    sal_Int32 nCol1 = -1, nRow1 = -1, nCol2 = -1, nRow2 = -1;
    sw_GetCellPosition( rCell1, nCol1, nRow1 );
@@ -574,7 +574,7 @@ void SwRangeDescriptor::Normalize()
static SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
{
    SwXCell* pXCell = 0;
    String sCellName = sw_GetCellName(nColumn, nRow);
    OUString sCellName = sw_GetCellName(nColumn, nRow);
    SwTable* pTable = SwTable::FindTable( pFmt );
    SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName );
    if(pBox)
@@ -936,9 +936,9 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException 
        sal_uInt32 nNdPos = pBox->IsValidNumTxtNd( sal_True );
        if(USHRT_MAX == nNdPos)
            sw_setString( *this, OUString(), sal_True );
        String sFml(comphelper::string::stripStart(rFormula, ' '));
        if( sFml.Len() && '=' == sFml.GetChar( 0 ) )
                    sFml.Erase( 0, 1 );
        OUString sFml(comphelper::string::stripStart(rFormula, ' '));
        if( !sFml.isEmpty() && '=' == sFml[0] )
                    sFml = sFml.copy( 1 );
        SwTblBoxFormula aFml( sFml );
        SwDoc* pMyDoc = GetDoc();
        UnoActionContext aAction(pMyDoc);
@@ -1578,7 +1578,7 @@ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
        const SwStartNode* pNode = pTblCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode();
        const SwTable* pTable = SwTable::FindTable( GetFrmFmt() );
        const SwTableBox* pEndBox = pTable->GetTblBox( pNode->GetIndex());
        String aTmp( pEndBox->GetName() );
        OUString aTmp( pEndBox->GetName() );

        if(pTblCrsr->HasMark())
        {
@@ -1595,7 +1595,7 @@ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
                }

                aTmp  = pStartBox->GetName();
                aTmp += ':';
                aTmp += ":";
                aTmp += pEndBox->GetName();
            }
        }
@@ -1614,7 +1614,7 @@ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool E
    {
        SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
        lcl_CrsrSelect( pTblCrsr, Expand );
        String sCellName(CellName);
        OUString sCellName(CellName);
        bRet = pTblCrsr->GotoTblBox(sCellName);
    }
    return bRet;
@@ -2236,7 +2236,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& CellN
    if(pFmt)
    {
        SwTable* pTable = SwTable::FindTable( pFmt );
        String sCellName(CellName);
        OUString sCellName(CellName);
        SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName );
        if(pBox)
        {
@@ -2280,7 +2280,7 @@ uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(co
    if(pFmt)
    {
        SwTable* pTable = SwTable::FindTable( pFmt );
        String sCellName(CellName);
        OUString sCellName(CellName);
        SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName );
        if(pBox && pBox->getRowSpan() > 0 )
        {
@@ -2347,12 +2347,11 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
                if(!m_sTableName.isEmpty())
                {
                    sal_uInt16 nIndex = 1;
                    const String sTmpName(m_sTableName);
                    String sTmpNameIndex(sTmpName);
                    const OUString sTmpName(m_sTableName);
                    OUString sTmpNameIndex(sTmpName);
                    while(pDoc->FindTblFmtByName( sTmpNameIndex, sal_True ) && nIndex < USHRT_MAX)
                    {
                        sTmpNameIndex = sTmpName;
                        sTmpNameIndex += nIndex++;
                        sTmpNameIndex = sTmpName + OUString::number(nIndex++);
                    }
                    pDoc->SetTableName( *pTblFmt, sTmpNameIndex);
                }
@@ -2451,8 +2450,8 @@ uno::Reference< table::XCellRange >  SwXTextTable::GetRangeByName(SwFrmFmt* pFmt
{
    SolarMutexGuard aGuard;
    uno::Reference< table::XCellRange >  aRef;
    String sTLName(rTLName);
    String sBRName(rBRName);
    OUString sTLName(rTLName);
    OUString sBRName(rBRName);
    const SwTableBox* pTLBox = pTable->GetTblBox( sTLName );
    if(pTLBox)
    {
@@ -2501,8 +2500,8 @@ uno::Reference< table::XCellRange >  SwXTextTable::getCellRangeByPosition(sal_In
            aDesc.nBottom = nBottom;
            aDesc.nLeft   = nLeft;
            aDesc.nRight  = nRight;
            String sTLName = sw_GetCellName(aDesc.nLeft, aDesc.nTop);
            String sBRName = sw_GetCellName(aDesc.nRight, aDesc.nBottom);
            OUString sTLName = sw_GetCellName(aDesc.nLeft, aDesc.nTop);
            OUString sBRName = sw_GetCellName(aDesc.nRight, aDesc.nBottom);

            // please note that according to the 'if' statement at the begin
            // sTLName:sBRName already denotes the normalized range string
@@ -2526,10 +2525,10 @@ uno::Reference< table::XCellRange >  SwXTextTable::getCellRangeByName(const OUSt
        SwTable* pTable = SwTable::FindTable( pFmt );
        if(!pTable->IsTblComplex())
        {
            String sRange(aRange);
            String sTLName(sRange.GetToken(0, ':'));
            String sBRName(sRange.GetToken(1, ':'));
            if(!sTLName.Len() || !sBRName.Len())
            OUString sRange(aRange);
            OUString sTLName(sRange.getToken(0, ':'));
            OUString sBRName(sRange.getToken(1, ':'));
            if(sTLName.isEmpty() || sBRName.isEmpty())
                throw uno::RuntimeException();
            SwRangeDescriptor aDesc;
            aDesc.nTop = aDesc.nLeft = aDesc.nBottom = aDesc.nRight = -1;
@@ -2991,7 +2990,7 @@ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumen
        if(!pTable->IsTblComplex())
        {

            String sAutoFmtName(aName);
            OUString sAutoFmtName(aName);
            SwTableAutoFmtTbl aAutoFmtTbl;
            aAutoFmtTbl.Load();
            for (sal_uInt16 i = aAutoFmtTbl.size(); i;)
@@ -3564,7 +3563,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )

    if(pFmt)
    {
        const String aOldName( pFmt->GetName() );
        const OUString aOldName( pFmt->GetName() );
        SwFrmFmt* pTmpFmt;
        const SwFrmFmts* pTbl = pFmt->GetDoc()->GetTblFrmFmts();
        for( sal_uInt16 i = pTbl->size(); i; )
@@ -3786,8 +3785,8 @@ uno::Reference< table::XCellRange >  SwXCellRange::getCellRangeByPosition(
            aNewDesc.nLeft   = nLeft + aRgDesc.nLeft;
            aNewDesc.nRight  = nRight + aRgDesc.nLeft;
            aNewDesc.Normalize();
            String sTLName = sw_GetCellName(aNewDesc.nLeft, aNewDesc.nTop);
            String sBRName = sw_GetCellName(aNewDesc.nRight, aNewDesc.nBottom);
            OUString sTLName = sw_GetCellName(aNewDesc.nLeft, aNewDesc.nTop);
            OUString sBRName = sw_GetCellName(aNewDesc.nRight, aNewDesc.nBottom);
            const SwTableBox* pTLBox = pTable->GetTblBox( sTLName );
            if(pTLBox)
            {
@@ -3825,10 +3824,10 @@ uno::Reference< table::XCellRange >  SwXCellRange::getCellRangeByName(const OUSt
        throw( uno::RuntimeException )
{
    SolarMutexGuard aGuard;
    String sRange(rRange);
    String sTLName(sRange.GetToken(0, ':'));
    String sBRName(sRange.GetToken(1, ':'));
    if(!sTLName.Len() || !sBRName.Len())
    OUString sRange(rRange);
    OUString sTLName(sRange.getToken(0, ':'));
    OUString sBRName(sRange.getToken(1, ':'));
    if(sTLName.isEmpty() || sBRName.isEmpty())
        throw uno::RuntimeException();
    SwRangeDescriptor aDesc;
    aDesc.nTop = aDesc.nLeft = aDesc.nBottom = aDesc.nRight = -1;
@@ -4764,7 +4763,7 @@ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
                throw aExcept;
            }

            String sTLName = sw_GetCellName(0, nIndex);
            OUString sTLName = sw_GetCellName(0, nIndex);
            const SwTableBox* pTLBox = pTable->GetTblBox( sTLName );
            bool bAppend = false;
            if(!pTLBox)
@@ -4811,7 +4810,7 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
        SwTable* pTable = SwTable::FindTable( pFrmFmt );
        if(!pTable->IsTblComplex())
        {
            String sTLName = sw_GetCellName(0, nIndex);
            OUString sTLName = sw_GetCellName(0, nIndex);
            const SwTableBox* pTLBox = pTable->GetTblBox( sTLName );
            if(pTLBox)
            {
@@ -4825,7 +4824,7 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
                SwUnoCrsr* pUnoCrsr = pFrmFmt->GetDoc()->CreateUnoCrsr(aPos, true);
                pUnoCrsr->Move( fnMoveForward, fnGoNode );
                pUnoCrsr->SetRemainInSection( sal_False );
                String sBLName = sw_GetCellName(0, nIndex + nCount - 1);
                OUString sBLName = sw_GetCellName(0, nIndex + nCount - 1);
                const SwTableBox* pBLBox = pTable->GetTblBox( sBLName );
                if(pBLBox)
                {
@@ -4976,7 +4975,7 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
                throw aExcept;
            }

            String sTLName = sw_GetCellName(nIndex, 0);
            OUString sTLName = sw_GetCellName(nIndex, 0);
            const SwTableBox* pTLBox = pTable->GetTblBox( sTLName );
            bool bAppend = false;
            if(!pTLBox)
@@ -5021,7 +5020,7 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
        SwTable* pTable = SwTable::FindTable( pFrmFmt );
        if(!pTable->IsTblComplex())
        {
            String sTLName = sw_GetCellName(nIndex, 0);
            OUString sTLName = sw_GetCellName(nIndex, 0);
            const SwTableBox* pTLBox = pTable->GetTblBox( sTLName );
            if(pTLBox)
            {
@@ -5035,7 +5034,7 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
                SwUnoCrsr* pUnoCrsr = pFrmFmt->GetDoc()->CreateUnoCrsr(aPos, true);
                pUnoCrsr->Move( fnMoveForward, fnGoNode );
                pUnoCrsr->SetRemainInSection( sal_False );
                String sTRName = sw_GetCellName(nIndex + nCount - 1, 0);
                OUString sTRName = sw_GetCellName(nIndex + nCount - 1, 0);
                const SwTableBox* pTRBox = pTable->GetTblBox( sTRName );
                if(pTRBox)
                {