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

Contains static methods used anywhere in the filters. More...

#include <ftools.hxx>

Public Member Functions

 ScfTools ()=delete
 We don't want anybody to instantiate this class, since it is just a collection of static items. More...
 
 ScfTools (const ScfTools &)=delete
 
const ScfToolsoperator= (const ScfTools &)=delete
 

Static Public Member Functions

static void ReadLongDouble (SvStream &rStrm, double &fResult)
 Reads a 10-byte-long-double and converts it to double. More...
 
static rtl_TextEncoding GetSystemTextEncoding ()
 Returns system text encoding for byte string conversion. More...
 
static OUString GetHexStr (sal_uInt16 nValue)
 Returns a string representing the hexadecimal value of nValue. More...
 
static sal_uInt8 GetMixedColorComp (sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans)
 Mixes RGB components with given transparence. More...
 
static Color GetMixedColor (const Color &rFore, const Color &rBack, sal_uInt8 nTrans)
 Mixes colors with given transparence. More...
 
static OUString ConvertToScDefinedName (const OUString &rName)
 Converts a string to a valid Calc defined name or database range name. More...
 
static tools::SvRef< SotStorageOpenStorageRead (tools::SvRef< SotStorage > const &xStrg, const OUString &rStrgName)
 Tries to open an existing storage with the specified name in the passed storage (read-only). More...
 
static tools::SvRef< SotStorageOpenStorageWrite (tools::SvRef< SotStorage > const &xStrg, const OUString &rStrgName)
 Creates and opens a storage with the specified name in the passed storage (read/write). More...
 
static tools::SvRef< SotStorageStreamOpenStorageStreamRead (tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName)
 Tries to open an existing stream with the specified name in the passed storage (read-only). More...
 
static tools::SvRef< SotStorageStreamOpenStorageStreamWrite (tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName)
 Creates and opens a stream with the specified name in the passed storage (read/write). More...
 
static bool CheckItem (const SfxItemSet &rItemSet, sal_uInt16 nWhichId, bool bDeep)
 Returns true, if the passed item set contains the item. More...
 
static bool CheckItems (const SfxItemSet &rItemSet, const sal_uInt16 *pnWhichIds, bool bDeep)
 Returns true, if the passed item set contains at least one of the items. More...
 
static void PutItem (SfxItemSet &rItemSet, const SfxPoolItem &rItem, sal_uInt16 nWhichId, bool bSkipPoolDef)
 Puts the item into the passed item set. More...
 
static void PutItem (SfxItemSet &rItemSet, const SfxPoolItem &rItem, bool bSkipPoolDef)
 Puts the item into the passed item set. More...
 
static ScStyleSheetMakeCellStyleSheet (ScStyleSheetPool &rPool, const OUString &rStyleName, bool bForceName)
 Creates and returns a cell style sheet and inserts it into the pool. More...
 
static ScStyleSheetMakePageStyleSheet (ScStyleSheetPool &rPool, const OUString &rStyleName, bool bForceName)
 Creates and returns a page style sheet and inserts it into the pool. More...
 
static OString read_zeroTerminated_uInt8s_ToOString (SvStream &rStrm, sal_Int32 &rnBytesLeft)
 Reads and returns a zero terminated byte string and decreases a stream counter. More...
 
static OUString read_zeroTerminated_uInt8s_ToOUString (SvStream &rStrm, sal_Int32 &rnBytesLeft, rtl_TextEncoding eTextEnc)
 Reads and returns a zero terminated byte string and decreases a stream counter. More...
 
static void AppendCString (SvStream &rStrm, OUString &rString, rtl_TextEncoding eTextEnc)
 Appends a zero terminated byte string. More...
 
static const OUString & GetHTMLDocName ()
 Returns the built-in range name for an HTML document. More...
 
static const OUString & GetHTMLTablesName ()
 Returns the built-in range name for all HTML tables. More...
 
static OUString GetNameFromHTMLIndex (sal_uInt32 nIndex)
 Returns the built-in range name for an HTML table, specified by table index. More...
 
static OUString GetNameFromHTMLName (std::u16string_view rTabName)
 Returns the built-in range name for an HTML table, specified by table name. More...
 
static bool IsHTMLDocName (const OUString &rSource)
 Returns true, if rSource is the built-in range name for an HTML document. More...
 
