[SOLVED] Spreadsheet with merged cells view

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mapeze
Posts: 12
Joined: Tue Oct 27, 2020 8:23 pm

[SOLVED] Spreadsheet with merged cells view

Post by mapeze »

Hello,

I have been working with drawings for my company the last days and I write here a possible bug I found. First of all thank you very much to all the people working on this project! This kind of posts are by now my unique "help" here. ;)

The Spreadsheet view is shown incorrectly if the Spreadsheet area contains merged cells in the same column. More explicitly, the view is shown incorrectly if the area includes at least one row below the merged cells.
Image

Regards,
Last edited by mapeze on Wed May 26, 2021 6:01 am, edited 7 times in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Spreadsheet views: multiline text and merged cells

Post by Kunda1 »

Thanks. Please add the full About info of each FreeCAD version you used.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mapeze
Posts: 12
Joined: Tue Oct 27, 2020 8:23 pm

Re: Spreadsheet views: multiline text and merged cells

Post by mapeze »

OS: Ubuntu 20.04.2 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.24894 (Git) AppImage
Build type: Release
Branch: master
Hash: a378b6b66f8a5992fc1452567ff59bdb613abc80
Python version: 3.9.4
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
mapeze
Posts: 12
Joined: Tue Oct 27, 2020 8:23 pm

Re: Spreadsheet views: multiline text and merged cells

Post by mapeze »

mapeze wrote: Tue May 11, 2021 4:25 pm The Spreadsheet view is shown incorrectly if the Spreadsheet area contains merged cells. More explicitly, the view is shown incorrectly if the area includes at least one row below the merged cells.
In DrawViewSpreadsheet.cpp I inserted new line 359 as follows,

Code: Select all

cellheight = sheet->getRowHeight(address.row());
just before

Code: Select all

rowoffset = rowoffset + cellheight;
I ran a compilation (first time in my life?) and... it works!!!.
Image
mapeze
Posts: 12
Joined: Tue Oct 27, 2020 8:23 pm

Re: [Solved?] Spreadsheet with merged cells view

Post by mapeze »

This change has been merged to the official master branch.
More precisely, the change has been to substitute the line 359:

Code: Select all

rowoffset = rowoffset + cellheight;
with

Code: Select all

rowoffset = rowoffset + sheet->getRowHeight(address.row());
Post Reply