LibreOffice Module sc (master) 1
interface.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <limits>
11#include <memory>
12#include <orcusinterface.hxx>
13
14#include <document.hxx>
15#include <formulacell.hxx>
16#include <rangenam.hxx>
17#include <tokenarray.hxx>
18#include <globalnames.hxx>
19#include <globstr.hrc>
20#include <scresid.hxx>
21#include <compiler.hxx>
22#include <stlpool.hxx>
23#include <scitems.hxx>
24#include <patattr.hxx>
25#include <docpool.hxx>
26#include <attrib.hxx>
27
28#include <editeng/postitem.hxx>
29#include <editeng/wghtitem.hxx>
30#include <editeng/colritem.hxx>
31#include <editeng/brushitem.hxx>
32#include <editeng/udlnitem.hxx>
33#include <editeng/boxitem.hxx>
35#include <editeng/fontitem.hxx>
36#include <editeng/fhgtitem.hxx>
37#include <editeng/lineitem.hxx>
40
42#include <svl/numformat.hxx>
43#include <svl/zforlist.hxx>
44#include <svl/intitem.hxx>
45#include <com/sun/star/task/XStatusIndicator.hpp>
46#include <i18nlangtag/lang.h>
47#include <tools/fontenum.hxx>
48#include <sal/log.hxx>
49
50#include <stylesbuffer.hxx>
51#include <orcus/exception.hpp>
52#include <stylehelper.hxx>
53#include <utility>
54#include <unordered_map>
55#include <frozen/bits/defines.h>
56#include <frozen/bits/elsa_std.h>
57#include <frozen/unordered_map.h>
58
59using namespace com::sun::star;
60
61namespace os = orcus::spreadsheet;
62
63namespace {
64
65formula::FormulaGrammar::Grammar getCalcGrammarFromOrcus( os::formula_grammar_t grammar )
66{
68 switch(grammar)
69 {
70 case orcus::spreadsheet::formula_grammar_t::ods:
72 break;
73 case orcus::spreadsheet::formula_grammar_t::xlsx:
75 break;
76 case orcus::spreadsheet::formula_grammar_t::gnumeric:
78 break;
79 case orcus::spreadsheet::formula_grammar_t::xls_xml:
81 break;
82 case orcus::spreadsheet::formula_grammar_t::unknown:
83 break;
84 }
85
86 return eGrammar;
87}
88
89}
90
92 : mrDoc(rDoc)
93 , meCalcGrammar(formula::FormulaGrammar::GRAM_UNSPECIFIED)
94 , meOrcusGrammar(os::formula_grammar_t::unknown)
95 , mnTextEncoding(RTL_TEXTENCODING_UTF8)
96{
97}
98
99void ScOrcusGlobalSettings::set_origin_date(int year, int month, int day)
100{
102}
103
104void ScOrcusGlobalSettings::set_character_set(orcus::character_set_t cs)
105{
106 // Keep the entries sorted by the key.
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 },
151 });
152
153 if (auto it = rules.find(cs); it != rules.end())
154 mnTextEncoding = it->second;
155}
156
157void ScOrcusGlobalSettings::set_default_formula_grammar(os::formula_grammar_t grammar)
158{
159 meCalcGrammar = getCalcGrammarFromOrcus(grammar);
160 meOrcusGrammar = grammar;
161}
162
163orcus::spreadsheet::formula_grammar_t ScOrcusGlobalSettings::get_default_formula_grammar() const
164{
165 return meOrcusGrammar;
166}
167
169 mrGlobalSettings(rGS) {}
170
171os::src_address_t ScOrcusRefResolver::resolve_address(std::string_view address)
172{
173 OUString aStr(address.data(), address.size(), mrGlobalSettings.getTextEncoding());
174
175 ScAddress aAddr;
179
180 if (!aAddr.IsValid())
181 {
182 std::ostringstream os;
183 os << "'" << address << "' is not a valid address expression.";
184 throw orcus::invalid_arg_error(os.str());
185 }
186
187 os::src_address_t ret;
188 ret.sheet = aAddr.Tab();
189 ret.column = aAddr.Col();
190 ret.row = aAddr.Row();
191
192 return ret;
193}
194
195os::src_range_t ScOrcusRefResolver::resolve_range(std::string_view range)
196{
197 OUString aStr(range.data(), range.size(), mrGlobalSettings.getTextEncoding());
198
199 ScRange aRange;
203
204 if (!aRange.IsValid())
205 {
206 std::ostringstream os;
207 os << "'" << range << "' is not a valid range expression.";
208 throw orcus::invalid_arg_error(os.str());
209 }
210
211 os::src_range_t ret;
212 ret.first.sheet = aRange.aStart.Tab();
213 ret.first.column = aRange.aStart.Col();
214 ret.first.row = aRange.aStart.Row();
215 ret.last.sheet = aRange.aEnd.Tab();
216 ret.last.column = aRange.aEnd.Col();
217 ret.last.row = aRange.aEnd.Row();
218
219 return ret;
220}
221
223 ScDocumentImport& rDoc, const ScOrcusGlobalSettings& rGS, SCTAB nTab ) :
224 mrDoc(rDoc), mrGlobalSettings(rGS), mnTab(nTab) {}
225
227{
228 maBasePos.SetTab(0);
229 maBasePos.SetCol(0);
230 maBasePos.SetRow(0);
231 maName.clear();
232 maExpr.clear();
233}
234
235void ScOrcusNamedExpression::set_base_position(const orcus::spreadsheet::src_address_t& pos)
236{
237 maBasePos.SetTab(pos.sheet);
238 maBasePos.SetCol(pos.column);
239 maBasePos.SetRow(pos.row);
240}
241
242void ScOrcusNamedExpression::set_named_expression(std::string_view name, std::string_view expression)
243{
244 maName = OUString(name.data(), name.size(), mrGlobalSettings.getTextEncoding());
245 maExpr = OUString(expression.data(), expression.size(), mrGlobalSettings.getTextEncoding());
246}
247
248void ScOrcusNamedExpression::set_named_range(std::string_view /*name*/, std::string_view /*range*/)
249{
250 throw std::runtime_error("ScOrcusNamedExpression::set_named_range not implemented yet.");
251}
252
254{
256 if (!pNames)
257 return;
258
259 ScRangeData* pRange = new ScRangeData(
262
263 pNames->insert(pRange, false);
264
265 reset(); // make sure to reset the state for the next run.
266}
267
269 : mfValue(std::numeric_limits<double>::quiet_NaN())
270 , maPos(rPos)
271 , meType(eType)
272 , mnIndex1(0)
273 , mnIndex2(0)
274 , meGrammar(formula::FormulaGrammar::GRAM_UNSPECIFIED)
275{
276}
277
279 : mfValue(fValue)
280 , maPos(rPos)
282 , mnIndex1(0)
283 , mnIndex2(0)
284 , meGrammar(formula::FormulaGrammar::GRAM_UNSPECIFIED)
285{
286}
287
289 : mfValue(std::numeric_limits<double>::quiet_NaN())
290 , maPos(rPos)
291 , meType(Type::String)
292 , mnIndex1(nIndex)
293 , mnIndex2(0)
294 , meGrammar(formula::FormulaGrammar::GRAM_UNSPECIFIED)
295{
296}
297
300 : maStr1(std::move(aFormula))
301 , mfValue(std::numeric_limits<double>::quiet_NaN())
302 , maPos(rPos)
304 , mnIndex1(0)
305 , mnIndex2(0)
306 , meGrammar(eGrammar)
307{
308}
309
310ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc, bool bSkipDefaultStyles) :
311 maDoc(rDoc),
314 maSharedStrings(*this),
316 maStyles(*this, bSkipDefaultStyles),
317 mnProgress(0) {}
318
319orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet(
320 orcus::spreadsheet::sheet_t sheet_index, std::string_view sheet_name)
321{
322 OUString aTabName(sheet_name.data(), sheet_name.size(), maGlobalSettings.getTextEncoding());
323
324 if (sheet_index == 0)
325 {
326 // The calc document initializes with one sheet already present.
327 assert(maDoc.getSheetCount() == 1);
328 maDoc.setSheetName(0, aTabName);
329 maSheets.push_back(std::make_unique<ScOrcusSheet>(maDoc, 0, *this));
330 return maSheets.back().get();
331 }
332
333 if (!maDoc.appendSheet(aTabName))
334 return nullptr;
335
336 SCTAB nTab = maDoc.getSheetCount() - 1;
337 maSheets.push_back(std::make_unique<ScOrcusSheet>(maDoc, nTab, *this));
338 return maSheets.back().get();
339}
340
341namespace {
342
343class FindSheetByIndex
344{
345 SCTAB mnTab;
346public:
347 explicit FindSheetByIndex(SCTAB nTab) : mnTab(nTab) {}
348 bool operator() (const std::unique_ptr<ScOrcusSheet>& rSheet) const
349 {
350 return rSheet->getIndex() == mnTab;
351 }
352};
353
354}
355
356orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::get_sheet(std::string_view sheet_name)
357{
358 OUString aTabName(sheet_name.data(), sheet_name.size(), maGlobalSettings.getTextEncoding());
359 SCTAB nTab = maDoc.getSheetIndex(aTabName);
360 if (nTab < 0)
361 // Sheet by that name not found.
362 return nullptr;
363
364 // See if we already have an orcus sheet instance by that index.
365 std::vector< std::unique_ptr<ScOrcusSheet> >::iterator it =
366 std::find_if(maSheets.begin(), maSheets.end(), FindSheetByIndex(nTab));
367
368 if (it != maSheets.end())
369 // We already have one. Return it.
370 return it->get();
371
372 // Create a new orcus sheet instance for this.
373 maSheets.push_back(std::make_unique<ScOrcusSheet>(maDoc, nTab, *this));
374 return maSheets.back().get();
375}
376
377orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::get_sheet(orcus::spreadsheet::sheet_t sheet_index)
378{
379 SCTAB nTab = static_cast<SCTAB>(sheet_index);
380 // See if we already have an orcus sheet instance by that index.
381 std::vector< std::unique_ptr<ScOrcusSheet> >::iterator it =
382 std::find_if(maSheets.begin(), maSheets.end(), FindSheetByIndex(nTab));
383
384 if (it != maSheets.end())
385 // We already have one. Return it.
386 return it->get();
387
388 // Create a new orcus sheet instance for this.
389 maSheets.push_back(std::make_unique<ScOrcusSheet>(maDoc, nTab, *this));
390 return maSheets.back().get();
391}
392
393orcus::spreadsheet::iface::import_global_settings* ScOrcusFactory::get_global_settings()
394{
395 return &maGlobalSettings;
396}
397
398orcus::spreadsheet::iface::import_shared_strings* ScOrcusFactory::get_shared_strings()
399{
400 return &maSharedStrings;
401}
402
403orcus::spreadsheet::iface::import_named_expression* ScOrcusFactory::get_named_expression()
404{
405 return &maNamedExpressions;
406}
407
408orcus::spreadsheet::iface::import_styles* ScOrcusFactory::get_styles()
409{
410 return &maStyles;
411}
412
413os::iface::import_reference_resolver* ScOrcusFactory::get_reference_resolver(os::formula_ref_context_t cxt)
414{
415 switch (cxt)
416 {
417 case os::formula_ref_context_t::global:
418 return &maRefResolver;
419 case os::formula_ref_context_t::named_expression_base:
420 case os::formula_ref_context_t::named_range:
421 return nullptr;
422 }
423
424 return nullptr;
425}
426
428{
429 auto toFormulaCell = [this]( const CellStoreToken& rToken ) -> std::unique_ptr<ScFormulaCell>
430 {
431 const ScOrcusSheet& rSheet = *maSheets.at(rToken.maPos.Tab());
432 const sc::SharedFormulaGroups& rSFG = rSheet.getSharedFormulaGroups();
433 const ScTokenArray* pArray = rSFG.get(rToken.mnIndex1);
434 if (!pArray)
435 return std::unique_ptr<ScFormulaCell>();
436
437 return std::make_unique<ScFormulaCell>(maDoc.getDoc(), rToken.maPos, *pArray);
438 };
439
440 int nCellCount = 0;
441
442 for (const CellStoreToken& rToken : maCellStoreTokens)
443 {
444 switch (rToken.meType)
445 {
447 {
448 maDoc.setAutoInput(rToken.maPos, rToken.maStr1);
449 ++nCellCount;
450 break;
451 }
453 {
454 if (rToken.mnIndex1 >= maStrings.size())
455 // String index out-of-bound! Something is up.
456 break;
457
458 maDoc.setStringCell(rToken.maPos, maStrings[rToken.mnIndex1]);
459 ++nCellCount;
460 break;
461 }
463 {
464 maDoc.setNumericCell(rToken.maPos, rToken.mfValue);
465 ++nCellCount;
466 break;
467 }
469 {
471 rToken.maPos, rToken.maStr1, rToken.meGrammar);
472
473 ++nCellCount;
474 break;
475 }
477 {
478 if (std::isfinite(rToken.mfValue))
479 maDoc.setFormulaCell(rToken.maPos, rToken.maStr1, rToken.meGrammar, &rToken.mfValue);
480 else
481 maDoc.setFormulaCell(rToken.maPos, rToken.maStr1, rToken.meGrammar, rToken.maStr2);
482
483 ++nCellCount;
484 break;
485 }
487 {
488 std::unique_ptr<ScFormulaCell> pCell = toFormulaCell(rToken);
489 if (!pCell)
490 break;
491
492 maDoc.setFormulaCell(rToken.maPos, pCell.release());
493
494 ++nCellCount;
495 break;
496 }
498 {
499 std::unique_ptr<ScFormulaCell> pCell = toFormulaCell(rToken);
500 if (!pCell)
501 break;
502
503 if (std::isfinite(rToken.mfValue))
504 pCell->SetResultDouble(rToken.mfValue);
505 else
506 pCell->SetHybridString(
507 maDoc.getDoc().GetSharedStringPool().intern(rToken.maStr2));
508
509 maDoc.setFormulaCell(rToken.maPos, pCell.release());
510
511 ++nCellCount;
512 break;
513 }
515 {
516 if (!rToken.mnIndex1 || !rToken.mnIndex2)
517 break;
518
519 ScRange aRange(rToken.maPos);
520 aRange.aEnd.IncCol(rToken.mnIndex1-1);
521 aRange.aEnd.IncRow(rToken.mnIndex2-1);
522
523 ScCompiler aComp(maDoc.getDoc(), aRange.aStart, rToken.meGrammar);
524 std::unique_ptr<ScTokenArray> pArray(aComp.CompileString(rToken.maStr1));
525 if (!pArray)
526 break;
527
528 maDoc.setMatrixCells(aRange, *pArray, rToken.meGrammar);
529 break;
530 }
532 {
533 if (!rToken.mnIndex1)
534 break;
535
536 maDoc.fillDownCells(rToken.maPos, rToken.mnIndex1);
537 break;
538 }
539 default:
540 ;
541 }
542
543 if (nCellCount == 100000)
544 {
546 nCellCount = 0;
547 }
548 }
549
550 if (mxStatusIndicator.is())
551 mxStatusIndicator->end();
552
553 maDoc.finalize();
554}
555
557{
558 return maDoc;
559}
560
561size_t ScOrcusFactory::appendString(const OUString& rStr)
562{
563 size_t nPos = maStrings.size();
564 maStrings.push_back(rStr);
565 maStringHash.emplace(rStr, nPos);
566
567 return nPos;
568}
569
570size_t ScOrcusFactory::addString(const OUString& rStr)
571{
572 // Add only if the string is not yet present in the string pool.
573 StringHashType::iterator it = maStringHash.find(rStr);
574 if (it != maStringHash.end())
575 return it->second;
576
577 return appendString(rStr);
578}
579
580const OUString* ScOrcusFactory::getString(size_t nIndex) const
581{
582 return nIndex < maStrings.size() ? &maStrings[nIndex] : nullptr;
583}
584
585void ScOrcusFactory::pushCellStoreAutoToken( const ScAddress& rPos, const OUString& rVal )
586{
588 maCellStoreTokens.back().maStr1 = rVal;
589}
590
591void ScOrcusFactory::pushCellStoreToken( const ScAddress& rPos, uint32_t nStrIndex )
592{
593 maCellStoreTokens.emplace_back(rPos, nStrIndex);
594}
595
596void ScOrcusFactory::pushCellStoreToken( const ScAddress& rPos, double fValue )
597{
598 maCellStoreTokens.emplace_back(rPos, fValue);
599}
600
602 const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar )
603{
604 maCellStoreTokens.emplace_back(rPos, rFormula, eGrammar);
605}
606
607void ScOrcusFactory::pushFillDownCellsToken( const ScAddress& rPos, uint32_t nFillSize )
608{
610 maCellStoreTokens.back().mnIndex1 = nFillSize;
611}
612
613void ScOrcusFactory::pushSharedFormulaToken( const ScAddress& rPos, uint32_t nIndex )
614{
616 maCellStoreTokens.back().mnIndex1 = nIndex;
617}
618
620 const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar,
621 uint32_t nRowRange, uint32_t nColRange )
622{
625 rT.maStr1 = rFormula;
626 rT.meGrammar = eGrammar;
627 rT.mnIndex1 = nColRange;
628 rT.mnIndex2 = nRowRange;
629}
630
631void ScOrcusFactory::pushFormulaResult( const ScAddress& rPos, double fValue )
632{
633 // Formula result is expected to be pushed immediately following the
634 // formula token it belongs.
635 if (maCellStoreTokens.empty())
636 return;
637
638 CellStoreToken& rToken = maCellStoreTokens.back();
639 if (rToken.maPos != rPos)
640 return;
641
642 switch (rToken.meType)
643 {
646 break;
649 break;
650 default:
651 return;
652 }
653
654 rToken.mfValue = fValue;
655}
656
657void ScOrcusFactory::pushFormulaResult( const ScAddress& rPos, const OUString& rValue )
658{
659 // Formula result is expected to be pushed immediately following the
660 // formula token it belongs.
661 if (maCellStoreTokens.empty())
662 return;
663
664 CellStoreToken& rToken = maCellStoreTokens.back();
665 if (rToken.maPos != rPos)
666 return;
667
668 switch (rToken.meType)
669 {
672 break;
675 break;
676 default:
677 return;
678 }
679
680 rToken.maStr2 = rValue;
681}
682
684{
685 if (!mxStatusIndicator.is())
686 // Status indicator object not set.
687 return;
688
689 // For now, we'll hard-code the progress range to be 100, and stops at 99
690 // in all cases.
691
692 if (!mnProgress)
693 mxStatusIndicator->start(ScResId(STR_LOAD_DOC), 100);
694
695 if (mnProgress == 99)
696 return;
697
698 ++mnProgress;
699 mxStatusIndicator->setValue(mnProgress);
700}
701
702void ScOrcusFactory::setStatusIndicator(const uno::Reference<task::XStatusIndicator>& rIndicator)
703{
704 mxStatusIndicator = rIndicator;
705}
706
708{
709 return maGlobalSettings;
710}
711
713 mrDoc(rDoc),
714 mnTab(nTab)
715{
716}
717
719{
720}
721
722namespace {
723
724double translateToInternal(double nVal, orcus::length_unit_t unit)
725{
726 switch(unit)
727 {
728 case orcus::length_unit_t::inch:
729 return nVal * 72.0 * 20.0;
730 case orcus::length_unit_t::twip:
731 return nVal;
732 case orcus::length_unit_t::point:
733 return nVal * 20.0;
734 case orcus::length_unit_t::centimeter:
735 return nVal * 20.0 * 72.0 / 2.54;
736 case orcus::length_unit_t::unknown:
737 if (nVal != 0)
738 SAL_WARN("sc.orcus", "unknown unit");
739 break;
740 default:
741 break;
742 }
743 return nVal;
744}
745
746
747}
748
749void ScOrcusSheetProperties::set_column_width(os::col_t col, os::col_t col_span, double width, orcus::length_unit_t unit)
750{
751 double nNewWidth = translateToInternal(width, unit);
752
753 for (os::col_t offset = 0; offset < col_span; ++offset)
754 mrDoc.getDoc().SetColWidthOnly(col + offset, mnTab, nNewWidth);
755}
756
757void ScOrcusSheetProperties::set_column_hidden(os::col_t col, os::col_t col_span, bool hidden)
758{
759 if (hidden)
760 mrDoc.getDoc().SetColHidden(col, col + col_span - 1, mnTab, hidden);
761}
762
763void ScOrcusSheetProperties::set_row_height(os::row_t row, double height, orcus::length_unit_t unit)
764{
765 double nNewHeight = translateToInternal(height, unit);
766 mrDoc.getDoc().SetRowHeightOnly(row, row,mnTab, nNewHeight);
767}
768
769void ScOrcusSheetProperties::set_row_hidden(os::row_t row, bool hidden)
770{
771 if (hidden)
772 mrDoc.getDoc().SetRowHidden(row, row, mnTab, hidden);
773}
774
775void ScOrcusSheetProperties::set_merge_cell_range(const orcus::spreadsheet::range_t& range)
776{
777 mrDoc.setMergedCells(mnTab, range.first.column, range.first.row, range.last.column, range.last.row);
778}
779
781 mnTab(nTab),
782 mrDoc(rDoc),
783 mpCurrentFormat(new ScConditionalFormat(0, &mrDoc)),
784 meEntryType(ScFormatEntry::Type::Condition)
785{
786}
787
789{
790}
791
792void ScOrcusConditionalFormat::set_color(os::color_elem_t /*alpha*/, os::color_elem_t /*red*/,
793 os::color_elem_t /*green*/, os::color_elem_t /*blue*/)
794{
795 SAL_INFO("sc.orcus.condformat", "set_color");
796}
797
798void ScOrcusConditionalFormat::set_condition_type(os::condition_type_t /*type*/)
799{
801 SAL_INFO("sc.orcus.condformat", "set_condition_type");
802}
803
804void ScOrcusConditionalFormat::set_formula(std::string_view /*formula*/)
805{
806 SAL_INFO("sc.orcus.condformat", "set_formula");
807}
808
809void ScOrcusConditionalFormat::set_date(os::condition_date_t /*date*/)
810{
812 SAL_INFO("sc.orcus.condformat", "set_date");
813}
814
816{
817 SAL_INFO("sc.orcus.condformat", "commit_condition");
818}
819
820void ScOrcusConditionalFormat::set_icon_name(std::string_view /*name*/)
821{
823 SAL_INFO("sc.orcus.condformat", "set_icon_name");
824}
825
827{
829 SAL_INFO("sc.orcus.condformat", "set_databar_gradient");
830}
831
832void ScOrcusConditionalFormat::set_databar_axis(os::databar_axis_t /*axis*/)
833{
835 SAL_INFO("sc.orcus.condformat", "set_databar_axis");
836}
837
838void ScOrcusConditionalFormat::set_databar_color_positive(os::color_elem_t /*alpha*/, os::color_elem_t /*red*/,
839 os::color_elem_t /*green*/, os::color_elem_t /*blue*/)
840{
842 SAL_INFO("sc.orcus.condformat", "set_databar_color_positive");
843}
844
845void ScOrcusConditionalFormat::set_databar_color_negative(os::color_elem_t /*alpha*/, os::color_elem_t /*red*/,
846 os::color_elem_t /*green*/, os::color_elem_t /*blue*/)
847{
849 SAL_INFO("sc.orcus.condformat", "set_databar_color_negative");
850}
851
853{
855 SAL_INFO("sc.orcus.condformat", "set_min_databar_length");
856}
857
859{
861 SAL_INFO("sc.orcus.condformat", "set_max_databar_length");
862}
863
865{
866 SAL_INFO("sc.orcus.condformat", "set_show_value");
867}
868
870{
872 SAL_INFO("sc.orcus.condformat", "set_iconset_reverse");
873}
874
876{
877 SAL_INFO("sc.orcus.condformat", "set_xf_id");
878}
879
880void ScOrcusConditionalFormat::set_operator(os::condition_operator_t /*condition_type*/)
881{
882 SAL_INFO("sc.orcus.condformat", "set_operator");
883}
884
885void ScOrcusConditionalFormat::set_type(os::conditional_format_t type)
886{
887 switch (type)
888 {
889 case os::conditional_format_t::condition:
890 case os::conditional_format_t::formula:
892 // mpCurrentEntry.reset(new ScCondFormatEntry());
893 break;
894 case os::conditional_format_t::date:
895 break;
896 case os::conditional_format_t::colorscale:
897 break;
898 case os::conditional_format_t::databar:
899 break;
900 case os::conditional_format_t::iconset:
901 break;
902 default:
903 SAL_INFO("sc.orcus.condformat", "unknown conditional_format_t value");
904 break;
905 }
906 SAL_INFO("sc.orcus.condformat", "set_type");
907}
908
910{
911 SAL_INFO("sc.orcus.condformat", "commit_entry");
912}
913
914void ScOrcusConditionalFormat::set_range(std::string_view /*range*/)
915{
916 SAL_INFO("sc.orcus.condformat", "set_range");
917}
918
919void ScOrcusConditionalFormat::set_range(os::row_t row_start, os::col_t col_start,
920 os::row_t row_end, os::col_t col_end)
921{
922 SAL_INFO("sc.orcus.condformat", "set_range");
923 ScRange aRange(col_start, row_start, mnTab, col_end, row_end, mnTab);
924 mpCurrentFormat->SetRange(aRange);
925}
926
928{
929 SAL_INFO("sc.orcus.condformat", "commit_format");
931}
932
934 mrDoc(rDoc),
935 mnTab(nTab),
936 mrFactory(rFactory),
937 mrStyles(static_cast<ScOrcusStyles&>(*mrFactory.get_styles())),
938 maAutoFilter(rFactory.getGlobalSettings()),
939 maProperties(mnTab, mrDoc),
940 maConditionalFormat(mnTab, rDoc.getDoc()),
941 maNamedExpressions(rDoc, rFactory.getGlobalSettings(), nTab),
942 maFormula(*this),
943 maArrayFormula(*this),
944 mnCellCount(0)
945{
946}
947
949{
950 mnCol = -1;
951 mnRow = -1;
952 maFormula.clear();
955 mbShared = false;
957 maResult.clear();
958 mfResult = 0.0;
959}
960
962 mrSheet(rSheet),
963 mnCol(-1),
964 mnRow(-1),
965 meGrammar(formula::FormulaGrammar::GRAM_UNSPECIFIED),
966 mnSharedFormulaIndex(0),
967 mbShared(false),
968 meResType(ResultType::NotSet),
969 mfResult(0.0) {}
970
972
973void ScOrcusFormula::set_position(os::row_t row, os::col_t col)
974{
975 mnCol = col;
976 mnRow = row;
977}
978
979void ScOrcusFormula::set_formula(os::formula_grammar_t grammar, std::string_view formula)
980{
982 meGrammar = getCalcGrammarFromOrcus(grammar);
983}
984
986{
988 mbShared = true;
989}
990
992{
994 mfResult = value;
995}
996
997void ScOrcusFormula::set_result_string(std::string_view value)
998{
1000 maResult = OUString(value.data(), value.size(), mrSheet.getFactory().getGlobalSettings().getTextEncoding());
1001}
1002
1004{
1006}
1007
1009{
1011 mfResult = value ? 1.0 : 0.0;
1012}
1013
1015{
1016 ScOrcusFactory& rFactory = mrSheet.getFactory();
1019
1020 if (mbShared)
1021 {
1022 if (maFormula.isEmpty())
1023 {
1024 // shared formula that references existing formula token.
1025 const ScTokenArray* pArray = rGroups.get(mnSharedFormulaIndex);
1026 if (!pArray)
1027 return;
1028 }
1029 else
1030 {
1031 // topmost shared formula with new formula token.
1032
1033 // Compile the formula expression into tokens.
1034 ScCompiler aComp(mrSheet.getDoc().getDoc(), aPos, meGrammar);
1035 std::unique_ptr<ScTokenArray> pArray = aComp.CompileString(maFormula);
1036 if (!pArray)
1037 // Tokenization failed.
1038 return;
1039
1040 rGroups.set(mnSharedFormulaIndex, std::move(pArray));
1041 }
1043 }
1044 else
1045 {
1046 // non-shared formula
1047 rFactory.pushCellStoreToken(aPos, maFormula, meGrammar);
1048 }
1049
1050 switch (meResType)
1051 {
1052 case ResultType::String:
1053 {
1054 rFactory.pushFormulaResult(aPos, maResult);
1055 break;
1056 }
1057 case ResultType::Value:
1058 rFactory.pushFormulaResult(aPos, mfResult);
1059 break;
1060 default:
1061 ;
1062 }
1063
1065}
1066
1068{
1069 mnCol = -1;
1070 mnRow = -1;
1071 mnColRange = 0;
1072 mnRowRange = 0;
1073
1074 maFormula.clear();
1076}
1077
1079 mrSheet(rSheet),
1080 mnCol(-1),
1081 mnRow(-1),
1082 mnColRange(0),
1083 mnRowRange(0),
1084 meGrammar(formula::FormulaGrammar::GRAM_UNSPECIFIED) {}
1085
1087
1088void ScOrcusArrayFormula::set_range(const os::range_t& range)
1089{
1090 mnCol = range.first.column;
1091 mnRow = range.first.row;
1092
1093 mnColRange = range.last.column - range.first.column + 1;
1094 mnRowRange = range.last.row - range.first.column + 1;
1095}
1096
1097void ScOrcusArrayFormula::set_formula(os::formula_grammar_t grammar, std::string_view formula)
1098{
1099 meGrammar = getCalcGrammarFromOrcus(grammar);
1101}
1102
1103void ScOrcusArrayFormula::set_result_value(os::row_t /*row*/, os::col_t /*col*/, double /*value*/)
1104{
1105 // TODO : implement result cache for matrix
1106}
1107
1108void ScOrcusArrayFormula::set_result_string(os::row_t /*row*/, os::col_t /*col*/, std::string_view /*value*/)
1109{
1110 // TODO : implement result cache for matrix
1111}
1112
1113void ScOrcusArrayFormula::set_result_empty(os::row_t /*row*/, os::col_t /*col*/)
1114{
1115 // TODO : implement result cache for matrix
1116}
1117
1118void ScOrcusArrayFormula::set_result_bool(os::row_t /*row*/, os::col_t /*col*/, bool /*value*/)
1119{
1120 // TODO : implement result cache for matrix
1121}
1122
1124{
1128}
1129
1131{
1132 ++mnCellCount;
1133 if (mnCellCount == 100000)
1134 {
1136 mnCellCount = 0;
1137 }
1138}
1139
1141{
1142 return mrDoc;
1143}
1144
1145os::iface::import_auto_filter* ScOrcusSheet::get_auto_filter()
1146{
1147 return &maAutoFilter;
1148}
1149
1150os::iface::import_table* ScOrcusSheet::get_table()
1151{
1152 return nullptr;
1153}
1154
1155os::iface::import_sheet_properties* ScOrcusSheet::get_sheet_properties()
1156{
1157 return &maProperties;
1158}
1159
1160os::iface::import_conditional_format* ScOrcusSheet::get_conditional_format()
1161{
1162 return &maConditionalFormat;
1163}
1164
1165os::iface::import_named_expression* ScOrcusSheet::get_named_expression()
1166{
1167 return &maNamedExpressions;
1168}
1169
1170os::iface::import_formula* ScOrcusSheet::get_formula()
1171{
1172 maFormula.reset();
1173 return &maFormula;
1174}
1175
1176os::iface::import_array_formula* ScOrcusSheet::get_array_formula()
1177{
1179 return &maArrayFormula;
1180}
1181
1182void ScOrcusSheet::set_auto(os::row_t row, os::col_t col, std::string_view value)
1183{
1184 OUString aVal(value.data(), value.size(), mrFactory.getGlobalSettings().getTextEncoding());
1186 cellInserted();
1187}
1188
1189void ScOrcusSheet::set_string(os::row_t row, os::col_t col, os::string_id_t sindex)
1190{
1192 cellInserted();
1193}
1194
1195void ScOrcusSheet::set_value(os::row_t row, os::col_t col, double value)
1196{
1198 cellInserted();
1199}
1200
1201void ScOrcusSheet::set_bool(os::row_t row, os::col_t col, bool value)
1202{
1203 mrFactory.pushCellStoreToken(ScAddress(col, row, mnTab), value ? 1.0 : 0.0);
1204 cellInserted();
1205}
1206
1208 os::row_t row, os::col_t col, int year, int month, int day, int hour, int minute, double second)
1209{
1210 SvNumberFormatter* pFormatter = mrDoc.getDoc().GetFormatTable();
1211
1212 Date aDate(day, month, year);
1213 sal_uInt32 nSec = floor(second);
1214 sal_uInt32 nNanoSec = (second - nSec) * ::tools::Time::nanoSecPerSec;
1215 tools::Time aTime(hour, minute, nSec, nNanoSec);
1216 tools::Long nDateDiff = aDate - pFormatter->GetNullDate();
1217
1218 double fTime =
1219 static_cast<double>(aTime.GetNanoSec()) / ::tools::Time::nanoSecPerSec +
1220 aTime.GetSec() +
1223
1224 fTime /= DATE_TIME_FACTOR;
1225
1226 mrFactory.pushCellStoreToken(ScAddress(col, row, mnTab), nDateDiff + fTime);
1227 cellInserted();
1228}
1229
1230void ScOrcusSheet::set_format(os::row_t row, os::col_t col, size_t xf_index)
1231{
1232 SAL_INFO("sc.orcus.style", "set format: " << xf_index);
1233
1234 ScPatternAttr aPattern(mrDoc.getDoc().GetPool());
1235 mrStyles.applyXfToItemSet(aPattern.GetItemSet(), xf_index);
1236 mrDoc.getDoc().ApplyPattern(col, row, mnTab, aPattern);
1237}
1238
1239void ScOrcusSheet::set_format(os::row_t row_start, os::col_t col_start,
1240 os::row_t row_end, os::col_t col_end, size_t xf_index)
1241{
1242 SAL_INFO("sc.orcus.style", "set format range: " << xf_index);
1243 ScPatternAttr aPattern(mrDoc.getDoc().GetPool());
1244 mrStyles.applyXfToItemSet(aPattern.GetItemSet(), xf_index);
1245 mrDoc.getDoc().ApplyPatternAreaTab(col_start, row_start, col_end, row_end, mnTab, aPattern);
1246}
1247
1249 os::col_t col, os::col_t col_span, std::size_t xf_index)
1250{
1251 ScPatternAttr aPattern(mrDoc.getDoc().GetPool());
1252 mrStyles.applyXfToItemSet(aPattern.GetItemSet(), xf_index);
1253
1255 col, 0, col + col_span - 1, mrDoc.getDoc().MaxRow(), mnTab, aPattern);
1256}
1257
1258void ScOrcusSheet::set_row_format(os::row_t row, std::size_t xf_index)
1259{
1260 ScPatternAttr aPattern(mrDoc.getDoc().GetPool());
1261 mrStyles.applyXfToItemSet(aPattern.GetItemSet(), xf_index);
1262
1264 0, row, mrDoc.getDoc().MaxCol(), row, mnTab, aPattern);
1265}
1266
1267orcus::spreadsheet::range_size_t ScOrcusSheet::get_sheet_size() const
1268{
1269 orcus::spreadsheet::range_size_t ret;
1270 ret.rows = MAXROWCOUNT;
1271 ret.columns = MAXCOLCOUNT;
1272
1273 return ret;
1274}
1275
1276void ScOrcusSheet::fill_down_cells(os::row_t row, os::col_t col, os::row_t range_size)
1277{
1279 cellInserted();
1280}
1281
1283{
1284 return maFormulaGroups;
1285}
1286
1288{
1289 return maFormulaGroups;
1290}
1291
1293{
1294 return mrFactory;
1295}
1296
1298 mrFactory(rFactory) {}
1299
1300size_t ScOrcusSharedStrings::append(std::string_view s)
1301{
1302 OUString aNewString(s.data(), s.size(), mrFactory.getGlobalSettings().getTextEncoding());
1303 return mrFactory.appendString(aNewString);
1304}
1305
1306size_t ScOrcusSharedStrings::add(std::string_view s)
1307{
1308 OUString aNewString(s.data(), s.size(), mrFactory.getGlobalSettings().getTextEncoding());
1309 return mrFactory.addString(aNewString);
1310}
1311
1313{
1314}
1315
1317{
1318}
1319
1321{
1322}
1323
1325{
1326}
1327
1329{
1330}
1331
1332void ScOrcusSharedStrings::set_segment_font_color(orcus::spreadsheet::color_elem_t,
1333 orcus::spreadsheet::color_elem_t,
1334 orcus::spreadsheet::color_elem_t,
1335 orcus::spreadsheet::color_elem_t)
1336{
1337}
1338
1340{
1341 maCurSegment.append(s.data(), s.size());
1342}
1343
1345{
1346 OString aStr = maCurSegment.makeStringAndClear();
1347 return mrFactory.addString(
1348 OStringToOUString(aStr, mrFactory.getGlobalSettings().getTextEncoding()));
1349}
1350
1352{
1353 if (mbBold)
1354 {
1357 }
1358
1359 if (mbBoldAsian)
1360 {
1363 }
1364
1365 if (mbBoldComplex)
1366 {
1369 }
1370
1371 if (mbItalic)
1372 {
1375 }
1376
1377 if (mbItalicAsian)
1378 {
1381 }
1382
1383 if (mbItalicComplex)
1384 {
1387 }
1388
1389 if (maColor)
1391
1392 if (maName && !maName->isEmpty())
1393 rSet.Put( SvxFontItem( FAMILY_DONTKNOW, *maName, *maName, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT ));
1394
1395 if (maNameAsian && !maNameAsian->isEmpty())
1397
1398 if (maNameComplex && !maNameComplex->isEmpty())
1400
1401 if (mnSize)
1402 {
1403 double fSize = translateToInternal(*mnSize, orcus::length_unit_t::point);
1405 }
1406
1407 if (mnSizeAsian)
1408 {
1409 double fSize = translateToInternal(*mnSizeAsian, orcus::length_unit_t::point);
1411 }
1412
1413 if (mnSizeComplex)
1414 {
1415 double fSize = translateToInternal(*mnSizeComplex, orcus::length_unit_t::point);
1417 }
1418
1419 if (meUnderline)
1420 {
1422 if (maUnderlineColor)
1423 // Separate color specified for the underline
1424 aUnderline.SetColor(*maUnderlineColor);
1425 else if (maColor)
1426 // Use font color
1427 aUnderline.SetColor(*maColor);
1428 rSet.Put(aUnderline);
1429 }
1430
1431 if (meStrikeout)
1433}
1434
1436{
1437 if (!mePattern || !maFgColor)
1438 return;
1439
1440 if (*mePattern == os::fill_pattern_t::solid)
1442}
1443
1445{
1446 auto getDirection = [](os::border_direction_t dir) -> SvxBoxItemLine
1447 {
1448 switch (dir)
1449 {
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;
1458 default:
1459 ;
1460 }
1461 return SvxBoxItemLine::RIGHT;
1462 };
1463
1464 if (maBorders.empty())
1465 return;
1466
1467 SvxBoxItem aBoxItem(ATTR_BORDER);
1468 SvxLineItem aDiagonal_TLBR(ATTR_BORDER_TLBR);
1469 SvxLineItem aDiagonal_BLTR(ATTR_BORDER_BLTR);
1470
1471 for (const auto& [dir, attrs] : maBorders)
1472 {
1473 SvxBoxItemLine eDir = getDirection(dir);
1474
1475 SvxBorderLineStyle eStyle = attrs.meStyle.value_or(SvxBorderLineStyle::SOLID);
1476 Color aColor = attrs.maColor.value_or(COL_BLACK);
1477 double nWidth = attrs.mnWidth.value_or(0.0);
1478
1479 switch (dir)
1480 {
1481 case os::border_direction_t::diagonal_tl_br:
1482 {
1483 editeng::SvxBorderLine aLine(&aColor, nWidth, eStyle);
1484 aDiagonal_TLBR.SetLine(&aLine);
1485 break;
1486 }
1487 case os::border_direction_t::diagonal_bl_tr:
1488 {
1489 editeng::SvxBorderLine aLine(&aColor, nWidth, eStyle);
1490 aDiagonal_BLTR.SetLine(&aLine);
1491 break;
1492 }
1493 default:
1494 {
1495 editeng::SvxBorderLine aLine(&aColor, nWidth, eStyle);
1496 aBoxItem.SetLine(&aLine, eDir);
1497 }
1498 }
1499 }
1500
1501 rSet.Put(aDiagonal_BLTR);
1502 rSet.Put(aDiagonal_TLBR);
1503 rSet.Put(aBoxItem);
1504}
1505
1507{
1509 return;
1510
1511 bool bLocked = mbLocked.value_or(true); // defaults to true.
1512 bool bHidden = mbHidden.value_or(false);
1513 bool bFormulaHidden = mbFormulaHidden.value_or(false);
1514 bool bPrintContent = mbPrintContent.value_or(false);
1515 rSet.Put(ScProtectionAttr(bLocked, bFormulaHidden, bHidden, bPrintContent));
1516}
1517
1519{
1520 if (!maCode)
1521 return;
1522
1523 sal_uInt32 nKey;
1524 sal_Int32 nCheckPos;
1525 SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
1526 OUString Code = *maCode; /* <-- Done because the SvNumberFormatter::PutEntry demands a non const NumFormat Code*/
1527 SvNumFormatType type = SvNumFormatType::ALL;
1528
1529 pFormatter->PutEntry(Code, nCheckPos, type, nKey, LANGUAGE_ENGLISH_US);
1530 if (!nCheckPos)
1532}
1533
1535 mnFontId(0),
1536 mnFillId(0),
1537 mnBorderId(0),
1538 mnProtectionId(0),
1539 mnNumberFormatId(0),
1540 mnStyleXf(0),
1541 mbApplyAlignment(false),
1542 mbWrapText(false),
1543 mbShrinkToFit(false),
1544 meHorAlignment(SvxCellHorJustify::Standard),
1545 meVerAlignment(SvxCellVerJustify::Standard),
1546 meHorAlignMethod(SvxCellJustifyMethod::Auto),
1547 meVerAlignMethod(SvxCellJustifyMethod::Auto)
1548{
1549}
1550
1552 maParentName(SC_STYLE_PROG_STANDARD),
1553 mnXFId(0),
1554 mnBuiltInId(0)
1555{
1556}
1557
1558ScOrcusImportFontStyle::ScOrcusImportFontStyle( ScOrcusFactory& rFactory, std::vector<ScOrcusFont>& rFonts ) :
1559 mrFactory(rFactory),
1560 mrFonts(rFonts)
1561{
1562}
1563
1565{
1567}
1568
1570{
1572}
1573
1575{
1577}
1578
1580{
1582}
1583
1585{
1587}
1588
1590{
1592}
1593
1595{
1597}
1598
1599void ScOrcusImportFontStyle::set_name(std::string_view name)
1600{
1601 OUString aName(name.data(), name.size(), mrFactory.getGlobalSettings().getTextEncoding());
1603}
1604
1606{
1607 OUString aName(name.data(), name.size(), mrFactory.getGlobalSettings().getTextEncoding());
1609}
1610
1612{
1613 OUString aName(name.data(), name.size(), mrFactory.getGlobalSettings().getTextEncoding());
1615}
1616
1618{
1620}
1621
1623{
1625}
1626
1628{
1630}
1631
1633{
1634 switch(e)
1635 {
1636 case os::underline_t::single_line:
1637 case os::underline_t::single_accounting:
1639 break;
1640 case os::underline_t::double_line:
1641 case os::underline_t::double_accounting:
1643 break;
1644 case os::underline_t::none:
1646 break;
1647 case os::underline_t::dotted:
1649 break;
1650 case os::underline_t::dash:
1652 break;
1653 case os::underline_t::long_dash:
1655 break;
1656 case os::underline_t::dot_dash:
1658 break;
1659 case os::underline_t::dot_dot_dash:
1661 break;
1662 case os::underline_t::wave:
1664 break;
1665 default:
1666 ;
1667 }
1668}
1669
1671{
1672 if (e == os::underline_width_t::bold || e == os::underline_width_t::thick)
1673 {
1675 {
1676 switch (*maCurrentFont.meUnderline)
1677 {
1678 case LINESTYLE_NONE:
1679 case LINESTYLE_SINGLE:
1681 break;
1682 case LINESTYLE_DOTTED:
1684 break;
1685 case LINESTYLE_DASH:
1687 break;
1688 case LINESTYLE_LONGDASH:
1690 break;
1691 case LINESTYLE_DASHDOT:
1693 break;
1696 break;
1697 case LINESTYLE_WAVE:
1699 break;
1700 default:
1701 ;
1702 }
1703 }
1704 else
1706 }
1707}
1708
1709void ScOrcusImportFontStyle::set_underline_mode(os::underline_mode_t /*e*/)
1710{
1711}
1712
1714{
1715 if (e == os::underline_type_t::double_type)
1716 {
1718 {
1719 switch (*maCurrentFont.meUnderline)
1720 {
1721 case LINESTYLE_NONE:
1722 case LINESTYLE_SINGLE:
1724 break;
1725 case LINESTYLE_WAVE:
1727 break;
1728 default:
1729 ;
1730 }
1731 }
1732 else
1734 }
1735}
1736
1738 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1739{
1740 maCurrentFont.maUnderlineColor = Color(ColorAlpha, alpha, red, green, blue);
1741}
1742
1744 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1745{
1746 maCurrentFont.maColor = Color(ColorAlpha, alpha, red, green, blue);
1747}
1748
1749void ScOrcusImportFontStyle::set_strikethrough_style(os::strikethrough_style_t /*s*/)
1750{
1751}
1752
1754{
1756 {
1760 return;
1761 }
1762
1763 switch (s)
1764 {
1765 case os::strikethrough_type_t::unknown:
1767 break;
1768 case os::strikethrough_type_t::none:
1770 break;
1771 case os::strikethrough_type_t::single_type:
1773 break;
1774 case os::strikethrough_type_t::double_type:
1776 break;
1777 default:
1778 ;
1779 }
1780}
1781
1783{
1784 switch (s)
1785 {
1786 case os::strikethrough_width_t::bold:
1788 break;
1789 default:
1790 ;
1791 }
1792}
1793
1795{
1796 switch (s)
1797 {
1798 case os::strikethrough_text_t::slash:
1800 break;
1801 case os::strikethrough_text_t::cross:
1803 break;
1804 default:
1805 ;
1806 }
1807}
1808
1810{
1811 SAL_INFO("sc.orcus.style", "commit font");
1812 mrFonts.push_back(maCurrentFont);
1814 return mrFonts.size() - 1;
1815}
1816
1817ScOrcusImportFillStyle::ScOrcusImportFillStyle( std::vector<ScOrcusFill>& rFills ) :
1818 mrFills(rFills)
1819{
1820}
1821
1823{
1825}
1826
1828{
1830}
1831
1833 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1834{
1835 maCurrentFill.maFgColor = Color(ColorAlpha, alpha, red, green, blue);
1836}
1837
1839 os::color_elem_t alpha, os::color_elem_t red, os::color_elem_t green, os::color_elem_t blue)
1840{
1841 maCurrentFill.maBgColor = Color(ColorAlpha, alpha, red, green, blue);
1842}
1843
1845{
1846 SAL_INFO("sc.orcus.style", "commit fill");
1847 mrFills.push_back(maCurrentFill);
1849 return mrFills.size() - 1;
1850}
1851
1852ScOrcusImportBorderStyle::ScOrcusImportBorderStyle( std::vector<ScOrcusBorder>& rBorders ) :
1853 mrBorders(rBorders)
1854{
1855}
1856
1858 os::border_direction_t dir, os::border_style_t style)
1859{
1861
1862 switch (style)
1863 {
1864 case os::border_style_t::solid:
1865 rBorderLine.meStyle = SvxBorderLineStyle::SOLID;
1866 rBorderLine.mnWidth = oox::xls::API_LINE_THIN;
1867 break;
1868 case os::border_style_t::hair:
1869 rBorderLine.meStyle = SvxBorderLineStyle::SOLID;
1870 rBorderLine.mnWidth = oox::xls::API_LINE_HAIR;
1871 break;
1872 case os::border_style_t::medium:
1873 rBorderLine.meStyle = SvxBorderLineStyle::SOLID;
1874 rBorderLine.mnWidth = oox::xls::API_LINE_MEDIUM;
1875 break;
1876 case os::border_style_t::thick:
1877 rBorderLine.meStyle = SvxBorderLineStyle::SOLID;
1878 rBorderLine.mnWidth = oox::xls::API_LINE_THICK;
1879 break;
1880 case os::border_style_t::thin:
1881 rBorderLine.meStyle = SvxBorderLineStyle::SOLID;
1882 rBorderLine.mnWidth = oox::xls::API_LINE_THIN;
1883 break;
1884 case os::border_style_t::dash_dot:
1885 rBorderLine.meStyle = SvxBorderLineStyle::DASH_DOT;
1886 rBorderLine.mnWidth = oox::xls::API_LINE_THIN;
1887 break;
1888 case os::border_style_t::dash_dot_dot:
1889 rBorderLine.meStyle = SvxBorderLineStyle::DASH_DOT_DOT;
1890 rBorderLine.mnWidth = oox::xls::API_LINE_THIN;
1891 break;
1892 case os::border_style_t::dashed:
1893 rBorderLine.meStyle = SvxBorderLineStyle::DASHED;
1894 rBorderLine.mnWidth = oox::xls::API_LINE_THIN;
1895 break;
1896 case os::border_style_t::dotted:
1897 rBorderLine.meStyle = SvxBorderLineStyle::DOTTED;
1898 rBorderLine.mnWidth = oox::xls::API_LINE_THIN;
1899 break;
1900 case os::border_style_t::double_border:
1901 rBorderLine.meStyle = SvxBorderLineStyle::DOUBLE;
1902 rBorderLine.mnWidth = oox::xls::API_LINE_THICK;
1903 break;
1904 case os::border_style_t::medium_dash_dot:
1905 case os::border_style_t::slant_dash_dot:
1906 rBorderLine.meStyle = SvxBorderLineStyle::DASH_DOT;
1907 rBorderLine.mnWidth = oox::xls::API_LINE_MEDIUM;
1908 break;
1909 case os::border_style_t::medium_dash_dot_dot:
1910 rBorderLine.meStyle = SvxBorderLineStyle::DASH_DOT_DOT;
1911 rBorderLine.mnWidth = oox::xls::API_LINE_MEDIUM;
1912 break;
1913 case os::border_style_t::medium_dashed:
1914 rBorderLine.meStyle = SvxBorderLineStyle::DASHED;
1915 rBorderLine.mnWidth = oox::xls::API_LINE_MEDIUM;
1916 break;
1917 case os::border_style_t::unknown:
1918 case os::border_style_t::none:
1919 rBorderLine.mnWidth = oox::xls::API_LINE_NONE;
1920 break;
1921 default:
1922 ;
1923 }
1924}
1925
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)
1929{
1931 rBorderLine.maColor = Color(ColorAlpha, alpha, red, green, blue);
1932}
1933
1935{
1937}
1938
1939void ScOrcusImportBorderStyle::set_width(os::border_direction_t dir, double val, orcus::length_unit_t unit)
1940{
1942 rBorderLine.mnWidth = translateToInternal(val, unit);
1943}
1944
1946{
1947 SAL_INFO("sc.orcus.style", "commit border");
1948 mrBorders.push_back(maCurrentBorder);
1950 return mrBorders.size() - 1;
1951}
1952
1953ScOrcusImportCellProtection::ScOrcusImportCellProtection( std::vector<ScOrcusProtection>& rProtections ) :
1954 mrProtections(rProtections)
1955{
1956}
1957
1959{
1961}
1962
1964{
1966}
1967
1969{
1971}
1972
1974{
1976}
1977
1979{
1981}
1982
1984{
1985 SAL_INFO("sc.orcus.style", "commit cell protection");
1988 return mrProtections.size() - 1;
1989}
1990
1991ScOrcusImportNumberFormat::ScOrcusImportNumberFormat( ScOrcusFactory& rFactory, std::vector<ScOrcusNumberFormat>& rFormats ) :
1992 mrFactory(rFactory), mrNumberFormats(rFormats)
1993{
1994}
1995
1997{
1999}
2000
2002{
2003}
2004
2006{
2007 OUString aCode(s.data(), s.size(), mrFactory.getGlobalSettings().getTextEncoding());
2008 maCurrentFormat.maCode = aCode;
2009}
2010
2012{
2013 SAL_INFO("sc.orcus.style", "commit number format");
2016 return mrNumberFormats.size() - 1;
2017}
2018
2020 ScOrcusFactory& rFactory, ScOrcusStyles& rStyles, const std::vector<ScOrcusXf>& rXfs ) :
2021 mrFactory(rFactory),
2022 mrStyles(rStyles),
2023 mrXfs(rXfs)
2024{
2025}
2026
2028{
2030}
2031
2032void ScOrucsImportCellStyle::set_name(std::string_view name)
2033{
2034 OUString aName(name.data(), name.size(), mrFactory.getGlobalSettings().getTextEncoding());
2036}
2037
2039{
2040 OUString aName(name.data(), name.size(), mrFactory.getGlobalSettings().getTextEncoding());
2042}
2043
2045{
2047}
2048
2050{
2052}
2053
2055{
2056 const OUString aParentName(name.data(), name.size(), mrFactory.getGlobalSettings().getTextEncoding());
2057 maCurrentStyle.maParentName = aParentName;
2058}
2059
2061{
2062 SAL_INFO("sc.orcus.style", "commit cell style: " << maCurrentStyle.maName);
2063 if (maCurrentStyle.mnXFId >= mrXfs.size())
2064 {
2065 SAL_WARN("sc.orcus.style", "invalid xf id for commit cell style");
2066 return;
2067 }
2068
2069 if (maCurrentStyle.mnXFId == 0)
2070 return;
2071
2073 SfxStyleSheetBase& rBase = pPool->Make(maCurrentStyle.maName, SfxStyleFamily::Para);
2074 // Need to convert the parent name to localized UI name, see tdf#139205.
2075 rBase.SetParent(
2077 maCurrentStyle.maParentName, SfxStyleFamily::Para));
2078
2079 SfxItemSet& rSet = rBase.GetItemSet();
2080 const ScOrcusXf& rXf = mrXfs[maCurrentStyle.mnXFId];
2082
2084}
2085
2086void ScOrcusImportXf::reset( std::vector<ScOrcusXf>& rXfs )
2087{
2088 mpXfs = &rXfs;
2090}
2091
2092void ScOrcusImportXf::set_font(std::size_t index)
2093{
2095}
2096
2097void ScOrcusImportXf::set_fill(std::size_t index)
2098{
2100}
2101
2102void ScOrcusImportXf::set_border(std::size_t index)
2103{
2105}
2106
2107void ScOrcusImportXf::set_protection(std::size_t index)
2108{
2110}
2111
2113{
2115}
2116
2117void ScOrcusImportXf::set_style_xf(std::size_t index)
2118{
2120}
2121
2123{
2125}
2126
2127void ScOrcusImportXf::set_horizontal_alignment(os::hor_alignment_t align)
2128{
2129 switch (align)
2130 {
2131 case os::hor_alignment_t::left:
2132 maCurrentXf.meHorAlignment = SvxCellHorJustify::Left;
2133 break;
2134 case os::hor_alignment_t::right:
2135 maCurrentXf.meHorAlignment = SvxCellHorJustify::Right;
2136 break;
2137 case os::hor_alignment_t::center:
2138 maCurrentXf.meHorAlignment = SvxCellHorJustify::Center;
2139 break;
2140 case os::hor_alignment_t::justified:
2141 maCurrentXf.meHorAlignment = SvxCellHorJustify::Block;
2142 break;
2143 case os::hor_alignment_t::distributed:
2144 maCurrentXf.meHorAlignment = SvxCellHorJustify::Block;
2145 maCurrentXf.meHorAlignMethod = SvxCellJustifyMethod::Distribute;
2146 break;
2147 case os::hor_alignment_t::unknown:
2148 maCurrentXf.meHorAlignment = SvxCellHorJustify::Standard;
2149 break;
2150 default:
2151 ;
2152 }
2154}
2155
2156void ScOrcusImportXf::set_vertical_alignment(os::ver_alignment_t align)
2157{
2158 switch (align)
2159 {
2160 case os::ver_alignment_t::top:
2161 maCurrentXf.meVerAlignment = SvxCellVerJustify::Top;
2162 break;
2163 case os::ver_alignment_t::bottom:
2164 maCurrentXf.meVerAlignment = SvxCellVerJustify::Bottom;
2165 break;
2166 case os::ver_alignment_t::middle:
2167 maCurrentXf.meVerAlignment = SvxCellVerJustify::Center;
2168 break;
2169 case os::ver_alignment_t::justified:
2170 maCurrentXf.meVerAlignment = SvxCellVerJustify::Block;
2171 break;
2172 case os::ver_alignment_t::distributed:
2173 maCurrentXf.meVerAlignment = SvxCellVerJustify::Block;
2174 maCurrentXf.meVerAlignMethod = SvxCellJustifyMethod::Distribute;
2175 break;
2176 case os::ver_alignment_t::unknown:
2177 maCurrentXf.meVerAlignment = SvxCellVerJustify::Standard;
2178 break;
2179 default:
2180 ;
2181 }
2183}
2184
2186{
2188}
2189
2191{
2193}
2194
2196{
2197 mpXfs->push_back(maCurrentXf);
2198 return mpXfs->size() - 1;
2199}
2200
2201
2202ScOrcusStyles::ScOrcusStyles( ScOrcusFactory& rFactory, bool bSkipDefaultStyles ) :
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)
2210{
2211 ScDocument& rDoc = rFactory.getDoc().getDoc();
2212 if (!bSkipDefaultStyles && !rDoc.GetStyleSheetPool()->HasStandardStyles())
2214}
2215
2216/*
2217namespace {
2218
2219std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
2220{
2221 rStrm << "Red: " << (int)rColor.GetRed() << ", Green: " << (int)rColor.GetGreen() << ", Blue: " << (int)rColor.GetBlue();
2222 return rStrm;
2223}
2224
2225}
2226*/
2227
2229{
2230 size_t nFontId = rXf.mnFontId;
2231 if (nFontId >= maFonts.size())
2232 {
2233 SAL_WARN("sc.orcus.style", "invalid font id");
2234 return;
2235 }
2236
2237 maFonts[nFontId].applyToItemSet(rSet);
2238
2239 size_t nFillId = rXf.mnFillId;
2240 if (nFillId >= maFills.size())
2241 {
2242 SAL_WARN("sc.orcus.style", "invalid fill id");
2243 return;
2244 }
2245
2246 maFills[nFillId].applyToItemSet(rSet);
2247
2248 size_t nBorderId = rXf.mnBorderId;
2249 if (nBorderId >= maBorders.size())
2250 {
2251 SAL_WARN("sc.orcus.style", "invalid border id");
2252 return;
2253 }
2254 maBorders[nBorderId].applyToItemSet(rSet);
2255
2256 size_t nProtectionId = rXf.mnProtectionId;
2257 if (nProtectionId >= maProtections.size())
2258 {
2259 SAL_WARN("sc.orcus.style", "invalid protection id");
2260 return;
2261 }
2262
2263 maProtections[nProtectionId].applyToItemSet(rSet);
2264
2265 size_t nNumberFormatId = rXf.mnNumberFormatId;
2266 if (nNumberFormatId >= maNumberFormats.size())
2267 {
2268 SAL_WARN("sc.orcus.style", "invalid number format id");
2269 return;
2270 }
2271 const ScOrcusNumberFormat& rFormat = maNumberFormats[nNumberFormatId];
2273
2274 if (rXf.mbApplyAlignment)
2275 {
2280 }
2281
2282 if (rXf.mbWrapText)
2284
2285 if (rXf.mbShrinkToFit)
2287}
2288
2289void ScOrcusStyles::applyXfToItemSet( SfxItemSet& rSet, std::size_t xfId )
2290{
2291 SAL_INFO("sc.orcus.style", "applyXfToitemSet: " << xfId);
2292 if (maCellXfs.size() <= xfId)
2293 {
2294 SAL_WARN("sc.orcus.style", "invalid xf id");
2295 return;
2296 }
2297
2299}
2300
2301os::iface::import_font_style* ScOrcusStyles::start_font_style()
2302{
2304 return &maFontStyle;
2305}
2306
2307os::iface::import_fill_style* ScOrcusStyles::start_fill_style()
2308{
2310 return &maFillStyle;
2311}
2312
2313os::iface::import_border_style* ScOrcusStyles::start_border_style()
2314{
2316 return &maBorderStyle;
2317}
2318
2319os::iface::import_cell_protection* ScOrcusStyles::start_cell_protection()
2320{
2322 return &maCellProtection;
2323}
2324
2325os::iface::import_number_format* ScOrcusStyles::start_number_format()
2326{
2328 return &maNumberFormat;
2329}
2330
2331os::iface::import_xf* ScOrcusStyles::start_xf(os::xf_category_t cat)
2332{
2333 switch (cat)
2334 {
2335 case os::xf_category_t::cell:
2337 break;
2338 case os::xf_category_t::cell_style:
2340 break;
2341 case os::xf_category_t::differential:
2343 break;
2344 case os::xf_category_t::unknown:
2345 SAL_WARN("sc.orcus.style", "unknown xf category");
2346 return nullptr;
2347 }
2348
2349 return &maXf;
2350}
2351
2352os::iface::import_cell_style* ScOrcusStyles::start_cell_style()
2353{
2355 return &maCellStyle;
2356}
2357
2359{
2360}
2361
2363{
2364}
2365
2367{
2368}
2369
2371{
2372}
2373
2374void ScOrcusStyles::set_xf_count(os::xf_category_t /*cat*/, size_t /*n*/)
2375{
2376}
2377
2379{
2380}
2381
2382// auto filter import
2383
2385 mrGlobalSettings(rGS)
2386{
2387}
2388
2390{
2391}
2392
2393void ScOrcusAutoFilter::set_range(const os::range_t& range)
2394{
2395 maRange.aStart.SetRow(range.first.row);
2396 maRange.aStart.SetCol(range.first.column);
2397 maRange.aEnd.SetRow(range.last.row);
2398 maRange.aEnd.SetCol(range.last.column);
2399}
2400
2402{
2403 SAL_INFO("sc.orcus.autofilter", "set_column: " << col);
2404}
2405
2407{
2408 OUString aString(value.data(), value.size(), mrGlobalSettings.getTextEncoding());
2409 SAL_INFO("sc.orcus.autofilter", "append_column_match_value: " << aString);
2410}
2411
2413{
2414 SAL_INFO("sc.orcus.autofilter", "commit column");
2415}
2416
2418{
2419 SAL_INFO("sc.orcus.autofilter", "commit");
2420}
2421
2422/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCCOL MAXCOLCOUNT
Definition: address.hxx:63
const SCROW MAXROWCOUNT
Definition: address.hxx:62
OUString maFormula
SvxBorderLineStyle
SvxBoxItemLine
sal_Int32 day
sal_Int32 year
sal_Int32 month
SCTAB Tab() const
Definition: address.hxx:283
void SetCol(SCCOL nColP)
Definition: address.hxx:291
void IncCol(SCCOL nDelta=1)
Definition: address.hxx:316
bool IsValid() const
Definition: address.hxx:305
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)
Definition: address.cxx:1537
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
void IncRow(SCROW nDelta=1)
Definition: address.hxx:312
SCCOL Col() const
Definition: address.hxx:279
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
Definition: compiler.cxx:4691
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)
ScDocument & getDoc()
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)
Definition: document.cxx:4448
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6050
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4770
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC void ApplyPattern(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4747
SC_DLLPUBLIC void SetColWidthOnly(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
Definition: document.cxx:4092
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6055
SC_DLLPUBLIC void SetRowHeightOnly(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight)
Definition: document.cxx:4110
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:601
SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden)
Definition: document.cxx:4442
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:467
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
Definition: documen3.cxx:171
virtual void set_formula(orcus::spreadsheet::formula_grammar_t grammar, std::string_view formula) override
Definition: interface.cxx:1097
virtual void set_range(const orcus::spreadsheet::range_t &range) override
Definition: interface.cxx:1088
ScOrcusArrayFormula(ScOrcusSheet &rSheet)
Definition: interface.cxx:1078
virtual void set_result_empty(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col) override
Definition: interface.cxx:1113
virtual void commit() override
Definition: interface.cxx:1123
ScOrcusSheet & mrSheet
virtual void set_result_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override
Definition: interface.cxx:1118
virtual void set_result_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override
Definition: interface.cxx:1108
virtual void set_result_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override
Definition: interface.cxx:1103
formula::FormulaGrammar::Grammar meGrammar
virtual ~ScOrcusArrayFormula() override
Definition: interface.cxx:1086
virtual void set_column(orcus::spreadsheet::col_t col) override
Definition: interface.cxx:2401
virtual void commit() override
Definition: interface.cxx:2417
const ScOrcusGlobalSettings & mrGlobalSettings
virtual void append_column_match_value(std::string_view value) override
Definition: interface.cxx:2406
ScOrcusAutoFilter(const ScOrcusGlobalSettings &rGS)
Definition: interface.cxx:2384
virtual void commit_column() override
Definition: interface.cxx:2412
virtual void set_range(const orcus::spreadsheet::range_t &range) override
Definition: interface.cxx:2393
virtual ~ScOrcusAutoFilter() override
Definition: interface.cxx:2389
virtual ~ScOrcusConditionalFormat() override
Definition: interface.cxx:788
virtual void commit_entry() override
Definition: interface.cxx:909
ScOrcusConditionalFormat(SCTAB nTab, ScDocument &rDoc)
Definition: interface.cxx:780
virtual void set_iconset_reverse(bool reverse) override
Definition: interface.cxx:869
virtual void set_databar_color_positive(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
Definition: interface.cxx:838
virtual void set_show_value(bool show) override
Definition: interface.cxx:864
virtual void set_type(orcus::spreadsheet::conditional_format_t type) override
Definition: interface.cxx:885
virtual void set_xf_id(size_t xf) override
Definition: interface.cxx:875
virtual void set_databar_gradient(bool gradient) override
Definition: interface.cxx:826
virtual void commit_format() override
Definition: interface.cxx:927
virtual void set_operator(orcus::spreadsheet::condition_operator_t condition_type) override
Definition: interface.cxx:880
virtual void set_databar_color_negative(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
Definition: interface.cxx:845
virtual void set_range(std::string_view range) override
Definition: interface.cxx:914
virtual void set_date(orcus::spreadsheet::condition_date_t date) override
Definition: interface.cxx:809
virtual void set_formula(std::string_view formula) override
Definition: interface.cxx:804
virtual void set_icon_name(std::string_view name) override
Definition: interface.cxx:820
virtual void commit_condition() override
Definition: interface.cxx:815
virtual void set_databar_axis(orcus::spreadsheet::databar_axis_t axis) override
Definition: interface.cxx:832
virtual void set_condition_type(orcus::spreadsheet::condition_type_t type) override
Definition: interface.cxx:798
std::unique_ptr< ScConditionalFormat > mpCurrentFormat
ScFormatEntry::Type meEntryType
virtual 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
Definition: interface.cxx:792
virtual void set_min_databar_length(double length) override
Definition: interface.cxx:852
virtual void set_max_databar_length(double length) override
Definition: interface.cxx:858
ScOrcusGlobalSettings maGlobalSettings
void pushSharedFormulaToken(const ScAddress &rPos, uint32_t nIndex)
Definition: interface.cxx:613
virtual orcus::spreadsheet::iface::import_reference_resolver * get_reference_resolver(orcus::spreadsheet::formula_ref_context_t cxt) override
Definition: interface.cxx:413
virtual void finalize() override
Definition: interface.cxx:427
StringHashType maStringHash
virtual orcus::spreadsheet::iface::import_shared_strings * get_shared_strings() override
Definition: interface.cxx:398
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)
Definition: interface.cxx:619
virtual orcus::spreadsheet::iface::import_named_expression * get_named_expression() override
Definition: interface.cxx:403
ScOrcusStyles maStyles
ScDocumentImport maDoc
void pushCellStoreToken(const ScAddress &rPos, uint32_t nStrIndex)
Definition: interface.cxx:591
size_t addString(const OUString &rStr)
Definition: interface.cxx:570
virtual orcus::spreadsheet::iface::import_global_settings * get_global_settings() override
Definition: interface.cxx:393
void pushFillDownCellsToken(const ScAddress &rPos, uint32_t nFillSize)
Definition: interface.cxx:607
void pushFormulaResult(const ScAddress &rPos, double fValue)
Definition: interface.cxx:631
const ScOrcusGlobalSettings & getGlobalSettings() const
Definition: interface.cxx:707
void setStatusIndicator(const css::uno::Reference< css::task::XStatusIndicator > &rIndicator)
Definition: interface.cxx:702
ScOrcusSharedStrings maSharedStrings
ScDocumentImport & getDoc()
Definition: interface.cxx:556
void incrementProgress()
Definition: interface.cxx:683
virtual orcus::spreadsheet::iface::import_styles * get_styles() override
Definition: interface.cxx:408
ScOrcusFactory(ScDocument &rDoc, bool bSkipDefaultStyles=false)
Definition: interface.cxx:310
std::vector< OUString > maStrings
size_t appendString(const OUString &rStr)
Definition: interface.cxx:561
ScOrcusNamedExpression maNamedExpressions
virtual orcus::spreadsheet::iface::import_sheet * append_sheet(orcus::spreadsheet::sheet_t sheet_index, std::string_view sheet_name) override
Definition: interface.cxx:319
ScOrcusRefResolver maRefResolver
CellStoreTokensType maCellStoreTokens
virtual orcus::spreadsheet::iface::import_sheet * get_sheet(std::string_view sheet_name) override
Definition: interface.cxx:356
void pushCellStoreAutoToken(const ScAddress &rPos, const OUString &rVal)
Definition: interface.cxx:585
const OUString * getString(size_t nIndex) const
Definition: interface.cxx:580
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
ScOrcusFormula(ScOrcusSheet &rSheet)
Definition: interface.cxx:961
virtual ~ScOrcusFormula() override
Definition: interface.cxx:971
virtual void set_result_value(double value) override
Definition: interface.cxx:991
virtual void set_formula(orcus::spreadsheet::formula_grammar_t grammar, std::string_view formula) override
Definition: interface.cxx:979
virtual void set_result_bool(bool value) override
Definition: interface.cxx:1008
size_t mnSharedFormulaIndex
formula::FormulaGrammar::Grammar meGrammar
virtual void set_result_empty() override
Definition: interface.cxx:1003
virtual void set_shared_formula_index(size_t index) override
Definition: interface.cxx:985
ResultType meResType
virtual void set_result_string(std::string_view value) override
Definition: interface.cxx:997
ScOrcusSheet & mrSheet
virtual void set_position(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col) override
Definition: interface.cxx:973
virtual void commit() override
Definition: interface.cxx:1014
virtual void set_character_set(orcus::character_set_t cs) override
Definition: interface.cxx:104
orcus::spreadsheet::formula_grammar_t meOrcusGrammar
ScOrcusGlobalSettings(ScDocumentImport &rDoc)
Definition: interface.cxx:91
formula::FormulaGrammar::Grammar getCalcGrammar() const
ScDocumentImport & getDoc() const
virtual orcus::spreadsheet::formula_grammar_t get_default_formula_grammar() const override
Definition: interface.cxx:163
rtl_TextEncoding mnTextEncoding
virtual void set_default_formula_grammar(orcus::spreadsheet::formula_grammar_t grammar) override
Definition: interface.cxx:157
formula::FormulaGrammar::Grammar meCalcGrammar
rtl_TextEncoding getTextEncoding() const
ScDocumentImport & mrDoc
virtual void set_origin_date(int year, int month, int day) override
Definition: interface.cxx:99
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
Definition: interface.cxx:1926
std::vector< ScOrcusBorder > & mrBorders
void set_style(orcus::spreadsheet::border_direction_t dir, orcus::spreadsheet::border_style_t style) override
Definition: interface.cxx:1857
ScOrcusImportBorderStyle(std::vector< ScOrcusBorder > &rBorders)
Definition: interface.cxx:1852
void set_width(orcus::spreadsheet::border_direction_t dir, double width, orcus::length_unit_t unit) override
Definition: interface.cxx:1939
std::size_t commit() override
Definition: interface.cxx:1945
ScOrcusProtection maCurrentProtection
void set_formula_hidden(bool b) override
Definition: interface.cxx:1978
std::size_t commit() override
Definition: interface.cxx:1983
std::vector< ScOrcusProtection > & mrProtections
void set_hidden(bool b) override
Definition: interface.cxx:1963
ScOrcusImportCellProtection(std::vector< ScOrcusProtection > &rProtections)
Definition: interface.cxx:1953
void set_print_content(bool b) override
Definition: interface.cxx:1973
void set_locked(bool b) override
Definition: interface.cxx:1968
ScOrcusImportFillStyle(std::vector< ScOrcusFill > &rFills)
Definition: interface.cxx:1817
std::size_t commit() override
Definition: interface.cxx:1844
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
Definition: interface.cxx:1832
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
Definition: interface.cxx:1838
void set_pattern_type(orcus::spreadsheet::fill_pattern_t fp) override
Definition: interface.cxx:1827
void set_underline_type(orcus::spreadsheet::underline_type_t e) override
Definition: interface.cxx:1713
void set_italic_asian(bool b) override
Definition: interface.cxx:1589
void set_italic_complex(bool b) override
Definition: interface.cxx:1594
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
Definition: interface.cxx:1737
void set_name_complex(std::string_view s) override
Definition: interface.cxx:1611
void set_name(std::string_view s) override
Definition: interface.cxx:1599
void set_size_complex(double point) override
Definition: interface.cxx:1627
void set_strikethrough_type(orcus::spreadsheet::strikethrough_type_t s) override
Definition: interface.cxx:1753
void set_underline_mode(orcus::spreadsheet::underline_mode_t e) override
Definition: interface.cxx:1709
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
Definition: interface.cxx:1743
void set_size(double point) override
Definition: interface.cxx:1617
void set_strikethrough_text(orcus::spreadsheet::strikethrough_text_t s) override
Definition: interface.cxx:1794
void set_strikethrough_width(orcus::spreadsheet::strikethrough_width_t s) override
Definition: interface.cxx:1782
void set_size_asian(double point) override
Definition: interface.cxx:1622
ScOrcusImportFontStyle(ScOrcusFactory &rFactory, std::vector< ScOrcusFont > &rFonts)
Definition: interface.cxx:1558
std::vector< ScOrcusFont > & mrFonts
void set_strikethrough_style(orcus::spreadsheet::strikethrough_style_t s) override
Definition: interface.cxx:1749
void set_name_asian(std::string_view s) override
Definition: interface.cxx:1605
void set_underline_width(orcus::spreadsheet::underline_width_t e) override
Definition: interface.cxx:1670
void set_bold(bool b) override
Definition: interface.cxx:1569
std::size_t commit() override
Definition: interface.cxx:1809
void set_bold_complex(bool b) override
Definition: interface.cxx:1579
void set_italic(bool b) override
Definition: interface.cxx:1584
void set_bold_asian(bool b) override
Definition: interface.cxx:1574
void set_underline(orcus::spreadsheet::underline_t e) override
Definition: interface.cxx:1632
ScOrcusFactory & mrFactory
void set_identifier(std::size_t id) override
Definition: interface.cxx:2001
ScOrcusImportNumberFormat(ScOrcusFactory &rFactory, std::vector< ScOrcusNumberFormat > &rFormats)
Definition: interface.cxx:1991
ScOrcusNumberFormat maCurrentFormat
void set_code(std::string_view s) override
Definition: interface.cxx:2005
std::size_t commit() override
Definition: interface.cxx:2011
std::vector< ScOrcusNumberFormat > & mrNumberFormats
void set_protection(std::size_t index) override
Definition: interface.cxx:2107
void set_apply_alignment(bool b) override
Definition: interface.cxx:2122
std::vector< ScOrcusXf > * mpXfs
void set_horizontal_alignment(orcus::spreadsheet::hor_alignment_t align) override
Definition: interface.cxx:2127
void set_vertical_alignment(orcus::spreadsheet::ver_alignment_t align) override
Definition: interface.cxx:2156
void set_number_format(std::size_t index) override
Definition: interface.cxx:2112
void set_wrap_text(bool b) override
Definition: interface.cxx:2185
void reset(std::vector< ScOrcusXf > &rXfs)
Definition: interface.cxx:2086
void set_style_xf(std::size_t index) override
Definition: interface.cxx:2117
std::size_t commit() override
Definition: interface.cxx:2195
void set_border(std::size_t index) override
Definition: interface.cxx:2102
void set_font(std::size_t index) override
Definition: interface.cxx:2092
void set_fill(std::size_t index) override
Definition: interface.cxx:2097
void set_shrink_to_fit(bool b) override
Definition: interface.cxx:2190
virtual void set_base_position(const orcus::spreadsheet::src_address_t &pos) override
Definition: interface.cxx:235
const ScOrcusGlobalSettings & mrGlobalSettings
virtual void set_named_range(std::string_view name, std::string_view range) override
Definition: interface.cxx:248
ScDocumentImport & mrDoc
virtual void set_named_expression(std::string_view name, std::string_view expression) override
Definition: interface.cxx:242
ScOrcusNamedExpression(ScDocumentImport &rDoc, const ScOrcusGlobalSettings &rGS, SCTAB nTab=-1)
Definition: interface.cxx:222
virtual void commit() override
Definition: interface.cxx:253
const ScOrcusGlobalSettings & mrGlobalSettings
orcus::spreadsheet::src_range_t resolve_range(std::string_view range) override
Definition: interface.cxx:195
orcus::spreadsheet::src_address_t resolve_address(std::string_view address) override
Definition: interface.cxx:171
ScOrcusRefResolver(const ScOrcusGlobalSettings &rGS)
Definition: interface.cxx:168
virtual void append_segment(std::string_view s) override
Definition: interface.cxx:1339
virtual size_t append(std::string_view s) override
Definition: interface.cxx:1300
virtual void set_segment_italic(bool b) override
Definition: interface.cxx:1320
virtual size_t add(std::string_view s) override
Definition: interface.cxx:1306
OStringBuffer maCurSegment
virtual void set_segment_bold(bool b) override
Definition: interface.cxx:1316
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
Definition: interface.cxx:1332
ScOrcusFactory & mrFactory
virtual void set_segment_font_size(double point) override
Definition: interface.cxx:1328
virtual size_t commit_segments() override
Definition: interface.cxx:1344
ScOrcusSharedStrings(ScOrcusFactory &rFactory)
Definition: interface.cxx:1297
virtual void set_segment_font(size_t font_index) override
Definition: interface.cxx:1312
virtual void set_segment_font_name(std::string_view s) override
Definition: interface.cxx:1324
virtual void set_column_hidden(orcus::spreadsheet::col_t col, orcus::spreadsheet::col_t col_span, bool hidden) override
Definition: interface.cxx:757
virtual void set_column_width(orcus::spreadsheet::col_t col, orcus::spreadsheet::col_t col_span, double width, orcus::length_unit_t unit) override
Definition: interface.cxx:749
virtual void set_merge_cell_range(const orcus::spreadsheet::range_t &range) override
Definition: interface.cxx:775
virtual void set_row_hidden(orcus::spreadsheet::row_t row, bool hidden) override
Definition: interface.cxx:769
virtual ~ScOrcusSheetProperties() override
Definition: interface.cxx:718
virtual void set_row_height(orcus::spreadsheet::row_t row, double height, orcus::length_unit_t unit) override
Definition: interface.cxx:763
ScOrcusSheetProperties(SCTAB nTab, ScDocumentImport &rDoc)
Definition: interface.cxx:712
ScDocumentImport & mrDoc
virtual orcus::spreadsheet::iface::import_formula * get_formula() override
Definition: interface.cxx:1170
virtual orcus::spreadsheet::iface::import_conditional_format * get_conditional_format() override
Definition: interface.cxx:1160
virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override
Definition: interface.cxx:1201
ScOrcusSheetProperties maProperties
ScOrcusFactory & mrFactory
void cellInserted()
Definition: interface.cxx:1130
ScDocumentImport & mrDoc
virtual void set_row_format(orcus::spreadsheet::row_t row, std::size_t xf_index) override
Definition: interface.cxx:1258
ScOrcusConditionalFormat maConditionalFormat
SCTAB getIndex() const
virtual void fill_down_cells(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::row_t range_size) override
Definition: interface.cxx:1276
ScOrcusArrayFormula maArrayFormula
ScOrcusFactory & getFactory()
Definition: interface.cxx:1292
virtual orcus::spreadsheet::iface::import_sheet_properties * get_sheet_properties() override
Definition: interface.cxx:1155
virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override
Definition: interface.cxx:1195
virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override
Definition: interface.cxx:1182
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
Definition: interface.cxx:1207
virtual orcus::spreadsheet::iface::import_table * get_table() override
Definition: interface.cxx:1150
virtual orcus::spreadsheet::iface::import_array_formula * get_array_formula() override
Definition: interface.cxx:1176
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
Definition: interface.cxx:1282
virtual orcus::spreadsheet::iface::import_auto_filter * get_auto_filter() override
Definition: interface.cxx:1145
virtual orcus::spreadsheet::iface::import_named_expression * get_named_expression() override
Definition: interface.cxx:1165
virtual orcus::spreadsheet::range_size_t get_sheet_size() const override
Definition: interface.cxx:1267
ScOrcusNamedExpression maNamedExpressions
ScOrcusFormula maFormula
ScOrcusSheet(ScDocumentImport &rDoc, SCTAB nTab, ScOrcusFactory &rFactory)
Definition: interface.cxx:933
ScDocumentImport & getDoc()
Definition: interface.cxx:1140
virtual void set_column_format(orcus::spreadsheet::col_t col, orcus::spreadsheet::col_t col_span, std::size_t xf_index) override
Definition: interface.cxx:1248
virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::string_id_t sindex) override
Definition: interface.cxx:1189
ScOrcusStyles & mrStyles
virtual orcus::spreadsheet::iface::import_fill_style * start_fill_style() override
Definition: interface.cxx:2307
std::vector< ScOrcusFont > maFonts
std::vector< ScOrcusBorder > maBorders
std::vector< ScOrcusXf > maCellXfs
ScOrcusImportBorderStyle maBorderStyle
void applyXfToItemSet(SfxItemSet &rSet, const ScOrcusXf &rXf)
Definition: interface.cxx:2228
std::vector< ScOrcusNumberFormat > maNumberFormats
virtual void set_border_count(size_t n) override
Definition: interface.cxx:2366
virtual orcus::spreadsheet::iface::import_number_format * start_number_format() override
Definition: interface.cxx:2325
ScOrcusImportCellProtection maCellProtection
ScOrcusStyles(ScOrcusFactory &rFactory, bool bSkipDefaultStyles=false)
Definition: interface.cxx:2202
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
Definition: interface.cxx:2378
virtual orcus::spreadsheet::iface::import_cell_style * start_cell_style() override
Definition: interface.cxx:2352
virtual orcus::spreadsheet::iface::import_cell_protection * start_cell_protection() override
Definition: interface.cxx:2319
ScOrcusImportNumberFormat maNumberFormat
ScOrucsImportCellStyle maCellStyle
std::vector< ScOrcusProtection > maProtections
virtual orcus::spreadsheet::iface::import_font_style * start_font_style() override
Definition: interface.cxx:2301
virtual orcus::spreadsheet::iface::import_xf * start_xf(orcus::spreadsheet::xf_category_t cat) override
Definition: interface.cxx:2331
virtual orcus::spreadsheet::iface::import_border_style * start_border_style() override
Definition: interface.cxx:2313
virtual void set_xf_count(orcus::spreadsheet::xf_category_t cat, size_t n) override
Definition: interface.cxx:2374
ScOrcusImportXf maXf
virtual void set_number_format_count(size_t n) override
Definition: interface.cxx:2370
virtual void set_fill_count(size_t n) override
Definition: interface.cxx:2362
virtual void set_font_count(size_t n) override
Definition: interface.cxx:2358
ScOrucsImportCellStyle(ScOrcusFactory &rFactory, ScOrcusStyles &rStyles, const std::vector< ScOrcusXf > &rXfs)
Definition: interface.cxx:2019
void set_display_name(std::string_view s) override
Definition: interface.cxx:2038
void commit() override
Definition: interface.cxx:2060
ScOrcusFactory & mrFactory
ScOrcusCellStyle maCurrentStyle
void set_builtin(std::size_t index) override
Definition: interface.cxx:2049
void set_name(std::string_view s) override
Definition: interface.cxx:2032
ScOrcusStyles & mrStyles
void set_xf(std::size_t index) override
Definition: interface.cxx:2044
const std::vector< ScOrcusXf > & mrXfs
void set_parent_name(std::string_view s) override
Definition: interface.cxx:2054
SfxItemSet & GetItemSet()
Definition: patattr.hxx:192
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
Definition: rangenam.cxx:802
ScAddress aEnd
Definition: address.hxx:498
bool IsValid() const
Definition: address.hxx:544
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)
Definition: address.cxx:1700
ScAddress aStart
Definition: address.hxx:497
static SC_DLLPUBLIC OUString ProgrammaticToDisplayName(const OUString &rProgName, SfxStyleFamily nType)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All) override
Definition: stlpool.cxx:72
void CreateStandardStyles()
Definition: stlpool.cxx:243
bool HasStandardStyles() const
Definition: stlpool.hxx:53
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual bool SetParent(const OUString &)
virtual SfxItemSet & GetItemSet()
bool PutEntry(OUString &rString, sal_Int32 &nCheckPos, SvNumFormatType &nType, sal_uInt32 &nKey, LanguageType eLnge=LANGUAGE_DONTKNOW, bool bReplaceBooleanEquivalent=true)
const Date & GetNullDate() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
void SetLine(const editeng::SvxBorderLine *pNew)
void SetColor(const Color &rColor)
static AddressConvention extractRefConvention(const Grammar eGrammar)
void set(size_t nSharedId, std::unique_ptr< ScTokenArray > pArray)
const ScTokenArray * get(size_t nSharedId) const
SharedString intern(const OUString &rStr)
sal_uInt16 GetSec() const
static const sal_Int64 nanoSecPerSec
sal_uInt16 GetMin() const
static const sal_Int64 secondPerMinute
sal_uInt16 GetHour() const
sal_uInt32 GetNanoSec() const
static const sal_Int64 secondPerHour
ColorAlpha
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
sal_Int32 mnRow
sal_Int32 mnCol
DocumentType eType
LINESTYLE_BOLDDASHDOT
LINESTYLE_BOLDDASHDOTDOT
LINESTYLE_SINGLE
LINESTYLE_BOLDLONGDASH
LINESTYLE_BOLDWAVE
LINESTYLE_DASHDOTDOT
LINESTYLE_BOLDDASH
LINESTYLE_BOLDDOTTED
LINESTYLE_DOUBLEWAVE
LINESTYLE_DOUBLE
LINESTYLE_NONE
LINESTYLE_DASH
LINESTYLE_DASHDOT
LINESTYLE_DOTTED
LINESTYLE_WAVE
LINESTYLE_LONGDASH
LINESTYLE_BOLD
STRIKEOUT_BOLD
STRIKEOUT_DOUBLE
STRIKEOUT_SINGLE
STRIKEOUT_X
STRIKEOUT_SLASH
STRIKEOUT_NONE
STRIKEOUT_DONTKNOW
PITCH_DONTKNOW
FontItalic
ITALIC_NORMAL
ITALIC_NONE
FAMILY_DONTKNOW
WEIGHT_BOLD
WEIGHT_NORMAL
#define DATE_TIME_FACTOR
Definition: globalnames.hxx:21
const char * name
sal_Int32 nIndex
OUString aName
#define LANGUAGE_ENGLISH_US
sal_uInt16 nPos
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
aStr
RttiCompleteObjectLocator col
SvGenericNameContainerMapImpl maProperties
def point()
Type
constexpr double alpha[nDetails]
index
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
FontWeight
long Long
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
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)
static SfxItemSet & rSet
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
Definition: interface.cxx:1444
std::size_t mnBuiltInId
CellStoreToken(const ScAddress &rPos, Type eType)
Definition: interface.cxx:268
formula::FormulaGrammar::Grammar meGrammar
void applyToItemSet(SfxItemSet &rSet) const
Definition: interface.cxx:1435
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
Definition: interface.cxx:1351
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
void applyToItemSet(SfxItemSet &rSet, const ScDocument &rDoc) const
Definition: interface.cxx:1518
std::optional< OUString > maCode
std::optional< bool > mbLocked
void applyToItemSet(SfxItemSet &rSet) const
Definition: interface.cxx:1506
std::optional< bool > mbPrintContent
std::optional< bool > mbFormulaHidden
std::optional< bool > mbHidden
std::size_t mnStyleXf
bool mbApplyAlignment
std::size_t mnBorderId
SvxCellVerJustify meVerAlignment
std::size_t mnFontId
SvxCellJustifyMethod meVerAlignMethod
std::size_t mnNumberFormatId
std::size_t mnProtectionId
std::optional< bool > mbShrinkToFit
SvxCellHorJustify meHorAlignment
std::optional< bool > mbWrapText
std::size_t mnFillId
SvxCellJustifyMethod meHorAlignMethod
constexpr OUStringLiteral SC_STYLE_PROG_STANDARD
Definition: stylehelper.hxx:30
SvxCellJustifyMethod
SvxCellHorJustify
SvxCellVerJustify
sal_Int16 SCTAB
Definition: types.hxx:22
ResultType type
size_t pos
RedlineType meType
SvNumFormatType