LibreOffice Module sc (master)  1
condformatdlg.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 
10 #include <comphelper/lok.hxx>
11 #include <condformatdlg.hxx>
12 
13 #include <sfx2/dispatch.hxx>
14 #include <sfx2/lokhelper.hxx>
15 #include <vcl/settings.hxx>
16 #include <vcl/svapp.hxx>
17 
18 #include <anyrefdg.hxx>
19 #include <document.hxx>
20 #include <conditio.hxx>
21 #include <tabvwsh.hxx>
22 #include <colorscale.hxx>
23 #include <reffact.hxx>
24 #include <docsh.hxx>
25 #include <docfunc.hxx>
26 #include <condformatdlgentry.hxx>
27 #include <condformatdlgitem.hxx>
28 
30  std::unique_ptr<weld::ScrolledWindow> xWindow,
31  std::unique_ptr<weld::Container> xGrid)
32  : mxScrollWindow(std::move(xWindow))
33  , mxGrid(std::move(xGrid))
34  , mbFrozen(false)
35  , mbNewEntry(false)
36  , mpDoc(nullptr)
37  , mpDialogParent(pDialogParent)
38 {
39  mxScrollWindow->set_size_request(mxScrollWindow->get_approximate_digit_width() * 85,
40  mxScrollWindow->get_text_height() * 23);
41  mxGrid->set_stack_background();
42 }
43 
45 {
46  return mpDialogParent->getDialog();
47 }
48 
50 {
51  Freeze();
52 }
53 
55  const ScConditionalFormat* pFormat, const ScRangeList& rRanges,
57 {
58  mpDoc = &rDoc;
59  maPos = rPos;
60  maRanges = rRanges;
61 
62  Freeze();
63 
64  if(pFormat)
65  {
66  size_t nCount = pFormat->size();
67  for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
68  {
69  const ScFormatEntry* pEntry = pFormat->GetEntry(nIndex);
70  switch(pEntry->GetType())
71  {
74  {
75  const ScCondFormatEntry* pConditionEntry = static_cast<const ScCondFormatEntry*>( pEntry );
76  if(pConditionEntry->GetOperation() != ScConditionMode::Direct)
77  maEntries.emplace_back(new ScConditionFrmtEntry( this, mpDoc, mpDialogParent, maPos, pConditionEntry ) );
78  else
79  maEntries.emplace_back(new ScFormulaFrmtEntry( this, mpDoc, mpDialogParent, maPos, pConditionEntry ) );
80 
81  }
82  break;
84  {
85  const ScColorScaleFormat* pColorScale = static_cast<const ScColorScaleFormat*>( pEntry );
86  if( pColorScale->size() == 2 )
87  maEntries.emplace_back(new ScColorScale2FrmtEntry( this, mpDoc, maPos, pColorScale ) );
88  else
89  maEntries.emplace_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos, pColorScale ) );
90  }
91  break;
93  maEntries.emplace_back(new ScDataBarFrmtEntry( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
94  break;
96  maEntries.emplace_back(new ScIconSetFrmtEntry( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
97  break;
99  maEntries.emplace_back(new ScDateFrmtEntry( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
100  break;
101  }
102  }
103  if(nCount)
104  EntrySelectHdl(*maEntries[0]);
105  }
106  else
107  {
108  switch(eType)
109  {
111  maEntries.emplace_back(new ScConditionFrmtEntry( this, mpDoc, mpDialogParent, maPos ));
112  break;
114  maEntries.emplace_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos ));
115  break;
117  maEntries.emplace_back(new ScDataBarFrmtEntry( this, mpDoc, maPos ));
118  break;
120  maEntries.emplace_back(new ScIconSetFrmtEntry( this, mpDoc, maPos ));
121  break;
123  maEntries.emplace_back(new ScDateFrmtEntry( this, mpDoc ));
124  break;
126  break;
127  }
128  mbNewEntry = true;
129  }
130  Thaw();
131  RecalcAll();
132  if (!maEntries.empty())
133  {
134  (*maEntries.begin())->SetActive();
136  }
137 
138  RecalcAll();
139 }
140 
142 {
143  maRanges = rRange;
144 }
145 
146 std::unique_ptr<ScConditionalFormat> ScCondFormatList::GetConditionalFormat() const
147 {
148  if(maEntries.empty())
149  return nullptr;
150 
151  std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(0, mpDoc));
152  pFormat->SetRange(maRanges);
153 
154  for(auto & rEntry: maEntries)
155  {
156  // tdf#119178: Sometimes initial apply-to range (the one this dialog
157  // was opened with) is different from the final apply-to range
158  // (as edited by the user)
159 
160  // If this format entry is new, take top-left corner of the final range
161  // and use it to create the initial entry (token array therein, if applicable)
162  if (mbNewEntry)
163  rEntry->SetPos(maRanges.GetTopLeftCorner());
164  // else do nothing: setting new position when editing recompiles formulas
165  // in entries and nobody wants that
166 
167  ScFormatEntry* pEntry = rEntry->GetEntry();
168  if(pEntry)
169  pFormat->AddEntry(pEntry);
170  }
171 
172  return pFormat;
173 }
174 
176 {
177  if (mbFrozen)
178  return;
179 
180  sal_Int32 nIndex = 1;
181  for (const auto& item : maEntries)
182  {
183  if (!item)
184  continue;
185  item->SetIndex(nIndex);
186  item->set_grid_top_attach(nIndex - 1);
187  ++nIndex;
188  }
189 }
190 
191 IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, weld::ComboBox&, rBox, void)
192 {
193  Application::PostUserEvent(LINK(this, ScCondFormatList, AfterColFormatTypeHdl), &rBox);
194 }
195 
196 IMPL_LINK(ScCondFormatList, AfterColFormatTypeHdl, void*, p, void)
197 {
198  weld::ComboBox* pBox = static_cast<weld::ComboBox*>(p);
199  EntryContainer::iterator itr = std::find_if(maEntries.begin(), maEntries.end(),
200  [](const std::unique_ptr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
201  if(itr == maEntries.end())
202  return;
203 
204  sal_Int32 nPos = pBox->get_active();
205  switch(nPos)
206  {
207  case 0:
208  if((*itr)->GetType() == condformat::entry::COLORSCALE2)
209  return;
210 
211  Freeze();
212  itr->reset(new ScColorScale2FrmtEntry(this, mpDoc, maPos));
213  break;
214  case 1:
215  if((*itr)->GetType() == condformat::entry::COLORSCALE3)
216  return;
217 
218  Freeze();
219  itr->reset(new ScColorScale3FrmtEntry(this, mpDoc, maPos));
220  break;
221  case 2:
222  if((*itr)->GetType() == condformat::entry::DATABAR)
223  return;
224 
225  Freeze();
226  itr->reset(new ScDataBarFrmtEntry(this, mpDoc, maPos));
227  break;
228  case 3:
229  if((*itr)->GetType() == condformat::entry::ICONSET)
230  return;
231 
232  Freeze();
233  itr->reset(new ScIconSetFrmtEntry(this, mpDoc, maPos));
234  break;
235  default:
236  break;
237  }
238  mpDialogParent->InvalidateRefData();
239  (*itr)->SetActive();
240  Thaw();
241  RecalcAll();
242 }
243 
244 IMPL_LINK(ScCondFormatList, TypeListHdl, weld::ComboBox&, rBox, void)
245 {
246  //Resolves: fdo#79021 At this point we are still inside the ListBox Select.
247  //If we call maEntries.replace here then the pBox will be deleted before it
248  //has finished Select and will crash on accessing its deleted this. So Post
249  //to do the real work after the Select has completed
250  Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), &rBox);
251 }
252 
253 IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, void)
254 {
255  weld::ComboBox* pBox = static_cast<weld::ComboBox*>(p);
256  EntryContainer::iterator itr = std::find_if(maEntries.begin(), maEntries.end(),
257  [](const std::unique_ptr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
258  if(itr == maEntries.end())
259  return;
260 
261  sal_Int32 nPos = pBox->get_active();
262  switch(nPos)
263  {
264  case 0:
265  switch((*itr)->GetType())
266  {
270  break;
275  return;
276  }
277  Freeze();
278  itr->reset(new ScColorScale3FrmtEntry(this, mpDoc, maPos));
279  mpDialogParent->InvalidateRefData();
280  (*itr)->SetActive();
281  break;
282  case 1:
283  if((*itr)->GetType() == condformat::entry::CONDITION)
284  return;
285 
286  Freeze();
287  itr->reset(new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos));
288  mpDialogParent->InvalidateRefData();
289  (*itr)->SetActive();
290  break;
291  case 2:
292  if((*itr)->GetType() == condformat::entry::FORMULA)
293  return;
294 
295  Freeze();
296  itr->reset(new ScFormulaFrmtEntry(this, mpDoc, mpDialogParent, maPos));
297  mpDialogParent->InvalidateRefData();
298  (*itr)->SetActive();
299  break;
300  case 3:
301  if((*itr)->GetType() == condformat::entry::DATE)
302  return;
303 
304  Freeze();
305  itr->reset(new ScDateFrmtEntry( this, mpDoc ));
306  mpDialogParent->InvalidateRefData();
307  (*itr)->SetActive();
308  break;
309 
310  }
311  Thaw();
312  RecalcAll();
313 }
314 
316 {
317  Freeze();
318  maEntries.emplace_back(new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos));
319  for(auto& rxEntry : maEntries)
320  {
321  rxEntry->SetInactive();
322  }
323  mpDialogParent->InvalidateRefData();
324  maEntries.back()->SetActive();
325  mpDialogParent->OnSelectionChange(maEntries.size() - 1, maEntries.size());
326  Thaw();
327  RecalcAll();
328 }
329 
331 {
332  Freeze();
333  auto itr = std::find_if(maEntries.begin(), maEntries.end(),
334  [](const std::unique_ptr<ScCondFrmtEntry>& widget) { return widget->IsSelected(); });
335  if (itr != maEntries.end())
336  {
337  maEntries.erase(itr);
338  }
339  mpDialogParent->InvalidateRefData();
340  mpDialogParent->OnSelectionChange(0, maEntries.size(), false);
341  Thaw();
342  RecalcAll();
343 }
344 
346 {
347  Freeze();
348  size_t index = 0;
349  for (size_t i = 0; i < maEntries.size(); i++)
350  {
351  auto& widget = maEntries[i];
352  if (widget->IsSelected() && i > 0)
353  {
354  std::swap(maEntries[i], maEntries[i - 1]);
355  index = i - 1;
356  break;
357  }
358  }
359  mpDialogParent->InvalidateRefData();
360  mpDialogParent->OnSelectionChange(index, maEntries.size());
361  Thaw();
362  RecalcAll();
363 }
364 
366 {
367  Freeze();
368  size_t index = 0;
369  for (size_t i = 0; i < maEntries.size(); i++)
370  {
371  auto& widget = maEntries[i];
372  if (widget->IsSelected())
373  {
374  index = i;
375  if (i < maEntries.size()-1)
376  {
377  std::swap(maEntries[i], maEntries[i + 1]);
378  index = i + 1;
379  break;
380  }
381  }
382  }
383  mpDialogParent->InvalidateRefData();
384  mpDialogParent->OnSelectionChange(index, maEntries.size());
385  Thaw();
386  RecalcAll();
387 }
388 
389 IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry&, rEntry, void )
390 {
391  if(rEntry.IsSelected())
392  return;
393 
394  Freeze();
395  size_t index = 0;
396  for(size_t i = 0; i < maEntries.size(); i++)
397  {
398  if (maEntries[i].get() == &rEntry)
399  {
400  index = i;
401  }
402  maEntries[i]->SetInactive();
403  }
404  mpDialogParent->InvalidateRefData();
405  mpDialogParent->OnSelectionChange(index, maEntries.size());
406  rEntry.SetActive();
407  Thaw();
408  RecalcAll();
409 }
410 
412  weld::Window* pParent, ScViewData* pViewData,
413  const ScCondFormatDlgItem* pItem)
414  : ScAnyRefDlgController(pB, pCW, pParent,
415  (SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())?OUString("modules/scalc/ui/conditionalformatdialogmobile.ui"):OUString("modules/scalc/ui/conditionalformatdialog.ui"),
416  "ConditionalFormatDialog")
417  , mpViewData(pViewData)
418  , mpDlgItem(pItem->Clone())
419  , mpLastEdit(nullptr)
420  , mxBtnOk(m_xBuilder->weld_button("ok"))
421  , mxBtnAdd(m_xBuilder->weld_button("add"))
422  , mxBtnRemove(m_xBuilder->weld_button("delete"))
423  , mxBtnUp(m_xBuilder->weld_button("up"))
424  , mxBtnDown(m_xBuilder->weld_button("down"))
425  , mxBtnCancel(m_xBuilder->weld_button("cancel"))
426  , mxFtRange(m_xBuilder->weld_label("ftassign"))
427  , mxEdRange(new formula::RefEdit(m_xBuilder->weld_entry("edassign")))
428  , mxRbRange(new formula::RefButton(m_xBuilder->weld_button("rbassign")))
429  , mxCondFormList(new ScCondFormatList(this, m_xBuilder->weld_scrolled_window("listwindow"),
430  m_xBuilder->weld_container("list")))
431 {
432  mxEdRange->SetReferences(this, mxFtRange.get());
433  mxRbRange->SetReferences(this, mxEdRange.get());
434 
435  ScConditionalFormat* pFormat = nullptr;
436  mnKey = mpDlgItem->GetIndex();
437  if (mpDlgItem->IsManaged() && mpDlgItem->GetConditionalFormatList())
438  {
439  pFormat = mpDlgItem->GetConditionalFormatList()->GetFormat(mnKey);
440  }
441  else if (!mpDlgItem->IsManaged())
442  {
443  ScDocument& rDoc = mpViewData->GetDocument();
444  pFormat = rDoc.GetCondFormList(mpViewData->GetTabNo())->GetFormat ( mnKey );
445  }
446 
447  ScRangeList aRange;
448  if (pFormat)
449  {
450  aRange = pFormat->GetRange();
451  }
452  else
453  {
454  // this is for adding a new entry
455  mpViewData->GetMarkData().FillRangeListWithMarks(&aRange, false);
456  if(aRange.empty())
457  {
459  aRange.push_back(ScRange(aPos));
460  }
461  mnKey = 0;
462  }
463  maPos = aRange.GetTopLeftCorner();
464 
465  mxCondFormList->init(mpViewData->GetDocument(), pFormat, aRange, maPos, mpDlgItem->GetDialogType());
466 
467  mxBtnOk->connect_clicked(LINK(this, ScCondFormatDlg, BtnPressedHdl ) );
468  mxBtnAdd->connect_clicked( LINK( mxCondFormList.get(), ScCondFormatList, AddBtnHdl ) );
469  mxBtnRemove->connect_clicked( LINK( mxCondFormList.get(), ScCondFormatList, RemoveBtnHdl ) );
470  mxBtnUp->connect_clicked(LINK(mxCondFormList.get(), ScCondFormatList, UpBtnHdl));
471  mxBtnDown->connect_clicked(LINK(mxCondFormList.get(), ScCondFormatList, DownBtnHdl));
472  mxBtnCancel->connect_clicked( LINK(this, ScCondFormatDlg, BtnPressedHdl ) );
473  mxEdRange->SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) );
474  mxEdRange->SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
475 
476  OUString aRangeString;
477  const ScDocument& rDoc = pViewData->GetDocument();
478  aRange.Format(aRangeString, ScRefFlags::VALID, rDoc, rDoc.GetAddressConvention());
479  mxEdRange->SetText(aRangeString);
480 
481  msBaseTitle = m_xDialog->get_title();
482  updateTitle();
483 }
484 
486 {
487  OUString aTitle = msBaseTitle + " " + mxEdRange->GetText();
488 
489  m_xDialog->set_title(aTitle);
490 }
491 
493 {
494 }
495 
497 {
498  if(mpLastEdit)
500  else
501  mxEdRange->GrabFocus();
502 
503  RefInputDone();
504 }
505 
506 void ScCondFormatDlg::RefInputDone( bool bForced )
507 {
509 
510  // ScAnyRefModalDlg::RefInputDone resets the title back
511  // to its original state.
512  // I.e. if we open the dialog normally, and then click into the sheet
513  // to modify the selection, the title is updated such that the range
514  // is only a single cell (e.g. $A$1), after which the dialog switches
515  // into the RefInput mode. During the RefInput mode the title is updated
516  // as expected, however at the end RefInputDone overwrites the title
517  // with the initial (now incorrect) single cell range. Hence we correct
518  // it here.
519  updateTitle();
520 }
521 
523 {
524  return !mpLastEdit || mpLastEdit == mxEdRange.get();
525 }
526 
528 {
529  return mxEdRange->GetWidget()->get_sensitive();
530 }
531 
533 {
534  formula::RefEdit* pEdit = mpLastEdit;
535  if (!mpLastEdit)
536  pEdit = mxEdRange.get();
537 
538  if (!pEdit->GetWidget()->get_sensitive())
539  return;
540 
541  if(rRef.aStart != rRef.aEnd)
542  RefInputStart(pEdit);
543 
544  ScRefFlags nFlags;
545  if (mpLastEdit && mpLastEdit != mxEdRange.get())
546  nFlags = ScRefFlags::RANGE_ABS_3D;
547  else
548  nFlags = ScRefFlags::RANGE_ABS;
549 
550  const ScDocument& rDoc = mpViewData->GetDocument();
551  OUString aRefStr(rRef.Format(rDoc, nFlags,
553  if (pEdit != mxEdRange.get())
554  {
555  Selection sel = pEdit->GetSelection();
556  sel.Justify(); // in case of RTL selection
557  sel.Max() = sel.Min() + aRefStr.getLength();
558  pEdit->GetWidget()->replace_selection(aRefStr);
559  pEdit->SetSelection(sel); // to replace it again with next drag event
560  }
561  else
562  pEdit->SetRefString( aRefStr );
563  updateTitle();
564 }
565 
566 std::unique_ptr<ScConditionalFormat> ScCondFormatDlg::GetConditionalFormat() const
567 {
568  OUString aRangeStr = mxEdRange->GetText();
569  if(aRangeStr.isEmpty())
570  return nullptr;
571 
572  ScRangeList aRange;
573  ScRefFlags nFlags = aRange.Parse(aRangeStr, mpViewData->GetDocument(),
575  mxCondFormList->SetRange(aRange);
576  std::unique_ptr<ScConditionalFormat> pFormat = mxCondFormList->GetConditionalFormat();
577 
578  if((nFlags & ScRefFlags::VALID) && !aRange.empty() && pFormat)
579  pFormat->SetRange(aRange);
580  else
581  pFormat.reset();
582 
583  return pFormat;
584 }
585 
587 {
588  mpLastEdit = nullptr;
589 }
590 
591 // Close the Conditional Format Dialog
592 //
594 {
595  DoClose( ScCondFormatDlgWrapper::GetChildWindowId() );
596 }
597 
598 // Occurs when the Conditional Format Dialog the OK button is pressed.
599 //
601 {
602  std::unique_ptr<ScConditionalFormat> pFormat = GetConditionalFormat();
603 
604  if (!mpDlgItem->IsManaged())
605  {
606  if(pFormat)
607  {
608  auto& rRangeList = pFormat->GetRange();
610  std::move(pFormat), maPos.Tab(), rRangeList);
611  }
612  else
614  nullptr, maPos.Tab(), ScRangeList());
615  }
616  else
617  {
618  ScConditionalFormatList* pList = mpDlgItem->GetConditionalFormatList();
619  sal_uInt32 nKey = mnKey;
620  if (mnKey == 0)
621  {
622  nKey = pList->getMaxKey() + 1;
623  }
624 
625  pList->erase(nKey);
626  if (pFormat)
627  {
628  pFormat->SetKey(nKey);
629  pList->InsertNew(std::move(pFormat));
630  }
632 
633  SetDispatcherLock( false );
634  // Queue message to open Conditional Format Manager Dialog
635  GetBindings().GetDispatcher()->Execute( SID_OPENDLG_CONDFRMT_MANAGER,
636  SfxCallMode::ASYNCHRON );
637  }
638  m_xDialog->response(RET_OK);
639 }
640 
641 // Occurs when the Conditional Format Dialog is cancelled.
642 //
644 {
645  if ( mpDlgItem->IsManaged() )
646  {
648  SetDispatcherLock( false );
649  // Queue message to open Conditional Format Manager Dialog
650  GetBindings().GetDispatcher()->Execute( SID_OPENDLG_CONDFRMT_MANAGER,
651  SfxCallMode::ASYNCHRON );
652  }
653  m_xDialog->response(RET_CANCEL);
654 }
655 
656 void ScCondFormatDlg::OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected)
657 {
658  if (nSize <= 1 || !bSelected)
659  {
660  mxBtnUp->set_sensitive(false);
661  mxBtnDown->set_sensitive(false);
662  }
663  else
664  {
665  mxBtnUp->set_sensitive(nIndex != 0);
666  mxBtnDown->set_sensitive(nIndex < nSize - 1);
667  }
668 }
669 
670 IMPL_LINK(ScCondFormatDlg, EdRangeModifyHdl, formula::RefEdit&, rEdit, void)
671 {
672  OUString aRangeStr = rEdit.GetText();
673  ScRangeList aRange;
674  ScRefFlags nFlags = aRange.Parse(aRangeStr, mpViewData->GetDocument(),
675  mpViewData->GetDocument().GetAddressConvention());
676  if(nFlags & ScRefFlags::VALID)
677  {
679  mxBtnOk->set_sensitive(true);
680  }
681  else
682  {
684  mxBtnOk->set_sensitive(false);
685  }
686 
687  updateTitle();
688 }
689 
690 IMPL_LINK(ScCondFormatDlg, RangeGetFocusHdl, formula::RefEdit&, rControl, void)
691 {
692  mpLastEdit = &rControl;
693 }
694 
695 IMPL_LINK( ScCondFormatDlg, BtnPressedHdl, weld::Button&, rBtn, void)
696 {
697  if (&rBtn == mxBtnOk.get())
698  OkPressed();
699  else if (&rBtn == mxBtnCancel.get())
700  CancelPressed();
701 }
702 
703 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long Max() const
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3046
std::unique_ptr< weld::Button > mxBtnDown
ScRangeList maRanges
size_t size() const
Definition: colorscale.cxx:696
IMPL_LINK_NOARG(ScCondFormatList, AddBtnHdl, weld::Button &, void)
sal_Int32 nIndex
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScAddress aStart
Definition: address.hxx:500
virtual ~ScCondFormatDlg() override
void InsertNew(std::unique_ptr< ScConditionalFormat > pNew)
Definition: conditio.cxx:2064
virtual void Close() override
SCROW GetCurY() const
Definition: viewdata.hxx:402
void OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected=true)
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
Definition: markdata.cxx:387
void SetDispatcherLock(bool bLock)
Definition: anyrefdg.cxx:700
std::unique_ptr< formula::RefEdit > mxEdRange
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScAddress aEnd
Definition: address.hxx:501
virtual bool IsTableLocked() const override
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
std::unique_ptr< weld::ScrolledWindow > mxScrollWindow
EntryContainer maEntries
virtual void SetReference(const ScRange &, ScDocument &) override
virtual void SetActive() override
void SetRange(const ScRangeList &rRange)
void SetSelection(const Selection &rSelection)
std::unique_ptr< ScConditionalFormat > GetConditionalFormat() const
virtual int get_active() const =0
ScConditionMode GetOperation() const
Definition: conditio.hxx:370
RET_CANCEL
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:489
const ScRangeList & GetRange() const
Definition: conditio.hxx:560
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
Definition: documen4.cxx:857
std::unique_ptr< weld::Button > mxBtnOk
virtual void replace_selection(const OUString &rText)=0
sal_uInt32 getMaxKey() const
Definition: conditio.cxx:2291
std::unique_ptr< ScConditionalFormat > GetConditionalFormat() const
virtual void RefInputDone(bool bForced=false) override
Selection GetSelection() const
int nCount
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1144
SCTAB Tab() const
Definition: address.hxx:271
size_t size() const
Definition: conditio.cxx:1767
SfxItemPool & GetPool() const
ScAddress GetTopLeftCorner() const
Definition: rangelst.cxx:1157
bool empty() const
Definition: rangelst.hxx:89
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
const ScFormatEntry * GetEntry(sal_uInt16 nPos) const
Definition: conditio.cxx:1781
void SetRefString(const OUString &rStr)
std::unique_ptr< weld::Button > mxBtnRemove
void Justify()
int i
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
SC_DLLPUBLIC OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
Definition: address.cxx:2203
ScRefFlags Parse(const OUString &, const ScDocument &, formula::FormulaGrammar::AddressConvention eConv=formula::FormulaGrammar::CONV_OOO, SCTAB nDefaultTab=0, sal_Unicode cDelimiter=0)
Definition: rangelst.cxx:106
ScCondFormatDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pWindow, ScViewData *pViewData, const ScCondFormatDlgItem *pDlgItem)
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:755
std::unique_ptr< weld::Container > mxGrid
std::unique_ptr< weld::Button > mxBtnUp
tuple index
weld::Entry * GetWidget() const
void ReplaceConditionalFormat(sal_uLong nOldIndex, std::unique_ptr< ScConditionalFormat > pFormat, SCTAB nTab, const ScRangeList &rRanges)
Definition: docfunc.cxx:5603
std::unique_ptr< weld::Button > mxBtnCancel
formula::RefEdit * mpLastEdit
ScViewData * mpViewData
IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, weld::ComboBox &, rBox, void)
virtual bool get_sensitive() const =0
std::unique_ptr< ScCondFormatList > mxCondFormList
std::unique_ptr< formula::RefButton > mxRbRange
virtual void set_message_type(EntryMessageType eType)=0
OUString msBaseTitle
weld::Entry & rEdit
SfxBindings & GetBindings() const
std::unique_ptr< weld::Label > mxFtRange
std::unique_ptr< weld::Button > mxBtnAdd
tools::Long Min() const
weld::Window * GetFrameWeld()
RET_OK
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
Reference< XExecutableDialog > m_xDialog
void * p
virtual bool IsRefInputMode() const override
ScDocument * mpDoc
SfxDispatcher * GetDispatcher() const
virtual Type GetType() const =0
void erase(sal_uLong nIndex)
Definition: conditio.cxx:2263
std::shared_ptr< ScCondFormatDlgItem > mpDlgItem
ScDocFunc & GetDocFunc()
Definition: docsh.hxx:218
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
ScRefFlags
Definition: address.hxx:145
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:694
ScCondFormatList(ScCondFormatDlg *pParent, std::unique_ptr< weld::ScrolledWindow > xWindow, std::unique_ptr< weld::Container > xGrid)
ScCondFormatDlg * mpDialogParent
sal_uInt16 nPos
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
Definition: anyrefdg.cxx:725
SCCOL GetCurX() const
Definition: viewdata.hxx:401
void init(ScDocument &rDoc, const ScConditionalFormat *pFormat, const ScRangeList &rRanges, const ScAddress &rPos, condformat::dialog::ScCondFormatDialogType eType)