kword13postparsing.cpp
1/*
2 This file is part of the KDE project
3 Copyright (C) 2004 Nicolas GOUTTE <goutte@kde.org>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#include <tqstring.h>
22#include <tqdict.h>
23
24#include <kdebug.h>
25
26#include <KoStore.h>
27
28#include "kword13picture.h"
29#include "kword13document.h"
30#include "kword13postparsing.h"
31
32KWord13PostParsing::KWord13PostParsing(void) : m_kwordDocument( 0 )
33{
34}
35
36KWord13PostParsing::~KWord13PostParsing(void)
37{
38}
39
40bool KWord13PostParsing::postParsePictures( KoStore* store )
41{
42 if ( ! m_kwordDocument )
43 return false;
44
45 for ( TQDictIterator<KWord13Picture> it( m_kwordDocument->m_pictureDict ) ; it.current(); ++it )
46 {
47 kdDebug(30520) << "Loading... " << it.currentKey() << endl;
48 if ( ! it.current()->loadPicture( store ) )
49 {
50 kdWarning(30520) << "Could not load picture!" << endl;
51 return false;
52 }
53 }
54 return true;
55}
56
57
58bool KWord13PostParsing::postParse( KoStore* store, KWord13Document& doc )
59{
60 // ### TODO: check if it is the same document if called twice
61 m_kwordDocument = &doc;
62
63 // ### TODO: return value
64 postParsePictures( store );
65 // ### TODO
66
67 return 1;
68}