summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/swtable.hxx2
-rw-r--r--sw/source/core/table/swtable.cxx10
-rw-r--r--sw/source/uibase/shells/tabsh.cxx14
3 files changed, 15 insertions, 11 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 3015223ef451..272ba18393f1 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -426,6 +426,8 @@ public:
// Cache also the type of the redline associated to the changed table row.
SwRedlineTable::size_type UpdateTextChangesOnly(
SwRedlineTable::size_type& rRedlinePos, bool bUpdateProperty = true) const;
+ // is it a tracked row
+ bool IsTracked(SwRedlineTable::size_type& rRedlinePos, bool bOnlyDeleted = false) const;
// is it a tracked deleted row
bool IsDeleted(SwRedlineTable::size_type& rRedlinePos) const;
// set/get (if it's possible, cached) redline type
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 889f4820e0fd..523f14e0c46f 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1892,19 +1892,25 @@ SwRedlineTable::size_type SwTableLine::UpdateTextChangesOnly(
return nRet;
}
-bool SwTableLine::IsDeleted(SwRedlineTable::size_type& rRedlinePos) const
+bool SwTableLine::IsTracked(SwRedlineTable::size_type& rRedlinePos, bool bOnlyDeleted) const
{
SwRedlineTable::size_type nPos = UpdateTextChangesOnly(rRedlinePos);
if ( nPos != SwRedlineTable::npos )
{
const SwRedlineTable& aRedlineTable =
GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
- if ( RedlineType::Delete == aRedlineTable[nPos]->GetType() )
+ if ( RedlineType::Delete == aRedlineTable[nPos]->GetType() ||
+ ( !bOnlyDeleted && RedlineType::Insert == aRedlineTable[nPos]->GetType() ) )
return true;
}
return false;
}
+bool SwTableLine::IsDeleted(SwRedlineTable::size_type& rRedlinePos) const
+{
+ return IsTracked(rRedlinePos, true);
+}
+
RedlineType SwTableLine::GetRedlineType() const
{
const SwRedlineTable& aRedlineTable = GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index d85c132c15bc..855685eda05d 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -446,17 +446,13 @@ static void lcl_TabGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLi
rBorderLine.SetColor(pBorderLine->GetColor());
}
-static bool lcl_BoxesInDeletedRows(SwWrtShell &rSh, const SwSelBoxes& rBoxes)
+static bool lcl_BoxesInTrackedRows(SwWrtShell &rSh, const SwSelBoxes& rBoxes)
{
- // cursor and selection are there only in deleted rows in Show Changes mode
- if ( rSh.GetLayout()->IsHideRedlines() )
- return false;
-
- // not selected or all selected rows are deleted
+ // cursor and selection are there only in tracked rows
bool bRet = true;
SwRedlineTable::size_type nRedlinePos = 0;
if ( rBoxes.empty() )
- bRet = rSh.GetCursor()->GetPointNode().GetTableBox()->GetUpper()->IsDeleted(nRedlinePos);
+ bRet = rSh.GetCursor()->GetPointNode().GetTableBox()->GetUpper()->IsTracked(nRedlinePos);
else
{
tools::Long nBoxes = rBoxes.size();
@@ -465,7 +461,7 @@ static bool lcl_BoxesInDeletedRows(SwWrtShell &rSh, const SwSelBoxes& rBoxes)
{
SwTableLine* pLine = rBoxes[i]->GetUpper();
if ( pLine != pPrevLine )
- bRet &= pLine->IsDeleted(nRedlinePos);
+ bRet &= pLine->IsTracked(nRedlinePos);
pPrevLine = pLine;
}
}
@@ -1450,7 +1446,7 @@ void SwTableShell::GetState(SfxItemSet &rSet)
{
SwSelBoxes aBoxes;
::GetTableSel( rSh, aBoxes, SwTableSearchType::Row );
- if( ::HasProtectedCells( aBoxes ) || lcl_BoxesInDeletedRows( rSh, aBoxes ) )
+ if( ::HasProtectedCells( aBoxes ) || lcl_BoxesInTrackedRows( rSh, aBoxes ) )
rSet.DisableItem( nSlot );
}
break;