[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Feb 4 20:59:54 UTC 2019
sw/source/ui/misc/glossary.cxx | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
New commits:
commit 148bc64fce5c7980e13de4743f67c0ef65412b7f
Author: Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Jan 27 19:54:58 2019 +0100
Commit: Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Mon Feb 4 21:59:32 2019 +0100
Group common code
Change-Id: Id836c9e4bce7ae36e3ebbfea2d84f1eb095bd298
Reviewed-on: https://gerrit.libreoffice.org/67311
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 43c616deece3..27c210083eaf 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -262,6 +262,22 @@ void SwGlossaryDlg::dispose()
SvxStandardDialog::dispose();
}
+namespace
+{
+
+OUString getCurrentGlossary()
+{
+ const OUString sTemp{ ::GetCurrGlosGroup() };
+
+ // the zeroth path is not being recorded!
+ if (sTemp.getToken(1, GLOS_DELIM).startsWith("0"))
+ return sTemp.getToken(0, GLOS_DELIM);
+
+ return sTemp;
+}
+
+}
+
// select new group
IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox, void )
{
@@ -299,11 +315,7 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox, void )
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY );
- OUString sTemp(::GetCurrGlosGroup());
- // the zeroth path is not being recorded!
- if (sTemp.getToken(1, GLOS_DELIM).startsWith("0"))
- sTemp = sTemp.getToken(0, GLOS_DELIM);
- aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, sTemp));
+ aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, getCurrentGlossary()));
aReq.Done();
}
Invalidate(InvalidateFlags::Update);
@@ -319,11 +331,7 @@ void SwGlossaryDlg::Apply()
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_INSERT_GLOSSARY );
- OUString sTemp(::GetCurrGlosGroup());
- // the zeroth path is not being recorded!
- if (sTemp.getToken(1, GLOS_DELIM).startsWith("0"))
- sTemp = sTemp.getToken(0, GLOS_DELIM);
- aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, sTemp));
+ aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, getCurrentGlossary()));
aReq.AppendItem(SfxStringItem(FN_PARAM_1, aGlosName));
aReq.Done();
}
@@ -474,11 +482,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool )
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq(pSh->GetView().GetViewFrame(), FN_NEW_GLOSSARY);
- OUString sTemp(::GetCurrGlosGroup());
- // the zeroth path is not being recorded!
- if (sTemp.getToken(1, GLOS_DELIM).startsWith("0"))
- sTemp = sTemp.getToken(0, GLOS_DELIM);
- aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, sTemp));
+ aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, getCurrentGlossary()));
aReq.AppendItem(SfxStringItem(FN_PARAM_1, aShortName));
aReq.AppendItem(SfxStringItem(FN_PARAM_2, aStr));
aReq.Done();
More information about the Libreoffice-commits
mailing list