Kaydet (Commit) 4485ff1b authored tarafından Miklos Vajna's avatar Miklos Vajna

implement RTF_DPLINECOR/G/B

Change-Id: I179472754f63559668ff918fd2a01331cd3c35bb
üst 57be17df
......@@ -2831,6 +2831,15 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aStates.top().nInternalState = INTERNAL_BIN;
m_aStates.top().nBinaryToRead = nParam;
break;
case RTF_DPLINECOR:
m_aStates.top().aDrawingObject.nLineColorR = nParam; m_aStates.top().aDrawingObject.bHasLineColor = true;
break;
case RTF_DPLINECOG:
m_aStates.top().aDrawingObject.nLineColorG = nParam; m_aStates.top().aDrawingObject.bHasLineColor = true;
break;
case RTF_DPLINECOB:
m_aStates.top().aDrawingObject.nLineColorB = nParam; m_aStates.top().aDrawingObject.bHasLineColor = true;
break;
default:
SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle value '" << lcl_RtfToString(nKeyword) << "'");
aSkip.setParsed(false);
......@@ -3330,6 +3339,13 @@ int RTFDocumentImpl::popState()
uno::Reference<drawing::XShape> xShape(rDrawing.xShape);
xShape->setPosition(awt::Point(rDrawing.nLeft, rDrawing.nTop));
xShape->setSize(awt::Size(rDrawing.nRight, rDrawing.nBottom));
if (rDrawing.bHasLineColor)
{
uno::Reference<beans::XPropertySet> xPropertySet(rDrawing.xPropertySet);
xPropertySet->setPropertyValue("LineColor", uno::makeAny(sal_uInt32((rDrawing.nLineColorR<<16) + (rDrawing.nLineColorG<<8) + rDrawing.nLineColorB)));
}
Mapper().startShape(xShape);
Mapper().endShape();
}
......@@ -3637,6 +3653,14 @@ RTFPicture::RTFPicture()
{
}
RTFDrawingObject::RTFDrawingObject()
: nLineColorR(0),
nLineColorG(0),
nLineColorB(0),
bHasLineColor(false)
{
}
RTFFrame::RTFFrame(RTFParserState* pParserState)
: m_pParserState(pParserState),
nX(0),
......
......@@ -197,9 +197,12 @@ namespace writerfilter {
class RTFDrawingObject : public RTFShape
{
public:
RTFDrawingObject();
uno::Reference<drawing::XShape> xShape;
uno::Reference<beans::XPropertySet> xPropertySet;
std::vector<beans::PropertyValue> aPendingProperties;
sal_uInt8 nLineColorR, nLineColorG, nLineColorB;
bool bHasLineColor;
};
/// Stores the properties of a picture.
......
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