LCOV - code coverage report
Current view: top level - sw/source/ui/app - docshini.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 237 290 81.7 %
Date: 2012-08-25 Functions: 17 22 77.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 321 748 42.9 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include <hintids.hxx>
      31                 :            : 
      32                 :            : #include <svx/dialogs.hrc>
      33                 :            : #include <i18npool/mslangid.hxx>
      34                 :            : #include <sot/storinfo.hxx>
      35                 :            : #include <sot/storage.hxx>
      36                 :            : #include <svl/zforlist.hxx>
      37                 :            : #include <svtools/ctrltool.hxx>
      38                 :            : #include <unotools/lingucfg.hxx>
      39                 :            : #include <sfx2/docfile.hxx>
      40                 :            : #include <sfx2/sfxmodelfactory.hxx>
      41                 :            : #include <sfx2/printer.hxx>
      42                 :            : #include <sfx2/bindings.hxx>
      43                 :            : #include <svl/asiancfg.hxx>
      44                 :            : #include <editeng/unolingu.hxx>
      45                 :            : #include <sfx2/request.hxx>
      46                 :            : #include <svl/intitem.hxx>
      47                 :            : #include <editeng/adjitem.hxx>
      48                 :            : #include <editeng/akrnitem.hxx>
      49                 :            : #include <linguistic/lngprops.hxx>
      50                 :            : #include <com/sun/star/document/UpdateDocMode.hpp>
      51                 :            : #include <com/sun/star/i18n/ScriptType.hpp>
      52                 :            : #include <rtl/logfile.hxx>
      53                 :            : #include <sfx2/docfilt.hxx>
      54                 :            : #include <svx/xtable.hxx>
      55                 :            : #include <svx/drawitem.hxx>
      56                 :            : #include <editeng/fhgtitem.hxx>
      57                 :            : #include <editeng/fontitem.hxx>
      58                 :            : #include <editeng/flstitem.hxx>
      59                 :            : #include <editeng/tstpitem.hxx>
      60                 :            : #include <editeng/langitem.hxx>
      61                 :            : #include <editeng/colritem.hxx>
      62                 :            : #include <editeng/hyznitem.hxx>
      63                 :            : #include <editeng/svxacorr.hxx>
      64                 :            : #include <vcl/svapp.hxx>
      65                 :            : #include <view.hxx>
      66                 :            : #include <prtopt.hxx>
      67                 :            : #include <fmtcol.hxx>
      68                 :            : #include <docsh.hxx>
      69                 :            : #include <wdocsh.hxx>
      70                 :            : #include <swmodule.hxx>
      71                 :            : #include <doc.hxx>
      72                 :            : #include <docfac.hxx>
      73                 :            : #include <docstyle.hxx>
      74                 :            : #include <shellio.hxx>
      75                 :            : #include <tox.hxx>
      76                 :            : #include <swdtflvr.hxx>
      77                 :            : #include <dbmgr.hxx>
      78                 :            : #include <usrpref.hxx>
      79                 :            : #include <fontcfg.hxx>
      80                 :            : #include <poolfmt.hxx>
      81                 :            : #include <modcfg.hxx>
      82                 :            : #include <globdoc.hxx>
      83                 :            : #include <ndole.hxx>
      84                 :            : #include <mdiexp.hxx>
      85                 :            : #include <unotxdoc.hxx>
      86                 :            : #include <linkenum.hxx>
      87                 :            : #include <swwait.hxx>
      88                 :            : #include <wrtsh.hxx>
      89                 :            : #include <swerror.h>
      90                 :            : #include <globals.hrc>
      91                 :            : 
      92                 :            : // #i18732#
      93                 :            : #include <fmtfollowtextflow.hxx>
      94                 :            : 
      95                 :            : #include <unochart.hxx>
      96                 :            : 
      97                 :            : // text grid
      98                 :            : #include <tgrditem.hxx>
      99                 :            : 
     100                 :            : using namespace ::com::sun::star::i18n;
     101                 :            : using namespace ::com::sun::star::lang;
     102                 :            : using namespace ::com::sun::star::uno;
     103                 :            : using namespace ::com::sun::star;
     104                 :            : using ::rtl::OUString;
     105                 :            : 
     106                 :            : 
     107                 :            : 
     108                 :            : /*--------------------------------------------------------------------
     109                 :            :     Description: Load Document
     110                 :            :  --------------------------------------------------------------------*/
     111                 :            : 
     112                 :            : 
     113                 :       1487 : sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
     114                 :            : {
     115                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDocShell::InitNew" );
     116                 :            : 
     117                 :       1487 :     sal_Bool bRet = SfxObjectShell::InitNew( xStor );
     118                 :            :     OSL_ENSURE( GetMapUnit() == MAP_TWIP, "map unit is not twip!" );
     119                 :       1487 :     sal_Bool bHTMLTemplSet = sal_False;
     120         [ +  + ]:       1487 :     if( bRet )
     121                 :            :     {
     122         [ +  - ]:       1484 :         AddLink();      // create pDoc / pIo if applicable
     123                 :            : 
     124 [ +  - ][ +  - ]:       1484 :         sal_Bool bWeb = ISA( SwWebDocShell );
     125         [ +  + ]:       1484 :         if ( bWeb )
     126         [ +  - ]:          4 :             bHTMLTemplSet = SetHTMLTemplate( *GetDoc() );// Styles from HTML.vor
     127 [ +  - ][ +  - ]:       1480 :         else if( ISA( SwGlobalDocShell ) )
                 [ -  + ]
     128         [ #  # ]:          0 :             GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);       // Globaldokument
     129                 :            : 
     130                 :            : 
     131         [ +  + ]:       1484 :         if ( GetCreateMode() ==  SFX_CREATE_MODE_EMBEDDED )
     132         [ +  - ]:        111 :             SwTransferable::InitOle( this, *pDoc );
     133                 :            : 
     134                 :            :         // set forbidden characters if necessary
     135         [ +  - ]:       1484 :         SvxAsianConfig aAsian;
     136         [ +  - ]:       1484 :         Sequence<lang::Locale> aLocales =  aAsian.GetStartEndCharLocales();
     137         [ -  + ]:       1484 :         if(aLocales.getLength())
     138                 :            :         {
     139                 :          0 :             const lang::Locale* pLocales = aLocales.getConstArray();
     140         [ #  # ]:          0 :             for(sal_Int32 i = 0; i < aLocales.getLength(); i++)
     141                 :            :             {
     142                 :          0 :                 ForbiddenCharacters aForbidden;
     143         [ #  # ]:          0 :                 aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine);
     144         [ #  # ]:          0 :                 LanguageType  eLang = SvxLocaleToLanguage(pLocales[i]);
     145         [ #  # ]:          0 :                 pDoc->setForbiddenCharacters( eLang, aForbidden);
     146                 :          0 :             }
     147                 :            :         }
     148                 :            :         pDoc->set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION,
     149 [ +  - ][ +  - ]:       1484 :                   !aAsian.IsKerningWesternTextOnly());
     150 [ +  - ][ +  - ]:       1484 :         pDoc->setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
     151 [ +  - ][ +  - ]:       1484 :         pDoc->setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
                 [ +  - ]
     152                 :            : 
     153         [ +  - ]:       1484 :         SubInitNew();
     154                 :            : 
     155                 :            :         // for all
     156                 :            : 
     157         [ +  - ]:       1484 :         SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
     158         [ +  - ]:       1484 :         SfxPrinter* pPrt = pDoc->getPrinter( false );
     159                 :            : 
     160         [ +  - ]:       1484 :         String sEntry;
     161                 :            :         sal_uInt16 aFontWhich[] =
     162                 :            :         {   RES_CHRATR_FONT,
     163                 :            :             RES_CHRATR_CJK_FONT,
     164                 :            :             RES_CHRATR_CTL_FONT
     165                 :       1484 :         };
     166                 :            :         sal_uInt16 aFontHeightWhich[] =
     167                 :            :         {
     168                 :            :             RES_CHRATR_FONTSIZE,
     169                 :            :             RES_CHRATR_CJK_FONTSIZE,
     170                 :            :             RES_CHRATR_CTL_FONTSIZE
     171                 :       1484 :         };
     172                 :            :         sal_uInt16 aFontIds[] =
     173                 :            :         {
     174                 :            :             FONT_STANDARD,
     175                 :            :             FONT_STANDARD_CJK,
     176                 :            :             FONT_STANDARD_CTL
     177                 :       1484 :         };
     178                 :            :         sal_uInt16 nFontTypes[] =
     179                 :            :         {
     180                 :            :             DEFAULTFONT_LATIN_TEXT,
     181                 :            :             DEFAULTFONT_CJK_TEXT,
     182                 :            :             DEFAULTFONT_CTL_TEXT
     183                 :       1484 :         };
     184                 :            :         sal_uInt16 aLangTypes[] =
     185                 :            :         {
     186                 :            :             RES_CHRATR_LANGUAGE,
     187                 :            :             RES_CHRATR_CJK_LANGUAGE,
     188                 :            :             RES_CHRATR_CTL_LANGUAGE
     189                 :       1484 :         };
     190                 :            : 
     191         [ +  + ]:       5936 :         for(sal_uInt8 i = 0; i < 3; i++)
     192                 :            :         {
     193                 :       4452 :             sal_uInt16 nFontWhich = aFontWhich[i];
     194                 :       4452 :             sal_uInt16 nFontId = aFontIds[i];
     195                 :       4452 :             SvxFontItem* pFontItem = 0;
     196         [ +  - ]:       4452 :             const SvxLanguageItem& rLang = (const SvxLanguageItem&)pDoc->GetDefault( aLangTypes[i] );
     197                 :       4452 :             LanguageType eLanguage = rLang.GetLanguage();
     198 [ +  + ][ +  - ]:       4452 :             if(!pStdFont->IsFontDefault(nFontId))
     199                 :            :             {
     200         [ +  - ]:       1836 :                 sEntry = pStdFont->GetFontFor(nFontId);
     201                 :            : 
     202         [ +  - ]:       1836 :                 Font aFont( sEntry, Size( 0, 10 ) );
     203         [ -  + ]:       1836 :                 if( pPrt )
     204                 :            :                 {
     205 [ #  # ][ #  # ]:          0 :                     aFont = pPrt->GetFontMetric( aFont );
                 [ #  # ]
     206                 :            :                 }
     207                 :            : 
     208                 :            :                 pFontItem = new SvxFontItem(aFont.GetFamily(), aFont.GetName(),
     209 [ +  - ][ +  - ]:       1836 :                                             aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich);
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     210                 :            :             }
     211                 :            :             else
     212                 :            :             {
     213                 :            :                 // #107782# OJ use korean language if latin was used
     214         [ +  + ]:       2616 :                 if ( i == 0 )
     215                 :            :                 {
     216 [ +  - ][ +  - ]:        872 :                     LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
     217 [ +  - ][ -  + ]:        872 :                     if (MsLangId::isKorean(eUiLanguage))
     218                 :          0 :                         eLanguage = eUiLanguage;
     219                 :            :                 }
     220                 :            : 
     221                 :            :                 Font aLangDefFont = OutputDevice::GetDefaultFont(
     222                 :       2616 :                     nFontTypes[i],
     223                 :            :                     eLanguage,
     224         [ +  - ]:       2616 :                     DEFAULTFONT_FLAGS_ONLYONE );
     225                 :            :                 pFontItem = new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetName(),
     226 [ +  - ][ +  - ]:       2616 :                                     aEmptyStr, aLangDefFont.GetPitch(), aLangDefFont.GetCharSet(), nFontWhich);
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     227                 :            :             }
     228         [ +  - ]:       4452 :             pDoc->SetDefault(*pFontItem);
     229         [ +  + ]:       4452 :             if( !bHTMLTemplSet )
     230                 :            :             {
     231         [ +  - ]:       4440 :                 SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
     232         [ +  - ]:       4440 :                 pColl->ResetFmtAttr(nFontWhich);
     233                 :            :             }
     234 [ +  - ][ +  - ]:       4452 :             delete pFontItem;
     235         [ +  - ]:       4452 :             sal_Int32 nFontHeight = pStdFont->GetFontHeight( FONT_STANDARD, i, eLanguage );
     236         [ -  + ]:       4452 :             if(nFontHeight <= 0)
     237         [ #  # ]:          0 :                 nFontHeight = pStdFont->GetDefaultHeightFor( nFontId, eLanguage );
     238 [ +  - ][ +  - ]:       4452 :             pDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] ));
                 [ +  - ]
     239         [ +  + ]:       4452 :             if( !bHTMLTemplSet )
     240                 :            :             {
     241         [ +  - ]:       4440 :                 SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
     242         [ +  - ]:       4440 :                 pColl->ResetFmtAttr(aFontHeightWhich[i]);
     243                 :            :             }
     244                 :            : 
     245                 :            :         }
     246                 :            :         sal_uInt16 aFontIdPoolId[] =
     247                 :            :         {
     248                 :            :             FONT_OUTLINE,       RES_POOLCOLL_HEADLINE_BASE,
     249                 :            :             FONT_LIST,          RES_POOLCOLL_NUMBUL_BASE,
     250                 :            :             FONT_CAPTION,       RES_POOLCOLL_LABEL,
     251                 :            :             FONT_INDEX,         RES_POOLCOLL_REGISTER_BASE,
     252                 :            :             FONT_OUTLINE_CJK,   RES_POOLCOLL_HEADLINE_BASE,
     253                 :            :             FONT_LIST_CJK,      RES_POOLCOLL_NUMBUL_BASE,
     254                 :            :             FONT_CAPTION_CJK,   RES_POOLCOLL_LABEL,
     255                 :            :             FONT_INDEX_CJK,     RES_POOLCOLL_REGISTER_BASE,
     256                 :            :             FONT_OUTLINE_CTL,   RES_POOLCOLL_HEADLINE_BASE,
     257                 :            :             FONT_LIST_CTL,      RES_POOLCOLL_NUMBUL_BASE,
     258                 :            :             FONT_CAPTION_CTL,   RES_POOLCOLL_LABEL,
     259                 :            :             FONT_INDEX_CTL,     RES_POOLCOLL_REGISTER_BASE
     260                 :       1484 :         };
     261                 :            : 
     262                 :       1484 :         sal_uInt16 nFontWhich = RES_CHRATR_FONT;
     263                 :       1484 :         sal_uInt16 nFontHeightWhich = RES_CHRATR_FONTSIZE;
     264         [ +  - ]:       1484 :         LanguageType eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage();
     265         [ +  + ]:      19292 :         for(sal_uInt8 nIdx = 0; nIdx < 24; nIdx += 2)
     266                 :            :         {
     267         [ +  + ]:      17808 :             if(nIdx == 8)
     268                 :            :             {
     269                 :       1484 :                 nFontWhich = RES_CHRATR_CJK_FONT;
     270                 :       1484 :                 nFontHeightWhich = RES_CHRATR_CJK_FONTSIZE;
     271         [ +  - ]:       1484 :                 eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage();
     272                 :            :             }
     273         [ +  + ]:      16324 :             else if(nIdx == 16)
     274                 :            :             {
     275                 :       1484 :                 nFontWhich = RES_CHRATR_CTL_FONT;
     276                 :       1484 :                 nFontHeightWhich = RES_CHRATR_CTL_FONTSIZE;
     277         [ +  - ]:       1484 :                 eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage();
     278                 :            :             }
     279                 :      17808 :             SwTxtFmtColl *pColl = 0;
     280 [ +  - ][ +  + ]:      17808 :             if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx]))
     281                 :            :             {
     282         [ +  - ]:       9960 :                 sEntry = pStdFont->GetFontFor(aFontIdPoolId[nIdx]);
     283                 :            : 
     284         [ +  - ]:       9960 :                 Font aFont( sEntry, Size( 0, 10 ) );
     285         [ -  + ]:       9960 :                 if( pPrt )
     286 [ #  # ][ #  # ]:          0 :                     aFont = pPrt->GetFontMetric( aFont );
                 [ #  # ]
     287                 :            : 
     288         [ +  - ]:       9960 :                 pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
     289 [ +  + ][ +  - ]:       9972 :                 if( !bHTMLTemplSet ||
                 [ +  - ]
     290                 :         12 :                     SFX_ITEM_SET != pColl->GetAttrSet().GetItemState(
     291         [ +  - ]:         12 :                                                     nFontWhich, sal_False ) )
     292                 :            :                 {
     293         [ +  - ]:       9960 :                     pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
     294 [ +  - ][ +  - ]:      19920 :                                                   aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     295         [ +  - ]:       9960 :                 }
     296                 :            :             }
     297         [ +  - ]:      17808 :             sal_Int32 nFontHeight = pStdFont->GetFontHeight( static_cast< sal_Int8 >(aFontIdPoolId[nIdx]), 0, eLanguage );
     298         [ -  + ]:      17808 :             if(nFontHeight <= 0)
     299         [ #  # ]:          0 :                 nFontHeight = pStdFont->GetDefaultHeightFor( aFontIdPoolId[nIdx], eLanguage );
     300         [ +  + ]:      17808 :             if(!pColl)
     301         [ +  - ]:       7848 :                 pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]);
     302 [ +  - ][ +  - ]:      17808 :             SvxFontHeightItem aFontHeight( (const SvxFontHeightItem&)pColl->GetFmtAttr( nFontHeightWhich, sal_True ));
     303         [ +  + ]:      17808 :             if(aFontHeight.GetHeight() != sal::static_int_cast<sal_uInt32, sal_Int32>(nFontHeight))
     304                 :            :             {
     305         [ +  - ]:       7420 :                 aFontHeight.SetHeight(nFontHeight);
     306         [ +  - ]:       7420 :                 pColl->SetFmtAttr( aFontHeight );
     307                 :            :             }
     308         [ +  - ]:      17808 :         }
     309                 :            : 
     310                 :            :         // the default for documents created via 'File/New' should be 'on'
     311                 :            :         // (old documents, where this property was not yet implemented, will get the
     312                 :            :         // value 'false' in the SwDoc c-tor)
     313                 :            :         pDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
     314 [ +  - ][ +  - ]:       1484 :                 SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() );
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     315                 :            :     }
     316                 :            : 
     317                 :            :     /* #106748# If the default frame direction of a document is RTL
     318                 :            :         the default adjusment is to the right. */
     319   [ +  +  -  + ]:       2970 :     if( !bHTMLTemplSet &&
                 [ -  + ]
     320                 :       1483 :         FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) )
     321         [ #  # ]:          0 :         pDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) );
     322                 :            : 
     323                 :            :     // OD 09.10.2003 #i18732# - set dynamic pool default for
     324                 :            :     // item RES_FOLLOW_TEXT_FLOW to sal_False for *new document*.
     325                 :            :     // Thus, redo this change in method <SwDoc::RemoveAllFmtLanguageDependencies()>,
     326                 :            :     // which is called from <SwDocShell::ConvertFrom(..)> in order to restore
     327                 :            :     // the static pool default.
     328         [ +  - ]:       1487 :     pDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) );
     329                 :            : 
     330                 :            : // #i29550#
     331         [ +  - ]:       1487 :     pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) );
     332                 :            : // <-- collapsing
     333                 :            : 
     334                 :            :     //#i16874# AutoKerning as default for new documents
     335         [ +  - ]:       1487 :     pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );
     336                 :            : 
     337                 :       1487 :     pDoc->SetDrawDefaults();
     338                 :            : 
     339                 :            :     // #i42080# - Due to the several calls of method <SetDefault(..)>
     340                 :            :     // at the document instance, the document is modified. Thus, reset this
     341                 :            :     // status here. Note: In method <SubInitNew()> this is also done.
     342                 :       1487 :     pDoc->ResetModified();
     343                 :            : 
     344                 :       1487 :     return bRet;
     345                 :            : }
     346                 :            : 
     347                 :            : /*--------------------------------------------------------------------
     348                 :            :     Description:    Ctor with SfxCreateMode ?????
     349                 :            :  --------------------------------------------------------------------*/
     350                 :            : 
     351                 :            : 
     352                 :        211 : SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
     353                 :            :     SfxObjectShell ( eMode ),
     354                 :            :     pDoc(0),
     355                 :            :     pFontList(0),
     356                 :            :     pView( 0 ),
     357                 :            :     pWrtShell( 0 ),
     358                 :            :     pOLEChildList( 0 ),
     359                 :            :     nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
     360 [ +  - ][ +  - ]:        211 :     bInUpdateFontList(false)
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     361                 :            : {
     362                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDocShell::SwDocShell" );
     363 [ +  - ][ +  - ]:        211 :     Init_Impl();
     364                 :        211 : }
     365                 :            : 
     366                 :            : /*--------------------------------------------------------------------
     367                 :            :     Description: Ctor / Dtor
     368                 :            :  --------------------------------------------------------------------*/
     369                 :            : 
     370                 :            : 
     371                 :       1318 : SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
     372                 :            :     SfxObjectShell ( i_nSfxCreationFlags ),
     373                 :            :     pDoc(0),
     374                 :            :     pFontList(0),
     375                 :            :     pView( 0 ),
     376                 :            :     pWrtShell( 0 ),
     377                 :            :     pOLEChildList( 0 ),
     378                 :            :     nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
     379 [ +  - ][ +  - ]:       1318 :     bInUpdateFontList(false)
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     380                 :            : {
     381                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDocShell::SwDocShell" );
     382 [ +  - ][ #  # ]:       1318 :     Init_Impl();
     383                 :       1318 : }
     384                 :            : 
     385                 :            : /*--------------------------------------------------------------------
     386                 :            :     Description: Ctor / Dtor
     387                 :            :  --------------------------------------------------------------------*/
     388                 :            : 
     389                 :            : 
     390                 :         24 : SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
     391                 :            :     SfxObjectShell ( eMode ),
     392                 :            :     pDoc(pD),
     393                 :            :     pFontList(0),
     394                 :            :     pView( 0 ),
     395                 :            :     pWrtShell( 0 ),
     396                 :            :     pOLEChildList( 0 ),
     397                 :            :     nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
     398 [ +  - ][ +  - ]:         24 :     bInUpdateFontList(false)
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     399                 :            : {
     400                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDocShell::SwDocShell" );
     401 [ +  - ][ #  # ]:         24 :     Init_Impl();
     402                 :         24 : }
     403                 :            : 
     404                 :            : /*--------------------------------------------------------------------
     405                 :            :     Description:    Dtor
     406                 :            :  --------------------------------------------------------------------*/
     407                 :            : 
     408                 :            : 
     409 [ +  - ][ +  - ]:       4297 :  SwDocShell::~SwDocShell()
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
     410                 :            : {
     411                 :            :     // disable chart related objects now because in ~SwDoc it may be to late for this
     412 [ +  + ][ +  - ]:       1435 :     if( pDoc )
     413                 :            :     {
     414 [ +  - ][ +  - ]:       1432 :         pDoc->GetChartControllerHelper().Disconnect();
         [ +  - ][ +  - ]
     415 [ +  - ][ +  - ]:       1432 :         SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
     416 [ -  + ][ -  + ]:       1432 :         if (pPCD)
     417 [ #  # ][ #  # ]:          0 :             pPCD->dispose();
     418                 :            :     }
     419                 :            : 
     420 [ +  - ][ +  - ]:       1435 :     RemoveLink();
     421 [ +  + ][ +  - ]:       1435 :     delete pFontList;
         [ +  - ][ +  - ]
     422                 :            : 
     423                 :            :     // we, as BroadCaster also become our own Listener
     424                 :            :     // (for DocInfo/FileNames/....)
     425 [ +  - ][ +  - ]:       1435 :     EndListening( *this );
     426                 :            : 
     427 [ -  + ][ #  # ]:       1435 :     delete pOLEChildList;
         [ -  + ][ #  # ]
     428 [ +  - ][ +  - ]:       5728 : }
                 [ -  + ]
           [ #  #  #  # ]
         [ -  + ][ -  + ]
                 [ -  + ]
           [ #  #  #  # ]
     429                 :            : 
     430                 :       1553 : void  SwDocShell::Init_Impl()
     431                 :            : {
     432                 :       1553 :     SetPool(&SW_MOD()->GetPool());
     433 [ +  - ][ +  - ]:       1553 :     SetBaseModel(new SwXTextDocument(this));
                 [ +  - ]
     434                 :            :     // we, as BroadCaster also become our own Listener
     435                 :            :     // (for DocInfo/FileNames/....)
     436                 :       1553 :     StartListening( *this );
     437                 :            :     //position of the "Automatic" style filter for the stylist (app.src)
     438                 :       1553 :     SetAutoStyleFilterIndex(3);
     439                 :            : 
     440                 :            :     // set map unit to twip
     441                 :       1553 :     SetMapUnit( MAP_TWIP );
     442                 :       1553 : }
     443                 :            : /*--------------------------------------------------------------------
     444                 :            :     Description: AddLink
     445                 :            :  --------------------------------------------------------------------*/
     446                 :            : 
     447                 :            : 
     448                 :       1547 : void SwDocShell::AddLink()
     449                 :            : {
     450         [ +  + ]:       1547 :     if( !pDoc )
     451                 :            :     {
     452         [ +  - ]:       1523 :         SwDocFac aFactory;
     453         [ +  - ]:       1523 :         pDoc = aFactory.GetDoc();
     454         [ +  - ]:       1523 :         pDoc->acquire();
     455 [ +  - ][ +  - ]:       1523 :         pDoc->set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell) );
         [ +  - ][ +  - ]
     456                 :            :     }
     457                 :            :     else
     458         [ +  - ]:         24 :         pDoc->acquire();
     459         [ +  - ]:       1547 :     pDoc->SetDocShell( this );      // set the DocShell-Pointer for Doc
     460 [ +  - ][ +  - ]:       1547 :     uno::Reference< text::XTextDocument >  xDoc(GetBaseModel(), uno::UNO_QUERY);
     461 [ +  - ][ +  - ]:       1547 :     ((SwXTextDocument*)xDoc.get())->Reactivate(this);
                 [ +  - ]
     462                 :            : 
     463                 :       1547 :     SetPool(&pDoc->GetAttrPool());
     464                 :            : 
     465                 :            :     // most suitably not until a sdbcx::View is created!!!
     466         [ +  - ]:       1547 :     pDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl));
     467                 :       1547 : }
     468                 :            : 
     469                 :            : /*--------------------------------------------------------------------
     470                 :            :     Description:    create new FontList Change Printer
     471                 :            :  --------------------------------------------------------------------*/
     472                 :            : 
     473                 :            : 
     474                 :       1696 : void SwDocShell::UpdateFontList()
     475                 :            : {
     476         [ +  + ]:       1696 :     if(!bInUpdateFontList)
     477                 :            :     {
     478                 :       1687 :         bInUpdateFontList = true;
     479                 :            :         OSL_ENSURE(pDoc, "No Doc no FontList");
     480         [ +  - ]:       1687 :         if( pDoc )
     481                 :            :         {
     482         [ +  + ]:       1687 :             delete pFontList;
     483         [ +  - ]:       1687 :             pFontList = new FontList( pDoc->getReferenceDevice( true ) );
     484         [ +  - ]:       1687 :             PutItem( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) );
     485                 :            :         }
     486                 :       1687 :         bInUpdateFontList = false;
     487                 :            :     }
     488                 :       1696 : }
     489                 :            : 
     490                 :            : /*--------------------------------------------------------------------
     491                 :            :     Description: RemoveLink
     492                 :            :  --------------------------------------------------------------------*/
     493                 :            : 
     494                 :            : 
     495                 :       1435 : void SwDocShell::RemoveLink()
     496                 :            : {
     497                 :            :     // disconnect Uno-Object
     498 [ +  - ][ +  - ]:       1435 :     uno::Reference< text::XTextDocument >  xDoc(GetBaseModel(), uno::UNO_QUERY);
     499 [ +  - ][ +  - ]:       1435 :     ((SwXTextDocument*)xDoc.get())->Invalidate();
                 [ +  - ]
     500         [ +  - ]:       1435 :     aFinishedTimer.Stop();
     501         [ +  + ]:       1435 :     if(pDoc)
     502                 :            :     {
     503         [ +  - ]:       1432 :         if( mxBasePool.is() )
     504                 :            :         {
     505         [ +  - ]:       1432 :             static_cast<SwDocStyleSheetPool*>(mxBasePool.get())->dispose();
     506                 :       1432 :             mxBasePool.clear();
     507                 :            :         }
     508         [ +  - ]:       1432 :         sal_Int8 nRefCt = static_cast< sal_Int8 >(pDoc->release());
     509         [ +  - ]:       1432 :         pDoc->SetOle2Link(Link());
     510         [ +  - ]:       1432 :         pDoc->SetDocShell( 0 );
     511         [ +  + ]:       1432 :         if( !nRefCt )
     512 [ +  - ][ +  - ]:       1316 :             delete pDoc;
     513                 :       1432 :         pDoc = 0;       // we don't have the Doc anymore!!
     514                 :       1435 :     }
     515                 :       1435 : }
     516                 :         22 : void SwDocShell::InvalidateModel()
     517                 :            : {
     518                 :            :     // disconnect Uno-Object
     519 [ +  - ][ +  - ]:         22 :     uno::Reference< text::XTextDocument >  xDoc(GetBaseModel(), uno::UNO_QUERY);
     520 [ +  - ][ +  - ]:         22 :     ((SwXTextDocument*)xDoc.get())->Invalidate();
                 [ +  - ]
     521                 :         22 : }
     522                 :         22 : void SwDocShell::ReactivateModel()
     523                 :            : {
     524                 :            :     // disconnect Uno-Object
     525 [ +  - ][ +  - ]:         22 :     uno::Reference< text::XTextDocument >  xDoc(GetBaseModel(), uno::UNO_QUERY);
     526 [ +  - ][ +  - ]:         22 :     ((SwXTextDocument*)xDoc.get())->Reactivate(this);
                 [ +  - ]
     527                 :         22 : }
     528                 :            : 
     529                 :            : /*--------------------------------------------------------------------
     530                 :            :     Description: Load, Default-Format
     531                 :            :  --------------------------------------------------------------------*/
     532                 :            : 
     533                 :            : 
     534                 :         63 : sal_Bool  SwDocShell::Load( SfxMedium& rMedium )
     535                 :            : {
     536                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDocShell::Load" );
     537                 :         63 :     sal_Bool bRet = sal_False;
     538         [ +  - ]:         63 :     if( SfxObjectShell::Load( rMedium ))
     539                 :            :     {
     540                 :            :         RTL_LOGFILE_CONTEXT_TRACE( aLog, "after SfxInPlaceObject::Load" );
     541         [ -  + ]:         63 :         if( pDoc )              // for last version!!
     542         [ #  # ]:          0 :             RemoveLink();       // release the existing
     543                 :            : 
     544         [ +  - ]:         63 :         AddLink();      // set Link and update Data!!
     545                 :            : 
     546                 :            :         // Loading
     547                 :            :         // for MD
     548                 :            :             OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
     549 [ +  - ][ +  - ]:         63 :             mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
     550         [ +  - ]:         63 :             if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
     551                 :            :             {
     552 [ +  - ][ +  - ]:         63 :                 SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
                 [ +  - ]
     553         [ +  - ]:         63 :                 nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
     554                 :            :             }
     555                 :            : 
     556         [ +  - ]:         63 :         SwWait aWait( *this, sal_True );
     557                 :         63 :         sal_uInt32 nErr = ERR_SWG_READ_ERROR;
     558   [ -  -  +  - ]:         63 :         switch( GetCreateMode() )
     559                 :            :         {
     560                 :            : 
     561                 :            :         case SFX_CREATE_MODE_ORGANIZER:
     562                 :            :             {
     563         [ #  # ]:          0 :                 if( ReadXML )
     564                 :            :                 {
     565                 :          0 :                     ReadXML->SetOrganizerMode( sal_True );
     566         [ #  # ]:          0 :                     SwReader aRdr( rMedium, aEmptyStr, pDoc );
     567         [ #  # ]:          0 :                     nErr = aRdr.Read( *ReadXML );
     568         [ #  # ]:          0 :                     ReadXML->SetOrganizerMode( sal_False );
     569                 :            :                 }
     570                 :            :             }
     571                 :          0 :             break;
     572                 :            : 
     573                 :            :         case SFX_CREATE_MODE_INTERNAL:
     574                 :            :         case SFX_CREATE_MODE_EMBEDDED:
     575                 :            :             {
     576                 :            :                 // for MWERKS (Mac-Compiler): can't cast autonomously
     577         [ #  # ]:          0 :                 SwTransferable::InitOle( this, *pDoc );
     578                 :            :             }
     579                 :            :             // suppress SfxProgress, when we are Embedded
     580         [ #  # ]:          0 :             SW_MOD()->SetEmbeddedLoadSave( sal_True );
     581                 :            :             // no break;
     582                 :            : 
     583                 :            :         case SFX_CREATE_MODE_STANDARD:
     584                 :            :         case SFX_CREATE_MODE_PREVIEW:
     585                 :            :             {
     586                 :         63 :                 Reader *pReader = ReadXML;
     587         [ +  - ]:         63 :                 if( pReader )
     588                 :            :                 {
     589                 :            :                     // set Doc's DocInfo at DocShell-Medium
     590                 :            :                     RTL_LOGFILE_CONTEXT_TRACE( aLog, "before ReadDocInfo" );
     591         [ +  - ]:         63 :                     SwReader aRdr( rMedium, aEmptyStr, pDoc );
     592                 :            :                     RTL_LOGFILE_CONTEXT_TRACE( aLog, "before Read" );
     593         [ +  - ]:         63 :                     nErr = aRdr.Read( *pReader );
     594                 :            :                     RTL_LOGFILE_CONTEXT_TRACE( aLog, "after Read" );
     595                 :            : 
     596                 :            :                     // If a XML document is loaded, the global doc/web doc
     597                 :            :                     // flags have to be set, because they aren't loaded
     598                 :            :                     // by this formats.
     599 [ +  - ][ +  - ]:         63 :                     if( ISA( SwWebDocShell ) )
                 [ -  + ]
     600                 :            :                     {
     601 [ #  # ][ #  # ]:          0 :                         if( !pDoc->get(IDocumentSettingAccess::HTML_MODE) )
     602         [ #  # ]:          0 :                             pDoc->set(IDocumentSettingAccess::HTML_MODE, true);
     603                 :            :                     }
     604 [ +  - ][ +  - ]:         63 :                     if( ISA( SwGlobalDocShell ) )
                 [ -  + ]
     605                 :            :                     {
     606 [ #  # ][ #  # ]:          0 :                         if( !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
     607         [ #  # ]:          0 :                             pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
     608         [ +  - ]:         63 :                     }
     609                 :            :                 }
     610                 :            :             }
     611                 :         63 :             break;
     612                 :            : 
     613                 :            :         default:
     614                 :            :             OSL_ENSURE( !this, "Load: new CreateMode?" );
     615                 :            : 
     616                 :            :         }
     617                 :            : 
     618         [ +  - ]:         63 :         UpdateFontList();
     619         [ +  - ]:         63 :         InitDraw();
     620                 :            : 
     621 [ +  - ][ +  - ]:         63 :         SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
     622                 :         63 :         bRet = !IsError( nErr );
     623                 :            : 
     624   [ +  -  +  - ]:        126 :         if ( bRet && !pDoc->IsInLoadAsynchron() &&
         [ +  - ][ +  - ]
     625                 :         63 :              GetCreateMode() == SFX_CREATE_MODE_STANDARD )
     626                 :            :         {
     627         [ +  - ]:         63 :             LoadingFinished();
     628                 :            :         }
     629                 :            : 
     630                 :            :         // suppress SfxProgress, when we are Embedded
     631 [ +  - ][ +  - ]:         63 :         SW_MOD()->SetEmbeddedLoadSave( sal_False );
     632                 :            :     }
     633                 :            : 
     634                 :         63 :     return bRet;
     635                 :            : }
     636                 :            : 
     637                 :          0 : sal_Bool  SwDocShell::LoadFrom( SfxMedium& rMedium )
     638                 :            : {
     639                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDocShell::LoadFrom" );
     640                 :          0 :     sal_Bool bRet = sal_False;
     641         [ #  # ]:          0 :     if( pDoc )
     642                 :          0 :         RemoveLink();
     643                 :            : 
     644                 :          0 :     AddLink();      // set Link and update Data!!
     645                 :            : 
     646                 :            :     do {        // middle check loop
     647                 :          0 :         sal_uInt32 nErr = ERR_SWG_READ_ERROR;
     648         [ #  # ]:          0 :         String aStreamName;
     649         [ #  # ]:          0 :         aStreamName = rtl::OUString("styles.xml");
     650 [ #  # ][ #  # ]:          0 :         uno::Reference < container::XNameAccess > xAccess( rMedium.GetStorage(), uno::UNO_QUERY );
     651 [ #  # ][ #  # ]:          0 :         if ( xAccess->hasByName( aStreamName ) && rMedium.GetStorage()->isStreamElement( aStreamName ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  #  
          #  #  #  #  #  
              # ][ #  # ]
     652                 :            :         {
     653                 :            :             // Loading
     654         [ #  # ]:          0 :             SwWait aWait( *this, sal_True );
     655                 :            :             {
     656                 :            :                 OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
     657 [ #  # ][ #  # ]:          0 :                 mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
     658         [ #  # ]:          0 :                 if( ReadXML )
     659                 :            :                 {
     660                 :          0 :                     ReadXML->SetOrganizerMode( sal_True );
     661         [ #  # ]:          0 :                     SwReader aRdr( rMedium, aEmptyStr, pDoc );
     662         [ #  # ]:          0 :                     nErr = aRdr.Read( *ReadXML );
     663         [ #  # ]:          0 :                     ReadXML->SetOrganizerMode( sal_False );
     664                 :            :                 }
     665         [ #  # ]:          0 :             }
     666                 :            :         }
     667                 :            :         else
     668                 :            :         {
     669                 :            :             OSL_FAIL("Code removed!");
     670                 :            :         }
     671                 :            : 
     672 [ #  # ][ #  # ]:          0 :         SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
     673         [ #  # ]:          0 :         bRet = !IsError( nErr );
     674                 :            : 
     675                 :            :     } while( sal_False );
     676                 :            : 
     677                 :          0 :     SfxObjectShell::LoadFrom( rMedium );
     678                 :          0 :     pDoc->ResetModified();
     679                 :          0 :     return bRet;
     680                 :            : }
     681                 :            : 
     682                 :            : 
     683                 :       1484 : void SwDocShell::SubInitNew()
     684                 :            : {
     685                 :            :     OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
     686 [ +  - ][ +  - ]:       1484 :     mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
     687         [ +  - ]:       1484 :     UpdateFontList();
     688         [ +  - ]:       1484 :     InitDraw();
     689                 :            : 
     690         [ +  - ]:       1484 :     pDoc->setLinkUpdateMode( GLOBALSETTING );
     691         [ +  - ]:       1484 :     pDoc->setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
     692                 :            : 
     693 [ +  - ][ +  - ]:       1484 :     sal_Bool bWeb = ISA(SwWebDocShell);
     694                 :            : 
     695                 :            :     sal_uInt16 nRange[] =   {
     696                 :            :         RES_PARATR_ADJUST, RES_PARATR_ADJUST,
     697                 :            :         RES_CHRATR_COLOR, RES_CHRATR_COLOR,
     698                 :            :         RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE,
     699                 :            :         RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE,
     700                 :            :         RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,
     701                 :       1484 :         0, 0, 0  };
     702         [ +  + ]:       1484 :     if(!bWeb)
     703                 :            :     {
     704                 :       1480 :         nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 3 ] = RES_PARATR_TABSTOP;
     705                 :       1480 :         nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 2 ] = RES_PARATR_HYPHENZONE;
     706                 :            :     }
     707         [ +  - ]:       1484 :     SfxItemSet aDfltSet( pDoc->GetAttrPool(), nRange );
     708                 :            : 
     709                 :            :     //! get lingu options without loading lingu DLL
     710         [ +  - ]:       1484 :     SvtLinguOptions aLinguOpt;
     711                 :            : 
     712 [ +  - ][ +  - ]:       1484 :     SvtLinguConfig().GetOptions( aLinguOpt );
                 [ +  - ]
     713                 :            : 
     714         [ +  - ]:       1484 :     sal_Int16   nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
     715         [ +  - ]:       1484 :                 eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
     716         [ +  - ]:       1484 :                 eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
     717 [ +  - ][ +  - ]:       1484 :     aDfltSet.Put( SvxLanguageItem( nVal, RES_CHRATR_LANGUAGE ) );
                 [ +  - ]
     718 [ +  - ][ +  - ]:       1484 :     aDfltSet.Put( SvxLanguageItem( eCJK, RES_CHRATR_CJK_LANGUAGE ) );
                 [ +  - ]
     719 [ +  - ][ +  - ]:       1484 :     aDfltSet.Put( SvxLanguageItem( eCTL, RES_CHRATR_CTL_LANGUAGE ) );
                 [ +  - ]
     720                 :            : 
     721         [ +  + ]:       1484 :     if(!bWeb)
     722                 :            :     {
     723                 :            :         SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) pDoc->GetDefault(
     724 [ +  - ][ +  - ]:       1480 :                                                         RES_PARATR_HYPHENZONE) );
     725                 :       1480 :         aHyp.GetMinLead()   = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinLeading);
     726                 :       1480 :         aHyp.GetMinTrail()  = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinTrailing);
     727                 :            : 
     728         [ +  - ]:       1480 :         aDfltSet.Put( aHyp );
     729                 :            : 
     730 [ +  - ][ +  - ]:       1480 :         sal_uInt16 nNewPos = static_cast< sal_uInt16 >(SW_MOD()->GetUsrPref(sal_False)->GetDefTab());
     731         [ +  - ]:       1480 :         if( nNewPos )
     732                 :            :             aDfltSet.Put( SvxTabStopItem( 1, nNewPos,
     733 [ +  - ][ +  - ]:       1480 :                                           SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ) );
         [ +  - ][ +  - ]
     734                 :            :     }
     735 [ +  - ][ +  - ]:       1484 :     aDfltSet.Put( SvxColorItem( Color( COL_AUTO ), RES_CHRATR_COLOR ) );
                 [ +  - ]
     736                 :            : 
     737         [ +  - ]:       1484 :     pDoc->SetDefault( aDfltSet );
     738                 :            : 
     739                 :            :     //default page mode for text grid
     740         [ +  + ]:       1484 :     if(!bWeb)
     741                 :            :     {
     742 [ +  - ][ +  - ]:       1480 :         sal_Bool bSquaredPageMode = SW_MOD()->GetUsrPref(sal_False)->IsSquaredPageMode();
     743         [ +  - ]:       1480 :         pDoc->SetDefaultPageMode( bSquaredPageMode );
     744                 :            :     }
     745                 :            : 
     746 [ +  - ][ +  - ]:       1484 :     pDoc->ResetModified();
                 [ +  - ]
     747                 :       1484 : }
     748                 :            : 
     749                 :            : /*
     750                 :            :  * Document Interface Access
     751                 :            :  */
     752         [ #  # ]:          0 : IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; }
     753         [ +  - ]:       2059 : const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; }
     754         [ #  # ]:          0 : IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; }
     755                 :            : 
     756                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10