summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlprmap.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-12-20 03:17:14 +0100
committerEike Rathke <erack@redhat.com>2013-12-20 03:26:57 +0100
commitebc1b2fe50c7ed1002ed8431410b8e2ac6e795b9 (patch)
tree73037b5e2e504807b7b04b32b55cba50d032facc /xmloff/source/style/xmlprmap.cxx
parent9dd7ee88bd9835ae2bae36093100fcd651fd3aeb (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
Diffstat (limited to 'xmloff/source/style/xmlprmap.cxx')
-rw-r--r--xmloff/source/style/xmlprmap.cxx32
1 files changed, 25 insertions, 7 deletions
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 );
}
}