diff options
author | Christian Lippka <cl@openoffice.org> | 2002-01-30 08:58:43 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2002-01-30 08:58:43 +0000 |
commit | e338f5c37e27d8ea8f197c26cb4c5ba77812ada1 (patch) | |
tree | 37934783c0089108b9cc036da7d59d78ed8ddbc8 /svx/source/unodraw | |
parent | a83dd3d663f0dd890d5a172ef4e5525870c8c5f5 (diff) |
#95585# helper for SdrHint to uno event conversion
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unomod.cxx | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 45f5fd6b5fd9..726f0f3a47c0 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unomod.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: vg $ $Date: 2001-10-17 10:12:08 $ + * last change: $Author: cl $ $Date: 2002-01-30 09:58:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -207,6 +207,63 @@ const SvEventDescription* ImplGetSupportedMacroItems() //-//////////////////////////////////////////////////////////////////// +/** fills the given EventObject from the given SdrHint. + @returns + true if the SdrHint could be translated to an EventObject<br> + false if not +*/ +sal_Bool SvxUnoDrawMSFactory::createEvent( const SdrModel* pDoc, const SdrHint* pSdrHint, ::com::sun::star::document::EventObject& aEvent ) +{ + const SdrObject* pObj = NULL; + const SdrPage* pPage = NULL; + + switch( pSdrHint->GetKind() ) + { +// case HINT_LAYERCHG: // Layerdefinition geaendert +// case HINT_LAYERORDERCHG: // Layerreihenfolge geaendert (Insert/Remove/ChangePos) +// case HINT_LAYERSETCHG: // Layerset geaendert +// case HINT_LAYERSETORDERCHG: // Layersetreihenfolge geaendert (Insert/Remove/ChangePos) + + case HINT_PAGECHG: // Page geaendert + aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageModified" ) ); + pPage = pSdrHint->GetPage(); + break; + case HINT_PAGEORDERCHG: // Reihenfolge der Seiten (Zeichenseiten oder Masterpages) geaendert (Insert/Remove/ChangePos) + aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageOrderModified" ) ); + pPage = pSdrHint->GetPage(); + break; + case HINT_OBJCHG: // Objekt geaendert + aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ShapeModified" ) ); + pObj = pSdrHint->GetObject(); + break; + case HINT_OBJINSERTED: // Neues Zeichenobjekt eingefuegt + aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ShapeInserted" ) ); + pObj = pSdrHint->GetObject(); + break; + case HINT_OBJREMOVED: // Zeichenobjekt aus Liste entfernt + aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ShapeRemoved" ) ); + pObj = pSdrHint->GetObject(); + break; +// HINT_DEFAULTTABCHG, // Default Tabulatorweite geaendert +// HINT_DEFFONTHGTCHG, // Default FontHeight geaendert +// HINT_CONTROLINSERTED, // UnoControl wurde eingefuegt +// HINT_CONTROLREMOVED, // UnoControl wurde entfernt +// HINT_SWITCHTOPAGE, // #94278# UNDO/REDO at an object evtl. on another page +// HINT_OBJLISTCLEAR // Is called before an SdrObjList will be cleared + default: + return sal_False; + } + + if( pObj ) + aEvent.Source = const_cast<SdrObject*>(pObj)->getUnoShape(); + else if( pPage ) + aEvent.Source = const_cast<SdrPage*>(pPage)->getUnoPage(); + else + aEvent.Source = (const_cast<SdrModel*>(pDoc))->getUnoModel(); + + return sal_True; +} + uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance( const OUString& ServiceSpecifier ) throw( uno::Exception, uno::RuntimeException ) { |