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

List:       koffice-devel
Subject:    koffice/plugins/artistictextshape
From:       Jan Hambrecht <jaham () gmx ! net>
Date:       2009-04-25 23:47:27
Message-ID: 1240703247.163706.18643.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 959313 by jaham:

fix loading of start offset when text is put on path
fix loading of transformation which was broken with commit 941933
which changed the saving of the transformation matrix

please review for backporting

CCMAIL:koffice-devel@kde.org



 M  +5 -8      ArtisticTextShape.cpp  
 M  +8 -0      ArtisticTextShapeLoadingUpdater.cpp  


--- trunk/koffice/plugins/artistictextshape/ArtisticTextShape.cpp #959312:959313
@@ -190,7 +190,7 @@
         }
         else if( pair[0] == "startOffset" )
         {
-            m_startOffset = 0.01 * pair[1].toDouble();
+            m_startOffset = 0.01 * pair[1].remove('%').toDouble();
         }
         else if( pair[0] == "text-anchor" )
         {
@@ -205,15 +205,12 @@
     updateSizeAndPosition();
     update();
 
-    QMatrix invMatrix = isOnPath() ? transformation().inverted() : QMatrix();
+    // reset transformation resulting from being put on path
+    setTransformation( QMatrix() );
 
-    loadOdfAttributes( element, context, OdfAllAttributes & ~OdfGeometry );
-    if( ! isOnPath() )
-        loadOdfAttributes( element, context, OdfPosition );
+    // load odf attributes including transformation
+    loadOdfAttributes( element, context, OdfAllAttributes & ~OdfSize );
 
-    // compensate transformation resulting from being put on path
-    applyTransformation( invMatrix );
-
     return true;
 }
 
--- trunk/koffice/plugins/artistictextshape/ArtisticTextShapeLoadingUpdater.cpp #959312:959313
@@ -33,5 +33,13 @@
 
 void ArtisticTextShapeLoadingUpdater::update(KoShape * shape)
 {
+    // we have already loaded the correct transformation, so save it here
+    // and apply after putting us on the path shape
+    QMatrix matrix = m_artisticTextShape->transformation();
+    
+    // putting us on the path shape resulting in a changed transformation
     m_artisticTextShape->putOnPath(dynamic_cast<KoPathShape*>(shape));
+
+    // resetting the transformation to the former state
+    m_artisticTextShape->setTransformation( matrix );
 }
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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