Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/toolkit/components/find/nsFindService.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
/*
7
 * The sole purpose of the Find service is to store globally the
8
 * last used Find settings
9
 *
10
 */
11
12
13
#include "nsFindService.h"
14
15
16
nsFindService::nsFindService()
17
: mFindBackwards(false)
18
, mWrapFind(true)
19
, mEntireWord(false)
20
, mMatchCase(false)
21
0
{
22
0
}
23
24
25
0
nsFindService::~nsFindService() = default;
26
27
NS_IMPL_ISUPPORTS(nsFindService, nsIFindService)
28
29
NS_IMETHODIMP nsFindService::GetSearchString(nsAString & aSearchString)
30
0
{
31
0
    aSearchString = mSearchString;
32
0
    return NS_OK;
33
0
}
34
35
NS_IMETHODIMP nsFindService::SetSearchString(const nsAString & aSearchString)
36
0
{
37
0
    mSearchString = aSearchString;
38
0
    return NS_OK;
39
0
}
40
41
NS_IMETHODIMP nsFindService::GetReplaceString(nsAString & aReplaceString)
42
0
{
43
0
    aReplaceString = mReplaceString;
44
0
    return NS_OK;
45
0
}
46
NS_IMETHODIMP nsFindService::SetReplaceString(const nsAString & aReplaceString)
47
0
{
48
0
    mReplaceString = aReplaceString;
49
0
    return NS_OK;
50
0
}
51
52
NS_IMETHODIMP nsFindService::GetFindBackwards(bool *aFindBackwards)
53
0
{
54
0
    NS_ENSURE_ARG_POINTER(aFindBackwards);
55
0
    *aFindBackwards = mFindBackwards;
56
0
    return NS_OK;
57
0
}
58
NS_IMETHODIMP nsFindService::SetFindBackwards(bool aFindBackwards)
59
0
{
60
0
    mFindBackwards = aFindBackwards;
61
0
    return NS_OK;
62
0
}
63
64
NS_IMETHODIMP nsFindService::GetWrapFind(bool *aWrapFind)
65
0
{
66
0
    NS_ENSURE_ARG_POINTER(aWrapFind);
67
0
    *aWrapFind = mWrapFind;
68
0
    return NS_OK;
69
0
}
70
NS_IMETHODIMP nsFindService::SetWrapFind(bool aWrapFind)
71
0
{
72
0
    mWrapFind = aWrapFind;
73
0
    return NS_OK;
74
0
}
75
76
NS_IMETHODIMP nsFindService::GetEntireWord(bool *aEntireWord)
77
0
{
78
0
    NS_ENSURE_ARG_POINTER(aEntireWord);
79
0
    *aEntireWord = mEntireWord;
80
0
    return NS_OK;
81
0
}
82
NS_IMETHODIMP nsFindService::SetEntireWord(bool aEntireWord)
83
0
{
84
0
    mEntireWord = aEntireWord;
85
0
    return NS_OK;
86
0
}
87
88
NS_IMETHODIMP nsFindService::GetMatchCase(bool *aMatchCase)
89
0
{
90
0
    NS_ENSURE_ARG_POINTER(aMatchCase);
91
0
    *aMatchCase = mMatchCase;
92
0
    return NS_OK;
93
0
}
94
NS_IMETHODIMP nsFindService::SetMatchCase(bool aMatchCase)
95
0
{
96
0
    mMatchCase = aMatchCase;
97
0
    return NS_OK;
98
0
}
99