LCOV - code coverage report
Current view: top level - sw/source/uibase/uno - SwXDocumentSettings.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 542 587 92.3 %
Date: 2014-11-03 Functions: 18 21 85.7 %
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 <osl/mutex.hxx>
      21             : #include <sfx2/sfxbasecontroller.hxx>
      22             : #include <SwXDocumentSettings.hxx>
      23             : #include <comphelper/MasterPropertySetInfo.hxx>
      24             : #include <cppuhelper/supportsservice.hxx>
      25             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      26             : #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
      27             : #include <com/sun/star/document/PrinterIndependentLayout.hpp>
      28             : #include <doc.hxx>
      29             : #include <IDocumentSettingAccess.hxx>
      30             : #include <IDocumentDeviceAccess.hxx>
      31             : #include <IDocumentRedlineAccess.hxx>
      32             : #include <docsh.hxx>
      33             : #include <fldupde.hxx>
      34             : #include <linkenum.hxx>
      35             : #include <sfx2/printer.hxx>
      36             : #include <editsh.hxx>
      37             : #include <drawdoc.hxx>
      38             : #include <svl/zforlist.hxx>
      39             : #include <unotxdoc.hxx>
      40             : #include <cmdid.h>
      41             : #include <sfx2/zoomitem.hxx>
      42             : #include <unomod.hxx>
      43             : #include <vcl/svapp.hxx>
      44             : #include <comphelper/servicehelper.hxx>
      45             : 
      46             : #include "swmodule.hxx"
      47             : #include "cfgitems.hxx"
      48             : #include "prtopt.hxx"
      49             : 
      50             : using namespace comphelper;
      51             : using namespace ::com::sun::star;
      52             : using namespace ::com::sun::star::uno;
      53             : using namespace ::com::sun::star::beans;
      54             : using namespace ::com::sun::star::lang;
      55             : using namespace ::com::sun::star::i18n;
      56             : 
      57             : enum SwDocumentSettingsPropertyHandles
      58             : {
      59             :     HANDLE_FORBIDDEN_CHARS,
      60             :     HANDLE_LINK_UPDATE_MODE,
      61             :     HANDLE_FIELD_AUTO_UPDATE,
      62             :     HANDLE_CHART_AUTO_UPDATE,
      63             :     HANDLE_ADD_PARA_TABLE_SPACING,
      64             :     HANDLE_ADD_PARA_TABLE_SPACING_AT_START,
      65             :     HANDLE_ALIGN_TAB_STOP_POSITION,
      66             :     HANDLE_PRINTER_NAME,
      67             :     HANDLE_PRINTER_SETUP,
      68             :     HANDLE_IS_KERN_ASIAN_PUNCTUATION,
      69             :     HANDLE_CHARACTER_COMPRESSION_TYPE,
      70             :     HANDLE_APPLY_USER_DATA,
      71             :     HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS,
      72             :     HANDLE_CURRENT_DATABASE_DATA_SOURCE,
      73             :     HANDLE_CURRENT_DATABASE_COMMAND,
      74             :     HANDLE_CURRENT_DATABASE_COMMAND_TYPE,
      75             :     HANDLE_SAVE_VERSION_ON_CLOSE,
      76             :     HANDLE_IS_GRID_VISIBLE,
      77             :     HANDLE_IS_SNAP_TO_GRID,
      78             :     HANDLE_IS_SYNCHRONISE_AXES,
      79             :     HANDLE_HORIZONTAL_GRID_RESOLUTION,
      80             :     HANDLE_HORIZONTAL_GRID_SUBDIVISION,
      81             :     HANDLE_VERTICAL_GRID_RESOLUTION,
      82             :     HANDLE_VERTICAL_GRID_SUBDIVISION,
      83             :     HANDLE_UPDATE_FROM_TEMPLATE,
      84             :     HANDLE_PRINTER_INDEPENDENT_LAYOUT,
      85             :     HANDLE_IS_LABEL_DOC,
      86             :     HANDLE_IS_ADD_FLY_OFFSET,
      87             :     HANDLE_IS_ADD_EXTERNAL_LEADING,
      88             :     HANDLE_OLD_NUMBERING, // #111955#
      89             :     HANDLE_OUTLINELEVEL_YIELDS_NUMBERING,
      90             :     /* Stampit It disable the print cancel button of the shown progress dialog. */
      91             :     HANDLE_ALLOW_PRINTJOB_CANCEL,
      92             :     HANDLE_USE_FORMER_LINE_SPACING,
      93             :     HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS,
      94             :     HANDLE_USE_FORMER_OBJECT_POSITIONING,
      95             :     HANDLE_USE_FORMER_TEXT_WRAPPING,
      96             :     HANDLE_CHANGES_PASSWORD,
      97             :     HANDLE_CONSIDER_WRAP_ON_OBJPOS,
      98             :     HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,
      99             :     HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
     100             :     HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
     101             :     HANDLE_TABLE_ROW_KEEP,
     102             :     HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,
     103             :     HANDLE_LOAD_READONLY,
     104             :     HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
     105             :     HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES,
     106             :     HANDLE_UNIX_FORCE_ZERO_EXT_LEADING,
     107             :     HANDLE_USE_OLD_PRINTER_METRICS,
     108             :     HANDLE_PROTECT_FORM,
     109             :     HANDLE_TABS_RELATIVE_TO_INDENT,
     110             :     HANDLE_RSID,
     111             :     HANDLE_RSID_ROOT,
     112             :     // #i89181#
     113             :     HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
     114             :     HANDLE_MODIFYPASSWORDINFO,
     115             :     HANDLE_MATH_BASELINE_ALIGNMENT,
     116             :     HANDLE_INVERT_BORDER_SPACING,
     117             :     HANDLE_COLLAPSE_EMPTY_CELL_PARA,
     118             :     HANDLE_SMALL_CAPS_PERCENTAGE_66,
     119             :     HANDLE_TAB_OVERFLOW,
     120             :     HANDLE_UNBREAKABLE_NUMBERINGS,
     121             :     HANDLE_STYLES_NODEFAULT,
     122             :     HANDLE_FLOATTABLE_NOMARGINS,
     123             :     HANDLE_CLIPPED_PICTURES,
     124             :     HANDLE_BACKGROUND_PARA_OVER_DRAWINGS,
     125             :     HANDLE_EMBED_FONTS,
     126             :     HANDLE_EMBED_SYSTEM_FONTS,
     127             :     HANDLE_TAB_OVER_MARGIN,
     128             :     HANDLE_SURROUND_TEXT_WRAP_SMALL,
     129             :     HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
     130             :     HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
     131             : };
     132             : 
     133       10172 : static MasterPropertySetInfo * lcl_createSettingsInfo()
     134             : {
     135             :     static PropertyInfo const aWriterSettingsInfoMap[] =
     136             :     {
     137          58 :         { OUString("ForbiddenCharacters"),        HANDLE_FORBIDDEN_CHARS,                 cppu::UnoType<css::i18n::XForbiddenCharacters>::get(),      0,   0},
     138          58 :         { OUString("LinkUpdateMode"),             HANDLE_LINK_UPDATE_MODE,                cppu::UnoType<sal_Int16>::get(),             0,   0},
     139          58 :         { OUString("FieldAutoUpdate"),            HANDLE_FIELD_AUTO_UPDATE,               cppu::UnoType<bool>::get(),           0,   0},
     140          58 :         { OUString("ChartAutoUpdate"),            HANDLE_CHART_AUTO_UPDATE,               cppu::UnoType<bool>::get(),           0,   0},
     141          58 :         { OUString("AddParaTableSpacing"),        HANDLE_ADD_PARA_TABLE_SPACING,          cppu::UnoType<bool>::get(),           0,   0},
     142          58 :         { OUString("AddParaTableSpacingAtStart"), HANDLE_ADD_PARA_TABLE_SPACING_AT_START, cppu::UnoType<bool>::get(),           0,   0},
     143          58 :         { OUString("AlignTabStopPosition"),       HANDLE_ALIGN_TAB_STOP_POSITION,         cppu::UnoType<bool>::get(),           0,   0},
     144          58 :         { OUString("PrinterName"),                HANDLE_PRINTER_NAME,                    cppu::UnoType<OUString>::get(),          0,   0},
     145          58 :         { OUString("PrinterSetup"),               HANDLE_PRINTER_SETUP,                   cppu::UnoType< cppu::UnoSequenceType<sal_Int8> >::get(),           0,   0},
     146          58 :         { OUString("IsKernAsianPunctuation"),     HANDLE_IS_KERN_ASIAN_PUNCTUATION,       cppu::UnoType<bool>::get(),           0,   0},
     147          58 :         { OUString("CharacterCompressionType"),   HANDLE_CHARACTER_COMPRESSION_TYPE,      cppu::UnoType<sal_Int16>::get(),             0,   0},
     148          58 :         { OUString("ApplyUserData"),              HANDLE_APPLY_USER_DATA,                 cppu::UnoType<bool>::get(),           0,   0},
     149          58 :         { OUString("SaveGlobalDocumentLinks"),    HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS,      cppu::UnoType<bool>::get(),           0,   0},
     150          58 :         { OUString("CurrentDatabaseDataSource"),  HANDLE_CURRENT_DATABASE_DATA_SOURCE,    cppu::UnoType<OUString>::get(),          0,   0},
     151          58 :         { OUString("CurrentDatabaseCommand"),     HANDLE_CURRENT_DATABASE_COMMAND,        cppu::UnoType<OUString>::get(),          0,   0},
     152          58 :         { OUString("CurrentDatabaseCommandType"), HANDLE_CURRENT_DATABASE_COMMAND_TYPE,   cppu::UnoType<sal_Int32>::get(),             0,   0},
     153          58 :         { OUString("SaveVersionOnClose"),         HANDLE_SAVE_VERSION_ON_CLOSE,           cppu::UnoType<bool>::get(),           0,   0},
     154          58 :         { OUString("UpdateFromTemplate"),         HANDLE_UPDATE_FROM_TEMPLATE,            cppu::UnoType<bool>::get(),           0,   0},
     155             : 
     156          58 :         { OUString("PrinterIndependentLayout"),   HANDLE_PRINTER_INDEPENDENT_LAYOUT,      cppu::UnoType<sal_Int16>::get(),             0,   0},
     157          58 :         { OUString("IsLabelDocument"),            HANDLE_IS_LABEL_DOC,                    cppu::UnoType<bool>::get(),           0,   0},
     158          58 :         { OUString("AddFrameOffsets"),            HANDLE_IS_ADD_FLY_OFFSET,               cppu::UnoType<bool>::get(),           0,   0},
     159          58 :         { OUString("AddExternalLeading"),         HANDLE_IS_ADD_EXTERNAL_LEADING,         cppu::UnoType<bool>::get(),           0,   0},
     160          58 :         { OUString("UseOldNumbering"),            HANDLE_OLD_NUMBERING,                   cppu::UnoType<bool>::get(),           0,   0}, // #111955#
     161          58 :         { OUString("OutlineLevelYieldsNumbering"), HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, cppu::UnoType<bool>::get(),           0,   0},
     162             :         /* Stampit It disable the print cancel button of the shown progress dialog. */
     163          58 :         { OUString("AllowPrintJobCancel"),        HANDLE_ALLOW_PRINTJOB_CANCEL,           cppu::UnoType<bool>::get(),           0,   0},
     164          58 :         { OUString("UseFormerLineSpacing"),       HANDLE_USE_FORMER_LINE_SPACING,         cppu::UnoType<bool>::get(),           0,   0},
     165          58 :         { OUString("AddParaSpacingToTableCells"), HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS, cppu::UnoType<bool>::get(),           0,   0},
     166          58 :         { OUString("UseFormerObjectPositioning"), HANDLE_USE_FORMER_OBJECT_POSITIONING,   cppu::UnoType<bool>::get(),           0,   0},
     167          58 :         { OUString("UseFormerTextWrapping"),      HANDLE_USE_FORMER_TEXT_WRAPPING,        cppu::UnoType<bool>::get(),           0,   0},
     168          58 :         { OUString("RedlineProtectionKey"),       HANDLE_CHANGES_PASSWORD,                cppu::UnoType< cppu::UnoSequenceType<sal_Int8> >::get(),           0,   0},
     169          58 :         { OUString("ConsiderTextWrapOnObjPos"),   HANDLE_CONSIDER_WRAP_ON_OBJPOS,         cppu::UnoType<bool>::get(),           0,   0},
     170          58 :         { OUString("IgnoreFirstLineIndentInNumbering"),   HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,         cppu::UnoType<bool>::get(),           0,   0},
     171          58 :         { OUString("DoNotJustifyLinesWithManualBreak"),   HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,         cppu::UnoType<bool>::get(),           0,   0},
     172          58 :         { OUString("DoNotResetParaAttrsForNumFont"),   HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,         cppu::UnoType<bool>::get(),           0,   0},
     173          58 :         { OUString("TableRowKeep"),               HANDLE_TABLE_ROW_KEEP,         cppu::UnoType<bool>::get(),           0,   0},
     174          58 :         { OUString("IgnoreTabsAndBlanksForLineCalculation"),   HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,         cppu::UnoType<bool>::get(),           0,   0},
     175          58 :         { OUString("LoadReadonly"),               HANDLE_LOAD_READONLY,                   cppu::UnoType<bool>::get(),           0,   0},
     176          58 :         { OUString("DoNotCaptureDrawObjsOnPage"),   HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, cppu::UnoType<bool>::get(), 0, 0},
     177          58 :         { OUString("ClipAsCharacterAnchoredWriterFlyFrames"), HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES, cppu::UnoType<bool>::get(), 0, 0},
     178          58 :         { OUString("UnxForceZeroExtLeading"), HANDLE_UNIX_FORCE_ZERO_EXT_LEADING, cppu::UnoType<bool>::get(), 0, 0},
     179          58 :         { OUString("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, cppu::UnoType<bool>::get(), 0, 0},
     180          58 :         { OUString("TabsRelativeToIndent"), HANDLE_TABS_RELATIVE_TO_INDENT, cppu::UnoType<bool>::get(), 0, 0},
     181          58 :         { OUString("Rsid"), HANDLE_RSID, cppu::UnoType<sal_Int32>::get(), 0, 0},
     182          58 :         { OUString("RsidRoot"), HANDLE_RSID_ROOT, cppu::UnoType<sal_Int32>::get(), 0, 0},
     183          58 :         { OUString("ProtectForm"), HANDLE_PROTECT_FORM, cppu::UnoType<bool>::get(), 0, 0},
     184             :         // #i89181#
     185          58 :         { OUString("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, cppu::UnoType<bool>::get(), 0, 0},
     186          58 :         { OUString("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, cppu::UnoType< cppu::UnoSequenceType<css::beans::PropertyValue> >::get(), 0,   0},
     187          58 :         { OUString("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, cppu::UnoType<bool>::get(), 0, 0},
     188          58 :         { OUString("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, cppu::UnoType<bool>::get(), 0, 0},
     189          58 :         { OUString("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, cppu::UnoType<bool>::get(), 0, 0},
     190          58 :         { OUString("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, cppu::UnoType<bool>::get(), 0, 0},
     191          58 :         { OUString("TabOverflow"), HANDLE_TAB_OVERFLOW, cppu::UnoType<bool>::get(), 0, 0},
     192          58 :         { OUString("UnbreakableNumberings"), HANDLE_UNBREAKABLE_NUMBERINGS, cppu::UnoType<bool>::get(), 0, 0},
     193          58 :         { OUString("StylesNoDefault"), HANDLE_STYLES_NODEFAULT, cppu::UnoType<bool>::get(), 0, 0},
     194          58 :         { OUString("FloattableNomargins"), HANDLE_FLOATTABLE_NOMARGINS, cppu::UnoType<bool>::get(), 0, 0},
     195          58 :         { OUString("ClippedPictures"), HANDLE_CLIPPED_PICTURES, cppu::UnoType<bool>::get(), 0, 0},
     196          58 :         { OUString("BackgroundParaOverDrawings"), HANDLE_BACKGROUND_PARA_OVER_DRAWINGS, cppu::UnoType<bool>::get(), 0, 0},
     197          58 :         { OUString("EmbedFonts"), HANDLE_EMBED_FONTS, cppu::UnoType<bool>::get(), 0, 0},
     198          58 :         { OUString("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType<bool>::get(), 0, 0},
     199          58 :         { OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType<bool>::get(), 0, 0},
     200          58 :         { OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0, 0},
     201          58 :         { OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0, 0},
     202          58 :         { OUString("PropLineSpacingShrinksFirstLine"),       HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE,         cppu::UnoType<bool>::get(),           0,   0},
     203             : /*
     204             :  * As OS said, we don't have a view when we need to set this, so I have to
     205             :  * find another solution before adding them to this property set - MTG
     206             :         { OUString("IsGridVisible"),              HANDLE_IS_GRID_VISIBLE,                 cppu::UnoType<bool>::get(),           0,   0},
     207             :         { OUString("IsSnapToGrid"),               HANDLE_IS_SNAP_TO_GRID,                 cppu::UnoType<bool>::get(),           0,   0},
     208             :         { OUString("IsSynchroniseAxes"),          HANDLE_IS_SYNCHRONISE_AXES,             cppu::UnoType<bool>::get(),           0,   0},
     209             :         { OUString("HorizontalGridResolution"),   HANDLE_HORIZONTAL_GRID_RESOLUTION,      cppu::UnoType<sal_Int32>::get(),             0,   0},
     210             :         { OUString("HorizontalGridSubdivision"),  HANDLE_HORIZONTAL_GRID_SUBDIVISION,     cppu::UnoType<sal_Int16>::get(),             0,   0},
     211             :         { OUString("VerticalGridResolution"),     HANDLE_VERTICAL_GRID_RESOLUTION,        cppu::UnoType<sal_Int32>::get(),             0,   0},
     212             :         { OUString("VerticalGridSubdivision"),    HANDLE_VERTICAL_GRID_SUBDIVISION,       cppu::UnoType<sal_Int16>::get(),             0,   0},
     213             : 
     214             :         { OUString("ShowParagraphEnd"),           HANDLE_SHOW_PARAGRAPH_END,              cppu::UnoType<bool>::get(),           0,   0},
     215             :         { OUString("ShowOptionalHyphens"),        HANDLE_SHOW_OPTIONAL_HYPHENS,           cppu::UnoType<bool>::get(),           0,   0},
     216             :         { OUString("ShowSpaces"),                 HANDLE_SHOW_SPACES,                     cppu::UnoType<bool>::get(),           0,   0},
     217             :         { OUString("ShowTabs"),                   HANDLE_SHOW_TABS,                       cppu::UnoType<bool>::get(),           0,   0},
     218             :         { OUString("ShowBreaks"),                 HANDLE_SHOW_BREAKS,                     cppu::UnoType<bool>::get(),           0,   0},
     219             :         { OUString("ShowHiddenText"),             HANDLE_SHOW_HIDDEN_TEXT,                cppu::UnoType<bool>::get(),           0,   0},
     220             :         { OUString("ShowHiddenParagraphs"),       HANDLE_SHOW_HIDDEN_PARAGRAPHS,          cppu::UnoType<bool>::get(),           0,   0},
     221             : 
     222             :         { OUString("ShowTextLimitGuide"),         HANDLE_SHOW_TEXT_LIMIT_GUIDE,           cppu::UnoType<bool>::get(),           0,   0},
     223             :         { OUString("ShowTableLimitGuide"),        HANDLE_SHOW_TABLE_LIMIT_GUIDE,          cppu::UnoType<bool>::get(),           0,   0},
     224             :         { OUString("ShowSectionLimitGuide"),      HANDLE_SHOW_SECTION_LIMIT_GUIDE,        cppu::UnoType<bool>::get(),           0,   0},
     225             :         { OUString("ShowGuidesWhileMoving"),      HANDLE_SHOW_GUIDES_WHILE_MOVING,        cppu::UnoType<bool>::get(),           0,   0},
     226             : */
     227             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     228       13884 :     };
     229       10172 :     return new MasterPropertySetInfo ( aWriterSettingsInfoMap );
     230             : }
     231             : 
     232       10172 : SwXDocumentSettings::SwXDocumentSettings ( SwXTextDocument * pModel )
     233             : : MasterPropertySet ( lcl_createSettingsInfo (),
     234       10172 :                       &Application::GetSolarMutex () )
     235             : , mxModel ( pModel )
     236             : , mpModel ( pModel )
     237             : , mpDocSh ( NULL )
     238             : , mpDoc ( NULL )
     239       10172 : , mpPrinter( NULL )
     240             : {
     241       10172 :     registerSlave ( new SwXPrintSettings ( PRINT_SETTINGS_DOCUMENT, mpModel->GetDocShell()->GetDoc() ) );
     242       10172 : }
     243             : 
     244       20344 : SwXDocumentSettings::~SwXDocumentSettings()
     245       10172 :     throw()
     246             : {
     247       20344 : }
     248             : 
     249       10180 : Any SAL_CALL SwXDocumentSettings::queryInterface( const Type& rType )
     250             :     throw(RuntimeException, std::exception)
     251             : {
     252             :         return ::cppu::queryInterface ( rType,
     253             :                                         // OWeakObject interfaces
     254             :                                         dynamic_cast< XInterface* > ( dynamic_cast< OWeakObject*  >(this) ),
     255             :                                         dynamic_cast< XWeak* > ( this ),
     256             :                                         // my own interfaces
     257             :                                         dynamic_cast< XPropertySet*  > ( this ),
     258             :                                         dynamic_cast< XPropertyState* > ( this ),
     259             :                                         dynamic_cast< XMultiPropertySet* > ( this ),
     260             :                                         dynamic_cast< XServiceInfo* > ( this ),
     261       10180 :                                         dynamic_cast< XTypeProvider* > ( this ) );
     262             : }
     263       37754 : void SwXDocumentSettings::acquire ()
     264             :     throw ()
     265             : {
     266       37754 :     OWeakObject::acquire();
     267       37754 : }
     268       37754 : void SwXDocumentSettings::release ()
     269             :     throw ()
     270             : {
     271       37754 :     OWeakObject::release();
     272       37754 : }
     273             : 
     274           0 : uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes(  )
     275             :     throw (RuntimeException, std::exception)
     276             : {
     277           0 :     SolarMutexGuard aGuard;
     278             : 
     279           0 :     uno::Sequence< uno::Type > aBaseTypes( 5 );
     280           0 :     uno::Type* pBaseTypes = aBaseTypes.getArray();
     281             : 
     282             :     // from MasterPropertySet
     283           0 :     pBaseTypes[0] = cppu::UnoType<XPropertySet>::get();
     284           0 :     pBaseTypes[1] = cppu::UnoType<XPropertyState>::get();
     285           0 :     pBaseTypes[2] = cppu::UnoType<XMultiPropertySet>::get();
     286             : 
     287           0 :     pBaseTypes[3] = cppu::UnoType<XServiceInfo>::get();
     288           0 :     pBaseTypes[4] = cppu::UnoType<XTypeProvider>::get();
     289             : 
     290           0 :     return aBaseTypes;
     291             : }
     292             : 
     293           0 : uno::Sequence< sal_Int8 > SAL_CALL SwXDocumentSettings::getImplementationId(  )
     294             :     throw (RuntimeException, std::exception)
     295             : {
     296           0 :     return css::uno::Sequence<sal_Int8>();
     297             : }
     298             : 
     299       91366 : void SwXDocumentSettings::_preSetValues ()
     300             :         throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException )
     301             : {
     302       91366 :     mpDocSh = mpModel->GetDocShell();
     303       91366 :     if (NULL == mpDocSh)
     304           0 :         throw UnknownPropertyException();
     305             : 
     306       91366 :     mpDoc = mpDocSh->GetDoc();
     307       91366 :     if (NULL == mpDoc)
     308           0 :         throw UnknownPropertyException();
     309       91366 : }
     310             : 
     311       91366 : void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, const uno::Any &rValue )
     312             :         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     313             : {
     314       91366 :     if (rInfo.mnAttributes & PropertyAttribute::READONLY)
     315           0 :         throw PropertyVetoException ("Property is read-only: " + rInfo.maName, static_cast < cppu::OWeakObject * > ( 0 ) );
     316             : 
     317       91366 :     switch( rInfo.mnHandle )
     318             :     {
     319             :         case HANDLE_FORBIDDEN_CHARS:
     320          36 :             break;
     321             :         case HANDLE_LINK_UPDATE_MODE:
     322             :         {
     323         308 :             sal_Int16 nMode = 0;
     324         308 :             rValue >>= nMode;
     325         308 :             switch (nMode)
     326             :             {
     327             :                 case NEVER:
     328             :                 case MANUAL:
     329             :                 case AUTOMATIC:
     330             :                 case GLOBALSETTING:
     331         308 :                     break;
     332             :                 default:
     333           0 :                     throw IllegalArgumentException();
     334             :             }
     335         308 :             mpDoc->getIDocumentSettingAccess().setLinkUpdateMode(nMode);
     336             :         }
     337         308 :         break;
     338             :         case HANDLE_FIELD_AUTO_UPDATE:
     339             :         {
     340         308 :             bool bUpdateField = *(sal_Bool*)rValue.getValue();
     341         308 :             SwFldUpdateFlags nFlag = mpDoc->getIDocumentSettingAccess().getFieldUpdateFlags(true);
     342         308 :             mpDoc->getIDocumentSettingAccess().setFieldUpdateFlags( bUpdateField ?
     343             :                                         nFlag == AUTOUPD_FIELD_AND_CHARTS ?
     344             :                                         AUTOUPD_FIELD_AND_CHARTS :
     345             :                                         AUTOUPD_FIELD_ONLY :
     346         308 :                                         AUTOUPD_OFF );
     347             :         }
     348         308 :         break;
     349             :         case HANDLE_CHART_AUTO_UPDATE:
     350             :         {
     351         310 :             bool bUpdateChart = *(sal_Bool*)rValue.getValue();
     352         310 :             SwFldUpdateFlags nFlag = mpDoc->getIDocumentSettingAccess().getFieldUpdateFlags(true);
     353         620 :             mpDoc->getIDocumentSettingAccess().setFieldUpdateFlags( (nFlag == AUTOUPD_FIELD_ONLY || nFlag == AUTOUPD_FIELD_AND_CHARTS ) ?
     354             :                                         bUpdateChart ?
     355             :                                         AUTOUPD_FIELD_AND_CHARTS :
     356             :                                         AUTOUPD_FIELD_ONLY :
     357         620 :                                         AUTOUPD_OFF );
     358             :         }
     359         310 :         break;
     360             :         case HANDLE_ADD_PARA_TABLE_SPACING:
     361             :         {
     362        3800 :             bool bParaSpace = false;
     363        3800 :             rValue >>= bParaSpace;
     364        3800 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::PARA_SPACE_MAX, bParaSpace );
     365             :         }
     366        3800 :         break;
     367             :         case HANDLE_ADD_PARA_TABLE_SPACING_AT_START:
     368             :         {
     369         310 :             bool bParaSpacePage = false;
     370         310 :             rValue >>= bParaSpacePage;
     371         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES, bParaSpacePage );
     372             :         }
     373         310 :         break;
     374             :         case HANDLE_ALIGN_TAB_STOP_POSITION:
     375             :         {
     376         310 :             bool bAlignTab = *(sal_Bool*)rValue.getValue();
     377         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::TAB_COMPAT, bAlignTab);
     378             :         }
     379         310 :         break;
     380             :         case HANDLE_PRINTER_NAME:
     381             :         {
     382             :             //the printer must be created
     383         308 :             OUString sPrinterName;
     384         308 :             if( rValue >>= sPrinterName  )
     385             :             {
     386         308 :                 if( !mpPrinter && !sPrinterName.isEmpty() && mpDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
     387             :                 {
     388          12 :                     SfxPrinter* pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( true );
     389          12 :                     if ( OUString ( pPrinter->GetName()) != sPrinterName )
     390             :                     {
     391          12 :                         SfxPrinter *pNewPrinter = new SfxPrinter ( pPrinter->GetOptions().Clone(), sPrinterName );
     392          12 :                         if( pNewPrinter->IsKnown() )
     393             :                         {
     394             :                             // set printer only once; in _postSetValues
     395           0 :                             mpPrinter = pNewPrinter;
     396             :                         }
     397             :                         else
     398             :                         {
     399          12 :                             delete pNewPrinter;
     400             :                         }
     401             :                     }
     402             :                 }
     403             :             }
     404             :             else
     405           0 :                 throw IllegalArgumentException();
     406             :         }
     407         308 :         break;
     408             :         case HANDLE_PRINTER_SETUP:
     409             :         {
     410         308 :             Sequence < sal_Int8 > aSequence;
     411         308 :             if ( rValue >>= aSequence )
     412             :             {
     413         308 :                 sal_uInt32 nSize = aSequence.getLength();
     414         308 :                 if( nSize > 0 )
     415             :                 {
     416          16 :                     SvMemoryStream aStream (aSequence.getArray(), nSize,
     417          32 :                                             STREAM_READ );
     418          16 :                     aStream.Seek ( STREAM_SEEK_TO_BEGIN );
     419             :                     static sal_uInt16 const nRange[] =
     420             :                     {
     421             :                         FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
     422             :                         SID_HTML_MODE,  SID_HTML_MODE,
     423             :                         SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
     424             :                         SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
     425             :                         0
     426             :                     };
     427          16 :                     SfxItemSet *pItemSet = new SfxItemSet( mpDoc->GetAttrPool(), nRange );
     428          16 :                     SfxPrinter *pPrinter = SfxPrinter::Create ( aStream, pItemSet );
     429             : 
     430             :                     // set printer only once; in _postSetValues
     431          16 :                     delete mpPrinter;
     432          16 :                     mpPrinter = pPrinter;
     433             :                 }
     434             :             }
     435             :             else
     436           0 :                 throw IllegalArgumentException();
     437             :         }
     438         308 :         break;
     439             :         case HANDLE_IS_KERN_ASIAN_PUNCTUATION:
     440             :         {
     441         308 :             bool bIsKern = *(sal_Bool*)(rValue).getValue();
     442         308 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION, bIsKern);
     443         308 :             SwEditShell* pEditSh = mpDoc->GetEditShell();
     444         308 :             if(pEditSh)
     445           0 :                 pEditSh->ChgHyphenation();
     446             :         }
     447         308 :         break;
     448             :         case HANDLE_CHARACTER_COMPRESSION_TYPE:
     449             :         {
     450         308 :             sal_Int16 nMode = 0;
     451         308 :             rValue >>= nMode;
     452         308 :             switch (nMode)
     453             :             {
     454             :                 case CHARCOMPRESS_NONE:
     455             :                 case CHARCOMPRESS_PUNCTUATION:
     456             :                 case CHARCOMPRESS_PUNCTUATION_KANA:
     457         308 :                     break;
     458             :                 default:
     459           0 :                     throw IllegalArgumentException();
     460             :             }
     461         308 :             mpDoc->getIDocumentSettingAccess().setCharacterCompressionType(static_cast < SwCharCompressType > (nMode) );
     462             :         }
     463         308 :         break;
     464             :         case HANDLE_APPLY_USER_DATA:
     465             :         {
     466         308 :             mpDocSh->SetUseUserData( *(sal_Bool*)rValue.getValue() );
     467             :         }
     468         308 :         break;
     469             :         case HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS:
     470             :         {
     471         310 :             bool bSaveGlobal = *(sal_Bool*)rValue.getValue();
     472         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, bSaveGlobal );
     473             :         }
     474         310 :         break;
     475             :         case HANDLE_CURRENT_DATABASE_DATA_SOURCE:
     476             :         {
     477         308 :             SwDBData aData = mpDoc->GetDBData();
     478         308 :             if ( rValue >>= aData.sDataSource )
     479         308 :                 mpDoc->ChgDBData( aData );
     480             :         }
     481         308 :         break;
     482             :         case HANDLE_CURRENT_DATABASE_COMMAND:
     483             :         {
     484         308 :             SwDBData aData = mpDoc->GetDBData();
     485             : 
     486         308 :             if ( rValue >>= aData.sCommand )
     487         308 :                 mpDoc->ChgDBData( aData );
     488             : 
     489             :             SAL_WARN_IF( aData.sDataSource.isEmpty() && !aData.sCommand.isEmpty(), "sw.uno",
     490         308 :                 "\"CurrentDatabaseCommand\" property possibly set before \"CurrentDatabaseDataSource\"" );
     491             :         }
     492         308 :         break;
     493             :         case HANDLE_CURRENT_DATABASE_COMMAND_TYPE:
     494             :         {
     495         308 :             SwDBData aData = mpDoc->GetDBData();
     496         308 :             if ( rValue >>= aData.nCommandType )
     497         308 :                 mpDoc->ChgDBData( aData );
     498             :             SAL_WARN_IF( aData.nCommandType && aData.sDataSource.isEmpty(), "sw.uno",
     499             :                 "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseDataSource\"" );
     500             :             SAL_WARN_IF( aData.nCommandType && aData.sCommand.isEmpty(), "sw.uno",
     501         308 :                 "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseCommand\"" );
     502             :         }
     503         308 :         break;
     504             :         case HANDLE_SAVE_VERSION_ON_CLOSE:
     505             :         {
     506         308 :             mpDocSh->SetSaveVersionOnClose( *(sal_Bool*)rValue.getValue() );
     507             :         }
     508         308 :         break;
     509             :         case HANDLE_UPDATE_FROM_TEMPLATE:
     510             :         {
     511         308 :             mpDocSh->SetQueryLoadTemplate( *(sal_Bool*)rValue.getValue() );
     512             :         }
     513         308 :         break;
     514             :         case HANDLE_PRINTER_INDEPENDENT_LAYOUT:
     515             :         {
     516         310 :             sal_Int16 nTmp = 0;
     517         310 :             rValue >>= nTmp;
     518             : 
     519         310 :             bool bUseVirDev = true;
     520         310 :             bool bHiResVirDev = true;
     521         310 :             if( nTmp == document::PrinterIndependentLayout::DISABLED )
     522          14 :                 bUseVirDev = false;
     523         296 :             else if ( nTmp == document::PrinterIndependentLayout::LOW_RESOLUTION )
     524           2 :                 bHiResVirDev = false;
     525         294 :             else if ( nTmp != document::PrinterIndependentLayout::HIGH_RESOLUTION )
     526           0 :                 throw IllegalArgumentException();
     527             : 
     528         310 :             mpDoc->getIDocumentDeviceAccess().setReferenceDeviceType( bUseVirDev, bHiResVirDev );
     529             :         }
     530         310 :         break;
     531             :         case HANDLE_IS_LABEL_DOC :
     532             :         {
     533         310 :             bool bSet = false;
     534         310 :             if(!(rValue >>= bSet))
     535           0 :                 throw IllegalArgumentException();
     536         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::LABEL_DOCUMENT, bSet);
     537             :         }
     538         310 :         break;
     539             :         case HANDLE_IS_ADD_FLY_OFFSET:
     540             :         {
     541        3106 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     542        3106 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::ADD_FLY_OFFSETS, bTmp);
     543             :         }
     544        3106 :         break;
     545             :         case HANDLE_IS_ADD_EXTERNAL_LEADING:
     546             :         {
     547         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     548         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::ADD_EXT_LEADING, bTmp);
     549             :         }
     550         310 :         break;
     551             :         case HANDLE_OLD_NUMBERING: // #111955#
     552             :         {
     553        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     554        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::OLD_NUMBERING, bTmp);
     555             :         }
     556        3108 :         break;
     557             :         case HANDLE_OUTLINELEVEL_YIELDS_NUMBERING:
     558             :         {
     559         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     560         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE, bTmp);
     561             :         }
     562         310 :         break;
     563             :         case HANDLE_ALLOW_PRINTJOB_CANCEL:
     564             :         {
     565         308 :             bool bState = false;
     566         308 :             if (!(rValue >>= bState))
     567           0 :                 throw IllegalArgumentException();
     568         308 :             mpDocSh->Stamp_SetPrintCancelState(bState);
     569             :         }
     570         308 :         break;
     571             :         case HANDLE_USE_FORMER_LINE_SPACING:
     572             :         {
     573        3110 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     574        3110 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::OLD_LINE_SPACING, bTmp);
     575             :         }
     576        3110 :         break;
     577             :         case HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS:
     578             :         {
     579        3110 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     580        3110 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS, bTmp);
     581             :         }
     582        3110 :         break;
     583             :         case HANDLE_USE_FORMER_OBJECT_POSITIONING:
     584             :         {
     585        3110 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     586        3110 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::USE_FORMER_OBJECT_POS, bTmp);
     587             :         }
     588        3110 :         break;
     589             :         case HANDLE_USE_FORMER_TEXT_WRAPPING:
     590             :         {
     591        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     592        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING, bTmp);
     593             :         }
     594        3108 :         break;
     595             :         case HANDLE_CHANGES_PASSWORD:
     596             :         {
     597           0 :             Sequence <sal_Int8> aNew;
     598           0 :             if(rValue >>= aNew)
     599             :             {
     600           0 :                 mpDoc->getIDocumentRedlineAccess().SetRedlinePassword(aNew);
     601           0 :                 if(aNew.getLength())
     602             :                 {
     603           0 :                     sal_uInt16 eMode = mpDoc->getIDocumentRedlineAccess().GetRedlineMode();
     604           0 :                     eMode = eMode|nsRedlineMode_t::REDLINE_ON;
     605           0 :                     mpDoc->getIDocumentRedlineAccess().SetRedlineMode((RedlineMode_t)( eMode ));
     606             :                 }
     607           0 :             }
     608             :         }
     609           0 :         break;
     610             :         case HANDLE_CONSIDER_WRAP_ON_OBJPOS:
     611             :         {
     612        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     613        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION, bTmp );
     614             :         }
     615        3108 :         break;
     616             :         case HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING:
     617             :         {
     618        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     619        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING, bTmp);
     620             :         }
     621        3108 :         break;
     622             :         case HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK:
     623             :         {
     624         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     625         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, bTmp);
     626             :         }
     627         310 :         break;
     628             :         case HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
     629             :         {
     630        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     631        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT, bTmp);
     632             :         }
     633        3108 :         break;
     634             :         case HANDLE_TABLE_ROW_KEEP:
     635             :         {
     636        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     637        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::TABLE_ROW_KEEP, bTmp);
     638             :         }
     639        3108 :         break;
     640             :         case HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
     641             :         {
     642        3106 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     643        3106 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, bTmp);
     644             :         }
     645        3106 :         break;
     646             :         case HANDLE_LOAD_READONLY:
     647             :         {
     648         310 :             mpDocSh->SetLoadReadonly( *(sal_Bool*)rValue.getValue() );
     649             :         }
     650         310 :         break;
     651             :         case HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
     652             :         {
     653         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     654         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, bTmp);
     655             :         }
     656         310 :         break;
     657             :         case HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES:
     658             :         {
     659         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     660         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME, bTmp);
     661             :         }
     662         310 :         break;
     663             :         case HANDLE_UNIX_FORCE_ZERO_EXT_LEADING:
     664             :         {
     665         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     666         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::UNIX_FORCE_ZERO_EXT_LEADING, bTmp);
     667             :         }
     668         310 :         break;
     669             :         case HANDLE_USE_OLD_PRINTER_METRICS:
     670             :             // ignore - this is a dead property
     671         310 :         break;
     672             :         case HANDLE_TABS_RELATIVE_TO_INDENT:
     673             :         {
     674        3786 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     675        3786 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT, bTmp);
     676             :         }
     677        3786 :         break;
     678             :         case HANDLE_RSID:
     679             :         {
     680         270 :             sal_uInt32 nTmp = 0;
     681         270 :             rValue >>= nTmp;
     682         270 :             mpDoc->setRsid( nTmp );
     683             :         }
     684         270 :         break;
     685             :         case HANDLE_RSID_ROOT:
     686             :         {
     687         270 :             sal_uInt32 nTmp = 0;
     688         270 :             rValue >>= nTmp;
     689         270 :             mpDoc->setRsidRoot( nTmp );
     690             :         }
     691         270 :         break;
     692             :         case HANDLE_PROTECT_FORM:
     693             :         {
     694         306 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     695         306 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::PROTECT_FORM, bTmp);
     696             :         }
     697         306 :         break;
     698             :         // #i89181#
     699             :         case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
     700             :         {
     701         308 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     702         308 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, bTmp);
     703             :         }
     704         308 :         break;
     705             :         case HANDLE_MODIFYPASSWORDINFO:
     706             :         {
     707           0 :             uno::Sequence< beans::PropertyValue > aInfo;
     708           0 :             if ( !( rValue >>= aInfo ) )
     709             :                 throw lang::IllegalArgumentException(
     710             :                     OUString( "Value of type Sequence<PropertyValue> expected!" ),
     711             :                     uno::Reference< uno::XInterface >(),
     712           0 :                     2 );
     713             : 
     714           0 :             if ( !mpDocSh->SetModifyPasswordInfo( aInfo ) )
     715             :                 throw beans::PropertyVetoException(
     716             :                     OUString( "The hash is not allowed to be changed now!" ),
     717           0 :                     uno::Reference< uno::XInterface >() );
     718             :         }
     719           0 :         break;
     720             :         case HANDLE_MATH_BASELINE_ALIGNMENT:
     721             :         {
     722         280 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     723         280 :             mpDoc->getIDocumentSettingAccess().set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, bTmp );
     724             :         }
     725         280 :         break;
     726             :         case HANDLE_INVERT_BORDER_SPACING:
     727             :         {
     728        3086 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     729        3086 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp);
     730             :         }
     731        3086 :         break;
     732             :         case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
     733             :         {
     734        3086 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     735        3086 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp);
     736             :         }
     737        3086 :         break;
     738             :         case HANDLE_SMALL_CAPS_PERCENTAGE_66:
     739             :         {
     740         310 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     741         310 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66, bTmp);
     742             :         }
     743         310 :         break;
     744             :         case HANDLE_TAB_OVERFLOW:
     745             :         {
     746        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     747        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::TAB_OVERFLOW, bTmp);
     748             :         }
     749        3108 :         break;
     750             :         case HANDLE_UNBREAKABLE_NUMBERINGS:
     751             :         {
     752        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     753        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS, bTmp);
     754             :         }
     755        3108 :         break;
     756             :         case HANDLE_STYLES_NODEFAULT:
     757             :         {
     758        3714 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     759        3714 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::STYLES_NODEFAULT, bTmp);
     760             :         }
     761        3714 :         break;
     762             :         case HANDLE_FLOATTABLE_NOMARGINS:
     763             :         {
     764        3044 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     765        3044 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::FLOATTABLE_NOMARGINS, bTmp);
     766             :         }
     767        3044 :         break;
     768             :         case HANDLE_CLIPPED_PICTURES:
     769             :         {
     770        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     771        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::CLIPPED_PICTURES, bTmp);
     772             :         }
     773        3108 :         break;
     774             :         case HANDLE_BACKGROUND_PARA_OVER_DRAWINGS:
     775             :         {
     776        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     777        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::BACKGROUND_PARA_OVER_DRAWINGS, bTmp);
     778             :         }
     779        3108 :         break;
     780             :         case HANDLE_EMBED_FONTS:
     781             :         {
     782         236 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     783         236 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::EMBED_FONTS, bTmp);
     784             :         }
     785         236 :         break;
     786             :         case HANDLE_EMBED_SYSTEM_FONTS:
     787             :         {
     788         424 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     789         424 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::EMBED_SYSTEM_FONTS, bTmp);
     790             :         }
     791         424 :         break;
     792             :         case HANDLE_TAB_OVER_MARGIN:
     793             :         {
     794        3108 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     795        3108 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::TAB_OVER_MARGIN, bTmp);
     796             :         }
     797        3108 :         break;
     798             :         case HANDLE_SURROUND_TEXT_WRAP_SMALL:
     799             :         {
     800        3654 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     801        3654 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, bTmp);
     802             :         }
     803        3654 :         break;
     804             :         case HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING:
     805             :         {
     806        3574 :             bool bTmp = *(sal_Bool*)rValue.getValue();
     807        3574 :             mpDoc->getIDocumentSettingAccess().set(IDocumentSettingAccess::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, bTmp);
     808             :         }
     809        3574 :         break;
     810             :         case HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
     811             :         {
     812             :             bool bTmp;
     813        3108 :             if (rValue >>= bTmp)
     814             :             {
     815        3108 :                 mpDoc->getIDocumentSettingAccess().set(
     816        3108 :                     IDocumentSettingAccess::PROP_LINE_SPACING_SHRINKS_FIRST_LINE, bTmp);
     817             :             }
     818             :         }
     819        3108 :         break;
     820             :         default:
     821           0 :             throw UnknownPropertyException();
     822             :     }
     823       91366 : }
     824             : 
     825       91366 : void SwXDocumentSettings::_postSetValues ()
     826             :         throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException )
     827             : {
     828             :     // set printer only once, namely here!
     829       91366 :     if( mpPrinter != NULL )
     830             :     {
     831             :         // #i86352# the printer is also used as container for options by sfx
     832             :         // when setting a printer it should have decent default options
     833          16 :         SfxItemSet aOptions( mpPrinter->GetOptions() );
     834          32 :         SwPrintData aPrtData( mpDoc->getIDocumentDeviceAccess().getPrintData() );
     835          32 :         SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, aPrtData);
     836          16 :         aOptions.Put(aAddPrinterItem);
     837          16 :         mpPrinter->SetOptions( aOptions );
     838             : 
     839          32 :         mpDoc->getIDocumentDeviceAccess().setPrinter( mpPrinter, true, true );
     840             :     }
     841             : 
     842       91366 :     mpPrinter = 0;
     843       91366 :     mpDocSh = 0;
     844       91366 :     mpDoc = 0;
     845       91366 : }
     846             : 
     847        3726 : void SwXDocumentSettings::_preGetValues ()
     848             :         throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException )
     849             : {
     850        3726 :     mpDocSh = mpModel->GetDocShell();
     851        3726 :     if (NULL == mpDocSh)
     852           0 :         throw UnknownPropertyException();
     853        3726 :     mpDoc = mpDocSh->GetDoc();
     854        3726 :     if (NULL == mpDoc)
     855           0 :         throw UnknownPropertyException();
     856        3726 : }
     857             : 
     858        3726 : void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue )
     859             :         throw (beans::UnknownPropertyException, lang::WrappedTargetException,
     860             :                uno::RuntimeException)
     861             : {
     862        3726 :     switch( rInfo.mnHandle )
     863             :     {
     864             :         case HANDLE_FORBIDDEN_CHARS:
     865             :         {
     866          94 :             Reference<XForbiddenCharacters> xRet(*mpModel->GetPropertyHelper(), UNO_QUERY);
     867          94 :             rValue <<= xRet;
     868             :         }
     869          94 :         break;
     870             :         case HANDLE_LINK_UPDATE_MODE:
     871             :         {
     872          58 :             rValue <<= static_cast < sal_Int16 > ( mpDoc->getIDocumentSettingAccess().getLinkUpdateMode(true) );
     873             :         }
     874          58 :         break;
     875             :         case HANDLE_FIELD_AUTO_UPDATE:
     876             :         {
     877          58 :             SwFldUpdateFlags nFlags = mpDoc->getIDocumentSettingAccess().getFieldUpdateFlags(true);
     878          58 :             sal_Bool bFieldUpd = (nFlags == AUTOUPD_FIELD_ONLY || nFlags == AUTOUPD_FIELD_AND_CHARTS );
     879          58 :             rValue.setValue(&bFieldUpd, ::getBooleanCppuType());
     880             :         }
     881          58 :         break;
     882             :         case HANDLE_CHART_AUTO_UPDATE:
     883             :         {
     884          62 :             SwFldUpdateFlags nFlags = mpDoc->getIDocumentSettingAccess().getFieldUpdateFlags(true);
     885          62 :             sal_Bool bChartUpd = nFlags == AUTOUPD_FIELD_AND_CHARTS;
     886          62 :             rValue.setValue(&bChartUpd, ::getBooleanCppuType());
     887             :         }
     888          62 :         break;
     889             :         case HANDLE_ADD_PARA_TABLE_SPACING:
     890             :         {
     891          62 :             sal_Bool bParaSpace = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::PARA_SPACE_MAX);
     892          62 :             rValue.setValue(&bParaSpace, ::getBooleanCppuType());
     893             :         }
     894          62 :         break;
     895             :         case HANDLE_ADD_PARA_TABLE_SPACING_AT_START:
     896             :         {
     897          62 :             sal_Bool bParaSpace = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES);
     898          62 :             rValue.setValue(&bParaSpace, ::getBooleanCppuType());
     899             :         }
     900          62 :         break;
     901             :         case HANDLE_ALIGN_TAB_STOP_POSITION:
     902             :         {
     903          62 :             sal_Bool bAlignTab = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::TAB_COMPAT);
     904          62 :             rValue.setValue(&bAlignTab, ::getBooleanCppuType());
     905             :         }
     906          62 :         break;
     907             :         case HANDLE_PRINTER_NAME:
     908             :         {
     909          58 :             SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
     910          58 :             rValue <<= pPrinter ? OUString ( pPrinter->GetName()) : OUString();
     911             :         }
     912          58 :         break;
     913             :         case HANDLE_PRINTER_SETUP:
     914             :         {
     915          58 :             SfxPrinter *pPrinter = mpDoc->getIDocumentDeviceAccess().getPrinter( false );
     916          58 :             if (pPrinter)
     917             :             {
     918           2 :                 SvMemoryStream aStream;
     919           2 :                 pPrinter->Store( aStream );
     920           2 :                 aStream.Seek ( STREAM_SEEK_TO_END );
     921           2 :                 sal_uInt32 nSize = aStream.Tell();
     922           2 :                 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
     923           4 :                 Sequence < sal_Int8 > aSequence( nSize );
     924           2 :                 aStream.Read ( aSequence.getArray(), nSize );
     925           4 :                 rValue <<= aSequence;
     926             :             }
     927             :             else
     928             :             {
     929          56 :                 Sequence < sal_Int8 > aSequence ( 0 );
     930          56 :                 rValue <<= aSequence;
     931             :             }
     932             :         }
     933          58 :         break;
     934             :         case HANDLE_IS_KERN_ASIAN_PUNCTUATION:
     935             :         {
     936          58 :             sal_Bool bParaSpace = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION);
     937          58 :             rValue.setValue(&bParaSpace, ::getBooleanCppuType());
     938             :         }
     939          58 :         break;
     940             :         case HANDLE_APPLY_USER_DATA:
     941             :         {
     942          58 :             rValue <<= mpDocSh->IsUseUserData();
     943             :         }
     944          58 :         break;
     945             :         case HANDLE_CHARACTER_COMPRESSION_TYPE:
     946             :         {
     947          58 :             rValue <<= static_cast < sal_Int16 > (mpDoc->getIDocumentSettingAccess().getCharacterCompressionType());
     948             :         }
     949          58 :         break;
     950             :         case HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS:
     951             :         {
     952          62 :             sal_Bool bSaveGlobal = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS);
     953          62 :             rValue.setValue(&bSaveGlobal, ::getBooleanCppuType());
     954             :         }
     955          62 :         break;
     956             :         case HANDLE_CURRENT_DATABASE_DATA_SOURCE:
     957             :         {
     958          58 :             const SwDBData& rData = mpDoc->GetDBDesc();
     959          58 :             rValue <<= rData.sDataSource;
     960             :         }
     961          58 :         break;
     962             :         case HANDLE_CURRENT_DATABASE_COMMAND:
     963             :         {
     964          58 :             const SwDBData& rData = mpDoc->GetDBDesc();
     965          58 :             rValue <<= rData.sCommand;
     966             :         }
     967          58 :         break;
     968             :         case HANDLE_CURRENT_DATABASE_COMMAND_TYPE:
     969             :         {
     970          58 :             const SwDBData& rData = mpDoc->GetDBDesc();
     971          58 :             rValue <<= rData.nCommandType;
     972             :         }
     973          58 :         break;
     974             :         case HANDLE_SAVE_VERSION_ON_CLOSE:
     975             :         {
     976          58 :             rValue <<= mpDocSh->IsSaveVersionOnClose();
     977             :         }
     978          58 :         break;
     979             :         case HANDLE_UPDATE_FROM_TEMPLATE:
     980             :         {
     981          58 :             rValue <<= mpDocSh->IsQueryLoadTemplate();
     982             :         }
     983          58 :         break;
     984             :         case HANDLE_PRINTER_INDEPENDENT_LAYOUT:
     985             :         {
     986             :             // returns short (see css.document.PrinterIndependentLayout)
     987          58 :             sal_Int16 nVirDevType = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ?
     988          56 :                                     ( mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::USE_HIRES_VIRTUAL_DEVICE) ?
     989             :                                       document::PrinterIndependentLayout::HIGH_RESOLUTION :
     990             :                                       document::PrinterIndependentLayout::LOW_RESOLUTION ) :
     991         114 :                                     document::PrinterIndependentLayout::DISABLED;
     992          58 :             rValue <<= nVirDevType;
     993             :         }
     994          58 :         break;
     995             :         case HANDLE_IS_LABEL_DOC:
     996             :         {
     997          62 :             bool bLabel = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::LABEL_DOCUMENT);
     998          62 :             rValue <<= bLabel;
     999             :         }
    1000          62 :         break;
    1001             :         case HANDLE_IS_ADD_FLY_OFFSET:
    1002             :         {
    1003          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::ADD_FLY_OFFSETS);
    1004          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1005             :         }
    1006          58 :         break;
    1007             :         case HANDLE_IS_ADD_EXTERNAL_LEADING:
    1008             :         {
    1009          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::ADD_EXT_LEADING);
    1010          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1011             :         }
    1012          58 :         break;
    1013             :         case HANDLE_OLD_NUMBERING: // #111955#
    1014             :         {
    1015          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::OLD_NUMBERING);
    1016          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1017             :         }
    1018          58 :         break;
    1019             :         case HANDLE_OUTLINELEVEL_YIELDS_NUMBERING: // #111955#
    1020             :         {
    1021          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE);
    1022          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1023             :         }
    1024          58 :         break;
    1025             :         case HANDLE_ALLOW_PRINTJOB_CANCEL:
    1026             :         {
    1027          58 :             sal_Bool bPrintCancelState = mpDocSh->Stamp_GetPrintCancelState();
    1028          58 :             rValue.setValue(&bPrintCancelState, ::getBooleanCppuType());
    1029             :         }
    1030          58 :         break;
    1031             :         case HANDLE_USE_FORMER_LINE_SPACING:
    1032             :         {
    1033          62 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::OLD_LINE_SPACING);
    1034          62 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1035             :         }
    1036          62 :         break;
    1037             :         case HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS:
    1038             :         {
    1039          62 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS);
    1040          62 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1041             :         }
    1042          62 :         break;
    1043             :         case HANDLE_USE_FORMER_OBJECT_POSITIONING:
    1044             :         {
    1045          62 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::USE_FORMER_OBJECT_POS);
    1046          62 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1047             :         }
    1048          62 :         break;
    1049             :         case HANDLE_USE_FORMER_TEXT_WRAPPING:
    1050             :         {
    1051          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING);
    1052          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1053             :         }
    1054          58 :         break;
    1055             :         case HANDLE_CHANGES_PASSWORD:
    1056             :         {
    1057          58 :             rValue <<= mpDoc->getIDocumentRedlineAccess().GetRedlinePassword();
    1058             :         }
    1059          58 :         break;
    1060             :         case HANDLE_CONSIDER_WRAP_ON_OBJPOS:
    1061             :         {
    1062          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION);
    1063          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1064             :         }
    1065          58 :         break;
    1066             :         case HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING:
    1067             :         {
    1068          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING);
    1069          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1070             :         }
    1071          58 :         break;
    1072             :         case HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK:
    1073             :         {
    1074          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
    1075          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1076             :         }
    1077          58 :         break;
    1078             :         case HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
    1079             :         {
    1080          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT);
    1081          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1082             :         }
    1083          58 :         break;
    1084             :         case HANDLE_TABLE_ROW_KEEP :
    1085             :         {
    1086          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::TABLE_ROW_KEEP);
    1087          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1088             :         }
    1089          58 :         break;
    1090             :         case HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
    1091             :         {
    1092          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
    1093          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1094             :         }
    1095          58 :         break;
    1096             :         case HANDLE_LOAD_READONLY:
    1097             :         {
    1098          58 :             rValue <<= mpDocSh->IsLoadReadonly();
    1099             :         }
    1100          58 :         break;
    1101             :         case HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
    1102             :         {
    1103          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE);
    1104          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1105             :         }
    1106          58 :         break;
    1107             :         case HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES:
    1108             :         {
    1109          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME);
    1110          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1111             :         }
    1112          58 :         break;
    1113             :         case HANDLE_UNIX_FORCE_ZERO_EXT_LEADING:
    1114             :         {
    1115          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::UNIX_FORCE_ZERO_EXT_LEADING);
    1116          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1117             :         }
    1118          58 :         break;
    1119             :         case HANDLE_USE_OLD_PRINTER_METRICS:
    1120             :         {
    1121          58 :             sal_Bool bTmp = sal_False;
    1122          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1123             :         }
    1124          58 :         break;
    1125             :         case HANDLE_TABS_RELATIVE_TO_INDENT:
    1126             :         {
    1127          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT);
    1128          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1129             :         }
    1130          58 :         break;
    1131             :         case HANDLE_RSID:
    1132             :         {
    1133          58 :             rValue <<= static_cast < sal_Int32 > ( mpDoc->getRsid() );
    1134             :         }
    1135          58 :         break;
    1136             :         case HANDLE_RSID_ROOT:
    1137             :         {
    1138          58 :             rValue <<= static_cast < sal_Int32 > ( mpDoc->getRsidRoot() );
    1139             :         }
    1140          58 :         break;
    1141             :         case HANDLE_PROTECT_FORM:
    1142             :         {
    1143          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::PROTECT_FORM);
    1144          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1145             :         }
    1146          58 :         break;
    1147             :         // #i89181#
    1148             :         case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
    1149             :         {
    1150          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
    1151          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1152             :         }
    1153          58 :         break;
    1154             :         case HANDLE_MODIFYPASSWORDINFO:
    1155             :         {
    1156          58 :             rValue <<= mpDocSh->GetModifyPasswordInfo();
    1157             :         }
    1158          58 :         break;
    1159             :         case HANDLE_MATH_BASELINE_ALIGNMENT:
    1160             :         {
    1161          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
    1162          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1163             :         }
    1164          58 :         break;
    1165             :     case HANDLE_INVERT_BORDER_SPACING:
    1166             :     {
    1167          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::INVERT_BORDER_SPACING);
    1168          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1169             :     }
    1170          58 :     break;
    1171             :         case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
    1172             :         {
    1173          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA );
    1174          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1175             :         }
    1176          58 :         break;
    1177             :         case HANDLE_SMALL_CAPS_PERCENTAGE_66:
    1178             :         {
    1179          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66 );
    1180          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1181             :         }
    1182          58 :         break;
    1183             :         case HANDLE_TAB_OVERFLOW:
    1184             :         {
    1185          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::TAB_OVERFLOW );
    1186          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1187             :         }
    1188          58 :         break;
    1189             :         case HANDLE_UNBREAKABLE_NUMBERINGS:
    1190             :         {
    1191          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS );
    1192          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1193             :         }
    1194          58 :         break;
    1195             :         case HANDLE_STYLES_NODEFAULT:
    1196             :         {
    1197          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::STYLES_NODEFAULT );
    1198          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1199             :         }
    1200          58 :         break;
    1201             :         case HANDLE_FLOATTABLE_NOMARGINS:
    1202             :         {
    1203          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::FLOATTABLE_NOMARGINS );
    1204          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1205             :         }
    1206          58 :         break;
    1207             :         case HANDLE_CLIPPED_PICTURES:
    1208             :         {
    1209          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::CLIPPED_PICTURES );
    1210          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1211             :         }
    1212          58 :         break;
    1213             :         case HANDLE_BACKGROUND_PARA_OVER_DRAWINGS:
    1214             :         {
    1215          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::BACKGROUND_PARA_OVER_DRAWINGS );
    1216          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1217             :         }
    1218          58 :         break;
    1219             :         case HANDLE_EMBED_FONTS:
    1220             :         {
    1221          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::EMBED_FONTS );
    1222          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1223             :         }
    1224          58 :         break;
    1225             :         case HANDLE_EMBED_SYSTEM_FONTS:
    1226             :         {
    1227          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::EMBED_SYSTEM_FONTS );
    1228          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1229             :         }
    1230          58 :         break;
    1231             :         case HANDLE_TAB_OVER_MARGIN:
    1232             :         {
    1233          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::TAB_OVER_MARGIN );
    1234          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1235             :         }
    1236          58 :         break;
    1237             :         case HANDLE_SURROUND_TEXT_WRAP_SMALL:
    1238             :         {
    1239          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL );
    1240          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1241             :         }
    1242          58 :         break;
    1243             :         case HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING:
    1244             :         {
    1245          58 :             sal_Bool bTmp = mpDoc->getIDocumentSettingAccess().get( IDocumentSettingAccess::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING );
    1246          58 :             rValue.setValue( &bTmp, ::getBooleanCppuType() );
    1247             :         }
    1248          58 :         break;
    1249             :         case HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
    1250             :         {
    1251          58 :             bool const bTmp(mpDoc->getIDocumentSettingAccess().get(
    1252          58 :                 IDocumentSettingAccess::PROP_LINE_SPACING_SHRINKS_FIRST_LINE));
    1253          58 :             rValue <<= bTmp;
    1254             :         }
    1255          58 :         break;
    1256             :         default:
    1257           0 :             throw UnknownPropertyException();
    1258             :     }
    1259        3726 : }
    1260             : 
    1261        3726 : void SwXDocumentSettings::_postGetValues ()
    1262             :         throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException )
    1263             : {
    1264        3726 :     mpDocSh = 0;
    1265        3726 :     mpDoc = 0;
    1266        3726 : }
    1267             : 
    1268             : // XServiceInfo
    1269           0 : OUString SAL_CALL SwXDocumentSettings::getImplementationName(  )
    1270             :     throw(RuntimeException, std::exception)
    1271             : {
    1272           0 :     return OUString("com.sun.star.comp.Writer.DocumentSettings");
    1273             : }
    1274             : 
    1275           4 : sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceName )
    1276             :     throw(RuntimeException, std::exception)
    1277             : {
    1278           4 :     return cppu::supportsService(this, ServiceName);
    1279             : }
    1280             : 
    1281           4 : Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames(  )
    1282             :     throw(RuntimeException, std::exception)
    1283             : {
    1284           4 :     Sequence< OUString > aSeq( 3 );
    1285           4 :     aSeq[0] = "com.sun.star.document.Settings";
    1286           4 :     aSeq[1] = "com.sun.star.text.DocumentSettings";
    1287           4 :     aSeq[2] = "com.sun.star.text.PrintSettings";
    1288           4 :     return aSeq;
    1289         270 : }
    1290             : 
    1291             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10