LibreOffice Module filter (master) 1
Functions
msfilter::rtfutil Namespace Reference

Functions

OString OutHex (sal_uLong nHex, sal_uInt8 nLen)
 Outputs a single character in hex form. More...
 
OString OutChar (sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc, bool *pSuccess, bool bUnicode=true)
 Handles correct unicode and legacy export of a single character. More...
 
OString OutString (std::u16string_view rStr, rtl_TextEncoding eDestEnc, bool bUnicode=true)
 Handles correct unicode and legacy export of a string. More...
 
static bool TryOutString (std::u16string_view rStr, rtl_TextEncoding eDestEnc)
 Checks if lossless conversion of the string to eDestEnc is possible or not. More...
 
OString OutStringUpr (std::string_view pToken, std::u16string_view rStr, rtl_TextEncoding eDestEnc)
 Handles correct unicode and legacy export of a string, when a '{' \upr '{' keyword ansi_text '}{*' \ud '{' keyword Unicode_text '}}}' construct should be used. More...
 
int AsHex (char ch)
 Get the numeric value of a single character, representing a hex value. More...
 
OString WriteHex (const sal_uInt8 *pData, sal_uInt32 nSize, SvStream *pStream=nullptr, sal_uInt32 nLimit=64)
 Writes binary data as a hex dump. More...
 
bool ExtractOLE2FromObjdata (const OString &rObjdata, SvStream &rOle2)
 Extract OLE2 data from an \objdata hex dump. More...
 
bool StripMetafileHeader (const sal_uInt8 *&rpGraphicAry, sal_uInt64 &rSize)
 Strips the header of a WMF file. More...
 

Function Documentation

◆ AsHex()

MSFILTER_DLLPUBLIC int msfilter::rtfutil::AsHex ( char  ch)

Get the numeric value of a single character, representing a hex value.

Returns
-1 on failure

Definition at line 253 of file rtfutil.cxx.

References ch.

Referenced by ExtractOLE2FromObjdata().

◆ ExtractOLE2FromObjdata()

MSFILTER_DLLPUBLIC bool msfilter::rtfutil::ExtractOLE2FromObjdata ( const OString &  rObjdata,
SvStream rOle2 
)

◆ OutChar()

MSFILTER_DLLPUBLIC OString msfilter::rtfutil::OutChar ( sal_Unicode  c,
int pUCMode,
rtl_TextEncoding  eDestEnc,
bool *  pSuccess,
bool  bUnicode 
)

Handles correct unicode and legacy export of a single character.

Definition at line 129 of file rtfutil.cxx.

References aBuf, OOO_STRING_SVTOOLS_RTF_LINE, OOO_STRING_SVTOOLS_RTF_TAB, and OutHex().

Referenced by OutString(), and TryOutString().

◆ OutHex()

MSFILTER_DLLPUBLIC OString msfilter::rtfutil::OutHex ( sal_uLong  nHex,
sal_uInt8  nLen 
)

Outputs a single character in hex form.

Definition at line 98 of file rtfutil.cxx.

References n.

Referenced by OutChar().

◆ OutString()

MSFILTER_DLLPUBLIC OString msfilter::rtfutil::OutString ( std::u16string_view  rStr,
rtl_TextEncoding  eDestEnc,
bool  bUnicode = true 
)

Handles correct unicode and legacy export of a string.

Parameters
rStrthe string to export
eDestEncthe legacy encoding to use
bUnicodeif unicode output is wanted as well, or just legacy

Definition at line 213 of file rtfutil.cxx.

References aBuf, n, OOO_STRING_SVTOOLS_RTF_UC, and OutChar().

Referenced by OutStringUpr().

◆ OutStringUpr()

MSFILTER_DLLPUBLIC OString msfilter::rtfutil::OutStringUpr ( std::string_view  pToken,
std::u16string_view  rStr,
rtl_TextEncoding  eDestEnc 
)

Handles correct unicode and legacy export of a string, when a '{' \upr '{' keyword ansi_text '}{*' \ud '{' keyword Unicode_text '}}}' construct should be used.

Parameters
pTokenthe keyword
rStrthe text to export
eDestEncthe legacy encoding to use

Definition at line 242 of file rtfutil.cxx.

References OOO_STRING_SVTOOLS_RTF_IGNORE, OOO_STRING_SVTOOLS_RTF_UD, OOO_STRING_SVTOOLS_RTF_UPR, OutString(), and TryOutString().

◆ StripMetafileHeader()

MSFILTER_DLLPUBLIC bool msfilter::rtfutil::StripMetafileHeader ( const sal_uInt8 *&  rpGraphicAry,
sal_uInt64 &  rSize 
)

Strips the header of a WMF file.

Definition at line 379 of file rtfutil.cxx.

◆ TryOutString()

static bool msfilter::rtfutil::TryOutString ( std::u16string_view  rStr,
rtl_TextEncoding  eDestEnc 
)
static

Checks if lossless conversion of the string to eDestEnc is possible or not.

Definition at line 229 of file rtfutil.cxx.

References n, and OutChar().

Referenced by OutStringUpr().

◆ WriteHex()

MSFILTER_DLLPUBLIC OString msfilter::rtfutil::WriteHex ( const sal_uInt8 pData,
sal_uInt32  nSize,
SvStream pStream,
sal_uInt32  nLimit 
)

Writes binary data as a hex dump.

Definition at line 271 of file rtfutil.cxx.

References gentoken::i, pData, SAL_NEWLINE_STRING, SvStream::WriteChar(), and SvStream::WriteOString().