[ooo-build-commit] .: sw/source sw/util

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Sep 15 23:51:58 PDT 2010


 sw/source/filter/ww8/WW8TableInfo.hxx        |    1 
 sw/source/filter/ww8/docxattributeoutput.cxx |   14 ++++++-------
 sw/source/filter/ww8/docxattributeoutput.hxx |    2 +
 sw/source/filter/ww8/docxexport.cxx          |   29 ++++++++++++++++++---------
 sw/source/filter/ww8/docxexport.hxx          |    5 ++--
 sw/source/filter/ww8/docxexportfilter.cxx    |    4 +--
 sw/source/filter/ww8/docxexportfilter.hxx    |    4 +--
 sw/source/filter/ww8/makefile.mk             |    4 +++
 sw/source/filter/ww8/wrtw8sty.cxx            |    4 ---
 sw/source/filter/ww8/wrtww8.hxx              |    4 ---
 sw/util/makefile.mk                          |    2 +
 11 files changed, 43 insertions(+), 30 deletions(-)

New commits:
commit cb10813a235b032ec1a60aae1421c3231b27a2ed
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Sep 16 06:58:03 2010 +0200

    docx-export-enable.diff: Enable the .docx export.

diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index 3f74d4a..d8544e7 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -30,6 +30,7 @@
 #include <hash_map>
 #include <string>
 #include <map>
+#include <set>
 #include <functional>
 #include <boost/shared_ptr.hpp>
 #include <sal/types.h>
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 291a6a7..4637f0d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -453,7 +453,7 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, sal_Bool bWriteRu
     if ( rInfos.pField && rInfos.eType == ww::eUNKNOWN )
     {
         // Expand unsupported fields
-        RunText( rInfos.pField->Expand( ) );
+        RunText( rInfos.pField->GetCntnt() );
     }
     else if ( rInfos.eType != ww::eNONE ) // HYPERLINK fields are just commands
     {
@@ -558,7 +558,7 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
         m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
 
         // Find another way for hyperlinks
-        RunText( rInfos.pField->Expand( ) );
+        RunText( rInfos.pField->GetCntnt() );
         m_pSerializer->endElementNS( XML_w, XML_r );
     }
 
@@ -1125,7 +1125,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
     TableBackgrounds( pTableTextNodeInfoInner );
 
     // Cell prefered width
-    SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )[ pTableTextNodeInfoInner->getCell() ];
+    SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() );
     m_pSerializer->singleElementNS( XML_w, XML_tcW, 
            FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nWidth ) ).getStr( ),
            FSNS( XML_w, XML_type ), "dxa",
@@ -1166,7 +1166,7 @@ void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t
     bool bRelBoxSize = false;
 
     // Create the SwWriteTable instance to use col spans (and maybe other infos)
-    GetTablePageSize( pTableTextNodeInfoInner, nPageSize, bRelBoxSize );
+    GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize );
     
     const SwTable* pTable = pTableTextNodeInfoInner->getTable( );
     const SwFrmFmt *pFmt = pTable->GetFrmFmt( );
@@ -1266,7 +1266,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
     bool bRelBoxSize = false;
     
     // Create the SwWriteTable instance to use col spans (and maybe other infos)
-    GetTablePageSize( pTableTextNodeInfoInner, nPageSize, bRelBoxSize );
+    GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize );
     
     // Output the table prefered width
     if ( nPageSize != 0 )
@@ -1318,8 +1318,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
     // Write the table grid infos
     m_pSerializer->startElementNS( XML_w, XML_tblGrid, FSEND );
     
-    std::vector<SwTwips> gridCols = GetGridCols( pTableTextNodeInfoInner );
-    for ( std::vector<SwTwips>::const_iterator it = gridCols.begin(); it != gridCols.end(); ++it )
+    ww8::GridColsPtr pGridCols = GetGridCols( pTableTextNodeInfoInner );
+    for ( ww8::GridCols::const_iterator it = pGridCols->begin(); it != pGridCols->end(); ++it )
         m_pSerializer->singleElementNS( XML_w, XML_gridCol,
                FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( *it ) ).getStr( ),
                FSEND );
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index e1edbd6..2e94069 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -160,6 +160,8 @@ public:
 
     virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
 
