Coverage Report

Created: 2026-08-14 10:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/xmloff/source/draw/XMLShapePropertySetContext.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
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include <XMLShapePropertySetContext.hxx>
21
#include <XMLTextColumnsContext.hxx>
22
#include <xmloff/XMLComplexColorContext.hxx>
23
#include <xmloff/xmlimp.hxx>
24
#include <xmloff/xmlnumi.hxx>
25
#include <xmltabi.hxx>
26
#include <xmlsdtypes.hxx>
27
#include <xmloff/txtprmap.hxx>
28
#include <xmloff/xmlimppr.hxx>
29
30
#include <com/sun/star/container/XIndexReplace.hpp>
31
32
using namespace ::com::sun::star;
33
using namespace ::com::sun::star::uno;
34
35
36
XMLShapePropertySetContext::XMLShapePropertySetContext(
37
                 SvXMLImport& rImport, sal_Int32 nElement,
38
                 const Reference< xml::sax::XFastAttributeList > & xAttrList,
39
                 sal_uInt32 nFam,
40
                 ::std::vector< XMLPropertyState > &rProps,
41
                 SvXMLImportPropertyMapper* pMap ) :
42
17.6k
    SvXMLPropertySetContext( rImport, nElement, xAttrList, nFam,
43
17.6k
                             rProps, pMap ),
44
17.6k
    mnBulletIndex(-1)
45
17.6k
{
46
17.6k
}
47
48
XMLShapePropertySetContext::~XMLShapePropertySetContext()
49
17.6k
{
50
17.6k
}
51
52
void XMLShapePropertySetContext::endFastElement(sal_Int32 )
53
17.5k
{
54
17.5k
    Reference< container::XIndexReplace > xNumRule;
55
17.5k
    if( mxBulletStyle.is() )
56
189
    {
57
189
        xNumRule = SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() );
58
189
        if( xNumRule.is() )
59
189
            mxBulletStyle->FillUnoNumRule(xNumRule);
60
189
    }
61
62
17.5k
    XMLPropertyState aPropState( mnBulletIndex, Any(xNumRule) );
63
17.5k
    mrProperties.push_back( aPropState );
64
17.5k
}
65
66
css::uno::Reference< css::xml::sax::XFastContextHandler > XMLShapePropertySetContext::createFastChildContext(
67
    sal_Int32 nElement,
68
    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
69
    ::std::vector< XMLPropertyState > &rProperties,
70
    const XMLPropertyState& rProp )
71
2.91k
{
72
2.91k
    switch( mpMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
73
2.91k
    {
74
190
    case CTF_NUMBERINGRULES:
75
190
        mnBulletIndex = rProp.mnIndex;
76
190
        mxBulletStyle = new SvxXMLListStyleContext( GetImport() );
77
190
        return mxBulletStyle;
78
2.72k
    case CTF_TABSTOP:
79
2.72k
        return new SvxXMLTabStopImportContext( GetImport(), nElement,
80
2.72k
                                                   rProp,
81
2.72k
                                                   rProperties );
82
0
    case CTF_TEXTCOLUMNS:
83
0
        return new XMLTextColumnsContext(GetImport(), nElement, xAttrList, rProp, rProperties);
84
85
0
    case CTF_COMPLEX_COLOR:
86
0
        return new XMLPropertyComplexColorContext(GetImport(), nElement, xAttrList, rProp, rProperties);
87
2.91k
    }
88
89
1
    return SvXMLPropertySetContext::createFastChildContext( nElement,
90
1
                                                            xAttrList,
91
1
                                                            rProperties, rProp );
92
2.91k
}
93
94
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */