lib

KoTextBookmark.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002-2003 Laurent Montel <montel@kde.org>
3 Copyright (C) 2006 David Faure <faure@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include "KoTextBookmark.h"
22#include "KoTextParag.h"
23
24KoTextBookmark::KoTextBookmark( const TQString& name )
25 : m_name( name ),
26 m_startParag( 0 ),
27 m_endParag( 0 ),
28 m_startIndex( 0 ),
29 m_endIndex( 0)
30{
31}
32
33KoTextBookmark::KoTextBookmark( const TQString &name,
34 KoTextParag *startParag, KoTextParag *endParag,
35 int start, int end )
36 : m_name( name ),
37 m_startParag( startParag ),
38 m_endParag( endParag ),
39 m_startIndex( start ),
40 m_endIndex( end )
41{
42 if ( startParag && endParag )
43 Q_ASSERT( startParag->document() == endParag->document() );
44}
45
46KoTextDocument* KoTextBookmark::textDocument() const
47{
48 Q_ASSERT( m_startParag->document() == m_endParag->document() );
49 return m_startParag->document();
50}
const char * name(StdAction id)