LibreOffice Module sc (master) 1
orcusinterface.hxx
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#pragma once
11
12#include <address.hxx>
13#include <documentimport.hxx>
14
15#include <tools/color.hxx>
16#include <tools/fontenum.hxx>
17#include <editeng/svxenum.hxx>
18
20
21#include <conditio.hxx>
22
23#include <rtl/strbuf.hxx>
25
26#include <orcus/spreadsheet/import_interface.hpp>
27
28#include <memory>
29#include <map>
30#include <unordered_map>
31#include <vector>
32
33class ScOrcusSheet;
34class ScOrcusStyles;
35class ScOrcusFactory;
36class SfxItemSet;
37namespace com::sun::star::task { class XStatusIndicator; }
38
39class ScOrcusGlobalSettings : public orcus::spreadsheet::iface::import_global_settings
40{
43 orcus::spreadsheet::formula_grammar_t meOrcusGrammar;
44 rtl_TextEncoding mnTextEncoding;
45
46public:
48
49 virtual void set_origin_date(int year, int month, int day) override;
50 virtual void set_character_set(orcus::character_set_t cs) override;
51
52 virtual void set_default_formula_grammar(orcus::spreadsheet::formula_grammar_t grammar) override;
53 virtual orcus::spreadsheet::formula_grammar_t get_default_formula_grammar() const override;
54
56 {
57 return meCalcGrammar;
58 }
59
60 rtl_TextEncoding getTextEncoding() const
61 {
62 return mnTextEncoding;
63 }
64
66 {
67 return mrDoc;
68 }
69};
70
71class ScOrcusRefResolver : public orcus::spreadsheet::iface::import_reference_resolver
72{
74
75public:
77
78 orcus::spreadsheet::src_address_t resolve_address(std::string_view address) override;
79 orcus::spreadsheet::src_range_t resolve_range(std::string_view range) override;
80};
81
82class ScOrcusNamedExpression : public orcus::spreadsheet::iface::import_named_expression
83{
87 OUString maName;
88 OUString maExpr;
89 const SCTAB mnTab; //< negative if global, else >= 0 for sheet-local named expressions.
90
91public:
93
94 void reset();
95
96 virtual void set_base_position(const orcus::spreadsheet::src_address_t& pos) override;
97 virtual void set_named_expression(std::string_view name, std::string_view expression) override;
98 virtual void set_named_range(std::string_view name, std::string_view range) override;
99 virtual void commit() override;
100};
101
102class ScOrcusSharedStrings : public orcus::spreadsheet::iface::import_shared_strings
103{
105
106 OStringBuffer maCurSegment;
107public:
109
110 virtual size_t append(std::string_view s) override;
111 virtual size_t add(std::string_view s) override;
112
113 virtual void set_segment_bold(bool b) override;
114 virtual void set_segment_italic(bool b) override;
115 virtual void set_segment_font(size_t font_index) override;
116 virtual void set_segment_font_name(std::string_view s) override;
117 virtual void set_segment_font_size(double point) override;
118 virtual void set_segment_font_color(orcus::spreadsheet::color_elem_t alpha,
119 orcus::spreadsheet::color_elem_t red,
120 orcus::spreadsheet::color_elem_t green,
121 orcus::spreadsheet::color_elem_t blue) override;
122 virtual void append_segment(std::string_view s) override;
123
124 virtual size_t commit_segments() override;
125};
126
127class ScOrcusConditionalFormat : public orcus::spreadsheet::iface::import_conditional_format
128{
129public:
131 virtual ~ScOrcusConditionalFormat() override;
132
133 virtual void set_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red,
134 orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override;
135
136 virtual void set_formula(std::string_view formula) override;
137
138 virtual void set_condition_type(orcus::spreadsheet::condition_type_t type) override;
139
140 virtual void set_date(orcus::spreadsheet::condition_date_t date) override;
141
142 virtual void commit_condition() override;
143
144 virtual void set_icon_name(std::string_view name) override;
145
146 virtual void set_databar_gradient(bool gradient) override;
147
148 virtual void set_databar_axis(orcus::spreadsheet::databar_axis_t axis) override;
149
150 virtual void set_databar_color_positive(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red,
151 orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override;
152
153 virtual void set_databar_color_negative(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red,
154 orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue) override;
155
156 virtual void set_min_databar_length(double length) override;
157
158 virtual void set_max_databar_length(double length) override;
159
160 virtual void set_show_value(bool show) override;
161
162 virtual void set_iconset_reverse(bool reverse) override;
163
164 virtual void set_xf_id(size_t xf) override;
165
166 virtual void set_operator(orcus::spreadsheet::condition_operator_t condition_type) override;
167
168 virtual void set_type(orcus::spreadsheet::conditional_format_t type) override;
169
170 virtual void commit_entry() override;
171
172 virtual void set_range(std::string_view range) override;
173
174 virtual void set_range(orcus::spreadsheet::row_t row_start, orcus::spreadsheet::col_t col_start,
175 orcus::spreadsheet::row_t row_end, orcus::spreadsheet::col_t col_end) override;
176
177 virtual void commit_format() override;
178
179private:
180
183
184 std::unique_ptr<ScConditionalFormat> mpCurrentFormat;
185
187};
188
189class ScOrcusAutoFilter : public orcus::spreadsheet::iface::import_auto_filter
190{
191public:
193
194 virtual ~ScOrcusAutoFilter() override;
195
196 virtual void set_range(const orcus::spreadsheet::range_t& range) override;
197
198 virtual void set_column(orcus::spreadsheet::col_t col) override;
199
200 virtual void append_column_match_value(std::string_view value) override;
201
202 virtual void commit_column() override;
203
204 virtual void commit() override;
205
206private:
209};
210
211class ScOrcusSheetProperties : public orcus::spreadsheet::iface::import_sheet_properties
212{
215public:
217 virtual ~ScOrcusSheetProperties() override;
218
219 virtual void set_column_width(orcus::spreadsheet::col_t col, double width, orcus::length_unit_t unit) override;
220
221 virtual void set_column_hidden(orcus::spreadsheet::col_t col, bool hidden) override;
222
223 virtual void set_row_height(orcus::spreadsheet::row_t row, double height, orcus::length_unit_t unit) override;
224
225 virtual void set_row_hidden(orcus::spreadsheet::row_t row, bool hidden) override;
226
227 virtual void set_merge_cell_range(const orcus::spreadsheet::range_t& range) override;
228};
229
230class ScOrcusFormula : public orcus::spreadsheet::iface::import_formula
231{
232 enum class ResultType { NotSet, String, Value, Empty };
233
234 friend class ScOrcusSheet;
235
237
240 OUString maFormula;
244
246 OUString maResult; // result string.
247 double mfResult;
248
249 void reset();
250
251public:
252 ScOrcusFormula( ScOrcusSheet& rSheet );
253 virtual ~ScOrcusFormula() override;
254
255 virtual void set_position(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col) override;
256 virtual void set_formula(orcus::spreadsheet::formula_grammar_t grammar, std::string_view formula) override;
257 virtual void set_shared_formula_index(size_t index) override;
258 virtual void set_result_value(double value) override;
259 virtual void set_result_string(std::string_view value) override;
260 virtual void set_result_empty() override;
261 virtual void set_result_bool(bool value) override;
262 virtual void commit() override;
263};
264
265class ScOrcusArrayFormula : public orcus::spreadsheet::iface::import_array_formula
266{
267 friend class ScOrcusSheet;
268
270
273 uint32_t mnColRange;
274 uint32_t mnRowRange;
275 OUString maFormula;
277
278 void reset();
279
280public:
282 virtual ~ScOrcusArrayFormula() override;
283
284 virtual void set_range(const orcus::spreadsheet::range_t& range) override;
285 virtual void set_formula(orcus::spreadsheet::formula_grammar_t grammar, std::string_view formula) override;
286 virtual void set_result_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override;
287 virtual void set_result_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override;
288 virtual void set_result_empty(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col) override;
289 virtual void set_result_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override;
290 virtual void commit() override;
291};
292
293class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet
294{
295 friend class ScOrcusFormula;
297
303
310
312
313 void cellInserted();
314
316
317public:
318 ScOrcusSheet(ScDocumentImport& rDoc, SCTAB nTab, ScOrcusFactory& rFactory);
319
320 virtual orcus::spreadsheet::iface::import_auto_filter* get_auto_filter() override;
321 virtual orcus::spreadsheet::iface::import_table* get_table() override;
322 virtual orcus::spreadsheet::iface::import_sheet_properties* get_sheet_properties() override;
323 virtual orcus::spreadsheet::iface::import_conditional_format* get_conditional_format() override;
324 virtual orcus::spreadsheet::iface::import_named_expression* get_named_expression() override;
325 virtual orcus::spreadsheet::iface::import_formula* get_formula() override;
326 virtual orcus::spreadsheet::iface::import_array_formula* get_array_formula() override;
327
328 // Orcus import interface
329 virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override;
330 virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::string_id_t sindex) override;
331 virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override;
332 virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override;
333 virtual void set_date_time(
334 orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, int year, int month, int day, int hour, int minute, double second) override;
335
336 virtual void set_format(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t xf_index) override;
337 virtual void set_format(orcus::spreadsheet::row_t row_start, orcus::spreadsheet::col_t col_start,
338 orcus::spreadsheet::row_t row_end, orcus::spreadsheet::col_t col_end, size_t xf_index) override;
339
340 virtual orcus::spreadsheet::range_size_t get_sheet_size() const override;
341
342 virtual void fill_down_cells(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::row_t range_size) override;
343
344 SCTAB getIndex() const { return mnTab; }
345
349};
350
351class ScOrcusStyles : public orcus::spreadsheet::iface::import_styles
352{
353private:
355
356 struct font
357 {
358 std::optional<OUString> maName;
359 std::optional<double> mnSize;
360 std::optional<Color> maColor;
361 std::optional<bool> mbBold;
362 std::optional<bool> mbItalic;
363 std::optional<FontLineStyle> meUnderline;
364 std::optional<Color> maUnderlineColor;
365 std::optional<FontStrikeout> meStrikeout;
366
367 void applyToItemSet(SfxItemSet& rSet) const;
368 };
369
371 std::vector<font> maFonts;
372
373 struct fill
374 {
375 std::optional<orcus::spreadsheet::fill_pattern_t> mePattern;
376 std::optional<Color> maFgColor;
377 std::optional<Color> maBgColor; // currently not used.
378
379 void applyToItemSet(SfxItemSet& rSet) const;
380 };
381
383 std::vector<fill> maFills;
384
385 struct border
386 {
388 {
389 std::optional<SvxBorderLineStyle> meStyle;
390 std::optional<Color> maColor;
391 std::optional<double> mnWidth;
392 };
393
394 std::map<orcus::spreadsheet::border_direction_t, border_line> maBorders;
395
396 void applyToItemSet(SfxItemSet& rSet) const;
397 };
398
400 std::vector<border> maBorders;
401
403 {
404 std::optional<bool> mbLocked;
405 std::optional<bool> mbHidden;
406 std::optional<bool> mbPrintContent;
407 std::optional<bool> mbFormulaHidden;
408
409 void applyToItemSet(SfxItemSet& rSet) const;
410 };
411
413 std::vector<protection> maProtections;
414
416 {
417 std::optional<OUString> maCode;
418
419 void applyToItemSet(SfxItemSet& rSet, const ScDocument& rDoc) const;
420 };
421
423 std::vector<number_format> maNumberFormats;
424
425 struct xf
426 {
427 size_t mnFontId;
428 size_t mnFillId;
432 size_t mnStyleXf;
434
439
440 xf();
441 };
442
444 std::vector<xf> maCellStyleXfs;
445 std::vector<xf> maCellXfs;
446
448 {
449 OUString maName;
450 OUString maParentName;
451 size_t mnXFId;
453
454 cell_style();
455 };
456
458
459 void applyXfToItemSet(SfxItemSet& rSet, const xf& rXf);
460
461public:
462 ScOrcusStyles( ScOrcusFactory& rFactory, bool bSkipDefaultStyles=false );
463
464 void applyXfToItemSet(SfxItemSet& rSet, size_t xfId);
465
466 // font
467
468 virtual void set_font_count(size_t n) override;
469 virtual void set_font_bold(bool b) override;
470 virtual void set_font_italic(bool b) override;
471 virtual void set_font_name(std::string_view name) override;
472 virtual void set_font_size(double point) override;
473 virtual void set_font_underline(orcus::spreadsheet::underline_t e) override;
474 virtual void set_font_underline_width(orcus::spreadsheet::underline_width_t e) override;
475 virtual void set_font_underline_mode(orcus::spreadsheet::underline_mode_t e) override;
476 virtual void set_font_underline_type(orcus::spreadsheet::underline_type_t e) override;
477 virtual void set_font_underline_color(orcus::spreadsheet::color_elem_t alpha,
478 orcus::spreadsheet::color_elem_t red,
479 orcus::spreadsheet::color_elem_t green,
480 orcus::spreadsheet::color_elem_t blue) override;
481 virtual void set_font_color( orcus::spreadsheet::color_elem_t alpha,
482 orcus::spreadsheet::color_elem_t red,
483 orcus::spreadsheet::color_elem_t green,
484 orcus::spreadsheet::color_elem_t blue) override;
485 virtual void set_strikethrough_style(orcus::spreadsheet::strikethrough_style_t s) override;
486 virtual void set_strikethrough_type(orcus::spreadsheet::strikethrough_type_t s) override;
487 virtual void set_strikethrough_width(orcus::spreadsheet::strikethrough_width_t s) override;
488 virtual void set_strikethrough_text(orcus::spreadsheet::strikethrough_text_t s) override;
489 virtual size_t commit_font() override;
490
491 // fill
492
493 virtual void set_fill_count(size_t n) override;
494 virtual void set_fill_pattern_type(orcus::spreadsheet::fill_pattern_t fp) override;
495 virtual void set_fill_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;
496 virtual void set_fill_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;
497 virtual size_t commit_fill() override;
498
499 // border
500
501 virtual void set_border_count(size_t n) override;
502
503 virtual void set_border_style(orcus::spreadsheet::border_direction_t dir, orcus::spreadsheet::border_style_t style) override;
504 virtual void set_border_color(orcus::spreadsheet::border_direction_t dir,
505 orcus::spreadsheet::color_elem_t alpha,
506 orcus::spreadsheet::color_elem_t red,
507 orcus::spreadsheet::color_elem_t green,
508 orcus::spreadsheet::color_elem_t blue) override;
509 virtual void set_border_width(orcus::spreadsheet::border_direction_t dir, double val, orcus::length_unit_t unit) override;
510 virtual size_t commit_border() override;
511
512 // cell protection
513 virtual void set_cell_hidden(bool b) override;
514 virtual void set_cell_locked(bool b) override;
515 virtual void set_cell_print_content(bool b) override;
516 virtual void set_cell_formula_hidden(bool b) override;
517 virtual size_t commit_cell_protection() override;
518
519 // number format
520 virtual void set_number_format_count(size_t n) override;
521 virtual void set_number_format_identifier(size_t n) override;
522 virtual void set_number_format_code(std::string_view s) override;
523 virtual size_t commit_number_format() override;
524
525 // cell style xf
526
527 virtual void set_cell_style_xf_count(size_t n) override;
528 virtual size_t commit_cell_style_xf() override;
529
530 // cell xf
531
532 virtual void set_cell_xf_count(size_t n) override;
533 virtual size_t commit_cell_xf() override;
534
535 // dxf
536 virtual void set_dxf_count(size_t count) override;
537 virtual size_t commit_dxf() override;
538
539 // xf (cell format) - used both by cell xf and cell style xf.
540
541 virtual void set_xf_number_format(size_t index) override;
542 virtual void set_xf_font(size_t index) override;
543 virtual void set_xf_fill(size_t index) override;
544 virtual void set_xf_border(size_t index) override;
545 virtual void set_xf_protection(size_t index) override;
546 virtual void set_xf_style_xf(size_t index) override;
547 virtual void set_xf_apply_alignment(bool b) override;
548 virtual void set_xf_horizontal_alignment(orcus::spreadsheet::hor_alignment_t align) override;
549 virtual void set_xf_vertical_alignment(orcus::spreadsheet::ver_alignment_t align) override;
550
551 // cell style entry
552
553 virtual void set_cell_style_count(size_t n) override;
554 virtual void set_cell_style_name(std::string_view name) override;
555 virtual void set_cell_style_xf(size_t index) override;
556 virtual void set_cell_style_builtin(size_t index) override;
557 virtual void set_cell_style_parent_name(std::string_view name) override;
558 virtual size_t commit_cell_style() override;
559};
560
561class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory
562{
564 {
565 enum class Type : sal_uInt8
566 {
567 Auto,
568 Numeric,
569 String,
570 Formula,
571 FormulaWithResult,
572 SharedFormula,
573 SharedFormulaWithResult,
574 Matrix,
575 FillDownCells
576 };
577
578
579 OUString maStr1;
580 OUString maStr2;
581 double mfValue;
582
585
586 uint32_t mnIndex1;
587 uint32_t mnIndex2;
589
590 CellStoreToken( const ScAddress& rPos, Type eType );
591 CellStoreToken( const ScAddress& rPos, double fValue );
592 CellStoreToken( const ScAddress& rPos, uint32_t nIndex );
593 CellStoreToken( const ScAddress& rPos, OUString aFormula, formula::FormulaGrammar::Grammar eGrammar );
594 };
595
596 typedef std::unordered_map<OUString, size_t> StringHashType;
597 typedef std::vector<CellStoreToken> CellStoreTokensType;
598
600
601 std::vector<OUString> maStrings;
603
608 std::vector<std::unique_ptr<ScOrcusSheet>> maSheets;
610
612
613 css::uno::Reference<css::task::XStatusIndicator> mxStatusIndicator;
614
615public:
616 ScOrcusFactory(ScDocument& rDoc, bool bSkipDefaultStyles=false);
617
618 virtual orcus::spreadsheet::iface::import_sheet* append_sheet(
619 orcus::spreadsheet::sheet_t sheet_index, std::string_view sheet_name) override;
620 virtual orcus::spreadsheet::iface::import_sheet* get_sheet(std::string_view sheet_name) override;
621 virtual orcus::spreadsheet::iface::import_sheet* get_sheet(orcus::spreadsheet::sheet_t sheet_index) override;
622 virtual orcus::spreadsheet::iface::import_global_settings* get_global_settings() override;
623 virtual orcus::spreadsheet::iface::import_shared_strings* get_shared_strings() override;
624 virtual orcus::spreadsheet::iface::import_named_expression* get_named_expression() override;
625 virtual orcus::spreadsheet::iface::import_styles* get_styles() override;
626 virtual void finalize() override;
627
629
630 size_t appendString(const OUString& rStr);
631 size_t addString(const OUString& rStr);
632 const OUString* getString(size_t nIndex) const;
633
634 void pushCellStoreAutoToken( const ScAddress& rPos, const OUString& rVal );
635 void pushCellStoreToken( const ScAddress& rPos, uint32_t nStrIndex );
636 void pushCellStoreToken( const ScAddress& rPos, double fValue );
638 const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar );
639 void pushFillDownCellsToken( const ScAddress& rPos, uint32_t nFillSize );
640
641 void pushSharedFormulaToken( const ScAddress& rPos, uint32_t nIndex );
643 const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar,
644 uint32_t nRowRange, uint32_t nColRange );
645
646 void pushFormulaResult( const ScAddress& rPos, double fValue );
647 void pushFormulaResult( const ScAddress& rPos, const OUString& rValue );
648
649 void incrementProgress();
650
651 void setStatusIndicator(const css::uno::Reference<css::task::XStatusIndicator>& rIndicator);
652
654};
655
656/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Accessor class to ScDocument.
virtual void set_formula(orcus::spreadsheet::formula_grammar_t grammar, std::string_view formula) override
Definition: interface.cxx:1075
virtual void set_range(const orcus::spreadsheet::range_t &range) override
Definition: interface.cxx:1066
ScOrcusArrayFormula(ScOrcusSheet &rSheet)
Definition: interface.cxx:1056
virtual void set_result_empty(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col) override
Definition: interface.cxx:1091
virtual void commit() override
Definition: interface.cxx:1101
ScOrcusSheet & mrSheet
virtual void set_result_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override
Definition: interface.cxx:1096
virtual void set_result_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override
Definition: interface.cxx:1086
virtual void set_result_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override
Definition: interface.cxx:1081
formula::FormulaGrammar::Grammar meGrammar
virtual ~ScOrcusArrayFormula() override
Definition: interface.cxx:1064
virtual void set_column(orcus::spreadsheet::col_t col) override
Definition: interface.cxx:2178
virtual void commit() override
Definition: interface.cxx:2194
const ScOrcusGlobalSettings & mrGlobalSettings
virtual void append_column_match_value(std::string_view value) override
Definition: interface.cxx:2183
ScOrcusAutoFilter(const ScOrcusGlobalSettings &rGS)
Definition: interface.cxx:2161
virtual void commit_column() override
Definition: interface.cxx:2189
virtual void set_range(const orcus::spreadsheet::range_t &range) override
Definition: interface.cxx:2170
virtual ~ScOrcusAutoFilter() override
Definition: interface.cxx:2166
virtual ~ScOrcusConditionalFormat() override
Definition: interface.cxx:766
virtual void commit_entry() override
Definition: interface.cxx:887
ScOrcusConditionalFormat(SCTAB nTab, ScDocument &rDoc)
Definition: interface.cxx:758
virtual void set_iconset_reverse(bool reverse) override
Definition: interface.cxx:847
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:816
virtual void set_show_value(bool show) override
Definition: interface.cxx:842
virtual void set_type(orcus::spreadsheet::conditional_format_t type) override
Definition: interface.cxx:863
virtual void set_xf_id(size_t xf) override
Definition: interface.cxx:853
virtual void set_range(orcus::spreadsheet::row_t row_start, orcus::spreadsheet::col_t col_start, orcus::spreadsheet::row_t row_end, orcus::spreadsheet::col_t col_end) override
virtual void set_databar_gradient(bool gradient) override
Definition: interface.cxx:804
virtual void commit_format() override
Definition: interface.cxx:905
virtual void set_operator(orcus::spreadsheet::condition_operator_t condition_type) override
Definition: interface.cxx:858
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:823
virtual void set_range(std::string_view range) override
Definition: interface.cxx:892
virtual void set_date(orcus::spreadsheet::condition_date_t date) override
Definition: interface.cxx:787
virtual void set_formula(std::string_view formula) override
Definition: interface.cxx:782
virtual void set_icon_name(std::string_view name) override
Definition: interface.cxx:798
virtual void commit_condition() override
Definition: interface.cxx:793
virtual void set_databar_axis(orcus::spreadsheet::databar_axis_t axis) override
Definition: interface.cxx:810
virtual void set_condition_type(orcus::spreadsheet::condition_type_t type) override
Definition: interface.cxx:776
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:770
virtual void set_min_databar_length(double length) override
Definition: interface.cxx:830
virtual void set_max_databar_length(double length) override
Definition: interface.cxx:836
ScOrcusGlobalSettings maGlobalSettings
void pushSharedFormulaToken(const ScAddress &rPos, uint32_t nIndex)
Definition: interface.cxx:593
virtual void finalize() override
Definition: interface.cxx:407
StringHashType maStringHash
virtual orcus::spreadsheet::iface::import_shared_strings * get_shared_strings() override
Definition: interface.cxx:392
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:599
virtual orcus::spreadsheet::iface::import_named_expression * get_named_expression() override
Definition: interface.cxx:397
std::vector< CellStoreToken > CellStoreTokensType
ScOrcusStyles maStyles
ScDocumentImport maDoc
void pushCellStoreToken(const ScAddress &rPos, uint32_t nStrIndex)
Definition: interface.cxx:571
size_t addString(const OUString &rStr)
Definition: interface.cxx:550
std::unordered_map< OUString, size_t > StringHashType
virtual orcus::spreadsheet::iface::import_global_settings * get_global_settings() override
Definition: interface.cxx:387
void pushFillDownCellsToken(const ScAddress &rPos, uint32_t nFillSize)
Definition: interface.cxx:587
void pushFormulaResult(const ScAddress &rPos, double fValue)
Definition: interface.cxx:611
const ScOrcusGlobalSettings & getGlobalSettings() const
Definition: interface.cxx:687
void setStatusIndicator(const css::uno::Reference< css::task::XStatusIndicator > &rIndicator)
Definition: interface.cxx:682
ScOrcusSharedStrings maSharedStrings
ScDocumentImport & getDoc()
Definition: interface.cxx:536
void incrementProgress()
Definition: interface.cxx:663
virtual orcus::spreadsheet::iface::import_styles * get_styles() override
Definition: interface.cxx:402
ScOrcusFactory(ScDocument &rDoc, bool bSkipDefaultStyles=false)
Definition: interface.cxx:305
std::vector< OUString > maStrings
size_t appendString(const OUString &rStr)
Definition: interface.cxx:541
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:313
CellStoreTokensType maCellStoreTokens
virtual orcus::spreadsheet::iface::import_sheet * get_sheet(std::string_view sheet_name) override
Definition: interface.cxx:350
void pushCellStoreAutoToken(const ScAddress &rPos, const OUString &rVal)
Definition: interface.cxx:565
const OUString * getString(size_t nIndex) const
Definition: interface.cxx:560
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
ScOrcusFormula(ScOrcusSheet &rSheet)
Definition: interface.cxx:939
virtual ~ScOrcusFormula() override
Definition: interface.cxx:949
virtual void set_result_value(double value) override
Definition: interface.cxx:969
virtual void set_formula(orcus::spreadsheet::formula_grammar_t grammar, std::string_view formula) override
Definition: interface.cxx:957
virtual void set_result_bool(bool value) override
Definition: interface.cxx:986
size_t mnSharedFormulaIndex
formula::FormulaGrammar::Grammar meGrammar
virtual void set_result_empty() override
Definition: interface.cxx:981
virtual void set_shared_formula_index(size_t index) override
Definition: interface.cxx:963
ResultType meResType
virtual void set_result_string(std::string_view value) override
Definition: interface.cxx:975
ScOrcusSheet & mrSheet
virtual void set_position(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col) override
Definition: interface.cxx:951
virtual void commit() override
Definition: interface.cxx:992
virtual void set_character_set(orcus::character_set_t cs) override
Definition: interface.cxx:100
orcus::spreadsheet::formula_grammar_t meOrcusGrammar
ScOrcusGlobalSettings(ScDocumentImport &rDoc)
Definition: interface.cxx:87
formula::FormulaGrammar::Grammar getCalcGrammar() const
ScDocumentImport & getDoc() const
virtual orcus::spreadsheet::formula_grammar_t get_default_formula_grammar() const override
Definition: interface.cxx:158
rtl_TextEncoding mnTextEncoding
virtual void set_default_formula_grammar(orcus::spreadsheet::formula_grammar_t grammar) override
Definition: interface.cxx:152
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:95
virtual void set_base_position(const orcus::spreadsheet::src_address_t &pos) override
Definition: interface.cxx:230
const ScOrcusGlobalSettings & mrGlobalSettings
virtual void set_named_range(std::string_view name, std::string_view range) override
Definition: interface.cxx:243
ScDocumentImport & mrDoc
virtual void set_named_expression(std::string_view name, std::string_view expression) override
Definition: interface.cxx:237
ScOrcusNamedExpression(ScDocumentImport &rDoc, const ScOrcusGlobalSettings &rGS, SCTAB nTab=-1)
Definition: interface.cxx:217
virtual void commit() override
Definition: interface.cxx:248
const ScOrcusGlobalSettings & mrGlobalSettings
orcus::spreadsheet::src_range_t resolve_range(std::string_view range) override
Definition: interface.cxx:190
orcus::spreadsheet::src_address_t resolve_address(std::string_view address) override
Definition: interface.cxx:166
ScOrcusRefResolver(const ScOrcusGlobalSettings &rGS)
Definition: interface.cxx:163
virtual void append_segment(std::string_view s) override
Definition: interface.cxx:1298
virtual size_t append(std::string_view s) override
Definition: interface.cxx:1259
virtual void set_segment_italic(bool b) override
Definition: interface.cxx:1279
virtual size_t add(std::string_view s) override
Definition: interface.cxx:1265
OStringBuffer maCurSegment
virtual void set_segment_bold(bool b) override
Definition: interface.cxx:1275
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:1291
ScOrcusFactory & mrFactory
virtual void set_segment_font_size(double point) override
Definition: interface.cxx:1287
virtual size_t commit_segments() override
Definition: interface.cxx:1303
ScOrcusSharedStrings(ScOrcusFactory &rFactory)
Definition: interface.cxx:1256
virtual void set_segment_font(size_t font_index) override
Definition: interface.cxx:1271
virtual void set_segment_font_name(std::string_view s) override
Definition: interface.cxx:1283
virtual void set_column_hidden(orcus::spreadsheet::col_t col, bool hidden) override
Definition: interface.cxx:735
virtual void set_merge_cell_range(const orcus::spreadsheet::range_t &range) override
Definition: interface.cxx:753
virtual void set_column_width(orcus::spreadsheet::col_t col, double width, orcus::length_unit_t unit) override
Definition: interface.cxx:729
virtual void set_row_hidden(orcus::spreadsheet::row_t row, bool hidden) override
Definition: interface.cxx:747
virtual ~ScOrcusSheetProperties() override
Definition: interface.cxx:698
virtual void set_row_height(orcus::spreadsheet::row_t row, double height, orcus::length_unit_t unit) override
Definition: interface.cxx:741
ScOrcusSheetProperties(SCTAB nTab, ScDocumentImport &rDoc)
Definition: interface.cxx:692
ScDocumentImport & mrDoc
virtual void set_format(orcus::spreadsheet::row_t row_start, orcus::spreadsheet::col_t col_start, orcus::spreadsheet::row_t row_end, orcus::spreadsheet::col_t col_end, size_t xf_index) override
virtual orcus::spreadsheet::iface::import_formula * get_formula() override
Definition: interface.cxx:1148
virtual orcus::spreadsheet::iface::import_conditional_format * get_conditional_format() override
Definition: interface.cxx:1138
virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value) override
Definition: interface.cxx:1179
ScOrcusSheetProperties maProperties
ScOrcusFactory & mrFactory
void cellInserted()
Definition: interface.cxx:1108
ScDocumentImport & mrDoc
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:1235
ScOrcusArrayFormula maArrayFormula
ScOrcusFactory & getFactory()
Definition: interface.cxx:1251
virtual orcus::spreadsheet::iface::import_sheet_properties * get_sheet_properties() override
Definition: interface.cxx:1133
virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value) override
Definition: interface.cxx:1173
virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, std::string_view value) override
Definition: interface.cxx:1160
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:1185
virtual orcus::spreadsheet::iface::import_table * get_table() override
Definition: interface.cxx:1128
virtual orcus::spreadsheet::iface::import_array_formula * get_array_formula() override
Definition: interface.cxx:1154
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:1241
virtual orcus::spreadsheet::iface::import_auto_filter * get_auto_filter() override
Definition: interface.cxx:1123
virtual orcus::spreadsheet::iface::import_named_expression * get_named_expression() override
Definition: interface.cxx:1143
virtual orcus::spreadsheet::range_size_t get_sheet_size() const override
Definition: interface.cxx:1226
ScOrcusNamedExpression maNamedExpressions
ScOrcusFormula maFormula
ScOrcusSheet(ScDocumentImport &rDoc, SCTAB nTab, ScOrcusFactory &rFactory)
Definition: interface.cxx:911
ScDocumentImport & getDoc()
Definition: interface.cxx:1118
virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::string_id_t sindex) override
Definition: interface.cxx:1167
ScOrcusStyles & mrStyles
virtual void set_fill_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:1795
virtual void set_cell_formula_hidden(bool b) override
Definition: interface.cxx:1931
virtual void set_dxf_count(size_t count) override
Definition: interface.cxx:1996
std::vector< font > maFonts
cell_style maCurrentCellStyle
std::vector< fill > maFills
virtual void set_fill_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:1801
virtual void set_strikethrough_type(orcus::spreadsheet::strikethrough_type_t s) override
Definition: interface.cxx:1719
virtual void set_cell_hidden(bool b) override
Definition: interface.cxx:1916
virtual void set_xf_apply_alignment(bool b) override
Definition: interface.cxx:2037
std::vector< number_format > maNumberFormats
virtual void set_cell_xf_count(size_t n) override
Definition: interface.cxx:1982
protection maCurrentProtection
virtual void set_border_width(orcus::spreadsheet::border_direction_t dir, double val, orcus::length_unit_t unit) override
Definition: interface.cxx:1901
virtual void set_cell_style_xf(size_t index) override
Definition: interface.cxx:2113
std::vector< xf > maCellXfs
virtual void set_xf_number_format(size_t index) override
Definition: interface.cxx:2007
virtual void set_font_name(std::string_view name) override
Definition: interface.cxx:1583
virtual void set_font_italic(bool b) override
Definition: interface.cxx:1578
virtual void set_strikethrough_text(orcus::spreadsheet::strikethrough_text_t s) override
Definition: interface.cxx:1760
std::vector< protection > maProtections
virtual void set_font_underline(orcus::spreadsheet::underline_t e) override
Definition: interface.cxx:1594
virtual size_t commit_dxf() override
Definition: interface.cxx:2000
virtual void set_border_style(orcus::spreadsheet::border_direction_t dir, orcus::spreadsheet::border_style_t style) override
Definition: interface.cxx:1822
virtual size_t commit_cell_style_xf() override
Definition: interface.cxx:1973
number_format maCurrentNumberFormat
virtual void set_cell_style_xf_count(size_t n) override
Definition: interface.cxx:1968
std::vector< xf > maCellStyleXfs
virtual size_t commit_cell_protection() override
Definition: interface.cxx:1936
virtual void set_xf_horizontal_alignment(orcus::spreadsheet::hor_alignment_t align) override
Definition: interface.cxx:2041
virtual void set_strikethrough_style(orcus::spreadsheet::strikethrough_style_t s) override
Definition: interface.cxx:1715
virtual void set_border_count(size_t n) override
Definition: interface.cxx:1817
ScOrcusStyles(ScOrcusFactory &rFactory, bool bSkipDefaultStyles=false)
Definition: interface.cxx:1310
virtual void set_strikethrough_width(orcus::spreadsheet::strikethrough_width_t s) override
Definition: interface.cxx:1748
virtual void set_cell_style_name(std::string_view name) override
Definition: interface.cxx:2107
virtual void set_xf_protection(size_t index) override
Definition: interface.cxx:2027
virtual size_t commit_fill() override
Definition: interface.cxx:1807
virtual void set_xf_font(size_t index) override
Definition: interface.cxx:2012
virtual size_t commit_number_format() override
Definition: interface.cxx:1958
virtual void set_font_size(double point) override
Definition: interface.cxx:1589
virtual void set_font_underline_width(orcus::spreadsheet::underline_width_t e) override
Definition: interface.cxx:1632
ScOrcusFactory & mrFactory
virtual void set_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:1707
virtual void set_cell_style_count(size_t n) override
Definition: interface.cxx:2102
virtual void set_xf_vertical_alignment(orcus::spreadsheet::ver_alignment_t align) override
Definition: interface.cxx:2070
virtual size_t commit_font() override
Definition: interface.cxx:1775
virtual void set_font_bold(bool b) override
Definition: interface.cxx:1573
virtual void set_cell_print_content(bool b) override
Definition: interface.cxx:1926
virtual void set_cell_locked(bool b) override
Definition: interface.cxx:1921
void applyXfToItemSet(SfxItemSet &rSet, const xf &rXf)
Definition: interface.cxx:1499
virtual size_t commit_cell_xf() override
Definition: interface.cxx:1987
virtual void set_cell_style_builtin(size_t index) override
Definition: interface.cxx:2118
virtual void set_font_underline_mode(orcus::spreadsheet::underline_mode_t e) override
Definition: interface.cxx:1671
virtual void set_number_format_code(std::string_view s) override
Definition: interface.cxx:1952
virtual void set_border_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:1891
std::vector< border > maBorders
virtual void set_font_underline_type(orcus::spreadsheet::underline_type_t e) override
Definition: interface.cxx:1675
virtual void set_xf_fill(size_t index) override
Definition: interface.cxx:2017
virtual size_t commit_border() override
Definition: interface.cxx:1907
virtual void set_number_format_identifier(size_t n) override
Definition: interface.cxx:1948
virtual void set_xf_border(size_t index) override
Definition: interface.cxx:2022
virtual void set_number_format_count(size_t n) override
Definition: interface.cxx:1944
virtual void set_fill_count(size_t n) override
Definition: interface.cxx:1785
virtual void set_fill_pattern_type(orcus::spreadsheet::fill_pattern_t fp) override
Definition: interface.cxx:1790
virtual void set_cell_style_parent_name(std::string_view name) override
Definition: interface.cxx:2124
virtual void set_font_count(size_t n) override
Definition: interface.cxx:1568
virtual void set_xf_style_xf(size_t index) override
Definition: interface.cxx:2032
virtual size_t commit_cell_style() override
Definition: interface.cxx:2130
virtual void set_font_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:1699
const char * name
Value
Empty
CellStoreToken(const ScAddress &rPos, Type eType)
Definition: interface.cxx:263
formula::FormulaGrammar::Grammar meGrammar
std::optional< SvxBorderLineStyle > meStyle
std::map< orcus::spreadsheet::border_direction_t, border_line > maBorders
void applyToItemSet(SfxItemSet &rSet) const
Definition: interface.cxx:1417
std::optional< Color > maBgColor
std::optional< Color > maFgColor
void applyToItemSet(SfxItemSet &rSet) const
Definition: interface.cxx:1374
std::optional< orcus::spreadsheet::fill_pattern_t > mePattern
std::optional< bool > mbItalic
void applyToItemSet(SfxItemSet &rSet) const
Definition: interface.cxx:1330
std::optional< OUString > maName
std::optional< Color > maColor
std::optional< Color > maUnderlineColor
std::optional< FontLineStyle > meUnderline
std::optional< bool > mbBold
std::optional< double > mnSize
std::optional< FontStrikeout > meStrikeout
void applyToItemSet(SfxItemSet &rSet, const ScDocument &rDoc) const
Definition: interface.cxx:1461
std::optional< OUString > maCode
std::optional< bool > mbHidden
void applyToItemSet(SfxItemSet &rSet) const
Definition: interface.cxx:1383
std::optional< bool > mbPrintContent
std::optional< bool > mbLocked
std::optional< bool > mbFormulaHidden
SvxCellJustifyMethod meHorAlignMethod
SvxCellVerJustify meVerAlignment
SvxCellJustifyMethod meVerAlignMethod
SvxCellHorJustify meHorAlignment
SvxCellJustifyMethod
SvxCellHorJustify
SvxCellVerJustify
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
ResultType type