1 /* This file is part of the wvWare 2 project
2 Copyright (C) 2002-2003 Werner Trobin <trobin@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02111-1307, USA.
17 */
18
19 #include "paragraphproperties.h"
20 #include "lists.h"
21
22 using namespace wvWare;
23
ParagraphProperties()24 ParagraphProperties::ParagraphProperties() : m_listInfo( 0 )
25 {
26 }
27
ParagraphProperties(const Word97::PAP & pap)28 ParagraphProperties::ParagraphProperties( const Word97::PAP& pap ) :
29 m_pap( pap ), m_listInfo( 0 )
30 {
31 }
32
ParagraphProperties(const ParagraphProperties & rhs)33 ParagraphProperties::ParagraphProperties( const ParagraphProperties& rhs ) :
34 Shared( rhs ), m_pap( rhs.pap() ), m_listInfo( 0 )
35 {
36 if ( rhs.listInfo() )
37 m_listInfo = new ListInfo( *rhs.listInfo() );
38 }
39
~ParagraphProperties()40 ParagraphProperties::~ParagraphProperties()
41 {
42 delete m_listInfo;
43 }
44
pap()45 Word97::PAP& ParagraphProperties::pap()
46 {
47 return m_pap;
48 }
49
pap() const50 const Word97::PAP& ParagraphProperties::pap() const
51 {
52 return m_pap;
53 }
54
listInfo() const55 const ListInfo* ParagraphProperties::listInfo() const
56 {
57 return m_listInfo;
58 }
59
setBulletPictureName(const QString & name)60 void ParagraphProperties::setBulletPictureName(const QString& name)
61 {
62 m_listInfo->setBulletPictureName(name);
63 }
64
createListInfo(ListInfoProvider & listInfoProvider,Word97::CHP & chp)65 void ParagraphProperties::createListInfo( ListInfoProvider& listInfoProvider, Word97::CHP& chp)
66 {
67 if ( m_listInfo || !listInfoProvider.isValid( m_pap.ilfo, m_pap.nLvlAnm ) ) {
68 return;
69 }
70 m_listInfo = new ListInfo( m_pap, chp, listInfoProvider );
71 }
72