Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <hintids.hxx>
21 : #include <txtrfmrk.hxx>
22 : #include <fmtrfmrk.hxx>
23 : #include <swfont.hxx>
24 :
25 :
26 : /****************************************************************************
27 : *
28 : * class SwFmtRefMark
29 : *
30 : ****************************************************************************/
31 :
32 23 : SwFmtRefMark::~SwFmtRefMark( )
33 : {
34 23 : }
35 :
36 11 : SwFmtRefMark::SwFmtRefMark( const XubString& rName )
37 : : SfxPoolItem( RES_TXTATR_REFMARK ),
38 : pTxtAttr( 0 ),
39 11 : aRefName( rName )
40 : {
41 11 : }
42 :
43 1 : SwFmtRefMark::SwFmtRefMark( const SwFmtRefMark& rAttr )
44 : : SfxPoolItem( RES_TXTATR_REFMARK ),
45 : pTxtAttr( 0 ),
46 1 : aRefName( rAttr.aRefName )
47 : {
48 1 : }
49 :
50 0 : int SwFmtRefMark::operator==( const SfxPoolItem& rAttr ) const
51 : {
52 : OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
53 0 : return aRefName == ((SwFmtRefMark&)rAttr).aRefName;
54 : }
55 :
56 1 : SfxPoolItem* SwFmtRefMark::Clone( SfxItemPool* ) const
57 : {
58 1 : return new SwFmtRefMark( *this );
59 : }
60 :
61 : /*************************************************************************
62 : * class SwTxtRefMark
63 : *************************************************************************/
64 :
65 : // Attribut fuer Inhalts-/Positions-Referenzen im Text
66 :
67 1 : SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr,
68 : xub_StrLen const nStartPos, xub_StrLen const*const pEnd)
69 : : SwTxtAttrEnd( rAttr, nStartPos, nStartPos )
70 : , m_pTxtNode( 0 )
71 1 : , m_pEnd( 0 )
72 : {
73 1 : rAttr.pTxtAttr = this;
74 1 : if ( pEnd )
75 : {
76 0 : m_nEnd = *pEnd;
77 0 : m_pEnd = & m_nEnd;
78 : }
79 : else
80 : {
81 1 : SetHasDummyChar(true);
82 : }
83 1 : SetDontMoveAttr( true );
84 1 : SetOverlapAllowedAttr( true );
85 1 : }
86 :
87 3 : xub_StrLen* SwTxtRefMark::GetEnd()
88 : {
89 3 : return m_pEnd;
90 : }
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|