Commit c2dda3f8 authored by Thorsten Zachmann's avatar Thorsten Zachmann

o Make adding / removing of shapes on masterpages work

  Now the shapes are also added to the views if the active page has the
  a master page to which the shape was added. The same is valid for
  removing.

svn path=/trunk/koffice/; revision=651057
parent c65b99ec
......@@ -280,13 +280,19 @@ void KoPADocument::addShape( KoShape * shape )
page = dynamic_cast<KoPAPageBase*>( parent );
}
bool isMaster = dynamic_cast<KoPAMasterPage*>( page ) != 0;
foreach( KoView *view, views() )
{
KoPAView * kopaView = static_cast<KoPAView*>( view );
if ( page == kopaView->activePage() )
{
KoPACanvas *canvas = kopaView->kopaCanvas();
canvas->shapeManager()->add( shape );
KoPAPage * p;
if ( page == kopaView->activePage() ) {
kopaView->kopaCanvas()->shapeManager()->add( shape );
}
else if ( isMaster && ( p = dynamic_cast<KoPAPage*>( kopaView->activePage() ) ) != 0 ) {
if ( p->masterPage() == page ) {
kopaView->kopaCanvas()->masterShapeManager()->add( shape );
}
}
}
}
......@@ -304,14 +310,19 @@ void KoPADocument::removeShape( KoShape *shape )
page = dynamic_cast<KoPAPageBase*>( parent );
}
bool isMaster = dynamic_cast<KoPAMasterPage*>( page ) != 0;
foreach( KoView *view, views() )
{
KoPAView * kopaView = static_cast<KoPAView*>( view );
if ( page == kopaView->activePage() )
{
KoPACanvas *canvas = kopaView->kopaCanvas();
canvas->shapeManager()->remove( shape );
KoPAPage * p;
if ( page == kopaView->activePage() ) {
kopaView->kopaCanvas()->shapeManager()->remove( shape );
}
else if ( isMaster && ( p = dynamic_cast<KoPAPage*>( kopaView->activePage() ) ) != 0 ) {
if ( p->masterPage() == page ) {
kopaView->kopaCanvas()->masterShapeManager()->remove( shape );
}
}
}
}
......
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