sc/qa/unit/tiledrendering/tiledrendering.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 6752e4f1b5819bb6e45b6cbaba04c3bc56325a95
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Aug 8 23:15:59 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Aug 9 10:54:07 2023 +0200

    sc: fix tiledrenderin test execution issue with comment IDs
    
    ScPostIt::mnLastPostItId is a static variable, which is used for
    generated the comment ID. In the test we depend that the ID are
    consistent and start with 1, but as we have more tests that insert
    comments this can be a problem.
    
    testCommentCallback and testCommentCellCopyPaste, both add comments
    and the expected execution order is testCommentCallback and then
    testCommentCellCopyPaste, so the latter test resets the mnLastPostItId
    variable to 1, so the IDs are consistent. In a LO 7.6 build for
    Fedora, it happened that the testCommentCellCopyPaste was executed
    first and testCommentCallback afterwards, but in testCommentCallback
    we do not reset the mnLastPostItId and the build failed.
    
    This change resets the mnLastPostItId also in testCommentCallback.
    
    Change-Id: I123b2f47b0d6177b2f5bdefcf6d8e9c301a7413b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155471
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 6eb2aa134e69..1b44ff54a91e 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1079,6 +1079,9 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testCommentCallback)
     // Comments callback are emitted only if tiled annotations are off
     comphelper::LibreOfficeKit::setTiledAnnotations(false);
 
+    // FIXME: Hack because previous tests do not destroy ScDocument(with 
annotations) on exit (?).
+    ScPostIt::mnLastPostItId = 1;
+
     {
         ScModelObj* pModelObj = createDoc("small.ods");
         ViewCallback aView1;

Reply via email to