14#include <document.hxx>
17#include <tokenarray.hxx>
21#include <compiler.hxx>
45#include <com/sun/star/task/XStatusIndicator.hpp>
51#include <orcus/exception.hpp>
54#include <unordered_map>
55#include <frozen/bits/defines.h>
56#include <frozen/bits/elsa_std.h>
57#include <frozen/unordered_map.h>
61namespace os = orcus::spreadsheet;
70 case orcus::spreadsheet::formula_grammar_t::ods:
73 case orcus::spreadsheet::formula_grammar_t::xlsx:
76 case orcus::spreadsheet::formula_grammar_t::gnumeric:
79 case orcus::spreadsheet::formula_grammar_t::xls_xml:
82 case orcus::spreadsheet::formula_grammar_t::unknown:
93 , meCalcGrammar(
formula::FormulaGrammar::GRAM_UNSPECIFIED)
94 , meOrcusGrammar(os::formula_grammar_t::
unknown)
95 , mnTextEncoding(RTL_TEXTENCODING_UTF8)
107 static constexpr auto rules = frozen::make_unordered_map<orcus::character_set_t, rtl_TextEncoding>({
108 { orcus::character_set_t::big5, RTL_TEXTENCODING_BIG5 },
109 { orcus::character_set_t::euc_jp, RTL_TEXTENCODING_EUC_JP },
110 { orcus::character_set_t::euc_kr, RTL_TEXTENCODING_EUC_KR },
111 { orcus::character_set_t::gb2312, RTL_TEXTENCODING_GB_2312 },
112 { orcus::character_set_t::gbk, RTL_TEXTENCODING_GBK },
113 { orcus::character_set_t::iso_2022_cn, RTL_TEXTENCODING_ISO_2022_CN },
114 { orcus::character_set_t::iso_2022_cn_ext, RTL_TEXTENCODING_ISO_2022_CN },
115 { orcus::character_set_t::iso_2022_jp, RTL_TEXTENCODING_ISO_2022_JP },
116 { orcus::character_set_t::iso_2022_jp_2, RTL_TEXTENCODING_ISO_2022_JP },
117 { orcus::character_set_t::iso_8859_1, RTL_TEXTENCODING_ISO_8859_1 },
118 { orcus::character_set_t::iso_8859_14, RTL_TEXTENCODING_ISO_8859_14 },
119 { orcus::character_set_t::iso_8859_15, RTL_TEXTENCODING_ISO_8859_15 },
120 { orcus::character_set_t::iso_8859_1_windows_3_0_latin_1, RTL_TEXTENCODING_ISO_8859_1 },
121 { orcus::character_set_t::iso_8859_1_windows_3_1_latin_1, RTL_TEXTENCODING_ISO_8859_1 },
122 { orcus::character_set_t::iso_8859_2, RTL_TEXTENCODING_ISO_8859_2 },
123 { orcus::character_set_t::iso_8859_2_windows_latin_2, RTL_TEXTENCODING_ISO_8859_2 },
124 { orcus::character_set_t::iso_8859_3, RTL_TEXTENCODING_ISO_8859_3 },
125 { orcus::character_set_t::iso_8859_4, RTL_TEXTENCODING_ISO_8859_4 },
126 { orcus::character_set_t::iso_8859_5, RTL_TEXTENCODING_ISO_8859_5 },
127 { orcus::character_set_t::iso_8859_6, RTL_TEXTENCODING_ISO_8859_6 },
128 { orcus::character_set_t::iso_8859_6_e, RTL_TEXTENCODING_ISO_8859_6 },
129 { orcus::character_set_t::iso_8859_6_i, RTL_TEXTENCODING_ISO_8859_6 },
130 { orcus::character_set_t::iso_8859_7, RTL_TEXTENCODING_ISO_8859_7 },
131 { orcus::character_set_t::iso_8859_8, RTL_TEXTENCODING_ISO_8859_8 },
132 { orcus::character_set_t::iso_8859_8_e, RTL_TEXTENCODING_ISO_8859_8 },
133 { orcus::character_set_t::iso_8859_8_i, RTL_TEXTENCODING_ISO_8859_8 },
134 { orcus::character_set_t::iso_8859_9, RTL_TEXTENCODING_ISO_8859_9 },
135 { orcus::character_set_t::iso_8859_9_windows_latin_5, RTL_TEXTENCODING_ISO_8859_9 },
136 { orcus::character_set_t::jis_x0201, RTL_TEXTENCODING_JIS_X_0201 },
137 { orcus::character_set_t::jis_x0212_1990, RTL_TEXTENCODING_JIS_X_0212 },
138 { orcus::character_set_t::shift_jis, RTL_TEXTENCODING_SHIFT_JIS },
139 { orcus::character_set_t::us_ascii, RTL_TEXTENCODING_ASCII_US },
140 { orcus::character_set_t::utf_7, RTL_TEXTENCODING_UTF7 },
141 { orcus::character_set_t::utf_8, RTL_TEXTENCODING_UTF8 },
142 { orcus::character_set_t::windows_1250, RTL_TEXTENCODING_MS_1250 },
143 { orcus::character_set_t::windows_1251, RTL_TEXTENCODING_MS_1251 },
144 { orcus::character_set_t::windows_1252, RTL_TEXTENCODING_MS_1252 },
145 { orcus::character_set_t::windows_1253, RTL_TEXTENCODING_MS_1253 },
146 { orcus::character_set_t::windows_1254, RTL_TEXTENCODING_MS_1254 },
147 { orcus::character_set_t::windows_1255, RTL_TEXTENCODING_MS_1255 },
148 { orcus::character_set_t::windows_1256, RTL_TEXTENCODING_MS_1256 },
149 { orcus::character_set_t::windows_1257, RTL_TEXTENCODING_MS_1257 },
150 { orcus::character_set_t::windows_1258, RTL_TEXTENCODING_MS_1258 },
153 if (
auto it = rules.find(cs); it != rules.end())
169 mrGlobalSettings(rGS) {}
182 std::ostringstream os;
183 os <<
"'" << address <<
"' is not a valid address expression.";
184 throw orcus::invalid_arg_error(os.str());
187 os::src_address_t ret;
188 ret.sheet = aAddr.
Tab();
189 ret.column = aAddr.
Col();
190 ret.row = aAddr.
Row();
206 std::ostringstream os;
207 os <<
"'" << range <<
"' is not a valid range expression.";
208 throw orcus::invalid_arg_error(os.str());
215 ret.last.sheet = aRange.
aEnd.
Tab();
216 ret.last.column = aRange.
aEnd.
Col();
217 ret.last.row = aRange.
aEnd.
Row();
224 mrDoc(rDoc), mrGlobalSettings(rGS), mnTab(nTab) {}
250 throw std::runtime_error(
"ScOrcusNamedExpression::set_named_range not implemented yet.");
263 pNames->
insert(pRange,
false);
269 : mfValue(
std::numeric_limits<double>::quiet_NaN())
274 , meGrammar(
formula::FormulaGrammar::GRAM_UNSPECIFIED)
284 , meGrammar(
formula::FormulaGrammar::GRAM_UNSPECIFIED)
289 : mfValue(
std::numeric_limits<double>::quiet_NaN())
294 , meGrammar(
formula::FormulaGrammar::GRAM_UNSPECIFIED)
300 : maStr1(
std::move(aFormula))
301 , mfValue(
std::numeric_limits<double>::quiet_NaN())
306 , meGrammar(eGrammar)
316 maStyles(*this, bSkipDefaultStyles),
320 orcus::spreadsheet::sheet_t sheet_index, std::string_view sheet_name)
324 if (sheet_index == 0)
329 maSheets.push_back(std::make_unique<ScOrcusSheet>(
maDoc, 0, *
this));
337 maSheets.push_back(std::make_unique<ScOrcusSheet>(
maDoc, nTab, *
this));
343class FindSheetByIndex
347 explicit FindSheetByIndex(
SCTAB nTab) : mnTab(nTab) {}
348 bool operator() (
const std::unique_ptr<ScOrcusSheet>& rSheet)
const
350 return rSheet->getIndex() == mnTab;
365 std::vector< std::unique_ptr<ScOrcusSheet> >::iterator it =
373 maSheets.push_back(std::make_unique<ScOrcusSheet>(
maDoc, nTab, *
this));
381 std::vector< std::unique_ptr<ScOrcusSheet> >::iterator it =
389 maSheets.push_back(std::make_unique<ScOrcusSheet>(
maDoc, nTab, *
this));
417 case os::formula_ref_context_t::global:
419 case os::formula_ref_context_t::named_expression_base:
420 case os::formula_ref_context_t::named_range:
429 auto toFormulaCell = [
this](
const CellStoreToken& rToken ) -> std::unique_ptr<ScFormulaCell>
435 return std::unique_ptr<ScFormulaCell>();
437 return std::make_unique<ScFormulaCell>(
maDoc.
getDoc(), rToken.maPos, *pArray);
444 switch (rToken.meType)
471 rToken.maPos, rToken.maStr1, rToken.meGrammar);
478 if (std::isfinite(rToken.mfValue))
488 std::unique_ptr<ScFormulaCell> pCell = toFormulaCell(rToken);
499 std::unique_ptr<ScFormulaCell> pCell = toFormulaCell(rToken);
503 if (std::isfinite(rToken.mfValue))
504 pCell->SetResultDouble(rToken.mfValue);
506 pCell->SetHybridString(
516 if (!rToken.mnIndex1 || !rToken.mnIndex2)
524 std::unique_ptr<ScTokenArray> pArray(aComp.
CompileString(rToken.maStr1));
533 if (!rToken.mnIndex1)
543 if (nCellCount == 100000)
621 uint32_t nRowRange, uint32_t nColRange )
639 if (rToken.
maPos != rPos)
665 if (rToken.
maPos != rPos)
724double translateToInternal(
double nVal, orcus::length_unit_t unit)
728 case orcus::length_unit_t::inch:
729 return nVal * 72.0 * 20.0;
730 case orcus::length_unit_t::twip:
732 case orcus::length_unit_t::point:
734 case orcus::length_unit_t::centimeter:
735 return nVal * 20.0 * 72.0 / 2.54;
736 case orcus::length_unit_t::unknown:
738 SAL_WARN(
"sc.orcus",
"unknown unit");
751 double nNewWidth = translateToInternal(width, unit);
753 for (os::col_t offset = 0; offset < col_span; ++offset)
765 double nNewHeight = translateToInternal(height, unit);
793 os::color_elem_t , os::color_elem_t )
795 SAL_INFO(
"sc.orcus.condformat",
"set_color");
801 SAL_INFO(
"sc.orcus.condformat",
"set_condition_type");
806 SAL_INFO(
"sc.orcus.condformat",
"set_formula");
812 SAL_INFO(
"sc.orcus.condformat",
"set_date");
817 SAL_INFO(
"sc.orcus.condformat",
"commit_condition");
823 SAL_INFO(
"sc.orcus.condformat",
"set_icon_name");
829 SAL_INFO(
"sc.orcus.condformat",
"set_databar_gradient");
835 SAL_INFO(
"sc.orcus.condformat",
"set_databar_axis");
839 os::color_elem_t , os::color_elem_t )
842 SAL_INFO(
"sc.orcus.condformat",
"set_databar_color_positive");
846 os::color_elem_t , os::color_elem_t )
849 SAL_INFO(
"sc.orcus.condformat",
"set_databar_color_negative");
855 SAL_INFO(
"sc.orcus.condformat",
"set_min_databar_length");
861 SAL_INFO(
"sc.orcus.condformat",
"set_max_databar_length");
866 SAL_INFO(
"sc.orcus.condformat",
"set_show_value");
872 SAL_INFO(
"sc.orcus.condformat",
"set_iconset_reverse");
877 SAL_INFO(
"sc.orcus.condformat",
"set_xf_id");
882 SAL_INFO(
"sc.orcus.condformat",
"set_operator");
889 case os::conditional_format_t::condition:
890 case os::conditional_format_t::formula:
894 case os::conditional_format_t::date:
896 case os::conditional_format_t::colorscale:
898 case os::conditional_format_t::databar:
900 case os::conditional_format_t::iconset:
903 SAL_INFO(
"sc.orcus.condformat",
"unknown conditional_format_t value");
906 SAL_INFO(
"sc.orcus.condformat",
"set_type");
911 SAL_INFO(
"sc.orcus.condformat",
"commit_entry");
916 SAL_INFO(
"sc.orcus.condformat",
"set_range");
920 os::row_t row_end, os::col_t col_end)
922 SAL_INFO(
"sc.orcus.condformat",
"set_range");
929 SAL_INFO(
"sc.orcus.condformat",
"commit_format");
937 mrStyles(static_cast<
ScOrcusStyles&>(*mrFactory.get_styles())),
938 maAutoFilter(rFactory.getGlobalSettings()),
940 maConditionalFormat(mnTab, rDoc.getDoc()),
941 maNamedExpressions(rDoc, rFactory.getGlobalSettings(), nTab),
943 maArrayFormula(*this),
965 meGrammar(
formula::FormulaGrammar::GRAM_UNSPECIFIED),
966 mnSharedFormulaIndex(0),
982 meGrammar = getCalcGrammarFromOrcus(grammar);
1084 meGrammar(
formula::FormulaGrammar::GRAM_UNSPECIFIED) {}
1090 mnCol = range.first.column;
1091 mnRow = range.first.row;
1093 mnColRange = range.last.column - range.first.column + 1;
1094 mnRowRange = range.last.row - range.first.column + 1;
1099 meGrammar = getCalcGrammarFromOrcus(grammar);
1208 os::row_t row, os::col_t col,
int year,
int month,
int day,
int hour,
int minute,
double second)
1213 sal_uInt32 nSec = floor(second);
1232 SAL_INFO(
"sc.orcus.style",
"set format: " << xf_index);
1240 os::row_t row_end, os::col_t col_end,
size_t xf_index)
1242 SAL_INFO(
"sc.orcus.style",
"set format range: " << xf_index);
1249 os::col_t col, os::col_t col_span, std::size_t xf_index)
1269 orcus::spreadsheet::range_size_t ret;
1298 mrFactory(rFactory) {}
1333 orcus::spreadsheet::color_elem_t,
1334 orcus::spreadsheet::color_elem_t,
1335 orcus::spreadsheet::color_elem_t)
1403 double fSize = translateToInternal(*
mnSize, orcus::length_unit_t::point);
1409 double fSize = translateToInternal(*
mnSizeAsian, orcus::length_unit_t::point);
1415 double fSize = translateToInternal(*
mnSizeComplex, orcus::length_unit_t::point);
1440 if (*
mePattern == os::fill_pattern_t::solid)
1446 auto getDirection = [](os::border_direction_t dir) ->
SvxBoxItemLine
1450 case os::border_direction_t::right:
1451 return SvxBoxItemLine::RIGHT;
1452 case os::border_direction_t::left:
1453 return SvxBoxItemLine::LEFT;
1454 case os::border_direction_t::top:
1455 return SvxBoxItemLine::TOP;
1456 case os::border_direction_t::bottom:
1457 return SvxBoxItemLine::BOTTOM;
1461 return SvxBoxItemLine::RIGHT;
1471 for (
const auto& [dir, attrs] :
maBorders)
1477 double nWidth = attrs.mnWidth.value_or(0.0);
1481 case os::border_direction_t::diagonal_tl_br:
1484 aDiagonal_TLBR.
SetLine(&aLine);
1487 case os::border_direction_t::diagonal_bl_tr:
1490 aDiagonal_BLTR.
SetLine(&aLine);
1496 aBoxItem.
SetLine(&aLine, eDir);
1511 bool bLocked =
mbLocked.value_or(
true);
1512 bool bHidden =
mbHidden.value_or(
false);
1524 sal_Int32 nCheckPos;
1539 mnNumberFormatId(0),
1541 mbApplyAlignment(false),
1543 mbShrinkToFit(false),
1559 mrFactory(rFactory),
1636 case os::underline_t::single_line:
1637 case os::underline_t::single_accounting:
1640 case os::underline_t::double_line:
1641 case os::underline_t::double_accounting:
1644 case os::underline_t::none:
1647 case os::underline_t::dotted:
1650 case os::underline_t::dash:
1653 case os::underline_t::long_dash:
1656 case os::underline_t::dot_dash:
1659 case os::underline_t::dot_dot_dash:
1662 case os::underline_t::wave:
1672 if (e == os::underline_width_t::bold || e == os::underline_width_t::thick)
1715 if (e == os::underline_type_t::double_type)
1738 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1744 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1765 case os::strikethrough_type_t::unknown:
1768 case os::strikethrough_type_t::none:
1771 case os::strikethrough_type_t::single_type:
1774 case os::strikethrough_type_t::double_type:
1786 case os::strikethrough_width_t::bold:
1798 case os::strikethrough_text_t::slash:
1801 case os::strikethrough_text_t::cross:
1811 SAL_INFO(
"sc.orcus.style",
"commit font");
1833 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1839 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1846 SAL_INFO(
"sc.orcus.style",
"commit fill");
1858 os::border_direction_t dir, os::border_style_t style)
1864 case os::border_style_t::solid:
1865 rBorderLine.
meStyle = SvxBorderLineStyle::SOLID;
1868 case os::border_style_t::hair:
1869 rBorderLine.
meStyle = SvxBorderLineStyle::SOLID;
1872 case os::border_style_t::medium:
1873 rBorderLine.
meStyle = SvxBorderLineStyle::SOLID;
1876 case os::border_style_t::thick:
1877 rBorderLine.
meStyle = SvxBorderLineStyle::SOLID;
1880 case os::border_style_t::thin:
1881 rBorderLine.
meStyle = SvxBorderLineStyle::SOLID;
1884 case os::border_style_t::dash_dot:
1885 rBorderLine.
meStyle = SvxBorderLineStyle::DASH_DOT;
1888 case os::border_style_t::dash_dot_dot:
1889 rBorderLine.
meStyle = SvxBorderLineStyle::DASH_DOT_DOT;
1892 case os::border_style_t::dashed:
1893 rBorderLine.
meStyle = SvxBorderLineStyle::DASHED;
1896 case os::border_style_t::dotted:
1897 rBorderLine.
meStyle = SvxBorderLineStyle::DOTTED;
1900 case os::border_style_t::double_border:
1901 rBorderLine.
meStyle = SvxBorderLineStyle::DOUBLE;
1904 case os::border_style_t::medium_dash_dot:
1905 case os::border_style_t::slant_dash_dot:
1906 rBorderLine.
meStyle = SvxBorderLineStyle::DASH_DOT;
1909 case os::border_style_t::medium_dash_dot_dot:
1910 rBorderLine.
meStyle = SvxBorderLineStyle::DASH_DOT_DOT;
1913 case os::border_style_t::medium_dashed:
1914 rBorderLine.
meStyle = SvxBorderLineStyle::DASHED;
1917 case os::border_style_t::unknown:
1918 case os::border_style_t::none:
1927 os::border_direction_t dir, os::color_elem_t alpha, os::color_elem_t red,
1928 os::color_elem_t green, os::color_elem_t blue)
1942 rBorderLine.
mnWidth = translateToInternal(val, unit);
1947 SAL_INFO(
"sc.orcus.style",
"commit border");
1954 mrProtections(rProtections)
1985 SAL_INFO(
"sc.orcus.style",
"commit cell protection");
1992 mrFactory(rFactory), mrNumberFormats(rFormats)
2013 SAL_INFO(
"sc.orcus.style",
"commit number format");
2021 mrFactory(rFactory),
2065 SAL_WARN(
"sc.orcus.style",
"invalid xf id for commit cell style");
2131 case os::hor_alignment_t::left:
2134 case os::hor_alignment_t::right:
2137 case os::hor_alignment_t::center:
2140 case os::hor_alignment_t::justified:
2143 case os::hor_alignment_t::distributed:
2147 case os::hor_alignment_t::unknown:
2160 case os::ver_alignment_t::top:
2163 case os::ver_alignment_t::bottom:
2166 case os::ver_alignment_t::middle:
2169 case os::ver_alignment_t::justified:
2172 case os::ver_alignment_t::distributed:
2176 case os::ver_alignment_t::unknown:
2198 return mpXfs->size() - 1;
2203 mrFactory(rFactory),
2204 maFontStyle(rFactory, maFonts),
2205 maFillStyle(maFills),
2206 maBorderStyle(maBorders),
2207 maCellProtection(maProtections),
2208 maNumberFormat(rFactory, maNumberFormats),
2209 maCellStyle(rFactory, *this, maCellStyleXfs)
2231 if (nFontId >=
maFonts.size())
2233 SAL_WARN(
"sc.orcus.style",
"invalid font id");
2240 if (nFillId >=
maFills.size())
2242 SAL_WARN(
"sc.orcus.style",
"invalid fill id");
2251 SAL_WARN(
"sc.orcus.style",
"invalid border id");
2259 SAL_WARN(
"sc.orcus.style",
"invalid protection id");
2268 SAL_WARN(
"sc.orcus.style",
"invalid number format id");
2291 SAL_INFO(
"sc.orcus.style",
"applyXfToitemSet: " << xfId);
2294 SAL_WARN(
"sc.orcus.style",
"invalid xf id");
2335 case os::xf_category_t::cell:
2338 case os::xf_category_t::cell_style:
2341 case os::xf_category_t::differential:
2344 case os::xf_category_t::unknown:
2345 SAL_WARN(
"sc.orcus.style",
"unknown xf category");
2385 mrGlobalSettings(rGS)
2403 SAL_INFO(
"sc.orcus.autofilter",
"set_column: " <<
col);
2409 SAL_INFO(
"sc.orcus.autofilter",
"append_column_match_value: " << aString);
2414 SAL_INFO(
"sc.orcus.autofilter",
"commit column");
2419 SAL_INFO(
"sc.orcus.autofilter",
"commit");
void IncCol(SCCOL nDelta=1)
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
void IncRow(SCROW nDelta=1)
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
Accessor class to ScDocument.
void setMatrixCells(const ScRange &rRange, const ScTokenArray &rArray, formula::FormulaGrammar::Grammar eGrammar)
void setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay)
void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
void setStringCell(const ScAddress &rPos, const OUString &rStr)
bool appendSheet(const OUString &rName)
void setFormulaCell(const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const double *pResult=nullptr)
void setSheetName(SCTAB nTab, const OUString &rName)
SCTAB getSheetCount() const
SCTAB getSheetIndex(const OUString &rName) const
void setNumericCell(const ScAddress &rPos, double fVal)
void fillDownCells(const ScAddress &rPos, SCROW nFillSize)
void setAutoInput(const ScAddress &rPos, const OUString &rStr, const ScSetStringParam *pStringParam=nullptr)
SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden)
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC void ApplyPattern(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr &rAttr)
SC_DLLPUBLIC void SetColWidthOnly(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
SC_DLLPUBLIC void SetRowHeightOnly(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight)
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
virtual void set_column(orcus::spreadsheet::col_t col) override
virtual void commit() override
const ScOrcusGlobalSettings & mrGlobalSettings
virtual void append_column_match_value(std::string_view value) override
ScOrcusAutoFilter(const ScOrcusGlobalSettings &rGS)
virtual void commit_column() override
virtual void set_range(const orcus::spreadsheet::range_t &range) override
virtual ~ScOrcusAutoFilter() override
ScOrcusGlobalSettings maGlobalSettings
void pushSharedFormulaToken(const ScAddress &rPos, uint32_t nIndex)
virtual orcus::spreadsheet::iface::import_reference_resolver * get_reference_resolver(orcus::spreadsheet::formula_ref_context_t cxt) override
virtual void finalize() override
StringHashType maStringHash
virtual orcus::spreadsheet::iface::import_shared_strings * get_shared_strings() override
std::vector< std::unique_ptr< ScOrcusSheet > > maSheets
void pushMatrixFormulaToken(const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, uint32_t nRowRange, uint32_t nColRange)
virtual orcus::spreadsheet::iface::import_named_expression * get_named_expression() override
void pushCellStoreToken(const ScAddress &rPos, uint32_t nStrIndex)
size_t addString(const OUString &rStr)
virtual orcus::spreadsheet::iface::import_global_settings * get_global_settings() override
void pushFillDownCellsToken(const ScAddress &rPos, uint32_t nFillSize)
void pushFormulaResult(const ScAddress &rPos, double fValue)
const ScOrcusGlobalSettings & getGlobalSettings() const
void setStatusIndicator(const css::uno::Reference< css::task::XStatusIndicator > &rIndicator)
ScOrcusSharedStrings maSharedStrings
ScDocumentImport & getDoc()
virtual orcus::spreadsheet::iface::import_styles * get_styles() override
ScOrcusFactory(ScDocument &rDoc, bool bSkipDefaultStyles=false)
std::vector< OUString > maStrings
size_t appendString(const OUString &rStr)
ScOrcusNamedExpression maNamedExpressions
virtual orcus::spreadsheet::iface::import_sheet * append_sheet(orcus::spreadsheet::sheet_t sheet_index, std::string_view sheet_name) override
ScOrcusRefResolver maRefResolver
CellStoreTokensType maCellStoreTokens
virtual orcus::spreadsheet::iface::import_sheet * get_sheet(std::string_view sheet_name) override
void pushCellStoreAutoToken(const ScAddress &rPos, const OUString &rVal)
const OUString * getString(size_t nIndex) const
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
virtual void set_character_set(orcus::character_set_t cs) override
orcus::spreadsheet::formula_grammar_t meOrcusGrammar
ScOrcusGlobalSettings(ScDocumentImport &rDoc)
formula::FormulaGrammar::Grammar getCalcGrammar() const
ScDocumentImport & getDoc() const
virtual orcus::spreadsheet::formula_grammar_t get_default_formula_grammar() const override
rtl_TextEncoding mnTextEncoding
virtual void set_default_formula_grammar(orcus::spreadsheet::formula_grammar_t grammar) override
formula::FormulaGrammar::Grammar meCalcGrammar
rtl_TextEncoding getTextEncoding() const
virtual void set_origin_date(int year, int month, int day) override
void set_color(orcus::spreadsheet::border_direction_t dir, orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override
std::vector< ScOrcusBorder > & mrBorders
ScOrcusBorder maCurrentBorder
void set_style(orcus::spreadsheet::border_direction_t dir, orcus::spreadsheet::border_style_t style) override
ScOrcusImportBorderStyle(std::vector< ScOrcusBorder > &rBorders)
void set_width(orcus::spreadsheet::border_direction_t dir, double width, orcus::length_unit_t unit) override
std::size_t commit() override
ScOrcusProtection maCurrentProtection
void set_formula_hidden(bool b) override
std::size_t commit() override
std::vector< ScOrcusProtection > & mrProtections
void set_hidden(bool b) override
ScOrcusImportCellProtection(std::vector< ScOrcusProtection > &rProtections)
void set_print_content(bool b) override
void set_locked(bool b) override
ScOrcusImportFillStyle(std::vector< ScOrcusFill > &rFills)
std::size_t commit() override
void set_fg_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override
std::vector< ScOrcusFill > & mrFills
void set_bg_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override
void set_pattern_type(orcus::spreadsheet::fill_pattern_t fp) override
ScOrcusFill maCurrentFill
void set_underline_type(orcus::spreadsheet::underline_type_t e) override
void set_italic_asian(bool b) override
void set_italic_complex(bool b) override
void set_underline_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override
void set_name_complex(std::string_view s) override
void set_name(std::string_view s) override
void set_size_complex(double point) override
void set_strikethrough_type(orcus::spreadsheet::strikethrough_type_t s) override
void set_underline_mode(orcus::spreadsheet::underline_mode_t e) override
void set_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override
void set_size(double point) override
void set_strikethrough_text(orcus::spreadsheet::strikethrough_text_t s) override
void set_strikethrough_width(orcus::spreadsheet::strikethrough_width_t s) override
void set_size_asian(double point) override
ScOrcusImportFontStyle(ScOrcusFactory &rFactory, std::vector< ScOrcusFont > &rFonts)
std::vector< ScOrcusFont > & mrFonts
void set_strikethrough_style(orcus::spreadsheet::strikethrough_style_t s) override
void set_name_asian(std::string_view s) override
void set_underline_width(orcus::spreadsheet::underline_width_t e) override
void set_bold(bool b) override
std::size_t commit() override
void set_bold_complex(bool b) override
ScOrcusFont maCurrentFont
void set_italic(bool b) override
void set_bold_asian(bool b) override
void set_underline(orcus::spreadsheet::underline_t e) override
ScOrcusFactory & mrFactory
void set_protection(std::size_t index) override
void set_apply_alignment(bool b) override
std::vector< ScOrcusXf > * mpXfs
void set_horizontal_alignment(orcus::spreadsheet::hor_alignment_t align) override
void set_vertical_alignment(orcus::spreadsheet::ver_alignment_t align) override
void set_number_format(std::size_t index) override
void set_wrap_text(bool b) override
void reset(std::vector< ScOrcusXf > &rXfs)
void set_style_xf(std::size_t index) override
std::size_t commit() override
void set_border(std::size_t index) override
void set_font(std::size_t index) override
void set_fill(std::size_t index) override
void set_shrink_to_fit(bool b) override
virtual void set_base_position(const orcus::spreadsheet::src_address_t &pos) override
const ScOrcusGlobalSettings & mrGlobalSettings
virtual void set_named_range(std::string_view name, std::string_view range) override
virtual void set_named_expression(std::string_view name, std::string_view expression) override
ScOrcusNamedExpression(ScDocumentImport &rDoc, const ScOrcusGlobalSettings &rGS, SCTAB nTab=-1)
virtual void commit() override
const ScOrcusGlobalSettings & mrGlobalSettings
orcus::spreadsheet::src_range_t resolve_range(std::string_view range) override
orcus::spreadsheet::src_address_t resolve_address(std::string_view address) override
ScOrcusRefResolver(const ScOrcusGlobalSettings &rGS)
virtual void append_segment(std::string_view s) override
virtual size_t append(std::string_view s) override
virtual void set_segment_italic(bool b) override
virtual size_t add(std::string_view s) override
OStringBuffer maCurSegment
virtual void set_segment_bold(bool b) override
virtual void set_segment_font_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override
ScOrcusFactory & mrFactory
virtual void set_segment_font_size(double point) override
virtual size_t commit_segments() override
ScOrcusSharedStrings(ScOrcusFactory &rFactory)
virtual void set_segment_font(size_t font_index) override
virtual void set_segment_font_name(std::string_view s) override
virtual void set_column_hidden(orcus::spreadsheet::col_t col, orcus::spreadsheet::col_t col_span, bool hidden) override
virtual void set_column_width(orcus::spreadsheet::col_t col, orcus::spreadsheet::col_t col_span, double width, orcus::length_unit_t unit) override
virtual void set_merge_cell_range(const orcus::spreadsheet::range_t &range) override
virtual void set_row_hidden(orcus::spreadsheet::row_t row, bool hidden) override
virtual ~ScOrcusSheetProperties() override
virtual void set_row_height(orcus::spreadsheet::row_t row, double height, orcus::length_unit_t unit) override
ScOrcusSheetProperties(SCTAB nTab, ScDocumentImport &rDoc)
virtual orcus::spreadsheet::iface::import_formula * get_formula() override
virtual orcus::spreadsheet::iface::import_conditional_format * get_conditional_format() override
virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override
ScOrcusSheetProperties maProperties
ScOrcusFactory & mrFactory
virtual void set_row_format(orcus::spreadsheet::row_t row, std::size_t xf_index) override
ScOrcusConditionalFormat maConditionalFormat
virtual void fill_down_cells(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::row_t range_size) override
ScOrcusArrayFormula maArrayFormula
ScOrcusFactory & getFactory()
virtual orcus::spreadsheet::iface::import_sheet_properties * get_sheet_properties() override
virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override
virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override
virtual void set_date_time(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, int year, int month, int day, int hour, int minute, double second) override
virtual orcus::spreadsheet::iface::import_table * get_table() override
virtual orcus::spreadsheet::iface::import_array_formula * get_array_formula() override
sc::SharedFormulaGroups maFormulaGroups
virtual void set_format(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t xf_index) override
ScOrcusAutoFilter maAutoFilter
const sc::SharedFormulaGroups & getSharedFormulaGroups() const
virtual orcus::spreadsheet::iface::import_auto_filter * get_auto_filter() override
virtual orcus::spreadsheet::iface::import_named_expression * get_named_expression() override
virtual orcus::spreadsheet::range_size_t get_sheet_size() const override
ScOrcusNamedExpression maNamedExpressions
ScOrcusSheet(ScDocumentImport &rDoc, SCTAB nTab, ScOrcusFactory &rFactory)
ScDocumentImport & getDoc()
virtual void set_column_format(orcus::spreadsheet::col_t col, orcus::spreadsheet::col_t col_span, std::size_t xf_index) override
virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::string_id_t sindex) override
virtual orcus::spreadsheet::iface::import_fill_style * start_fill_style() override
std::vector< ScOrcusFont > maFonts
std::vector< ScOrcusBorder > maBorders
std::vector< ScOrcusXf > maCellXfs
ScOrcusImportBorderStyle maBorderStyle
void applyXfToItemSet(SfxItemSet &rSet, const ScOrcusXf &rXf)
std::vector< ScOrcusNumberFormat > maNumberFormats
virtual void set_border_count(size_t n) override
virtual orcus::spreadsheet::iface::import_number_format * start_number_format() override
ScOrcusImportCellProtection maCellProtection
ScOrcusStyles(ScOrcusFactory &rFactory, bool bSkipDefaultStyles=false)
std::vector< ScOrcusXf > maCellStyleXfs
std::vector< ScOrcusXf > maCellDiffXfs
ScOrcusImportFontStyle maFontStyle
ScOrcusImportFillStyle maFillStyle
std::vector< ScOrcusFill > maFills
ScOrcusFactory & mrFactory
virtual void set_cell_style_count(size_t n) override
virtual orcus::spreadsheet::iface::import_cell_style * start_cell_style() override
virtual orcus::spreadsheet::iface::import_cell_protection * start_cell_protection() override
ScOrcusImportNumberFormat maNumberFormat
ScOrucsImportCellStyle maCellStyle
std::vector< ScOrcusProtection > maProtections
virtual orcus::spreadsheet::iface::import_font_style * start_font_style() override
virtual orcus::spreadsheet::iface::import_xf * start_xf(orcus::spreadsheet::xf_category_t cat) override
virtual orcus::spreadsheet::iface::import_border_style * start_border_style() override
virtual void set_xf_count(orcus::spreadsheet::xf_category_t cat, size_t n) override
virtual void set_number_format_count(size_t n) override
virtual void set_fill_count(size_t n) override
virtual void set_font_count(size_t n) override
ScOrucsImportCellStyle(ScOrcusFactory &rFactory, ScOrcusStyles &rStyles, const std::vector< ScOrcusXf > &rXfs)
void set_display_name(std::string_view s) override
ScOrcusFactory & mrFactory
ScOrcusCellStyle maCurrentStyle
void set_builtin(std::size_t index) override
void set_name(std::string_view s) override
void set_xf(std::size_t index) override
const std::vector< ScOrcusXf > & mrXfs
void set_parent_name(std::string_view s) override
SfxItemSet & GetItemSet()
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
ScRefFlags Parse(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
static SC_DLLPUBLIC OUString ProgrammaticToDisplayName(const OUString &rProgName, SfxStyleFamily nType)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All) override
void CreateStandardStyles()
bool HasStandardStyles() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual bool SetParent(const OUString &)
virtual SfxItemSet & GetItemSet()
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
void SetLine(const editeng::SvxBorderLine *pNew)
void SetColor(const Color &rColor)
SharedString intern(const OUString &rStr)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define LANGUAGE_ENGLISH_US
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
RttiCompleteObjectLocator col
SvGenericNameContainerMapImpl maProperties
constexpr double alpha[nDetails]
const sal_Int16 API_LINE_THICK
const sal_Int16 API_LINE_MEDIUM
const sal_Int16 API_LINE_THIN
const sal_Int16 API_LINE_NONE
Font auto color (system window text color).
const sal_Int16 API_LINE_HAIR
OUString ScResId(TranslateId aId)
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< SvxLineItem > ATTR_BORDER_TLBR(141)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
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< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
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< Color > maColor
std::optional< SvxBorderLineStyle > meStyle
std::optional< double > mnWidth
std::map< orcus::spreadsheet::border_direction_t, BorderLine > maBorders
void applyToItemSet(SfxItemSet &rSet) const
@ SharedFormulaWithResult
CellStoreToken(const ScAddress &rPos, Type eType)
formula::FormulaGrammar::Grammar meGrammar
void applyToItemSet(SfxItemSet &rSet) const
std::optional< Color > maBgColor
std::optional< orcus::spreadsheet::fill_pattern_t > mePattern
std::optional< Color > maFgColor
std::optional< bool > mbItalic
std::optional< double > mnSize
std::optional< double > mnSizeAsian
std::optional< FontLineStyle > meUnderline
std::optional< Color > maUnderlineColor
void applyToItemSet(SfxItemSet &rSet) const
std::optional< bool > mbItalicComplex
std::optional< OUString > maNameComplex
std::optional< FontStrikeout > meStrikeout
std::optional< bool > mbBoldComplex
std::optional< bool > mbBold
std::optional< OUString > maNameAsian
std::optional< OUString > maName
std::optional< Color > maColor
std::optional< bool > mbBoldAsian
std::optional< bool > mbItalicAsian
std::optional< double > mnSizeComplex
std::optional< bool > mbLocked
void applyToItemSet(SfxItemSet &rSet) const
std::optional< bool > mbPrintContent
std::optional< bool > mbFormulaHidden
std::optional< bool > mbHidden
SvxCellVerJustify meVerAlignment
SvxCellJustifyMethod meVerAlignMethod
std::size_t mnNumberFormatId
std::size_t mnProtectionId
std::optional< bool > mbShrinkToFit
SvxCellHorJustify meHorAlignment
std::optional< bool > mbWrapText
SvxCellJustifyMethod meHorAlignMethod
constexpr OUStringLiteral SC_STYLE_PROG_STANDARD