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 =
35  m_bBookmarks =
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();
49  m_bCharHiddenText = rVOpt.IsShowHiddenChar(true);
50  m_bBookmarks = rVOpt.IsShowBookmarks(true);
51  m_bManualBreak = rVOpt.IsLineBreak(true);
53 }
54 
56 {
57  return new SwDocDisplayItem( *this );
58 }
59 
60 bool 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 &&
70  m_bSoftHyphen == rItem.m_bSoftHyphen &&
72  m_bBookmarks == rItem.m_bBookmarks &&
73  m_bManualBreak == rItem.m_bManualBreak &&
75 }
76 
78 {
80  rVOpt.SetTab (m_bTab );
81  rVOpt.SetBlank (m_bSpace );
83  rVOpt.SetSoftHyph (m_bSoftHyphen );
88 }
89 
92 {
93  m_bVertRuler =
95  m_bCrosshair =
97  m_bTable =
98  m_bGraphic =
99  m_bDrawing =
100  m_bNotes = false;
101  m_bShowInlineTooltips = true;
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 
133 bool 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 &&
142  m_bSmoothScroll == rItem.m_bSmoothScroll &&
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 {
157  rVOpt.SetViewVRuler(m_bVertRuler );
159  rVOpt.SetCrossHair(m_bCrosshair );
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 
192 bool SwAddPrinterItem::operator==( const SfxPoolItem& rAttr ) const
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 
241 bool 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: */
void SetLineBreak(bool b)
Definition: viewopt.hxx:256
sal_Int32 m_xDefaultAnchor
Definition: cfgitems.hxx:54
bool IsSmoothScroll() const
Definition: viewopt.hxx:404
void SetSoftHyph(bool b)
Definition: viewopt.hxx:267
bool m_bTest4
Definition: cfgitems.hxx:147
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:222
bool m_bDrawing
Definition: cfgitems.hxx:78
bool m_bTest7
Definition: cfgitems.hxx:150
virtual bool operator==(const SfxPoolItem &) const =0
#define FN_PARAM_ELEM
Definition: cmdid.h:767
bool IsGraphic() const
Definition: viewopt.hxx:334
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:155
sal_Int32 GetDefaultAnchor() const
Definition: viewopt.hxx:683
void SetShowInlineTooltips(bool b)
Definition: viewopt.hxx:291
bool IsPostIts() const
Definition: viewopt.hxx:274
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:133
virtual SwShadowCursorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:217
bool m_bNotes
Definition: cfgitems.hxx:79
bool IsHardBlank() const
Definition: viewopt.hxx:232
bool m_bCharHiddenText
Definition: cfgitems.hxx:51
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:805
void SetHardBlank(bool b)
Definition: viewopt.hxx:234
bool IsShowHiddenPara() const
Definition: viewopt.hxx:398
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:765
virtual SwAddPrinterItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:187
void SetShowHiddenChar(bool b)
Definition: viewopt.hxx:326
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:192
void SetShdwCursorFillMode(SwFillMode nMode)
Definition: viewopt.hxx:640
#define FN_PARAM_DOCDISP
Definition: cmdid.h:766
virtual SwElemItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:128
void SetShowOutlineContentVisibilityButton(bool b)
Definition: viewopt.hxx:314
void SetParagraph(bool b)
Definition: viewopt.hxx:240
Item for settings dialog, ShadowCursorPage.
Definition: cfgitems.hxx:116
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool m_bShowHiddenPara
Definition: cfgitems.hxx:85
SwFillMode
Definition: crstate.hxx:28
void SetShowChangesInMargin(bool b)
Definition: viewopt.hxx:297
void SetShowHiddenPara(bool b)
Definition: viewopt.hxx:401
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:226
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:100
bool m_bTest8
Definition: cfgitems.hxx:151
bool m_bTable
Definition: cfgitems.hxx:76
SwFillMode GetMode() const
Definition: cfgitems.hxx:129
void SetSmoothScroll(bool b)
Definition: viewopt.hxx:407
bool IsDraw() const
Definition: viewopt.hxx:349
bool IsCrossHair() const
Definition: viewopt.hxx:386
void SetDraw(bool b)
Definition: viewopt.hxx:351
bool m_bVertRuler
Definition: cfgitems.hxx:70
virtual SwTestItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:236
void SetTable(bool b)
Definition: viewopt.hxx:346
bool m_bTest6
Definition: cfgitems.hxx:149
void SetShowHiddenField(bool b)
Definition: viewopt.hxx:331
void SetTab(bool b)
Definition: viewopt.hxx:223
void SetDefaultAnchor(const sal_Int32 aFlag)
Definition: viewopt.hxx:685
bool IsShowChangesInMargin() const
Definition: viewopt.hxx:295
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:237
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:60
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:607
virtual SwDocDisplayItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgitems.cxx:55
bool IsControl() const
Definition: viewopt.hxx:354
bool m_bTest9
Definition: cfgitems.hxx:152
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:220
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:77
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:253
void SetGraphic(bool b)
Definition: viewopt.hxx:336
bool m_bShowInlineTooltips
Definition: cfgitems.hxx:80
bool IsTable() const
Definition: viewopt.hxx:344
void SetCrossHair(bool b)
Definition: viewopt.hxx:388
bool m_bShowChangesInMargin
Definition: cfgitems.hxx:83
bool m_bGraphic
Definition: cfgitems.hxx:77
bool m_bTest5
Definition: cfgitems.hxx:148
bool IsVRulerRight() const
Definition: viewopt.hxx:628
SwPrintData & operator=(SwPrintData const &)=default
bool m_bSmoothScroll
Definition: cfgitems.hxx:72
bool m_bFieldHiddenText
Definition: cfgitems.hxx:84
bool IsShowInlineTooltips() const
Definition: viewopt.hxx:289
Item for settings dialog - document view.
Definition: cfgitems.hxx:41
bool m_bTest3
Definition: cfgitems.hxx:146
bool m_bTest10
Definition: cfgitems.hxx:153
void SetPostIts(bool b)
Definition: viewopt.hxx:276
bool m_bTreatSubOutlineLevelsAsContent
Definition: cfgitems.hxx:82
bool IsOn() const
Definition: cfgitems.hxx:130
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:229
void SetTreatSubOutlineLevelsAsContent(bool b)
Definition: viewopt.hxx:318
void SetVRulerRight(bool b)
Definition: viewopt.hxx:630
void SetShadowCursor(bool b)
Definition: viewopt.hxx:624
bool m_bTest2
Definition: cfgitems.hxx:145
bool IsSoftHyph() const
Definition: viewopt.hxx:265
bool IsTreatSubOutlineLevelsAsContent() const
Definition: viewopt.cxx:106
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:247
bool operator==(const SwPrintData &rData) const
Definition: printdata.hxx:103
bool m_bParagraphEnd
Definition: cfgitems.hxx:46
void SetViewVRuler(bool b)
Definition: viewopt.hxx:618
void SetControl(bool b)
Definition: viewopt.hxx:356
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:322
bool IsShowHiddenField() const
Definition: viewopt.hxx:329
bool m_bShowOutlineContentVisibilityButton
Definition: cfgitems.hxx:81
bool m_bCrosshair
Definition: cfgitems.hxx:74
SwFillMode m_eMode
Definition: cfgitems.hxx:118
void SetShowBookmarks(bool const b)
Definition: viewopt.hxx:243
bool m_bVertRulerRight
Definition: cfgitems.hxx:71
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgitems.cxx:241
bool m_bNonbreakingSpace
Definition: cfgitems.hxx:49
bool m_bTest1
Definition: cfgitems.hxx:144
void SetBlank(bool b)
Definition: viewopt.hxx:229