LCOV - code coverage report
Current view: top level - sw/source/core/doc - DocumentSettingManager.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 262 278 94.2 %
Date: 2014-11-03 Functions: 21 22 95.5 %
Legend: Lines: hit not hit

          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        5052 : sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
      40             :     :m_rDoc(rDoc),
      41             :     mnLinkUpdMode( GLOBALSETTING ),
      42             :     meFldUpdMode( 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             :     mApplyParagraphMarkFormatToNumbering(false),
      85        5052 :     mbLastBrowseMode( false )
      86             : 
      87             :     // COMPATIBILITY FLAGS END
      88             : {
      89             :     // COMPATIBILITY FLAGS START
      90             : 
      91             :     // Note: Any non-hidden compatibility flag should obtain its default
      92             :     // by asking SvtCompatibilityOptions, see below.
      93             : 
      94        5052 :     const SvtCompatibilityOptions aOptions;
      95        5052 :     mbParaSpaceMax                      = aOptions.IsAddSpacing();
      96        5052 :     mbParaSpaceMaxAtPages               = aOptions.IsAddSpacingAtPages();
      97        5052 :     mbTabCompat                         = !aOptions.IsUseOurTabStops();
      98        5052 :     mbUseVirtualDevice                  = !aOptions.IsUsePrtDevice();
      99        5052 :     mbAddExternalLeading                = !aOptions.IsNoExtLeading();
     100        5052 :     mbOldLineSpacing                    = aOptions.IsUseLineSpacing();
     101        5052 :     mbAddParaSpacingToTableCells        = aOptions.IsAddTableSpacing();
     102        5052 :     mbUseFormerObjectPos                = aOptions.IsUseObjectPositioning();
     103        5052 :     mbUseFormerTextWrapping             = aOptions.IsUseOurTextWrapping();
     104        5052 :     mbConsiderWrapOnObjPos              = aOptions.IsConsiderWrappingStyle();
     105             : 
     106        5052 :     mbDoNotJustifyLinesWithManualBreak      = !aOptions.IsExpandWordSpace();
     107             : 
     108             :     // COMPATIBILITY FLAGS END
     109             : 
     110        5052 : }
     111             : 
     112             : 
     113       10090 : sw::DocumentSettingManager::~DocumentSettingManager()
     114             : {
     115       10090 : }
     116             : 
     117             : /* IDocumentSettingAccess */
     118    12639061 : bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
     119             : {
     120    12639061 :     switch (id)
     121             :     {
     122             :         // COMPATIBILITY FLAGS START
     123       76523 :         case PARA_SPACE_MAX: return mbParaSpaceMax; //(n8Dummy1 & DUMMY_PARASPACEMAX);
     124       96814 :         case PARA_SPACE_MAX_AT_PAGES: return mbParaSpaceMaxAtPages; //(n8Dummy1 & DUMMY_PARASPACEMAX_AT_PAGES);
     125      298605 :         case TAB_COMPAT: return mbTabCompat; //(n8Dummy1 & DUMMY_TAB_COMPAT);
     126      130419 :         case ADD_FLY_OFFSETS: return mbAddFlyOffsets; //(n8Dummy2 & DUMMY_ADD_FLY_OFFSETS);
     127     2040483 :         case ADD_EXT_LEADING: return mbAddExternalLeading; //(n8Dummy2 & DUMMY_ADD_EXTERNAL_LEADING);
     128     3519000 :         case USE_VIRTUAL_DEVICE: return mbUseVirtualDevice; //(n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE);
     129         352 :         case USE_HIRES_VIRTUAL_DEVICE: return mbUseHiResolutionVirtualDevice; //(n8Dummy2 & DUMMY_USE_HIRES_VIR_DEV);
     130        5148 :         case OLD_NUMBERING: return mbOldNumbering;
     131      433999 :         case OLD_LINE_SPACING: return mbOldLineSpacing;
     132       46788 :         case ADD_PARA_SPACING_TO_TABLE_CELLS: return mbAddParaSpacingToTableCells;
     133       46316 :         case USE_FORMER_OBJECT_POS: return mbUseFormerObjectPos;
     134      192966 :         case USE_FORMER_TEXT_WRAPPING: return mbUseFormerTextWrapping;
     135     1296900 :         case CONSIDER_WRAP_ON_OBJECT_POSITION: return mbConsiderWrapOnObjPos;
     136         702 :         case DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK: return mbDoNotJustifyLinesWithManualBreak;
     137      590571 :         case IGNORE_FIRST_LINE_INDENT_IN_NUMBERING: return mbIgnoreFirstLineIndentInNumbering;
     138          58 :         case OUTLINE_LEVEL_YIELDS_OUTLINE_RULE: return mbOutlineLevelYieldsOutlineRule;
     139        9498 :         case TABLE_ROW_KEEP: return mbTableRowKeep;
     140      147442 :         case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation;
     141        9122 :         case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage;
     142             :         // #i68949#
     143        5773 :         case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames;
     144        5088 :         case UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
     145      398629 :         case TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent;
     146       70050 :         case PROTECT_FORM: return mbProtectForm;
     147             :         // #i89181#
     148        1060 :         case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
     149      877480 :         case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
     150      285300 :         case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
     151      103228 :         case SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66;
     152       28710 :         case TAB_OVERFLOW: return mbTabOverflow;
     153      161901 :         case UNBREAKABLE_NUMBERINGS: return mbUnbreakableNumberings;
     154         345 :         case CLIPPED_PICTURES: return mbClippedPictures;
     155       12768 :         case BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
     156      260577 :         case TAB_OVER_MARGIN: return mbTabOverMargin;
     157         955 :         case SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
     158       17936 :         case PROP_LINE_SPACING_SHRINKS_FIRST_LINE: return mbPropLineSpacingShrinksFirstLine;
     159             : 
     160       30409 :         case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the SwViewShell has to be asked!
     161      779608 :         case HTML_MODE: return mbHTMLMode;
     162        5858 :         case GLOBAL_DOCUMENT: return mbIsGlobalDoc;
     163          62 :         case GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks;
     164       10340 :         case LABEL_DOCUMENT: return mbIsLabelDoc;
     165       15524 :         case PURGE_OLE: return mbPurgeOLE;
     166       94332 :         case KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation;
     167        8472 :         case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
     168          58 :         case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
     169       41726 :         case STYLES_NODEFAULT: return mbStylesNoDefault;
     170      459534 :         case FLOATTABLE_NOMARGINS: return mbFloattableNomargins;
     171       12242 :         case EMBED_FONTS: return mEmbedFonts;
     172         918 :         case EMBED_SYSTEM_FONTS: return mEmbedSystemFonts;
     173        8472 :         case APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: return mApplyParagraphMarkFormatToNumbering;
     174             :         default:
     175             :             OSL_FAIL("Invalid setting id");
     176             :     }
     177           0 :     return false;
     178             : }
     179             : 
     180      148900 : void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
     181             : {
     182      148900 :     switch (id)
     183             :     {
     184             :         // COMPATIBILITY FLAGS START
     185             :         case PARA_SPACE_MAX:
     186        3986 :             mbParaSpaceMax = value;
     187        3986 :             break;
     188             :         case PARA_SPACE_MAX_AT_PAGES:
     189         496 :             mbParaSpaceMaxAtPages = value;
     190         496 :             break;
     191             :         case TAB_COMPAT:
     192         496 :             mbTabCompat = value;
     193         496 :             break;
     194             :         case ADD_FLY_OFFSETS:
     195        3292 :             mbAddFlyOffsets = value;
     196        3292 :             break;
     197             :         case ADD_EXT_LEADING:
     198         500 :             mbAddExternalLeading = value;
     199         500 :             break;
     200             :         case USE_VIRTUAL_DEVICE:
     201         202 :             mbUseVirtualDevice = value;
     202         202 :             break;
     203             :         case USE_HIRES_VIRTUAL_DEVICE:
     204         202 :             mbUseHiResolutionVirtualDevice = value;
     205         202 :             break;
     206             :         case OLD_NUMBERING:
     207        3294 :             if (mbOldNumbering != value)
     208             :             {
     209           8 :                 mbOldNumbering = value;
     210             : 
     211           8 :                 const SwNumRuleTbl& rNmTbl = m_rDoc.GetNumRuleTbl();
     212          16 :                 for( sal_uInt16 n = 0; n < rNmTbl.size(); ++n )
     213           8 :                     rNmTbl[n]->SetInvalidRule(true);
     214             : 
     215           8 :                 m_rDoc.UpdateNumRule();
     216             : 
     217           8 :                 SwNumRule *pOutlineRule = m_rDoc.GetOutlineNumRule();
     218           8 :                 if (pOutlineRule)
     219             :                 {
     220           8 :                     pOutlineRule->Validate();
     221             :                     // counting of phantoms depends on <IsOldNumbering()>
     222           8 :                     pOutlineRule->SetCountPhantoms( !mbOldNumbering );
     223             :                 }
     224             :             }
     225        3294 :             break;
     226             :         case OLD_LINE_SPACING:
     227        3296 :             mbOldLineSpacing = value;
     228        3296 :             break;
     229             :         case ADD_PARA_SPACING_TO_TABLE_CELLS:
     230        3296 :             mbAddParaSpacingToTableCells = value;
     231        3296 :             break;
     232             :         case USE_FORMER_OBJECT_POS:
     233        3296 :             mbUseFormerObjectPos = value;
     234        3296 :             break;
     235             :         case USE_FORMER_TEXT_WRAPPING:
     236        3294 :             mbUseFormerTextWrapping = value;
     237        3294 :             break;
     238             :         case CONSIDER_WRAP_ON_OBJECT_POSITION:
     239        3294 :             mbConsiderWrapOnObjPos = value;
     240        3294 :             break;
     241             :         case DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK:
     242         496 :             mbDoNotJustifyLinesWithManualBreak = value;
     243         496 :             break;
     244             :         case IGNORE_FIRST_LINE_INDENT_IN_NUMBERING:
     245        3294 :             mbIgnoreFirstLineIndentInNumbering = value;
     246        3294 :             break;
     247             : 
     248             :         case OUTLINE_LEVEL_YIELDS_OUTLINE_RULE:
     249         310 :             mbOutlineLevelYieldsOutlineRule = value;
     250         310 :             break;
     251             : 
     252             :         case TABLE_ROW_KEEP:
     253        3294 :             mbTableRowKeep = value;
     254        3294 :             break;
     255             : 
     256             :         case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
     257        3292 :             mbIgnoreTabsAndBlanksForLineCalculation = value;
     258        3292 :             break;
     259             : 
     260             :         case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
     261         312 :             mbDoNotCaptureDrawObjsOnPage = value;
     262         312 :             break;
     263             : 
     264             :         // #i68949#
     265             :         case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
     266         310 :             mbClipAsCharacterAnchoredWriterFlyFrames = value;
     267         310 :             break;
     268             : 
     269             :         case UNIX_FORCE_ZERO_EXT_LEADING:
     270         310 :             mbUnixForceZeroExtLeading = value;
     271         310 :             break;
     272             : 
     273             :         case PROTECT_FORM:
     274         492 :             mbProtectForm = value;
     275         492 :             break;
     276             : 
     277             :         case TABS_RELATIVE_TO_INDENT:
     278        3972 :             mbTabRelativeToIndent = value;
     279        3972 :             break;
     280             :         // #i89181#
     281             :         case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
     282         308 :             mbTabAtLeftIndentForParagraphsInList = value;
     283         308 :             break;
     284             : 
     285             :         case INVERT_BORDER_SPACING:
     286        3272 :             mbInvertBorderSpacing = value;
     287        3272 :             break;
     288             : 
     289             :         case COLLAPSE_EMPTY_CELL_PARA:
     290        3272 :             mbCollapseEmptyCellPara = value;
     291        3272 :             break;
     292             : 
     293             :         case SMALL_CAPS_PERCENTAGE_66:
     294         310 :             mbSmallCapsPercentage66 = value;
     295         310 :             break;
     296             : 
     297             :         case TAB_OVERFLOW:
     298        3294 :             mbTabOverflow = value;
     299        3294 :             break;
     300             : 
     301             :         case UNBREAKABLE_NUMBERINGS:
     302        3294 :             mbUnbreakableNumberings = value;
     303        3294 :             break;
     304             : 
     305             :         case CLIPPED_PICTURES:
     306        3294 :             mbClippedPictures = value;
     307        3294 :             break;
     308             : 
     309             :         case BACKGROUND_PARA_OVER_DRAWINGS:
     310        3108 :             mbBackgroundParaOverDrawings = value;
     311        3108 :             break;
     312             : 
     313             :         case TAB_OVER_MARGIN:
     314        3294 :             mbTabOverMargin = value;
     315        3294 :             break;
     316             : 
     317             :         case SURROUND_TEXT_WRAP_SMALL:
     318        3840 :             mbSurroundTextWrapSmall = value;
     319        3840 :             break;
     320             : 
     321             :         case PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
     322        3294 :             mbPropLineSpacingShrinksFirstLine = value;
     323        3294 :             break;
     324             : 
     325             :         // COMPATIBILITY FLAGS END
     326             : 
     327             :         case BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available
     328        4756 :             mbLastBrowseMode = value;
     329        4756 :             break;
     330             : 
     331             :         case HTML_MODE:
     332       12346 :             mbHTMLMode = value;
     333       12346 :             break;
     334             : 
     335             :         case GLOBAL_DOCUMENT:
     336           0 :             mbIsGlobalDoc = value;
     337           0 :             break;
     338             : 
     339             :         case GLOBAL_DOCUMENT_SAVE_LINKS:
     340         310 :             mbGlblDocSaveLinks = value;
     341         310 :             break;
     342             : 
     343             :         case LABEL_DOCUMENT:
     344         310 :             mbIsLabelDoc = value;
     345         310 :             break;
     346             : 
     347             :         case PURGE_OLE:
     348       31048 :             mbPurgeOLE = value;
     349       31048 :             break;
     350             : 
     351             :         case KERN_ASIAN_PUNCTUATION:
     352        5224 :             mbKernAsianPunctuation = value;
     353        5224 :             break;
     354             : 
     355             :         case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
     356        3294 :             mbDoNotResetParaAttrsForNumFont = value;
     357        3294 :             break;
     358             :         case MATH_BASELINE_ALIGNMENT:
     359        5014 :             mbMathBaselineAlignment  = value;
     360        5014 :             break;
     361             :         case STYLES_NODEFAULT:
     362        3714 :             mbStylesNoDefault  = value;
     363        3714 :             break;
     364             :         case FLOATTABLE_NOMARGINS:
     365        3044 :             mbFloattableNomargins = value;
     366        3044 :             break;
     367             :         case EMBED_FONTS:
     368         236 :             mEmbedFonts = value;
     369         236 :             break;
     370             :         case EMBED_SYSTEM_FONTS:
     371         424 :             mEmbedSystemFonts = value;
     372         424 :             break;
     373             :         case APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING:
     374        3574 :             mApplyParagraphMarkFormatToNumbering = value;
     375        3574 :             break;
     376             :         default:
     377             :             OSL_FAIL("Invalid setting id");
     378             :     }
     379      148900 : }
     380             : 
     381             : const css::i18n::ForbiddenCharacters*
     382       54163 :     sw::DocumentSettingManager::getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const
     383             : {
     384       54163 :     const css::i18n::ForbiddenCharacters* pRet = 0;
     385       54163 :     if( mxForbiddenCharsTable.is() )
     386       54163 :         pRet = mxForbiddenCharsTable->GetForbiddenCharacters( nLang, false );
     387       54163 :     if( bLocaleData && !pRet && g_pBreakIt )
     388       50729 :         pRet = &g_pBreakIt->GetForbidden( (LanguageType)nLang );
     389       54163 :     return pRet;
     390             : }
     391             : 
     392         144 : void sw::DocumentSettingManager::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
     393             :                                    /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars )
     394             : {
     395         144 :     if( !mxForbiddenCharsTable.is() )
     396             :     {
     397           0 :         mxForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
     398             :     }
     399         144 :     mxForbiddenCharsTable->SetForbiddenCharacters( nLang, rFChars );
     400             : 
     401         144 :     SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
     402         144 :     if( pDrawModel )
     403             :     {
     404         144 :         pDrawModel->SetForbiddenCharsTable( mxForbiddenCharsTable );
     405         144 :         if( !m_rDoc.IsInReading() )
     406           0 :             pDrawModel->ReformatAllTextObjects();
     407             :     }
     408             : 
     409         144 :     SwRootFrm* pTmpRoot = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
     410         144 :     if( pTmpRoot && !m_rDoc.IsInReading() )
     411             :     {
     412           0 :         pTmpRoot->StartAllAction();
     413           0 :         std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
     414           0 :         std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
     415           0 :         pTmpRoot->EndAllAction();
     416             :     }
     417         144 :     m_rDoc.getIDocumentState().SetModified();
     418         144 : }
     419             : 
     420        5586 : rtl::Reference<SvxForbiddenCharactersTable>& sw::DocumentSettingManager::getForbiddenCharacterTable()
     421             : {
     422        5586 :     if( !mxForbiddenCharsTable.is() )
     423             :     {
     424        5052 :         mxForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
     425             :     }
     426        5586 :     return mxForbiddenCharsTable;
     427             : }
     428             : 
     429           0 : const rtl::Reference<SvxForbiddenCharactersTable>& sw::DocumentSettingManager::getForbiddenCharacterTable() const
     430             : {
     431           0 :     return mxForbiddenCharsTable;
     432             : }
     433             : 
     434        4078 : sal_uInt16 sw::DocumentSettingManager::getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const
     435             : {
     436        4078 :     sal_uInt16 nRet = mnLinkUpdMode;
     437        4078 :     if( bGlobalSettings && GLOBALSETTING == nRet )
     438        3728 :         nRet = SW_MOD()->GetLinkUpdMode(get(IDocumentSettingAccess::HTML_MODE));
     439        4078 :     return nRet;
     440             : }
     441             : 
     442        5042 : void sw::DocumentSettingManager::setLinkUpdateMode( /*[in]*/sal_uInt16 eMode )
     443             : {
     444        5042 :     mnLinkUpdMode = eMode;
     445        5042 : }
     446             : 
     447         878 : SwFldUpdateFlags sw::DocumentSettingManager::getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const
     448             : {
     449         878 :     SwFldUpdateFlags eRet = meFldUpdMode;
     450         878 :     if( bGlobalSettings && AUTOUPD_GLOBALSETTING == eRet )
     451         482 :         eRet = SW_MOD()->GetFldUpdateFlags(get(IDocumentSettingAccess::HTML_MODE));
     452         878 :     return eRet;
     453             : }
     454             : 
     455        5352 : void sw::DocumentSettingManager::setFieldUpdateFlags(/*[in]*/SwFldUpdateFlags eMode )
     456             : {
     457        5352 :     meFldUpdMode = eMode;
     458        5352 : }
     459             : 
     460       89509 : SwCharCompressType sw::DocumentSettingManager::getCharacterCompressionType() const
     461             : {
     462       89509 :     return meChrCmprType;
     463             : }
     464             : 
     465        5224 : void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
     466             : {
     467        5224 :     if( meChrCmprType != n )
     468             :     {
     469          10 :         meChrCmprType = n;
     470             : 
     471          10 :         SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
     472          10 :         if( pDrawModel )
     473             :         {
     474          10 :             pDrawModel->SetCharCompressType( static_cast<sal_uInt16>(n) );
     475          10 :             if( !m_rDoc.IsInReading() )
     476           0 :                 pDrawModel->ReformatAllTextObjects();
     477             :         }
     478             : 
     479          10 :         SwRootFrm* pTmpRoot = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
     480          10 :         if( pTmpRoot && !m_rDoc.IsInReading() )
     481             :         {
     482           0 :             pTmpRoot->StartAllAction();
     483           0 :             std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
     484           0 :             std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
     485           0 :             pTmpRoot->EndAllAction();
     486             :         }
     487          10 :         m_rDoc.getIDocumentState().SetModified();
     488             :     }
     489        5224 : }
     490             : 
     491             : 
     492          16 : void sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSettingManager& rSource)
     493             : {
     494          16 :     Setn32DummyCompatibilityOptions1( rSource.Getn32DummyCompatibilityOptions1() );
     495          16 :     Setn32DummyCompatibilityOptions2( rSource.Getn32DummyCompatibilityOptions2() );
     496             : 
     497          16 :     mbParaSpaceMax = rSource.mbParaSpaceMax;
     498          16 :     mbParaSpaceMaxAtPages = rSource.mbParaSpaceMaxAtPages;
     499          16 :     mbTabCompat = rSource.mbTabCompat;
     500          16 :     mbUseVirtualDevice = rSource.mbUseVirtualDevice;
     501          16 :     mbAddExternalLeading = rSource.mbAddExternalLeading;
     502          16 :     mbOldLineSpacing = rSource.mbOldLineSpacing;
     503          16 :     mbAddParaSpacingToTableCells = rSource.mbAddParaSpacingToTableCells;
     504          16 :     mbUseFormerObjectPos = rSource.mbUseFormerObjectPos;
     505          16 :     mbUseFormerTextWrapping = rSource.mbUseFormerTextWrapping;
     506          16 :     mbConsiderWrapOnObjPos = rSource.mbConsiderWrapOnObjPos;
     507          16 :     mbAddFlyOffsets = rSource.mbAddFlyOffsets;
     508          16 :     mbOldNumbering = rSource.mbOldNumbering;
     509          16 :     mbUseHiResolutionVirtualDevice = rSource.mbUseHiResolutionVirtualDevice;
     510          16 :     mbIgnoreFirstLineIndentInNumbering = rSource.mbIgnoreFirstLineIndentInNumbering;
     511          16 :     mbDoNotJustifyLinesWithManualBreak = rSource.mbDoNotJustifyLinesWithManualBreak;
     512          16 :     mbDoNotResetParaAttrsForNumFont = rSource.mbDoNotResetParaAttrsForNumFont;
     513          16 :     mbOutlineLevelYieldsOutlineRule = rSource.mbOutlineLevelYieldsOutlineRule;
     514          16 :     mbTableRowKeep = rSource.mbTableRowKeep;
     515          16 :     mbIgnoreTabsAndBlanksForLineCalculation = rSource.mbIgnoreTabsAndBlanksForLineCalculation;
     516          16 :     mbDoNotCaptureDrawObjsOnPage = rSource.mbDoNotCaptureDrawObjsOnPage;
     517          16 :     mbClipAsCharacterAnchoredWriterFlyFrames = rSource.mbClipAsCharacterAnchoredWriterFlyFrames;
     518          16 :     mbUnixForceZeroExtLeading = rSource.mbUnixForceZeroExtLeading;
     519          16 :     mbTabRelativeToIndent = rSource.mbTabRelativeToIndent;
     520          16 :     mbTabAtLeftIndentForParagraphsInList = rSource.mbTabAtLeftIndentForParagraphsInList;
     521          16 : }
     522             : 
     523          50 : sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatibilityOptions1() const
     524             : {
     525          50 :     return mn32DummyCompatibilityOptions1;
     526             : }
     527             : 
     528         202 : void sw::DocumentSettingManager::Setn32DummyCompatibilityOptions1( const sal_uInt32 CompatibilityOptions1 )
     529             : {
     530         202 :     mn32DummyCompatibilityOptions1 = CompatibilityOptions1;
     531         202 : }
     532             : 
     533          50 : sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatibilityOptions2() const
     534             : {
     535          50 :     return mn32DummyCompatibilityOptions2;
     536             : }
     537             : 
     538         202 : void sw::DocumentSettingManager::Setn32DummyCompatibilityOptions2( const sal_uInt32 CompatibilityOptions2 )
     539             : {
     540         202 :     mn32DummyCompatibilityOptions2 = CompatibilityOptions2;
     541         472 : }
     542             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10