diff options
author | Eike Rathke <erack@redhat.com> | 2013-12-20 12:57:15 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-21 19:30:27 +0000 |
commit | 7b44c5e95b07cde11b8b03f940f97e71ea9c7df4 (patch) | |
tree | a6721c7c008a3ac23f37aa3f12ed5d3a5b46e147 /xmloff | |
parent | e94ab5aad124b888d524033abeaf212696779067 (diff) |
XMLPropertyMapEntry::mbImportOnly and XMLPropertySetMapper bForExport
Although a rather large change this does not change the property
mappings or import/export behavior yet, but prepares for further
changes that add mappings for generating correct ODF and consuming
both old and new namespace/element/attribute names.
This is a combination of 4 commits:
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.
(cherry picked from commit ebc1b2fe50c7ed1002ed8431410b8e2ac6e795b9)
Conflicts:
dbaccess/source/filter/xml/xmlHelper.cxx
xmloff/source/chart/PropertyMaps.cxx
xmloff/source/draw/sdpropls.cxx
xmloff/source/style/PageMasterPropMapper.cxx
xmloff/source/table/XMLTableImport.cxx
prepared XMLPropertyMapEntry with mbImportOnly flag
(cherry picked from commit 9dd7ee88bd9835ae2bae36093100fcd651fd3aeb)
Conflicts:
dbaccess/source/filter/xml/xmlHelper.cxx
xmloff/source/table/XMLTableExport.cxx
xmloff/source/text/txtprmap.cxx
just beautify this a little
(cherry picked from commit 44b4973fbd0f190906f36321b31215d80b363d52)
reordered member variables for 4 byte alignment
(cherry picked from commit dd902b8e256867b5d5fed06b52995f14d969f67d)
Change-Id: I15b03870fd14f110833037b6c0ff934624d72de1
Reviewed-on: https://gerrit.libreoffice.org/7144
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'xmloff')
24 files changed, 116 insertions, 94 deletions
diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx index e2463e255c8d..051910eeb516 100644 --- a/xmloff/inc/XMLChartPropertySetMapper.hxx +++ b/xmloff/inc/XMLChartPropertySetMapper.hxx @@ -47,8 +47,8 @@ public: class XMLChartPropertySetMapper : public XMLPropertySetMapper { public: - XMLChartPropertySetMapper(); - ~XMLChartPropertySetMapper(); + explicit XMLChartPropertySetMapper( bool bForExport ); + ~XMLChartPropertySetMapper(); }; // ---------------------------------------- diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx index a0bd4306226b..4380a9e66ef3 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/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index f19b36593e72..809c043f5a24 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -84,14 +84,14 @@ #define XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ( XML_SCH_CTF_START + 25 ) -#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, sizeof(ApiName)-1, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport } -#define MAP_ENTRY( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_010 } -#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012 } -#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT } -#define MAP_CONTEXT( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFVER_010 } -#define MAP_SPECIAL( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_010 } -#define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_012 } -#define MAP_ENTRY_END { 0,0,0,xmloff::token::XML_TOKEN_INVALID,0,0,SvtSaveOptions::ODFVER_010 } +#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, sizeof(ApiName)-1, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false } +#define MAP_ENTRY( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_010, false } +#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012, false } +#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false } +#define MAP_CONTEXT( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFVER_010, false } +#define MAP_SPECIAL( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_010, false } +#define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_012, false } +#define MAP_ENTRY_END { 0,0,0,xmloff::token::XML_TOKEN_INVALID,0,0,SvtSaveOptions::ODFVER_010, false } // --------------------------------------------------------- // PropertyMap for Chart properties drawing- and diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index da811523940c..dd7b59ac1f62 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -171,8 +171,8 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 // ---------------------------------------- -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 89a8dae3c885..8cd6416a6ea3 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1064,7 +1064,7 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl( msTableName = OUString( "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 8e243fa7e330..5486a1857b90 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -72,14 +72,14 @@ using ::com::sun::star::uno::Reference; using namespace ::com::sun::star; using namespace ::xmloff::token; -#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 } -#define _MAPV(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version } +#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } +#define _MAPV(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, false } #define GMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_GRAPHIC,context) #define GMAPV(name,prefix,token,type,context,version) _MAPV(name,prefix,token,type|XML_TYPE_PROP_GRAPHIC,context,version) #define DPMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_DRAWING_PAGE,context) #define TMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_TEXT,context) #define PMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_PARAGRAPH,context) -#define MAP_END() { 0L, 0, 0, XML_EMPTY, 0 ,0, SvtSaveOptions::ODFVER_010} +#define MAP_END() { 0L, 0, 0, XML_EMPTY, 0 ,0, SvtSaveOptions::ODFVER_010, false } ////////////////////////////////////////////////////////////////////////////// // entry list for graphic properties @@ -1180,8 +1180,9 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy ////////////////////////////////////////////////////////////////////////////// -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 70ac1b718109..e10199c69340 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -244,7 +244,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 c9149b9ae87a..5bbdce5bcc1d 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -444,7 +444,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(); @@ -456,7 +456,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 ); if(mpPresPagePropsMapper) diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 14ec5c8c205a..30c0230fe8fc 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1014,7 +1014,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 ); @@ -1259,7 +1259,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 fb411104985a..7a4619aeb3d0 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -154,7 +154,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(); @@ -170,7 +170,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) { @@ -1055,7 +1055,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 @@ -1160,7 +1160,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/controlpropertymap.cxx b/xmloff/source/forms/controlpropertymap.cxx index 2f0dc041bbb2..59e59865f4df 100644 --- a/xmloff/source/forms/controlpropertymap.cxx +++ b/xmloff/source/forms/controlpropertymap.cxx @@ -35,10 +35,10 @@ namespace xmloff { //......................................................................... -#define MAP_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 } -#define MAP_CONST( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 } -#define MAP_CONST_P( name, prefix, token, type, context ){ name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 } -#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 } +#define MAP_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010, false } +#define MAP_CONST( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010, false } +#define MAP_CONST_P( name, prefix, token, type, context ){ name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010, false } +#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } XMLPropertyMapEntry* getControlStylePropertyMap_Access( ) { diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index c880662d9d3a..663609ade575 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -89,7 +89,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 273e1c3eaf35..639fbb00fa91 100644 --- a/xmloff/source/style/PageMasterPropMapper.cxx +++ b/xmloff/source/style/PageMasterPropMapper.cxx @@ -31,15 +31,16 @@ 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 231a35911452..392fe174dc77 100644 --- a/xmloff/source/style/PageMasterPropMapper.hxx +++ b/xmloff/source/style/PageMasterPropMapper.hxx @@ -28,10 +28,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/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 872672906272..18d6ea20db96 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -24,7 +24,7 @@ using namespace ::xmloff::token; -#define MAP(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version } +#define MAP(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, false } #define PLMAP(name,prefix,token,type,context) \ MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context, SvtSaveOptions::ODFVER_010) #define PLMAP_12(name,prefix,token,type,context) \ @@ -186,7 +186,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = HFMAP( "FooterBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_FOOTERGRAPHICURL ), HFMAP( "FooterDynamicSpacing", XML_NAMESPACE_STYLE, XML_DYNAMIC_SPACING, XML_TYPE_BOOL, CTF_PM_FOOTERFLAG ), - { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010 } + { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 48e429550dd7..7278eb9d610c 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -161,7 +161,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 351c9127cb6c..1ea9a6f913fe 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -40,10 +40,11 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( sXMLAttributeName( GetXMLToken(rMapEntry.meXMLName) ), sAPIPropertyName( OUString(rMapEntry.msApiName, rMapEntry.nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ), - nXMLNameSpace( rMapEntry.mnNameSpace ), nType( rMapEntry.mnType ), + nXMLNameSpace( rMapEntry.mnNameSpace ), nContextId( rMapEntry.mnContextId ), nEarliestODFVersionForExport( rMapEntry.mnEarliestODFVersionForExport ), + bImportOnly( rMapEntry.mbImportOnly), pHdl( rFactory->GetPropertyHandler( rMapEntry.mnType & MID_FLAG_MASK ) ) { } @@ -52,10 +53,11 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( const XMLPropertySetMapperEntry_Impl& rEntry ) : sXMLAttributeName( rEntry.sXMLAttributeName), sAPIPropertyName( rEntry.sAPIPropertyName), - nXMLNameSpace( rEntry.nXMLNameSpace), nType( rEntry.nType), + nXMLNameSpace( rEntry.nXMLNameSpace), nContextId( rEntry.nContextId), nEarliestODFVersionForExport( rEntry.nEarliestODFVersionForExport ), + bImportOnly( rEntry.bImportOnly), pHdl( rEntry.pHdl) { DBG_ASSERT( pHdl, "Unknown XML property type handler!" ); @@ -67,19 +69,36 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( // 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) + { + while( pIter->msApiName ) + { + if (!pIter->mbImportOnly) + { + XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); + aMapEntries.push_back( aEntry ); + } + pIter++; + } + } + else { - XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); - aMapEntries.push_back( aEntry ); - pIter++; + while( pIter->msApiName ) + { + XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); + aMapEntries.push_back( aEntry ); + pIter++; + } } } } @@ -104,7 +123,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 c54d7ffbe5f5..7ca0b206409a 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -677,7 +677,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; @@ -686,7 +686,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 b710adefa8f7..611273d10589 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -54,10 +54,10 @@ using namespace ::com::sun::star::style; // -------------------------------------------------------------------- -#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 } +#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } #define CMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_TABLE_COLUMN,context) #define RMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_TABLE_ROW,context) -#define MAP_END { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010 } +#define MAP_END { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } // -------------------------------------------------------------------- @@ -163,8 +163,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 59254909af26..1f847655c2e1 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -205,11 +205,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 24221a6d87c1..42e0576936d7 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1001,23 +1001,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 ); } @@ -1029,25 +1029,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; @@ -1058,7 +1058,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 ); } @@ -1067,7 +1067,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 3b5933be9e2f..e09b6a2b3ebf 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1273,7 +1273,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() ); @@ -1282,7 +1282,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 = OUString( GetXMLToken(XML_TEXT) ); @@ -1290,7 +1290,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 = OUString( XML_STYLE_FAMILY_SD_GRAPHICS_NAME ); @@ -1298,7 +1298,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 = OUString( GetXMLToken( XML_SECTION ) ); @@ -1306,14 +1306,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 = OUString( GetXMLToken( XML_RUBY ) ); aPrefix = OUString( "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() ); @@ -1357,7 +1357,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 ); } @@ -1365,7 +1365,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 ); } @@ -1373,7 +1373,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 ); } @@ -1381,7 +1381,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 def83355d0aa..26d04d898d3b 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -31,13 +31,13 @@ using namespace ::com::sun::star::uno; using namespace ::xmloff::token; #define _M_E( a, p, l, t, c ) \ - { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, SvtSaveOptions::ODFVER_010 } + { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, SvtSaveOptions::ODFVER_010, false } #define _M_EV( a, p, l, t, c, v ) \ - { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, v } + { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, v, false } #define _M_ED( a, p, l, t, c ) \ - { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c, SvtSaveOptions::ODFVER_010 } + { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c, SvtSaveOptions::ODFVER_010, false } // text properties #define MT_E( a, p, l, t, c ) \ @@ -68,7 +68,7 @@ using namespace ::xmloff::token; _M_E( a, p, l, (t|XML_TYPE_PROP_RUBY), c ) #define M_END() \ - { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 } + { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } XMLPropertyMapEntry aXMLParaPropMap[] = @@ -88,7 +88,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = MP_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), MP_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), MP_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), - { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, + { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, // RES_CHRATR_CASEMAP MT_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), MT_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), @@ -136,9 +136,9 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // RES_CHRATR_WEIGHT MT_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_RSID - { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, + { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, // RES_PARATR_RSID - { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, + { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, // RES_CHRATR_WORDLINEMODE MT_E( "CharWordMode", STYLE, TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), MT_E( "CharWordMode", STYLE, TEXT_OVERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), @@ -434,9 +434,9 @@ XMLPropertyMapEntry aXMLTextPropMap[] = // RES_CHRATR_WEIGHT MT_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_RSID - { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, + { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, // RES_PARATR_RSID - { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, + { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, // RES_CHRATR_WORDLINEMODE MT_E( "CharWordMode", STYLE, TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), MT_E( "CharWordMode", STYLE, TEXT_OVERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), @@ -890,9 +890,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 b507b09c9087..c3dd060e01ba 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -128,7 +128,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( @@ -136,7 +136,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() ) ); } } |