diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2019-04-19 23:15:53 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-05-04 10:22:02 +0200 |
commit | c2f1c68ffb6dfa1ce7de09dcc428d6c53549e88d (patch) | |
tree | 15d5df7332e6249922645e58d30c2706df17c659 /sc/source/filter/inc/condformatbuffer.hxx | |
parent | 8c637b47d9de4b3a64c33a9c2ffe7ed220be2467 (diff) |
tdf#122590: follow-up : import x14:cfRule priorities
If there are x:cfRule's and x14:cfRule's with matching
range-list, then insert the conditional-fmt entries into
the document in the order of the priorities. That is
don't just append the x14:cfRule entries to the document
after the x:cfRule entries are inserted.
There was also a off-by-one bug in the priority export
of x14:cfRule entries. This caused the priority numbers
to be duplicated. This is also fixed.
Change-Id: I5b0d11c4456b2966b808f6ee589075a870f43768
Reviewed-on: https://gerrit.libreoffice.org/71311
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc/source/filter/inc/condformatbuffer.hxx')
-rw-r--r-- | sc/source/filter/inc/condformatbuffer.hxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index d67f648e8086..8fbca5c0febf 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -160,6 +160,9 @@ public: /** Imports rule settings from a CFRULE record. */ void importCfRule( SequenceInputStream& rStrm ); + /** Directly set a ScFormatEntry with a priority ready for finalizeImport(). */ + void setFormatEntry(sal_Int32 nPriority, ScFormatEntry* pEntry); + /** Creates a conditional formatting rule in the Calc document. */ void finalizeImport(); @@ -174,6 +177,7 @@ private: const CondFormat& mrCondFormat; CondFormatRuleModel maModel; ScConditionalFormat* mpFormat; + ScFormatEntry* mpFormatEntry; std::unique_ptr<ColorScaleRule> mpColor; std::unique_ptr<DataBarRule> mpDataBar; std::unique_ptr<IconSetRule> mpIconSet; @@ -190,9 +194,12 @@ struct CondFormatModel explicit CondFormatModel(); }; +class CondFormatBuffer; + /** Represents a conditional formatting object with a list of affected cell ranges. */ class CondFormat : public WorksheetHelper { +friend class CondFormatBuffer; public: explicit CondFormat( const WorksheetHelper& rHelper ); @@ -268,14 +275,17 @@ public: class ExtCfCondFormat { public: - ExtCfCondFormat(const ScRangeList& aRange, std::vector< std::unique_ptr<ScFormatEntry> >& rEntries); + ExtCfCondFormat(const ScRangeList& aRange, std::vector< std::unique_ptr<ScFormatEntry> >& rEntries, + std::vector<sal_Int32>* pPriorities = nullptr); ~ExtCfCondFormat(); const ScRangeList& getRange(); const std::vector< std::unique_ptr<ScFormatEntry> >& getEntries(); + const std::vector<sal_Int32>& getPriorities() const { return maPriorities; } private: std::vector< std::unique_ptr<ScFormatEntry> > maEntries; + std::vector<sal_Int32> maPriorities; ScRangeList const maRange; }; @@ -307,6 +317,7 @@ private: CondFormatVec maCondFormats; /// All conditional formatting in a sheet. ExtCfDataBarRuleVec maCfRules; /// All external conditional formatting rules in a sheet. std::vector< std::unique_ptr<ExtCfCondFormat> > maExtCondFormats; + sal_Int32 mnNonPrioritizedRuleNextPriority = 1048576; }; } // namespace xls |