Index: annot.h
===================================================================
--- annot.h	(revision 17424)
+++ annot.h	(working copy)
@@ -218,6 +218,7 @@
 
 public slots:
 	void NewName();
+        bool FoundName(QString name);
 	void IPlace();
 	void RemoveNIcon();
 	void RemovePIcon();
Index: annot.cpp
===================================================================
--- annot.cpp	(revision 17424)
+++ annot.cpp	(working copy)
@@ -21,6 +21,7 @@
 #include <QSpinBox>
 #include <QTabWidget>
 #include <QWidget>
+#include <QMessageBox>
 #include <QRadioButton>
 #include <QList>
 #include <QStringList>
@@ -1185,7 +1186,7 @@
 	connect(PlaceIcon, SIGNAL(clicked()), this, SLOT(IPlace()));
 	connect(ChFile, SIGNAL(clicked()), this, SLOT(GetFile()));
 	connect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternLink()));
-	connect(Name, SIGNAL(Leaved()), this, SLOT(NewName()));
+        //connect(Name, SIGNAL(Leaved()), this, SLOT(NewName()));
 	NoSpell->setToolTip( tr( "Flag is ignored for PDF 1.3" ) );
 	NoScroll->setToolTip( tr( "Flag is ignored for PDF 1.3" ) );
 	CalcFields->setToolTip( tr( "Enter a comma separated list of fields here" ) );
@@ -1198,6 +1199,20 @@
 Annot::~Annot()
 {}
 
+bool Annot::FoundName(QString name)
+{
+        bool found = false;
+        for (int b = 0; b < view->Doc->Items->count(); ++b)
+        {
+                if ((name == view->Doc->Items->at(b)->itemName()) && (view->Doc->Items->at(b) != item))
+                {
+                          found = true;
+                          break;
+                }
+         }
+         return found;
+}
+
 void Annot::NewName()
 {
 	QString NameNew = Name->text();
@@ -1206,17 +1221,9 @@
 		Name->setText(OldName);
 		return;
 	}
-	bool found = false;
-	for (int b = 0; b < view->Doc->Items->count(); ++b)
+        if (FoundName(NameNew) && (OldName != NameNew))
 	{
-		if ((NameNew == view->Doc->Items->at(b)->itemName()) && (view->Doc->Items->at(b) != item))
-		{
-			found = true;
-			break;
-		}
-	}
-	if (found)
-	{
+                QMessageBox::warning(this, CommonStrings::trWarning, tr("The item with such name is already exist"), QMessageBox::Ok);
 		Name->setText(OldName);
 		Name->setFocus();
 	}
@@ -1808,8 +1815,14 @@
 	QString Nfo("");
 	bool AAct = false;
 	item->annotation().setType(ComboBox1->currentIndex()+2);
-	if (Name->text() != OldName)
+        bool enableClose = true;
+        if ((!FoundName(Name->text())) && (Name->text() != OldName)) {
 		item->setItemName(Name->text());
+        }
+        if (FoundName(Name->text())) {
+            NewName();
+            enableClose = false;
+        }
 	item->annotation().setToolTip(Tip->text());
 	item->annotation().setRollOver(TextO->text());
 	item->annotation().setDown(DownT->text());
@@ -2032,7 +2045,7 @@
 	if (!item->annotation().C_act().isEmpty())
 		AAct = true;
 	item->annotation().setAAact(AAct);
-	accept();
+        if (enableClose) accept();
 }
 
 void Annot::SetAnnotationType(int it)
