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