summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-18 15:33:50 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-18 19:21:06 +0100
commit5fbea544470d1a3edc51e881c12063ef1bf56dda (patch)
treec4d5c0385bd0e07766bf454e05ebbafafdc900c1 /sw
parent151cc01f6afb389ab4d98131ba918dbf6e06e749 (diff)
drawingml export of sw textframe inset
This is triggered by testFdo66929 in CppunitTest_sw_ooxmlexport when DML export of TextFrames is enabled in non-experimental mode. Change-Id: I39481c55fc101aa9c61984cc5646911b4c207bc9
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx13
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx2
2 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 81f6479c66bc..725a5798f7af 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -462,6 +462,7 @@ void DocxAttributeOutput::WriteDMLTextFrame(sw::Frame* pParentFrame)
XML_prst, "rect",
FSEND);
m_bDMLTextFrameSyntax = true;
+ m_pBodyPrAttrList = m_pSerializer->createAttrList();
m_rExport.OutputFormat( pParentFrame->GetFrmFmt(), false, false, true );
m_bDMLTextFrameSyntax = false;
m_pSerializer->endElementNS(XML_wps, XML_spPr);
@@ -472,7 +473,9 @@ void DocxAttributeOutput::WriteDMLTextFrame(sw::Frame* pParentFrame)
m_rExport.WriteText( );
m_pSerializer->endElementNS( XML_w, XML_txbxContent );
m_pSerializer->endElementNS( XML_wps, XML_txbx );
- m_pSerializer->singleElementNS( XML_wps, XML_bodyPr, FSEND );
+ XFastAttributeListRef xBodyPrAttrList(m_pBodyPrAttrList);
+ m_pBodyPrAttrList = NULL;
+ m_pSerializer->singleElementNS( XML_wps, XML_bodyPr, xBodyPrAttrList );
m_pSerializer->endElementNS(XML_wps, XML_wsp);
m_pSerializer->endElementNS(XML_a, XML_graphicData);
@@ -5891,7 +5894,13 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
}
if (m_bDMLTextFrameSyntax)
+ {
+ m_pBodyPrAttrList->add(XML_lIns, OString::number(TwipsToEMU(rBox.GetDistance(BOX_LINE_LEFT))));
+ m_pBodyPrAttrList->add(XML_tIns, OString::number(TwipsToEMU(rBox.GetDistance(BOX_LINE_TOP))));
+ m_pBodyPrAttrList->add(XML_rIns, OString::number(TwipsToEMU(rBox.GetDistance(BOX_LINE_RIGHT))));
+ m_pBodyPrAttrList->add(XML_bIns, OString::number(TwipsToEMU(rBox.GetDistance(BOX_LINE_BOTTOM))));
return;
+ }
// v:textbox's inset attribute: inner margin values for textbox text - write only non-default values
double fDistanceLeftTwips = double(rBox.GetDistance(BOX_LINE_LEFT));
@@ -6235,6 +6244,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_pParagraphSpacingAttrList( NULL ),
m_pHyperlinkAttrList( NULL ),
m_pFlyAttrList( NULL ),
+ m_pBodyPrAttrList( NULL ),
m_pFlyFillAttrList( NULL ),
m_pFlyWrapAttrList( NULL ),
m_pTextboxAttrList( NULL ),
@@ -6293,6 +6303,7 @@ DocxAttributeOutput::~DocxAttributeOutput()
delete m_pParagraphSpacingAttrList, m_pParagraphSpacingAttrList = NULL;
delete m_pHyperlinkAttrList, m_pHyperlinkAttrList = NULL;
delete m_pFlyAttrList, m_pFlyAttrList = NULL;
+ delete m_pBodyPrAttrList, m_pBodyPrAttrList = NULL;
delete m_pTextboxAttrList, m_pTextboxAttrList = NULL;
delete m_pColorAttrList, m_pColorAttrList = NULL;
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 99bb35ca4ea3..8ebf31ef0c3b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -678,6 +678,8 @@ private:
::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList;
::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
::sax_fastparser::FastAttributeList *m_pFlyAttrList;
+ /// Attributes of <wps:bodyPr>, used during DML export of text frames.
+ ::sax_fastparser::FastAttributeList *m_pBodyPrAttrList;
::sax_fastparser::FastAttributeList *m_pFlyFillAttrList;
::sax_fastparser::FastAttributeList *m_pFlyWrapAttrList;
/// Attributes of the next v:textbox element.