Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 73cdc430 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink

save the musicshape inside a draw:frame to prepare for the possibility of also...

save the musicshape inside a draw:frame to prepare for the possibility of also saving a pixmap and/or svg representation of it

svn path=/trunk/koffice/; revision=924242
parent af2061a3
......@@ -49,7 +49,8 @@ using namespace MusicCore;
//static MusicShape* firstShape = 0;
: m_firstSystem(0),
: KoFrameShape("", "shape"),
m_style(new MusicStyle),
m_engraver(new Engraver()),
m_renderer(new MusicRenderer(m_style)),
......@@ -116,19 +117,25 @@ void MusicShape::paint( QPainter& painter, const KoViewConverter& converter )
void MusicShape::saveOdf( KoShapeSavingContext & context ) const
KoXmlWriter& writer = context.xmlWriter();
saveOdfAttributes(context, OdfAllAttributes);
writer.addAttribute("xmlns:music", "");
saveOdfAttributes( context, OdfAllAttributes );
MusicXmlWriter().writeSheet( writer, m_sheet, false );
MusicXmlWriter().writeSheet(writer, m_sheet, false);
writer.endElement(); // music:shape
saveOdfCommonChildElements( context );
writer.endElement(); // draw:frame
bool MusicShape::loadOdf( const KoXmlElement & element, KoShapeLoadingContext &context ) {
loadOdfAttributes( element, context, OdfAllAttributes );
loadOdfAttributes(element, context, OdfAllAttributes);
return loadOdfFrame(element, context);
bool MusicShape::loadOdfFrameElement( const KoXmlElement & element, KoShapeLoadingContext & context )
KoXmlElement score = KoXml::namedItemNS(element, "", "score-partwise");
if (score.isNull()) {
kWarning() << "no music:score-partwise element as first child";
......@@ -20,6 +20,7 @@
#include <KoShape.h>
#include <KoFrameShape.h>
#include <kurl.h>
#define MusicShapeId "MusicShape"
......@@ -31,7 +32,7 @@ class MusicRenderer;
class MusicStyle;
class Engraver;
class MusicShape : public KoShape
class MusicShape : public KoShape, public KoFrameShape
......@@ -57,11 +58,13 @@ public:
MusicRenderer* renderer();
MusicStyle* style();
void engrave(bool engraveBars=true);
MusicShape* successor() { return m_successor; }
MusicShape* predecessor() { return m_predecessor; }
// reimplemented
virtual bool loadOdfFrameElement( const KoXmlElement & element, KoShapeLoadingContext & context );
MusicCore::Sheet* m_sheet;
int m_firstSystem;
int m_lastSystem;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment