diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-11 13:29:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-13 18:13:20 +0200 |
commit | 2bda87fd8758448267c447ba26f1932325a1338d (patch) | |
tree | 8fec2ed4450eff43f2e76d2422121755794f171f /sc/inc | |
parent | 1b2219cec9abe0ac77360ca2cc252d11d7f512e3 (diff) |
defer turning xlsx notes into SdrCaptions until activated
to improve import performance
Change-Id: I8dd3483372d20cbbb8694bae02a7d8b062324ff0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155613
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/postit.hxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index c2a5cc9a60ad..df114eaf64a5 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -174,12 +174,20 @@ private: sal_uInt32 mnPostItId; }; +class GenerateNoteCaption +{ +public: + virtual void Generate(SdrCaptionObj& rCaptionObj) = 0; + virtual OUString GetSimpleText() const = 0; + virtual ~GenerateNoteCaption() {}; +}; + class SC_DLLPUBLIC ScNoteUtil { static ScPostIt* InsertNote(ScDocument& rDoc, const ScAddress& rPos, ScNoteData&& rNoteData, bool bAlwaysCreateCaption, sal_uInt32 nPostItId); - static ScNoteData CreateNoteData(ScDocument& rDoc, const ScAddress& rPos, const OutlinerParaObject& rOutlinerObj, + static ScNoteData CreateNoteData(ScDocument& rDoc, const ScAddress& rPos, const tools::Rectangle& rCaptionRect, bool bShown); public: @@ -242,13 +250,11 @@ public: const OutlinerParaObject& rOutlinerObj, const tools::Rectangle& rCaptionRect, bool bShown ); - // similar to above, except rPropertyNames/rPropertyValues contain the - // uno properties for the caption object formatting. - static ScPostIt* CreateNoteFromObjectProperties( + // similar to above, except xGenerator is a functor to apply import + // properties to the caption object to finalize it on demand + static ScPostIt* CreateNoteFromGenerator( ScDocument& rDoc, const ScAddress& rPos, - const css::uno::Sequence<OUString>& rPropertyNames, - const css::uno::Sequence<css::uno::Any>& rPropertyValues, - const OutlinerParaObject& rOutlinerObj, + std::unique_ptr<GenerateNoteCaption> xGenerator, const tools::Rectangle& rCaptionRect, bool bShown ); /** Creates a cell note based on the passed string and inserts it into the |