sw/source/core/doc/docfmt.cxx | 2 ++ 1 file changed, 2 insertions(+) New commits: commit 720e3441825c31d655043deb1099cdda8939bfd4 Author: Vasily Melenchuk <vasily.melenc...@cib.de> AuthorDate: Mon Jul 20 09:55:19 2020 +0300 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Wed Aug 19 14:54:43 2020 +0200
sw: generate unique style name for table box and line frames Since SwTableBoxFormat and SwTableLineFormat are derived from SwFrameFormat they can behave incorrectly during undo/redo. Undo/redo code is trying to rely style names instead of pointers to format: this is dangerous. Any problems with SwTableBoxFormat and SwTableLineFormat, I was not able to reproduce with GUI. But external access to document via UNO can bring surprises. For example: NumberFormat for table cells in GUI is modified, but can be changed to another by UNO call (see example/usecase in /sw/qa/python/check_table.py: test_tdf32082. And such replacement looks from core as a new style, not a modification of attributes in existing one. Change-Id: I6afc992f6cdb9ce692167204b3c98e8234cd87d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99023 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit 083fe09958658de8c3da87a28e0f8ff7b3b8a5e9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100941 diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 6b92ee74e9ac..a738ea1596a0 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1696,6 +1696,7 @@ bool SwDoc::DontExpandFormat( const SwPosition& rPos, bool bFlag ) SwTableBoxFormat* SwDoc::MakeTableBoxFormat() { SwTableBoxFormat* pFormat = new SwTableBoxFormat( GetAttrPool(), mpDfltFrameFormat.get() ); + pFormat->SetName("TableBox" + OUString::number(reinterpret_cast<sal_IntPtr>(pFormat))); getIDocumentState().SetModified(); return pFormat; } @@ -1703,6 +1704,7 @@ SwTableBoxFormat* SwDoc::MakeTableBoxFormat() SwTableLineFormat* SwDoc::MakeTableLineFormat() { SwTableLineFormat* pFormat = new SwTableLineFormat( GetAttrPool(), mpDfltFrameFormat.get() ); + pFormat->SetName("TableLine" + OUString::number(reinterpret_cast<sal_IntPtr>(pFormat))); getIDocumentState().SetModified(); return pFormat; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits