summaryrefslogtreecommitdiff
path: root/sc/source/filter/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@libreoffice.org>2021-12-15 23:42:56 -0500
committerXisco Fauli <xiscofauli@libreoffice.org>2021-12-20 16:11:38 +0100
commitafd8e27195bef78df3eb2d3ecab9cc3dae695b64 (patch)
treec32bcac90bbea0c4ef8dbc54621ade481f57a018 /sc/source/filter/inc
parentdd5e7b2120898b96132ed4d330adb597991c1f6b (diff)
tdf#103331: Make styles attributes optional.
Apply only those that are actually specified. Change-Id: Ib2e090fefe4dbfe3d4fca2b953bcf51d97d9ddec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126901 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org> (cherry picked from commit 6b2da3ae3ea7f47dff3c807c151f88a9e1ae9964) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127167 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/source/filter/inc')
-rw-r--r--sc/source/filter/inc/orcusinterface.hxx63
1 files changed, 20 insertions, 43 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 935854c46e3f..08e9c4a56871 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -355,22 +355,14 @@ private:
struct font
{
- OUString maName;
- double mnSize;
- Color maColor;
- bool mbBold;
- bool mbItalic;
-
- bool mbHasFontAttr;
- bool mbHasUnderlineAttr;
- bool mbHasStrikeout;
-
- FontLineStyle meUnderline;
- Color maUnderlineColor;
-
- FontStrikeout meStrikeout;
-
- font();
+ std::optional<OUString> maName;
+ std::optional<double> mnSize;
+ std::optional<Color> maColor;
+ std::optional<bool> mbBold;
+ std::optional<bool> mbItalic;
+ std::optional<FontLineStyle> meUnderline;
+ std::optional<Color> maUnderlineColor;
+ std::optional<FontStrikeout> meStrikeout;
void applyToItemSet(SfxItemSet& rSet) const;
};
@@ -380,13 +372,9 @@ private:
struct fill
{
- orcus::spreadsheet::fill_pattern_t mePattern;
- Color maFgColor;
- Color maBgColor;
-
- bool mbHasFillAttr;
-
- fill();
+ std::optional<orcus::spreadsheet::fill_pattern_t> mePattern;
+ std::optional<Color> maFgColor;
+ std::optional<Color> maBgColor; // currently not used.
void applyToItemSet(SfxItemSet& rSet) const;
};
@@ -398,17 +386,12 @@ private:
{
struct border_line
{
- SvxBorderLineStyle meStyle;
- Color maColor;
- double mnWidth;
-
- border_line();
+ std::optional<SvxBorderLineStyle> meStyle;
+ std::optional<Color> maColor;
+ std::optional<double> mnWidth;
};
- std::map<orcus::spreadsheet::border_direction_t, border_line> border_lines;
-
- bool mbHasBorderAttr;
- border();
+ std::map<orcus::spreadsheet::border_direction_t, border_line> maBorders;
void applyToItemSet(SfxItemSet& rSet) const;
};
@@ -418,14 +401,11 @@ private:
struct protection
{
- bool mbHidden;
- bool mbLocked;
- bool mbPrintContent;
- bool mbFormulaHidden;
+ std::optional<bool> mbLocked;
+ std::optional<bool> mbHidden;
+ std::optional<bool> mbPrintContent;
+ std::optional<bool> mbFormulaHidden;
- bool mbHasProtectionAttr;
-
- protection();
void applyToItemSet(SfxItemSet& rSet) const;
};
@@ -434,11 +414,8 @@ private:
struct number_format
{
- OUString maCode;
-
- bool mbHasNumberFormatAttr;
+ std::optional<OUString> maCode;
- number_format();
void applyToItemSet(SfxItemSet& rSet, const ScDocument& rDoc) const;
};