diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /filters/kspread/latex/export/cell.cc | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filters/kspread/latex/export/cell.cc')
-rw-r--r-- | filters/kspread/latex/export/cell.cc | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/filters/kspread/latex/export/cell.cc b/filters/kspread/latex/export/cell.cc new file mode 100644 index 000000000..81e2e7fdb --- /dev/null +++ b/filters/kspread/latex/export/cell.cc @@ -0,0 +1,132 @@ +/* +** A program to convert the XML rendered by KSpread into LATEX. +** +** Copyright (C) 2002, 2003 Robert JACOLIN +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Library General Public +** License as published by the Free Software Foundation; either +** version 2 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Library General Public License for more details. +** +** To receive a copy of the GNU Library General Public License, write to the +** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +** +*/ + +#include <kdebug.h> /* for kdDebug stream */ + +#include "cell.h" +#include "table.h" +#include "column.h" + +/*******************************************/ +/* Constructor */ +/*******************************************/ +Cell::Cell(): Format() +{ + setCol(0); + setRow(0); + setText(""); + setTextDataType("none"); + setResultDataType("none"); +} + +/*******************************************/ +/* Destructor */ +/*******************************************/ +Cell::~Cell() +{ +} + +void Cell::analyse(const QDomNode balise) +{ + _row = getAttr(balise, "row").toLong(); + _col = getAttr(balise, "column").toLong(); + kdDebug(30522) << getRow() << "-" << getCol() << endl; + Format::analyse(getChild(balise, "format")); + analyseText(balise); +} + +void Cell::analyseText(const QDomNode balise) +{ + setTextDataType( getAttr(getChild(balise, "text"), "dataType")); + setText(getData(balise, "text")); + kdDebug(30522) << "text(" << getTextDataType() << "): " << getText() << endl; +} + +/*******************************************/ +/* generate */ +/*******************************************/ +void Cell::generate(QTextStream& out, Table* table) +{ + /*if(getMulticol() > 0) + out << "\\multicol{" << getMulticol() << "}{"; + else*/ if (getMultirow() > 0) + out << "\\multirow{" << getMultirow() << "}{"; + kdDebug(30522) << "Generate cell..." << endl; + + out << "\\multicolumn{1}{"; + Format::generate(out, table->searchColumn(_col)); + out << "}{" << endl; + + if(getTextDataType() == "Str") + { + generateTextFormat(out, getText()); + //out << getText(); + } + + out << "}" << endl; + + /*if(getColSpan() > 0) + out << "}" << endl; + else*/ if (getMultirow() > 0) + out << "}" << endl; + + /*Element* elt = 0; + kdDebug(30522) << "GENERATION OF A TABLE " << count() << endl; + out << endl << "\\begin{tabular}"; + generateCellHeader(out); + out << endl; + indent(); + + int row= 0; + while(row <= getMaxRow()) + { + generateTopLineBorder(out, row); + for(int col= 0; col <= getMaxCol(); col++) + { + writeIndent(out); + */ + /* Search the cell in the list */ + /* elt = searchCell(row, col); + + out << "\\multicolumn{1}{"; + if(elt->hasLeftBorder()) + out << "|"; + out << "m{" << getCellSize(col) << "pt}"; + + if(elt->hasRightBorder()) + out << "|"; + out << "}{" << endl; + + generateCell(out, row, col); + out << "}" << endl; + if(col < getMaxCol()) + out << "&" << endl; + } + out << "\\\\" << endl; + writeIndent(out); + row = row + 1; + } + generateBottomLineBorder(out, row - 1); + out << "\\end{tabular}" << endl << endl; + desindent();*/ + kdDebug(30522) << "END OF GENERATINO OF A CELL" << endl; +} + |