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