static bool IsHTMLTablesName (const OUString &rSource)
 Returns true, if rSource is the built-in range name for all HTML tables. More...
 
static bool GetHTMLNameFromName (const OUString &rSource, OUString &rName)
 Converts a built-in range name to an HTML table name. More...
 

Static Private Member Functions

static const OUString & GetHTMLIndexPrefix ()
 Returns the prefix for table index names. More...
 
static const OUString & GetHTMLNamePrefix ()
 Returns the prefix for table names. More...
 

Detailed Description

Contains static methods used anywhere in the filters.

Definition at line 119 of file ftools.hxx.

Constructor & Destructor Documentation

ScfTools::ScfTools ( )
delete

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

ScfTools::ScfTools ( const ScfTools )
delete

Member Function Documentation

void ScfTools::AppendCString ( SvStream rStrm,
OUString &  rString,
rtl_TextEncoding  eTextEnc 
)
static

Appends a zero terminated byte string.

Definition at line 277 of file ftools.cxx.

References read_zeroTerminated_uInt8s_ToOUString().

Referenced by ImportLotus::Read().

bool ScfTools::CheckItem ( const SfxItemSet rItemSet,
sal_uInt16  nWhichId,
bool  bDeep 
)
static
bool ScfTools::CheckItems ( const SfxItemSet rItemSet,
const sal_uInt16 *  pnWhichIds,
bool  bDeep 
)
static

Returns true, if the passed item set contains at least one of the items.

Parameters
pnWhichIdsZero-terminated array of Which-IDs.
bDeeptrue = Searches in parent item sets too.

Definition at line 204 of file ftools.cxx.

References CheckItem().

Referenced by XclExpFontHelper::CheckItems().

OUString ScfTools::ConvertToScDefinedName ( const OUString &  rName)
static

Converts a string to a valid Calc defined name or database range name.

Defined names in Calc may contain letters, digits (*), underscores, periods (*), colons (*), question marks, and dollar signs. (*) = not allowed at first position.

Definition at line 148 of file ftools.cxx.

References CharName, ScCompiler::IsCharFlagAllConventions(), Name, nPos, sName, and u.

Referenced by OP_NamedRange(), OP_SymphNamedRange(), XclImpExtName::XclImpExtName(), and XclImpName::XclImpName().

OUString ScfTools::GetHexStr ( sal_uInt16  nValue)
static

Returns a string representing the hexadecimal value of nValue.

Definition at line 120 of file ftools.cxx.

References aStr.

Referenced by XclImpPivotCache::ReadPivotCacheStream(), and XclExpPivotCache::WriteCacheStream().

const OUString & ScfTools::GetHTMLDocName ( )
static

Returns the built-in range name for an HTML document.

Definition at line 284 of file ftools.cxx.

Referenced by IsHTMLDocName(), XclImpWebQuery::ReadParamqry(), and ScHTMLImport::WriteToDocument().

const OUString & ScfTools::GetHTMLIndexPrefix ( )
staticprivate

Returns the prefix for table index names.

Definition at line 296 of file ftools.cxx.

Referenced by GetHTMLNameFromName(), and GetNameFromHTMLIndex().

bool ScfTools::GetHTMLNameFromName ( const OUString &  rSource,
OUString &  rName 
)
static

Converts a built-in range name to an HTML table name.

Parameters
rSourceThe string to be determined.
rNameThe HTML table name.
Returns
true, if conversion was successful.

Definition at line 331 of file ftools.cxx.

References ScGlobal::AddQuotes(), aIndex, GetHTMLIndexPrefix(), GetHTMLNamePrefix(), getLength(), and CharClass::isAsciiNumeric().

Referenced by XclExpWebQuery::XclExpWebQuery().

const OUString & ScfTools::GetHTMLNamePrefix ( )
staticprivate

Returns the prefix for table names.

Definition at line 303 of file ftools.cxx.

Referenced by GetHTMLNameFromName(), and GetNameFromHTMLName().

const OUString & ScfTools::GetHTMLTablesName ( )
static

Returns the built-in range name for all HTML tables.

Definition at line 290 of file ftools.cxx.

Referenced by IsHTMLTablesName(), XclImpWebQuery::ReadParamqry(), and ScHTMLImport::WriteToDocument().

Color ScfTools::GetMixedColor ( const Color rFore,
const Color rBack,
sal_uInt8  nTrans 
)
static

