equal
deleted
inserted
replaced
38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include "versitutils_p.h" |
42 #include "versitutils_p.h" |
|
43 #include "qversitdocument.h" |
|
44 #include "qversitproperty.h" |
43 #include "qmobilityglobal.h" |
45 #include "qmobilityglobal.h" |
44 |
46 |
45 #include <QMap> |
47 #include <QMap> |
46 #include <QTextCodec> |
48 #include <QTextCodec> |
47 #include <QScopedPointer> |
49 #include <QScopedPointer> |
104 m_newlineList->append(QByteArrayMatcher(encode("\n", codec))); |
106 m_newlineList->append(QByteArrayMatcher(encode("\n", codec))); |
105 m_newlineList->append(QByteArrayMatcher(encode("\r", codec))); |
107 m_newlineList->append(QByteArrayMatcher(encode("\r", codec))); |
106 |
108 |
107 m_previousCodec = codec; |
109 m_previousCodec = codec; |
108 } |
110 } |
|
111 |
|
112 /*! |
|
113 * Finds a property in the \a document with the given \a propertyName, adds it to \a toBeRemoved, |
|
114 * and returns it. |
|
115 */ |
|
116 QVersitProperty VersitUtils::takeProperty(const QVersitDocument& document, |
|
117 const QString& propertyName, |
|
118 QList<QVersitProperty>* toBeRemoved) { |
|
119 foreach (const QVersitProperty& currentProperty, document.properties()) { |
|
120 if (currentProperty.name() == propertyName) { |
|
121 *toBeRemoved << currentProperty; |
|
122 return currentProperty; |
|
123 } |
|
124 } |
|
125 return QVersitProperty(); |
|
126 } |