[SOLVED] Spreadsheet with merged cells view

Discussions about the development of the TechDraw workbench
mapeze
Posts: 11
Joined: Tue Oct 27, 2020 8:23 pm

[SOLVED] Spreadsheet with merged cells view

Postby mapeze » Tue May 11, 2021 4:25 pm

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
Posts: 10532
Joined: Thu Jan 05, 2017 9:03 pm

Re: Spreadsheet views: multiline text and merged cells

Postby Kunda1 » Mon May 17, 2021 1:00 am

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:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
mapeze
Posts: 11
Joined: Tue Oct 27, 2020 8:23 pm

Re: Spreadsheet views: multiline text and merged cells

Postby mapeze » Mon May 17, 2021 5:10 pm

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: 11
Joined: Tue Oct 27, 2020 8:23 pm

Re: Spreadsheet views: multiline text and merged cells

Postby mapeze » Tue May 18, 2021 7:11 am

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: 11
Joined: Tue Oct 27, 2020 8:23 pm

Re: [Solved?] Spreadsheet with merged cells view

Postby mapeze » Wed May 26, 2021 6:00 am

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());