~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kword/filters/mif/generate_xml.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: generate_xml.cpp,v 1.5 1999/10/20 10:24:55 kulow Exp $
2
 
 *
3
 
 * This file is part of MIFParse, a MIF parser for Unix.
4
 
 *
5
 
 * Copyright (C) 1998 by Matthias Kalle Dalheimer <kalle@dalheimer.de>
6
 
 */
7
 
 
8
 
#include "generate_xml.h"
9
 
#include "generate_xml_textflow.h"
10
 
#include "generate_xml_document.h"
11
 
#include "unitconv.h"
12
 
#include <fstream>
13
 
#include <algorithm>
14
 
 
15
 
ofstream xmloutstr;
16
 
unsigned int indent = 0;
17
 
 
18
 
void generate_xml( const char* outfile )
19
 
{
20
 
        xmloutstr.open( outfile );
21
 
        if( !xmloutstr.is_open() ) {
22
 
                cerr << "Could not open outfile " << outfile << '\n';
23
 
        }
24
 
 
25
 
        // generate_header
26
 
        xmloutstr << "<?xml version=\"1.0\"?>\n";
27
 
        xmloutstr << "<DOC author=\"Kalle Dalheimer\" email=\"kalle@kde.org\" editor=\"KWord/MIF-Filter\" mime=\"application/x-kword\">" << endl;
28
 
        // PENDING(kalle) Don't hard-code those values
29
 
 
30
 
        xmloutstr << " <PAPER format=\"1\" width=\"";
31
 
        xmloutstr << point2mm( generate_xml_document::paperWidth() );
32
 
        xmloutstr << "\" height=\"";
33
 
        xmloutstr << point2mm( generate_xml_document::paperHeight() );
34
 
        xmloutstr << "\" orientation=\"0\" columns=\"1\" columnspacing=\"3\">" << endl;
35
 
        xmloutstr << " </PAPER>";
36
 
        xmloutstr << " <ATTRIBUTES processing=\"1\" standardpage=\"1\"/>"
37
 
                          << endl;
38
 
        indent += 2;
39
 
 
40
 
        // write out framesets tag
41
 
        xmloutstr << " <FRAMESETS>" << endl;
42
 
 
43
 
        // Traverse all text flow elements
44
 
        QListIterator<TextFlow> tfi( textflows );
45
 
        TextFlow* tf = tfi.current();
46
 
        while( tf ) {
47
 
                ++tfi;
48
 
                generate_xml_textflow::generate( tf );
49
 
                tf = tfi.current();
50
 
        }
51
 
 
52
 
        // write out /framesets tag
53
 
        xmloutstr << " </FRAMESETS>" << endl;
54
 
 
55
 
        xmloutstr << "</DOC>";
56
 
        xmloutstr.close();
57
 
}
58
 
 
59