View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004429 | FreeCAD | Bug | public | 2020-09-07 04:13 | 2020-09-13 10:30 |
Reporter | wang02139 | Assigned To | wmayer | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | OS Version | 18.04.5 LTS |
Summary | 0004429: Spreadsheet: Bug when inserting a row into spreadsheet | ||||
Description | Forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=50032 When a spreadsheet has entries with aliases which goes through 2 levels of reference, and the user inserts a row, the reference is broken and there is an error that a property is not found. I have attached a very simple file with this problem. If you insert a row at, say, row 3, there is an error "15:19:52 <Spreadsheet> Cell.cpp(594): Unnamed#Spreadsheet.A9: Property 'b' not found in 'b'" There are 2 aliases: a = 1 b = a + 1 The last cell is b+1 which has the error. | ||||
Steps To Reproduce | 1. Load the file 2. Open the spreadsheet 3. Insert a row at row 3 | ||||
Additional Information | This is the error message: "15:19:52 <Spreadsheet> Cell.cpp(594): Unnamed#Spreadsheet.A9: Property 'b' not found in 'b'" | ||||
Tags | spreadsheet | ||||
FreeCAD Information | OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/ubuntu) Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.19.22284 (Git) AppImage Build type: Release Branch: master Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c Python version: 3.8.5 Qt version: 5.12.5 Coin version: 4.0.0 OCC version: 7.4.0 Locale: English/United States (en_US) | ||||
|
|
|
I looked at the code and understood the problem now. Old values in revAliasProp are used before they are updated later. Here it's using revAliasProp to look for the location, but it's the old location of the alias: PropertySheet.cpp#L993 The alias may be changed later in moveCell which updates revAliasProp PropertySheett.cpp#L708 Thus the dependency graph is wrong. |
|
https://github.com/FreeCAD/FreeCAD/pull/3866 Move the aliases before other content of cells When a user performs insert rows, remove rows, insert columns, or remove rows, we need to move multiple cells as a batch. The cells are moved sequentially. For each cell, its dependent alias positions are looked up and dependencies are added. However, those cells with aliases may be moved later in the batch. Thus the earlier dependencies become wrong. This commit fixes this bug by moving all the aliases before moving the cells. Unit tests are added to for this bug. fixes issue 0004429 |
|
https://github.com/FreeCAD/FreeCAD/commit/0aa759b5c55bb9449d6eef7d38cc3ab4ef3f404f |
FreeCAD: master 0aa759b5 2020-09-13 00:38:03 Cheuksan Wang Committer: wmayer Details Diff |
Move the aliases before other content of cells When a user performs insert rows, remove rows, insert columns, or remove rows, we need to move multiple cells as a batch. The cells are moved sequentially. For each cell, its dependent alias positions are looked up and dependencies are added. However, those cells with aliases may be moved later in the batch. Thus the earlier dependencies become wrong. This commit fixes this bug by moving all the aliases before moving the cells. Unit tests are added to for this bug. fixes issue 0004429 |
Affected Issues 0004429 |
|
mod - src/Mod/Spreadsheet/App/PropertySheet.cpp | Diff File | ||
mod - src/Mod/Spreadsheet/App/PropertySheet.h | Diff File | ||
mod - src/Mod/Spreadsheet/TestSpreadsheet.py | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-09-07 04:13 | wang02139 | New Issue | |
2020-09-07 04:13 | wang02139 | Tag Attached: spreadsheet | |
2020-09-07 04:13 | wang02139 | File Added: spreadsheet_insert.FCStd | |
2020-09-07 06:54 | wang02139 | Note Added: 0014729 | |
2020-09-13 01:31 | wang02139 | Note Added: 0014747 | |
2020-09-13 10:10 | wmayer | Assigned To | => wmayer |
2020-09-13 10:10 | wmayer | Status | new => closed |
2020-09-13 10:10 | wmayer | Resolution | open => fixed |
2020-09-13 10:10 | wmayer | Fixed in Version | => 0.19 |
2020-09-13 10:10 | wmayer | Note Added: 0014749 | |
2020-09-13 10:30 | wmayer | Changeset attached | => FreeCAD master 0aa759b5 |