Warning, file /office/calligra/filters/sheets/latex/export/document.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* TODO : Manage File problems !
0002  */
0003 /*
0004 ** A program to convert the XML rendered by Words into LATEX.
0005 **
0006 ** SPDX-FileCopyrightText: 2000, 2003 Robert JACOLIN
0007 **
0008 ** This library is free software; you can redistribute it and/or
0009 ** modify it under the terms of the GNU Library General Public
0010 ** License as published by the Free Software Foundation; either
0011 ** version 2 of the License, or (at your option) any later version.
0012 **
0013 ** This library is distributed in the hope that it will be useful,
0014 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
0015 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016 ** Library General Public License for more details.
0017 **
0018 ** To receive a copy of the GNU Library General Public License, write to the
0019 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020  * Boston, MA 02110-1301, USA.
0021 **
0022 */
0023 
0024 #include "document.h"
0025 
0026 #include "LatexDebug.h"
0027 
0028 Document::Document(const KoStore* in, QString fileOut):
0029         XmlParser(in), _file(fileOut)
0030 {
0031     //debugLatex << fileIn;
0032     debugLatex << fileOut;
0033     _filename = fileOut;
0034     //setFileHeader(_fileHeader);
0035     //setRoot(&_document);
0036     Config::instance()->setEmbeded(false);
0037     //analyze_config(config);
0038 }
0039 
0040 Document::~Document()
0041 {
0042 
0043 }
0044 
0045 void Document::analyze()
0046 {
0047     QDomNode node;
0048     node = init();
0049     debugLatex << "ANALYZE A DOC";
0050     _document.analyze(node);
0051     debugLatex << "END ANALYZE";
0052 }
0053 
0054 void Document::generate()
0055 {
0056     if (_file.open(QIODevice::WriteOnly)) {
0057         debugLatex << "GENERATION";
0058         _out.setDevice(&_file);
0059         _document.generate(_out, !isEmbeded());
0060         //_out << getDocument();
0061         _file.close();
0062     } else
0063         debugLatex << "Can't use the file ...";
0064 }