summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhimajin100000 <himajin100000@gmail.com>2018-03-20 05:41:35 +0900
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-05-08 14:10:42 +0200
commitfa17a6021f79374ba0e4e010587fa01774805da5 (patch)
tree65d7c79b6a72cfbfa11622b32393e2a49d2cbb74
parent638ec7728b9a1327b424eade7f6bc5828b575921 (diff)
tdf#114549:entering hex/dec code should change char sample
by checking has_focus() for m_xHexCodeText and m_xDecimalCodeText. Also,CharHighlightHdl and SearchCharHighlightHdl now look alike. Also add case for missing glyph for entered hex/dec code. Change-Id: I32c782ac09756462f11b209afa12183d5ae7ac1f Reviewed-on: https://gerrit.libreoffice.org/51616 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--cui/inc/strings.hrc1
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/cuicharmap.cxx42
2 files changed, 26 insertions, 17 deletions
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index 5ee718467f54..66da2d39506d 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -97,6 +97,7 @@
#define RID_SVXSTR_SELECTOR_RUN NC_("RID_SVXSTR_SELECTOR_RUN", "Run")
#define RID_SVXSTR_ROW NC_("RID_SVXSTR_ROW", "Insert Rows")
#define RID_SVXSTR_REMOVE_FAVORITES NC_("RID_SVXSTR_REMOVE_FAVORITES", "Remove from Favorites")
+#define RID_SVXSTR_MISSING_GLYPH NC_("RID_SVXSTR_MISSING_GLYPH", "Missing Glyph")
#define RID_SVXSTR_ADD_FAVORITES NC_("RID_SVXSTR_ADD_FAVORITES", "Add to Favorites")
// PPI is pixel per inch, %1 is a number
#define RID_SVXSTR_PPI NC_("RID_SVXSTR_PPI", "(%1 PPI)")
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index ae4eedfb84ba..4727baca0fc2 100644..100755
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -935,6 +935,17 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
{
// using the new UCS4 constructor
aText = OUString( &cChar, 1 );
+ // Get the hexadecimal code
+ aHexText = OUString::number(cChar, 16).toAsciiUpperCase();
+ // Get the decimal code
+ aDecimalText = OUString::number(cChar);
+ setCharName(cChar);
+
+ // Update the hex and decimal codes only if necessary
+ if (m_xHexCodeText->get_text() != aHexText)
+ m_xHexCodeText->set_text( aHexText );
+ if (m_xDecimalCodeText->get_text() != aDecimalText)
+ m_xDecimalCodeText->set_text( aDecimalText );
const Subset* pSubset = nullptr;
if( pSubsetMap )
@@ -945,7 +956,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
m_xSubsetLB->set_active(-1);
}
- if (m_xShowSet->HasFocus())
+ if(m_xShowSet->HasFocus() || m_xHexCodeText->has_focus() || m_xDecimalCodeText->has_focus() )
{
m_xShowChar->SetText( aText );
m_xShowChar->SetFont( aFont );
@@ -953,22 +964,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
setFavButtonState(aText, aFont.GetFamilyName());
}
-
- // show char codes
- if ( bSelect )
- {
- // Get the hexadecimal code
- aHexText = OUString::number(cChar, 16).toAsciiUpperCase();
- // Get the decimal code
- aDecimalText = OUString::number(cChar);
- setCharName(cChar);
- }
-
- // Update the hex and decimal codes only if necessary
- if (m_xHexCodeText->get_text() != aHexText)
- m_xHexCodeText->set_text( aHexText );
- if (m_xDecimalCodeText->get_text() != aDecimalText)
- m_xDecimalCodeText->set_text( aDecimalText );
}
IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void)
@@ -1034,6 +1029,19 @@ void SvxCharacterMap::selectCharByCode(Radix radix)
if (xFontCharMap->HasChar(cChar))
// Select the corresponding character
SetChar(cChar);
+ else {
+ m_xCharName->set_label(CuiResId(RID_SVXSTR_MISSING_GLYPH));
+ m_xShowChar->SetText(" ");
+ switch(radix)
+ {
+ case Radix::decimal:
+ m_xHexCodeText->set_text(OUString::number(cChar, 16));
+ break;
+ case Radix::hexadecimal:
+ m_xDecimalCodeText->set_text(OUString::number(cChar));
+ break;
+ }
+ }
}
IMPL_LINK_NOARG(SvxCharacterMap, DecimalCodeChangeHdl, weld::Entry&, void)