summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2022-10-20 14:28:07 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-10-24 15:09:37 +0200
commit9ad7df41572d67687221cb43d53cde27a45fff0f (patch)
treeb2c81fe59972afd4c478abe36161c8875939cad4 /oox
parentdba424efc15aa2915c38721c27edf0cc1d716bd1 (diff)
tdf#83671 make SmartArt visible in import of xlsx
Problem is, that Excel writes a zero size in xdr:xfrm for the SmartArt. With that the import generates a background size with zero width and height and no shapes at all in the SmartArt group. The diagram DOM is imported correctly. The actual size is not known until the row and column values of the anchor are evaluated. The idea of this patch is to correct the background size directly and to repeat the import of drawing.xml when the actual size is known. I noticed that in import of SmartArt in docx there is a similar problem that the SmartArt shapes are missing at some point, as can be seen in ShapeContextHandler::getShape(), about line 428. It uses ShapeDrawingFragmentHandler to import the shapes. To be able to use that handler too, I have moved its header file to include. The solution for docx uses a loop over the vector getExtDrawings(). But I have not seen a SmartArt case, where more then one element exists in it. Whether the shape is a diagram, is indirectly tested currently. The shape has yet no direct method for it. Change-Id: I9d705ed5bfb2894e9ce740ebf8589e06b4870bed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141571 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx2
-rw-r--r--oox/source/shape/ShapeDrawingFragmentHandler.cxx2
-rw-r--r--oox/source/shape/ShapeDrawingFragmentHandler.hxx35
3 files changed, 2 insertions, 37 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 54a455452365..4e8329c1417d 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
#include <oox/shape/ShapeContextHandler.hxx>
-#include "ShapeDrawingFragmentHandler.hxx"
+#include <oox/shape/ShapeDrawingFragmentHandler.hxx>
#include "LockedCanvasContext.hxx"
#include "WpsContext.hxx"
#include "WpgContext.hxx"
diff --git a/oox/source/shape/ShapeDrawingFragmentHandler.cxx b/oox/source/shape/ShapeDrawingFragmentHandler.cxx
index 0e915058fcb4..456f7df6c80d 100644
--- a/oox/source/shape/ShapeDrawingFragmentHandler.cxx
+++ b/oox/source/shape/ShapeDrawingFragmentHandler.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "ShapeDrawingFragmentHandler.hxx"
+#include <oox/shape/ShapeDrawingFragmentHandler.hxx>
#include <oox/drawingml/shapegroupcontext.hxx>
#include <oox/token/namespaces.hxx>
diff --git a/oox/source/shape/ShapeDrawingFragmentHandler.hxx b/oox/source/shape/ShapeDrawingFragmentHandler.hxx
deleted file mode 100644
index 15b424b6fd8f..000000000000
--- a/oox/source/shape/ShapeDrawingFragmentHandler.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_OOX_SOURCE_SHAPE_SHAPEDRAWINGFRAGMENTHANDLER_HXX
-#define INCLUDED_OOX_SOURCE_SHAPE_SHAPEDRAWINGFRAGMENTHANDLER_HXX
-
-#include <oox/core/fragmenthandler2.hxx>
-#include <oox/drawingml/drawingmltypes.hxx>
-
-namespace oox::shape {
-
-/// Generic (i.e. not specific to PPTX) handler for the prerendered diagram parsing.
-class ShapeDrawingFragmentHandler : public oox::core::FragmentHandler2
-{
-public:
- ShapeDrawingFragmentHandler(oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, oox::drawingml::ShapePtr pGroupShapePtr);
- virtual ~ShapeDrawingFragmentHandler() noexcept override;
- virtual void SAL_CALL endDocument() override;
- virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 Element, const AttributeList& rAttribs ) override;
-
-private:
- oox::drawingml::ShapePtr mpGroupShapePtr;
-};
-
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */