Kaydet (Commit) 14045bbd authored tarafından Caolán McNamara's avatar Caolán McNamara

fix crash on export of ooo88740-1.odt to .docx

use similar logic as AttributeOutputBase::FormatCharBorder

Change-Id: I71c4aa28c2495fd4a357fd62568aaa49e918da5c
üst 259bad51
...@@ -1303,24 +1303,47 @@ void DocxSdrExport::writeOnlyTextOfFrame(sw::Frame* pParentFrame) ...@@ -1303,24 +1303,47 @@ void DocxSdrExport::writeOnlyTextOfFrame(sw::Frame* pParentFrame)
m_pImpl->m_bFrameBtLr = false; m_pImpl->m_bFrameBtLr = false;
} }
void DocxSdrExport::writeBoxItemLine(const SvxBoxItem& rBoxItem) void DocxSdrExport::writeBoxItemLine(const SvxBoxItem& rBox)
{ {
const editeng::SvxBorderLine* pBorderLine = 0;
if( rBox.GetTop() )
{
pBorderLine = rBox.GetTop();
}
else if( rBox.GetLeft() )
{
pBorderLine = rBox.GetLeft();
}
else if( rBox.GetBottom() )
{
pBorderLine = rBox.GetBottom();
}
else if( rBox.GetRight() )
{
pBorderLine = rBox.GetRight();
}
if (!pBorderLine)
{
return;
}
sax_fastparser::FSHelperPtr pFS = m_pImpl->m_pSerializer; sax_fastparser::FSHelperPtr pFS = m_pImpl->m_pSerializer;
const editeng::SvxBorderLine* pTop = rBoxItem.GetTop(); double fConverted(editeng::ConvertBorderWidthToWord(pBorderLine->GetBorderLineStyle(), pBorderLine->GetWidth()));
double fConverted(editeng::ConvertBorderWidthToWord(pTop->GetBorderLineStyle(), pTop->GetWidth()));
OString sWidth(OString::number(TwipsToEMU(fConverted))); OString sWidth(OString::number(TwipsToEMU(fConverted)));
pFS->startElementNS(XML_a, XML_ln, pFS->startElementNS(XML_a, XML_ln,
XML_w, sWidth.getStr(), XML_w, sWidth.getStr(),
FSEND); FSEND);
pFS->startElementNS(XML_a, XML_solidFill, FSEND); pFS->startElementNS(XML_a, XML_solidFill, FSEND);
OString sColor(msfilter::util::ConvertColor(pTop->GetColor())); OString sColor(msfilter::util::ConvertColor(pBorderLine->GetColor()));
pFS->singleElementNS(XML_a, XML_srgbClr, pFS->singleElementNS(XML_a, XML_srgbClr,
XML_val, sColor, XML_val, sColor,
FSEND); FSEND);
pFS->endElementNS(XML_a, XML_solidFill); pFS->endElementNS(XML_a, XML_solidFill);
if (drawing::LineStyle_DASH == pTop->GetBorderLineStyle()) // Line Style is Dash type if (drawing::LineStyle_DASH == pBorderLine->GetBorderLineStyle()) // Line Style is Dash type
pFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND); pFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND);
pFS->endElementNS(XML_a, XML_ln); pFS->endElementNS(XML_a, XML_ln);
......
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