diff options
author | Eike Rathke <erack@redhat.com> | 2013-12-20 03:17:14 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-12-20 03:26:57 +0100 |
commit | ebc1b2fe50c7ed1002ed8431410b8e2ac6e795b9 (patch) | |
tree | 73037b5e2e504807b7b04b32b55cba50d032facc | |
parent | 9dd7ee88bd9835ae2bae36093100fcd651fd3aeb (diff) |
added bool bForExport parameter to XMLPropertySetMapper ctor
Set to true for export, false for import. If export true, an
XMLPropertyMapEntry with mbImportOnly==true is not added to the
mappings. This to be able to have more than one mappings for import
(for example a current extension namespace and the future namespace
proposed to the ODF-TC, or corrected typos in element or attribute
names), but map only to one entry on export, of course.
Change-Id: Ia01ea949c88eda2f8a6c10f51c59e35e7abdcaf3
34 files changed, 137 insertions, 109 deletions
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 8cddfdefd986..f1b9350908d6 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -225,7 +225,7 @@ ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext,sal_uInt16 m_xColumnExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetColumnStylesPropertySetMapper()); m_xCellExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetCellStylesPropertySetMapper()); - m_xRowExportHelper = new OSpecialHanldeXMLExportPropertyMapper(OXMLHelper::GetRowStylesPropertySetMapper()); + m_xRowExportHelper = new OSpecialHanldeXMLExportPropertyMapper(OXMLHelper::GetRowStylesPropertySetMapper( true)); GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TABLE_TABLE, @@ -1391,7 +1391,7 @@ UniReference < XMLPropertySetMapper > ODBExport::GetTableStylesPropertySetMapper { if ( !m_xTableStylesPropertySetMapper.is() ) { - m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper(); + m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper( true); } return m_xTableStylesPropertySetMapper; } @@ -1400,7 +1400,7 @@ UniReference < XMLPropertySetMapper > ODBExport::GetCellStylesPropertySetMapper( { if ( !m_xCellStylesPropertySetMapper.is() ) { - m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper(); + m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper( true); } return m_xCellStylesPropertySetMapper; } @@ -1409,7 +1409,7 @@ UniReference < XMLPropertySetMapper > ODBExport::GetColumnStylesPropertySetMappe { if ( !m_xColumnStylesPropertySetMapper.is() ) { - m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper(); + m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper( true); } return m_xColumnStylesPropertySetMapper; } diff --git a/dbaccess/source/filter/xml/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx index abb417437f50..94ca65199703 100644 --- a/dbaccess/source/filter/xml/xmlHelper.cxx +++ b/dbaccess/source/filter/xml/xmlHelper.cxx @@ -71,17 +71,17 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 } #define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 , 0, SvtSaveOptions::ODFVER_010, false} -UniReference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMapper() +UniReference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMapper( bool bForExport ) { static const XMLPropertyMapEntry s_aTableStylesProperties[] = { MAP_END() }; UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); - return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aTableStylesProperties, xFac); + return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aTableStylesProperties, xFac, bForExport); } -UniReference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapper() +UniReference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapper( bool bForExport ) { #define MAP_CONST_COLUMN( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_COLUMN, context, SvtSaveOptions::ODFVER_010, false } static const XMLPropertyMapEntry s_aColumnStylesProperties[] = @@ -92,10 +92,10 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapp MAP_END() }; UniReference < XMLPropertyHandlerFactory> xFac = new OPropertyHandlerFactory(); - return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aColumnStylesProperties, xFac); + return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aColumnStylesProperties, xFac, bForExport); } -UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper() +UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper( bool bForExport ) { #define MAP_CONST_CELL( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010, false } #define MAP_CONST_TEXT( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010, false } @@ -133,10 +133,10 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper MAP_END() }; UniReference < XMLPropertyHandlerFactory> xFac = new /*OPropertyHandlerFactory*/::xmloff::OControlPropertyHandlerFactory(); - return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aCellStylesProperties, xFac); + return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aCellStylesProperties, xFac, bForExport); } -UniReference < XMLPropertySetMapper > OXMLHelper::GetRowStylesPropertySetMapper() +UniReference < XMLPropertySetMapper > OXMLHelper::GetRowStylesPropertySetMapper( bool bForExport ) { #define MAP_CONST_ROW( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_ROW, context, SvtSaveOptions::ODFVER_010, false } static const XMLPropertyMapEntry s_aStylesProperties[] = @@ -145,7 +145,7 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetRowStylesPropertySetMapper( MAP_END() }; UniReference < XMLPropertyHandlerFactory> xFac = new OPropertyHandlerFactory(); - return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aStylesProperties, xFac); + return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aStylesProperties, xFac, bForExport); } } diff --git a/dbaccess/source/filter/xml/xmlHelper.hxx b/dbaccess/source/filter/xml/xmlHelper.hxx index 36114dd372f9..ded4960329a4 100644 --- a/dbaccess/source/filter/xml/xmlHelper.hxx +++ b/dbaccess/source/filter/xml/xmlHelper.hxx @@ -50,10 +50,10 @@ namespace dbaxml class OXMLHelper { public: - static UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper(); - static UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper(); - static UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper(); - static UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper(); + static UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper( bool bForExport ); + static UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper( bool bForExport ); + static UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper( bool bForExport ); + static UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper( bool bForExport ); }; } // dbaxml #endif // INCLUDED_DBACCESS_SOURCE_FILTER_XML_XMLHELPER_HXX diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 31743f2185a4..a85bfbdada16 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -836,7 +836,7 @@ UniReference < XMLPropertySetMapper > ODBFilter::GetTableStylesPropertySetMapper { if ( !m_xTableStylesPropertySetMapper.is() ) { - m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper(); + m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper( false); } return m_xTableStylesPropertySetMapper; } @@ -845,7 +845,7 @@ UniReference < XMLPropertySetMapper > ODBFilter::GetColumnStylesPropertySetMappe { if ( !m_xColumnStylesPropertySetMapper.is() ) { - m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper(); + m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper( false); } return m_xColumnStylesPropertySetMapper; } @@ -854,7 +854,7 @@ UniReference < XMLPropertySetMapper > ODBFilter::GetCellStylesPropertySetMapper( { if ( !m_xCellStylesPropertySetMapper.is() ) { - m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper(); + m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper( false); } return m_xCellStylesPropertySetMapper; } diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx index 38010577349b..0eebd9bca1df 100644 --- a/include/xmloff/txtprmap.hxx +++ b/include/xmloff/txtprmap.hxx @@ -211,7 +211,7 @@ class XMLOFF_DLLPUBLIC XMLTextPropertySetMapper : public XMLPropertySetMapper { public: - XMLTextPropertySetMapper( sal_uInt16 nType ); + XMLTextPropertySetMapper( sal_uInt16 nType, bool bForExport ); virtual ~XMLTextPropertySetMapper(); static const XMLPropertyMapEntry* getPropertyMapForType( sal_uInt16 _nType ); diff --git a/include/xmloff/xmlprmap.hxx b/include/xmloff/xmlprmap.hxx index 37f56330c617..fed1411a5183 100644 --- a/include/xmloff/xmlprmap.hxx +++ b/include/xmloff/xmlprmap.hxx @@ -76,12 +76,19 @@ class XMLOFF_DLLPUBLIC XMLPropertySetMapper : public UniRefBase { ::std::vector< XMLPropertySetMapperEntry_Impl > aMapEntries; ::std::vector< UniReference < XMLPropertyHandlerFactory > > aHdlFactories; + bool mbOnlyExportMappings; public: - /** The last element of the XMLPropertyMapEntry-array must contain NULL-values */ + /** The last element of the XMLPropertyMapEntry-array must contain NULL-values. + + @param bForExport + If TRUE, only entries that have the mbImportOnly flag not set + will be in the mappings. + */ XMLPropertySetMapper( const XMLPropertyMapEntry* pEntries, - const UniReference< XMLPropertyHandlerFactory >& rFactory ); + const UniReference< XMLPropertyHandlerFactory >& rFactory, + bool bForExport ); virtual ~XMLPropertySetMapper(); void AddMapperEntry( const UniReference < XMLPropertySetMapper >& rMapper ); diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index c61afd807798..b11dcf3a3153 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -270,23 +270,23 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext,sal_uInt m_xPropHdlFactory = new OXMLRptPropHdlFactory(); UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); - UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper1 = new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(),xFac); - UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TEXT_PROP_MAP_TABLE_DEFAULTS ); + UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper1 = new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(),xFac, true); + UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TEXT_PROP_MAP_TABLE_DEFAULTS, true ); xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2); m_xTableStylesExportPropertySetMapper = new SvXMLExportPropertyMapper(xTableStylesPropertySetMapper1); - m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(); + m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap( false, true); m_xCellStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(m_xCellStylesPropertySetMapper); m_xCellStylesExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); - UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory); + UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory, true); m_xColumnStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(xColumnStylesPropertySetMapper); - UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory); + UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory, true); m_xRowStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(xRowStylesPropertySetMapper); - UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA )); + UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, true )); m_xParaPropMapper = new OSpecialHanldeXMLExportPropertyMapper( xPropMapper); OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index fc3c01624e79..d1cd6a93cfd8 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -109,7 +109,7 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 #define MAP_CONST_C_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context, SvtSaveOptions::ODFVER_010, false } #define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 ,0, SvtSaveOptions::ODFVER_010, false} // ----------------------------------------------------------------------------- -UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _bOldFormat) +UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _bOldFormat, bool bForExport) { if ( _bOldFormat ) { @@ -132,7 +132,7 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _ MAP_CONST_C_ASCII( "BorderBottom", FO, BORDER_BOTTOM, XML_TYPE_BORDER, 0 ), MAP_END() }; - return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory()); + return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory(), bForExport); } else { @@ -152,7 +152,7 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _ MAP_CONST_C_ASCII( "BorderBottom", FO, BORDER_BOTTOM, XML_TYPE_BORDER, 0 ), MAP_END() }; - return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory()); + return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory(), bForExport); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlHelper.hxx b/reportdesign/source/filter/xml/xmlHelper.hxx index 6cc32dcf3a1f..d3fbac9953ed 100644 --- a/reportdesign/source/filter/xml/xmlHelper.hxx +++ b/reportdesign/source/filter/xml/xmlHelper.hxx @@ -56,7 +56,7 @@ namespace rptxml class OXMLHelper { public: - static UniReference < XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat = false); + static UniReference < XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat, bool bForExport); static const SvXMLEnumMapEntry* GetReportPrintOptions(); static const SvXMLEnumMapEntry* GetForceNewPageOptions(); diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx index e6925339cd53..4b504af62f11 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -240,7 +240,7 @@ UniReference < SvXMLImportPropertyMapper > if( !m_xTableImpPropMapper.is() ) { UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); - m_xTableImpPropMapper = new SvXMLImportPropertyMapper( new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(), xFac), m_rImport ); + m_xTableImpPropMapper = new SvXMLImportPropertyMapper( new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(), xFac, false), m_rImport ); } xMapper = m_xTableImpPropMapper; } diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 863cc177ccdc..589c433c7fd5 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -373,10 +373,10 @@ ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext,sa XML_NAMESPACE_REPORT ); m_xPropHdlFactory = new OXMLRptPropHdlFactory; - m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(true); - m_xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory); - m_xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory); - m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS ); + m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(true, false); + m_xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory, false); + m_xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory, false); + m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS, false ); } // ----------------------------------------------------------------------------- diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index f8851f182399..8defd8aef7cf 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -501,10 +501,10 @@ ScXMLExport::ScXMLExport( // document is not set here - create ScChangeTrackingExportHelper later xScPropHdlFactory = new XMLScPropHdlFactory; - xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory); - xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory); - xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesProperties, xScPropHdlFactory); - xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesProperties, xScPropHdlFactory); + xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory, true); + xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory, true); + xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesProperties, xScPropHdlFactory, true); + xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesProperties, xScPropHdlFactory, true); xCellStylesExportPropertySetMapper = new ScXMLCellExportPropertyMapper(xCellStylesPropertySetMapper); xCellStylesExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); xColumnStylesExportPropertySetMapper = new ScXMLColumnExportPropertyMapper(xColumnStylesPropertySetMapper); @@ -4988,7 +4988,7 @@ sal_uInt32 ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) SfxObjectShell* pFoundShell = reinterpret_cast<SfxObjectShell*>( xObjShellTunnel.is() ? xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()) : 0 ); if ( pFoundShell && ooo::vba::isAlienExcelDoc( *pFoundShell ) ) { - xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScFromXLSRowStylesProperties, xScPropHdlFactory); + xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScFromXLSRowStylesProperties, xScPropHdlFactory, true); xRowStylesExportPropertySetMapper = new ScXMLRowExportPropertyMapper(xRowStylesPropertySetMapper); GetAutoStylePool()->SetFamilyPropSetMapper( XML_STYLE_FAMILY_TABLE_ROW, xRowStylesExportPropertySetMapper ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 96be8112c40c..69f46b08229b 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2110,10 +2110,10 @@ ScXMLImport::ScXMLImport( pStylesImportHelper = new ScMyStylesImportHelper(*this); xScPropHdlFactory = new XMLScPropHdlFactory; - xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory); - xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory); - xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesImportProperties, xScPropHdlFactory); - xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesImportProperties, xScPropHdlFactory); + xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory, false); + xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory, false); + xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesImportProperties, xScPropHdlFactory, false); + xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesImportProperties, xScPropHdlFactory, false); // #i66550# needed for 'presentation:event-listener' element for URLs in shapes GetNamespaceMap().Add( diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx index 90438273f57b..212557dfcba8 100644 --- a/xmloff/inc/XMLChartPropertySetMapper.hxx +++ b/xmloff/inc/XMLChartPropertySetMapper.hxx @@ -42,8 +42,8 @@ public: class XMLChartPropertySetMapper : public XMLPropertySetMapper { public: - XMLChartPropertySetMapper(); - ~XMLChartPropertySetMapper(); + explicit XMLChartPropertySetMapper( bool bForExport ); + ~XMLChartPropertySetMapper(); }; class XMLChartExportPropertyMapper : public SvXMLExportPropertyMapper diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx index 8dfa5021ed99..9bd6e3783901 100644 --- a/xmloff/qa/unit/uxmloff.cxx +++ b/xmloff/qa/unit/uxmloff.cxx @@ -62,7 +62,7 @@ void Test::testAutoStylePool() UniReference< SvXMLAutoStylePoolP > xPool( new SvXMLAutoStylePoolP( *pExport ) ); UniReference< XMLPropertySetMapper > xSetMapper( - new XMLChartPropertySetMapper ); + new XMLChartPropertySetMapper( true) ); UniReference< XMLChartExportPropertyMapper > xExportPropMapper( new XMLChartExportPropertyMapper( xSetMapper, *pExport ) ); diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 9d73fc358431..f92bbbc9f9ba 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -163,8 +163,8 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 return pHdl; } -XMLChartPropertySetMapper::XMLChartPropertySetMapper() : - XMLPropertySetMapper( aXMLChartPropMap, new XMLChartPropHdlFactory ) +XMLChartPropertySetMapper::XMLChartPropertySetMapper( bool bForExport ) : + XMLPropertySetMapper( aXMLChartPropMap, new XMLChartPropHdlFactory, bForExport ) { } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 25c120aaa22f..26401f548e0b 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1052,7 +1052,7 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl( msTableName = "local-table"; // create property set mapper - mxPropertySetMapper = new XMLChartPropertySetMapper; + mxPropertySetMapper = new XMLChartPropertySetMapper( true); mxExpPropMapper = new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport ); // register chart auto-style family diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index b544dd115e64..7ee4ecc19103 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -1162,8 +1162,9 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy return pHdl; } -XMLShapePropertySetMapper::XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef) -: XMLPropertySetMapper( aXMLSDProperties, rFactoryRef ) +XMLShapePropertySetMapper::XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef, + bool bForExport) +: XMLPropertySetMapper( aXMLSDProperties, rFactoryRef, bForExport ) { } diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx index 00b8f63770c0..348c08104600 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -223,7 +223,7 @@ public: class XMLShapePropertySetMapper : public XMLPropertySetMapper { public: - XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef); + XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef, bool bForExport); ~XMLShapePropertySetMapper(); }; diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 21e35740a30c..b4e8cd1201fc 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -435,7 +435,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory; // construct PropertySetMapper - UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef); + UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef, true); // get or create text paragraph export GetTextParagraphExport(); @@ -447,7 +447,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); // construct PresPagePropsMapper - xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef); + xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef, true); mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this ); // set lock to avoid deletion diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index ade0d57c44e5..f2d4c782e5cd 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1024,7 +1024,7 @@ SvXMLExportPropertyMapper* XMLShapeExport::CreateShapePropMapper( SvXMLExport& rExport ) { UniReference< XMLPropertyHandlerFactory > xFactory = new XMLSdPropHdlFactory( rExport.GetModel(), rExport ); - UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory ); + UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory, true ); rExport.GetTextParagraphExport(); // get or create text paragraph export SvXMLExportPropertyMapper* pResult = new XMLShapeExportPropertyMapper( xMapper, rExport ); @@ -1265,7 +1265,7 @@ const rtl::Reference< XMLTableExport >& XMLShapeExport::GetShapeTableExport() if( !mxShapeTableExport.is() ) { rtl::Reference< XMLPropertyHandlerFactory > xFactory( new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport ) ); - UniReference < XMLPropertySetMapper > xMapper( new XMLShapePropertySetMapper( xFactory.get() ) ); + UniReference < XMLPropertySetMapper > xMapper( new XMLShapePropertySetMapper( xFactory.get(), true ) ); mrExport.GetTextParagraphExport(); // get or create text paragraph export rtl::Reference< SvXMLExportPropertyMapper > xPropertySetMapper( new XMLShapeExportPropertyMapper( xMapper, mrExport ) ); mxShapeTableExport = new XMLTableExport( mrExport, xPropertySetMapper, xFactory ); diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index b6e9e160d1d9..0e0ec13d4616 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -148,7 +148,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( mpSdPropHdlFactory->acquire(); // construct PropertySetMapper - UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory); + UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory, false); mpPropertySetMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); // set lock to avoid deletion mpPropertySetMapper->acquire(); @@ -164,7 +164,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaDefaultExtPropMapper(rImporter)); // construct PresPagePropsMapper - xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory); + xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory, false); mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); if(mpPresPagePropsMapper) { @@ -1014,7 +1014,7 @@ void XMLShapeImportHelper::restoreConnections() SvXMLImportPropertyMapper* XMLShapeImportHelper::CreateShapePropMapper( const uno::Reference< frame::XModel>& rModel, SvXMLImport& rImport ) { UniReference< XMLPropertyHandlerFactory > xFactory = new XMLSdPropHdlFactory( rModel, rImport ); - UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory ); + UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory, false ); SvXMLImportPropertyMapper* pResult = new SvXMLImportPropertyMapper( xMapper, rImport ); // chain text attributes @@ -1119,7 +1119,7 @@ const rtl::Reference< XMLTableImport >& XMLShapeImportHelper::GetShapeTableImpor if( !mxShapeTableImport.is() ) { rtl::Reference< XMLPropertyHandlerFactory > xFactory( new XMLSdPropHdlFactory( mrImporter.GetModel(), mrImporter ) ); - rtl::Reference< XMLPropertySetMapper > xPropertySetMapper( new XMLShapePropertySetMapper( xFactory.get() ) ); + rtl::Reference< XMLPropertySetMapper > xPropertySetMapper( new XMLShapePropertySetMapper( xFactory.get(), false ) ); mxShapeTableImport = new XMLTableImport( mrImporter, xPropertySetMapper, xFactory ); } diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index 3ff18dbf398f..7e213f721e49 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -82,7 +82,7 @@ namespace xmloff // add our style family to the export context's style pool m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory(); - ::rtl::Reference< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper( getControlStylePropertyMap(), m_xPropertyHandlerFactory.get() ); + ::rtl::Reference< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper( getControlStylePropertyMap(), m_xPropertyHandlerFactory.get(), true ); m_xStyleExportMapper = new OFormComponentStyleExportMapper( xStylePropertiesMapper.get() ); // our style family diff --git a/xmloff/source/style/PageMasterPropMapper.cxx b/xmloff/source/style/PageMasterPropMapper.cxx index 60588799e397..0a031364bb14 100644 --- a/xmloff/source/style/PageMasterPropMapper.cxx +++ b/xmloff/source/style/PageMasterPropMapper.cxx @@ -26,15 +26,16 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper(): - XMLPropertySetMapper( aXMLPageMasterStyleMap, new XMLPageMasterPropHdlFactory()) +XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper( bool bForExport ): + XMLPropertySetMapper( aXMLPageMasterStyleMap, new XMLPageMasterPropHdlFactory(), bForExport) { } XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper( const XMLPropertyMapEntry* pEntries, - const UniReference< XMLPropertyHandlerFactory >& rFactory ) : - XMLPropertySetMapper( pEntries, rFactory ) + const UniReference< XMLPropertyHandlerFactory >& rFactory, + bool bForExport ) : + XMLPropertySetMapper( pEntries, rFactory, bForExport ) { } diff --git a/xmloff/source/style/PageMasterPropMapper.hxx b/xmloff/source/style/PageMasterPropMapper.hxx index 0ee9f7793a32..f93431517a5d 100644 --- a/xmloff/source/style/PageMasterPropMapper.hxx +++ b/xmloff/source/style/PageMasterPropMapper.hxx @@ -25,10 +25,11 @@ class XMLPageMasterPropSetMapper : public XMLPropertySetMapper { public: - XMLPageMasterPropSetMapper(); + XMLPageMasterPropSetMapper( bool bForExport ); XMLPageMasterPropSetMapper( const XMLPropertyMapEntry* pEntries, - const UniReference< XMLPropertyHandlerFactory >& rFactory ); + const UniReference< XMLPropertyHandlerFactory >& rFactory, + bool bForExport ); virtual ~XMLPageMasterPropSetMapper(); }; diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 8592c207bd24..62b767779f86 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -157,7 +157,7 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) : xPageMasterPropHdlFactory = new XMLPageMasterPropHdlFactory; xPageMasterPropSetMapper = new XMLPageMasterPropSetMapper( (XMLPropertyMapEntry*) aXMLPageMasterStyleMap, - xPageMasterPropHdlFactory ); + xPageMasterPropHdlFactory, true ); xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper( xPageMasterPropSetMapper, rExp); diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index 8aff0909ae02..b9478b2a9764 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -65,19 +65,36 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( // Ctor XMLPropertySetMapper::XMLPropertySetMapper( const XMLPropertyMapEntry* pEntries, - const UniReference< XMLPropertyHandlerFactory >& rFactory ) + const UniReference< XMLPropertyHandlerFactory >& rFactory, + bool bForExport ) + : + mbOnlyExportMappings( bForExport) { aHdlFactories.push_back( rFactory ); if( pEntries ) { const XMLPropertyMapEntry* pIter = pEntries; - // count entries - while( pIter->msApiName ) + if (mbOnlyExportMappings) { - XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); - aMapEntries.push_back( aEntry ); - pIter++; + while( pIter->msApiName ) + { + if (!pIter->mbImportOnly) + { + XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); + aMapEntries.push_back( aEntry ); + } + pIter++; + } + } + else + { + while( pIter->msApiName ) + { + XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); + aMapEntries.push_back( aEntry ); + pIter++; + } } } } @@ -102,7 +119,8 @@ void XMLPropertySetMapper::AddMapperEntry( aEIter != rMapper->aMapEntries.end(); ++aEIter ) { - aMapEntries.push_back( *aEIter ); + if (!mbOnlyExportMappings || !(*aEIter).bImportOnly) + aMapEntries.push_back( *aEIter ); } } diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 40bbdbb599cf..00a43032a5ab 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -667,7 +667,7 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty case XML_STYLE_FAMILY_SCH_CHART_ID: if( ! mxChartImpPropMapper.is() ) { - XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper(); + XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper( false ); mxChartImpPropMapper = new XMLChartImportPropertyMapper( pPropMapper, GetImport() ); } xMapper = mxChartImpPropMapper; @@ -676,7 +676,7 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty if( ! mxPageImpPropMapper.is() ) { XMLPropertySetMapper *pPropMapper = - new XMLPageMasterPropSetMapper(); + new XMLPageMasterPropSetMapper( false ); mxPageImpPropMapper = new PageMasterImportPropertyMapper( pPropMapper, ((SvXMLStylesContext*)this)->GetImport() ); diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 1f03d1977661..4054fc559cc4 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -149,8 +149,8 @@ XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExp mxCellExportPropertySetMapper = xExportPropertyMapper; mxCellExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExp)); - mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get() ) ); - mxColumnExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get() ) ); + mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), true ) ); + mxColumnExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get(), true ) ); mrExport.GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME), diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 5497331ee556..16606cf18d35 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -184,10 +184,10 @@ XMLTableImport::XMLTableImport( SvXMLImport& rImport, const rtl::Reference< XMLP mxCellImportPropertySetMapper = new SvXMLImportPropertyMapper( xCellPropertySetMapper.get(), rImport ); mxCellImportPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(rImport)); - UniReference < XMLPropertySetMapper > xRowMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get() ) ); + UniReference < XMLPropertySetMapper > xRowMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), false ) ); mxRowImportPropertySetMapper = new SvXMLImportPropertyMapper( xRowMapper, rImport ); - UniReference < XMLPropertySetMapper > xColMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get() ) ); + UniReference < XMLPropertySetMapper > xColMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get(), false ) ); mxColumnImportPropertySetMapper = new SvXMLImportPropertyMapper( xColMapper, rImport ); } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 18091977d56e..259633dee671 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -996,23 +996,23 @@ XMLTextImportHelper::XMLTextImportHelper( } XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, false ); m_pImpl->m_xParaImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); + pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, false ); m_pImpl->m_xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); + pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, false ); m_pImpl->m_xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); + pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION, false ); m_pImpl->m_xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); + pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY, false ); m_pImpl->m_xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper, rImport ); } @@ -1024,25 +1024,25 @@ XMLTextImportHelper::~XMLTextImportHelper() SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, false ); return new XMLTextImportPropertyMapper( pPropMapper, rImport ); } SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, false ); return new XMLTextImportPropertyMapper( pPropMapper, rImport ); } SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaDefaultExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper* pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, false ); SvXMLImportPropertyMapper* pImportMapper = new XMLTextImportPropertyMapper( pPropMapper, rImport ); pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS, false ); pImportMapper->ChainImportMapper( new XMLTextImportPropertyMapper( pPropMapper, rImport ) ); return pImportMapper; @@ -1053,7 +1053,7 @@ SvXMLImportPropertyMapper* SvXMLImport& rImport ) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS, false ); return new SvXMLImportPropertyMapper( pPropMapper, rImport ); } @@ -1062,7 +1062,7 @@ SvXMLImportPropertyMapper* SvXMLImport& rImport ) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_ROW_DEFAULTS ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_ROW_DEFAULTS, false ); return new SvXMLImportPropertyMapper( pPropMapper, rImport ); } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 4b5dead0108d..721e9b26f77b 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1267,7 +1267,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( sTextFieldStartEnd( "TextFieldStartEnd" ), aCharStyleNamesPropInfoCache( sCharStyleNames ) { - UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA )); + UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, true )); xParaPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); @@ -1276,7 +1276,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, xParaPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); + xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, true ); xTextPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); sFamily = GetXMLToken(XML_TEXT); @@ -1284,7 +1284,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, sFamily, xTextPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_AUTO_FRAME ); + xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_AUTO_FRAME, true ); xAutoFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); sFamily = XML_STYLE_FAMILY_SD_GRAPHICS_NAME; @@ -1292,7 +1292,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_FRAME, sFamily, xAutoFramePropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); + xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION, true ); xSectionPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); sFamily = GetXMLToken( XML_SECTION ); @@ -1300,14 +1300,14 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_SECTION, sFamily, xSectionPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); + xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY, true ); xRubyPropMapper = new SvXMLExportPropertyMapper( xPropMapper ); sFamily = GetXMLToken( XML_RUBY ); aPrefix = "Ru"; rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_RUBY, sFamily, xRubyPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); + xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, true ); xFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); @@ -1351,7 +1351,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateShapeExtPropMapper( SvXMLExport& rExport ) { UniReference < XMLPropertySetMapper > xPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE, true ); return new XMLTextExportPropertySetMapper( xPropMapper, rExport ); } @@ -1359,7 +1359,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateCharExtPropMapper( SvXMLExport& rExport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, true ); return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); } @@ -1367,7 +1367,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaExtPropMapper( SvXMLExport& rExport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, true ); return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); } @@ -1375,7 +1375,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaDefaultExtPropMappe SvXMLExport& rExport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS ); + new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS, true ); return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); } diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 430d70611fd3..ae30b1154b80 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -944,9 +944,9 @@ const XMLPropertyMapEntry* XMLTextPropertySetMapper::getPropertyMapForType( sal_ return lcl_txtprmap_getMap( _nType ); } -XMLTextPropertySetMapper::XMLTextPropertySetMapper( sal_uInt16 nType ) : +XMLTextPropertySetMapper::XMLTextPropertySetMapper( sal_uInt16 nType, bool bForExport ) : XMLPropertySetMapper( lcl_txtprmap_getMap( nType ), - new XMLTextPropertyHandlerFactory ) + new XMLTextPropertyHandlerFactory, bForExport ) { } diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx index 0f690b0c20d7..eba122b9d2ee 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -127,7 +127,7 @@ void XMLTextParagraphExport::exportTextStyles( sal_Bool bUsed, sal_Bool bProg ) GetXMLToken(XML_TABLE), new XMLTextExportPropertySetMapper( new XMLTextPropertySetMapper( - TEXT_PROP_MAP_TABLE_DEFAULTS ), + TEXT_PROP_MAP_TABLE_DEFAULTS, true ), GetExport() ) ); exportDefaultStyle( @@ -135,7 +135,7 @@ void XMLTextParagraphExport::exportTextStyles( sal_Bool bUsed, sal_Bool bProg ) GetXMLToken(XML_TABLE_ROW), new XMLTextExportPropertySetMapper( new XMLTextPropertySetMapper( - TEXT_PROP_MAP_TABLE_ROW_DEFAULTS ), + TEXT_PROP_MAP_TABLE_ROW_DEFAULTS, true ), GetExport() ) ); } } |