Mixes colors with given transparence.

Parameters
nTransForeground transparence (0x00 == full rFore ... 0x80 = full rBack).

Definition at line 136 of file ftools.cxx.

References Color::GetBlue(), Color::GetGreen(), GetMixedColorComp(), and Color::GetRed().

Referenced by XclTools::GetPatternColor(), and XclImpChRoot::GetSeriesFillAutoColor().

sal_uInt8 ScfTools::GetMixedColorComp ( sal_uInt8  nFore,
sal_uInt8  nBack,
sal_uInt8  nTrans 
)
static

Mixes RGB components with given transparence.

Parameters
nTransForeground transparence (0x00 == full nFore ... 0x80 = full nBack).

Definition at line 130 of file ftools.cxx.

Referenced by GetMixedColor().

OUString ScfTools::GetNameFromHTMLIndex ( sal_uInt32  nIndex)
static

Returns the built-in range name for an HTML table, specified by table index.

Definition at line 309 of file ftools.cxx.

References aName, and GetHTMLIndexPrefix().

Referenced by ScHTMLImport::GetHTMLRangeNameList(), XclImpWebQuery::ReadWqtables(), and ScHTMLImport::WriteToDocument().

OUString ScfTools::GetNameFromHTMLName ( std::u16string_view  rTabName)
static

Returns the built-in range name for an HTML table, specified by table name.

Definition at line 316 of file ftools.cxx.

References GetHTMLNamePrefix().

Referenced by XclImpWebQuery::ReadWqtables().

rtl_TextEncoding ScfTools::GetSystemTextEncoding ( )
static

Returns system text encoding for byte string conversion.

Definition at line 115 of file ftools.cxx.

Referenced by XclImpFont::FillToItemSet(), oox::xls::Font::fillToItemSet(), and XclExpFontBuffer::InitDefaultFonts().

bool ScfTools::IsHTMLDocName ( const OUString &  rSource)
static

Returns true, if rSource is the built-in range name for an HTML document.

Definition at line 321 of file ftools.cxx.

References GetHTMLDocName().

Referenced by XclExpWebQuery::XclExpWebQuery().

bool ScfTools::IsHTMLTablesName ( const OUString &  rSource)
static

Returns true, if rSource is the built-in range name for all HTML tables.

Definition at line 326 of file ftools.cxx.

References GetHTMLTablesName().

Referenced by ScHTMLImport::GetHTMLRangeNameList(), and XclExpWebQuery::XclExpWebQuery().

ScStyleSheet & ScfTools::MakeCellStyleSheet ( ScStyleSheetPool rPool,
const OUString &  rStyleName,
bool  bForceName 
)
static

Creates and returns a cell style sheet and inserts it into the pool.

If the style sheet is already in the pool, another unused style name is used.

Parameters
bForceNameControls behaviour, if the style already exists: true = Old existing style will be renamed; false = New style gets another name.

Definition at line 256 of file ftools.cxx.

Referenced by oox::xls::StylesBuffer::createDxfStyle(), oox::xls::StylesBuffer::createExtDxfStyle(), and XclImpCondFormat::ReadCF().

ScStyleSheet & ScfTools::MakePageStyleSheet ( ScStyleSheetPool rPool,
const OUString &  rStyleName,
bool  bForceName 
)
static

Creates and returns a page style sheet and inserts it into the pool.

If the style sheet is already in the pool, another unused style name is used.

Parameters
bForceNameControls behaviour, if the style already exists: true = Old existing style will be renamed; false = New style gets another name.

Definition at line 261 of file ftools.cxx.

Referenced by XclImpPageSettings::Finalize().

tools::SvRef< SotStorage > ScfTools::OpenStorageRead ( tools::SvRef< SotStorage > const &  xStrg,
const OUString &  rStrgName 
)
static

Tries to open an existing storage with the specified name in the passed storage (read-only).

Definition at line 164 of file ftools.cxx.

References tools::SvRef< T >::is(), SotStorage::IsContained(), and SotStorage::OpenSotStorage().

Referenced by XclRoot::OpenStorage().

tools::SvRef< SotStorageStream > ScfTools::OpenStorageStreamRead ( tools::SvRef< SotStorage > const &  xStrg,
const OUString &  rStrmName 
)
static

Tries to open an existing stream with the specified name in the passed storage (read-only).

Definition at line 180 of file ftools.cxx.

