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