Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/oox/source/ppt/extdrawingfragmenthandler.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#include "extdrawingfragmenthandler.hxx"
11
12
#include <oox/ppt/pptshapegroupcontext.hxx>
13
#include <oox/token/namespaces.hxx>
14
#include <oox/core/xmlfilterbase.hxx>
15
#include <utility>
16
17
using namespace ::oox::core;
18
19
namespace oox::ppt {
20
21
ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase& rFilter,
22
                                                        const OUString& rFragmentPath,
23
        oox::ppt::SlidePersistPtr pSlidePersistPtr,
24
        const oox::ppt::ShapeLocation   eShapeLocation,
25
        oox::drawingml::ShapePtr pGroupShapePtr,
26
        oox::drawingml::ShapePtr pShapePtr)
27
0
    : FragmentHandler2( rFilter, rFragmentPath ),
28
0
     mpSlidePersistPtr (std::move(pSlidePersistPtr )),
29
0
     meShapeLocation( eShapeLocation ),
30
0
     mpGroupShapePtr(std::move( pGroupShapePtr )),
31
0
     mpShapePtr(std::move( pShapePtr ))
32
0
{
33
0
}
34
35
ExtDrawingFragmentHandler::~ExtDrawingFragmentHandler( ) noexcept
36
0
{
37
    // Empty DrawingML fallback, need to warn the user at the end.
38
0
    if (mpShapePtr && mpShapePtr->getChildren().empty())
39
0
        getFilter().setMissingExtDrawing();
40
0
}
41
42
ContextHandlerRef
43
ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement,
44
                                            const AttributeList& )
45
0
{
46
0
    switch( aElement )
47
0
    {
48
0
    case DSP_TOKEN( drawing ):
49
0
        break;
50
0
    case DSP_TOKEN( spTree ):
51
0
        return new PPTShapeGroupContext(
52
0
                *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr,
53
0
                mpShapePtr );
54
0
    default:
55
0
        break;
56
0
    }
57
58
0
    return this;
59
0
}
60
61
}
62
63
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */