summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-05-16 01:25:19 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2019-05-22 23:00:45 +0200
commitcc223fa12a61ba0e580b884386a7f5d7efd0541f (patch)
tree62184f16ce568b083fae06dd0585f0a193c95e10 /include
parent9b6a9a1f50a6d7326e97b02618e9bd5e44fb5832 (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 'include')
-rw-r--r--include/vcl/texteng.hxx3
-rw-r--r--include/vcl/vclmedit.hxx5
2 files changed, 6 insertions, 2 deletions
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
index 7e6c9d452590..95da903bc1d4 100644
--- a/include/vcl/texteng.hxx
+++ b/include/vcl/texteng.hxx
@@ -106,6 +106,7 @@ class VCL_DLLPUBLIC TextEngine : public SfxBroadcaster
std::unique_ptr<LocaleDataWrapper> mpLocaleDataWrapper;
vcl::Font maFont;
+ vcl::Font maOrigFont; // original font from SetFont
Color maTextColor;
sal_Int32 mnMaxTextLen;
@@ -220,7 +221,7 @@ public:
sal_Int32 GetTextLen( const TextSelection& rSel ) const;
void SetFont( const vcl::Font& rFont );
- const vcl::Font& GetFont() const { return maFont; }
+ const vcl::Font& GetFont() const { return maOrigFont; }
void SetLeftMargin( sal_uInt16 n );
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
index d52d040d028e..23381f5f8443 100644
--- a/include/vcl/vclmedit.hxx
+++ b/include/vcl/vclmedit.hxx
@@ -98,7 +98,10 @@ protected:
TextView* GetTextView() const;
ExtTextEngine* GetTextEngine() const;
- virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
+ void ApplySettings(vcl::RenderContext&) override;
+ void ApplyBackgroundSettings(vcl::RenderContext&, const StyleSettings&);
+ void ApplyFontSettings(vcl::RenderContext&, const StyleSettings&);
+
public:
VclMultiLineEdit( vcl::Window* pParent,
WinBits nWinStyle );