1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: atrref.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
35 #include <hintids.hxx>
36 #include <txtrfmrk.hxx>
37 #include <fmtrfmrk.hxx>
41 /****************************************************************************
45 ****************************************************************************/
47 SwFmtRefMark::~SwFmtRefMark( )
51 SwFmtRefMark::SwFmtRefMark( const XubString
& rName
)
52 : SfxPoolItem( RES_TXTATR_REFMARK
),
58 SwFmtRefMark::SwFmtRefMark( const SwFmtRefMark
& rAttr
)
59 : SfxPoolItem( RES_TXTATR_REFMARK
),
61 aRefName( rAttr
.aRefName
)
65 int SwFmtRefMark::operator==( const SfxPoolItem
& rAttr
) const
67 ASSERT( SfxPoolItem::operator==( rAttr
), "keine gleichen Attribute" );
68 return aRefName
== ((SwFmtRefMark
&)rAttr
).aRefName
;
71 SfxPoolItem
* SwFmtRefMark::Clone( SfxItemPool
* ) const
73 return new SwFmtRefMark( *this );
76 /*************************************************************************
78 *************************************************************************/
80 // Attribut fuer Inhalts-/Positions-Referenzen im Text
82 SwTxtRefMark::SwTxtRefMark( SwFmtRefMark
& rAttr
,
83 xub_StrLen nStartPos
, xub_StrLen
* pEnd
)
84 : SwTxtAttrEnd( rAttr
, nStartPos
, nStartPos
)
88 rAttr
.pTxtAttr
= this;
96 SetHasDummyChar(true);
98 SetDontMoveAttr( true );
99 SetOverlapAllowedAttr( true );
102 xub_StrLen
* SwTxtRefMark::GetEnd()