LibreOffice Module sc (master) 1
Public Member Functions | Static Public Member Functions | List of all members
XclExpStringHelper Class Reference

This class provides methods to create an XclExpString. More...

#include <xehelper.hxx>

Public Member Functions

 XclExpStringHelper (const XclExpStringHelper &)=delete
 removes copy constructor More...
 
const XclExpStringHelperoperator= (const XclExpStringHelper &)=delete
 remove copy-assignment operator More...
 
 XclExpStringHelper ()=delete
 We don't want anybody to instantiate this class, since it is just a collection of static methods. More...
 

Static Public Member Functions

static XclExpStringRef CreateString (const XclExpRoot &rRoot, const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
 Creates a new unformatted string from the passed string. More...
 
static XclExpStringRef CreateString (const XclExpRoot &rRoot, sal_Unicode cChar, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
 Creates a new unformatted string from the passed character. More...
 
static void AppendString (XclExpString &rXclString, const XclExpRoot &rRoot, std::u16string_view rString)
 Appends an unformatted string to an Excel string object. More...
 
static void AppendChar (XclExpString &rXclString, const XclExpRoot &rRoot, sal_Unicode cChar)
 Appends a character to an Excel string object. More...
 
static XclExpStringRef CreateCellString (const XclExpRoot &rRoot, const OUString &rString, const ScPatternAttr *pCellAttr, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
 Creates a new formatted string from a Calc string cell. More...
 
static XclExpStringRef CreateCellString (const XclExpRoot &rRoot, const EditTextObject &rEditText, const ScPatternAttr *pCellAttr, XclExpHyperlinkHelper &rLinkHelper, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
 Creates a new formatted string from a Calc edit cell. More...
 
static XclExpStringRef CreateString (const XclExpRoot &rRoot, const SdrTextObj &rTextObj, XclStrFlags nFlags=XclStrFlags::NONE)
 Creates a new formatted string from a drawing text box. More...
 
static XclExpStringRef CreateString (const XclExpRoot &rRoot, const EditTextObject &rEditObj, XclStrFlags nFlags=XclStrFlags::NONE)
 Creates a new formatted string from an edit text string. More...
 
static sal_Int16 GetLeadingScriptType (const XclExpRoot &rRoot, const OUString &rString)
 Returns the script type first text portion different to WEAK, or the system default script type, if there is only weak script in the passed string. More...
 

Detailed Description

This class provides methods to create an XclExpString.

@descr The string can be created from an edit engine text object or directly from a Calc edit cell.

Definition at line 214 of file xehelper.hxx.

Constructor & Destructor Documentation

◆ XclExpStringHelper() [1/2]

XclExpStringHelper::XclExpStringHelper ( const XclExpStringHelper )
delete

removes copy constructor

◆ XclExpStringHelper() [2/2]

XclExpStringHelper::XclExpStringHelper ( )
delete

We don't want anybody to instantiate this class, since it is just a collection of static methods.

Member Function Documentation

◆ AppendChar()

void XclExpStringHelper::AppendChar ( XclExpString rXclString,
const XclExpRoot rRoot,
sal_Unicode  cChar 
)
static

Appends a character to an Excel string object.

@descr Selects the correct Append() function depending on the current BIFF version contained in the passed XclExpRoot object.

Parameters
rXclStringThe Excel string object.
rStringThe source string.

Definition at line 563 of file xehelper.cxx.

References XclExpString::Append(), XclExpString::AppendByte(), EXC_BIFF8, XclRoot::GetBiff(), and XclRoot::GetTextEncoding().

Referenced by CreateString().

◆ AppendString()

void XclExpStringHelper::AppendString ( XclExpString rXclString,
const XclExpRoot rRoot,
std::u16string_view  rString 
)
static

Appends an unformatted string to an Excel string object.

@descr Selects the correct Append() function depending on the current BIFF version contained in the passed XclExpRoot object.

Parameters
rXclStringThe Excel string object.
rStringThe source string.

Definition at line 555 of file xehelper.cxx.

References XclExpString::Append(), XclExpString::AppendByte(), EXC_BIFF8, XclRoot::GetBiff(), and XclRoot::GetTextEncoding().

Referenced by XclExpChSourceLink::AppendString(), and XclExpChSourceLink::ConvertStringSequence().

◆ CreateCellString() [1/2]

XclExpStringRef XclExpStringHelper::CreateCellString ( const XclExpRoot rRoot,
const EditTextObject rEditText,
const ScPatternAttr pCellAttr,
XclExpHyperlinkHelper rLinkHelper,
XclStrFlags  nFlags = XclStrFlags::NONE,
sal_uInt16  nMaxLen = EXC_STR_MAXLEN 
)
static

Creates a new formatted string from a Calc edit cell.

@descr Creates a Unicode string or a byte string, depending on the current BIFF version contained in the passed XclExpRoot object.

Parameters
rEditCellThe Calc edit cell object.
pCellAttrThe set item containing the cell formatting.
rLinkHelperHelper object for hyperlink conversion.
nFlagsModifiers for string export.
nMaxLenThe maximum number of characters to store in this string.
Returns
The new string object (shared pointer).

Definition at line 578 of file xehelper.cxx.

References ScPatternAttr::FillToEditItemSet(), ScDocument::GetDefPattern(), XclRoot::GetDoc(), XclRoot::GetEditEngine(), EditEngine::GetEmptyItemSet(), ScPatternAttr::GetItemSet(), ScEditEngineDefaulter::SetDefaults(), ScEditEngineDefaulter::SetTextCurrentDefaults(), and EditEngine::SetUpdateLayout().

◆ CreateCellString() [2/2]

XclExpStringRef XclExpStringHelper::CreateCellString ( const XclExpRoot rRoot,
const OUString &  rString,
const ScPatternAttr pCellAttr,
XclStrFlags  nFlags = XclStrFlags::NONE,
sal_uInt16  nMaxLen = EXC_STR_MAXLEN 
)
static

Creates a new formatted string from a Calc string cell.

@descr Creates a Unicode string or a byte string, depending on the current BIFF version contained in the passed XclExpRoot object. May create a formatted string object, if the cell text contains different script types.

Parameters
rStringCellThe Calc string cell object.
pCellAttrThe set item containing the cell formatting.
nFlagsModifiers for string export.
nMaxLenThe maximum number of characters to store in this string.
Returns
The new string object (shared pointer).

Definition at line 571 of file xehelper.cxx.

Referenced by XclExpChTrCellContent::GetCellData(), and XclExpLabelCell::XclExpLabelCell().

◆ CreateString() [1/4]

XclExpStringRef XclExpStringHelper::CreateString ( const XclExpRoot rRoot,
const EditTextObject rEditObj,
XclStrFlags  nFlags = XclStrFlags::NONE 
)
static

Creates a new formatted string from an edit text string.

Parameters
rEditObjThe edittext object.
nFlagsModifiers for string export.
Returns
The new string object.

Definition at line 631 of file xehelper.cxx.

References EXC_FONT_APP, EXC_MAXRECSIZE_BIFF8, EXC_STR_MAXLEN, XclRoot::GetDrawEditEngine(), EditEngine::SetText(), and EditEngine::SetUpdateLayout().

◆ CreateString() [2/4]

XclExpStringRef XclExpStringHelper::CreateString ( const XclExpRoot rRoot,
const OUString &  rString,
XclStrFlags  nFlags = XclStrFlags::NONE,
sal_uInt16  nMaxLen = EXC_STR_MAXLEN 
)
static

Creates a new unformatted string from the passed string.

@descr Creates a Unicode string or a byte string, depending on the current BIFF version contained in the passed XclExpRoot object.

Parameters
rStringThe source string.
nFlagsModifiers for string export.
nMaxLenThe maximum number of characters to store in this string.
Returns
The new string object (shared pointer).

Definition at line 536 of file xehelper.cxx.

References EXC_BIFF8, XclRoot::GetBiff(), and XclRoot::GetTextEncoding().

Referenced by XclExpChSourceLink::ConvertString(), XclExpChSourceLink::ConvertStringSequence(), CreateString(), and XclExpNote::XclExpNote().

◆ CreateString() [3/4]

XclExpStringRef XclExpStringHelper::CreateString ( const XclExpRoot rRoot,
const SdrTextObj rTextObj,
XclStrFlags  nFlags = XclStrFlags::NONE 
)
static

Creates a new formatted string from a drawing text box.

@descr Creates a Unicode string or a byte string, depending on the current BIFF version contained in the passed XclExpRoot object.

Parameters
rTextObjThe text box object.
nFlagsModifiers for string export.
Returns
The new string object (shared pointer).

Definition at line 602 of file xehelper.cxx.

References CreateString(), EXC_FONT_APP, EXC_MAXRECSIZE_BIFF8, EXC_STR_MAXLEN, XclRoot::GetDrawEditEngine(), SdrTextObj::GetOutlinerParaObject(), EditEngine::SetText(), and EditEngine::SetUpdateLayout().

◆ CreateString() [4/4]

XclExpStringRef XclExpStringHelper::CreateString ( const XclExpRoot rRoot,
sal_Unicode  cChar,
XclStrFlags  nFlags = XclStrFlags::NONE,
sal_uInt16  nMaxLen = EXC_STR_MAXLEN 
)
static

Creates a new unformatted string from the passed character.

@descr Creates a Unicode string or a byte string, depending on the current BIFF version contained in the passed XclExpRoot object.

Parameters
cCharThe source character. The NUL character is explicitly allowed.
nFlagsModifiers for string export.
nMaxLenThe maximum number of characters to store in this string.
Returns
The new string object (shared pointer).

Definition at line 547 of file xehelper.cxx.

References AppendChar(), and CreateString().

◆ GetLeadingScriptType()

sal_Int16 XclExpStringHelper::GetLeadingScriptType ( const XclExpRoot rRoot,
const OUString &  rString 
)
static

Returns the script type first text portion different to WEAK, or the system default script type, if there is only weak script in the passed string.

Definition at line 650 of file xehelper.cxx.

References ScDocument::GetBreakIterator(), XclRoot::GetDefApiScript(), and XclRoot::GetDoc().

Referenced by XclExpChSourceLink::ConvertStringSequence(), and XclExpFormulaCell::XclExpFormulaCell().

◆ operator=()

const XclExpStringHelper & XclExpStringHelper::operator= ( const XclExpStringHelper )
delete

remove copy-assignment operator


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