summaryrefslogtreecommitdiff
path: root/oox/source/shape
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-19 15:33:44 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-19 16:50:45 +0200
commit868acbd97b58b200731ca25ece4019de734e5726 (patch)
treed5adac0a6a25619cb29170a0467d365849babc3e /oox/source/shape
parent47654bc44e4aff1b251e17c07d42f8beb8ce09c8 (diff)
oox, svx, sw, xmlsecurity: clang-format these files
I added these files more or less recently and they have long lines. Use clang-format to break at a sane column limit. Change-Id: Id4ef832e4843fc81f4a497385e49ccb835a7197f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94503 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox/source/shape')
-rw-r--r--oox/source/shape/LockedCanvasContext.cxx50
-rw-r--r--oox/source/shape/LockedCanvasContext.hxx10
-rw-r--r--oox/source/shape/WpgContext.cxx72
-rw-r--r--oox/source/shape/WpgContext.hxx10
4 files changed, 70 insertions, 72 deletions
diff --git a/oox/source/shape/LockedCanvasContext.cxx b/oox/source/shape/LockedCanvasContext.cxx
index 2633f33d1fcd..0a56a42eda46 100644
--- a/oox/source/shape/LockedCanvasContext.cxx
+++ b/oox/source/shape/LockedCanvasContext.cxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-
#include "LockedCanvasContext.hxx"
#include <sal/log.hxx>
#include <oox/drawingml/shape.hxx>
@@ -20,7 +19,6 @@ using namespace com::sun::star;
namespace oox::shape
{
-
LockedCanvasContext::LockedCanvasContext(FragmentHandler2 const& rParent)
: FragmentHandler2(rParent)
{
@@ -28,35 +26,37 @@ LockedCanvasContext::LockedCanvasContext(FragmentHandler2 const& rParent)
LockedCanvasContext::~LockedCanvasContext() = default;
-::oox::core::ContextHandlerRef LockedCanvasContext::onCreateContext(sal_Int32 nElementToken, const ::oox::AttributeList& /*rAttribs*/)
+::oox::core::ContextHandlerRef
+LockedCanvasContext::onCreateContext(sal_Int32 nElementToken,
+ const ::oox::AttributeList& /*rAttribs*/)
{
switch (getBaseToken(nElementToken))
{
- case XML_lockedCanvas:
- case XML_nvGrpSpPr:
- case XML_grpSpPr:
- break;
- case XML_sp:
- {
- oox::drawingml::ShapePtr pMasterShape;
- mpShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.CustomShape");
- mpShape->setLockedCanvas(true);
- return new oox::drawingml::ShapeContext(*this, pMasterShape, mpShape);
- }
- case XML_grpSp:
- {
- oox::drawingml::ShapePtr pMasterShape;
- mpShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape");
- mpShape->setLockedCanvas(true);
- return new oox::drawingml::ShapeGroupContext(*this, pMasterShape, mpShape);
- }
- default:
- SAL_WARN("oox", "LockedCanvasContext::createFastChildContext: unhandled element:" << getBaseToken(nElementToken));
- break;
+ case XML_lockedCanvas:
+ case XML_nvGrpSpPr:
+ case XML_grpSpPr:
+ break;
+ case XML_sp:
+ {
+ oox::drawingml::ShapePtr pMasterShape;
+ mpShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.CustomShape");
+ mpShape->setLockedCanvas(true);
+ return new oox::drawingml::ShapeContext(*this, pMasterShape, mpShape);
+ }
+ case XML_grpSp:
+ {
+ oox::drawingml::ShapePtr pMasterShape;
+ mpShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape");
+ mpShape->setLockedCanvas(true);
+ return new oox::drawingml::ShapeGroupContext(*this, pMasterShape, mpShape);
+ }
+ default:
+ SAL_WARN("oox", "LockedCanvasContext::createFastChildContext: unhandled element:"
+ << getBaseToken(nElementToken));
+ break;
}
return nullptr;
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/LockedCanvasContext.hxx b/oox/source/shape/LockedCanvasContext.hxx
index e445e7a1a9cf..68c8e27fad35 100644
--- a/oox/source/shape/LockedCanvasContext.hxx
+++ b/oox/source/shape/LockedCanvasContext.hxx
@@ -17,7 +17,6 @@ namespace oox
{
namespace shape
{
-
/// Locked canvas is kind of a container for drawingml shapes: it can even contain group shapes.
class LockedCanvasContext final : public oox::core::FragmentHandler2
{
@@ -25,17 +24,14 @@ public:
explicit LockedCanvasContext(oox::core::FragmentHandler2 const& rParent);
~LockedCanvasContext() override;
- oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken, const ::oox::AttributeList& rAttribs) override;
+ oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken,
+ const ::oox::AttributeList& rAttribs) override;
- const oox::drawingml::ShapePtr& getShape() const
- {
- return mpShape;
- }
+ const oox::drawingml::ShapePtr& getShape() const { return mpShape; }
private:
oox::drawingml::ShapePtr mpShape;
};
-
}
}
diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx
index f7e17d123fef..7896f8a4c81d 100644
--- a/oox/source/shape/WpgContext.cxx
+++ b/oox/source/shape/WpgContext.cxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-
#include "WpgContext.hxx"
#include <sal/log.hxx>
#include <drawingml/shapepropertiescontext.hxx>
@@ -20,7 +19,6 @@ using namespace com::sun::star;
namespace oox::shape
{
-
WpgContext::WpgContext(FragmentHandler2 const& rParent)
: FragmentHandler2(rParent)
{
@@ -30,43 +28,51 @@ WpgContext::WpgContext(FragmentHandler2 const& rParent)
WpgContext::~WpgContext() = default;
-oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken, const oox::AttributeList& /*rAttribs*/)
+oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken,
+ const oox::AttributeList& /*rAttribs*/)
{
switch (getBaseToken(nElementToken))
{
- case XML_wgp:
- case XML_cNvGrpSpPr:
- case XML_grpSpPr:
- return new oox::drawingml::ShapePropertiesContext(*this, *mpShape);
- case XML_wsp:
- {
- // Don't set default character height, Writer has its own way to set
- // the default, and if we don't set it here, editeng properly inherits
- // it.
- oox::drawingml::ShapePtr pShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false);
- return new oox::drawingml::ShapeContext(*this, mpShape, pShape);
- // return new oox::shape::WpsContext(*this, uno::Reference<drawing::XShape>(),
- // mpShape, pShape);
- }
- case XML_pic:
- return new oox::drawingml::GraphicShapeContext(*this, mpShape, std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GraphicObjectShape"));
- case XML_grpSp:
- {
- return new oox::drawingml::ShapeGroupContext(*this, mpShape, std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape"));
- }
- case XML_graphicFrame:
- {
- auto pShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GraphicObjectShape");
- pShape->setWps(true);
- return new oox::drawingml::GraphicalObjectFrameContext(*this, mpShape, pShape, /*bEmbedShapesInChart=*/true);
- }
- default:
- SAL_WARN("oox", "WpgContext::createFastChildContext: unhandled element: " << getBaseToken(nElementToken));
- break;
+ case XML_wgp:
+ case XML_cNvGrpSpPr:
+ case XML_grpSpPr:
+ return new oox::drawingml::ShapePropertiesContext(*this, *mpShape);
+ case XML_wsp:
+ {
+ // Don't set default character height, Writer has its own way to set
+ // the default, and if we don't set it here, editeng properly inherits
+ // it.
+ oox::drawingml::ShapePtr pShape = std::make_shared<oox::drawingml::Shape>(
+ "com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false);
+ return new oox::drawingml::ShapeContext(*this, mpShape, pShape);
+ // return new oox::shape::WpsContext(*this, uno::Reference<drawing::XShape>(),
+ // mpShape, pShape);
+ }
+ case XML_pic:
+ return new oox::drawingml::GraphicShapeContext(
+ *this, mpShape,
+ std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GraphicObjectShape"));
+ case XML_grpSp:
+ {
+ return new oox::drawingml::ShapeGroupContext(
+ *this, mpShape,
+ std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape"));
+ }
+ case XML_graphicFrame:
+ {
+ auto pShape = std::make_shared<oox::drawingml::Shape>(
+ "com.sun.star.drawing.GraphicObjectShape");
+ pShape->setWps(true);
+ return new oox::drawingml::GraphicalObjectFrameContext(*this, mpShape, pShape,
+ /*bEmbedShapesInChart=*/true);
+ }
+ default:
+ SAL_WARN("oox", "WpgContext::createFastChildContext: unhandled element: "
+ << getBaseToken(nElementToken));
+ break;
}
return nullptr;
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/WpgContext.hxx b/oox/source/shape/WpgContext.hxx
index 363750169040..1b85cd4ec885 100644
--- a/oox/source/shape/WpgContext.hxx
+++ b/oox/source/shape/WpgContext.hxx
@@ -17,7 +17,6 @@ namespace oox
{
namespace shape
{
-
/// Wpg is the drawingML equivalent of v:group.
class WpgContext final : public oox::core::FragmentHandler2
{
@@ -25,17 +24,14 @@ public:
explicit WpgContext(oox::core::FragmentHandler2 const& rParent);
~WpgContext() override;
- oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken, const oox::AttributeList& rAttribs) override;
+ oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken,
+ const oox::AttributeList& rAttribs) override;
- const oox::drawingml::ShapePtr& getShape() const
- {
- return mpShape;
- }
+ const oox::drawingml::ShapePtr& getShape() const { return mpShape; }
private:
oox::drawingml::ShapePtr mpShape;
};
-
}
}