Bug 39930 - Calc buttons shrink in height
Summary: Calc buttons shrink in height
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.3 release
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 07:40 UTC by Bill Gradwohl
Modified: 2012-08-31 10:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Various stages showing what happens (775.29 KB, application/x-gzip)
2011-08-08 07:40 UTC, Bill Gradwohl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Gradwohl 2011-08-08 07:40:16 UTC
Created attachment 50032 [details]
Various stages showing what happens

I have a spreadsheet that's used 12 hours a day, every day. We've used it in various stages of development for 6 years. Lately, on a netbook, buttons started shrinking during the course of the day so that at end of day some buttons were .02cm high and unusable. 

I've experimented and want to report what I've discovered. Please see the attached snapshots for familiarization. Note that I've done so much experimentation on so many versions of this file that I can't possibly explain all I've done as I can't remember it all. 

I have 23 sheets in a 36 sheet spreadsheet that represent tables in a restaurant, and are therefore identical in layout with a minor Title modification to one button per sheet to display the sheet name in large letters. Each of these 23 sheets has 4 buttons total, with 3 of them arranged vertically above each other. These 3 buttons would shrink by themselves during the day, with the bottom button shrinking to near invisibility, the one above shrunken to approximately half its normal size and the top button shrunken a bit. The 4th button is also shrinking, but it provides no additional information about this issue. Buttons would shrink on sheets I've hidden and can't possibly get used during the day.

When all this started, I had absolutely no macro code that did anything to buttons. The buttons were created on the first of these identical sheets and copied to the remainder using the IDE. Blowing the shrunken buttons away and recreating them became tiresome, so I recently wrote some code to bring them back to full size. It worked perfectly. We could continue using the spreadsheet for a few more hours till it was time to reinflate the buttons again. Problem was at end of day we would save and close up LO for the night and the next morning the 3 buttons we used on these sheets the previous night were all gone. We would use a backup copy to go forward.

More experimentation revealed that the first sheet had 1524 shapes of which 1520 had a control of null. Common sense says I didn't put 1520 dead shapes on this sheet, LO did by process of elimination. The other sheets also had anywhere from 10 to 75 of these half baked shapes. I wrote more code to nuke the dead entries leaving only 4 shapes with non null control entries – my real buttons. Again the sheets worked perfectly for several hours, but this time a save, close and reacquire would produce a bogus password failure during the loading process. This spreadsheet was NOT password protected, and it would occur several seconds into the loading process. The .ods file was now unusable. Performing the identical operation on a backup copy always results in an unusable file.

If I took a backup copy, with shrunken buttons and ran my clean up macro to nuke the dead shapes, it would work and give me a file that would save and could be reopened successfully. Touching the shrunken buttons and attempting a reinflation after a shape clean up functions normally, but a save and reacquire is always unsuccessful due to a corrupt file.

Back to a backup copy.

Reinflating the 3 buttons works, and the spreadsheet is perfectly usable for hours, but a save, close and reacquire looses them. I discovered however that if I used the IDE to simply touch each button after my macro code resizes them, those buttons would remain across sessions. Those not touched would disappear. The shape count per sheet tells me the disappeared buttons are really gone. Note that I only attempt to resize 3 of the 4 available buttons per sheet. The 4th button is always there.

Attached are snapshots of an experiment. I ran my macro to resize the buttons on all sheets. I then used the IDE to display the properties of one of those buttons on one of those sheets. TG1.1, TG1.2 and TG1.3 show all the properties available. Note that there is no position/size information. Further note where the Anchor symbol is – way above where it normally is.

TG1.4 shows I put focus on the button. TG1.5 is an up arrow operation and the anchor sync's up with the button. TG1.6 is a down arrow to put the button back where it belongs.

TG1.7 I focus on another button. TG1.8 I return focus on the top button. TG1.9 shows we now have position/size information via the IDE.

TG2.1 shows a sheet where the buttons have been reinflated via my macro code, but the IDE was NOT used to touch these buttons.

The spreadsheet is immediately saved, closed and LO is brought up again.

TG1.After.Save shows the buttons on the TG1 sheet – the reinflated buttons that the IDE touched. TG2.After.Save shows the mangled buttons on the TG2 sheet – the reinflated buttons the IDE did NOT touch. Note that these buttons are shrunken in height with the top button shrunk the least (% wise) the middle button shrunken more and the bottom button shrunken the most. All the remaining sheets – TG3, TG4, etc, all look like TG2.

The width of these buttons never changes – only the height. During normal day to day use, it appears that the more a sheet is used, the more likely it is to have a more shrunken button, but that's just a guess. The identical button on the various sheets can go from a low of .02cm to .27cm, but no button is ever its full height by the end of day.

I conclude the IDE is damaging the spreadsheet by leaving trash shapes lying around. What is shrinking the buttons is unknown, but my code certainly isn't doing it. Therefore LO is. As the buttons are full height an instant before I save and reload the sheet must surely indicate that some part of LO is manipulating the buttons during the close or open process.

Over the years I have had numerous issues with OO (now LO), reported them with no apparent interest from the bug handlers. I would suck my macro code out of a damaged file on one machine, and recreate a brand new spreadsheet on another machine to put that code into about every 6 months to a year. Something would corrupt the spreadsheet in various ways, usually resulting in a bogus password message during the loading process that rendered the file unusable. 

I would use a backup of a damaged sheet for the cell widths, colors, etc and manually recreate a brand new version of it and then copy my macros from the damaged sheet into emacs piece by piece as the copy can't handle the amount of code I have per library/module, and then copy from emacs to the new spreadsheet. This takes 2 days of my time usually, but I end up with a clean brand new version of the spreadsheet that works as intended.

Some form of corruption eventually kills the spreadsheet. I'm hoping I can get someones attention this time, as I think I've shown that LO is messing up, not me. I suspect the IDE and in particular the form control is responsible for all the corruption issues I've seen over the years, as its always after I make a change to a dialog or button that things start to go haywire. If I leave it alone, it works fine. If I modify just code, its fine. If I modify a control or dialog, things go awry.

I run Fedora 15 fully patched with LO.3.3.3 as supplied by Fedora on an ASUS Eee PC at 1024x600 screen resolution at 100% scaling. I have two of these machines identically set up and both produce the same behavior so I rule out hardware. 

My main development machine is a high end ASUS gaming laptop running fully patched Fedora 14 with OO. I do not see the shrinking issue on that box, but then I don't use it for production. On that box, if I attempt to delete a sheet or move a sheet from one position to another, the spreadsheet is absolutely fine till I save and reacquire it. Then its trashed. Happens every time.

We don't use Windows at all, so if someone is going to take this report seriously, please have it be by someone familiar with Linux.

I can supply the spreadsheet (250+KB) to an LO developer. I'm a professional software developer (operating system internals, O/S utilities, etc) but have no knowledge of LO internals and only rudimentary BASIC macro level knowledge of how to work with calc.

There are other shrinking button issues with this spreadsheet, but I don't want to muddy the waters with that now.

I'm willing to do whatever I can, but I'm saddle with a 16KB/sec Internet connection on the island of Roatan, Honduras.



sub fixButtons()
dim doc                                  as Object
dim sheets                               as Object
dim sheet                                as Object
dim sN                                   as integer
dim x                                    as integer
dim oSize
dim oShape
dim oPosition
dim xPOs as long
dim yPos as long

doc = ThisComponent

sheets = doc.Sheets

for sN=0 to ubound(sName)
   sheet=sheets.getByName(sName(sN))
   sheet.unprotect("Bagels")
   oShape=GetControlShape(sheet,"SaveXaction")
   oShape.Control.Label=sName(sN)
   oSize=oShape.Size
   oSize.Height=1000
   oShape.Size=oSize
   if sN=0 then
      oPosition=oShape.Position
      xPos=oPosition.X
      yPos=oPosition.Y
   else
      oPosition.X=xPos
      oPosition.Y=yPos
      oShape.Position=oPosition
   end if
   sheet.protect("Bagels")
next sN

for sN=0 to ubound(sName)
   sheet=sheets.getByName(sName(sN))
   sheet.unprotect("Bagels")
   oShape=GetControlShape(sheet,"TblRcpt")
   oSize=oShape.Size
   oSize.Height=500
   oShape.Size=oSize
   if sN=0 then
      oPosition=oShape.Position
      xPos=oPosition.X
      yPos=oPosition.Y
   else
      oPosition.X=xPos
      oPosition.Y=yPos
      oShape.Position=oPosition
   end if
   sheet.protect("Bagels")
next sN

for sN=0 to ubound(sName)
   sheet=sheets.getByName(sName(sN))
   sheet.unprotect("Bagels")
   oShape=GetControlShape(sheet,"Kitchen")
   oSize=oShape.Size
   oSize.Height=500
   oShape.Size=oSize
   if sN=0 then
      oPosition=oShape.Position
      xPos=oPosition.X
      yPos=oPosition.Y
   else
      oPosition.X=xPos
      oPosition.Y=yPos
      oShape.Position=oPosition
   end if
   sheet.protect("Bagels")
next sn
   
sheet=sheets.getByName("Tables")
sheet.unprotect("Bagels")
for sN=0 to ubound(sName)
   oShape=GetControlShape(sheet,"goto"+sName(sN))
   oSize=oShape.Size
   oSize.Height=700
   oSize.Width=1500
   oShape.Size=oSize
next sN
sheet.protect("Bagels")

msgbox("Done")
end sub
Comment 1 Bill Gradwohl 2011-08-10 20:07:30 UTC
Today, all the buttons on all the sheets ended up on a single sheet. That sheet had 76 buttons on it and the rest of the sheets had none. This happened at startup. 

The night before, the buttons were shrunken, but they were where they were supposed to be. 

Additionally, several buttons had their fonts changed to a large size making the text unreadable.
Comment 2 Cor Nouws 2011-08-26 14:51:21 UTC
Hi Bill,
I get the impression - but would need to read your posting more often - that it is quite an interesting document. Would you mind sending me a copy? 
thanks - Cor
Comment 3 Bill Gradwohl 2011-08-26 19:34:51 UTC
(In reply to comment #2)
> Hi Bill,
> I get the impression - but would need to read your posting more often - that it
> is quite an interesting document. Would you mind sending me a copy? 
> thanks - Cor

Sent you a copy to your private email address as the info in the spreadsheet isn't public.
Comment 4 Bill Gradwohl 2011-09-21 09:59:11 UTC
(In reply to comment #2)
> Hi Bill,
> I get the impression - but would need to read your posting more often - that it
> is quite an interesting document. Would you mind sending me a copy? 
> thanks - Cor


Cor:
I sent you a copy of my document quite a while ago as you requested. 

Have you discovered anything yet?
Comment 5 Cor Nouws 2011-09-25 13:47:17 UTC
(In reply to comment #4)

> I sent you a copy of my document quite a while ago as you requested. 
> 
> Have you discovered anything yet?

Sorry, did not made enough time for a good study - and it does look complicated/large. 

Did you ever experience any difference with different versions of LibreOffice (OpenOffice)?
Do you think there is a stripped down version thinkable that would help to analyse the source of trouble?
Comment 6 Bill Gradwohl 2011-09-25 14:26:12 UTC
(In reply to comment #5)
> Did you ever experience any difference with different versions of LibreOffice
> (OpenOffice)?
This problem was only discovered under LO, but that's only because the machine used is Fedora 15 with LO. I don't have another similar machine running OO to test with.
> Do you think there is a stripped down version thinkable that would help to
> analyse the source of trouble?
No. This spreadsheet, when broken, is so sensitive to any changes that trying to strip it down is impossible. Try deleting one of the T1 to T10 sheets to see what I mean. Usually, doing so appears to work just fine, as the spreadsheet continues to function normally, but a save and reload fails due to corruption. Just moving a sheet from one position to another appears to work, but a save and reload usually fails.

I've used this spreadsheet for several years in our business. When it starts to go bad, it does all sorts of strange things, and by then it is too sensitive to touch to try to strip it down.

I'm a professional software developer. I spent 30 years writing code on mainframes and PC's. That experience tells me that, although I haven't looked at the source code, the problem is with OO's writing of the xml file. 

OO/LO writes a file (save) that it can't read the next day, or reads and then misinterprets what it read. On numerous occasions the last save of the day produced a file that couldn't be opened the next day due to file corruption, even though the spreadsheet ran fine up to the last save of the day.

Someone needs to seriously look at the conversion from what the spreadsheet looks like in memory to a version represented in xml. I'm convinced that's where the problems are injected. Due to the backup system I wrote specifically to track this problem, I have dozens to hundreds of versions of this spreadsheet as it evolves during a day of use. Analysing those copies has shown huge sections of rubbish that when I remove it, produces a file that will again at least load, and sometimes also function as expected. 

How did that rubbish get into the file?? Obviously, LO put it there by misinterpreting what was in operating RAM at the time. That's how buttons shrink - by misinterpreting something and writing out the xml of the misinterpretation.
Comment 7 Björn Michaelsen 2011-12-23 12:20:39 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 8 Florian Reisinger 2012-08-14 13:57:15 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 9 Florian Reisinger 2012-08-14 13:58:37 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 10 Florian Reisinger 2012-08-14 14:03:10 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 11 Florian Reisinger 2012-08-14 14:05:24 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian