diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2022-05-20 20:24:46 +0530 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2022-05-24 21:20:35 +0200 |
commit | a4536c53eceac8eec6e5ac273583fefb6bafcb3f (patch) | |
tree | 961c6a9527de1578ab7ed0a9d361cf59b594a68b /sw/source/core/txtnode/thints.cxx | |
parent | c022b7a169eebf15f38db0286660ac84cc537358 (diff) |
comments: reassign ID when copy comment
reassigning new ID will make all the comments have unique IDs
this will also ensure there is no mixup when working with comments ID
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I94b433130c68354ab94d4d6e9b86751038b31af5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134686
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 0d3bba5c383ef8b9f62c121a26fed4445c813949)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134792
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/txtnode/thints.cxx')
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index f71db22d3fb7..0c774f83677f 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1091,7 +1091,9 @@ SwTextAttr* MakeTextAttr( // the relation to its annotation mark (relation established via annotation field's name). // If the annotation mark is also copied, the relation and thus the annotated text range will be reestablished, // when the annotation mark is created and inserted into the document. - const_cast<SwPostItField&>(dynamic_cast<const SwPostItField&>(*(pNew->GetFormatField().GetField()))).SetName(OUString()); + auto& pField = const_cast<SwPostItField&>(dynamic_cast<const SwPostItField&>(*(pNew->GetFormatField().GetField()))); + pField.SetName(OUString()); + pField.SetPostItId(); } } break; |