summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-10 15:55:13 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-10 17:50:07 +0100
commit4614af18d3e033e0eed27db3d4c897afb8c8baa1 (patch)
treec8a8d5d6e90acbdcae1a5d1b8af3cf64138d02b7 /sw
parent03f0128c15ef59bbcf193bcd85e1763111c29ad7 (diff)
DOCX shape export: when in experimental mode, use DML instead of VML
Change-Id: I8a07b74c047dfa2c4b1096e3cd3ace3bd5f93d0a
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx47
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx8
2 files changed, 45 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8e336511e3b1..b546b37ed426 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -110,6 +110,7 @@
#include <osl/file.hxx>
#include <rtl/tencinfo.h>
#include <vcl/embeddedfontshelper.hxx>
+#include <svtools/miscopt.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -1058,7 +1059,10 @@ void DocxAttributeOutput::StartRunProperties()
m_postponedDiagram = new std::list< PostponedDiagram >;
OSL_ASSERT( m_postponedVMLDrawing == NULL );
- m_postponedVMLDrawing = new std::list< PostponedVMLDrawing >;
+ m_postponedVMLDrawing = new std::list< PostponedDrawing >;
+
+ assert(!m_postponedDMLDrawing);
+ m_postponedDMLDrawing = new std::list< PostponedDrawing >;
}
void DocxAttributeOutput::InitCollectedRunProperties()
@@ -1178,6 +1182,7 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData )
//We need to write w:pict tag after the w:rPr.
WritePostponedVMLDrawing();
+ WritePostponedDMLDrawing();
// merge the properties _before_ the run text (strictly speaking, just
// after the start of the run)
@@ -3316,7 +3321,7 @@ void DocxAttributeOutput::WritePostponedVMLDrawing()
if(m_postponedVMLDrawing == NULL)
return;
- for( std::list< PostponedVMLDrawing >::iterator it = m_postponedVMLDrawing->begin();
+ for( std::list< PostponedDrawing >::iterator it = m_postponedVMLDrawing->begin();
it != m_postponedVMLDrawing->end();
++it )
{
@@ -3326,6 +3331,21 @@ void DocxAttributeOutput::WritePostponedVMLDrawing()
m_postponedVMLDrawing = NULL;
}
+void DocxAttributeOutput::WritePostponedDMLDrawing()
+{
+ if(m_postponedDMLDrawing == NULL)
+ return;
+
+ for( std::list< PostponedDrawing >::iterator it = m_postponedDMLDrawing->begin();
+ it != m_postponedDMLDrawing->end();
+ ++it )
+ {
+ WriteDMLDrawing(it->object, it->frame);
+ }
+ delete m_postponedDMLDrawing;
+ m_postponedDMLDrawing = NULL;
+}
+
void DocxAttributeOutput::WriteDMLDrawing( const SdrObject* pSdrObject, const SwFrmFmt* pFrmFmt )
{
Size aSize(pSdrObject->GetSnapRect().GetWidth(), pSdrObject->GetSnapRect().GetHeight());
@@ -3422,11 +3442,23 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
}
else
{
- if ( m_postponedVMLDrawing == NULL )
- WriteVMLDrawing( pSdrObj, rFrame.GetFrmFmt(), rNdTopLeft);
- else // we are writing out attributes, but w:pict should not be inside w:rPr,
- { // so write it out later
- m_postponedVMLDrawing->push_back( PostponedVMLDrawing( pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft ) );
+ SvtMiscOptions aMiscOptions;
+ if (aMiscOptions.IsExperimentalMode())
+ {
+ if ( m_postponedDMLDrawing == NULL )
+ WriteDMLDrawing( pSdrObj, &rFrame.GetFrmFmt());
+ else
+ // we are writing out attributes, but w:drawing should not be inside w:rPr, so write it out later
+ m_postponedDMLDrawing->push_back(PostponedDrawing(pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft));
+ }
+ else
+ {
+ if ( m_postponedVMLDrawing == NULL )
+ WriteVMLDrawing( pSdrObj, rFrame.GetFrmFmt(), rNdTopLeft);
+ else // we are writing out attributes, but w:pict should not be inside w:rPr,
+ { // so write it out later
+ m_postponedVMLDrawing->push_back( PostponedDrawing( pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft ) );
+ }
}
}
}
@@ -6406,6 +6438,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_postponedGraphic( NULL ),
m_postponedDiagram( NULL ),
m_postponedVMLDrawing(NULL),
+ m_postponedDMLDrawing(NULL),
m_postponedMath( NULL ),
m_postponedChart( NULL ),
pendingPlaceholder( NULL ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 4326cde1d40c..bac7c8adad14 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -646,6 +646,7 @@ private:
void WritePostponedDiagram();
void WritePostponedChart();
void WritePostponedVMLDrawing();
+ void WritePostponedDMLDrawing();
void WriteCommentRanges();
void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = sal_False );
@@ -747,14 +748,15 @@ private:
};
std::list< PostponedDiagram >* m_postponedDiagram;
- struct PostponedVMLDrawing
+ struct PostponedDrawing
{
- PostponedVMLDrawing( const SdrObject* sdrObj, const SwFrmFmt* frm, const Point* pt ) : object( sdrObj ), frame( frm ), point( pt ) {};
+ PostponedDrawing( const SdrObject* sdrObj, const SwFrmFmt* frm, const Point* pt ) : object( sdrObj ), frame( frm ), point( pt ) {};
const SdrObject* object;
const SwFrmFmt* frame;
const Point* point;
};
- std::list< PostponedVMLDrawing >* m_postponedVMLDrawing;
+ std::list< PostponedDrawing >* m_postponedVMLDrawing;
+ std::list< PostponedDrawing >* m_postponedDMLDrawing;
const SwOLENode* m_postponedMath;
const SdrObject* m_postponedChart;