Set the value of a cell, merge line breaks

def SetValue(self, row, col, value, refresh=True):
        """Set the value of a cell, merge line breaks"""

        # Join code that has been split because of long line issue
        value = "".join(value.split("\n"))

        key = row, col, self.grid.current_table

        old_code = self.grid.code_array(key)
        if old_code is None:
            old_code = ""

        if value != old_code:
            self.grid.actions.set_code(key, value)