Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/editeng/SpellPortions.hxx
Line
Count
Source
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
#ifndef INCLUDED_EDITENG_SPELLPORTIONS_HXX
21
#define INCLUDED_EDITENG_SPELLPORTIONS_HXX
22
23
#include <i18nlangtag/lang.h>
24
#include <rtl/ustring.hxx>
25
#include <com/sun/star/uno/Reference.h>
26
#include <com/sun/star/linguistic2/SingleProofreadingError.hpp>
27
#include <vector>
28
29
namespace com::sun::star::linguistic2 {
30
    class XSpellAlternatives;
31
}
32
33
namespace com::sun::star::linguistic2 { class XProofreader; }
34
35
namespace svx{
36
/** contains a portion of text that has the same language attributes applied
37
    and belongs to the same script type.
38
 */
39
struct SpellPortion
40
{
41
    /** contains the text of the portion.
42
     */
43
    OUString   sText;
44
    /** for wrong words this reference is filled with the error information otherwise
45
        it's an empty reference
46
     */
47
    css::uno::Reference< css::linguistic2::XSpellAlternatives> xAlternatives;
48
    /** provides access to the grammar checker interface
49
     */
50
    css::uno::Reference< css::linguistic2::XProofreader > xGrammarChecker;
51
    /** contains the proposed dialog title if the proof reading component provides one.
52
     */
53
    OUString   sDialogTitle;
54
    /** contains the grammar error information
55
    */
56
    css::linguistic2::SingleProofreadingError aGrammarError;
57
    /** contains the language applied to the text. It has to match the script type.
58
     */
59
    LanguageType    eLanguage;
60
    /** Marks the portion as field, footnote symbol or any other special content that
61
     should be protected against unintentional deletion.
62
     */
63
    bool bIsField;
64
    /** Marks the portion hidden content that should not be touched by spell checking
65
        and not be removed like redlines. The creator of the portions has to take care
66
        for them.
67
     */
68
    bool bIsHidden;
69
    /** determines whether the error type is a grammar error
70
    */
71
    bool bIsGrammarError;
72
    /** marks portion as to-be-ignored. This is a return parameter.
73
     */
74
    bool bIgnoreThisError;
75
76
    SpellPortion() :
77
0
        eLanguage(LANGUAGE_DONTKNOW),
78
0
        bIsField(false),
79
0
        bIsHidden(false),
80
0
        bIsGrammarError(false),
81
0
        bIgnoreThisError(false)
82
0
        {
83
0
            aGrammarError.nErrorStart = aGrammarError.nErrorLength = aGrammarError.nErrorType = 0;
84
0
        }
85
};
86
typedef std::vector<SpellPortion> SpellPortions;
87
}//namespace svx
88
#endif
89
90
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */