Kaydet (Commit) 41d229b2 authored tarafından Caolán McNamara's avatar Caolán McNamara

XubString->OUString

Change-Id: I72b2678c79401320c355c7b6635a6180b01202f1
üst a97e46f0
......@@ -1518,9 +1518,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
SwTwips nSpace = 0;
if( FILL_TAB != rFill.Mode() )
{
static sal_Char const sDoubleSpace[] = " ";
const XubString aTmp( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
const OUString aTmp(" ");
SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTmp, 0, 2 );
nSpace = pFnt->_GetTxtSize( aDrawInf ).Width()/2;
}
......
......@@ -537,25 +537,23 @@ bool SwTxtGuess::AlternativeSpelling( const SwTxtFormatInfo &rInf,
const xub_StrLen nPos )
{
// get word boundaries
xub_StrLen nWordLen;
Boundary aBound =
g_pBreakIt->GetBreakIter()->getWordBoundary( rInf.GetTxt(), nPos,
g_pBreakIt->GetLocale( rInf.GetFont()->GetLanguage() ),
WordType::DICTIONARY_WORD, sal_True );
nBreakStart = (xub_StrLen)aBound.startPos;
nWordLen = static_cast<xub_StrLen>(aBound.endPos - nBreakStart);
sal_Int32 nWordLen = aBound.endPos - nBreakStart;
// if everything else fails, we want to cut at nPos
nCutPos = nPos;
XubString aTxt( rInf.GetTxt().copy( nBreakStart, nWordLen ) );
OUString aTxt( rInf.GetTxt().copy( nBreakStart, nWordLen ) );
// check, if word has alternative spelling
Reference< XHyphenator > xHyph( ::GetHyphenator() );
OSL_ENSURE( xHyph.is(), "Hyphenator is missing");
//! subtract 1 since the UNO-interface is 0 based
xHyphWord = xHyph->queryAlternativeSpelling( OUString(aTxt),
xHyphWord = xHyph->queryAlternativeSpelling( aTxt,
g_pBreakIt->GetLocale( rInf.GetFont()->GetLanguage() ),
nPos - nBreakStart, rInf.GetHyphValues() );
return xHyphWord.is() && xHyphWord->isAlternativeSpelling();
......
......@@ -25,7 +25,6 @@
#include <libxml/xmlwriter.h>
#endif
class XubString;
class SwTxtSizeInfo;
class SwTxtPaintInfo;
class SwTxtFormatInfo;
......
......@@ -164,8 +164,7 @@ void SwKernPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.GetFont()->IsPaintBlank() )
{
static sal_Char const sDoubleSpace[] = " ";
XubString aTxtDouble( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
OUString aTxtDouble(" ");
//
SwRect aClipRect;
rInf.CalcRect( *this, &aClipRect, 0 );
......
......@@ -317,8 +317,6 @@ void SwDoDrawCapital::Do()
void SwDoDrawCapital::DrawSpace( Point &rPos )
{
static sal_Char const sDoubleSpace[] = " ";
long nDiff = rInf.GetPos().X() - rPos.X();
Point aPos( rPos );
......@@ -343,7 +341,7 @@ void SwDoDrawCapital::DrawSpace( Point &rPos )
{
rInf.ApplyAutoColor();
GetOut().DrawStretchText( aPos, nDiff,
XubString( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ), 0, 2 );
OUString(" "), 0, 2 );
}
rPos.X() = rInf.GetPos().X() + rInf.GetWidth();
}
......
......@@ -3067,15 +3067,15 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
{
case RES_TXTATR_FIELD:
{
XubString const aExpand(
OUString const aExpand(
static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
->ExpandField(true));
if( aExpand.Len() )
if (!aExpand.isEmpty())
{
++aDestIdx; // dahinter einfuegen;
OUString const ins(
rDestNd.InsertText( aExpand, aDestIdx));
SAL_INFO_IF(ins.getLength() != aExpand.Len(),
SAL_INFO_IF(ins.getLength() != aExpand.getLength(),
"sw.core", "GetExpandTxt lossage");
aDestIdx = nInsPos + nAttrStartIdx;
nInsPos = nInsPos + ins.getLength();
......
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