[Libreoffice-bugs] [Bug 134326] New: Text Grid should accept floating point font-size for base text and ruby

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jun 26 16:14:03 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=134326

            Bug ID: 134326
           Summary: Text Grid should accept floating point font-size for
                    base text and ruby
           Product: LibreOffice
           Version: 7.1.0.0.alpha0+ Master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: himajin100000 at gmail.com

Description:
see steps to reproduce.

Steps to Reproduce:
Preparation steps:

1. Run LibreOffice
2. Tools->Options
3. Language Settings->Languages
4. Make sure "Asian" checkbox under "Default Languages for Documents " is
checked.
I also set the Language to "Japanese", but this may not be necessary.
5. Apply
6. Quit LibreOffice
7. Run Writer
8. Tools->Options
9. LibreOffice Writer->General
10. check "Use square page mode for text grid" under Settings. Also, note that
font-size is in points, whatever measurement unit is set.
11. Apply
12. Restart LibreOffice

Main Steps:

1. Run Writer
2. (for comparison) In the "Formatting" toolbar, you will find a
FontSizeBox(COMBOBOX, not a spinbutton), and there you will find 10.5 pt.
This font-size is said to be used by Japanese government's official documents.

https://opengrok.libreoffice.org/xref/core/svtools/source/control/ctrltool.cxx?r=d077cd61#45
https://opengrok.libreoffice.org/xref/core/svtools/source/control/ctrlbox.cxx?r=fcce0642#962

3. Format ( in Main menu) -> Page Style
4. you will find "Text Grid" tab
5.  In the "Grid" section,  click "Grid (lines and characters)".  "Grid Layout"
section will be enabled.
6. In the "Grid Layout" section,  you will find "Max. base text size."
MetricSpinButton.
7. Input 10.5pt to the MetricSpinButton.
8. Leave the control(e.g. with Tab key) so that we can notify the program of
completion of our text input to the spinbutton. 

Actual Results:
The spinbutton's value changes to 11pt.
Previews, Max characters per line, Max lines per page are calculated based on
this 11pt.

Expected Results:
MetricSpinButtons hold floating point values. In this case, 10.5pt.


Reproducible: Always


User Profile Reset: No



Additional Info:
My guess( but just a guess ):

MetricSpinButton holds a floating point length, for example, 100.405 cm (=
100405 * 10^(-3) cm ), with an integer member variable( = 100405), a member
variable for the decimal digits(= 3) , and the measurement unit(= "cm").

When we change its unit from its initial unit through e.g. SetFieldUnit, the
decimal digits will be set based on the new unit. 
https://opengrok.libreoffice.org/xref/core/svtools/source/misc/unitconv.cxx?r=ec11b733#25 
Also, please note that MetricSpinButton constructor doesn't seem to call this
function.

I guess, the MetricSpinButton's unit hasn't changed since its initial value, 0.
(not that sure) 
https://opengrok.libreoffice.org/xref/core/vcl/source/app/salvtables.cxx?r=01e37e3e#5272
https://opengrok.libreoffice.org/xref/core/vcl/source/control/fmtfield.cxx?r=01e37e3e#657
https://opengrok.libreoffice.org/xref/core/svl/source/numbers/zformat.cxx?r=1861363d#221

I have one more concern.

when we call a method to try to get 100.405 in the example case,  the control
tries to caluculate 100405 / 10^3.
https://opengrok.libreoffice.org/xref/core/vcl/source/window/builder.cxx?r=7e4a3eee#240
but the return value seems to be of int type, not floating point type like
double.

This value is set to  SwTextGridItem::SetBaseHeight(int), yes this also take an
integer parameter, and this value seems to be used for layouting I guess.
https://opengrok.libreoffice.org/xref/core/sw/source/ui/misc/pggrid.cxx?r=eaeabd78#229

==================
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 642fc41cd7d080384658e10b30bb9d3b38a2cbd9
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: CL

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200626/2df9495c/attachment.htm>


More information about the Libreoffice-bugs mailing list