LibreOffice Module sw (master)  1
DocumentSettingManager.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 <libxml/xmlwriter.h>
21 
23 #include <doc.hxx>
25 #include <IDocumentState.hxx>
29 #include <svx/svdmodel.hxx>
30 #include <svl/asiancfg.hxx>
32 #include <unotools/configmgr.hxx>
33 #include <drawdoc.hxx>
34 #include <swmodule.hxx>
35 #include <linkenum.hxx>
36 #include <rootfrm.hxx>
37 #include <breakit.hxx>
38 #include <docary.hxx>
39 
40 /* IDocumentSettingAccess */
41 
43  :m_rDoc(rDoc),
44  mnLinkUpdMode( GLOBALSETTING ),
45  meFieldUpdMode( AUTOUPD_GLOBALSETTING ),
46  meChrCmprType( CharCompressType::NONE ),
47  mn32DummyCompatibilityOptions1(0),
48  mn32DummyCompatibilityOptions2(0),
49  mbHTMLMode(false),
50  mbIsGlobalDoc(false),
51  mbGlblDocSaveLinks(false),
52  mbIsLabelDoc(false),
53  mbPurgeOLE(true),
54  mbKernAsianPunctuation(false),
55 
56  // COMPATIBILITY FLAGS START
57 
58  mbAddFlyOffsets(false),
59  mbAddVerticalFlyOffsets(false),
60  mbUseHiResolutionVirtualDevice(true),
61  mbMathBaselineAlignment(false), // default for *old* documents is 'off'
62  mbStylesNoDefault(false),
63  mbFloattableNomargins(false),
64  mEmbedFonts(false),
65  mEmbedUsedFonts(false),
66  mEmbedLatinScriptFonts(true),
67  mEmbedAsianScriptFonts(true),
68  mEmbedComplexScriptFonts(true),
69  mEmbedSystemFonts(false),
70  mbOldNumbering(false),
71  mbIgnoreFirstLineIndentInNumbering(false),
72  mbDoNotResetParaAttrsForNumFont(false),
73  mbTableRowKeep(false),
74  mbIgnoreTabsAndBlanksForLineCalculation(false),
75  mbDoNotCaptureDrawObjsOnPage(false),
76  mbClipAsCharacterAnchoredWriterFlyFrames(false),
77  mbUnixForceZeroExtLeading(false),
78  mbTabRelativeToIndent(true),
79  mbProtectForm(false), // i#78591#
80  mbMsWordCompTrailingBlanks(false), // tdf#104349 tdf#104668
81  mbInvertBorderSpacing (false),
82  mbCollapseEmptyCellPara(true),
83  mbTabAtLeftIndentForParagraphsInList(false), //#i89181#
84  mbSmallCapsPercentage66(false),
85  mbTabOverflow(true),
86  mbUnbreakableNumberings(false),
87  mbClippedPictures(false),
88  mbBackgroundParaOverDrawings(false),
89  mbTabOverMargin(false),
90  mbTreatSingleColumnBreakAsPageBreak(false),
91  mbSurroundTextWrapSmall(false),
92  mbPropLineSpacingShrinksFirstLine(true),
93  mbSubtractFlys(false),
94  mApplyParagraphMarkFormatToNumbering(false),
95  mbLastBrowseMode( false ),
96  mbDisableOffPagePositioning ( false ),
97  mbProtectBookmarks(false),
98  mbProtectFields(false)
99 
100  // COMPATIBILITY FLAGS END
101 {
102  // COMPATIBILITY FLAGS START
103 
104  // Note: Any non-hidden compatibility flag should obtain its default
105  // by asking SvtCompatibilityOptions, see below.
106 
108  {
109  const SvtCompatibilityOptions aOptions;
126  }
127  else
128  {
129  mbParaSpaceMax = false;
130  mbParaSpaceMaxAtPages = false;
131  mbTabCompat = true;
132  mbUseVirtualDevice = true;
133  mbAddExternalLeading = true;
134  mbOldLineSpacing = false;
136  mbUseFormerObjectPos = false;
137  mbUseFormerTextWrapping = false;
138  mbConsiderWrapOnObjPos = false;
140  mbProtectForm = false;
142  mbSubtractFlys = false;
144  }
145 
146  // COMPATIBILITY FLAGS END
147 
148 }
149 
150 
152 {
153 }
154 
155 /* IDocumentSettingAccess */
157 {
158  switch (id)
159  {
160  // COMPATIBILITY FLAGS START
161  case DocumentSettingId::PARA_SPACE_MAX: return mbParaSpaceMax; //(n8Dummy1 & DUMMY_PARASPACEMAX);
162  case DocumentSettingId::PARA_SPACE_MAX_AT_PAGES: return mbParaSpaceMaxAtPages; //(n8Dummy1 & DUMMY_PARASPACEMAX_AT_PAGES);
163  case DocumentSettingId::TAB_COMPAT: return mbTabCompat; //(n8Dummy1 & DUMMY_TAB_COMPAT);
164  case DocumentSettingId::ADD_FLY_OFFSETS: return mbAddFlyOffsets; //(n8Dummy2 & DUMMY_ADD_FLY_OFFSETS);
165  case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS: return mbAddVerticalFlyOffsets;
166  case DocumentSettingId::ADD_EXT_LEADING: return mbAddExternalLeading; //(n8Dummy2 & DUMMY_ADD_EXTERNAL_LEADING);
167  case DocumentSettingId::USE_VIRTUAL_DEVICE: return mbUseVirtualDevice; //(n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE);
168  case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE: return mbUseHiResolutionVirtualDevice; //(n8Dummy2 & DUMMY_USE_HIRES_VIR_DEV);
169  case DocumentSettingId::OLD_NUMBERING: return mbOldNumbering;
170  case DocumentSettingId::OLD_LINE_SPACING: return mbOldLineSpacing;
171  case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS: return mbAddParaSpacingToTableCells;
172  case DocumentSettingId::USE_FORMER_OBJECT_POS: return mbUseFormerObjectPos;
173  case DocumentSettingId::USE_FORMER_TEXT_WRAPPING: return mbUseFormerTextWrapping;
174  case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION: return mbConsiderWrapOnObjPos;
175  case DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK: return mbDoNotJustifyLinesWithManualBreak;
176  case DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING: return mbIgnoreFirstLineIndentInNumbering;
177  case DocumentSettingId::TABLE_ROW_KEEP: return mbTableRowKeep;
178  case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation;
179  case DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage;
180  // #i68949#
181  case DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames;
182  case DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
183  case DocumentSettingId::TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent;
184  case DocumentSettingId::PROTECT_FORM: return mbProtectForm;
185  // tdf#104349 tdf#104668
186  case DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS: return mbMsWordCompTrailingBlanks;
187  // #i89181#
188  case DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
189  case DocumentSettingId::INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
190  case DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
191  case DocumentSettingId::SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66;
192  case DocumentSettingId::TAB_OVERFLOW: return mbTabOverflow;
193  case DocumentSettingId::UNBREAKABLE_NUMBERINGS: return mbUnbreakableNumberings;
194  case DocumentSettingId::CLIPPED_PICTURES: return mbClippedPictures;
195  case DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
196  case DocumentSettingId::TAB_OVER_MARGIN: return mbTabOverMargin;
197  case DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK: return mbTreatSingleColumnBreakAsPageBreak;
198  case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
199  case DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE: return mbPropLineSpacingShrinksFirstLine;
200  case DocumentSettingId::SUBTRACT_FLYS: return mbSubtractFlys;
201 
202  case DocumentSettingId::BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the SwViewShell has to be asked!
203  case DocumentSettingId::HTML_MODE: return mbHTMLMode;
204  case DocumentSettingId::GLOBAL_DOCUMENT: return mbIsGlobalDoc;
205  case DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks;
206  case DocumentSettingId::LABEL_DOCUMENT: return mbIsLabelDoc;
207  case DocumentSettingId::PURGE_OLE: return mbPurgeOLE;
208  case DocumentSettingId::KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation;
209  case DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
210  case DocumentSettingId::MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
211  case DocumentSettingId::STYLES_NODEFAULT: return mbStylesNoDefault;
212  case DocumentSettingId::FLOATTABLE_NOMARGINS: return mbFloattableNomargins;
213  case DocumentSettingId::EMBED_FONTS: return mEmbedFonts;
214  case DocumentSettingId::EMBED_USED_FONTS: return mEmbedUsedFonts;
215  case DocumentSettingId::EMBED_LATIN_SCRIPT_FONTS: return mEmbedLatinScriptFonts;
216  case DocumentSettingId::EMBED_ASIAN_SCRIPT_FONTS: return mEmbedAsianScriptFonts;
217  case DocumentSettingId::EMBED_COMPLEX_SCRIPT_FONTS: return mEmbedComplexScriptFonts;
218  case DocumentSettingId::EMBED_SYSTEM_FONTS: return mEmbedSystemFonts;
219  case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: return mApplyParagraphMarkFormatToNumbering;
220  case DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING: return mbDisableOffPagePositioning;
221  case DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA: return mbEmptyDbFieldHidesPara;
222  case DocumentSettingId::CONTINUOUS_ENDNOTES: return mbContinuousEndnotes;
223  case DocumentSettingId::PROTECT_BOOKMARKS: return mbProtectBookmarks;
224  case DocumentSettingId::PROTECT_FIELDS: return mbProtectFields;
225  default:
226  OSL_FAIL("Invalid setting id");
227  }
228  return false;
229 }
230 
231 void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
232 {
233  switch (id)
234  {
235  // COMPATIBILITY FLAGS START
237  mbParaSpaceMax = value;
238  break;
240  mbParaSpaceMaxAtPages = value;
241  break;
243  mbTabCompat = value;
244  break;
246  mbAddFlyOffsets = value;
247  break;
249  mbAddVerticalFlyOffsets = value;
250  break;
252  mbAddExternalLeading = value;
253  break;
255  mbUseVirtualDevice = value;
256  break;
258  mbUseHiResolutionVirtualDevice = value;
259  break;
261  if (mbOldNumbering != value)
262  {
263  mbOldNumbering = value;
264 
265  const SwNumRuleTable& rNmTable = m_rDoc.GetNumRuleTable();
266  for( SwNumRuleTable::size_type n = 0; n < rNmTable.size(); ++n )
267  rNmTable[n]->SetInvalidRule(true);
268 
269  m_rDoc.UpdateNumRule();
270 
271  SwNumRule *pOutlineRule = m_rDoc.GetOutlineNumRule();
272  if (pOutlineRule)
273  {
274  pOutlineRule->Validate();
275  // counting of phantoms depends on <IsOldNumbering()>
276  pOutlineRule->SetCountPhantoms( !mbOldNumbering );
277  }
278  }
279  break;
281  mbOldLineSpacing = value;
282  break;
284  mbAddParaSpacingToTableCells = value;
285  break;
287  mbUseFormerObjectPos = value;
288  break;
290  mbUseFormerTextWrapping = value;
291  break;
293  mbConsiderWrapOnObjPos = value;
294  break;
296  mbDoNotJustifyLinesWithManualBreak = value;
297  break;
299  mbIgnoreFirstLineIndentInNumbering = value;
300  break;
301 
303  mbTableRowKeep = value;
304  break;
305 
307  mbIgnoreTabsAndBlanksForLineCalculation = value;
308  break;
309 
311  mbDoNotCaptureDrawObjsOnPage = value;
312  break;
313 
314  // #i68949#
316  mbClipAsCharacterAnchoredWriterFlyFrames = value;
317  break;
318 
320  mbUnixForceZeroExtLeading = value;
321  break;
322 
324  mbProtectForm = value;
325  break;
326 
327  // tdf#140349
329  mbMsWordCompTrailingBlanks = value;
330  break;
331 
333  mbTabRelativeToIndent = value;
334  break;
335  // #i89181#
337  mbTabAtLeftIndentForParagraphsInList = value;
338  break;
339 
341  mbInvertBorderSpacing = value;
342  break;
343 
345  mbCollapseEmptyCellPara = value;
346  break;
347 
349  mbSmallCapsPercentage66 = value;
350  break;
351 
353  mbTabOverflow = value;
354  break;
355 
357  mbUnbreakableNumberings = value;
358  break;
359 
361  mbClippedPictures = value;
362  break;
363 
365  mbBackgroundParaOverDrawings = value;
366  break;
367 
369  mbTabOverMargin = value;
370  break;
371 
373  mbTreatSingleColumnBreakAsPageBreak = value;
374  break;
375 
377  mbSurroundTextWrapSmall = value;
378  break;
379 
381  mbPropLineSpacingShrinksFirstLine = value;
382  break;
383 
385  mbSubtractFlys = value;
386  break;
387 
388  // COMPATIBILITY FLAGS END
389 
390  case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available
391  mbLastBrowseMode = value;
392  break;
393 
395  mbHTMLMode = value;
396  break;
397 
399  mbIsGlobalDoc = value;
400  break;
401 
403  mbGlblDocSaveLinks = value;
404  break;
405 
407  mbIsLabelDoc = value;
408  break;
409 
411  mbPurgeOLE = value;
412  break;
413 
415  mbKernAsianPunctuation = value;
416  break;
417 
419  mbDoNotResetParaAttrsForNumFont = value;
420  break;
422  mbMathBaselineAlignment = value;
423  break;
425  mbStylesNoDefault = value;
426  break;
428  mbFloattableNomargins = value;
429  break;
431  mEmbedFonts = value;
432  break;
434  mEmbedUsedFonts = value;
435  break;
437  mEmbedLatinScriptFonts = value;
438  break;
440  mEmbedAsianScriptFonts = value;
441  break;
443  mEmbedComplexScriptFonts = value;
444  break;
446  mEmbedSystemFonts = value;
447  break;
449  mApplyParagraphMarkFormatToNumbering = value;
450  break;
452  mbDisableOffPagePositioning = value;
453  break;
455  mbEmptyDbFieldHidesPara = value;
456  break;
458  mbContinuousEndnotes = value;
459  break;
461  mbProtectBookmarks = value;
462  break;
464  mbProtectFields = value;
465  break;
466  default:
467  OSL_FAIL("Invalid setting id");
468  }
469 }
470 
471 const css::i18n::ForbiddenCharacters*
472  sw::DocumentSettingManager::getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const
473 {
474  const css::i18n::ForbiddenCharacters* pRet = nullptr;
475  if (mxForbiddenCharsTable)
476  pRet = mxForbiddenCharsTable->GetForbiddenCharacters( nLang, false );
477  if( bLocaleData && !pRet && g_pBreakIt )
478  pRet = &g_pBreakIt->GetForbidden( nLang );
479  return pRet;
480 }
481 
483  /*[in]*/ const css::i18n::ForbiddenCharacters& rFChars )
484 {
485  if (!mxForbiddenCharsTable)
487  mxForbiddenCharsTable->SetForbiddenCharacters( nLang, rFChars );
488 
489  SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
490  if( pDrawModel )
491  {
492  pDrawModel->SetForbiddenCharsTable(mxForbiddenCharsTable);
493  if( !m_rDoc.IsInReading() )
494  pDrawModel->ReformatAllTextObjects();
495  }
496 
497  SwRootFrame* pTmpRoot = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
498  if( pTmpRoot && !m_rDoc.IsInReading() )
499  {
500  pTmpRoot->StartAllAction();
501  for(SwRootFrame* aLayout : m_rDoc.GetAllLayouts())
502  aLayout->InvalidateAllContent(SwInvalidateFlags::Size);
503  pTmpRoot->EndAllAction();
504  }
505  m_rDoc.getIDocumentState().SetModified();
506 }
507 
508 std::shared_ptr<SvxForbiddenCharactersTable>& sw::DocumentSettingManager::getForbiddenCharacterTable()
509 {
510  if (!mxForbiddenCharsTable)
512  return mxForbiddenCharsTable;
513 }
514 
515 const std::shared_ptr<SvxForbiddenCharactersTable>& sw::DocumentSettingManager::getForbiddenCharacterTable() const
516 {
517  return mxForbiddenCharsTable;
518 }
519 
520 sal_uInt16 sw::DocumentSettingManager::getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const
521 {
522  sal_uInt16 nRet = mnLinkUpdMode;
523  if( bGlobalSettings && GLOBALSETTING == nRet )
524  nRet = SW_MOD()->GetLinkUpdMode();
525  return nRet;
526 }
527 
528 void sw::DocumentSettingManager::setLinkUpdateMode( /*[in]*/sal_uInt16 eMode )
529 {
530  mnLinkUpdMode = eMode;
531 }
532 
534 {
535  SwFieldUpdateFlags eRet = meFieldUpdMode;
536  if( bGlobalSettings && AUTOUPD_GLOBALSETTING == eRet )
537  eRet = SW_MOD()->GetFieldUpdateFlags();
538  return eRet;
539 }
540 
542 {
543  meFieldUpdMode = eMode;
544 }
545 
547 {
548  return meChrCmprType;
549 }
550 
552 {
553  if( meChrCmprType != n )
554  {
555  meChrCmprType = n;
556 
557  SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
558  if( pDrawModel )
559  {
560  pDrawModel->SetCharCompressType( n );
561  if( !m_rDoc.IsInReading() )
562  pDrawModel->ReformatAllTextObjects();
563  }
564 
565  SwRootFrame* pTmpRoot = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
566  if( pTmpRoot && !m_rDoc.IsInReading() )
567  {
568  pTmpRoot->StartAllAction();
569  for( auto aLayout : m_rDoc.GetAllLayouts() )
570  aLayout->InvalidateAllContent(SwInvalidateFlags::Size);
571  pTmpRoot->EndAllAction();
572  }
573  m_rDoc.getIDocumentState().SetModified();
574  }
575 }
576 
577 
579 {
580  Setn32DummyCompatibilityOptions1( rSource.Getn32DummyCompatibilityOptions1() );
581  Setn32DummyCompatibilityOptions2( rSource.Getn32DummyCompatibilityOptions2() );
582 
583  mbParaSpaceMax = rSource.mbParaSpaceMax;
584  mbParaSpaceMaxAtPages = rSource.mbParaSpaceMaxAtPages;
585  mbTabCompat = rSource.mbTabCompat;
586  mbUseVirtualDevice = rSource.mbUseVirtualDevice;
587  mbAddExternalLeading = rSource.mbAddExternalLeading;
588  mbOldLineSpacing = rSource.mbOldLineSpacing;
589  mbAddParaSpacingToTableCells = rSource.mbAddParaSpacingToTableCells;
590  mbUseFormerObjectPos = rSource.mbUseFormerObjectPos;
591  mbUseFormerTextWrapping = rSource.mbUseFormerTextWrapping;
592  mbConsiderWrapOnObjPos = rSource.mbConsiderWrapOnObjPos;
593  mbAddFlyOffsets = rSource.mbAddFlyOffsets;
594  mbOldNumbering = rSource.mbOldNumbering;
595  mbUseHiResolutionVirtualDevice = rSource.mbUseHiResolutionVirtualDevice;
596  mbIgnoreFirstLineIndentInNumbering = rSource.mbIgnoreFirstLineIndentInNumbering;
597  mbDoNotJustifyLinesWithManualBreak = rSource.mbDoNotJustifyLinesWithManualBreak;
598  mbDoNotResetParaAttrsForNumFont = rSource.mbDoNotResetParaAttrsForNumFont;
599  mbTableRowKeep = rSource.mbTableRowKeep;
600  mbIgnoreTabsAndBlanksForLineCalculation = rSource.mbIgnoreTabsAndBlanksForLineCalculation;
601  mbDoNotCaptureDrawObjsOnPage = rSource.mbDoNotCaptureDrawObjsOnPage;
602  mbClipAsCharacterAnchoredWriterFlyFrames = rSource.mbClipAsCharacterAnchoredWriterFlyFrames;
603  mbUnixForceZeroExtLeading = rSource.mbUnixForceZeroExtLeading;
604  mbTabRelativeToIndent = rSource.mbTabRelativeToIndent;
605  mbTabAtLeftIndentForParagraphsInList = rSource.mbTabAtLeftIndentForParagraphsInList;
606  mbMsWordCompTrailingBlanks = rSource.mbMsWordCompTrailingBlanks;
607  mbEmptyDbFieldHidesPara = rSource.mbEmptyDbFieldHidesPara;
608 }
609 
611 {
612  return mn32DummyCompatibilityOptions1;
613 }
614 
615 void sw::DocumentSettingManager::Setn32DummyCompatibilityOptions1( const sal_uInt32 CompatibilityOptions1 )
616 {
617  mn32DummyCompatibilityOptions1 = CompatibilityOptions1;
618 }
619 
621 {
622  return mn32DummyCompatibilityOptions2;
623 }
624 
625 void sw::DocumentSettingManager::Setn32DummyCompatibilityOptions2( const sal_uInt32 CompatibilityOptions2 )
626 {
627  mn32DummyCompatibilityOptions2 = CompatibilityOptions2;
628 }
629 
631 {
632  xmlTextWriterStartElement(pWriter, BAD_CAST("DocumentSettingManager"));
633 
634  xmlTextWriterStartElement(pWriter, BAD_CAST("mbHTMLMode"));
635  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
636  BAD_CAST(OString::boolean(mbHTMLMode).getStr()));
637  xmlTextWriterEndElement(pWriter);
638 
639  xmlTextWriterStartElement(pWriter, BAD_CAST("mbIsGlobalDoc"));
640  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
641  BAD_CAST(OString::boolean(mbIsGlobalDoc).getStr()));
642  xmlTextWriterEndElement(pWriter);
643 
644  xmlTextWriterStartElement(pWriter, BAD_CAST("mbGlblDocSaveLinks"));
645  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
646  BAD_CAST(OString::boolean(mbGlblDocSaveLinks).getStr()));
647  xmlTextWriterEndElement(pWriter);
648 
649  xmlTextWriterStartElement(pWriter, BAD_CAST("mbIsLabelDoc"));
650  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
651  BAD_CAST(OString::boolean(mbIsLabelDoc).getStr()));
652  xmlTextWriterEndElement(pWriter);
653 
654  xmlTextWriterStartElement(pWriter, BAD_CAST("mbPurgeOLE"));
655  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
656  BAD_CAST(OString::boolean(mbPurgeOLE).getStr()));
657  xmlTextWriterEndElement(pWriter);
658 
659  xmlTextWriterStartElement(pWriter, BAD_CAST("mbKernAsianPunctuation"));
660  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
661  BAD_CAST(OString::boolean(mbKernAsianPunctuation).getStr()));
662  xmlTextWriterEndElement(pWriter);
663 
664  xmlTextWriterStartElement(pWriter, BAD_CAST("mbParaSpaceMax"));
665  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
666  BAD_CAST(OString::boolean(mbParaSpaceMax).getStr()));
667  xmlTextWriterEndElement(pWriter);
668 
669  xmlTextWriterStartElement(pWriter, BAD_CAST("mbParaSpaceMaxAtPages"));
670  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
671  BAD_CAST(OString::boolean(mbParaSpaceMaxAtPages).getStr()));
672  xmlTextWriterEndElement(pWriter);
673 
674  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTabCompat"));
675  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
676  BAD_CAST(OString::boolean(mbTabCompat).getStr()));
677  xmlTextWriterEndElement(pWriter);
678 
679  xmlTextWriterStartElement(pWriter, BAD_CAST("mbUseVirtualDevice"));
680  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
681  BAD_CAST(OString::boolean(mbUseVirtualDevice).getStr()));
682  xmlTextWriterEndElement(pWriter);
683 
684  xmlTextWriterStartElement(pWriter, BAD_CAST("mbAddFlyOffsets"));
685  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
686  BAD_CAST(OString::boolean(mbAddFlyOffsets).getStr()));
687  xmlTextWriterEndElement(pWriter);
688 
689  xmlTextWriterStartElement(pWriter, BAD_CAST("mbAddVerticalFlyOffsets"));
690  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
691  BAD_CAST(OString::boolean(mbAddVerticalFlyOffsets).getStr()));
692  xmlTextWriterEndElement(pWriter);
693 
694  xmlTextWriterStartElement(pWriter, BAD_CAST("mbAddExternalLeading"));
695  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
696  BAD_CAST(OString::boolean(mbAddExternalLeading).getStr()));
697  xmlTextWriterEndElement(pWriter);
698 
699  xmlTextWriterStartElement(pWriter, BAD_CAST("mbUseHiResolutionVirtualDevice"));
700  xmlTextWriterWriteAttribute(
701  pWriter, BAD_CAST("value"),
702  BAD_CAST(OString::boolean(mbUseHiResolutionVirtualDevice).getStr()));
703  xmlTextWriterEndElement(pWriter);
704 
705  xmlTextWriterStartElement(pWriter, BAD_CAST("mbOldLineSpacing"));
706  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
707  BAD_CAST(OString::boolean(mbOldLineSpacing).getStr()));
708  xmlTextWriterEndElement(pWriter);
709 
710  xmlTextWriterStartElement(pWriter, BAD_CAST("mbAddParaSpacingToTableCells"));
711  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
712  BAD_CAST(OString::boolean(mbAddParaSpacingToTableCells).getStr()));
713  xmlTextWriterEndElement(pWriter);
714 
715  xmlTextWriterStartElement(pWriter, BAD_CAST("mbUseFormerObjectPos"));
716  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
717  BAD_CAST(OString::boolean(mbUseFormerObjectPos).getStr()));
718  xmlTextWriterEndElement(pWriter);
719 
720  xmlTextWriterStartElement(pWriter, BAD_CAST("mbUseFormerTextWrapping"));
721  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
722  BAD_CAST(OString::boolean(mbUseFormerTextWrapping).getStr()));
723  xmlTextWriterEndElement(pWriter);
724 
725  xmlTextWriterStartElement(pWriter, BAD_CAST("mbConsiderWrapOnObjPos"));
726  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
727  BAD_CAST(OString::boolean(mbConsiderWrapOnObjPos).getStr()));
728  xmlTextWriterEndElement(pWriter);
729 
730  xmlTextWriterStartElement(pWriter, BAD_CAST("mbMathBaselineAlignment"));
731  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
732  BAD_CAST(OString::boolean(mbMathBaselineAlignment).getStr()));
733  xmlTextWriterEndElement(pWriter);
734 
735  xmlTextWriterStartElement(pWriter, BAD_CAST("mbStylesNoDefault"));
736  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
737  BAD_CAST(OString::boolean(mbStylesNoDefault).getStr()));
738  xmlTextWriterEndElement(pWriter);
739 
740  xmlTextWriterStartElement(pWriter, BAD_CAST("mbFloattableNomargins"));
741  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
742  BAD_CAST(OString::boolean(mbFloattableNomargins).getStr()));
743  xmlTextWriterEndElement(pWriter);
744 
745  xmlTextWriterStartElement(pWriter, BAD_CAST("mbOldNumbering"));
746  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
747  BAD_CAST(OString::boolean(mbOldNumbering).getStr()));
748  xmlTextWriterEndElement(pWriter);
749 
750  xmlTextWriterStartElement(pWriter, BAD_CAST("mbIgnoreFirstLineIndentInNumbering"));
751  xmlTextWriterWriteAttribute(
752  pWriter, BAD_CAST("value"),
753  BAD_CAST(OString::boolean(mbIgnoreFirstLineIndentInNumbering).getStr()));
754  xmlTextWriterEndElement(pWriter);
755 
756  xmlTextWriterStartElement(pWriter, BAD_CAST("mbDoNotJustifyLinesWithManualBreak"));
757  xmlTextWriterWriteAttribute(
758  pWriter, BAD_CAST("value"),
759  BAD_CAST(OString::boolean(mbDoNotJustifyLinesWithManualBreak).getStr()));
760  xmlTextWriterEndElement(pWriter);
761 
762  xmlTextWriterStartElement(pWriter, BAD_CAST("mbDoNotResetParaAttrsForNumFont"));
763  xmlTextWriterWriteAttribute(
764  pWriter, BAD_CAST("value"),
765  BAD_CAST(OString::boolean(mbDoNotResetParaAttrsForNumFont).getStr()));
766  xmlTextWriterEndElement(pWriter);
767 
768  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTableRowKeep"));
769  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
770  BAD_CAST(OString::boolean(mbTableRowKeep).getStr()));
771  xmlTextWriterEndElement(pWriter);
772 
773  xmlTextWriterStartElement(pWriter, BAD_CAST("mbIgnoreTabsAndBlanksForLineCalculation"));
774  xmlTextWriterWriteAttribute(
775  pWriter, BAD_CAST("value"),
776  BAD_CAST(OString::boolean(mbIgnoreTabsAndBlanksForLineCalculation).getStr()));
777  xmlTextWriterEndElement(pWriter);
778 
779  xmlTextWriterStartElement(pWriter, BAD_CAST("mbDoNotCaptureDrawObjsOnPage"));
780  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
781  BAD_CAST(OString::boolean(mbDoNotCaptureDrawObjsOnPage).getStr()));
782  xmlTextWriterEndElement(pWriter);
783 
784  xmlTextWriterStartElement(pWriter, BAD_CAST("mbClipAsCharacterAnchoredWriterFlyFrames"));
785  xmlTextWriterWriteAttribute(
786  pWriter, BAD_CAST("value"),
787  BAD_CAST(OString::boolean(mbClipAsCharacterAnchoredWriterFlyFrames).getStr()));
788  xmlTextWriterEndElement(pWriter);
789 
790  xmlTextWriterStartElement(pWriter, BAD_CAST("mbUnixForceZeroExtLeading"));
791  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
792  BAD_CAST(OString::boolean(mbUnixForceZeroExtLeading).getStr()));
793  xmlTextWriterEndElement(pWriter);
794 
795  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTabRelativeToIndent"));
796  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
797  BAD_CAST(OString::boolean(mbTabRelativeToIndent).getStr()));
798  xmlTextWriterEndElement(pWriter);
799 
800  xmlTextWriterStartElement(pWriter, BAD_CAST("mbProtectForm"));
801  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
802  BAD_CAST(OString::boolean(mbProtectForm).getStr()));
803  xmlTextWriterEndElement(pWriter);
804 
805  xmlTextWriterStartElement(pWriter, BAD_CAST("mbMsWordCompTrailingBlanks"));
806  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
807  BAD_CAST(OString::boolean(mbMsWordCompTrailingBlanks).getStr()));
808  xmlTextWriterEndElement(pWriter);
809 
810  xmlTextWriterStartElement(pWriter, BAD_CAST("mbInvertBorderSpacing"));
811  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
812  BAD_CAST(OString::boolean(mbInvertBorderSpacing).getStr()));
813  xmlTextWriterEndElement(pWriter);
814 
815  xmlTextWriterStartElement(pWriter, BAD_CAST("mbCollapseEmptyCellPara"));
816  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
817  BAD_CAST(OString::boolean(mbCollapseEmptyCellPara).getStr()));
818  xmlTextWriterEndElement(pWriter);
819 
820  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTabAtLeftIndentForParagraphsInList"));
821  xmlTextWriterWriteAttribute(
822  pWriter, BAD_CAST("value"),
823  BAD_CAST(OString::boolean(mbTabAtLeftIndentForParagraphsInList).getStr()));
824  xmlTextWriterEndElement(pWriter);
825 
826  xmlTextWriterStartElement(pWriter, BAD_CAST("mbSmallCapsPercentage66"));
827  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
828  BAD_CAST(OString::boolean(mbSmallCapsPercentage66).getStr()));
829  xmlTextWriterEndElement(pWriter);
830 
831  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTabOverflow"));
832  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
833  BAD_CAST(OString::boolean(mbTabOverflow).getStr()));
834  xmlTextWriterEndElement(pWriter);
835 
836  xmlTextWriterStartElement(pWriter, BAD_CAST("mbUnbreakableNumberings"));
837  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
838  BAD_CAST(OString::boolean(mbUnbreakableNumberings).getStr()));
839  xmlTextWriterEndElement(pWriter);
840 
841  xmlTextWriterStartElement(pWriter, BAD_CAST("mbClippedPictures"));
842  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
843  BAD_CAST(OString::boolean(mbClippedPictures).getStr()));
844  xmlTextWriterEndElement(pWriter);
845 
846  xmlTextWriterStartElement(pWriter, BAD_CAST("mbBackgroundParaOverDrawings"));
847  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
848  BAD_CAST(OString::boolean(mbBackgroundParaOverDrawings).getStr()));
849  xmlTextWriterEndElement(pWriter);
850 
851  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTabOverMargin"));
852  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
853  BAD_CAST(OString::boolean(mbTabOverMargin).getStr()));
854  xmlTextWriterEndElement(pWriter);
855 
856  xmlTextWriterStartElement(pWriter, BAD_CAST("mbTreatSingleColumnBreakAsPageBreak"));
857  xmlTextWriterWriteAttribute(
858  pWriter, BAD_CAST("value"),
859  BAD_CAST(OString::boolean(mbTreatSingleColumnBreakAsPageBreak).getStr()));
860  xmlTextWriterEndElement(pWriter);
861 
862  xmlTextWriterStartElement(pWriter, BAD_CAST("mbSurroundTextWrapSmall"));
863  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
864  BAD_CAST(OString::boolean(mbSurroundTextWrapSmall).getStr()));
865  xmlTextWriterEndElement(pWriter);
866 
867  xmlTextWriterStartElement(pWriter, BAD_CAST("mbPropLineSpacingShrinksFirstLine"));
868  xmlTextWriterWriteAttribute(
869  pWriter, BAD_CAST("value"),
870  BAD_CAST(OString::boolean(mbPropLineSpacingShrinksFirstLine).getStr()));
871  xmlTextWriterEndElement(pWriter);
872 
873  xmlTextWriterStartElement(pWriter, BAD_CAST("mbSubtractFlys"));
874  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
875  BAD_CAST(OString::boolean(mbSubtractFlys).getStr()));
876  xmlTextWriterEndElement(pWriter);
877 
878  xmlTextWriterStartElement(pWriter, BAD_CAST("mbLastBrowseMode"));
879  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
880  BAD_CAST(OString::boolean(mbLastBrowseMode).getStr()));
881  xmlTextWriterEndElement(pWriter);
882 
883  xmlTextWriterStartElement(pWriter, BAD_CAST("mbDisableOffPagePositioning"));
884  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
885  BAD_CAST(OString::boolean(mbDisableOffPagePositioning).getStr()));
886  xmlTextWriterEndElement(pWriter);
887 
888  xmlTextWriterStartElement(pWriter, BAD_CAST("mbEmptyDbFieldHidesPara"));
889  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
890  BAD_CAST(OString::boolean(mbEmptyDbFieldHidesPara).getStr()));
891  xmlTextWriterEndElement(pWriter);
892 
893  xmlTextWriterStartElement(pWriter, BAD_CAST("mbContinuousEndnotes"));
894  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
895  BAD_CAST(OString::boolean(mbContinuousEndnotes).getStr()));
896  xmlTextWriterEndElement(pWriter);
897 
898  xmlTextWriterEndElement(pWriter);
899 }
900 
901 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual const css::i18n::ForbiddenCharacters * getForbiddenCharacters(LanguageType nLang, bool bLocaleData) const override
Return the forbidden characters.
bool GetDefault(SvtCompatibilityEntry::Index rIdx) const
SwFieldUpdateFlags
Definition: fldupde.hxx:22
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
sal_Int64 n
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: doc.hxx:186
virtual CharCompressType getCharacterCompressionType() const override
Get the character compression type for Asian characters.
virtual void set(DocumentSettingId id, bool value) override
Set the specified document setting.
void SetCharCompressType(CharCompressType nType)
void Setn32DummyCompatibilityOptions1(const sal_uInt32 CompatibilityOptions1) override
Set the n32DummyCompatabilityOptions1.
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
static LanguageType nLang
Definition: srtdlg.cxx:51
void ReformatAllTextObjects()
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:33
static bool IsFuzzing()
static std::shared_ptr< SvxForbiddenCharactersTable > makeForbiddenCharactersTable(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void setLinkUpdateMode(sal_uInt16 nMode) override
Set the current link update mode.
void ReplaceCompatibilityOptions(const DocumentSettingManager &rSource)
struct _xmlTextWriter * xmlTextWriterPtr
virtual void setFieldUpdateFlags(SwFieldUpdateFlags eMode) override
Set the current field update mode.
#define SW_MOD()
Definition: swmodule.hxx:256
CharCompressType
std::vector< SwNumRule * >::size_type size_type
Definition: docary.hxx:70
virtual std::shared_ptr< SvxForbiddenCharactersTable > & getForbiddenCharacterTable() override
Get the forbidden character table and creates one if necessary.
void Setn32DummyCompatibilityOptions2(const sal_uInt32 CompatibilityOptions2) override
Set the n32DummyCompatabilityOptions2.
size_t size() const
Definition: docary.hxx:91
void SetCountPhantoms(bool bCountPhantoms)
Definition: number.cxx:994
PDFDocument & m_rDoc
virtual void setCharacterCompressionType(CharCompressType nType) override
Set the character compression type for Asian characters.
sal_uInt32 Getn32DummyCompatibilityOptions2() const override
Get the n32DummyCompatabilityOptions2.
void Validate()
Definition: number.cxx:981
virtual SwFieldUpdateFlags getFieldUpdateFlags(bool bGlobalSettings) const override
Get the current field update mode.
virtual void setForbiddenCharacters(LanguageType nLang, const css::i18n::ForbiddenCharacters &rForbiddenCharacters) override
Set the forbidden characters.
virtual sal_uInt16 getLinkUpdateMode(bool bGlobalSettings) const override
Get the current link update mode.
sal_uInt32 Getn32DummyCompatibilityOptions1() const override
Get the n32DummyCompatabilityOptions1.
Reference< XComponentContext > getProcessComponentContext()
virtual ~DocumentSettingManager() override
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
Definition: pagechg.cxx:1864
void EndAllAction(bool bVirDev=false)
Definition: pagechg.cxx:1876
const css::i18n::ForbiddenCharacters & GetForbidden(const LanguageType aLang)
Definition: breakit.hxx:103