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