Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.cxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.cxx Fri Feb 28 04:44:42 2014 @@ -381,7 +381,7 @@ void DocxAttributeOutput::EndRun() } DoWriteBookmarks( ); - WriteCommentRanges(); + //WriteCommentRanges(); // clarence_guo: because this method contained semi code of m_postitFieldsMaxId, temporarily comment it. m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND ); // merges with "postponed run start", see above @@ -408,6 +408,7 @@ void DocxAttributeOutput::EndRun() EndRedline(); } +/* clarence_guo: because this method contained semi code of m_postitFieldsMaxId, temporarily comment it. void DocxAttributeOutput::WriteCommentRanges() { if (m_bPostitStart) @@ -423,6 +424,7 @@ void DocxAttributeOutput::WriteCommentRa m_pSerializer->singleElementNS( XML_w, XML_commentRangeEnd, FSNS( XML_w, XML_id ), idstr.getStr(), FSEND ); } } +*/ void DocxAttributeOutput::WritePostitFieldStart() { @@ -434,7 +436,6 @@ void DocxAttributeOutput::WritePostitFie m_bPostitEnd = true; } - void DocxAttributeOutput::DoWriteBookmarks() { // Write the start bookmarks @@ -478,7 +479,7 @@ void DocxAttributeOutput::StartField_Imp if ( rInfos.pField && rInfos.eType == ww::eUNKNOWN ) { // Expand unsupported fields - RunText( rInfos.pField->Expand( ) ); + RunText( rInfos.pField->GetFieldName() ); } else if ( rInfos.eType != ww::eNONE ) // HYPERLINK fields are just commands { @@ -583,7 +584,7 @@ void DocxAttributeOutput::EndField_Impl( m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); // Find another way for hyperlinks - RunText( rInfos.pField->Expand( ) ); + RunText( rInfos.pField->GetFieldName() ); m_pSerializer->endElementNS( XML_w, XML_r ); } @@ -1150,7 +1151,7 @@ void DocxAttributeOutput::TableCellPrope 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", @@ -1191,7 +1192,7 @@ void DocxAttributeOutput::InitTableHelpe 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( ); @@ -1291,7 +1292,7 @@ void DocxAttributeOutput::TableDefinitio 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 ) @@ -1343,8 +1344,8 @@ void DocxAttributeOutput::TableDefinitio // 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(), end = pGridCols->end(); it != end; ++it ) m_pSerializer->singleElementNS( XML_w, XML_gridCol, FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( *it ) ).getStr( ), FSEND ); @@ -2114,7 +2115,8 @@ void DocxAttributeOutput::NumberingLevel sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 /*nListTabPos*/, - const String &rNumberingString ) + const String &rNumberingString , + const SvxBrushItem* pBrush ) { m_pSerializer->startElementNS( XML_w, XML_lvl, FSNS( XML_w, XML_ilvl ), OString::valueOf( sal_Int32( nLevel ) ).getStr(), @@ -2209,7 +2211,7 @@ void DocxAttributeOutput::NumberingLevel FSNS( XML_w, XML_hint ), "default", FSEND ); } - m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN ); + m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF ); m_pSerializer->endElementNS( XML_w, XML_rPr ); } @@ -2461,6 +2463,14 @@ void DocxAttributeOutput::CharWeightCTL( m_pSerializer->singleElementNS( XML_w, XML_bCs, FSNS( XML_w, XML_val ), "off", FSEND ); } +void DocxAttributeOutput::CharBidiRTL( const SfxPoolItem& ) +{ +} + +void DocxAttributeOutput::CharIdctHint( const SfxPoolItem& ) +{ +} + void DocxAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate) { if ( !rRotate.GetValue() )
Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.hxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.hxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/docxattributeoutput.hxx Fri Feb 28 04:44:42 2014 @@ -19,8 +19,6 @@ * *************************************************************/ - - #ifndef _DOCXATTRIBUTEOUTPUT_HXX_ #define _DOCXATTRIBUTEOUTPUT_HXX_ @@ -160,6 +158,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. @@ -263,7 +263,8 @@ public: sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, - const String &rNumberingString ); + const String &rNumberingString , + const SvxBrushItem* pBrush = 0); void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode ); @@ -401,6 +402,12 @@ protected: /// Sfx item RES_CHRATR_CTL_WEIGHT virtual void CharWeightCTL( const SvxWeightItem& rWeight ); + /// Sfx item RES_CHRATR_BidiRTL + virtual void CharBidiRTL( const SfxPoolItem& ); + + /// Sfx item RES_CHRATR_IdctHint + virtual void CharIdctHint( const SfxPoolItem& ); + /// Sfx item RES_CHRATR_ROTATE virtual void CharRotate( const SvxCharRotateItem& rRotate ); @@ -529,7 +536,7 @@ protected: private: void DoWriteBookmarks( ); - void WriteCommentRanges(); + //void WriteCommentRanges(); // clarence_guo: because this method contained semi code of m_postitFieldsMaxId, temporarily comment it. void StartField_Impl( FieldInfos& rInfos, sal_Bool bWriteRun = sal_False ); void DoWriteCmd( String& rCmd ); Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.cxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.cxx Fri Feb 28 04:44:42 2014 @@ -19,10 +19,9 @@ * *************************************************************/ - - #include "docxexport.hxx" #include "docxexportfilter.hxx" +#include "docxattributeoutput.hxx" #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> @@ -151,10 +150,15 @@ void DocxExport::AppendBookmark( const O m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds ); } +void DocxExport::ExportGrfBullet( const SwTxtNode & ) +{ + OSL_TRACE( "TODO DocxExport::ExportGrfBullet()\n" ); +} + ::rtl::OString DocxExport::AddRelation( const OUString& rType, const OUString& rTarget, const OUString& rMode ) { OUString sId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - rType, rTarget, rMode ); + rType, rTarget, true ); return ::rtl::OUStringToOString( sId, RTL_TEXTENCODING_UTF8 ); } @@ -184,7 +188,7 @@ bool DocxExport::DisallowInheritingOutli } void DocxExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags, - const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt ) + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, sal_uInt8 /*nBreakCode*/ ) { // headers if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN ) @@ -217,6 +221,11 @@ void DocxExport::WriteFormData( const :: OSL_TRACE( "TODO DocxExport::WriteFormData()\n" ); } +void DocxExport::WriteHyperlinkData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) +{ + OSL_TRACE( "TODO DocxExport::WriteHyperlinkData()\n" ); +} + void DocxExport::DoComboBox(const rtl::OUString& rName, const rtl::OUString& rHelp, const rtl::OUString& rToolTip, @@ -326,7 +335,7 @@ void DocxExport::OutputEndNode( const Sw if ( rNd.IsEndNode() && rNd.StartOfSectionNode()->IsSectionNode() ) return; - if ( !rNd.IsSectionNode() && !bIsInTable ) // No sections in table + if ( !rNd.IsSectionNode() && !IsInTable() ) // No sections in table { const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent(); if( !pParentFmt ) @@ -400,7 +409,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 @@ -423,7 +432,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 @@ -444,7 +453,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 @@ -467,7 +476,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 @@ -500,7 +509,7 @@ void DocxExport::WriteHeaderFooter( cons 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, @@ -515,7 +524,7 @@ void DocxExport::WriteHeaderFooter( cons 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, @@ -558,7 +567,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" ) ); @@ -646,7 +655,7 @@ DocxExport::DocxExport( DocxExportFilter 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 Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.hxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.hxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexport.hxx Fri Feb 28 04:44:42 2014 @@ -19,8 +19,6 @@ * *************************************************************/ - - #ifndef _DOCXEXPORT_HXX_ #define _DOCXEXPORT_HXX_ @@ -93,6 +91,8 @@ public: virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ); + virtual void ExportGrfBullet( const SwTxtNode & ); + /// Returns the relationd id rtl::OString AddRelation( const rtl::OUString& rType, const rtl::OUString& rTarget, const rtl::OUString& rMode ); @@ -104,7 +104,7 @@ public: /// Output the actual headers and footers. virtual void WriteHeadersFooters( sal_uInt8 nHeadFootFlags, - const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt ); + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, sal_uInt8 nBreakCode ); /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, @@ -112,7 +112,8 @@ 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, const rtl::OUString &ToolTip, Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.cxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.cxx Fri Feb 28 04:44:42 2014 @@ -19,8 +19,6 @@ * *************************************************************/ - - #include "docxexportfilter.hxx" #include "rtfexportfilter.hxx" #include "rtfimportfilter.hxx" @@ -35,17 +33,18 @@ using namespace ::comphelper; using namespace ::com::sun::star; using ::rtl::OUString; +using ::com::sun::star::lang::XComponent; #define S( x ) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) -DocxExportFilter::DocxExportFilter( const uno::Reference< lang::XMultiServiceFactory >& rMSF ) - : oox::core::XmlFilterBase( rMSF ) +DocxExportFilter::DocxExportFilter( const uno::Reference< uno::XComponentContext >& xCtx ) + : oox::core::XmlFilterBase( xCtx ) { } 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 ); @@ -74,7 +73,7 @@ bool DocxExportFilter::exportDocument() aExport.ExportDocument( true ); // FIXME support exporting selection only } - commit(); + commitStorage(); // delete the pCurPam if ( pCurPam ) @@ -91,28 +90,43 @@ bool DocxExportFilter::exportDocument() // UNO stuff so that the filter is registered ////////////////////////////////////////////////////////////////////////// -#define IMPL_NAME "com.sun.star.comp.Writer.DocxExport" +#define IMPL_NAME "com.sun.star.comp.writer.OOXMLExporter" -OUString DocxExport_getImplementationName() +OUString SwOOXMLExport_getImplementationName() { return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME ) ); } OUString DocxExportFilter::implGetImplementationName() const { - return DocxExport_getImplementationName(); + return SwOOXMLExport_getImplementationName(); } -uno::Sequence< OUString > SAL_CALL DocxExport_getSupportedServiceNames() throw() +uno::Sequence< OUString > SAL_CALL SwOOXMLExport_getSupportedServiceNames() throw() { const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) ); const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } -uno::Reference< uno::XInterface > SAL_CALL DocxExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +uno::Reference< uno::XInterface > SAL_CALL SwOOXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) { - return (cppu::OWeakObject*) new DocxExportFilter( rSMgr ); + uno::Reference< uno::XInterface > xRet; + uno::Reference< uno::XComponentContext > xCtx; + uno::Reference< beans::XPropertySet > const xProps( rSMgr, uno::UNO_QUERY ); + if ( xProps.is() ) + { + try + { + xCtx.set( xProps->getPropertyValue( rtl::OUString::createFromAscii( "DefaultContext" ) ), uno::UNO_QUERY ); + } + catch ( beans::UnknownPropertyException & e ) + { + } + } + if ( xCtx.is() ) + xRet.set( (cppu::OWeakObject*) new DocxExportFilter( xCtx ) ); + return xRet; } #ifdef __cplusplus @@ -125,6 +139,30 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL compo *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) +{ + sal_Bool bRet = sal_False; + + if( pRegistryKey ) + { + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + OUString::createFromAscii( "com.sun.star.comp.writer.OOXMLExporter/UNO/SERVICES/" ) ) ); + xNewKey1->createKey( SwOOXMLExport_getSupportedServiceNames().getConstArray()[0] ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + } + } + + return bRet; +} + // ------------------------ // - component_getFactory - // ------------------------ @@ -141,9 +179,9 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL comp xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), - DocxExport_getImplementationName(), - DocxExport_createInstance, - DocxExport_getSupportedServiceNames() ) ); + SwOOXMLExport_getImplementationName(), + SwOOXMLExport_createInstance, + SwOOXMLExport_getSupportedServiceNames() ) ); } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) { const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) ); Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.hxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.hxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/docxexportfilter.hxx Fri Feb 28 04:44:42 2014 @@ -19,29 +19,28 @@ * *************************************************************/ - - #ifndef _DOCXEXPORTFILTER_HXX_ #define _DOCXEXPORTFILTER_HXX_ #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> +#include <com/sun/star/uno/XComponentContext.hpp> /// The physical access to the DOCX document (for writing). class DocxExportFilter : public oox::core::XmlFilterBase { public: - DocxExportFilter( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rMSF ); + DocxExportFilter( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xCtx ); // FIXME these should not even exist for the export-only filter! // For now, let's just do empty implementations of those. 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(); } @@ -52,6 +51,11 @@ private: /// Implementatio of the filter abstract method. virtual ::rtl::OUString implGetImplementationName() const; + + virtual ::oox::ole::VbaProject* implCreateVbaProject() const + { + return NULL; + } }; #endif // _DOCXEXPORTFILTER_HXX_ Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/rtfexportfilter.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/rtfexportfilter.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/rtfexportfilter.cxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/rtfexportfilter.cxx Fri Feb 28 04:44:42 2014 @@ -128,56 +128,57 @@ uno::Reference< uno::XInterface > SAL_CA { return (cppu::OWeakObject*) new RtfExportFilter( rSMgr ); } -#ifdef __cplusplus -extern "C" -{ -#endif -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} +//#ifdef __cplusplus +//extern "C" +//{ +//#endif + +//SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) +//{ +// *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +//} // ------------------------ // - component_getFactory - // ------------------------ -SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) -{ - OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName); - uno::Reference< lang::XSingleServiceFactory > xFactory; - void* pRet = 0; - - if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) { - const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) ); - - xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( - reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), - RtfExport_getImplementationName(), - RtfExport_createInstance, - RtfExport_getSupportedServiceNames() ) ); - } - else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) { - const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) ); - - xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( - reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), - RtfImport_getImplementationName(), - RtfImport_createInstance, - RtfImport_getSupportedServiceNames() ) ); - } - - if ( xFactory.is() ) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - - return pRet; -} - -#ifdef __cplusplus -} -#endif +//SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) +//{ +// OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName); +// uno::Reference< lang::XSingleServiceFactory > xFactory; +// void* pRet = 0; + +// if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) { +// const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) ); + +// xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( +// reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), +// RtfExport_getImplementationName(), +// RtfExport_createInstance, +// RtfExport_getSupportedServiceNames() ) ); +// } +// else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) { +// const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) ); + +// xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( +// reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), +// RtfImport_getImplementationName(), +// RtfImport_createInstance, +// RtfImport_getSupportedServiceNames() ) ); +// } + +// if ( xFactory.is() ) +// { +// xFactory->acquire(); +// pRet = xFactory.get(); +// } + +// return pRet; +//} + +//#ifdef __cplusplus +//} +//#endif /* vi:set shiftwidth=4 expandtab: */ Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtw8sty.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtw8sty.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtw8sty.cxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtw8sty.cxx Fri Feb 28 04:44:42 2014 @@ -695,7 +695,6 @@ bool wwFont::Write(SvStream *pTableStrm) return true; } -#ifdef DOCX void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const { // no font embedding, panose id, subsetting, ... implemented @@ -710,7 +709,6 @@ void wwFont::WriteDocx( const DocxAttrib rAttrOutput->EndFont(); } -#endif void wwFont::WriteRtf( const RtfAttributeOutput* rAttrOutput ) const { @@ -857,7 +855,6 @@ void wwFontHelper::WriteFontTable(SvStre } } -#ifdef DOCX void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput ) { ::std::vector<const wwFont *> aFontList( AsVector() ); @@ -865,7 +862,6 @@ void wwFontHelper::WriteFontTable( const ::std::for_each( aFontList.begin(), aFontList.end(), ::std::bind2nd( ::std::mem_fun( &wwFont::WriteDocx ), &rAttrOutput ) ); } -#endif void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput ) { Modified: openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtww8.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtww8.hxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtww8.hxx (original) +++ openoffice/branches/ooxml/main/sw/source/filter/ww8/wrtww8.hxx Fri Feb 28 04:44:42 2014 @@ -19,7 +19,6 @@ * *************************************************************/ - /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ #ifndef _WRTWW8_HXX @@ -305,9 +304,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 void WriteRtf( const RtfAttributeOutput* rAttrOutput ) const; rtl::OUString GetFamilyName() const { return rtl::OUString( msFamilyNm ); } friend bool operator < (const wwFont &r1, const wwFont &r2); @@ -331,9 +328,7 @@ public: sal_uInt16 GetId(const SvxFontItem& rFont); sal_uInt16 GetId(const wwFont& rFont); void WriteFontTable( SvStream *pTableStream, WW8Fib& pFib ); -#ifdef DOCX void WriteFontTable( const DocxAttributeOutput& rAttrOutput ); -#endif void WriteFontTable( const RtfAttributeOutput& rAttrOutput ); /// If true, all fonts are loaded before processing the document. @@ -727,7 +722,7 @@ public: /// Output the actual headers and footers. virtual void WriteHeadersFooters( sal_uInt8 nHeadFootFlags, const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, - sal_uInt8 nBreakCode) = 0; + sal_uInt8 nBreakCode ) = 0; /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, Modified: openoffice/branches/ooxml/main/sw/util/msword.component URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/sw/util/msword.component?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/sw/util/msword.component (original) +++ openoffice/branches/ooxml/main/sw/util/msword.component Fri Feb 28 04:44:42 2014 @@ -20,8 +20,6 @@ * ***********************************************************--> - - <component loader="com.sun.star.loader.SharedLibrary" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.Writer.RtfExport"> @@ -30,4 +28,7 @@ <implementation name="com.sun.star.comp.Writer.RtfImport"> <service name="com.sun.star.comp.Writer.RtfImport"/> </implementation> + <implementation name="com.sun.star.comp.writer.OOXMLExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> </component> Modified: openoffice/branches/ooxml/main/writerfilter/source/filter/ImportFilter.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/writerfilter/source/filter/ImportFilter.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/writerfilter/source/filter/ImportFilter.cxx (original) +++ openoffice/branches/ooxml/main/writerfilter/source/filter/ImportFilter.cxx Fri Feb 28 04:44:42 2014 @@ -19,8 +19,6 @@ * *************************************************************/ - - #include <osl/diagnose.h> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> @@ -47,21 +45,21 @@ using ::comphelper::MediaDescriptor; sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) throw (uno::RuntimeException) { - if( m_xSrcDoc.is() ) + if ( m_xSrcDoc.is() ) { - uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); - uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.DocxExport" ))), uno::UNO_QUERY_THROW); - if (!xIfc.is()) - return sal_False; - uno::Reference< document::XExporter > xExprtr(xIfc, uno::UNO_QUERY_THROW); - uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); - if (!xExprtr.is() || !xFltr.is()) - return sal_False; - xExprtr->setSourceDocument(m_xSrcDoc); + uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); + uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.writer.OOXMLExporter" ))), uno::UNO_QUERY_THROW); + if (!xIfc.is()) + return sal_False; + uno::Reference< document::XExporter > xExprtr(xIfc, uno::UNO_QUERY_THROW); + uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); + if (!xExprtr.is() || !xFltr.is()) + return sal_False; + xExprtr->setSourceDocument(m_xSrcDoc); return xFltr->filter(aDescriptor); - } - else if (m_xDstDoc.is()) - { + } + else if ( m_xDstDoc.is() ) + { MediaDescriptor aMediaDesc( aDescriptor ); OUString sFilterName = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_FILTERNAME(), OUString() ); @@ -84,56 +82,56 @@ sal_Bool WriterFilter::filter( const uno #ifdef DEBUG_IMPORT OUString sURL = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_URL(), OUString() ); ::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr(); - + writerfilter::TagLogger::Pointer_t debugLogger - (writerfilter::TagLogger::getInstance("DEBUG")); + (writerfilter::TagLogger::getInstance("DEBUG")); debugLogger->setFileName(sURLc); debugLogger->startDocument(); - + writerfilter::TagLogger::Pointer_t dmapperLogger - (writerfilter::TagLogger::getInstance("DOMAINMAPPER")); + (writerfilter::TagLogger::getInstance("DOMAINMAPPER")); dmapperLogger->setFileName(sURLc); dmapperLogger->startDocument(); #endif - writerfilter::dmapper::SourceDocumentType eType = - (m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007" ) ) || - m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007_Template" ) )) ? - writerfilter::dmapper::DOCUMENT_OOXML : writerfilter::dmapper::DOCUMENT_DOC; - writerfilter::Stream::Pointer_t pStream(new writerfilter::dmapper::DomainMapper(m_xContext, xInputStream, m_xDstDoc, eType)); - //create the tokenizer and domain mapper - if( eType == writerfilter::dmapper::DOCUMENT_OOXML ) - { - writerfilter::ooxml::OOXMLStream::Pointer_t pDocStream = writerfilter::ooxml::OOXMLDocumentFactory::createStream(m_xContext, xInputStream); - writerfilter::ooxml::OOXMLDocument::Pointer_t pDocument(writerfilter::ooxml::OOXMLDocumentFactory::createDocument(pDocStream)); + writerfilter::dmapper::SourceDocumentType eType = + (m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007" ) ) || + m_sFilterName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "writer_MS_Word_2007_Template" ) )) ? + writerfilter::dmapper::DOCUMENT_OOXML : writerfilter::dmapper::DOCUMENT_DOC; + writerfilter::Stream::Pointer_t pStream(new writerfilter::dmapper::DomainMapper(m_xContext, xInputStream, m_xDstDoc, eType)); + //create the tokenizer and domain mapper + if( eType == writerfilter::dmapper::DOCUMENT_OOXML ) + { + writerfilter::ooxml::OOXMLStream::Pointer_t pDocStream = writerfilter::ooxml::OOXMLDocumentFactory::createStream(m_xContext, xInputStream); + writerfilter::ooxml::OOXMLDocument::Pointer_t pDocument(writerfilter::ooxml::OOXMLDocumentFactory::createDocument(pDocStream)); - uno::Reference<frame::XModel> xModel(m_xDstDoc, uno::UNO_QUERY_THROW); - pDocument->setModel(xModel); + uno::Reference<frame::XModel> xModel(m_xDstDoc, uno::UNO_QUERY_THROW); + pDocument->setModel(xModel); - uno::Reference<drawing::XDrawPageSupplier> xDrawings - (m_xDstDoc, uno::UNO_QUERY_THROW); - uno::Reference<drawing::XDrawPage> xDrawPage - (xDrawings->getDrawPage(), uno::UNO_SET_THROW); - pDocument->setDrawPage(xDrawPage); + uno::Reference<drawing::XDrawPageSupplier> xDrawings + (m_xDstDoc, uno::UNO_QUERY_THROW); + uno::Reference<drawing::XDrawPage> xDrawPage + (xDrawings->getDrawPage(), uno::UNO_SET_THROW); + pDocument->setDrawPage(xDrawPage); - pDocument->resolve(*pStream); - } - else - { - writerfilter::doctok::WW8Stream::Pointer_t pDocStream = writerfilter::doctok::WW8DocumentFactory::createStream(m_xContext, xInputStream); - writerfilter::doctok::WW8Document::Pointer_t pDocument(writerfilter::doctok::WW8DocumentFactory::createDocument(pDocStream)); + pDocument->resolve(*pStream); + } + else + { + writerfilter::doctok::WW8Stream::Pointer_t pDocStream = writerfilter::doctok::WW8DocumentFactory::createStream(m_xContext, xInputStream); + writerfilter::doctok::WW8Document::Pointer_t pDocument(writerfilter::doctok::WW8DocumentFactory::createDocument(pDocStream)); - pDocument->resolve(*pStream); - } + pDocument->resolve(*pStream); + } #ifdef DEBUG_IMPORT - writerfilter::TagLogger::dump("DOMAINMAPPER"); - dmapperLogger->endDocument(); - writerfilter::TagLogger::dump("DEBUG"); - debugLogger->endDocument(); + writerfilter::TagLogger::dump("DOMAINMAPPER"); + dmapperLogger->endDocument(); + writerfilter::TagLogger::dump("DEBUG"); + debugLogger->endDocument(); #endif - return sal_True; + return sal_True; } return sal_False; } @@ -190,6 +188,7 @@ OUString WriterFilter_getImplementationN #define SERVICE_NAME1 "com.sun.star.document.ImportFilter" #define SERVICE_NAME2 "com.sun.star.document.ExportFilter" + /*-- 09.06.2006 10:15:20--------------------------------------------------- -----------------------------------------------------------------------*/ Modified: openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.cxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.cxx (original) +++ openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.cxx Fri Feb 28 04:44:42 2014 @@ -62,6 +62,11 @@ void SAL_CALL component_getImplementatio *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } +sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) +{ + return ::cppu::component_writeInfoHelper( xMgr, xRegistry, s_component_entries ); +} + void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) { return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries ); Modified: openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.hxx?rev=1572819&r1=1572818&r2=1572819&view=diff ============================================================================== --- openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.hxx (original) +++ openoffice/branches/ooxml/main/writerfilter/source/filter/WriterFilter.hxx Fri Feb 28 04:44:42 2014 @@ -37,7 +37,7 @@ class WRITERFILTER_DLLPUBLIC WriterFilte < com::sun::star::document::XFilter, com::sun::star::document::XImporter, - com::sun::star::document::XExporter, + com::sun::star::document::XExporter, com::sun::star::lang::XInitialization, com::sun::star::lang::XServiceInfo >