26#include <com/sun/star/i18n/ScriptType.hpp>
28#include <rtl/tencinfo.h>
29#include <vcl/font.hxx>
40#include <document.hxx>
42#include <stlsheet.hxx>
56#include <oox/token/tokens.hxx>
57#include <oox/token/namespaces.hxx>
81 default: OSL_FAIL(
"lclGetWeighting - unknown color type" );
86sal_Int32 lclGetColorDistance(
const Color& rColor1,
const Color& rColor2 )
91 nDist += nDummy * nDummy * 151;
93 nDist += nDummy * nDummy * 28;
99 sal_uInt8 nComp1Dist = ::std::min< sal_uInt8 >( nComp1, 0xFF - nComp1 );
100 sal_uInt8 nComp2Dist = ::std::min< sal_uInt8 >( nComp2, 0xFF - nComp2 );
101 if( nComp1Dist != nComp2Dist )
105 const sal_uInt8& rnCompNearer = (nComp1Dist < nComp2Dist) ? nComp1 : nComp2;
106 sal_uInt32& rnWeight = (nComp1Dist < nComp2Dist) ? nWeight1 : nWeight2;
107 rnWeight *= ((rnCompNearer - 0x80L) * (rnCompNearer - 0x7FL) / 0x1000L + 1);
109 sal_uInt32 nWSum = nWeight1 + nWeight2;
110 return static_cast< sal_uInt8 >( (nComp1 * nWeight1 + nComp2 * nWeight2 + nWSum / 2) / nWSum );
113void lclSetMixedColor(
Color& rDest,
const Color& rSrc1,
const Color& rSrc2 )
136 sal_uInt32 mnColorId;
141 explicit XclListColor(
const Color& rColor, sal_uInt32 nColorId );
146 sal_uInt32 GetColorId()
const {
return mnColorId; }
148 sal_uInt32 GetWeighting()
const {
return mnWeight; }
150 bool IsBaseColor()
const {
return mbBaseColor; }
153 void AddWeighting( sal_uInt32 nWeight ) {
mnWeight += nWeight; }
155 void Merge(
const XclListColor& rColor );
158XclListColor::XclListColor(
const Color& rColor, sal_uInt32 nColorId ) :
160 mnColorId( nColorId ),
164 ((rColor.
GetRed() == 0x00) || (rColor.
GetRed() == 0xFF)) &&
169void XclListColor::Merge(
const XclListColor& rColor )
171 sal_uInt32 nWeight2 = rColor.GetWeighting();
175 maColor.SetRed( lclGetMergedColorComp(
maColor.GetRed(), mnWeight, rColor.maColor.GetRed(), nWeight2 ) );
176 maColor.SetGreen( lclGetMergedColorComp(
maColor.GetGreen(), mnWeight, rColor.maColor.GetGreen(), nWeight2 ) );
177 maColor.SetBlue( lclGetMergedColorComp(
maColor.GetBlue(), mnWeight, rColor.maColor.GetBlue(), nWeight2 ) );
179 AddWeighting( nWeight2 );
192struct XclPaletteColor
197 explicit XclPaletteColor(
const Color& rColor ) :
maColor( rColor ), mbUsed( false ) {}
198 void SetColor(
const Color& rColor ) {
maColor = rColor; mbUsed =
true; }
205 sal_uInt32 mnPalIndex;
208 explicit XclRemap() : mnPalIndex( 0 ), mbProcessed( false ) {}
209 void SetIndex( sal_uInt32 nPalIndex )
210 { mnPalIndex = nPalIndex; mbProcessed =
true; }
216 sal_uInt32 mnPalIndex;
219 explicit XclNearest() : mnPalIndex( 0 ), mnDist( 0 ) {}
247 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
248 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const;
292 const Color& rColor )
const;
296 sal_uInt32& rnFirst, sal_uInt32& rnSecond,
297 const Color& rColor )
const;
305 std::vector< XclColorIdData >
307 std::vector< XclPaletteColor >
323 for( sal_uInt16 nIdx = 0; nIdx <
nCount; ++nIdx )
334 sal_uInt32 nFoundIdx = 0;
336 if( !pEntry || (pEntry->GetColor() != rColor) )
338 pEntry->AddWeighting( lclGetWeighting(
eType ) );
340 return pEntry->GetColorId();
354 for( sal_uInt32 nIdx = 0; nIdx <
nCount; ++nIdx )
356 const XclListColor& listColor = *
mxColorList->at( nIdx );
357 maColorIdDataVec[ listColor.GetColorId() ].Set( listColor.GetColor(), nIdx );
363 sal_uInt32 nPass = 0;
374 std::vector< XclRemap > aRemapVec(
nCount );
375 std::vector< XclNearest > aNearestVec(
nCount );
378 for( sal_uInt32 nRun = 0; nRun <
nCount; ++nRun )
386 sal_uInt32 nFound = 0;
388 if( aNearestVec[
nIndex ].mnDist < aNearestVec[ nFound ].mnDist )
391 sal_uInt32 nNearest = aNearestVec[ nFound ].mnPalIndex;
392 OSL_ENSURE( nNearest <
maPalette.size(),
"XclExpPaletteImpl::Finalize - algorithm error" );
394 aRemapVec[ nFound ].SetIndex( nNearest );
399 rColorIdData.mnIndex = aRemapVec[ rColorIdData.mnIndex ].mnPalIndex;
406 nRet =
static_cast< sal_uInt16
>( nColorId & ~EXC_PAL_INDEXBASE );
413 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
414 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const
423 sal_uInt32 nIndex1, nIndex2;
429 Color aColorArr[ 5 ];
430 aColorArr[ 0 ] =
maPalette[ nIndex1 ].maColor;
431 aColorArr[ 4 ] =
maPalette[ nIndex2 ].maColor;
432 lclSetMixedColor( aColorArr[ 2 ], aColorArr[ 0 ], aColorArr[ 4 ] );
433 lclSetMixedColor( aColorArr[ 1 ], aColorArr[ 0 ], aColorArr[ 2 ] );
434 lclSetMixedColor( aColorArr[ 3 ], aColorArr[ 2 ], aColorArr[ 4 ] );
436 sal_Int32 nMinDist = nFirstDist;
437 sal_uInt32 nMinIndex = 0;
438 for( sal_uInt32 nCnt = 1; nCnt < 4; ++nCnt )
440 sal_Int32 nDist = lclGetColorDistance( aForeColor, aColorArr[ nCnt ] );
441 if( nDist < nMinDist )
449 if( nMinDist < nFirstDist )
473 bool bDefault =
true;
474 for( sal_uInt32 nIdx = 0, nSize =
static_cast< sal_uInt32
>(
maPalette.size() ); bDefault && (nIdx < nSize); ++nIdx )
481 rStrm << static_cast< sal_uInt16 >(
maPalette.size() );
483 rStrm << rColor.maColor;
492 rStyleSheet->startElement(XML_colors);
493 rStyleSheet->startElement(XML_indexedColors);
496 rStyleSheet->endElement( XML_indexedColors );
497 rStyleSheet->endElement( XML_colors );
514 XclListColor* pEntry =
nullptr;
517 if (mnLastIdx < mxColorList->
size())
519 pEntry = (*mxColorList)[
mnLastIdx].get();
520 if( pEntry->GetColor() == rColor )
528 sal_uInt32 nBegIdx = 0;
531 while( !bFound && (nBegIdx < nEndIdx) )
533 rnIndex = (nBegIdx + nEndIdx) / 2;
534 pEntry = (*mxColorList)[rnIndex].get();
535 bFound = pEntry->GetColor() == rColor;
538 if( pEntry->GetColor() < rColor )
539 nBegIdx = rnIndex + 1;
555 XclListColor* pEntry =
new XclListColor( rColor,
mxColorList->size() );
574 mxColorList = std::make_shared<XclListColorList>();
578 aListIndexMap.reserve( xOldList->size() );
582 sal_uInt8& rnComp = ((nPass % 3 == 0) ? nB : ((nPass % 3 == 1) ? nR : nG));
584 OSL_ENSURE( nPass < 7,
"XclExpPaletteImpl::RawReducePalette - reduction not terminated" );
586 static const sal_uInt8 spnFactor2[] = { 0x81, 0x82, 0x84, 0x88, 0x92, 0xAA, 0xFF };
588 sal_uInt8 nFactor2 = spnFactor2[ nPass ];
592 for(
const std::unique_ptr<XclListColor> & pOldColor : *xOldList)
595 const XclListColor* pOldEntry = pOldColor.get();
596 nR = pOldEntry->GetColor().GetRed();
597 nG = pOldEntry->GetColor().GetGreen();
598 nB = pOldEntry->GetColor().GetBlue();
604 sal_uInt32 nNewComp = rnComp;
605 nNewComp /= nFactor1;
606 nNewComp *= nFactor2;
607 nNewComp /= nFactor3;
608 rnComp =
static_cast< sal_uInt8 >( nNewComp );
609 Color aNewColor( nR, nG, nB );
612 sal_uInt32 nFoundIdx = 0;
614 if( !pNewEntry || (pNewEntry->GetColor() != aNewColor) )
616 pNewEntry->AddWeighting( pOldEntry->GetWeighting() );
617 aListIndexMap.push_back( nFoundIdx );
622 rColorIdData.mnIndex = aListIndexMap[ rColorIdData.mnIndex ];
633 XclListColor* pKeepEntry =
mxColorList->at(nKeep).get();
634 XclListColor* pRemoveEntry =
mxColorList->at(nRemove).get();
635 if( !(pKeepEntry && pRemoveEntry) )
639 pKeepEntry->Merge( *pRemoveEntry );
641 XclListColorList::iterator itr =
mxColorList->begin();
642 ::std::advance(itr, nRemove);
644 if( nKeep > nRemove ) --nKeep;
649 if( rColorIdData.mnIndex > nRemove )
650 --rColorIdData.mnIndex;
651 else if( rColorIdData.mnIndex == nRemove )
652 rColorIdData.mnIndex = nKeep;
658 sal_uInt32 nFound = 0;
665 if( !rEntry.IsBaseColor() && (rEntry.GetWeighting() < nMinW) )
668 nMinW = rEntry.GetWeighting();
676 sal_uInt32 nFound = 0;
681 if( nIdx != nIgnore )
683 if( XclListColor* pEntry =
mxColorList->at(nIdx).get() )
685 sal_Int32 nDist = lclGetColorDistance( rColor, pEntry->GetColor() );
706 sal_uInt32& rnIndex,
const Color& rColor )
const
711 sal_uInt32 nPaletteIndex = 0;
712 for(
const auto& rPaletteColor :
maPalette )
714 if( !rPaletteColor.mbUsed )
716 sal_Int32 nCurrDist = lclGetColorDistance( rColor, rPaletteColor.maColor );
717 if( nCurrDist < nDist )
719 rnIndex = nPaletteIndex;
729 sal_uInt32& rnFirst, sal_uInt32& rnSecond,
const Color& rColor )
const
731 rnFirst = rnSecond = 0;
735 sal_uInt32 nPaletteIndex = 0;
736 for(
const auto& rPaletteColor :
maPalette )
738 sal_Int32 nCurrDist = lclGetColorDistance( rColor, rPaletteColor.maColor );
739 if( nCurrDist < nDist1 )
743 rnFirst = nPaletteIndex;
746 else if( nCurrDist < nDist2 )
748 rnSecond = nPaletteIndex;
760 mxImpl = std::make_shared<XclExpPaletteImpl>( *
this );
770 return mxImpl->InsertColor( rColor,
eType, nAutoDefault );
785 return mxImpl->GetColorIndex( nColorId );
789 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
790 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const
792 return mxImpl->GetMixedColors( rnXclForeIx, rnXclBackIx, rnXclPattern, nForeColorId, nBackColorId );
797 return mxImpl->GetColor( nXclIndex );
802 if( !
mxImpl->IsDefaultPalette() )
808 if( !
mxImpl->IsDefaultPalette() )
821typedef ::std::pair< sal_uInt16, sal_Int16 > WhichAndScript;
823sal_Int16 lclCheckFontItems(
const SfxItemSet& rItemSet,
824 const WhichAndScript& rWAS1,
const WhichAndScript& rWAS2,
const WhichAndScript& rWAS3 )
836 namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
842 static const WhichAndScript WAS_LATIN(
ATTR_FONT, css::i18n::ScriptType::LATIN );
843 static const WhichAndScript WAS_ASIAN(
ATTR_CJK_FONT, css::i18n::ScriptType::ASIAN );
844 static const WhichAndScript WAS_CMPLX(
ATTR_CTL_FONT, css::i18n::ScriptType::COMPLEX );
850 sal_Int16 nScript = 0;
853 while( (nScript == 0) && pCurrSet )
857 case ApiScriptType::LATIN:
858 nScript = lclCheckFontItems( *pCurrSet, WAS_LATIN, WAS_CMPLX, WAS_ASIAN );
860 case ApiScriptType::ASIAN:
861 nScript = lclCheckFontItems( *pCurrSet, WAS_ASIAN, WAS_CMPLX, WAS_LATIN );
863 case ApiScriptType::COMPLEX:
864 nScript = lclCheckFontItems( *pCurrSet, WAS_CMPLX, WAS_ASIAN, WAS_LATIN );
867 OSL_FAIL(
"XclExpFontHelper::GetFirstUsedScript - unknown script type" );
868 nScript = ApiScriptType::LATIN;
874 nScript = nDefScript;
878 OSL_FAIL(
"XclExpFontHelper::GetFirstUsedScript - unknown script type" );
879 nScript = ApiScriptType::LATIN;
888 if( nScript == css::i18n::ScriptType::WEAK )
911 static const sal_uInt16 pnCommonIds[] = {
914 static const sal_uInt16 pnLatinIds[] = {
916 static const sal_uInt16 pnAsianIds[] = {
918 static const sal_uInt16 pnComplexIds[] = {
924 namespace ApiScriptType = css::i18n::ScriptType;
926 if( nScript == ApiScriptType::WEAK )
933 case ApiScriptType::COMPLEX: bUsed =
ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep );
break;
934 default: OSL_FAIL(
"XclExpFontHelper::CheckItems - unknown script type" );
942std::size_t lclCalcHash(
const XclFontData& rFontData )
944 std::size_t seed = 0;
985 rStyleSheet->startElement(XML_font);
988 rStyleSheet->endElement( XML_font );
1003 OSL_ENSURE(
maData.
maName.getLength() < 256,
"XclExpFont::WriteBody - font name too long" );
1046const char* getFontFamilyOOXValue(
FontFamily eValue)
1076 rStyleSheet->startElement(XML_font);
1083 if (!aFontName.isEmpty())
1085 rStyleSheet->singleElement(XML_name, XML_val, aFontName);
1089 sal_uInt8 nExcelCharSet = rtl_getBestWindowsCharsetFromTextEncoding(eTextEnc);
1092 rStyleSheet->singleElement(XML_charset, XML_val, OString::number(nExcelCharSet));
1096 const char* pVal = getFontFamilyOOXValue(eFamily);
1099 rStyleSheet->singleElement(XML_family, XML_val, pVal);
1105 rStyleSheet->singleElement(XML_b,
1112 rStyleSheet->singleElement(XML_i, XML_val, ToPsz10(bItalic));
1122 rStyleSheet->singleElement(XML_strike, XML_val, ToPsz10(bStrikeout));
1132 rStyleSheet->singleElement(XML_shadow, XML_val, ToPsz10(*
maDxfData.
bShadow));
1137 rStyleSheet->singleElement(XML_color,
1143 rStyleSheet->singleElement(XML_sz,
1150 rStyleSheet->singleElement(XML_u, XML_val, pVal);
1153 rStyleSheet->endElement(XML_font);
1224 return static_cast< sal_uInt16
>(
nPos );
1252 rStyleSheet->startElement(XML_fonts, XML_count, OString::number(
maFontList.
GetSize()));
1256 rStyleSheet->endElement( XML_fonts );
1264 aFontData.
maName =
"Arial";
1309 sal_uInt32 nHash = lclCalcHash( rFontData );
1321struct XclExpNumFmtPred
1323 sal_uInt32 mnScNumFmt;
1324 explicit XclExpNumFmtPred( sal_uInt32 nScNumFmt ) : mnScNumFmt( nScNumFmt ) {}
1334 rStyleSheet->singleElement( XML_numFmt,
1343 mnStdFmt( GetFormatter().GetStandardIndex(
ScGlobal::eLnge ) )
1361 XclExpNumFmtVec::const_iterator aIt =
1364 return aIt->mnXclNumFmt;
1369 sal_uInt16 nXclNumFmt =
static_cast< sal_uInt16
>( nSize +
mnXclOffset );
1389 rStyleSheet->startElement(XML_numFmts, XML_count, OString::number(
maFormatMap.size()));
1392 rEntry.SaveXml(
rStrm );
1394 rStyleSheet->endElement( XML_numFmts );
1403 aExpStr.
Assign( rFormatStr );
1406 rStrm << nXclNumFmt << aExpStr;
1447 rStrm.GetCurrentStream()->singleElement( XML_protection,
1453 bool bForceLineBreak,
XclBiff eBiff,
bool bStyle)
1466 sal_Int32 nIndent =
static_cast<double>(nTmpIndent) / (3.0 * nSpaceWidth) + 0.5;
1467 mnIndent = limit_cast< sal_uInt8 >( nIndent, 0, 15 );
1530 if (eHorAlign == SvxCellHorJustify::Block)
1534 if (eHorJustMethod == SvxCellJustifyMethod::Distribute)
1538 if (eVerAlign == SvxCellVerJustify::Block)
1542 if (eVerJustMethod == SvxCellJustifyMethod::Distribute)
1600 rStrm.GetCurrentStream()->singleElement( XML_alignment,
1603 XML_textRotation, OString::number(
mnRotation),
1605 XML_indent, OString::number(
mnIndent),
1608 XML_shrinkToFit, ToPsz(
mbShrink ),
1614void lclGetBorderLine(
1620 enum CalcLineIndex{Idx_None, Idx_Solid, Idx_Dotted, Idx_Dashed, Idx_FineDashed, Idx_DashDot, Idx_DashDotDot, Idx_DoubleThin, Idx_Last};
1621 enum ExcelWidthIndex{Width_Hair, Width_Thin, Width_Medium, Width_Thick, Width_Last};
1622 static sal_uInt8 Map_LineLO_toMS[Idx_Last][Width_Last] =
1639 sal_uInt16 nOuterWidth = pLine->GetOutWidth();
1640 ExcelWidthIndex nOuterWidthIndx;
1641 CalcLineIndex nStyleIndex;
1643 switch (pLine->GetBorderLineStyle())
1645 case SvxBorderLineStyle::NONE:
1646 nStyleIndex = Idx_None;
1648 case SvxBorderLineStyle::SOLID:
1649 nStyleIndex = Idx_Solid;
1651 case SvxBorderLineStyle::DOTTED:
1652 nStyleIndex = Idx_Dotted;
1654 case SvxBorderLineStyle::DASHED:
1655 nStyleIndex = Idx_Dashed;
1657 case SvxBorderLineStyle::FINE_DASHED:
1658 nStyleIndex = Idx_FineDashed;
1660 case SvxBorderLineStyle::DASH_DOT:
1661 nStyleIndex = Idx_DashDot;
1663 case SvxBorderLineStyle::DASH_DOT_DOT:
1664 nStyleIndex = Idx_DashDotDot;
1666 case SvxBorderLineStyle::DOUBLE_THIN:
1670 nStyleIndex = Idx_DoubleThin;
1673 nStyleIndex = Idx_Solid;
1677 nOuterWidthIndx = Width_Thick;
1679 nOuterWidthIndx = Width_Medium;
1681 nOuterWidthIndx = Width_Thin;
1683 nOuterWidthIndx = Width_Hair;
1685 nOuterWidthIndx = Width_Thin;
1687 rnXclLine = Map_LineLO_toMS[nStyleIndex][nOuterWidthIndx];
1696 rComplexColor = pLine->getComplexColor();
1707 mnLeftColorId(
XclExpPalette::GetColorIdFromIndex( mnLeftColor ) ),
1708 mnRightColorId(
XclExpPalette::GetColorIdFromIndex( mnRightColor ) ),
1709 mnTopColorId(
XclExpPalette::GetColorIdFromIndex( mnTopColor ) ),
1710 mnBottomColorId(
XclExpPalette::GetColorIdFromIndex( mnBottomColor ) ),
1711 mnDiagColorId(
XclExpPalette::GetColorIdFromIndex( mnDiagColor ) )
1726 sal_uInt32 nTLBRColorId;
1728 lclGetBorderLine( nTLBRLine, nTLBRColorId, aTLBRComplexColor, rTLBRItem.
GetLine(), rPalette, eBiff );
1733 sal_uInt32 nBLTRColorId;
1735 lclGetBorderLine( nBLTRLine, nBLTRColorId, aBLTRComplexColor, rBLTRItem.
GetLine(), rPalette, eBiff );
1828 switch( nLineStyle )
1853 rStyleSheet->singleElement(nElement);
1857 rStyleSheet->startElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1861 rStyleSheet->singleElement(XML_color,
1862 XML_theme, OString::number(nTheme),
1865 rStyleSheet->endElement(nElement);
1867 else if (rColor ==
Color(0, 0, 0))
1869 rStyleSheet->singleElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1873 rStyleSheet->startElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1875 rStyleSheet->endElement( nElement );
1885 rStyleSheet->startElement( XML_border,
1898 rStyleSheet->endElement( XML_border );
1902 mnForeColorId(
XclExpPalette::GetColorIdFromIndex(mnForeColor)),
1903 mnBackColorId(
XclExpPalette::GetColorIdFromIndex(mnBackColor)),
1913 , maForeColor(aForeColor)
1914 , maBackColor(aBackColor)
1989 rStyleSheet->startElement(XML_fill);
2010 rStyleSheet->singleElement(XML_fgColor,
2011 XML_theme, OString::number(nTheme),
2023 rStyleSheet->singleElement(XML_bgColor,
2024 XML_theme, OString::number(nTheme),
2039 rStyleSheet->singleElement(XML_fgColor,
2040 XML_theme, OString::number(nTheme),
2052 rStyleSheet->singleElement(XML_bgColor,
2053 XML_theme, OString::number(nTheme),
2062 rStyleSheet->endElement( XML_patternFill );
2065 rStyleSheet->endElement( XML_fill );
2083 rStyleSheet->startElement(XML_fill);
2084 rStyleSheet->startElement(XML_patternFill);
2089 rStyleSheet->singleElement(XML_bgColor,
2090 XML_theme, OString::number(nTheme),
2096 rStyleSheet->endElement( XML_patternFill );
2097 rStyleSheet->endElement( XML_fill );
2113 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak ) :
2118 Init( rPattern.
GetItemSet(), nScript, nForceScNumFmt, nForceXclFont, bForceLineBreak,
false );
2126 bool bDefStyle = (rStyleSheet.
GetName() ==
ScResId( STR_STYLENAME_STANDARD ));
2127 sal_Int16 nScript = bDefStyle ?
GetDefApiScript() : css::i18n::ScriptType::WEAK;
2141 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
const
2179 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak,
bool bDefStyle )
2245 sal_uInt16 nTypeProt = 0, nAlign = 0;
2246 sal_uInt32 nArea = 0,
nBorder = 0;
2262 sal_uInt16 nTypeProt = 0, nAlign = 0, nMiscAttrib = 0, nArea = 0;
2263 sal_uInt32 nBorder1 = 0, nBorder2 = 0;
2300 sal_Int32 nXfId = 0;
2301 const XclExpXF* pStyleXF =
nullptr;
2305 nXfId =
rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFIndex );
2309 rStyleSheet->startElement( XML_xf,
2312 XML_fillId, OString::number(
mnFillId),
2325 else if ( pStyleXF )
2329 else if ( pStyleXF )
2333 rStyleSheet->endElement( XML_xf );
2360 OSL_ENSURE( !
maName.isEmpty(),
"XclExpStyle::XclExpStyle - empty style name" );
2361#if OSL_DEBUG_LEVEL > 0
2364 "XclExpStyle::XclExpStyle - this is a built-in style" );
2371 mnStyleId( nStyleId ),
2401 case 0:
return "Normal";
2402 case 3:
return "Comma";
2403 case 4:
return "Currency";
2404 case 5:
return "Percent";
2405 case 6:
return "Comma [0]";
2406 case 7:
return "Currency [0]";
2413 constexpr sal_Int32 CELL_STYLE_MAX_BUILTIN_ID = 54;
2416 const char* pBuiltinId =
nullptr;
2420 sBuiltinId = OString::number( std::min(
static_cast<sal_Int32
>( CELL_STYLE_MAX_BUILTIN_ID - 1 ),
static_cast <sal_Int32
>(
mnStyleId ) ) );
2421 pBuiltinId = sBuiltinId.getStr();
2429 nXFId =
rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFId );
2430 rStrm.GetCurrentStream()->singleElement( XML_cellStyle,
2432 XML_xfId, OString::number(nXFId),
2434 XML_builtinId, pBuiltinId
2444const sal_uInt32 EXC_XFLIST_INDEXBASE = 0xFFFE0000;
2446const sal_uInt32 EXC_XFLIST_HARDLIMIT = 256 * 1024;
2448bool lclIsBuiltInStyle(
const OUString& rStyleName )
2460 mbPredefined( true ),
2461 mbHasStyleRec( false )
2468struct XclExpBorderPred
2472 explicit XclExpBorderPred(
const XclExpCellBorder& rBorder ) : mrBorder( rBorder ) {}
2488 mrBorder.mnTopLine == rBorder.
mnTopLine &&
2502struct XclExpFillPred
2506 explicit XclExpFillPred(
const XclExpCellArea& rFill ) : mrFill( rFill ) {}
2512bool XclExpFillPred::operator()(
const XclExpCellArea& rFill )
const
2539 sal_uInt16 nForceXclFont,
bool bForceLineBreak )
2556 return EXC_XFLIST_INDEXBASE | nXFIndex;
2574 sal_uInt32 nTotalCount =
static_cast< sal_uInt32
>(
maXFList.
GetSize() );
2580 XclExpBuiltInMap::const_iterator aBuiltInEnd =
maBuiltInMap.end();
2594 sal_uInt32 nStyleXFCount = 0;
2596 for(
nId = 0;
nId < nTotalCount; ++
nId )
2599 if( xXF->IsStyleXF() && ((
nId > nMaxBuiltInXFId) || (
maBuiltInMap.find(
nId ) == aBuiltInEnd)) )
2627 if( xXF->IsCellXF() && ((
nId > nMaxBuiltInXFId) || (
maBuiltInMap.find(
nId ) == aBuiltInEnd)) )
2633 if( xDefCellXF->Equals( *xXF ) )
2638 (nSearchPos < nSearchEnd) && (nFoundIndex ==
EXC_XF_NOTFOUND); ++nSearchPos )
2641 nFoundIndex =
static_cast< sal_uInt16
>( nSearchPos );
2652 sal_uInt16 nXmlStyleIndex = 0;
2653 sal_uInt16 nXmlCellIndex = 0;
2656 for(
size_t i = 0;
i < nXFCount; ++
i )
2659 if( xXF->IsStyleXF() )
2669 if( nXFId >= EXC_XFLIST_INDEXBASE )
2670 nXFIndex =
static_cast< sal_uInt16
>( nXFId & ~EXC_XFLIST_INDEXBASE );
2678 OSL_ENSURE( nXFIndex <
maStyleIndexes.size(),
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
2686 OSL_ENSURE( nXFIndex <
maCellIndexes.size(),
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
2704 size_t nXFCount = rXFList.
GetSize();
2705 for(
size_t i = 0;
i < nXFCount; ++
i )
2708 if( xXF->IsCellXF() )
2710 else if( xXF->IsStyleXF() )
2719 rStyleSheet->startElement(XML_fills, XML_count, OString::number(
maFills.size()));
2720 for(
const auto& rFill :
maFills )
2722 rFill.SaveXml(
rStrm );
2724 rStyleSheet->endElement( XML_fills );
2726 rStyleSheet->startElement(XML_borders, XML_count, OString::number(
maBorders.size()));
2729 rBorder.SaveXml(
rStrm );
2731 rStyleSheet->endElement( XML_borders );
2734 sal_Int32 nCells, nStyles;
2739 rStyleSheet->startElement(XML_cellStyleXfs, XML_count, OString::number(nStyles));
2741 for(
size_t i = 0;
i < nXFCount; ++
i )
2744 if( ! xXF->IsStyleXF() )
2748 rStyleSheet->endElement( XML_cellStyleXfs );
2753 rStyleSheet->startElement(XML_cellXfs, XML_count, OString::number(nCells));
2755 for(
size_t i = 0;
i < nXFCount; ++
i )
2758 if( ! xXF->IsCellXF() )
2762 rStyleSheet->endElement( XML_cellXfs );
2766 rStyleSheet->startElement(XML_cellStyles, XML_count, OString::number(
maStyleList.
GetSize()));
2768 rStyleSheet->endElement( XML_cellStyles );
2773 XclExpBorderList::iterator aBorderPos =
2775 OSL_ENSURE( aBorderPos !=
maBorders.end(),
"XclExpXFBuffer::SaveXml - Invalid @borderId!" );
2776 XclExpFillList::iterator aFillPos =
2778 OSL_ENSURE( aFillPos !=
maFills.end(),
"XclExpXFBuffer::SaveXml - Invalid @fillId!" );
2780 sal_Int32 nBorderId = 0, nFillId = 0;
2782 nBorderId = std::distance(
maBorders.begin(), aBorderPos );
2783 if( aFillPos !=
maFills.end() )
2784 nFillId = std::distance(
maFills.begin(), aFillPos );
2791 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
const
2801 for (
auto it = it1; it != it2; ++it)
2802 for (
auto const &
nPos : it->second)
2815 for (
auto it = it1; it != it2; ++it)
2816 for (
auto const &
nPos : it->second)
2827 for (
auto const &
nPos : it->second)
2837 FindKey key1 {
false, pItemSet, 0, 0 };
2841 for (
auto it = it1; it != it2; ++it)
2842 for (
auto const &
nPos : it->second)
2851 [&nStyleId, nLevel](
const XclExpBuiltInMap::value_type& rEntry) {
2852 return (rEntry.second.mnStyleId == nStyleId) && (rEntry.second.mnLevel == nLevel);
2865 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
2869 pPattern = pDefPattern;
2872 if( (pPattern == pDefPattern) && !bForceLineBreak &&
2883 rPositions.erase(it);
2889 rbPredefined =
false;
2894 sal_uInt32 nXFId =
FindXF( *pPattern, nForceScNumFmt, nForceXclFont, bForceLineBreak );
2901 GetRoot(), *pPattern, nScript, nForceScNumFmt, nForceXclFont, bForceLineBreak );
2935 OSL_ENSURE(
maXFList.
HasRecord( nXFId ),
"XclExpXFBuffer::InsertStyleXF - built-in XF not found" );
2937 bool& rbPredefined =
maBuiltInMap[ nXFId ].mbPredefined;
2942 auto it = std::find(rPositions.begin(), rPositions.end(), nXFId);
2943 rPositions.erase(it);
2949 rbPredefined =
false;
2954 bool& rbHasStyleRec =
maBuiltInMap[ nXFId ].mbHasStyleRec;
2955 if( !rbHasStyleRec )
2958 rbHasStyleRec =
true;
2966 sal_uInt32 nXFId =
FindXF( rStyleSheet );
2971 if( nXFId < EXC_XFLIST_HARDLIMIT )
2976 if( !rStyleSheet.
GetName().isEmpty() )
2991 if( pStyleSheet->IsUserDefined() && !lclIsBuiltInStyle( pStyleSheet->GetName() ) )
3046 OSL_FAIL(
"XclExpXFBuffer::InsertDefaultRecords - default style not found" );
3048 xDefStyle->SetAllUsedFlags(
true );
3098 OSL_ENSURE( nXFId <
maXFIndexVec.size(),
"XclExpXFBuffer::AppendXFIndex - XF ID out of range" );
3103 OSL_ENSURE(
maXFList.
HasRecord( nXFId ),
"XclExpXFBuffer::AppendXFIndex - XF not found" );
3128 sal_Int32 nDxfId = 0;
3129 for(
SCTAB nTab = 0; nTab < nTables; ++nTab)
3133 for (
auto&
pData : pDBData)
3136 pData->GetArea(aRange);
3141 aRange.
aEnd.
Row(), nTab,
true, aFilterEntries);
3150 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(rColor, 0));
3151 maDxf.push_back(std::make_unique<XclExpDxf>(rRoot, std::move(pExpCellArea)));
3159 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(rColor, 0));
3160 maDxf.push_back(std::make_unique<XclExpDxf>(rRoot, std::move(pExpCellArea)));
3170 for (
const auto& rxItem : *pList)
3172 size_t nEntryCount = rxItem->
size();
3173 for (
size_t nFormatEntry = 0; nFormatEntry < nEntryCount; ++nFormatEntry)
3175 const ScFormatEntry* pFormatEntry = rxItem->GetEntry(nFormatEntry);
3182 OUString aStyleName;
3210 if (!pAlign->FillFromItemSet(rRoot,
rSet,
false,
GetBiff()))
3216 if (!pCellProt->FillFromItemSet(
rSet ))
3221 std::unique_ptr<XclExpColor> pColor(
new XclExpColor);
3222 if(!pColor->FillFromItemSet(
rSet ))
3229 std::unique_ptr<XclExpNumFmt> pNumFormat;
3232 sal_uInt32 nScNumFmt = pPoolItem->GetValue();
3234 pNumFormat.reset(
new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *
this, nScNumFmt, xFormatter.get(),
mpKeywordTable.get() )));
3237 maDxf.push_back(std::make_unique<XclExpDxf>( rRoot, std::move(pAlign), std::move(pBorder),
3238 std::move(pFont), std::move(pNumFormat), std::move(pCellProt), std::move(pColor) ));
3250 std::map<OUString, sal_Int32>::const_iterator itr =
maStyleNameToDxfId.find(rStyleName);
3258 std::map<Color, sal_Int32>::const_iterator itr =
maColorToDxfId.find(aColor);
3268 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(aColor, 0));
3269 maDxf.push_back(std::make_unique<XclExpDxf>(
GetRoot(), std::move(pExpCellArea)));
3278 rStyleSheet->startElement(XML_dxfs, XML_count, OString::number(
maDxf.size()));
3280 for (
auto& rxDxf :
maDxf )
3282 rxDxf->SaveXml(
rStrm );
3285 rStyleSheet->endElement( XML_dxfs );
3290 for (
auto& rxDxf :
maDxf)
3292 rxDxf->SetFinalColors();
3297 std::unique_ptr<XclExpDxfFont> pFont, std::unique_ptr<XclExpNumFmt> pNumberFmt, std::unique_ptr<XclExpCellProt> pProt,
3298 std::unique_ptr<XclExpColor> pColor)
3300 mpAlign(
std::move(pAlign)),
3301 mpBorder(
std::move(pBorder)),
3303 mpNumberFmt(
std::move(pNumberFmt)),
3304 mpProt(
std::move(pProt)),
3305 mpColor(
std::move(pColor))
3311 , mpCellArea(
std::move(pCellArea))
3330 rStyleSheet->startElement(XML_dxf);
3346 rStyleSheet->endElement( XML_dxf );
3352 rStyleSheet->startElementNS( XML_x14, XML_dxf );
3366 rStyleSheet->endElementNS( XML_x14, XML_dxf );
3380 rStrm.GetCurrentStream()->getOutputStream(),
3381 "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3383 rStrm.PushStream( aStyleSheet );
3385 aStyleSheet->startElement(XML_styleSheet, XML_xmlns,
rStrm.getNamespaceURL(OOX_NS(xls)));
3393 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 void fillColor(model::ComplexColor &rComplexColor, const SfxItemSet &rItemSet, ScAutoFontColorMode eAutoMode, const SfxItemSet *pCondSet=nullptr, const Color *pBackConfigColor=nullptr, const Color *pTextConfigColor=nullptr)
static ScDxfFont GetDxfFont(const SfxItemSet &rSet, SvtScriptType nScript)
SfxItemSet & GetItemSet()
static void fillFontOnly(vcl::Font &rFont, const SfxItemSet &rItemSet, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE)
Static helper function to fill a font object from the passed item set.
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 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 model::ComplexColor & getComplexColor() 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
void addColor(Color aColor)
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpDxfs(const XclExpRoot &rRoot)
std::map< OUString, sal_Int32 > maStyleNameToDxfId
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, OUString aStyleName)
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.
sax_fastparser::FSHelperPtr & GetCurrentStream()
const XclExpRoot & GetRoot() const
Returns the filter root data.
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)
ColorType getType() const
Color const & getFinalColor() const
ThemeColorType getSchemeType() const
bool isValidSchemeType() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#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::enable_if_t<(sizeof(N)==4)> hash_combine(N &nSeed, T const *pValue, size_t nCount)
std::shared_ptr< T > make_shared(Args &&... args)
OUString getRelationship(Relationship eRelationship)
static double convertColorTransformsToTintOrShade(model::ComplexColor const &rComplexColor)
static sal_Int32 convertThemeColorTypeToExcelThemeNumber(model::ThemeColorType eType)
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
@ 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.
model::ComplexColor maForegroundComplexColor
bool FillFromItemSet(const SfxItemSet &rItemSet, XclExpPalette &rPalette, bool bStyle)
Fills the area attributes from the passed item set.
model::ComplexColor maBackgroundComplexColor
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.
model::ComplexColor maComplexColorLeft
Color ID for diagonal line(s).
model::ComplexColor maComplexColorTop
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.
sal_uInt32 mnRightColorId
Color ID for left line.
sal_uInt32 mnBottomColorId
Color ID for top line.
model::ComplexColor maComplexColorRight
model::ComplexColor maComplexColorDiagonal
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
model::ComplexColor maComplexColorBottom
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
model::ComplexColor maComplexColor
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.
sal_uInt8 mnCharSet
Windows font family.
void SetScHeight(sal_Int32 nTwips)
Sets the Calc font height (in twips).
sal_uInt16 mnHeight
String with styles (bold, italic).
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.
model::ComplexColor maComplexColor
true = Shadowed.
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 void lcl_WriteBorder(XclExpXmlStream &rStrm, sal_Int32 nElement, sal_uInt8 nLineStyle, const Color &rColor, model::ComplexColor const &rComplexColor)
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 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