Kaydet (Commit) 82b29b9d authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#53442 SwTxtPaintInfo::_DrawBackBrush: color multi-para comment ranges

Change-Id: Ieb9a33cda8297b432e1d0ea8224ba9231b6ac2c1
üst 5ddcaa86
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#include <cstdio> #include <cstdio>
// #i12836# enhanced pdf export // #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx> #include <EnhancedPDFExportHelper.hxx>
#include <docufld.hxx>
#include <unomid.h> #include <unomid.h>
...@@ -1108,17 +1109,14 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const ...@@ -1108,17 +1109,14 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
// If this is a comment range, need to look up the color of the comment author. // If this is a comment range, need to look up the color of the comment author.
if (pFieldmark->GetFieldname() == ODF_COMMENTRANGE) if (pFieldmark->GetFieldname() == ODF_COMMENTRANGE)
{ {
// Search for the position of the postit field // Search for the postit field
const sal_Unicode fld[] = { CH_TXTATR_INWORD, 0 }; const SwFmtFld* pField = SwPostItField::GetByName(pNd->GetDoc(), pFieldmark->GetName());
xub_StrLen nEndIdx = GetTxt().SearchChar(fld, GetIdx()); if (pField)
if (nEndIdx != STRING_NOTFOUND)
{ {
SwTxtAttr* pTxtAttr = pNd->GetTxtAttrForCharAt(nEndIdx, RES_TXTATR_FIELD);
const SwFmtFld& rPostItField = pTxtAttr->GetFld();
// Look up the author name // Look up the author name
const OUString& rAuthor = rPostItField.GetFld()->GetPar1(); const OUString& rAuthor = pField->GetFld()->GetPar1();
sal_uInt16 nIndex = pNd->GetDoc()->InsertRedlineAuthor(rAuthor); sal_uInt16 nIndex = pNd->GetDoc()->InsertRedlineAuthor(rAuthor);
pOutDev->SetFillColor( SwPostItMgr::GetColorLight(nIndex) ); pOutDev->SetFillColor(SwPostItMgr::GetColorLight(nIndex));
bFilled = true; bFilled = true;
} }
} }
......
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