1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <comphelper/string.hxx>
21 #include <vcl/msgbox.hxx>
23 #include "conflictsdlg.hxx"
24 #include "conflictsdlg.hrc"
25 #include "scresid.hxx"
26 #include "viewdata.hxx"
30 //=============================================================================
31 // struct ScConflictsListEntry
32 //=============================================================================
34 bool ScConflictsListEntry::HasSharedAction( sal_uLong nSharedAction
) const
36 ScChangeActionList::const_iterator aEnd
= maSharedActions
.end();
37 for ( ScChangeActionList::const_iterator aItr
= maSharedActions
.begin(); aItr
!= aEnd
; ++aItr
)
39 if ( *aItr
== nSharedAction
)
48 bool ScConflictsListEntry::HasOwnAction( sal_uLong nOwnAction
) const
50 ScChangeActionList::const_iterator aEnd
= maOwnActions
.end();
51 for ( ScChangeActionList::const_iterator aItr
= maOwnActions
.begin(); aItr
!= aEnd
; ++aItr
)
53 if ( *aItr
== nOwnAction
)
63 //=============================================================================
64 // class ScConflictsListHelper
65 //=============================================================================
67 bool ScConflictsListHelper::HasOwnAction( ScConflictsList
& rConflictsList
, sal_uLong nOwnAction
)
69 ScConflictsList::const_iterator aEnd
= rConflictsList
.end();
70 for ( ScConflictsList::const_iterator aItr
= rConflictsList
.begin(); aItr
!= aEnd
; ++aItr
)
72 if ( aItr
->HasOwnAction( nOwnAction
) )
81 ScConflictsListEntry
* ScConflictsListHelper::GetSharedActionEntry( ScConflictsList
& rConflictsList
, sal_uLong nSharedAction
)
83 ScConflictsList::iterator aEnd
= rConflictsList
.end();
84 for ( ScConflictsList::iterator aItr
= rConflictsList
.begin(); aItr
!= aEnd
; ++aItr
)
86 if ( aItr
->HasSharedAction( nSharedAction
) )
95 ScConflictsListEntry
* ScConflictsListHelper::GetOwnActionEntry( ScConflictsList
& rConflictsList
, sal_uLong nOwnAction
)
97 ScConflictsList::iterator aEnd
= rConflictsList
.end();
98 for ( ScConflictsList::iterator aItr
= rConflictsList
.begin(); aItr
!= aEnd
; ++aItr
)
100 if ( aItr
->HasOwnAction( nOwnAction
) )
109 void ScConflictsListHelper::Transform_Impl( ScChangeActionList
& rActionList
, ScChangeActionMergeMap
* pMergeMap
)
116 for ( ScChangeActionList::iterator aItr
= rActionList
.begin(); aItr
!= rActionList
.end(); )
118 ScChangeActionMergeMap::iterator aItrMap
= pMergeMap
->find( *aItr
);
119 if ( aItrMap
!= pMergeMap
->end() )
121 *aItr
= aItrMap
->second
;
126 aItr
= rActionList
.erase( aItr
);
127 OSL_FAIL( "ScConflictsListHelper::Transform_Impl: erased action from conflicts list!" );
132 void ScConflictsListHelper::TransformConflictsList( ScConflictsList
& rConflictsList
,
133 ScChangeActionMergeMap
* pSharedMap
, ScChangeActionMergeMap
* pOwnMap
)
135 ScConflictsList::iterator aEnd
= rConflictsList
.end();
136 for ( ScConflictsList::iterator aItr
= rConflictsList
.begin(); aItr
!= aEnd
; ++aItr
)
140 ScConflictsListHelper::Transform_Impl( aItr
->maSharedActions
, pSharedMap
);
145 ScConflictsListHelper::Transform_Impl( aItr
->maOwnActions
, pOwnMap
);
151 //=============================================================================
152 // class ScConflictsFinder
153 //=============================================================================
155 ScConflictsFinder::ScConflictsFinder( ScChangeTrack
* pTrack
, sal_uLong nStartShared
, sal_uLong nEndShared
,
156 sal_uLong nStartOwn
, sal_uLong nEndOwn
, ScConflictsList
& rConflictsList
)
158 ,mnStartShared( nStartShared
)
159 ,mnEndShared( nEndShared
)
160 ,mnStartOwn( nStartOwn
)
162 ,mrConflictsList( rConflictsList
)
166 ScConflictsFinder::~ScConflictsFinder()
170 bool ScConflictsFinder::DoActionsIntersect( const ScChangeAction
* pAction1
, const ScChangeAction
* pAction2
)
172 if ( pAction1
&& pAction2
&& pAction1
->GetBigRange().Intersects( pAction2
->GetBigRange() ) )
179 ScConflictsListEntry
* ScConflictsFinder::GetIntersectingEntry( const ScChangeAction
* pAction
) const
181 ScConflictsList::iterator aEnd
= mrConflictsList
.end();
182 for ( ScConflictsList::iterator aItr
= mrConflictsList
.begin(); aItr
!= aEnd
; ++aItr
)
184 ScChangeActionList::const_iterator aEndShared
= aItr
->maSharedActions
.end();
185 for ( ScChangeActionList::const_iterator aItrShared
= aItr
->maSharedActions
.begin(); aItrShared
!= aEndShared
; ++aItrShared
)
187 if ( DoActionsIntersect( mpTrack
->GetAction( *aItrShared
), pAction
) )
193 ScChangeActionList::const_iterator aEndOwn
= aItr
->maOwnActions
.end();
194 for ( ScChangeActionList::const_iterator aItrOwn
= aItr
->maOwnActions
.begin(); aItrOwn
!= aEndOwn
; ++aItrOwn
)
196 if ( DoActionsIntersect( mpTrack
->GetAction( *aItrOwn
), pAction
) )
206 ScConflictsListEntry
* ScConflictsFinder::GetEntry( sal_uLong nSharedAction
, const ScChangeActionList
& rOwnActions
)
208 // try to get a list entry which already contains the shared action
209 ScConflictsListEntry
* pEntry
= ScConflictsListHelper::GetSharedActionEntry( mrConflictsList
, nSharedAction
);
215 // try to get a list entry for which the shared action intersects with any
216 // other action of this entry
217 pEntry
= GetIntersectingEntry( mpTrack
->GetAction( nSharedAction
) );
220 pEntry
->maSharedActions
.push_back( nSharedAction
);
224 // try to get a list entry for which any of the own actions intersects with
225 // any other action of this entry
226 ScChangeActionList::const_iterator aEnd
= rOwnActions
.end();
227 for ( ScChangeActionList::const_iterator aItr
= rOwnActions
.begin(); aItr
!= aEnd
; ++aItr
)
229 pEntry
= GetIntersectingEntry( mpTrack
->GetAction( *aItr
) );
232 pEntry
->maSharedActions
.push_back( nSharedAction
);
237 // if no entry was found, create a new one
238 ScConflictsListEntry aEntry
;
239 aEntry
.meConflictAction
= SC_CONFLICT_ACTION_NONE
;
240 aEntry
.maSharedActions
.push_back( nSharedAction
);
241 mrConflictsList
.push_back( aEntry
);
242 return &(mrConflictsList
.back());
245 bool ScConflictsFinder::Find()
252 bool bReturn
= false;
253 ScChangeAction
* pSharedAction
= mpTrack
->GetAction( mnStartShared
);
254 while ( pSharedAction
&& pSharedAction
->GetActionNumber() <= mnEndShared
)
256 ScChangeActionList aOwnActions
;
257 ScChangeAction
* pOwnAction
= mpTrack
->GetAction( mnStartOwn
);
258 while ( pOwnAction
&& pOwnAction
->GetActionNumber() <= mnEndOwn
)
260 if ( DoActionsIntersect( pSharedAction
, pOwnAction
) )
262 aOwnActions
.push_back( pOwnAction
->GetActionNumber() );
264 pOwnAction
= pOwnAction
->GetNext();
267 if ( aOwnActions
.size() )
269 ScConflictsListEntry
* pEntry
= GetEntry( pSharedAction
->GetActionNumber(), aOwnActions
);
270 ScChangeActionList::iterator aEnd
= aOwnActions
.end();
271 for ( ScChangeActionList::iterator aItr
= aOwnActions
.begin(); aItr
!= aEnd
; ++aItr
)
273 if ( pEntry
&& !ScConflictsListHelper::HasOwnAction( mrConflictsList
, *aItr
) )
275 pEntry
->maOwnActions
.push_back( *aItr
);
281 pSharedAction
= pSharedAction
->GetNext();
287 //=============================================================================
288 // class ScConflictsResolver
289 //=============================================================================
291 ScConflictsResolver::ScConflictsResolver( ScChangeTrack
* pTrack
, ScConflictsList
& rConflictsList
)
293 ,mrConflictsList ( rConflictsList
)
295 OSL_ENSURE( mpTrack
, "ScConflictsResolver CTOR: mpTrack is null!" );
298 ScConflictsResolver::~ScConflictsResolver()
302 void ScConflictsResolver::HandleAction( ScChangeAction
* pAction
, bool bIsSharedAction
,
303 bool bHandleContentAction
, bool bHandleNonContentAction
)
305 if ( !mpTrack
|| !pAction
)
310 if ( bIsSharedAction
)
312 ScConflictsListEntry
* pConflictEntry
= ScConflictsListHelper::GetSharedActionEntry(
313 mrConflictsList
, pAction
->GetActionNumber() );
314 if ( pConflictEntry
)
316 ScConflictAction eConflictAction
= pConflictEntry
->meConflictAction
;
317 if ( eConflictAction
== SC_CONFLICT_ACTION_KEEP_MINE
)
319 if ( pAction
->GetType() == SC_CAT_CONTENT
)
321 if ( bHandleContentAction
)
323 mpTrack
->Reject( pAction
);
328 if ( bHandleNonContentAction
)
330 mpTrack
->Reject( pAction
);
338 ScConflictsListEntry
* pConflictEntry
= ScConflictsListHelper::GetOwnActionEntry(
339 mrConflictsList
, pAction
->GetActionNumber() );
340 if ( pConflictEntry
)
342 ScConflictAction eConflictAction
= pConflictEntry
->meConflictAction
;
343 if ( eConflictAction
== SC_CONFLICT_ACTION_KEEP_MINE
)
345 if ( pAction
->GetType() == SC_CAT_CONTENT
)
347 if ( bHandleContentAction
)
350 //mpTrack->SelectContent( pAction );
355 if ( bHandleNonContentAction
)
358 //mpTrack->Accept( pAction );
362 else if ( eConflictAction
== SC_CONFLICT_ACTION_KEEP_OTHER
)
364 if ( pAction
->GetType() == SC_CAT_CONTENT
)
366 if ( bHandleContentAction
)
368 mpTrack
->Reject( pAction
);
373 if ( bHandleNonContentAction
)
375 mpTrack
->Reject( pAction
);
383 //=============================================================================
384 // class ScConflictsDlg
385 //=============================================================================
387 ScConflictsDlg::ScConflictsDlg( Window
* pParent
, ScViewData
* pViewData
, ScDocument
* pSharedDoc
, ScConflictsList
& rConflictsList
)
388 :ModalDialog( pParent
, ScResId( RID_SCDLG_CONFLICTS
) )
389 ,maFtConflicts ( this, ScResId( FT_CONFLICTS
) )
390 ,m_aLbConflictsContainer(this, ScResId( LB_CONFLICTS
))
391 ,maLbConflicts(m_aLbConflictsContainer
)
392 ,maBtnKeepMine ( this, ScResId( BTN_KEEPMINE
) )
393 ,maBtnKeepOther ( this, ScResId( BTN_KEEPOTHER
) )
394 ,maFlConflicts ( this, ScResId( FL_CONFLICTS
) )
395 ,maBtnKeepAllMine ( this, ScResId( BTN_KEEPALLMINE
) )
396 ,maBtnKeepAllOthers ( this, ScResId( BTN_KEEPALLOTHERS
) )
397 ,maBtnCancel ( this, ScResId( BTN_CANCEL
) )
398 ,maBtnHelp ( this, ScResId( BTN_HELP
) )
399 ,maStrTitleConflict ( ScResId( STR_TITLE_CONFLICT
) )
400 ,maStrTitleAuthor ( ScResId( STR_TITLE_AUTHOR
) )
401 ,maStrTitleDate ( ScResId( STR_TITLE_DATE
) )
402 ,maStrUnknownUser ( ScResId( STR_UNKNOWN_USER
) )
403 ,mpViewData ( pViewData
)
406 ,mpSharedDoc ( pSharedDoc
)
407 ,mpSharedTrack ( NULL
)
408 ,mrConflictsList ( rConflictsList
)
409 ,maDialogSize ( GetSizePixel() )
410 ,mbInSelectHdl ( false )
411 ,mbInDeselectHdl ( false )
413 OSL_ENSURE( mpViewData
, "ScConflictsDlg CTOR: mpViewData is null!" );
414 mpOwnDoc
= ( mpViewData
? mpViewData
->GetDocument() : NULL
);
415 OSL_ENSURE( mpOwnDoc
, "ScConflictsDlg CTOR: mpOwnDoc is null!" );
416 mpOwnTrack
= ( mpOwnDoc
? mpOwnDoc
->GetChangeTrack() : NULL
);
417 OSL_ENSURE( mpOwnTrack
, "ScConflictsDlg CTOR: mpOwnTrack is null!" );
418 OSL_ENSURE( mpSharedDoc
, "ScConflictsDlg CTOR: mpSharedDoc is null!" );
419 mpSharedTrack
= ( mpSharedDoc
? mpSharedDoc
->GetChangeTrack() : NULL
);
420 OSL_ENSURE( mpSharedTrack
, "ScConflictsDlg CTOR: mpSharedTrack is null!" );
424 SetMinOutputSizePixel( maDialogSize
);
426 long nTabs
[] = { 3, 10, 216, 266 };
427 maLbConflicts
.SetTabs( nTabs
);
430 OUString
aHeader( maStrTitleConflict
);
432 aHeader
+= maStrTitleAuthor
;
434 aHeader
+= maStrTitleDate
;
435 maLbConflicts
.InsertHeaderEntry( aHeader
, HEADERBAR_APPEND
, HIB_LEFT
| HIB_LEFTIMAGE
| HIB_VCENTER
);
437 maLbConflicts
.SetStyle( maLbConflicts
.GetStyle() | WB_HASLINES
| WB_CLIPCHILDREN
| WB_HASBUTTONS
| WB_HASBUTTONSATROOT
| WB_HSCROLL
);
438 maLbConflicts
.SetSelectionMode( MULTIPLE_SELECTION
);
439 maLbConflicts
.SetHighlightRange();
441 maSelectionTimer
.SetTimeout( 100 );
442 maSelectionTimer
.SetTimeoutHdl( LINK( this, ScConflictsDlg
, UpdateSelectionHdl
) );
444 maLbConflicts
.SetSelectHdl( LINK( this, ScConflictsDlg
, SelectHandle
) );
445 maLbConflicts
.SetDeselectHdl( LINK( this, ScConflictsDlg
, DeselectHandle
) );
447 maBtnKeepMine
.SetClickHdl( LINK( this, ScConflictsDlg
, KeepMineHandle
) );
448 maBtnKeepOther
.SetClickHdl( LINK( this, ScConflictsDlg
, KeepOtherHandle
) );
449 maBtnKeepAllMine
.SetClickHdl( LINK( this, ScConflictsDlg
, KeepAllMineHandle
) );
450 maBtnKeepAllOthers
.SetClickHdl( LINK( this, ScConflictsDlg
, KeepAllOthersHandle
) );
454 SvTreeListEntry
* pEntry
= maLbConflicts
.First();
455 if ( pEntry
!= NULL
)
457 maLbConflicts
.Select( pEntry
);
461 ScConflictsDlg::~ScConflictsDlg()
465 OUString
ScConflictsDlg::GetConflictString( const ScConflictsListEntry
& rConflictEntry
)
470 const ScChangeAction
* pAction
= mpOwnTrack
->GetAction( rConflictEntry
.maOwnActions
[ 0 ] );
471 if ( pAction
&& mpOwnDoc
)
473 SCTAB nTab
= pAction
->GetBigRange().MakeRange().aStart
.Tab();
474 mpOwnDoc
->GetName( nTab
, aString
);
480 OUString
ScConflictsDlg::GetActionString( const ScChangeAction
* pAction
, ScDocument
* pDoc
)
484 OSL_ENSURE( pAction
, "ScConflictsDlg::GetActionString(): pAction is null!" );
485 OSL_ENSURE( pDoc
, "ScConflictsDlg::GetActionString(): pDoc is null!" );
486 if ( pAction
&& pDoc
)
489 pAction
->GetDescription(aDesc
, pDoc
, true, false);
493 OUString aUser
= comphelper::string::strip(pAction
->GetUser(), ' ');
494 if ( aUser
.isEmpty() )
496 aUser
= maStrUnknownUser
;
501 DateTime aDateTime
= pAction
->GetDateTime();
502 aString
+= ScGlobal::pLocaleData
->getDate( aDateTime
);
504 aString
+= ScGlobal::pLocaleData
->getTime( aDateTime
, false );
511 void ScConflictsDlg::HandleListBoxSelection( bool bSelectHandle
)
513 SvTreeListEntry
* pSelEntry
= maLbConflicts
.GetCurEntry();
516 pSelEntry
= maLbConflicts
.FirstSelected();
523 SvTreeListEntry
* pRootEntry
= maLbConflicts
.GetRootLevelParent( pSelEntry
);
528 maLbConflicts
.SelectAll( false );
530 if ( !maLbConflicts
.IsSelected( pRootEntry
) )
532 maLbConflicts
.Select( pRootEntry
);
534 SvTreeListEntry
* pEntry
= maLbConflicts
.FirstChild( pRootEntry
);
537 if ( !maLbConflicts
.IsSelected( pEntry
) )
539 maLbConflicts
.Select( pEntry
);
541 pEntry
= maLbConflicts
.NextSibling( pEntry
);
546 IMPL_LINK_NOARG(ScConflictsDlg
, SelectHandle
)
548 if ( mbInSelectHdl
|| mbInDeselectHdl
)
553 mbInSelectHdl
= true;
554 HandleListBoxSelection( true );
555 maSelectionTimer
.Start();
556 mbInSelectHdl
= false;
561 IMPL_LINK_NOARG(ScConflictsDlg
, DeselectHandle
)
563 if ( mbInDeselectHdl
|| mbInSelectHdl
)
568 mbInDeselectHdl
= true;
569 HandleListBoxSelection( false );
570 mbInDeselectHdl
= false;
575 IMPL_LINK_NOARG(ScConflictsDlg
, UpdateSelectionHdl
)
577 if ( !mpViewData
|| !mpOwnDoc
)
582 ScTabView
* pTabView
= mpViewData
->GetView();
583 pTabView
->DoneBlockMode();
584 sal_Bool bContMark
= false;
585 SvTreeListEntry
* pEntry
= maLbConflicts
.FirstSelected();
588 if ( pEntry
!= maLbConflicts
.GetRootLevelParent( pEntry
) )
590 RedlinData
* pUserData
= static_cast< RedlinData
* >( pEntry
->GetUserData() );
593 ScChangeAction
* pAction
= static_cast< ScChangeAction
* >( pUserData
->pData
);
594 if ( pAction
&& ( pAction
->GetType() != SC_CAT_DELETE_TABS
) &&
595 ( pAction
->IsClickable() || pAction
->IsVisible() ) )
597 const ScBigRange
& rBigRange
= ( static_cast< const ScChangeAction
* >( pAction
) )->GetBigRange();
598 if ( rBigRange
.IsValid( mpOwnDoc
) )
600 sal_Bool bSetCursor
= !maLbConflicts
.NextSelected( pEntry
);
601 pTabView
->MarkRange( rBigRange
.MakeRange(), bSetCursor
, bContMark
);
602 bContMark
= sal_True
;
607 pEntry
= maLbConflicts
.NextSelected( pEntry
);
613 void ScConflictsDlg::SetConflictAction( SvTreeListEntry
* pRootEntry
, ScConflictAction eConflictAction
)
615 RedlinData
* pUserData
= static_cast< RedlinData
* >( pRootEntry
? pRootEntry
->GetUserData() : NULL
);
616 ScConflictsListEntry
* pConflictEntry
= static_cast< ScConflictsListEntry
* >( pUserData
? pUserData
->pData
: NULL
);
617 if ( pConflictEntry
)
619 pConflictEntry
->meConflictAction
= eConflictAction
;
623 void ScConflictsDlg::KeepHandler( bool bMine
)
625 SvTreeListEntry
* pEntry
= maLbConflicts
.FirstSelected();
626 SvTreeListEntry
* pRootEntry
= ( pEntry
? maLbConflicts
.GetRootLevelParent( pEntry
) : NULL
);
631 SetPointer( Pointer( POINTER_WAIT
) );
632 ScConflictAction eConflictAction
= ( bMine
? SC_CONFLICT_ACTION_KEEP_MINE
: SC_CONFLICT_ACTION_KEEP_OTHER
);
633 SetConflictAction( pRootEntry
, eConflictAction
);
634 maLbConflicts
.RemoveEntry( pRootEntry
);
635 SetPointer( Pointer( POINTER_ARROW
) );
636 if ( maLbConflicts
.GetEntryCount() == 0 )
642 void ScConflictsDlg::KeepAllHandler( bool bMine
)
644 SvTreeListEntry
* pEntry
= maLbConflicts
.First();
645 SvTreeListEntry
* pRootEntry
= ( pEntry
? maLbConflicts
.GetRootLevelParent( pEntry
) : NULL
);
650 SetPointer( Pointer( POINTER_WAIT
) );
651 ScConflictAction eConflictAction
= ( bMine
? SC_CONFLICT_ACTION_KEEP_MINE
: SC_CONFLICT_ACTION_KEEP_OTHER
);
654 SetConflictAction( pRootEntry
, eConflictAction
);
655 pRootEntry
= maLbConflicts
.NextSibling( pRootEntry
);
657 maLbConflicts
.SetUpdateMode( false );
658 maLbConflicts
.Clear();
659 maLbConflicts
.SetUpdateMode( sal_True
);
660 SetPointer( Pointer( POINTER_ARROW
) );
664 IMPL_LINK_NOARG(ScConflictsDlg
, KeepMineHandle
)
671 IMPL_LINK_NOARG(ScConflictsDlg
, KeepOtherHandle
)
673 KeepHandler( false );
678 IMPL_LINK_NOARG(ScConflictsDlg
, KeepAllMineHandle
)
680 KeepAllHandler( true );
685 IMPL_LINK_NOARG(ScConflictsDlg
, KeepAllOthersHandle
)
687 KeepAllHandler( false );
692 static void lcl_MoveControlX( Window
& rWindow
, long nDelta
)
694 Point
aPos( rWindow
.GetPosPixel() );
696 rWindow
.SetPosPixel( aPos
);
699 static void lcl_MoveControlY( Window
& rWindow
, long nDelta
)
701 Point
aPos( rWindow
.GetPosPixel() );
703 rWindow
.SetPosPixel( aPos
);
706 static void lcl_ChangeControlWidth( Window
& rWindow
, long nDelta
)
708 Size
aSize( rWindow
.GetSizePixel() );
709 aSize
.Width() += nDelta
;
710 rWindow
.SetSizePixel( aSize
);
713 static void lcl_ChangeControlHeight( Window
& rWindow
, long nDelta
)
715 Size
aSize( rWindow
.GetSizePixel() );
716 aSize
.Height() += nDelta
;
717 rWindow
.SetSizePixel( aSize
);
720 void ScConflictsDlg::Resize()
722 Size
aSize( GetSizePixel() );
723 long nDeltaWidth
= aSize
.Width() - maDialogSize
.Width();
724 long nDeltaHeight
= aSize
.Height() - maDialogSize
.Height();
725 maDialogSize
= aSize
;
727 lcl_ChangeControlWidth( maFtConflicts
, nDeltaWidth
);
729 lcl_ChangeControlWidth( m_aLbConflictsContainer
, nDeltaWidth
);
730 lcl_ChangeControlHeight( m_aLbConflictsContainer
, nDeltaHeight
);
732 lcl_MoveControlX( maBtnKeepMine
, nDeltaWidth
/ 2 );
733 lcl_MoveControlY( maBtnKeepMine
, nDeltaHeight
);
735 lcl_MoveControlX( maBtnKeepOther
, nDeltaWidth
/ 2 );
736 lcl_MoveControlY( maBtnKeepOther
, nDeltaHeight
);
738 lcl_MoveControlY( maFlConflicts
, nDeltaHeight
);
739 lcl_ChangeControlWidth( maFlConflicts
, nDeltaWidth
);
741 lcl_MoveControlX( maBtnKeepAllMine
, nDeltaWidth
);
742 lcl_MoveControlY( maBtnKeepAllMine
, nDeltaHeight
);
744 lcl_MoveControlX( maBtnKeepAllOthers
, nDeltaWidth
);
745 lcl_MoveControlY( maBtnKeepAllOthers
, nDeltaHeight
);
747 lcl_MoveControlX( maBtnCancel
, nDeltaWidth
);
748 lcl_MoveControlY( maBtnCancel
, nDeltaHeight
);
750 lcl_MoveControlX( maBtnHelp
, nDeltaWidth
);
751 lcl_MoveControlY( maBtnHelp
, nDeltaHeight
);
754 void ScConflictsDlg::UpdateView()
756 ScConflictsList::iterator aEndItr
= mrConflictsList
.end();
757 for ( ScConflictsList::iterator aItr
= mrConflictsList
.begin(); aItr
!= aEndItr
; ++aItr
)
759 ScConflictsListEntry
* pConflictEntry
= &(*aItr
);
760 if ( pConflictEntry
&& pConflictEntry
->meConflictAction
== SC_CONFLICT_ACTION_NONE
)
762 RedlinData
* pRootUserData
= new RedlinData();
763 pRootUserData
->pData
= static_cast< void* >( pConflictEntry
);
764 SvTreeListEntry
* pRootEntry
= maLbConflicts
.InsertEntry( GetConflictString( *aItr
), pRootUserData
);
766 ScChangeActionList::const_iterator aEndShared
= aItr
->maSharedActions
.end();
767 for ( ScChangeActionList::const_iterator aItrShared
= aItr
->maSharedActions
.begin(); aItrShared
!= aEndShared
; ++aItrShared
)
769 ScChangeAction
* pAction
= mpSharedTrack
->GetAction( *aItrShared
);
772 // only display shared top content entries
773 if ( pAction
->GetType() == SC_CAT_CONTENT
)
775 ScChangeActionContent
* pNextContent
= ( dynamic_cast< ScChangeActionContent
* >( pAction
) )->GetNextContent();
776 if ( pNextContent
&& aItr
->HasSharedAction( pNextContent
->GetActionNumber() ) )
782 OUString
aString( GetActionString( pAction
, mpSharedDoc
) );
783 maLbConflicts
.InsertEntry( aString
, static_cast< RedlinData
* >( NULL
), pRootEntry
);
787 ScChangeActionList::const_iterator aEndOwn
= aItr
->maOwnActions
.end();
788 for ( ScChangeActionList::const_iterator aItrOwn
= aItr
->maOwnActions
.begin(); aItrOwn
!= aEndOwn
; ++aItrOwn
)
790 ScChangeAction
* pAction
= mpOwnTrack
->GetAction( *aItrOwn
);
793 // only display own top content entries
794 if ( pAction
->GetType() == SC_CAT_CONTENT
)
796 ScChangeActionContent
* pNextContent
= ( dynamic_cast< ScChangeActionContent
* >( pAction
) )->GetNextContent();
797 if ( pNextContent
&& aItr
->HasOwnAction( pNextContent
->GetActionNumber() ) )
803 OUString
aString( GetActionString( pAction
, mpOwnDoc
) );
804 RedlinData
* pUserData
= new RedlinData();
805 pUserData
->pData
= static_cast< void* >( pAction
);
806 maLbConflicts
.InsertEntry( aString
, pUserData
, pRootEntry
);
810 maLbConflicts
.Expand( pRootEntry
);
815 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */