sw/source/core/doc/docfmt.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cb168fa5a2b732438266baf07a08c4c1d9fe671d
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:55:12 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/+/100940

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index f0a3e2a5fb35..230337e9d22a 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1705,6 +1705,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;
 }
@@ -1712,6 +1713,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

Reply via email to