summaryrefslogtreecommitdiff
path: root/dbaccess/source/filter
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 /dbaccess/source/filter
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 'dbaccess/source/filter')
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx8
-rw-r--r--dbaccess/source/filter/xml/xmlHelper.cxx16
-rw-r--r--dbaccess/source/filter/xml/xmlHelper.hxx8
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx6
4 files changed, 19 insertions, 19 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;
}