Created attachment 194820 [details] Impress template with a single word Steps to reproduce: 1) Open the attached Impress document, it's just an almost empty presentation based on the shipped Beehive template. 2) Double-click on the "beehive" string, Ctrl-C. 3) Create a new Writer document, check the number of styles (Basic macro: ThisComponent.StyleFamilies.ParagraphStyles.getCount()): 126 4) Paste that single word into Writer, and check the number of paragraph styles again. Expected result: number of paragraph styles is 126 or 127 (+1 is OK if the source paragraph had a style and it's not yet in the Writer document). Actual result: 221, 95 new paragraph styles for a single word. When doing such copy&paste a lot, this can lead to hundreds of unnecessary styles, which slows down doc load, save, etc.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/afb4ea67463d9f0200dc6216cfd932aec0984c82 tdf#161652 editeng, RTF copy: only write used paragraph styles It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/70d1bd6ee0eba9d6661cd6280566f77a87f2d068 tdf#161652 editeng, RTF copy: only write used paragraph styles It will be available in 24.8.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f58e3e3402c87755a2dd3cb83f29d00c40b94f1a Related: tdf#161652 sw, RTF paste: only keep used paragraph styles It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/211cc26639fcda194a888155344e52d49dba170f Related: tdf#161652 sw, RTF paste: only keep used paragraph styles It will be available in 24.8.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 194970 [details] Clipboard RTF doc with lots of styles.
Created attachment 194978 [details] DOCX reproducer with a few bullets. Related problem: open this file in Writer, select-all, copy, paste as rtf in an other Writer document, then paste as rtf again. First the number of character styles goes from 27 to 55, then to 73. With enough RTF paste, this can lead to thousands of character styles, which slows down the document. It's also inconsistent with paragraph styles, where we don't create or update them if the target document has a paragraph style with a matching name.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8bc8f073e81d125a8e8f1adce966ddb2c7d6bacb Related: tdf#161652 sw, RTF paste: avoid duplicated numbering styles It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/5f447e9d4e3781c5950b1e5a50da358dc60b305d Related: tdf#161652 sw, RTF paste: avoid duplicated numbering styles It will be available in 24.8.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.