Kaydet (Commit) 9746dc9a authored tarafından Markus Mohrhard's avatar Markus Mohrhard

fix ODF validation errors

Introduced by 7d9bb549

Change-Id: I09411486b93a031a0c405579d34d9e744b8002a7
üst 0879c444
......@@ -126,7 +126,8 @@ public:
bool Equals( const ::std::vector< XMLPropertyState >& aProperties1,
const ::std::vector< XMLPropertyState >& aProperties2 ) const;
/** fills the given attribute list with the items in the given set */
/** fills the given attribute list with the items in the given set
*/
void exportXML(
SvXMLAttributeList& rAttrList,
const ::std::vector< XMLPropertyState >& rProperties,
......@@ -149,12 +150,15 @@ public:
sal_uInt16 nFlags = 0 ) const;
/** like above but only properties whose property map index is within the
specified range are exported */
* specified range are exported
*
* @param bExtensionNamespace use the extension namespace for graphic-properties
*/
void exportXML(
SvXMLExport& rExport,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
sal_uInt16 nFlags = 0 ) const;
sal_uInt16 nFlags = 0, bool bExtensionNamespace = false ) const;
/** this method is called for every item that has the
MID_FLAG_ELEMENT_EXPORT flag set */
......
......@@ -115,7 +115,7 @@ SvXMLImportContext *XMLChartStyleContext::CreateChildContext(
{
SvXMLImportContext* pContext = NULL;
if( XML_NAMESPACE_STYLE == nPrefix )
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
sal_uInt32 nFamily = 0;
if( IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) )
......
......@@ -57,7 +57,7 @@ SvXMLImportContext *XMLGraphicsDefaultStyle::CreateChildContext( sal_uInt16 nPre
{
SvXMLImportContext *pContext = 0;
if( XML_NAMESPACE_STYLE == nPrefix )
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
sal_uInt32 nFamily = 0;
if( IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) )
......
......@@ -95,7 +95,7 @@ SvXMLImportContext *XMLShapeStyleContext::CreateChildContext(
{
SvXMLImportContext *pContext = 0;
if( XML_NAMESPACE_STYLE == nPrefix )
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
sal_uInt32 nFamily = 0;
if( IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) )
......
......@@ -685,10 +685,15 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
XML_NAMESPACE_STYLE, XML_NAME,
aExpStyles[i].mpProperties->GetName() );
bool bExtensionNamespace = false;
if( rFamily.mbAsFamily )
{
GetExport().AddAttribute(
XML_NAMESPACE_STYLE, XML_FAMILY, aStrFamilyName );
if(aStrFamilyName != "graphic" &&
aStrFamilyName != "presentation" &&
aStrFamilyName != "chart" )
bExtensionNamespace = true;
}
if( !aExpStyles[i].mpParent->isEmpty() )
......@@ -741,7 +746,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
rFamily.mxMapper->exportXML(
GetExport(),
aExpStyles[i].mpProperties->GetProperties(),
nStart, nEnd, XML_EXPORT_FLAG_IGN_WS );
nStart, nEnd, XML_EXPORT_FLAG_IGN_WS, bExtensionNamespace );
pAntiImpl->exportStyleContent(
GetExport().GetDocHandler(),
......
......@@ -163,7 +163,7 @@ SvXMLImportContext *XMLPropStyleContext::CreateChildContext(
SvXMLImportContext *pContext = 0;
sal_uInt32 nFamily = 0;
if( XML_NAMESPACE_STYLE == nPrefix )
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
if( IsXMLToken( rLocalName, XML_GRAPHIC_PROPERTIES ) )
nFamily = XML_TYPE_PROP_GRAPHIC;
......
......@@ -745,7 +745,7 @@ void SvXMLExportPropertyMapper::exportXML(
SvXMLExport& rExport,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
sal_uInt16 nFlags ) const
sal_uInt16 nFlags, bool bExtensionNamespace ) const
{
sal_uInt16 nPropTypeFlags = 0;
for( sal_uInt16 i=0; i<MAX_PROP_TYPES; ++i )
......@@ -766,7 +766,11 @@ void SvXMLExportPropertyMapper::exportXML(
(nFlags & XML_EXPORT_FLAG_EMPTY) != 0 ||
!aIndexArray.empty() )
{
SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE,
sal_uInt16 nNamespace = XML_NAMESPACE_STYLE;
if(bExtensionNamespace && aPropTokens[i].eToken ==
xmloff::token::XML_GRAPHIC_PROPERTIES)
nNamespace = XML_NAMESPACE_LO_EXT;
SvXMLElementExport aElem( rExport, nNamespace,
aPropTokens[i].eToken,
(nFlags & XML_EXPORT_FLAG_IGN_WS) != 0,
false );
......
......@@ -161,7 +161,7 @@ SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext(
{
SvXMLImportContext *pContext = 0;
if( XML_NAMESPACE_STYLE == nPrefix )
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
sal_uInt32 nFamily = 0;
if( IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) )
......
......@@ -773,7 +773,7 @@ XMLTransformerContext *XMLStyleOASISTContext::CreateChildContext(
{
XMLTransformerContext *pContext = 0;
if( XML_NAMESPACE_STYLE == nPrefix )
if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
{
XMLPropType ePropType =
XMLPropertiesTContext_Impl::GetPropType( rLocalName );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment