diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-05-16 01:25:19 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-05-22 23:00:45 +0200 |
commit | cc223fa12a61ba0e580b884386a7f5d7efd0541f (patch) | |
tree | 62184f16ce568b083fae06dd0585f0a193c95e10 /vcl/source/edit/texteng.cxx | |
parent | 9b6a9a1f50a6d7326e97b02618e9bd5e44fb5832 (diff) |
VCL keep / return the original set TextEngine font
TextEngine::SetFont copies the font parameter and then modifies
its color, transparency, fill color and alignment, so passing the
same font again will not be detected as the same font.
Therefore this patch stores the original font in addition to the
modified one and also returns that one on the GetFont call.
This allows us to merge the font setup in VclMultiLineEdit's
ImplInitSettings and ApplySettings into a common function.
Change-Id: I618d283ecd0ae14faf9b87a3aceec6ca1c37b526
Reviewed-on: https://gerrit.libreoffice.org/72788
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/source/edit/texteng.cxx')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 097305df51c7..b6835dbc07a2 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -170,8 +170,9 @@ void TextEngine::SetActiveView( TextView* pTextView ) void TextEngine::SetFont( const vcl::Font& rFont ) { - if ( rFont == maFont ) + if (rFont == maOrigFont) return; + maOrigFont = rFont; maFont = rFont; // #i40221# As the font's color now defaults to transparent (since i35764) @@ -206,9 +207,9 @@ void TextEngine::SetFont( const vcl::Font& rFont ) for ( auto nView = mpViews->size(); nView; ) { TextView* pView = (*mpViews)[ --nView ]; - pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); + pView->GetWindow()->SetInputContext(InputContext(maFont, !pView->IsReadOnly() + ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE)); } - } void TextEngine::SetMaxTextLen( sal_Int32 nLen ) |