Kaydet (Commit) 5c3382d5 authored tarafından Noel Grandin's avatar Noel Grandin

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

Change-Id: Ifda1e87fb14d075bb0b1708efc12404c9ebc255a
üst c60452f1
......@@ -678,7 +678,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
const SwNoTxtFrm* pNoTxtFrm = static_cast<const SwNoTxtFrm*>(pFly->Lower());
const SwNoTxtNode* pNoTxtNode = static_cast<const SwNoTxtNode*>(pNoTxtFrm->GetNode());
const String aAlternateTxt( pNoTxtNode->GetTitle() );
const OUString aAlternateTxt( pNoTxtNode->GetTitle() );
mpPDFExtOutDevData->SetAlternateText( aAlternateTxt );
}
}
......@@ -783,7 +783,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
if ( bActualText )
{
const String aActualTxt( rInf.GetTxt(), rInf.GetIdx(), pPor->GetLen() );
const OUString aActualTxt = rInf.GetTxt().copy( rInf.GetIdx(), pPor->GetLen() );
mpPDFExtOutDevData->SetActualText( aActualTxt );
}
......@@ -1004,7 +1004,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
return;
sal_uInt16 nPDFType = USHRT_MAX;
String aPDFType;
OUString aPDFType;
switch ( pFrm->GetType() )
{
......@@ -1360,7 +1360,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
return;
sal_uInt16 nPDFType = USHRT_MAX;
String aPDFType;
OUString aPDFType;
switch ( pPor->GetWhichPor() )
{
......@@ -1670,14 +1670,14 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{
// First, we create the destination, because there may be more
// than one link to this destination:
String aURL( INetURLObject::decode(
OUString aURL( INetURLObject::decode(
p->rINetAttr.GetINetFmt().GetValue(),
INET_HEX_ESCAPE,
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ) );
// We have to distinguish between intern and real URLs
const bool bIntern = '#' == aURL.GetChar( 0 );
const bool bIntern = '#' == aURL[0];
// _GetCrsr() is a SwShellCrsr, which is derived from
// SwSelPaintRects, therefore the rectangles of the current
......@@ -1692,7 +1692,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
sal_Int32 nDestId = -1;
if ( bIntern )
{
aURL.Erase( 0, 1 );
aURL = aURL.copy( 1 );
mrSh.SwCrsrShell::ClearMark();
JumpToSwMark( &mrSh, aURL );
......@@ -1762,14 +1762,14 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( RES_DRAWFRMFMT != pFrmFmt->Which() &&
SFX_ITEM_SET == pFrmFmt->GetAttrSet().GetItemState( RES_URL, sal_True, &pItem ) )
{
String aURL( static_cast<const SwFmtURL*>(pItem)->GetURL() );
const bool bIntern = '#' == aURL.GetChar( 0 );
OUString aURL( static_cast<const SwFmtURL*>(pItem)->GetURL() );
const bool bIntern = '#' == aURL[0];
// Create the destination for internal links:
sal_Int32 nDestId = -1;
if ( bIntern )
{
aURL.Erase( 0, 1 );
aURL = aURL.copy( 1 );
mrSh.SwCrsrShell::ClearMark();
JumpToSwMark( &mrSh, aURL );
......@@ -1855,7 +1855,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle
const SwGetRefField* pField =
(SwGetRefField*)pFirst->GetFld();
const String& rRefName = pField->GetSetRefName();
const OUString& rRefName = pField->GetSetRefName();
mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() );
const SwRect& rDestRect = mrSh.GetCharRect();
......@@ -1897,7 +1897,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// #i44368# Links in Header/Footer
if ( bHeaderFooter )
{
const String aDummy;
const OUString aDummy;
MakeHeaderFooterLinks( *pPDFExtOutDevData, *pTNd, rLinkRect, nDestId, aDummy, true );
}
}
......@@ -2024,7 +2024,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum );
// Outline entry text
const String& rEntry = mrSh.getIDocumentOutlineNodesAccess()->getOutlineText( i );
const OUString& rEntry = mrSh.getIDocumentOutlineNodesAccess()->getOutlineText( i );
// Create a new outline item:
const sal_Int32 nOutlineId =
......@@ -2080,11 +2080,11 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
const std::vector< vcl::PDFExtOutDevBookmarkEntry >::const_iterator aIEnd = rBookmarks.end();
while ( aIBeg != aIEnd )
{
String aBookmarkName( aIBeg->aBookmark );
const bool bIntern = '#' == aBookmarkName.GetChar( 0 );
OUString aBookmarkName( aIBeg->aBookmark );
const bool bIntern = '#' == aBookmarkName[0];
if ( bIntern )
{
aBookmarkName.Erase( 0, 1 );
aBookmarkName = aBookmarkName.copy( 1 );
JumpToSwMark( &mrSh, aBookmarkName );
// Destination Rectangle
......
......@@ -394,9 +394,9 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
#if OSL_DEBUG_LEVEL > 1
// e.g., Schif-fahrt, referes to our string
const String aWord = xHyphWord->getWord();
const OUString aWord = xHyphWord->getWord();
// e.g., Schiff-fahrt, referes to the word after hyphenation
const String aHyphenatedWord = xHyphWord->getHyphenatedWord();
const OUString aHyphenatedWord = xHyphWord->getHyphenatedWord();
// e.g., Schif-fahrt: 5, referes to our string
const sal_uInt16 nHyphenationPos = xHyphWord->getHyphenationPos();
(void)nHyphenationPos;
......
......@@ -47,7 +47,7 @@ sal_Bool SwExpandPortion::GetExpTxt( const SwTxtSizeInfo&, OUString &rTxt ) cons
void SwExpandPortion::HandlePortion( SwPortionHandler& rPH ) const
{
String aString;
OUString aString;
rPH.Special( GetLen(), aString, GetWhichPor() );
}
......
......@@ -679,12 +679,12 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if( !g_pBreakIt->GetBreakIter().is() )
return;
const String& rTxt = rNode.GetTxt();
const OUString& rTxt = rNode.GetTxt();
//
// HIDDEN TEXT INFORMATION
//
Range aRange( 0, rTxt.Len() ? rTxt.Len() - 1 : 0 );
Range aRange( 0, !rTxt.isEmpty() ? rTxt.getLength() - 1 : 0 );
MultiSelection aHiddenMulti( aRange );
CalcHiddenRanges( rNode, aHiddenMulti );
......@@ -840,8 +840,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
xub_StrLen nEnd =
(xub_StrLen)g_pBreakIt->GetBreakIter()->endOfScript( rTxt, nChg, WEAK );
if( nEnd > rTxt.Len() )
nEnd = rTxt.Len();
if( nEnd > rTxt.getLength() )
nEnd = rTxt.getLength();
nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
......@@ -852,7 +852,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nChg = nEnd;
// Get next script type or set to weak in order to exit
sal_uInt8 nNextScript = ( nEnd < rTxt.Len() ) ?
sal_uInt8 nNextScript = ( nEnd < rTxt.getLength() ) ?
(sal_uInt8)g_pBreakIt->GetBreakIter()->getScriptType( rTxt, nEnd ) :
(sal_uInt8)WEAK;
......@@ -868,7 +868,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// UPDATE THE SCRIPT INFO ARRAYS:
//
while ( nChg < rTxt.Len() || ( aScriptChanges.empty() && !rTxt.Len() ) )
while ( nChg < rTxt.getLength() || ( aScriptChanges.empty() && rTxt.isEmpty() ) )
{
SAL_WARN_IF( i18n::ScriptType::WEAK == nScript,
"sw.core", "Inserting WEAK into SwScriptInfo structure" );
......@@ -877,8 +877,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
xub_StrLen nSearchStt = nChg;
nChg = (xub_StrLen)g_pBreakIt->GetBreakIter()->endOfScript( rTxt, nSearchStt, nScript );
if ( nChg > rTxt.Len() )
nChg = rTxt.Len();
if ( nChg > rTxt.getLength() )
nChg = rTxt.getLength();
// #i28203#
// for 'complex' portions, we make sure that a portion does not contain more
......@@ -891,7 +891,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
while( com::sun::star::i18n::CTLScriptType::CTL_UNKNOWN == nCurrentScriptType || nScriptType == nCurrentScriptType )
{
nNextCTLScriptStart = (xub_StrLen)ScriptTypeDetector::endOfCTLScriptType( rTxt, nNextCTLScriptStart );
if( nNextCTLScriptStart < rTxt.Len() && nNextCTLScriptStart < nChg )
if( nNextCTLScriptStart < rTxt.getLength() && nNextCTLScriptStart < nChg )
nCurrentScriptType = ScriptTypeDetector::getCTLScriptType( rTxt, nNextCTLScriptStart );
else
break;
......@@ -901,10 +901,10 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// special case for dotted circle since it can be used with complex
// before a mark, so we want it associated with the mark's script
if (nChg < rTxt.Len() && nChg > 0 && (i18n::ScriptType::WEAK ==
if (nChg < rTxt.getLength() && nChg > 0 && (i18n::ScriptType::WEAK ==
g_pBreakIt->GetBreakIter()->getScriptType(rTxt,nChg - 1)))
{
int8_t nType = u_charType(rTxt.GetChar(nChg) );
int8_t nType = u_charType(rTxt[nChg] );
if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
nType == U_COMBINING_SPACING_MARK )
{
......@@ -932,7 +932,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
while ( nLastCompression < nChg )
{
sal_Unicode cChar = rTxt.GetChar( nLastCompression );
sal_Unicode cChar = rTxt[ nLastCompression ];
// examine current character
switch ( cChar )
......@@ -1154,7 +1154,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
} // end of kashida search
}
if ( nChg < rTxt.Len() )
if ( nChg < rTxt.getLength() )
nScript = (sal_uInt8)g_pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
nLastCompression = nChg;
......
......@@ -387,7 +387,7 @@ sal_Bool SwLinePortion::GetExpTxt( const SwTxtSizeInfo &, OUString & ) const
void SwLinePortion::HandlePortion( SwPortionHandler& rPH ) const
{
String aString;
OUString aString;
rPH.Special( GetLen(), aString, GetWhichPor(), Height(), Width() );
}
......
......@@ -635,7 +635,7 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
else
pRubyFont = NULL;
String aStr( rRuby.GetText(), nOffs, STRING_LEN );
OUString aStr = rRuby.GetText().copy( nOffs );
SwFldPortion *pFld = new SwFldPortion( aStr, pRubyFont );
pFld->SetNextOffset( nOffs );
pFld->SetFollow( sal_True );
......
......@@ -94,7 +94,7 @@ void SwIsoRefPortion::Paint( const SwTxtPaintInfo &rInf ) const
void SwIsoRefPortion::HandlePortion( SwPortionHandler& rPH ) const
{
String aString;
OUString aString;
rPH.Special( GetLen(), aString, GetWhichPor() );
}
......
......@@ -530,12 +530,12 @@ void SwControlCharPortion::Paint( const SwTxtPaintInfo &rInf ) const
aTmpFont.SetProportion( nProp ); // a smaller font
SwFontSave aFontSave( rInf, &aTmpFont );
String aOutString;
OUString aOutString;
switch ( mcChar )
{
case CHAR_ZWSP :
aOutString = '/'; break;
aOutString = "/"; break;
// case CHAR_LRM :
// rTxt = sal_Unicode(0x2514); break;
// case CHAR_RLM :
......
......@@ -96,7 +96,7 @@ void SwIsoToxPortion::Paint( const SwTxtPaintInfo &rInf ) const
void SwIsoToxPortion::HandlePortion( SwPortionHandler& rPH ) const
{
String aString;
OUString aString;
rPH.Special( GetLen(), aString, GetWhichPor() );
}
......
......@@ -1546,7 +1546,7 @@ sal_Bool SwQuoVadisPortion::GetExpTxt( const SwTxtSizeInfo &, OUString &rTxt ) c
void SwQuoVadisPortion::HandlePortion( SwPortionHandler& rPH ) const
{
String aString( aExpand );
OUString aString( aExpand );
aString += aErgo;
rPH.Special( GetLen(), aString, GetWhichPor() );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment