diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-05-23 20:48:35 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-05-29 15:16:28 +0900 |
commit | 8b78a8791bc539bcffe7159f9d9714d577cb3d7d (patch) | |
tree | 1328291f966f19a22d7b13657d3f01a588eb1083 /filters/kword/libexport/KWEFStructures.cpp | |
parent | 95834e2bdc5e01ae1bd21ac0dfa4fa1d2417fae9 (diff) | |
download | koffice-8b78a8791bc539bcffe7159f9d9714d577cb3d7d.tar.gz koffice-8b78a8791bc539bcffe7159f9d9714d577cb3d7d.zip |
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'filters/kword/libexport/KWEFStructures.cpp')
-rw-r--r-- | filters/kword/libexport/KWEFStructures.cpp | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/filters/kword/libexport/KWEFStructures.cpp b/filters/kword/libexport/KWEFStructures.cpp new file mode 100644 index 000000000..6c9c301f2 --- /dev/null +++ b/filters/kword/libexport/KWEFStructures.cpp @@ -0,0 +1,208 @@ +/* + This file is part of the KDE project + Copyright (C) 2001, 2002, 2004 Nicolas GOUTTE <goutte@kde.org> + Copyright (c) 2001 IABG mbH. All rights reserved. + Contact: Wolf-Michael Bolle <Bolle@IABG.de> + + 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. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +/* + Part of the code is based on code licensed under the terms of the + GNU Library General Public License version 2: + Copyright 2001 Michael Johnson <mikej@xnet.com> +*/ + +#include <kdebug.h> + +#include "KWEFStructures.h" + + +TableCell::~TableCell ( void ) +{ +#if 0 + if ( paraList) delete paraList; +#endif +} + +void Table::addCell ( int c, int r, int _cols, int _rows, TQValueList<ParaData> &p, FrameData &frameData ) +{ + if ( c + _cols > cols ) + { + cols = c + _cols; + } + + cellList << TableCell ( c, r, _cols, _rows, new TQValueList<ParaData> (p), frameData ); +} + +bool TabulatorData::operator == (const TabulatorData& other) const +{ + return ((m_type==other.m_type) + && (m_ptpos==other.m_ptpos) + && (m_filling==other.m_filling) + && (m_width==other.m_width)); +} + +void VariableData::setLink(const TQString& linkName, const TQString& hrefName) +{ + propertyMap["link:linkName"]=linkName; + propertyMap["link:hrefName"]=hrefName; +} + +TQString VariableData::getLinkName(void) const +{ + return propertyMap["link:linkName"]; +} + +TQString VariableData::getHrefName(void) const +{ + return propertyMap["link:hrefName"]; +} + +void VariableData::setPgNum(const TQString& subtype, const TQString& value) +{ + propertyMap["pgnum:subtype"]=subtype; + propertyMap["pgnum:value"]=value; +} + +bool VariableData::isPageNumber(void) const +{ + const int num=propertyMap["pgnum:subtype"].toInt(); + return (num==0); +} + +bool VariableData::isPageCount(void) const +{ + const int num=propertyMap["pgnum:subtype"].toInt(); + return (num==1); +} + +void VariableData::setField(const TQString& name, const TQString& value) +{ + propertyMap["field:name"]=name; + propertyMap["field:value"]=value; +} + +TQString VariableData::getFieldName(void) const +{ + return propertyMap["field:name"]; +} + +TQString VariableData::getFieldValue(void) const +{ + return propertyMap["field:value"]; +} + +void VariableData::setFootnote( const TQString& notetype, const TQString& automatic,const TQString& value, TQValueList<ParaData>* para) +{ + propertyMap["footnote:value"] = value; + propertyMap["footnote:auto"] = automatic; + propertyMap["footnote:notetype"] = notetype; + footnotePara = para; +} + +bool VariableData::getFootnoteAuto(void) const +{ + return propertyMap["footnote:auto"]=="auto"; +} + +TQString VariableData::getFootnoteValue(void) const +{ + return propertyMap["footnote:value"]; +} + +bool VariableData::getFootnoteType( void ) const +{ + return propertyMap["footnote:notetype"] == "footnote"; +} + +TQValueList<ParaData>* VariableData::getFootnotePara(void) const +{ + return footnotePara; +} + +void VariableData::setGenericData( const TQString& key, const TQString& data ) +{ + propertyMap[ key ] = data ; +} + +TQString VariableData::getGenericData( const TQString& key ) const +{ + return propertyMap[ key ]; +} + +Bookmark::Bookmark() + : m_startparag(-1), m_endparag(-1), m_cursorIndexStart(-1), m_cursorIndexEnd(-1) +{ +} + +void CreateMissingFormatData (TQString ¶Text, ValueListFormatData ¶FormatDataList) +{ + ValueListFormatData::Iterator paraFormatDataIt; + int lastPos=0; // last position + + for (paraFormatDataIt = paraFormatDataList.begin (); + paraFormatDataIt != paraFormatDataList.end (); + paraFormatDataIt++) + { + if ( (*paraFormatDataIt).pos > lastPos ) + { +#if 0 + kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos + << ", pos = " << (*paraFormatDataIt).pos + << ", len = " << (*paraFormatDataIt).len << " (bad)" << endl; +#endif + + // We must add a FormatData + paraFormatDataList.insert ( paraFormatDataIt, + FormatData ( lastPos, (*paraFormatDataIt).pos - lastPos, true ) ); + } +#if 0 + else + { + kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos + << ", pos = " << (*paraFormatDataIt).pos + << ", len = " << (*paraFormatDataIt).len << " (ok)" << endl; + } +#endif + + + /* A check for pos < lastPos might be interesting at this point */ + + + lastPos = (*paraFormatDataIt).pos + (*paraFormatDataIt).len; + + } + + // Add the last one if needed + if ( (int) paraText.length () > lastPos ) + { +#if 0 + kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos + << ", total len = " << paraText.length () << " (bad)" << endl; +#endif + + paraFormatDataList.append ( + FormatData ( lastPos, paraText.length () - lastPos, true ) ); + } +#if 0 + else + { + kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos + << ", total len = " << paraText.length () << " (ok)" << endl; + } +#endif +} |