filters
filterbase.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <filterbase.h>
00021
00022 FilterBase::FilterBase() : QObject() {
00023 m_success=true;
00024 m_ready=false;
00025 }
00026
00027 FilterBase::FilterBase(QStringList &oleStreams) : QObject() {
00028 FilterBase();
00029 m_oleStreams = oleStreams;
00030 }
00031
00032 bool FilterBase::filter() {
00033 QString newstr;
00034
00035
00036
00037 const unsigned height = 841;
00038 const unsigned width = 595;
00039 const unsigned hMargin = 28;
00040 const unsigned vMargin = 42;
00041
00042 newstr = QString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE DOC >\n"
00043 "<DOC author=\"Reginald Stadlbauer and Torben Weis\" email=\"reggie@kde.org and weis@kde.org\" editor=\"KWord\" mime=\"application/x-kword\">\n"
00044 " <PAPER format=\"1\" ptWidth=\"595\" ptHeight=\"841\" mmWidth =\"210\" mmHeight=\"297\" inchWidth =\"8.26772\" inchHeight=\"11.6929\" orientation=\"0\" columns=\"1\" ptColumnspc=\"2\" mmColumnspc=\"1\" inchColumnspc=\"0.0393701\" hType=\"0\" fType=\"0\" ptHeadBody=\"9\" ptFootBody=\"9\" mmHeadBody=\"3.5\" mmFootBody=\"3.5\" inchHeadBody=\"0.137795\" inchFootBody=\"0.137795\">\n"
00045 " <PAPERBORDERS mmLeft=\"10\" mmTop=\"15\" mmRight=\"10\" mmBottom=\"15\" ptLeft=\"");
00046 newstr.append(QString::number(hMargin));
00047 newstr.append("\" ptTop=\"");
00048 newstr.append(QString::number(vMargin));
00049 newstr.append("\" ptRight=\"");
00050 newstr.append(QString::number(hMargin));
00051 newstr.append("\" ptBottom=\"");
00052 newstr.append(QString::number(vMargin));
00053 newstr.append("\" inchLeft=\"0.393701\" inchTop=\"0.590551\" inchRight=\"0.393701\" inchBottom=\"0.590551\"/>\n"
00054 " </PAPER>\n"
00055 " <ATTRIBUTES processing=\"0\" standardpage=\"1\" hasHeader=\"0\" hasFooter=\"0\" unit=\"mm\"/>\n"
00056 " <FOOTNOTEMGR>\n"
00057 " <START value=\"1\"/>\n"
00058 " <FORMAT superscript=\"1\" type=\"1\"/>\n"
00059 " <FIRSTPARAG ref=\"(null)\"/>\n"
00060 " </FOOTNOTEMGR>\n"
00061 " <FRAMESETS>\n");
00062 newstr.append(
00063 " <FRAMESET frameType=\"1\" frameInfo=\"0\" removeable=\"0\" visible=\"1\">\n"
00064 " <FRAME left=\"");
00065 newstr.append(QString::number(hMargin));
00066 newstr.append("\" top=\"");
00067 newstr.append(QString::number(vMargin));
00068 newstr.append("\" right=\"");
00069 newstr.append(QString::number(width - hMargin));
00070 newstr.append("\" bottom=\"");
00071 newstr.append(QString::number(height - vMargin));
00072 newstr.append("\" runaround=\"1\" runaGapPT=\"2\" runaGapMM=\"1\" runaGapINCH=\"0.0393701\" lWidth=\"1\" lRed=\"255\" lGreen=\"255\" lBlue=\"255\" lStyle=\"0\" rWidth=\"1\" rRed=\"255\" rGreen=\"255\" rBlue=\"255\" rStyle=\"0\" tWidth=\"1\" tRed=\"255\" tGreen=\"255\" tBlue=\"255\" tStyle=\"0\" bWidth=\"1\" bRed=\"255\" bGreen=\"255\" bBlue=\"255\" bStyle=\"0\" bkRed=\"255\" bkGreen=\"255\" bkBlue=\"255\" bleftpt=\"0\" bleftmm=\"0\" bleftinch=\"0\" brightpt=\"0\" brightmm=\"0\" brightinch=\"0\" btoppt=\"0\" btopmm=\"0\" btopinch=\"0\" bbottompt=\"0\" bbottommm=\"0\" bbottominch=\"0");
00073 newstr.append("\" autoCreateNewFrame=\"1\" newFrameBehaviour=\"0\"/>\n"
00074 " <PARAGRAPH>\n"
00075 " <TEXT>");
00076 newstr.append("Cannot import OLE streams of type: ");
00077 newstr.append(m_oleStreams.join(","));
00078 newstr.append("</TEXT>\n"
00079 " </PARAGRAPH>\n"
00080 " </FRAMESET>\n");
00081 newstr.append(
00082 " </FRAMESETS>\n"
00083 "</DOC>\n");
00084 m_part=QDomDocument("doc");
00085 m_part.setContent(newstr);
00086 m_success=true;
00087 m_ready=true;
00088 return m_success;
00089 }
00090
00091 #include <filterbase.moc>
|