Update ooo320-m1
[ooovba.git] / sw / source / core / txtnode / atrref.cxx
blob831d604fb3cfaa39cc90fe860d4d946dc0dd1b75
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: atrref.cxx,v $
10 * $Revision: 1.8 $
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>
38 #include <swfont.hxx>
41 /****************************************************************************
43 * class SwFmtRefMark
45 ****************************************************************************/
47 SwFmtRefMark::~SwFmtRefMark( )
51 SwFmtRefMark::SwFmtRefMark( const XubString& rName )
52 : SfxPoolItem( RES_TXTATR_REFMARK ),
53 pTxtAttr( 0 ),
54 aRefName( rName )
58 SwFmtRefMark::SwFmtRefMark( const SwFmtRefMark& rAttr )
59 : SfxPoolItem( RES_TXTATR_REFMARK ),
60 pTxtAttr( 0 ),
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 /*************************************************************************
77 * class SwTxtRefMark
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 )
85 , m_pTxtNode( 0 )
86 , m_pEnd( 0 )
88 rAttr.pTxtAttr = this;
89 if ( pEnd )
91 m_nEnd = *pEnd;
92 m_pEnd = & m_nEnd;
94 else
96 SetHasDummyChar(true);
98 SetDontMoveAttr( true );
99 SetOverlapAllowedAttr( true );
102 xub_StrLen* SwTxtRefMark::GetEnd()
104 return m_pEnd;