diff --git a/libs/flake/KoTextShapeDataBase.h b/libs/flake/KoTextShapeDataBase.h
index fcd1e64..8a60f0e 100644
--- a/libs/flake/KoTextShapeDataBase.h
+++ b/libs/flake/KoTextShapeDataBase.h
@@ -30,6 +30,7 @@ class KoTextShapeDataBasePrivate;
 class KoXmlElement;
 class KoShapeLoadingContext;
 class KoShapeSavingContext;
+class KoGenStyle;
 
 /**
  * \internal
@@ -67,6 +68,22 @@ public:
     */
     virtual void saveOdf(KoShapeSavingContext &context, int from = 0, int to  = -1) const = 0;
 
+    /**
+     * Load the style of the element
+     *
+     * This method is used to load the style in case the TextShape is used as TOS. In this case
+     * the paragraph style of the shape e.g. a custom-shape needs to be applied before we load the
+     * text so all looks as it should look.
+     */
+    virtual void loadStyle(const KoXmlElement &element, KoShapeLoadingContext &context) = 0;
+    /**
+     * Save the style of the element
+     *
+     * This method save the style in case the TextShape is used as TOS. In this case the paragraph
+     * style of the shape e.g. a custom-shape needs to be saved with the style of the shape.
+     */
+    virtual void saveStyle(KoGenStyle &style, KoShapeSavingContext &context) const = 0;
+
     /** Sets the vertical alignment of all the text inside the shape. */
     void setVerticalAlignment(Qt::Alignment alignment);
     /** Returns the vertical alignment of all the text in the shape */
diff --git a/libs/flake/KoTosContainer.cpp b/libs/flake/KoTosContainer.cpp
index 9ac96d0..e6a3539 100644
--- a/libs/flake/KoTosContainer.cpp
+++ b/libs/flake/KoTosContainer.cpp
@@ -77,6 +77,7 @@ bool KoTosContainer::loadText(const KoXmlElement &element, KoShapeLoadingContext
             // everything, so we have to use the KoTextShapeData object instead.
             KoTextShapeDataBase *shapeData = qobject_cast<KoTextShapeDataBase*>(textShape->userData());
             Q_ASSERT(shapeData);
+            shapeData->loadStyle(element, context);
             bool loadOdf = shapeData->loadOdf(element, context);
             return loadOdf;
         }
diff --git a/libs/kotext/opendocument/KoTextLoader.cpp b/libs/kotext/opendocument/KoTextLoader.cpp
index 3ea7109..7026c63 100644
--- a/libs/kotext/opendocument/KoTextLoader.cpp
+++ b/libs/kotext/opendocument/KoTextLoader.cpp
@@ -95,7 +95,7 @@
 #include <QXmlStreamReader>
 
 // if defined then debugging is enabled
-// #define KOOPENDOCUMENTLOADER_DEBUG
+#define KOOPENDOCUMENTLOADER_DEBUG
 
 /// \internal d-pointer class.
 class KoTextLoader::Private
diff --git a/libs/kotext/opendocument/KoTextSharedLoadingData.cpp b/libs/kotext/opendocument/KoTextSharedLoadingData.cpp
index 1ffe61b..84df888 100644
--- a/libs/kotext/opendocument/KoTextSharedLoadingData.cpp
+++ b/libs/kotext/opendocument/KoTextSharedLoadingData.cpp
@@ -249,6 +249,7 @@ QList<QPair<QString, KoParagraphStyle *> > KoTextSharedLoadingData::loadParagrap
     }
 
     // second pass; resolve all the 'next-style's and parent-style's.
+    // TODO iterate via values
     foreach (KoParagraphStyle *style, nextStyles.keys()) {
         KoParagraphStyle *next = d->namedParagraphStyles.value(nextStyles.value(style));
         if (next && next->styleId() >= 0)
diff --git a/libs/kotext/styles/KoCharacterStyle.cpp b/libs/kotext/styles/KoCharacterStyle.cpp
index f8afa05..a18e68a 100644
--- a/libs/kotext/styles/KoCharacterStyle.cpp
+++ b/libs/kotext/styles/KoCharacterStyle.cpp
@@ -427,6 +427,7 @@ void KoCharacterStyle::applyStyle(QTextCharFormat &format) const
     bool fontSizeSet = false; // if this style has already set size don't apply the relatives
     const QMap<int, QVariant> props = d->stylesPrivate.properties();
     QMap<int, QVariant>::const_iterator it = props.begin();
+    QList<int> clearProperty;
     while (it != props.end()) {
         if (!it.value().isNull()) {
             if (it.key() == KoCharacterStyle::PercentageFontSize && !fontSizeSet) {
@@ -447,7 +448,20 @@ void KoCharacterStyle::applyStyle(QTextCharFormat &format) const
                 }
                 format.setProperty(QTextFormat::FontPointSize, size);
             }
+            else if (it.key() == QTextFormat::FontFamily) {
+                if (!props.contains(QTextFormat::FontStyleHint)) {
+                    clearProperty.append(QTextFormat::FontStyleHint);
+                }
+                if (!props.contains(QTextFormat::FontFixedPitch)) {
+                    clearProperty.append(QTextFormat::FontFixedPitch);
+                }
+                if (!props.contains(KoCharacterStyle::FontCharset)) {
+                    clearProperty.append(KoCharacterStyle::FontCharset);
+                }
+                format.setProperty(it.key(), it.value());
+            }
             else {
+                kDebug(32500) << "setProperty" << it.key() << it.value();
                 format.setProperty(it.key(), it.value());
             }
 
@@ -456,11 +470,16 @@ void KoCharacterStyle::applyStyle(QTextCharFormat &format) const
             }
 
             if (it.key() == QTextFormat::ForegroundBrush) {
-                format.clearProperty(KoCharacterStyle::UseWindowFontColor);
+                clearProperty.append(KoCharacterStyle::UseWindowFontColor);
             }
         }
         ++it;
     }
