[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra] sheets: move conditions to the odf dir
From:       Tomas Mecir <mecirt () gmail ! com>
Date:       2016-03-06 17:21:13
Message-ID: E1accMj-0005vS-4D () scm ! kde ! org
[Download RAW message or body]

Git commit b2dff11fc01d2876dfb588cc18ad786bf364730a by Tomas Mecir.
Committed on 05/03/2016 at 17:08.
Pushed by mecir into branch 'master'.

move conditions to the odf dir

M  +1    -0    sheets/CMakeLists.txt
M  +2    -179  sheets/Condition.cpp
M  +5    -39   sheets/Condition.h
M  +1    -2    sheets/odf/SheetsOdfCell.cpp
A  +225  -0    sheets/odf/SheetsOdfCondition.cpp     [License: LGPL (v2+)]
M  +10   -0    sheets/odf/SheetsOdfPrivate.h
M  +2    -4    sheets/odf/SheetsOdfStyle.cpp

http://commits.kde.org/calligra/b2dff11fc01d2876dfb588cc18ad786bf364730a

diff --git a/sheets/CMakeLists.txt b/sheets/CMakeLists.txt
index 5947343..b986481 100644
--- a/sheets/CMakeLists.txt
+++ b/sheets/CMakeLists.txt
@@ -152,6 +152,7 @@ set (odf_DIR_SRCS
     odf/SheetsOdfCell.cpp
     odf/SheetsOdfStyle.cpp
     odf/SheetsOdfRegion.cpp
+    odf/SheetsOdfCondition.cpp
     )
 
 set (part_DIR_SRCS
diff --git a/sheets/Condition.cpp b/sheets/Condition.cpp
index 5c364d4..a886e09 100644
--- a/sheets/Condition.cpp
+++ b/sheets/Condition.cpp
@@ -34,13 +34,10 @@
 #include "Sheet.h"
 #include "Style.h"
 #include "StyleManager.h"
-#include "Util.h"
 #include "ValueCalc.h"
 #include "ValueConverter.h"
 #include "ValueParser.h"
 
-#include <KoGenStyles.h>
-#include <KoXmlNS.h>
 
 #include <QDomDocument>
 
@@ -287,71 +284,9 @@ void Conditions::setDefaultStyle(const Style &style)
     d->defaultStyle = style;
 }
 
-void Conditions::saveOdfConditions(KoGenStyle &currentCellStyle, ValueConverter \
*converter) const +void Conditions::addCondition(Conditional cond)
 {
-    //todo fix me with kspread old format!!!
-    if (d->conditionList.isEmpty())
-        return;
-    QLinkedList<Conditional>::const_iterator it;
-    int i = 0;
-    for (it = d->conditionList.begin(); it != d->conditionList.end(); ++it, ++i) {
-        Conditional condition = *it;
-        //<style:map style:condition="cell-content()=45" \
                style:apply-style-name="Default" \
                style:base-cell-address="Sheet1.E10"/>
-        QMap<QString, QString> map;
-        map.insert("style:condition", saveOdfConditionValue(condition, converter));
-        map.insert("style:apply-style-name", condition.styleName);
-        if (!condition.baseCellAddress.isEmpty())
-            map.insert("style:base-cell-address", condition.baseCellAddress);
-        currentCellStyle.addStyleMap(map);
-    }
-}
-
-QString Conditions::saveOdfConditionValue(const Conditional &condition, \
                ValueConverter* converter) const
-{
-    //we can also compare text value.
-    //todo adapt it.
-    QString value;
-    switch (condition.cond) {
-    case Conditional::None:
-        break;
-    case Conditional::Equal:
-        value = "cell-content()=" + \
                converter->asString(condition.value1).asStringWithDoubleQuotes();
-        break;
-    case Conditional::Superior:
-        value = "cell-content()>" + \
                converter->asString(condition.value1).asStringWithDoubleQuotes();
-        break;
-    case Conditional::Inferior:
-        value = "cell-content()<" + \
                converter->asString(condition.value1).asStringWithDoubleQuotes();
-        break;
-    case Conditional::SuperiorEqual:
-        value = "cell-content()>=" + \
                converter->asString(condition.value1).asStringWithDoubleQuotes();
-        break;
-    case Conditional::InferiorEqual:
-        value = "cell-content()<=" + \
                converter->asString(condition.value1).asStringWithDoubleQuotes();
-        break;
-    case Conditional::Between:
-        value = "cell-content-is-between(" +
-                converter->asString(condition.value1).asStringWithDoubleQuotes() +
-                ',' +
-                converter->asString(condition.value2).asStringWithDoubleQuotes() +
-                ')';
-        break;
-    case Conditional::DifferentTo:
-        value = "cell-content()!=" + \
                converter->asString(condition.value1).asStringWithDoubleQuotes();
-        break;
-    case Conditional::Different:
-        value = "cell-content-is-not-between(" +
-                converter->asString(condition.value1).asStringWithDoubleQuotes() +
-                ',' +
-                converter->asString(condition.value2).asStringWithDoubleQuotes() +
-                ')';
-        break;
-    case Conditional::IsTrueFormula:
-        value = "is-true-formula(" +
-                Odf::encodeFormula(condition.value1.asString()) +
-                ')';
-    }
-    return value;
+    d->conditionList.append(cond);
 }
 
 
@@ -403,118 +338,6 @@ QDomElement Conditions::saveConditions(QDomDocument &doc, \
ValueConverter *conver  }
 }
 
-Conditional Conditions::loadOdfCondition(const QString &conditionValue, const \
                QString &applyStyleName,
-                                         const QString& baseCellAddress, const \
                ValueParser *parser)
-{
-    //debugSheetsODF << "\tcondition:" << conditionValue;
-    Conditional newCondition;
-    loadOdfConditionValue(conditionValue, newCondition, parser);
-    if (!applyStyleName.isNull()) {
-        //debugSheetsODF << "\tstyle:" << applyStyleName;
-        newCondition.styleName = applyStyleName;
-    }
-    newCondition.baseCellAddress = baseCellAddress;
-    d->conditionList.append(newCondition);
-    return newCondition;
-}
-
-void Conditions::loadOdfConditions(const KoXmlElement &element, const ValueParser \
                *parser, const StyleManager *styleManager)
-{
-    debugSheetsODF << "Loading conditional styles";
-    KoXmlNode node(element);
-
-    while (!node.isNull()) {
-        KoXmlElement elementItem = node.toElement();
-        if (elementItem.tagName() == "map" && elementItem.namespaceURI() == \
                KoXmlNS::style) {
-            QString conditionValue = elementItem.attributeNS(KoXmlNS::style, \
                "condition", QString());
-            QString applyStyleName;
-            if (elementItem.hasAttributeNS(KoXmlNS::style, "apply-style-name"))
-                applyStyleName = elementItem.attributeNS(KoXmlNS::style, \
                "apply-style-name", QString());
-            if (!applyStyleName.isEmpty() && styleManager) {
-                QString odfStyle = styleManager->openDocumentName(applyStyleName);
-                if (!odfStyle.isEmpty()) applyStyleName = odfStyle;
-            }
-            QString baseCellAddress = elementItem.attributeNS(KoXmlNS::style, \
                "base-cell-address");
-            loadOdfCondition(conditionValue, applyStyleName, baseCellAddress, \
                parser);
-        }
-        node = node.nextSibling();
-    }
-}
-
-void Conditions::loadOdfConditionValue(const QString &styleCondition, Conditional \
                &newCondition, const ValueParser *parser)
