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