+
+    foreach (int property, clearProperty) {
+        kDebug(32500) << "clearProperty" << property;
+        format.clearProperty(property);
+    }
 }
 
 KoCharacterStyle *KoCharacterStyle::autoStyle(const QTextCharFormat &format, QTextCharFormat blockCharFormat) const
diff --git a/libs/textlayout/KoTextShapeData.cpp b/libs/textlayout/KoTextShapeData.cpp
index 0ec0530..8f7e6b1 100644
--- a/libs/textlayout/KoTextShapeData.cpp
+++ b/libs/textlayout/KoTextShapeData.cpp
@@ -39,11 +39,13 @@
 
 #include <KoGenStyle.h>
 #include <KoGenStyles.h>
+#include <KoOdfLoadingContext.h>
 #include <KoShapeLoadingContext.h>
 #include <KoShapeSavingContext.h>
 #include <KoDocumentRdfBase.h>
 
 #include <KoXmlWriter.h>
+#include <KoXmlNS.h>
 
 #include "KoTextPage.h"
 
@@ -68,6 +70,7 @@ public:
             , direction(KoText::AutoDirection)
             , textpage(0)
             , rootArea(0)
+            , paragraphStyle(0)
     {
     }
 
@@ -83,6 +86,7 @@ public:
     KoText::Direction direction;
     KoTextPage *textpage;
     KoTextLayoutRootArea *rootArea;
+    KoParagraphStyle *paragraphStyle;
 };
 
 
@@ -207,4 +211,75 @@ void KoTextShapeData::saveOdf(KoShapeSavingContext &context, KoDocumentRdfBase *
     KoTextWriter::saveOdf(context, rdfData, d->document, from, to);
 }
 
+void KoTextShapeData::loadStyle(const KoXmlElement &element, KoShapeLoadingContext &context)
+{
+    Q_D(KoTextShapeData);
+    // load the (text) style of the frame
+    const KoXmlElement *style = 0;
+    if (element.hasAttributeNS(KoXmlNS::draw, "style-name")) {
+        style = context.odfLoadingContext().stylesReader().findStyle(
+                    element.attributeNS(KoXmlNS::draw, "style-name"), "graphic",
+                    context.odfLoadingContext().useStylesAutoStyles());
+        if (!style) {
+            kDebug(32500) << "graphic style not found:" << element.attributeNS(KoXmlNS::draw, "style-name");
+        }
+    }
+    if (element.hasAttributeNS(KoXmlNS::presentation, "style-name")) {
+        style = context.odfLoadingContext().stylesReader().findStyle(
+                    element.attributeNS(KoXmlNS::presentation, "style-name"), "presentation",
+                    context.odfLoadingContext().useStylesAutoStyles());
+        if (!style) {
+            kDebug(32500) << "presentation style not found:" << element.attributeNS(KoXmlNS::presentation, "style-name");
+        }
+    }
+
+    if (style) {
+        // graphic styles don't support inheritance yet therefor some additional work is needed here.
+        QList<KoParagraphStyle *> paragraphStyles;
+        while (style) {
+            KoParagraphStyle *pStyle = new KoParagraphStyle();
+            pStyle->loadOdf(style, context);
+            if (!paragraphStyles.isEmpty()) {
+                paragraphStyles.last()->setParentStyle(pStyle);
+            }
+            paragraphStyles.append(pStyle);
+            QString family = style->attributeNS(KoXmlNS::style, "family", "paragraph");
+            style = context.odfLoadingContext().stylesReader().findStyle(
+                    style->attributeNS(KoXmlNS::style, "parent-style-name"), family.toLocal8Bit().constData(),
+                    context.odfLoadingContext().useStylesAutoStyles());
+            if (!style && paragraphStyles.size() == 1) {
+                style = context.odfLoadingContext().stylesReader().findStyle(
+                        "standard", family.toLocal8Bit().constData(),
+                        context.odfLoadingContext().useStylesAutoStyles());
+            }
+        }
+#if 0
+        delete d->paragraphStyle;
+        d->paragraphStyle = new KoParagraphStyle();
+        d->paragraphStyle->loadOdf(style, context, true);
+#endif
+
+        QTextDocument *document = this->document();
+        QTextCursor cursor(document);
+        QTextBlockFormat format;
+        paragraphStyles.first()->applyStyle(format);
+        cursor.setBlockFormat(format);
+        QTextCharFormat cformat;
+        paragraphStyles.first()->KoCharacterStyle::applyStyle(cformat);
+        cursor.setCharFormat(cformat);
+        cursor.setBlockCharFormat(cformat);
+
+        d->paragraphStyle = new KoParagraphStyle(format, cformat);
+        qDeleteAll(paragraphStyles);
+    }
+}
+
+void KoTextShapeData::saveStyle(KoGenStyle &style, KoShapeSavingContext &context) const
+{
+    Q_D(const KoTextShapeData);
+    if (d->paragraphStyle) {
+        d->paragraphStyle->saveOdf(style, context);
+    }
+}
+
 #include <KoTextShapeData.moc>
