cui/source/options/dbregister.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 44d50f0226b1003f60dd0a890e2309cac9660812 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Sep 9 22:59:06 2023 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Sep 10 09:30:53 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 diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 3aa47d69aea9..d1c8abb4d102 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -287,7 +287,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;