Thursday, December 5, 2019

Fixed a terrible regression

There was a bug tdf#128133 about "muddy fonts in LibreOffice GUI with 125% scale in Windows". I have 125% scaled GUI on all my machines with Windows because I have a bad vision. And that bug was very terrible for me. 
The bug was a regression but we have couldn't to find a bad commit using bibisect process. We just have had wrong result.
And finally, Jan-Marek Glogowski have found a problem and yesterday he fixed it!
Thank you very much!

Friday, November 29, 2019

Filter by months and years in Calc pivot table

I have a huge spreadsheet with many data about work days and hours of special construction machinery with a date of work. There is a pivot table created from that data, where I can see number of hours for every object by type of the machinery. And I need to have a filter by month and years in the Calc pivot table.
But I got a problem when I wanted make a filter using normal pivot table control functionality. I moved Date field to Page fields area: 
and I had a filter by Date in Pivot table, but...
I can't select monts or years there, only days! I want have opportunity like in the Autofilter:
Can I get it in the Pivot table? Yes (nearly)! There are several methods for it.
First, I can add additional columns to the source table, one for month number with formula like =MONTHS(<link_to_cell_with_date>) and second for years with formula like =YEAR(<link_to_cell_with_date>). And I'll have the source table like this:
Then I should change a source in my Pivot table's properties dialog and drag Mounth and Year items to Page fields area. And I have next:
It works fine, I can select months (one or several) and years (one or several), but can I make it without any additional column in my source table? Yes, I can.
Second method is creating of filters by months and years using Pivot table's parameters and grouping.
Open the Pivot table's properties dialog and drag Date item from Page field area to Row fields area. Note, the Pivot table became very unusable, but that action was need us only for some magic. Then select any cell with date in Pivot table and press F12 key (or use menu Data->Group and Outline->Group). It will open a Grouping dialog:
Check Months and Years items there and press OK button. The Pivot table became less unusable ;-) Then need to open Pivot table's properties dialog and drag Date and Years items from Row fields area to Page fields area and close the dialog. Now I have my filters with months and years:
I see some problems in the appearance of filters in second method. 
I can't change name Date to Months! Interesting than I can change filed name in MS Excel in that case. MS Excel allows to set a custom name for the field. 
And both filters have some boundary values like <11/01/2017 and >04/05/2019. I don't know why does it need, but they are.
The second method looks very strange and not obvious. In general that actions is a full copy from MS Excel and I don't like a process, but I need a result of that magic.
The same Russian post is here.

Monday, November 25, 2019

Charts in Writer documents