diff --git a/libs/textlayout/KoTextShapeData.h b/libs/textlayout/KoTextShapeData.h
index 89d5118..2c8cdda 100644
--- a/libs/textlayout/KoTextShapeData.h
+++ b/libs/textlayout/KoTextShapeData.h
@@ -113,6 +113,12 @@ public:
         saveOdf(context, 0, from, to);
     }
 
+    // reimplemented
+    virtual void loadStyle(const KoXmlElement &element, KoShapeLoadingContext &context);
+
+    // reimplemented
+    virtual void saveStyle(KoGenStyle &style, KoShapeSavingContext &context) const;
+
     /**
      * Set the page direction.
      * The page direction will determine behavior on the insertion of new text and those
diff --git a/plugins/textshape/TextShape.cpp b/plugins/textshape/TextShape.cpp
index 1a987d4..214fcf1 100644
--- a/plugins/textshape/TextShape.cpp
+++ b/plugins/textshape/TextShape.cpp
@@ -325,6 +325,23 @@ bool TextShape::loadOdf(const KoXmlElement &element, KoShapeLoadingContext &cont
     m_textShapeData->document()->setUndoRedoEnabled(false);
     loadOdfAttributes(element, context, OdfAllAttributes);
 
+#if 1
+    m_textShapeData->loadStyle(element, context);
+
+#ifndef NWORKAROUND_ODF_BUGS
+    KoTextShapeData::ResizeMethod method = m_textShapeData->resizeMethod();
+    if (KoOdfWorkaround::fixAutoGrow(method, context)) {
+        KoTextDocumentLayout *lay = qobject_cast<KoTextDocumentLayout*>(m_textShapeData->document()->documentLayout());
+        Q_ASSERT(lay);
+        if (lay) {
+            SimpleRootAreaProvider *provider = dynamic_cast<SimpleRootAreaProvider*>(lay->provider());
+            if (provider) {
+                provider->m_fixAutogrow = true;
+            }
+        }
+    }
+#endif
+#else
     // load the (text) style of the frame
     const KoXmlElement *style = 0;
     if (element.hasAttributeNS(KoXmlNS::draw, "style-name")) {
@@ -372,6 +389,7 @@ bool TextShape::loadOdf(const KoXmlElement &element, KoShapeLoadingContext &cont
         }
 #endif
     }
+#endif
 
     bool answer = loadOdfFrame(element, context);
     m_textShapeData->document()->setUndoRedoEnabled(true);
diff --git a/plugins/textshape/TextTool.cpp b/plugins/textshape/TextTool.cpp
index 759ce48..b773f2a 100644
--- a/plugins/textshape/TextTool.cpp
+++ b/plugins/textshape/TextTool.cpp
@@ -2191,6 +2191,7 @@ void TextTool::debugTextDocument()
                 continue;
             QTextCharFormat fmt = fragment.charFormat();
             kDebug(32500) << "changeId: " << fmt.property(KoCharacterStyle::ChangeTrackerId);
+            kDebug(32500) << fmt;
             const int fragmentStart = fragment.position() - block.position();
             for (int i = fragmentStart; i < fragmentStart + fragment.length(); i += CHARSPERLINE) {
                 if (lastPrintedChar == fragmentStart-1)
diff --git a/tools/cstester/visualimagecompare/CompareView.cpp b/tools/cstester/visualimagecompare/CompareView.cpp
index a56a5da..ba05bb2 100644
--- a/tools/cstester/visualimagecompare/CompareView.cpp
+++ b/tools/cstester/visualimagecompare/CompareView.cpp
@@ -63,7 +63,7 @@ void CompareView::init()
     layout->addWidget(m_stack, 1, 0);
 
     m_diffLabel = new QLabel(this);
-    layout->addWidget(m_diffLabel, 1, 1);
+    layout->addWidget(m_diffLabel, 1, 1, Qt::AlignCenter);
 
     setLayout(layout);
 }
@@ -82,6 +82,8 @@ void CompareView::update(const QImage &image1, const QImage &image2, const QStri
     m_image1Label->setPixmap(QPixmap::fromImage(image1));
     m_image2Label->setPixmap(QPixmap::fromImage(image2));
     m_diffLabel->setPixmap(QPixmap::fromImage(m_diff));
+    m_diffLabel->setMinimumWidth(image1.width());
+    m_diffLabel->setAlignment(Qt::AlignCenter);
 }
 
 int lighten(int value)
