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