+    virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
     virtual void TableRowEnd( sal_uInt32 nDepth = 1 );
 
     /// Start of the styles table.
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 8752ff2..07e2b54 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -312,7 +312,7 @@ bool DocxExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt )
 }
 
 void DocxExport::WriteHeadersFooters( BYTE nHeadFootFlags,
-        const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt )
+        const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE /*nBreakCode*/ )
 {
     // headers
     if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN )
@@ -333,6 +333,10 @@ void DocxExport::WriteHeadersFooters( BYTE nHeadFootFlags,
 
     if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST )
         WriteHeaderFooter( rFirstPageFmt, false, "first" );
+
+#if OSL_DEBUG_LEVEL > 0
+    fprintf( stderr, "DocxExport::WriteHeadersFooters() - nBreakCode introduced, but ignored\n" );
+#endif
 }
 
 void DocxExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, BYTE nMode )
@@ -345,6 +349,13 @@ void DocxExport::WriteFormData( const ::sw::mark::IFieldmark& /*rFieldmark*/ )
     OSL_TRACE( "TODO DocxExport::WriteFormData()\n" );
 }
 
+void DocxExport::WriteHyperlinkData( const ::sw::mark::IFieldmark& /*rFieldmark*/ )
+{
+#if OSL_DEBUG_LEVEL > 0
+    fprintf( stderr, "TODO DocxExport::WriteHyperlinkData()\n" );
+#endif
+}
+
 void DocxExport::DoComboBox(const rtl::OUString& rName,
                              const rtl::OUString& rHelp,
                              const rtl::OUString& rToolTip,
@@ -528,7 +539,7 @@ void DocxExport::InitStyles()
             S( "styles.xml" ) );
 
     ::sax_fastparser::FSHelperPtr pStylesFS =
-        m_pFilter->openOutputStreamWithSerializer( S( "word/styles.xml" ),
+        m_pFilter->openFragmentStreamWithSerializer( S( "word/styles.xml" ),
             S( "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" ) );
 
     // switch the serializer to redirect the output to word/styles.xml
@@ -551,7 +562,7 @@ void DocxExport::WriteFootnotesEndnotes()
                 S( "footnotes.xml" ) );
 
         ::sax_fastparser::FSHelperPtr pFootnotesFS =
-            m_pFilter->openOutputStreamWithSerializer( S( "word/footnotes.xml" ),
+            m_pFilter->openFragmentStreamWithSerializer( S( "word/footnotes.xml" ),
                     S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" ) );
 
         // switch the serializer to redirect the output to word/footnotes.xml
@@ -572,7 +583,7 @@ void DocxExport::WriteFootnotesEndnotes()
                 S( "endnotes.xml" ) );
 
         ::sax_fastparser::FSHelperPtr pEndnotesFS =
-            m_pFilter->openOutputStreamWithSerializer( S( "word/endnotes.xml" ),
+            m_pFilter->openFragmentStreamWithSerializer( S( "word/endnotes.xml" ),
                     S( "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" ) );
 
         // switch the serializer to redirect the output to word/endnotes.xml
@@ -595,7 +606,7 @@ void DocxExport::WriteNumbering()
         S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" ),
         S( "numbering.xml" ) );
 
-    ::sax_fastparser::FSHelperPtr pNumberingFS = m_pFilter->openOutputStreamWithSerializer( S( "word/numbering.xml" ),
+    ::sax_fastparser::FSHelperPtr pNumberingFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/numbering.xml" ),
         S( "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" ) );
 
     // switch the serializer to redirect the output to word/nubering.xml
@@ -628,7 +639,7 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char*
                 S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" ),
                 aName );
         
