diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-05-05 15:30:26 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-05-05 15:30:26 +0000 |
commit | 8ce299c8a86cbbf785445c2d11c35fa94b35f176 (patch) | |
tree | a59eb7518558f5dbdf16bddaa51c26dc17febfe1 /xmloff | |
parent | 6daf25d98b004a4590513abba798947809d8ef7c (diff) |
INTEGRATION: CWS cellstylefixes (1.3.2); FILE MERGED
2008/04/15 15:32:28 cl 1.3.2.1: #i88272# export drawing layer table stuff only for draw/impress
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/table/XMLTableExport.cxx | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index ad1aad73813a..f3df5cb3d086 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: XMLTableExport.cxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -152,7 +152,28 @@ sal_Int32 StringStatisticHelper::getModeString( OUString& rStyleName ) XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef ) : mrExport( rExp ) +, mbExportTables( false ) { + Reference< XMultiServiceFactory > xFac( rExp.GetModel(), UNO_QUERY ); + if( xFac.is() ) try + { + Sequence< OUString > sSNS( xFac->getAvailableServiceNames() ); + sal_Int32 n = sSNS.getLength(); + const OUString* pSNS( sSNS.getConstArray() ); + while( --n > 0 ) + { + if( (*pSNS++).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape") ) ) + { + mbExportTables = true; + break; + } + } + } + catch( Exception& e ) + { + (void)e; + } + mxCellExportPropertySetMapper = new SvXMLExportPropertyMapper( xCellPropertySetMapper.get() ); mxCellExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExp)); @@ -205,6 +226,9 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) void XMLTableExport::collectTableAutoStyles(const Reference < XColumnRowRange >& xColumnRowRange) { + if( !mbExportTables ) + return; + boost::shared_ptr< XMLTableInfo > pTableInfo( new XMLTableInfo() ); maTableInfoMap[xColumnRowRange] = pTableInfo; @@ -307,6 +331,9 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) void XMLTableExport::exportTable( const Reference < XColumnRowRange >& xColumnRowRange ) { + if( !mbExportTables ) + return; + try { boost::shared_ptr< XMLTableInfo > pTableInfo( maTableInfoMap[xColumnRowRange] ); @@ -463,6 +490,9 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) void XMLTableExport::exportTableStyles() { + if( !mbExportTables ) + return; + XMLStyleExport aStEx(mrExport, OUString(), mrExport.GetAutoStylePool().get()); // write graphic family styles @@ -477,6 +507,9 @@ void XMLTableExport::exportTableStyles() void XMLTableExport::exportAutoStyles() { + if( !mbExportTables ) + return; + mrExport.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_TABLE_COLUMN, mrExport.GetDocHandler(), mrExport.GetMM100UnitConverter(), mrExport.GetNamespaceMap() ); mrExport.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_TABLE_ROW, mrExport.GetDocHandler(), mrExport.GetMM100UnitConverter(), mrExport.GetNamespaceMap() ); mrExport.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_TABLE_CELL, mrExport.GetDocHandler(), mrExport.GetMM100UnitConverter(), mrExport.GetNamespaceMap() ); @@ -507,6 +540,9 @@ const TableStyleElement* getTableStyleMap() void XMLTableExport::exportTableTemplates() { + if( !mbExportTables ) + return; + try { Reference< XStyleFamiliesSupplier > xFamiliesSupp( mrExport.GetModel(), UNO_QUERY_THROW ); |