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

initial DOCX export of Writer textframe gradients

Change-Id: I0b0a623c58ca398bb556fc9fcd2cdecb4e789d0a
üst 23515e81
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
#include <editeng/editobj.hxx> #include <editeng/editobj.hxx>
#include <svx/svdmodel.hxx> #include <svx/svdmodel.hxx>
#include <svx/svdobj.hxx> #include <svx/svdobj.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflgrit.hxx>
#include <sfx2/sfxbasemodel.hxx> #include <sfx2/sfxbasemodel.hxx>
#include <anchoredobject.hxx> #include <anchoredobject.hxx>
...@@ -315,6 +317,12 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT ...@@ -315,6 +317,12 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
m_pSerializer->startElementNS( XML_w, XML_pict, FSEND ); m_pSerializer->startElementNS( XML_w, XML_pict, FSEND );
m_pSerializer->startElementNS( XML_v, XML_rect, xFlyAttrList ); m_pSerializer->startElementNS( XML_v, XML_rect, xFlyAttrList );
lcl_TextFrameShadow(m_pSerializer, rFrmFmt); lcl_TextFrameShadow(m_pSerializer, rFrmFmt);
if (m_pFlyFillAttrList)
{
XFastAttributeListRef xFlyFillAttrList(m_pFlyFillAttrList);
m_pFlyFillAttrList = NULL;
m_pSerializer->singleElementNS(XML_v, XML_fill, xFlyFillAttrList);
}
m_pSerializer->startElementNS( XML_v, XML_textbox, FSEND ); m_pSerializer->startElementNS( XML_v, XML_textbox, FSEND );
m_pSerializer->startElementNS( XML_w, XML_txbxContent, FSEND ); m_pSerializer->startElementNS( XML_w, XML_txbxContent, FSEND );
m_rExport.WriteText( ); m_rExport.WriteText( );
...@@ -4547,12 +4555,37 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) ...@@ -4547,12 +4555,37 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
} }
} }
void DocxAttributeOutput::FormatFillStyle( const XFillStyleItem& /*rFillStyle*/ ) void DocxAttributeOutput::FormatFillStyle( const XFillStyleItem& rFillStyle )
{ {
m_oFillStyle.reset(rFillStyle.GetValue());
} }
void DocxAttributeOutput::FormatFillGradient( const XFillGradientItem& /*rFillGradient*/ ) void DocxAttributeOutput::FormatFillGradient( const XFillGradientItem& rFillGradient )
{ {
if (*m_oFillStyle == XFILL_GRADIENT)
{
m_pFlyFillAttrList = m_pSerializer->createAttrList();
m_pFlyFillAttrList->add(XML_type, "gradient");
const XGradient& rGradient = rFillGradient.GetGradientValue();
OString sStartColor = impl_ConvertColor(rGradient.GetStartColor());
m_pFlyFillAttrList->add(XML_color2, "#" + sStartColor);
OString sEndColor = impl_ConvertColor(rGradient.GetEndColor());
m_pFlyAttrList->add(XML_fillcolor, "#" + sEndColor);
switch (rGradient.GetGradientStyle())
{
case XGRAD_LINEAR: break;
case XGRAD_AXIAL:
m_pFlyFillAttrList->add(XML_focus, "50%");
break;
case XGRAD_RADIAL: break;
case XGRAD_ELLIPTICAL: break;
case XGRAD_SQUARE: break;
case XGRAD_RECT: break;
}
}
m_oFillStyle.reset();
} }
void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox ) void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
...@@ -4743,6 +4776,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri ...@@ -4743,6 +4776,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_pParagraphSpacingAttrList( NULL ), m_pParagraphSpacingAttrList( NULL ),
m_pHyperlinkAttrList( NULL ), m_pHyperlinkAttrList( NULL ),
m_pFlyAttrList( NULL ), m_pFlyAttrList( NULL ),
m_pFlyFillAttrList( NULL ),
m_pFootnotesList( new ::docx::FootnotesList() ), m_pFootnotesList( new ::docx::FootnotesList() ),
m_pEndnotesList( new ::docx::FootnotesList() ), m_pEndnotesList( new ::docx::FootnotesList() ),
m_footnoteEndnoteRefTag( 0 ), m_footnoteEndnoteRefTag( 0 ),
......
...@@ -28,11 +28,13 @@ ...@@ -28,11 +28,13 @@
#include <sax/fshelper.hxx> #include <sax/fshelper.hxx>
#include <sax/fastattribs.hxx> #include <sax/fastattribs.hxx>
#include <vcl/vclenum.hxx> #include <vcl/vclenum.hxx>
#include <svx/xenum.hxx>
#include <fldbas.hxx> #include <fldbas.hxx>
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/optional.hpp>
#include <oox/export/vmlexport.hxx> #include <oox/export/vmlexport.hxx>
class SwGrfNode; class SwGrfNode;
...@@ -558,6 +560,7 @@ private: ...@@ -558,6 +560,7 @@ private:
::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList; ::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList;
::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList; ::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
::sax_fastparser::FastAttributeList *m_pFlyAttrList; ::sax_fastparser::FastAttributeList *m_pFlyAttrList;
::sax_fastparser::FastAttributeList *m_pFlyFillAttrList;
::docx::FootnotesList *m_pFootnotesList; ::docx::FootnotesList *m_pFootnotesList;
::docx::FootnotesList *m_pEndnotesList; ::docx::FootnotesList *m_pEndnotesList;
...@@ -630,6 +633,8 @@ private: ...@@ -630,6 +633,8 @@ private:
// Remember first cell (used for for default borders/margins) of each table // Remember first cell (used for for default borders/margins) of each table
std::vector<ww8::WW8TableNodeInfoInner::Pointer_t> tableFirstCells; std::vector<ww8::WW8TableNodeInfoInner::Pointer_t> tableFirstCells;
boost::optional<XFillStyle> m_oFillStyle;
public: public:
DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML ); DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );
......
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