LibreOffice Module sc (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
oox::xls::RichString Class Reference

Contains string data and a list of formatting runs for a rich formatted string. More...

#include <richstring.hxx>

Collaboration diagram for oox::xls::RichString:
[legend]

Public Member Functions

sal_Int32 importText (const AttributeList &rAttribs)
 Appends and returns an index of a portion object for a plain string (t element). More...
 
sal_Int32 importRun ()
 Appends and returns an index of a portion object for a new formatting run (r element). More...
 
RichStringPhoneticRef importPhoneticRun (const AttributeList &rAttribs)
 Appends and returns a phonetic text object for a new phonetic run (rPh element). More...
 
void importPhoneticPr (const AttributeList &rAttribs, const WorkbookHelper &rHelper)
 Imports phonetic settings from the rPhoneticPr element. More...
 
void importString (SequenceInputStream &rStrm, bool bRich, const WorkbookHelper &rHelper)
 Imports a Unicode rich-string from the passed record stream. More...
 
void finalizeImport (const WorkbookHelper &rHelper)
 Final processing after import of all strings. More...
 
bool extractPlainString (OUString &orString, const oox::xls::Font *pFirstPortionFont) const
 Tries to extract a plain string from this object. More...
 
void convert (const css::uno::Reference< css::text::XText > &rxText)
 Converts the string and writes it into the passed XText, replace old contents of the text object,. More...
 
std::unique_ptr< EditTextObjectconvert (ScEditEngineDefaulter &rEE, const oox::xls::Font *pFont)
 
RichStringPortiongetPortion (sal_Int32 nPortionIdx)
 
void setAttributes (const AttributeList &rAttribs)
 
bool isPreserveSpace () const
 

Private Types

typedef RefVector< RichStringPhoneticPhoneticVector
 

Private Member Functions

sal_Int32 createPortion ()
 Creates, appends, and returns a new empty string portion. More...
 
RichStringPhoneticRef createPhonetic ()
 Creates, appends, and returns a new empty phonetic text portion. More...
 
void createTextPortions (std::u16string_view aText, FontPortionModelList &rPortions)
 Create base text portions from the passed string and character formatting. More...
 
void createPhoneticPortions (std::u16string_view aText, PhoneticPortionModelList &rPortions, sal_Int32 nBaseLen)
 Create phonetic text portions from the passed string and portion data. More...
 

Private Attributes

std::vector< RichStringPortionmaTextPortions
 
std::unique_ptr< PhoneticSettingsmxPhonSettings
 String portions with font data. More...
 
PhoneticVector maPhonPortions
 Phonetic settings for this string. More...
 
bool mbPreserveSpace = false
 Phonetic text portions. More...
 

Detailed Description

Contains string data and a list of formatting runs for a rich formatted string.

Definition at line 206 of file richstring.hxx.

Member Typedef Documentation

◆ PhoneticVector

Definition at line 255 of file richstring.hxx.

Member Function Documentation

◆ convert() [1/2]

void oox::xls::RichString::convert ( const css::uno::Reference< css::text::XText > &  rxText)

Converts the string and writes it into the passed XText, replace old contents of the text object,.

Parameters
rxTextThe XText interface of the target object.

Referenced by oox::xls::WorksheetHelper::putRichString().

◆ convert() [2/2]

std::unique_ptr< EditTextObject > oox::xls::RichString::convert ( ScEditEngineDefaulter rEE,
const oox::xls::Font pFont 
)

◆ createPhonetic()

RichStringPhoneticRef oox::xls::RichString::createPhonetic ( )
private

Creates, appends, and returns a new empty phonetic text portion.

Definition at line 431 of file richstring.cxx.

References maPhonPortions.

Referenced by createPhoneticPortions(), and importPhoneticRun().

◆ createPhoneticPortions()

void oox::xls::RichString::createPhoneticPortions ( std::u16string_view  aText,
PhoneticPortionModelList rPortions,
sal_Int32  nBaseLen 
)
private

◆ createPortion()

sal_Int32 oox::xls::RichString::createPortion ( )
private

Creates, appends, and returns a new empty string portion.

Definition at line 425 of file richstring.cxx.

References maTextPortions.

Referenced by createTextPortions(), importRun(), importString(), and importText().

◆ createTextPortions()

void oox::xls::RichString::createTextPortions ( std::u16string_view  aText,
FontPortionModelList rPortions 
)
private

◆ extractPlainString()

bool oox::xls::RichString::extractPlainString ( OUString &  orString,
const oox::xls::Font pFirstPortionFont 
) const

Tries to extract a plain string from this object.

Returns the string, if there is only one unformatted portion.

Definition at line 364 of file richstring.cxx.

References maPhonPortions, and maTextPortions.

◆ finalizeImport()

void oox::xls::RichString::finalizeImport ( const WorkbookHelper rHelper)

Final processing after import of all strings.

Definition at line 358 of file richstring.cxx.

References maTextPortions.

◆ getPortion()

RichStringPortion & oox::xls::RichString::getPortion ( sal_Int32  nPortionIdx)
inline

Definition at line 237 of file richstring.hxx.

References maTextPortions.

Referenced by createTextPortions(), and importString().

◆ importPhoneticPr()

void oox::xls::RichString::importPhoneticPr ( const AttributeList rAttribs,
const WorkbookHelper rHelper 
)

Imports phonetic settings from the rPhoneticPr element.

Definition at line 323 of file richstring.cxx.

References mxPhonSettings.

◆ importPhoneticRun()

RichStringPhoneticRef oox::xls::RichString::importPhoneticRun ( const AttributeList rAttribs)

Appends and returns a phonetic text object for a new phonetic run (rPh element).

Definition at line 316 of file richstring.cxx.

References createPhonetic().

◆ importRun()

sal_Int32 oox::xls::RichString::importRun ( )

Appends and returns an index of a portion object for a new formatting run (r element).

Definition at line 304 of file richstring.cxx.

References createPortion().

◆ importString()

void oox::xls::RichString::importString ( SequenceInputStream rStrm,
bool  bRich,
const WorkbookHelper rHelper 
)

◆ importText()

sal_Int32 oox::xls::RichString::importText ( const AttributeList rAttribs)

Appends and returns an index of a portion object for a plain string (t element).

Definition at line 297 of file richstring.cxx.

References createPortion(), and setAttributes().

◆ isPreserveSpace()

bool oox::xls::RichString::isPreserveSpace ( ) const
inline

Definition at line 241 of file richstring.hxx.

References mbPreserveSpace.

◆ setAttributes()

void oox::xls::RichString::setAttributes ( const AttributeList rAttribs)

Definition at line 309 of file richstring.cxx.

References oox::AttributeList::getString(), and mbPreserveSpace.

Referenced by importText().

Member Data Documentation

◆ maPhonPortions

PhoneticVector oox::xls::RichString::maPhonPortions
private

Phonetic settings for this string.

Definition at line 259 of file richstring.hxx.

Referenced by createPhonetic(), createPhoneticPortions(), and extractPlainString().

◆ maTextPortions

std::vector<RichStringPortion> oox::xls::RichString::maTextPortions
private

◆ mbPreserveSpace

bool oox::xls::RichString::mbPreserveSpace = false
private

Phonetic text portions.

Definition at line 260 of file richstring.hxx.

Referenced by isPreserveSpace(), and setAttributes().

◆ mxPhonSettings

std::unique_ptr<PhoneticSettings> oox::xls::RichString::mxPhonSettings
private

String portions with font data.

Definition at line 258 of file richstring.hxx.

Referenced by importPhoneticPr(), and importString().


The documentation for this class was generated from the following files: