Kaydet (Commit) 57bdb067 authored tarafından Gulsah Kose's avatar Gulsah Kose Kaydeden (comit) Eike Rathke

tdf#108098 Correct detection of MIXED state.

Change-Id: I212b908b8b7b2e8933dd5f923b0a2d8890bceed6
Signed-off-by: 's avatarGulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/38310Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst 28d760e5
...@@ -6518,7 +6518,9 @@ void ScDocument::ForgetNoteCaptions( const ScRangeList& rRanges, bool bPreserveD ...@@ -6518,7 +6518,9 @@ void ScDocument::ForgetNoteCaptions( const ScRangeList& rRanges, bool bPreserveD
CommentCaptionState ScDocument::GetAllNoteCaptionsState( const ScRangeList& rRanges ) CommentCaptionState ScDocument::GetAllNoteCaptionsState( const ScRangeList& rRanges )
{ {
CommentCaptionState aOldState, aState = CommentCaptionState::ALLHIDDEN; //because of Werror=maybe-uninitialized CommentCaptionState aTmpState = CommentCaptionState::ALLHIDDEN;
CommentCaptionState aState = CommentCaptionState::ALLHIDDEN;
bool bFirstControl = true;
std::vector<sc::NoteEntry> aNotes; std::vector<sc::NoteEntry> aNotes;
for (size_t i = 0, n = rRanges.size(); i < n; ++i) for (size_t i = 0, n = rRanges.size(); i < n; ++i)
...@@ -6528,18 +6530,19 @@ CommentCaptionState ScDocument::GetAllNoteCaptionsState( const ScRangeList& rRan ...@@ -6528,18 +6530,19 @@ CommentCaptionState ScDocument::GetAllNoteCaptionsState( const ScRangeList& rRan
for( SCTAB nTab = pRange->aStart.Tab(); nTab <= pRange->aEnd.Tab(); ++nTab ) for( SCTAB nTab = pRange->aStart.Tab(); nTab <= pRange->aEnd.Tab(); ++nTab )
{ {
aState = maTabs[nTab]->GetAllNoteCaptionsState( *pRange, aNotes ); aState = maTabs[nTab]->GetAllNoteCaptionsState( *pRange, aNotes );
if (aState == CommentCaptionState::MIXED) if (aState == CommentCaptionState::MIXED)
return aState; return aState;
if (nTab - 1 >= 0) // it is possible that a range is ALLSHOWN, another range is ALLHIDDEN, if (bFirstControl) // it is possible that a range is ALLSHOWN, another range is ALLHIDDEN,
{ // we have to detect that situation as mixed. { // we have to detect that situation as mixed.
aOldState = maTabs[nTab-1]->GetAllNoteCaptionsState( *pRange, aNotes ); aTmpState = aState;
bFirstControl = false;
if (aState != aOldState) }
{ else if(aTmpState != aState)
aState = CommentCaptionState::MIXED; {
return aState; aState = CommentCaptionState::MIXED;
} return aState;
} }
} }
} }
......
...@@ -485,6 +485,7 @@ void ScTabView::SelectionChanged() ...@@ -485,6 +485,7 @@ void ScTabView::SelectionChanged()
rBindings.Invalidate( FID_HIDE_NOTE ); rBindings.Invalidate( FID_HIDE_NOTE );
rBindings.Invalidate( FID_SHOW_ALL_NOTES ); rBindings.Invalidate( FID_SHOW_ALL_NOTES );
rBindings.Invalidate( FID_HIDE_ALL_NOTES ); rBindings.Invalidate( FID_HIDE_ALL_NOTES );
rBindings.Invalidate( SID_TOGGLE_NOTES );
rBindings.Invalidate( SID_DELETE_NOTE ); rBindings.Invalidate( SID_DELETE_NOTE );
rBindings.Invalidate( SID_ROWCOL_SELCOUNT ); rBindings.Invalidate( SID_ROWCOL_SELCOUNT );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment