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