LibreOffice Module sw (master)  1
bookmark.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 <sfx2/request.hxx>
21 #include <svl/stritem.hxx>
22 #include <vcl/weld.hxx>
23 #include <com/sun/star/text/XBookmarksSupplier.hpp>
24 
25 #include <swabstdlg.hxx>
26 #include <swuiexp.hxx>
27 #include <view.hxx>
28 #include <wrtsh.hxx>
29 #include <cmdid.h>
30 #include <bookmark.hxx>
31 #include <docsh.hxx>
32 #include <ndtxt.hxx>
33 #include <strings.hrc>
34 #include <svtools/miscopt.hxx>
36 
37 using namespace ::com::sun::star;
38 
39 const OUString BookmarkTable::aForbiddenChars("/\\@*?\",#");
40 const char BookmarkTable::cSeparator(';');
41 
42 // callback to modify EditBox
44 {
45  ValidateBookmarks();
46  m_xBookmarksBox->unselect_all();
47  // if a string has been pasted from the clipboard then
48  // there may be illegal characters in the box
49  // sanitization
50  OUString sTmp = m_xEditBox->get_text();
51  OUString sMsg;
52  const sal_Int32 nLen = sTmp.getLength();
53  for (sal_Int32 i = 0; i < BookmarkTable::aForbiddenChars.getLength(); i++)
54  {
55  const sal_Int32 nTmpLen = sTmp.getLength();
56  sTmp = sTmp.replaceAll(OUStringChar(BookmarkTable::aForbiddenChars[i]), "");
57  if (sTmp.getLength() != nTmpLen)
58  sMsg += OUStringChar(BookmarkTable::aForbiddenChars[i]);
59  }
60  const bool bHasForbiddenChars = sTmp.getLength() != nLen;
61  m_xForbiddenChars->set_visible(bHasForbiddenChars);
62  if (bHasForbiddenChars)
63  m_xEditBox->set_message_type(weld::EntryMessageType::Error);
64  else
65  m_xEditBox->set_message_type(weld::EntryMessageType::Normal);
66 
67  sal_Int32 nSelectedEntries = 0;
68  sal_Int32 nEntries = 0;
69  sal_Int32 nTokenIndex = 0;
70  while (!sTmp.isEmpty() && nTokenIndex >= 0)
71  {
72  OUString aToken = sTmp.getToken(0, BookmarkTable::cSeparator, nTokenIndex);
73  if (m_xBookmarksBox->GetBookmarkByName(aToken))
74  {
75  m_xBookmarksBox->SelectByName(aToken);
76  nSelectedEntries++;
77  }
78  nEntries++;
79  }
80 
81  // allow to add new bookmark only if one name provided and it's not taken
82  m_xInsertBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 0 && !bHasForbiddenChars && !m_bAreProtected);
83 
84  // allow to delete only if all bookmarks are recognized
85  m_xDeleteBtn->set_sensitive(nEntries > 0 && nSelectedEntries == nEntries && !m_bAreProtected);
86  m_xGotoBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 1);
87  m_xRenameBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 1 && !m_bAreProtected);
88 }
89 
90 // callback to delete a text mark
92 {
93  if (!ValidateBookmarks())
94  return;
95 
96  int nSelectedRows(0);
97 
98  m_xBookmarksBox->selected_foreach([this, &nSelectedRows](weld::TreeIter& rEntry){
99  // remove from model
100  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry).toInt64());
101  OUString sRemoved = pBookmark->GetName();
102  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
103  pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved));
104  SfxRequest aReq(rSh.GetView().GetViewFrame(), FN_DELETE_BOOKMARK);
105  aReq.AppendItem(SfxStringItem(FN_DELETE_BOOKMARK, sRemoved));
106  aReq.Done();
107  aTableBookmarks.erase(std::remove(aTableBookmarks.begin(), aTableBookmarks.end(),
108  std::make_pair(pBookmark, sRemoved)), aTableBookmarks.end());
109 
110  ++nSelectedRows;
111 
112  return false;
113  });
114 
115  if (!nSelectedRows)
116  return;
117 
118  // remove from BookmarkTable
119  m_xBookmarksBox->remove_selection();
120 
121  ValidateBookmarks();
122 
123  m_xDeleteBtn->set_sensitive(false);
124  m_xGotoBtn->set_sensitive(false);
125  m_xRenameBtn->set_sensitive(false);
126  m_xInsertBtn->set_sensitive(false);
127 }
128 
129 // callback to a goto button
131 {
132  GotoSelectedBookmark();
133 }
134 
136 {
137  GotoSelectedBookmark();
138  return true;
139 }
140 
142 {
143  if (!ValidateBookmarks())
144  return;
145  // this event should fired only if we change selection by clicking on BookmarkTable entry
146  if (!m_xBookmarksBox->has_focus())
147  return;
148 
149  OUStringBuffer sEditBoxText;
150  int nSelectedRows = 0;
151  m_xBookmarksBox->selected_foreach([this, &sEditBoxText, &nSelectedRows](weld::TreeIter& rEntry){
152  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry).toInt64());
153  const OUString& sEntryName = pBookmark->GetName();
154  if (!sEditBoxText.isEmpty())
155  sEditBoxText.append(";");
156  sEditBoxText.append(sEntryName);
157  ++nSelectedRows;
158  return false;
159  });
160  if (nSelectedRows)
161  {
162  m_xInsertBtn->set_sensitive(false);
163  m_xGotoBtn->set_sensitive(nSelectedRows == 1);
164  m_xRenameBtn->set_sensitive(nSelectedRows == 1 && !m_bAreProtected);
165  m_xEditBox->set_text(sEditBoxText.makeStringAndClear());
166  }
167  else
168  {
169  m_xInsertBtn->set_sensitive(!m_bAreProtected);
170  m_xGotoBtn->set_sensitive(false);
171  m_xRenameBtn->set_sensitive(false);
172  m_xDeleteBtn->set_sensitive(false);
173  }
174 }
175 
177 {
178  if (!ValidateBookmarks())
179  return;
180  auto xSelected = m_xBookmarksBox->get_selected();
181  if (!xSelected)
182  return;
183 
184  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected).toInt64());
185  uno::Reference<frame::XModel> xModel = rSh.GetView().GetDocShell()->GetBaseModel();
186  uno::Reference<text::XBookmarksSupplier> xBkms(xModel, uno::UNO_QUERY);
187  uno::Reference<container::XNameAccess> xNameAccess = xBkms->getBookmarks();
188  uno::Any aObj = xNameAccess->getByName(pBookmark->GetName());
189  uno::Reference<uno::XInterface> xTmp;
190  aObj >>= xTmp;
191  uno::Reference<container::XNamed> xNamed(xTmp, uno::UNO_QUERY);
193  ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(rFact.CreateSwRenameXNamedDlg(m_xDialog.get(), xNamed, xNameAccess));
195 
196  if (pDlg->Execute())
197  {
198  ValidateBookmarks();
199  m_xDeleteBtn->set_sensitive(false);
200  m_xGotoBtn->set_sensitive(false);
201  m_xRenameBtn->set_sensitive(false);
202  m_xInsertBtn->set_sensitive(false);
203  }
204 }
205 
206 // callback to an insert button. Inserts a new text mark to the current position.
208 {
209  OUString sBookmark = m_xEditBox->get_text();
210  rSh.SetBookmark2(vcl::KeyCode(), sBookmark, m_xHideCB->get_active(), m_xConditionED->get_text());
211  rReq.AppendItem(SfxStringItem(FN_INSERT_BOOKMARK, sBookmark));
212  rReq.Done();
213  if (!rReq.IsDone())
214  rReq.Ignore();
215 
216  m_xDialog->response(RET_OK);
217 }
218 
219 IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::ToggleButton&, rBox, void)
220 {
221  bool bHide = rBox.get_active();
222  m_xConditionED->set_sensitive(bHide);
223  m_xConditionFT->set_sensitive(bHide);
224 }
225 
227 {
228  if (!ValidateBookmarks())
229  return;
230  // if no entries selected we can't jump anywhere
231  // shouldn't be needed as we disable GoTo button when jump is not possible
232  auto xSelected = m_xBookmarksBox->get_selected();
233  if (!xSelected)
234  return;
235 
236  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected).toInt64());
237 
238  rSh.EnterStdMode();
239  rSh.GotoMark(pBookmark);
240 }
241 
243 {
244  if (HaveBookmarksChanged())
245  {
246  PopulateTable();
247  m_xEditBox->set_text("");
248  return false;
249  }
250  return true;
251 }
252 
254 {
255  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
256  if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
257  return true;
258 
259  std::vector<std::pair<sw::mark::IMark*, OUString>>::const_iterator aListIter = aTableBookmarks.begin();
260  for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
261  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
262  {
264  {
265  // more bookmarks then expected
266  if (aListIter == aTableBookmarks.end())
267  return true;
268  if (aListIter->first != *ppBookmark ||
269  aListIter->second != (*ppBookmark)->GetName())
270  return true;
271  ++aListIter;
272  }
273  }
274  // less bookmarks then expected
275  return aListIter != aTableBookmarks.end();
276 }
277 
279 {
280  aTableBookmarks.clear();
281  m_xBookmarksBox->clear();
282 
283  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
284  for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
285  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
286  {
288  {
289  m_xBookmarksBox->InsertBookmark(*ppBookmark);
290  aTableBookmarks.emplace_back(*ppBookmark, (*ppBookmark)->GetName());
291  }
292  }
293  m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
294 }
295 
297  : SfxDialogController(pParent, "modules/swriter/ui/insertbookmark.ui", "InsertBookmarkDialog")
298  , rSh(rS)
299  , rReq(rRequest)
300  , m_nLastBookmarksCount(0)
301  , m_bSorted(false)
302  , m_xEditBox(m_xBuilder->weld_entry("name"))
303  , m_xInsertBtn(m_xBuilder->weld_button("insert"))
304  , m_xDeleteBtn(m_xBuilder->weld_button("delete"))
305  , m_xGotoBtn(m_xBuilder->weld_button("goto"))
306  , m_xRenameBtn(m_xBuilder->weld_button("rename"))
307  , m_xHideCB(m_xBuilder->weld_check_button("hide"))
308  , m_xConditionFT(m_xBuilder->weld_label("condlabel"))
309  , m_xConditionED(new ConditionEdit(m_xBuilder->weld_entry("withcond")))
310  , m_xBookmarksBox(new BookmarkTable(m_xBuilder->weld_tree_view("bookmarks")))
311  , m_xForbiddenChars(m_xBuilder->weld_label("lbForbiddenChars"))
312 {
313  m_xBookmarksBox->connect_changed(LINK(this, SwInsertBookmarkDlg, SelectionChangedHdl));
314  m_xBookmarksBox->connect_row_activated(LINK(this, SwInsertBookmarkDlg, DoubleClickHdl));
315  m_xBookmarksBox->connect_column_clicked(LINK(this, SwInsertBookmarkDlg, HeaderBarClick));
316  m_xEditBox->connect_changed(LINK(this, SwInsertBookmarkDlg, ModifyHdl));
317  m_xInsertBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, InsertHdl));
318  m_xDeleteBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, DeleteHdl));
319  m_xGotoBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, GotoHdl));
320  m_xRenameBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, RenameHdl));
321  m_xHideCB->connect_toggled(LINK(this, SwInsertBookmarkDlg, ChangeHideHdl));
322 
323  m_xDeleteBtn->set_sensitive(false);
324  m_xGotoBtn->set_sensitive(false);
325  m_xRenameBtn->set_sensitive(false);
326 
327  PopulateTable();
328 
329  m_xEditBox->set_text(m_xBookmarksBox->GetNameProposal());
330  m_xEditBox->set_position(-1);
331 
332  m_xForbiddenChars->set_label(SwResId(STR_BOOKMARK_FORBIDDENCHARS) + " " + BookmarkTable::aForbiddenChars);
333  m_xForbiddenChars->set_visible(false);
334 
335  SvtMiscOptions aMiscOpt;
336  if ( !aMiscOpt.IsExperimentalMode() )
337  {
338  m_xHideCB->set_visible( false );
339  m_xConditionFT->set_visible( false );
340  m_xConditionED->set_visible( false );
341  }
342 
344 }
345 
346 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
347 {
348  if (!m_bSorted)
349  {
350  m_xBookmarksBox->make_sorted();
351  m_bSorted = true;
352  }
353 
354  bool bSortAtoZ = m_xBookmarksBox->get_sort_order();
355 
356  //set new arrow positions in headerbar
357  if (nColumn == m_xBookmarksBox->get_sort_column())
358  {
359  bSortAtoZ = !bSortAtoZ;
360  m_xBookmarksBox->set_sort_order(bSortAtoZ);
361  }
362  else
363  {
364  m_xBookmarksBox->set_sort_indicator(TRISTATE_INDET, m_xBookmarksBox->get_sort_column());
365  m_xBookmarksBox->set_sort_column(nColumn);
366  }
367 
368  if (nColumn != -1)
369  {
370  //sort lists
371  m_xBookmarksBox->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn);
372  }
373 }
374 
376 {
377 }
378 
379 BookmarkTable::BookmarkTable(std::unique_ptr<weld::TreeView> xControl)
380  : m_xControl(std::move(xControl))
381 {
382  m_xControl->set_size_request(450, 250);
383  std::vector<int> aWidths;
384  aWidths.push_back(40);
385  aWidths.push_back(110);
386  aWidths.push_back(150);
387  aWidths.push_back(60);
388  m_xControl->set_column_fixed_widths(aWidths);
389  m_xControl->set_selection_mode(SelectionMode::Multiple);
390 }
391 
392 std::unique_ptr<weld::TreeIter> BookmarkTable::get_selected() const
393 {
394  std::unique_ptr<weld::TreeIter> xIter(m_xControl->make_iterator());
395  if (!m_xControl->get_selected(xIter.get()))
396  xIter.reset();
397  return xIter;
398 }
399 
401 {
402  sw::mark::IBookmark* pBookmark = dynamic_cast<sw::mark::IBookmark*>(pMark);
403  assert(pBookmark);
404 
405  OUString sBookmarkNodeText = pBookmark->GetMarkStart().nNode.GetNode().GetTextNode()->GetText();
406  sal_Int32 nBookmarkNodeTextPos = pBookmark->GetMarkStart().nContent.GetIndex();
407  sal_Int32 nBookmarkTextLen = 0;
408  bool bPulledAll = false;
409  bool bPulling = false;
410  static const sal_Int32 nMaxTextLen = 50;
411 
412  if (pBookmark->IsExpanded())
413  {
414  nBookmarkTextLen = pBookmark->GetMarkEnd().nContent.GetIndex() - nBookmarkNodeTextPos;
415  }
416  else
417  {
418  if (nBookmarkNodeTextPos == sBookmarkNodeText.getLength()) // no text after bookmark
419  {
420  nBookmarkNodeTextPos = std::max<sal_Int32>(0, nBookmarkNodeTextPos - nMaxTextLen);
421  bPulling = true;
422  if (nBookmarkNodeTextPos == 0)
423  bPulledAll = true;
424  }
425  nBookmarkTextLen = sBookmarkNodeText.getLength() - nBookmarkNodeTextPos;
426  }
427  bool bExceedsLength = nBookmarkTextLen > nMaxTextLen;
428  nBookmarkTextLen = std::min<sal_Int32>(nMaxTextLen, nBookmarkTextLen);
429  sBookmarkNodeText = sBookmarkNodeText.copy(nBookmarkNodeTextPos, nBookmarkTextLen).trim();
430  if (bExceedsLength)
431  sBookmarkNodeText += "...";
432  else if (bPulling && !bPulledAll)
433  sBookmarkNodeText = "..." + sBookmarkNodeText;
434 
435  OUString sHidden = SwResId(STR_BOOKMARK_NO);
436  if (pBookmark->IsHidden())
437  sHidden = SwResId(STR_BOOKMARK_YES);
438  const OUString& sHideCondition = pBookmark->GetHideCondition();
439  OUString sPageNum = OUString::number(SwPaM(pMark->GetMarkStart()).GetPageNum());
440  int nRow = m_xControl->n_children();
441  m_xControl->append(OUString::number(reinterpret_cast<sal_Int64>(pMark)), sPageNum);
442  m_xControl->set_text(nRow, pBookmark->GetName(), 1);
443  m_xControl->set_text(nRow, sBookmarkNodeText, 2);
444  m_xControl->set_text(nRow, sHidden, 3);
445  m_xControl->set_text(nRow, sHideCondition, 4);
446 }
447 
448 std::unique_ptr<weld::TreeIter> BookmarkTable::GetRowByBookmarkName(const OUString& sName)
449 {
450  std::unique_ptr<weld::TreeIter> xRet;
451  m_xControl->all_foreach([this, &sName, &xRet](weld::TreeIter& rEntry){
452  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(rEntry).toInt64());
453  if (pBookmark->GetName() == sName)
454  {
455  xRet = m_xControl->make_iterator(&rEntry);
456  return true;
457  }
458  return false;
459  });
460  return xRet;
461 }
462 
464 {
465  auto xEntry = GetRowByBookmarkName(sName);
466  if (!xEntry)
467  return nullptr;
468 
469  return reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(*xEntry).toInt64());
470 }
471 
472 void BookmarkTable::SelectByName(const OUString& sName)
473 {
474  auto xEntry = GetRowByBookmarkName(sName);
475  if (!xEntry)
476  return;
477  select(*xEntry);
478 }
479 
481 {
482  OUString sDefaultBookmarkName = SwResId(STR_BOOKMARK_DEF_NAME);
483  sal_Int32 nHighestBookmarkId = 0;
484  for (int i = 0, nCount = m_xControl->n_children(); i < nCount; ++i)
485  {
486  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(i).toInt64());
487  const OUString& sName = pBookmark->GetName();
488  sal_Int32 nIndex = 0;
489  if (sName.getToken(0, ' ', nIndex) == sDefaultBookmarkName)
490  {
491  sal_Int32 nCurrBookmarkId = sName.getToken(0, ' ', nIndex).toInt32();
492  nHighestBookmarkId = std::max<sal_Int32>(nHighestBookmarkId, nCurrBookmarkId);
493  }
494  }
495  return sDefaultBookmarkName + " " + OUString::number(nHighestBookmarkId + 1);
496 }
497 
498 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsExperimentalMode() const
virtual void SetForbiddenChars(const OUString &rSet)=0
virtual ~SwInsertBookmarkDlg() override
Definition: bookmark.cxx:375
sal_Int32 nIndex
virtual const OUString & GetName() const =0
SwWrtShell & rSh
Definition: bookmark.hxx:67
std::unique_ptr< weld::TreeView > m_xControl
Definition: bookmark.hxx:32
const OUString & GetText() const
Definition: ndtxt.hxx:210
static const OUString aForbiddenChars
Definition: bookmark.hxx:61
Reference< XControl > m_xControl
SwNodeIndex nNode
Definition: pam.hxx:37
virtual sal_Int32 getBookmarksCount() const =0
returns the number of IBookmarks.
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
std::unique_ptr< weld::Button > m_xInsertBtn
Definition: bookmark.hxx:75
std::unique_ptr< weld::Label > m_xConditionFT
Definition: bookmark.hxx:80
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:474
Provides access to the marks of a document.
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: viewsh.cxx:2578
SwNode & GetNode() const
Definition: ndindex.hxx:119
void EnterStdMode()
Definition: select.cxx:550
virtual short Execute()=0
TRISTATE_TRUE
bool HaveBookmarksChanged()
Definition: bookmark.cxx:253
std::unique_ptr< weld::Label > m_xForbiddenChars
Definition: bookmark.hxx:83
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
virtual const OUString & GetHideCondition() const =0
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
SwIndex nContent
Definition: pam.hxx:38
#define FN_INSERT_BOOKMARK
Definition: cmdid.h:189
int nCount
std::unique_ptr< weld::Button > m_xRenameBtn
Definition: bookmark.hxx:78
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2582
std::unique_ptr< weld::CheckButton > m_xHideCB
Definition: bookmark.hxx:79
std::unique_ptr< weld::TreeIter > GetRowByBookmarkName(const OUString &sName)
Definition: bookmark.cxx:448
sal_Int32 m_nLastBookmarksCount
Definition: bookmark.hxx:70
TRISTATE_INDET
const char * sName
std::unique_ptr< ConditionEdit > m_xConditionED
Definition: bookmark.hxx:81
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark)=0
Deletes a mark.
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
SwAbstractDialogFactory & GetFactory()
Definition: swuiexp.cxx:26
std::unique_ptr< weld::Button > m_xDeleteBtn
Definition: bookmark.hxx:76
std::unique_ptr< BookmarkTable > m_xBookmarksBox
Definition: bookmark.hxx:82
int i
TRISTATE_FALSE
static const char cSeparator
Definition: bookmark.hxx:62
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
OUString GetNameProposal() const
Definition: bookmark.cxx:480
IMPL_LINK_NOARG(SwInsertBookmarkDlg, ModifyHdl, weld::Entry &, void)
Definition: bookmark.cxx:43
void select(const weld::TreeIter &rIter)
Definition: bookmark.hxx:46
void SelectByName(const OUString &sName)
Definition: bookmark.cxx:472
std::vector< std::pair< sw::mark::IMark *, OUString > > aTableBookmarks
Definition: bookmark.hxx:69
void GotoMark(const ::sw::mark::IMark *const pMark)
Definition: wrtsh3.cxx:133
BookmarkTable(std::unique_ptr< weld::TreeView > xControl)
Definition: bookmark.cxx:379
bool ValidateBookmarks()
Check if displayed bookmarks are up-to date, if not update them.
Definition: bookmark.cxx:242
std::unique_ptr< weld::TreeIter > get_selected() const
Definition: bookmark.cxx:392
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
sal_Int32 GetIndex() const
Definition: index.hxx:95
SwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh, SfxRequest &rReq)
Definition: bookmark.cxx:296
RET_OK
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Entry > m_xEditBox
Definition: bookmark.hxx:74
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual const SwPosition & GetMarkEnd() const =0
std::unique_ptr< weld::Button > m_xGotoBtn
Definition: bookmark.hxx:77
void AppendItem(const SfxPoolItem &)
Reference< XModel > xModel
sw::mark::IMark * GetBookmarkByName(const OUString &sName)
Definition: bookmark.cxx:463
virtual const SwPosition & GetMarkStart() const =0
void GotoSelectedBookmark()
Definition: bookmark.cxx:226
void InsertBookmark(sw::mark::IMark *pMark)
Definition: bookmark.cxx:400
virtual bool IsExpanded() const =0
virtual VclPtr< AbstractSwRenameXNamedDlg > CreateSwRenameXNamedDlg(weld::Window *pParent, css::uno::Reference< css::container::XNamed > &xNamed, css::uno::Reference< css::container::XNameAccess > &xNameAccess)=0
virtual bool IsHidden() const =0
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::ToggleButton &, rBox, void)
Definition: bookmark.cxx:219