[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source
Vasily Melenchuk (via logerrit)
logerrit at kemper.freedesktop.org
Sun Aug 23 17:13:50 UTC 2020
sw/source/core/doc/docfmt.cxx | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 9253d60c6fa4c8f37eba8e445cb5432e80a61696
Author: Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Mon Jul 20 09:55:19 2020 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Aug 23 19:13:17 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.Behrens at CIB.de>
(cherry picked from commit 083fe09958658de8c3da87a28e0f8ff7b3b8a5e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100941
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101225
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
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;
}
More information about the Libreoffice-commits
mailing list