]> Git trees. - libqmvoc.git/commitdiff
Do not take into account the translation we are removing when finding words of this... upstream/KDE/4.9 v4.9.2 v4.9.3 v4.9.4
authorAlbert Astals Cid <aacid@kde.org>
Mon, 17 Sep 2012 17:20:46 +0000 (19:20 +0200)
committerAlbert Astals Cid <aacid@kde.org>
Mon, 17 Sep 2012 17:20:46 +0000 (19:20 +0200)
keduvocdocument/keduvocwordtype.cpp

index 87aeebbbb823af93aa4dcb2128911f1430d5d61a..8539baddf408148c0cbe8047db98527bb61b3b97 100644 (file)
@@ -89,10 +89,10 @@ void KEduVocWordType::removeTranslation(KEduVocTranslation* translation)
         }
     }
 
-    // remove from cache
+    // remove from cache if none of the translations use this word type (other than the one we are removing that should not be taken into account)
     bool found = false;
     foreach(int i, translation->entry()->translationIndices()) {
-        if (translation->entry()->translation(i)->wordType() && translation->entry()->translation(i)->wordType() == this) {
+        if (translation->entry()->translation(i)->wordType() && translation->entry()->translation(i)->wordType() == this && translation->entry()->translation(i) != translation) {
             found = true;
             break;
         }