-{
-    QString val(styleCondition);
-    if (val.contains("cell-content()")) {
-        val.remove("cell-content()");
-        loadOdfCondition(val, newCondition, parser);
-    } else if (val.contains("value()")) {
-        val.remove("value()");
-        loadOdfCondition(val, newCondition, parser);
-    }
-
-    //GetFunction ::= cell-content-is-between(Value, Value) | \
                cell-content-is-not-between(Value, Value)
-    //for the moment we support just int/double value, not text/date/time :(
-    if (val.contains("cell-content-is-between(")) {
-        val.remove("cell-content-is-between(");
-        val.remove(')');
-        QStringList listVal = val.split(',', QString::SkipEmptyParts);
-        loadOdfValidationValue(listVal, newCondition, parser);
-        newCondition.cond = Conditional::Between;
-    } else if (val.contains("cell-content-is-not-between(")) {
-        val.remove("cell-content-is-not-between(");
-        val.remove(')');
-        QStringList listVal = val.split(',', QString::SkipEmptyParts);
-        loadOdfValidationValue(listVal, newCondition, parser);
-        newCondition.cond = Conditional::Different;
-    } else if (val.startsWith(QLatin1String("is-true-formula("))) {
-        val.remove(0, 16);
-        if (val.endsWith(QLatin1Char(')'))) val.chop(1);
-        newCondition.cond = Conditional::IsTrueFormula;
-        newCondition.value1 = Value(Odf::decodeFormula(val));
-    }
-}
-
-void Conditions::loadOdfCondition(QString &valExpression, Conditional &newCondition, \
                const ValueParser *parser)
-{
-    QString value;
-    if (valExpression.indexOf("<=") == 0) {
-        value = valExpression.remove(0, 2);
-        newCondition.cond = Conditional::InferiorEqual;
-    } else if (valExpression.indexOf(">=") == 0) {
-        value = valExpression.remove(0, 2);
-        newCondition.cond = Conditional::SuperiorEqual;
-    } else if (valExpression.indexOf("!=") == 0) {
-        //add Differentto attribute
-        value = valExpression.remove(0, 2);
-        newCondition.cond = Conditional::DifferentTo;
-    } else if (valExpression.indexOf('<') == 0) {
-        value = valExpression.remove(0, 1);
-        newCondition.cond = Conditional::Inferior;
-    } else if (valExpression.indexOf('>') == 0) {
-        value = valExpression.remove(0, 1);
-        newCondition.cond = Conditional::Superior;
-    } else if (valExpression.indexOf('=') == 0) {
-        value = valExpression.remove(0, 1);
-        newCondition.cond = Conditional::Equal;
-    } else {
-        warnSheets << " I don't know how to parse it :" << valExpression;
-    }
-    //debugSheetsODF << "\tvalue:" << value;
-
-    if (value.length() > 1 && value[0] == '"' && value[value.length()-1] == '"') {
-        newCondition.value1 = Value(value.mid(1, value.length()-2));
-    } else {
-        newCondition.value1 = parser->parse(value);
-    }
-}
-
-void Conditions::loadOdfValidationValue(const QStringList &listVal, Conditional \
                &newCondition, const ValueParser *parser)
