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