LibreOffice Module sw (master)  1
glossary.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <hintids.hxx>
21 
22 #include <o3tl/any.hxx>
23 #include <vcl/event.hxx>
24 #include <vcl/svapp.hxx>
25 #include <vcl/weld.hxx>
26 #include <svl/stritem.hxx>
27 #include <svl/macitem.hxx>
28 #include <unotools/pathoptions.hxx>
29 #include <unotools/lingucfg.hxx>
30 #include <sfx2/request.hxx>
31 #include <sfx2/fcontnr.hxx>
32 #include <sfx2/docfilt.hxx>
33 
34 #include <svx/svxdlg.hxx>
35 #include <editeng/acorrcfg.hxx>
36 #include <sfx2/viewfrm.hxx>
37 #include <unotools.hxx>
39 #include <ucbhelper/content.hxx>
40 #include <com/sun/star/text/AutoTextContainer.hpp>
41 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
42 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
43 #include <svl/urihelper.hxx>
44 #include <unotools/charclass.hxx>
45 #include <swtypes.hxx>
46 #include <wrtsh.hxx>
47 #include <view.hxx>
48 #include <glossary.hxx>
49 #include <gloshdl.hxx>
50 #include <glosbib.hxx>
51 #include <initui.hxx>
52 #include <glosdoc.hxx>
53 #include <macassgn.hxx>
54 #include <docsh.hxx>
55 #include <shellio.hxx>
56 
57 #include <cmdid.h>
58 #include <sfx2/filedlghelper.hxx>
59 
60 #include <memory>
61 
62 #include <strings.hrc>
63 #include <iodetect.hxx>
64 
65 #include <officecfg/Office/Writer.hxx>
66 
67 using namespace ::com::sun::star;
68 using namespace ::com::sun::star::lang;
69 using namespace ::com::sun::star::uno;
70 using namespace ::com::sun::star::text;
71 using namespace ::com::sun::star::ucb;
72 using namespace ::com::sun::star::ui::dialogs;
73 using namespace ::ucbhelper;
74 using namespace ::sfx2;
75 
76 static OUString lcl_GetValidShortCut( const OUString& rName )
77 {
78  const sal_Int32 nSz = rName.getLength();
79 
80  if ( 0 == nSz )
81  return rName;
82 
83  sal_Int32 nStart = 1;
84  while( rName[nStart-1]==' ' && nStart < nSz )
85  nStart++;
86 
87  OUStringBuffer aBuf;
88  aBuf.append(rName[nStart-1]);
89 
90  for( ; nStart < nSz; ++nStart )
91  {
92  if( rName[nStart-1]==' ' && rName[nStart]!=' ')
93  aBuf.append(rName[nStart]);
94  }
95  return aBuf.makeStringAndClear();
96 }
97 
99 {
100  OUString sGroupName;
101  sal_uInt16 nPathIdx;
102  bool bReadonly;
103 
105  : nPathIdx(0),
106  bReadonly(false) {}
107 };
108 
109 // dialog for new block name
111 {
114 
115  std::unique_ptr<weld::Entry> m_xNewName;
116  std::unique_ptr<weld::Entry> m_xNewShort;
117  std::unique_ptr<weld::Button> m_xOk;
118  std::unique_ptr<weld::Entry> m_xOldName;
119  std::unique_ptr<weld::Entry> m_xOldShort;
120 
121 protected:
122  DECL_LINK(Modify, weld::Entry&, void);
123  DECL_LINK(Rename, weld::Button&, void);
124  DECL_LINK(TextFilterHdl, OUString&, bool);
125 
126 public:
128  const OUString& rOldName,
129  const OUString& rOldShort);
130 
131  OUString GetNewName() const { return m_xNewName->get_text(); }
132  OUString GetNewShort() const { return m_xNewShort->get_text(); }
133 };
134 
135 IMPL_LINK(SwNewGlosNameDlg, TextFilterHdl, OUString&, rTest, bool)
136 {
137  rTest = m_aNoSpaceFilter.filter(rTest);
138  return true;
139 }
140 
141 SwNewGlosNameDlg::SwNewGlosNameDlg(SwGlossaryDlg* pParent, const OUString& rOldName, const OUString& rOldShort)
142  : GenericDialogController(pParent->getDialog(), "modules/swriter/ui/renameautotextdialog.ui", "RenameAutoTextDialog")
143  , m_pParent(pParent)
144  , m_xNewName(m_xBuilder->weld_entry("newname"))
145  , m_xNewShort(m_xBuilder->weld_entry("newsc"))
146  , m_xOk(m_xBuilder->weld_button("ok"))
147  , m_xOldName(m_xBuilder->weld_entry("oldname"))
148  , m_xOldShort(m_xBuilder->weld_entry("oldsc"))
149 {
150  m_xNewShort->connect_insert_text(LINK(this, SwNewGlosNameDlg, TextFilterHdl));
151 
152  m_xOldName->set_text(rOldName);
153  m_xOldShort->set_text(rOldShort);
154  m_xNewName->connect_changed(LINK(this, SwNewGlosNameDlg, Modify ));
155  m_xNewShort->connect_changed(LINK(this, SwNewGlosNameDlg, Modify ));
156  m_xOk->connect_clicked(LINK(this, SwNewGlosNameDlg, Rename ));
157  m_xNewName->grab_focus();
158 }
159 
160 // query / set currently set group
162 {
163  if( !::GetCurrGlosGroup().isEmpty() )
165  return SwGlossaries::GetDefName();
166 }
167 
168 void SwGlossaryDlg::SetActGroup(const OUString &rGrp)
169 {
170  ::SetCurrGlosGroup(rGrp);
171 }
172 
173 IMPL_LINK(SwGlossaryDlg, TextFilterHdl, OUString&, rTest, bool)
174 {
175  rTest = m_aNoSpaceFilter.filter(rTest);
176  return true;
177 }
178 
180  SwGlossaryHdl * pGlosHdl, SwWrtShell *pWrtShell)
181  : SfxDialogController(pViewFrame->GetWindow().GetFrameWeld(), "modules/swriter/ui/autotext.ui", "AutoTextDialog")
182  , m_sReadonlyPath(SwResId(STR_READONLY_PATH))
183  , m_pGlossaryHdl(pGlosHdl)
184  , m_bResume(false)
185  , m_bSelection(pWrtShell->IsSelection())
186  , m_bReadOnly(false)
187  , m_bIsOld(false)
188  , m_bIsDocReadOnly(false)
189  , m_pShell(pWrtShell)
190  , m_xInsertTipCB(m_xBuilder->weld_check_button("inserttip"))
191  , m_xNameED(m_xBuilder->weld_entry("name"))
192  , m_xShortNameLbl(m_xBuilder->weld_label("shortnameft"))
193  , m_xShortNameEdit(m_xBuilder->weld_entry("shortname"))
194  , m_xCategoryBox(m_xBuilder->weld_tree_view("category"))
195  , m_xFileRelCB(m_xBuilder->weld_check_button("relfile"))
196  , m_xNetRelCB(m_xBuilder->weld_check_button("relnet"))
197  , m_xInsertBtn(m_xBuilder->weld_button("ok"))
198  , m_xEditBtn(m_xBuilder->weld_menu_button("autotext"))
199  , m_xBibBtn(m_xBuilder->weld_button("categories"))
200  , m_xPathBtn(m_xBuilder->weld_button("path"))
201 {
202  m_xCategoryBox->set_size_request(m_xCategoryBox->get_approximate_digit_width() * 52,
203  m_xCategoryBox->get_height_rows(12));
204 
205  Link<SwOneExampleFrame&,void> aLink(LINK(this, SwGlossaryDlg, PreviewLoadedHdl));
207  m_xExampleFrameWin.reset(new weld::CustomWeld(*m_xBuilder, "example", *m_xExampleFrame));
208  Size aSize = m_xExampleFrame->GetDrawingArea()->get_ref_device().LogicToPixel(
209  Size(82, 124), MapMode(MapUnit::MapAppFont));
210  m_xExampleFrame->set_size_request(aSize.Width(), aSize.Height());
211 
212  m_xShortNameEdit->connect_insert_text(LINK(this, SwGlossaryDlg, TextFilterHdl));
213 
214  m_xEditBtn->connect_toggled(LINK(this, SwGlossaryDlg, EnableHdl));
215  m_xEditBtn->connect_selected(LINK(this, SwGlossaryDlg, MenuHdl));
216  m_xPathBtn->connect_clicked(LINK(this, SwGlossaryDlg, PathHdl));
217 
218  m_xNameED->connect_changed(LINK(this,SwGlossaryDlg,NameModify));
219  m_xShortNameEdit->connect_changed(LINK(this,SwGlossaryDlg,NameModify));
220 
221  m_xCategoryBox->connect_row_activated(LINK(this, SwGlossaryDlg, NameDoubleClick));
222  m_xCategoryBox->connect_changed(LINK(this, SwGlossaryDlg, GrpSelect));
223  m_xCategoryBox->connect_key_press(LINK(this, SwGlossaryDlg, KeyInputHdl));
224  m_xBibBtn->connect_clicked(LINK(this,SwGlossaryDlg,BibHdl));
225 
226  m_xInsertBtn->connect_clicked(LINK(this,SwGlossaryDlg,InsertHdl));
227 
228  ShowPreview();
229 
232  if( m_bIsDocReadOnly )
233  m_xInsertBtn->set_sensitive(false);
234  m_xNameED->grab_focus();
235  m_xCategoryBox->make_sorted();
236  m_xCategoryBox->set_sort_order(true);
237 
238  Init();
239 }
240 
242 {
243 }
244 
245 namespace
246 {
247 
248 OUString getCurrentGlossary()
249 {
250  const OUString sTemp{ ::GetCurrGlosGroup() };
251 
252  // the zeroth path is not being recorded!
253  if (sTemp.getToken(1, GLOS_DELIM).startsWith("0"))
254  return sTemp.getToken(0, GLOS_DELIM);
255 
256  return sTemp;
257 }
258 
259 }
260 
261 // select new group
262 IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, void)
263 {
264  std::unique_ptr<weld::TreeIter> xEntry = rBox.make_iterator();
265  if (!rBox.get_selected(xEntry.get()))
266  return;
267 
268  std::unique_ptr<weld::TreeIter> xParent = rBox.make_iterator(xEntry.get());
269  weld::TreeIter* pParent;
270  if (rBox.get_iter_depth(*xParent))
271  {
272  rBox.iter_parent(*xParent);
273  pParent = xParent.get();
274  }
275  else
276  pParent = xEntry.get();
277  GroupUserData* pGroupData = reinterpret_cast<GroupUserData*>(rBox.get_id(*pParent).toInt64());
278  ::SetCurrGlosGroup(pGroupData->sGroupName
279  + OUStringChar(GLOS_DELIM)
280  + OUString::number(pGroupData->nPathIdx));
281  m_pGlossaryHdl->SetCurGroup(::GetCurrGlosGroup());
282  // set current text block
283  m_bReadOnly = m_pGlossaryHdl->IsReadOnly();
284  EnableShortName( !m_bReadOnly );
285  m_xEditBtn->set_sensitive(!m_bReadOnly);
286  m_bIsOld = m_pGlossaryHdl->IsOld();
287  if( pParent != xEntry.get())
288  {
289  OUString aName(rBox.get_text(*xEntry));
290  m_xNameED->set_text(aName);
291  m_xShortNameEdit->set_text(rBox.get_id(*xEntry));
292  m_xInsertBtn->set_sensitive( !m_bIsDocReadOnly);
293  ShowAutoText(::GetCurrGlosGroup(), m_xShortNameEdit->get_text());
294  }
295  else
296  {
297  m_xNameED->set_text("");
298  m_xShortNameEdit->set_text("");
299  m_xShortNameEdit->set_sensitive(false);
300  ShowAutoText("", "");
301  }
302  // update controls
303  NameModify(*m_xShortNameEdit);
304  if( SfxRequest::HasMacroRecorder( m_pShell->GetView().GetViewFrame() ) )
305  {
306  SfxRequest aReq( m_pShell->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY );
307  aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, getCurrentGlossary()));
308  aReq.Done();
309  }
310 }
311 
313 {
314  short nRet = SfxDialogController::run();
315  if (nRet == RET_OK)
316  Apply();
317  return nRet;
318 }
319 
321 {
322  const OUString aGlosName(m_xShortNameEdit->get_text());
323  if (!aGlosName.isEmpty())
324  {
325  m_pGlossaryHdl->InsertGlossary(aGlosName);
326  }
328  {
330  aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, getCurrentGlossary()));
331  aReq.AppendItem(SfxStringItem(FN_PARAM_1, aGlosName));
332  aReq.Done();
333  }
334 }
335 
337 {
338  m_xShortNameLbl->set_sensitive(bOn);
339  m_xShortNameEdit->set_sensitive(bOn);
340 }
341 
342 // does the title exist in the selected group?
343 std::unique_ptr<weld::TreeIter> SwGlossaryDlg::DoesBlockExist(const OUString& rBlock,
344  const OUString& rShort)
345 {
346  // look for possible entry in TreeListBox
347  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
348  if (m_xCategoryBox->get_selected(xEntry.get()))
349  {
350  if (m_xCategoryBox->get_iter_depth(*xEntry))
351  m_xCategoryBox->iter_parent(*xEntry);
352  if (!m_xCategoryBox->iter_children(*xEntry))
353  return nullptr;
354  do
355  {
356  if (rBlock == m_xCategoryBox->get_text(*xEntry) &&
357  (rShort.isEmpty() ||
358  rShort == m_xCategoryBox->get_id(*xEntry))
359  )
360  {
361  return xEntry;
362  }
363  }
364  while (m_xCategoryBox->iter_next_sibling(*xEntry));
365  }
366  return nullptr;
367 }
368 
369 IMPL_LINK(SwGlossaryDlg, NameModify, weld::Entry&, rEdit, void)
370 {
371  const OUString aName(m_xNameED->get_text());
372  bool bNameED = &rEdit == m_xNameED.get();
373  if( aName.isEmpty() )
374  {
375  if(bNameED)
376  m_xShortNameEdit->set_text(aName);
377  m_xInsertBtn->set_sensitive(false);
378  return;
379  }
380  const bool bNotFound = !DoesBlockExist(aName, bNameED ? OUString() : rEdit.get_text());
381  if(bNameED)
382  {
383  // did the text get in to the Listbox in the Edit with a click?
384  if(bNotFound)
385  {
386  m_xShortNameEdit->set_text( lcl_GetValidShortCut( aName ) );
387  EnableShortName();
388  }
389  else
390  {
391  m_xShortNameEdit->set_text(m_pGlossaryHdl->GetGlossaryShortName(aName));
392  EnableShortName(!m_bReadOnly);
393  }
394  m_xInsertBtn->set_sensitive(!bNotFound && !m_bIsDocReadOnly);
395  }
396  else
397  {
398  //ShortNameEdit
399  if(!bNotFound)
400  {
401  m_xInsertBtn->set_sensitive(!m_bIsDocReadOnly);
402  }
403  }
404 }
405 
406 IMPL_LINK( SwGlossaryDlg, NameDoubleClick, weld::TreeView&, rBox, bool )
407 {
408  std::unique_ptr<weld::TreeIter> xEntry = rBox.make_iterator();
409  if (rBox.get_selected(xEntry.get()) && rBox.get_iter_depth(*xEntry) && !m_bIsDocReadOnly)
410  m_xDialog->response(RET_OK);
411  return true;
412 }
413 
415 {
416  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
417  bool bEntry = m_xCategoryBox->get_selected(xEntry.get());
418 
419  const OUString aEditText(m_xNameED->get_text());
420  const bool bHasEntry = !aEditText.isEmpty() && !m_xShortNameEdit->get_text().isEmpty();
421  const bool bExists = nullptr != DoesBlockExist(aEditText, m_xShortNameEdit->get_text());
422  const bool bIsGroup = bEntry && !m_xCategoryBox->get_iter_depth(*xEntry);
423  m_xEditBtn->set_item_visible("new", m_bSelection && bHasEntry && !bExists);
424  m_xEditBtn->set_item_visible("newtext", m_bSelection && bHasEntry && !bExists);
425  m_xEditBtn->set_item_visible("copy", bExists && !bIsGroup);
426  m_xEditBtn->set_item_visible("replace", m_bSelection && bExists && !bIsGroup && !m_bIsOld );
427  m_xEditBtn->set_item_visible("replacetext", m_bSelection && bExists && !bIsGroup && !m_bIsOld );
428  m_xEditBtn->set_item_visible("edit", bExists && !bIsGroup );
429  m_xEditBtn->set_item_visible("rename", bExists && !bIsGroup );
430  m_xEditBtn->set_item_visible("delete", bExists && !bIsGroup );
431  m_xEditBtn->set_item_visible("macro", bExists && !bIsGroup && !m_bIsOld &&
432  !m_pGlossaryHdl->IsReadOnly() );
433  m_xEditBtn->set_item_visible("import", bIsGroup && !m_bIsOld && !m_pGlossaryHdl->IsReadOnly() );
434 }
435 
436 IMPL_LINK(SwGlossaryDlg, MenuHdl, const OString&, rItemIdent, void)
437 {
438  if (rItemIdent == "edit")
439  {
440  std::unique_ptr<SwTextBlocks> pGroup = ::GetGlossaries()->GetGroupDoc ( GetCurrGrpName () );
441  pGroup.reset();
442  m_xDialog->response(RET_EDIT);
443  }
444  else if (rItemIdent == "replace")
445  {
446  m_pGlossaryHdl->NewGlossary(m_xNameED->get_text(),
447  m_xShortNameEdit->get_text());
448  }
449  else if (rItemIdent == "replacetext")
450  {
451  m_pGlossaryHdl->NewGlossary(m_xNameED->get_text(),
452  m_xShortNameEdit->get_text(),
453  false, true);
454  }
455  else if (rItemIdent == "new" || rItemIdent == "newtext")
456  {
457  bool bNoAttr = rItemIdent == "newtext";
458 
459  const OUString aStr(m_xNameED->get_text());
460  const OUString aShortName(m_xShortNameEdit->get_text());
461  if(m_pGlossaryHdl->HasShortName(aShortName))
462  {
463  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
464  VclMessageType::Info, VclButtonsType::Ok,
465  SwResId(STR_DOUBLE_SHORTNAME)));
466  xInfoBox->run();
467  m_xShortNameEdit->select_region(0, -1);
468  m_xShortNameEdit->grab_focus();
469  }
470  if(m_pGlossaryHdl->NewGlossary(aStr, aShortName, false, bNoAttr ))
471  {
472  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
473  if (!m_xCategoryBox->get_selected(xEntry.get()))
474  xEntry.reset();
475  else if (m_xCategoryBox->get_iter_depth(*xEntry))
476  m_xCategoryBox->iter_parent(*xEntry);
477  m_xCategoryBox->insert(xEntry.get(), -1, &aStr, &aShortName,
478  nullptr, nullptr, nullptr, false, nullptr);
479 
480  m_xNameED->set_text(aStr);
481  m_xShortNameEdit->set_text(aShortName);
482  NameModify(*m_xNameED); // for toggling the buttons
483 
484  if( SfxRequest::HasMacroRecorder( m_pShell->GetView().GetViewFrame() ) )
485  {
486  SfxRequest aReq(m_pShell->GetView().GetViewFrame(), FN_NEW_GLOSSARY);
487  aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, getCurrentGlossary()));
488  aReq.AppendItem(SfxStringItem(FN_PARAM_1, aShortName));
489  aReq.AppendItem(SfxStringItem(FN_PARAM_2, aStr));
490  aReq.Done();
491  }
492  }
493  }
494  else if (rItemIdent == "copy")
495  {
496  m_pGlossaryHdl->CopyToClipboard(*m_pShell, m_xShortNameEdit->get_text());
497  }
498  else if (rItemIdent == "rename")
499  {
500  m_xShortNameEdit->set_text(m_pGlossaryHdl->GetGlossaryShortName(m_xNameED->get_text()));
501  SwNewGlosNameDlg aNewNameDlg(this, m_xNameED->get_text(), m_xShortNameEdit->get_text());
502  if (aNewNameDlg.run() == RET_OK && m_pGlossaryHdl->Rename(m_xShortNameEdit->get_text(),
503  aNewNameDlg.GetNewShort(),
504  aNewNameDlg.GetNewName()))
505  {
506  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
507  if (m_xCategoryBox->get_selected(xEntry.get()))
508  {
509  std::unique_ptr<weld::TreeIter> xOldEntry = m_xCategoryBox->make_iterator(xEntry.get());
510  if (m_xCategoryBox->get_iter_depth(*xEntry))
511  m_xCategoryBox->iter_parent(*xEntry);
512 
513  std::unique_ptr<weld::TreeIter> xNewEntry = m_xCategoryBox->make_iterator();
514  OUString sId(aNewNameDlg.GetNewShort());
515  OUString sName(aNewNameDlg.GetNewName());
516 
517  m_xCategoryBox->insert(xEntry.get(), -1, &sName, &sId,
518  nullptr, nullptr, nullptr, false, xNewEntry.get());
519 
520  m_xCategoryBox->remove(*xOldEntry);
521  m_xCategoryBox->select(*xNewEntry);
522  m_xCategoryBox->scroll_to_row(*xNewEntry);
523  }
524  }
525  GrpSelect(*m_xCategoryBox);
526  }
527  else if (rItemIdent == "delete")
528  {
529  DeleteEntry();
530  }
531  else if (rItemIdent == "macro")
532  {
534 
535  SvxMacro aStart(OUString(), OUString(), STARBASIC);
536  SvxMacro aEnd(OUString(), OUString(), STARBASIC);
537  m_pGlossaryHdl->GetMacros(m_xShortNameEdit->get_text(), aStart, aEnd );
538 
539  SvxMacroItem aItem(RES_FRMMACRO);
540  if( aStart.HasMacro() )
541  aItem.SetMacro( SvMacroItemId::SwStartInsGlossary, aStart );
542  if( aEnd.HasMacro() )
543  aItem.SetMacro( SvMacroItemId::SwEndInsGlossary, aEnd );
544 
545  aSet.Put( aItem );
547 
548  const SfxPoolItem* pItem;
551  m_pShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() ));
552  if ( pMacroDlg && pMacroDlg->Execute() == RET_OK &&
553  SfxItemState::SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, false, &pItem ) )
554  {
555  const SvxMacroTableDtor& rTable = static_cast<const SvxMacroItem*>(pItem)->GetMacroTable();
556  m_pGlossaryHdl->SetMacros( m_xShortNameEdit->get_text(),
557  rTable.Get( SvMacroItemId::SwStartInsGlossary ),
558  rTable.Get( SvMacroItemId::SwEndInsGlossary ) );
559  }
560  }
561  else if (rItemIdent == "import")
562  {
563  // call the FileOpenDialog do find WinWord - Files with templates
564  FileDialogHelper aDlgHelper(TemplateDescription::FILEOPEN_SIMPLE,
565  FileDialogFlags::NONE, m_xDialog.get());
566  uno::Reference < XFilePicker3 > xFP = aDlgHelper.GetFilePicker();
567 
568  SvtPathOptions aPathOpt;
569  xFP->setDisplayDirectory(aPathOpt.GetWorkPath() );
570 
571  SfxFilterMatcher aMatcher( SwDocShell::Factory().GetFactoryName() );
572  SfxFilterMatcherIter aIter( aMatcher );
573  std::shared_ptr<const SfxFilter> pFilter = aIter.First();
574  while ( pFilter )
575  {
576  if( pFilter->GetUserData() == FILTER_WW8 )
577  {
578  xFP->appendFilter( pFilter->GetUIName(),
579  pFilter->GetWildcard().getGlob() );
580  xFP->setCurrentFilter( pFilter->GetUIName() ) ;
581  }
582  else if( pFilter->GetUserData() == FILTER_DOCX )
583  {
584  xFP->appendFilter( pFilter->GetUIName(),
585  pFilter->GetWildcard().getGlob() );
586  xFP->setCurrentFilter( pFilter->GetUIName() ) ;
587  }
588 
589  pFilter = aIter.Next();
590  }
591 
592  if( aDlgHelper.Execute() == ERRCODE_NONE )
593  {
594  if( m_pGlossaryHdl->ImportGlossaries( xFP->getSelectedFiles().getConstArray()[0] ))
595  Init();
596  else
597  {
598  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
599  VclMessageType::Info, VclButtonsType::Ok,
600  SwResId(STR_NO_GLOSSARIES)));
601  xInfoBox->run();
602  }
603  }
604  }
605 }
606 
607 // dialog manage regions
609 {
610  SwGlossaries* pGloss = ::GetGlossaries();
611  if( pGloss->IsGlosPathErr() )
612  pGloss->ShowError();
613  else
614  {
615  //check if at least one glossary path is write enabled
616  SvtPathOptions aPathOpt;
617  const OUString& sGlosPath( aPathOpt.GetAutoTextPath() );
618  bool bIsWritable = false;
619  sal_Int32 nIdx {sGlosPath.isEmpty() ? -1 : 0};
620  while (nIdx>=0)
621  {
622  const OUString sPath = URIHelper::SmartRel2Abs(
623  INetURLObject(), sGlosPath.getToken(0, ';', nIdx),
625  try
626  {
627  Content aTestContent( sPath,
628  uno::Reference< XCommandEnvironment >(),
630  Any aAny = aTestContent.getPropertyValue( "IsReadOnly" );
631  if(aAny.hasValue())
632  {
633  bIsWritable = !*o3tl::doAccess<bool>(aAny);
634  }
635  }
636  catch (const Exception&)
637  {
638  }
639  if(bIsWritable)
640  break;
641  }
642  if(bIsWritable)
643  {
644 
645  SwGlossaryGroupDlg aDlg(m_xDialog.get(), pGloss->GetPathArray(), m_pGlossaryHdl);
646  if (aDlg.run() == RET_OK)
647  {
648  Init();
649  //if new groups were created - select one of them
650  const OUString sNewGroup = aDlg.GetCreatedGroupName();
651 
652  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
653  bool bEntry = m_xCategoryBox->get_iter_first(*xEntry);
654 
655  while (!sNewGroup.isEmpty() && bEntry)
656  {
657  if (!m_xCategoryBox->get_iter_depth(*xEntry))
658  {
659  GroupUserData* pGroupData = reinterpret_cast<GroupUserData*>(m_xCategoryBox->get_id(*xEntry).toInt64());
660  const OUString sGroup = pGroupData->sGroupName
661  + OUStringChar(GLOS_DELIM)
662  + OUString::number(pGroupData->nPathIdx);
663  if(sGroup == sNewGroup)
664  {
665  m_xCategoryBox->select(*xEntry);
666  m_xCategoryBox->scroll_to_row(*xEntry);
667  GrpSelect(*m_xCategoryBox);
668  break;
669  }
670  }
671  bEntry = m_xCategoryBox->iter_next(*xEntry);
672  }
673 
674  }
675  }
676  else
677  {
678  std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
679  VclMessageType::Question, VclButtonsType::YesNo,
680  m_sReadonlyPath));
681  if (RET_YES == xBox->run())
682  PathHdl(*m_xPathBtn);
683  }
684  }
685 }
686 
687 // initialisation; from Ctor and after editing regions
689 {
690  m_xCategoryBox->freeze();
691  m_xCategoryBox->clear();
692  m_xGroupData.clear();
693  m_xCategoryBox->make_unsorted();
694 
695  // display text block regions
696  const size_t nCnt = m_pGlossaryHdl->GetGroupCnt();
697  std::unique_ptr<weld::TreeIter> xSelEntry;
698  const OUString sSelStr(::GetCurrGlosGroup().getToken(0, GLOS_DELIM));
699  const sal_Int32 nSelPath = ::GetCurrGlosGroup().getToken(1, GLOS_DELIM).toInt32();
700  // #i66304# - "My AutoText" comes from mytexts.bau, but should be translated
701  const OUString sMyAutoTextEnglish("My AutoText");
702  const OUString sMyAutoTextTranslated(SwResId(STR_MY_AUTOTEXT));
703  for(size_t nId = 0; nId < nCnt; ++nId )
704  {
705  OUString sTitle;
706  OUString sGroupName(m_pGlossaryHdl->GetGroupName(nId, &sTitle));
707  if(sGroupName.isEmpty())
708  continue;
709  sal_Int32 nIdx{ 0 };
710  const OUString sName{ sGroupName.getToken( 0, GLOS_DELIM, nIdx ) };
711  if(sTitle.isEmpty())
712  sTitle = sName;
713  if(sTitle == sMyAutoTextEnglish)
714  sTitle = sMyAutoTextTranslated;
715 
716  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
717  m_xCategoryBox->append(xEntry.get());
718  m_xCategoryBox->set_text(*xEntry, sTitle, 0);
719  const sal_Int32 nPath = sGroupName.getToken( 0, GLOS_DELIM, nIdx ).toInt32();
720 
722  pData->sGroupName = sName;
723  pData->nPathIdx = static_cast< sal_uInt16 >(nPath);
724  pData->bReadonly = m_pGlossaryHdl->IsReadOnly(&sGroupName);
725  m_xGroupData.emplace_back(pData);
726 
727  m_xCategoryBox->set_id(*xEntry, OUString::number(reinterpret_cast<sal_Int64>(pData)));
728  if (sSelStr == pData->sGroupName && nSelPath == nPath)
729  xSelEntry = m_xCategoryBox->make_iterator(xEntry.get());
730 
731  // fill entries for the groups
732  {
733  m_pGlossaryHdl->SetCurGroup(sGroupName, false, true);
734  const sal_uInt16 nCount = m_pGlossaryHdl->GetGlossaryCnt();
735  for(sal_uInt16 i = 0; i < nCount; ++i)
736  {
737  OUString sEntryName = m_pGlossaryHdl->GetGlossaryName(i);
739  m_xCategoryBox->insert(xEntry.get(), -1, &sEntryName, &sId,
740  nullptr, nullptr, nullptr, false, nullptr);
741  }
742  }
743  }
744  // set current group and display text blocks
745  if (!xSelEntry)
746  {
747  //find a non-readonly group
748  std::unique_ptr<weld::TreeIter> xSearch = m_xCategoryBox->make_iterator();
749  if (m_xCategoryBox->get_iter_first(*xSearch))
750  {
751  do
752  {
753  if (!m_xCategoryBox->get_iter_depth(*xSearch))
754  {
755  GroupUserData* pData = reinterpret_cast<GroupUserData*>(m_xCategoryBox->get_id(*xSearch).toInt64());
756  if (!pData->bReadonly)
757  {
758  xSelEntry = std::move(xSearch);
759  break;
760  }
761  }
762  }
763  while (m_xCategoryBox->iter_next(*xSearch));
764  }
765  if (!xSelEntry)
766  {
767  xSelEntry = std::move(xSearch);
768  if (!m_xCategoryBox->get_iter_first(*xSelEntry))
769  xSelEntry.reset();
770  }
771  }
772 
773  m_xCategoryBox->thaw();
774  m_xCategoryBox->make_sorted();
775 
776  if (xSelEntry)
777  {
778  m_xCategoryBox->expand_row(*xSelEntry);
779  m_xCategoryBox->select(*xSelEntry);
780  m_xCategoryBox->scroll_to_row(*xSelEntry);
781  GrpSelect(*m_xCategoryBox);
782  }
783 
784  const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
785  m_xFileRelCB->set_active( rCfg.IsSaveRelFile() );
786  m_xFileRelCB->connect_toggled(LINK(this, SwGlossaryDlg, CheckBoxHdl));
787  m_xNetRelCB->set_active( rCfg.IsSaveRelNet() );
788  m_xNetRelCB->connect_toggled(LINK(this, SwGlossaryDlg, CheckBoxHdl));
789  m_xInsertTipCB->set_active( rCfg.IsAutoTextTip() );
790  m_xInsertTipCB->set_sensitive(!officecfg::Office::Writer::AutoFunction::Text::ShowToolTip::isReadOnly());
791  m_xInsertTipCB->connect_toggled(LINK(this, SwGlossaryDlg, CheckBoxHdl));
792 }
793 
794 // KeyInput for ShortName - Edits without Spaces
795 IMPL_LINK( SwNewGlosNameDlg, Modify, weld::Entry&, rBox, void )
796 {
797  OUString aName(m_xNewName->get_text());
798  SwGlossaryDlg* pDlg = m_pParent;
799  if (&rBox == m_xNewName.get())
800  m_xNewShort->set_text(lcl_GetValidShortCut(aName));
801 
802  bool bEnable = !aName.isEmpty() && !m_xNewShort->get_text().isEmpty() &&
803  (!pDlg->DoesBlockExist(aName, m_xNewShort->get_text())
804  || aName == m_xOldName->get_text());
805  m_xOk->set_sensitive(bEnable);
806 }
807 
809 {
810  SwGlossaryDlg* pDlg = m_pParent;
811  OUString sNew = GetAppCharClass().uppercase(m_xNewShort->get_text());
812  if (pDlg->m_pGlossaryHdl->HasShortName(m_xNewShort->get_text())
813  && sNew != m_xOldShort->get_text())
814  {
815  std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
816  VclMessageType::Info, VclButtonsType::Ok,
817  SwResId(STR_DOUBLE_SHORTNAME)));
818  xBox->run();
819  m_xNewShort->grab_focus();
820  }
821  else
822  m_xDialog->response(RET_OK);
823 }
824 
825 IMPL_LINK(SwGlossaryDlg, CheckBoxHdl, weld::ToggleButton&, rBox, void)
826 {
828  bool bCheck = rBox.get_active();
829  if (&rBox == m_xInsertTipCB.get())
830  rCfg.SetAutoTextTip(bCheck);
831  else if (&rBox == m_xFileRelCB.get())
832  rCfg.SetSaveRelFile(bCheck);
833  else
834  rCfg.SetSaveRelNet(bCheck);
835  rCfg.Commit();
836 }
837 
838 IMPL_LINK(SwGlossaryDlg, KeyInputHdl, const KeyEvent&, rKEvt, bool)
839 {
840  if (rKEvt.GetKeyCode().GetCode() == KEY_DELETE)
841  {
842  DeleteEntry();
843  return true;
844  }
845  return false;
846 }
847 
849 {
850  std::unique_ptr<weld::TreeIter> xEntry = m_xCategoryBox->make_iterator();
851  if (m_xCategoryBox->get_selected(xEntry.get()))
852  {
853  if (m_xCategoryBox->get_iter_depth(*xEntry))
854  m_xCategoryBox->iter_parent(*xEntry);
855  GroupUserData* pGroupData = reinterpret_cast<GroupUserData*>(m_xCategoryBox->get_id(*xEntry).toInt64());
856  return pGroupData->sGroupName + OUStringChar(GLOS_DELIM) + OUString::number(pGroupData->nPathIdx);
857  }
858  return OUString();
859 }
860 
862 {
865  SvtPathOptions aPathOpt;
866  const OUString sGlosPath( aPathOpt.GetAutoTextPath() );
867  pDlg->SetPath(sGlosPath);
868  if(RET_OK == pDlg->Execute())
869  {
870  const OUString sTmp(pDlg->GetPath());
871  if(sTmp != sGlosPath)
872  {
873  aPathOpt.SetAutoTextPath( sTmp );
874  ::GetGlossaries()->UpdateGlosPath( true );
875  Init();
876  }
877  }
878 }
879 
881 {
882  m_xDialog->response(RET_OK);
883 }
884 
886 {
888 };
889 
891 {
892  ResumeShowAutoText();
893 }
894 
895 void SwGlossaryDlg::ShowAutoText(const OUString& rGroup, const OUString& rShortName)
896 {
897  if (m_xExampleFrameWin->get_visible())
898  {
899  SetResumeData(rGroup, rShortName);
900  //try to make an Undo()
901  m_xExampleFrame->ClearDocument();
902  }
903 }
904 
906 {
907  OUString sGroup;
908  OUString sShortName;
909  if(GetResumeData(sGroup, sShortName) && m_xExampleFrameWin->get_visible())
910  {
911  if(!m_xAutoText.is())
912  {
913  //now the AutoText ListBoxes have to be filled
914  m_xAutoText = text::AutoTextContainer::create( comphelper::getProcessComponentContext() );
915  }
916 
917  uno::Reference< XTextCursor > & xCursor = m_xExampleFrame->GetTextCursor();
918  if(xCursor.is())
919  {
920  if (!sShortName.isEmpty())
921  {
922  uno::Any aGroup = m_xAutoText->getByName(sGroup);
923  uno::Reference< XAutoTextGroup > xGroup;
924  if((aGroup >>= xGroup) && xGroup->hasByName(sShortName))
925  {
926  uno::Any aEntry(xGroup->getByName(sShortName));
927  uno::Reference< XAutoTextEntry > xEntry;
928  aEntry >>= xEntry;
929  xEntry->applyTo(xCursor);
930  }
931  }
932  }
933  }
934  m_bResume = false;
935 }
936 
938 {
939  bool bEntry = m_xCategoryBox->get_selected(nullptr);
940 
941  const OUString aTitle(m_xNameED->get_text());
942  const OUString aShortName(m_xShortNameEdit->get_text());
943 
944  std::unique_ptr<weld::TreeIter> xParent;
945  std::unique_ptr<weld::TreeIter> xChild = DoesBlockExist(aTitle, aShortName);
946  if (xChild && m_xCategoryBox->get_iter_depth(*xChild))
947  {
948  xParent = m_xCategoryBox->make_iterator(xChild.get());
949  m_xCategoryBox->iter_parent(*xParent);
950  }
951 
952  const bool bExists = nullptr != xChild;
953  const bool bIsGroup = bEntry && !xParent;
954 
955  std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(m_xDialog.get(),
956  VclMessageType::Question, VclButtonsType::YesNo,
957  SwResId(STR_QUERY_DELETE)));
958  if (bExists && !bIsGroup && RET_YES == xQuery->run())
959  {
960  if (!aTitle.isEmpty() && m_pGlossaryHdl->DelGlossary(aShortName))
961  {
962  OSL_ENSURE(xChild, "entry not found!");
963  m_xCategoryBox->select(*xParent);
964  m_xCategoryBox->remove(*xChild);
965  m_xNameED->set_text(OUString());
966  NameModify(*m_xNameED);
967  }
968  }
969 }
970 
971 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const short RET_EDIT
Definition: gloshdl.cxx:50
SfxViewFrame * GetViewFrame() const
bool GetResumeData(OUString &rGroup, OUString &rShortName)
Definition: glossary.hxx:102
long Width() const
bool IsGlosPathErr() const
Definition: glosdoc.hxx:119
static SvxAutoCorrCfg & Get()
void Init()
std::shared_ptr< const SfxFilter > Next()
std::unique_ptr< weld::Entry > m_xOldShort
Definition: glossary.cxx:119
OUString sGroupName
Definition: glossary.cxx:100
std::unique_ptr< ContentProperties > pData
virtual const SfxItemSet * GetOutputItemSet() const =0
long Height() const
OUString GetGlossaryShortName(const OUString &rName)
Definition: gloshdl.cxx:233
bool m_bIsDocReadOnly
Definition: glossary.hxx:59
static SvxAbstractDialogFactory * Create()
void ShowAutoText(const OUString &rGroup, const OUString &rShortName)
Definition: glossary.cxx:895
std::shared_ptr< const SfxFilter > First()
std::unique_ptr< weld::Entry > m_xShortNameEdit
Definition: glossary.hxx:69
sal_uInt16 GetGlossaryCnt() const
Definition: gloshdl.cxx:215
virtual VclPtr< SfxAbstractDialog > CreateEventConfigDialog(weld::Widget *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
aBuf
virtual ~SwGlossaryDlg() override
Definition: glossary.cxx:241
sal_Int16 nId
bool DelGlossary(const OUString &)
Definition: gloshdl.cxx:298
std::unique_ptr< weld::CheckButton > m_xNetRelCB
Definition: glossary.hxx:72
void SetSaveRelNet(bool bSet)
std::unique_ptr< SwTextBlocks > GetGroupDoc(const OUString &rName, bool bCreate=false)
Definition: glosdoc.cxx:157
static void SetActGroup(const OUString &rNewGroup)
Definition: glossary.cxx:168
std::unique_ptr< weld::Button > m_xOk
Definition: glossary.cxx:117
static OUString lcl_GetValidShortCut(const OUString &rName)
Definition: glossary.cxx:76
bool m_bResume
Definition: glossary.hxx:54
virtual void set_text(const OUString &rText)=0
size_t GetGroupCnt() const
Definition: gloshdl.cxx:136
std::unique_ptr< weld::Button > m_xInsertBtn
Definition: glossary.hxx:73
TextFilter m_aNoSpaceFilter
Definition: glossary.cxx:112
IMPL_LINK(SwNewGlosNameDlg, TextFilterHdl, OUString &, rTest, bool)
Definition: glossary.cxx:135
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
bool HasMacro() const
const SwView & GetView() const
Definition: wrtsh.hxx:428
RET_YES
std::unique_ptr< weld::Label > m_xShortNameLbl
Definition: glossary.hxx:67
int nCount
SwNewGlosNameDlg(SwGlossaryDlg *pParent, const OUString &rOldName, const OUString &rOldShort)
Definition: glossary.cxx:141
void SetCurGroup(const OUString &aGrp, bool bApi=false, bool bAlwaysCreateNew=false)
Definition: gloshdl.cxx:92
static bool HasMacroRecorder(SfxViewFrame const *pFrame)
SW_DLLPUBLIC SwGlossaries * GetGlossaries()
Definition: initui.cxx:160
SwGlossaryHdl * m_pGlossaryHdl
Definition: glossary.hxx:50
static SfxEventNamesItem AddEvents(DlgEventType eType)
Definition: macassgn.cxx:38
sal_uInt16 nPathIdx
Definition: glossary.cxx:101
const char * sName
void Apply()
Definition: glossary.cxx:320
static OUString GetCurrGroup()
Definition: glossary.cxx:161
void ShowError()
Definition: glosdoc.cxx:411
OUString GetGlossaryName(sal_uInt16)
Definition: gloshdl.cxx:220
#define FN_INSERT_GLOSSARY
Definition: cmdid.h:580
std::unique_ptr< weld::MenuButton > m_xEditBtn
Definition: glossary.hxx:74
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
virtual short run() override
Definition: glossary.cxx:312
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
std::unique_ptr< weld::Entry > m_xNameED
Definition: glossary.hxx:66
constexpr TypedWhichId< SvxMacroItem > RES_FRMMACRO(108)
OUString GetNewName() const
Definition: glossary.cxx:131
SwGlossaryDlg(SfxViewFrame const *pViewFrame, SwGlossaryHdl *pGlosHdl, SwWrtShell *pWrtShell)
Definition: glossary.cxx:179
bool IsAutoTextTip() const
std::unique_ptr< weld::CustomWeld > m_xExampleFrameWin
Definition: glossary.hxx:78
std::unique_ptr< weld::CheckButton > m_xFileRelCB
Definition: glossary.hxx:71
#define FILTER_DOCX
Definition: iodetect.hxx:38
std::unique_ptr< weld::Button > m_xBibBtn
Definition: glossary.hxx:75
static OUString GetDefName()
Definition: glosdoc.cxx:90
DECL_LINK(Modify, weld::Entry &, void)
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
OUString GetCurrGrpName() const
Definition: glossary.cxx:848
bool IsReadOnly(const OUString *=nullptr) const
Definition: gloshdl.cxx:623
OUString GetGroupName(size_t, OUString *pTitle)
Definition: gloshdl.cxx:141
virtual VclPtr< AbstractSvxMultiPathDialog > CreateSvxPathSelectDialog(weld::Window *pParent)=0
std::unique_ptr< weld::Entry > m_xNewName
Definition: glossary.cxx:115
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
bool IsSaveRelFile() const
Shell * m_pShell
SwWrtShell * m_pShell
Definition: glossary.hxx:61
bool HasReadonlySel() const
Definition: crsrsh.cxx:3328
void EnableShortName(bool bOn=true)
Definition: glossary.cxx:336
std::unique_ptr< weld::TreeView > m_xCategoryBox
Definition: glossary.hxx:70
void UpdateGlosPath(bool bFull)
Definition: glosdoc.cxx:347
SwDocShell * GetDocShell()
Definition: view.cxx:1107
void SetMacro(SvMacroItemId nEvent, const SvxMacro &)
virtual OUString get_text() const =0
bool IsReadOnly() const
#define FILTER_WW8
WinWord 97 filter.
Definition: iodetect.hxx:33
std::unique_ptr< weld::Entry > m_xOldName
Definition: glossary.cxx:118
virtual OUString GetPath() const =0
void SetAutoTextPath(const OUString &rPath)
void SetSaveRelFile(bool bSet)
void ShowPreview()
Definition: glossary.cxx:885
SW_DLLPUBLIC const OUString & GetCurrGlosGroup()
Definition: initui.cxx:46
void ResumeShowAutoText()
Definition: glossary.cxx:905
const OUString & GetWorkPath() const
std::vector< std::unique_ptr< GroupUserData > > m_xGroupData
Definition: glossary.hxx:63
bool InsertGlossary(const OUString &rName)
Definition: gloshdl.cxx:487
bool HasShortName(const OUString &rShortName) const
Definition: gloshdl.cxx:250
css::uno::Reference< css::text::XAutoTextContainer2 > m_xAutoText
Definition: glossary.hxx:48
const SvxMacro * Get(SvMacroItemId nEvent) const
weld::Entry & rEdit
#define FN_SET_ACT_GLOSSARY
Definition: cmdid.h:582
SW_DLLPUBLIC void SetCurrGlosGroup(const OUString &sStr)
Definition: initui.cxx:51
std::vector< OUString > const & GetPathArray() const
Definition: glosdoc.hxx:120
virtual void SetPath(const OUString &rPath)=0
#define ERRCODE_NONE
std::unique_ptr< weld::Entry > m_xNewShort
Definition: glossary.cxx:116
std::unique_ptr< SwOneExampleFrame > m_xExampleFrame
Definition: glossary.hxx:77
OUString aName
RET_OK
Reference< XExecutableDialog > m_xDialog
Reference< XComponentContext > getProcessComponentContext()
const OUString & GetAutoTextPath() const
#define GLOS_DELIM
Definition: glosdoc.hxx:41
sal_Int32 getToken(const Context &rContext, const char *pToken)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
bool m_bReadOnly
void SetAutoTextTip(bool bSet)
void DeleteEntry()
Definition: glossary.cxx:937
std::unique_ptr< weld::CheckButton > m_xInsertTipCB
Definition: glossary.hxx:65
OUString GetNewShort() const
Definition: glossary.cxx:132
OUString sId
void SetResumeData(const OUString &rGroup, const OUString &rShortName)
Definition: glossary.hxx:104
bool IsSaveRelNet() const
std::unique_ptr< weld::TreeIter > DoesBlockExist(const OUString &sBlock, const OUString &rShort)
Definition: glossary.cxx:343
void AppendItem(const SfxPoolItem &)
SwGlossaryDlg * m_pParent
Definition: glossary.cxx:113
constexpr sal_uInt16 KEY_DELETE
std::unique_ptr< weld::Button > m_xPathBtn
Definition: glossary.hxx:76
CharClass & GetAppCharClass()
Definition: init.cxx:709
#define EX_SHOW_ONLINE_LAYOUT
Definition: unotools.hxx:29
STARBASIC
aStr
#define FN_NEW_GLOSSARY
Definition: cmdid.h:581
IMPL_LINK_NOARG(SwGlossaryDlg, EnableHdl, weld::ToggleButton &, void)
Definition: glossary.cxx:414
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)