cui/source/options/dbregister.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 574316ea568a09074cda20dd7953f578b081a754 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Sep 9 22:59:06 2023 +0200 Commit: Lionel Mamane <lio...@mamane.lu> CommitDate: Sun Sep 10 13:18:24 2023 +0200 tdf#149195: Impossible to change link of a DB and keep the same registered name Just test nEntry to know if it's a new entry (and so the name must be different from an existing one) Change-Id: I3bda6b1d3d9bae3d79fdfc2cb1323f20add410c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156785 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins (cherry picked from commit a410b8f1111c738604ad2f67c111f98d91761051) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156735 Reviewed-by: Lionel Mamane <lio...@mamane.lu> diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 143112c58724..92cbbd0012e9 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -280,7 +280,10 @@ void DbRegistrationOptionsPage::openLinkDialog(const OUString& sOldName, const O ODocumentLinkDialog aDlg(GetFrameWeld(), nEntry == -1); aDlg.setLink(sOldName, sOldLocation); - aDlg.setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) ); + + // tdf#149195: control the name (ie check duplicate) only if new entry case + if (nEntry == -1) + aDlg.setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) ); if (aDlg.run() != RET_OK) return;