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

Generated by: LCOV version 1.10