filters

kword13postparsing.cpp

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2004 Nicolas GOUTTE <goutte@kde.org>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include <qstring.h>
00022 #include <qdict.h>
00023 
00024 #include <kdebug.h>
00025 
00026 #include <KoStore.h>
00027 
00028 #include "kword13picture.h"
00029 #include "kword13document.h"
00030 #include "kword13postparsing.h"
00031 
00032 KWord13PostParsing::KWord13PostParsing(void) : m_kwordDocument( 0 )
00033 {
00034 }
00035 
00036 KWord13PostParsing::~KWord13PostParsing(void)
00037 {
00038 }
00039 
00040 bool KWord13PostParsing::postParsePictures( KoStore* store )
00041 {
00042     if ( ! m_kwordDocument )
00043         return false;
00044         
00045     for ( QDictIterator<KWord13Picture> it( m_kwordDocument->m_pictureDict ) ; it.current(); ++it )
00046     {
00047         kdDebug(30520) << "Loading... " << it.currentKey() << endl;
00048         if ( ! it.current()->loadPicture( store ) )
00049         {
00050             kdWarning(30520) << "Could not load picture!" << endl;
00051             return false;
00052         }
00053     }
00054     return true;
00055 }
00056 
00057 
00058 bool KWord13PostParsing::postParse( KoStore* store, KWord13Document& doc )
00059 {
00060     // ### TODO: check if it is the same document if called twice
00061     m_kwordDocument = &doc;
00062     
00063     // ### TODO: return value
00064     postParsePictures( store );
00065     // ### TODO
00066     
00067     return 1;
00068 }
KDE Home | KDE Accessibility Home | Description of Access Keys