LibreOffice Module sw (master)  1
SwXDocumentSettings.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 <config_features.h>
21 
22 #include <sal/config.h>
23 #include <sal/log.hxx>
24 
25 #include <utility>
26 
27 #include <o3tl/any.hxx>
29 #include "SwXDocumentSettings.hxx"
33 #include <com/sun/star/beans/PropertyAttribute.hpp>
34 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
35 #include <com/sun/star/document/PrinterIndependentLayout.hpp>
36 #include <doc.hxx>
40 #include <docsh.hxx>
41 #include <fldupde.hxx>
42 #include <linkenum.hxx>
43 #include <sfx2/printer.hxx>
44 #include <editsh.hxx>
45 #include <drawdoc.hxx>
46 #include <svl/zforlist.hxx>
47 #include <unotxdoc.hxx>
48 #include <cmdid.h>
49 #include <sfx2/zoomitem.hxx>
50 #include <unomod.hxx>
51 #include <vcl/svapp.hxx>
52 #include <svl/asiancfg.hxx>
53 #include <tools/stream.hxx>
54 
55 #include <swmodule.hxx>
56 #include <cfgitems.hxx>
57 #include <prtopt.hxx>
58 #include <dbmgr.hxx>
59 
60 using namespace comphelper;
61 using namespace ::com::sun::star;
62 using namespace ::com::sun::star::uno;
63 using namespace ::com::sun::star::beans;
64 using namespace ::com::sun::star::lang;
65 using namespace ::com::sun::star::i18n;
66 
68 {
97  /* Stampit It disable the print cancel button of the shown progress dialog. */
147 };
148 
150 {
151  static PropertyInfo const aWriterSettingsInfoMap[] =
152  {
153  { OUString("ForbiddenCharacters"), HANDLE_FORBIDDEN_CHARS, cppu::UnoType<css::i18n::XForbiddenCharacters>::get(), 0},
154  { OUString("LinkUpdateMode"), HANDLE_LINK_UPDATE_MODE, cppu::UnoType<sal_Int16>::get(), 0},
155  { OUString("FieldAutoUpdate"), HANDLE_FIELD_AUTO_UPDATE, cppu::UnoType<bool>::get(), 0},
156  { OUString("ChartAutoUpdate"), HANDLE_CHART_AUTO_UPDATE, cppu::UnoType<bool>::get(), 0},
157  { OUString("AddParaTableSpacing"), HANDLE_ADD_PARA_TABLE_SPACING, cppu::UnoType<bool>::get(), 0},
158  { OUString("AddParaTableSpacingAtStart"), HANDLE_ADD_PARA_TABLE_SPACING_AT_START, cppu::UnoType<bool>::get(), 0},
159  { OUString("AlignTabStopPosition"), HANDLE_ALIGN_TAB_STOP_POSITION, cppu::UnoType<bool>::get(), 0},
160  { OUString("PrinterName"), HANDLE_PRINTER_NAME, cppu::UnoType<OUString>::get(), 0},
162  { OUString("PrinterPaperFromSetup"), HANDLE_PRINTER_PAPER, cppu::UnoType<bool>::get(), 0},
163  { OUString("IsKernAsianPunctuation"), HANDLE_IS_KERN_ASIAN_PUNCTUATION, cppu::UnoType<bool>::get(), 0},
164  { OUString("CharacterCompressionType"), HANDLE_CHARACTER_COMPRESSION_TYPE, cppu::UnoType<sal_Int16>::get(), 0},
165  { OUString("ApplyUserData"), HANDLE_APPLY_USER_DATA, cppu::UnoType<bool>::get(), 0 },
166  { OUString("SaveThumbnail"), HANDLE_SAVE_THUMBNAIL, cppu::UnoType<bool>::get(), 0 },
167  { OUString("SaveGlobalDocumentLinks"), HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS, cppu::UnoType<bool>::get(), 0},
168  { OUString("CurrentDatabaseDataSource"), HANDLE_CURRENT_DATABASE_DATA_SOURCE, cppu::UnoType<OUString>::get(), 0},
169  { OUString("CurrentDatabaseCommand"), HANDLE_CURRENT_DATABASE_COMMAND, cppu::UnoType<OUString>::get(), 0},
170  { OUString("CurrentDatabaseCommandType"), HANDLE_CURRENT_DATABASE_COMMAND_TYPE, cppu::UnoType<sal_Int32>::get(), 0},
171  { OUString("EmbeddedDatabaseName"), HANDLE_EMBEDDED_DATABASE_NAME, cppu::UnoType<OUString>::get(), 0},
172  { OUString("SaveVersionOnClose"), HANDLE_SAVE_VERSION_ON_CLOSE, cppu::UnoType<bool>::get(), 0},
173  { OUString("UpdateFromTemplate"), HANDLE_UPDATE_FROM_TEMPLATE, cppu::UnoType<bool>::get(), 0},
174 
175  { OUString("PrinterIndependentLayout"), HANDLE_PRINTER_INDEPENDENT_LAYOUT, cppu::UnoType<sal_Int16>::get(), 0},
176  { OUString("IsLabelDocument"), HANDLE_IS_LABEL_DOC, cppu::UnoType<bool>::get(), 0},
177  { OUString("AddFrameOffsets"), HANDLE_IS_ADD_FLY_OFFSET, cppu::UnoType<bool>::get(), 0},
178  { OUString("AddVerticalFrameOffsets"), HANDLE_IS_ADD_VERTICAL_FLY_OFFSET, cppu::UnoType<bool>::get(), 0},
179  { OUString("AddExternalLeading"), HANDLE_IS_ADD_EXTERNAL_LEADING, cppu::UnoType<bool>::get(), 0},
180  { OUString("UseOldNumbering"), HANDLE_OLD_NUMBERING, cppu::UnoType<bool>::get(), 0},
181  { OUString("OutlineLevelYieldsNumbering"), HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, cppu::UnoType<bool>::get(), 0},
182  /* Stampit It disable the print cancel button of the shown progress dialog. */
183  { OUString("AllowPrintJobCancel"), HANDLE_ALLOW_PRINTJOB_CANCEL, cppu::UnoType<bool>::get(), 0},
184  { OUString("UseFormerLineSpacing"), HANDLE_USE_FORMER_LINE_SPACING, cppu::UnoType<bool>::get(), 0},
185  { OUString("AddParaSpacingToTableCells"), HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS, cppu::UnoType<bool>::get(), 0},
186  { OUString("UseFormerObjectPositioning"), HANDLE_USE_FORMER_OBJECT_POSITIONING, cppu::UnoType<bool>::get(), 0},
187  { OUString("UseFormerTextWrapping"), HANDLE_USE_FORMER_TEXT_WRAPPING, cppu::UnoType<bool>::get(), 0},
188  { OUString("RedlineProtectionKey"), HANDLE_CHANGES_PASSWORD, cppu::UnoType< cppu::UnoSequenceType<sal_Int8> >::get(), 0},
189  { OUString("ConsiderTextWrapOnObjPos"), HANDLE_CONSIDER_WRAP_ON_OBJPOS, cppu::UnoType<bool>::get(), 0},
190  { OUString("IgnoreFirstLineIndentInNumbering"), HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING, cppu::UnoType<bool>::get(), 0},
191  { OUString("DoNotJustifyLinesWithManualBreak"), HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, cppu::UnoType<bool>::get(), 0},
192  { OUString("DoNotResetParaAttrsForNumFont"), HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT, cppu::UnoType<bool>::get(), 0},
193  { OUString("TableRowKeep"), HANDLE_TABLE_ROW_KEEP, cppu::UnoType<bool>::get(), 0},
194  { OUString("IgnoreTabsAndBlanksForLineCalculation"), HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, cppu::UnoType<bool>::get(), 0},
195  { OUString("LoadReadonly"), HANDLE_LOAD_READONLY, cppu::UnoType<bool>::get(), 0},
196  { OUString("DoNotCaptureDrawObjsOnPage"), HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, cppu::UnoType<bool>::get(), 0},
197  { OUString("ClipAsCharacterAnchoredWriterFlyFrames"), HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES, cppu::UnoType<bool>::get(), 0},
198  { OUString("UnxForceZeroExtLeading"), HANDLE_UNIX_FORCE_ZERO_EXT_LEADING, cppu::UnoType<bool>::get(), 0},
199  { OUString("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, cppu::UnoType<bool>::get(), 0},
200  { OUString("TabsRelativeToIndent"), HANDLE_TABS_RELATIVE_TO_INDENT, cppu::UnoType<bool>::get(), 0},
201  { OUString("Rsid"), HANDLE_RSID, cppu::UnoType<sal_Int32>::get(), 0},
202  { OUString("RsidRoot"), HANDLE_RSID_ROOT, cppu::UnoType<sal_Int32>::get(), 0},
203  { OUString("ProtectForm"), HANDLE_PROTECT_FORM, cppu::UnoType<bool>::get(), 0},
204  { OUString("MsWordCompTrailingBlanks"), HANDLE_MS_WORD_COMP_TRAILING_BLANKS, cppu::UnoType<bool>::get(), 0 },
205  { OUString("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, cppu::UnoType<bool>::get(), 0},
207  { OUString("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, cppu::UnoType<bool>::get(), 0},
208  { OUString("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, cppu::UnoType<bool>::get(), 0},
209  { OUString("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, cppu::UnoType<bool>::get(), 0},
210  { OUString("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, cppu::UnoType<bool>::get(), 0},
211  { OUString("TabOverflow"), HANDLE_TAB_OVERFLOW, cppu::UnoType<bool>::get(), 0},
212  { OUString("UnbreakableNumberings"), HANDLE_UNBREAKABLE_NUMBERINGS, cppu::UnoType<bool>::get(), 0},
213  { OUString("StylesNoDefault"), HANDLE_STYLES_NODEFAULT, cppu::UnoType<bool>::get(), 0},
214  { OUString("FloattableNomargins"), HANDLE_FLOATTABLE_NOMARGINS, cppu::UnoType<bool>::get(), 0},
215  { OUString("ClippedPictures"), HANDLE_CLIPPED_PICTURES, cppu::UnoType<bool>::get(), 0},
216  { OUString("BackgroundParaOverDrawings"), HANDLE_BACKGROUND_PARA_OVER_DRAWINGS, cppu::UnoType<bool>::get(), 0},
217  { OUString("EmbedFonts"), HANDLE_EMBED_FONTS, cppu::UnoType<bool>::get(), 0},
218  { OUString("EmbedOnlyUsedFonts"), HANDLE_EMBED_USED_FONTS, cppu::UnoType<bool>::get(), 0},
219  { OUString("EmbedLatinScriptFonts"), HANDLE_EMBED_LATIN_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0},
220  { OUString("EmbedAsianScriptFonts"), HANDLE_EMBED_ASIAN_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0},
221  { OUString("EmbedComplexScriptFonts"), HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0},
222  { OUString("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType<bool>::get(), 0},
223  { OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType<bool>::get(), 0},
224  { OUString("TreatSingleColumnBreakAsPageBreak"), HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, cppu::UnoType<bool>::get(), 0},
225  { OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0},
226  { OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0},
227  { OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType<bool>::get(), 0},
228  { OUString("SubtractFlysAnchoredAtFlys"), HANDLE_SUBTRACT_FLYS, cppu::UnoType<bool>::get(), 0},
229  { OUString("DisableOffPagePositioning"), HANDLE_DISABLE_OFF_PAGE_POSITIONING, cppu::UnoType<bool>::get(), 0},
230  { OUString("EmptyDbFieldHidesPara"), HANDLE_EMPTY_DB_FIELD_HIDES_PARA, cppu::UnoType<bool>::get(), 0 },
231  { OUString("ContinuousEndnotes"), HANDLE_CONTINUOUS_ENDNOTES, cppu::UnoType<bool>::get(), 0 },
232 /*
233  * As OS said, we don't have a view when we need to set this, so I have to
234  * find another solution before adding them to this property set - MTG
235  { OUString("IsGridVisible"), HANDLE_IS_GRID_VISIBLE, cppu::UnoType<bool>::get(), 0, 0},
236  { OUString("IsSnapToGrid"), HANDLE_IS_SNAP_TO_GRID, cppu::UnoType<bool>::get(), 0, 0},
237  { OUString("IsSynchroniseAxes"), HANDLE_IS_SYNCHRONISE_AXES, cppu::UnoType<bool>::get(), 0, 0},
238  { OUString("HorizontalGridResolution"), HANDLE_HORIZONTAL_GRID_RESOLUTION, cppu::UnoType<sal_Int32>::get(), 0, 0},
239  { OUString("HorizontalGridSubdivision"), HANDLE_HORIZONTAL_GRID_SUBDIVISION, cppu::UnoType<sal_Int16>::get(), 0, 0},
240  { OUString("VerticalGridResolution"), HANDLE_VERTICAL_GRID_RESOLUTION, cppu::UnoType<sal_Int32>::get(), 0, 0},
241  { OUString("VerticalGridSubdivision"), HANDLE_VERTICAL_GRID_SUBDIVISION, cppu::UnoType<sal_Int16>::get(), 0, 0},
242 
243  { OUString("ShowParagraphEnd"), HANDLE_SHOW_PARAGRAPH_END, cppu::UnoType<bool>::get(), 0, 0},
244  { OUString("ShowOptionalHyphens"), HANDLE_SHOW_OPTIONAL_HYPHENS, cppu::UnoType<bool>::get(), 0, 0},
245  { OUString("ShowSpaces"), HANDLE_SHOW_SPACES, cppu::UnoType<bool>::get(), 0, 0},
246  { OUString("ShowTabs"), HANDLE_SHOW_TABS, cppu::UnoType<bool>::get(), 0, 0},
247  { OUString("ShowBreaks"), HANDLE_SHOW_BREAKS, cppu::UnoType<bool>::get(), 0, 0},
248  { OUString("ShowHiddenText"), HANDLE_SHOW_HIDDEN_TEXT, cppu::UnoType<bool>::get(), 0, 0},
249  { OUString("ShowHiddenParagraphs"), HANDLE_SHOW_HIDDEN_PARAGRAPHS, cppu::UnoType<bool>::get(), 0, 0},
250 
251  { OUString("ShowTextLimitGuide"), HANDLE_SHOW_TEXT_LIMIT_GUIDE, cppu::UnoType<bool>::get(), 0, 0},
252  { OUString("ShowTableLimitGuide"), HANDLE_SHOW_TABLE_LIMIT_GUIDE, cppu::UnoType<bool>::get(), 0, 0},
253  { OUString("ShowSectionLimitGuide"), HANDLE_SHOW_SECTION_LIMIT_GUIDE, cppu::UnoType<bool>::get(), 0, 0},
254  { OUString("ShowGuidesWhileMoving"), HANDLE_SHOW_GUIDES_WHILE_MOVING, cppu::UnoType<bool>::get(), 0, 0},
255 */
256  { OUString(), 0, css::uno::Type(), 0}
257  };
258  return new MasterPropertySetInfo ( aWriterSettingsInfoMap );
259 }
260 
263  &Application::GetSolarMutex () )
264 , mpModel ( pModel )
265 , mpDocSh ( nullptr )
266 , mpDoc ( nullptr )
267 , mpPrinter( nullptr )
268 , mbPreferPrinterPapersize( false )
269 {
271 }
272 
274  throw()
275 {
276 }
277 
279 {
280  return ::cppu::queryInterface(rType,
281  // OWeakObject interfaces
282  &dynamic_cast<XInterface&>(dynamic_cast<OWeakObject&>(*this)),
283  &dynamic_cast<XWeak&>(*this),
284  // my own interfaces
285  &dynamic_cast<XPropertySet&>(*this),
286  &dynamic_cast<XPropertyState&>(*this),
287  &dynamic_cast<XMultiPropertySet&>(*this),
288  &dynamic_cast<XServiceInfo&>(*this),
289  &dynamic_cast<XTypeProvider&>(*this));
290 }
292  throw ()
293 {
294  OWeakObject::acquire();
295 }
297  throw ()
298 {
299  OWeakObject::release();
300 }
301 
302 uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( )
303 {
304  static const uno::Sequence< uno::Type > aTypes {
305  // from MasterPropertySet
311  };
312  return aTypes;
313 }
314 
315 uno::Sequence< sal_Int8 > SAL_CALL SwXDocumentSettings::getImplementationId( )
316 {
317  return css::uno::Sequence<sal_Int8>();
318 }
319 
321 {
323  if (nullptr == mpDocSh)
324  throw UnknownPropertyException();
325 
326  mpDoc = mpDocSh->GetDoc();
327  if (nullptr == mpDoc)
328  throw UnknownPropertyException();
329 }
330 
332 {
333  if (rInfo.mnAttributes & PropertyAttribute::READONLY)
334  throw PropertyVetoException ("Property is read-only: " + rInfo.maName, static_cast < cppu::OWeakObject * > ( nullptr ) );
335 
336  switch( rInfo.mnHandle )
337  {
339  break;
341  {
342  sal_Int16 nMode = 0;
343  rValue >>= nMode;
344  switch (nMode)
345  {
346  case NEVER:
347  case MANUAL:
348  case AUTOMATIC:
349  case GLOBALSETTING:
350  break;
351  default:
352  throw IllegalArgumentException();
353  }
355  }
356  break;
358  {
359  bool bUpdateField = *o3tl::doAccess<bool>(rValue);
362  nFlag == AUTOUPD_FIELD_AND_CHARTS ?
365  AUTOUPD_OFF );
366  }
367  break;
369  {
370  bool bUpdateChart = *o3tl::doAccess<bool>(rValue);
373  bUpdateChart ?
376  AUTOUPD_OFF );
377  }
378  break;
380  {
381  bool bParaSpace = false;
382  rValue >>= bParaSpace;
384  }
385  break;
387  {
388  bool bParaSpacePage = false;
389  rValue >>= bParaSpacePage;
391  }
392  break;
394  {
395  bool bAlignTab = *o3tl::doAccess<bool>(rValue);
397  }
398  break;
399  case HANDLE_PRINTER_NAME:
400  {
401  //the printer must be created
402  OUString sPrinterName;
403  if( !(rValue >>= sPrinterName) )
404  throw IllegalArgumentException();
405 
406  if( !mpPrinter && !sPrinterName.isEmpty() && mpDocSh->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
407  {
408  SfxPrinter* pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( true );
409  if ( pPrinter->GetName() != sPrinterName )
410  {
411  VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
412  assert (! pNewPrinter->isDisposed() );
413  if( pNewPrinter->IsKnown() )
414  {
415  // set printer only once; in _postSetValues
416  mpPrinter = pNewPrinter;
417  }
418  else
419  {
420  pNewPrinter.disposeAndClear();
421  }
422  }
423  }
424 
425  }
426  break;
428  {
429  Sequence < sal_Int8 > aSequence;
430  if ( !(rValue >>= aSequence) )
431  throw IllegalArgumentException();
432 
433  sal_uInt32 nSize = aSequence.getLength();
434  if( nSize > 0 )
435  {
436  SvMemoryStream aStream (aSequence.getArray(), nSize,
437  StreamMode::READ );
438  aStream.Seek ( STREAM_SEEK_TO_BEGIN );
439  static sal_uInt16 const nRange[] =
440  {
442  SID_HTML_MODE, SID_HTML_MODE,
443  SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
444  SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
445  0
446  };
447  auto pItemSet = std::make_unique<SfxItemSet>( mpDoc->GetAttrPool(), nRange );
448  VclPtr<SfxPrinter> pPrinter = SfxPrinter::Create ( aStream, std::move(pItemSet) );
449  assert (! pPrinter->isDisposed() );
450  // set printer only once; in _postSetValues
452  mpPrinter = pPrinter;
453  }
454 
455  }
456  break;
458  {
459  bool bPreferPrinterPapersize;
460  if(!(rValue >>= bPreferPrinterPapersize))
461  throw IllegalArgumentException();
462  mbPreferPrinterPapersize = bPreferPrinterPapersize;
463  }
464  break;
466  {
467  bool bIsKern = *o3tl::doAccess<bool>(rValue);
469  SwEditShell* pEditSh = mpDoc->GetEditShell();
470  if(pEditSh)
471  pEditSh->ChgHyphenation();
472  }
473  break;
475  {
476  sal_Int16 nMode = 0;
477  rValue >>= nMode;
478  switch (static_cast<CharCompressType>(nMode))
479  {
480  case CharCompressType::NONE:
481  case CharCompressType::PunctuationOnly:
482  case CharCompressType::PunctuationAndKana:
483  break;
484  default:
485  throw IllegalArgumentException();
486  }
487  mpDoc->getIDocumentSettingAccess().setCharacterCompressionType(static_cast<CharCompressType>(nMode));
488  }
489  break;
491  {
492  mpDocSh->SetUseUserData(*o3tl::doAccess<bool>(rValue));
493  }
494  break;
496  {
497  mpDocSh->SetUseThumbnailSave(*o3tl::doAccess<bool>(rValue));
498  }
499  break;
501  {
502  bool bSaveGlobal = *o3tl::doAccess<bool>(rValue);
504  }
505  break;
507  {
509  if ( rValue >>= aData.sDataSource )
510  mpDoc->ChgDBData( aData );
511  }
512  break;
514  {
516 
517  if ( rValue >>= aData.sCommand )
518  mpDoc->ChgDBData( aData );
519 
520  SAL_WARN_IF( aData.sDataSource.isEmpty() && !aData.sCommand.isEmpty(), "sw.uno",
521  "\"CurrentDatabaseCommand\" property possibly set before \"CurrentDatabaseDataSource\"" );
522  }
523  break;
525  {
527  if ( rValue >>= aData.nCommandType )
528  mpDoc->ChgDBData( aData );
529  SAL_WARN_IF( aData.nCommandType && aData.sDataSource.isEmpty(), "sw.uno",
530  "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseDataSource\"" );
531  SAL_WARN_IF( aData.nCommandType && aData.sCommand.isEmpty(), "sw.uno",
532  "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseCommand\"" );
533  }
534  break;
536  {
537 #if HAVE_FEATURE_DBCONNECTIVITY
538  OUString sEmbeddedName;
539  if (rValue >>= sEmbeddedName)
540  mpDoc->GetDBManager()->setEmbeddedName(sEmbeddedName, *mpDocSh);
541 #endif
542  }
543  break;
545  {
546  mpDocSh->SetSaveVersionOnClose( *o3tl::doAccess<bool>(rValue) );
547  }
548  break;
550  {
551  mpDocSh->SetQueryLoadTemplate( *o3tl::doAccess<bool>(rValue) );
552  }
553  break;
555  {
556  sal_Int16 nTmp = 0;
557  rValue >>= nTmp;
558 
559  bool bUseVirDev = true;
560  bool bHiResVirDev = true;
561  if( nTmp == document::PrinterIndependentLayout::DISABLED )
562  bUseVirDev = false;
563  else if ( nTmp == document::PrinterIndependentLayout::LOW_RESOLUTION )
564  bHiResVirDev = false;
565  else if ( nTmp != document::PrinterIndependentLayout::HIGH_RESOLUTION )
566  throw IllegalArgumentException();
567 
568  mpDoc->getIDocumentDeviceAccess().setReferenceDeviceType( bUseVirDev, bHiResVirDev );
569  }
570  break;
571  case HANDLE_IS_LABEL_DOC :
572  {
573  bool bSet = false;
574  if(!(rValue >>= bSet))
575  throw IllegalArgumentException();
577  }
578  break;
580  {
581  bool bTmp = *o3tl::doAccess<bool>(rValue);
583  }
584  break;
586  {
587  bool bTmp = *o3tl::doAccess<bool>(rValue);
589  }
590  break;
592  {
593  bool bTmp = *o3tl::doAccess<bool>(rValue);
595  }
596  break;
598  {
599  bool bTmp = *o3tl::doAccess<bool>(rValue);
601  }
602  break;
604  {
605  // ignore - this is a dead property
606  }
607  break;
609  {
610  bool bState = false;
611  if (!(rValue >>= bState))
612  throw IllegalArgumentException();
614  }
615  break;
617  {
618  bool bTmp = *o3tl::doAccess<bool>(rValue);
620  }
621  break;
623  {
624  bool bTmp = *o3tl::doAccess<bool>(rValue);
626  }
627  break;
629  {
630  bool bTmp = *o3tl::doAccess<bool>(rValue);
632  }
633  break;
635  {
636  bool bTmp = *o3tl::doAccess<bool>(rValue);
638  }
639  break;
641  {
642  Sequence <sal_Int8> aNew;
643  if(rValue >>= aNew)
644  {
646  if(aNew.hasElements())
647  {
649  eMode |= RedlineFlags::On;
651  }
652  }
653  }
654  break;
656  {
657  bool bTmp = *o3tl::doAccess<bool>(rValue);
659  }
660  break;
662  {
663  bool bTmp = *o3tl::doAccess<bool>(rValue);
665  }
666  break;
668  {
669  bool bTmp = *o3tl::doAccess<bool>(rValue);
671  }
672  break;
674  {
675  bool bTmp = *o3tl::doAccess<bool>(rValue);
677  }
678  break;
680  {
681  bool bTmp = *o3tl::doAccess<bool>(rValue);
683  }
684  break;
686  {
687  bool bTmp = *o3tl::doAccess<bool>(rValue);
689  }
690  break;
692  {
693  mpDocSh->SetLoadReadonly( *o3tl::doAccess<bool>(rValue) );
694  }
695  break;
697  {
698  bool bTmp = *o3tl::doAccess<bool>(rValue);
700  }
701  break;
703  {
704  bool bTmp = *o3tl::doAccess<bool>(rValue);
706  }
707  break;
709  {
710  bool bTmp = *o3tl::doAccess<bool>(rValue);
712  }
713  break;
715  // ignore - this is a dead property
716  break;
718  {
719  bool bTmp = *o3tl::doAccess<bool>(rValue);
721  }
722  break;
723  case HANDLE_RSID:
724  {
725  sal_uInt32 nTmp = 0;
726  rValue >>= nTmp;
727  mpDoc->setRsid( nTmp );
728  }
729  break;
730  case HANDLE_RSID_ROOT:
731  {
732  sal_uInt32 nTmp = 0;
733  rValue >>= nTmp;
734  mpDoc->setRsidRoot( nTmp );
735  }
736  break;
737  case HANDLE_PROTECT_FORM:
738  {
739  bool bTmp = *o3tl::doAccess<bool>(rValue);
741  }
742  break;
744  {
745  bool bTmp = *o3tl::doAccess<bool>(rValue);
747  }
748  break;
750  {
751  bool bTmp = *o3tl::doAccess<bool>(rValue);
753  }
754  break;
756  {
757  uno::Sequence< beans::PropertyValue > aInfo;
758  if ( !( rValue >>= aInfo ) )
759  throw lang::IllegalArgumentException(
760  "Value of type Sequence<PropertyValue> expected!",
761  uno::Reference< uno::XInterface >(),
762  2 );
763 
764  if ( !mpDocSh->SetModifyPasswordInfo( aInfo ) )
765  throw beans::PropertyVetoException(
766  "The hash is not allowed to be changed now!",
767  uno::Reference< uno::XInterface >() );
768  }
769  break;
771  {
772  bool bTmp = *o3tl::doAccess<bool>(rValue);
774  }
775  break;
777  {
778  bool bTmp = *o3tl::doAccess<bool>(rValue);
780  }
781  break;
783  {
784  bool bTmp = *o3tl::doAccess<bool>(rValue);
786  }
787  break;
789  {
790  bool bTmp = *o3tl::doAccess<bool>(rValue);
792  }
793  break;
794  case HANDLE_TAB_OVERFLOW:
795  {
796  bool bTmp = *o3tl::doAccess<bool>(rValue);
798  }
799  break;
801  {
802  bool bTmp = *o3tl::doAccess<bool>(rValue);
804  }
805  break;
807  {
808  bool bTmp = *o3tl::doAccess<bool>(rValue);
810  }
811  break;
813  {
814  bool bTmp = *o3tl::doAccess<bool>(rValue);
816  }
817  break;
819  {
820  bool bTmp = *o3tl::doAccess<bool>(rValue);
822  }
823  break;
825  {
826  bool bTmp = *o3tl::doAccess<bool>(rValue);
828  }
829  break;
830  case HANDLE_EMBED_FONTS:
831  {
832  bool bTmp = *o3tl::doAccess<bool>(rValue);
834  }
835  break;
837  {
838  bool bTmp = *o3tl::doAccess<bool>(rValue);
840  }
841  break;
843  {
844  bool bTmp = *o3tl::doAccess<bool>(rValue);
846  }
847  break;
849  {
850  bool bTmp = *o3tl::doAccess<bool>(rValue);
852  }
853  break;
855  {
856  bool bTmp = *o3tl::doAccess<bool>(rValue);
858  }
859  break;
861  {
862  bool bTmp = *o3tl::doAccess<bool>(rValue);
864  }
865  break;
867  {
868  bool bTmp = *o3tl::doAccess<bool>(rValue);
870  }
871  break;
873  {
874  bool bTmp = *o3tl::doAccess<bool>(rValue);
876  }
877  break;
879  {
880  bool bTmp = *o3tl::doAccess<bool>(rValue);
882  }
883  break;
885  {
886  bool bTmp = *o3tl::doAccess<bool>(rValue);
888  }
889  break;
891  {
892  bool bTmp;
893  if (rValue >>= bTmp)
894  {
897  }
898  }
899  break;
901  {
902  bool bTmp;
903  if (rValue >>= bTmp)
904  {
907  }
908  }
909  break;
911  {
912  bool bTmp;
913  if (rValue >>= bTmp)
914  {
917  }
918  }
919  break;
921  {
922  bool bTmp;
923  if (rValue >>= bTmp)
924  {
926  bTmp);
927  }
928  }
929  break;
931  {
932  bool bTmp;
933  if (rValue >>= bTmp)
934  {
936  bTmp);
937  }
938  }
939  break;
940  default:
941  throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
942  }
943 }
944 
946 {
947  // set printer only once, namely here!
948  if( mpPrinter != nullptr )
949  {
950  // #i86352# the printer is also used as container for options by sfx
951  // when setting a printer it should have decent default options
952  SfxItemSet aOptions( mpPrinter->GetOptions() );
954  SwAddPrinterItem aAddPrinterItem (aPrtData);
955  aOptions.Put(aAddPrinterItem);
956  mpPrinter->SetOptions( aOptions );
957  mpPrinter->SetPrinterSettingsPreferred( mbPreferPrinterPapersize );
958 
960  }
961 
962  mpPrinter = nullptr;
963  mpDocSh = nullptr;
964  mpDoc = nullptr;
965 }
966 
968 {
970  if (nullptr == mpDocSh)
971  throw UnknownPropertyException();
972  mpDoc = mpDocSh->GetDoc();
973  if (nullptr == mpDoc)
974  throw UnknownPropertyException();
975 }
976 
978 {
979  switch( rInfo.mnHandle )
980  {
982  {
983  Reference<XForbiddenCharacters> xRet(*mpModel->GetPropertyHelper(), UNO_QUERY);
984  rValue <<= xRet;
985  }
986  break;
988  {
989  rValue <<= static_cast < sal_Int16 > ( mpDoc->getIDocumentSettingAccess().getLinkUpdateMode(true) );
990  }
991  break;
993  {
995  rValue <<= nFlags == AUTOUPD_FIELD_ONLY || nFlags == AUTOUPD_FIELD_AND_CHARTS;
996  }
997  break;
999  {
1001  rValue <<= nFlags == AUTOUPD_FIELD_AND_CHARTS;
1002  }
1003  break;
1005  {
1007  }
1008  break;
1010  {
1012  }
1013  break;
1015  {
1017  }
1018  break;
1019  case HANDLE_PRINTER_NAME:
1020  {
1021  SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
1022  rValue <<= pPrinter ? pPrinter->GetName() : OUString();
1023  }
1024  break;
1025  case HANDLE_PRINTER_SETUP:
1026  {
1027  SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
1028  if (pPrinter)
1029  {
1030  SvMemoryStream aStream;
1031  pPrinter->Store( aStream );
1032  sal_uInt32 nSize = aStream.TellEnd();
1033  aStream.Seek ( STREAM_SEEK_TO_BEGIN );
1034  Sequence < sal_Int8 > aSequence( nSize );
1035  aStream.ReadBytes(aSequence.getArray(), nSize);
1036  rValue <<= aSequence;
1037  }
1038  else
1039  {
1040  Sequence < sal_Int8 > aSequence ( 0 );
1041  rValue <<= aSequence;
1042  }
1043  }
1044  break;
1045  case HANDLE_PRINTER_PAPER:
1046  {
1047  SfxPrinter *pTempPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
1048  rValue <<= pTempPrinter && pTempPrinter->GetPrinterSettingsPreferred();
1049  }
1050  break;
1052  {
1054  }
1055  break;
1057  {
1058  rValue <<= mpDocSh->IsUseUserData();
1059  }
1060  break;
1061  case HANDLE_SAVE_THUMBNAIL:
1062  {
1063  rValue <<= mpDocSh->IsUseThumbnailSave();
1064  }
1065  break;
1067  {
1068  rValue <<= static_cast < sal_Int16 > (mpDoc->getIDocumentSettingAccess().getCharacterCompressionType());
1069  }
1070  break;
1072  {
1074  }
1075  break;
1077  {
1078  const SwDBData& rData = mpDoc->GetDBDesc();
1079  rValue <<= rData.sDataSource;
1080  }
1081  break;
1083  {
1084  const SwDBData& rData = mpDoc->GetDBDesc();
1085  rValue <<= rData.sCommand;
1086  }
1087  break;
1089  {
1090  const SwDBData& rData = mpDoc->GetDBDesc();
1091  rValue <<= rData.nCommandType;
1092  }
1093  break;
1095  {
1096 #if HAVE_FEATURE_DBCONNECTIVITY
1097  rValue <<= mpDoc->GetDBManager()->getEmbeddedName();
1098 #else
1099  rValue = uno::Any();
1100 #endif
1101  }
1102  break;
1104  {
1105  rValue <<= mpDocSh->IsSaveVersionOnClose();
1106  }
1107  break;
1109  {
1110  rValue <<= mpDocSh->IsQueryLoadTemplate();
1111  }
1112  break;
1114  {
1115  // returns short (see css.document.PrinterIndependentLayout)
1118  document::PrinterIndependentLayout::HIGH_RESOLUTION :
1119  document::PrinterIndependentLayout::LOW_RESOLUTION ) :
1120  document::PrinterIndependentLayout::DISABLED;
1121  rValue <<= nVirDevType;
1122  }
1123  break;
1124  case HANDLE_IS_LABEL_DOC:
1125  {
1127  rValue <<= bLabel;
1128  }
1129  break;
1131  {
1133  }
1134  break;
1136  {
1138  }
1139  break;
1141  {
1143  }
1144  break;
1145  case HANDLE_OLD_NUMBERING:
1146  {
1148  }
1149  break;
1151  {
1152  rValue <<= false;
1153  }
1154  break;
1156  {
1157  rValue <<= mpDocSh->Stamp_GetPrintCancelState();
1158  }
1159  break;
1161  {
1163  }
1164  break;
1166  {
1168  }
1169  break;
1171  {
1173  }
1174  break;
1176  {
1178  }
1179  break;
1181  {
1183  }
1184  break;
1186  {
1188  }
1189  break;
1191  {
1193  }
1194  break;
1196  {
1198  }
1199  break;
1201  {
1203  }
1204  break;
1205  case HANDLE_TABLE_ROW_KEEP :
1206  {
1208  }
1209  break;
1211  {
1213  }
1214  break;
1215  case HANDLE_LOAD_READONLY:
1216  {
1217  rValue <<= mpDocSh->IsLoadReadonly();
1218  }
1219  break;
1221  {
1223  }
1224  break;
1226  {
1228  }
1229  break;
1231  {
1233  }
1234  break;
1236  {
1237  rValue <<= false;
1238  }
1239  break;
1241  {
1243  }
1244  break;
1245  case HANDLE_RSID:
1246  {
1247  rValue <<= static_cast < sal_Int32 > ( mpDoc->getRsid() );
1248  }
1249  break;
1250  case HANDLE_RSID_ROOT:
1251  {
1252  rValue <<= static_cast < sal_Int32 > ( mpDoc->getRsidRoot() );
1253  }
1254  break;
1255  case HANDLE_PROTECT_FORM:
1256  {
1258  }
1259  break;
1261  {
1263  }
1264  break;
1266  {
1268  }
1269  break;
1271  {
1272  rValue <<= mpDocSh->GetModifyPasswordInfo();
1273  }
1274  break;
1276  {
1278  }
1279  break;
1281  {
1283  }
1284  break;
1286  {
1288  }
1289  break;
1291  {
1293  }
1294  break;
1295  case HANDLE_TAB_OVERFLOW:
1296  {
1298  }
1299  break;
1301  {
1303  }
1304  break;
1306  {
1308  }
1309  break;
1311  {
1313  }
1314  break;
1316  {
1318  }
1319  break;
1321  {
1323  }
1324  break;
1325  case HANDLE_EMBED_FONTS:
1326  {
1328  }
1329  break;
1331  {
1333  }
1334  break;
1336  {
1338  }
1339  break;
1341  {
1343  }
1344  break;
1346  {
1348  }
1349  break;
1351  {
1353  }
1354  break;
1356  {
1358  }
1359  break;
1361  {
1363  }
1364  break;
1366  {
1368  }
1369  break;
1371  {
1373  }
1374  break;
1376  {
1378  }
1379  break;
1380  case HANDLE_SUBTRACT_FLYS:
1381  {
1383  }
1384  break;
1386  {
1388  }
1389  break;
1391  {
1392  rValue <<= mpDoc->getIDocumentSettingAccess().get(
1394  }
1395  break;
1397  {
1398  rValue
1400  }
1401  break;
1402  default:
1403  throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
1404  }
1405 }
1406 
1408 {
1409  mpDocSh = nullptr;
1410  mpDoc = nullptr;
1411 }
1412 
1413 // XServiceInfo
1415 {
1416  return "SwXDocumentSettings";
1417 }
1418 
1419 sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceName )
1420 {
1421  return cppu::supportsService(this, ServiceName);
1422 }
1423 
1425 {
1426  return { "com.sun.star.document.Settings", "com.sun.star.text.DocumentSettings", "com.sun.star.text.PrintSettings" };
1427 }
1428 
1429 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Type
virtual void _postSetValues() override
virtual void SAL_CALL release() override
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
void ChgDBData(const SwDBData &rNewData)
Definition: doc.cxx:452
bool IsUseUserData() const
SwFieldUpdateFlags
Definition: fldupde.hxx:22
virtual OUString SAL_CALL getImplementationName() override
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
static MasterPropertySetInfo * lcl_createSettingsInfo()
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:237
sal_uInt32 getRsidRoot() const
Definition: doc.cxx:215
OUString sDataSource
Definition: swdbdata.hxx:30
void disposeAndClear()
virtual void setReferenceDeviceType(bool bNewVirtual, bool bNewHiRes)=0
Sets the type of the reference device used for formatting the document.
SwXDocumentPropertyHelper * GetPropertyHelper()
Definition: unotxdoc.cxx:461
virtual void setFieldUpdateFlags(SwFieldUpdateFlags nMode)=0
Set the current field update mode.
sal_uInt64 Seek(sal_uInt64 nPos)
const ScDocument * mpDoc
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:743
virtual sal_uInt64 TellEnd() override
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
virtual void SAL_CALL acquire() override
sal_Int16 const mnAttributes
virtual void setCharacterCompressionType(CharCompressType nType)=0
Set the character compression type for Asian characters.
virtual void _preGetValues() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void setEmbeddedName(const OUString &rEmbeddedName, SwDocShell &rDocShell)
Definition: dbmgr.cxx:3185
sal_uInt32 getRsid() const
Definition: doc.cxx:195
virtual SwFieldUpdateFlags getFieldUpdateFlags(bool bGlobalSettings) const =0
Get the current field update mode.
SwXDocumentSettings(SwXTextDocument *pModel)
RedlineFlags on.
SfxObjectCreateMode GetCreateMode() const
const SwDBData & GetDBDesc()
Definition: docfld.cxx:347
SwDocumentSettingsPropertyHandles
void registerSlave(ChainablePropertySet *pNewSet)
virtual CharCompressType getCharacterCompressionType() const =0
Get the character compression type for Asian characters.
const SfxItemSet & GetOptions() const
void ChgHyphenation()
Definition: viewsh.hxx:211
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
SwDBData const & GetDBData()
Definition: docfld.cxx:342
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
#define STREAM_SEEK_TO_BEGIN
virtual ~SwXDocumentSettings() override
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:317
bool Stamp_GetPrintCancelState() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_uInt16 getLinkUpdateMode(bool bGlobalSettings) const =0
Get the current link update mode.
const css::uno::Sequence< css::beans::PropertyValue > & GetModifyPasswordInfo() const
static VclPtr< SfxPrinter > Create(SvStream &rStream, std::unique_ptr< SfxItemSet > &&pOptions)
virtual void _getSingleValue(const comphelper::PropertyInfo &rInfo, css::uno::Any &rValue) override
void SetSaveVersionOnClose(bool bSet)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
unsigned char sal_Bool
void setRsidRoot(sal_uInt32 nVal)
Definition: doc.cxx:220
SwDocShell * GetDocShell()
Definition: unotxdoc.hxx:463
virtual void _setSingleValue(const comphelper::PropertyInfo &rInfo, const css::uno::Any &rValue) override
css::uno::Type const & get()
void SetUseThumbnailSave(bool _bNew)
SwXTextDocument * mpModel
GUIDCNamePair const aData
void SetUseUserData(bool bNew)
void Store(SvStream &rStream) const
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
std::size_t ReadBytes(void *pData, std::size_t nSize)
void setRsid(sal_uInt32 nVal)
Definition: doc.cxx:200
virtual void _postGetValues() override
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
AUTOMATIC
bool IsUseThumbnailSave() const
#define SAL_WARN_IF(condition, area, stream)
bool IsQueryLoadTemplate() const
bool IsSaveVersionOnClose() const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
bool SetModifyPasswordInfo(const css::uno::Sequence< css::beans::PropertyValue > &aInfo)
virtual void setLinkUpdateMode(sal_uInt16 nMode)=0
Set the current link update mode.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
void SetLoadReadonly(bool _bReadonly)
void SetQueryLoadTemplate(bool b)
bool IsLoadReadonly() const
void Stamp_SetPrintCancelState(bool bState)
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
VclPtr< SfxPrinter > mpPrinter
the printer should be set only once; since there are several printer-related properties, remember the last printer and set it in _postSetValues
OUString sCommand
Definition: swdbdata.hxx:31
sal_Int32 const mnHandle
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
SwDBManager * GetDBManager() const
Definition: doc.hxx:663
void SetOptions(const SfxItemSet &rNewOptions)
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1309
virtual void _preSetValues() override
const OUString & getEmbeddedName() const
Definition: dbmgr.cxx:3206