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 <rtl/ustrbuf.hxx>
21 #include <sfx2/request.hxx>
22 #include <svl/stritem.hxx>
23 #include <vcl/weld.hxx>
24 #include <com/sun/star/frame/XModel.hpp>
25 #include <com/sun/star/text/XBookmarksSupplier.hpp>
26 
27 #include <swabstdlg.hxx>
28 #include <swuiexp.hxx>
29 #include <view.hxx>
30 #include <wrtsh.hxx>
31 #include <cmdid.h>
32 #include <bookmark.hxx>
33 #include <docsh.hxx>
34 #include <ndtxt.hxx>
35 #include <strings.hrc>
36 #include <svtools/miscopt.hxx>
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 && !m_bAreProtected);
85 
86  // allow to delete only if all bookmarks are recognized
87  m_xDeleteBtn->set_sensitive(nEntries > 0 && nSelectedEntries == nEntries && !m_bAreProtected);
88  m_xGotoBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 1);
89  m_xRenameBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 1 && !m_bAreProtected);
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 && !m_bAreProtected);
167  m_xEditBox->set_text(sEditBoxText.makeStringAndClear());
168  }
169  else
170  {
171  m_xInsertBtn->set_sensitive(!m_bAreProtected);
172  m_xGotoBtn->set_sensitive(false);
173  m_xRenameBtn->set_sensitive(false);
174  m_xDeleteBtn->set_sensitive(false);
175  }
176 }
177 
179 {
180  if (!ValidateBookmarks())
181  return;
182  auto xSelected = m_xBookmarksBox->get_selected();
183  if (!xSelected)
184  return;
185 
186  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected).toInt64());
187  uno::Reference<frame::XModel> xModel = rSh.GetView().GetDocShell()->GetBaseModel();
188  uno::Reference<text::XBookmarksSupplier> xBkms(xModel, uno::UNO_QUERY);
189  uno::Reference<container::XNameAccess> xNameAccess = xBkms->getBookmarks();
190  uno::Any aObj = xNameAccess->getByName(pBookmark->GetName());
191  uno::Reference<uno::XInterface> xTmp;
192  aObj >>= xTmp;
193  uno::Reference<container::XNamed> xNamed(xTmp, uno::UNO_QUERY);
195  ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(rFact.CreateSwRenameXNamedDlg(m_xDialog.get(), xNamed, xNameAccess));
197 
198  if (pDlg->Execute())
199  {
200  ValidateBookmarks();
201  m_xDeleteBtn->set_sensitive(false);
202  m_xGotoBtn->set_sensitive(false);
203  m_xRenameBtn->set_sensitive(false);
204  m_xInsertBtn->set_sensitive(false);
205  }
206 }
207 
208 // callback to an insert button. Inserts a new text mark to the current position.
210 {
211  OUString sBookmark = m_xEditBox->get_text();
212  rSh.SetBookmark2(vcl::KeyCode(), sBookmark, m_xHideCB->get_active(), m_xConditionED->get_text());
213  rReq.AppendItem(SfxStringItem(FN_INSERT_BOOKMARK, sBookmark));
214  rReq.Done();
215  if (!rReq.IsDone())
216  rReq.Ignore();
217 
218  m_xDialog->response(RET_OK);
219 }
220 
221 IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::ToggleButton&, rBox, void)
222 {
223  bool bHide = rBox.get_active();
224  m_xConditionED->set_sensitive(bHide);
225  m_xConditionFT->set_sensitive(bHide);
226 }
227 
229 {
230  if (!ValidateBookmarks())
231  return;
232  // if no entries selected we can't jump anywhere
233  // shouldn't be needed as we disable GoTo button when jump is not possible
234  auto xSelected = m_xBookmarksBox->get_selected();
235  if (!xSelected)
236  return;
237 
238  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected).toInt64());
239 
240  rSh.EnterStdMode();
241  rSh.GotoMark(pBookmark);
242 }
243 
245 {
246  if (HaveBookmarksChanged())
247  {
248  PopulateTable();
249  m_xEditBox->set_text("");
250  return false;
251  }
252  return true;
253 }
254 
256 {
257  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
258  if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
259  return true;
260 
261  std::vector<std::pair<sw::mark::IMark*, OUString>>::const_iterator aListIter = aTableBookmarks.begin();
262  for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
263  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
264  {
266  {
267  // more bookmarks then expected
268  if (aListIter == aTableBookmarks.end())
269  return true;
270  if (aListIter->first != *ppBookmark ||
271  aListIter->second != (*ppBookmark)->GetName())
272  return true;
273  ++aListIter;
274  }
275  }
276  // less bookmarks then expected
277  return aListIter != aTableBookmarks.end();
278 }
279 
281 {
282  aTableBookmarks.clear();
283  m_xBookmarksBox->clear();
284 
285  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
286  for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
287  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
288  {
290  {
291  m_xBookmarksBox->InsertBookmark(*ppBookmark);
292  aTableBookmarks.emplace_back(*ppBookmark, (*ppBookmark)->GetName());
293  }
294  }
295  m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
296 }
297 
299  : SfxDialogController(pParent, "modules/swriter/ui/insertbookmark.ui", "InsertBookmarkDialog")
300  , rSh(rS)
301  , rReq(rRequest)
302  , m_nLastBookmarksCount(0)
303  , m_bSorted(false)
304  , m_xEditBox(m_xBuilder->weld_entry("name"))
305  , m_xInsertBtn(m_xBuilder->weld_button("insert"))
306  , m_xDeleteBtn(m_xBuilder->weld_button("delete"))
307  , m_xGotoBtn(m_xBuilder->weld_button("goto"))
308  , m_xRenameBtn(m_xBuilder->weld_button("rename"))
309  , m_xHideCB(m_xBuilder->weld_check_button("hide"))
310  , m_xConditionFT(m_xBuilder->weld_label("condlabel"))
311  , m_xConditionED(new ConditionEdit(m_xBuilder->weld_entry("withcond")))
312  , m_xBookmarksBox(new BookmarkTable(m_xBuilder->weld_tree_view("bookmarks")))
313  , m_xForbiddenChars(m_xBuilder->weld_label("lbForbiddenChars"))
314 {
315  m_xBookmarksBox->connect_changed(LINK(this, SwInsertBookmarkDlg, SelectionChangedHdl));
316  m_xBookmarksBox->connect_row_activated(LINK(this, SwInsertBookmarkDlg, DoubleClickHdl));
317  m_xBookmarksBox->connect_column_clicked(LINK(this, SwInsertBookmarkDlg, HeaderBarClick));
318  m_xEditBox->connect_changed(LINK(this, SwInsertBookmarkDlg, ModifyHdl));
319  m_xInsertBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, InsertHdl));
320  m_xDeleteBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, DeleteHdl));
321  m_xGotoBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, GotoHdl));
322  m_xRenameBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, RenameHdl));
323  m_xHideCB->connect_toggled(LINK(this, SwInsertBookmarkDlg, ChangeHideHdl));
324 
325  m_xDeleteBtn->set_sensitive(false);
326  m_xGotoBtn->set_sensitive(false);
327  m_xRenameBtn->set_sensitive(false);
328 
329  PopulateTable();
330 
331  m_xEditBox->set_text(m_xBookmarksBox->GetNameProposal());
332  m_xEditBox->set_position(-1);
333 
334  m_xForbiddenChars->set_label(SwResId(STR_BOOKMARK_FORBIDDENCHARS) + " " + BookmarkTable::aForbiddenChars);
335  m_xForbiddenChars->set_visible(false);
336 
337  SvtMiscOptions aMiscOpt;
338  if ( !aMiscOpt.IsExperimentalMode() )
339  {
340  m_xHideCB->set_visible( false );
341  m_xConditionFT->set_visible( false );
342  m_xConditionED->set_visible( false );
343  }
344 
346 }
347 
348 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
349 {
350  if (!m_bSorted)
351  {
352  m_xBookmarksBox->make_sorted();
353  m_bSorted = true;
354  }
355 
356  bool bSortAtoZ = m_xBookmarksBox->get_sort_order();
357 
358  //set new arrow positions in headerbar
359  if (nColumn == m_xBookmarksBox->get_sort_column())
360  {
361  bSortAtoZ = !bSortAtoZ;
362  m_xBookmarksBox->set_sort_order(bSortAtoZ);
363  }
364  else
365  {
366  m_xBookmarksBox->set_sort_indicator(TRISTATE_INDET, m_xBookmarksBox->get_sort_column());
367  m_xBookmarksBox->set_sort_column(nColumn);
368  }
369 
370  if (nColumn != -1)
371  {
372  //sort lists
373  m_xBookmarksBox->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn);
374  }
375 }
376 
378 {
379 }
380 
381 BookmarkTable::BookmarkTable(std::unique_ptr<weld::TreeView> xControl)
382  : m_xControl(std::move(xControl))
383 {
384  m_xControl->set_size_request(450, 250);
385  std::vector<int> aWidths;
386  aWidths.push_back(40);
387  aWidths.push_back(110);
388  aWidths.push_back(150);
389  aWidths.push_back(60);
390  m_xControl->set_column_fixed_widths(aWidths);
391  m_xControl->set_selection_mode(SelectionMode::Multiple);
392 }
393 
394 std::unique_ptr<weld::TreeIter> BookmarkTable::get_selected() const
395 {
396  std::unique_ptr<weld::TreeIter> xIter(m_xControl->make_iterator());
397  if (!m_xControl->get_selected(xIter.get()))
398  xIter.reset();
399  return xIter;
400 }
401 
403 {
404  sw::mark::IBookmark* pBookmark = dynamic_cast<sw::mark::IBookmark*>(pMark);
405  assert(pBookmark);
406 
407  OUString sBookmarkNodeText = pBookmark->GetMarkStart().nNode.GetNode().GetTextNode()->GetText();
408  sal_Int32 nBookmarkNodeTextPos = pBookmark->GetMarkStart().nContent.GetIndex();
409  sal_Int32 nBookmarkTextLen = 0;
410  bool bPulledAll = false;
411  bool bPulling = false;
412  static const sal_Int32 nMaxTextLen = 50;
413 
414  if (pBookmark->IsExpanded())
415  {
416  nBookmarkTextLen = pBookmark->GetMarkEnd().nContent.GetIndex() - nBookmarkNodeTextPos;
417  }
418  else
419  {
420  if (nBookmarkNodeTextPos == sBookmarkNodeText.getLength()) // no text after bookmark
421  {
422  nBookmarkNodeTextPos = std::max<sal_Int32>(0, nBookmarkNodeTextPos - nMaxTextLen);
423  bPulling = true;
424  if (nBookmarkNodeTextPos == 0)
425  bPulledAll = true;
426  }
427  nBookmarkTextLen = sBookmarkNodeText.getLength() - nBookmarkNodeTextPos;
428  }
429  bool bExceedsLength = nBookmarkTextLen > nMaxTextLen;
430  nBookmarkTextLen = std::min<sal_Int32>(nMaxTextLen, nBookmarkTextLen);
431  sBookmarkNodeText = sBookmarkNodeText.copy(nBookmarkNodeTextPos, nBookmarkTextLen).trim();
432  if (bExceedsLength)
433  sBookmarkNodeText += "...";
434  else if (bPulling && !bPulledAll)
435  sBookmarkNodeText = "..." + sBookmarkNodeText;
436 
437  OUString sHidden = SwResId(STR_BOOKMARK_NO);
438  if (pBookmark->IsHidden())
439  sHidden = SwResId(STR_BOOKMARK_YES);
440  const OUString& sHideCondition = pBookmark->GetHideCondition();
441  OUString sPageNum = OUString::number(SwPaM(pMark->GetMarkStart()).GetPageNum());
442  int nRow = m_xControl->n_children();
443  m_xControl->append(OUString::number(reinterpret_cast<sal_Int64>(pMark)), sPageNum);
444  m_xControl->set_text(nRow, pBookmark->GetName(), 1);
445  m_xControl->set_text(nRow, sBookmarkNodeText, 2);
446  m_xControl->set_text(nRow, sHidden, 3);
447  m_xControl->set_text(nRow, sHideCondition, 4);
448 }
449 
450 std::unique_ptr<weld::TreeIter> BookmarkTable::GetRowByBookmarkName(const OUString& sName)
451 {
452  std::unique_ptr<weld::TreeIter> xRet;
453  m_xControl->all_foreach([this, &sName, &xRet](weld::TreeIter& rEntry){
454  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(rEntry).toInt64());
455  if (pBookmark->GetName() == sName)
456  {
457  xRet = m_xControl->make_iterator(&rEntry);
458  return true;
459  }
460  return false;
461  });
462  return xRet;
463 }
464 
466 {
467  auto xEntry = GetRowByBookmarkName(sName);
468  if (!xEntry)
469  return nullptr;
470 
471  return reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(*xEntry).toInt64());
472 }
473 
474 void BookmarkTable::SelectByName(const OUString& sName)
475 {
476  auto xEntry = GetRowByBookmarkName(sName);
477  if (!xEntry)
478  return;
479  select(*xEntry);
480 }
481 
483 {
484  OUString sDefaultBookmarkName = SwResId(STR_BOOKMARK_DEF_NAME);
485  sal_Int32 nHighestBookmarkId = 0;
486  for (int i = 0, nCount = m_xControl->n_children(); i < nCount; ++i)
487  {
488  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(i).toInt64());
489  const OUString& sName = pBookmark->GetName();
490  sal_Int32 nIndex = 0;
491  if (sName.getToken(0, ' ', nIndex) == sDefaultBookmarkName)
492  {
493  sal_Int32 nCurrBookmarkId = sName.getToken(0, ' ', nIndex).toInt32();
494  nHighestBookmarkId = std::max<sal_Int32>(nHighestBookmarkId, nCurrBookmarkId);
495  }
496  }
497  return sDefaultBookmarkName + " " + OUString::number(nHighestBookmarkId + 1);
498 }
499 
500 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsExperimentalMode() const
virtual void SetForbiddenChars(const OUString &rSet)=0
virtual ~SwInsertBookmarkDlg() override
Definition: bookmark.cxx:377
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:211
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:2585
SwNode & GetNode() const
Definition: ndindex.hxx:119
void EnterStdMode()
Definition: select.cxx:550
virtual short Execute()=0
TRISTATE_TRUE
bool HaveBookmarksChanged()
Definition: bookmark.cxx:255
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:191
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:2589
std::unique_ptr< weld::CheckButton > m_xHideCB
Definition: bookmark.hxx:79
std::unique_ptr< weld::TreeIter > GetRowByBookmarkName(const OUString &sName)
Definition: bookmark.cxx:450
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.
int i
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
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:482
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:474
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:381
bool ValidateBookmarks()
Check if displayed bookmarks are up-to date, if not update them.
Definition: bookmark.cxx:244
std::unique_ptr< weld::TreeIter > get_selected() const
Definition: bookmark.cxx:394
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:298
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:465
virtual const SwPosition & GetMarkStart() const =0
void GotoSelectedBookmark()
Definition: bookmark.cxx:228
void InsertBookmark(sw::mark::IMark *pMark)
Definition: bookmark.cxx:402
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:836
IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::ToggleButton &, rBox, void)
Definition: bookmark.cxx:221