Bug 73617 - After selecting cells containing two different fonts, toolbar font selector constantly resets to blank, goes to top of list
Summary: After selecting cells containing two different fonts, toolbar font selector c...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.0.beta1
Hardware: Other All
: medium normal
Assignee: Maxim Monastirsky
URL:
Whiteboard: target:4.4.0 target:4.3.5
Keywords: bibisected, regression
: 76162 80604 86826 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-14 17:10 UTC by tmacalp
Modified: 2015-12-17 07:35 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tmacalp 2014-01-14 17:10:50 UTC
Description
In Calc, if you select cells that contain different font types, it causes issues with the font selector drop-down.  From what I can tell, either using the scroll bar, scrolling down with the mouse wheel, using the arrow keys, or even keying in another font will cause the font selector to revert back to displaying None.  This causes the selection to go back up to the top of the list.

Steps to reproduce
* Create a new spreadsheet
* Change the font in B1 to some font other than the default
* Select A1:B1
* Click on the dropdown arrow in the font selector (pulls up list of fonts)
* Scroll down using mousewheel, pressing down arrow, typing, etc...

Expected
We should be able to select and apply any font, without having to race the dialog resetting.

Actual
Font selection is "reset" back to blank and keeps resetting to blank each time you try to select any other font.  If you're quick, you can click on a font and that font is applied to the selection.

Notes
This behavior of setting the font selector to blank is what happens when you first make your selection that includes multiple font types.  That's the intended behavior, since it can't show more than one font.  But after that point, it should never have to reset back to blank again.

Versions tested
I tested a number of versions and it seems that this bug was introduced with the 4.1.x line and also affects the 4.2.0.1 prerelease.  4.0.x versions are unaffected.

AFFECTED
LibreOffice 4.1.3.2 under 32bit Fedora 17
LibreOffice 4.2.0.1 under 32bit Fedora 17
LibreOffice 4.1.4.2 under 64bit RHEL6
LibreOffice 4.1.4.2 under 32bit Windows7

NOT AFFECTED: 
LibreOffice 4.0.6.2 under 32bit Fedora 17
OpenOffice 3.2.1 under 64bit RHEL6
Comment 1 Cor Nouws 2014-01-14 19:52:51 UTC
Hi 

thanks for the issue. I see the same in 4.2.0.2. As long as the mouse pointer is over the scroll bar, I can go down. As soon as the mouse pointer is over the list, the focus jumps back.

(There was a similar issue some time ago for the list behaviour, but without more fonts in the selection involved - cannot find it now)

See it in 4.1.0rc1 (do not have the alpha versions here) is OK in 4.0.6.2
Comment 2 Urmas 2014-10-06 00:31:11 UTC
*** Bug 76162 has been marked as a duplicate of this bug. ***
Comment 3 raal 2014-10-23 18:54:05 UTC
 git bisect log
# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# bad: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect bad e02439a3d6297a1f5334fa558ddec5ef4212c574
# good: [8f4aeaad2f65d656328a451154142bb82efa4327] source-hash-1885266f274575327cdeee9852945a3e91f32f15
git bisect good 8f4aeaad2f65d656328a451154142bb82efa4327
# good: [9995fae0d8a24ce31bcb5e9cd0459b69cfbf7a02] source-hash-8600bc24bbc9029e92bea6102bff2921bc10b33e
git bisect good 9995fae0d8a24ce31bcb5e9cd0459b69cfbf7a02
# good: [8ad82bc1416a07501651e8d96fe268e47d3931d3] source-hash-13821254f88d2c5488fba9fe6393dcf4ae810db4
git bisect good 8ad82bc1416a07501651e8d96fe268e47d3931d3
# bad: [d084d250b04446535ca1d7c29cf2062e6bd042b3] source-hash-688f72e3a2c3ef923389bbd21f6aea3afe1114db
git bisect bad d084d250b04446535ca1d7c29cf2062e6bd042b3
# bad: [013adf05b6bf8e5d44a4e820d43177d7fb749079] source-hash-a16a4006e40bdb2cb4671846295fe2bf5a856e68
git bisect bad 013adf05b6bf8e5d44a4e820d43177d7fb749079
# good: [ff4b17247dc05a006a5c4c57dced132c87f2396c] source-hash-d74ba0c4147f33abd9d0c03883cc88f15e160ee5
git bisect good ff4b17247dc05a006a5c4c57dced132c87f2396c
# bad: [0e1044821fb18012f74e2c8fd79abba13944ac9d] source-hash-11b851d2f2f8ee6230b8c732d5b157e472c21be2
git bisect bad 0e1044821fb18012f74e2c8fd79abba13944ac9d
# bad: [4c57c51cf101def05bdde024fdc877a08ffd01ca] source-hash-e75ddb91c3d52ea9e6939325118cf906d971c41e
git bisect bad 4c57c51cf101def05bdde024fdc877a08ffd01ca
# bad: [fa884dc86639e1925692df2117e53599726e366d] source-hash-86fd1240bbbb8ee72899abc24daf5e4402a61add
git bisect bad fa884dc86639e1925692df2117e53599726e366d
# first bad commit: [fa884dc86639e1925692df2117e53599726e366d] source-hash-86fd1240bbbb8ee72899abc24daf5e4402a61add


Maybe this one "basic inplace Font preview for calc"? 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=dd763604784fe10ee06a2f9c1fddf74cdf890bcc
Comment 4 Maxim Monastirsky 2014-10-23 19:16:55 UTC
*** Bug 80604 has been marked as a duplicate of this bug. ***
Comment 5 Maxim Monastirsky 2014-10-23 20:11:18 UTC
(In reply to raal from comment #3)
> Maybe this one "basic inplace Font preview for calc"? 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=dd763604784fe10ee06a2f9c1fddf74cdf890bcc
That's right. It's due to invalidation of SID_ATTR_CHAR_FONT during live preview. Called from:

ScFormatShell::ExecuteAttr
  ScViewFunc::UpdateSelectionArea
    ScTabView::CellContentChanged
      ScTabView::InvalidateAttribs

When the selection consist of multiple fonts, it leads to the following code in SvxFontNameToolBoxControl::StateChanged:

if ( SfxItemState::DEFAULT == eState )
{
    ...
}
else
    pBox->SetText( "" );
Comment 6 Maxim Monastirsky 2014-10-23 23:02:27 UTC
Let's try with http://cgit.freedesktop.org/libreoffice/core/commit/?id=6ba8b7f5eacac969e4781d63718083a05491b1bc

Please test with a daily build that have this patch, and report here whether it fixes the bug for you.
Comment 7 Jean-Baptiste Faure 2014-10-24 04:32:46 UTC
Yes your patch fixes the problem for me, tested on master without and with your patch.
Version: 4.4.0.0.alpha1+
Build ID: 6ba8b7f5eacac969e4781d63718083a05491b1bc

built at home under Ubuntu 14.04 x86-64.


Best regards. JBF
Comment 8 Maxim Monastirsky 2014-10-24 08:53:21 UTC
Thanks JBF, so let's mark this one as fixed (backport to the stable branch to follow later).
Comment 9 Maxim Monastirsky 2014-11-29 17:52:46 UTC
*** Bug 86826 has been marked as a duplicate of this bug. ***
Comment 10 Robinson Tryon (qubit) 2015-12-17 07:35:04 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]