Kaydet (Commit) 71bf95db authored tarafından Miklos Vajna's avatar Miklos Vajna

implement RTF_DPFILLBGCR/G/B

Change-Id: I Ie4df6921201b2be4e7d9aa3febd1dcdc1e3eef40
üst 4485ff1b
...@@ -2840,6 +2840,15 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -2840,6 +2840,15 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_DPLINECOB: case RTF_DPLINECOB:
m_aStates.top().aDrawingObject.nLineColorB = nParam; m_aStates.top().aDrawingObject.bHasLineColor = true; m_aStates.top().aDrawingObject.nLineColorB = nParam; m_aStates.top().aDrawingObject.bHasLineColor = true;
break; break;
case RTF_DPFILLBGCR:
m_aStates.top().aDrawingObject.nFillColorR = nParam; m_aStates.top().aDrawingObject.bHasFillColor = true;
break;
case RTF_DPFILLBGCG:
m_aStates.top().aDrawingObject.nFillColorG = nParam; m_aStates.top().aDrawingObject.bHasFillColor = true;
break;
case RTF_DPFILLBGCB:
m_aStates.top().aDrawingObject.nFillColorB = nParam; m_aStates.top().aDrawingObject.bHasFillColor = true;
break;
default: default:
SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle value '" << lcl_RtfToString(nKeyword) << "'"); SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle value '" << lcl_RtfToString(nKeyword) << "'");
aSkip.setParsed(false); aSkip.setParsed(false);
...@@ -3339,12 +3348,15 @@ int RTFDocumentImpl::popState() ...@@ -3339,12 +3348,15 @@ int RTFDocumentImpl::popState()
uno::Reference<drawing::XShape> xShape(rDrawing.xShape); uno::Reference<drawing::XShape> xShape(rDrawing.xShape);
xShape->setPosition(awt::Point(rDrawing.nLeft, rDrawing.nTop)); xShape->setPosition(awt::Point(rDrawing.nLeft, rDrawing.nTop));
xShape->setSize(awt::Size(rDrawing.nRight, rDrawing.nBottom)); xShape->setSize(awt::Size(rDrawing.nRight, rDrawing.nBottom));
uno::Reference<beans::XPropertySet> xPropertySet(rDrawing.xPropertySet);
if (rDrawing.bHasLineColor) 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))); xPropertySet->setPropertyValue("LineColor", uno::makeAny(sal_uInt32((rDrawing.nLineColorR<<16) + (rDrawing.nLineColorG<<8) + rDrawing.nLineColorB)));
} if (rDrawing.bHasFillColor)
xPropertySet->setPropertyValue("FillColor", uno::makeAny(sal_uInt32((rDrawing.nFillColorR<<16) + (rDrawing.nFillColorG<<8) + rDrawing.nFillColorB)));
else
// If there is no fill, the Word default is 100% transparency.
xPropertySet->setPropertyValue("FillTransparence", uno::makeAny(sal_Int32(100)));
Mapper().startShape(xShape); Mapper().startShape(xShape);
Mapper().endShape(); Mapper().endShape();
...@@ -3657,7 +3669,11 @@ RTFDrawingObject::RTFDrawingObject() ...@@ -3657,7 +3669,11 @@ RTFDrawingObject::RTFDrawingObject()
: nLineColorR(0), : nLineColorR(0),
nLineColorG(0), nLineColorG(0),
nLineColorB(0), nLineColorB(0),
bHasLineColor(false) bHasLineColor(false),
nFillColorR(0),
nFillColorG(0),
nFillColorB(0),
bHasFillColor(false)
{ {
} }
......
...@@ -203,6 +203,8 @@ namespace writerfilter { ...@@ -203,6 +203,8 @@ namespace writerfilter {
std::vector<beans::PropertyValue> aPendingProperties; std::vector<beans::PropertyValue> aPendingProperties;
sal_uInt8 nLineColorR, nLineColorG, nLineColorB; sal_uInt8 nLineColorR, nLineColorG, nLineColorB;
bool bHasLineColor; bool bHasLineColor;
sal_uInt8 nFillColorR, nFillColorG, nFillColorB;
bool bHasFillColor;
}; };
/// Stores the properties of a picture. /// 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