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>
55#include <oox/token/tokens.hxx>
56#include <oox/token/namespaces.hxx>
80 default: OSL_FAIL(
"lclGetWeighting - unknown color type" );
85sal_Int32 lclGetColorDistance(
const Color& rColor1,
const Color& rColor2 )
90 nDist += nDummy * nDummy * 151;
92 nDist += nDummy * nDummy * 28;
98 sal_uInt8 nComp1Dist = ::std::min< sal_uInt8 >( nComp1, 0xFF - nComp1 );
99 sal_uInt8 nComp2Dist = ::std::min< sal_uInt8 >( nComp2, 0xFF - nComp2 );
100 if( nComp1Dist != nComp2Dist )
104 const sal_uInt8& rnCompNearer = (nComp1Dist < nComp2Dist) ? nComp1 : nComp2;
105 sal_uInt32& rnWeight = (nComp1Dist < nComp2Dist) ? nWeight1 : nWeight2;
106 rnWeight *= ((rnCompNearer - 0x80L) * (rnCompNearer - 0x7FL) / 0x1000L + 1);
108 sal_uInt32 nWSum = nWeight1 + nWeight2;
109 return static_cast< sal_uInt8 >( (nComp1 * nWeight1 + nComp2 * nWeight2 + nWSum / 2) / nWSum );
112void lclSetMixedColor(
Color& rDest,
const Color& rSrc1,
const Color& rSrc2 )
135 sal_uInt32 mnColorId;
140 explicit XclListColor(
const Color& rColor, sal_uInt32 nColorId );
145 sal_uInt32 GetColorId()
const {
return mnColorId; }
147 sal_uInt32 GetWeighting()
const {
return mnWeight; }
149 bool IsBaseColor()
const {
return mbBaseColor; }
152 void AddWeighting( sal_uInt32 nWeight ) {
mnWeight += nWeight; }
154 void Merge(
const XclListColor& rColor );
157XclListColor::XclListColor(
const Color& rColor, sal_uInt32 nColorId ) :
159 mnColorId( nColorId ),
163 ((rColor.
GetRed() == 0x00) || (rColor.
GetRed() == 0xFF)) &&
168void XclListColor::Merge(
const XclListColor& rColor )
170 sal_uInt32 nWeight2 = rColor.GetWeighting();
174 maColor.SetRed( lclGetMergedColorComp(
maColor.GetRed(), mnWeight, rColor.maColor.GetRed(), nWeight2 ) );
175 maColor.SetGreen( lclGetMergedColorComp(
maColor.GetGreen(), mnWeight, rColor.maColor.GetGreen(), nWeight2 ) );
176 maColor.SetBlue( lclGetMergedColorComp(
maColor.GetBlue(), mnWeight, rColor.maColor.GetBlue(), nWeight2 ) );
178 AddWeighting( nWeight2 );
191struct XclPaletteColor
196 explicit XclPaletteColor(
const Color& rColor ) :
maColor( rColor ), mbUsed( false ) {}
197 void SetColor(
const Color& rColor ) {
maColor = rColor; mbUsed =
true; }
204 sal_uInt32 mnPalIndex;
207 explicit XclRemap() : mnPalIndex( 0 ), mbProcessed( false ) {}
208 void SetIndex( sal_uInt32 nPalIndex )
209 { mnPalIndex = nPalIndex; mbProcessed =
true; }
215 sal_uInt32 mnPalIndex;
218 explicit XclNearest() : mnPalIndex( 0 ), mnDist( 0 ) {}
246 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
247 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const;
291 const Color& rColor )
const;
295 sal_uInt32& rnFirst, sal_uInt32& rnSecond,
296 const Color& rColor )
const;
304 std::vector< XclColorIdData >
306 std::vector< XclPaletteColor >
322 for( sal_uInt16 nIdx = 0; nIdx <
nCount; ++nIdx )
333 sal_uInt32 nFoundIdx = 0;
335 if( !pEntry || (pEntry->GetColor() != rColor) )
337 pEntry->AddWeighting( lclGetWeighting(
eType ) );
339 return pEntry->GetColorId();
353 for( sal_uInt32 nIdx = 0; nIdx <
nCount; ++nIdx )
355 const XclListColor& listColor = *
mxColorList->at( nIdx );
356 maColorIdDataVec[ listColor.GetColorId() ].Set( listColor.GetColor(), nIdx );
362 sal_uInt32 nPass = 0;
373 std::vector< XclRemap > aRemapVec(
nCount );
374 std::vector< XclNearest > aNearestVec(
nCount );
377 for( sal_uInt32 nRun = 0; nRun <
nCount; ++nRun )
385 sal_uInt32 nFound = 0;
387 if( aNearestVec[
nIndex ].mnDist < aNearestVec[ nFound ].mnDist )
390 sal_uInt32 nNearest = aNearestVec[ nFound ].mnPalIndex;
391 OSL_ENSURE( nNearest <
maPalette.size(),
"XclExpPaletteImpl::Finalize - algorithm error" );
393 aRemapVec[ nFound ].SetIndex( nNearest );
398 rColorIdData.mnIndex = aRemapVec[ rColorIdData.mnIndex ].mnPalIndex;
405 nRet =
static_cast< sal_uInt16
>( nColorId & ~EXC_PAL_INDEXBASE );
412 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
413 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const
422 sal_uInt32 nIndex1, nIndex2;
428 Color aColorArr[ 5 ];
429 aColorArr[ 0 ] =
maPalette[ nIndex1 ].maColor;
430 aColorArr[ 4 ] =
maPalette[ nIndex2 ].maColor;
431 lclSetMixedColor( aColorArr[ 2 ], aColorArr[ 0 ], aColorArr[ 4 ] );
432 lclSetMixedColor( aColorArr[ 1 ], aColorArr[ 0 ], aColorArr[ 2 ] );
433 lclSetMixedColor( aColorArr[ 3 ], aColorArr[ 2 ], aColorArr[ 4 ] );
435 sal_Int32 nMinDist = nFirstDist;
436 sal_uInt32 nMinIndex = 0;
437 for( sal_uInt32 nCnt = 1; nCnt < 4; ++nCnt )
439 sal_Int32 nDist = lclGetColorDistance( aForeColor, aColorArr[ nCnt ] );
440 if( nDist < nMinDist )
448 if( nMinDist < nFirstDist )
472 bool bDefault =
true;
473 for( sal_uInt32 nIdx = 0, nSize =
static_cast< sal_uInt32
>(
maPalette.size() ); bDefault && (nIdx < nSize); ++nIdx )
480 rStrm << static_cast< sal_uInt16 >(
maPalette.size() );
482 rStrm << rColor.maColor;
491 rStyleSheet->startElement(XML_colors);
492 rStyleSheet->startElement(XML_indexedColors);
495 rStyleSheet->endElement( XML_indexedColors );
496 rStyleSheet->endElement( XML_colors );
513 XclListColor* pEntry =
nullptr;
516 if (mnLastIdx < mxColorList->
size())
518 pEntry = (*mxColorList)[
mnLastIdx].get();
519 if( pEntry->GetColor() == rColor )
527 sal_uInt32 nBegIdx = 0;
530 while( !bFound && (nBegIdx < nEndIdx) )
532 rnIndex = (nBegIdx + nEndIdx) / 2;
533 pEntry = (*mxColorList)[rnIndex].get();
534 bFound = pEntry->GetColor() == rColor;
537 if( pEntry->GetColor() < rColor )
538 nBegIdx = rnIndex + 1;
554 XclListColor* pEntry =
new XclListColor( rColor,
mxColorList->size() );
573 mxColorList = std::make_shared<XclListColorList>();
577 aListIndexMap.reserve( xOldList->size() );
581 sal_uInt8& rnComp = ((nPass % 3 == 0) ? nB : ((nPass % 3 == 1) ? nR : nG));
583 OSL_ENSURE( nPass < 7,
"XclExpPaletteImpl::RawReducePalette - reduction not terminated" );
585 static const sal_uInt8 spnFactor2[] = { 0x81, 0x82, 0x84, 0x88, 0x92, 0xAA, 0xFF };
587 sal_uInt8 nFactor2 = spnFactor2[ nPass ];
591 for(
const std::unique_ptr<XclListColor> & pOldColor : *xOldList)
594 const XclListColor* pOldEntry = pOldColor.get();
595 nR = pOldEntry->GetColor().GetRed();
596 nG = pOldEntry->GetColor().GetGreen();
597 nB = pOldEntry->GetColor().GetBlue();
603 sal_uInt32 nNewComp = rnComp;
604 nNewComp /= nFactor1;
605 nNewComp *= nFactor2;
606 nNewComp /= nFactor3;
607 rnComp =
static_cast< sal_uInt8 >( nNewComp );
608 Color aNewColor( nR, nG, nB );
611 sal_uInt32 nFoundIdx = 0;
613 if( !pNewEntry || (pNewEntry->GetColor() != aNewColor) )
615 pNewEntry->AddWeighting( pOldEntry->GetWeighting() );
616 aListIndexMap.push_back( nFoundIdx );
621 rColorIdData.mnIndex = aListIndexMap[ rColorIdData.mnIndex ];
632 XclListColor* pKeepEntry =
mxColorList->at(nKeep).get();
633 XclListColor* pRemoveEntry =
mxColorList->at(nRemove).get();
634 if( !(pKeepEntry && pRemoveEntry) )
638 pKeepEntry->Merge( *pRemoveEntry );
640 XclListColorList::iterator itr =
mxColorList->begin();
641 ::std::advance(itr, nRemove);
643 if( nKeep > nRemove ) --nKeep;
648 if( rColorIdData.mnIndex > nRemove )
649 --rColorIdData.mnIndex;
650 else if( rColorIdData.mnIndex == nRemove )
651 rColorIdData.mnIndex = nKeep;
657 sal_uInt32 nFound = 0;
664 if( !rEntry.IsBaseColor() && (rEntry.GetWeighting() < nMinW) )
667 nMinW = rEntry.GetWeighting();
675 sal_uInt32 nFound = 0;
680 if( nIdx != nIgnore )
682 if( XclListColor* pEntry =
mxColorList->at(nIdx).get() )
684 sal_Int32 nDist = lclGetColorDistance( rColor, pEntry->GetColor() );
705 sal_uInt32& rnIndex,
const Color& rColor )
const
710 sal_uInt32 nPaletteIndex = 0;
711 for(
const auto& rPaletteColor :
maPalette )
713 if( !rPaletteColor.mbUsed )
715 sal_Int32 nCurrDist = lclGetColorDistance( rColor, rPaletteColor.maColor );
716 if( nCurrDist < nDist )
718 rnIndex = nPaletteIndex;
728 sal_uInt32& rnFirst, sal_uInt32& rnSecond,
const Color& rColor )
const
730 rnFirst = rnSecond = 0;
734 sal_uInt32 nPaletteIndex = 0;
735 for(
const auto& rPaletteColor :
maPalette )
737 sal_Int32 nCurrDist = lclGetColorDistance( rColor, rPaletteColor.maColor );
738 if( nCurrDist < nDist1 )
742 rnFirst = nPaletteIndex;
745 else if( nCurrDist < nDist2 )
747 rnSecond = nPaletteIndex;
759 mxImpl = std::make_shared<XclExpPaletteImpl>( *
this );
769 return mxImpl->InsertColor( rColor,
eType, nAutoDefault );
784 return mxImpl->GetColorIndex( nColorId );
788 sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx,
sal_uInt8& rnXclPattern,
789 sal_uInt32 nForeColorId, sal_uInt32 nBackColorId )
const
791 return mxImpl->GetMixedColors( rnXclForeIx, rnXclBackIx, rnXclPattern, nForeColorId, nBackColorId );
796 return mxImpl->GetColor( nXclIndex );
801 if( !
mxImpl->IsDefaultPalette() )
807 if( !
mxImpl->IsDefaultPalette() )
820typedef ::std::pair< sal_uInt16, sal_Int16 > WhichAndScript;
822sal_Int16 lclCheckFontItems(
const SfxItemSet& rItemSet,
823 const WhichAndScript& rWAS1,
const WhichAndScript& rWAS2,
const WhichAndScript& rWAS3 )
835 namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
841 static const WhichAndScript WAS_LATIN(
ATTR_FONT, css::i18n::ScriptType::LATIN );
842 static const WhichAndScript WAS_ASIAN(
ATTR_CJK_FONT, css::i18n::ScriptType::ASIAN );
843 static const WhichAndScript WAS_CMPLX(
ATTR_CTL_FONT, css::i18n::ScriptType::COMPLEX );
849 sal_Int16 nScript = 0;
852 while( (nScript == 0) && pCurrSet )
856 case ApiScriptType::LATIN:
857 nScript = lclCheckFontItems( *pCurrSet, WAS_LATIN, WAS_CMPLX, WAS_ASIAN );
859 case ApiScriptType::ASIAN:
860 nScript = lclCheckFontItems( *pCurrSet, WAS_ASIAN, WAS_CMPLX, WAS_LATIN );
862 case ApiScriptType::COMPLEX:
863 nScript = lclCheckFontItems( *pCurrSet, WAS_CMPLX, WAS_ASIAN, WAS_LATIN );
866 OSL_FAIL(
"XclExpFontHelper::GetFirstUsedScript - unknown script type" );
867 nScript = ApiScriptType::LATIN;
873 nScript = nDefScript;
877 OSL_FAIL(
"XclExpFontHelper::GetFirstUsedScript - unknown script type" );
878 nScript = ApiScriptType::LATIN;
887 if( nScript == css::i18n::ScriptType::WEAK )
910 static const sal_uInt16 pnCommonIds[] = {
913 static const sal_uInt16 pnLatinIds[] = {
915 static const sal_uInt16 pnAsianIds[] = {
917 static const sal_uInt16 pnComplexIds[] = {
923 namespace ApiScriptType = css::i18n::ScriptType;
925 if( nScript == ApiScriptType::WEAK )
932 case ApiScriptType::COMPLEX: bUsed =
ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep );
break;
933 default: OSL_FAIL(
"XclExpFontHelper::CheckItems - unknown script type" );
941sal_uInt32 lclCalcHash(
const XclFontData& rFontData )
943 sal_uInt32 nHash = rFontData.
maName.getLength();
944 nHash += sal_uInt32(rFontData.
maColor) * 2;
951 if( rFontData.
mbItalic ) nHash += 19;
954 if( rFontData.
mbShadow ) nHash += 31;
983 rStyleSheet->startElement(XML_font);
986 rStyleSheet->endElement( XML_font );
1001 OSL_ENSURE(
maData.
maName.getLength() < 256,
"XclExpFont::WriteBody - font name too long" );
1044const char* getFontFamilyOOXValue(
FontFamily eValue)
1074 rStyleSheet->startElement(XML_font);
1081 if (!aFontName.isEmpty())
1083 rStyleSheet->singleElement(XML_name, XML_val, aFontName);
1087 sal_uInt8 nExcelCharSet = rtl_getBestWindowsCharsetFromTextEncoding(eTextEnc);
1090 rStyleSheet->singleElement(XML_charset, XML_val, OString::number(nExcelCharSet));
1094 const char* pVal = getFontFamilyOOXValue(eFamily);
1097 rStyleSheet->singleElement(XML_family, XML_val, pVal);
1103 rStyleSheet->singleElement(XML_b,
1110 rStyleSheet->singleElement(XML_i, XML_val, ToPsz10(bItalic));
1120 rStyleSheet->singleElement(XML_strike, XML_val, ToPsz10(bStrikeout));
1130 rStyleSheet->singleElement(XML_shadow, XML_val, ToPsz10(*
maDxfData.
bShadow));
1135 rStyleSheet->singleElement(XML_color,
1141 rStyleSheet->singleElement(XML_sz,
1148 rStyleSheet->singleElement(XML_u, XML_val, pVal);
1151 rStyleSheet->endElement(XML_font);
1222 return static_cast< sal_uInt16
>(
nPos );
1250 rStyleSheet->startElement(XML_fonts, XML_count, OString::number(
maFontList.
GetSize()));
1254 rStyleSheet->endElement( XML_fonts );
1262 aFontData.
maName =
"Arial";
1307 sal_uInt32 nHash = lclCalcHash( rFontData );
1319struct XclExpNumFmtPred
1321 sal_uInt32 mnScNumFmt;
1322 explicit XclExpNumFmtPred( sal_uInt32 nScNumFmt ) : mnScNumFmt( nScNumFmt ) {}
1332 rStyleSheet->singleElement( XML_numFmt,
1341 mnStdFmt( GetFormatter().GetStandardIndex(
ScGlobal::eLnge ) )
1359 XclExpNumFmtVec::const_iterator aIt =
1362 return aIt->mnXclNumFmt;
1367 sal_uInt16 nXclNumFmt =
static_cast< sal_uInt16
>( nSize +
mnXclOffset );
1387 rStyleSheet->startElement(XML_numFmts, XML_count, OString::number(
maFormatMap.size()));
1390 rEntry.SaveXml(
rStrm );
1392 rStyleSheet->endElement( XML_numFmts );
1401 aExpStr.
Assign( rFormatStr );
1404 rStrm << nXclNumFmt << aExpStr;
1445 rStrm.GetCurrentStream()->singleElement( XML_protection,
1451 bool bForceLineBreak,
XclBiff eBiff,
bool bStyle)
1464 sal_Int32 nIndent =
static_cast<double>(nTmpIndent) / (3.0 * nSpaceWidth) + 0.5;
1465 mnIndent = limit_cast< sal_uInt8 >( nIndent, 0, 15 );
1528 if (eHorAlign == SvxCellHorJustify::Block)
1532 if (eHorJustMethod == SvxCellJustifyMethod::Distribute)
1536 if (eVerAlign == SvxCellVerJustify::Block)
1540 if (eVerJustMethod == SvxCellJustifyMethod::Distribute)
1598 rStrm.GetCurrentStream()->singleElement( XML_alignment,
1601 XML_textRotation, OString::number(
mnRotation),
1603 XML_indent, OString::number(
mnIndent),
1606 XML_shrinkToFit, ToPsz(
mbShrink ),
1612void lclGetBorderLine(
1613 sal_uInt8& rnXclLine, sal_uInt32& rnColorId,
1618 enum CalcLineIndex{Idx_None, Idx_Solid, Idx_Dotted, Idx_Dashed, Idx_FineDashed, Idx_DashDot, Idx_DashDotDot, Idx_DoubleThin, Idx_Last};
1619 enum ExcelWidthIndex{Width_Hair, Width_Thin, Width_Medium, Width_Thick, Width_Last};
1620 static sal_uInt8 Map_LineLO_toMS[Idx_Last][Width_Last] =
1637 sal_uInt16 nOuterWidth = pLine->GetOutWidth();
1638 ExcelWidthIndex nOuterWidthIndx;
1639 CalcLineIndex nStyleIndex;
1641 switch (pLine->GetBorderLineStyle())
1643 case SvxBorderLineStyle::NONE:
1644 nStyleIndex = Idx_None;
1646 case SvxBorderLineStyle::SOLID:
1647 nStyleIndex = Idx_Solid;
1649 case SvxBorderLineStyle::DOTTED:
1650 nStyleIndex = Idx_Dotted;
1652 case SvxBorderLineStyle::DASHED:
1653 nStyleIndex = Idx_Dashed;
1655 case SvxBorderLineStyle::FINE_DASHED:
1656 nStyleIndex = Idx_FineDashed;
1658 case SvxBorderLineStyle::DASH_DOT:
1659 nStyleIndex = Idx_DashDot;
1661 case SvxBorderLineStyle::DASH_DOT_DOT:
1662 nStyleIndex = Idx_DashDotDot;
1664 case SvxBorderLineStyle::DOUBLE_THIN:
1668 nStyleIndex = Idx_DoubleThin;
1671 nStyleIndex = Idx_Solid;
1675 nOuterWidthIndx = Width_Thick;
1677 nOuterWidthIndx = Width_Medium;
1679 nOuterWidthIndx = Width_Thin;
1681 nOuterWidthIndx = Width_Hair;
1683 nOuterWidthIndx = Width_Thin;
1685 rnXclLine = Map_LineLO_toMS[nStyleIndex][nOuterWidthIndx];
1699 mnLeftColorId(
XclExpPalette::GetColorIdFromIndex( mnLeftColor ) ),
1700 mnRightColorId(
XclExpPalette::GetColorIdFromIndex( mnRightColor ) ),
1701 mnTopColorId(
XclExpPalette::GetColorIdFromIndex( mnTopColor ) ),
1702 mnBottomColorId(
XclExpPalette::GetColorIdFromIndex( mnBottomColor ) ),
1703 mnDiagColorId(
XclExpPalette::GetColorIdFromIndex( mnDiagColor ) )
1718 sal_uInt32 nTLBRColorId;
1719 lclGetBorderLine( nTLBRLine, nTLBRColorId, rTLBRItem.
GetLine(), rPalette, eBiff );
1724 sal_uInt32 nBLTRColorId;
1725 lclGetBorderLine( nBLTRLine, nBLTRColorId, rBLTRItem.
GetLine(), rPalette, eBiff );
1816 switch( nLineStyle )
1840 rStyleSheet->singleElement(nElement);
1841 else if( rColor ==
Color( 0, 0, 0 ) )
1842 rStyleSheet->singleElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1845 rStyleSheet->startElement(nElement, XML_style,
ToLineStyle(nLineStyle));
1847 rStyleSheet->endElement( nElement );
1857 rStyleSheet->startElement( XML_border,
1868 rStyleSheet->endElement( XML_border );
1872 mnForeColorId(
XclExpPalette::GetColorIdFromIndex( mnForeColor ) ),
1873 mnBackColorId(
XclExpPalette::GetColorIdFromIndex( mnBackColor ) ),
1883 , maForeColor(aForeColor)
1884 , maBackColor(aBackColor)
1955 rStyleSheet->startElement(XML_fill);
1973 rStyleSheet->singleElement(XML_fgColor, XML_rgb,
1979 rStyleSheet->singleElement(XML_bgColor, XML_rgb,
1987 rStyleSheet->singleElement(XML_fgColor, XML_rgb,
1992 rStyleSheet->singleElement(XML_bgColor, XML_rgb,
1997 rStyleSheet->endElement( XML_patternFill );
2000 rStyleSheet->endElement( XML_fill );
2017 rStyleSheet->startElement(XML_fill);
2018 rStyleSheet->startElement(XML_patternFill);
2021 rStyleSheet->endElement( XML_patternFill );
2022 rStyleSheet->endElement( XML_fill );
2038 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak ) :
2043 Init( rPattern.
GetItemSet(), nScript, nForceScNumFmt, nForceXclFont, bForceLineBreak,
false );
2051 bool bDefStyle = (rStyleSheet.
GetName() ==
ScResId( STR_STYLENAME_STANDARD ));
2052 sal_Int16 nScript = bDefStyle ?
GetDefApiScript() : css::i18n::ScriptType::WEAK;
2066 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
const
2104 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak,
bool bDefStyle )
2170 sal_uInt16 nTypeProt = 0, nAlign = 0;
2171 sal_uInt32 nArea = 0,
nBorder = 0;
2187 sal_uInt16 nTypeProt = 0, nAlign = 0, nMiscAttrib = 0, nArea = 0;
2188 sal_uInt32 nBorder1 = 0, nBorder2 = 0;
2225 sal_Int32 nXfId = 0;
2226 const XclExpXF* pStyleXF =
nullptr;
2230 nXfId =
rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFIndex );
2234 rStyleSheet->startElement( XML_xf,
2237 XML_fillId, OString::number(
mnFillId),
2250 else if ( pStyleXF )
2254 else if ( pStyleXF )
2258 rStyleSheet->endElement( XML_xf );
2285 OSL_ENSURE( !
maName.isEmpty(),
"XclExpStyle::XclExpStyle - empty style name" );
2286#if OSL_DEBUG_LEVEL > 0
2289 "XclExpStyle::XclExpStyle - this is a built-in style" );
2296 mnStyleId( nStyleId ),
2326 case 0:
return "Normal";
2327 case 3:
return "Comma";
2328 case 4:
return "Currency";
2329 case 5:
return "Percent";
2330 case 6:
return "Comma [0]";
2331 case 7:
return "Currency [0]";
2338 constexpr sal_Int32 CELL_STYLE_MAX_BUILTIN_ID = 54;
2341 const char* pBuiltinId =
nullptr;
2345 sBuiltinId = OString::number( std::min(
static_cast<sal_Int32
>( CELL_STYLE_MAX_BUILTIN_ID - 1 ),
static_cast <sal_Int32
>(
mnStyleId ) ) );
2346 pBuiltinId = sBuiltinId.getStr();
2354 nXFId =
rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFId );
2355 rStrm.GetCurrentStream()->singleElement( XML_cellStyle,
2357 XML_xfId, OString::number(nXFId),
2359 XML_builtinId, pBuiltinId
2369const sal_uInt32 EXC_XFLIST_INDEXBASE = 0xFFFE0000;
2371const sal_uInt32 EXC_XFLIST_HARDLIMIT = 256 * 1024;
2373bool lclIsBuiltInStyle(
const OUString& rStyleName )
2385 mbPredefined( true ),
2386 mbHasStyleRec( false )
2393struct XclExpBorderPred
2397 explicit XclExpBorderPred(
const XclExpCellBorder& rBorder ) : mrBorder( rBorder ) {}
2413 mrBorder.mnTopLine == rBorder.
mnTopLine &&
2427struct XclExpFillPred
2431 explicit XclExpFillPred(
const XclExpCellArea& rFill ) : mrFill( rFill ) {}
2437bool XclExpFillPred::operator()(
const XclExpCellArea& rFill )
const
2464 sal_uInt16 nForceXclFont,
bool bForceLineBreak )
2481 return EXC_XFLIST_INDEXBASE | nXFIndex;
2499 sal_uInt32 nTotalCount =
static_cast< sal_uInt32
>(
maXFList.
GetSize() );
2505 XclExpBuiltInMap::const_iterator aBuiltInEnd =
maBuiltInMap.end();
2519 sal_uInt32 nStyleXFCount = 0;
2521 for(
nId = 0;
nId < nTotalCount; ++
nId )
2524 if( xXF->IsStyleXF() && ((
nId > nMaxBuiltInXFId) || (
maBuiltInMap.find(
nId ) == aBuiltInEnd)) )
2552 if( xXF->IsCellXF() && ((
nId > nMaxBuiltInXFId) || (
maBuiltInMap.find(
nId ) == aBuiltInEnd)) )
2558 if( xDefCellXF->Equals( *xXF ) )
2563 (nSearchPos < nSearchEnd) && (nFoundIndex ==
EXC_XF_NOTFOUND); ++nSearchPos )
2566 nFoundIndex =
static_cast< sal_uInt16
>( nSearchPos );
2577 sal_uInt16 nXmlStyleIndex = 0;
2578 sal_uInt16 nXmlCellIndex = 0;
2581 for(
size_t i = 0;
i < nXFCount; ++
i )
2584 if( xXF->IsStyleXF() )
2594 if( nXFId >= EXC_XFLIST_INDEXBASE )
2595 nXFIndex =
static_cast< sal_uInt16
>( nXFId & ~EXC_XFLIST_INDEXBASE );
2603 OSL_ENSURE( nXFIndex <
maStyleIndexes.size(),
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
2611 OSL_ENSURE( nXFIndex <
maCellIndexes.size(),
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
2629 size_t nXFCount = rXFList.
GetSize();
2630 for(
size_t i = 0;
i < nXFCount; ++
i )
2633 if( xXF->IsCellXF() )
2635 else if( xXF->IsStyleXF() )
2644 rStyleSheet->startElement(XML_fills, XML_count, OString::number(
maFills.size()));
2645 for(
const auto& rFill :
maFills )
2647 rFill.SaveXml(
rStrm );
2649 rStyleSheet->endElement( XML_fills );
2651 rStyleSheet->startElement(XML_borders, XML_count, OString::number(
maBorders.size()));
2654 rBorder.SaveXml(
rStrm );
2656 rStyleSheet->endElement( XML_borders );
2659 sal_Int32 nCells, nStyles;
2664 rStyleSheet->startElement(XML_cellStyleXfs, XML_count, OString::number(nStyles));
2666 for(
size_t i = 0;
i < nXFCount; ++
i )
2669 if( ! xXF->IsStyleXF() )
2673 rStyleSheet->endElement( XML_cellStyleXfs );
2678 rStyleSheet->startElement(XML_cellXfs, XML_count, OString::number(nCells));
2680 for(
size_t i = 0;
i < nXFCount; ++
i )
2683 if( ! xXF->IsCellXF() )
2687 rStyleSheet->endElement( XML_cellXfs );
2691 rStyleSheet->startElement(XML_cellStyles, XML_count, OString::number(
maStyleList.
GetSize()));
2693 rStyleSheet->endElement( XML_cellStyles );
2698 XclExpBorderList::iterator aBorderPos =
2700 OSL_ENSURE( aBorderPos !=
maBorders.end(),
"XclExpXFBuffer::SaveXml - Invalid @borderId!" );
2701 XclExpFillList::iterator aFillPos =
2703 OSL_ENSURE( aFillPos !=
maFills.end(),
"XclExpXFBuffer::SaveXml - Invalid @fillId!" );
2705 sal_Int32 nBorderId = 0, nFillId = 0;
2707 nBorderId = std::distance(
maBorders.begin(), aBorderPos );
2708 if( aFillPos !=
maFills.end() )
2709 nFillId = std::distance(
maFills.begin(), aFillPos );
2716 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
const
2726 for (
auto it = it1; it != it2; ++it)
2727 for (
auto const &
nPos : it->second)
2740 for (
auto it = it1; it != it2; ++it)
2741 for (
auto const &
nPos : it->second)
2752 for (
auto const &
nPos : it->second)
2762 FindKey key1 {
false, pItemSet, 0, 0 };
2766 for (
auto it = it1; it != it2; ++it)
2767 for (
auto const &
nPos : it->second)
2776 [&nStyleId, nLevel](
const XclExpBuiltInMap::value_type& rEntry) {
2777 return (rEntry.second.mnStyleId == nStyleId) && (rEntry.second.mnLevel == nLevel);
2790 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont,
bool bForceLineBreak )
2794 pPattern = pDefPattern;
2797 if( (pPattern == pDefPattern) && !bForceLineBreak &&
2808 rPositions.erase(it);
2814 rbPredefined =
false;
2819 sal_uInt32 nXFId =
FindXF( *pPattern, nForceScNumFmt, nForceXclFont, bForceLineBreak );
2826 GetRoot(), *pPattern, nScript, nForceScNumFmt, nForceXclFont, bForceLineBreak );
2860 OSL_ENSURE(
maXFList.
HasRecord( nXFId ),
"XclExpXFBuffer::InsertStyleXF - built-in XF not found" );
2862 bool& rbPredefined =
maBuiltInMap[ nXFId ].mbPredefined;
2867 auto it = std::find(rPositions.begin(), rPositions.end(), nXFId);
2868 rPositions.erase(it);
2874 rbPredefined =
false;
2879 bool& rbHasStyleRec =
maBuiltInMap[ nXFId ].mbHasStyleRec;
2880 if( !rbHasStyleRec )
2883 rbHasStyleRec =
true;
2891 sal_uInt32 nXFId =
FindXF( rStyleSheet );
2896 if( nXFId < EXC_XFLIST_HARDLIMIT )
2901 if( !rStyleSheet.
GetName().isEmpty() )
2916 if( pStyleSheet->IsUserDefined() && !lclIsBuiltInStyle( pStyleSheet->GetName() ) )
2971 OSL_FAIL(
"XclExpXFBuffer::InsertDefaultRecords - default style not found" );
2973 xDefStyle->SetAllUsedFlags(
true );
3023 OSL_ENSURE( nXFId <
maXFIndexVec.size(),
"XclExpXFBuffer::AppendXFIndex - XF ID out of range" );
3028 OSL_ENSURE(
maXFList.
HasRecord( nXFId ),
"XclExpXFBuffer::AppendXFIndex - XF not found" );
3053 sal_Int32 nDxfId = 0;
3054 for(
SCTAB nTab = 0; nTab < nTables; ++nTab)
3058 for (
auto&
pData : pDBData)
3061 pData->GetArea(aRange);
3066 aRange.
aEnd.
Row(), nTab,
true, aFilterEntries);
3075 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(rColor, 0));
3076 maDxf.push_back(std::make_unique<XclExpDxf>(rRoot, std::move(pExpCellArea)));
3084 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(rColor, 0));
3085 maDxf.push_back(std::make_unique<XclExpDxf>(rRoot, std::move(pExpCellArea)));
3095 for (
const auto& rxItem : *pList)
3097 size_t nEntryCount = rxItem->
size();
3098 for (
size_t nFormatEntry = 0; nFormatEntry < nEntryCount; ++nFormatEntry)
3100 const ScFormatEntry* pFormatEntry = rxItem->GetEntry(nFormatEntry);
3107 OUString aStyleName;
3135 if (!pAlign->FillFromItemSet(rRoot,
rSet,
false,
GetBiff()))
3141 if (!pCellProt->FillFromItemSet(
rSet ))
3146 std::unique_ptr<XclExpColor> pColor(
new XclExpColor);
3147 if(!pColor->FillFromItemSet(
rSet ))
3154 std::unique_ptr<XclExpNumFmt> pNumFormat;
3157 sal_uInt32 nScNumFmt = pPoolItem->GetValue();
3159 pNumFormat.reset(
new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *
this, nScNumFmt, xFormatter.get(),
mpKeywordTable.get() )));
3162 maDxf.push_back(std::make_unique<XclExpDxf>( rRoot, std::move(pAlign), std::move(pBorder),
3163 std::move(pFont), std::move(pNumFormat), std::move(pCellProt), std::move(pColor) ));
3175 std::map<OUString, sal_Int32>::const_iterator itr =
maStyleNameToDxfId.find(rStyleName);
3183 std::map<Color, sal_Int32>::const_iterator itr =
maColorToDxfId.find(aColor);
3193 std::unique_ptr<XclExpCellArea> pExpCellArea(
new XclExpCellArea(aColor, 0));
3194 maDxf.push_back(std::make_unique<XclExpDxf>(
GetRoot(), std::move(pExpCellArea)));
3203 rStyleSheet->startElement(XML_dxfs, XML_count, OString::number(
maDxf.size()));
3205 for (
auto& rxDxf :
maDxf )
3207 rxDxf->SaveXml(
rStrm );
3210 rStyleSheet->endElement( XML_dxfs );
3215 for (
auto& rxDxf :
maDxf)
3217 rxDxf->SetFinalColors();
3222 std::unique_ptr<XclExpDxfFont> pFont, std::unique_ptr<XclExpNumFmt> pNumberFmt, std::unique_ptr<XclExpCellProt> pProt,
3223 std::unique_ptr<XclExpColor> pColor)
3225 mpAlign(
std::move(pAlign)),
3226 mpBorder(
std::move(pBorder)),
3228 mpNumberFmt(
std::move(pNumberFmt)),
3229 mpProt(
std::move(pProt)),
3230 mpColor(
std::move(pColor))
3236 , mpCellArea(
std::move(pCellArea))
3255 rStyleSheet->startElement(XML_dxf);
3271 rStyleSheet->endElement( XML_dxf );
3277 rStyleSheet->startElementNS( XML_x14, XML_dxf );
3291 rStyleSheet->endElementNS( XML_x14, XML_dxf );
3305 rStrm.GetCurrentStream()->getOutputStream(),
3306 "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3308 rStrm.PushStream( aStyleSheet );
3310 aStyleSheet->startElement(XML_styleSheet, XML_xmlns,
rStrm.getNamespaceURL(OOX_NS(xls)));
3318 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, 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.
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