-        pFS = m_pFilter->openOutputStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(),
+        pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(),
                     S( "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" ) );
 
         pFS->startElementNS( XML_w, XML_hdr,
@@ -643,7 +654,7 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char*
                 S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" ),
                 aName );
         
-        pFS = m_pFilter->openOutputStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(),
+        pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(),
                     S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" ) );
 
         pFS->startElementNS( XML_w, XML_ftr,
@@ -686,7 +697,7 @@ void DocxExport::WriteFonts()
             S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" ),
             S( "fontTable.xml" ) );
 
-    ::sax_fastparser::FSHelperPtr pFS = m_pFilter->openOutputStreamWithSerializer(
+    ::sax_fastparser::FSHelperPtr pFS = m_pFilter->openFragmentStreamWithSerializer(
             S( "word/fontTable.xml" ),
             S( "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" ) );
 
@@ -774,7 +785,7 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur
             S( "word/document.xml" ) );
 
     // the actual document
-    m_pDocumentFS = m_pFilter->openOutputStreamWithSerializer( S( "word/document.xml" ),
+    m_pDocumentFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/document.xml" ),
             S( "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ) );
 
     // the DrawingML access
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 06d39a6..5873f95 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -113,7 +113,7 @@ public:
 
     /// Output the actual headers and footers.
     virtual void WriteHeadersFooters( BYTE nHeadFootFlags,
-            const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt );
+            const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE nBreakCode );
 
     /// Write the field
     virtual void OutputField( const SwField* pFld, ww::eField eFldType,
@@ -121,6 +121,7 @@ public:
 
     /// Write the data of the form field
     virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
+    virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark );
     
     virtual void DoComboBox(const rtl::OUString &rName,
                     const rtl::OUString &rHelp,
@@ -154,7 +155,7 @@ protected:
 
     virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum );
 
-    virtual void SectionBreaksAndFrames( const SwTxtNode& rNode ) {}
+    virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {}
 
     /// Get ready for a new section.
     virtual void PrepareNewPageDesc( const SfxItemSet* pSet,
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index 3d7d44f..7004f08 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -47,7 +47,7 @@ DocxExportFilter::DocxExportFilter( const uno::Reference< lang::XMultiServiceFac
 
 bool DocxExportFilter::exportDocument()
 {
-    OSL_TRACE(, "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me
+    OSL_TRACE( "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me
 
     // get SwDoc*
     uno::Reference< uno::XInterface > xIfc( getModel(), uno::UNO_QUERY );
@@ -76,7 +76,7 @@ bool DocxExportFilter::exportDocument()
         aExport.ExportDocument( true ); // FIXME support exporting selection only
     }
 
-    commit();
+    commitStorage();
 
     // delete the pCurPam
     if ( pCurPam )
diff --git a/sw/source/filter/ww8/docxexportfilter.hxx b/sw/source/filter/ww8/docxexportfilter.hxx
index e1d0b3d..cf5d5e2 100644
--- a/sw/source/filter/ww8/docxexportfilter.hxx
+++ b/sw/source/filter/ww8/docxexportfilter.hxx
@@ -30,7 +30,7 @@
 
 #include <oox/core/xmlfilterbase.hxx>
 #include <oox/drawingml/chart/chartconverter.hxx>
-#include <oox/vml/drawing.hxx>
+#include <oox/vml/vmldrawing.hxx>
 
 #include <com/sun/star/beans/PropertyValue.hpp>
 
@@ -45,7 +45,7 @@ public:
     virtual bool        importDocument() { return false; }
     virtual const ::oox::drawingml::Theme* getCurrentTheme() const { return NULL; }
     virtual sal_Int32   getSchemeClr( sal_Int32 ) const { return 0; }
-    virtual const ::oox::vml::DrawingPtr getDrawings() { return ::oox::vml::DrawingPtr(); }
+    virtual ::oox::vml::Drawing* getVmlDrawing() { return NULL; }
     virtual ::oox::drawingml::chart::ChartConverter& getChartConverter() { static ::oox::drawingml::chart::ChartConverter aConverter; return aConverter; }
     virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() { return ::oox::drawingml::table::TableStyleListPtr(); }
 
diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk
index b25887e..653c36f 100644
--- a/sw/source/filter/ww8/makefile.mk
+++ b/sw/source/filter/ww8/makefile.mk
@@ -58,6 +58,7 @@ EXCEPTIONSFILES = \
         $(SLO)$/wrtw8num.obj \
         $(SLO)$/wrtw8sty.obj \
         $(SLO)$/wrtww8.obj \
+        $(SLO)$/docxexportfilter.obj \
         $(SLO)$/ww8atr.obj \
         $(SLO)$/ww8par.obj \
         $(SLO)$/ww8par6.obj \
@@ -77,6 +78,9 @@ SLOFILES =	\
         $(SLO)$/wrtw8sty.obj \
         $(SLO)$/wrtww8.obj \
         $(SLO)$/wrtww8gr.obj \
+        $(SLO)$/docxattributeoutput.obj \
+        $(SLO)$/docxexportfilter.obj \
+        $(SLO)$/docxexport.obj \
         $(SLO)$/ww8atr.obj \
         $(SLO)$/ww8graf.obj \
         $(SLO)$/ww8graf2.obj \
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 651c09e..42b829a 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -696,7 +696,6 @@ bool wwFont::Write(SvStream *pTableStrm) const
     return true;
 }
 
-#ifdef DOCX
 void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const
 {
     // no font embedding, panose id, subsetting, ... implemented
@@ -711,7 +710,6 @@ void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const
 
     rAttrOutput->EndFont();
 }
-#endif
 
 bool operator<(const wwFont &r1, const wwFont &r2)
 {
@@ -829,7 +827,6 @@ void wwFontHelper::WriteFontTable(SvStream *pTableStream, WW8Fib& rFib)
     }
 }
 
-#ifdef DOCX
 void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput )
 {
     ::std::vector<const wwFont *> aFontList( AsVector() );
@@ -837,7 +834,6 @@ void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput )
     ::std::for_each( aFontList.begin(), aFontList.end(),
         ::std::bind2nd( ::std::mem_fun( &wwFont::WriteDocx ), &rAttrOutput ) );
 }
-#endif
 
 /*  */
 
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 43211a9..d73ebae 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -293,9 +293,7 @@ public:
     wwFont( const String &rFamilyName, FontPitch ePitch, FontFamily eFamily,
         rtl_TextEncoding eChrSet, bool bWrtWW8 );
     bool Write( SvStream *pTableStram ) const;
-#ifdef DOCX
     void WriteDocx( const DocxAttributeOutput* rAttrOutput ) const;
-#endif
     rtl::OUString GetFamilyName() const { return rtl::OUString( msFamilyNm ); }
     friend bool operator < (const wwFont &r1, const wwFont &r2);
 };
@@ -318,9 +316,7 @@ public:
     USHORT GetId(const SvxFontItem& rFont);
     USHORT GetId(const wwFont& rFont);
     void WriteFontTable( SvStream *pTableStream, WW8Fib& pFib );
-#ifdef DOCX
     void WriteFontTable( const DocxAttributeOutput& rAttrOutput );
-#endif
 };
 
 class DrawObj
diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk
index ce1419b..61b4a3e 100644
--- a/sw/util/makefile.mk
+++ b/sw/util/makefile.mk
@@ -315,6 +315,8 @@ DEF4NAME=$(SHL4TARGET)
 
 SHL4STDLIBS= \
     $(ISWLIB) \
+    $(OOXLIB) \
+    $(SAXLIB) \
     $(SVXCORELIB) \
        $(EDITENGLIB) \
     $(MSFILTERLIB) \


More information about the ooo-build-commit mailing list