If you use LibreOffice Calc, then you know it can insert charts to sheet using some data from selected cell range (if not, then it's a pity). LibreOffice Writer allows to make the same. There are two variants for insertng charts into text document:
1 variant. You just use menu Insert->Chart or icon on toolbar. Will be insert a default chart:
Then you should customize your chart using tools on special toolbar (select type of chart, add legend, etc.). And in that case you should add your data in an internal table manually:
That dialog is very uncomfortable. If your data will be update, then you should be change data in that internal table in chart editing mode.
2 variant. You already have some table with your data in your Writer document. Click inside of your table and select Insert->Chart. It opens a chart wizard instead simple default chart! That wizard is the same as in Calc:
You can customize your chart as you want there. Note, there are already data range in the field on wizard's step two. And that data range is from your source table!
Possibly, you should change it! 
Note, a table name is default in that field (Table1). If you'll plan to have many charts from many tables in your text document, then give them unique names before creating of charts.
There is a bonus in using of variant 2. The chart will be autoupdate after changing a data in the table!
Attention! That autoupdate mechanism was changed in LibreOffice 5.3 for perfomance optimization. Unfortunately, now you should enter to chart edit mode and exit from it at once after changing of data in the table for updating of chart=( There is a bug about it and I hope someone fix it.
Note, a chart from table will be created above table! But after creating of chart you can move it into another place in your document. Link will be saved. 

Sunday, November 24, 2019

The best LibreOffice extensions. Formatting of all Math formulas

So, there is another one the best LibreOffice extension for you! If you have many number of Math formulas in your Writer, Calc, Draw or Impress document, then you know you can't change font and font size for these objects for one time. You should open its one-by-one and change these parameters manually in Math editor. Ugly!
Our extension Formatting of All Math Formulas allows you change only font or only font size or both for ALL Math formulas in your document for one time! Or you can select only several Math formulas and make your changes only for it.
Download the extension by link above, install it. In LibreOffice you'll find it in Tools->Add-ons->FaF. When you start it you'll see a dialog:
If you want to change only font size, then uncheck "Enable changing of font" option, set up needed font size in the field and press "Formatting..." button.
If you want to change only font, then uncheck "Enable changing of font size" option, select font from drop-down list (you can start to type font name from first letter for faster searching), and press "Formatting..." button.
If you selected only several Math objects from all before start of the FaF dialog, then will be available "Formatting only in selection" button.
After all changings for all Math objects you'll see a "Done" message with OK button.
If you don't want to make any changes, then just press Close button.
Enjoy!

Monday, November 18, 2019

Automatic row numbering in the Writer tables

Often we have a Writer table with some numbering in its first column. And when you delete some rows from the table, then you should to make your numbering in first column anew.
There is a beautiful method for that case special for you! After that you shouldn't re-create your numbering in the table.
Just make next steps:
1. Create a table in Writer
2. Select needed column or several cells in column
3. Press Toggle Numbered List icon on toolbar (or select some list style on the Sidebar)
4. Now you have AUTOMATIC numbering of table rows!
For example, you created a numbering for 10 rows. Try delete 5th and 6th row. Your numbering is updated automatic and you have numbering from 1 to 8. And if you insert two row between existing rows with numbering, then you'll get numbering from 1 to 10 automatic also.
You can disable that numbering using the same way as when you created it. Just select cells with numbering and press Toggle Numbered List icon.
The same Russian post is here.

Sunday, November 17, 2019

LibreOffice 6.4 beta 1 is available

LibreOffice 6.4 beta 1 is available for downloading now. There are builds for all main OS for 64 bit. There is a 32 bit build for Windows also.
These builds are only for testing.
Links for downloading below:
Source code
Description of fixed bugs in LibreOffice 6.4 beta 1 compare with LibreOffice 6.4 alpha 1 is by link.
If you found a bug in LibreOffice 6.4 beta 1, then please file a bug reprort in our Bugzilla.

Tuesday, November 12, 2019

Calculations inside of Writer tables

Possibly, not all people know it can to make calculations inside Writer tables like in the Calc. But there are only 25 functions for use inside Writer tables, but Calc has over 400 functions.
To start use functions inside Writer tables you should left click into cell and then press key F2 or "=" on keyboard, or use "Formula" icon on Table toolbar. It shows a Formula bar like in the Calc.
There are Cell address field, Functions drop-down list, Cancel button, Apply button, Formula field on that bar.
Note, links to cells in Writer tables look as <A1> or <B3>. Cell ranges look as <A1:A10> or <A1:D12>.
After the Formula bar appeared you can select functions from drop-down list or can write a formula manually inside the Formula field after equal sign at once.
You can make calculates not only inside one Writer table. You can use values from many tables inside one Writer document. Use link to cell with table name like <Table2.A1>.
Attention! If you made in your formula a link to cell from another table and then changed that table's name, then you'll see an error in the cell like "** Expression is faulty **"! So, you should rename all your tables before you start create formulas inside these tables.
MS Word allows calculations in its native table too. But there are some differences between MS Word and LO Writer in that case.
First - difference between functions sets:

LibreOffice Writer table`s functions
MS Word table`s functions
SUM
SUM
ROUND
ROUND
PERCENT -
SQUARE ROOT -
POWER -
LIST SEPARATOR -
EQUAL -
NOT EQUAL -
LESS THAN OR EQUAL -
GREATER THAN OR EQUAL -
LESS -
GREATER -
BOOLEAN OR
OR
BOOLEAN XOR -
BOOLEAN AND
AND
BOOLEAN NOT
NOT
MEAN
AVERAGE
MINIMUM
MIN
MAXIMUM
MAX
SINE -
COSINE -
TANGENT -
ARCSINE -
ARCCOSINE -
ARCTANGENT -
COUNT (starting from 7.1)
COUNT
ABS (starting from 7.1)
ABS
-
DEFINED
-
FALSE
-
IF
-
INT
-
MOD
PRODUCT (starting from 7.1)
PRODUCT
SIGN (starting from 7.1)
SIGN
-
TRUE

Second - in the Writer you type a formula into Formula bar like in the Calc, but in the MS Word you type a formula into the different dialog window.
Third - you can click on cells in the Writer tables when you create a formula, but in the MS Word you can't make it
Fourth - Writer can automatically recalculate result of formula when you change source values, but MS Word can't.
ps: if there is a formula inside a Writer table, then you'll never know about it wihout tooltip! Cell with formula looks like any another cell without formula in the table=(

Sunday, November 10, 2019

The best LibreOffice Extensions. Remove Duplicates Fast

There are many good extensions for LibreOffice. You can find it all on site https://extensions.libreoffice.org/. I want to tell you about the best from it.
So, there is an enhancement 85976 about adding of Remove Duplicates feature to LibreOffice Calc. That is really useful function and LibreOffice Calc isn't having it now.
However, there is Remove Duplicates Fast extension that adds need feature to Calc. It's a fork of another extension Remove Duplicates.
RDF allows you delete all row duplicates from selected range using values from one or more column. Just download it by link above, install and use it from Data menu.
Thanks to Mike Kaganski for great code writing.

Friday, November 8, 2019

Footnotes and Endnotes in LibreOffice Writer

It's translation of my Russian post about Footnotes and Endnotes to English.
What's Footnote? Wiki says us next:
A note is a string of text placed at the bottom of a page in a book or document or at the end of a chapter, volume or the whole text. The note can provide an author's comments on the main text or citations of a reference work in support of the text. Footnotes are notes at the foot of the page while endnotes are collected under a separate heading at the end of a chapter, volume, or entire work.
It looks in the text document so:
Note, the notes in the text are highlight by gray color. It made for help of users and will not be print on paper.
LibreOffice Writer can insert both types of notes: Footnotes and Endnotes.
On image above you see that footnotes places in bottom of page and endnotes places on latest page in the document. Page with endnotes is always latest page in the document. If you have last "empty" page in your document with even only one empty paragraph, then the endnotes page will be next page anyway.
Font size for footnotes and endnotes is smaller than basic font size in text body by default.
Use menu "Insert->Footnote and Endnote->Footnote" and "Insert->Footnote and Endnote->Endnote" to insert notes.
Notes have own options. You can find it in "Tools->Footnotes and Endnotes...". I think it needs to rename that item to something like "Foot/Endnotes settings".
The dialog has two tabs:
Here can set up numbering type, for Footnotes can to set up counting per page, per chapter or per document, can select paragraph ans symbol styles, etc.
Footnotes have else one place with some parameters. It's "Page style" dialog, "Footnote" tab:
Look at two options in Footnote area section. Its are responsible for footnotes area height on the page. If you select "Maximum footnote height" with small value and your footnote's text will be too long, then that text could be move to next page to its footnotes area. It may be unwanted. Also here you can customize Separator line between text body and footnotes area.
Next place with some parameters for notes is "Paragraph style" dialog for Footnote or Endnote. Select your Footnote (or Endnote), open Styles tab in the Sidebar, select Footnote (or Endnote) in the list of styles, right click and select "Modify":
Here you can change many options for text of footnotes.
Note, you can select any paragraph style for footnotes (or endnotes) text. Just for your convenience LibreOffice already has predefined styles. Footnote paragraph style is just style by default for footnotes.
Next thing that you'll want customize is note number view in the text body. Use options of Footnote (or Endnote) anchor symbol style. Find that style in the list of symbol styles in the Sidebar, right click on style name and select "Modify". Use "Font" and "Position" tabs in the dialog to customize view of note number.
Also Footnote text in bottom of the page has a number. If you want customize that number view, then use changing of "Footnote (or Endnote) characters" character style.
And, finally, there are pair of lifehacks for work with Footnotes and Endnotes in Writer text document.
First. Possibly you'll want to have two or more the same footnote number in the text body that will be link with only one footnote text in bottom of the page:
Make follow steps:
1. Insert first Footnote using menu "Insert->Footnote and Endnote->Footnote"
2. Second and all next the same number we'll be insert using dialog "Insert->Cross-reference...". In "Type" list select "Footnote", in "Insert reference to" list select "Reference, then press "Insert" button. You got link to the same footnote. But it looks like text body text. So...
3. Select your second footnote number in text body and apply to it "Footnote anchor" symbol style!
Second. Normally Endnotes place on latest page of the document. But there is a method for placing of Endnotes after end of text body at once.
1. Make sure you have all need Endnotes in the your document. 
2. Select all text using Ctrl+A.
3. Select menu "Insert->Section"
4. Go to Footnotes/Endnotes tab
5. Check "Collect at end of section" in Endnotes section
6. Press "Insert" button
Voila, we have Endnotes after text body at once.

Wednesday, November 6, 2019

New Table section was added to Writer Sidebar

Tamás Zolnai from Collabora added to Writer Sidebar new Table section. Now when you click inside a Writer table then you'll see in Sidebar new section with controls for handling of the table like "Add row", "Add column", etc.
It will be available in LibreOffice 6.4 that will be release in February 2020 year

Tuesday, November 5, 2019

Changing of cairo to skia inside LibreOffice

Developers of LibreOffice are making an experiment. They make changing of cairo to skia inside LibreOffice.
That change will be merge in to the master after branch of LibreOffice 6.4

Thursday, July 4, 2019

Changing of fonts in windows installer dialog of LibreOffice

Windows installer dialog of LibreOffice had old Tahoma font, but modern OS Windows (7 and newer) uses Segoe UI font for all UI elements. There is a bug about changing windows installer font in our bugzilla.
Our installer uses Windows MSI like many other Windows softwares. For changing any parameters of MSI it can use Orca tool. You can download it here.
After installing of Orca right click to LibreOffice installer file and select context menu item "Edit with Orca". It opens a dialog:
In left side of the dialog it shows the list of tables. Every table has some data (text of messages, size of controls, type of controls, etc). MSI uses these data for showing of installer dialogs.
To change of only font in the dialog we need TextStyle table. Select it:
On picture above you see a data for the TextStyle table. In this case it's just list of fonts. There are columns:
TextStyle - internal name (ID) for font. It using in other tables inside MSI.
FaceName - real font name as it's in your OS Windows.
Size - font size.
Color - font color.
StyleBits - format mark for font: 1 for bold, 2 for italic.
There are many different fonts in this table. But, in fact installer dialog windows use only three fonts from that list. I have checked it using Find dialog in the Orca tool.
Press shortcut Ctrl+F. It opens Find dialog. In a text field enter internal name of font and press Find button. Press F3 to find next occurence. You can see the dialog don't use, for example, any Arial fonts, because there are no that font name in any tables except TextStyle.
So, in fact we need only three type of font: Default, Default Bold and Heading.
I changed internal name of fonts and all another options and got follow view of TextStyle table:
Because I changed internal font's names my next step was to change it in need other tables:
- in the Property table in DefaultUIFont row in Value column type our new internal font name - DialogDefault
- the Control table and the RadioButton table both had links to fonts like {&Tahoma8} in start of text phrase. But after review of my patch I have knew that these tables have special ID instead
phrase. It have made for localization. I'll write about it some later.
In general it were all changings for adding new fonts in to installer dialogs.
But because Segoe UI font is bigger than Tahoma and because we used font size 9pt instead 8pt our text became out of special text area. It just crops by text areas border. All sizes of dialogs and text areas inside dialogs hard coded in the same MSI tables. Then we should change it too.
At first I checked view for all dialog windows using menu Tool->Dialog Preview. It opens follow window in Orca:
There are 31 dialog windows in the LibreOffice installer include some error and information messages. Select a dialog from the list (don't need to open sublevels) and push Preview button. Look at dialog preview. It created the preview using current values from MSI table. For close the preview just click out of preview or push Done button.
To show all text we should increase some text areas but text areas should fit inside dialog window. So we should increase size of dialog windows too.
I began from changing of size main dialog windows. It all had size 374x266 units (not pixels!).
Note: MSI uses for define of all sizes special installer unit. It equals 1/12 of MS Sans Serif 10pt size! It has made for scale of GUI opportunity in OS Windows.
Sizes of dialog windows are in the Dialog table in the Width and Height columns. For more easy next work I changed only width of main dialog windows, I increased it to 474 units.
Next step is size changing of the text areas and moving of controls inside dialog windows to new place because we increased width of the dialog windows. All values for it are in the Control table. We need next column in the table:
Dialog - an internal name of the dialog window
Control - an internal name of the control  
Type - a type of the control (image, text area, text field, button, checkbox, drop-down control or radiobutton)
Х - a distance from the left edge of the dialog window to the left edge of the control, in units
Y - a distance from the top edge of the dialog window to the top edge of the control, in units
Width - a width of the control, in units
Height - a height of the control, in units
Text - a label on the control. We'll look at this value to understand which control we are moving or changing.
I made follow:
- if I touched a button then I increased the X value by 100 units. (Button Help was an exception, because it is on the left part of the dialog window and shouldn't move anyway in our case). 
- if I touched other controls then I increased the Width value by 100 units.
After changing all values for one dialog window I looked at it using Preview function. If it was OK then I started change next.
In final I exported changed tables in to files using menu Tables->Export Tables. Select need tables in the list, select Output directory and push OK button.
There are the same tables with MSI options in the source code of LibreOffice. It's the most important thing. Now we can just change files with tables in the source code by our tables from Orca. Right? No!
Files in the source code almost the same, but it isn't the same as Orca shows! There are differences in file name, in inside structure. It's a link to all MSI tables in the source code of LibreOffice.
For minimize of changing in the source code my mentor Mike Kaganski asked me rework my first patch, special the file with Control table. It was difference in sorting of rows between source code file and my file.
And I changed else one file - Control.ulf (It's here) that we didn't touch in Orca. That file has all text strings from dialog windows with its ID. It's a part of localization mechanism for our windows installer.
And last problem was a banner. It's image from top part of the main dialog windows (the new dialog window is left):
Look at top image with 6 on the left window and compare it with the same on the right window.
We increased width of the dialog window and width of the image area, but we didn't change banner image! And our banner is stretchet now.
It's a link to banner in the source code. I downloaded it and changed it using the GIMP. Banner had width 499px (image uses pixels!) and I added width to 632px (just 499/374*474=632).
It's all. The patch was merged in to source code and you can look at new view of installer dialog windows yourself now.