summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-03-27 16:13:37 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-27 16:35:45 +0100
commit82b29b9d384211061653f35695287be60dbc99b8 (patch)
tree12c5d842a2f319f84bab08c43dd56028d3e2330f
parent5ddcaa86003c6a28c4a9b307cdf3b37deabaa5a4 (diff)
fdo#53442 SwTxtPaintInfo::_DrawBackBrush: color multi-para comment ranges
Change-Id: Ieb9a33cda8297b432e1d0ea8224ba9231b6ac2c1
-rw-r--r--sw/source/core/text/inftxt.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 62ac9a2184bb..8b51fc953f6d 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -66,6 +66,7 @@
#include <cstdio>
// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
+#include <docufld.hxx>
#include <unomid.h>
@@ -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 (pFieldmark->GetFieldname() == ODF_COMMENTRANGE)
{
- // Search for the position of the postit field
- const sal_Unicode fld[] = { CH_TXTATR_INWORD, 0 };
- xub_StrLen nEndIdx = GetTxt().SearchChar(fld, GetIdx());
- if (nEndIdx != STRING_NOTFOUND)
+ // Search for the postit field
+ const SwFmtFld* pField = SwPostItField::GetByName(pNd->GetDoc(), pFieldmark->GetName());
+ if (pField)
{
- SwTxtAttr* pTxtAttr = pNd->GetTxtAttrForCharAt(nEndIdx, RES_TXTATR_FIELD);
- const SwFmtFld& rPostItField = pTxtAttr->GetFld();
// Look up the author name
- const OUString& rAuthor = rPostItField.GetFld()->GetPar1();
+ const OUString& rAuthor = pField->GetFld()->GetPar1();
sal_uInt16 nIndex = pNd->GetDoc()->InsertRedlineAuthor(rAuthor);
- pOutDev->SetFillColor( SwPostItMgr::GetColorLight(nIndex) );
+ pOutDev->SetFillColor(SwPostItMgr::GetColorLight(nIndex));
bFilled = true;
}
}