[Libreoffice-commits] core.git: oox/source sd/source
Sarper Akdemir (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 1 09:01:28 UTC 2021
oox/source/drawingml/textcharacterpropertiescontext.cxx | 6 ++++--
oox/source/export/drawingml.cxx | 12 ++++++------
oox/source/export/shapes.cxx | 3 ++-
sd/source/filter/eppt/epptooxml.hxx | 6 +++---
sd/source/filter/eppt/pptx-epptooxml.cxx | 8 ++++----
5 files changed, 19 insertions(+), 16 deletions(-)
New commits:
commit f63c56f87294d87275b409f6b39b7fcdc0b2be92
Author: Sarper Akdemir <sarper.akdemir at collabora.com>
AuthorDate: Tue Jun 29 11:10:41 2021 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jul 1 11:00:53 2021 +0200
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 <vmiklos at collabora.com>
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<css::text::XTextContent
bool& rbOverridingCharHeight, sal_Int32& rnCharHeight,
const css::uno::Reference<css::beans::XPropertySet>& rXShapePropSet)
{
- Reference<XEnumerationAccess> access(rParagraph, UNO_QUERY);
- if (!access.is())
+ Reference<XEnumerationAccess> xAccess(rParagraph, UNO_QUERY);
+ if (!xAccess.is())
return;
- Reference<XEnumeration> enumeration(access->createEnumeration());
- if (!enumeration.is())
+ Reference<XEnumeration> xEnumeration(xAccess->createEnumeration());
+ if (!xEnumeration.is())
return;
Reference<XTextRange> 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 );
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index 8643ff58e841..82bb6a3ab937 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -123,7 +123,7 @@ private:
@param rXShape Master placeholder shape
@returns Placeholder index
*/
- unsigned CreateNewPlaceholderIndex(const css::uno::Reference<css::drawing::XShape>& rXShape);
+ sal_Int32 CreateNewPlaceholderIndex(const css::uno::Reference<css::drawing::XShape>& rXShape);
css::uno::Reference<css::drawing::XShape> GetReferencedPlaceholderXShape(const PlaceholderType eType, PageType ePageType) const;
void WritePlaceholderReferenceShapes(PowerPointShapeExport& rDML, PageType ePageType);
@@ -151,9 +151,9 @@ private:
::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap;
- unsigned mnPlaceholderIndexMax; ///< Last used placeholder index
+ sal_Int32 mnPlaceholderIndexMax; ///< Last used placeholder index
/// Map of placeholder indexes for Master placeholders
- std::unordered_map< css::uno::Reference<css::drawing::XShape>, unsigned > maPlaceholderShapeToIndexMap;
+ std::unordered_map< css::uno::Reference<css::drawing::XShape>, sal_Int32 > maPlaceholderShapeToIndexMap;
struct AuthorComments {
sal_Int32 nId;
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 18356f1ec595..d26cf6b0d061 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -121,7 +121,7 @@ public:
ShapeExport& WriteUnknownShape(const Reference< XShape >& xShape) override;
ShapeExport& WritePlaceholderShape(const Reference< XShape >& xShape, PlaceholderType ePlaceholder);
/** Writes a placeholder shape that references the placeholder on the master slide */
- ShapeExport& WritePlaceholderReferenceShape(PlaceholderType ePlaceholder, unsigned nReferencedPlaceholderIdx, PageType ePageType, Reference<XPropertySet>& rXPagePropSet);
+ ShapeExport& WritePlaceholderReferenceShape(PlaceholderType ePlaceholder, sal_Int32 nReferencedPlaceholderIdx, PageType ePageType, Reference<XPropertySet>& rXPagePropSet);
ShapeExport& WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj);
/** Writes textbody of a placeholder that references the placeholder on the master slide */
ShapeExport& WritePlaceholderReferenceTextBody(PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet);
@@ -1607,7 +1607,7 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap
}
mpFS->endElementNS(XML_p, XML_spPr);
- WriteTextBox(xShape, XML_p, bUsePlaceholderIndex);
+ WriteTextBox(xShape, XML_p, /*bWritePropertiesAsLstStyles=*/bUsePlaceholderIndex);
mpFS->endElementNS(XML_p, XML_sp);
@@ -1615,7 +1615,7 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap
}
ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceShape(
- PlaceholderType ePlaceholder, unsigned nReferencedPlaceholderIdx, PageType ePageType,
+ PlaceholderType ePlaceholder, sal_Int32 nReferencedPlaceholderIdx, PageType ePageType,
Reference<XPropertySet>& rXPagePropSet)
{
mpFS->startElementNS(XML_p, XML_sp);
@@ -2274,7 +2274,7 @@ void PowerPointExport::WritePlaceholderReferenceShapes(PowerPointShapeExport& rD
}
}
-unsigned PowerPointExport::CreateNewPlaceholderIndex(const css::uno::Reference<XShape> &rXShape)
+sal_Int32 PowerPointExport::CreateNewPlaceholderIndex(const css::uno::Reference<XShape> &rXShape)
{
maPlaceholderShapeToIndexMap.insert({rXShape, mnPlaceholderIndexMax});
return mnPlaceholderIndexMax++;
More information about the Libreoffice-commits
mailing list