diff options
author | Thomas Lange <tl@openoffice.org> | 2000-10-16 09:58:40 +0000 |
---|---|---|
committer | Thomas Lange <tl@openoffice.org> | 2000-10-16 09:58:40 +0000 |
commit | d7c5edaeec78062a58503aba5b93f69bae995190 (patch) | |
tree | 7cb50bc8a37c71a34390e3edeea5613f2f832c8d | |
parent | deda20652773d5187edf19351cc46a8412431915 (diff) |
#78980# Font modify handler added to allow for Font switch via paste
-rw-r--r-- | starmath/inc/dialog.hxx | 7 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 23 |
2 files changed, 22 insertions, 8 deletions
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 6a1591c212bb..c227f5fcf610 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * last change: $Author: tl $ $Date: 2000-10-16 10:58:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -238,7 +238,8 @@ class SmFontDialog : public ModalDialog Font Face; - DECL_LINK(FontChangeHdl, ComboBox *); + DECL_LINK(FontSelectHdl, ComboBox *); + DECL_LINK(FontModifyHdl, ComboBox *); DECL_LINK(AttrChangeHdl, CheckBox *); public: diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 056103b3c61b..37fb3840d2c3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:26 $ + * last change: $Author: tl $ $Date: 2000-10-16 10:58:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -381,13 +381,25 @@ void SmShowFont::SetFont(const Font& rFont) } -IMPL_LINK_INLINE_START( SmFontDialog, FontChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK_INLINE_START( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox ) { Face.SetName(pComboBox->GetText()); aShowFont.SetFont(Face); return 0; } -IMPL_LINK_INLINE_END( SmFontDialog, FontChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK_INLINE_END( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox ) + + +IMPL_LINK( SmFontDialog, FontModifyHdl, ComboBox *, pComboBox ) +{ + // if font is available in list then use it + USHORT nPos = pComboBox->GetEntryPos( pComboBox->GetText() ); + if (COMBOBOX_ENTRY_NOTFOUND != nPos) + { + FontSelectHdl( pComboBox ); + } + return 0; +} IMPL_LINK( SmFontDialog, AttrChangeHdl, CheckBox *, pCheckBox ) @@ -463,7 +475,8 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) //Application::LeaveWait(); } - aFontBox.SetSelectHdl(LINK(this, SmFontDialog, FontChangeHdl)); + aFontBox.SetSelectHdl(LINK(this, SmFontDialog, FontSelectHdl)); + aFontBox.SetModifyHdl(LINK(this, SmFontDialog, FontModifyHdl)); aBoldCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); aItalicCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); } |