summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-06-17 14:10:09 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-06-17 14:42:42 +0900
commitefc5602dd3a2c2c138e0290e58ed1527523e4dcf (patch)
treea810f32ce08d11fc621fb0bb2f3e05eecfc2101f
parent343f992816ab594c608537fd32fb4bf412f5fabb (diff)
tdf#91748 fix preview of special characters
Change-Id: Icf18e8be2ec07bb4bcd6edce3e41a6e88ecefca7 (cherry picked from commit 56d62036862462ca7147686268558a754613858f)
-rw-r--r--cui/source/dialogs/cuicharmap.cxx17
-rw-r--r--cui/source/inc/cuicharmap.hxx1
2 files changed, 11 insertions, 7 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 958942366fd9..89f63ef853c0 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -184,6 +184,8 @@ VCL_BUILDER_FACTORY(SvxShowText)
void SvxShowText::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{
+ rRenderContext.SetFont(maFont);
+
Color aTextCol = rRenderContext.GetTextColor();
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
@@ -268,13 +270,14 @@ void SvxShowText::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
void SvxShowText::SetFont( const vcl::Font& rFont )
{
long nWinHeight = GetOutputSizePixel().Height();
- vcl::Font aFont = rFont;
- aFont.SetWeight( WEIGHT_NORMAL );
- aFont.SetAlign( ALIGN_TOP );
- aFont.SetSize( PixelToLogic( Size( 0, nWinHeight/2 ) ) );
- aFont.SetTransparent( true );
- Control::SetFont( aFont );
- mnY = ( nWinHeight - GetTextHeight() ) / 2;
+ maFont = vcl::Font(rFont);
+ maFont.SetWeight(WEIGHT_NORMAL);
+ maFont.SetAlign(ALIGN_TOP);
+ maFont.SetSize(PixelToLogic(Size(0, nWinHeight / 2)));
+ maFont.SetTransparent(true);
+ Control::SetFont(maFont);
+
+ mnY = (nWinHeight - GetTextHeight()) / 2;
Invalidate();
}
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index 3a653257b2cb..d06f55a33fd6 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -55,6 +55,7 @@ protected:
private:
long mnY;
bool mbCenter;
+ vcl::Font maFont;
};