diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-07 12:31:42 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-08 15:44:34 -0400 |
commit | 80df5277585d69be5c3d5f32184db94831113f95 (patch) | |
tree | 6e3e504b1d593f6d509b4c057e0c4dca4b1dfaa6 | |
parent | f4bda54cdaf13cf96ff7c9327036568825c8c323 (diff) |
Avoid exposing aText; encapsulate it.
Change-Id: I7f6ba0735830b55e35b7e352a5e31fdda47a8dfb
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 24 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 2 |
3 files changed, 20 insertions, 10 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index d1e1a6e763c8..c7d99744f9b5 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -164,6 +164,16 @@ sal_uIntPtr ContentInfo::GetStringIDIgnoreCase( const svl::SharedStringPool& rPo return rPool.getIdentifierIgnoreCase(aText); } +OUString ContentInfo::GetText() const +{ + return aText; +} + +void ContentInfo::SetText( const OUString& rStr ) +{ + aText = rStr; +} + const WrongList* ContentInfo::GetWrongList() const { return mpWrongs.get(); @@ -1341,7 +1351,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) // The Text... OString aByteString = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStream); - pC->GetText() = OStringToOUString(aByteString, eSrcEncoding); + pC->SetText(OStringToOUString(aByteString, eSrcEncoding)); // StyleName and Family... pC->GetStyle() = rIStream.ReadUniOrByteString(eSrcEncoding); @@ -1378,7 +1388,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) sal_Char cEncodedChar = aByteString[nStart]; sal_Unicode cChar = OUString(&cEncodedChar, 1, ((SvxCharSetColorItem*)pItem)->GetCharSet()).toChar(); - pC->GetText() = pC->GetText().replaceAt(nStart, 1, OUString(cChar)); + pC->SetText(pC->GetText().replaceAt(nStart, 1, OUString(cChar))); } else { @@ -1390,7 +1400,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) // Convert CH_FEATURE to CH_FEATURE_OLD DBG_ASSERT( (sal_uInt8) aByteString[nStart] == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" ); if ( (sal_uInt8) aByteString[nStart] == CH_FEATURE_OLD ) - pC->GetText() = pC->GetText().replaceAt( nStart, 1, OUString(CH_FEATURE) ); + pC->SetText(pC->GetText().replaceAt(nStart, 1, OUString(CH_FEATURE))); } } } @@ -1405,7 +1415,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { - pC->GetText() = OStringToOUString(aByteString, RTL_TEXTENCODING_SYMBOL); + pC->SetText(OStringToOUString(aByteString, RTL_TEXTENCODING_SYMBOL)); bSymbolPara = true; } } @@ -1422,7 +1432,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) // Not correctly converted OString aPart(aByteString.copy(rAttr.GetStart(), rAttr.GetEnd()-rAttr.GetStart())); OUString aNew(OStringToOUString(aPart, rFontItem.GetCharSet())); - pC->GetText() = pC->GetText().replaceAt( rAttr.GetStart(), rAttr.GetEnd()-rAttr.GetStart(), aNew ); + pC->SetText(pC->GetText().replaceAt(rAttr.GetStart(), rAttr.GetEnd()-rAttr.GetStart(), aNew)); } // Convert StarMath and StarBats to StarSymbol @@ -1445,7 +1455,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) DBG_ASSERT( cOld >= 0xF000, "cOld not converted?!" ); sal_Unicode cConv = ConvertFontToSubsFontChar( hConv, cOld ); if ( cConv ) - pC->GetText() = pC->GetText().replaceAt( nChar, 1, OUString(cConv) ); + pC->SetText(pC->GetText().replaceAt(nChar, 1, OUString(cConv))); } DestroyFontToSubsFontConverter( hConv ); @@ -1479,7 +1489,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) DBG_ASSERT( cOld >= 0xF000, "cOld not converted?!" ); sal_Unicode cConv = ConvertFontToSubsFontChar( hConv, cOld ); if ( cConv ) - pC->GetText() = pC->GetText().replaceAt( nChar, 1, OUString(cConv) ); + pC->SetText(pC->GetText().replaceAt(nChar, 1, OUString(cConv))); } } diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 20dafe929db5..964c97861c45 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -145,16 +145,16 @@ public: void NormalizeString( svl::SharedStringPool& rPool ); sal_uIntPtr GetStringID( const svl::SharedStringPool& rPool ) const; sal_uIntPtr GetStringIDIgnoreCase( const svl::SharedStringPool& rPool ) const; + OUString GetText() const; + void SetText( const OUString& rStr ); const XEditAttributesType& GetAttribs() const { return aAttribs; } XEditAttributesType& GetAttribs() { return aAttribs; } - const OUString& GetText() const { return aText; } const OUString& GetStyle() const { return aStyle; } const SfxItemSet& GetParaAttribs() const { return aParaAttribs; } SfxStyleFamily GetFamily() const { return eFamily; } - OUString& GetText() { return aText; } OUString& GetStyle() { return aStyle; } SfxItemSet& GetParaAttribs() { return aParaAttribs; } SfxStyleFamily& GetFamily() { return eFamily; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index ada5a54ba73c..fa8110b29772 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1084,7 +1084,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool } // The Text... - pC->GetText() = pNode->Copy( nStartPos, nEndPos-nStartPos ); + pC->SetText(pNode->Copy(nStartPos, nEndPos-nStartPos)); // and the Attribute... sal_uInt16 nAttr = 0; |