2000-11-29 13:57:24 +00:00
/*************************************************************************
2000-09-18 23:08:29 +00:00
*
2005-09-09 04:26:25 +00:00
* OpenOffice . org - a multi - platform office productivity suite
2000-09-18 23:08:29 +00:00
*
2005-09-09 04:26:25 +00:00
* $ RCSfile : unoframe . cxx , v $
2000-09-18 23:08:29 +00:00
*
2006-09-16 20:57:12 +00:00
* $ Revision : 1.105 $
2000-09-18 23:08:29 +00:00
*
2006-09-16 20:57:12 +00:00
* last change : $ Author : obo $ $ Date : 2006 - 09 - 16 21 : 57 : 12 $
2000-09-18 23:08:29 +00:00
*
2005-09-09 04:26:25 +00:00
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1 .
2000-09-18 23:08:29 +00:00
*
*
2005-09-09 04:26:25 +00:00
* GNU Lesser General Public License Version 2.1
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Copyright 2005 by Sun Microsystems , Inc .
* 901 San Antonio Road , Palo Alto , CA 94303 , USA
2000-09-18 23:08:29 +00:00
*
2005-09-09 04:26:25 +00:00
* This library is free software ; you can redistribute it and / or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1 , as published by the Free Software Foundation .
2000-09-18 23:08:29 +00:00
*
2005-09-09 04:26:25 +00:00
* This library is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* Lesser General Public License for more details .
2000-09-18 23:08:29 +00:00
*
2005-09-09 04:26:25 +00:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place , Suite 330 , Boston ,
* MA 02111 - 1307 USA
2000-09-18 23:08:29 +00:00
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2006-09-16 20:57:12 +00:00
// MARKER(update_precomp.py): autogen include statement, do not remove
# include "precompiled_sw.hxx"
2000-09-18 23:08:29 +00:00
2005-03-15 10:25:26 +00:00
# ifndef _COM_SUN_STAR_EMBED_NOVISUALAREASIZEEXCEPTION_HPP_
# include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
# endif
2005-04-04 07:22:36 +00:00
# ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
# include <com/sun/star/container/XChild.hpp>
# endif
2004-10-04 18:13:38 +00:00
# ifndef _COM_SUN_STAR_EMBED_XCLASSIFIEDOBJECT_HPP_
# include <com/sun/star/embed/XClassifiedObject.hpp>
# endif
# ifndef _COM_SUN_STAR_EMBED_XVISUALOBJECT_HPP_
# include <com/sun/star/embed/XVisualObject.hpp>
# endif
# ifndef _COM_SUN_STAR_EMBED_XCOMPONENTSUPPLIER_HPP_
# include <com/sun/star/embed/XComponentSupplier.hpp>
# endif
# ifndef _COM_SUN_STAR_EMBED_EMBEDSTATES_HPP_
# include <com/sun/star/embed/EmbedStates.hpp>
# endif
# ifndef _COM_SUN_STAR_EMBED_ASPECTS_HPP_
# include <com/sun/star/embed/Aspects.hpp>
# endif
2000-09-18 23:08:29 +00:00
# include <swtypes.hxx>
# include <cmdid.h>
2005-02-25 08:27:49 +00:00
# include <memory>
2000-09-18 23:08:29 +00:00
# ifndef _HINTS_HXX //autogen
# include <hints.hxx>
# endif
# ifndef _DOC_HXX //autogen
# include <doc.hxx>
# endif
# ifndef _DOCSH_HXX //autogen
# include <docsh.hxx>
# endif
2006-05-05 07:08:29 +00:00
# ifndef _SWCLI_HXX
# include <swcli.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _NDINDEX_HXX //autogen
# include <ndindex.hxx>
# endif
# ifndef _PAM_HXX //autogen
# include <pam.hxx>
# endif
# ifndef _NDNOTXT_HXX //autogen
# include <ndnotxt.hxx>
# endif
# ifndef _SVX_UNOMID_HXX
# include <svx/unomid.hxx>
# endif
# ifndef _UNOCRSR_HXX //autogen
# include <unocrsr.hxx>
# endif
# ifndef _DOCSTYLE_HXX //autogen
# include <docstyle.hxx>
# endif
2000-11-27 10:13:17 +00:00
# ifndef _DCONTACT_HXX
# include <dcontact.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _FMTCNCT_HXX //autogen
# include <fmtcnct.hxx>
# endif
# ifndef _NDOLE_HXX //autogen
# include <ndole.hxx>
# endif
2006-07-14 07:31:03 +00:00
# ifndef _FRMFMT_HXX
# include <frmfmt.hxx>
# endif
# ifndef _FRAME_HXX
# include <frame.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _UNOOBJ_HXX
# include <unoobj.hxx>
# endif
# ifndef _UNOMAP_HXX
# include <unomap.hxx>
# endif
# ifndef _UNOPRNMS_HXX
# include <unoprnms.hxx>
# endif
2000-12-19 16:28:58 +00:00
# ifndef _UNOEVENT_HXX
# include <unoevent.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _COM_SUN_STAR_TABLE_BORDERLINE_HPP_
# include <com/sun/star/table/BorderLine.hpp>
# endif
# ifndef _COM_SUN_STAR_UTIL_XMODIFYBROADCASTER_HPP_
# include <com/sun/star/util/XModifyBroadcaster.hpp>
# endif
# ifndef _COM_SUN_STAR_TABLE_SHADOWFORMAT_HPP_
# include <com/sun/star/table/ShadowFormat.hpp>
# endif
# ifndef _COM_SUN_STAR_STYLE_GRAPHICLOCATION_HPP_
# include <com/sun/star/style/GraphicLocation.hpp>
# endif
# ifndef _COM_SUN_STAR_TEXT_GRAPHICCROP_HPP_
# include <com/sun/star/text/GraphicCrop.hpp>
# endif
# ifndef _COM_SUN_STAR_TEXT_TEXTCONTENTANCHORTYPE_HPP_
# include <com/sun/star/text/TextContentAnchorType.hpp>
# endif
# ifndef _COM_SUN_STAR_TEXT_XTEXTCOLUMNS_HPP_
# include <com/sun/star/text/XTextColumns.hpp>
# endif
2001-03-16 13:39:32 +00:00
# ifndef _COM_SUN_STAR_TEXT_WRAPTEXTMODE_HPP_
# include <com/sun/star/text/WrapTextMode.hpp>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
# include <com/sun/star/beans/PropertyAttribute.hpp>
# endif
2000-10-24 13:26:57 +00:00
# ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_
# include <com/sun/star/drawing/PointSequenceSequence.hpp>
# endif
# ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCE_HPP_
# include <com/sun/star/drawing/PointSequence.hpp>
# endif
2000-12-14 08:48:16 +00:00
# ifndef _COM_SUN_STAR_DRAWING_COLORMODE_HPP_
# include <com/sun/star/drawing/ColorMode.hpp>
# endif
2004-01-06 17:20:22 +00:00
# ifndef _TL_POLY_HXX
# include <tools/poly.hxx>
2000-10-24 13:26:57 +00:00
# endif
2003-04-17 13:43:12 +00:00
# ifndef _SWUNDO_HXX //autogen
# include <swundo.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _UNOSTYLE_HXX
# include <unostyle.hxx>
# endif
2000-11-27 10:13:17 +00:00
# ifndef _SVDMODEL_HXX
# include <svx/svdmodel.hxx>
# endif
# ifndef _SVDPAGE_HXX
# include <svx/svdpage.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _SVX_BRSHITEM_HXX //autogen
# include <svx/brshitem.hxx>
# endif
# ifndef _SVX_PROTITEM_HXX //autogen
# include <svx/protitem.hxx>
# endif
# ifndef _FMTORNT_HXX //autogen
# include <fmtornt.hxx>
# endif
# ifndef _FMTURL_HXX //autogen
# include <fmturl.hxx>
# endif
# ifndef _SVX_LRSPITEM_HXX //autogen
# include <svx/lrspitem.hxx>
# endif
# ifndef _SVX_ULSPITEM_HXX //autogen
# include <svx/ulspitem.hxx>
# endif
# ifndef _SVX_BOXITEM_HXX //autogen
# include <svx/boxitem.hxx>
# endif
# ifndef _SVX_OPAQITEM_HXX //autogen
# include <svx/opaqitem.hxx>
# endif
# ifndef _SVX_PRNTITEM_HXX //autogen
# include <svx/prntitem.hxx>
# endif
# ifndef _SVX_SHADITEM_HXX //autogen
# include <svx/shaditem.hxx>
# endif
# ifndef _FMTSRND_HXX //autogen
# include <fmtsrnd.hxx>
# endif
# ifndef _FMTFSIZE_HXX //autogen
# include <fmtfsize.hxx>
# endif
# ifndef _GRFATR_HXX //autogen
# include <grfatr.hxx>
# endif
# ifndef _UNOFRAME_HXX
# include <unoframe.hxx>
# endif
# ifndef _FMTANCHR_HXX
# include <fmtanchr.hxx>
# endif
2000-11-20 11:10:03 +00:00
# ifndef _FMTCLDS_HXX
# include <fmtclds.hxx>
# endif
2000-12-06 10:36:14 +00:00
# ifndef _FRMATR_HXX
# include <frmatr.hxx>
# endif
2000-09-18 23:08:29 +00:00
# ifndef _NDTXT_HXX
# include <ndtxt.hxx>
# endif
# ifndef _NDGRF_HXX
# include <ndgrf.hxx>
# endif
# ifndef _VOS_MUTEX_HXX_ //autogen
# include <vos/mutex.hxx>
# endif
# ifndef _SV_SVAPP_HXX //autogen
# include <vcl/svapp.hxx>
# endif
2003-04-17 13:43:12 +00:00
# ifndef _SFX_PRINTER_HXX
# include <sfx2/printer.hxx>
# endif
2001-07-20 09:40:14 +00:00
# ifndef _SWSTYLENAMEMAPPER_HXX
# include <SwStyleNameMapper.hxx>
# endif
2001-07-09 04:50:21 +00:00
# ifndef _XMLOFF_XMLCNITM_HXX
# include <xmloff/xmlcnitm.hxx>
# endif
2001-10-12 12:57:26 +00:00
# ifndef _POOLFMT_HXX
# include <poolfmt.hxx>
# endif
# ifndef _PAGEDESC_HXX
# include <pagedesc.hxx>
# endif
# ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_HPP_
# include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
# endif
2001-11-22 16:48:09 +00:00
# ifndef _URLOBJ_HXX
# include <tools/urlobj.hxx>
# endif
2002-02-04 17:08:18 +00:00
# ifndef _SVX_FRMDIRITEM_HXX //autogen
# include <svx/frmdiritem.hxx>
# endif
2004-02-02 17:26:06 +00:00
// DVO, OD 01.10.2003 #i18732#
# ifndef _FMTFOLLOWTEXTFLOW_HXX
# include <fmtfollowtextflow.hxx>
# endif
2004-08-02 13:18:03 +00:00
// OD 2004-05-05 #i28701#
# ifndef _FMTWRAPINFLUENCEONOBJPOS_HXX
# include <fmtwrapinfluenceonobjpos.hxx>
# endif
2002-02-04 17:08:18 +00:00
2004-10-04 18:13:38 +00:00
# include <toolkit/helper/vclunohelper.hxx>
2003-03-27 14:45:43 +00:00
// from fefly1.cxx
extern sal_Bool lcl_ChkAndSetNewAnchor ( const SwFlyFrm & rFly , SfxItemSet & rSet ) ;
2000-09-18 23:08:29 +00:00
using namespace : : com : : sun : : star ;
using namespace : : com : : sun : : star : : uno ;
using namespace : : com : : sun : : star : : beans ;
using namespace : : com : : sun : : star : : text ;
using namespace : : com : : sun : : star : : lang ;
2000-10-24 13:26:57 +00:00
using namespace : : com : : sun : : star : : drawing ;
2000-09-18 23:08:29 +00:00
using namespace : : rtl ;
2001-10-12 12:57:26 +00:00
using com : : sun : : star : : frame : : XModel ;
using com : : sun : : star : : container : : XNameAccess ;
using com : : sun : : star : : style : : XStyleFamiliesSupplier ;
2000-11-29 14:57:15 +00:00
const sal_Char __FAR_DATA sPackageProtocol [ ] = " vnd.sun.star.Package: " ;
const sal_Char __FAR_DATA sGraphicObjectProtocol [ ] = " vnd.sun.star.GraphicObject: " ;
2000-09-18 23:08:29 +00:00
/****************************************************************************
Rahmenbeschreibung
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-06-15 13:27:58 +00:00
DECLARE_TABLE ( SwFrameAnyTable_Impl , uno : : Any * )
2000-09-18 23:08:29 +00:00
class BaseFrameProperties_Impl
{
2001-06-15 13:27:58 +00:00
const SfxItemPropertyMap * _pMap ;
SwFrameAnyTable_Impl aAnyTbl ;
2000-09-18 23:08:29 +00:00
public :
2001-10-23 16:40:05 +00:00
BaseFrameProperties_Impl ( const SfxItemPropertyMap * pMap ) :
_pMap ( pMap ) { }
2001-06-15 13:27:58 +00:00
~ BaseFrameProperties_Impl ( ) ;
2000-09-18 23:08:29 +00:00
2001-06-15 13:27:58 +00:00
void SetProperty ( USHORT nWID , BYTE nMemberId , uno : : Any aVal ) ;
sal_Bool GetProperty ( USHORT nWID , BYTE nMemberId , uno : : Any * & pAny ) ;
2001-10-12 12:57:26 +00:00
void GetProperty ( const OUString & rPropertyName , const Reference < XPropertySet > & rxPropertySet , uno : : Any & rAny ) ;
2000-09-18 23:08:29 +00:00
2001-06-15 13:27:58 +00:00
const SfxItemPropertyMap * GetMap ( ) const { return _pMap ; }
2001-10-23 16:40:05 +00:00
sal_Bool FillBaseProperties ( SfxItemSet & rToSet , const SfxItemSet & rFromSet , sal_Bool & rSizeFound ) ;
2000-09-18 23:08:29 +00:00
2001-10-23 16:40:05 +00:00
virtual sal_Bool AnyToItemSet ( SwDoc * pDoc , SfxItemSet & rFrmSet , SfxItemSet & rSet , sal_Bool & rSizeFound ) = 0 ;
2000-09-18 23:08:29 +00:00
} ;
2001-06-15 13:27:58 +00:00
/* -----------------------------12.06.01 15:46--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
BaseFrameProperties_Impl : : ~ BaseFrameProperties_Impl ( )
{
uno : : Any * pVal = aAnyTbl . First ( ) ;
while ( pVal )
{
delete pVal ;
pVal = aAnyTbl . Next ( ) ;
}
}
/* -----------------------------12.06.01 15:43--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void BaseFrameProperties_Impl : : SetProperty ( USHORT nWID , BYTE nMemberId , uno : : Any aVal )
{
ULONG nKey = ( nWID < < 16 ) + nMemberId ;
Any * pCurAny = aAnyTbl . Get ( nKey ) ;
if ( ! pCurAny )
{
pCurAny = new uno : : Any ;
aAnyTbl . Insert ( nKey , pCurAny ) ;
}
* pCurAny = aVal ;
}
/* -----------------------------12.06.01 15:43--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-12 12:57:26 +00:00
sal_Bool BaseFrameProperties_Impl : : GetProperty ( USHORT nWID , BYTE nMemberId , uno : : Any * & pAny )
2001-06-15 13:27:58 +00:00
{
ULONG nKey = ( nWID < < 16 ) + nMemberId ;
2001-10-12 12:57:26 +00:00
Any * pCurAny = aAnyTbl . Get ( nKey ) ;
2001-06-15 13:27:58 +00:00
pAny = pCurAny ;
return pCurAny ! = 0 ;
}
2001-10-12 12:57:26 +00:00
void BaseFrameProperties_Impl : : GetProperty ( const OUString & rPropertyName , const Reference < XPropertySet > & rxPropertySet , uno : : Any & rAny )
{
rAny = rxPropertySet - > getPropertyValue ( rPropertyName ) ;
}
2000-09-18 23:08:29 +00:00
/* -----------------29.06.98 09:55-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-23 16:40:05 +00:00
sal_Bool BaseFrameProperties_Impl : : FillBaseProperties ( SfxItemSet & rToSet , const SfxItemSet & rFromSet , sal_Bool & rSizeFound )
2000-09-18 23:08:29 +00:00
{
sal_Bool bRet = sal_True ;
//Anker kommt auf jeden Fall in den Set
2001-10-23 16:40:05 +00:00
SwFmtAnchor aAnchor ( static_cast < const SwFmtAnchor & > ( rFromSet . Get ( RES_ANCHOR ) ) ) ;
2000-09-18 23:08:29 +00:00
{
uno : : Any * pAnchorPgNo ;
2001-06-15 13:27:58 +00:00
if ( GetProperty ( RES_ANCHOR , MID_ANCHOR_PAGENUM , pAnchorPgNo ) )
2000-09-18 23:08:29 +00:00
bRet & = ( ( SfxPoolItem & ) aAnchor ) . PutValue ( * pAnchorPgNo , MID_ANCHOR_PAGENUM ) ;
uno : : Any * pAnchorType ;
2001-06-15 13:27:58 +00:00
if ( GetProperty ( RES_ANCHOR , MID_ANCHOR_ANCHORTYPE , pAnchorType ) )
2000-09-18 23:08:29 +00:00
bRet & = ( ( SfxPoolItem & ) aAnchor ) . PutValue ( * pAnchorType , MID_ANCHOR_ANCHORTYPE ) ;
}
2001-10-23 16:40:05 +00:00
rToSet . Put ( aAnchor ) ;
2000-09-18 23:08:29 +00:00
{
uno : : Any * pCol = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BACKGROUND , MID_BACK_COLOR , pCol ) ;
2002-08-16 12:11:48 +00:00
uno : : Any * pRGBCol = 0 ;
GetProperty ( RES_BACKGROUND , MID_BACK_COLOR_R_G_B , pRGBCol ) ;
uno : : Any * pColTrans = 0 ;
GetProperty ( RES_BACKGROUND , MID_BACK_COLOR_TRANSPARENCY , pColTrans ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pTrans = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BACKGROUND , MID_GRAPHIC_TRANSPARENT , pTrans ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pGrLoc = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BACKGROUND , MID_GRAPHIC_POSITION , pGrLoc ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pGrURL = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BACKGROUND , MID_GRAPHIC_URL , pGrURL ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pGrFilter = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BACKGROUND , MID_GRAPHIC_FILTER , pGrFilter ) ;
2002-08-16 12:11:48 +00:00
uno : : Any * pGrTranparency = 0 ;
GetProperty ( RES_BACKGROUND , MID_GRAPHIC_TRANSPARENCY , pGrTranparency ) ;
2000-09-18 23:08:29 +00:00
2002-08-16 12:11:48 +00:00
if ( pCol | | pTrans | | pGrURL | | pGrFilter | | pGrLoc | |
pGrTranparency | | pColTrans | | pRGBCol )
2000-09-18 23:08:29 +00:00
{
2001-10-23 16:40:05 +00:00
SvxBrushItem aBrush ( static_cast < const SvxBrushItem & > ( rFromSet . Get ( RES_BACKGROUND ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pCol )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pCol , MID_BACK_COLOR ) ;
2002-08-16 12:11:48 +00:00
if ( pColTrans )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pColTrans , MID_BACK_COLOR_TRANSPARENCY ) ;
if ( pRGBCol )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pRGBCol , MID_BACK_COLOR_R_G_B ) ;
2000-09-18 23:08:29 +00:00
if ( pTrans )
2002-08-16 12:11:48 +00:00
{
// don't overwrite transparency with a non-transparence flag
if ( ! pColTrans | | Any2Bool ( * pTrans ) )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pTrans , MID_GRAPHIC_TRANSPARENT ) ;
}
2000-09-18 23:08:29 +00:00
if ( pGrURL )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pGrURL , MID_GRAPHIC_URL ) ;
if ( pGrFilter )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pGrFilter , MID_GRAPHIC_FILTER ) ;
if ( pGrLoc )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pGrLoc , MID_GRAPHIC_POSITION ) ;
2002-08-16 12:11:48 +00:00
if ( pGrTranparency )
bRet & = ( ( SfxPoolItem & ) aBrush ) . PutValue ( * pGrTranparency , MID_GRAPHIC_TRANSPARENCY ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aBrush ) ;
2000-09-18 23:08:29 +00:00
}
}
{
uno : : Any * pCont = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_PROTECT , MID_PROTECT_CONTENT , pCont ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pPos = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_PROTECT , MID_PROTECT_POSITION , pPos ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pName = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_PROTECT , MID_PROTECT_SIZE , pName ) ;
2000-09-18 23:08:29 +00:00
if ( pCont | | pPos | | pName )
{
2001-10-23 16:40:05 +00:00
SvxProtectItem aProt ( static_cast < const SvxProtectItem & > ( rFromSet . Get ( RES_PROTECT ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pCont )
bRet & = ( ( SfxPoolItem & ) aProt ) . PutValue ( * pCont , MID_PROTECT_CONTENT ) ;
if ( pPos )
bRet & = ( ( SfxPoolItem & ) aProt ) . PutValue ( * pPos , MID_PROTECT_POSITION ) ;
if ( pName )
bRet & = ( ( SfxPoolItem & ) aProt ) . PutValue ( * pName , MID_PROTECT_SIZE ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aProt ) ;
2000-09-18 23:08:29 +00:00
}
}
{
uno : : Any * pHori = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_HORI_ORIENT , MID_HORIORIENT_ORIENT , pHori ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pHoriP = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_HORI_ORIENT , MID_HORIORIENT_POSITION | CONVERT_TWIPS , pHoriP ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pHoriR = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_HORI_ORIENT , MID_HORIORIENT_RELATION , pHoriR ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pPageT = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_HORI_ORIENT , MID_HORIORIENT_PAGETOGGLE , pPageT ) ;
2000-09-18 23:08:29 +00:00
if ( pHori | | pHoriP | | pHoriR | | pPageT )
{
2001-10-23 16:40:05 +00:00
SwFmtHoriOrient aOrient ( static_cast < const SwFmtHoriOrient & > ( rFromSet . Get ( RES_HORI_ORIENT ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pHori )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pHori , MID_HORIORIENT_ORIENT ) ;
if ( pHoriP )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pHoriP , MID_HORIORIENT_POSITION | CONVERT_TWIPS ) ;
if ( pHoriR )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pHoriR , MID_HORIORIENT_RELATION ) ;
if ( pPageT )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pPageT , MID_HORIORIENT_PAGETOGGLE ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aOrient ) ;
2000-09-18 23:08:29 +00:00
}
}
{
uno : : Any * pVert = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_VERT_ORIENT , MID_VERTORIENT_ORIENT , pVert ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pVertP = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_VERT_ORIENT , MID_VERTORIENT_POSITION | CONVERT_TWIPS , pVertP ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pVertR = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_VERT_ORIENT , MID_VERTORIENT_RELATION , pVertR ) ;
2000-09-18 23:08:29 +00:00
if ( pVert | | pVertP | | pVertR )
{
2001-10-23 16:40:05 +00:00
SwFmtVertOrient aOrient ( static_cast < const SwFmtVertOrient & > ( rFromSet . Get ( RES_VERT_ORIENT ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pVert )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pVert , MID_VERTORIENT_ORIENT ) ;
if ( pVertP )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pVertP , MID_VERTORIENT_POSITION | CONVERT_TWIPS ) ;
if ( pVertR )
bRet & = ( ( SfxPoolItem & ) aOrient ) . PutValue ( * pVertR , MID_VERTORIENT_RELATION ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aOrient ) ;
2000-09-18 23:08:29 +00:00
}
}
{
uno : : Any * pURL = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_URL , MID_URL_URL , pURL ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pTarget = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_URL , MID_URL_TARGET , pTarget ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pHyLNm = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_URL , MID_URL_HYPERLINKNAME , pHyLNm ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pHySMp = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_URL , MID_URL_SERVERMAP , pHySMp ) ;
2000-09-18 23:08:29 +00:00
if ( pURL | | pTarget | | pHyLNm | | pHySMp )
{
2001-10-23 16:40:05 +00:00
SwFmtURL aURL ( static_cast < const SwFmtURL & > ( rFromSet . Get ( RES_URL ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pURL )
bRet & = ( ( SfxPoolItem & ) aURL ) . PutValue ( * pURL , MID_URL_URL ) ;
if ( pTarget )
bRet & = ( ( SfxPoolItem & ) aURL ) . PutValue ( * pTarget , MID_URL_TARGET ) ;
if ( pHyLNm )
bRet & = ( ( SfxPoolItem & ) aURL ) . PutValue ( * pHyLNm , MID_URL_HYPERLINKNAME ) ;
if ( pHySMp )
bRet & = ( ( SfxPoolItem & ) aURL ) . PutValue ( * pHySMp , MID_URL_SERVERMAP ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aURL ) ;
2000-09-18 23:08:29 +00:00
}
}
uno : : Any * pL = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_LR_SPACE , MID_L_MARGIN | CONVERT_TWIPS , pL ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pR = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_LR_SPACE , MID_R_MARGIN | CONVERT_TWIPS , pR ) ;
2000-09-18 23:08:29 +00:00
if ( pL | | pR )
{
2001-10-23 16:40:05 +00:00
SvxLRSpaceItem aLR ( static_cast < const SvxLRSpaceItem & > ( rFromSet . Get ( RES_LR_SPACE ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pL )
bRet & = ( ( SfxPoolItem & ) aLR ) . PutValue ( * pL , MID_L_MARGIN | CONVERT_TWIPS ) ;
if ( pR )
bRet & = ( ( SfxPoolItem & ) aLR ) . PutValue ( * pR , MID_R_MARGIN | CONVERT_TWIPS ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aLR ) ;
2000-09-18 23:08:29 +00:00
}
uno : : Any * pT = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_UL_SPACE , MID_UP_MARGIN | CONVERT_TWIPS , pT ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pB = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_UL_SPACE , MID_LO_MARGIN | CONVERT_TWIPS , pB ) ;
2000-09-18 23:08:29 +00:00
if ( pT | | pB )
{
2001-10-23 16:40:05 +00:00
SvxULSpaceItem aTB ( static_cast < const SvxULSpaceItem & > ( rFromSet . Get ( RES_UL_SPACE ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pT )
bRet & = ( ( SfxPoolItem & ) aTB ) . PutValue ( * pT , MID_UP_MARGIN | CONVERT_TWIPS ) ;
if ( pB )
bRet & = ( ( SfxPoolItem & ) aTB ) . PutValue ( * pB , MID_LO_MARGIN | CONVERT_TWIPS ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aTB ) ;
2000-09-18 23:08:29 +00:00
}
uno : : Any * pOp ;
2001-06-15 13:27:58 +00:00
if ( GetProperty ( RES_OPAQUE , 0 , pOp ) )
2000-09-18 23:08:29 +00:00
{
2001-10-23 16:40:05 +00:00
SvxOpaqueItem aOp ( static_cast < const SvxOpaqueItem & > ( rFromSet . Get ( RES_OPAQUE ) ) ) ;
2000-09-18 23:08:29 +00:00
bRet & = ( ( SfxPoolItem & ) aOp ) . PutValue ( * pOp , 0 ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aOp ) ;
2000-09-18 23:08:29 +00:00
}
uno : : Any * pPrt ;
2001-06-15 13:27:58 +00:00
if ( GetProperty ( RES_PRINT , 0 , pPrt ) )
2000-09-18 23:08:29 +00:00
{
2001-10-23 16:40:05 +00:00
SvxPrintItem aPrt ( static_cast < const SvxPrintItem & > ( rFromSet . Get ( RES_PRINT ) ) ) ;
2000-09-18 23:08:29 +00:00
bRet & = ( ( SfxPoolItem & ) aPrt ) . PutValue ( * pPrt , 0 ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aPrt ) ;
2000-09-18 23:08:29 +00:00
}
uno : : Any * pSh ;
2001-06-15 13:27:58 +00:00
if ( GetProperty ( RES_SHADOW , CONVERT_TWIPS , pSh ) )
2000-09-18 23:08:29 +00:00
{
2001-10-23 16:40:05 +00:00
SvxShadowItem aSh ( static_cast < const SvxShadowItem & > ( rFromSet . Get ( RES_SHADOW ) ) ) ;
2000-09-18 23:08:29 +00:00
bRet & = ( ( SfxPoolItem & ) aSh ) . PutValue ( * pSh , CONVERT_TWIPS ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aSh ) ;
2000-09-18 23:08:29 +00:00
}
uno : : Any * pSur = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_SURROUND , MID_SURROUND_SURROUNDTYPE , pSur ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pSurAnch = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_SURROUND , MID_SURROUND_ANCHORONLY , pSurAnch ) ;
2000-09-18 23:08:29 +00:00
if ( pSur | | pSurAnch )
{
2001-10-23 16:40:05 +00:00
SwFmtSurround aSrnd ( static_cast < const SwFmtSurround & > ( rFromSet . Get ( RES_SURROUND ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pSur )
bRet & = ( ( SfxPoolItem & ) aSrnd ) . PutValue ( * pSur , MID_SURROUND_SURROUNDTYPE ) ;
if ( pSurAnch )
bRet & = ( ( SfxPoolItem & ) aSrnd ) . PutValue ( * pSurAnch , MID_SURROUND_ANCHORONLY ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aSrnd ) ;
2000-09-18 23:08:29 +00:00
}
uno : : Any * pLeft = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , LEFT_BORDER | CONVERT_TWIPS , pLeft ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pRight = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | RIGHT_BORDER , pRight ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pTop = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | TOP_BORDER , pTop ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pBottom = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | BOTTOM_BORDER , pBottom ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pDistance = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | BORDER_DISTANCE , pDistance ) ;
2000-12-08 07:32:02 +00:00
uno : : Any * pLeftDistance = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | LEFT_BORDER_DISTANCE , pLeftDistance ) ;
2000-12-08 07:32:02 +00:00
uno : : Any * pRightDistance = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | RIGHT_BORDER_DISTANCE , pRightDistance ) ;
2000-12-08 07:32:02 +00:00
uno : : Any * pTopDistance = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | TOP_BORDER_DISTANCE , pTopDistance ) ;
2000-12-08 07:32:02 +00:00
uno : : Any * pBottomDistance = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_BOX , CONVERT_TWIPS | BOTTOM_BORDER_DISTANCE , pBottomDistance ) ;
2000-12-08 07:32:02 +00:00
if ( pLeft | | pRight | | pTop | | pBottom | | pDistance | |
pLeftDistance | | pRightDistance | | pTopDistance | | pBottomDistance )
2000-09-18 23:08:29 +00:00
{
2001-10-23 16:40:05 +00:00
SvxBoxItem aBox ( static_cast < const SvxBoxItem & > ( rFromSet . Get ( RES_BOX ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pLeft )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pLeft , CONVERT_TWIPS | LEFT_BORDER ) ;
if ( pRight )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pRight , CONVERT_TWIPS | RIGHT_BORDER ) ;
if ( pTop )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pTop , CONVERT_TWIPS | TOP_BORDER ) ;
if ( pBottom )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pBottom , CONVERT_TWIPS | BOTTOM_BORDER ) ;
if ( pDistance )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pDistance , CONVERT_TWIPS | BORDER_DISTANCE ) ;
2000-12-08 07:32:02 +00:00
if ( pLeftDistance )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pLeftDistance , CONVERT_TWIPS | LEFT_BORDER_DISTANCE ) ;
if ( pRightDistance )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pRightDistance , CONVERT_TWIPS | RIGHT_BORDER_DISTANCE ) ;
if ( pTopDistance )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pTopDistance , CONVERT_TWIPS | TOP_BORDER_DISTANCE ) ;
if ( pBottomDistance )
bRet & = ( ( SfxPoolItem & ) aBox ) . PutValue ( * pBottomDistance , CONVERT_TWIPS | BOTTOM_BORDER_DISTANCE ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aBox ) ;
2000-09-18 23:08:29 +00:00
}
{
uno : : Any * pRelH = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_REL_HEIGHT , pRelH ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pRelW = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_REL_WIDTH , pRelW ) ;
2001-01-15 10:28:36 +00:00
uno : : Any * pSyncWidth = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT , pSyncWidth ) ;
2001-01-15 10:28:36 +00:00
uno : : Any * pSyncHeight = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH , pSyncHeight ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pWidth = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_WIDTH | CONVERT_TWIPS , pWidth ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pHeight = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_HEIGHT | CONVERT_TWIPS , pHeight ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pSize = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_SIZE | CONVERT_TWIPS , pSize ) ;
2000-09-18 23:08:29 +00:00
uno : : Any * pSizeType = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_SIZE_TYPE , pSizeType ) ;
2004-05-18 13:53:29 +00:00
uno : : Any * pWidthType = 0 ;
GetProperty ( RES_FRM_SIZE , MID_FRMSIZE_WIDTH_TYPE , pWidthType ) ;
2001-03-06 14:47:13 +00:00
if ( pWidth | | pHeight | | pRelH | | pRelW | | pSize | | pSizeType | |
2004-05-18 13:53:29 +00:00
pWidthType | | pSyncWidth | | pSyncHeight )
2000-09-18 23:08:29 +00:00
{
2001-05-28 12:29:57 +00:00
rSizeFound = sal_True ;
2001-10-23 16:40:05 +00:00
SwFmtFrmSize aFrmSz ( static_cast < const SwFmtFrmSize & > ( rFromSet . Get ( RES_FRM_SIZE ) ) ) ;
2000-09-18 23:08:29 +00:00
if ( pWidth )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pWidth , MID_FRMSIZE_WIDTH | CONVERT_TWIPS ) ;
if ( pHeight )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pHeight , MID_FRMSIZE_HEIGHT | CONVERT_TWIPS ) ;
if ( pRelH )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pRelH , MID_FRMSIZE_REL_HEIGHT ) ;
if ( pRelW )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pRelW , MID_FRMSIZE_REL_WIDTH ) ;
2001-01-15 10:28:36 +00:00
if ( pSyncWidth )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pSyncWidth , MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT ) ;
if ( pSyncHeight )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pSyncHeight , MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH ) ;
2000-09-18 23:08:29 +00:00
if ( pSize )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pSize , MID_FRMSIZE_SIZE | CONVERT_TWIPS ) ;
if ( pSizeType )
2001-06-15 13:27:58 +00:00
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pSizeType , MID_FRMSIZE_SIZE_TYPE ) ;
2004-05-18 13:53:29 +00:00
if ( pWidthType )
bRet & = ( ( SfxPoolItem & ) aFrmSz ) . PutValue ( * pWidthType , MID_FRMSIZE_WIDTH_TYPE ) ;
2000-12-11 07:15:23 +00:00
if ( ! aFrmSz . GetWidth ( ) )
aFrmSz . SetWidth ( MINFLY ) ;
if ( ! aFrmSz . GetHeight ( ) )
aFrmSz . SetHeight ( MINFLY ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aFrmSz ) ;
2000-09-18 23:08:29 +00:00
}
else
{
2001-05-28 12:29:57 +00:00
rSizeFound = sal_False ;
2000-09-18 23:08:29 +00:00
SwFmtFrmSize aFrmSz ;
awt : : Size aSize ;
2001-05-28 12:29:57 +00:00
aSize . Width = 2 * MM50 ;
aSize . Height = 2 * MM50 ;
2000-09-18 23:08:29 +00:00
uno : : Any aSizeVal ;
aSizeVal < < = aSize ;
( ( SfxPoolItem & ) aFrmSz ) . PutValue ( aSizeVal , MID_FRMSIZE_SIZE | CONVERT_TWIPS ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aFrmSz ) ;
2000-09-18 23:08:29 +00:00
}
}
2002-02-04 17:08:18 +00:00
uno : : Any * pFrameDirection = 0 ;
GetProperty ( RES_FRAMEDIR , 0 , pFrameDirection ) ;
if ( pFrameDirection )
{
SvxFrameDirectionItem aAttr ( FRMDIR_HORI_LEFT_TOP , RES_FRAMEDIR ) ;
aAttr . PutValue ( * pFrameDirection , 0 ) ;
rToSet . Put ( aAttr ) ;
}
2001-07-09 04:50:21 +00:00
uno : : Any * pUnknown = 0 ;
GetProperty ( RES_UNKNOWNATR_CONTAINER , 0 , pUnknown ) ;
if ( pUnknown )
{
SvXMLAttrContainerItem aAttr ( RES_UNKNOWNATR_CONTAINER ) ;
aAttr . PutValue ( * pUnknown , 0 ) ;
2001-10-23 16:40:05 +00:00
rToSet . Put ( aAttr ) ;
2001-07-09 04:50:21 +00:00
}
2004-02-02 17:26:06 +00:00
// DVO, OD 01.10.2003 #i18732#
uno : : Any * pFollowTextFlow = 0 ;
GetProperty ( RES_FOLLOW_TEXT_FLOW , 0 , pFollowTextFlow ) ;
if ( pFollowTextFlow )
{
SwFmtFollowTextFlow aFmtFollowTextFlow ;
aFmtFollowTextFlow . PutValue ( * pFollowTextFlow , 0 ) ;
rToSet . Put ( aFmtFollowTextFlow ) ;
}
2004-08-02 13:18:03 +00:00
// OD 2004-05-04 #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS
uno : : Any * pWrapInfluenceOnObjPos = 0 ;
GetProperty ( RES_WRAP_INFLUENCE_ON_OBJPOS , MID_WRAP_INFLUENCE , pWrapInfluenceOnObjPos ) ;
if ( pWrapInfluenceOnObjPos )
{
SwFmtWrapInfluenceOnObjPos aFmtWrapInfluenceOnObjPos ;
aFmtWrapInfluenceOnObjPos . PutValue ( * pWrapInfluenceOnObjPos , MID_WRAP_INFLUENCE ) ;
rToSet . Put ( aFmtWrapInfluenceOnObjPos ) ;
}
2000-09-18 23:08:29 +00:00
return bRet ;
}
/* -----------------22.06.98 09:17-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-06-15 13:27:58 +00:00
2000-09-18 23:08:29 +00:00
class SwFrameProperties_Impl : public BaseFrameProperties_Impl
{
2003-04-17 13:43:12 +00:00
protected :
SwFrameProperties_Impl ( const SfxItemPropertyMap * pMap ) :
BaseFrameProperties_Impl ( pMap ) { }
2000-09-18 23:08:29 +00:00
public :
SwFrameProperties_Impl ( ) ;
2001-06-15 13:27:58 +00:00
~ SwFrameProperties_Impl ( ) { }
2000-09-18 23:08:29 +00:00
2001-10-23 16:40:05 +00:00
virtual sal_Bool AnyToItemSet ( SwDoc * pDoc , SfxItemSet & rFrmSet , SfxItemSet & rSet , sal_Bool & rSizeFound ) ;
2000-09-18 23:08:29 +00:00
} ;
/* -----------------22.06.98 09:17-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-23 16:40:05 +00:00
SwFrameProperties_Impl : : SwFrameProperties_Impl ( ) :
BaseFrameProperties_Impl ( aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_TEXT_FRAME ) )
2000-09-18 23:08:29 +00:00
{
}
/* -----------------22.06.98 11:27-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-11-07 13:06:27 +00:00
inline void lcl_FillCol ( SfxItemSet & rToSet , const SfxItemSet & rFromSet , Any * pAny )
{
if ( pAny )
{
SwFmtCol aCol ( static_cast < const SwFmtCol & > ( rFromSet . Get ( RES_COL ) ) ) ;
( ( SfxPoolItem & ) aCol ) . PutValue ( * pAny , MID_COLUMNS ) ;
rToSet . Put ( aCol ) ;
}
}
2001-10-23 16:40:05 +00:00
sal_Bool SwFrameProperties_Impl : : AnyToItemSet ( SwDoc * pDoc , SfxItemSet & rSet , SfxItemSet & , sal_Bool & rSizeFound )
2000-09-18 23:08:29 +00:00
{
//Properties fuer alle Frames
2001-10-23 16:40:05 +00:00
uno : : Any * pStyleName ;
SwDocStyleSheet * pStyle = NULL ;
sal_Bool bRet ;
if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME , 0 , pStyleName ) )
{
OUString sStyle ;
* pStyleName > > = sStyle ;
pStyle = ( SwDocStyleSheet * ) pDoc - > GetDocShell ( ) - > GetStyleSheetPool ( ) - > Find ( sStyle ,
SFX_STYLE_FAMILY_FRAME ) ;
}
2001-11-07 13:06:27 +00:00
uno : : Any * pColumns = NULL ;
GetProperty ( RES_COL , MID_COLUMNS , pColumns ) ;
2001-10-23 16:40:05 +00:00
if ( pStyle )
2001-10-31 15:53:40 +00:00
{
2001-11-01 08:37:44 +00:00
SwDocStyleSheet aStyle ( * pStyle ) ;
2001-11-07 13:06:27 +00:00
const SfxItemSet * pItemSet = & aStyle . GetItemSet ( ) ;
bRet = FillBaseProperties ( rSet , * pItemSet , rSizeFound ) ;
lcl_FillCol ( rSet , * pItemSet , pColumns ) ;
2001-10-31 15:53:40 +00:00
}
2001-10-23 16:40:05 +00:00
else
2001-11-07 13:06:27 +00:00
{
const SfxItemSet * pItemSet = & pDoc - > GetFrmFmtFromPool ( RES_POOLFRM_FRAME ) - > GetAttrSet ( ) ;
bRet = FillBaseProperties ( rSet , * pItemSet , rSizeFound ) ;
lcl_FillCol ( rSet , * pItemSet , pColumns ) ;
}
2000-09-18 23:08:29 +00:00
uno : : Any * pEdit ;
2001-06-15 13:27:58 +00:00
if ( GetProperty ( RES_EDIT_IN_READONLY , 0 , pEdit ) )
2000-09-18 23:08:29 +00:00
{
SfxBoolItem aBool ( RES_EDIT_IN_READONLY ) ;
( ( SfxPoolItem & ) aBool ) . PutValue ( * pEdit , 0 ) ;
rSet . Put ( aBool ) ;
}
return bRet ;
}
/****************************************************************************
Grafik - Descriptor
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class SwGraphicProperties_Impl : public BaseFrameProperties_Impl
{
public :
SwGraphicProperties_Impl ( ) ;
2001-06-15 13:27:58 +00:00
~ SwGraphicProperties_Impl ( ) { }
2000-09-18 23:08:29 +00:00
2001-10-23 16:40:05 +00:00
virtual sal_Bool AnyToItemSet ( SwDoc * pDoc , SfxItemSet & rFrmSet , SfxItemSet & rSet , sal_Bool & rSizeFound ) ;
2000-09-18 23:08:29 +00:00
} ;
/* -----------------27.06.98 14:53-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-23 16:40:05 +00:00
SwGraphicProperties_Impl : : SwGraphicProperties_Impl ( ) :
BaseFrameProperties_Impl ( aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_TEXT_GRAPHIC ) )
2000-09-18 23:08:29 +00:00
{
2000-12-14 08:48:16 +00:00
}
2000-09-18 23:08:29 +00:00
/* -----------------27.06.98 14:40-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-11-07 13:06:27 +00:00
inline void lcl_FillMirror ( SfxItemSet & rToSet , const SfxItemSet & rFromSet , Any * pHEvenMirror , Any * pHOddMirror , Any * pVMirror , sal_Bool & rRet )
{
if ( pHEvenMirror | | pHOddMirror | | pVMirror )
{
SwMirrorGrf aMirror ( static_cast < const SwMirrorGrf & > ( rFromSet . Get ( RES_FRM_SIZE ) ) ) ;
if ( pHEvenMirror )
rRet & = ( ( SfxPoolItem & ) aMirror ) . PutValue ( * pHEvenMirror , MID_MIRROR_HORZ_EVEN_PAGES ) ;
if ( pHOddMirror )
rRet & = ( ( SfxPoolItem & ) aMirror ) . PutValue ( * pHOddMirror , MID_MIRROR_HORZ_ODD_PAGES ) ;
if ( pVMirror )
rRet & = ( ( SfxPoolItem & ) aMirror ) . PutValue ( * pVMirror , MID_MIRROR_VERT ) ;
rToSet . Put ( aMirror ) ;
}
}
2000-09-18 23:08:29 +00:00
sal_Bool SwGraphicProperties_Impl : : AnyToItemSet (
2001-10-23 16:40:05 +00:00
SwDoc * pDoc ,
2000-09-18 23:08:29 +00:00
SfxItemSet & rFrmSet ,
2001-05-28 12:29:57 +00:00
SfxItemSet & rGrSet ,
sal_Bool & rSizeFound )
2000-09-18 23:08:29 +00:00
{
//Properties fuer alle Frames
2001-10-23 16:40:05 +00:00
sal_Bool bRet ;
uno : : Any * pStyleName ;
SwDocStyleSheet * pStyle = NULL ;
if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME , 0 , pStyleName ) )
{
OUString sStyle ;
* pStyleName > > = sStyle ;
pStyle = ( SwDocStyleSheet * ) pDoc - > GetDocShell ( ) - > GetStyleSheetPool ( ) - > Find ( sStyle ,
SFX_STYLE_FAMILY_FRAME ) ;
}
2000-09-18 23:08:29 +00:00
2000-10-24 09:11:48 +00:00
uno : : Any * pHEvenMirror = 0 ;
uno : : Any * pHOddMirror = 0 ;
2000-09-18 23:08:29 +00:00
uno : : Any * pVMirror = 0 ;
2001-06-15 13:27:58 +00:00
GetProperty ( RES_GRFATR_MIRRORGRF , MID_MIRROR_HORZ_EVEN_PAGES , pHEvenMirror ) ;
GetProperty ( RES_GRFATR_MIRRORGRF , MID_MIRROR_HORZ_ODD_PAGES , pHOddMirror ) ;
GetProperty ( RES_GRFATR_MIRRORGRF , MID_MIRROR_VERT , pVMirror ) ;
2001-11-07 13:06:27 +00:00
if ( pStyle )
2000-09-18 23:08:29 +00:00
{
2001-11-07 13:06:27 +00:00
SwDocStyleSheet aStyle ( * pStyle ) ;
const SfxItemSet * pItemSet = & aStyle . GetItemSet ( ) ;
bRet = FillBaseProperties ( rFrmSet , * pItemSet , rSizeFound ) ;
lcl_FillMirror ( rGrSet , * pItemSet , pHEvenMirror , pHOddMirror , pVMirror , bRet ) ;
2000-09-18 23:08:29 +00:00
}
2001-11-07 13:06:27 +00:00
else
{
const SfxItemSet * pItemSet = & pDoc - > GetFrmFmtFromPool ( RES_POOLFRM_GRAPHIC ) - > GetAttrSet ( ) ;
bRet = FillBaseProperties ( rFrmSet , * pItemSet , rSizeFound ) ;
lcl_FillMirror ( rGrSet , * pItemSet , pHEvenMirror , pHOddMirror , pVMirror , bRet ) ;
}
2000-12-14 08:48:16 +00:00
static const USHORT nIDs [ ] =
{
RES_GRFATR_CROPGRF ,
RES_GRFATR_ROTATION ,
RES_GRFATR_LUMINANCE ,
RES_GRFATR_CONTRAST ,
RES_GRFATR_CHANNELR ,
RES_GRFATR_CHANNELG ,
RES_GRFATR_CHANNELB ,
RES_GRFATR_GAMMA ,
RES_GRFATR_INVERT ,
RES_GRFATR_TRANSPARENCY ,
RES_GRFATR_DRAWMODE ,
0
} ;
uno : : Any * pAny ;
for ( sal_Int16 nIndex = 0 ; nIDs [ nIndex ] ; nIndex + + )
2000-09-18 23:08:29 +00:00
{
2001-06-26 08:56:03 +00:00
BYTE nMId = RES_GRFATR_CROPGRF = = nIDs [ nIndex ] ? CONVERT_TWIPS : 0 ;
if ( GetProperty ( nIDs [ nIndex ] , nMId , pAny ) )
2000-12-14 08:48:16 +00:00
{
SfxPoolItem * pItem = : : GetDfltAttr ( nIDs [ nIndex ] ) - > Clone ( ) ;
2001-06-26 08:56:03 +00:00
bRet & = pItem - > PutValue ( * pAny , nMId ) ;
2000-12-14 08:48:16 +00:00
rGrSet . Put ( * pItem ) ;
delete pItem ;
}
2000-09-18 23:08:29 +00:00
}
2000-12-14 08:48:16 +00:00
2000-09-18 23:08:29 +00:00
return bRet ;
}
2003-04-17 13:43:12 +00:00
/* -----------------4/1/2003 13:54-------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
public :
SwOLEProperties_Impl ( ) :
SwFrameProperties_Impl ( aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_EMBEDDED_OBJECT ) ) { }
~ SwOLEProperties_Impl ( ) { }
virtual sal_Bool AnyToItemSet ( SwDoc * pDoc , SfxItemSet & rFrmSet , SfxItemSet & rSet , sal_Bool & rSizeFound ) ;
} ;
/* -----------------4/1/2003 15:32-------------------
2000-09-18 23:08:29 +00:00
2003-04-17 13:43:12 +00:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Bool SwOLEProperties_Impl : : AnyToItemSet (
SwDoc * pDoc , SfxItemSet & rFrmSet , SfxItemSet & rSet , sal_Bool & rSizeFound )
{
uno : : Any * pCLSID ;
if ( ! GetProperty ( FN_UNO_CLSID , 0 , pCLSID ) )
return FALSE ;
SwFrameProperties_Impl : : AnyToItemSet ( pDoc , rFrmSet , rSet , rSizeFound ) ;
//
return TRUE ;
}
2000-09-18 23:08:29 +00:00
/******************************************************************
* SwXFrame
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* -----------------------------10.03.00 18:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
const uno : : Sequence < sal_Int8 > & SwXFrame : : getUnoTunnelId ( )
{
static uno : : Sequence < sal_Int8 > aSeq = : : CreateUnoTunnelId ( ) ;
return aSeq ;
}
/* -----------------------------10.03.00 18:04--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Int64 SAL_CALL SwXFrame : : getSomething ( const uno : : Sequence < sal_Int8 > & rId )
throw ( RuntimeException )
{
if ( rId . getLength ( ) = = 16
& & 0 = = rtl_compareMemory ( getUnoTunnelId ( ) . getConstArray ( ) ,
rId . getConstArray ( ) , 16 ) )
{
return ( sal_Int64 ) this ;
}
return 0 ;
}
/*-----------------24.03.98 14:49-------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
TYPEINIT1 ( SwXFrame , SwClient ) ;
/* -----------------------------06.04.00 14:20--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
OUString SwXFrame : : getImplementationName ( void ) throw ( RuntimeException )
{
return C2U ( " SwXFrame " ) ;
}
/* -----------------------------06.04.00 14:20--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
BOOL SwXFrame : : supportsService ( const OUString & rServiceName ) throw ( RuntimeException )
{
2001-02-12 06:14:16 +00:00
return ! rServiceName . compareToAscii ( " com.sun.star.text.BaseFrame " ) | |
! rServiceName . compareToAscii ( " com.sun.star.text.TextContent " ) | |
! rServiceName . compareToAscii ( " com.sun.star.document.LinkTarget " ) ;
2000-09-18 23:08:29 +00:00
}
/* -----------------------------06.04.00 14:20--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Sequence < OUString > SwXFrame : : getSupportedServiceNames ( void ) throw ( RuntimeException )
{
2001-02-12 06:14:16 +00:00
Sequence < OUString > aRet ( 3 ) ;
2000-09-18 23:08:29 +00:00
OUString * pArray = aRet . getArray ( ) ;
2001-02-12 06:14:16 +00:00
pArray [ 0 ] = C2U ( " com.sun.star.text.BaseFrame " ) ;
pArray [ 1 ] = C2U ( " com.sun.star.text.TextContent " ) ;
pArray [ 2 ] = C2U ( " com.sun.star.document.LinkTarget " ) ;
2000-09-18 23:08:29 +00:00
return aRet ;
}
2004-08-12 11:42:23 +00:00
2000-09-18 23:08:29 +00:00
/*-- 14.01.99 11:31:52---------------------------------------------------
Dieser CTor legt den Frame als Descriptor an
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2004-08-12 11:42:23 +00:00
SwXFrame : : SwXFrame ( FlyCntType eSet , const SfxItemPropertyMap * pMap , SwDoc * pDoc )
:
2000-09-18 23:08:29 +00:00
aLstnrCntnr ( ( container : : XNamed * ) this ) ,
eType ( eSet ) ,
aPropSet ( pMap ) ,
_pMap ( pMap ) ,
2001-10-12 12:57:26 +00:00
bIsDescriptor ( sal_True ) ,
mpDoc ( pDoc )
2000-09-18 23:08:29 +00:00
{
2001-10-12 12:57:26 +00:00
// Register ourselves as a listener to the document (via the page descriptor)
pDoc - > GetPageDescFromPool ( RES_POOLPAGE_STANDARD ) - > Add ( this ) ;
// get the property set for the default style data
// First get the model
Reference < XModel > xModel = pDoc - > GetDocShell ( ) - > GetBaseModel ( ) ;
// Ask the model for it's family supplier interface
Reference < XStyleFamiliesSupplier > xFamilySupplier ( xModel , UNO_QUERY ) ;
// Get the style families
Reference < XNameAccess > xFamilies = xFamilySupplier - > getStyleFamilies ( ) ;
// Get the Frame family (and keep it for later)
Any aAny = xFamilies - > getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " FrameStyles " ) ) ) ;
aAny > > = mxStyleFamily ;
// In the derived class, we'll ask mxStyleFamily for the relevant default style
2001-10-23 16:40:05 +00:00
// mxStyleFamily is initialised in the SwXFrame constructor
switch ( eType )
{
case FLYCNTTYPE_FRM :
{
Any aAny = mxStyleFamily - > getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Frame " ) ) ) ;
aAny > > = mxStyleData ;
pProps = new SwFrameProperties_Impl ( ) ;
}
break ;
case FLYCNTTYPE_GRF :
{
Any aAny = mxStyleFamily - > getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Graphics " ) ) ) ;
aAny > > = mxStyleData ;
pProps = new SwGraphicProperties_Impl ( ) ;
}
break ;
case FLYCNTTYPE_OLE :
{
Any aAny = mxStyleFamily - > getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " OLE " ) ) ) ;
aAny > > = mxStyleData ;
pProps = 0 ;
2003-04-17 13:43:12 +00:00
pProps = new SwOLEProperties_Impl ( ) ;
2001-10-23 16:40:05 +00:00
}
break ;
}
2000-09-18 23:08:29 +00:00
}
/*-- 11.12.98 15:05:01---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXFrame : : SwXFrame ( SwFrmFmt & rFrmFmt , FlyCntType eSet , const SfxItemPropertyMap * pMap ) :
eType ( eSet ) ,
SwClient ( & rFrmFmt ) ,
aLstnrCntnr ( ( container : : XNamed * ) this ) ,
aPropSet ( pMap ) ,
_pMap ( pMap ) ,
bIsDescriptor ( sal_False ) ,
pProps ( 0 )
{
}
/*-- 11.12.98 15:05:02---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXFrame : : ~ SwXFrame ( )
{
delete pProps ;
}
/*-- 11.12.98 15:05:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*-- 11.12.98 15:05:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
OUString SwXFrame : : getName ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
String sRet ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
sRet = pFmt - > GetName ( ) ;
else if ( bIsDescriptor )
sRet = sName ;
else
throw RuntimeException ( ) ;
return sRet ;
}
/*-- 11.12.98 15:05:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : setName ( const OUString & rName ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
String sTmpName ( rName ) ;
if ( pFmt )
{
pFmt - > GetDoc ( ) - > SetFlyName ( ( SwFlyFrmFmt & ) * pFmt , sTmpName ) ;
if ( pFmt - > GetName ( ) ! = sTmpName )
{
throw RuntimeException ( ) ;
}
}
else if ( bIsDescriptor )
sName = sTmpName ;
else
throw RuntimeException ( ) ;
}
/*-- 11.12.98 15:05:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XPropertySetInfo > SwXFrame : : getPropertySetInfo ( void ) throw ( RuntimeException )
{
uno : : Reference < XPropertySetInfo > xRef ;
static uno : : Reference < XPropertySetInfo > xFrmRef ;
static uno : : Reference < XPropertySetInfo > xGrfRef ;
static uno : : Reference < XPropertySetInfo > xOLERef ;
switch ( eType )
{
case FLYCNTTYPE_FRM :
if ( ! xFrmRef . is ( ) )
xFrmRef = aPropSet . getPropertySetInfo ( ) ;
xRef = xFrmRef ;
break ;
case FLYCNTTYPE_GRF :
if ( ! xGrfRef . is ( ) )
xGrfRef = aPropSet . getPropertySetInfo ( ) ;
xRef = xGrfRef ;
break ;
case FLYCNTTYPE_OLE :
if ( ! xOLERef . is ( ) )
xOLERef = aPropSet . getPropertySetInfo ( ) ;
xRef = xOLERef ;
break ;
}
return xRef ;
}
/*-- 11.12.98 15:05:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2000-12-06 10:36:14 +00:00
2002-11-26 11:35:55 +00:00
SdrObject * SwXFrame : : GetOrCreateSdrObject ( SwFlyFrmFmt * pFmt )
2000-12-06 10:36:14 +00:00
{
SdrObject * pObject = pFmt - > FindSdrObject ( ) ;
if ( ! pObject )
{
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
2005-09-28 10:22:42 +00:00
// --> OD 2005-08-08 #i52858# - method name changed
SdrModel * pDrawModel = pDoc - > GetOrCreateDrawModel ( ) ;
// <--
2000-12-06 10:36:14 +00:00
SwFlyDrawContact * pContactObject
= new SwFlyDrawContact ( pFmt , pDrawModel ) ;
pObject = pContactObject - > GetMaster ( ) ;
const SwFmtSurround & rSurround = pFmt - > GetSurround ( ) ;
pObject - > SetLayer (
( SURROUND_THROUGHT = = rSurround . GetSurround ( ) & &
! pFmt - > GetOpaque ( ) . GetValue ( ) ) ? pDoc - > GetHellId ( )
: pDoc - > GetHeavenId ( ) ) ;
pDrawModel - > GetPage ( 0 ) - > InsertObject ( pObject ) ;
}
return pObject ;
}
2000-12-20 06:55:54 +00:00
SwFrmFmt * lcl_GetFrmFmt ( const uno : : Any & rValue , SwDoc * pDoc )
{
SwFrmFmt * pRet = 0 ;
SwDocShell * pDocSh = pDoc - > GetDocShell ( ) ;
if ( pDocSh )
{
OUString uTemp ;
rValue > > = uTemp ;
2001-08-16 11:33:56 +00:00
String sStyle ;
SwStyleNameMapper : : FillUIName ( String ( uTemp ) , sStyle , GET_POOLID_FRMFMT , sal_True ) ;
2000-12-20 06:55:54 +00:00
SwDocStyleSheet * pStyle =
( SwDocStyleSheet * ) pDocSh - > GetStyleSheetPool ( ) - > Find ( sStyle ,
SFX_STYLE_FAMILY_FRAME ) ;
if ( pStyle )
pRet = pStyle - > GetFrmFmt ( ) ;
}
return pRet ;
}
2000-09-18 23:08:29 +00:00
void SwXFrame : : setPropertyValue ( const OUString & rPropertyName , const uno : : Any & aValue )
throw ( UnknownPropertyException , PropertyVetoException , lang : : IllegalArgumentException , WrappedTargetException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
2001-06-15 13:27:58 +00:00
const SfxItemPropertyMap * pCur = SfxItemPropertyMap : : GetByName ( _pMap , rPropertyName ) ;
2001-11-28 19:13:57 +00:00
if ( ! pCur )
throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Unknown property: " ) ) + rPropertyName , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2000-09-18 23:08:29 +00:00
if ( pFmt )
{
sal_Bool bNextFrame = sal_False ;
2001-04-27 05:42:08 +00:00
if ( pCur - > nFlags & PropertyAttribute : : READONLY )
2002-08-16 12:11:48 +00:00
throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Property is read-only: " ) ) + rPropertyName , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2001-04-27 05:42:08 +00:00
2000-09-18 23:08:29 +00:00
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
if ( eType = = FLYCNTTYPE_GRF & &
2001-05-21 12:01:57 +00:00
( pCur - > nWID > = RES_GRFATR_BEGIN & &
pCur - > nWID < RES_GRFATR_END ) | |
2001-05-04 07:41:21 +00:00
pCur - > nWID = = FN_PARAM_COUNTOUR_PP | |
pCur - > nWID = = FN_UNO_IS_AUTOMATIC_CONTOUR | |
2001-05-21 12:01:57 +00:00
pCur - > nWID = = FN_UNO_IS_PIXEL_CONTOUR | |
FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
SwNoTxtNode * pNoTxt = aIdx . GetNode ( ) . GetNoTxtNode ( ) ;
2001-05-21 12:01:57 +00:00
if ( FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
OUString uTemp ;
aValue > > = uTemp ;
pNoTxt - > SetAlternateText ( uTemp ) ;
}
2000-10-24 13:26:57 +00:00
else if ( pCur - > nWID = = FN_PARAM_COUNTOUR_PP )
{
PointSequenceSequence aParam ;
if ( ! aValue . hasValue ( ) )
pNoTxt - > SetContour ( 0 ) ;
else if ( aValue > > = aParam )
{
2001-05-04 07:41:21 +00:00
PolyPolygon aPoly ( ( USHORT ) aParam . getLength ( ) ) ;
2000-10-24 13:26:57 +00:00
for ( sal_Int32 i = 0 ; i < aParam . getLength ( ) ; i + + )
{
const PointSequence * pPointSeq = aParam . getConstArray ( ) ;
2001-05-04 07:41:21 +00:00
sal_Int32 nPoints = pPointSeq [ i ] . getLength ( ) ;
const awt : : Point * pPoints = pPointSeq [ i ] . getConstArray ( ) ;
Polygon aSet ( ( USHORT ) nPoints ) ;
for ( sal_Int32 j = 0 ; j < nPoints ; j + + )
2000-10-24 13:26:57 +00:00
{
2001-05-04 07:41:21 +00:00
Point aPoint ( pPoints [ j ] . X , pPoints [ j ] . Y ) ;
aSet . SetPoint ( aPoint , ( USHORT ) j ) ;
2000-10-24 13:26:57 +00:00
}
2001-05-04 07:41:21 +00:00
// Close polygon if it isn't closed already.
aSet . Optimize ( POLY_OPTIMIZE_CLOSE ) ;
2000-10-24 13:26:57 +00:00
aPoly . Insert ( aSet ) ;
}
2001-05-04 07:41:21 +00:00
pNoTxt - > SetContourAPI ( & aPoly ) ;
2000-10-24 13:26:57 +00:00
}
else
throw IllegalArgumentException ( ) ;
}
2001-05-04 07:41:21 +00:00
else if ( pCur - > nWID = = FN_UNO_IS_AUTOMATIC_CONTOUR )
{
pNoTxt - > SetAutomaticContour ( * ( sal_Bool * ) aValue . getValue ( ) ) ;
}
else if ( pCur - > nWID = = FN_UNO_IS_PIXEL_CONTOUR )
{
// The IsPixelContour property can only be set if there
// is no contour, or if the contour has been set by the
// API itself (or in other words, if the contour isn't
// used already).
if ( ! pNoTxt - > _HasContour ( ) | |
! pNoTxt - > IsContourMapModeValid ( ) )
pNoTxt - > SetPixelContour ( * ( sal_Bool * ) aValue . getValue ( ) ) ;
else
throw IllegalArgumentException ( ) ;
}
2000-09-18 23:08:29 +00:00
else
{
SfxItemSet aSet ( pNoTxt - > GetSwAttrSet ( ) ) ;
2000-11-15 14:00:49 +00:00
aPropSet . setPropertyValue ( * pCur , aValue , aSet ) ;
2000-09-18 23:08:29 +00:00
pNoTxt - > SetAttr ( aSet ) ;
}
}
}
2001-05-21 12:01:57 +00:00
else if ( FN_UNO_FRAME_STYLE_NAME = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
2000-12-20 06:55:54 +00:00
SwFrmFmt * pFrmFmt = lcl_GetFrmFmt ( aValue , pFmt - > GetDoc ( ) ) ;
if ( pFrmFmt )
2000-09-18 23:08:29 +00:00
{
2000-12-20 06:55:54 +00:00
UnoActionContext aAction ( pFmt - > GetDoc ( ) ) ;
2003-03-27 14:45:43 +00:00
SfxItemSet * pSet = 0 ;
2004-11-09 11:31:53 +00:00
// --> OD 2004-08-13 #i31771#, #i25798# - No adjustment of
// anchor ( no call of method <::lcl_ChkAndSetNewAnchor(..)> ),
// if document is currently in reading mode.
if ( ! pFmt - > GetDoc ( ) - > IsInReading ( ) )
2003-03-27 14:45:43 +00:00
{
2004-11-09 11:31:53 +00:00
// see SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos )
SwFlyFrm * pFly = 0 ;
2003-03-27 14:45:43 +00:00
{
2004-11-09 11:31:53 +00:00
const SwFrmFmt * pFmtXX = pFmt ;
if ( PTR_CAST ( SwFlyFrmFmt , pFmtXX ) )
pFly = ( ( SwFlyFrmFmt * ) pFmtXX ) - > GetFrm ( ) ;
}
if ( pFly )
{
const SfxPoolItem * pItem ;
if ( SFX_ITEM_SET = = pFrmFmt - > GetItemState ( RES_ANCHOR , sal_False , & pItem ) )
{
pSet = new SfxItemSet ( pDoc - > GetAttrPool ( ) , aFrmFmtSetRange ) ;
pSet - > Put ( * pItem ) ;
if ( ! : : lcl_ChkAndSetNewAnchor ( * pFly , * pSet ) )
delete pSet , pSet = 0 ;
}
2003-03-27 14:45:43 +00:00
}
}
2004-11-09 11:31:53 +00:00
// <--
2003-03-27 14:45:43 +00:00
pFmt - > GetDoc ( ) - > SetFrmFmtToFly ( * pFmt , * pFrmFmt , pSet , FALSE ) ;
delete pSet ;
2000-09-18 23:08:29 +00:00
}
2000-12-20 06:55:54 +00:00
else
throw IllegalArgumentException ( ) ;
2000-09-18 23:08:29 +00:00
}
2001-05-21 12:01:57 +00:00
else if ( FN_UNO_GRAPHIC_U_R_L = = pCur - > nWID | |
FN_UNO_GRAPHIC_FILTER = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
String sGrfName , sFltName ;
2000-11-29 13:57:24 +00:00
GraphicObject * pGrfObj = 0 ;
2000-09-18 23:08:29 +00:00
pFmt - > GetDoc ( ) - > GetGrfNms ( * ( SwFlyFrmFmt * ) pFmt , & sGrfName , & sFltName ) ;
OUString uTemp ;
aValue > > = uTemp ;
String sTmp ( uTemp ) ;
UnoActionContext aAction ( pFmt - > GetDoc ( ) ) ;
2001-05-21 12:01:57 +00:00
if ( FN_UNO_GRAPHIC_U_R_L = = pCur - > nWID )
2000-11-29 13:57:24 +00:00
{
if ( sTmp . EqualsAscii ( sPackageProtocol ,
0 , sizeof ( sPackageProtocol ) - 1 ) )
{
2001-03-02 13:08:50 +00:00
pGrfObj = new GraphicObject ;
pGrfObj - > SetUserData ( sTmp ) ;
pGrfObj - > SetSwapState ( ) ;
2000-11-29 13:57:24 +00:00
sGrfName . Erase ( ) ;
}
else if ( sTmp . EqualsAscii ( sGraphicObjectProtocol ,
0 , sizeof ( sGraphicObjectProtocol ) - 1 ) )
{
ByteString sId ( sTmp . Copy ( sizeof ( sGraphicObjectProtocol ) - 1 ) ,
RTL_TEXTENCODING_ASCII_US ) ;
pGrfObj = new GraphicObject ( sId ) ;
sGrfName . Erase ( ) ;
}
else
{
2001-11-30 14:00:46 +00:00
sGrfName = sTmp ;
2000-11-29 13:57:24 +00:00
}
}
2000-09-18 23:08:29 +00:00
else
2000-11-29 13:57:24 +00:00
{
2000-09-18 23:08:29 +00:00
sFltName = sTmp ;
2000-11-29 13:57:24 +00:00
}
2000-09-18 23:08:29 +00:00
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
SwGrfNode * pGrfNode = aIdx . GetNode ( ) . GetGrfNode ( ) ;
if ( ! pGrfNode )
2000-11-29 13:57:24 +00:00
{
delete pGrfObj ;
2000-09-18 23:08:29 +00:00
throw RuntimeException ( ) ;
2000-11-29 13:57:24 +00:00
}
2000-09-18 23:08:29 +00:00
SwPaM aGrfPaM ( * pGrfNode ) ;
2000-11-29 13:57:24 +00:00
pFmt - > GetDoc ( ) - > ReRead ( aGrfPaM , sGrfName , sFltName , 0 ,
pGrfObj ) ;
2000-09-18 23:08:29 +00:00
}
2000-11-29 13:57:24 +00:00
delete pGrfObj ;
2000-09-18 23:08:29 +00:00
}
2001-06-13 11:03:44 +00:00
else if ( 0 ! = ( bNextFrame = ( rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_CHAIN_NEXT_NAME ) ) ) )
| | rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_CHAIN_PREV_NAME ) ) )
2000-09-18 23:08:29 +00:00
{
OUString uTemp ;
aValue > > = uTemp ;
String sChainName ( uTemp ) ;
if ( ! sChainName . Len ( ) )
{
if ( bNextFrame )
pDoc - > Unchain ( * pFmt ) ;
else
{
SwFmtChain aChain ( pFmt - > GetChain ( ) ) ;
SwFrmFmt * pPrev = aChain . GetPrev ( ) ;
if ( pPrev )
pDoc - > Unchain ( * pPrev ) ;
}
}
else
{
2000-12-22 08:54:15 +00:00
sal_uInt16 nCount = pDoc - > GetFlyCount ( FLYCNTTYPE_FRM ) ;
2000-09-18 23:08:29 +00:00
SwFrmFmt * pChain = 0 ;
for ( sal_uInt16 i = 0 ; i < nCount ; i + + )
{
SwFrmFmt * pFmt = pDoc - > GetFlyNum ( i , FLYCNTTYPE_FRM ) ;
if ( sChainName = = pFmt - > GetName ( ) )
{
pChain = pFmt ;
break ;
}
}
if ( pChain )
{
SwFrmFmt * pSource = bNextFrame ? pFmt : pChain ;
SwFrmFmt * pDest = bNextFrame ? pChain : pFmt ;
pDoc - > Chain ( * pSource , * pDest ) ;
}
}
}
2000-11-27 10:13:17 +00:00
else if ( FN_UNO_Z_ORDER = = pCur - > nWID )
{
sal_Int32 nZOrder = - 1 ;
aValue > > = nZOrder ;
2000-12-06 10:36:14 +00:00
if ( nZOrder > = 0 )
2000-11-27 10:13:17 +00:00
{
2000-12-06 10:36:14 +00:00
SdrObject * pObject =
2002-11-26 11:35:55 +00:00
GetOrCreateSdrObject ( ( SwFlyFrmFmt * ) pFmt ) ;
2000-12-06 10:36:14 +00:00
SdrModel * pDrawModel = pDoc - > GetDrawModel ( ) ;
pDrawModel - > GetPage ( 0 ) - >
SetObjectOrdNum ( pObject - > GetOrdNum ( ) , nZOrder ) ;
2000-11-27 10:13:17 +00:00
}
}
2001-03-12 11:30:40 +00:00
else if ( RES_ANCHOR = = pCur - > nWID & & MID_ANCHOR_ANCHORFRAME = = pCur - > nMemberId )
{
2004-11-16 14:55:23 +00:00
sal_Bool bDone = sal_False ;
2001-03-12 11:30:40 +00:00
Reference < XTextFrame > xFrame ;
if ( aValue > > = xFrame )
{
Reference < XUnoTunnel > xTunnel ( xFrame , UNO_QUERY ) ;
SwXFrame * pFrame = xTunnel . is ( ) ?
( SwXFrame * ) xTunnel - > getSomething ( SwXFrame : : getUnoTunnelId ( ) ) : 0 ;
if ( pFrame & & this ! = pFrame & & pFrame - > GetFrmFmt ( ) & & pFrame - > GetFrmFmt ( ) - > GetDoc ( ) = = pDoc )
{
SfxItemSet aSet ( pDoc - > GetAttrPool ( ) ,
RES_FRMATR_BEGIN , RES_FRMATR_END - 1 ) ;
aSet . SetParent ( & pFmt - > GetAttrSet ( ) ) ;
SwFmtAnchor aAnchor = ( const SwFmtAnchor & ) aSet . Get ( pCur - > nWID ) ;
SwPosition aPos ( * pFrame - > GetFrmFmt ( ) - > GetCntnt ( ) . GetCntntIdx ( ) ) ;
aAnchor . SetAnchor ( & aPos ) ;
aAnchor . SetType ( FLY_AT_FLY ) ;
aSet . Put ( aAnchor ) ;
pDoc - > SetFlyFrmAttr ( * pFmt , aSet ) ;
bDone = sal_True ;
}
}
if ( ! bDone )
2001-03-14 09:35:27 +00:00
throw IllegalArgumentException ( ) ;
2001-03-12 11:30:40 +00:00
}
2000-09-18 23:08:29 +00:00
else
{
SfxItemSet aSet ( pDoc - > GetAttrPool ( ) ,
RES_FRMATR_BEGIN , RES_FRMATR_END - 1 ) ;
aSet . SetParent ( & pFmt - > GetAttrSet ( ) ) ;
2000-11-15 14:00:49 +00:00
aPropSet . setPropertyValue ( * pCur , aValue , aSet ) ;
2001-03-12 09:00:47 +00:00
if ( RES_ANCHOR = = pCur - > nWID & & MID_ANCHOR_ANCHORTYPE = = pCur - > nMemberId )
{
SwFmtAnchor aAnchor = ( const SwFmtAnchor & ) aSet . Get ( pCur - > nWID ) ;
if ( aAnchor . GetAnchorId ( ) = = FLY_AT_FLY )
{
const SwPosition * pPosition = aAnchor . GetCntntAnchor ( ) ;
SwFrmFmt * pFmt = pPosition ? pPosition - > nNode . GetNode ( ) . GetFlyFmt ( ) : 0 ;
if ( ! pFmt | | pFmt - > Which ( ) = = RES_DRAWFRMFMT )
{
lang : : IllegalArgumentException aExcept ;
aExcept . Message = C2U ( " Anchor to frame: no frame found " ) ;
throw aExcept ;
}
else
{
SwPosition aPos = * pPosition ;
aPos . nNode = * pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
aAnchor . SetAnchor ( & aPos ) ;
aSet . Put ( aAnchor ) ;
}
}
2001-06-06 12:31:31 +00:00
else if ( aAnchor . GetAnchorId ( ) ! = FLY_PAGE & & ! aAnchor . GetCntntAnchor ( ) )
{
SwNode & rNode = pDoc - > GetNodes ( ) . GetEndOfContent ( ) ;
SwPaM aPam ( rNode ) ;
aPam . Move ( fnMoveBackward , fnGoDoc ) ;
aAnchor . SetAnchor ( aPam . Start ( ) ) ;
aSet . Put ( aAnchor ) ;
}
2003-04-01 14:22:09 +00:00
2004-11-09 11:31:53 +00:00
// --> OD 2004-08-13 #i31771#, #i25798# - No adjustment of
// anchor ( no call of method <::lcl_ChkAndSetNewAnchor(..)> ),
// if document is currently in reading mode.
if ( ! pFmt - > GetDoc ( ) - > IsInReading ( ) )
2003-04-01 14:22:09 +00:00
{
2004-11-09 11:31:53 +00:00
// see SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
SwFlyFrm * pFly = 0 ;
if ( PTR_CAST ( SwFlyFrmFmt , pFmt ) )
pFly = ( ( SwFlyFrmFmt * ) pFmt ) - > GetFrm ( ) ;
if ( pFly )
2003-04-01 14:22:09 +00:00
{
2004-11-09 11:31:53 +00:00
const SfxPoolItem * pItem ;
if ( SFX_ITEM_SET = = aSet . GetItemState ( RES_ANCHOR , sal_False , & pItem ) )
{
aSet . Put ( * pItem ) ;
: : lcl_ChkAndSetNewAnchor ( * pFly , aSet ) ;
}
2003-04-01 14:22:09 +00:00
}
}
2004-11-09 11:31:53 +00:00
// <--
2003-04-01 14:22:09 +00:00
2000-09-18 23:08:29 +00:00
pFmt - > GetDoc ( ) - > SetFlyFrmAttr ( * pFmt , aSet ) ;
2001-03-12 09:00:47 +00:00
}
2003-04-17 13:43:12 +00:00
else if ( FN_UNO_CLSID = = pCur - > nWID )
{
throw lang : : IllegalArgumentException ( ) ;
}
2000-09-18 23:08:29 +00:00
else
pFmt - > SetAttr ( aSet ) ;
}
}
else if ( IsDescriptor ( ) )
2001-10-15 09:06:21 +00:00
{
2001-06-15 13:27:58 +00:00
pProps - > SetProperty ( pCur - > nWID , pCur - > nMemberId , aValue ) ;
2001-10-15 12:54:21 +00:00
if ( FN_UNO_FRAME_STYLE_NAME = = pCur - > nWID )
2001-10-15 09:06:21 +00:00
{
2001-10-15 12:54:21 +00:00
OUString sStyleName ;
aValue > > = sStyleName ;
try
{
Any aAny = mxStyleFamily - > getByName ( sStyleName ) ;
aAny > > = mxStyleData ;
}
catch ( container : : NoSuchElementException & )
{
}
catch ( WrappedTargetException & )
{
}
catch ( RuntimeException & )
{
}
2001-10-15 09:06:21 +00:00
}
}
2000-09-18 23:08:29 +00:00
else
throw RuntimeException ( ) ;
}
/*-- 11.12.98 15:05:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Any SwXFrame : : getPropertyValue ( const OUString & rPropertyName )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
uno : : Any aAny ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
2001-06-15 13:27:58 +00:00
const SfxItemPropertyMap * pCur = SfxItemPropertyMap : : GetByName ( _pMap , rPropertyName ) ;
2001-11-28 19:13:57 +00:00
if ( ! pCur )
throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Unknown property: " ) ) + rPropertyName , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2001-06-15 13:27:58 +00:00
if ( FN_UNO_ANCHOR_TYPES = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
uno : : Sequence < TextContentAnchorType > aTypes ( 5 ) ;
TextContentAnchorType * pArray = aTypes . getArray ( ) ;
pArray [ 0 ] = TextContentAnchorType_AT_PARAGRAPH ;
pArray [ 1 ] = TextContentAnchorType_AS_CHARACTER ;
pArray [ 2 ] = TextContentAnchorType_AT_PAGE ;
pArray [ 3 ] = TextContentAnchorType_AT_FRAME ;
pArray [ 4 ] = TextContentAnchorType_AT_CHARACTER ;
aAny . setValue ( & aTypes , : : getCppuType ( ( uno : : Sequence < TextContentAnchorType > * ) 0 ) ) ;
}
else if ( pFmt )
{
2003-03-27 14:45:43 +00:00
if ( ( ( eType = = FLYCNTTYPE_GRF ) | | ( eType = = FLYCNTTYPE_OLE ) ) & &
2000-09-18 23:08:29 +00:00
pCur & &
2000-12-18 12:32:58 +00:00
( ( pCur - > nWID > = RES_GRFATR_BEGIN & &
pCur - > nWID < RES_GRFATR_END ) | |
2001-05-04 07:41:21 +00:00
pCur - > nWID = = FN_PARAM_COUNTOUR_PP | |
pCur - > nWID = = FN_UNO_IS_AUTOMATIC_CONTOUR | |
pCur - > nWID = = FN_UNO_IS_PIXEL_CONTOUR ) )
2000-09-18 23:08:29 +00:00
{
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
SwNoTxtNode * pNoTxt = aIdx . GetNode ( ) . GetNoTxtNode ( ) ;
2000-10-24 13:26:57 +00:00
if ( pCur - > nWID = = FN_PARAM_COUNTOUR_PP )
{
2001-05-04 07:41:21 +00:00
PolyPolygon aContour ;
if ( pNoTxt - > GetContourAPI ( aContour ) )
2000-10-24 13:26:57 +00:00
{
2001-05-04 07:41:21 +00:00
PointSequenceSequence aPtSeq ( aContour . Count ( ) ) ;
2000-10-24 13:26:57 +00:00
PointSequence * pPSeq = aPtSeq . getArray ( ) ;
2001-05-04 07:41:21 +00:00
for ( USHORT i = 0 ; i < aContour . Count ( ) ; i + + )
2000-10-24 13:26:57 +00:00
{
2001-05-04 07:41:21 +00:00
const Polygon & rPoly = aContour . GetObject ( i ) ;
2000-10-24 13:26:57 +00:00
pPSeq [ i ] . realloc ( rPoly . GetSize ( ) ) ;
awt : : Point * pPoints = pPSeq [ i ] . getArray ( ) ;
for ( USHORT j = 0 ; j < rPoly . GetSize ( ) ; j + + )
{
const Point & rPoint = rPoly . GetPoint ( j ) ;
2001-05-04 07:41:21 +00:00
pPoints [ j ] . X = rPoint . X ( ) ;
pPoints [ j ] . Y = rPoint . Y ( ) ;
2000-10-24 13:26:57 +00:00
}
}
aAny < < = aPtSeq ;
}
}
2001-05-04 07:41:21 +00:00
else if ( pCur - > nWID = = FN_UNO_IS_AUTOMATIC_CONTOUR )
{
BOOL bValue = pNoTxt - > HasAutomaticContour ( ) ;
aAny . setValue ( & bValue , : : getBooleanCppuType ( ) ) ;
}
else if ( pCur - > nWID = = FN_UNO_IS_PIXEL_CONTOUR )
{
BOOL bValue = pNoTxt - > IsPixelContour ( ) ;
aAny . setValue ( & bValue , : : getBooleanCppuType ( ) ) ;
}
2000-10-24 13:26:57 +00:00
else
{
SfxItemSet aSet ( pNoTxt - > GetSwAttrSet ( ) ) ;
2000-11-15 14:00:49 +00:00
aAny = aPropSet . getPropertyValue ( * pCur , aSet ) ;
2000-10-24 13:26:57 +00:00
}
2000-09-18 23:08:29 +00:00
}
}
2001-05-21 12:01:57 +00:00
else if ( FN_UNO_GRAPHIC_U_R_L = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
2000-11-29 13:57:24 +00:00
String sGrfName ;
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
SwGrfNode * pGrfNode = aIdx . GetNode ( ) . GetGrfNode ( ) ;
if ( ! pGrfNode )
throw RuntimeException ( ) ;
if ( pGrfNode - > IsGrfLink ( ) )
{
pFmt - > GetDoc ( ) - > GetGrfNms ( * ( SwFlyFrmFmt * ) pFmt , & sGrfName , 0 ) ;
}
else
{
String sPrefix ( RTL_CONSTASCII_STRINGPARAM ( sGraphicObjectProtocol ) ) ;
String sId ( pGrfNode - > GetGrfObj ( ) . GetUniqueID ( ) ,
RTL_TEXTENCODING_ASCII_US ) ;
( sGrfName = sPrefix ) + = sId ;
}
}
aAny < < = OUString ( sGrfName ) ;
}
2001-05-21 12:01:57 +00:00
else if ( FN_UNO_GRAPHIC_FILTER = = pCur - > nWID )
2000-11-29 13:57:24 +00:00
{
String sFltName ;
pFmt - > GetDoc ( ) - > GetGrfNms ( * ( SwFlyFrmFmt * ) pFmt , 0 , & sFltName ) ;
2000-09-18 23:08:29 +00:00
aAny < < = OUString ( sFltName ) ;
}
2001-05-21 12:01:57 +00:00
else if ( FN_UNO_FRAME_STYLE_NAME = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
2001-07-20 09:40:14 +00:00
aAny < < = OUString ( SwStyleNameMapper : : GetProgName ( pFmt - > DerivedFrom ( ) - > GetName ( ) , GET_POOLID_FRMFMT ) ) ;
2000-09-18 23:08:29 +00:00
}
else if ( eType = = FLYCNTTYPE_GRF & &
2001-06-13 11:03:44 +00:00
( rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_ACTUAL_SIZE ) ) | |
2001-05-21 12:01:57 +00:00
FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID ) )
2000-09-18 23:08:29 +00:00
{
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
SwNoTxtNode * pNoTxt = aIdx . GetNode ( ) . GetNoTxtNode ( ) ;
2001-05-21 12:01:57 +00:00
if ( FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
aAny < < = OUString ( pNoTxt - > GetAlternateText ( ) ) ;
else
{
Size aActSize = ( ( SwGrfNode * ) pNoTxt ) - > GetTwipSize ( ) ;
awt : : Size aTmp ;
aTmp . Width = TWIP_TO_MM100 ( aActSize . Width ( ) ) ;
aTmp . Height = TWIP_TO_MM100 ( aActSize . Height ( ) ) ;
aAny . setValue ( & aTmp , : : getCppuType ( ( const awt : : Size * ) 0 ) ) ;
}
}
}
2000-11-27 10:13:17 +00:00
else if ( FN_PARAM_LINK_DISPLAY_NAME = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
{
aAny < < = OUString ( pFmt - > GetName ( ) ) ;
}
2000-11-27 10:13:17 +00:00
else if ( FN_UNO_Z_ORDER = = pCur - > nWID )
{
2000-12-06 13:25:52 +00:00
const SdrObject * pObj = pFmt - > FindRealSdrObject ( ) ;
if ( pObj )
2000-11-27 10:13:17 +00:00
{
aAny < < = ( sal_Int32 ) pObj - > GetOrdNum ( ) ;
}
}
2003-04-17 13:43:12 +00:00
else if ( FN_UNO_CLSID = = pCur - > nWID | | FN_UNO_MODEL = = pCur - > nWID | |
FN_UNO_COMPONENT = = pCur - > nWID )
{
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
const SwFmtCntnt * pCnt = & pFmt - > GetCntnt ( ) ;
DBG_ASSERT ( pCnt - > GetCntntIdx ( ) & &
pDoc - > GetNodes ( ) [ pCnt - > GetCntntIdx ( ) - >
GetIndex ( ) + 1 ] - > GetOLENode ( ) , " kein OLE-Node? " )
SwOLENode * pOleNode = pDoc - > GetNodes ( ) [ pCnt - > GetCntntIdx ( )
- > GetIndex ( ) + 1 ] - > GetOLENode ( ) ;
2004-10-04 18:13:38 +00:00
uno : : Reference < embed : : XEmbeddedObject > xIP = pOleNode - > GetOLEObj ( ) . GetOleRef ( ) ;
2003-04-17 13:43:12 +00:00
OUString aHexCLSID ;
{
2004-11-26 15:27:27 +00:00
SvGlobalName aClassName ( xIP - > getClassID ( ) ) ;
2003-04-17 13:43:12 +00:00
aHexCLSID = aClassName . GetHexName ( ) ;
if ( FN_UNO_CLSID ! = pCur - > nWID )
{
2004-11-26 15:27:27 +00:00
if ( svt : : EmbeddedObjectRef : : TryRunningState ( xIP ) )
{
uno : : Reference < lang : : XComponent > xComp ( xIP - > getComponent ( ) , uno : : UNO_QUERY ) ;
uno : : Reference < frame : : XModel > xModel ( xComp , uno : : UNO_QUERY ) ;
if ( xModel . is ( ) )
aAny < < = xModel ;
else if ( FN_UNO_COMPONENT = = pCur - > nWID )
aAny < < = xComp ;
}
2003-04-17 13:43:12 +00:00
}
}
2004-10-04 18:13:38 +00:00
2003-04-17 13:43:12 +00:00
if ( FN_UNO_CLSID = = pCur - > nWID )
aAny < < = aHexCLSID ;
}
2006-07-14 07:31:03 +00:00
else if ( WID_LAYOUT_SIZE = = pCur - > nWID )
{
// property is only valid/available if the document is layoutet
// so we check this now
if ( pFmt - > GetDoc ( ) - > GetRootFrm ( ) )
{
SwClientIter aIter ( * pFmt ) ;
for ( SwClient * pC = aIter . First ( TYPE ( SwFrm ) ) ;
pC ; pC = aIter . Next ( ) )
{
SwFrm * pTmpFrm = static_cast < SwFrm * > ( pC ) ;
// check if the frame is valid (actually it does not always
// mean that this frame was already formated. But it is the
// best way to check that is available...)
if ( pTmpFrm - > IsValid ( ) )
{
const SwRect & rRect = pTmpFrm - > Frm ( ) ;
Size aMM100Size = OutputDevice : : LogicToLogic (
Size ( rRect . Width ( ) , rRect . Height ( ) ) ,
MapMode ( MAP_TWIP ) , MapMode ( MAP_100TH_MM ) ) ;
aAny < < = awt : : Size ( aMM100Size . Width ( ) , aMM100Size . Height ( ) ) ;
break ;
}
}
}
}
2000-09-18 23:08:29 +00:00
else
{
const SwAttrSet & rSet = pFmt - > GetAttrSet ( ) ;
2000-11-15 14:00:49 +00:00
aAny = aPropSet . getPropertyValue ( * pCur , rSet ) ;
2000-09-18 23:08:29 +00:00
}
}
else if ( IsDescriptor ( ) )
{
2001-10-15 09:06:21 +00:00
if ( ! mpDoc )
throw RuntimeException ( ) ;
2006-07-14 07:31:03 +00:00
if ( WID_LAYOUT_SIZE ! = pCur - > nWID ) // there is no LayoutSize in a descriptor
{
uno : : Any * pAny = 0 ;
if ( ! pProps - > GetProperty ( pCur - > nWID , pCur - > nMemberId , pAny ) )
pProps - > GetProperty ( rPropertyName , mxStyleData , aAny ) ;
else if ( pAny )
aAny = * pAny ;
}
2000-09-18 23:08:29 +00:00
}
else
throw RuntimeException ( ) ;
return aAny ;
}
/*-- 11.12.98 15:05:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : addPropertyChangeListener ( const OUString & PropertyName ,
const uno : : Reference < XPropertyChangeListener > & aListener )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
DBG_WARNING ( " not implemented " )
}
/*-- 11.12.98 15:05:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : removePropertyChangeListener ( const OUString & PropertyName ,
const uno : : Reference < XPropertyChangeListener > & aListener )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
DBG_WARNING ( " not implemented " )
}
/*-- 11.12.98 15:05:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : addVetoableChangeListener ( const OUString & PropertyName ,
const uno : : Reference < XVetoableChangeListener > & aListener )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
DBG_WARNING ( " not implemented " )
}
/*-- 11.12.98 15:05:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : removeVetoableChangeListener (
const OUString & PropertyName , const uno : : Reference < XVetoableChangeListener > & aListener )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
DBG_WARNING ( " not implemented " )
}
/*-- 12.09.00 14:04:53---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
PropertyState SwXFrame : : getPropertyState ( const OUString & rPropertyName )
throw ( UnknownPropertyException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
Sequence < OUString > aPropertyNames ( 1 ) ;
OUString * pNames = aPropertyNames . getArray ( ) ;
pNames [ 0 ] = rPropertyName ;
Sequence < PropertyState > aStates = getPropertyStates ( aPropertyNames ) ;
return aStates . getConstArray ( ) [ 0 ] ;
}
/*-- 12.09.00 14:04:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Sequence < PropertyState > SwXFrame : : getPropertyStates (
const Sequence < OUString > & aPropertyNames )
throw ( UnknownPropertyException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
Sequence < PropertyState > aStates ( aPropertyNames . getLength ( ) ) ;
PropertyState * pStates = aStates . getArray ( ) ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
const OUString * pNames = aPropertyNames . getConstArray ( ) ;
const SwAttrSet & rFmtSet = pFmt - > GetAttrSet ( ) ;
for ( int i = 0 ; i < aPropertyNames . getLength ( ) ; i + + )
{
const SfxItemPropertyMap * pCur = SfxItemPropertyMap : : GetByName ( _pMap , pNames [ i ] ) ;
2001-11-28 19:13:57 +00:00
if ( ! pCur )
throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Unknown property: " ) ) + pNames [ i ] , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2000-09-18 23:08:29 +00:00
if ( pCur - > nWID = = FN_UNO_ANCHOR_TYPES | |
pCur - > nWID = = FN_PARAM_LINK_DISPLAY_NAME | |
2001-05-21 12:01:57 +00:00
FN_UNO_FRAME_STYLE_NAME = = pCur - > nWID | |
FN_UNO_GRAPHIC_U_R_L = = pCur - > nWID | |
FN_UNO_GRAPHIC_FILTER = = pCur - > nWID | |
FN_UNO_ACTUAL_SIZE = = pCur - > nWID | |
FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
pStates [ i ] = PropertyState_DIRECT_VALUE ;
else
{
if ( eType = = FLYCNTTYPE_GRF & &
pCur & &
2000-12-18 12:32:58 +00:00
( pCur - > nWID > = RES_GRFATR_BEGIN & &
pCur - > nWID < = RES_GRFATR_END ) )
2000-09-18 23:08:29 +00:00
{
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
SwNoTxtNode * pNoTxt = aIdx . GetNode ( ) . GetNoTxtNode ( ) ;
SfxItemSet aSet ( pNoTxt - > GetSwAttrSet ( ) ) ;
aSet . GetItemState ( pCur - > nWID ) ;
if ( SFX_ITEM_SET = = aSet . GetItemState ( pCur - > nWID , FALSE ) )
pStates [ i ] = beans : : PropertyState_DIRECT_VALUE ;
}
}
else
{
if ( SFX_ITEM_SET = = rFmtSet . GetItemState ( pCur - > nWID , FALSE ) )
pStates [ i ] = beans : : PropertyState_DIRECT_VALUE ;
else
pStates [ i ] = beans : : PropertyState_DEFAULT_VALUE ;
}
}
}
}
else if ( IsDescriptor ( ) )
{
for ( int i = 0 ; i < aPropertyNames . getLength ( ) ; i + + )
pStates [ i ] = PropertyState_DIRECT_VALUE ;
}
else
throw RuntimeException ( ) ;
return aStates ;
}
/*-- 12.09.00 14:04:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : setPropertyToDefault ( const OUString & rPropertyName )
throw ( UnknownPropertyException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
const SwAttrSet & rFmtSet = pFmt - > GetAttrSet ( ) ;
const SfxItemPropertyMap * pCur = SfxItemPropertyMap : : GetByName ( _pMap , rPropertyName ) ;
2001-11-28 19:13:57 +00:00
if ( ! pCur )
throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Unknown property: " ) ) + rPropertyName , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2001-10-16 10:58:14 +00:00
if ( pCur - > nFlags & PropertyAttribute : : READONLY )
2004-08-11 14:42:27 +00:00
throw RuntimeException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " setPropertyToDefault: property is read-only: " ) ) + rPropertyName , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2001-10-16 10:58:14 +00:00
2000-09-18 23:08:29 +00:00
BOOL bNextFrame ;
if ( pCur - > nWID & &
pCur - > nWID ! = FN_UNO_ANCHOR_TYPES & &
pCur - > nWID ! = FN_PARAM_LINK_DISPLAY_NAME )
{
if ( eType = = FLYCNTTYPE_GRF & &
2001-06-15 13:27:58 +00:00
( FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID | |
2000-12-18 12:32:58 +00:00
( pCur - > nWID > = RES_GRFATR_BEGIN & &
2001-06-15 13:27:58 +00:00
pCur - > nWID < RES_GRFATR_END ) ) )
2000-09-18 23:08:29 +00:00
{
const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
SwNoTxtNode * pNoTxt = aIdx . GetNode ( ) . GetNoTxtNode ( ) ;
2001-06-15 13:27:58 +00:00
if ( FN_UNO_ALTERNATIVE_TEXT = = pCur - > nWID )
2000-09-18 23:08:29 +00:00
pNoTxt - > SetAlternateText ( aEmptyStr ) ;
else
{
SfxItemSet aSet ( pNoTxt - > GetSwAttrSet ( ) ) ;
aSet . ClearItem ( pCur - > nWID ) ;
pNoTxt - > SetAttr ( aSet ) ;
}
}
}
else
{
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
SfxItemSet aSet ( pDoc - > GetAttrPool ( ) ,
RES_FRMATR_BEGIN , RES_FRMATR_END - 1 ) ;
aSet . SetParent ( & pFmt - > GetAttrSet ( ) ) ;
aSet . ClearItem ( pCur - > nWID ) ;
2001-06-13 11:03:44 +00:00
if ( ! rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_ANCHOR_TYPE ) ) )
2000-09-18 23:08:29 +00:00
pFmt - > SetAttr ( aSet ) ;
}
}
2001-06-13 11:03:44 +00:00
else if ( 0 ! = ( bNextFrame = ( rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_CHAIN_NEXT_NAME ) ) ) )
| | rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_CHAIN_PREV_NAME ) ) )
2000-09-18 23:08:29 +00:00
{
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
if ( bNextFrame )
pDoc - > Unchain ( * pFmt ) ;
else
{
SwFmtChain aChain ( pFmt - > GetChain ( ) ) ;
SwFrmFmt * pPrev = aChain . GetPrev ( ) ;
if ( pPrev )
pDoc - > Unchain ( * pPrev ) ;
}
}
}
else if ( ! IsDescriptor ( ) )
throw RuntimeException ( ) ;
}
/*-- 12.09.00 14:04:55---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Any SwXFrame : : getPropertyDefault ( const OUString & rPropertyName )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
Any aRet ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
const SfxItemPropertyMap * pCur = SfxItemPropertyMap : : GetByName ( _pMap , rPropertyName ) ;
if ( pCur )
{
2001-10-16 10:58:14 +00:00
if ( pCur - > nWID < RES_FRMATR_END )
2000-09-18 23:08:29 +00:00
{
const SfxPoolItem & rDefItem =
pFmt - > GetDoc ( ) - > GetAttrPool ( ) . GetDefaultItem ( pCur - > nWID ) ;
rDefItem . QueryValue ( aRet , pCur - > nMemberId ) ;
}
}
else
2001-11-28 19:13:57 +00:00
throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( " Unknown property: " ) ) + rPropertyName , static_cast < cppu : : OWeakObject * > ( this ) ) ;
2000-09-18 23:08:29 +00:00
}
else if ( ! IsDescriptor ( ) )
throw RuntimeException ( ) ;
return aRet ;
}
/* -----------------22.04.99 14:59-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : addEventListener ( const uno : : Reference < XEventListener > & aListener ) throw ( RuntimeException )
{
if ( ! GetRegisteredIn ( ) )
throw RuntimeException ( ) ;
aLstnrCntnr . AddListener ( aListener ) ;
}
/* -----------------22.04.99 14:59-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : removeEventListener ( const uno : : Reference < XEventListener > & aListener ) throw ( RuntimeException )
{
if ( ! GetRegisteredIn ( ) | | ! aLstnrCntnr . RemoveListener ( aListener ) )
throw RuntimeException ( ) ;
}
/*-- 11.12.98 15:05:06---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : Modify ( SfxPoolItem * pOld , SfxPoolItem * pNew )
{
ClientModify ( this , pOld , pNew ) ;
if ( ! GetRegisteredIn ( ) )
2001-10-15 09:06:21 +00:00
{
mxStyleData . clear ( ) ;
mxStyleFamily . clear ( ) ;
mpDoc = 0 ;
2000-09-18 23:08:29 +00:00
aLstnrCntnr . Disposing ( ) ;
2001-10-15 09:06:21 +00:00
}
2000-09-18 23:08:29 +00:00
}
/*-- 11.12.98 15:23:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : dispose ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
2003-09-29 14:05:47 +00:00
if ( pFmt )
2000-09-18 23:08:29 +00:00
{
2003-05-08 07:50:57 +00:00
SdrObject * pObj = pFmt - > FindSdrObject ( ) ;
2003-09-29 14:05:47 +00:00
// OD 11.09.2003 #112039# - add condition to perform delete of
// format/anchor sign, not only if the object is inserted, but also
// if a contact object is registered, which isn't in the destruction.
if ( pObj & &
( pObj - > IsInserted ( ) | |
( pObj - > GetUserCall ( ) & &
! static_cast < SwContact * > ( pObj - > GetUserCall ( ) ) - > IsInDTOR ( ) ) ) )
2003-05-08 07:50:57 +00:00
{
if ( pFmt - > GetAnchor ( ) . GetAnchorId ( ) = = FLY_IN_CNTNT )
2003-05-22 07:44:15 +00:00
{
const SwPosition & rPos = * ( pFmt - > GetAnchor ( ) . GetCntntAnchor ( ) ) ;
SwTxtNode * pTxtNode = rPos . nNode . GetNode ( ) . GetTxtNode ( ) ;
const xub_StrLen nIdx = rPos . nContent . GetIndex ( ) ;
pTxtNode - > Delete ( RES_TXTATR_FLYCNT , nIdx , nIdx ) ;
}
else
pFmt - > GetDoc ( ) - > DelLayoutFmt ( pFmt ) ;
2003-05-08 07:50:57 +00:00
}
2000-09-18 23:08:29 +00:00
}
}
/*-- 11.12.98 16:02:27---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XTextRange > SwXFrame : : getAnchor ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
uno : : Reference < XTextRange > aRef ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
2001-08-01 11:51:14 +00:00
const SwFmtAnchor & rAnchor = pFmt - > GetAnchor ( ) ;
// return an anchor for non-page bound frames
// and for page bound frames that have a page no == NULL and a content position
if ( rAnchor . GetAnchorId ( ) ! = FLY_PAGE | |
( rAnchor . GetCntntAnchor ( ) & & ! rAnchor . GetPageNum ( ) ) )
2000-09-18 23:08:29 +00:00
{
2001-08-01 11:51:14 +00:00
const SwPosition & rPos = * ( rAnchor . GetCntntAnchor ( ) ) ;
2001-01-12 15:15:41 +00:00
aRef = SwXTextRange : : CreateTextRangeFromPosition ( pFmt - > GetDoc ( ) , rPos , 0 ) ;
2000-09-18 23:08:29 +00:00
}
}
else
throw RuntimeException ( ) ;
return aRef ;
}
/* -----------------14.01.99 12:02-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : ResetDescriptor ( )
{
bIsDescriptor = sal_False ;
2001-10-15 09:06:21 +00:00
mxStyleData . clear ( ) ;
mxStyleFamily . clear ( ) ;
2000-09-18 23:08:29 +00:00
DELETEZ ( pProps ) ;
}
/* -----------------18.02.99 13:34-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : attachToRange ( const uno : : Reference < XTextRange > & xTextRange )
throw ( IllegalArgumentException , RuntimeException )
{
2004-06-17 15:04:10 +00:00
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
2000-09-18 23:08:29 +00:00
if ( ! IsDescriptor ( ) )
throw RuntimeException ( ) ;
uno : : Reference < XUnoTunnel > xRangeTunnel ( xTextRange , uno : : UNO_QUERY ) ;
SwXTextRange * pRange = 0 ;
2003-04-01 14:34:01 +00:00
OTextCursorHelper * pCursor = 0 ;
2000-09-18 23:08:29 +00:00
if ( xRangeTunnel . is ( ) )
{
pRange = ( SwXTextRange * ) xRangeTunnel - > getSomething (
SwXTextRange : : getUnoTunnelId ( ) ) ;
2003-04-01 14:34:01 +00:00
pCursor = ( OTextCursorHelper * ) xRangeTunnel - > getSomething (
OTextCursorHelper : : getUnoTunnelId ( ) ) ;
2000-09-18 23:08:29 +00:00
}
SwDoc * pDoc = pRange ? ( SwDoc * ) pRange - > GetDoc ( ) : pCursor ? ( SwDoc * ) pCursor - > GetDoc ( ) : 0 ;
if ( pDoc )
{
SwUnoInternalPaM aIntPam ( * pDoc ) ;
//das muss jetzt sal_True liefern
SwXTextRange : : XTextRangeToSwPaM ( aIntPam , xTextRange ) ;
SwNode & rNode = pDoc - > GetNodes ( ) . GetEndOfContent ( ) ;
SwPaM aPam ( rNode ) ;
aPam . Move ( fnMoveBackward , fnGoDoc ) ;
static sal_uInt16 __READONLY_DATA aFrmAttrRange [ ] =
{
RES_FRMATR_BEGIN , RES_FRMATR_END - 1 ,
SID_ATTR_BORDER_INNER , SID_ATTR_BORDER_INNER ,
2001-07-09 04:50:21 +00:00
RES_UNKNOWNATR_CONTAINER , RES_UNKNOWNATR_CONTAINER ,
2000-09-18 23:08:29 +00:00
0
} ;
static sal_uInt16 __READONLY_DATA aGrAttrRange [ ] =
{
RES_GRFATR_BEGIN , RES_GRFATR_END - 1 ,
0
} ;
SfxItemSet aGrSet ( pDoc - > GetAttrPool ( ) , aGrAttrRange ) ;
SfxItemSet aFrmSet ( pDoc - > GetAttrPool ( ) , aFrmAttrRange ) ;
//jetzt muessen die passenden Items in den Set
2001-05-28 12:29:57 +00:00
sal_Bool bSizeFound ;
2001-10-23 16:40:05 +00:00
if ( ! pProps - > AnyToItemSet ( pDoc , aFrmSet , aGrSet , bSizeFound ) )
2000-09-18 23:08:29 +00:00
throw IllegalArgumentException ( ) ;
//der TextRange wird einzeln behandelt
* aPam . GetPoint ( ) = * aIntPam . GetPoint ( ) ;
if ( aIntPam . HasMark ( ) )
{
aPam . SetMark ( ) ;
* aPam . GetMark ( ) = * aIntPam . GetMark ( ) ;
}
const SfxPoolItem * pItem ;
2001-03-13 14:50:56 +00:00
if ( SFX_ITEM_SET = = aFrmSet . GetItemState ( RES_ANCHOR , sal_False , & pItem ) )
2000-09-18 23:08:29 +00:00
{
2001-03-13 14:50:56 +00:00
if ( FLY_AT_FLY = = ( ( const SwFmtAnchor * ) pItem ) - > GetAnchorId ( ) & &
! aPam . GetNode ( ) - > FindFlyStartNode ( ) )
{
//rahmengebunden geht nur dort, wo ein Rahmen ist!
SwFmtAnchor aAnchor ( FLY_AT_CNTNT ) ;
aFrmSet . Put ( aAnchor ) ;
}
else if ( FLY_PAGE = = ( ( const SwFmtAnchor * ) pItem ) - > GetAnchorId ( ) & &
0 = = ( ( const SwFmtAnchor * ) pItem ) - > GetPageNum ( ) )
{
SwFmtAnchor aAnchor ( * ( ( const SwFmtAnchor * ) pItem ) ) ;
aAnchor . SetAnchor ( aPam . GetPoint ( ) ) ;
aFrmSet . Put ( aAnchor ) ;
}
2000-09-18 23:08:29 +00:00
}
2001-03-13 14:50:56 +00:00
2000-12-20 06:55:54 +00:00
uno : : Any * pStyle ;
SwFrmFmt * pParentFrmFmt = 0 ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_FRAME_STYLE_NAME , 0 , pStyle ) )
2000-12-20 06:55:54 +00:00
pParentFrmFmt = lcl_GetFrmFmt ( * pStyle , pDoc ) ;
2000-09-18 23:08:29 +00:00
SwFlyFrmFmt * pFmt = 0 ;
if ( eType = = FLYCNTTYPE_FRM )
{
UnoActionContext aCont ( pDoc ) ;
2000-12-20 06:55:54 +00:00
pFmt = pDoc - > MakeFlySection ( FLY_AT_CNTNT , aPam . GetPoint ( ) ,
& aFrmSet , pParentFrmFmt ) ;
2000-09-18 23:08:29 +00:00
if ( pFmt )
{
pFmt - > Add ( this ) ;
if ( sName . Len ( ) )
pDoc - > SetFlyName ( ( SwFlyFrmFmt & ) * pFmt , sName ) ;
}
//den SwXText wecken
2001-10-15 09:06:21 +00:00
( ( SwXTextFrame * ) this ) - > SetDoc ( bIsDescriptor ? mpDoc : GetFrmFmt ( ) - > GetDoc ( ) ) ;
2000-09-18 23:08:29 +00:00
}
else if ( eType = = FLYCNTTYPE_GRF )
{
UnoActionContext aCont ( pDoc ) ;
uno : : Any * pGraphicURL ;
String sGraphicURL ;
2000-11-29 13:57:24 +00:00
GraphicObject * pGrfObj = 0 ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_GRAPHIC_U_R_L , 0 , pGraphicURL ) )
2000-09-18 23:08:29 +00:00
{
OUString uTemp ;
( * pGraphicURL ) > > = uTemp ;
sGraphicURL = String ( uTemp ) ;
2000-11-29 13:57:24 +00:00
if ( sGraphicURL . EqualsAscii ( sPackageProtocol ,
0 , sizeof ( sPackageProtocol ) - 1 ) )
{
2001-03-02 13:08:50 +00:00
pGrfObj = new GraphicObject ;
pGrfObj - > SetUserData ( sGraphicURL ) ;
pGrfObj - > SetSwapState ( ) ;
2000-11-29 13:57:24 +00:00
sGraphicURL . Erase ( ) ;
}
else if ( sGraphicURL . EqualsAscii ( sGraphicObjectProtocol ,
0 , sizeof ( sGraphicObjectProtocol ) - 1 ) )
{
ByteString sId ( sGraphicURL . Copy ( sizeof ( sGraphicObjectProtocol ) - 1 ) ,
RTL_TEXTENCODING_ASCII_US ) ;
pGrfObj = new GraphicObject ( sId ) ;
sGraphicURL . Erase ( ) ;
}
2000-09-18 23:08:29 +00:00
}
String sFltName ;
uno : : Any * pFilter ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_GRAPHIC_FILTER , 0 , pFilter ) )
2000-09-18 23:08:29 +00:00
{
OUString uTemp ;
( * pFilter ) > > = uTemp ;
sFltName = String ( uTemp ) ;
}
2000-12-06 10:36:14 +00:00
pFmt =
2000-12-20 06:55:54 +00:00
pGrfObj ? pDoc - > Insert ( aPam , * pGrfObj , & aFrmSet , & aGrSet ,
pParentFrmFmt )
2000-11-29 13:57:24 +00:00
: pDoc - > Insert ( aPam , sGraphicURL , sFltName , 0 ,
2000-12-20 06:55:54 +00:00
& aFrmSet , & aGrSet , pParentFrmFmt ) ;
2000-11-29 13:57:24 +00:00
delete pGrfObj ;
2000-12-06 10:36:14 +00:00
if ( pFmt )
2000-09-18 23:08:29 +00:00
{
2001-05-28 12:29:57 +00:00
SwGrfNode * pGrfNd = pDoc - > GetNodes ( ) [ pFmt - > GetCntnt ( ) . GetCntntIdx ( )
- > GetIndex ( ) + 1 ] - > GetGrfNode ( ) ;
pGrfNd - > SetChgTwipSize ( ! bSizeFound ) ;
2000-12-06 10:36:14 +00:00
pFmt - > Add ( this ) ;
2000-09-18 23:08:29 +00:00
if ( sName . Len ( ) )
2000-12-06 10:36:14 +00:00
pDoc - > SetFlyName ( ( SwFlyFrmFmt & ) * pFmt , sName ) ;
2000-10-24 13:26:57 +00:00
2000-09-18 23:08:29 +00:00
}
2000-11-16 11:49:04 +00:00
uno : : Any * pSurroundContour ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( RES_SURROUND , MID_SURROUND_CONTOUR , pSurroundContour ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_SURROUND_CONTOUR ) ) , * pSurroundContour ) ;
2000-11-16 11:49:04 +00:00
uno : : Any * pContourOutside ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( RES_SURROUND , MID_SURROUND_CONTOUROUTSIDE , pContourOutside ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_CONTOUR_OUTSIDE ) ) , * pContourOutside ) ;
2000-10-24 13:26:57 +00:00
uno : : Any * pContourPoly ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_PARAM_COUNTOUR_PP , 0 , pContourPoly ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_CONTOUR_POLY_POLYGON ) ) , * pContourPoly ) ;
2001-05-04 07:41:21 +00:00
uno : : Any * pPixelContour ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_IS_PIXEL_CONTOUR , 0 , pPixelContour ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_IS_PIXEL_CONTOUR ) ) , * pPixelContour ) ;
2001-05-04 07:41:21 +00:00
uno : : Any * pAutoContour ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_IS_AUTOMATIC_CONTOUR , 0 , pAutoContour ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_IS_AUTOMATIC_CONTOUR ) ) , * pAutoContour ) ;
2000-11-16 11:49:04 +00:00
uno : : Any * pAltText ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_ALTERNATIVE_TEXT , 0 , pAltText ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_ALTERNATIVE_TEXT ) ) , * pAltText ) ;
2000-09-18 23:08:29 +00:00
}
else
{
2003-04-17 13:43:12 +00:00
uno : : Any * pCLSID ;
if ( ! pProps - > GetProperty ( FN_UNO_CLSID , 0 , pCLSID ) )
throw RuntimeException ( ) ;
OUString aCLSID ;
SvGlobalName aClassName ;
2004-10-04 18:13:38 +00:00
uno : : Reference < embed : : XEmbeddedObject > xIPObj ;
2005-02-25 08:27:49 +00:00
std : : auto_ptr < comphelper : : EmbeddedObjectContainer > pCnt ;
2003-04-17 13:43:12 +00:00
if ( ( * pCLSID ) > > = aCLSID )
{
sal_Bool bInternal = sal_True ;
if ( ! aClassName . MakeId ( aCLSID ) )
{
IllegalArgumentException aExcept ;
aExcept . Message = OUString : : createFromAscii ( " CLSID invalid " ) ;
throw aExcept ;
}
2004-10-04 18:13:38 +00:00
2005-02-25 08:27:49 +00:00
pCnt . reset ( new comphelper : : EmbeddedObjectContainer ) ;
2004-10-04 18:13:38 +00:00
: : rtl : : OUString aName ;
2005-02-25 08:27:49 +00:00
xIPObj = pCnt - > CreateEmbeddedObject ( aClassName . GetByteSequence ( ) , aName ) ;
2003-04-17 13:43:12 +00:00
}
2004-10-04 18:13:38 +00:00
if ( xIPObj . is ( ) )
2003-04-17 13:43:12 +00:00
{
2004-10-04 18:13:38 +00:00
//TODO/LATER: MISCSTATUS_RESIZEONPRINTERCHANGE
2006-08-14 15:54:32 +00:00
//if( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xIPObj->GetMiscStatus() && pDoc->getPrinter( false ) )
// xIPObj->OnDocumentPrinterChanged( pDoc->getPrinter( false ) );
2003-04-17 13:43:12 +00:00
UnoActionContext aAction ( pDoc ) ;
2006-08-14 15:54:32 +00:00
pDoc - > StartUndo ( UNDO_INSERT , NULL ) ;
2003-04-17 13:43:12 +00:00
if ( ! bSizeFound )
{
2004-10-04 18:13:38 +00:00
//TODO/LATER: from where do I get a ViewAspect? And how do I transport it to the OLENode?
sal_Int64 nAspect = embed : : Aspects : : MSOLE_CONTENT ;
2005-04-04 07:22:36 +00:00
// TODO/LEAN: VisualArea still needs running state
svt : : EmbeddedObjectRef : : TryRunningState ( xIPObj ) ;
// set parent to get correct VisArea(in case of object needing parent printer)
uno : : Reference < container : : XChild > xChild ( xIPObj , uno : : UNO_QUERY ) ;
if ( xChild . is ( ) )
xChild - > setParent ( pDoc - > GetDocShell ( ) - > GetModel ( ) ) ;
2003-04-17 13:43:12 +00:00
//The Size should be suggested by the OLE server if not manually set
2004-10-04 18:13:38 +00:00
MapUnit aRefMap = VCLUnoHelper : : UnoEmbed2VCLMapUnit ( xIPObj - > getMapUnit ( nAspect ) ) ;
2005-03-15 10:25:26 +00:00
awt : : Size aSize ;
try
{
aSize = xIPObj - > getVisualAreaSize ( nAspect ) ;
}
catch ( embed : : NoVisualAreaSizeException & )
{
// the default size will be set later
}
2004-10-04 18:13:38 +00:00
Size aSz ( aSize . Width , aSize . Height ) ;
2003-04-17 13:43:12 +00:00
if ( ! aSz . Width ( ) | | ! aSz . Height ( ) )
{
aSz . Width ( ) = aSz . Height ( ) = 5000 ;
aSz = OutputDevice : : LogicToLogic
( aSz , MapMode ( MAP_100TH_MM ) , aRefMap ) ;
}
MapMode aMyMap ( MAP_TWIP ) ;
aSz = OutputDevice : : LogicToLogic ( aSz , aRefMap , aMyMap ) ;
SwFmtFrmSize aFrmSz ;
aFrmSz . SetSize ( aSz ) ;
aFrmSet . Put ( aFrmSz ) ;
}
SwFlyFrmFmt * pFmt = 0 ;
2006-08-14 15:54:32 +00:00
pFmt = pDoc - > Insert ( aPam , xIPObj , & aFrmSet , NULL , NULL ) ;
2003-04-17 13:43:12 +00:00
ASSERT ( pFmt , " Doc->Insert(notxt) failed. " ) ;
2006-08-14 15:54:32 +00:00
pDoc - > EndUndo ( UNDO_INSERT , NULL ) ;
2003-04-17 13:43:12 +00:00
pFmt - > Add ( this ) ;
if ( sName . Len ( ) )
pDoc - > SetFlyName ( ( SwFlyFrmFmt & ) * pFmt , sName ) ;
}
2000-09-18 23:08:29 +00:00
}
2000-12-06 10:36:14 +00:00
if ( pFmt & & pDoc - > GetDrawModel ( ) )
2002-11-26 11:35:55 +00:00
GetOrCreateSdrObject ( pFmt ) ;
2000-11-27 10:13:17 +00:00
uno : : Any * pOrder ;
2001-06-15 13:27:58 +00:00
if ( pProps - > GetProperty ( FN_UNO_Z_ORDER , 0 , pOrder ) )
2001-06-13 11:03:44 +00:00
setPropertyValue ( C2U ( SW_PROP_NAME_STR ( UNO_NAME_Z_ORDER ) ) , * pOrder ) ;
2000-09-18 23:08:29 +00:00
}
else
throw IllegalArgumentException ( ) ;
//setzt das Flag zurueck und loescht den Descriptor-Pointer
ResetDescriptor ( ) ;
}
2001-04-05 12:25:40 +00:00
/* -----------------------------04.04.01 14:27--------------------------------
2000-09-18 23:08:29 +00:00
2001-04-05 12:25:40 +00:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : attach ( const uno : : Reference < XTextRange > & xTextRange )
throw ( IllegalArgumentException , RuntimeException )
{
SwFrmFmt * pFmt ;
if ( IsDescriptor ( ) )
attachToRange ( xTextRange ) ;
else if ( 0 ! = ( pFmt = GetFrmFmt ( ) ) )
{
Reference < XUnoTunnel > xRangeTunnel ( xTextRange , UNO_QUERY ) ;
SwXTextRange * pRange = 0 ;
2003-04-01 14:34:01 +00:00
OTextCursorHelper * pCursor = 0 ;
2001-04-05 12:25:40 +00:00
if ( xRangeTunnel . is ( ) )
{
pRange = ( SwXTextRange * ) xRangeTunnel - > getSomething (
SwXTextRange : : getUnoTunnelId ( ) ) ;
2003-04-01 14:34:01 +00:00
pCursor = ( OTextCursorHelper * ) xRangeTunnel - > getSomething (
OTextCursorHelper : : getUnoTunnelId ( ) ) ;
2001-04-05 12:25:40 +00:00
}
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
SwUnoInternalPaM aIntPam ( * pDoc ) ;
if ( SwXTextRange : : XTextRangeToSwPaM ( aIntPam , xTextRange ) )
{
SfxItemSet aSet ( pDoc - > GetAttrPool ( ) ,
RES_ANCHOR , RES_ANCHOR ) ;
aSet . SetParent ( & pFmt - > GetAttrSet ( ) ) ;
SwFmtAnchor aAnchor = ( const SwFmtAnchor & ) aSet . Get ( RES_ANCHOR ) ;
aAnchor . SetAnchor ( aIntPam . Start ( ) ) ;
aSet . Put ( aAnchor ) ;
pDoc - > SetFlyFrmAttr ( * pFmt , aSet ) ;
}
else
throw IllegalArgumentException ( ) ;
}
}
2000-09-18 23:08:29 +00:00
/*-- 22.04.99 08:03:20---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
awt : : Point SwXFrame : : getPosition ( void ) throw ( RuntimeException )
{
2000-11-27 10:13:17 +00:00
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
RuntimeException aRuntime ;
aRuntime . Message = C2U ( " position cannot be determined with this method " ) ;
throw aRuntime ;
2000-09-18 23:08:29 +00:00
return awt : : Point ( ) ;
}
/*-- 22.04.99 08:03:21---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : setPosition ( const awt : : Point & aPosition ) throw ( RuntimeException )
{
2000-11-27 10:13:17 +00:00
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
RuntimeException aRuntime ;
aRuntime . Message = C2U ( " position cannot be changed with this method " ) ;
throw aRuntime ;
2000-09-18 23:08:29 +00:00
}
/*-- 22.04.99 08:03:21---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
awt : : Size SwXFrame : : getSize ( void ) throw ( RuntimeException )
{
uno : : Any aVal = getPropertyValue ( C2U ( " Size " ) ) ;
awt : : Size * pRet = ( awt : : Size * ) aVal . getValue ( ) ;
return * pRet ;
}
/*-- 22.04.99 08:03:21---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXFrame : : setSize ( const awt : : Size & aSize )
throw ( PropertyVetoException , RuntimeException )
{
uno : : Any aVal ( & aSize , : : getCppuType ( ( const awt : : Size * ) 0 ) ) ;
setPropertyValue ( C2U ( " Size " ) , aVal ) ;
}
/*-- 22.04.99 08:03:21---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
OUString SwXFrame : : getShapeType ( void ) throw ( RuntimeException )
{
return C2U ( " FrameShape " ) ;
}
2000-12-19 16:28:58 +00:00
2000-09-18 23:08:29 +00:00
/******************************************************************
* SwXTextFrame
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-- 14.01.99 11:27:51---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-12 12:57:26 +00:00
SwXTextFrame : : SwXTextFrame ( SwDoc * pDoc ) :
SwXFrame ( FLYCNTTYPE_FRM , aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_TEXT_FRAME ) , pDoc ) ,
2000-09-18 23:08:29 +00:00
SwXText ( 0 , CURSOR_FRAME )
{
}
/*-- 11.12.98 15:23:01---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXTextFrame : : SwXTextFrame ( SwFrmFmt & rFmt ) :
SwXFrame ( rFmt , FLYCNTTYPE_FRM , aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_TEXT_FRAME ) ) ,
SwXText ( rFmt . GetDoc ( ) , CURSOR_FRAME )
{
}
/*-- 11.12.98 15:23:02---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXTextFrame : : ~ SwXTextFrame ( )
{
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextFrame : : acquire ( ) throw ( )
{
SwXFrame : : acquire ( ) ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextFrame : : release ( ) throw ( )
{
SwXFrame : : release ( ) ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Any SAL_CALL SwXTextFrame : : queryInterface ( const uno : : Type & aType )
throw ( RuntimeException )
{
2002-03-19 14:59:14 +00:00
uno : : Any aRet = SwXFrame : : queryInterface ( aType ) ;
2000-09-18 23:08:29 +00:00
if ( aRet . getValueType ( ) = = : : getCppuVoidType ( ) )
2002-03-19 14:59:14 +00:00
aRet = SwXText : : queryInterface ( aType ) ;
2000-09-18 23:08:29 +00:00
if ( aRet . getValueType ( ) = = : : getCppuVoidType ( ) )
aRet = SwXTextFrameBaseClass : : queryInterface ( aType ) ;
return aRet ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < : : com : : sun : : star : : uno : : Type > SAL_CALL SwXTextFrame : : getTypes ( ) throw ( RuntimeException )
{
uno : : Sequence < uno : : Type > aTextFrameTypes = SwXTextFrameBaseClass : : getTypes ( ) ;
uno : : Sequence < uno : : Type > aFrameTypes = SwXFrame : : getTypes ( ) ;
uno : : Sequence < uno : : Type > aTextTypes = SwXText : : getTypes ( ) ;
long nIndex = aTextFrameTypes . getLength ( ) ;
aTextFrameTypes . realloc (
aTextFrameTypes . getLength ( ) +
aFrameTypes . getLength ( ) +
aTextTypes . getLength ( ) ) ;
uno : : Type * pTextFrameTypes = aTextFrameTypes . getArray ( ) ;
const uno : : Type * pFrameTypes = aFrameTypes . getConstArray ( ) ;
long nPos ;
for ( nPos = 0 ; nPos < aFrameTypes . getLength ( ) ; nPos + + )
pTextFrameTypes [ nIndex + + ] = pFrameTypes [ nPos ] ;
const uno : : Type * pTextTypes = aTextTypes . getConstArray ( ) ;
for ( nPos = 0 ; nPos < aTextTypes . getLength ( ) ; nPos + + )
pTextFrameTypes [ nIndex + + ] = pTextTypes [ nPos ] ;
return aTextFrameTypes ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < sal_Int8 > SAL_CALL SwXTextFrame : : getImplementationId ( ) throw ( RuntimeException )
{
2003-03-27 14:45:43 +00:00
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
static Sequence < sal_Int8 > aId ( 16 ) ;
static sal_Bool bInit = sal_False ;
2000-09-18 23:08:29 +00:00
if ( ! bInit )
2003-03-27 14:45:43 +00:00
{
rtl_createUuid ( ( sal_uInt8 * ) ( aId . getArray ( ) ) , 0 , sal_True ) ;
bInit = sal_True ;
}
2000-09-18 23:08:29 +00:00
return aId ;
}
/*-- 11.12.98 15:23:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XText > SwXTextFrame : : getText ( void ) throw ( RuntimeException )
{
return this ;
}
/*-- 11.12.98 15:23:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-06-12 06:28:29 +00:00
const SwStartNode * SwXTextFrame : : GetStartNode ( ) const
{
const SwStartNode * pSttNd = 0 ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
const SwFmtCntnt & rFlyCntnt = pFmt - > GetCntnt ( ) ;
if ( rFlyCntnt . GetCntntIdx ( ) )
pSttNd = rFlyCntnt . GetCntntIdx ( ) - > GetNode ( ) . GetStartNode ( ) ;
}
return pSttNd ;
}
2001-11-20 13:42:32 +00:00
uno : : Reference < XTextCursor > SwXTextFrame : : createCursor ( ) throw ( : : com : : sun : : star : : uno : : RuntimeException )
2000-09-18 23:08:29 +00:00
{
return createTextCursor ( ) ;
}
/*-- 11.12.98 15:23:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XTextCursor > SwXTextFrame : : createTextCursor ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
uno : : Reference < XTextCursor > aRef ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
2001-11-15 14:48:44 +00:00
//save current start node to be able to check if there is content after the table -
//otherwise the cursor would be in the body text!
const SwNode & rNode = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) - > GetNode ( ) ;
const SwStartNode * pOwnStartNode = rNode . FindSttNodeByType ( SwFlyStartNode ) ;
SwPaM aPam ( rNode ) ;
2000-11-08 13:56:39 +00:00
aPam . Move ( fnMoveForward , fnGoNode ) ;
SwTableNode * pTblNode = aPam . GetNode ( ) - > FindTableNode ( ) ;
SwCntntNode * pCont = 0 ;
while ( pTblNode )
{
aPam . GetPoint ( ) - > nNode = * pTblNode - > EndOfSectionNode ( ) ;
pCont = GetDoc ( ) - > GetNodes ( ) . GoNext ( & aPam . GetPoint ( ) - > nNode ) ;
pTblNode = pCont - > FindTableNode ( ) ;
}
if ( pCont )
aPam . GetPoint ( ) - > nContent . Assign ( pCont , 0 ) ;
2001-11-15 14:48:44 +00:00
const SwStartNode * pNewStartNode =
aPam . GetNode ( ) - > FindSttNodeByType ( SwFlyStartNode ) ;
if ( ! pNewStartNode | | pNewStartNode ! = pOwnStartNode )
{
uno : : RuntimeException aExcept ;
aExcept . Message = S2U ( " no text available " ) ;
throw aExcept ;
}
2000-11-08 13:56:39 +00:00
SwXTextCursor * pXCrsr = new SwXTextCursor ( this , * aPam . GetPoint ( ) , CURSOR_FRAME , pFmt - > GetDoc ( ) ) ;
2000-09-18 23:08:29 +00:00
aRef = ( XWordCursor * ) pXCrsr ;
SwUnoCrsr * pUnoCrsr = pXCrsr - > GetCrsr ( ) ;
// // no Cursor in protected sections
// SwCrsrSaveState aSave( *pUnoCrsr );
// if(pUnoCrsr->IsInProtectTable( sal_True ) ||
// pUnoCrsr->IsSelOvr( SELOVER_TOGGLE | SELOVER_CHANGEPOS ))
// throw RuntimeException() );
}
else
throw RuntimeException ( ) ;
return aRef ;
}
/*-- 11.12.98 15:23:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XTextCursor > SwXTextFrame : : createTextCursorByRange ( const uno : : Reference < XTextRange > & aTextPosition ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
uno : : Reference < XTextCursor > aRef ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
SwUnoInternalPaM aPam ( * GetDoc ( ) ) ;
if ( pFmt & & SwXTextRange : : XTextRangeToSwPaM ( aPam , aTextPosition ) )
{
SwNode & rNode = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) - > GetNode ( ) ;
2003-04-15 15:58:20 +00:00
# if OSL_DEBUG_LEVEL > 1
2000-09-18 23:08:29 +00:00
const SwStartNode * p1 = aPam . GetNode ( ) - > FindFlyStartNode ( ) ;
const SwStartNode * p2 = rNode . FindFlyStartNode ( ) ;
# endif
if ( aPam . GetNode ( ) - > FindFlyStartNode ( ) = = rNode . FindFlyStartNode ( ) )
aRef = ( XWordCursor * ) new SwXTextCursor ( this ,
* aPam . GetPoint ( ) , CURSOR_FRAME , pFmt - > GetDoc ( ) , aPam . GetMark ( ) ) ;
}
else
throw RuntimeException ( ) ;
return aRef ;
}
/*-- 11.12.98 15:23:03---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < container : : XEnumeration > SwXTextFrame : : createEnumeration ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
uno : : Reference < container : : XEnumeration > aRef ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
uno : : XInterface * pRet = 0 ;
if ( pFmt )
{
SwPosition aPos ( pFmt - > GetCntnt ( ) . GetCntntIdx ( ) - > GetNode ( ) ) ;
SwUnoCrsr * pUnoCrsr = GetDoc ( ) - > CreateUnoCrsr ( aPos , sal_False ) ;
pUnoCrsr - > Move ( fnMoveForward , fnGoNode ) ;
// // no Cursor in protected sections
// SwCrsrSaveState aSave( *pUnoCrsr );
// if(pUnoCrsr->IsInProtectTable( sal_True ) ||
// pUnoCrsr->IsSelOvr( SELOVER_TOGGLE | SELOVER_CHANGEPOS ))
// throw RuntimeException() );
aRef = new SwXParagraphEnumeration ( this , pUnoCrsr , CURSOR_FRAME ) ;
}
return aRef ;
}
/*-- 11.12.98 15:23:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Type SwXTextFrame : : getElementType ( void ) throw ( RuntimeException )
{
return : : getCppuType ( ( uno : : Reference < XTextRange > * ) 0 ) ;
}
/*-- 11.12.98 15:23:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Bool SwXTextFrame : : hasElements ( void ) throw ( RuntimeException )
{
return sal_True ;
}
/*-- 11.12.98 15:23:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextFrame : : attach ( const uno : : Reference < XTextRange > & xTextRange )
throw ( IllegalArgumentException , RuntimeException )
{
2001-04-05 12:25:40 +00:00
SwXFrame : : attach ( xTextRange ) ;
2000-09-18 23:08:29 +00:00
}
/*-- 11.12.98 15:23:04---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XTextRange > SwXTextFrame : : getAnchor ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
return SwXFrame : : getAnchor ( ) ;
}
/*-- 11.12.98 15:23:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextFrame : : dispose ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwXFrame : : dispose ( ) ;
}
/*-- 11.12.98 15:23:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextFrame : : addEventListener ( const uno : : Reference < XEventListener > & aListener ) throw ( RuntimeException )
{
SwXFrame : : addEventListener ( aListener ) ;
}
/*-- 11.12.98 15:23:05---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextFrame : : removeEventListener ( const uno : : Reference < XEventListener > & aListener ) throw ( RuntimeException )
{
SwXFrame : : removeEventListener ( aListener ) ;
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
OUString SwXTextFrame : : getImplementationName ( void ) throw ( RuntimeException )
{
return C2U ( " SwXTextFrame " ) ;
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Bool SwXTextFrame : : supportsService ( const OUString & rServiceName ) throw ( RuntimeException )
{
return COMPARE_EQUAL = = rServiceName . compareToAscii ( " com.sun.star.text.Text " ) | |
COMPARE_EQUAL = = rServiceName . compareToAscii ( " com.sun.star.text.TextFrame " ) | |
2001-02-12 06:14:16 +00:00
SwXFrame : : supportsService ( rServiceName ) ;
2000-09-18 23:08:29 +00:00
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < OUString > SwXTextFrame : : getSupportedServiceNames ( void ) throw ( RuntimeException )
{
2001-02-12 06:14:16 +00:00
uno : : Sequence < OUString > aRet = SwXFrame : : getSupportedServiceNames ( ) ;
aRet . realloc ( aRet . getLength ( ) + 2 ) ;
2000-09-18 23:08:29 +00:00
OUString * pArray = aRet . getArray ( ) ;
2001-02-12 06:14:16 +00:00
pArray [ aRet . getLength ( ) - 2 ] = C2U ( " com.sun.star.text.TextFrame " ) ;
pArray [ aRet . getLength ( ) - 1 ] = C2U ( " com.sun.star.text.Text " ) ;
2000-09-18 23:08:29 +00:00
return aRet ;
}
/* -----------------------------20.06.00 10:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void * SAL_CALL SwXTextFrame : : operator new ( size_t t ) throw ( )
{
return SwXTextFrameBaseClass : : operator new ( t ) ;
}
/* -----------------------------20.06.00 10:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextFrame : : operator delete ( void * p ) throw ( )
{
SwXTextFrameBaseClass : : operator delete ( p ) ;
}
2000-12-19 16:28:58 +00:00
uno : : Reference < container : : XNameReplace > SAL_CALL SwXTextFrame : : getEvents ( )
throw ( RuntimeException )
{
return new SwFrameEventDescriptor ( * this ) ;
}
2001-01-15 10:28:36 +00:00
/* -----------------------------10.01.01 13:27--------------------------------
2000-12-19 16:28:58 +00:00
2001-01-15 10:28:36 +00:00
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Int64 SAL_CALL SwXTextFrame : : getSomething ( const uno : : Sequence < sal_Int8 > & rId )
throw ( RuntimeException )
{
sal_Int64 nRet = SwXFrame : : getSomething ( rId ) ;
if ( ! nRet )
nRet = SwXText : : getSomething ( rId ) ;
return nRet ;
}
2002-03-19 14:59:14 +00:00
/* -----------------------------19.03.2002 16:43------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Any SwXTextFrame : : getPropertyValue ( const OUString & rPropertyName )
throw ( UnknownPropertyException , WrappedTargetException , RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
2002-03-20 07:04:08 +00:00
uno : : Any aRet ;
2002-03-19 14:59:14 +00:00
if ( rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_START_REDLINE ) ) | |
rPropertyName . equalsAsciiL ( SW_PROP_NAME ( UNO_NAME_END_REDLINE ) ) )
2002-03-20 07:04:08 +00:00
{
//redline can only be returned if it's a living object
if ( ! IsDescriptor ( ) )
aRet = SwXText : : getPropertyValue ( rPropertyName ) ;
}
2002-03-19 14:59:14 +00:00
else
2002-03-20 07:04:08 +00:00
aRet = SwXFrame : : getPropertyValue ( rPropertyName ) ;
return aRet ;
2002-03-19 14:59:14 +00:00
}
2000-09-18 23:08:29 +00:00
/******************************************************************
* SwXTextGraphicObject
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-- 14.01.99 11:27:51---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-12 12:57:26 +00:00
SwXTextGraphicObject : : SwXTextGraphicObject ( SwDoc * pDoc ) :
SwXFrame ( FLYCNTTYPE_GRF , aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_TEXT_GRAPHIC ) , pDoc )
2000-09-18 23:08:29 +00:00
{
}
/*-- 11.12.98 16:02:25---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXTextGraphicObject : : SwXTextGraphicObject ( SwFrmFmt & rFmt ) :
SwXFrame ( rFmt , FLYCNTTYPE_GRF , aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_TEXT_GRAPHIC ) )
{
}
/*-- 11.12.98 16:02:26---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXTextGraphicObject : : ~ SwXTextGraphicObject ( )
{
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextGraphicObject : : acquire ( ) throw ( )
{
SwXFrame : : acquire ( ) ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextGraphicObject : : release ( ) throw ( )
{
SwXFrame : : release ( ) ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Any SAL_CALL SwXTextGraphicObject : : queryInterface ( const uno : : Type & aType )
throw ( RuntimeException )
{
uno : : Any aRet = SwXFrame : : queryInterface ( aType ) ;
if ( aRet . getValueType ( ) = = : : getCppuVoidType ( ) )
aRet = SwXTextGraphicObjectBaseClass : : queryInterface ( aType ) ;
return aRet ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < : : com : : sun : : star : : uno : : Type > SAL_CALL
SwXTextGraphicObject : : getTypes ( ) throw ( RuntimeException )
{
uno : : Sequence < uno : : Type > aGraphicTypes = SwXTextGraphicObjectBaseClass : : getTypes ( ) ;
uno : : Sequence < uno : : Type > aFrameTypes = SwXFrame : : getTypes ( ) ;
long nIndex = aGraphicTypes . getLength ( ) ;
aGraphicTypes . realloc (
aGraphicTypes . getLength ( ) +
aFrameTypes . getLength ( ) ) ;
uno : : Type * pGraphicTypes = aGraphicTypes . getArray ( ) ;
const uno : : Type * pFrameTypes = aFrameTypes . getConstArray ( ) ;
long nPos ;
for ( nPos = 0 ; nPos < aFrameTypes . getLength ( ) ; nPos + + )
pGraphicTypes [ nIndex + + ] = pFrameTypes [ nPos ] ;
return aGraphicTypes ;
}
/* -----------------------------15.03.00 16:30--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < sal_Int8 > SAL_CALL SwXTextGraphicObject : : getImplementationId ( ) throw ( RuntimeException )
{
2003-03-27 14:45:43 +00:00
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
static Sequence < sal_Int8 > aId ( 16 ) ;
static sal_Bool bInit = sal_False ;
2000-09-18 23:08:29 +00:00
if ( ! bInit )
2003-03-27 14:45:43 +00:00
{
rtl_createUuid ( ( sal_uInt8 * ) ( aId . getArray ( ) ) , 0 , sal_True ) ;
bInit = sal_True ;
}
2000-09-18 23:08:29 +00:00
return aId ;
}
/*-- 11.12.98 16:02:27---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextGraphicObject : : attach ( const uno : : Reference < XTextRange > & xTextRange ) throw ( IllegalArgumentException , RuntimeException )
{
2001-04-05 12:25:40 +00:00
SwXFrame : : attach ( xTextRange ) ;
2000-09-18 23:08:29 +00:00
}
/*-- 11.12.98 16:02:27---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XTextRange > SwXTextGraphicObject : : getAnchor ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
return SwXFrame : : getAnchor ( ) ;
}
/*-- 11.12.98 16:02:28---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextGraphicObject : : dispose ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwXFrame : : dispose ( ) ;
}
/*-- 11.12.98 16:02:29---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextGraphicObject : : addEventListener ( const uno : : Reference < XEventListener > & aListener )
throw ( RuntimeException )
{
SwXFrame : : addEventListener ( aListener ) ;
}
/*-- 11.12.98 16:02:29---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextGraphicObject : : removeEventListener ( const uno : : Reference < XEventListener > & aListener )
throw ( RuntimeException )
{
SwXFrame : : removeEventListener ( aListener ) ;
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
OUString SwXTextGraphicObject : : getImplementationName ( void ) throw ( RuntimeException )
{
return C2U ( " SwXTextGraphicObject " ) ;
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Bool SwXTextGraphicObject : : supportsService ( const OUString & rServiceName ) throw ( RuntimeException )
{
return COMPARE_EQUAL = = rServiceName . compareToAscii ( " com.sun.star.text.TextGraphicObject " ) | |
2001-02-12 06:14:16 +00:00
SwXFrame : : supportsService ( rServiceName ) ;
2000-09-18 23:08:29 +00:00
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < OUString > SwXTextGraphicObject : : getSupportedServiceNames ( void )
throw ( RuntimeException )
{
2001-02-12 06:14:16 +00:00
uno : : Sequence < OUString > aRet = SwXFrame : : getSupportedServiceNames ( ) ;
aRet . realloc ( aRet . getLength ( ) + 1 ) ;
2000-09-18 23:08:29 +00:00
OUString * pArray = aRet . getArray ( ) ;
2001-02-12 06:14:16 +00:00
pArray [ aRet . getLength ( ) - 1 ] = C2U ( " com.sun.star.text.TextGraphicObject " ) ;
2000-09-18 23:08:29 +00:00
return aRet ;
}
/* -----------------------------20.06.00 10:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void * SAL_CALL SwXTextGraphicObject : : operator new ( size_t t ) throw ( )
{
return SwXTextGraphicObjectBaseClass : : operator new ( t ) ;
}
/* -----------------------------20.06.00 10:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextGraphicObject : : operator delete ( void * p ) throw ( )
{
SwXTextGraphicObjectBaseClass : : operator delete ( p ) ;
}
2000-12-19 16:28:58 +00:00
/* -----------------------------15.12.00 12:45--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < container : : XNameReplace > SAL_CALL
SwXTextGraphicObject : : getEvents ( )
throw ( RuntimeException )
{
return new SwFrameEventDescriptor ( * this ) ;
}
2000-09-18 23:08:29 +00:00
/******************************************************************
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-- 11.12.98 16:16:53---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2001-10-12 12:57:26 +00:00
SwXTextEmbeddedObject : : SwXTextEmbeddedObject ( SwDoc * pDoc ) :
SwXFrame ( FLYCNTTYPE_OLE , aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_EMBEDDED_OBJECT ) , pDoc )
2000-09-18 23:08:29 +00:00
{
}
/*-- 11.12.98 16:16:53---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXTextEmbeddedObject : : SwXTextEmbeddedObject ( SwFrmFmt & rFmt ) :
2000-12-22 08:54:15 +00:00
SwXFrame ( rFmt , FLYCNTTYPE_OLE , aSwMapProvider . GetPropertyMap ( PROPERTY_MAP_EMBEDDED_OBJECT ) )
2000-09-18 23:08:29 +00:00
{
}
/*-- 11.12.98 16:16:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXTextEmbeddedObject : : ~ SwXTextEmbeddedObject ( )
{
}
/*-- 11.12.98 16:16:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* -----------------------------15.03.00 16:32--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextEmbeddedObject : : acquire ( ) throw ( )
{
SwXFrame : : acquire ( ) ;
}
/* -----------------------------15.03.00 16:32--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextEmbeddedObject : : release ( ) throw ( )
{
SwXFrame : : release ( ) ;
}
/* -----------------------------15.03.00 16:32--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Any SAL_CALL SwXTextEmbeddedObject : : queryInterface ( const uno : : Type & aType )
throw ( RuntimeException )
{
uno : : Any aRet = SwXFrame : : queryInterface ( aType ) ; ;
if ( aRet . getValueType ( ) = = : : getCppuVoidType ( ) )
aRet = SwXTextEmbeddedObjectBaseClass : : queryInterface ( aType ) ;
return aRet ;
}
/* -----------------------------15.03.00 16:32--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < uno : : Type > SAL_CALL SwXTextEmbeddedObject : : getTypes ( ) throw ( RuntimeException )
{
uno : : Sequence < uno : : Type > aTextEmbeddedTypes = SwXTextEmbeddedObjectBaseClass : : getTypes ( ) ;
uno : : Sequence < uno : : Type > aFrameTypes = SwXFrame : : getTypes ( ) ;
long nIndex = aTextEmbeddedTypes . getLength ( ) ;
aTextEmbeddedTypes . realloc (
aTextEmbeddedTypes . getLength ( ) +
aFrameTypes . getLength ( ) ) ;
uno : : Type * pTextEmbeddedTypes = aTextEmbeddedTypes . getArray ( ) ;
const uno : : Type * pFrameTypes = aFrameTypes . getConstArray ( ) ;
long nPos ;
for ( nPos = 0 ; nPos < aFrameTypes . getLength ( ) ; nPos + + )
pTextEmbeddedTypes [ nIndex + + ] = pFrameTypes [ nPos ] ;
return aTextEmbeddedTypes ;
}
/* -----------------------------15.03.00 16:32--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < sal_Int8 > SAL_CALL SwXTextEmbeddedObject : : getImplementationId ( ) throw ( RuntimeException )
{
2003-03-27 14:45:43 +00:00
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
static Sequence < sal_Int8 > aId ( 16 ) ;
static sal_Bool bInit = sal_False ;
2000-09-18 23:08:29 +00:00
if ( ! bInit )
2003-03-27 14:45:43 +00:00
{
rtl_createUuid ( ( sal_uInt8 * ) ( aId . getArray ( ) ) , 0 , sal_True ) ;
bInit = sal_True ;
}
2000-09-18 23:08:29 +00:00
return aId ;
}
/*-- 11.12.98 16:16:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextEmbeddedObject : : attach ( const uno : : Reference < XTextRange > & xTextRange ) throw ( IllegalArgumentException , RuntimeException )
{
2001-04-05 12:25:40 +00:00
SwXFrame : : attach ( xTextRange ) ;
2000-09-18 23:08:29 +00:00
}
/*-- 11.12.98 16:16:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XTextRange > SwXTextEmbeddedObject : : getAnchor ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
return SwXFrame : : getAnchor ( ) ;
}
/*-- 11.12.98 16:16:54---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextEmbeddedObject : : dispose ( void ) throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
SwXFrame : : dispose ( ) ;
}
/*-- 11.12.98 16:16:55---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextEmbeddedObject : : addEventListener ( const uno : : Reference < XEventListener > & aListener ) throw ( RuntimeException )
{
SwXFrame : : addEventListener ( aListener ) ;
}
/*-- 11.12.98 16:16:55---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXTextEmbeddedObject : : removeEventListener ( const uno : : Reference < XEventListener > & aListener ) throw ( RuntimeException )
{
SwXFrame : : removeEventListener ( aListener ) ;
}
/*-- 11.12.98 16:16:55---------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < XComponent > SwXTextEmbeddedObject : : getEmbeddedObject ( void ) throw ( RuntimeException )
{
uno : : Reference < XComponent > xRet ;
SwFrmFmt * pFmt = GetFrmFmt ( ) ;
if ( pFmt )
{
SwDoc * pDoc = pFmt - > GetDoc ( ) ;
const SwFmtCntnt * pCnt = & pFmt - > GetCntnt ( ) ;
DBG_ASSERT ( pCnt - > GetCntntIdx ( ) & &
pDoc - > GetNodes ( ) [ pCnt - > GetCntntIdx ( ) - >
GetIndex ( ) + 1 ] - > GetOLENode ( ) , " kein OLE-Node? " )
SwOLENode * pOleNode = pDoc - > GetNodes ( ) [ pCnt - > GetCntntIdx ( )
- > GetIndex ( ) + 1 ] - > GetOLENode ( ) ;
2004-10-04 18:13:38 +00:00
uno : : Reference < embed : : XEmbeddedObject > xIP = pOleNode - > GetOLEObj ( ) . GetOleRef ( ) ;
2004-11-26 15:27:27 +00:00
if ( svt : : EmbeddedObjectRef : : TryRunningState ( xIP ) )
2000-09-18 23:08:29 +00:00
{
2006-05-05 07:08:29 +00:00
if ( pDoc - > GetDocShell ( ) )
2006-07-14 07:31:03 +00:00
pDoc - > GetDocShell ( ) - > CalcAndSetScaleOfOLEObj ( pOleNode - > GetOLEObj ( ) ) ;
2006-05-05 07:08:29 +00:00
2004-11-26 15:27:27 +00:00
xRet = uno : : Reference < lang : : XComponent > ( xIP - > getComponent ( ) , uno : : UNO_QUERY ) ;
2004-10-04 18:13:38 +00:00
uno : : Reference < util : : XModifyBroadcaster > xBrdcst ( xRet , uno : : UNO_QUERY ) ;
uno : : Reference < frame : : XModel > xModel ( xRet , uno : : UNO_QUERY ) ;
if ( xBrdcst . is ( ) & & xModel . is ( ) )
2000-09-18 23:08:29 +00:00
{
2004-10-04 18:13:38 +00:00
SwClientIter aIter ( * pFmt ) ;
SwXOLEListener * pListener = ( SwXOLEListener * ) aIter .
First ( TYPE ( SwXOLEListener ) ) ;
//create a new one if the OLE object doesn't have one already
if ( ! pListener )
2000-09-18 23:08:29 +00:00
{
2004-10-04 18:13:38 +00:00
uno : : Reference < util : : XModifyListener > xOLEListener = new SwXOLEListener ( * pFmt , xModel ) ;
xBrdcst - > addModifyListener ( xOLEListener ) ;
2000-09-18 23:08:29 +00:00
}
}
}
}
return xRet ;
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
OUString SwXTextEmbeddedObject : : getImplementationName ( void ) throw ( RuntimeException )
{
return C2U ( " SwXTextEmbeddedObject " ) ;
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
sal_Bool SwXTextEmbeddedObject : : supportsService ( const OUString & rServiceName ) throw ( RuntimeException )
{
return COMPARE_EQUAL = = rServiceName . compareToAscii ( " com.sun.star.text.TextEmbeddedObject " ) | |
2001-02-12 06:14:16 +00:00
SwXFrame : : supportsService ( rServiceName ) ;
2000-09-18 23:08:29 +00:00
}
/* -----------------03.05.99 12:28-------------------
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Sequence < OUString > SwXTextEmbeddedObject : : getSupportedServiceNames ( void )
throw ( RuntimeException )
{
2001-02-12 06:14:16 +00:00
uno : : Sequence < OUString > aRet = SwXFrame : : getSupportedServiceNames ( ) ;
aRet . realloc ( aRet . getLength ( ) + 1 ) ;
2000-09-18 23:08:29 +00:00
OUString * pArray = aRet . getArray ( ) ;
2001-02-12 06:14:16 +00:00
pArray [ aRet . getLength ( ) - 1 ] = C2U ( " com.sun.star.text.TextEmbeddedObject " ) ;
2000-09-18 23:08:29 +00:00
return aRet ;
}
/* -----------------------------20.06.00 10:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void * SAL_CALL SwXTextEmbeddedObject : : operator new ( size_t t ) throw ( )
{
return SwXTextEmbeddedObjectBaseClass : : operator new ( t ) ;
}
/* -----------------------------20.06.00 10:02--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SAL_CALL SwXTextEmbeddedObject : : operator delete ( void * p ) throw ( )
{
SwXTextEmbeddedObjectBaseClass : : operator delete ( p ) ;
}
2000-12-19 16:28:58 +00:00
/* -----------------------------15.12.00 12:45--------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
uno : : Reference < container : : XNameReplace > SAL_CALL
SwXTextEmbeddedObject : : getEvents ( )
throw ( RuntimeException )
{
return new SwFrameEventDescriptor ( * this ) ;
}
2000-09-18 23:08:29 +00:00
/******************************************************************
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-09-11 08:40:41 +00:00
TYPEINIT1 ( SwXOLEListener , SwClient ) ;
/* -----------------------------18.01.2002 09:59------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXOLEListener : : SwXOLEListener ( SwFmt & rOLEFmt , uno : : Reference < XModel > xOLE ) :
SwClient ( & rOLEFmt ) ,
xOLEModel ( xOLE )
{
}
/* -----------------------------18.01.2002 09:59------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
SwXOLEListener : : ~ SwXOLEListener ( )
{ }
2000-09-18 23:08:29 +00:00
void SwXOLEListener : : modified ( const EventObject & rEvent )
throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
2003-09-11 08:40:41 +00:00
SwOLENode * pNd = 0 ;
SwFmt * pFmt = GetFmt ( ) ;
if ( pFmt )
{ const SwNodeIndex * pIdx = pFmt - > GetCntnt ( ) . GetCntntIdx ( ) ;
if ( pIdx )
{
SwNodeIndex aIdx ( * pIdx , 1 ) ;
SwNoTxtNode * pNoTxt = aIdx . GetNode ( ) . GetNoTxtNode ( ) ;
pNd = pNoTxt - > GetOLENode ( ) ;
}
}
if ( ! pNd )
throw RuntimeException ( ) ;
2004-10-04 18:13:38 +00:00
uno : : Reference < embed : : XEmbeddedObject > xIP = pNd - > GetOLEObj ( ) . GetOleRef ( ) ;
if ( xIP . is ( ) )
2000-09-18 23:08:29 +00:00
{
2004-10-04 18:13:38 +00:00
sal_Int32 nState = xIP - > getCurrentState ( ) ;
if ( nState = = embed : : EmbedStates : : INPLACE_ACTIVE | | nState = = embed : : EmbedStates : : UI_ACTIVE )
return ;
2000-09-18 23:08:29 +00:00
}
2004-10-04 18:13:38 +00:00
// if the OLE-Node is UI-Active do nothing
pNd - > SetOLESizeInvalid ( sal_True ) ;
pNd - > GetDoc ( ) - > SetOLEObjModified ( ) ;
2000-09-18 23:08:29 +00:00
}
2004-10-04 18:13:38 +00:00
2000-09-18 23:08:29 +00:00
/* ---------------------------------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void SwXOLEListener : : disposing ( const EventObject & rEvent )
throw ( RuntimeException )
{
vos : : OGuard aGuard ( Application : : GetSolarMutex ( ) ) ;
uno : : Reference < util : : XModifyListener > xListener ( this ) ;
2003-09-11 08:40:41 +00:00
uno : : Reference < frame : : XModel > xModel ( rEvent . Source , uno : : UNO_QUERY ) ;
uno : : Reference < util : : XModifyBroadcaster > xBrdcst ( xModel , uno : : UNO_QUERY ) ;
2000-09-18 23:08:29 +00:00
2003-09-11 08:40:41 +00:00
try
{
2000-09-18 23:08:29 +00:00
if ( xBrdcst . is ( ) )
xBrdcst - > removeModifyListener ( xListener ) ;
}
2003-09-11 08:40:41 +00:00
catch ( Exception & rEx )
2003-03-27 14:45:43 +00:00
{
2003-09-11 08:40:41 +00:00
DBG_ERROR ( " OLE Listener couldn't be removed " )
2003-03-27 14:45:43 +00:00
}
}
/* ---------------------------------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2003-09-11 08:40:41 +00:00
void SwXOLEListener : : Modify ( SfxPoolItem * pOld , SfxPoolItem * pNew )
2003-03-27 14:45:43 +00:00
{
2003-09-11 08:40:41 +00:00
ClientModify ( this , pOld , pNew ) ;
if ( ! GetRegisteredIn ( ) )
xOLEModel = 0 ;
2000-09-18 23:08:29 +00:00
}