Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/oox/ppt/slidepersist.hxx
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
#ifndef INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
21
#define INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
22
23
#include <vector>
24
#include <map>
25
#include <memory>
26
27
#include <cppuhelper/weakref.hxx>
28
#include <com/sun/star/uno/Reference.hxx>
29
#include <oox/drawingml/clrscheme.hxx>
30
#include <oox/drawingml/color.hxx>
31
#include <oox/drawingml/drawingmltypes.hxx>
32
#include <oox/drawingml/shape.hxx>
33
#include <oox/ppt/comments.hxx>
34
#include <oox/ppt/headerfooter.hxx>
35
#include <rtl/ustring.hxx>
36
#include <sal/types.h>
37
38
namespace com::sun::star {
39
    namespace animations { class XAnimationNode; }
40
    namespace drawing { class XDrawPage; }
41
}
42
43
namespace oox::core { class XmlFilterBase; }
44
namespace oox::vml { class Drawing; }
45
46
namespace oox::ppt {
47
48
enum ShapeLocation
49
{
50
    Master,
51
    Layout,
52
    Slide
53
};
54
55
56
class TimeNode;
57
class SlidePersist;
58
59
typedef std::shared_ptr< SlidePersist > SlidePersistPtr;
60
61
class SlidePersist : public std::enable_shared_from_this< SlidePersist >
62
{
63
64
public:
65
    SlidePersist( oox::core::XmlFilterBase& rFilter, bool bMaster, bool bNotes,
66
                    const css::uno::Reference< css::drawing::XDrawPage >&,
67
                    oox::drawingml::ShapePtr pShapesPtr, ::oox::drawingml::TextListStylePtr  );
68
    ~SlidePersist();
69
70
71
185k
    const css::uno::Reference< css::drawing::XDrawPage >& getPage() const { return mxPage; };
72
73
#if OSL_DEBUG_LEVEL > 0
74
    static css::uno::WeakReference< css::drawing::XDrawPage > mxDebugPage;
75
#endif
76
77
2.66k
    void setMasterPersist(const SlidePersistPtr& pMasterPersistPtr) { mpMasterPagePtr = pMasterPersistPtr; }
78
298k
    const SlidePersistPtr& getMasterPersist() const { return mpMasterPagePtr; }
79
80
21.1k
    void setPath( const OUString& rPath ) { maPath = rPath; }
81
7.96k
    const OUString& getPath() const { return maPath; }
82
83
16.5k
    void setLayoutPath( const OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; }
84
6.66k
    const OUString& getLayoutPath() const { return maLayoutPath; }
85
86
19.1k
    void setTheme( const oox::drawingml::ThemePtr& rThemePtr ){ mpThemePtr = rThemePtr; }
87
2.86M
    const oox::drawingml::ThemePtr& getTheme() const { return mpThemePtr; }
88
89
8.30k
    void setClrMap( const oox::drawingml::ClrMapPtr& pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
90
389k
    const oox::drawingml::ClrMapPtr& getClrMap() const { return mpClrMapPtr; }
91
92
5.45k
    void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr& rFillPropertiesPtr ){ mpBackgroundPropertiesPtr = rFillPropertiesPtr; }
93
3.44k
    oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
94
95
69.4k
    bool isMasterPage() const { return mbMaster; }
96
63.4k
    bool isNotesPage() const { return mbNotes; }
97
98
10.4k
    void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
99
    sal_Int16 getLayoutFromValueToken() const;
100
101
102
41.8k
    const oox::drawingml::TextListStylePtr& getDefaultTextStyle() const { return maDefaultTextStylePtr; }
103
21.1k
    const oox::drawingml::TextListStylePtr& getTitleTextStyle() const { return maTitleTextStylePtr; }
104
28.7k
    const oox::drawingml::TextListStylePtr& getBodyTextStyle() const { return maBodyTextStylePtr; }
105
184
    const oox::drawingml::TextListStylePtr& getNotesTextStyle() const { return maNotesTextStylePtr; }
106
12.5k
    const oox::drawingml::TextListStylePtr& getOtherTextStyle() const { return maOtherTextStylePtr; }
107
108
94.9k
    const oox::drawingml::ShapePtr& getShapes() const { return maShapesPtr; }
109
    void hideShapesAsMasterShapes();
110
811
    ::std::vector< std::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
111
21.1k
    oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
112
113
37.7k
    oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
114
115
    void createXShapes( oox::core::XmlFilterBase& rFilterBase );
116
    void createBackground( const oox::core::XmlFilterBase& rFilterBase );
117
    void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
118
119
    /// Release import-side shape data after createXShapes has pushed
120
    /// everything into the core model.
121
    void releaseShapes();
122
123
124
1.98k
    std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
125
    css::uno::Reference<css::animations::XAnimationNode> getAnimationNode(const OUString& sId) const;
126
295
    ::oox::drawingml::ShapePtr getShape( const OUString & id ) { return maShapeMap[ id ]; }
127
89.5k
    ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
128
129
519
    CommentList& getCommentsList() { return maCommentsList; }
130
54
    CommentAuthorList& getCommentAuthors() { return maCommentAuthors; }
131
132
4.55k
    const OUString& getTitleText() const { return maTitleText; }
133
134
    void createConnectorShapeConnection(const oox::drawingml::ShapePtr& pConnector);
135
136
private:
137
    OUString                                                                maPath;
138
    OUString                                                                maLayoutPath;
139
    std::shared_ptr< oox::vml::Drawing >                                    mpDrawingPtr;
140
    css::uno::Reference< css::drawing::XDrawPage >                          mxPage;
141
    oox::drawingml::ThemePtr                                                mpThemePtr;         // the theme that is used
142
    oox::drawingml::ClrMapPtr                                               mpClrMapPtr;        // color mapping (if any)
143
    SlidePersistPtr                                                         mpMasterPagePtr;
144
145
    oox::drawingml::ShapePtr                                                maShapesPtr;
146
    oox::drawingml::Color                                                   maBackgroundColor;
147
    oox::drawingml::FillPropertiesPtr                                       mpBackgroundPropertiesPtr;
148
    ::std::vector< std::shared_ptr< TimeNode > >                            maTimeNodeList;
149
150
    oox::ppt::HeaderFooter                                                  maHeaderFooter;
151
    sal_Int32                                                               mnLayoutValueToken;
152
    bool                                                                    mbMaster;
153
    bool                                                                    mbNotes;
154
155
    oox::drawingml::TextListStylePtr                                        maDefaultTextStylePtr;
156
    oox::drawingml::TextListStylePtr                                        maTitleTextStylePtr;
157
    oox::drawingml::TextListStylePtr                                        maBodyTextStylePtr;
158
    oox::drawingml::TextListStylePtr                                        maNotesTextStylePtr;
159
    oox::drawingml::TextListStylePtr                                        maOtherTextStylePtr;
160
161
    std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > > maAnimNodesMap;
162
    std::map< OUString, ::oox::drawingml::ShapePtr >                        maShapeMap;
163
164
    OUString                                                                maTitleText;
165
166
    // slide comments
167
    CommentList                                                             maCommentsList;
168
    CommentAuthorList                                                       maCommentAuthors;
169
};
170
171
}
172
173
#endif // INCLUDED_OOX_PPT_SLIDEPERSIST_HXX
174
175
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */