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