Kaydet (Commit) 8f73c761 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#72850: ODF export: don't export spurious style:display="false"

... on style:header-left, style:header-first, style:footer-left,
style:footer-first.

(regression from d9234556)

Change-Id: I48c51fcd2b07ae8b0e3ec2c1087a388c6900b366
üst 0d9c4baf
...@@ -54,6 +54,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa ...@@ -54,6 +54,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa
bLeft( bLft ), bLeft( bLft ),
bFirst( bFrst ) bFirst( bFrst )
{ {
// NOTE: if this ever handles XML_DISPLAY attr then beware of fdo#72850 !
if( bLeft || bFirst ) if( bLeft || bFirst )
{ {
Any aAny; Any aAny;
......
...@@ -128,18 +128,18 @@ void XMLTextMasterPageExport::exportMasterPageContent( ...@@ -128,18 +128,18 @@ void XMLTextMasterPageExport::exportMasterPageContent(
sal_Bool bHeader = sal_False; sal_Bool bHeader = sal_False;
aAny >>= bHeader; aAny >>= bHeader;
sal_Bool bHeaderFirst = sal_False; sal_Bool bHeaderFirstShared = sal_False;
if( bHeader ) if( bHeader )
{ {
aAny = rPropSet->getPropertyValue( sFirstShareContent ); aAny = rPropSet->getPropertyValue( sFirstShareContent );
aAny >>= bHeaderFirst; aAny >>= bHeaderFirstShared;
} }
sal_Bool bHeaderLeft = sal_False; sal_Bool bHeaderLeftShared = sal_False;
if( bHeader ) if( bHeader )
{ {
aAny = rPropSet->getPropertyValue( sHeaderShareContent ); aAny = rPropSet->getPropertyValue( sHeaderShareContent );
aAny >>= bHeaderLeft; aAny >>= bHeaderLeftShared;
} }
if( xHeaderText.is() ) if( xHeaderText.is() )
...@@ -154,7 +154,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( ...@@ -154,7 +154,7 @@ void XMLTextMasterPageExport::exportMasterPageContent(
if( xHeaderTextFirst.is() && xHeaderTextFirst != xHeaderText ) if( xHeaderTextFirst.is() && xHeaderTextFirst != xHeaderText )
{ {
if( !bHeaderFirst ) if (bHeaderFirstShared)
GetExport().AddAttribute( XML_NAMESPACE_STYLE, GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE ); XML_DISPLAY, XML_FALSE );
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
...@@ -164,7 +164,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( ...@@ -164,7 +164,7 @@ void XMLTextMasterPageExport::exportMasterPageContent(
if( xHeaderTextLeft.is() && xHeaderTextLeft != xHeaderText ) if( xHeaderTextLeft.is() && xHeaderTextLeft != xHeaderText )
{ {
if( !bHeaderLeft ) if (bHeaderLeftShared)
GetExport().AddAttribute( XML_NAMESPACE_STYLE, GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE ); XML_DISPLAY, XML_FALSE );
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
...@@ -176,18 +176,18 @@ void XMLTextMasterPageExport::exportMasterPageContent( ...@@ -176,18 +176,18 @@ void XMLTextMasterPageExport::exportMasterPageContent(
sal_Bool bFooter = sal_False; sal_Bool bFooter = sal_False;
aAny >>= bFooter; aAny >>= bFooter;
sal_Bool bFooterFirst = sal_False; sal_Bool bFooterFirstShared = sal_False;
if( bFooter ) if( bFooter )
{ {
aAny = rPropSet->getPropertyValue( sFirstShareContent ); aAny = rPropSet->getPropertyValue( sFirstShareContent );
aAny >>= bFooterFirst; aAny >>= bFooterFirstShared;
} }
sal_Bool bFooterLeft = sal_False; sal_Bool bFooterLeftShared = sal_False;
if( bFooter ) if( bFooter )
{ {
aAny = rPropSet->getPropertyValue( sFooterShareContent ); aAny = rPropSet->getPropertyValue( sFooterShareContent );
aAny >>= bFooterLeft; aAny >>= bFooterLeftShared;
} }
if( xFooterText.is() ) if( xFooterText.is() )
...@@ -202,7 +202,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( ...@@ -202,7 +202,7 @@ void XMLTextMasterPageExport::exportMasterPageContent(
if( xFooterTextFirst.is() && xFooterTextFirst != xFooterText ) if( xFooterTextFirst.is() && xFooterTextFirst != xFooterText )
{ {
if( !bFooterFirst ) if (bFooterFirstShared)
GetExport().AddAttribute( XML_NAMESPACE_STYLE, GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE ); XML_DISPLAY, XML_FALSE );
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
...@@ -212,7 +212,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( ...@@ -212,7 +212,7 @@ void XMLTextMasterPageExport::exportMasterPageContent(
if( xFooterTextLeft.is() && xFooterTextLeft != xFooterText ) if( xFooterTextLeft.is() && xFooterTextLeft != xFooterText )
{ {
if( !bFooterLeft ) if (bFooterLeftShared)
GetExport().AddAttribute( XML_NAMESPACE_STYLE, GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE ); XML_DISPLAY, XML_FALSE );
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
......
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