# HG changeset patch
# User Andrey Skvortsov <andrej.skvortzov@gmail.com>
# Date 1491904295 -10800
# Node ID eed01e0ab32a640e83ae16d039cf15fc83d44412
# Parent  5f4e53508e4e6c18691e549d9d92867d39913a64
fix problem with clearing non-empty location field after changing type of config variable

introduced by cd9db17 ("clear variable location cell in variable
panel, if variable class or type changed").

Closes #26

diff -r 5f4e53508e4e -r eed01e0ab32a controls/VariablePanel.py
--- a/controls/VariablePanel.py	Mon Apr 10 18:29:12 2017 +0300
+++ b/controls/VariablePanel.py	Tue Apr 11 12:51:35 2017 +0300
@@ -800,9 +800,10 @@
     def ClearLocation(self, row, col, value):
         if self.Values[row].Location != '':
             if self.Table.GetColLabelValue(col, False) == 'Class' and value not in ["Local", "Global"] or \
-               self.Table.GetColLabelValue(col, False) == 'Type' and not self.Parent.Controler.IsLocatableType(value):
+               self.Table.GetColLabelValue(col, False) == 'Type' and not self.Controler.IsLocatableType(value):
                 self.Values[row].Location = ''
-            self.RefreshValues()
+                self.RefreshValues()
+                self.SaveValues()
 
     def BuildStdIECTypesMenu(self,type_menu):
             # build a submenu containing standard IEC types