LibreOffice Module sc (master) 1
|
Stores all used colors in the document. More...
#include <xestyle.hxx>
Public Member Functions | |
XclExpPalette (const XclExpRoot &rRoot) | |
virtual | ~XclExpPalette () override |
sal_uInt32 | InsertColor (const Color &rColor, XclExpColorType eType, sal_uInt16 nAutoDefault=0) |
Inserts the color into the list and updates weighting. More... | |
void | Finalize () |
Reduces the color list to the maximum count of the current BIFF version. More... | |
sal_uInt16 | GetColorIndex (sal_uInt32 nColorId) const |
Returns the Excel palette index of the color with passed color ID. More... | |
void | GetMixedColors (sal_uInt16 &rnXclForeIx, sal_uInt16 &rnXclBackIx, sal_uInt8 &rnXclPattern, sal_uInt32 nForeColorId, sal_uInt32 nBackColorId) const |
Returns a foreground and background color for the two passed color IDs. More... | |
Color | GetColor (sal_uInt16 nXclIndex) const |
Returns the color for a (non-zero-based) Excel palette entry. More... | |
virtual void | Save (XclExpStream &rStrm) override |
Saves the PALETTE record, if it differs from the default palette. More... | |
virtual void | SaveXml (XclExpXmlStream &rStrm) override |
Public Member Functions inherited from XclDefaultPalette | |
XclDefaultPalette (const XclRoot &rRoot) | |
sal_uInt32 | GetColorCount () const |
Returns the color count in the current palette. More... | |
Color | GetDefColor (sal_uInt16 nXclIndex) const |
Returns the default color for a (non-zero-based) Excel color or COL_AUTO on error. More... | |
bool | IsSystemColor (sal_uInt16 nXclIndex) const |
Returns true, if the passed Excel color index is a system color. More... | |
Public Member Functions inherited from XclExpRecord | |
XclExpRecord (sal_uInt16 nRecId=EXC_ID_UNKNOWN, std::size_t nRecSize=0) | |
XclExpRecord (XclExpRecord const &)=default | |
virtual | ~XclExpRecord () override |
sal_uInt16 | GetRecId () const |
Returns the current record ID. More... | |
std::size_t | GetRecSize () const |
Returns the current record size prediction. More... | |
void | SetRecId (sal_uInt16 nRecId) |
Sets a new record ID. More... | |
void | SetRecSize (std::size_t nRecSize) |
Sets a new record size prediction. More... | |
void | AddRecSize (std::size_t nRecSize) |
Adds a size value to the record size prediction. More... | |
void | SetRecHeader (sal_uInt16 nRecId, std::size_t nRecSize) |
Sets record ID and size with one call. More... | |
virtual void | Save (XclExpStream &rStrm) override |
Writes the record header and calls WriteBody(). More... | |
Public Member Functions inherited from XclExpRecordBase | |
XclExpRecordBase () | |
XclExpRecordBase (XclExpRecordBase const &) | |
XclExpRecordBase (XclExpRecordBase &&) | |
XclExpRecordBase & | operator= (XclExpRecordBase const &) |
XclExpRecordBase & | operator= (XclExpRecordBase &&) noexcept |
virtual | ~XclExpRecordBase () |
virtual void | Save (XclExpStream &rStrm) |
Overwrite this method to do any operation while saving the record. More... | |
virtual void | SaveXml (XclExpXmlStream &rStrm) |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Static Public Member Functions | |
static sal_uInt32 | GetColorIdFromIndex (sal_uInt16 nIndex) |
Returns the color ID representing a fixed Excel palette index (i.e. More... | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Private Types | |
typedef std::shared_ptr< XclExpPaletteImpl > | XclExpPaletteImplRef |
Private Member Functions | |
virtual void | WriteBody (XclExpStream &rStrm) override |
Writes the contents of the PALETTE record. More... | |
Private Attributes | |
XclExpPaletteImplRef | mxImpl |
Additional Inherited Members | |
virtual void | WriteBody (XclExpStream &rStrm) |
Writes the body of the record (without record header). More... | |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
Stores all used colors in the document.
Supports color reduction to the maximum count of the current BIFF version. An instance of this class collects all colors in the conversion phase of the export, using the InsertColor() function. It returns a unique identifier for each passed color.
After the entire document is converted, the Finalize() function will reduce the palette to the number of colors supported by the current BIFF version.
Then, in the streaming phase, the functions GetColorIndex() and GetMixedColors() return the real Excel palette index for all color identifiers.
Definition at line 76 of file xestyle.hxx.
|
private |
Definition at line 116 of file xestyle.hxx.
|
explicit |
Definition at line 756 of file xestyle.cxx.
References XclDefaultPalette::GetColorCount(), mxImpl, and XclExpRecord::SetRecSize().
|
overridevirtual |
Definition at line 764 of file xestyle.cxx.
void XclExpPalette::Finalize | ( | ) |
Reduces the color list to the maximum count of the current BIFF version.
Definition at line 778 of file xestyle.cxx.
References mxImpl.
Referenced by XclExpRoot::InitializeSave().
Color XclExpPalette::GetColor | ( | sal_uInt16 | nXclIndex | ) | const |
Returns the color for a (non-zero-based) Excel palette entry.
Definition at line 795 of file xestyle.cxx.
References mxImpl.
Referenced by XclExpCellBorder::SaveXml(), and XclExpCellArea::SaveXml().
|
static |
Returns the color ID representing a fixed Excel palette index (i.e.
for auto colors).
Definition at line 773 of file xestyle.cxx.
References XclExpPaletteImpl::GetColorIdFromIndex(), and nIndex.
Referenced by XclExpChLineFormat::Convert(), XclExpChAreaFormat::Convert(), XclExpCellArea::FillFromItemSet(), XclExpChEscherFormat::RegisterColor(), XclExpTabViewSettings::SaveXml(), and XclExpChRoot::SetSystemColor().
sal_uInt16 XclExpPalette::GetColorIndex | ( | sal_uInt32 | nColorId | ) | const |
Returns the Excel palette index of the color with passed color ID.
Definition at line 783 of file xestyle.cxx.
References mxImpl.
Referenced by XclExpChEscherFormat::Save(), XclExpCellBorder::SetFinalColors(), XclExpCFImpl::WriteBody(), XclExpChAreaFormat::WriteBody(), XclExpChText::WriteBody(), XclExpChMarkerFormat::WriteBody(), XclExpChTick::WriteBody(), XclExpFont::WriteBody(), XclExpWindow2::WriteBody(), and XclExpTabBgColor::WriteBody().
void XclExpPalette::GetMixedColors | ( | sal_uInt16 & | rnXclForeIx, |
sal_uInt16 & | rnXclBackIx, | ||
sal_uInt8 & | rnXclPattern, | ||
sal_uInt32 | nForeColorId, | ||
sal_uInt32 | nBackColorId | ||
) | const |
Returns a foreground and background color for the two passed color IDs.
@descr If rnXclPattern contains a solid pattern, this function tries to find the two best fitting colors and a mix pattern (25%, 50% or 75%) for nForeColorId. This will result in a better approximation to the passed foreground color.
Definition at line 788 of file xestyle.cxx.
References mxImpl.
Referenced by XclExpCellArea::SetFinalColors().
sal_uInt32 XclExpPalette::InsertColor | ( | const Color & | rColor, |
XclExpColorType | eType, | ||
sal_uInt16 | nAutoDefault = 0 |
||
) |
Inserts the color into the list and updates weighting.
nAutoDefault | The Excel palette index for automatic color. |
Definition at line 768 of file xestyle.cxx.
Referenced by XclExpChLineFormat::Convert(), XclExpChAreaFormat::Convert(), XclExpCellArea::FillFromItemSet(), XclExpChEscherFormat::RegisterColor(), XclExpChMarkerFormat::RegisterColors(), XclExpCFImpl::XclExpCFImpl(), XclExpFont::XclExpFont(), and XclExpTabViewSettings::XclExpTabViewSettings().
|
overridevirtual |
Saves the PALETTE record, if it differs from the default palette.
Reimplemented from XclExpRecord.
Definition at line 800 of file xestyle.cxx.
References mxImpl, rStrm, and XclExpRecord::Save().
|
overridevirtual |
Reimplemented from XclExpRecordBase.
Definition at line 806 of file xestyle.cxx.
|
overrideprivatevirtual |
Writes the contents of the PALETTE record.
Reimplemented from XclExpRecord.
Definition at line 812 of file xestyle.cxx.
|
private |
Definition at line 117 of file xestyle.hxx.
Referenced by Finalize(), GetColor(), GetColorIndex(), GetMixedColors(), InsertColor(), Save(), SaveXml(), WriteBody(), and XclExpPalette().