Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/svx/source/items/postattr.cxx
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
#include <svx/postattr.hxx>
21
#include <svx/strings.hrc>
22
#include <svx/dialmgr.hxx>
23
24
0
SfxPoolItem* SvxPostItAuthorItem::CreateDefault() { return new SvxPostItAuthorItem(TypedWhichId<SvxPostItAuthorItem>(0)); }
25
0
SfxPoolItem* SvxPostItDateItem::CreateDefault() { return new SvxPostItDateItem(TypedWhichId<SvxPostItDateItem>(0)); }
26
0
SfxPoolItem* SvxPostItTextItem::CreateDefault() { return new SvxPostItTextItem(TypedWhichId<SvxPostItTextItem>(0)); }
27
0
SfxPoolItem* SvxPostItIdItem::CreateDefault() { return new SvxPostItIdItem(TypedWhichId<SvxPostItIdItem>(0)); }
28
29
SvxPostItAuthorItem::SvxPostItAuthorItem( TypedWhichId<SvxPostItAuthorItem> _nWhich )
30
0
{
31
0
    SetWhich( _nWhich );
32
0
}
33
34
35
SvxPostItAuthorItem::SvxPostItAuthorItem( const OUString& rAuthor,
36
                                          TypedWhichId<SvxPostItAuthorItem> _nWhich ) :
37
0
    SfxStringItem( _nWhich, rAuthor )
38
0
{
39
0
}
40
41
42
bool SvxPostItAuthorItem::GetPresentation
43
(
44
    SfxItemPresentation ePres,
45
    MapUnit             /*eCoreUnit*/,
46
    MapUnit             /*ePresUnit*/,
47
    OUString&           rText, const IntlWrapper&
48
)   const
49
0
{
50
0
    switch ( ePres )
51
0
    {
52
0
        case SfxItemPresentation::Nameless:
53
0
            rText = GetValue();
54
0
            return true;
55
0
        case SfxItemPresentation::Complete:
56
0
            rText = SvxResId(RID_SVXITEMS_AUTHOR_COMPLETE) + GetValue();
57
0
            return true;
58
0
        default: ;//prevent warning
59
0
    }
60
0
    return false;
61
0
}
62
63
SvxPostItAuthorItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const
64
0
{
65
0
    return new SvxPostItAuthorItem( *this );
66
0
}
67
68
SvxPostItDateItem::SvxPostItDateItem( TypedWhichId<SvxPostItDateItem> _nWhich )
69
0
    : SfxStringItem(_nWhich)
70
0
{
71
0
}
72
73
74
SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, TypedWhichId<SvxPostItDateItem> _nWhich ) :
75
0
    SfxStringItem( _nWhich, rDate )
76
0
{
77
0
}
78
79
80
bool SvxPostItDateItem::GetPresentation
81
(
82
    SfxItemPresentation ePres,
83
    MapUnit             /*eCoreUnit*/,
84
    MapUnit             /*ePresUnit*/,
85
    OUString&           rText, const IntlWrapper&
86
)   const
87
0
{
88
0
    switch ( ePres )
89
0
    {
90
0
        case SfxItemPresentation::Nameless:
91
0
            rText = GetValue();
92
0
            return true;
93
0
        case SfxItemPresentation::Complete:
94
0
            rText = SvxResId(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
95
0
            return true;
96
0
        default: ;//prevent warning
97
0
    }
98
0
    return false;
99
0
}
100
101
102
SvxPostItDateItem* SvxPostItDateItem::Clone( SfxItemPool * ) const
103
0
{
104
0
    return new SvxPostItDateItem( *this );
105
0
}
106
107
SvxPostItTextItem::SvxPostItTextItem( TypedWhichId<SvxPostItTextItem> _nWhich )
108
0
{
109
0
    SetWhich( _nWhich );
110
0
}
111
112
SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, TypedWhichId<SvxPostItTextItem> _nWhich ) :
113
114
0
    SfxStringItem( _nWhich, rText )
115
0
{
116
0
}
117
118
bool SvxPostItTextItem::GetPresentation
119
(
120
    SfxItemPresentation ePres,
121
    MapUnit             /*eCoreUnit*/,
122
    MapUnit             /*ePresUnit*/,
123
    OUString&           rText, const IntlWrapper&
124
)   const
125
0
{
126
0
    switch ( ePres )
127
0
    {
128
0
        case SfxItemPresentation::Nameless:
129
0
            rText = GetValue();
130
0
            return true;
131
0
        case SfxItemPresentation::Complete:
132
0
            rText = SvxResId(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
133
0
            return true;
134
0
        default: ;//prevent warning
135
0
    }
136
0
    return false;
137
0
}
138
139
SvxPostItTextItem* SvxPostItTextItem::Clone( SfxItemPool * ) const
140
0
{
141
0
    return new SvxPostItTextItem( *this );
142
0
}
143
144
SvxPostItIdItem::SvxPostItIdItem( TypedWhichId<SvxPostItIdItem> _nWhich )
145
0
{
146
0
    SetWhich( _nWhich );
147
0
}
148
149
SvxPostItIdItem* SvxPostItIdItem::Clone( SfxItemPool * ) const
150
0
{
151
0
    return new SvxPostItIdItem( *this );
152
0
}
153
154
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */