Bug 148615 - Grid settings in Draw not properly set upon loading file
Summary: Grid settings in Draw not properly set upon loading file
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.3.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-15 16:14 UTC by Scott
Modified: 2022-04-20 01:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Draw file with specific grid settings (39.71 KB, application/vnd.oasis.opendocument.graphics)
2022-04-15 16:17 UTC, Scott
Details
Opened document showing wrong settings (157.14 KB, image/png)
2022-04-16 13:36 UTC, Scott
Details
Showing proper "Load" setting (59.89 KB, image/png)
2022-04-16 13:37 UTC, Scott
Details
Shows Unit of measurement is not inches (14.77 KB, image/png)
2022-04-16 13:38 UTC, Scott
Details
Screenshot from attachment 179589 (9.65 KB, image/png)
2022-04-16 16:42 UTC, Regina Henschel
Details
Metric coordinates displayed in inches (35.88 KB, image/png)
2022-04-16 18:10 UTC, Scott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott 2022-04-15 16:14:17 UTC
Description:
I have various Drawings generated with Draw with different grid settings. I noticed when I load a Drawing to work on it items would be off grid and a mess. Figured out it was because the Grid settings are not properly set for each drawing when the drawing is loaded.

Steps to Reproduce:
1. Open Draw
2. Set Tools | Options | General | UOM : Inch
3. Set Tools | Options | Grid : Snap to Grid:on + Visible Grid:on + H/V= 1.00" + H/V Spaces=5
4. Apply
5. Close Draw
6. Open Draw
7. Verify the previous settings
8. Open grid1.odg
9. Check the Options to see if they agree with file settings



Actual Results:
When I perform these steps and check the grid settings I find the Grid H/V settings are 2.54 cm.

Expected Results:
The Grid H/V settings should be 1.00 cm.


Reproducible: Always


User Profile Reset: No



Additional Info:
I can reproduce this on two different windows 11 computers.
I can reproduce many variations of this problem opening and closing files with different grid settings.
OpenGL doesn't seem to make a difference.
Comment 1 Scott 2022-04-15 16:17:44 UTC
Created attachment 179589 [details]
Draw file with specific grid settings
Comment 2 Regina Henschel 2022-04-16 12:50:23 UTC
Not sure whether I understand you correctly. If I open a document it always uses the grid stored in the document. The grid settings in Tools > Options are used, when generating a new document. They do not reflect the grid settings of the current active document. Only if you change the settings, then the changed values are used for the active document.
Grid settings are stored in hundredths of a millimeter in the file.

If the document does not show the grid as it was when last saved, then perhaps the settings are not load? Please have a look whether the option "Load user-specific settings with the document" is checked in section 'Load' in Tools > Options > Load/Save > General.
Comment 3 Scott 2022-04-16 13:34:35 UTC
This morning I followed the procedure I outlined above and got the results shown in the attached images. The images show the document and coordinates when I last saved the document as well as my current settings. As you can see there are several issues. The Grid H/V=2.54cm not 1.00cm. Also the selected rectangle Position and Size are shown in inches even though the "General UOM" is Centimeter (that might be a related but separate bug). The setting you ask about ( "Load user-specific settings with the document") is set properly.

I performed the following steps with the indicated result:

1. I opened and closed the document several times in a row without changing anything (and thus without saving anything). Each time the results were incorrect the same as the images show.

2. After closing Draw I reopened it with no document.
3. I changed the options settings to reflect the desired document settings for this document.
4. Then I reopened the document from "Recent Documents" and all settings were correct. The document was fine.

Then I performed the procedure again outlined in my original submission and the settings were incorrect as indicated.

This is very repeatable for me.
Comment 4 Scott 2022-04-16 13:36:51 UTC
Created attachment 179610 [details]
Opened document showing wrong settings
Comment 5 Scott 2022-04-16 13:37:51 UTC
Created attachment 179611 [details]
Showing proper "Load" setting
Comment 6 Scott 2022-04-16 13:38:49 UTC
Created attachment 179612 [details]
Shows Unit of measurement is not inches
Comment 7 Scott 2022-04-16 13:43:48 UTC
Just thinking about my results it appears one of two things is happening:

1. My settings are not stored in my document (something you can check I presume).
2. My verion of Draw isn't loading them when I open the file.
Comment 8 Regina Henschel 2022-04-16 16:42:58 UTC
Created attachment 179614 [details]
Screenshot from attachment 179589 [details]

The attachment 179589 [details] has grid 1000 (=1cm) for wide gride and 200 (=0.2cm) for fine grid. That it exactly what is shown in the opened document. The ruler has 30, 40, 50... because scaling is 1:10. From one line to the next is 1cm as it should be and there are 5 spaces between two grid lines, exactly as it should be. So for me here the document is rendered correctly.

Again, the values in Tools > Options > Draw > Grid are not designed to reflect the settings of the active document.
Comment 9 Scott 2022-04-16 18:09:05 UTC
I see now that you are totally correct. I can see that I misunderstood and thus misstated the bug. The coordinates are in fact stored and restored with the document as they should be. The problem is the display parameters when the document is reloaded.

Let's say I create a document with certain grid/unit parameters, save and later reload it. In the newest attachment would you say that the fact that the "Position and Size" are displayed in inches is a bug? Given that the "Tool | Options" are only associated with document creation and I want to work with these parameters in centimeters how should I manage that?

I think that's a bug but not the bug I initially described. This is new to me so I'm not sure how to proceed. Do you agree there's a bug and if so should this thread be closed and refiled differently?
Comment 10 Scott 2022-04-16 18:10:11 UTC
Created attachment 179615 [details]
Metric coordinates displayed in inches
Comment 11 Regina Henschel 2022-04-16 21:30:03 UTC
The unit of the Position&Size dialog is not determined by the document but by your "Locale setting". Go to Tools > Options > Language Settings > Languages. Look at section "Formats" > Locale setting. In your case it should be "Hungarian". I use "German". If it is "Default - English(USA)" the dialog will use inches.
Comment 12 Scott 2022-04-17 15:50:09 UTC
1. Your answer suggests that you do not think it's a bug for the Position & Size (P&S) box to show dimensions in inches when the original and current "Unit of Measure" is Centimeters. Is that your position?

2.Furthermore you indicate the solution if I want the dimensions to show as Cm instead of inches is to change the "Locale" setting to some foreign country. So you are saying when I decide what Unit of Measure I want to use on a new drawing that I have to change my Locale setting irrespective of my actual Locale. Am I understanding that correctly?

3. In any case with the example I last cited I followed your advice and changed the Locale to "Hungarian" and to several variations of "German." The P&S continued to display in inches. 

Thus it is my contention that if a document is created with UOM=Centimeters and then saved that when it is reopened the P&S dimensions should show as Centimeters and not inches.
Comment 13 Regina Henschel 2022-04-17 22:02:28 UTC
So your problem is not the grid but the unit of the 'Position and Size' section in the sidebar. Please write a new bug report for that.

Please try a current developer build. You can install it parallel to your normal LibreOffice version. It seems, that there are changes in the behavior of the 'Position and Size' section from LO 7.3 to LO 7.4.
https://dev-builds.libreoffice.org/daily/master/