LibreOffice Module sw (master)  1
usrpref.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 <sal/config.h>
21 
22 #include <osl/diagnose.h>
23 #include <o3tl/any.hxx>
24 #include <unotools/configmgr.hxx>
25 #include <unotools/syslocale.hxx>
26 
27 #include <usrpref.hxx>
28 #include <com/sun/star/uno/Any.hxx>
29 #include <com/sun/star/uno/Sequence.hxx>
31 
32 using namespace utl;
33 using namespace ::com::sun::star;
34 using namespace ::com::sun::star::uno;
35 
37 {
38  *static_cast<SwViewOption*>(this) = rCopy;
39 }
40 
42  m_eFieldUpdateFlags(AUTOUPD_OFF),
43  m_nLinkUpdateMode(0),
44  m_bIsHScrollMetricSet(false),
45  m_bIsVScrollMetricSet(false),
46  m_nDefTabInMm100( 2000 ), // 2 cm
47  m_bIsSquaredPageMode(false),
48  m_bIsAlignMathObjectsToBaseline(false),
49  m_aContentConfig(bWeb, *this),
50  m_aLayoutConfig(bWeb, *this),
51  m_aGridConfig(bWeb, *this),
52  m_aCursorConfig(*this),
53  m_pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : nullptr),
54  m_bApplyCharUnit(false)
55 {
57  {
59  return;
60  }
62  m_eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
64 
70  m_pWebColorConfig->Load();
71 }
72 
74 {
75 }
76 
77 static const auto g_UpdateLinkIndex = 17;
78 
80 {
81  static constexpr const char*const aPropNames[] =
82  {
83  "Display/GraphicObject", // 0
84  "Display/Table", // 1
85  "Display/DrawingControl", // 2
86  "Display/FieldCode", // 3
87  "Display/Note", // 4
88  "Display/ShowContentTips", // 5
89  "NonprintingCharacter/MetaCharacters", // 6
90  "NonprintingCharacter/ParagraphEnd", // 7
91  "NonprintingCharacter/OptionalHyphen", // 8
92  "NonprintingCharacter/Space", // 9
93  "NonprintingCharacter/Break", // 10
94  "NonprintingCharacter/ProtectedSpace", // 11
95  "NonprintingCharacter/Tab", // 12 //not in Writer/Web
96  "NonprintingCharacter/HiddenText", // 13
97  "NonprintingCharacter/HiddenParagraph", // 14
98  "NonprintingCharacter/HiddenCharacter", // 15
99  "NonprintingCharacter/Bookmarks", // 16
100  "Update/Link", // 17
101  "Update/Field", // 18
102  "Update/Chart", // 19
103  "Display/ShowInlineTooltips", // 20
104  "Display/UseHeaderFooterMenu" // 21
105  };
106 #if defined(__GNUC__) && !defined(__clang__)
107  // clang 8.0.0 says strcmp isn't constexpr
108  static_assert(std::strcmp("Update/Link", aPropNames[g_UpdateLinkIndex]) == 0);
109 #endif
110  const int nCount = bWeb ? 12 : SAL_N_ELEMENTS(aPropNames);
111  Sequence<OUString> aNames(nCount);
112  OUString* pNames = aNames.getArray();
113  for(int i = 0; i < nCount; i++)
114  {
115  pNames[i] = OUString::createFromAscii(aPropNames[i]);
116  }
117  return aNames;
118 }
119 
121  ConfigItem(bIsWeb ? OUString("Office.WriterWeb/Content") : OUString("Office.Writer/Content")),
122  rParent(rPar),
123  bWeb(bIsWeb)
124 {
125  Load();
127 }
128 
130 {
131 }
132 
133 void SwContentViewConfig::Notify( const Sequence< OUString > & /*rPropertyNames*/ )
134 {
135  Load();
136 }
137 
139 {
141 
142  Sequence<Any> aValues(aNames.getLength());
143  Any* pValues = aValues.getArray();
144 
145  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
146  {
147  bool bVal = false;
148  switch(nProp)
149  {
150  case 0: bVal = rParent.IsGraphic(); break;// "Display/GraphicObject",
151  case 1: bVal = rParent.IsTable(); break;// "Display/Table",
152  case 2: bVal = rParent.IsDraw(); break;// "Display/DrawingControl",
153  case 3: bVal = rParent.IsFieldName(); break;// "Display/FieldCode",
154  case 4: bVal = rParent.IsPostIts(); break;// "Display/Note",
155  case 5: bVal = rParent.IsShowContentTips(); break; // "Display/ShowContentTips"
156  case 6: bVal = rParent.IsViewMetaChars(); break; //"NonprintingCharacter/MetaCharacters"
157  case 7: bVal = rParent.IsParagraph(true); break;// "NonprintingCharacter/ParagraphEnd",
158  case 8: bVal = rParent.IsSoftHyph(); break;// "NonprintingCharacter/OptionalHyphen",
159  case 9: bVal = rParent.IsBlank(true); break;// "NonprintingCharacter/Space",
160  case 10: bVal = rParent.IsLineBreak(true);break;// "NonprintingCharacter/Break",
161  case 11: bVal = rParent.IsHardBlank(); break;// "NonprintingCharacter/ProtectedSpace",
162  case 12: bVal = rParent.IsTab(true); break;// "NonprintingCharacter/Tab",
163  case 13: bVal = rParent.IsShowHiddenField(); break;// "NonprintingCharacter/Fields: HiddenText",
164  case 14: bVal = rParent.IsShowHiddenPara(); break;// "NonprintingCharacter/Fields: HiddenParagraph",
165  case 15: bVal = rParent.IsShowHiddenChar(true); break;// "NonprintingCharacter/HiddenCharacter",
166  case 16: bVal = rParent.IsShowBookmarks(true); break;// "NonprintingCharacter/Bookmarks",
167  case 17: pValues[nProp] <<= rParent.GetUpdateLinkMode(); break;// "Update/Link",
168  case 18: bVal = rParent.IsUpdateFields(); break;// "Update/Field",
169  case 19: bVal = rParent.IsUpdateCharts(); break;// "Update/Chart"
170  case 20: bVal = rParent.IsShowInlineTooltips(); break;// "Display/ShowInlineTooltips"
171  case 21: bVal = rParent.IsUseHeaderFooterMenu(); break;// "Display/UseHeaderFooterMenu"
172  }
173  if (nProp != g_UpdateLinkIndex)
174  pValues[nProp] <<= bVal;
175  }
176  PutProperties(aNames, aValues);
177 }
178 
180 {
182  Sequence<Any> aValues = GetProperties(aNames);
183  const Any* pValues = aValues.getConstArray();
184  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
185  if(aValues.getLength() == aNames.getLength())
186  {
187  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
188  {
189  if(pValues[nProp].hasValue())
190  {
191  bool bSet = nProp != g_UpdateLinkIndex && *o3tl::doAccess<bool>(pValues[nProp]);
192  switch(nProp)
193  {
194  case 0: rParent.SetGraphic(bSet); break;// "Display/GraphicObject",
195  case 1: rParent.SetTable(bSet); break;// "Display/Table",
196  case 2: rParent.SetDraw(bSet); break;// "Display/DrawingControl",
197  case 3: rParent.SetFieldName(bSet); break;// "Display/FieldCode",
198  case 4: rParent.SetPostIts(bSet); break;// "Display/Note",
199  case 5: rParent.SetShowContentTips(bSet); break;// "Display/ShowContentTips",
200  case 6: rParent.SetViewMetaChars(bSet); break; //"NonprintingCharacter/MetaCharacters"
201  case 7: rParent.SetParagraph(bSet); break;// "NonprintingCharacter/ParagraphEnd",
202  case 8: rParent.SetSoftHyph(bSet); break;// "NonprintingCharacter/OptionalHyphen",
203  case 9: rParent.SetBlank(bSet); break;// "NonprintingCharacter/Space",
204  case 10: rParent.SetLineBreak(bSet);break;// "NonprintingCharacter/Break",
205  case 11: rParent.SetHardBlank(bSet); break;// "NonprintingCharacter/ProtectedSpace",
206  case 12: rParent.SetTab(bSet); break;// "NonprintingCharacter/Tab",
207  case 13: rParent.SetShowHiddenField(bSet); break;// "NonprintingCharacter/Fields: HiddenText",
208  case 14: rParent.SetShowHiddenPara(bSet); break;// "NonprintingCharacter/Fields: HiddenParagraph",
209  case 15: rParent.SetShowHiddenChar(bSet); break;// "NonprintingCharacter/HiddenCharacter",
210  case 16: rParent.SetShowBookmarks(bSet); break;// "NonprintingCharacter/Bookmarks",
211  case 17:
212  {
213  sal_Int32 nSet = 0;
214  pValues[nProp] >>= nSet;
215  rParent.SetUpdateLinkMode(nSet, true);
216  }
217  break;// "Update/Link",
218  case 18: rParent.SetUpdateFields(bSet); break;// "Update/Field",
219  case 19: rParent.SetUpdateCharts(bSet); break;// "Update/Chart"
220  case 20: rParent.SetShowInlineTooltips(bSet); break;// "Display/ShowInlineTooltips"
221  case 21: rParent.SetUseHeaderFooterMenu(bSet); break;// "Display/UseHeaderFooterMenu"
222  }
223  }
224  }
225  }
226 }
227 
229 {
230  static const char* aPropNames[] =
231  {
232  "Line/Guide", // 0
233  "Window/HorizontalScroll", // 1
234  "Window/VerticalScroll", // 2
235  "Window/ShowRulers", // 3
236  "Window/HorizontalRuler", // 4
237  "Window/VerticalRuler", // 5
238  "Window/HorizontalRulerUnit", // 6
239  "Window/VerticalRulerUnit", // 7
240  "Window/SmoothScroll", // 8
241  "Zoom/Value", // 9
242  "Zoom/Type", //10
243  "Other/IsAlignMathObjectsToBaseline", //11
244  "Other/MeasureUnit", //12
245  // below properties are not available in WriterWeb
246  "Other/TabStop", //13
247  "Window/IsVerticalRulerRight", //14
248  "ViewLayout/Columns", //15
249  "ViewLayout/BookMode", //16
250  "Other/IsSquaredPageMode", //17
251  "Other/ApplyCharUnit", //18
252  "Window/ShowScrollBarTips" //19
253  };
254  const int nCount = bWeb ? 13 : 20;
255  Sequence<OUString> aNames(nCount);
256  OUString* pNames = aNames.getArray();
257  for(int i = 0; i < nCount; i++)
258  {
259  pNames[i] = OUString::createFromAscii(aPropNames[i]);
260  }
261  return aNames;
262 }
263 
265  ConfigItem(bIsWeb ? OUString("Office.WriterWeb/Layout") : OUString("Office.Writer/Layout"),
267  rParent(rPar),
268  bWeb(bIsWeb)
269 {
270 }
271 
273 {
274 }
275 
277 {
279 
280  Sequence<Any> aValues(aNames.getLength());
281  Any* pValues = aValues.getArray();
282 
283  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
284  {
285  Any &rVal = pValues[nProp];
286  switch(nProp)
287  {
288  case 0: rVal <<= rParent.IsCrossHair(); break; // "Line/Guide",
289  case 1: rVal <<= rParent.IsViewHScrollBar(); break; // "Window/HorizontalScroll",
290  case 2: rVal <<= rParent.IsViewVScrollBar(); break; // "Window/VerticalScroll",
291  case 3: rVal <<= rParent.IsViewAnyRuler(); break; // "Window/ShowRulers"
292  // #i14593# use IsView*Ruler(true) instead of IsView*Ruler()
293  // this preserves the single ruler states even if "Window/ShowRulers" is off
294  case 4: rVal <<= rParent.IsViewHRuler(true); break; // "Window/HorizontalRuler",
295  case 5: rVal <<= rParent.IsViewVRuler(true); break; // "Window/VerticalRuler",
296  case 6:
298  rVal <<= static_cast<sal_Int32>(rParent.m_eHScrollMetric); // "Window/HorizontalRulerUnit"
299  break;
300  case 7:
302  rVal <<= static_cast<sal_Int32>(rParent.m_eVScrollMetric); // "Window/VerticalRulerUnit"
303  break;
304  case 8: rVal <<= rParent.IsSmoothScroll(); break; // "Window/SmoothScroll",
305  case 9: rVal <<= static_cast<sal_Int32>(rParent.GetZoom()); break; // "Zoom/Value",
306  case 10: rVal <<= static_cast<sal_Int32>(rParent.GetZoomType()); break; // "Zoom/Type",
307  case 11: rVal <<= rParent.IsAlignMathObjectsToBaseline(); break; // "Other/IsAlignMathObjectsToBaseline"
308  case 12: rVal <<= static_cast<sal_Int32>(rParent.GetMetric()); break; // "Other/MeasureUnit",
309  case 13: rVal <<= rParent.GetDefTabInMm100(); break;// "Other/TabStop",
310  case 14: rVal <<= rParent.IsVRulerRight(); break; // "Window/IsVerticalRulerRight",
311  case 15: rVal <<= static_cast<sal_Int32>(rParent.GetViewLayoutColumns()); break; // "ViewLayout/Columns",
312  case 16: rVal <<= rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode",
313  case 17: rVal <<= rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode",
314  case 18: rVal <<= rParent.IsApplyCharUnit(); break; // "Other/ApplyCharUnit",
315  case 19: rVal <<= rParent.IsShowScrollBarTips(); break; // "Window/ShowScrollBarTips",
316  }
317  }
318  PutProperties(aNames, aValues);
319 }
320 
322 {
324  Sequence<Any> aValues = GetProperties(aNames);
325  const Any* pValues = aValues.getConstArray();
326  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
327  if(aValues.getLength() == aNames.getLength())
328  {
329  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
330  {
331  if(pValues[nProp].hasValue())
332  {
333  sal_Int32 nInt32Val = 0;
334  bool bSet = false;
335  pValues[nProp] >>= nInt32Val;
336  pValues[nProp] >>= bSet;
337 
338  switch(nProp)
339  {
340  case 0: rParent.SetCrossHair(bSet); break;// "Line/Guide",
341  case 1: rParent.SetViewHScrollBar(bSet); break;// "Window/HorizontalScroll",
342  case 2: rParent.SetViewVScrollBar(bSet); break;// "Window/VerticalScroll",
343  case 3: rParent.SetViewAnyRuler(bSet);break; // "Window/ShowRulers"
344  case 4: rParent.SetViewHRuler(bSet); break;// "Window/HorizontalRuler",
345  case 5: rParent.SetViewVRuler(bSet); break;// "Window/VerticalRuler",
346  case 6:
347  {
349  rParent.m_eHScrollMetric = static_cast<FieldUnit>(nInt32Val); // "Window/HorizontalRulerUnit"
350  }
351  break;
352  case 7:
353  {
355  rParent.m_eVScrollMetric = static_cast<FieldUnit>(nInt32Val); // "Window/VerticalRulerUnit"
356  }
357  break;
358  case 8: rParent.SetSmoothScroll(bSet); break;// "Window/SmoothScroll",
359  case 9: rParent.SetZoom( static_cast< sal_uInt16 >(nInt32Val) ); break;// "Zoom/Value",
360  case 10: rParent.SetZoomType( static_cast< SvxZoomType >(nInt32Val) ); break;// "Zoom/Type",
361  case 11: rParent.SetAlignMathObjectsToBaseline(bSet, true); break;// "Other/IsAlignMathObjectsToBaseline"
362  case 12: rParent.SetMetric(static_cast<FieldUnit>(nInt32Val), true); break;// "Other/MeasureUnit",
363  case 13: rParent.SetDefTabInMm100(nInt32Val, true); break;// "Other/TabStop",
364  case 14: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
365  case 15: rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
366  case 16: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
367  case 17: rParent.SetDefaultPageMode(bSet,true); break;// "Other/IsSquaredPageMode",
368  case 18: rParent.SetApplyCharUnit(bSet, true); break;// "Other/ApplyUserChar"
369  case 19: rParent.SetShowScrollBarTips(bSet); break;// "Window/ShowScrollBarTips",
370  }
371  }
372  }
373  }
374 }
375 
376 void SwLayoutViewConfig::Notify( const css::uno::Sequence< OUString >& ) {}
377 
379 {
380  static const char* aPropNames[] =
381  {
382  "Option/SnapToGrid", // 0
383  "Option/VisibleGrid", // 1
384  "Option/Synchronize", // 2
385  "Resolution/XAxis", // 3
386  "Resolution/YAxis", // 4
387  "Subdivision/XAxis", // 5
388  "Subdivision/YAxis" // 6
389  };
390  const int nCount = 7;
391  Sequence<OUString> aNames(nCount);
392  OUString* pNames = aNames.getArray();
393  for(int i = 0; i < nCount; i++)
394  {
395  pNames[i] = OUString::createFromAscii(aPropNames[i]);
396  }
397  return aNames;
398 }
399 
401  ConfigItem(bIsWeb ? OUString("Office.WriterWeb/Grid") : OUString("Office.Writer/Grid"),
403  rParent(rPar)
404 {
405 }
406 
408 {
409 }
410 
412 {
414 
415  Sequence<Any> aValues(aNames.getLength());
416  Any* pValues = aValues.getArray();
417 
418  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
419  {
420  switch(nProp)
421  {
422  case 0: pValues[nProp] <<= rParent.IsSnap(); break;// "Option/SnapToGrid",
423  case 1: pValues[nProp] <<= rParent.IsGridVisible(); break;//"Option/VisibleGrid",
424  case 2: pValues[nProp] <<= rParent.IsSynchronize(); break;// "Option/Synchronize",
425  case 3: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(rParent.GetSnapSize().Width())); break;// "Resolution/XAxis",
426  case 4: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(rParent.GetSnapSize().Height())); break;// "Resolution/YAxis",
427  case 5: pValues[nProp] <<= static_cast<sal_Int16>(rParent.GetDivisionX()); break;// "Subdivision/XAxis",
428  case 6: pValues[nProp] <<= static_cast<sal_Int16>(rParent.GetDivisionY()); break;// "Subdivision/YAxis"
429  }
430  }
431  PutProperties(aNames, aValues);
432 }
433 
435 {
437  Sequence<Any> aValues = GetProperties(aNames);
438  const Any* pValues = aValues.getConstArray();
439  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
440  if(aValues.getLength() == aNames.getLength())
441  {
442  Size aSnap(rParent.GetSnapSize());
443  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
444  {
445  if(pValues[nProp].hasValue())
446  {
447  bool bSet = nProp < 3 && *o3tl::doAccess<bool>(pValues[nProp]);
448  sal_Int32 nSet = 0;
449  if(nProp >= 3)
450  pValues[nProp] >>= nSet;
451  switch(nProp)
452  {
453  case 0: rParent.SetSnap(bSet); break;// "Option/SnapToGrid",
454  case 1: rParent.SetGridVisible(bSet); break;//"Option/VisibleGrid",
455  case 2: rParent.SetSynchronize(bSet); break;// "Option/Synchronize",
456  case 3: aSnap.setWidth( convertMm100ToTwip(nSet) ); break;// "Resolution/XAxis",
457  case 4: aSnap.setHeight( convertMm100ToTwip(nSet) ); break;// "Resolution/YAxis",
458  case 5: rParent.SetDivisionX(static_cast<short>(nSet)); break;// "Subdivision/XAxis",
459  case 6: rParent.SetDivisionY(static_cast<short>(nSet)); break;// "Subdivision/YAxis"
460  }
461  }
462  }
463  rParent.SetSnapSize(aSnap);
464  }
465 }
466 
467 void SwGridConfig::Notify( const css::uno::Sequence< OUString >& ) {}
468 
470 {
471  static const char* aPropNames[] =
472  {
473  "DirectCursor/UseDirectCursor", // 0
474  "DirectCursor/Insert", // 1
475  "Option/ProtectedArea", // 2
476  };
477  const int nCount = SAL_N_ELEMENTS(aPropNames);
478  Sequence<OUString> aNames(nCount);
479  OUString* pNames = aNames.getArray();
480  for(int i = 0; i < nCount; i++)
481  pNames[i] = OUString::createFromAscii(aPropNames[i]);
482  return aNames;
483 }
484 
486  ConfigItem("Office.Writer/Cursor", ConfigItemMode::ReleaseTree),
487  rParent(rPar)
488 {
489 }
490 
492 {
493 }
494 
496 {
498 
499  Sequence<Any> aValues(aNames.getLength());
500  Any* pValues = aValues.getArray();
501 
502  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
503  {
504  switch(nProp)
505  {
506  case 0: pValues[nProp] <<= rParent.IsShadowCursor(); break; // "DirectCursor/UseDirectCursor",
507  case 1: pValues[nProp] <<= static_cast<sal_Int32>(rParent.GetShdwCursorFillMode()); break; // "DirectCursor/Insert",
508  case 2: pValues[nProp] <<= rParent.IsCursorInProtectedArea(); break; // "Option/ProtectedArea"
509  }
510  }
511  PutProperties(aNames, aValues);
512 }
513 
515 {
517  Sequence<Any> aValues = GetProperties(aNames);
518  const Any* pValues = aValues.getConstArray();
519  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
520  if(aValues.getLength() == aNames.getLength())
521  {
522 
523  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
524  {
525  if(pValues[nProp].hasValue())
526  {
527  bool bSet = false;
528  sal_Int32 nSet = 0;
529  if(nProp != 1 )
530  bSet = *o3tl::doAccess<bool>(pValues[nProp]);
531  else
532  pValues[nProp] >>= nSet;
533  switch(nProp)
534  {
535  case 0: rParent.SetShadowCursor(bSet); break; // "DirectCursor/UseDirectCursor",
536  case 1: rParent.SetShdwCursorFillMode(static_cast<sal_uInt8>(nSet)); break; // "DirectCursor/Insert",
537  case 2: rParent.SetCursorInProtectedArea(bSet); break; // "Option/ProtectedArea"
538  }
539  }
540  }
541 
542  }
543 }
544 
545 void SwCursorConfig::Notify( const css::uno::Sequence< OUString >& ) {}
546 
548  ConfigItem("Office.WriterWeb/Background", ConfigItemMode::ReleaseTree),
549  rParent(rPar),
550  aPropNames(1)
551 {
552  aPropNames.getArray()[0] = "Color";
553 }
554 
556 {
557 }
558 
560 {
561  Sequence<Any> aValues(aPropNames.getLength());
562  Any* pValues = aValues.getArray();
563  for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
564  {
565  switch(nProp)
566  {
567  case 0: pValues[nProp] <<= rParent.GetRetoucheColor(); break;// "Color",
568  }
569  }
570  PutProperties(aPropNames, aValues);
571 }
572 
573 void SwWebColorConfig::Notify( const css::uno::Sequence< OUString >& ) {}
574 
576 {
577  Sequence<Any> aValues = GetProperties(aPropNames);
578  const Any* pValues = aValues.getConstArray();
579  OSL_ENSURE(aValues.getLength() == aPropNames.getLength(), "GetProperties failed");
580  if(aValues.getLength() == aPropNames.getLength())
581  {
582  for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
583  {
584  if(pValues[nProp].hasValue())
585  {
586  switch(nProp)
587  {
588  case 0:
589  Color nSet;
590  pValues[nProp] >>= nSet; rParent.SetRetoucheColor(nSet);
591  break;// "Color",
592  }
593  }
594  }
595  }
596 }
597 
598 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
void SetLineBreak(bool b)
Definition: viewopt.hxx:249
bool IsSynchronize() const
Definition: viewopt.hxx:352
virtual void ImplCommit() override
Definition: usrpref.cxx:411
SwMasterUsrPref(bool bWeb)
Definition: usrpref.cxx:41
bool IsViewMetaChars() const
Definition: viewopt.hxx:347
bool IsSmoothScroll() const
Definition: viewopt.hxx:375
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:550
FieldUnit
bool const bWeb
Definition: usrpref.hxx:34
bool IsShowScrollBarTips() const
Definition: viewopt.hxx:515
void SetShowContentTips(bool b)
Definition: viewopt.hxx:530
void SetShowScrollBarTips(bool b)
Definition: viewopt.hxx:534
void SetUsrPref(const SwViewOption &rCopy)
Definition: usrpref.cxx:36
void SetSoftHyph(bool b)
Definition: viewopt.hxx:260
css::uno::Sequence< OUString > aPropNames
Definition: usrpref.hxx:110
void SetDivisionX(short n)
Definition: viewopt.hxx:417
virtual void Notify(const css::uno::Sequence< OUString > &rPropertyNames) override
Definition: usrpref.cxx:133
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:478
void SetUpdateFields(bool bSet)
Definition: usrpref.hxx:175
SwLayoutViewConfig(bool bWeb, SwMasterUsrPref &rParent)
Definition: usrpref.cxx:264
bool IsShowContentTips() const
Definition: viewopt.hxx:511
bool IsViewAnyRuler() const
Definition: viewopt.hxx:553
bool IsUpdateCharts() const
Definition: usrpref.hxx:206
sal_uInt8 GetShdwCursorFillMode() const
Definition: viewopt.hxx:610
long Height() const
bool IsGraphic() const
Definition: viewopt.hxx:305
void SetShowInlineTooltips(bool b)
Definition: viewopt.hxx:284
std::unique_ptr< SwWebColorConfig > m_pWebColorConfig
Definition: usrpref.hxx:148
SwMasterUsrPref & rParent
Definition: usrpref.hxx:33
bool IsPostIts() const
Definition: viewopt.hxx:267
ConfigItemMode
virtual ~SwCursorConfig() override
Definition: usrpref.cxx:491
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:454
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
bool IsHardBlank() const
Definition: viewopt.hxx:225
void SetDefaultPageMode(bool bVal, bool bNoModify=false)
Definition: usrpref.hxx:254
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
Definition: usrpref.hxx:262
void SetHardBlank(bool b)
Definition: viewopt.hxx:227
bool IsShowHiddenPara() const
Definition: viewopt.hxx:369
void SetShowHiddenChar(bool b)
Definition: viewopt.hxx:297
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:376
css::uno::Sequence< OUString > GetPropertyNames() const
Definition: usrpref.cxx:79
MeasurementSystem
bool const bWeb
Definition: usrpref.hxx:55
sal_Int32 GetDefTabInMm100() const
Definition: usrpref.hxx:244
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:518
void SetUseHeaderFooterMenu(bool b)
Definition: viewopt.hxx:290
bool IsFieldName() const
Definition: viewopt.hxx:263
const LocaleDataWrapper & GetLocaleData() const
short GetDivisionX() const
Definition: viewopt.hxx:416
void SetCursorInProtectedArea(bool b)
Definition: viewopt.hxx:384
void SetParagraph(bool b)
Definition: viewopt.hxx:233
short GetDivisionY() const
Definition: viewopt.hxx:418
void SetSynchronize(bool b)
Definition: viewopt.hxx:354
static bool IsFuzzing()
int nCount
SwLayoutViewConfig m_aLayoutConfig
Definition: usrpref.hxx:145
SwMasterUsrPref & rParent
Definition: usrpref.hxx:91
void Load()
Definition: usrpref.cxx:434
bool IsViewVScrollBar() const
Definition: viewopt.hxx:491
virtual void ImplCommit() override
Definition: usrpref.cxx:559
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:564
void SetShowHiddenPara(bool b)
Definition: viewopt.hxx:372
virtual ~SwLayoutViewConfig() override
Definition: usrpref.cxx:272
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:219
void SetUpdateCharts(bool bSet)
Definition: usrpref.hxx:195
#define SAL_N_ELEMENTS(arr)
bool IsShadowCursor() const
Definition: viewopt.hxx:593
static css::uno::Sequence< OUString > GetPropertyNames()
Definition: usrpref.cxx:378
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:573
static const auto g_UpdateLinkIndex
Definition: usrpref.cxx:77
SwCursorConfig m_aCursorConfig
Definition: usrpref.hxx:147
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:544
void SetSmoothScroll(bool b)
Definition: viewopt.hxx:378
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:381
bool IsDraw() const
Definition: viewopt.hxx:320
bool IsCrossHair() const
Definition: viewopt.hxx:357
void SetDraw(bool b)
Definition: viewopt.hxx:322
sal_Int32 GetUpdateLinkMode() const
Definition: usrpref.hxx:173
bool PutProperties(const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues)
void SetTable(bool b)
Definition: viewopt.hxx:317
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:451
SwGridConfig(bool bWeb, SwMasterUsrPref &rParent)
Definition: usrpref.cxx:400
void SetShowHiddenField(bool b)
Definition: viewopt.hxx:302
int i
void SetTab(bool b)
Definition: viewopt.hxx:216
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:230
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:545
virtual ~SwWebColorConfig() override
Definition: usrpref.cxx:555
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:578
SwContentViewConfig(bool bWeb, SwMasterUsrPref &rParent)
Definition: usrpref.cxx:120
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:213
void SetViewHRuler(bool b)
Definition: viewopt.hxx:575
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:246
bool IsUpdateFields() const
Definition: usrpref.hxx:186
void SetGraphic(bool b)
Definition: viewopt.hxx:307
SwMasterUsrPref & rParent
Definition: usrpref.hxx:109
void SetViewMetaChars(bool b)
Definition: viewopt.hxx:349
void SetSnapSize(Size const &rSz)
Definition: viewopt.hxx:335
void SetApplyCharUnit(bool bSet, bool noModify=false)
Definition: usrpref.hxx:236
bool IsTable() const
Definition: viewopt.hxx:315
void SetFieldName(bool b)
Definition: viewopt.hxx:264
virtual ~SwGridConfig() override
Definition: usrpref.cxx:407
void SetUpdateLinkMode(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:167
virtual void ImplCommit() override
Definition: usrpref.cxx:138
void SetCrossHair(bool b)
Definition: viewopt.hxx:359
virtual ~SwContentViewConfig() override
Definition: usrpref.cxx:129
static css::uno::Sequence< OUString > GetPropertyNames()
Definition: usrpref.cxx:469
bool IsVRulerRight() const
Definition: viewopt.hxx:599
const PropertyValue * pValues
void SetDivisionY(short n)
Definition: viewopt.hxx:419
void SetViewLayoutBookMode(bool bNew)
Definition: viewopt.hxx:452
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
FieldUnit m_eHScrollMetric
Definition: usrpref.hxx:134
bool IsSquaredPageMode() const
Definition: usrpref.hxx:253
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:467
bool IsShowInlineTooltips() const
Definition: viewopt.hxx:282
virtual void ImplCommit() override
Definition: usrpref.cxx:495
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:551
const Size & GetSnapSize() const
Definition: viewopt.hxx:336
SwGridConfig m_aGridConfig
Definition: usrpref.hxx:146
SwMasterUsrPref & rParent
Definition: usrpref.hxx:73
void SetShdwCursorFillMode(sal_uInt8 nMode)
Definition: viewopt.hxx:611
void SetPostIts(bool b)
Definition: viewopt.hxx:269
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:477
virtual void ImplCommit() override
Definition: usrpref.cxx:276
SwWebColorConfig(SwMasterUsrPref &rParent)
Definition: usrpref.cxx:547
bool m_bIsHScrollMetricSet
Definition: usrpref.hxx:135
void SetViewVScrollBar(bool b)
Definition: viewopt.hxx:522
css::uno::Sequence< OUString > GetPropertyNames() const
Definition: usrpref.cxx:228
bool IsUseHeaderFooterMenu() const
Definition: viewopt.hxx:288
void SetVRulerRight(bool b)
Definition: viewopt.hxx:601
void SetShadowCursor(bool b)
Definition: viewopt.hxx:595
bool IsSoftHyph() const
Definition: viewopt.hxx:258
FieldUnit m_eUserMetric
Definition: usrpref.hxx:133
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:240
void SetSnap(bool b)
Definition: viewopt.hxx:332
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
bool IsGridVisible() const
Definition: viewopt.hxx:338
void SetViewVRuler(bool b)
Definition: viewopt.hxx:589
SwCursorConfig(SwMasterUsrPref &rParent)
Definition: usrpref.cxx:485
FieldUnit m_eVScrollMetric
Definition: usrpref.hxx:136
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:293
void SetViewHScrollBar(bool b)
Definition: viewopt.hxx:524
bool m_bIsVScrollMetricSet
Definition: usrpref.hxx:137
void SetGridVisible(bool b)
Definition: viewopt.hxx:340
bool IsShowHiddenField() const
Definition: viewopt.hxx:300
void SetViewAnyRuler(bool bSet)
Definition: viewopt.hxx:561
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
SwMasterUsrPref & rParent
Definition: usrpref.hxx:54
bool IsSnap() const
Definition: viewopt.hxx:330
SwContentViewConfig m_aContentConfig
Definition: usrpref.hxx:144
bool IsViewHScrollBar() const
Definition: viewopt.hxx:499
void SetShowBookmarks(bool const b)
Definition: viewopt.hxx:236
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:453
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:245
bool IsAlignMathObjectsToBaseline() const
Definition: usrpref.hxx:261
void SetMetric(FieldUnit eSet, bool bNoModify=false)
Definition: usrpref.hxx:209
void SetBlank(bool b)
Definition: viewopt.hxx:222
MeasurementSystem getMeasurementSystemEnum() const