LibreOffice Module sc (master)  1
conflictsdlg.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 <comphelper/string.hxx>
21 #include <osl/diagnose.h>
22 
23 #include <conflictsdlg.hxx>
24 #include <o3tl/safeint.hxx>
25 #include <strings.hrc>
26 #include <scresid.hxx>
27 #include <viewdata.hxx>
28 #include <dbfunc.hxx>
29 #include <chgtrack.hxx>
30 
31 // struct ScConflictsListEntry
32 
34 {
35  auto aEnd = maSharedActions.cend();
36  auto aItr = std::find(maSharedActions.cbegin(), aEnd, nSharedAction);
37 
38  return aItr != aEnd;
39 }
40 
42 {
43  auto aEnd = maOwnActions.cend();
44  auto aItr = std::find(maOwnActions.cbegin(), aEnd, nOwnAction);
45 
46  return aItr != aEnd;
47 }
48 
49 
51 {
52  return std::any_of(rConflictsList.begin(), rConflictsList.end(),
53  [nOwnAction](ScConflictsListEntry& rConflict) { return rConflict.HasOwnAction( nOwnAction ); });
54 }
55 
57 {
58  auto aEnd = rConflictsList.end();
59  auto aItr = std::find_if(rConflictsList.begin(), aEnd,
60  [nSharedAction](ScConflictsListEntry& rConflict) { return rConflict.HasSharedAction( nSharedAction ); });
61 
62  if (aItr != aEnd)
63  return &(*aItr);
64 
65  return nullptr;
66 }
67 
69 {
70  auto aEnd = rConflictsList.end();
71  auto aItr = std::find_if(rConflictsList.begin(), aEnd,
72  [nOwnAction](ScConflictsListEntry& rConflict) { return rConflict.HasOwnAction( nOwnAction ); });
73 
74  if (aItr != aEnd)
75  return &(*aItr);
76 
77  return nullptr;
78 }
79 
80 void ScConflictsListHelper::Transform_Impl( std::vector<sal_uLong>& rActionList, ScChangeActionMergeMap* pMergeMap )
81 {
82  if ( !pMergeMap )
83  {
84  return;
85  }
86 
87  for ( auto aItr = rActionList.begin(); aItr != rActionList.end(); )
88  {
89  ScChangeActionMergeMap::iterator aItrMap = pMergeMap->find( *aItr );
90  if ( aItrMap != pMergeMap->end() )
91  {
92  *aItr = aItrMap->second;
93  ++aItr;
94  }
95  else
96  {
97  aItr = rActionList.erase( aItr );
98  OSL_FAIL( "ScConflictsListHelper::Transform_Impl: erased action from conflicts list!" );
99  }
100  }
101 }
102 
104  ScChangeActionMergeMap* pSharedMap, ScChangeActionMergeMap* pOwnMap )
105 {
106  for ( auto& rConflictEntry : rConflictsList )
107  {
108  if ( pSharedMap )
109  {
110  ScConflictsListHelper::Transform_Impl( rConflictEntry.maSharedActions, pSharedMap );
111  }
112 
113  if ( pOwnMap )
114  {
115  ScConflictsListHelper::Transform_Impl( rConflictEntry.maOwnActions, pOwnMap );
116  }
117  }
118 }
119 
120 
122  sal_uLong nStartOwn, sal_uLong nEndOwn, ScConflictsList& rConflictsList )
123  :mpTrack( pTrack )
124  ,mnStartShared( nStartShared )
125  ,mnEndShared( nEndShared )
126  ,mnStartOwn( nStartOwn )
127  ,mnEndOwn( nEndOwn )
128  ,mrConflictsList( rConflictsList )
129 {
130 }
131 
133 {
134 }
135 
137 {
138  return pAction1 && pAction2 && pAction1->GetBigRange().Intersects( pAction2->GetBigRange() );
139 }
140 
142 {
143  auto doActionsIntersect = [this, pAction](const sal_uLong& aAction) { return DoActionsIntersect( mpTrack->GetAction( aAction ), pAction ); };
144 
145  for ( auto& rConflict : mrConflictsList )
146  {
147  if (std::any_of( rConflict.maSharedActions.cbegin(), rConflict.maSharedActions.cend(), doActionsIntersect ))
148  return &rConflict;
149 
150  if (std::any_of( rConflict.maOwnActions.cbegin(), rConflict.maOwnActions.cend(), doActionsIntersect ))
151  return &rConflict;
152  }
153 
154  return nullptr;
155 }
156 
157 ScConflictsListEntry& ScConflictsFinder::GetEntry( sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions )
158 {
159  // try to get a list entry which already contains the shared action
161  if ( pEntry )
162  {
163  return *pEntry;
164  }
165 
166  // try to get a list entry for which the shared action intersects with any
167  // other action of this entry
168  pEntry = GetIntersectingEntry( mpTrack->GetAction( nSharedAction ) );
169  if ( pEntry )
170  {
171  pEntry->maSharedActions.push_back( nSharedAction );
172  return *pEntry;
173  }
174 
175  // try to get a list entry for which any of the own actions intersects with
176  // any other action of this entry
177  for ( auto& rOwnAction : rOwnActions )
178  {
179  pEntry = GetIntersectingEntry( mpTrack->GetAction( rOwnAction ) );
180  if ( pEntry )
181  {
182  pEntry->maSharedActions.push_back( nSharedAction );
183  return *pEntry;
184  }
185  }
186 
187  // if no entry was found, create a new one
188  ScConflictsListEntry aEntry;
190  aEntry.maSharedActions.push_back( nSharedAction );
191  mrConflictsList.push_back( aEntry );
192  return mrConflictsList.back();
193 }
194 
196 {
197  if ( !mpTrack )
198  {
199  return false;
200  }
201 
202  bool bReturn = false;
203  ScChangeAction* pSharedAction = mpTrack->GetAction( mnStartShared );
204  while ( pSharedAction && pSharedAction->GetActionNumber() <= mnEndShared )
205  {
206  std::vector<sal_uLong> aOwnActions;
207  ScChangeAction* pOwnAction = mpTrack->GetAction( mnStartOwn );
208  while ( pOwnAction && pOwnAction->GetActionNumber() <= mnEndOwn )
209  {
210  if ( DoActionsIntersect( pSharedAction, pOwnAction ) )
211  {
212  aOwnActions.push_back( pOwnAction->GetActionNumber() );
213  }
214  pOwnAction = pOwnAction->GetNext();
215  }
216 
217  if ( !aOwnActions.empty() )
218  {
219  ScConflictsListEntry& rEntry = GetEntry(pSharedAction->GetActionNumber(), aOwnActions);
220  for ( const auto& aOwnAction : aOwnActions )
221  {
223  {
224  rEntry.maOwnActions.push_back(aOwnAction);
225  }
226  }
227  bReturn = true;
228  }
229 
230  pSharedAction = pSharedAction->GetNext();
231  }
232 
233  return bReturn;
234 }
235 
236 
238  :mpTrack ( pTrack )
239  ,mrConflictsList ( rConflictsList )
240 {
241  OSL_ENSURE( mpTrack, "ScConflictsResolver CTOR: mpTrack is null!" );
242 }
243 
245 {
246 }
247 
248 void ScConflictsResolver::HandleAction( ScChangeAction* pAction, bool bIsSharedAction,
249  bool bHandleContentAction, bool bHandleNonContentAction )
250 {
251  if ( !mpTrack || !pAction )
252  {
253  return;
254  }
255 
256  if ( bIsSharedAction )
257  {
259  mrConflictsList, pAction->GetActionNumber() );
260  if ( pConflictEntry )
261  {
262  ScConflictAction eConflictAction = pConflictEntry->meConflictAction;
263  if ( eConflictAction == SC_CONFLICT_ACTION_KEEP_MINE )
264  {
265  if ( pAction->GetType() == SC_CAT_CONTENT )
266  {
267  if ( bHandleContentAction )
268  {
269  mpTrack->Reject( pAction );
270  }
271  }
272  else
273  {
274  if ( bHandleNonContentAction )
275  {
276  mpTrack->Reject( pAction );
277  }
278  }
279  }
280  }
281  }
282  else
283  {
285  mrConflictsList, pAction->GetActionNumber() );
286  if ( pConflictEntry )
287  {
288  ScConflictAction eConflictAction = pConflictEntry->meConflictAction;
289  if ( eConflictAction == SC_CONFLICT_ACTION_KEEP_MINE )
290  {
291  if ( pAction->GetType() == SC_CAT_CONTENT )
292  {
293  if ( bHandleContentAction )
294  {
295  // do nothing
296  //mpTrack->SelectContent( pAction );
297  }
298  }
299  else
300  {
301  if ( bHandleNonContentAction )
302  {
303  // do nothing
304  //mpTrack->Accept( pAction );
305  }
306  }
307  }
308  else if ( eConflictAction == SC_CONFLICT_ACTION_KEEP_OTHER )
309  {
310  if ( pAction->GetType() == SC_CAT_CONTENT )
311  {
312  if ( bHandleContentAction )
313  {
314  mpTrack->Reject( pAction );
315  }
316  }
317  else
318  {
319  if ( bHandleNonContentAction )
320  {
321  mpTrack->Reject( pAction );
322  }
323  }
324  }
325  }
326  }
327 }
328 
329 
330 ScConflictsDlg::ScConflictsDlg(weld::Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList)
331  : GenericDialogController(pParent, "modules/scalc/ui/conflictsdialog.ui", "ConflictsDialog")
332  , maStrUnknownUser ( ScResId( STR_UNKNOWN_USER_CONFLICT ) )
333  , mpViewData ( pViewData )
334  , mpOwnDoc ( nullptr )
335  , mpOwnTrack ( nullptr )
336  , mpSharedDoc ( pSharedDoc )
337  , mpSharedTrack ( nullptr )
338  , mrConflictsList ( rConflictsList )
339  , maSelectionIdle ( "ScConflictsDlg maSelectionIdle" )
340  , mbInSelectHdl ( false )
341  , m_xBtnKeepMine(m_xBuilder->weld_button("keepmine"))
342  , m_xBtnKeepOther(m_xBuilder->weld_button("keepother"))
343  , m_xBtnKeepAllMine(m_xBuilder->weld_button("keepallmine"))
344  , m_xBtnKeepAllOthers(m_xBuilder->weld_button("keepallothers"))
345  , m_xLbConflicts(new SvxRedlinTable(m_xBuilder->weld_tree_view("container"), nullptr))
346 {
347  OSL_ENSURE( mpViewData, "ScConflictsDlg CTOR: mpViewData is null!" );
348  mpOwnDoc = ( mpViewData ? &mpViewData->GetDocument() : nullptr );
349  OSL_ENSURE( mpOwnDoc, "ScConflictsDlg CTOR: mpOwnDoc is null!" );
350  mpOwnTrack = ( mpOwnDoc ? mpOwnDoc->GetChangeTrack() : nullptr );
351  OSL_ENSURE( mpOwnTrack, "ScConflictsDlg CTOR: mpOwnTrack is null!" );
352  OSL_ENSURE( mpSharedDoc, "ScConflictsDlg CTOR: mpSharedDoc is null!" );
354  OSL_ENSURE( mpSharedTrack, "ScConflictsDlg CTOR: mpSharedTrack is null!" );
355 
356  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
357 
358  auto nDigitWidth = rTreeView.get_approximate_digit_width();
359  std::vector<int> aWidths
360  {
361  o3tl::narrowing<int>(nDigitWidth * 60),
362  o3tl::narrowing<int>(nDigitWidth * 20)
363  };
364  rTreeView.set_column_fixed_widths(aWidths);
365 
366  rTreeView.set_selection_mode(SelectionMode::Multiple);
367  rTreeView.set_size_request(-1, rTreeView.get_height_rows(16));
368 
369  maSelectionIdle.SetInvokeHandler( LINK( this, ScConflictsDlg, UpdateSelectionHdl ) );
370 
371  rTreeView.connect_changed(LINK(this, ScConflictsDlg, SelectHandle));
372 
373  m_xBtnKeepMine->connect_clicked( LINK( this, ScConflictsDlg, KeepMineHandle ) );
374  m_xBtnKeepOther->connect_clicked( LINK( this, ScConflictsDlg, KeepOtherHandle ) );
375  m_xBtnKeepAllMine->connect_clicked( LINK( this, ScConflictsDlg, KeepAllMineHandle ) );
376  m_xBtnKeepAllOthers->connect_clicked( LINK( this, ScConflictsDlg, KeepAllOthersHandle ) );
377 
378  UpdateView();
379 
380  std::unique_ptr<weld::TreeIter> xEntry(rTreeView.make_iterator());
381  if (rTreeView.get_iter_first(*xEntry))
382  rTreeView.select(*xEntry);
383 }
384 
386 {
387 }
388 
390 {
391  OUString aString;
392  if ( mpOwnTrack )
393  {
394  const ScChangeAction* pAction = mpOwnTrack->GetAction( rConflictEntry.maOwnActions[ 0 ] );
395  if ( pAction && mpOwnDoc )
396  {
397  SCTAB nTab = pAction->GetBigRange().MakeRange().aStart.Tab();
398  mpOwnDoc->GetName( nTab, aString );
399  }
400  }
401  return aString;
402 }
403 
405 {
406  OSL_ENSURE( pAction, "ScConflictsDlg::GetActionString(): pAction is null!" );
407  OSL_ENSURE( pDoc, "ScConflictsDlg::GetActionString(): pDoc is null!" );
408  if (!pAction || !pDoc)
409  return;
410 
411  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
412  OUString aDesc = pAction->GetDescription(*pDoc, true, false);
413  rTreeView.set_text(rEntry, aDesc, 0);
414 
415  OUString aUser = comphelper::string::strip(pAction->GetUser(), ' ');
416  if ( aUser.isEmpty() )
417  {
418  aUser = maStrUnknownUser;
419  }
420  rTreeView.set_text(rEntry, aUser, 1);
421 
422  DateTime aDateTime = pAction->GetDateTime();
423  OUString aString = ScGlobal::getLocaleData().getDate( aDateTime ) + " " +
424  ScGlobal::getLocaleData().getTime( aDateTime, false );
425  rTreeView.set_text(rEntry, aString, 2);
426 }
427 
429 {
430  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
431  std::unique_ptr<weld::TreeIter> xEntry(rTreeView.make_iterator());
432  bool bSelEntry = rTreeView.get_cursor(xEntry.get());
433  if (!bSelEntry)
434  bSelEntry = rTreeView.get_selected(xEntry.get());
435  if (!bSelEntry)
436  return;
437 
438  bool bSelectHandle = rTreeView.is_selected(*xEntry);
439 
440  while (rTreeView.get_iter_depth(*xEntry))
441  rTreeView.iter_parent(*xEntry);
442 
443  if (bSelectHandle)
444  rTreeView.unselect_all();
445  if (!rTreeView.is_selected(*xEntry))
446  rTreeView.select(*xEntry);
447  if (rTreeView.iter_children(*xEntry))
448  {
449  do
450  {
451  if (!rTreeView.is_selected(*xEntry))
452  rTreeView.select(*xEntry);
453  } while (rTreeView.iter_next_sibling(*xEntry));
454  }
455 }
456 
458 {
459  if (mbInSelectHdl)
460  return;
461 
462  mbInSelectHdl = true;
463  HandleListBoxSelection();
464  maSelectionIdle.Start();
465  mbInSelectHdl = false;
466 }
467 
468 IMPL_LINK_NOARG(ScConflictsDlg, UpdateSelectionHdl, Timer *, void)
469 {
470  if ( !mpViewData || !mpOwnDoc )
471  {
472  return;
473  }
474 
475  ScTabView* pTabView = mpViewData->GetView();
476  pTabView->DoneBlockMode();
477 
478  std::vector<const ScChangeAction*> aActions;
479 
480  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
481  rTreeView.selected_foreach([&rTreeView, &aActions](weld::TreeIter& rEntry){
482  if (rTreeView.get_iter_depth(rEntry))
483  {
484  RedlinData* pUserData = reinterpret_cast<RedlinData*>(rTreeView.get_id(rEntry).toInt64());
485  if (pUserData)
486  {
487  ScChangeAction* pAction = static_cast< ScChangeAction* >( pUserData->pData );
488  if ( pAction && ( pAction->GetType() != SC_CAT_DELETE_TABS ) &&
489  ( pAction->IsClickable() || pAction->IsVisible() ) )
490  {
491  aActions.push_back(pAction);
492  }
493  }
494  }
495  return false;
496  });
497 
498  bool bContMark = false;
499  for (size_t i = 0, nCount = aActions.size(); i < nCount; ++i)
500  {
501  const ScBigRange& rBigRange = aActions[i]->GetBigRange();
502  if (rBigRange.IsValid(*mpOwnDoc))
503  {
504  bool bSetCursor = i == nCount - 1;
505  pTabView->MarkRange(rBigRange.MakeRange(), bSetCursor, bContMark);
506  bContMark = true;
507  }
508  }
509 }
510 
511 void ScConflictsDlg::SetConflictAction(const weld::TreeIter& rRootEntry, ScConflictAction eConflictAction)
512 {
513  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
514  RedlinData* pUserData = reinterpret_cast<RedlinData*>(rTreeView.get_id(rRootEntry).toInt64());
515  ScConflictsListEntry* pConflictEntry = static_cast< ScConflictsListEntry* >( pUserData ? pUserData->pData : nullptr );
516  if ( pConflictEntry )
517  {
518  pConflictEntry->meConflictAction = eConflictAction;
519  }
520 }
521 
523 {
524  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
525  std::unique_ptr<weld::TreeIter> xEntry(rTreeView.make_iterator());
526  if (!rTreeView.get_selected(xEntry.get()))
527  return;
528 
529  while (rTreeView.get_iter_depth(*xEntry))
530  rTreeView.iter_parent(*xEntry);
531 
532  m_xDialog->set_busy_cursor(true);
534  SetConflictAction(*xEntry, eConflictAction);
535  rTreeView.remove(*xEntry);
536  m_xDialog->set_busy_cursor(false);
537  if (rTreeView.n_children() == 0)
538  m_xDialog->response(RET_OK);
539 }
540 
542 {
543  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
544  std::unique_ptr<weld::TreeIter> xEntry(rTreeView.make_iterator());
545  if (!rTreeView.get_iter_first(*xEntry))
546  return;
547 
548  while (rTreeView.get_iter_depth(*xEntry))
549  rTreeView.iter_parent(*xEntry);
550 
551  m_xDialog->set_busy_cursor(true);
552 
554  do
555  {
556  SetConflictAction(*xEntry, eConflictAction);
557  } while (rTreeView.iter_next_sibling(*xEntry));
558 
559  rTreeView.freeze();
560  rTreeView.clear();
561  rTreeView.thaw();
562 
563  m_xDialog->set_busy_cursor(false);
564 
565  m_xDialog->response(RET_OK);
566 }
567 
569 {
570  KeepHandler( true );
571 }
572 
573 IMPL_LINK_NOARG(ScConflictsDlg, KeepOtherHandle, weld::Button&, void)
574 {
575  KeepHandler( false );
576 }
577 
578 IMPL_LINK_NOARG(ScConflictsDlg, KeepAllMineHandle, weld::Button&, void)
579 {
580  KeepAllHandler( true );
581 }
582 
583 IMPL_LINK_NOARG(ScConflictsDlg, KeepAllOthersHandle, weld::Button&, void)
584 {
585  KeepAllHandler( false );
586 }
587 
589 {
590  weld::TreeView& rTreeView = m_xLbConflicts->GetWidget();
591  for ( ScConflictsListEntry& rConflictEntry : mrConflictsList )
592  {
593  if (rConflictEntry.meConflictAction == SC_CONFLICT_ACTION_NONE)
594  {
595  std::unique_ptr<RedlinData> pRootUserData(new RedlinData());
596  pRootUserData->pData = static_cast<void*>(&rConflictEntry);
597  OUString sString(GetConflictString(rConflictEntry));
598  OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pRootUserData.release())));
599  std::unique_ptr<weld::TreeIter> xRootEntry(rTreeView.make_iterator());
600  std::unique_ptr<weld::TreeIter> xEntry(rTreeView.make_iterator());
601  rTreeView.insert(nullptr, -1, &sString, &sId, nullptr, nullptr, false, xRootEntry.get());
602 
603  for ( const auto& aSharedAction : rConflictEntry.maSharedActions )
604  {
605  ScChangeAction* pAction = mpSharedTrack ? mpSharedTrack->GetAction(aSharedAction) : nullptr;
606  if ( pAction )
607  {
608  // only display shared top content entries
609  if ( pAction->GetType() == SC_CAT_CONTENT )
610  {
611  ScChangeActionContent* pNextContent = dynamic_cast<ScChangeActionContent&>(*pAction).GetNextContent();
612  if ( pNextContent && rConflictEntry.HasSharedAction( pNextContent->GetActionNumber() ) )
613  {
614  continue;
615  }
616  }
617 
618  rTreeView.insert(xRootEntry.get(), -1, nullptr, nullptr, nullptr, nullptr, false, xEntry.get());
619  SetActionString(pAction, mpSharedDoc, *xEntry);
620  }
621  }
622 
623  for ( const auto& aOwnAction : rConflictEntry.maOwnActions )
624  {
625  ScChangeAction* pAction = mpOwnTrack ? mpOwnTrack->GetAction(aOwnAction) : nullptr;
626  if ( pAction )
627  {
628  // only display own top content entries
629  if ( pAction->GetType() == SC_CAT_CONTENT )
630  {
631  ScChangeActionContent* pNextContent = dynamic_cast<ScChangeActionContent&>(*pAction).GetNextContent();
632  if ( pNextContent && rConflictEntry.HasOwnAction( pNextContent->GetActionNumber() ) )
633  {
634  continue;
635  }
636  }
637 
638  std::unique_ptr<RedlinData> pUserData(new RedlinData());
639  pUserData->pData = static_cast< void* >( pAction );
640  OUString aId(OUString::number(reinterpret_cast<sal_Int64>(pUserData.release())));
641  rTreeView.insert(xRootEntry.get(), -1, nullptr, &aId, nullptr, nullptr, false, xEntry.get());
642  SetActionString(pAction, mpOwnDoc, *xEntry);
643  }
644  }
645 
646  rTreeView.expand_row(*xRootEntry);
647  }
648  }
649 }
650 
651 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void set_text(int row, const OUString &rText, int col=-1)=0
std::shared_ptr< weld::Dialog > m_xDialog
virtual ~ScConflictsDlg() override
OUString maStrUnknownUser
ScAddress aStart
Definition: address.hxx:499
ScChangeActionType GetType() const
Definition: chgtrack.hxx:317
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:89
ScChangeActionContent * GetNextContent() const
Definition: chgtrack.hxx:699
std::unordered_map< sal_uLong, sal_uLong > ScChangeActionMergeMap
Definition: docsh.hxx:65
virtual bool iter_parent(TreeIter &rIter) const =0
ScChangeAction * GetNext() const
Definition: chgtrack.hxx:322
void unselect_all()
virtual void insert(const TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, TreeIter *pRet)=0
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1687
SC_DLLPUBLIC ScChangeAction * GetAction(sal_uLong nAction) const
Definition: chgtrack.cxx:2116
OString strip(std::string_view rIn, char c)
ScChangeTrack * mpSharedTrack
void * pData
sal_uIntPtr sal_uLong
IMPL_LINK_NOARG(ScConflictsDlg, SelectHandle, weld::TreeView &, void)
virtual void clear()=0
sal_uLong mnEndShared
ScDocument & GetDocument() const
Definition: viewdata.hxx:379
::std::vector< ScConflictsListEntry > ScConflictsList
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const
Definition: chgtrack.cxx:420
virtual bool is_selected(int pos) const =0
std::unique_ptr< weld::Button > m_xBtnKeepAllOthers
sal_uLong mnStartOwn
void HandleListBoxSelection()
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const =0
sal_uLong mnStartShared
virtual void thaw()=0
ScDocument *const mpSharedDoc
void connect_changed(const Link< TreeView &, void > &rLink)
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
Definition: global.cxx:1004
ScChangeTrack * mpTrack
void HandleAction(ScChangeAction *pAction, bool bIsSharedAction, bool bHandleContentAction, bool bHandleNonContentAction)
int nCount
virtual int n_children() const =0
virtual void set_column_fixed_widths(const std::vector< int > &rWidths)=0
virtual void selected_foreach(const std::function< bool(TreeIter &)> &func)=0
void SetActionString(const ScChangeAction *pAction, ScDocument *pDoc, const weld::TreeIter &rEntry)
std::unique_ptr< weld::Button > m_xBtnKeepAllMine
virtual OUString get_id(int pos) const =0
SCTAB Tab() const
Definition: address.hxx:270
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:409
std::unique_ptr< weld::Button > m_xBtnKeepMine
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2405
bool Intersects(const ScBigRange &) const
do two ranges overlap?
Definition: bigrange.hxx:169
static void TransformConflictsList(ScConflictsList &rConflictsList, ScChangeActionMergeMap *pSharedMap, ScChangeActionMergeMap *pOwnMap)
ScConflictAction
ScConflictsList & mrConflictsList
int i
ScConflictAction meConflictAction
virtual void freeze()=0
OUString aId
bool IsValid(const ScDocument &rDoc) const
Definition: bigrange.hxx:134
static ScConflictsListEntry * GetOwnActionEntry(ScConflictsList &rConflictsList, sal_uLong nOwnAction)
bool HasOwnAction(sal_uLong nOwnAction) const
static bool DoActionsIntersect(const ScChangeAction *pAction1, const ScChangeAction *pAction2)
ScBigRange & GetBigRange()
Definition: chgtrack.hxx:231
static void Transform_Impl(std::vector< sal_uLong > &rActionList, ScChangeActionMergeMap *pMergeMap)
static bool HasOwnAction(ScConflictsList &rConflictsList, sal_uLong nOwnAction)
ScConflictsList & mrConflictsList
virtual void expand_row(const TreeIter &rIter)=0
bool HasSharedAction(sal_uLong nSharedAction) const
virtual bool get_cursor(TreeIter *pIter) const =0
virtual bool iter_children(TreeIter &rIter) const =0
sal_uLong GetActionNumber() const
Definition: chgtrack.hxx:319
virtual void remove(int pos)=0
OUString getDate(const Date &rDate) const
ScRange MakeRange() const
Definition: bigrange.hxx:136
std::unique_ptr< SvxRedlinTable > m_xLbConflicts
virtual void select(int pos)=0
ScChangeTrack * mpOwnTrack
virtual bool get_selected(TreeIter *pIter) const =0
bool Reject(ScChangeAction *, ScChangeActionMap *, bool bRecursion)
Definition: chgtrack.cxx:4125
ScConflictsResolver(ScChangeTrack *pTrack, ScConflictsList &rConflictsList)
bool IsVisible() const
Definition: chgtrack.cxx:142
RET_OK
ScViewData *const mpViewData
std::unique_ptr< weld::Button > m_xBtnKeepOther
virtual bool get_iter_first(TreeIter &rIter) const =0
virtual int get_height_rows(int nRows) const =0
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void set_selection_mode(SelectionMode eMode)=0
static ScConflictsListEntry * GetSharedActionEntry(ScConflictsList &rConflictsList, sal_uLong nSharedAction)
ScConflictsFinder(ScChangeTrack *pTrack, sal_uLong nStartShared, sal_uLong nEndShared, sal_uLong nStartOwn, sal_uLong nEndOwn, ScConflictsList &rConflictsList)
ScChangeTrack * mpTrack
const OUString & GetUser() const
Definition: chgtrack.hxx:349
ScConflictsList & mrConflictsList
void KeepAllHandler(bool bMine)
virtual bool iter_next_sibling(TreeIter &rIter) const =0
std::vector< sal_uLong > maOwnActions
ScConflictsListEntry * GetIntersectingEntry(const ScChangeAction *pAction) const
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
std::vector< sal_uLong > maSharedActions
ScConflictsDlg(weld::Window *pParent, ScViewData *pViewData, ScDocument *pSharedDoc, ScConflictsList &rConflictsList)
void SetConflictAction(const weld::TreeIter &rRootEntry, ScConflictAction eConflictAction)
virtual void set_size_request(int nWidth, int nHeight)=0
bool IsClickable() const
Definition: chgtrack.cxx:165
ScConflictsListEntry & GetEntry(sal_uLong nSharedAction, const std::vector< sal_uLong > &rOwnActions)
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:213
SC_DLLPUBLIC DateTime GetDateTime() const
Definition: chgtrack.cxx:406
virtual float get_approximate_digit_width() const =0
ScDocument * mpOwnDoc
sal_Int16 SCTAB
Definition: types.hxx:22
virtual int get_iter_depth(const TreeIter &rIter) const =0
OUString GetConflictString(const ScConflictsListEntry &rConflictEntry)
void KeepHandler(bool bMine)
OUString sId