From f63c56f87294d87275b409f6b39b7fcdc0b2be92 Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Tue, 29 Jun 2021 11:10:41 +0300 Subject: address style concerns and better practices for pptx footer export Change-Id: I9954141fb24022487983f2f6ed37e3df2a98c482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118072 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- oox/source/drawingml/textcharacterpropertiescontext.cxx | 6 ++++-- oox/source/export/drawingml.cxx | 12 ++++++------ oox/source/export/shapes.cxx | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'oox/source') diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 9363a69673bb..ce2ac6a4a119 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -50,11 +50,13 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( int nVisualTokenAmount = sax_fastparser::castToFastAttributeList( rAttribs.getFastAttributeList() ).getFastAttributeTokens().size(); - if ( rAttribs.hasAttribute( XML_lang ) ){ + if ( rAttribs.hasAttribute( XML_lang ) ) + { mrTextCharacterProperties.moLang = rAttribs.getString( XML_lang ); --nVisualTokenAmount; // Not a visual attribute } - if ( rAttribs.hasAttribute( XML_altLang )){ + if ( rAttribs.hasAttribute( XML_altLang )) + { --nVisualTokenAmount; // Not a visual attribute } if ( rAttribs.hasAttribute( XML_sz ) ) diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 72d7b6d67a37..455e50159612 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2938,20 +2938,20 @@ void DrawingML::WriteLstStyles(const css::uno::Reference& rXShapePropSet) { - Reference access(rParagraph, UNO_QUERY); - if (!access.is()) + Reference xAccess(rParagraph, UNO_QUERY); + if (!xAccess.is()) return; - Reference enumeration(access->createEnumeration()); - if (!enumeration.is()) + Reference xEnumeration(xAccess->createEnumeration()); + if (!xEnumeration.is()) return; Reference rRun; - if (enumeration->hasMoreElements()) + if (xEnumeration->hasMoreElements()) { - Any aAny(enumeration->nextElement()); + Any aAny(xEnumeration->nextElement()); if (aAny >>= rRun) { float fFirstCharHeight = rnCharHeight / 1000.; diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 32732178bef5..795c864bc600 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1590,7 +1590,8 @@ ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, s pFS->startElementNS(nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx)); - WriteText( xIface, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX), true, 0, bWritePropertiesAsLstStyles ); + WriteText(xIface, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX), /*bText=*/true, + /*nXmlNamespace=*/0, /*bWritePropertiesAsLstStyles=*/bWritePropertiesAsLstStyles); pFS->endElementNS( nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx) ); if (GetDocumentType() == DOCUMENT_DOCX) WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace ); -- cgit