Bug 251484

Summary: strange connectors in an .odg file from OpenOffice
Product: [Applications] karbon Reporter: Mamonetti <freddy2_es>
Component: opendocumentAssignee: T Zachmann <t.zachmann>
Status: RESOLVED FIXED    
Severity: normal CC: t.zachmann
Priority: NOR    
Version: 2.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Test .odg file created by OOffice Draw

Description Mamonetti 2010-09-16 20:21:16 UTC
Created attachment 51730 [details]
Test .odg file created by OOffice Draw

Version:           2.1 (using KDE 4.5.1) 
OS:                Linux

After creating a simple .odg file with OOffice Draw (just a few boxes, connectors and text areas) the connectors aren't recognized as connectors by Karbon. They look like strange boxes.


Reproducible: Always

Steps to Reproduce:
Just load the attached file.
Comment 1 Mamonetti 2010-09-16 20:25:27 UTC
A screenshot:
http://img522.imageshack.us/img522/7617/instantanea50.jpg
Comment 2 Mamonetti 2010-09-16 20:29:18 UTC
And a screenshot with OODraw:
http://img715.imageshack.us/img715/4614/instantanea51.jpg

Sorry for the extra comments
Comment 3 T Zachmann 2010-09-17 05:32:08 UTC
There are multiple problems in this slide:

- the connectors getting a background. This is due to OO defining a default background and not saying that the connection should have no background.
- the connectors out of the page. Looks like there is a bug in text on shape which leads to the connectors shown at the wrong position. If text on shape loading is disabled the position of the connectors is correct. Moved that problem to bug
https://bugs.kde.org/show_bug.cgi?id=251528.
- the top connectors are not connected to the right position. Moved that problem to bug https://bugs.kde.org/show_bug.cgi?id=251529

The leaves the wrong background in this bugreport.
Comment 4 Jan Hambrecht 2010-12-28 21:41:26 UTC
commit 0032c24ef451340e080f74d8751e18f14f89fe67
branch master
Author: Jan Hambrecht <jaham@gmx.net>
Date:   Tue Dec 28 19:00:26 2010 +0100

    force no background on connection shape
    BUG:251484

diff --git a/libs/flake/KoConnectionShape.cpp b/libs/flake/KoConnectionShape.cpp
index 3a416c2..8430eb0 100644
--- a/libs/flake/KoConnectionShape.cpp
+++ b/libs/flake/KoConnectionShape.cpp
@@ -30,6 +30,7 @@
 #include "KoTextOnShapeContainer.h"
 #include "KoPathShapeLoader.h"
 #include "KoPathPoint.h"
+#include "KoShapeBackground.h"
 #include <KoXmlReader.h>
 #include <KoXmlWriter.h>
 #include <KoXmlNS.h>
@@ -640,6 +641,17 @@ void KoConnectionShape::shapeChanged(ChangeType type, KoShape *shape)
         if (shape == d->shape2)
             connectSecond(0, -1);
         break;
+    case BackgroundChanged:
+    {
+        // connection shape should not have a background
+        KoShapeBackground *fill = background();
+        if (fill) {
+            if (fill->deref())
+                delete fill;
+            setBackground(0);
+        }
+        return;
+    }
     default:
         return;
     }