diff options
author | Christian Lippka <cl@openoffice.org> | 2001-05-07 13:25:20 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2001-05-07 13:25:20 +0000 |
commit | c0b28465056cf21cb1e0c0f3ac6db7e0f148ae11 (patch) | |
tree | e8b166b446aa177a0214b1b889fbe83099e125e4 /svx/source/unodraw | |
parent | f430b6c109ebc764278aff8935931d21cbacded8 (diff) |
#86616# added api for caption points
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/shapeimpl.hxx | 15 | ||||
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 8 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 34 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 20 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 19 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 27 |
6 files changed, 96 insertions, 27 deletions
diff --git a/svx/source/unodraw/shapeimpl.hxx b/svx/source/unodraw/shapeimpl.hxx index 7431c1ffbbd2..a18d31f48a51 100644 --- a/svx/source/unodraw/shapeimpl.hxx +++ b/svx/source/unodraw/shapeimpl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeimpl.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: cl $ $Date: 2001-04-30 10:06:24 $ + * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,6 +69,17 @@ class SvGlobalName; * * ***********************************************************************/ +class SvxShapeCaption : public SvxShape +{ +public: + SvxShapeCaption( SdrObject* pObj ) throw(); + virtual ~SvxShapeCaption() throw(); +}; + +/*********************************************************************** +* * +***********************************************************************/ + class SvxOle2Shape : public SvxShape { public: diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 21c70296bb51..8efef293034b 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unopage.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: cl $ $Date: 2001-05-02 15:55:00 $ + * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -636,7 +636,9 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt3 case OBJ_FREEFILL: pRet = new SvxShapePolyPolygonBezier( pObj , PolygonKind_FREEFILL ); break; - case OBJ_CAPTION: // todo: caption? + case OBJ_CAPTION: + pRet = new SvxShapeCaption( pObj ); + break; case OBJ_TEXT: pRet = new SvxShape( pObj ); break; diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index e9bee4e7fc27..a83272483b47 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoprov.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: cl $ $Date: 2001-04-30 10:06:24 $ + * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -558,6 +558,29 @@ SfxItemPropertyMap* ImplGetSvxPageShapePropertyMap() return aPageShapePropertyMap_Impl; } +SfxItemPropertyMap* ImplGetSvxCaptionPropertyMap() +{ + static SfxItemPropertyMap aCaptionPropertyMap_Impl[] = + { + SPECIAL_CAPTION_PROPERTIES + EDGERADIUS_PROPERTIES + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + SHAPE_DESCRIPTOR_PROPERTIES + MISC_OBJ_PROPERTIES + LINKTARGET_PROPERTIES + SHADOW_PROPERTIES + TEXT_PROPERTIES + // #FontWork# + FONTWORK_PROPERTIES + {0,0,0,0,0} + }; + + return aCaptionPropertyMap_Impl; +} + + comphelper::PropertyMapEntry* ImplGetSvxDrawingDefaultsPropertyMap() { static comphelper::PropertyMapEntry aSvxDrawingDefaultsPropertyMap_Impl[] = @@ -718,6 +741,13 @@ SfxItemPropertyMap* SvxUnoPropertyMapProvider::GetMap(UINT16 nPropertyId) case SVXMAP_3DPOLYGONOBJECT: aMapArr[SVXMAP_3DPOLYGONOBJECT]=ImplGetSvx3DPolygonObjectPropertyMap(); break; case SVXMAP_ALL: aMapArr[SVXMAP_ALL]=ImplGetSvxAllPropertyMap(); break; case SVXMAP_GROUP: aMapArr[SVXMAP_GROUP]=ImplGetSvxGroupPropertyMap(); break; + case SVXMAP_CAPTION: aMapArr[SVXMAP_CAPTION]=ImplGetSvxCaptionPropertyMap(); break; + case SVXMAP_OLE2: aMapArr[SVXMAP_OLE2]=ImplGetSvxOle2PropertyMap(); break; + case SVXMAP_PLUGIN: aMapArr[SVXMAP_PLUGIN]=ImplGetSvxPluginPropertyMap(); break; + case SVXMAP_FRAME: aMapArr[SVXMAP_FRAME]=ImplGetSvxFramePropertyMap(); break; + case SVXMAP_APPLET: aMapArr[SVXMAP_APPLET]=ImplGetSvxAppletPropertyMap(); break; + case SVXMAP_CONTROL: aMapArr[SVXMAP_CONTROL]=ImplGetSvxControlShapePropertyMap(); break; + default: DBG_ERROR( "Unknown property map for SvxUnoPropertyMapProvider!" ); } diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 820df2f3f160..443dc92a9be8 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoshap2.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: cl $ $Date: 2001-04-30 09:57:04 $ + * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,6 +103,7 @@ #include "svdpage.hxx" #include "svdmodel.hxx" #include "svdouno.hxx" +#include "shapeimpl.hxx" using namespace ::osl; using namespace ::vos; @@ -603,12 +604,10 @@ uno::Sequence< OUString > SAL_CALL SvxShapeConnector::getSupportedServiceNames() * class SvxShapeControl * ***********************************************************************/ -extern SfxItemPropertyMap* ImplGetSvxControlShapePropertyMap(); - uno::Sequence< uno::Type > SvxShapeControl::maTypeSequence; SvxShapeControl::SvxShapeControl( SdrObject* pObj ) throw() : - SvxShape( pObj, ImplGetSvxControlShapePropertyMap() ) + SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_CONTROL) ) { } @@ -1806,3 +1805,14 @@ void SvxConvertXPolygonToPolyPolygonBezier( const XPolygon& rPolygon, drawing::P *pInnerFlags++ = (drawing::PolygonFlags)((sal_uInt16)rPolygon.GetFlags(b)); } } + +/////////////////////////////////////////////////////////////////////// + +SvxShapeCaption::SvxShapeCaption( SdrObject* pObj ) throw() +: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_CAPTION) ) +{ +} + +SvxShapeCaption::~SvxShapeCaption() throw() +{ +} diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index b2b81c1c0cc6..6a30bc3b7a81 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoshap4.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: cl $ $Date: 2001-04-30 10:06:24 $ + * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,13 +85,6 @@ /////////////////////////////////////////////////////////////////////// -extern SfxItemPropertyMap* ImplGetSvxOle2PropertyMap(); -extern SfxItemPropertyMap* ImplGetSvxPluginPropertyMap(); -extern SfxItemPropertyMap* ImplGetSvxFramePropertyMap(); -extern SfxItemPropertyMap* ImplGetSvxAppletPropertyMap(); - -/////////////////////////////////////////////////////////////////////// - using namespace ::osl; using namespace ::vos; using namespace ::rtl; @@ -104,7 +97,7 @@ using namespace ::com::sun::star::beans; /////////////////////////////////////////////////////////////////////// SvxOle2Shape::SvxOle2Shape( SdrObject* pObject ) throw() -: SvxShape( pObject, ImplGetSvxOle2PropertyMap() ) +: SvxShape( pObject, aSvxMapProvider.GetMap(SVXMAP_OLE2) ) { } @@ -261,7 +254,7 @@ static void SvxImplFillCommandSequence( const SvCommandList& aCommands, Sequence /////////////////////////////////////////////////////////////////////// SvxAppletShape::SvxAppletShape( SdrObject* pObject ) throw() -: SvxOle2Shape( pObject, ImplGetSvxAppletPropertyMap() ) +: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_APPLET) ) { SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.AppletShape" ) ) ); } @@ -409,7 +402,7 @@ Any SAL_CALL SvxAppletShape::getPropertyValue( const OUString& PropertyName ) th /////////////////////////////////////////////////////////////////////// SvxPluginShape::SvxPluginShape( SdrObject* pObject ) throw() -: SvxOle2Shape( pObject, ImplGetSvxPluginPropertyMap() ) +: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_PLUGIN) ) { SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.PluginShape" ) ) ); } @@ -533,7 +526,7 @@ Any SAL_CALL SvxPluginShape::getPropertyValue( const OUString& PropertyName ) th /////////////////////////////////////////////////////////////////////// SvxFrameShape::SvxFrameShape( SdrObject* pObject ) throw() -: SvxOle2Shape( pObject, ImplGetSvxFramePropertyMap() ) +: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_FRAME) ) { SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.FrameShape" ) ) ); } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 7b1e8c0fa489..3f14a3d37392 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoshape.cxx,v $ * - * $Revision: 1.48 $ + * $Revision: 1.49 $ * - * last change: $Author: thb $ $Date: 2001-05-04 14:22:39 $ + * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -156,6 +156,10 @@ #include "dialmgr.hxx" // not nice, we need our own resources some day #include "dialogs.hrc" // +#ifndef _SVDCAPT_HXX +#include "svdocapt.hxx" +#endif + #ifndef _E3D_OBJ3D_HXX #include <obj3d.hxx> #endif @@ -1061,6 +1065,18 @@ void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const u switch( pMap->nWID ) { + case OWN_ATTR_CAPTION_POINT: + { + awt::Point aPnt; + if( rVal >>= aPnt ) + { + const Point aVclPoint( aPnt.X, aPnt.Y ); + ((SdrCaptionObj*)pObj)->SetTailPos(aVclPoint); + + return; + } + break; + } case OWN_ATTR_TRANSFORMATION: { drawing::HomogenMatrix3 aMatrix; @@ -1566,6 +1582,13 @@ uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName ) switch( pMap->nWID ) { + case OWN_ATTR_CAPTION_POINT: + { + const Point& aVclPnt = ((SdrCaptionObj*)pObj)->GetTailPos(); + awt::Point aPnt( aVclPnt.X(), aVclPnt.Y() ); + aAny <<= aPnt; + break; + } case OWN_ATTR_INTERNAL_OLE: { #ifndef SVX_LIGHT |