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

List:       kde-commits
Subject:    branches/work/koffice-essen
From:       Carlos Licea <carlos_licea () hotmail ! com>
Date:       2010-11-10 4:30:07
Message-ID: 20101110043007.BB0D3AC8A1 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1194915 by clicea:

Implement KoRowStyle. I swear I had already implemented it, but it fell off in the git cracks
somehow.

 M  +1 -2      filters/libmsooxml/MsooXmlDrawingReaderTableImpl.h  
 A             libs/odf/KoRowStyle.cpp   [License: LGPL (v2+)]
 M  +41 -18    libs/odf/KoRowStyle.h  


--- branches/work/koffice-essen/filters/libmsooxml/MsooXmlDrawingReaderTableImpl.h #1194914:1194915
@@ -122,9 +122,8 @@
     const QXmlStreamAttributes attrs(attributes());
 
     TRY_READ_ATTR_WITHOUT_NS(w)
-    const QString widthCm(MSOOXML::Utils::EMU_to_ODF(w));
 
-    const qreal columnWidth = widthCm.left(widthCm.length()-2).toFloat();
+    const qreal columnWidth = EMU_TO_POINT(w.toFloat());
 
     KoColumn* column = m_table->columnAt(m_currentTableColumnNumber++);
     KoColumnStyle::Ptr style = KoColumnStyle::create();
--- branches/work/koffice-essen/libs/odf/KoRowStyle.h #1194914:1194915
@@ -16,24 +16,29 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifndef KOSTYLE_H
-#define KOSTYLE_H
+#ifndef KOROWSTYLE_H
+#define KOROWSTYLE_H
 
 #include "KoStyle.h"
+#include "koodf_export.h"
 
+#include <QColor>
+
 /**
- * A \class KoRowStyle represents a style of a row to be applied to one or more row.
+ * A \class KoRowStyle represents a style of a row to be applied to one or more rows.
  * 
  * As all the styles it can be shared
  */
 
-class KoRowStyle : public KoStyle
+class KOODF_EXPORT KoRowStyle : public KoStyle
 {
+    KoRowStyle();
+
 public:
-    KoRowStyle();
+    KOSTYLE_DECLARE_SHARED_POINTER(KoRowStyle)
     ~KoRowStyle();
 
-    void setBackgroundColor(QColor color);
+    void setBackgroundColor(const QColor& color);
     QColor backgroundColor() const;
 
     enum HeightType{
@@ -45,27 +50,45 @@
     void setHeightType(HeightType type);
     qreal height() const;
 
-    void setBreakBefore(bool breakBefore);
-    bool breakBefore() const;
+    enum BreakType {
+        NoBreak,
+        AutoBreak,
+        ColumnBreak,
+        PageBreak
+    };
+    void setBreakBefore(BreakType breakBefore);
+    BreakType breakBefore() const;
 
-    void setBreakAfter(bool breakAfter);
-    bool breakAfter() const;
+    void setBreakAfter(BreakType breakAfter);
+    BreakType breakAfter() const;
 
-    void setKeepTogether(bool keepTogether);
-    bool keepTogether() const;
+    enum KeepTogetherType {
+        DontKeepTogether,
+        AutoKeepTogether,
+        AlwaysKeeptogether
+    };
+    void setKeepTogether(KeepTogetherType keepTogether);
+    KeepTogetherType keepTogether() const;
 
-    void setBackgroundImage(Image image);
-    Image backgroundImage() const;
+//     void setBackgroundImage(Image image);
+//     Image backgroundImage() const;
 
+protected:
+    virtual KoGenStyle::Type automaticstyleType() const;
+    virtual QString defaultPrefix() const;
+    virtual void prepareStyle(KoGenStyle& style) const;
+    virtual const char* styleFamilyName() const;
+    virtual KoGenStyle::Type styleType() const;
+
 private:
     QColor m_backgroundColor;
-    Image* m_image;
+//     Image* m_image;
 
     qreal m_height;
     HeightType m_heightType;
-    bool m_breakAfter;
-    bool m_breakBhefore;
-    bool m_keepTogether;
+    BreakType m_breakAfter;
+    BreakType m_breakBefore;
+    KeepTogetherType m_keepTogether;
 };
 
 #endif
[prev in list] [next in list] [prev in thread] [next in thread] 

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