summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/cuicharmap.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/dialogs/cuicharmap.cxx')
-rw-r--r--cui/source/dialogs/cuicharmap.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index f457ba390399..c88da88ba719 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -241,6 +241,14 @@ void SvxShowText::SetFont( const Font& rFont )
Invalidate();
}
+Size SvxShowText::GetOptimalSize() const
+{
+ const Font &rFont = GetFont();
+ const Size rFontSize = rFont.GetSize();
+ long nWinHeight = LogicToPixel(rFontSize).Height() * 2;
+ return Size( GetTextWidth( GetText() ) + 2 * 12, nWinHeight );
+}
+
void SvxShowText::Resize()
{
Control::Resize();