10

Due, I think, to some clumsiness with the mouse, a calc window got reduced to an invisible size. This got stored as the default for the next opening of a file. Now any calc file I open comes up invisible and I cannot do anything with it. Where can I find where this format is stored so as to delete it and get back to normal?

Ubuntu 19.04 ibreoffice-calc 1:6.2.5-0ubuntu0.19.04.1 X and Gnome

DK Bose
  • 44,553

5 Answers5

7

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.

danzel
  • 6,533
5

Just had this problem, found a simple solution here.

While Calc is your current program, use Alt + Space to force the window to maximize again, or resize to wherever you want it.

ThunderBird
  • 1,963
  • 13
  • 22
  • 31
Alex
  • 51
3

Default window position and size for Calc, Writer and other modules are stored in LibreOffice configuration. You can reset the defaults from the Expert Configuration window.

To open it, go to menu Tools > Options > LibreOffice > Advanced > Open Expert Configuration, then search for FactoryWindowAttributes (search is not case sensitive).

This will list several items, one for each LibreOffice module, such as Writer (TextDocument) and Calc (SpreadsheetDocument). Names are self explanatory.

Double click on the one related to Calc, and reset it, deleting the current value, and click OK. Then click OK on the other configuration windows to save your preferences.

Expert configuration window screenshot

gerlos
  • 2,904
1

LibreOffice stores information about window size and placement in ~/.config/libreoffice/4/user/registrymodifications.xcu which is an xml file.

The registrymodifications.xcu file is not meant to be accessed by the average user. However, if you go into Tools > Options > Advanced, you'll see a button labelled Open Expert Configuration. Clicking this button opens a window containing the contents of registrymodifications.xcu and maybe other stuff as well. You can identify the line storing your last used window size and position if you know what to look for.

Because I'm not an expert, I took another route. I used xwininfo to check a LibreOffice Writer window:

  Absolute upper-left X:  556
  Absolute upper-left Y:  337
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 747
  Height: 353
  Depth: 24
  Visual: 0x10e
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x5400002 (not installed)                        
  Bit Gravity State: NorthWestGravity                        
  Window Gravity State: NorthWestGravity                     
  Backing Store State: NotUseful                             
  Save Under State: no                                       
  Map State: IsViewable                                      
  Override Redirect State: no                                
  Corners:  +556+337  -63+337  -63-78  +556-78               
  -geometry 747x353-63-78                                    

Then, I opened a copy of ~/.config/libreoffice/4/user/registrymodifications.xcu and searched for lines containing 747 (based on the -geometry). That got me just the one line:

<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.text.TextDocument']"><prop oor:name="ooSetupFactoryWindowAttributes" oor:op="fuse"><value>556,337,747,353;1;0,0,0,0;</value></prop></item>

Now, I knew what to search for in the Expert Configuration window I mentioned earlier. That window has a Help button offering some documentation in case you want to look deeper into matters.

Expert Configuration

DK Bose
  • 44,553
0

This is EASY In Libre Office && the same in CALC~!! It's a setting from within libre office & Calc.

  1. open a document and get it how you want the documents to open. You can include font margins, etc.
  2. Navigate to FILE, then TEMPLATE, then SAVE AS TEMPLATE and in the popup, name something "normal" and put it in "My Templates." Save and quit. Done