diff options
author | Sumit Chauhan <sumitcn25@gmail.com> | 2019-06-10 15:47:55 +0530 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-06-16 22:14:10 +0200 |
commit | 6b888ac476fe6ac2ee96c7086cb8c24249f08473 (patch) | |
tree | f36fb8dd53a8f0ed4a6b1eae795e5468ecf6dc8b /cui | |
parent | adcb7bacb452dccde70b20a902f5c1f23f37913f (diff) |
Reload Notebookbar, when customization is being done.
This patch is related to notebookbar customization tab. When one clicks
the widget checkbox , to preview the real-time changes one need to call
this ReloadNotebookBar() method .
Change-Id: I3d6314e4b8220a8744331246639acadea941252f
Reviewed-on: https://gerrit.libreoffice.org/73750
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/SvxNotebookbarConfigPage.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx index d2ef34807920..f32ad2c472a0 100644 --- a/cui/source/customize/SvxNotebookbarConfigPage.cxx +++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx @@ -206,6 +206,8 @@ short SvxNotebookbarConfigPage::QueryReset() OUString sNotebookbarInterface = getFileName(sFileName); Sequence<OUString> sSequenceEntries; CustomNotebookbarGenerator::setCustomizedUIItem(sSequenceEntries, sNotebookbarInterface); + OUString sUIPath = "modules/s" + sAppName.toAsciiLowerCase() + "/ui/"; + sfx2::SfxNotebookBar::ReloadNotebookBar(sUIPath); } return nValue; } @@ -374,13 +376,10 @@ static OUString getUIItemID(OUString sString) return sUIItemID.makeStringAndClear(); } -static void EditRegistryFile(OUString& sUIItemID, OUString& sSetEntry) +static void EditRegistryFile(OUString& sUIItemID, OUString& sSetEntry, + OUString& sNotebookbarInterface) { int nFlag = 0; - OUString sAppName; - OUString sFileName; - CustomNotebookbarGenerator::getFileNameAndAppName(sAppName, sFileName); - OUString sNotebookbarInterface = getFileName(sFileName); Sequence<OUString> aOldEntries = CustomNotebookbarGenerator::getCustomizedUIItem(sNotebookbarInterface); Sequence<OUString> aNewEntries(aOldEntries.getLength() + 1); @@ -411,6 +410,10 @@ static void EditRegistryFile(OUString& sUIItemID, OUString& sSetEntry) void SvxNotebookbarEntriesListBox::ChangedVisibility(int nRow) { OUString sUIItemID = m_xControl->get_selected_text(); + OUString sAppName; + OUString sFileName; + CustomNotebookbarGenerator::getFileNameAndAppName(sAppName, sFileName); + OUString sNotebookbarInterface = getFileName(sFileName); OUString sVisible; sUIItemID = getUIItemID(sUIItemID); if (m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE) @@ -420,8 +423,10 @@ void SvxNotebookbarEntriesListBox::ChangedVisibility(int nRow) OUString sSetEntries = sUIItemID + ",visible," + sVisible; Sequence<OUString> sSeqOfEntries(1); sSeqOfEntries[0] = sSetEntries; - EditRegistryFile(sUIItemID, sSetEntries); + EditRegistryFile(sUIItemID, sSetEntries, sNotebookbarInterface); CustomNotebookbarGenerator::modifyCustomizedUIFile(sSeqOfEntries); + OUString sUIPath = "modules/s" + sAppName.toAsciiLowerCase() + "/ui/"; + sfx2::SfxNotebookBar::ReloadNotebookBar(sUIPath); } IMPL_LINK(SvxNotebookbarEntriesListBox, CheckButtonHdl, const row_col&, rRowCol, void) |