Line data Source code
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 <DocumentSettingManager.hxx>
21 : #include <doc.hxx>
22 : #include <IDocumentDrawModelAccess.hxx>
23 : #include <IDocumentState.hxx>
24 : #include <IDocumentLayoutAccess.hxx>
25 : #include <comphelper/processfactory.hxx>
26 : #include <editeng/forbiddencharacterstable.hxx>
27 : #include <svx/svdmodel.hxx>
28 : #include <unotools/compatibility.hxx>
29 : #include <drawdoc.hxx>
30 : #include <swmodule.hxx>
31 : #include <linkenum.hxx>
32 : #include <rootfrm.hxx>
33 : #include <breakit.hxx>
34 : #include <docary.hxx>
35 : #include <SwUndoFmt.hxx>
36 :
37 : /* IDocumentSettingAccess */
38 :
39 2958 : sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
40 : :m_rDoc(rDoc),
41 : mnLinkUpdMode( GLOBALSETTING ),
42 : meFieldUpdMode( AUTOUPD_GLOBALSETTING ),
43 : meChrCmprType( CHARCOMPRESS_NONE ),
44 : mn32DummyCompatibilityOptions1(0),
45 : mn32DummyCompatibilityOptions2(0),
46 : mbHTMLMode(false),
47 : mbIsGlobalDoc(false),
48 : mbGlblDocSaveLinks(false),
49 : mbIsLabelDoc(false),
50 : mbPurgeOLE(true),
51 : mbKernAsianPunctuation(false),
52 :
53 : // COMPATIBILITY FLAGS START
54 :
55 : mbAddFlyOffsets(false),
56 : mbUseHiResolutionVirtualDevice(true),
57 : mbMathBaselineAlignment(false), // default for *old* documents is 'off'
58 : mbStylesNoDefault(false),
59 : mbFloattableNomargins(false),
60 : mEmbedFonts(false),
61 : mEmbedSystemFonts(false),
62 : mbOldNumbering(false),
63 : mbIgnoreFirstLineIndentInNumbering(false),
64 : mbDoNotResetParaAttrsForNumFont(false),
65 : mbTableRowKeep(false),
66 : mbIgnoreTabsAndBlanksForLineCalculation(false),
67 : mbDoNotCaptureDrawObjsOnPage(false),
68 : mbOutlineLevelYieldsOutlineRule(false),
69 : mbClipAsCharacterAnchoredWriterFlyFrames(false),
70 : mbUnixForceZeroExtLeading(false),
71 : mbTabRelativeToIndent(true),
72 : mbProtectForm(false), // i#78591#
73 : mbInvertBorderSpacing (false),
74 : mbCollapseEmptyCellPara(true),
75 : mbTabAtLeftIndentForParagraphsInList(false), //#i89181#
76 : mbSmallCapsPercentage66(false),
77 : mbTabOverflow(true),
78 : mbUnbreakableNumberings(false),
79 : mbClippedPictures(false),
80 : mbBackgroundParaOverDrawings(false),
81 : mbTabOverMargin(false),
82 : mbSurroundTextWrapSmall(false),
83 : mbPropLineSpacingShrinksFirstLine(true),
84 : mbSubtractFlys(false),
85 : mApplyParagraphMarkFormatToNumbering(false),
86 2958 : mbLastBrowseMode( false )
87 :
88 : // COMPATIBILITY FLAGS END
89 : {
90 : // COMPATIBILITY FLAGS START
91 :
92 : // Note: Any non-hidden compatibility flag should obtain its default
93 : // by asking SvtCompatibilityOptions, see below.
94 :
95 2958 : const SvtCompatibilityOptions aOptions;
96 2958 : mbParaSpaceMax = aOptions.IsAddSpacing();
97 2958 : mbParaSpaceMaxAtPages = aOptions.IsAddSpacingAtPages();
98 2958 : mbTabCompat = !aOptions.IsUseOurTabStops();
99 2958 : mbUseVirtualDevice = !aOptions.IsUsePrtDevice();
100 2958 : mbAddExternalLeading = !aOptions.IsNoExtLeading();
101 2958 : mbOldLineSpacing = aOptions.IsUseLineSpacing();
102 2958 : mbAddParaSpacingToTableCells = aOptions.IsAddTableSpacing();
103 2958 : mbUseFormerObjectPos = aOptions.IsUseObjectPositioning();
104 2958 : mbUseFormerTextWrapping = aOptions.IsUseOurTextWrapping();
105 2958 : mbConsiderWrapOnObjPos = aOptions.IsConsiderWrappingStyle();
106 :
107 2958 : mbDoNotJustifyLinesWithManualBreak = !aOptions.IsExpandWordSpace();
108 :
109 : // COMPATIBILITY FLAGS END
110 :
111 2958 : }
112 :
113 :
114 5898 : sw::DocumentSettingManager::~DocumentSettingManager()
115 : {
116 5898 : }
117 :
118 : /* IDocumentSettingAccess */
119 55896099 : bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
120 : {
121 55896099 : switch (id)
122 : {
123 : // COMPATIBILITY FLAGS START
124 45128 : case DocumentSettingId::PARA_SPACE_MAX: return mbParaSpaceMax; //(n8Dummy1 & DUMMY_PARASPACEMAX);
125 52055 : case DocumentSettingId::PARA_SPACE_MAX_AT_PAGES: return mbParaSpaceMaxAtPages; //(n8Dummy1 & DUMMY_PARASPACEMAX_AT_PAGES);
126 183338 : case DocumentSettingId::TAB_COMPAT: return mbTabCompat; //(n8Dummy1 & DUMMY_TAB_COMPAT);
127 72347 : case DocumentSettingId::ADD_FLY_OFFSETS: return mbAddFlyOffsets; //(n8Dummy2 & DUMMY_ADD_FLY_OFFSETS);
128 1225040 : case DocumentSettingId::ADD_EXT_LEADING: return mbAddExternalLeading; //(n8Dummy2 & DUMMY_ADD_EXTERNAL_LEADING);
129 2071432 : case DocumentSettingId::USE_VIRTUAL_DEVICE: return mbUseVirtualDevice; //(n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE);
130 339 : case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE: return mbUseHiResolutionVirtualDevice; //(n8Dummy2 & DUMMY_USE_HIRES_VIR_DEV);
131 3051 : case DocumentSettingId::OLD_NUMBERING: return mbOldNumbering;
132 238316 : case DocumentSettingId::OLD_LINE_SPACING: return mbOldLineSpacing;
133 24902 : case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS: return mbAddParaSpacingToTableCells;
134 25815 : case DocumentSettingId::USE_FORMER_OBJECT_POS: return mbUseFormerObjectPos;
135 105788 : case DocumentSettingId::USE_FORMER_TEXT_WRAPPING: return mbUseFormerTextWrapping;
136 646441 : case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION: return mbConsiderWrapOnObjPos;
137 398 : case DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK: return mbDoNotJustifyLinesWithManualBreak;
138 341495 : case DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING: return mbIgnoreFirstLineIndentInNumbering;
139 72 : case DocumentSettingId::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE: return mbOutlineLevelYieldsOutlineRule;
140 5297 : case DocumentSettingId::TABLE_ROW_KEEP: return mbTableRowKeep;
141 86864 : case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation;
142 5161 : case DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage;
143 : // #i68949#
144 3020 : case DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames;
145 3009 : case DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
146 235084 : case DocumentSettingId::TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent;
147 39425 : case DocumentSettingId::PROTECT_FORM: return mbProtectForm;
148 : // #i89181#
149 1510 : case DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
150 516251 : case DocumentSettingId::INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
151 155245 : case DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
152 57156 : case DocumentSettingId::SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66;
153 16986 : case DocumentSettingId::TAB_OVERFLOW: return mbTabOverflow;
154 102093 : case DocumentSettingId::UNBREAKABLE_NUMBERINGS: return mbUnbreakableNumberings;
155 218 : case DocumentSettingId::CLIPPED_PICTURES: return mbClippedPictures;
156 9321 : case DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
157 152064 : case DocumentSettingId::TAB_OVER_MARGIN: return mbTabOverMargin;
158 312 : case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
159 9582 : case DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE: return mbPropLineSpacingShrinksFirstLine;
160 1104 : case DocumentSettingId::SUBTRACT_FLYS: return mbSubtractFlys;
161 :
162 19053 : case DocumentSettingId::BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the SwViewShell has to be asked!
163 49053639 : case DocumentSettingId::HTML_MODE: return mbHTMLMode;
164 3487 : case DocumentSettingId::GLOBAL_DOCUMENT: return mbIsGlobalDoc;
165 74 : case DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks;
166 5923 : case DocumentSettingId::LABEL_DOCUMENT: return mbIsLabelDoc;
167 8195 : case DocumentSettingId::PURGE_OLE: return mbPurgeOLE;
168 52039 : case DocumentSettingId::KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation;
169 7000 : case DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
170 72 : case DocumentSettingId::MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
171 26770 : case DocumentSettingId::STYLES_NODEFAULT: return mbStylesNoDefault;
172 269585 : case DocumentSettingId::FLOATTABLE_NOMARGINS: return mbFloattableNomargins;
173 7049 : case DocumentSettingId::EMBED_FONTS: return mEmbedFonts;
174 554 : case DocumentSettingId::EMBED_SYSTEM_FONTS: return mEmbedSystemFonts;
175 7000 : case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: return mApplyParagraphMarkFormatToNumbering;
176 : default:
177 : OSL_FAIL("Invalid setting id");
178 : }
179 0 : return false;
180 : }
181 :
182 87804 : void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
183 : {
184 87804 : switch (id)
185 : {
186 : // COMPATIBILITY FLAGS START
187 : case DocumentSettingId::PARA_SPACE_MAX:
188 2377 : mbParaSpaceMax = value;
189 2377 : break;
190 : case DocumentSettingId::PARA_SPACE_MAX_AT_PAGES:
191 410 : mbParaSpaceMaxAtPages = value;
192 410 : break;
193 : case DocumentSettingId::TAB_COMPAT:
194 410 : mbTabCompat = value;
195 410 : break;
196 : case DocumentSettingId::ADD_FLY_OFFSETS:
197 1933 : mbAddFlyOffsets = value;
198 1933 : break;
199 : case DocumentSettingId::ADD_EXT_LEADING:
200 424 : mbAddExternalLeading = value;
201 424 : break;
202 : case DocumentSettingId::USE_VIRTUAL_DEVICE:
203 143 : mbUseVirtualDevice = value;
204 143 : break;
205 : case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE:
206 143 : mbUseHiResolutionVirtualDevice = value;
207 143 : break;
208 : case DocumentSettingId::OLD_NUMBERING:
209 1934 : if (mbOldNumbering != value)
210 : {
211 10 : mbOldNumbering = value;
212 :
213 10 : const SwNumRuleTable& rNmTable = m_rDoc.GetNumRuleTable();
214 20 : for( SwNumRuleTable::size_type n = 0; n < rNmTable.size(); ++n )
215 10 : rNmTable[n]->SetInvalidRule(true);
216 :
217 10 : m_rDoc.UpdateNumRule();
218 :
219 10 : SwNumRule *pOutlineRule = m_rDoc.GetOutlineNumRule();
220 10 : if (pOutlineRule)
221 : {
222 10 : pOutlineRule->Validate();
223 : // counting of phantoms depends on <IsOldNumbering()>
224 10 : pOutlineRule->SetCountPhantoms( !mbOldNumbering );
225 : }
226 : }
227 1934 : break;
228 : case DocumentSettingId::OLD_LINE_SPACING:
229 1935 : mbOldLineSpacing = value;
230 1935 : break;
231 : case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS:
232 1935 : mbAddParaSpacingToTableCells = value;
233 1935 : break;
234 : case DocumentSettingId::USE_FORMER_OBJECT_POS:
235 1935 : mbUseFormerObjectPos = value;
236 1935 : break;
237 : case DocumentSettingId::USE_FORMER_TEXT_WRAPPING:
238 1934 : mbUseFormerTextWrapping = value;
239 1934 : break;
240 : case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION:
241 1934 : mbConsiderWrapOnObjPos = value;
242 1934 : break;
243 : case DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK:
244 410 : mbDoNotJustifyLinesWithManualBreak = value;
245 410 : break;
246 : case DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING:
247 1934 : mbIgnoreFirstLineIndentInNumbering = value;
248 1934 : break;
249 :
250 : case DocumentSettingId::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE:
251 285 : mbOutlineLevelYieldsOutlineRule = value;
252 285 : break;
253 :
254 : case DocumentSettingId::TABLE_ROW_KEEP:
255 1932 : mbTableRowKeep = value;
256 1932 : break;
257 :
258 : case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
259 1931 : mbIgnoreTabsAndBlanksForLineCalculation = value;
260 1931 : break;
261 :
262 : case DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
263 288 : mbDoNotCaptureDrawObjsOnPage = value;
264 288 : break;
265 :
266 : // #i68949#
267 : case DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
268 285 : mbClipAsCharacterAnchoredWriterFlyFrames = value;
269 285 : break;
270 :
271 : case DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING:
272 285 : mbUnixForceZeroExtLeading = value;
273 285 : break;
274 :
275 : case DocumentSettingId::PROTECT_FORM:
276 404 : mbProtectForm = value;
277 404 : break;
278 :
279 : case DocumentSettingId::TABS_RELATIVE_TO_INDENT:
280 2363 : mbTabRelativeToIndent = value;
281 2363 : break;
282 : // #i89181#
283 : case DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
284 279 : mbTabAtLeftIndentForParagraphsInList = value;
285 279 : break;
286 :
287 : case DocumentSettingId::INVERT_BORDER_SPACING:
288 1917 : mbInvertBorderSpacing = value;
289 1917 : break;
290 :
291 : case DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA:
292 1917 : mbCollapseEmptyCellPara = value;
293 1917 : break;
294 :
295 : case DocumentSettingId::SMALL_CAPS_PERCENTAGE_66:
296 285 : mbSmallCapsPercentage66 = value;
297 285 : break;
298 :
299 : case DocumentSettingId::TAB_OVERFLOW:
300 1934 : mbTabOverflow = value;
301 1934 : break;
302 :
303 : case DocumentSettingId::UNBREAKABLE_NUMBERINGS:
304 1934 : mbUnbreakableNumberings = value;
305 1934 : break;
306 :
307 : case DocumentSettingId::CLIPPED_PICTURES:
308 1934 : mbClippedPictures = value;
309 1934 : break;
310 :
311 : case DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS:
312 1809 : mbBackgroundParaOverDrawings = value;
313 1809 : break;
314 :
315 : case DocumentSettingId::TAB_OVER_MARGIN:
316 1934 : mbTabOverMargin = value;
317 1934 : break;
318 :
319 : case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL:
320 2283 : mbSurroundTextWrapSmall = value;
321 2283 : break;
322 :
323 : case DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
324 1934 : mbPropLineSpacingShrinksFirstLine = value;
325 1934 : break;
326 :
327 : case DocumentSettingId::SUBTRACT_FLYS:
328 285 : mbSubtractFlys = value;
329 285 : break;
330 :
331 : // COMPATIBILITY FLAGS END
332 :
333 : case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available
334 2879 : mbLastBrowseMode = value;
335 2879 : break;
336 :
337 : case DocumentSettingId::HTML_MODE:
338 7360 : mbHTMLMode = value;
339 7360 : break;
340 :
341 : case DocumentSettingId::GLOBAL_DOCUMENT:
342 0 : mbIsGlobalDoc = value;
343 0 : break;
344 :
345 : case DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS:
346 285 : mbGlblDocSaveLinks = value;
347 285 : break;
348 :
349 : case DocumentSettingId::LABEL_DOCUMENT:
350 285 : mbIsLabelDoc = value;
351 285 : break;
352 :
353 : case DocumentSettingId::PURGE_OLE:
354 16390 : mbPurgeOLE = value;
355 16390 : break;
356 :
357 : case DocumentSettingId::KERN_ASIAN_PUNCTUATION:
358 3074 : mbKernAsianPunctuation = value;
359 3074 : break;
360 :
361 : case DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
362 1934 : mbDoNotResetParaAttrsForNumFont = value;
363 1934 : break;
364 : case DocumentSettingId::MATH_BASELINE_ALIGNMENT:
365 2931 : mbMathBaselineAlignment = value;
366 2931 : break;
367 : case DocumentSettingId::STYLES_NODEFAULT:
368 2199 : mbStylesNoDefault = value;
369 2199 : break;
370 : case DocumentSettingId::FLOATTABLE_NOMARGINS:
371 1770 : mbFloattableNomargins = value;
372 1770 : break;
373 : case DocumentSettingId::EMBED_FONTS:
374 241 : mEmbedFonts = value;
375 241 : break;
376 : case DocumentSettingId::EMBED_SYSTEM_FONTS:
377 335 : mEmbedSystemFonts = value;
378 335 : break;
379 : case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING:
380 2112 : mApplyParagraphMarkFormatToNumbering = value;
381 2112 : break;
382 : default:
383 : OSL_FAIL("Invalid setting id");
384 : }
385 87804 : }
386 :
387 : const css::i18n::ForbiddenCharacters*
388 33908 : sw::DocumentSettingManager::getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const
389 : {
390 33908 : const css::i18n::ForbiddenCharacters* pRet = 0;
391 33908 : if( mxForbiddenCharsTable.is() )
392 33908 : pRet = mxForbiddenCharsTable->GetForbiddenCharacters( nLang, false );
393 33908 : if( bLocaleData && !pRet && g_pBreakIt )
394 33530 : pRet = &g_pBreakIt->GetForbidden( (LanguageType)nLang );
395 33908 : return pRet;
396 : }
397 :
398 90 : void sw::DocumentSettingManager::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
399 : /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars )
400 : {
401 90 : if( !mxForbiddenCharsTable.is() )
402 : {
403 0 : mxForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
404 : }
405 90 : mxForbiddenCharsTable->SetForbiddenCharacters( nLang, rFChars );
406 :
407 90 : SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
408 90 : if( pDrawModel )
409 : {
410 90 : pDrawModel->SetForbiddenCharsTable( mxForbiddenCharsTable );
411 90 : if( !m_rDoc.IsInReading() )
412 0 : pDrawModel->ReformatAllTextObjects();
413 : }
414 :
415 90 : SwRootFrm* pTmpRoot = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
416 90 : if( pTmpRoot && !m_rDoc.IsInReading() )
417 : {
418 0 : pTmpRoot->StartAllAction();
419 0 : std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
420 0 : std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllContent), INV_SIZE));
421 0 : pTmpRoot->EndAllAction();
422 : }
423 90 : m_rDoc.getIDocumentState().SetModified();
424 90 : }
425 :
426 3371 : rtl::Reference<SvxForbiddenCharactersTable>& sw::DocumentSettingManager::getForbiddenCharacterTable()
427 : {
428 3371 : if( !mxForbiddenCharsTable.is() )
429 : {
430 2958 : mxForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
431 : }
432 3371 : return mxForbiddenCharsTable;
433 : }
434 :
435 0 : const rtl::Reference<SvxForbiddenCharactersTable>& sw::DocumentSettingManager::getForbiddenCharacterTable() const
436 : {
437 0 : return mxForbiddenCharsTable;
438 : }
439 :
440 2486 : sal_uInt16 sw::DocumentSettingManager::getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const
441 : {
442 2486 : sal_uInt16 nRet = mnLinkUpdMode;
443 2486 : if( bGlobalSettings && GLOBALSETTING == nRet )
444 2165 : nRet = SW_MOD()->GetLinkUpdMode(get(DocumentSettingId::HTML_MODE));
445 2486 : return nRet;
446 : }
447 :
448 2951 : void sw::DocumentSettingManager::setLinkUpdateMode( /*[in]*/sal_uInt16 eMode )
449 : {
450 2951 : mnLinkUpdMode = eMode;
451 2951 : }
452 :
453 6084 : SwFieldUpdateFlags sw::DocumentSettingManager::getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const
454 : {
455 6084 : SwFieldUpdateFlags eRet = meFieldUpdMode;
456 6084 : if( bGlobalSettings && AUTOUPD_GLOBALSETTING == eRet )
457 5623 : eRet = SW_MOD()->GetFieldUpdateFlags(get(DocumentSettingId::HTML_MODE));
458 6084 : return eRet;
459 : }
460 :
461 3236 : void sw::DocumentSettingManager::setFieldUpdateFlags(/*[in]*/SwFieldUpdateFlags eMode )
462 : {
463 3236 : meFieldUpdMode = eMode;
464 3236 : }
465 :
466 50569 : SwCharCompressType sw::DocumentSettingManager::getCharacterCompressionType() const
467 : {
468 50569 : return meChrCmprType;
469 : }
470 :
471 3074 : void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
472 : {
473 3074 : if( meChrCmprType != n )
474 : {
475 17 : meChrCmprType = n;
476 :
477 17 : SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
478 17 : if( pDrawModel )
479 : {
480 17 : pDrawModel->SetCharCompressType( static_cast<sal_uInt16>(n) );
481 17 : if( !m_rDoc.IsInReading() )
482 0 : pDrawModel->ReformatAllTextObjects();
483 : }
484 :
485 17 : SwRootFrm* pTmpRoot = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
486 17 : if( pTmpRoot && !m_rDoc.IsInReading() )
487 : {
488 0 : pTmpRoot->StartAllAction();
489 0 : std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
490 0 : std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllContent), INV_SIZE));
491 0 : pTmpRoot->EndAllAction();
492 : }
493 17 : m_rDoc.getIDocumentState().SetModified();
494 : }
495 3074 : }
496 :
497 :
498 53 : void sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSettingManager& rSource)
499 : {
500 53 : Setn32DummyCompatibilityOptions1( rSource.Getn32DummyCompatibilityOptions1() );
501 53 : Setn32DummyCompatibilityOptions2( rSource.Getn32DummyCompatibilityOptions2() );
502 :
503 53 : mbParaSpaceMax = rSource.mbParaSpaceMax;
504 53 : mbParaSpaceMaxAtPages = rSource.mbParaSpaceMaxAtPages;
505 53 : mbTabCompat = rSource.mbTabCompat;
506 53 : mbUseVirtualDevice = rSource.mbUseVirtualDevice;
507 53 : mbAddExternalLeading = rSource.mbAddExternalLeading;
508 53 : mbOldLineSpacing = rSource.mbOldLineSpacing;
509 53 : mbAddParaSpacingToTableCells = rSource.mbAddParaSpacingToTableCells;
510 53 : mbUseFormerObjectPos = rSource.mbUseFormerObjectPos;
511 53 : mbUseFormerTextWrapping = rSource.mbUseFormerTextWrapping;
512 53 : mbConsiderWrapOnObjPos = rSource.mbConsiderWrapOnObjPos;
513 53 : mbAddFlyOffsets = rSource.mbAddFlyOffsets;
514 53 : mbOldNumbering = rSource.mbOldNumbering;
515 53 : mbUseHiResolutionVirtualDevice = rSource.mbUseHiResolutionVirtualDevice;
516 53 : mbIgnoreFirstLineIndentInNumbering = rSource.mbIgnoreFirstLineIndentInNumbering;
517 53 : mbDoNotJustifyLinesWithManualBreak = rSource.mbDoNotJustifyLinesWithManualBreak;
518 53 : mbDoNotResetParaAttrsForNumFont = rSource.mbDoNotResetParaAttrsForNumFont;
519 53 : mbOutlineLevelYieldsOutlineRule = rSource.mbOutlineLevelYieldsOutlineRule;
520 53 : mbTableRowKeep = rSource.mbTableRowKeep;
521 53 : mbIgnoreTabsAndBlanksForLineCalculation = rSource.mbIgnoreTabsAndBlanksForLineCalculation;
522 53 : mbDoNotCaptureDrawObjsOnPage = rSource.mbDoNotCaptureDrawObjsOnPage;
523 53 : mbClipAsCharacterAnchoredWriterFlyFrames = rSource.mbClipAsCharacterAnchoredWriterFlyFrames;
524 53 : mbUnixForceZeroExtLeading = rSource.mbUnixForceZeroExtLeading;
525 53 : mbTabRelativeToIndent = rSource.mbTabRelativeToIndent;
526 53 : mbTabAtLeftIndentForParagraphsInList = rSource.mbTabAtLeftIndentForParagraphsInList;
527 53 : }
528 :
529 85 : sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatibilityOptions1() const
530 : {
531 85 : return mn32DummyCompatibilityOptions1;
532 : }
533 :
534 178 : void sw::DocumentSettingManager::Setn32DummyCompatibilityOptions1( const sal_uInt32 CompatibilityOptions1 )
535 : {
536 178 : mn32DummyCompatibilityOptions1 = CompatibilityOptions1;
537 178 : }
538 :
539 85 : sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatibilityOptions2() const
540 : {
541 85 : return mn32DummyCompatibilityOptions2;
542 : }
543 :
544 178 : void sw::DocumentSettingManager::Setn32DummyCompatibilityOptions2( const sal_uInt32 CompatibilityOptions2 )
545 : {
546 178 : mn32DummyCompatibilityOptions2 = CompatibilityOptions2;
547 355 : }
548 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|