LibreOffice Module sw (master) 1
cfgitems.cxx
Go to the documentation of this file.
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 <viewopt.hxx>
21#include <cmdid.h>
22#include <cfgitems.hxx>
23#include <crstate.hxx>
24
25
28{
30 m_bTab =
31 m_bSpace =
36 m_bManualBreak = true;
37 m_xDefaultAnchor = 1; //FLY_TO_CHAR
38};
39
40// Item for the Settings dialog, page document view
43{
44 m_bParagraphEnd = rVOpt.IsParagraph(true);
45 m_bTab = rVOpt.IsTab(true);
46 m_bSpace = rVOpt.IsBlank(true);
48 m_bSoftHyphen = rVOpt.IsSoftHyph();
50 m_bBookmarks = rVOpt.IsShowBookmarks(true);
51 m_bManualBreak = rVOpt.IsLineBreak(true);
53}
54
56{
57 return new SwDocDisplayItem( *this );
58}
59
60bool SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const
61{
62 assert(SfxPoolItem::operator==(rAttr));
63
64 const SwDocDisplayItem& rItem = static_cast<const SwDocDisplayItem&>(rAttr);
65
66 return ( m_bParagraphEnd == rItem.m_bParagraphEnd &&
67 m_bTab == rItem.m_bTab &&
68 m_bSpace == rItem.m_bSpace &&
72 m_bBookmarks == rItem.m_bBookmarks &&
75}
76
78{
80 rVOpt.SetTab (m_bTab );
81 rVOpt.SetBlank (m_bSpace );
88}
89
92{
97 m_bTable =
100 m_bNotes = false;
106 m_bShowHiddenPara = false;
107}
108
111{
112 m_bVertRuler = rVOpt.IsViewVRuler(true);
114 m_bCrosshair = rVOpt.IsCrossHair();
116 m_bTable = rVOpt.IsTable();
117 m_bGraphic = rVOpt.IsGraphic();
118 m_bDrawing = rVOpt.IsDraw() && rVOpt.IsControl();
119 m_bNotes = rVOpt.IsPostIts();
126}
127
129{
130 return new SwElemItem( *this );
131}
132
133bool SwElemItem::operator==( const SfxPoolItem& rAttr ) const
134{
135 assert(SfxPoolItem::operator==(rAttr));
136
137 const SwElemItem& rItem = static_cast<const SwElemItem&>(rAttr);
138
139 return ( m_bVertRuler == rItem.m_bVertRuler &&
141 m_bCrosshair == rItem.m_bCrosshair &&
143 m_bTable == rItem.m_bTable &&
144 m_bGraphic == rItem.m_bGraphic &&
145 m_bDrawing == rItem.m_bDrawing &&
146 m_bNotes == rItem.m_bNotes &&
153}
154
156{
161 rVOpt.SetTable (m_bTable );
162 rVOpt.SetGraphic (m_bGraphic );
163 rVOpt.SetDraw (m_bDrawing );
164 rVOpt.SetControl (m_bDrawing );
165 rVOpt.SetPostIts (m_bNotes );
172}
173
174// CTOR for empty Item
177{
178}
179
180// CTOR from SwPrintOptions
183{
184 SwPrintData::operator=(rPrtData);
185}
186
188{
189 return new SwAddPrinterItem( *this );
190}
191
193{
194 assert(SfxPoolItem::operator==(rAttr));
195
196 const SwAddPrinterItem& rItem = static_cast<const SwAddPrinterItem&>(rAttr);
197
198 return SwPrintData::operator==(rItem);
199}
200
201// Item for Settings dialog, ShadowCursorPage
204 m_eMode( SwFillMode::Tab )
205 ,m_bOn( false )
206{
207}
208
211 m_eMode( rVOpt.GetShdwCursorFillMode() )
212 ,m_bOn( rVOpt.IsShadowCursor() )
213
214{
215}
216
218{
219 return new SwShadowCursorItem( *this );
220}
221
223{
224 return SfxPoolItem::operator==(rCmp) &&
225 IsOn() == static_cast<const SwShadowCursorItem&>(rCmp).IsOn() &&
226 GetMode() == static_cast<const SwShadowCursorItem&>(rCmp).GetMode();
227}
228
230{
231 rVOpt.SetShadowCursor( m_bOn );
233}
234
235#ifdef DBG_UTIL
237{
238 return new SwTestItem( *this );
239}
240
241bool SwTestItem::operator==( const SfxPoolItem& rAttr ) const
242{
243 assert(SfxPoolItem::operator==(rAttr));
244
245 const SwTestItem& rItem = static_cast<const SwTestItem&>( rAttr);
246
247 return ( m_bTest1==rItem.m_bTest1&&
248 m_bTest2==rItem.m_bTest2&&
249 m_bTest3==rItem.m_bTest3&&
250 m_bTest4==rItem.m_bTest4&&
251 m_bTest5==rItem.m_bTest5&&
252 m_bTest6==rItem.m_bTest6&&
253 m_bTest7==rItem.m_bTest7&&
254 m_bTest8==rItem.m_bTest8&&
255 m_bTest9==rItem.m_bTest9&&
256 m_bTest10==rItem.m_bTest10);
257}
258
259#endif
260
261/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const=0
virtual SwAddPrinterItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:187
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:192
Item for settings dialog - document view.
Definition: cfgitems.hxx:42
bool m_bNonbreakingSpace
Definition: cfgitems.hxx:49
virtual SwDocDisplayItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:55
bool m_bParagraphEnd
Definition: cfgitems.hxx:46
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:77
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:60
sal_Int32 m_xDefaultAnchor
Definition: cfgitems.hxx:54
bool m_bCharHiddenText
Definition: cfgitems.hxx:51
bool m_bCrosshair
Definition: cfgitems.hxx:74
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:133
bool m_bSmoothScroll
Definition: cfgitems.hxx:72
bool m_bShowChangesInMargin
Definition: cfgitems.hxx:83
bool m_bNotes
Definition: cfgitems.hxx:79
bool m_bVertRulerRight
Definition: cfgitems.hxx:71
bool m_bShowHiddenPara
Definition: cfgitems.hxx:85
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:155
bool m_bFieldHiddenText
Definition: cfgitems.hxx:84
bool m_bShowInlineTooltips
Definition: cfgitems.hxx:80
bool m_bTreatSubOutlineLevelsAsContent
Definition: cfgitems.hxx:82
bool m_bShowOutlineContentVisibilityButton
Definition: cfgitems.hxx:81
bool m_bDrawing
Definition: cfgitems.hxx:78
bool m_bTable
Definition: cfgitems.hxx:76
virtual SwElemItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:128
bool m_bGraphic
Definition: cfgitems.hxx:77
bool m_bVertRuler
Definition: cfgitems.hxx:70
SwPrintData & operator=(SwPrintData const &)=default
bool operator==(const SwPrintData &rData) const
Definition: printdata.hxx:103
Item for settings dialog, ShadowCursorPage.
Definition: cfgitems.hxx:117
virtual SwShadowCursorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:217
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:229
SwFillMode GetMode() const
Definition: cfgitems.hxx:129
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:222
bool IsOn() const
Definition: cfgitems.hxx:130
SwFillMode m_eMode
Definition: cfgitems.hxx:118
bool m_bTest8
Definition: cfgitems.hxx:151
bool m_bTest7
Definition: cfgitems.hxx:150
virtual SwTestItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:236
bool m_bTest6
Definition: cfgitems.hxx:149
bool m_bTest9
Definition: cfgitems.hxx:152
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:241
bool m_bTest1
Definition: cfgitems.hxx:144
bool m_bTest5
Definition: cfgitems.hxx:148
bool m_bTest2
Definition: cfgitems.hxx:145
bool m_bTest4
Definition: cfgitems.hxx:147
bool m_bTest10
Definition: cfgitems.hxx:153
bool m_bTest3
Definition: cfgitems.hxx:146
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:371
void SetLineBreak(bool b)
Definition: viewopt.hxx:396
bool IsVRulerRight() const
Definition: viewopt.hxx:793
void SetShdwCursorFillMode(SwFillMode nMode)
Definition: viewopt.hxx:805
bool IsSmoothScroll() const
Definition: viewopt.hxx:576
sal_Int32 GetDefaultAnchor() const
Definition: viewopt.hxx:847
void SetTab(bool b)
Definition: viewopt.hxx:348
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:385
void SetGraphic(bool b)
Definition: viewopt.hxx:503
void SetShowChangesInMargin(bool b)
Definition: viewopt.hxx:462
void SetVRulerRight(bool b)
Definition: viewopt.hxx:795
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:353
void SetDefaultAnchor(const sal_Int32 aFlag)
Definition: viewopt.hxx:849
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:178
bool IsShowHiddenField() const
Definition: viewopt.hxx:496
void SetShowHiddenChar(bool b)
Definition: viewopt.hxx:493
void SetHardBlank(bool b)
Definition: viewopt.hxx:366
bool IsTable() const
Definition: viewopt.hxx:511
bool IsShowHiddenPara() const
Definition: viewopt.hxx:570
bool IsHardBlank() const
Definition: viewopt.hxx:362
void SetPostIts(bool b)
Definition: viewopt.hxx:432
void SetTable(bool b)
Definition: viewopt.hxx:513
void SetParagraph(bool b)
Definition: viewopt.hxx:376
bool IsTreatSubOutlineLevelsAsContent() const
Definition: viewopt.cxx:183
void SetShadowCursor(bool b)
Definition: viewopt.hxx:789
void SetTreatSubOutlineLevelsAsContent(bool b)
Definition: viewopt.hxx:486
void SetSoftHyph(bool b)
Definition: viewopt.hxx:414
void SetSmoothScroll(bool b)
Definition: viewopt.hxx:579
void SetShowHiddenField(bool b)
Definition: viewopt.hxx:498
void SetShowOutlineContentVisibilityButton(bool b)
Definition: viewopt.hxx:482
void SetShowBookmarks(bool const b)
Definition: viewopt.hxx:381
void SetBlank(bool b)
Definition: viewopt.hxx:357
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:489
void SetControl(bool b)
Definition: viewopt.hxx:523
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:772
bool IsGraphic() const
Definition: viewopt.hxx:501
bool IsSoftHyph() const
Definition: viewopt.hxx:411
bool IsControl() const
Definition: viewopt.hxx:521
void SetViewVRuler(bool b)
Definition: viewopt.hxx:783
bool IsPostIts() const
Definition: viewopt.hxx:427
void SetShowHiddenPara(bool b)
Definition: viewopt.hxx:573
void SetDraw(bool b)
Definition: viewopt.hxx:518
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:391
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:344
void SetCrossHair(bool b)
Definition: viewopt.hxx:560
void SetShowInlineTooltips(bool b)
Definition: viewopt.hxx:453
bool IsShowInlineTooltips() const
Definition: viewopt.hxx:448
bool IsShowChangesInMargin() const
Definition: viewopt.hxx:457
bool IsCrossHair() const
Definition: viewopt.hxx:558
bool IsDraw() const
Definition: viewopt.hxx:516
#define FN_PARAM_ELEM
Definition: cmdid.h:802
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:835
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:800
#define FN_PARAM_DOCDISP
Definition: cmdid.h:801
SwFillMode
Definition: crstate.hxx:29