-{
-    debugSheetsODF << " listVal[0] :" << listVal[0] << " listVal[1] :" << \
                listVal[1];
-    newCondition.value1 = parser->parse(listVal[0]);
-    newCondition.value2 = parser->parse(listVal[1]);
-}
-
 void Conditions::loadConditions(const KoXmlElement &element, const ValueParser \
*parser)  {
     Conditional newCondition;
diff --git a/sheets/Condition.h b/sheets/Condition.h
index 30a8edf..4a6c39b 100644
--- a/sheets/Condition.h
+++ b/sheets/Condition.h
@@ -119,6 +119,11 @@ public:
     void setConditionList(const QLinkedList<Conditional> & list);
 
     /**
+      * Add a new condition.
+      */
+    void addCondition(Conditional cond);
+
+    /**
      * Returns an optional default style, which is returned by testConditons if none \
                of
      * the conditions matches.
      */
@@ -144,25 +149,6 @@ public:
      */
     QDomElement saveConditions(QDomDocument &doc, ValueConverter *converter) const;
 
-    /**
-     * \ingroup OpenDocument
-     * Loads the condtional formatting.
-     */
-    Conditional loadOdfCondition(const QString &conditionValue, const QString \
                &applyStyleName,
-                                 const QString &baseCellAddress, const ValueParser \
                *parser);
-
-    /**
-     * \ingroup OpenDocument
-     * Loads the condtional formattings.
-     */
-    void loadOdfConditions(const KoXmlElement &element, const ValueParser *parser, \
                const StyleManager* styleManager);
-
-    /**
-     * \ingroup OpenDocument
-     * Saves the condtional formattings.
-     */
-    void saveOdfConditions(KoGenStyle &currentCellStyle, ValueConverter *converter) \
                const;
-
     /// \note implementation to make QMap happy (which is needed by RectStorage)
     bool operator<(const Conditions& conditions) const {
         return qHash(*this) < qHash(conditions);
@@ -188,26 +174,6 @@ private:
 
     bool isTrueFormula(const Cell& cell, const QString& formula, const QString& \
baseCellAddress) const;  
-    /**
-     * \ingroup OpenDocument
-     */
-    void loadOdfCondition(QString &valExpression, Conditional &newCondition, const \
                ValueParser *parser);
-
-    /**
-     * \ingroup OpenDocument
-     */
-    void loadOdfConditionValue(const QString &styleCondition, Conditional \
                &newCondition, const ValueParser *parser);
-
-    /**
-     * \ingroup OpenDocument
-     */
-    void loadOdfValidationValue(const QStringList &listVal, Conditional \
                &newCondition, const ValueParser *parser);
-
-    /**
-     * \ingroup OpenDocument
-     */
-    QString saveOdfConditionValue(const Conditional &conditionalStyle, \
                ValueConverter *converter) const;
-
     class Private;
     QSharedDataPointer<Private> d;
 };
diff --git a/sheets/odf/SheetsOdfCell.cpp b/sheets/odf/SheetsOdfCell.cpp
index 02ad83a..b5d94c0 100644
--- a/sheets/odf/SheetsOdfCell.cpp
+++ b/sheets/odf/SheetsOdfCell.cpp
@@ -883,8 +883,7 @@ QString Odf::saveCellStyle(Cell *cell, KoGenStyle \
&currentCellStyle, KoGenStyles  if (!conditions.isEmpty()) {
         // this has to be an automatic style
         currentCellStyle = KoGenStyle(KoGenStyle::TableCellAutoStyle, "table-cell");
-#warning use new odf
-        conditions.saveOdfConditions(currentCellStyle, \
cell->sheet()->map()->converter()); +        saveConditions(&conditions, \
currentCellStyle, cell->sheet()->map()->converter());  }
     Style style = cell->style();
     return saveStyle(&style, currentCellStyle, mainStyles, \
                cell->sheet()->map()->styleManager());
diff --git a/sheets/odf/SheetsOdfCondition.cpp b/sheets/odf/SheetsOdfCondition.cpp
new file mode 100644
index 0000000..4c940ca
--- /dev/null
+++ b/sheets/odf/SheetsOdfCondition.cpp
@@ -0,0 +1,225 @@
+/* This file is part of the KDE project
+   Copyright 2010 Marijn Kruisselbrink <mkruisselbrink@kde.org>
+   Copyright 1998, 1999 Torben Weis <weis@kde.org>
+   Copyright 1999- 2006 The KSpread Team <calligra-devel@kde.org>
+
+   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.
+*/
+
+#include "SheetsOdf.h"
+#include "SheetsOdfPrivate.h"
+
+#include "Condition.h"
+#include "Util.h"
+#include "StyleManager.h"
+#include "ValueConverter.h"
+#include "ValueParser.h"
+
+#include <KoGenStyles.h>
+#include <KoXmlNS.h>
+
+// This file contains functionality to load/save a Condition
+
+namespace Calligra {
+namespace Sheets {
+
+namespace Odf {
+    void loadCondition(QString &valExpression, Conditional &newCondition, const \
ValueParser *parser); +    void loadConditionValue(const QString &styleCondition, \
Conditional &newCondition, const ValueParser *parser); +    void \
loadValidationValue(const QStringList &listVal, Conditional &newCondition, const \
ValueParser *parser); +    QString saveConditionValue(const Conditional \
&conditionalStyle, ValueConverter *converter); +}
+
+void Odf::saveConditions(const Conditions *conditions, KoGenStyle &currentCellStyle, \
ValueConverter *converter) +{
+    //todo fix me with kspread old format!!!
+    if (conditions->isEmpty())
+        return;
+    QLinkedList<Conditional> list = conditions->conditionList();
+    QLinkedList<Conditional>::const_iterator it;
+    int i = 0;
+    for (it = list.begin(); it != list.end(); ++it, ++i) {
+        Conditional conditional = *it;
+        //<style:map style:condition="cell-content()=45" \
style:apply-style-name="Default" style:base-cell-address="Sheet1.E10"/> +        \
QMap<QString, QString> map; +        map.insert("style:condition", \
saveConditionValue(conditional, converter)); +        \
map.insert("style:apply-style-name", conditional.styleName); +        if \
(!conditional.baseCellAddress.isEmpty()) +            \
map.insert("style:base-cell-address", conditional.baseCellAddress); +        \
currentCellStyle.addStyleMap(map); +    }
+}
+
+QString Odf::saveConditionValue(const Conditional &conditional, ValueConverter* \
converter) +{
+    //we can also compare text value.
+    //todo adapt it.
+    QString v1 = converter->asString(conditional.value1).asStringWithDoubleQuotes();
+    QString v2 = converter->asString(conditional.value2).asStringWithDoubleQuotes();
+    QString value;
+    switch (conditional.cond) {
+    case Conditional::None:
+        break;
+    case Conditional::Equal:
+        value = "cell-content()=" + v1;
+        break;
+    case Conditional::Superior:
+        value = "cell-content()>" + v1;
+        break;
+    case Conditional::Inferior:
+        value = "cell-content()<" + v1;
+        break;
+    case Conditional::SuperiorEqual:
+        value = "cell-content()>=" + v1;
+        break;
+    case Conditional::InferiorEqual:
+        value = "cell-content()<=" + v1;
+        break;
+    case Conditional::Between:
+        value = "cell-content-is-between(" + v1 + ',' + v2 + ')';
+        break;
+    case Conditional::DifferentTo:
+        value = "cell-content()!=" + v1;
+        break;
+    case Conditional::Different:
+        value = "cell-content-is-not-between(" + v1 + ',' + v2 + ')';
+        break;
+    case Conditional::IsTrueFormula:
+        value = "is-true-formula(" +
+                Odf::encodeFormula(conditional.value1.asString()) +
+                ')';
+    }
+    return value;
+}
+
+Conditional Odf::loadCondition(Conditions *condition, const QString &conditionValue, \
const QString &applyStyleName, +                                         const \
QString& baseCellAddress, const ValueParser *parser) +{
+    //debugSheetsODF << "\tcondition:" << conditionValue;
+    Conditional newCondition;
+    loadConditionValue(conditionValue, newCondition, parser);
+    if (!applyStyleName.isNull()) {
+        //debugSheetsODF << "\tstyle:" << applyStyleName;
+        newCondition.styleName = applyStyleName;
+    }
+    newCondition.baseCellAddress = baseCellAddress;
+    condition->addCondition(newCondition);
+    return newCondition;
+}
+
+void Odf::loadConditions(Conditions *condition, const KoXmlElement &element, const \
ValueParser *parser, const StyleManager *styleManager) +{
+    debugSheetsODF << "Loading conditional styles";
+    KoXmlNode node(element);
+
+    while (!node.isNull()) {
+        KoXmlElement elementItem = node.toElement();
+        if (elementItem.tagName() == "map" && elementItem.namespaceURI() == \
KoXmlNS::style) { +            QString conditionValue = \
elementItem.attributeNS(KoXmlNS::style, "condition", QString()); +            QString \
applyStyleName; +            if (elementItem.hasAttributeNS(KoXmlNS::style, \
"apply-style-name")) +                applyStyleName = \
elementItem.attributeNS(KoXmlNS::style, "apply-style-name", QString()); +            \
if (!applyStyleName.isEmpty() && styleManager) { +                QString odfStyle = \
styleManager->openDocumentName(applyStyleName); +                if \
(!odfStyle.isEmpty()) applyStyleName = odfStyle; +            }
+            QString baseCellAddress = elementItem.attributeNS(KoXmlNS::style, \
"base-cell-address"); +            loadCondition(condition, conditionValue, \
applyStyleName, baseCellAddress, parser); +        }
+        node = node.nextSibling();
+    }
+}
+
+void Odf::loadConditionValue(const QString &styleCondition, Conditional \
&newCondition, const ValueParser *parser) +{
+    QString val(styleCondition);
+    if (val.contains("cell-content()")) {
+        val.remove("cell-content()");
+        loadCondition(val, newCondition, parser);
+    } else if (val.contains("value()")) {
+        val.remove("value()");
+        loadCondition(val, newCondition, parser);
+    }
+
+    //GetFunction ::= cell-content-is-between(Value, Value) | \
cell-content-is-not-between(Value, Value) +    //for the moment we support just \
int/double value, not text/date/time :( +    if \
(val.contains("cell-content-is-between(")) { +        \
val.remove("cell-content-is-between("); +        val.remove(')');
+        QStringList listVal = val.split(',', QString::SkipEmptyParts);
+        loadValidationValue(listVal, newCondition, parser);
+        newCondition.cond = Conditional::Between;
+    } else if (val.contains("cell-content-is-not-between(")) {
+        val.remove("cell-content-is-not-between(");
+        val.remove(')');
+        QStringList listVal = val.split(',', QString::SkipEmptyParts);
+        loadValidationValue(listVal, newCondition, parser);
+        newCondition.cond = Conditional::Different;
+    } else if (val.startsWith(QLatin1String("is-true-formula("))) {
+        val.remove(0, 16);
+        if (val.endsWith(QLatin1Char(')'))) val.chop(1);
+        newCondition.cond = Conditional::IsTrueFormula;
+        newCondition.value1 = Value(Odf::decodeFormula(val));
+    }
+}
+
+void Odf::loadCondition(QString &valExpression, Conditional &newCondition, const \
ValueParser *parser) +{
+    QString value;
+    if (valExpression.indexOf("<=") == 0) {
+        value = valExpression.remove(0, 2);
+        newCondition.cond = Conditional::InferiorEqual;
+    } else if (valExpression.indexOf(">=") == 0) {
+        value = valExpression.remove(0, 2);
+        newCondition.cond = Conditional::SuperiorEqual;
+    } else if (valExpression.indexOf("!=") == 0) {
+        //add Differentto attribute
+        value = valExpression.remove(0, 2);
+        newCondition.cond = Conditional::DifferentTo;
+    } else if (valExpression.indexOf('<') == 0) {
+        value = valExpression.remove(0, 1);
+        newCondition.cond = Conditional::Inferior;
+    } else if (valExpression.indexOf('>') == 0) {
+        value = valExpression.remove(0, 1);
+        newCondition.cond = Conditional::Superior;
+    } else if (valExpression.indexOf('=') == 0) {
+        value = valExpression.remove(0, 1);
+        newCondition.cond = Conditional::Equal;
+    } else {
+        warnSheets << " I don't know how to parse it :" << valExpression;
+    }
+    //debugSheetsODF << "\tvalue:" << value;
+
+    if (value.length() > 1 && value[0] == '"' && value[value.length()-1] == '"') {
+        newCondition.value1 = Value(value.mid(1, value.length()-2));
+    } else {
+        newCondition.value1 = parser->parse(value);
+    }
+}
+
+void Odf::loadValidationValue(const QStringList &listVal, Conditional &newCondition, \
const ValueParser *parser) +{
+    debugSheetsODF << " listVal[0] :" << listVal[0] << " listVal[1] :" << \
listVal[1]; +    newCondition.value1 = parser->parse(listVal[0]);
+    newCondition.value2 = parser->parse(listVal[1]);
+}
+
+
+
+
+}  // Sheets
+}  // Calligra
+
diff --git a/sheets/odf/SheetsOdfPrivate.h b/sheets/odf/SheetsOdfPrivate.h
index 4e020b1..b936963 100644
--- a/sheets/odf/SheetsOdfPrivate.h
+++ b/sheets/odf/SheetsOdfPrivate.h
@@ -49,6 +49,8 @@ namespace Sheets {
 
 class CalculationSettings;
 class NamedAreaManager;
+class Conditions;
+class Conditional;
 
 namespace Odf {
 
@@ -97,6 +99,14 @@ namespace Odf {
     void loadDataStyle(Style *style, KoOdfStylesReader& stylesReader, const \
                KoXmlElement& element,
                              Conditions& conditions, const StyleManager* \
styleManager,  const ValueParser *parser);
+
+    // SheetsOdfCondition
+    Conditional loadCondition(Conditions *conditions, const QString &conditionValue, \
const QString &applyStyleName, +                                 const QString \
&baseCellAddress, const ValueParser *parser); +    void loadConditions(Conditions \
*conditions, const KoXmlElement &element, const ValueParser *parser, const \
StyleManager* styleManager); +    void saveConditions(const Conditions *conditions, \
KoGenStyle &currentCellStyle, ValueConverter *converter); +
+
 }
 
 }
diff --git a/sheets/odf/SheetsOdfStyle.cpp b/sheets/odf/SheetsOdfStyle.cpp
index b01b35f..e04f23d 100644
--- a/sheets/odf/SheetsOdfStyle.cpp
+++ b/sheets/odf/SheetsOdfStyle.cpp
@@ -283,8 +283,7 @@ void Odf::loadStyle(Style *style, KoOdfStylesReader& \
stylesReader, const KoXmlEl  KoXmlElement e;
     forEachElement(e, element) {
         if (e.namespaceURI() == KoXmlNS::style && e.localName() == "map")
-#warning TODO new odf
-            conditions.loadOdfConditions(e, parser, styleManager);
+            loadConditions(&conditions, e, parser, styleManager);
     }
 
     loadDataStyle(style, stylesReader, element, conditions, styleManager, parser);
@@ -328,8 +327,7 @@ void Odf::loadDataStyle(Style *style, KoOdfStylesReader \
&stylesReader, const QSt  if(styleMaps.count() > 0) {
         style = new Style();
         for (QList<QPair<QString,QString> >::const_iterator it = styleMaps.begin(); \
                it != styleMaps.end(); ++it) {
-#warning TODO new odf
-            const Conditional c = conditions.loadOdfCondition(it->first, it->second, \
QString(), parser); +            const Conditional c = loadCondition(&conditions, \
it->first, it->second, QString(), parser);  if (styleManager->style(c.styleName) == \
0) {  CustomStyle* s = new CustomStyle(c.styleName);
                 loadDataStyle(s, stylesReader, c.styleName, conditions, \
styleManager, parser);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic