LibreOffice Module sc (master)
1
|
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 ScfTools & | operator= (const ScfTools &)=delete |
Static Public Member Functions | |
static double | ReadLongDouble (SvStream &rStrm) |
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< SotStorage > | OpenStorageRead (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< SotStorage > | OpenStorageWrite (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< SotStorageStream > | OpenStorageStreamRead (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< SotStorageStream > | OpenStorageStreamWrite (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 ScStyleSheet & | MakeCellStyleSheet (ScStyleSheetPool &rPool, const OUString &rStyleName, bool bForceName) |
Creates and returns a cell style sheet and inserts it into the pool. More... | |
static ScStyleSheet & | MakePageStyleSheet (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... | |
Contains static methods used anywhere in the filters.
Definition at line 119 of file ftools.hxx.
|
delete |
We don't want anybody to instantiate this class, since it is just a collection of static items.
|
delete |
|
static |
Appends a zero terminated byte string.
Definition at line 273 of file ftools.cxx.
References read_zeroTerminated_uInt8s_ToOUString().
Referenced by ImportLotus::Read().
|
static |
Returns true, if the passed item set contains the item.
bDeep | true = Searches in parent item sets too. |
Definition at line 195 of file ftools.cxx.
References SfxItemSet::GetItemState().
Referenced by CheckItems(), XclExpCellProt::FillFromItemSet(), XclExpCellAlign::FillFromItemSet(), XclExpCellBorder::FillFromItemSet(), XclExpCellArea::FillFromItemSet(), XclExpColor::FillFromItemSet(), XclExpXF::Init(), XclExpCellTable::XclExpCellTable(), XclExpCFImpl::XclExpCFImpl(), and XclExpPageSettings::XclExpPageSettings().
|
static |
Returns true, if the passed item set contains at least one of the items.
pnWhichIds | Zero-terminated array of Which-IDs. |
bDeep | true = Searches in parent item sets too. |
Definition at line 200 of file ftools.cxx.
References CheckItem().
Referenced by XclExpFontHelper::CheckItems().
|
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 144 of file ftools.cxx.
References CharName, ScCompiler::IsCharFlagAllConventions(), Name, nPos, sName, and u.
Referenced by OP_NamedRange(), OP_SymphNamedRange(), XclImpExtName::XclImpExtName(), and XclImpName::XclImpName().
|
static |
Returns a string representing the hexadecimal value of nValue.
Definition at line 116 of file ftools.cxx.
References aStr.
Referenced by XclImpPivotCache::ReadPivotCacheStream(), and XclExpPivotCache::WriteCacheStream().
|
static |
Returns the built-in range name for an HTML document.
Definition at line 280 of file ftools.cxx.
Referenced by IsHTMLDocName(), XclImpWebQuery::ReadParamqry(), and ScHTMLImport::WriteToDocument().
|
staticprivate |
Returns the prefix for table index names.
Definition at line 292 of file ftools.cxx.
Referenced by GetHTMLNameFromName(), and GetNameFromHTMLIndex().
|
static |
Converts a built-in range name to an HTML table name.
rSource | The string to be determined. |
rName | The HTML table name. |
Definition at line 327 of file ftools.cxx.
References ScGlobal::AddQuotes(), aIndex, GetHTMLIndexPrefix(), GetHTMLNamePrefix(), getLength(), and CharClass::isAsciiNumeric().
Referenced by XclExpWebQuery::XclExpWebQuery().
|
staticprivate |
Returns the prefix for table names.
Definition at line 299 of file ftools.cxx.
Referenced by GetHTMLNameFromName(), and GetNameFromHTMLName().
|
static |
Returns the built-in range name for all HTML tables.
Definition at line 286 of file ftools.cxx.
Referenced by IsHTMLTablesName(), XclImpWebQuery::ReadParamqry(), and ScHTMLImport::WriteToDocument().
Mixes colors with given transparence.
nTrans | Foreground transparence (0x00 == full rFore ... 0x80 = full rBack). |
Definition at line 132 of file ftools.cxx.
References Color::GetBlue(), Color::GetGreen(), GetMixedColorComp(), and Color::GetRed().
Referenced by XclTools::GetPatternColor(), and XclImpChRoot::GetSeriesFillAutoColor().
Mixes RGB components with given transparence.
nTrans | Foreground transparence (0x00 == full nFore ... 0x80 = full nBack). |
Definition at line 126 of file ftools.cxx.
Referenced by GetMixedColor().
|
static |
Returns the built-in range name for an HTML table, specified by table index.
Definition at line 305 of file ftools.cxx.
References aName, and GetHTMLIndexPrefix().
Referenced by ScHTMLImport::GetHTMLRangeNameList(), XclImpWebQuery::ReadWqtables(), and ScHTMLImport::WriteToDocument().
|
static |
Returns the built-in range name for an HTML table, specified by table name.
Definition at line 312 of file ftools.cxx.
References GetHTMLNamePrefix().
Referenced by XclImpWebQuery::ReadWqtables(), and ScHTMLImport::WriteToDocument().
|
static |
Returns system text encoding for byte string conversion.
Definition at line 111 of file ftools.cxx.
Referenced by XclImpFont::FillToItemSet(), oox::xls::Font::fillToItemSet(), and XclExpFontBuffer::InitDefaultFonts().
|
static |
Returns true, if rSource is the built-in range name for an HTML document.
Definition at line 317 of file ftools.cxx.
References GetHTMLDocName().
Referenced by XclExpWebQuery::XclExpWebQuery().
|
static |
Returns true, if rSource is the built-in range name for all HTML tables.
Definition at line 322 of file ftools.cxx.
References GetHTMLTablesName().
Referenced by ScHTMLImport::GetHTMLRangeNameList(), and XclExpWebQuery::XclExpWebQuery().
|
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.
bForceName | Controls behaviour, if the style already exists: true = Old existing style will be renamed; false = New style gets another name. |
Definition at line 252 of file ftools.cxx.
Referenced by oox::xls::StylesBuffer::createDxfStyle(), oox::xls::StylesBuffer::createExtDxfStyle(), and XclImpCondFormat::ReadCF().
|
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.
bForceName | Controls behaviour, if the style already exists: true = Old existing style will be renamed; false = New style gets another name. |
Definition at line 257 of file ftools.cxx.
Referenced by XclImpPageSettings::Finalize().
|
static |
Tries to open an existing storage with the specified name in the passed storage (read-only).
Definition at line 160 of file ftools.cxx.
References tools::SvRef< T >::is(), SotStorage::IsContained(), and SotStorage::OpenSotStorage().
Referenced by XclRoot::OpenStorage().
|
static |
Tries to open an existing stream with the specified name in the passed storage (read-only).
Definition at line 176 of file ftools.cxx.
References tools::SvRef< T >::is(), SotStorage::IsContained(), SotStorage::IsStream(), and SotStorage::OpenSotStream().
Referenced by XclRoot::OpenStream(), and ScFormatFilterPluginImpl::ScImportExcel().
|
static |
Creates and opens a stream with the specified name in the passed storage (read/write).
Definition at line 184 of file ftools.cxx.
References tools::SvRef< T >::is(), SotStorage::IsContained(), and SotStorage::OpenSotStream().
Referenced by lcl_ExportExcelBiff(), and XclRoot::OpenStream().
|
static |
Creates and opens a storage with the specified name in the passed storage (read/write).
Definition at line 168 of file ftools.cxx.
References tools::SvRef< T >::is(), and SotStorage::OpenSotStorage().
Referenced by XclRoot::OpenStorage().
|
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.
rItemSet | The destination item set. |
rItem | The item to put into the item set. |
nWhichId | The Which-ID to set with the item. |
bSkipPoolDef | true = Do not put item if it is equal to pool default; false = Always put the item. |
Definition at line 209 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().
|
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.
rItemSet | The destination item set. |
rItem | The item to put into the item set. |
bSkipPoolDef | true = Do not put item if it is equal to pool default; false = Always put the item. |
Definition at line 217 of file ftools.cxx.
References PutItem(), and SfxPoolItem::Which().
|
static |
Reads and returns a zero terminated byte string and decreases a stream counter.
Definition at line 264 of file ftools.cxx.
References SvStream::good().
Referenced by read_zeroTerminated_uInt8s_ToOUString().
|
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().
|
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().