25#include <com/sun/star/i18n/ScriptType.hpp>
27#include <rtl/tencinfo.h>
28#include <vcl/font.hxx>
39#include <document.hxx>
41#include <stlsheet.hxx>
54#include <oox/token/tokens.hxx>
55#include <oox/token/namespaces.hxx>
79 default: OSL_FAIL(
"lclGetWeighting - unknown color type" );
84sal_Int32 lclGetColorDistance(
const Color& rColor1,
const Color& rColor2 )
89 nDist += nDummy * nDummy * 151;
91 nDist += nDummy * nDummy * 28;
97 sal_uInt8 nComp1Dist = ::std::min< sal_uInt8 >( nComp1, 0xFF - nComp1 );
98 sal_uInt8 nComp2Dist = ::std::min< sal_uInt8 >( nComp2, 0xFF - nComp2 );
99 if( nComp1Dist != nComp2Dist )
103 const sal_uInt8& rnCompNearer = (nComp1Dist < nComp2Dist) ? nComp1 : nComp2;
104 sal_uInt32& rnWeight = (nComp1Dist < nComp2Dist) ? nWeight1 : nWeight2;
105 rnWeight *= ((rnCompNearer - 0x80L) * (rnCompNearer - 0x7FL) / 0x1000L + 1);
107 sal_uInt32 nWSum = nWeight1 + nWeight2;
108 return static_cast< sal_uInt8 >( (nComp1 * nWeight1 + nComp2 * nWeight2 + nWSum / 2) / nWSum );
111void lclSetMixedColor(
Color& rDest,
const Color& rSrc1,
const Color& rSrc2 )
134 sal_uInt32 mnColorId;
139 explicit XclListColor(
const Color& rColor, sal_uInt32 nColorId );
144 sal_uInt32 GetColorId()
const {
return mnColorId; }
146 sal_uInt32 GetWeighting()
const {
return mnWeight; }
148 bool IsBaseColor()
const {
return mbBaseColor; }
151 void AddWeighting( sal_uInt32 nWeight ) {
mnWeight += nWeight; }
153 void Merge(
const XclListColor& rColor );
156XclListColor::XclListColor(
const Color& rColor, sal_uInt32 nColorId ) :
158 mnColorId( nColorId ),
162 ((rColor.
GetRed() == 0x00) || (rColor.
GetRed() == 0xFF)) &&
167void XclListColor::Merge(
const XclListColor& rColor )
169 sal_uInt32 nWeight2 = rColor.GetWeighting();
173 maColor.SetRed( lclGetMergedColorComp(
maColor.GetRed(), mnWeight, rColor.maColor.GetRed(), nWeight2 ) );
174 maColor.SetGreen( lclGetMergedColorComp(
maColor.GetGreen(), mnWeight, rColor.maColor.GetGreen(), nWeight2 ) );
175 maColor.SetBlue( lclGetMergedColorComp(
maColor.GetBlue(), mnWeight, rColor.maColor.GetBlue(), nWeight2 ) );
177 AddWeighting( nWeight2 );
190struct XclPaletteColor
195 explicit XclPaletteColor(
const Color& rColor ) :
maColor( rColor ), mbUsed( false ) {}
196 void SetColor(
const Color& rColor ) {
maColor = rColor; mbUsed =
true; }
203 sal_uInt32 mnPalIndex;
206 explicit XclRemap() : mnPalIndex( 0 ), mbProcessed( false ) {}
207 void SetIndex( sal_uInt32 nPalIndex )
208 { mnPalIndex = nPalIndex; mbProcessed =
true; }
214 sal_uInt32 mnPalIndex;
217 explicit XclNearest() : mnPalIndex( 0 ), mnDist( 0 ) {}
245 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
246 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const;
290 const Color& rColor )
const;
294 sal_uInt32& rnFirst, sal_uInt32& rnSecond,
295 const Color& rColor )
const;
303 std::vector< XclColorIdData >
305 std::vector< XclPaletteColor >
321 for( sal_uInt16 nIdx = 0; nIdx <
nCount; ++nIdx )
332 sal_uInt32 nFoundIdx = 0;
334 if( !pEntry || (pEntry->GetColor() != rColor) )
336 pEntry->AddWeighting( lclGetWeighting(
eType ) );
338 return pEntry->GetColorId();
352 for( sal_uInt32 nIdx = 0; nIdx <
nCount; ++nIdx )
354 const XclListColor& listColor = *
mxColorList->at( nIdx );
355 maColorIdDataVec[ listColor.GetColorId() ].Set( listColor.GetColor(), nIdx );
361 sal_uInt32 nPass = 0;
372 std::vector< XclRemap > aRemapVec(
nCount );
373 std::vector< XclNearest > aNearestVec(
nCount );
376 for( sal_uInt32 nRun = 0; nRun <
nCount; ++nRun )
384 sal_uInt32 nFound = 0;
386 if( aNearestVec[
nIndex ].mnDist < aNearestVec[ nFound ].mnDist )
389 sal_uInt32 nNearest = aNearestVec[ nFound ].mnPalIndex;
390 OSL_ENSURE( nNearest <
maPalette.size(),
"XclExpPaletteImpl::Finalize - algorithm error" );
392 aRemapVec[ nFound ].SetIndex( nNearest );
397 rColorIdData.mnIndex = aRemapVec[ rColorIdData.mnIndex ].mnPalIndex;
404 nRet =
static_cast< sal_uInt16
>( nColorId & ~EXC_PAL_INDEXBASE );
411 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
412 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const
421 sal_uInt32 nIndex1, nIndex2;
427 Color aColorArr[ 5 ];
428 aColorArr[ 0 ] =
maPalette[ nIndex1 ].maColor;
429 aColorArr[ 4 ] =
maPalette[ nIndex2 ].maColor;
430 lclSetMixedColor( aColorArr[ 2 ], aColorArr[ 0 ], aColorArr[ 4 ] );
431 lclSetMixedColor( aColorArr[ 1 ], aColorArr[ 0 ], aColorArr[ 2 ] );
432 lclSetMixedColor( aColorArr[ 3 ], aColorArr[ 2 ], aColorArr[ 4 ] );
434 sal_Int32 nMinDist = nFirstDist;
435 sal_uInt32 nMinIndex = 0;
436 for( sal_uInt32 nCnt = 1; nCnt < 4; ++nCnt )
438 sal_Int32 nDist = lclGetColorDistance( aForeColor, aColorArr[ nCnt ] );
439 if( nDist < nMinDist )
447 if( nMinDist < nFirstDist )
471 bool bDefault =
true;
472 for( sal_uInt32 nIdx = 0, nSize =
static_cast< sal_uInt32
>(
maPalette.size() ); bDefault && (nIdx < nSize); ++nIdx )
479 rStrm << static_cast< sal_uInt16 >(
maPalette.size() );
481 rStrm << rColor.maColor;
490 rStyleSheet->startElement(XML_colors);
491 rStyleSheet->startElement(XML_indexedColors);
494 rStyleSheet->endElement( XML_indexedColors );
495 rStyleSheet->endElement( XML_colors );
512 XclListColor* pEntry =
nullptr;
515 if (mnLastIdx < mxColorList->
size())
517 pEntry = (*mxColorList)[
mnLastIdx].get();
518 if( pEntry->GetColor() == rColor )
526 sal_uInt32 nBegIdx = 0;
529 while( !bFound && (nBegIdx < nEndIdx) )
531 rnIndex = (nBegIdx + nEndIdx) / 2;
532 pEntry = (*mxColorList)[rnIndex].get();
533 bFound = pEntry->GetColor() == rColor;
536 if( pEntry->GetColor() < rColor )
537 nBegIdx = rnIndex + 1;
553 XclListColor* pEntry =
new XclListColor( rColor,
mxColorList->size() );
572 mxColorList = std::make_shared<XclListColorList>();
576 aListIndexMap.reserve( xOldList->size() );
580 sal_uInt8& rnComp = ((nPass % 3 == 0) ? nB : ((nPass % 3 == 1) ? nR : nG));
582 OSL_ENSURE( nPass < 7,
"XclExpPaletteImpl::RawReducePalette - reduction not terminated" );
584 static const sal_uInt8 spnFactor2[] = { 0x81, 0x82, 0x84, 0x88, 0x92, 0xAA, 0xFF };
586 sal_uInt8 nFactor2 = spnFactor2[ nPass ];
590 for(
const std::unique_ptr<XclListColor> & pOldColor : *xOldList)
593 const XclListColor* pOldEntry = pOldColor.get();
594 nR = pOldEntry->GetColor().GetRed();
595 nG = pOldEntry->GetColor().GetGreen();
596 nB = pOldEntry->GetColor().GetBlue();
602 sal_uInt32 nNewComp = rnComp;
603 nNewComp /= nFactor1;
604 nNewComp *= nFactor2;
605 nNewComp /= nFactor3;
606 rnComp =
static_cast< sal_uInt8 >( nNewComp );
607 Color aNewColor( nR, nG, nB );
610 sal_uInt32 nFoundIdx = 0;
612 if( !pNewEntry || (pNewEntry->GetColor() != aNewColor) )
614 pNewEntry->AddWeighting( pOldEntry->GetWeighting() );
615 aListIndexMap.push_back( nFoundIdx );
620 rColorIdData.mnIndex = aListIndexMap[ rColorIdData.mnIndex ];
631 XclListColor* pKeepEntry =
mxColorList->at(nKeep).get();
632 XclListColor* pRemoveEntry =
mxColorList->at(nRemove).get();
633 if( !(pKeepEntry && pRemoveEntry) )
637 pKeepEntry->Merge( *pRemoveEntry );
639 XclListColorList::iterator itr =
mxColorList->begin();
640 ::std::advance(itr, nRemove);
642 if( nKeep > nRemove ) --nKeep;
647 if( rColorIdData.mnIndex > nRemove )
648 --rColorIdData.mnIndex;
649 else if( rColorIdData.mnIndex == nRemove )
650 rColorIdData.mnIndex = nKeep;
656 sal_uInt32 nFound = 0;
663 if( !rEntry.IsBaseColor() && (rEntry.GetWeighting() < nMinW) )
666 nMinW = rEntry.GetWeighting();
674 sal_uInt32 nFound = 0;
679 if( nIdx != nIgnore )
681 if( XclListColor* pEntry =
mxColorList->at(nIdx).get() )
683 sal_Int32 nDist = lclGetColorDistance( rColor, pEntry->GetColor() );
704 sal_uInt32& rnIndex,
const Color& rColor )
const
709 sal_uInt32 nPaletteIndex = 0;
710 for(
const auto& rPaletteColor :
maPalette )
712 if( !rPaletteColor.mbUsed )
714 sal_Int32 nCurrDist = lclGetColorDistance( rColor, rPaletteColor.maColor );
715 if( nCurrDist < nDist )
717 rnIndex = nPaletteIndex;
727 sal_uInt32& rnFirst, sal_uInt32& rnSecond,
const Color& rColor )
const
729 rnFirst = rnSecond = 0;
733 sal_uInt32 nPaletteIndex = 0;
734 for(
const auto& rPaletteColor :
maPalette )
736 sal_Int32 nCurrDist = lclGetColorDistance( rColor, rPaletteColor.maColor );
737 if( nCurrDist < nDist1 )
741 rnFirst = nPaletteIndex;
744 else if( nCurrDist < nDist2 )
746 rnSecond = nPaletteIndex;
758 mxImpl = std::make_shared<XclExpPaletteImpl>( *
this );
768 return mxImpl->InsertColor( rColor,
eType, nAutoDefault );
783 return mxImpl->GetColorIndex( nColorId );
787 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
788 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const
790 return mxImpl->GetMixedColors( rnXclForeIx, rnXclBackIx, rnXclPattern, nForeColorId, nBackColorId );
795 return mxImpl->GetColor( nXclIndex );
800 if( !
mxImpl->IsDefaultPalette() )
806 if( !
mxImpl->IsDefaultPalette() )
819typedef ::std::pair< sal_uInt16, sal_Int16 > WhichAndScript;
821sal_Int16 lclCheckFontItems(
const SfxItemSet& rItemSet,
822 const WhichAndScript& rWAS1,
const WhichAndScript& rWAS2,
const WhichAndScript& rWAS3 )
834 namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
840 static const WhichAndScript WAS_LATIN(
ATTR_FONT, css::i18n::ScriptType::LATIN );
841 static const WhichAndScript WAS_ASIAN(
ATTR_CJK_FONT, css::i18n::ScriptType::ASIAN );
842 static const WhichAndScript WAS_CMPLX(
ATTR_CTL_FONT, css::i18n::ScriptType::COMPLEX );
848 sal_Int16 nScript = 0;
851 while( (nScript == 0) && pCurrSet )
855 case ApiScriptType::LATIN:
856 nScript = lclCheckFontItems( *pCurrSet, WAS_LATIN, WAS_CMPLX, WAS_ASIAN );
858 case ApiScriptType::ASIAN:
859 nScript = lclCheckFontItems( *pCurrSet, WAS_ASIAN, WAS_CMPLX, WAS_LATIN );
861 case ApiScriptType::COMPLEX:
862 nScript = lclCheckFontItems( *pCurrSet, WAS_CMPLX, WAS_ASIAN, WAS_LATIN );
865 OSL_FAIL(
"XclExpFontHelper::GetFirstUsedScript - unknown script type" );
866 nScript = ApiScriptType::LATIN;
872 nScript = nDefScript;
876 OSL_FAIL(
"XclExpFontHelper::GetFirstUsedScript - unknown script type" );
877 nScript = ApiScriptType::LATIN;
886 if( nScript == css::i18n::ScriptType::WEAK )
909 static const sal_uInt16 pnCommonIds[] = {
912 static const sal_uInt16 pnLatinIds[] = {
914 static const sal_uInt16 pnAsianIds[] = {
916 static const sal_uInt16 pnComplexIds[] = {
922 namespace ApiScriptType = css::i18n::ScriptType;
924 if( nScript == ApiScriptType::WEAK )
931 case ApiScriptType::COMPLEX: bUsed =
ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep );
break;
932 default: OSL_FAIL(
"XclExpFontHelper::CheckItems - unknown script type" );
940sal_uInt32 lclCalcHash(
const XclFontData& rFontData )
942 sal_uInt32 nHash = rFontData.
maName.getLength();
943 nHash += sal_uInt32(rFontData.
maColor) * 2;
950 if( rFontData.
mbItalic ) nHash += 19;
953 if( rFontData.
mbShadow ) nHash += 31;
982 rStyleSheet->startElement(XML_font);
985 rStyleSheet->endElement( XML_font );
1000 OSL_ENSURE(
maData.
maName.getLength() < 256,
"XclExpFont::WriteBody - font name too long" );
1043const char* getFontFamilyOOXValue(
FontFamily eValue)
1073 rStyleSheet->startElement(XML_font);
1080 if (!aFontName.isEmpty())
1082 rStyleSheet->singleElement(XML_name, XML_val, aFontName);
1086 sal_uInt8 nExcelCharSet = rtl_getBestWindowsCharsetFromTextEncoding(eTextEnc);
1089 rStyleSheet->singleElement(XML_charset, XML_val, OString::number(nExcelCharSet));
1093 const char* pVal = getFontFamilyOOXValue(eFamily);
1096 rStyleSheet->singleElement(XML_family, XML_val, pVal);
1102 rStyleSheet->singleElement(XML_b,
1109 rStyleSheet->singleElement(XML_i, XML_val, ToPsz10(bItalic));
1119 rStyleSheet->singleElement(XML_strike, XML_val, ToPsz10(bStrikeout));
1129 rStyleSheet->singleElement(XML_shadow, XML_val, ToPsz10(*
maDxfData.
bShadow));
1134 rStyleSheet->singleElement(XML_color,
1140 rStyleSheet->singleElement(XML_sz,
1147 rStyleSheet->singleElement(XML_u, XML_val, pVal);
1150 rStyleSheet->endElement(XML_font);
1221 return static_cast< sal_uInt16
>(
nPos );
1249 rStyleSheet->startElement(XML_fonts, XML_count, OString::number(
maFontList.
GetSize()));
1253 rStyleSheet->endElement( XML_fonts );
1261 aFontData.
maName =
"Arial";
1306 sal_uInt32 nHash = lclCalcHash( rFontData );
1318struct XclExpNumFmtPred
1320 sal_uInt32 mnScNumFmt;
1321 explicit XclExpNumFmtPred( sal_uInt32 nScNumFmt ) : mnScNumFmt( nScNumFmt ) {}
1331 rStyleSheet->singleElement( XML_numFmt,
1340 mnStdFmt( GetFormatter().GetStandardIndex(
ScGlobal::eLnge ) )
1358 XclExpNumFmtVec::const_iterator aIt =
1361 return aIt->mnXclNumFmt;
1366 sal_uInt16 nXclNumFmt =
static_cast< sal_uInt16
>( nSize +
mnXclOffset );
1386 rStyleSheet->startElement(XML_numFmts, XML_count, OString::number(
maFormatMap.size()));
1389 rEntry.SaveXml(
rStrm );
1391 rStyleSheet->endElement( XML_numFmts );
1400 aExpStr.
Assign( rFormatStr );
1403 rStrm << nXclNumFmt << aExpStr;
1444 rStrm.GetCurrentStream()->singleElement( XML_protection,
1450 bool bForceLineBreak,
XclBiff eBiff,
bool bStyle)
1463 sal_Int32 nIndent =
static_cast<double>(nTmpIndent) / (3.0 * nSpaceWidth) + 0.5;
1464 mnIndent = limit_cast< sal_uInt8 >( nIndent, 0, 15 );
1527 if (eHorAlign == SvxCellHorJustify::Block)
1531 if (eHorJustMethod == SvxCellJustifyMethod::Distribute)
1535 if (eVerAlign == SvxCellVerJustify::Block)
1539 if (eVerJustMethod == SvxCellJustifyMethod::Distribute)
1597 rStrm.GetCurrentStream()->singleElement( XML_alignment,
1600 XML_textRotation, OString::number(
mnRotation),
1602 XML_indent, OString::number(
mnIndent),
1605 XML_shrinkToFit, ToPsz(
mbShrink ),
1611void lclGetBorderLine(
1612 sal_uInt8& rnXclLine, sal_uInt32& rnColorId,
1617 enum CalcLineIndex{Idx_None, Idx_Solid, Idx_Dotted, Idx_Dashed, Idx_FineDashed, Idx_DashDot, Idx_DashDotDot, Idx_DoubleThin, Idx_Last};
1618 enum ExcelWidthIndex{Width_Hair, Width_Thin, Width_Medium, Width_Thick, Width_Last};
1619 static sal_uInt8 Map_LineLO_toMS[Idx_Last][Width_Last] =
1636 sal_uInt16 nOuterWidth = pLine->GetOutWidth();
1637 ExcelWidthIndex nOuterWidthIndx;
1638 CalcLineIndex nStyleIndex;
1640 switch (pLine->GetBorderLineStyle())
1642 case SvxBorderLineStyle::NONE:
1643 nStyleIndex = Idx_None;
1645 case SvxBorderLineStyle::SOLID:
1646 nStyleIndex = Idx_Solid;
1648 case SvxBorderLineStyle::DOTTED:
1649 nStyleIndex = Idx_Dotted;
1651 case SvxBorderLineStyle::DASHED:
1652 nStyleIndex = Idx_Dashed;
1654 case SvxBorderLineStyle::FINE_DASHED:
1655 nStyleIndex = Idx_FineDashed;
1657 case SvxBorderLineStyle::DASH_DOT:
1658 nStyleIndex = Idx_DashDot;
1660 case SvxBorderLineStyle::DASH_DOT_DOT:
1661 nStyleIndex = Idx_DashDotDot;
1663 case SvxBorderLineStyle::DOUBLE_THIN:
1667 nStyleIndex = Idx_DoubleThin;
1670 nStyleIndex = Idx_Solid;
1674 nOuterWidthIndx = Width_Thick;
1676 nOuterWidthIndx = Width_Medium;
1678 nOuterWidthIndx = Width_Thin;
1680 nOuterWidthIndx = Width_Hair;
1682 nOuterWidthIndx = Width_Thin;
1684 rnXclLine = Map_LineLO_toMS[nStyleIndex][nOuterWidthIndx];
1698 mnLeftColorId(
XclExpPalette::GetColorIdFromIndex( mnLeftColor ) ),
1699 mnRightColorId(
XclExpPalette::GetColorIdFromIndex( mnRightColor ) ),
1700 mnTopColorId(
XclExpPalette::GetColorIdFromIndex( mnTopColor ) ),
1701 mnBottomColorId(
XclExpPalette::GetColorIdFromIndex( mnBottomColor ) ),
1702 mnDiagColorId(
XclExpPalette::GetColorIdFromIndex( mnDiagColor ) )
1717 sal_uInt32 nTLBRColorId;
1718 lclGetBorderLine( nTLBRLine, nTLBRColorId, rTLBRItem.
GetLine(), rPalette, eBiff );
1723 sal_uInt32 nBLTRColorId;
1724 lclGetBorderLine( nBLTRLine, nBLTRColorId, rBLTRItem.
GetLine(), rPalette, eBiff );
1815 switch( nLineStyle )
1839 rStyleSheet->singleElement(nElement);
1840 else if( rColor ==
Color( 0, 0, 0 ) )
1841 rStyleSheet->singleElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1844 rStyleSheet->startElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1846 rStyleSheet->endElement( nElement );
1856 rStyleSheet->startElement( XML_border,
1867 rStyleSheet->endElement( XML_border );
1871 mnForeColorId(
XclExpPalette::GetColorIdFromIndex( mnForeColor ) ),
1872 mnBackColorId(
XclExpPalette::GetColorIdFromIndex( mnBackColor ) ),
1882 , maForeColor(aForeColor)
1883 , maBackColor(aBackColor)
1954 rStyleSheet->startElement(XML_fill);
1972 rStyleSheet->singleElement(XML_fgColor, XML_rgb,
1978 rStyleSheet->singleElement(XML_bgColor, XML_rgb,
1986 rStyleSheet->singleElement(XML_fgColor, XML_rgb,
1991 rStyleSheet->singleElement(XML_bgColor, XML_rgb,
1996 rStyleSheet->endElement( XML_patternFill );
1999 rStyleSheet->endElement( XML_fill );
2016 rStyleSheet->startElement(XML_fill);
2017 rStyleSheet->startElement(XML_patternFill);
2020 rStyleSheet->endElement( XML_patternFill );
2021 rStyleSheet->endElement( XML_fill );
2037 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak ) :
2042 Init( rPattern.
GetItemSet(), nScript, nForceScNumFmt, nForceXclFont, bForceLineBreak,
false );
2050 bool bDefStyle = (rStyleSheet.
GetName() ==
ScResId( STR_STYLENAME_STANDARD ));
2051 sal_Int16 nScript = bDefStyle ?
GetDefApiScript() : css::i18n::ScriptType::WEAK;
2065 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
const
2103 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak,
bool bDefStyle )
2169 sal_uInt16 nTypeProt = 0, nAlign = 0;
2170 sal_uInt32 nArea = 0,
nBorder = 0;
2186 sal_uInt16 nTypeProt = 0, nAlign = 0, nMiscAttrib = 0, nArea = 0;
2187 sal_uInt32 nBorder1 = 0, nBorder2 = 0;
2224 sal_Int32 nXfId = 0;
2225 const XclExpXF* pStyleXF =
nullptr;
2229 nXfId =
rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFIndex );
2233 rStyleSheet->startElement( XML_xf,
2236 XML_fillId, OString::number(
mnFillId),
2249 else if ( pStyleXF )
2253 else if ( pStyleXF )
2257 rStyleSheet->endElement( XML_xf );
2284 OSL_ENSURE( !
maName.isEmpty(),
"XclExpStyle::XclExpStyle - empty style name" );
2285#if OSL_DEBUG_LEVEL > 0
2288 "XclExpStyle::XclExpStyle - this is a built-in style" );
2295 mnStyleId( nStyleId ),
2325 case 0:
return "Normal";
2326 case 3:
return "Comma";
2327 case 4:
return "Currency";
2328 case 5:
return "Percent";
2329 case 6:
return "Comma [0]";
2330 case 7:
return "Currency [0]";
2337 constexpr sal_Int32 CELL_STYLE_MAX_BUILTIN_ID = 54;
2340 const char* pBuiltinId =
nullptr;
2344 sBuiltinId = OString::number( std::min(
static_cast<sal_Int32
>( CELL_STYLE_MAX_BUILTIN_ID - 1 ),
static_cast <sal_Int32
>(
mnStyleId ) ) );
2345 pBuiltinId = sBuiltinId.getStr();
2353 nXFId =
rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFId );
2354 rStrm.GetCurrentStream()->singleElement( XML_cellStyle,
2356 XML_xfId, OString::number(nXFId),
2358 XML_builtinId, pBuiltinId
2368const sal_uInt32 EXC_XFLIST_INDEXBASE = 0xFFFE0000;
2370const sal_uInt32 EXC_XFLIST_HARDLIMIT = 256 * 1024;
2372bool lclIsBuiltInStyle(
const OUString& rStyleName )
2384 mbPredefined( true ),
2385 mbHasStyleRec( false )
2392struct XclExpBorderPred
2396 explicit XclExpBorderPred(
const XclExpCellBorder& rBorder ) : mrBorder( rBorder ) {}
2412 mrBorder.mnTopLine == rBorder.
mnTopLine &&
2426struct XclExpFillPred
2430 explicit XclExpFillPred(
const XclExpCellArea& rFill ) : mrFill( rFill ) {}
2436bool XclExpFillPred::operator()(
const XclExpCellArea& rFill )
const
2463 sal_uInt16 nForceXclFont,
bool bForceLineBreak )
2480 return EXC_XFLIST_INDEXBASE | nXFIndex;
2498 sal_uInt32 nTotalCount =
static_cast< sal_uInt32
>(
maXFList.
GetSize() );
2504 XclExpBuiltInMap::const_iterator aBuiltInEnd =
maBuiltInMap.end();
2518 sal_uInt32 nStyleXFCount = 0;
2520 for(
nId = 0;
nId < nTotalCount; ++
nId )
2523 if( xXF->IsStyleXF() && ((
nId > nMaxBuiltInXFId) || (
maBuiltInMap.find(
nId ) == aBuiltInEnd)) )
2551 if( xXF->IsCellXF() && ((
nId > nMaxBuiltInXFId) || (
maBuiltInMap.find(
nId ) == aBuiltInEnd)) )
2557 if( xDefCellXF->Equals( *xXF ) )
2562 (nSearchPos < nSearchEnd) && (nFoundIndex ==
EXC_XF_NOTFOUND); ++nSearchPos )
2565 nFoundIndex =
static_cast< sal_uInt16
>( nSearchPos );
2576 sal_uInt16 nXmlStyleIndex = 0;
2577 sal_uInt16 nXmlCellIndex = 0;
2580 for(
size_t i = 0;
i < nXFCount; ++
i )
2583 if( xXF->IsStyleXF() )
2593 if( nXFId >= EXC_XFLIST_INDEXBASE )
2594 nXFIndex =
static_cast< sal_uInt16
>( nXFId & ~EXC_XFLIST_INDEXBASE );
2602 OSL_ENSURE( nXFIndex <
maStyleIndexes.size(),
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
2610 OSL_ENSURE( nXFIndex <
maCellIndexes.size(),
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
2628 size_t nXFCount = rXFList.
GetSize();
2629 for(
size_t i = 0;
i < nXFCount; ++
i )
2632 if( xXF->IsCellXF() )
2634 else if( xXF->IsStyleXF() )
2643 rStyleSheet->startElement(XML_fills, XML_count, OString::number(
maFills.size()));
2644 for(
const auto& rFill :
maFills )
2646 rFill.SaveXml(
rStrm );
2648 rStyleSheet->endElement( XML_fills );
2650 rStyleSheet->startElement(XML_borders, XML_count, OString::number(
maBorders.size()));
2653 rBorder.SaveXml(
rStrm );
2655 rStyleSheet->endElement( XML_borders );
2658 sal_Int32 nCells, nStyles;
2663 rStyleSheet->startElement(XML_cellStyleXfs, XML_count, OString::number(nStyles));
2665 for(
size_t i = 0;
i < nXFCount; ++
i )
2668 if( ! xXF->IsStyleXF() )
2672 rStyleSheet->endElement( XML_cellStyleXfs );
2677 rStyleSheet->startElement(XML_cellXfs, XML_count, OString::number(nCells));
2679 for(
size_t i = 0;
i < nXFCount; ++
i )
2682 if( ! xXF->IsCellXF() )
2686 rStyleSheet->endElement( XML_cellXfs );
2690 rStyleSheet->startElement(XML_cellStyles, XML_count, OString::number(
maStyleList.
GetSize()));
2692 rStyleSheet->endElement( XML_cellStyles );
2697 XclExpBorderList::iterator aBorderPos =
2699 OSL_ENSURE( aBorderPos !=
maBorders.end(),
"XclExpXFBuffer::SaveXml - Invalid @borderId!" );
2700 XclExpFillList::iterator aFillPos =
2702 OSL_ENSURE( aFillPos !=
maFills.end(),
"XclExpXFBuffer::SaveXml - Invalid @fillId!" );
2704 sal_Int32 nBorderId = 0, nFillId = 0;
2706 nBorderId = std::distance(
maBorders.begin(), aBorderPos );
2707 if( aFillPos !=
maFills.end() )
2708 nFillId = std::distance(
maFills.begin(), aFillPos );
2715 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
const
2725 for (
auto it = it1; it != it2; ++it)
2726 for (
auto const &
nPos : it->second)
2739 for (
auto it = it1; it != it2; ++it)
2740 for (
auto const &
nPos : it->second)
2751 for (
auto const &
nPos : it->second)
2761 FindKey key1 {
false, pItemSet, 0, 0 };
2765 for (
auto it = it1; it != it2; ++it)
2766 for (
auto const &
nPos : it->second)
2775 [&nStyleId, nLevel](
const XclExpBuiltInMap::value_type& rEntry) {
2776 return (rEntry.second.mnStyleId == nStyleId) && (rEntry.second.mnLevel == nLevel);
2789 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
2793 pPattern = pDefPattern;
2796 if( (pPattern == pDefPattern) && !bForceLineBreak &&
2807 rPositions.erase(it);
2813 rbPredefined =
false;
2818 sal_uInt32 nXFId =
FindXF( *pPattern, nForceScNumFmt, nForceXclFont, bForceLineBreak );
2825 GetRoot(), *pPattern, nScript, nForceScNumFmt, nForceXclFont, bForceLineBreak );
2859 OSL_ENSURE(
maXFList.
HasRecord( nXFId ),
"XclExpXFBuffer::InsertStyleXF - built-in XF not found" );
2861 bool& rbPredefined =
maBuiltInMap[ nXFId ].mbPredefined;
2866 auto it = std::find(rPositions.begin(), rPositions.end(), nXFId);
2867 rPositions.erase(it);
2873 rbPredefined =
false;
2878 bool& rbHasStyleRec =
maBuiltInMap[ nXFId ].mbHasStyleRec;
2879 if( !rbHasStyleRec )
2882 rbHasStyleRec =
true;
2890 sal_uInt32 nXFId =
FindXF( rStyleSheet );
2895 if( nXFId < EXC_XFLIST_HARDLIMIT )
2900 if( !rStyleSheet.
GetName().isEmpty() )
2915 if( pStyleSheet->IsUserDefined() && !lclIsBuiltInStyle( pStyleSheet->GetName() ) )
2970 OSL_FAIL(
"XclExpXFBuffer::InsertDefaultRecords - default style not found" );
2972 xDefStyle->SetAllUsedFlags(
true );
3022 OSL_ENSURE( nXFId <
maXFIndexVec.size(),
"XclExpXFBuffer::AppendXFIndex - XF ID out of range" );
3027 OSL_ENSURE(
maXFList.
HasRecord( nXFId ),
"XclExpXFBuffer::AppendXFIndex - XF not found" );
3052 sal_Int32 nDxfId = 0;
3053 for(
SCTAB nTab = 0; nTab < nTables; ++nTab)
3057 for (
auto&
pData : pDBData)
3060 pData->GetArea(aRange);
3065 aRange.
aEnd.
Row(), nTab,
true, aFilterEntries);
3074 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(rColor, 0));
3075 maDxf.push_back(std::make_unique<XclExpDxf>(rRoot, std::move(pExpCellArea)));
3083 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(rColor, 0));
3084 maDxf.push_back(std::make_unique<XclExpDxf>(rRoot, std::move(pExpCellArea)));
3094 for (
const auto& rxItem : *pList)
3096 size_t nEntryCount = rxItem->
size();
3097 for (
size_t nFormatEntry = 0; nFormatEntry < nEntryCount; ++nFormatEntry)
3099 const ScFormatEntry* pFormatEntry = rxItem->GetEntry(nFormatEntry);
3106 OUString aStyleName;
3134 if (!pAlign->FillFromItemSet(rRoot,
rSet,
false,
GetBiff()))
3140 if (!pCellProt->FillFromItemSet(
rSet ))
3145 std::unique_ptr<XclExpColor> pColor(
new XclExpColor);
3146 if(!pColor->FillFromItemSet(
rSet ))
3153 std::unique_ptr<XclExpNumFmt> pNumFormat;
3156 sal_uInt32 nScNumFmt = pPoolItem->GetValue();
3158 pNumFormat.reset(
new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *
this, nScNumFmt, xFormatter.get(),
mpKeywordTable.get() )));
3161 maDxf.push_back(std::make_unique<XclExpDxf>( rRoot, std::move(pAlign), std::move(pBorder),
3162 std::move(pFont), std::move(pNumFormat), std::move(pCellProt), std::move(pColor) ));
3174 std::map<OUString, sal_Int32>::const_iterator itr =
maStyleNameToDxfId.find(rStyleName);
3182 std::map<Color, sal_Int32>::const_iterator itr =
maColorToDxfId.find(aColor);
3192 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(aColor, 0));
3193 maDxf.push_back(std::make_unique<XclExpDxf>(
GetRoot(), std::move(pExpCellArea)));
3202 rStyleSheet->startElement(XML_dxfs, XML_count, OString::number(
maDxf.size()));
3204 for (
auto& rxDxf :
maDxf )
3206 rxDxf->SaveXml(
rStrm );
3209 rStyleSheet->endElement( XML_dxfs );
3213 std::unique_ptr<XclExpDxfFont> pFont, std::unique_ptr<XclExpNumFmt> pNumberFmt, std::unique_ptr<XclExpCellProt> pProt,
3214 std::unique_ptr<XclExpColor> pColor)
3216 mpAlign(
std::move(pAlign)),
3217 mpBorder(
std::move(pBorder)),
3219 mpNumberFmt(
std::move(pNumberFmt)),
3220 mpProt(
std::move(pProt)),
3221 mpColor(
std::move(pColor))
3227 , mpCellArea(
std::move(pCellArea))
3238 rStyleSheet->startElement(XML_dxf);
3254 rStyleSheet->endElement( XML_dxf );
3260 rStyleSheet->startElementNS( XML_x14, XML_dxf );
3274 rStyleSheet->endElementNS( XML_x14, XML_dxf );
3288 rStrm.GetCurrentStream()->getOutputStream(),
3289 "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3291 rStrm.PushStream( aStyleSheet );
3293 aStyleSheet->startElement(XML_styleSheet, XML_xmlns,
rStrm.getNamespaceURL(OOX_NS(xls)));
3301 aStyleSheet->endElement( XML_styleSheet );
bool ScHasPriority(const ::editeng::SvxBorderLine *pThis, const ::editeng::SvxBorderLine *pOther)
General Help Function.
sal_uInt8 GetBlue() const
void SetGreen(sal_uInt8 nGreen)
void SetRed(sal_uInt8 nRed)
bool IsTransparent() const
sal_uInt8 GetGreen() const
void SetBlue(sal_uInt8 nBlue)
const OUString & GetStyleName() const
const OUString & GetStyle() const
std::vector< ScDBData * > GetAllDBsFromTab(SCTAB nTab)
SC_DLLPUBLIC ScPatternAttr * GetDefPattern() const
SC_DLLPUBLIC void GetFilterEntriesArea(SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bCaseSens, ScFilterEntries &rFilterEntries)
Entries for Filter dialog.
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
SC_DLLPUBLIC SCTAB GetTableCount() const
virtual Type GetType() const =0
const ScStyleSheet * GetStyleSheet() const
static ScDxfFont GetDxfFont(const SfxItemSet &rSet, SvtScriptType nScript)
static void GetFont(vcl::Font &rFont, const SfxItemSet &rItemSet, ScAutoFontColorMode eAutoMode, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE, const Color *pBackConfigColor=nullptr, const Color *pTextConfigColor=nullptr)
Static helper function to fill a font object from the passed item set.
SfxItemSet & GetItemSet()
bool GetHideFormula() const
bool GetProtection() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
const OUString & GetName() const
virtual SfxItemSet & GetItemSet()
virtual SfxStyleSheetBase * Next()
virtual SfxStyleSheetBase * First()
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
const Color & GetColor() const
const editeng::SvxBorderLine * GetLine() const
Stores all default colors for a specific BIFF version.
sal_uInt32 GetColorCount() const
Returns the color count in the current palette.
Color GetDefColor(sal_uInt16 nXclIndex) const
Returns the default color for a (non-zero-based) Excel color or COL_AUTO on error.
Used as placeholder for font index 4, which is not used in Excel.
virtual bool Equals(const XclFontData &rFontData, sal_uInt32 nHash) const override
Returns always false to never find this font while searching the font list.
virtual void Save(XclExpStream &rStrm) override
Skips writing this record.
XclExpBlindFont(const XclExpRoot &rRoot)
Represents a default XF record.
void SetNumFmt(sal_uInt16 nXclNumFmt)
Sets the Excel number format index.
void SetFont(sal_uInt16 nXclFont)
Sets the Excel font index.
XclExpDefaultXF(const XclExpRoot &rRoot, bool bCellXF)
XclExpDxfFont(const XclExpRoot &rRoot, const SfxItemSet &rItemSet)
virtual void SaveXml(XclExpXmlStream &rStrm) override
std::unique_ptr< XclExpNumFmt > mpNumberFmt
std::unique_ptr< XclExpCellAlign > mpAlign
std::unique_ptr< XclExpCellProt > mpProt
std::unique_ptr< XclExpCellArea > mpCellArea
virtual void SaveXml(XclExpXmlStream &rStrm) override
void SaveXmlExt(XclExpXmlStream &rStrm)
virtual ~XclExpDxf() override
std::unique_ptr< XclExpDxfFont > mpFont
XclExpDxf(const XclExpRoot &rRoot, std::unique_ptr< XclExpCellAlign > pAlign, std::unique_ptr< XclExpCellBorder > pBorder, std::unique_ptr< XclExpDxfFont > pFont, std::unique_ptr< XclExpNumFmt > pNumberFmt, std::unique_ptr< XclExpCellProt > pProt, std::unique_ptr< XclExpColor > pColor)
std::unique_ptr< XclExpCellBorder > mpBorder
std::unique_ptr< XclExpColor > mpColor
sal_Int32 GetDxfByColor(Color aColor) const
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpDxfs(const XclExpRoot &rRoot)
std::map< OUString, sal_Int32 > maStyleNameToDxfId
void AddColor(Color aColor)
std::unique_ptr< NfKeywordTable > mpKeywordTable
sal_Int32 GetDxfId(const OUString &rName) const
std::map< Color, sal_Int32 > maColorToDxfId
XclExpFontList maFontList
XclExpFontBuffer(const XclExpRoot &rRoot)
size_t mnXclMaxSize
List of all FONT records.
sal_uInt16 Insert(const XclFontData &rFontData, XclExpColorType eColorType, bool bAppFont=false)
Inserts a new font with the passed font data into the buffer if not present.
const XclExpFont * GetFont(sal_uInt16 nXclFont) const
Returns the specified font from font list.
void InitDefaultFonts()
Initializes the default fonts for the current BIFF version.
size_t Find(const XclFontData &rFontData)
Tries to find the passed font and returns the current list index.
const XclFontData & GetAppFontData() const
Returns the application font data of this file, needed e.g.
virtual void Save(XclExpStream &rStrm) override
Writes all FONT records contained in this buffer.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Stores all data of an Excel font and provides export of FONT records.
virtual bool Equals(const XclFontData &rFontData, sal_uInt32 nHash) const
Compares this font with the passed font data.
sal_uInt32 mnHash
Unique color ID for text color.
XclExpFont(const XclExpRoot &rRoot, const XclFontData &rFontData, XclExpColorType eColorType)
virtual void SaveXml(XclExpXmlStream &rStrm) override
sal_uInt32 mnColorId
All font attributes.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the FONT record.
const XclFontData & GetFontData() const
Returns read-only access to font data.
OUString GetFormatCode(sal_uInt32 nScNumFmt)
XclExpNumFmtBuffer(const XclExpRoot &rRoot)
sal_uInt16 Insert(sal_uInt32 nScNumFmt)
Inserts a number format into the format buffer.
void WriteFormatRecord(XclExpStream &rStrm, sal_uInt16 nXclNumFmt, const OUString &rFormatStr)
Writes the FORMAT record with index nXclIx and format string rFormatStr.
virtual ~XclExpNumFmtBuffer() override
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpNumFmtVec maFormatMap
Special number formatter for conversion.
std::unique_ptr< NfKeywordTable > mpKeywordTable
Maps core formats to Excel indexes.
sal_uInt16 mnXclOffset
Key for standard number format.
virtual void Save(XclExpStream &rStrm) override
Writes all FORMAT records contained in this buffer.
SvNumberFormatterPtr mxFormatter
XclListColorListRef mxColorList
The default palette for the current BIFF version.
XclExpPaletteImpl(const XclDefaultPalette &rDefPal)
sal_uInt32 GetNearestListColor(const Color &rColor, sal_uInt32 nIgnore) const
Returns the list index of the color nearest to rColor.
bool IsDefaultPalette() const
Returns true, if all colors of the palette are equal to default palette colors.
static sal_uInt16 GetXclIndex(sal_uInt32 nIndex)
Returns the Excel index of a 0-based color index.
void ReduceLeastUsedColor()
Reduction of one color using advanced color merging based on color weighting.
sal_uInt32 GetLeastUsedListColor() const
Finds the least used color and returns its current list index.
std::vector< XclColorIdData > maColorIdDataVec
Working color list.
sal_uInt32 mnLastIdx
Contains resulting colors to export.
sal_Int32 GetNearPaletteColors(sal_uInt32 &rnFirst, sal_uInt32 &rnSecond, const Color &rColor) const
Returns in rnFirst and rnSecond the palette indexes of the two colors nearest to rColor.
Color GetColor(sal_uInt16 nXclIndex) const
Returns the RGB color for a (non-zero-based) Excel palette entry.
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.
std::vector< XclPaletteColor > maPalette
Data of all CIDs.
const Color & GetOriginalColor(sal_uInt32 nColorId) const
Returns the original inserted color represented by the color ID nColorId.
void RawReducePalette(sal_uInt32 nPass)
Raw and fast reduction of the palette.
std::shared_ptr< XclListColorList > XclListColorListRef
sal_uInt32 InsertColor(const Color &rColor, XclExpColorType eType, sal_uInt16 nAutoDefault=0)
Inserts the color into the list and updates weighting.
sal_uInt16 GetColorIndex(sal_uInt32 nColorId) const
Returns the Excel palette index of the color with passed color ID.
void Finalize()
Reduces the color list to the maximum count of the current BIFF version.
void WriteBody(XclExpStream &rStrm)
Writes the color list (contents of the palette record) to the passed stream.
const XclDefaultPalette & mrDefPal
static sal_uInt32 GetColorIdFromIndex(sal_uInt16 nIndex)
Returns the color ID representing a fixed Excel palette index (i.e.
XclListColor * CreateListEntry(const Color &rColor, sal_uInt32 nIndex)
Creates and inserts a new color list entry at the specified list position.
void SaveXml(XclExpXmlStream &rStrm)
std::vector< std::unique_ptr< XclListColor > > XclListColorList
XclListColor * SearchListEntry(const Color &rColor, sal_uInt32 &rnIndex)
Searches for rColor, returns the ordered insertion index for rColor in rnIndex.
sal_Int32 GetNearestPaletteColor(sal_uInt32 &rnIndex, const Color &rColor) const
Returns in rnIndex the palette index of the color nearest to rColor.
Stores all used colors in the document.
sal_uInt32 InsertColor(const Color &rColor, XclExpColorType eType, sal_uInt16 nAutoDefault=0)
Inserts the color into the list and updates weighting.
sal_uInt16 GetColorIndex(sal_uInt32 nColorId) const
Returns the Excel palette index of the color with passed color ID.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Color GetColor(sal_uInt16 nXclIndex) const
Returns the color for a (non-zero-based) Excel palette entry.
void Finalize()
Reduces the color list to the maximum count of the current BIFF version.
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.
static sal_uInt32 GetColorIdFromIndex(sal_uInt16 nIndex)
Returns the color ID representing a fixed Excel palette index (i.e.
virtual void Save(XclExpStream &rStrm) override
Saves the PALETTE record, if it differs from the default palette.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the PALETTE record.
virtual ~XclExpPalette() override
XclExpPaletteImplRef mxImpl
XclExpPalette(const XclExpRoot &rRoot)
virtual void SaveXml(XclExpXmlStream &rStrm) override
rtl::Reference< XclExpXF > RecordRefType
void AppendNewRecord(RecType *pRec)
Appends a newly created record to the list.
bool HasRecord(size_t nPos) const
Returns true, if the passed index points to an exiting record.
void ReplaceRecord(RecType *pRec, size_t nPos)
Replaces the record at the specified position from the list with the passed record.
virtual void Save(XclExpStream &rStrm) override
Writes the complete record list.
void AppendRecord(RecType *pRec)
Appends a record to the list.
RecType * GetRecord(size_t nPos) const
Returns reference to an existing record or empty reference on error.
Base class for single records with any content.
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
void SetRecHeader(sal_uInt16 nRecId, std::size_t nRecSize)
Sets record ID and size with one call.
void SetRecSize(std::size_t nRecSize)
Sets a new record size prediction.
Access to global data from other classes.
XclExpFontBuffer & GetFontBuffer() const
Returns the font buffer.
XclExpNumFmtBuffer & GetNumFmtBuffer() const
Returns the number format buffer.
XclExpRecordRef CreateRecord(sal_uInt16 nRecId) const
Returns the reference to a record (or record list) representing a root object.
XclExpPalette & GetPalette() const
Returns the color buffer.
XclExpXFBuffer & GetXFBuffer() const
Returns the cell formatting attributes buffer.
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
This class is used to export Excel record streams.
This class stores an unformatted or formatted string for Excel export.
void AssignByte(std::u16string_view rString, rtl_TextEncoding eTextEnc, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF2-BIFF7 byte string.
void Assign(const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
std::size_t GetSize() const
Returns the byte count the whole string will take on export.
Represents a STYLE record containing the data of a cell style.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the STYLE record.
sal_uInt8 mnStyleId
XF identifier for style formatting.
XclExpXFId maXFId
Name of the cell style.
sal_uInt8 mnLevel
Built-in style identifier.
bool IsBuiltIn() const
Returns true, if this record represents an Excel built-in style.
XclExpStyle(sal_uInt32 nXFId, const OUString &rStyleName)
virtual void SaveXml(XclExpXmlStream &rStrm) override
Stores all XF records (cell formats and cell styles) in the document.
sal_uInt32 InsertCellXF(const ScPatternAttr *pPattern, sal_Int16 nScript, sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont, bool bForceLineBreak)
Tries to find the XF record containing the passed format or inserts a new record.
void Finalize()
Reduces the XF record list to the maximum allowed number of records.
void AppendXFIndex(sal_uInt32 nXFId)
Appends a XF index to the internal ID<->index maps.
virtual void Save(XclExpStream &rStrm) override
Writes all XF records contained in this buffer.
void AddBorderAndFill(const XclExpXF &rXF)
sal_uInt32 InsertWithNumFmt(const ScPatternAttr *pPattern, sal_Int16 nScript, sal_uInt32 nForceScNumFmt, bool bForceLineBreak)
Finds or creates a cell XF record for the passed item set, with custom number format.
sal_uInt32 FindXF(const ScPatternAttr &rPattern, sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont, bool bForceLineBreak) const
Returns the XF ID of the cell XF containing the passed format.
XclExpXFBuffer(const XclExpRoot &rRoot)
sal_uInt32 InsertStyleXF(const SfxStyleSheetBase &rStyleSheet)
Inserts the passed cell style.
XclExpRecordList< XclExpStyle > maStyleList
map of itemset to vector of positions, to speed up find
XclExpXFList maSortedXFList
Maps XF IDs to OOXML Cell indexes.
XclExpFillList maFills
List of borders used by XF records.
ScfUInt16Vec maXFIndexVec
Contained elements describe built-in XFs.
static sal_uInt32 GetXFIdFromIndex(sal_uInt16 nXFIndex)
Returns the XF identifier representing a fixed Excel XF index (e.g.
sal_uInt32 FindBuiltInXF(sal_uInt8 nStyleId, sal_uInt8 nLevel) const
Returns the XF ID of a built-in style XF, searches by style identifier.
sal_uInt32 InsertWithFont(const ScPatternAttr *pPattern, sal_Int16 nScript, sal_uInt16 nForceXclFont, bool bForceLineBreak)
Finds or creates a cell XF record for the passed item set.
ScfUInt16Vec maCellIndexes
Maps XF IDs to OOXML Style indexes.
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpBuiltInMap maBuiltInMap
List of all STYLE records.
sal_Int32 GetXmlStyleIndex(sal_uInt32 nXFId) const
XclExpBorderList maBorders
List of XF records in XF index order.
static sal_uInt32 GetDefCellXFId()
Returns the XF identifier representing the default cell XF.
static FindKey ToFindKey(XclExpXF const &)
void InsertUserStyles()
Inserts an XF and a STYLE record for all user defined style sheets.
sal_uInt32 Insert(const ScPatternAttr *pPattern, sal_Int16 nScript)
Finds or creates a cell XF record for the passed item set.
const XclExpXF * GetXFById(sal_uInt32 nXFId) const
Returns an XF record by its unique identifier.
void InsertDefaultRecords()
Inserts all default XF and STYLE records.
XclExpXFList::RecordRefType XclExpXFRef
void SaveXFXml(XclExpXmlStream &rStrm, XclExpXF &rXF)
ScfUInt16Vec maStyleIndexes
Maps XF IDs to XF indexes.
std::map< FindKey, std::vector< sal_uInt32 > > maXFFindMap
List of all XF records.
sal_uInt16 GetXFIndex(sal_uInt32 nXFId) const
Returns the Excel XF index of the XF record with passed XF ID.
sal_uInt32 AppendBuiltInXFWithStyle(XclExpXFRef const &xXF, sal_uInt8 nStyleId, sal_uInt8 nLevel=EXC_STYLE_NOLEVEL)
Inserts a built-in XF and STYLE record and returns the XF ID.
sal_uInt32 InsertStyle(const SfxStyleSheetBase *pStyleSheet)
Inserts the passed cell style.
void Initialize()
Inserts predefined built-in styles and user-defined styles.
sal_uInt32 AppendBuiltInXF(XclExpXFRef const &xXF, sal_uInt8 nStyleId, sal_uInt8 nLevel=EXC_STYLE_NOLEVEL)
Inserts a built-in XF record without a STYLE record and returns the XF ID.
sal_Int32 GetXmlCellIndex(sal_uInt32 nXFId) const
Represents an XF record which contains all formatting data of a cell or cell style.
sal_uInt32 GetScNumFmt() const
XclExpCellArea maArea
Border line style.
virtual void SaveXml(XclExpXmlStream &rStrm) override
bool Equals(const ScPatternAttr &rPattern, sal_uInt32 nScForceNumFmt, sal_uInt16 nForceXclFont, bool bForceLineBreak) const
Returns true, if this XF record represents the passed cell formatting.
sal_uInt8 GetUsedFlags() const
Returns the bits specifying the used attributes.
sal_uInt16 mnXclNumFmt
Excel font index.
sal_uInt16 GetXclFont() const
void Init(const SfxItemSet &rItemSet, sal_Int16 nScript, sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont, bool bForceLineBreak, bool bDefStyle)
Fills all members from the passed item set.
sal_uInt32 mnScNumFmt
XF ID of parent XF record.
const XclExpCellAlign & GetAlignmentData() const
Returns the alignment settings of this XF.
void WriteBody5(XclExpStream &rStrm)
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the XF record.
void SetFinalColors()
Sets the resulting Excel palette index from all used color IDs (border and area).
void InitDefault()
Initializes with default values.
void WriteBody8(XclExpStream &rStrm)
const SfxItemSet * GetItemSet() const
const SfxItemSet * mpItemSet
XclExpCellBorder maBorder
All alignment attributes.
XclExpCellAlign maAlignment
Cell protection flags.
const XclExpCellBorder & GetBorderData() const
Returns the cell border settings of this XF.
const XclExpCellArea & GetAreaData() const
Returns the cell fill settings of this XF.
void SetXmlIds(sal_uInt32 nBorderId, sal_uInt32 nFillId)
sal_Int32 mnFillId
OOXML Border Index.
XclExpCellProt maProtection
Pointer to the item set (we do not own it).
sal_Int32 mnBorderId
Excel number format index.
XclExpXF(const XclExpRoot &rRoot, const ScPatternAttr &rPattern, sal_Int16 nScript, sal_uInt32 nScForceNumFmt=NUMBERFORMAT_ENTRY_NOT_FOUND, sal_uInt16 nForceXclFont=EXC_FONT_NOTFOUND, bool bForceLineBreak=false)
Constructs a cell XF record from the passed Calc cell formatting.
sal_uInt16 mnXclFont
Calc number format index.
sal_uInt32 mnParentXFId
Background area style.
const XclExpCellProt & GetProtectionData() const
Returns the cell protection settings of this XF.
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpXmlStyleSheet(const XclExpRoot &rRoot)
Access to global data for a filter object (imported or exported document) from other classes.
XclOutput GetOutput() const
Returns the current output format of the importer/exporter.
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
SvNumberFormatter & GetFormatter() const
Returns the number formatter of the Calc document.
sal_Int16 GetDefApiScript() const
Returns the default script type, e.g.
tools::Long GetSpaceWidth() const
void SetCharWidth(const XclFontData &rFontData)
Sets the width of the '0' - '9' digit character as well as the ' ' space char (using the default font...
ScStyleSheetPool & GetStyleSheetPool() const
Returns the style sheet pool of the Calc document.
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Contains base members for XF record import/export.
bool mbBorderUsed
true = alignment used.
bool IsCellXF() const
Returns true, if this is a hard cell format.
bool mbAreaUsed
true = border data used.
bool IsStyleXF() const
Returns true, if this is a cell style.
bool mbProtUsed
true = cell XF, false = style XF.
bool mbFmtUsed
true = font index used.
bool mbAlignUsed
true = number format used.
bool mbCellXF
Index to parent style XF.
bool Equals(const XclXFBase &rCmp) const
Returns true, if this object is equal to the passed.
void SetAllUsedFlags(bool bUsed)
Sets all "attribute used" flags to the passed state.
bool mbFontUsed
true = cell protection used.
static OString ToOString(const Color &rColor)
static sax_fastparser::FSHelperPtr WriteFontData(sax_fastparser::FSHelperPtr pStream, const XclFontData &rFontData, sal_Int32 nNameId)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define LANGUAGE_ENGLISH_US
std::vector< sal_Int8, boost::noinit_adaptor< std::allocator< sal_Int8 > > > maData
std::unique_ptr< sal_Int32[]> pData
SvtScriptType FromI18NToSvtScriptType(sal_Int16 nI18NType)
ScDxfFont GetDxfFontFromItemSet(const XclExpRoot &rRoot, const SfxItemSet &rSet)
Get a dxf related font object from the item set.
vcl::Font GetFontFromItemSet(const XclExpRoot &rRoot, const SfxItemSet &rItemSet, sal_Int16 nScript)
Returns a VCL font object filled from the passed item set.
bool CheckItems(const XclExpRoot &rRoot, const SfxItemSet &rItemSet, sal_Int16 nScript, bool bDeep)
Returns true, if at least one font related item is set in the passed item set.
sal_Int16 GetFirstUsedScript(const XclExpRoot &rRoot, const SfxItemSet &rItemSet)
Returns the script type of the first font item found in the item set and its parents.
tools::Long const nBorder
Reference< XComponentContext > getProcessComponentContext()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::shared_ptr< T > make_shared(Args &&... args)
OUString getRelationship(Relationship eRelationship)
const char * UseIf(const char *s, bool bUse)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
::std::array< OUString, NF_KEYWORD_ENTRIES_COUNT > NfKeywordTable
std::optional< vcl::Font > mpFont
@ SC_AUTOCOL_RAW
COL_AUTO is returned.
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
constexpr TypedWhichId< SvxPostureItem > ATTR_CTL_FONT_POSTURE(119)
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxWeightItem > ATTR_CJK_FONT_WEIGHT(113)
constexpr TypedWhichId< ScShrinkToFitCell > ATTR_SHRINKTOFIT(140)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_TLBR(141)
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxLanguageItem > ATTR_LANGUAGE_FORMAT(147)
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_VER_JUSTIFY_METHOD(133)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_HOR_JUSTIFY_METHOD(130)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< SvxFrameDirectionItem > ATTR_WRITINGDIR(138)
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
constexpr TypedWhichId< SvxLanguageItem > ATTR_FONT_LANGUAGE(110)
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
constexpr TypedWhichId< SvxPostureItem > ATTR_CJK_FONT_POSTURE(114)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
std::optional< bool > bShadow
std::optional< const SvxFontItem * > pFontAttr
std::optional< bool > bOutline
std::optional< FontLineStyle > eUnder
std::optional< FontItalic > eItalic
std::optional< FontStrikeout > eStrike
std::optional< sal_uInt32 > nFontHeight
std::optional< FontWeight > eWeight
std::optional< Color > aColor
std::set< Color > & getTextColors()
std::set< Color > & getBackgroundColors()
sal_uInt8 mnTextDir
Text orientation.
void SetScFrameDir(SvxFrameDirection eFrameDir)
Sets the Calc frame direction.
sal_uInt8 mnOrient
Vertical alignment.
sal_uInt8 mnVerAlign
Horizontal alignment.
sal_uInt8 mnIndent
Text rotation angle.
void SetScHorAlign(SvxCellHorJustify eHorJust)
Sets the Calc horizontal alignment.
void SetScVerAlign(SvxCellVerJustify eVerJust)
Sets the Calc vertical alignment.
sal_uInt8 mnRotation
CTL text direction.
bool mbLineBreak
Indentation.
bool mbShrink
true = Multi-line text.
Contains background colors and pattern for a cell.
sal_uInt16 mnBackColor
Palette index to foreground color.
bool IsTransparent() const
Returns true, if the area represents transparent state.
sal_uInt8 mnPattern
Palette index to background color.
sal_uInt8 mnRightLine
Style of left line.
sal_uInt8 mnDiagLine
Style of bottom line.
sal_uInt16 mnDiagColor
Palette index for bottom line.
bool mbDiagTLtoBR
Style of diagonal line(s).
sal_uInt8 mnTopLine
Style of right line.
sal_uInt8 mnLeftLine
Palette index for diagonal line(s).
sal_uInt16 mnTopColor
Palette index for right line.
sal_uInt16 mnRightColor
Palette index for left line.
sal_uInt16 mnBottomColor
Palette index for top line.
bool mbDiagBLtoTR
true = Top-left to bottom-right on.
sal_uInt8 mnBottomLine
Style of top line.
bool mbHidden
true = Locked against editing.
Extends the XclCellAlign struct for export.
bool FillFromItemSet(const XclRoot &rRoot, const SfxItemSet &rItemSet, bool bForceLineBreak, XclBiff eBiff, bool bStyle=false)
Fills the alignment attributes from the passed item set.
void SaveXml(XclExpXmlStream &rStrm) const
void FillToXF8(sal_uInt16 &rnAlign, sal_uInt16 &rnMiscAttrib) const
Fills the data to the passed fields of a BIFF8 XF record.
void FillToXF5(sal_uInt16 &rnAlign) const
Fills the data to the passed fields of a BIFF5/BIFF7 XF record.
Extends the XclCellArea struct for export.
Color maForeColor
Background color ID.
void SaveXml(XclExpXmlStream &rStrm) const
sal_uInt32 mnBackColorId
Foreground color ID.
void FillToCF8(sal_uInt16 &rnPattern, sal_uInt16 &rnColor) const
Fills the data to the passed fields of a BIFF8 CF (conditional format) record.
void FillToXF5(sal_uInt32 &rnArea) const
Fills the data to the passed fields of a BIFF5/BIFF7 XF record.
void SetFinalColors(const XclExpPalette &rPalette)
Fills the mn***Color base members from the mn***ColorId members.
bool FillFromItemSet(const SfxItemSet &rItemSet, XclExpPalette &rPalette, bool bStyle)
Fills the area attributes from the passed item set.
void FillToXF8(sal_uInt32 &rnBorder2, sal_uInt16 &rnArea) const
Fills the data to the passed fields of a BIFF8 XF record.
Extends the XclCellBorder struct for export.
sal_uInt32 mnDiagColorId
Color ID for bottom line.
void SetFinalColors(const XclExpPalette &rPalette)
Fills the mn***Color base members from the mn***ColorId members.
bool FillFromItemSet(const SfxItemSet &rItemSet, XclExpPalette &rPalette, XclBiff eBiff, bool bStyle=false)
Fills the border attributes from the passed item set.
XclExpCellBorder()
Color ID for diagonal line(s).
sal_uInt32 mnRightColorId
Color ID for left line.
sal_uInt32 mnBottomColorId
Color ID for top line.
void FillToXF8(sal_uInt32 &rnBorder1, sal_uInt32 &rnBorder2) const
Fills the data to the passed fields of a BIFF8 XF record.
void FillToCF8(sal_uInt16 &rnLine, sal_uInt32 &rnColor) const
Fills the data to the passed fields of a BIFF8 CF (conditional format) record.
void SaveXml(XclExpXmlStream &rStrm) const
void FillToXF5(sal_uInt32 &rnBorder, sal_uInt32 &rnArea) const
Fills the data to the passed fields of a BIFF5/BIFF7 XF record.
sal_uInt32 mnTopColorId
Color ID for right line.
Extends the XclCellProt struct for export.
bool FillFromItemSet(const SfxItemSet &rItemSet, bool bStyle=false)
Fills the protection attributes from the passed item set.
void SaveXml(XclExpXmlStream &rStrm) const
void FillToXF3(sal_uInt16 &rnProt) const
Fills the data to the passed fields of a BIFF3-BIFF8 XF record.
void SaveXml(XclExpXmlStream &rStrm) const
bool FillFromItemSet(const SfxItemSet &rItemSet)
Stores a core number format index with corresponding Excel format index.
void SaveXml(XclExpXmlStream &rStrm)
sal_uInt16 mnXclNumFmt
Core index of the number format.
OUString maNumFmtString
Resulting Excel format index.
composite key for the find-map, so we can do partial key searching
Extended info about a built-in XF.
XclExpBuiltInInfo()
true = STYLE record created.
sal_uInt8 mnLevel
Built-in style identifier.
bool mbPredefined
Level for RowLevel/ColLevel styles.
A combination of unique XF identifier with real Excel XF index.
sal_uInt16 mnXFIndex
Temporary XF identifier.
void ConvertXFIndex(const XclExpRoot &rRoot)
Converts the XF identifier in mnXFId to an Excel XF index and stores it in mnXFIndex.
XclExpXFId()
Real Excel XF index.
This struct helps reading and writing Excel fonts.
Color maColor
String with styles (bold, italic).
sal_uInt8 mnCharSet
Windows font family.
void SetScHeight(sal_Int32 nTwips)
Sets the Calc font height (in twips).
sal_uInt16 mnHeight
Font color.
void SetFontEncoding(rtl_TextEncoding eFontEnc)
Sets the font text encoding.
bool mbOutline
true = Struck out.
void SetScFamily(FontFamily eScFamily)
Sets the Calc font family.
sal_uInt16 mnWeight
Font height in twips (1/20 of a point).
void SetScPosture(FontItalic eScPosture)
Sets the Calc font posture.
bool mbItalic
Underline style.
sal_uInt8 mnUnderline
Windows character set.
bool mbStrikeout
true = Italic.
void SetScWeight(FontWeight eScWeight)
Sets the Calc font weight.
sal_uInt8 mnFamily
Escapement type.
sal_uInt16 mnEscapem
Boldness: 400=normal, 700=bold.
bool mbShadow
true = Outlined.
const sal_uInt32 EXC_PAL_MAXRAWSIZE
static const char * lcl_StyleNameFromId(sal_Int32 nStyleId)
static const char * ToVerticalAlignment(sal_uInt8 nVerAlign)
static void lcl_GetCellCounts(const XclExpRecordList< XclExpXF > &rXFList, sal_Int32 &rCells, sal_Int32 &rStyles)
static const char * ToHorizontalAlignment(sal_uInt8 nHorAlign)
static XclExpCellArea lcl_GetPatternFill_None()
static XclExpCellArea lcl_GetPatternFill_Gray125()
static const char * ToPatternType(sal_uInt8 nPattern)
const sal_uInt32 EXC_PAL_INDEXBASE
static void lcl_WriteBorder(XclExpXmlStream &rStrm, sal_Int32 nElement, sal_uInt8 nLineStyle, const Color &rColor)
static const char * ToLineStyle(sal_uInt8 nLineStyle)
const sal_uInt16 EXC_ID_FONTLIST
const sal_uInt16 EXC_ID_XFLIST
For internal use only.
XclExpColorType
For internal use only. TODO:moggi: find a better/correct value.
@ EXC_COLOR_CHARTAREA
Line in a chart.
@ EXC_COLOR_GRID
Text color in a form control.
@ EXC_COLOR_CELLBORDER
Text in a cell.
@ EXC_COLOR_CTRLTEXT
Area in a chart.
@ EXC_COLOR_CHARTTEXT
Background area of a cell.
@ EXC_COLOR_CELLAREA
Border of a cell.
@ EXC_COLOR_CHARTLINE
Text color in a chart.
@ EXC_COLOR_TABBG
Spreadsheet grid color.
const sal_uInt16 EXC_ID_FORMATLIST
For internal use only.
const sal_uInt16 EXC_ID_DXFS
For internal use only.
const size_t EXC_FONTLIST_NOTFOUND
::std::unique_ptr< SvNumberFormatter > SvNumberFormatterPtr
const sal_uInt16 EXC_BORDER_THICK
const sal_uInt16 EXC_BORDER_MEDIUM
const sal_uInt16 EXC_BORDER_THIN
XclBiff
An enumeration for all Excel file format types (BIFF types).
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
const sal_uInt8 EXC_ROT_STACKED
Text rotation: 90 deg clockwise.
const sal_uInt16 EXC_BORDER_HAIR
@ EightBitLength
Always use UCS-2 characters (default: try to compress). BIFF8 only.
@ ForceUnicode
Default string settings.
const sal_uInt8 EXC_STYLE_CURRENCY_0
"Comma [0]" style.
const sal_uInt16 EXC_XF_DEFAULTSTYLE
Arbitrary maximum number of style XFs.
const size_t EXC_FONT_MAXCOUNT5
const sal_uInt16 EXC_COLOR_WINDOWBACK
System window text color (>=BIFF5).
const sal_uInt16 EXC_FONT_NOTFOUND
Application font index.
const sal_uInt8 EXC_XF_HOR_GENERAL
const sal_uInt8 EXC_XF_HOR_DISTRIB
const sal_uInt8 EXC_STYLE_CURRENCY
"Comma" style.
const sal_uInt8 EXC_LINE_HAIR
const sal_uInt16 EXC_FONTATTR_SHADOW
const sal_uInt8 EXC_LINE_DOTTED
const sal_uInt16 EXC_FORMAT_OFFSET8
const sal_uInt8 EXC_PATT_50_PERC
const sal_uInt8 EXC_STYLE_COLLEVEL
"RowLevel_*" styles.
const sal_uInt8 EXC_LINE_MEDIUM_DASHDOTDOT
const sal_uInt16 EXC_FONT_APP
const sal_uInt8 EXC_XF_DIFF_BORDER
const sal_uInt32 EXC_XF_MAXSTYLECOUNT
Maximum number of all XF records.
const sal_uInt8 EXC_PATT_6_25_PERC
const sal_uInt16 EXC_COLOR_FONTAUTO
Note text color.
const sal_uInt16 EXC_FONTATTR_UNDERLINE
const sal_uInt16 EXC_COLOR_USEROFFSET
const sal_uInt8 EXC_XF_HOR_CENTER_AS
const sal_uInt8 EXC_STYLE_PERCENT
"Currency" style.
const sal_uInt8 EXC_XF_HOR_CENTER
const size_t EXC_FONT_MAXCOUNT8
const sal_uInt8 EXC_STYLE_LEVELCOUNT
No built-in style.
const sal_uInt8 EXC_XF_DIFF_FONT
const sal_uInt8 EXC_LINE_DASHED
const sal_uInt8 EXC_LINE_THIN
const sal_uInt8 EXC_STYLE_ROWLEVEL
"Normal" style.
const sal_uInt16 EXC_ID4_FORMAT
const sal_uInt8 EXC_LINE_MEDIUM_DASHED
const sal_uInt16 EXC_FONTATTR_STRIKEOUT
const sal_uInt8 EXC_LINE_NONE
const sal_uInt16 EXC_COLOR_WINDOWTEXT
System window background color (BIFF3-BIFF4).
const sal_uInt16 EXC_XF_NOTFOUND
Excel index to default cell XF.
const sal_uInt16 EXC_ID2_FONT
const sal_uInt8 EXC_XF_DIFF_VALFMT
Shrink to fit into cell.
const sal_uInt8 EXC_XF_VER_TOP
const sal_uInt8 EXC_LINE_THIN_DASHDOTDOT
const sal_uInt8 EXC_STYLE_NOLEVEL
Number of outline level styles.
const sal_uInt16 EXC_FONTATTR_ITALIC
const sal_uInt16 EXC_XF_STYLE
const sal_uInt16 EXC_ID_PALETTE
const sal_uInt16 EXC_XF_LOCKED
const sal_uInt8 EXC_XF_VER_JUSTIFY
const sal_uInt16 EXC_XF_STYLEPARENT
const sal_uInt16 EXC_STYLE_BUILTIN
const sal_uInt16 EXC_FONTATTR_NONE
const sal_uInt16 EXC_ID_STYLE
Font auto color (system window text color).
const sal_uInt8 EXC_XF_VER_BOTTOM
const sal_uInt8 EXC_PATT_NONE
const sal_uInt8 EXC_XF_VER_CENTER
const sal_uInt8 EXC_LINE_MEDIUM_SLANT_DASHDOT
const sal_uInt8 EXC_LINE_THIN_DASHDOT
const sal_uInt16 EXC_XF_HIDDEN
const sal_uInt8 EXC_XF_HOR_FILL
const sal_uInt8 EXC_STYLE_COMMA_0
"Percent" style.
const sal_uInt8 EXC_PATT_SOLID
const sal_uInt32 EXC_XF_MAXCOUNT
const sal_uInt8 EXC_PATT_75_PERC
const sal_uInt8 EXC_LINE_MEDIUM
const sal_uInt16 EXC_XF_LINEBREAK
Styles don't have a parent.
const sal_uInt32 EXC_XF_DIAGONAL_BL_TO_TR
Top-left to bottom-right.
const sal_uInt8 EXC_PATT_12_5_PERC
const sal_uInt8 EXC_XF_HOR_RIGHT
const sal_uInt8 EXC_XF_HOR_JUSTIFY
const sal_uInt16 EXC_ID5_XF
const sal_uInt8 EXC_XF_VER_DISTRIB
const sal_uInt32 EXC_XFID_NOTFOUND
Special index for "not found" state.
const sal_uInt8 EXC_LINE_THICK
const size_t EXC_FONT_MAXCOUNT4
const sal_uInt32 EXC_XF_DIAGONAL_TL_TO_BR
const sal_uInt8 EXC_XF_HOR_LEFT
const sal_uInt8 EXC_XF_DIFF_ALIGN
const sal_uInt8 EXC_PATT_25_PERC
const sal_uInt8 EXC_STYLE_COMMA
"ColLevel_*" styles.
const sal_uInt8 EXC_XF_DIFF_AREA
const sal_uInt8 EXC_LINE_DOUBLE
const sal_uInt8 EXC_LINE_MEDIUM_DASHDOT
const sal_uInt16 EXC_FONTATTR_OUTLINE
const sal_uInt16 EXC_XF_DEFAULTCELL
Excel index to default style XF.
const sal_uInt8 EXC_XF_TEXTDIR_CONTEXT
const sal_uInt16 EXC_FORMAT_OFFSET5
const sal_uInt8 EXC_STYLE_NORMAL
const sal_uInt8 EXC_STYLE_USERDEF
"Followed_Hyperlink" style.
const sal_uInt16 EXC_XF8_SHRINK
const sal_uInt8 EXC_XF_DIFF_PROT
#define SV_COUNTRY_LANGUAGE_OFFSET
constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND