You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b6b94a8
Browse filesBrowse the repository at this point in the historyBrowse files
Overload the assignment operators for the Table and Index classes
This fixes issues that assigning the main representation of the database
in DBBrowserDB::objectMap is modified when playing around with the
database in the Edit Table and Edit Index dialogs.
These bugs were caused by my refactoring. Let's hope there's not much
more fallout from this refactoring...
Copy file name to clipboardExpand all lines: src/sqlitetypes.cpp
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,37 @@ Table::~Table()
226
226
clear();
227
227
}
228
228
229
+
Table& Table::operator=(const Table& rhs)
230
+
{
231
+
// Base class
232
+
Object::operator=(rhs);
233
+
234
+
// Just assign the strings
235
+
m_rowidColumn = rhs.m_rowidColumn;
236
+
m_virtual = rhs.m_virtual;
237
+
238
+
// Make copies of the fields and the constraints. This is necessary in order to avoid any unwanted changes to the application's main database
239
+
// schema representation just modifying a reference to the fields or constraints and thinking it operates on a copy.
240
+
foreach(FieldPtr f, rhs.m_fields)
241
+
addField(FieldPtr(newField(*f)));
242
+
for(auto it=rhs.m_constraints.constBegin();it!=rhs.m_constraints.constEnd();++it) // TODO This is so ugly, it should be replaced really by anything else
0 commit comments