[Libreoffice-commits] core.git: include/sfx2 sfx2/inc sfx2/source

ShyamPraveenSingh (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 2 15:59:17 UTC 2020


 include/sfx2/strings.hrc               |    3 +++
 sfx2/inc/charmapcontrol.hxx            |    1 +
 sfx2/source/control/charmapcontrol.cxx |    6 ++++++
 3 files changed, 10 insertions(+)

New commits:
commit b6c69a02222e3b6860efadb294a5b4d924bed819
Author:     ShyamPraveenSingh <shyampraveensingh at gmail.com>
AuthorDate: Wed Nov 25 10:31:13 2020 +0530
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Wed Dec 2 16:58:27 2020 +0100

    Resolves tdf#137547 CharmapCtrl label depending on recent chars
    
    Label shows now "No recent characters" if none has been used
    
    Change-Id: Ica3e4da077758ce848775eaa9b658f8322278b47
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106557
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 9927afe17e93..794d1a4b7af6 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -348,6 +348,9 @@
 #define STR_SPREADSHEET                         NC_("STR_SPREADSHEET", "Spreadsheet")
 #define STR_PRESENTATION                        NC_("STR_PRESENTATION", "Presentation")
 #define STR_DRAWING                             NC_("STR_DRAWING", "Drawing")
+#define STR_RECENT                              NC_("STR_RECENT", "Recently used")
+#define STR_NORECENT                            NC_("STR_NORECENT", "No recent characters")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/charmapcontrol.hxx b/sfx2/inc/charmapcontrol.hxx
index 0902f17fa94f..039fed4aae4b 100644
--- a/sfx2/inc/charmapcontrol.hxx
+++ b/sfx2/inc/charmapcontrol.hxx
@@ -49,6 +49,7 @@ private:
 
     SvxCharView m_aRecentCharView[16];
     SvxCharView m_aFavCharView[16];
+    std::unique_ptr<weld::Label> m_xRecentLabel;
     std::unique_ptr<weld::Button> m_xDlgBtn;
     std::unique_ptr<weld::CustomWeld> m_xRecentCharView[16];
     std::unique_ptr<weld::CustomWeld> m_xFavCharView[16];
diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx
index 56af57524a88..7987fb6aa600 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -22,6 +22,8 @@
 #include <charmapcontrol.hxx>
 #include <sfx2/charmappopup.hxx>
 #include <sfx2/viewfrm.hxx>
+#include <sfx2/strings.hrc>
+#include <sfx2/sfxresid.hxx>
 
 using namespace css;
 
@@ -61,6 +63,7 @@ SfxCharmapCtrl::SfxCharmapCtrl(CharmapPopup* pControl, weld::Widget* pParent)
                      SvxCharView(m_xVirDev),
                      SvxCharView(m_xVirDev),
                      SvxCharView(m_xVirDev)}
+    , m_xRecentLabel(m_xBuilder->weld_label("label2"))
     , m_xDlgBtn(m_xBuilder->weld_button("specialchardlg"))
     , m_xRecentCharView{std::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar1", m_aRecentCharView[0]),
                         std::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar2", m_aRecentCharView[1]),
@@ -175,6 +178,9 @@ void SfxCharmapCtrl::updateRecentCharControl()
         m_aRecentCharView[i].SetText(OUString());
         m_aRecentCharView[i].Hide();
     }
+
+    //checking if the characters are recently used or no
+    m_xRecentLabel->set_label(m_aRecentCharList.size() > 0 ? SfxResId(STR_RECENT) : SfxResId(STR_NORECENT));
 }
 
 IMPL_LINK(SfxCharmapCtrl, CharClickHdl, SvxCharView*, pView, void)


More information about the Libreoffice-commits mailing list