summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-23 11:34:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-04-23 11:36:28 +0100
commit14045bbd2b724478bc47fafb3a47d119d2e70704 (patch)
treec3159b10d518b995d3b7f4584625672d33fcea54
parent259bad513edb83ba1f03a374462cf9a224c99cb3 (diff)
fix crash on export of ooo88740-1.odt to .docx
use similar logic as AttributeOutputBase::FormatCharBorder Change-Id: I71c4aa28c2495fd4a357fd62568aaa49e918da5c
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx33
1 files changed, 28 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index ac8382ee8e17..7c191c0a4d99 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1303,24 +1303,47 @@ void DocxSdrExport::writeOnlyTextOfFrame(sw::Frame* pParentFrame)
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;
- const editeng::SvxBorderLine* pTop = rBoxItem.GetTop();
- double fConverted(editeng::ConvertBorderWidthToWord(pTop->GetBorderLineStyle(), pTop->GetWidth()));
+ double fConverted(editeng::ConvertBorderWidthToWord(pBorderLine->GetBorderLineStyle(), pBorderLine->GetWidth()));
OString sWidth(OString::number(TwipsToEMU(fConverted)));
pFS->startElementNS(XML_a, XML_ln,
XML_w, sWidth.getStr(),
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,
XML_val, sColor,
FSEND);
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->endElementNS(XML_a, XML_ln);