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 <serval2412@yahoo.fr>
Tested-by: Jenkins
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 3aa47d6..d1c8abb 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;