Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <hintids.hxx>
30 : : #include <txtrfmrk.hxx>
31 : : #include <fmtrfmrk.hxx>
32 : : #include <swfont.hxx>
33 : :
34 : :
35 : : /****************************************************************************
36 : : *
37 : : * class SwFmtRefMark
38 : : *
39 : : ****************************************************************************/
40 : :
41 : 589 : SwFmtRefMark::~SwFmtRefMark( )
42 : : {
43 [ - + ]: 1093 : }
44 : :
45 : 180 : SwFmtRefMark::SwFmtRefMark( const XubString& rName )
46 : : : SfxPoolItem( RES_TXTATR_REFMARK ),
47 : : pTxtAttr( 0 ),
48 [ + - ]: 180 : aRefName( rName )
49 : : {
50 : 180 : }
51 : :
52 : 409 : SwFmtRefMark::SwFmtRefMark( const SwFmtRefMark& rAttr )
53 : : : SfxPoolItem( RES_TXTATR_REFMARK ),
54 : : pTxtAttr( 0 ),
55 : 409 : aRefName( rAttr.aRefName )
56 : : {
57 : 409 : }
58 : :
59 : 78 : int SwFmtRefMark::operator==( const SfxPoolItem& rAttr ) const
60 : : {
61 : : OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
62 : 78 : return aRefName == ((SwFmtRefMark&)rAttr).aRefName;
63 : : }
64 : :
65 : 409 : SfxPoolItem* SwFmtRefMark::Clone( SfxItemPool* ) const
66 : : {
67 [ + - ]: 409 : return new SwFmtRefMark( *this );
68 : : }
69 : :
70 : : /*************************************************************************
71 : : * class SwTxtRefMark
72 : : *************************************************************************/
73 : :
74 : : // Attribut fuer Inhalts-/Positions-Referenzen im Text
75 : :
76 : 85 : SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr,
77 : : xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
78 : : : SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
79 : : , m_pTxtNode( 0 )
80 : 85 : , m_pEnd( 0 )
81 : : {
82 : 85 : rAttr.pTxtAttr = this;
83 [ + + ]: 85 : if ( pEnd )
84 : : {
85 : 28 : m_nEnd = *pEnd;
86 : 28 : m_pEnd = & m_nEnd;
87 : : }
88 : : else
89 : : {
90 : 57 : SetHasDummyChar(true);
91 : : }
92 : 85 : SetDontMoveAttr( true );
93 : 85 : SetOverlapAllowedAttr( true );
94 : 85 : }
95 : :
96 : 4976 : xub_StrLen* SwTxtRefMark::GetEnd()
97 : : {
98 : 4976 : return m_pEnd;
99 : : }
100 : :
101 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|