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