summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/inc/flyfrm.hxx3
-rw-r--r--sw/source/core/layout/fly.cxx3
-rw-r--r--sw/source/core/layout/paintfrm.cxx4
-rw-r--r--sw/source/core/text/porlay.cxx11
4 files changed, 14 insertions, 7 deletions
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 399bbbe913fe..47017e71e50e 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -131,6 +131,7 @@ protected:
bool m_bLayout :1; ///< RndStdIds::FLY_AT_PAGE, RndStdIds::FLY_AT_FLY, at page or at frame
bool m_bAutoPosition :1; ///< RndStdIds::FLY_AT_CHAR, anchored at character
bool m_bDeleted :1; ///< Anchored to a tracked deletion
+ size_t m_nAuthor; ///< Redline author index for colored crossing out
friend class SwNoTextFrame; // is allowed to call NotifyBackground
@@ -217,6 +218,8 @@ public:
bool IsFlyAtContentFrame() const { return m_bAtCnt; }
bool IsDeleted() const { return m_bDeleted; }
void SetDeleted(bool bDeleted) { m_bDeleted = bDeleted; }
+ void SetAuthor( size_t nAuthor ) { m_nAuthor = nAuthor; }
+ size_t GetAuthor() const { return m_nAuthor; }
bool IsNotifyBack() const { return m_bNotifyBack; }
void SetNotifyBack() { m_bNotifyBack = true; }
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index bf01c3b1dc7a..8181bd623d39 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -87,7 +87,8 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
m_bAtCnt( false ),
m_bLayout( false ),
m_bAutoPosition( false ),
- m_bDeleted (false ),
+ m_bDeleted( false ),
+ m_nAuthor( std::string::npos ),
m_bValidContentPos( false )
{
mnFrameType = SwFrameType::Fly;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 4a9eb647bbd6..f5cb3c50ad1c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4222,11 +4222,11 @@ void SwFlyFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const&
PaintDecorators();
// crossing out for tracked deletion
- if ( IsDeleted() )
+ if ( GetAuthor() != std::string::npos && IsDeleted() )
{
tools::Long startX = aRect.Left( ), endX = aRect.Right();
tools::Long startY = aRect.Top( ), endY = aRect.Bottom();
- rRenderContext.SetLineColor(NON_PRINTING_CHARACTER_COLOR);
+ rRenderContext.SetLineColor( SwPostItMgr::GetColorAnchor(GetAuthor()) );
rRenderContext.DrawLine(Point(startX, startY), Point(endX, endY));
rRenderContext.DrawLine(Point(startX, endY), Point(endX, startY));
}
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 9a162b6993d7..f0a3a4e00eee 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -670,20 +670,23 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
if ( auto pFly = dynamic_cast<SwFlyFrame *>( pAnchoredObj ) )
{
bool bDeleted = false;
+ size_t nAuthor = std::string::npos;
const SwFormatAnchor& rAnchor = pAnchoredObj->GetFrameFormat().GetAnchor();
if ( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR )
{
SwPosition aAnchor = *rAnchor.GetContentAnchor();
- const SwPaM aPam(aAnchor, aAnchor);
- if ( rIDRA.HasRedline( aPam, RedlineType::Delete,
- /*bStartOrEndInRange=*/false) )
+ SwRedlineTable::size_type n = 0;
+ const SwRangeRedline* pFnd =
+ rIDRA.GetRedlineTable().FindAtPosition( aAnchor, n );
+ if ( pFnd && RedlineType::Delete == pFnd->GetType() )
{
bDeleted = true;
+ nAuthor = pFnd->GetAuthor();
}
}
pFly->SetDeleted(bDeleted);
+ pFly->SetAuthor(nAuthor);
}
-
}
}
}