From d934aeace6e7049db3959421538ae382cb97b1d1 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Thu, 15 Jun 2023 11:16:18 +0300 Subject: tdf#103064 sw,editeng: make para styles work inside comments - Style objects for comments are stored in a dedicated stylesheet pool, and constantly updated from the "real" styles using modification broadcasts. In theory, it should be possible to use same objects for both Writer core and EditEngine, as they use separate item ranges. But unfortunately SwDocStyleSheetPool isn't really a styles container, but just a wrapper around Writer's core styles, with a single mxStyleSheet member that is filled each time with data from different styles (while EditEngine expects different styles to be represented by different objects). - EditEngine switched to allow duplicate listeners for styles - one per paragraph. The use case is 2 paragraphs of the same style, and then one of them is switched to another style. In that case we still need to keep listening to the former style for the other paragraph. There is probably some opportunity for optimization, but it should be good enough for now. - Copying formatted text from document's body doesn't preserve style assignment for now. The editeng RTF import should be tweaked to not insert styles into our "special" stylesheet pool (or somehow forward them to Writer's core style handling) before we can enable this part. Change-Id: Ib67c5388f9cd078c73ec0d453017f815843161ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153156 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky --- svl/source/items/style.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index ff21cd91c804..e766dcb09f65 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -690,7 +690,7 @@ SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBas SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const OUString& rName, SfxStyleFamily eFamily, - SfxStyleSearchBits eMask) const + SfxStyleSearchBits eMask) { SfxStyleSheetIterator aIter(this, eFamily, eMask); return aIter.Find(rName); -- cgit