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

XubString->OUString

Change-Id: I9ce007261555008a438b90b36a888a8d4cb4f140
üst 07aade88
......@@ -700,7 +700,7 @@ public:
// Calls HyphenateWord() of Hyphenator
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XHyphenatedWord >
HyphWord( const String &rTxt, const sal_uInt16 nMinTrail );
HyphWord( const OUString &rTxt, const sal_uInt16 nMinTrail );
const com::sun::star::beans::PropertyValues &
GetHyphValues() const;
......
......@@ -372,7 +372,7 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
sal_Int32 nNextOfst = aExpand.getLength() - nRest;
if ( IsQuoVadisPortion() )
nNextOfst = nNextOfst + ((SwQuoVadisPortion*)this)->GetContTxt().Len();
nNextOfst = nNextOfst + ((SwQuoVadisPortion*)this)->GetContTxt().getLength();
XubString aNew( aExpand, nNextOfst, STRING_LEN );
aExpand = aExpand.copy( 0, nNextOfst );
......
......@@ -36,9 +36,9 @@ class SwFtnPortion : public SwFldPortion
bool mbPreferredScriptTypeSet;
sal_uInt8 mnPreferredScriptType;
public:
SwFtnPortion( const XubString &rExpand, SwTxtFtn *pFtn,
SwFtnPortion( const OUString &rExpand, SwTxtFtn *pFtn,
KSHORT nOrig = KSHRT_MAX );
inline KSHORT& Orig() { return nOrigHeight; }
KSHORT& Orig() { return nOrigHeight; }
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
......@@ -59,7 +59,7 @@ public:
class SwFtnNumPortion : public SwNumberPortion
{
public:
inline SwFtnNumPortion( const XubString &rExpand, SwFont *pFntL )
SwFtnNumPortion( const OUString &rExpand, SwFont *pFntL )
: SwNumberPortion( rExpand, pFntL, sal_True, sal_False, 0, false )
{ SetWhichPor( POR_FTNNUM ); }
......@@ -72,16 +72,16 @@ public:
class SwQuoVadisPortion : public SwFldPortion
{
XubString aErgo;
OUString aErgo;
public:
SwQuoVadisPortion( const XubString &rExp, const XubString& rStr );
SwQuoVadisPortion( const OUString &rExp, const OUString& rStr );
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
inline void SetNumber( const XubString& rStr ) { aErgo = rStr; }
inline const OUString GetQuoTxt() const { return aExpand; }
inline const XubString &GetContTxt() const { return aErgo; }
void SetNumber( const OUString& rStr ) { aErgo = rStr; }
const OUString GetQuoTxt() const { return aExpand; }
const OUString &GetContTxt() const { return aErgo; }
// Field cloner for SplitGlue
virtual SwFldPortion *Clone( const OUString &rExpand ) const;
......@@ -99,7 +99,7 @@ public:
class SwErgoSumPortion : public SwFldPortion
{
public:
SwErgoSumPortion( const XubString &rExp, const XubString& rStr );
SwErgoSumPortion( const OUString &rExp, const OUString& rStr );
virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
......
......@@ -28,7 +28,10 @@
class SwHyphPortion : public SwExpandPortion
{
public:
inline SwHyphPortion( ) { SetWhichPor( POR_HYPH ); }
SwHyphPortion()
{
SetWhichPor( POR_HYPH );
}
virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
......@@ -44,9 +47,14 @@ public:
class SwHyphStrPortion : public SwHyphPortion
{
XubString aExpand;
OUString aExpand;
public:
inline SwHyphStrPortion( const XubString &rStr );
SwHyphStrPortion(const OUString &rStr)
: aExpand(rStr + "-")
{
SetWhichPor( POR_HYPHSTR );
}
virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
// Accessibility: pass information about this portion to the PortionHandler
......@@ -90,18 +98,11 @@ public:
class SwSoftHyphStrPortion : public SwHyphStrPortion
{
public:
SwSoftHyphStrPortion( const XubString &rStr );
SwSoftHyphStrPortion( const OUString &rStr );
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
OUTPUT_OPERATOR
};
inline SwHyphStrPortion::SwHyphStrPortion( const XubString &rStr )
: aExpand( rStr )
{
aExpand += '-';
SetWhichPor( POR_HYPHSTR );
}
CLASSIO( SwHyphPortion )
CLASSIO( SwHyphStrPortion )
CLASSIO( SwSoftHyphPortion )
......
......@@ -305,7 +305,7 @@ public:
xub_StrLen GetParLen() const;
// For Prepare()
sal_Bool UpdateQuoVadis( const XubString &rQuo );
sal_Bool UpdateQuoVadis( const OUString &rQuo );
// Flags
inline void SetFly( const sal_Bool bNew = sal_True ) { bFlys = bNew; }
......@@ -349,7 +349,7 @@ public:
SvStream &WriteSwg( SvStream& rStream ); //$ ostream
// Set nErgo in the QuoVadisPortion
void SetErgoSumNum( const XubString &rErgo );
void SetErgoSumNum( const OUString &rErgo );
const SwDropPortion *FindDropPortion() const;
......
......@@ -999,7 +999,7 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const
SwFmtFtn& rFtn = (SwFmtFtn&)pFtn->GetFtn();
SwDoc *pDoc = pFrm->GetNode()->GetDoc();
XubString aFtnTxt( rFtn.GetViewNumStr( *pDoc, sal_True ));
OUString aFtnTxt( rFtn.GetViewNumStr( *pDoc, sal_True ));
const SwEndNoteInfo* pInfo;
if( rFtn.IsEndNote() )
......@@ -1039,7 +1039,7 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const
* SwTxtFormatter::NewErgoSumPortion()
*************************************************************************/
XubString lcl_GetPageNumber( const SwPageFrm* pPage )
OUString lcl_GetPageNumber( const SwPageFrm* pPage )
{
OSL_ENSURE( pPage, "GetPageNumber: Homeless TxtFrm" );
MSHORT nVirtNum = pPage->GetVirtPageNum();
......@@ -1065,7 +1065,7 @@ SwErgoSumPortion *SwTxtFormatter::NewErgoSumPortion( SwTxtFormatInfo &rInf ) con
const SwPageFrm* pQuoPage = pQuoFrm->FindPageFrm();
if( pPage == pQuoFrm->FindPageFrm() )
return 0; // Wenn der QuoVadis auf der selben (spaltigen) Seite steht
const XubString aPage = lcl_GetPageNumber( pPage );
const OUString aPage = lcl_GetPageNumber( pPage );
SwParaPortion *pPara = pQuoFrm->GetPara();
if( pPara )
pPara->SetErgoSumNum( aPage );
......@@ -1142,7 +1142,7 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset )
const KSHORT nOldRealWidth = rInf.RealWidth();
rInf.RealWidth( nOldRealWidth - nLastLeft );
XubString aErgo = lcl_GetPageNumber( pErgoFrm->FindPageFrm() );
OUString aErgo = lcl_GetPageNumber( pErgoFrm->FindPageFrm() );
SwQuoVadisPortion *pQuo = new SwQuoVadisPortion(rFtnInfo.aQuoVadis, aErgo );
pQuo->SetAscent( rInf.GetAscent() );
pQuo->Height( rInf.GetTxtHeight() );
......@@ -1401,7 +1401,7 @@ SwFtnSave::~SwFtnSave()
* SwFtnPortion::SwFtnPortion()
*************************************************************************/
SwFtnPortion::SwFtnPortion( const XubString &rExpand,
SwFtnPortion::SwFtnPortion( const OUString &rExpand,
SwTxtFtn *pFootn, KSHORT nReal )
: SwFldPortion( rExpand, 0 )
, pFtn(pFootn)
......@@ -1484,9 +1484,11 @@ void SwFtnPortion::SetPreferredScriptType( sal_uInt8 nPreferredScriptType )
*************************************************************************/
SwFldPortion *SwQuoVadisPortion::Clone( const OUString &rExpand ) const
{ return new SwQuoVadisPortion( rExpand, aErgo ); }
{
return new SwQuoVadisPortion( rExpand, aErgo );
}
SwQuoVadisPortion::SwQuoVadisPortion( const XubString &rExp, const XubString& rStr )
SwQuoVadisPortion::SwQuoVadisPortion( const OUString &rExp, const OUString& rStr )
: SwFldPortion( rExp ), aErgo(rStr)
{
SetLen(0);
......@@ -1575,7 +1577,7 @@ SwFldPortion *SwErgoSumPortion::Clone( const OUString &rExpand ) const
return new SwErgoSumPortion( rExpand, OUString() );
}
SwErgoSumPortion::SwErgoSumPortion( const XubString &rExp, const XubString& rStr )
SwErgoSumPortion::SwErgoSumPortion(const OUString &rExp, const OUString& rStr)
: SwFldPortion( rExp )
{
SetLen(0);
......@@ -1618,7 +1620,7 @@ sal_Bool SwErgoSumPortion::Format( SwTxtFormatInfo &rInf )
* SwParaPortion::SetErgoSumNum()
*************************************************************************/
void SwParaPortion::SetErgoSumNum( const XubString& rErgo )
void SwParaPortion::SetErgoSumNum( const OUString& rErgo )
{
SwLineLayout *pLay = this;
while( pLay->GetNext() )
......@@ -1643,7 +1645,7 @@ void SwParaPortion::SetErgoSumNum( const XubString& rErgo )
* Wird im SwTxtFrm::Prepare() gerufen
*************************************************************************/
sal_Bool SwParaPortion::UpdateQuoVadis( const XubString &rQuo )
sal_Bool SwParaPortion::UpdateQuoVadis( const OUString &rQuo )
{
SwLineLayout *pLay = this;
while( pLay->GetNext() )
......
......@@ -41,9 +41,9 @@ using namespace ::com::sun::star::i18n;
*************************************************************************/
Reference< XHyphenatedWord > SwTxtFormatInfo::HyphWord(
const XubString &rTxt, const MSHORT nMinTrail )
const OUString &rTxt, const MSHORT nMinTrail )
{
if( rTxt.Len() < 4 || m_pFnt->IsSymbol(m_pVsh) )
if( rTxt.getLength() < 4 || m_pFnt->IsSymbol(m_pVsh) )
return 0;
Reference< XHyphenator > xHyph = ::GetHyphenator();
Reference< XHyphenatedWord > xHyphWord;
......@@ -51,7 +51,7 @@ Reference< XHyphenatedWord > SwTxtFormatInfo::HyphWord(
if( xHyph.is() )
xHyphWord = xHyph->hyphenate( OUString(rTxt),
g_pBreakIt->GetLocale( m_pFnt->GetLanguage() ),
rTxt.Len() - nMinTrail, GetHyphValues() );
rTxt.getLength() - nMinTrail, GetHyphValues() );
return xHyphWord;
}
......@@ -237,7 +237,7 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
bRet = 0 != nLen;
if( bRet )
{
XubString aSelTxt( rInf.GetTxt().copy(nWrdStart, nLen) );
OUString aSelTxt( rInf.GetTxt().copy(nWrdStart, nLen) );
{
MSHORT nMinTrail = 0;
......@@ -293,7 +293,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
aAltSpell = SvxGetAltSpelling( xHyphWord );
OSL_ENSURE( aAltSpell.bIsAltSpelling, "no alternatve spelling" );
XubString aAltTxt = aAltSpell.aReplacement;
OUString aAltTxt = aAltSpell.aReplacement;
nPorEnd = aAltSpell.nChangedPos + rGuess.BreakStart() - rGuess.FieldDiff();
xub_StrLen nTmpLen = 0;
......@@ -308,7 +308,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
}
// length of pHyphPor is adjusted
pHyphPor->SetLen( aAltTxt.Len() + 1 );
pHyphPor->SetLen( aAltTxt.getLength() + 1 );
(SwPosSize&)(*pHyphPor) = pHyphPor->GetTxtSize( rInf );
pHyphPor->SetLen( aAltSpell.nChangedLength + nTmpLen );
}
......@@ -635,7 +635,7 @@ void SwSoftHyphStrPortion::Paint( const SwTxtPaintInfo &rInf ) const
SwHyphStrPortion::Paint( rInf );
}
SwSoftHyphStrPortion::SwSoftHyphStrPortion( const XubString &rStr )
SwSoftHyphStrPortion::SwSoftHyphStrPortion( const OUString &rStr )
: SwHyphStrPortion( rStr )
{
SetLen( 1 );
......
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