References tools::SvRef< T >::is(), SotStorage::IsContained(), SotStorage::IsStream(), and SotStorage::OpenSotStream().

Referenced by XclRoot::OpenStream(), and ScFormatFilterPluginImpl::ScImportExcel().

tools::SvRef< SotStorageStream > ScfTools::OpenStorageStreamWrite ( tools::SvRef< SotStorage > const &  xStrg,
const OUString &  rStrmName 
)
static

Creates and opens a stream with the specified name in the passed storage (read/write).

Definition at line 188 of file ftools.cxx.

References tools::SvRef< T >::is(), SotStorage::IsContained(), and SotStorage::OpenSotStream().

Referenced by lcl_ExportExcelBiff(), and XclRoot::OpenStream().

tools::SvRef< SotStorage > ScfTools::OpenStorageWrite ( tools::SvRef< SotStorage > const &  xStrg,
const OUString &  rStrgName 
)
static

Creates and opens a storage with the specified name in the passed storage (read/write).

Definition at line 172 of file ftools.cxx.

References tools::SvRef< T >::is(), and SotStorage::OpenSotStorage().

Referenced by XclRoot::OpenStorage().

const ScfTools& ScfTools::operator= ( const ScfTools )
delete
void ScfTools::PutItem ( SfxItemSet rItemSet,
const SfxPoolItem rItem,
sal_uInt16  nWhichId,
bool  bSkipPoolDef 
)
static

Puts the item into the passed item set.

The item will be put into the item set, if bSkipPoolDef is false, or if the item differs from the default pool item.

Parameters
rItemSetThe destination item set.
rItemThe item to put into the item set.
nWhichIdThe Which-ID to set with the item.
bSkipPoolDeftrue = Do not put item if it is equal to pool default; false = Always put the item.

Definition at line 213 of file ftools.cxx.

References SfxPoolItem::CloneSetWhich(), SfxItemPool::GetDefaultItem(), SfxItemSet::GetPool(), and SfxItemSet::Put().

Referenced by XclImpXF::CreatePattern(), oox::xls::Xf::createPattern(), XclImpNumFmtBuffer::FillScFmtToItemSet(), oox::xls::NumberFormat::fillToItemSet(), oox::xls::Font::fillToItemSet(), XclImpCellProt::FillToItemSet(), XclImpCellAlign::FillToItemSet(), XclImpCellBorder::FillToItemSet(), oox::xls::Alignment::fillToItemSet(), XclImpCellArea::FillToItemSet(), oox::xls::Protection::fillToItemSet(), oox::xls::Border::fillToItemSet(), oox::xls::Fill::fillToItemSet(), XclImpPageSettings::Finalize(), and PutItem().

void ScfTools::PutItem ( SfxItemSet rItemSet,
const SfxPoolItem rItem,
bool  bSkipPoolDef 
)
static

Puts the item into the passed item set.

The item will be put into the item set, if bSkipPoolDef is false, or if the item differs from the default pool item.

Parameters
rItemSetThe destination item set.
rItemThe item to put into the item set.
bSkipPoolDeftrue = Do not put item if it is equal to pool default; false = Always put the item.

Definition at line 221 of file ftools.cxx.

References PutItem(), and SfxPoolItem::Which().

OString ScfTools::read_zeroTerminated_uInt8s_ToOString ( SvStream rStrm,
sal_Int32 &  rnBytesLeft 
)
static

Reads and returns a zero terminated byte string and decreases a stream counter.

Definition at line 268 of file ftools.cxx.

References SvStream::good().

Referenced by read_zeroTerminated_uInt8s_ToOUString().

static OUString ScfTools::read_zeroTerminated_uInt8s_ToOUString ( SvStream rStrm,
sal_Int32 &  rnBytesLeft,
rtl_TextEncoding  eTextEnc 
)
inlinestatic

Reads and returns a zero terminated byte string and decreases a stream counter.

Definition at line 215 of file ftools.hxx.

References read_zeroTerminated_uInt8s_ToOString().

Referenced by AppendCString(), and LotusToSc::Convert().

void ScfTools::ReadLongDouble ( SvStream rStrm,
double &  fResult 
)
static

Reads a 10-byte-long-double and converts it to double.

Definition at line 41 of file ftools.cxx.

Referenced by LotusToSc::Convert(), and ImportLotus::Read().


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