In addition to DK Bose's answer, in case you want to manipulate the file manually:
You are right, window size (and position) are stored in ~/.config/libreoffice/4/user/registrymodifications.xcu when you close the last window of e.g. Calc.
The prop is called ooSetupFactoryWindowAttributes, and there is one for each document type (Drawing, Presentation, Spreadsheet, Text) (and one for the StartModule).
For example, the following line describes the WindowAttributes of Impress:
<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.presentation.PresentationDocument']"><prop oor:name="ooSetupFactoryWindowAttributes" oor:op="fuse"><value>56,29,1864,1051;53;56,29,1864,1051;</value></prop></item>
The value of that prop can be interpreted as follows:
x-pos,y-pos,width,height;window-state;maximized-x-pos,maximized-y-pos,maximized-width,maximized-height;
Position and size are pixels, window-state is the decimal representation of a 7-bit bitmask, where, according to the vcl source code (API documentation available here):
Normal = 0x0001,
Minimized = 0x0002,
Maximized = 0x0004,
Rollup = 0x0008,
MaximizedHorz = 0x0010,
MaximizedVert = 0x0020,
FullScreen = 0x0040,
The 53 in the example above means:
53(dec) == 110101(bin) == Normal|Maximized|MaximizedHorz|MaximizedVert
You can change those values manually, but probably not all of them will be respected. On my Kubuntu 18.04, only width,height, Minimized, Maximized[Horz|Vert] and Rollup have any effect.
libreoffice-calc 1:6.2.5-0ubuntu0.19.04.1 amd64
Using X and Gnome
Somewhere in the confusing mass of .* directories in my home directory must be stored the parameters of the last calc window used. But where? Does that depend on any of those things you asked for?
– Oliver Elphick Jul 19 '19 at 08:20However I would still like to know where all this data is stored. Looking for recently changed files suggests .config/libreoffice/4/user/registrymodifications.xcu and .pack. But where is the documentation?
– Oliver Elphick Jul 19 '19 at 08:38