LCOV - code coverage report
Current view: top level - sc/source/ui/unoobj - styleuno.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 787 1066 73.8 %
Date: 2014-04-11 Functions: 63 94 67.0 %
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 "scitems.hxx"
      21             : #include <editeng/memberids.hrc>
      22             : #include <svx/algitem.hxx>
      23             : #include <editeng/boxitem.hxx>
      24             : #include <editeng/langitem.hxx>
      25             : #include <editeng/numitem.hxx>
      26             : #include <svx/pageitem.hxx>
      27             : #include <editeng/pbinitem.hxx>
      28             : #include <svx/unomid.hxx>
      29             : #include <editeng/unonrule.hxx>
      30             : #include <sfx2/bindings.hxx>
      31             : #include <sfx2/printer.hxx>
      32             : #include <vcl/virdev.hxx>
      33             : #include <vcl/svapp.hxx>
      34             : #include <svl/itempool.hxx>
      35             : #include <svl/itemset.hxx>
      36             : #include <svl/intitem.hxx>
      37             : #include <svl/zformat.hxx>
      38             : 
      39             : #include <com/sun/star/table/BorderLine.hpp>
      40             : #include <com/sun/star/table/CellVertJustify2.hpp>
      41             : #include <com/sun/star/table/TableBorder.hpp>
      42             : #include <com/sun/star/table/ShadowFormat.hpp>
      43             : #include <com/sun/star/table/CellHoriJustify.hpp>
      44             : #include <com/sun/star/table/CellOrientation.hpp>
      45             : #include <com/sun/star/style/PageStyleLayout.hpp>
      46             : #include <com/sun/star/style/GraphicLocation.hpp>
      47             : #include <com/sun/star/sheet/XHeaderFooterContent.hpp>
      48             : #include <com/sun/star/util/CellProtection.hpp>
      49             : #include <com/sun/star/awt/FontSlant.hpp>
      50             : #include <com/sun/star/awt/Size.hpp>
      51             : #include <com/sun/star/lang/Locale.hpp>
      52             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      53             : #include <cppuhelper/supportsservice.hxx>
      54             : 
      55             : #include "styleuno.hxx"
      56             : #include "docsh.hxx"
      57             : #include "attrib.hxx"
      58             : #include "stlpool.hxx"
      59             : #include "docpool.hxx"
      60             : #include "miscuno.hxx"
      61             : #include "convuno.hxx"
      62             : #include "tablink.hxx"
      63             : #include "unonames.hxx"
      64             : #include "unowids.hxx"
      65             : #include "globstr.hrc"
      66             : #include "cellsuno.hxx"
      67             : #include "stylehelper.hxx"
      68             : 
      69             : using namespace ::com::sun::star;
      70             : 
      71        1686 : static const SfxItemPropertySet* lcl_GetCellStyleSet()
      72             : {
      73             :     static const SfxItemPropertyMapEntry aCellStyleMap_Impl[] =
      74             :     {
      75          28 :         {OUString(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,getBooleanCppuType(),                  0, 0 },
      76          28 :         {OUString(SC_UNONAME_BOTTBORDER),ATTR_BORDER,       ::getCppuType((const table::BorderLine*)0),        0, BOTTOM_BORDER | CONVERT_TWIPS },
      77          28 :         {OUString(SC_UNONAME_BOTTBORDER2),ATTR_BORDER,       ::getCppuType((const table::BorderLine2*)0),        0, BOTTOM_BORDER | CONVERT_TWIPS },
      78          28 :         {OUString(SC_UNONAME_CELLBACK), ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
      79          28 :         {OUString(SC_UNONAME_CELLPRO),  ATTR_PROTECTION,    ::getCppuType((const util::CellProtection*)0), 0, 0 },
      80          28 :         {OUString(SC_UNONAME_CCOLOR),   ATTR_FONT_COLOR,    ::getCppuType((const sal_Int32*)0),            0, 0 },
      81          28 :         {OUString(SC_UNONAME_COUTL),    ATTR_FONT_CONTOUR,  ::getBooleanCppuType(),            0, 0 },
      82          28 :         {OUString(SC_UNONAME_CCROSS),   ATTR_FONT_CROSSEDOUT,::getBooleanCppuType(),           0, MID_CROSSED_OUT },
      83          28 :         {OUString(SC_UNONAME_CEMPHAS),  ATTR_FONT_EMPHASISMARK,getCppuType((sal_Int16*)0),         0, MID_EMPHASIS },
      84          28 :         {OUString(SC_UNONAME_CFONT),    ATTR_FONT,          ::getCppuType((const sal_Int16*)0),            0, MID_FONT_FAMILY },
      85          28 :         {OUString(SC_UNONAME_CFCHARS),  ATTR_FONT,          getCppuType((sal_Int16*)0),            0, MID_FONT_CHAR_SET },
      86          28 :         {OUString(SC_UNO_CJK_CFCHARS),  ATTR_CJK_FONT,      getCppuType((sal_Int16*)0),            0, MID_FONT_CHAR_SET },
      87          28 :         {OUString(SC_UNO_CTL_CFCHARS),  ATTR_CTL_FONT,      getCppuType((sal_Int16*)0),            0, MID_FONT_CHAR_SET },
      88          28 :         {OUString(SC_UNONAME_CFFAMIL),  ATTR_FONT,          getCppuType((sal_Int16*)0),            0, MID_FONT_FAMILY },
      89          28 :         {OUString(SC_UNO_CJK_CFFAMIL),  ATTR_CJK_FONT,      getCppuType((sal_Int16*)0),            0, MID_FONT_FAMILY },
      90          28 :         {OUString(SC_UNO_CTL_CFFAMIL),  ATTR_CTL_FONT,      getCppuType((sal_Int16*)0),            0, MID_FONT_FAMILY },
      91          28 :         {OUString(SC_UNONAME_CFNAME),   ATTR_FONT,          getCppuType((OUString*)0),        0, MID_FONT_FAMILY_NAME },
      92          28 :         {OUString(SC_UNO_CJK_CFNAME),   ATTR_CJK_FONT,      getCppuType((OUString*)0),        0, MID_FONT_FAMILY_NAME },
      93          28 :         {OUString(SC_UNO_CTL_CFNAME),   ATTR_CTL_FONT,      getCppuType((OUString*)0),        0, MID_FONT_FAMILY_NAME },
      94          28 :         {OUString(SC_UNONAME_CFPITCH),  ATTR_FONT,          getCppuType((sal_Int16*)0),            0, MID_FONT_PITCH },
      95          28 :         {OUString(SC_UNO_CJK_CFPITCH),  ATTR_CJK_FONT,      getCppuType((sal_Int16*)0),            0, MID_FONT_PITCH },
      96          28 :         {OUString(SC_UNO_CTL_CFPITCH),  ATTR_CTL_FONT,      getCppuType((sal_Int16*)0),            0, MID_FONT_PITCH },
      97          28 :         {OUString(SC_UNONAME_CFSTYLE),  ATTR_FONT,          getCppuType((OUString*)0),        0, MID_FONT_STYLE_NAME },
      98          28 :         {OUString(SC_UNO_CJK_CFSTYLE),  ATTR_CJK_FONT,      getCppuType((OUString*)0),        0, MID_FONT_STYLE_NAME },
      99          28 :         {OUString(SC_UNO_CTL_CFSTYLE),  ATTR_CTL_FONT,      getCppuType((OUString*)0),        0, MID_FONT_STYLE_NAME },
     100          28 :         {OUString(SC_UNONAME_CHEIGHT),  ATTR_FONT_HEIGHT,   ::getCppuType((const float*)0),            0, MID_FONTHEIGHT | CONVERT_TWIPS },
     101          28 :         {OUString(SC_UNO_CJK_CHEIGHT),  ATTR_CJK_FONT_HEIGHT,::getCppuType((const float*)0),           0, MID_FONTHEIGHT | CONVERT_TWIPS },
     102          28 :         {OUString(SC_UNO_CTL_CHEIGHT),  ATTR_CTL_FONT_HEIGHT,::getCppuType((const float*)0),           0, MID_FONTHEIGHT | CONVERT_TWIPS },
     103          28 :         {OUString(SC_UNONAME_CLOCAL),   ATTR_FONT_LANGUAGE, ::getCppuType((const lang::Locale*)0),         0, MID_LANG_LOCALE },
     104          28 :         {OUString(SC_UNO_CJK_CLOCAL),   ATTR_CJK_FONT_LANGUAGE,::getCppuType((const lang::Locale*)0),          0, MID_LANG_LOCALE },
     105          28 :         {OUString(SC_UNO_CTL_CLOCAL),   ATTR_CTL_FONT_LANGUAGE,::getCppuType((const lang::Locale*)0),          0, MID_LANG_LOCALE },
     106          28 :         {OUString(SC_UNONAME_COVER),    ATTR_FONT_OVERLINE, ::getCppuType((const sal_Int16*)0),    0, MID_TL_STYLE },
     107          28 :         {OUString(SC_UNONAME_COVRLCOL), ATTR_FONT_OVERLINE, getCppuType((sal_Int32*)0),            0, MID_TL_COLOR },
     108          28 :         {OUString(SC_UNONAME_COVRLHAS), ATTR_FONT_OVERLINE, getBooleanCppuType(),                  0, MID_TL_HASCOLOR },
     109          28 :         {OUString(SC_UNONAME_CPOST),    ATTR_FONT_POSTURE,  ::getCppuType((const awt::FontSlant*)0),       0, MID_POSTURE },
     110          28 :         {OUString(SC_UNO_CJK_CPOST),    ATTR_CJK_FONT_POSTURE,::getCppuType((const awt::FontSlant*)0),     0, MID_POSTURE },
     111          28 :         {OUString(SC_UNO_CTL_CPOST),    ATTR_CTL_FONT_POSTURE,::getCppuType((const awt::FontSlant*)0),     0, MID_POSTURE },
     112          28 :         {OUString(SC_UNONAME_CRELIEF),  ATTR_FONT_RELIEF,   getCppuType((sal_Int16*)0),            0, MID_RELIEF },
     113          28 :         {OUString(SC_UNONAME_CSHADD),   ATTR_FONT_SHADOWED, ::getBooleanCppuType(),            0, 0 },
     114          28 :         {OUString(SC_UNONAME_CSTRIKE),  ATTR_FONT_CROSSEDOUT,getCppuType((sal_Int16*)0),           0, MID_CROSS_OUT },
     115          28 :         {OUString(SC_UNONAME_CUNDER),   ATTR_FONT_UNDERLINE,::getCppuType((const sal_Int16*)0),    0, MID_TL_STYLE },
     116          28 :         {OUString(SC_UNONAME_CUNDLCOL), ATTR_FONT_UNDERLINE,getCppuType((sal_Int32*)0),            0, MID_TL_COLOR },
     117          28 :         {OUString(SC_UNONAME_CUNDLHAS), ATTR_FONT_UNDERLINE,getBooleanCppuType(),                  0, MID_TL_HASCOLOR },
     118          28 :         {OUString(SC_UNONAME_CWEIGHT),  ATTR_FONT_WEIGHT,   ::getCppuType((const float*)0),            0, MID_WEIGHT },
     119          28 :         {OUString(SC_UNO_CJK_CWEIGHT),  ATTR_CJK_FONT_WEIGHT,::getCppuType((const float*)0),           0, MID_WEIGHT },
     120          28 :         {OUString(SC_UNO_CTL_CWEIGHT),  ATTR_CTL_FONT_WEIGHT,::getCppuType((const float*)0),           0, MID_WEIGHT },
     121          28 :         {OUString(SC_UNONAME_CWORDMOD), ATTR_FONT_WORDLINE, getBooleanCppuType(),                  0, 0 },
     122          28 :         {OUString(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, ::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
     123          28 :         {OUString(SC_UNONAME_DIAGONAL_BLTR2), ATTR_BORDER_BLTR, ::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
     124          28 :         {OUString(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, ::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
     125          28 :         {OUString(SC_UNONAME_DIAGONAL_TLBR2), ATTR_BORDER_TLBR, ::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
     126          28 :         {OUString(SC_UNONAME_DISPNAME), SC_WID_UNO_DISPNAME,::getCppuType((OUString*)0),  beans::PropertyAttribute::READONLY, 0 },
     127          28 :         {OUString(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY,   ::getCppuType((const table::CellHoriJustify*)0),   0, MID_HORJUST_HORJUST },
     128          28 :         {OUString(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, ::getCppuType((const sal_Int32*)0),   0, 0 },
     129          28 :         {OUString(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     130          28 :         {OUString(SC_UNONAME_WRAP),     ATTR_LINEBREAK,     ::getBooleanCppuType(),            0, 0 },
     131          28 :         {OUString(SC_UNONAME_LEFTBORDER),ATTR_BORDER,       ::getCppuType((const table::BorderLine*)0),        0, LEFT_BORDER | CONVERT_TWIPS },
     132          28 :         {OUString(SC_UNONAME_LEFTBORDER2),ATTR_BORDER,       ::getCppuType((const table::BorderLine2*)0),        0, LEFT_BORDER | CONVERT_TWIPS },
     133          28 :         {OUString(SC_UNONAME_NUMFMT),   ATTR_VALUE_FORMAT,  ::getCppuType((const sal_Int32*)0),            0, 0 },
     134             : //      {SC_UNONAME_NUMRULES, SC_WID_UNO_NUMRULES,getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
     135          28 :         {OUString(SC_UNONAME_CELLORI),  ATTR_STACKED,       ::getCppuType((const table::CellOrientation*)0),   0, 0 },
     136          28 :         {OUString(SC_UNONAME_PADJUST),  ATTR_HOR_JUSTIFY,   ::getCppuType((const sal_Int16*)0),    0, MID_HORJUST_ADJUST },
     137          28 :         {OUString(SC_UNONAME_PBMARGIN), ATTR_MARGIN,        ::getCppuType((const sal_Int32*)0),            0, MID_MARGIN_LO_MARGIN | CONVERT_TWIPS },
     138          28 :         {OUString(SC_UNONAME_PINDENT),  ATTR_INDENT,        ::getCppuType((const sal_Int16*)0),            0, 0 }, //! CONVERT_TWIPS
     139          28 :         {OUString(SC_UNONAME_PISCHDIST),ATTR_SCRIPTSPACE,   ::getBooleanCppuType(),                    0, 0 },
     140          28 :         {OUString(SC_UNONAME_PISFORBID),ATTR_FORBIDDEN_RULES,::getBooleanCppuType(),                   0, 0 },
     141          28 :         {OUString(SC_UNONAME_PISHANG),  ATTR_HANGPUNCTUATION,::getBooleanCppuType(),                   0, 0 },
     142          28 :         {OUString(SC_UNONAME_PISHYPHEN),ATTR_HYPHENATE,     getBooleanCppuType(),                  0, 0 },
     143          28 :         {OUString(SC_UNONAME_PLASTADJ), ATTR_HOR_JUSTIFY,   ::getCppuType((const sal_Int16*)0),    0, MID_HORJUST_ADJUST },
     144          28 :         {OUString(SC_UNONAME_PLMARGIN), ATTR_MARGIN,        ::getCppuType((const sal_Int32*)0),            0, MID_MARGIN_L_MARGIN  | CONVERT_TWIPS },
     145          28 :         {OUString(SC_UNONAME_PRMARGIN), ATTR_MARGIN,        ::getCppuType((const sal_Int32*)0),            0, MID_MARGIN_R_MARGIN  | CONVERT_TWIPS },
     146          28 :         {OUString(SC_UNONAME_PTMARGIN), ATTR_MARGIN,        ::getCppuType((const sal_Int32*)0),            0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
     147          28 :         {OUString(SC_UNONAME_RIGHTBORDER),ATTR_BORDER,      ::getCppuType((const table::BorderLine*)0),        0, RIGHT_BORDER | CONVERT_TWIPS },
     148          28 :         {OUString(SC_UNONAME_RIGHTBORDER2),ATTR_BORDER,      ::getCppuType((const table::BorderLine2*)0),        0, RIGHT_BORDER | CONVERT_TWIPS },
     149          28 :         {OUString(SC_UNONAME_ROTANG),   ATTR_ROTATE_VALUE,  ::getCppuType((const sal_Int32*)0),            0, 0 },
     150          28 :         {OUString(SC_UNONAME_ROTREF),   ATTR_ROTATE_MODE,   ::getCppuType((const sal_Int32*)0),    0, 0 },
     151          28 :         {OUString(SC_UNONAME_SHADOW),   ATTR_SHADOW,        ::getCppuType((const table::ShadowFormat*)0),  0, 0 | CONVERT_TWIPS },
     152          28 :         {OUString(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, getBooleanCppuType(),               0, 0 },
     153          28 :         {OUString(SC_UNONAME_TBLBORD),  SC_WID_UNO_TBLBORD, ::getCppuType((const table::TableBorder*)0),       0, 0 | CONVERT_TWIPS },
     154          28 :         {OUString(SC_UNONAME_TBLBORD),  SC_WID_UNO_TBLBORD2, ::getCppuType((const table::TableBorder2*)0),       0, 0 | CONVERT_TWIPS },
     155          28 :         {OUString(SC_UNONAME_TOPBORDER),ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, TOP_BORDER | CONVERT_TWIPS },
     156          28 :         {OUString(SC_UNONAME_TOPBORDER2),ATTR_BORDER,        ::getCppuType((const table::BorderLine2*)0),        0, TOP_BORDER | CONVERT_TWIPS },
     157          28 :         {OUString(SC_UNONAME_USERDEF),  ATTR_USERDEF,       getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
     158          28 :         {OUString(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY,   ::getCppuType((const sal_Int32*)0),    0, 0 },
     159          28 :         {OUString(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, ::getCppuType((const sal_Int32*)0),   0, 0 },
     160          28 :         {OUString(SC_UNONAME_WRITING),  ATTR_WRITINGDIR,    getCppuType((sal_Int16*)0),            0, 0 },
     161          28 :         {OUString(SC_UNONAME_HIDDEN),   ATTR_HIDDEN,        getCppuType((sal_Bool*)0),             0, 0 },
     162          28 :         {OUString(SC_UNONAME_HYPERLINK),  ATTR_HYPERLINK, getCppuType((OUString*)0),        0, 0 },
     163             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     164        4150 :     };
     165        1686 :     static SfxItemPropertySet aCellStyleSet_Impl( aCellStyleMap_Impl );
     166        1686 :     return &aCellStyleSet_Impl;
     167             : }
     168             : 
     169             : //  Map mit allen Seitenattributen, incl. Kopf-/Fusszeilenattribute
     170             : 
     171         625 : static const SfxItemPropertySet * lcl_GetPageStyleSet()
     172             : {
     173             :     static const SfxItemPropertyMapEntry aPageStyleMap_Impl[] =
     174             :     {
     175          22 :         {OUString(SC_UNO_PAGE_BACKCOLOR),   ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
     176          22 :         {OUString(SC_UNO_PAGE_GRAPHICFILT), ATTR_BACKGROUND,    ::getCppuType((const OUString*)0),          0, MID_GRAPHIC_FILTER },
     177          22 :         {OUString(SC_UNO_PAGE_GRAPHICLOC),  ATTR_BACKGROUND,    ::getCppuType((const style::GraphicLocation*)0),   0, MID_GRAPHIC_POSITION },
     178          22 :         {OUString(SC_UNO_PAGE_GRAPHICURL),  ATTR_BACKGROUND,    ::getCppuType((const OUString*)0),          0, MID_GRAPHIC_URL },
     179          22 :         {OUString(SC_UNO_PAGE_BACKTRANS),   ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     180          22 :         {OUString(OLD_UNO_PAGE_BACKCOLOR),  ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
     181          22 :         {OUString(SC_UNO_PAGE_BORDERDIST),  ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, BORDER_DISTANCE | CONVERT_TWIPS },
     182          22 :         {OUString(SC_UNO_PAGE_BOTTBORDER),  ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, BOTTOM_BORDER | CONVERT_TWIPS },
     183          22 :         {OUString(SC_UNO_PAGE_BOTTBRDDIST), ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, BOTTOM_BORDER_DISTANCE | CONVERT_TWIPS },
     184          22 :         {OUString(SC_UNO_PAGE_BOTTMARGIN),  ATTR_ULSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_LO_MARGIN | CONVERT_TWIPS },
     185          22 :         {OUString(SC_UNO_PAGE_CENTERHOR),   ATTR_PAGE_HORCENTER,::getBooleanCppuType(),            0, 0 },
     186          22 :         {OUString(SC_UNO_PAGE_CENTERVER),   ATTR_PAGE_VERCENTER,::getBooleanCppuType(),            0, 0 },
     187          22 :         {OUString(SC_UNONAME_DISPNAME),     SC_WID_UNO_DISPNAME,::getCppuType((OUString*)0),  beans::PropertyAttribute::READONLY, 0 },
     188          22 :         {OUString(SC_UNO_PAGE_FIRSTPAGE),   ATTR_PAGE_FIRSTPAGENO,::getCppuType((const sal_Int16*)0),      0, 0 },
     189             : 
     190          22 :         {OUString(SC_UNO_PAGE_FTRBACKCOL),  SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     191          22 :         {OUString(SC_UNO_PAGE_FTRGRFFILT),  SC_WID_UNO_FOOTERSET,::getCppuType((const OUString*)0),     0, 0 },
     192          22 :         {OUString(SC_UNO_PAGE_FTRGRFLOC),   SC_WID_UNO_FOOTERSET,::getCppuType((const style::GraphicLocation*)0), 0, 0 },
     193          22 :         {OUString(SC_UNO_PAGE_FTRGRFURL),   SC_WID_UNO_FOOTERSET,::getCppuType((const OUString*)0),     0, 0 },
     194          22 :         {OUString(SC_UNO_PAGE_FTRBACKTRAN), SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     195          22 :         {OUString(OLD_UNO_PAGE_FTRBACKCOL), SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     196          22 :         {OUString(SC_UNO_PAGE_FTRBODYDIST), SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     197          22 :         {OUString(SC_UNO_PAGE_FTRBRDDIST),  SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     198          22 :         {OUString(SC_UNO_PAGE_FTRBOTTBOR),  SC_WID_UNO_FOOTERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     199          22 :         {OUString(SC_UNO_PAGE_FTRBOTTBDIS), SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     200          22 :         {OUString(OLD_UNO_PAGE_FTRDYNAMIC), SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     201          22 :         {OUString(SC_UNO_PAGE_FTRHEIGHT),   SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     202          22 :         {OUString(SC_UNO_PAGE_FTRDYNAMIC),  SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     203          22 :         {OUString(SC_UNO_PAGE_FTRON),       SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     204          22 :         {OUString(SC_UNO_PAGE_FTRSHARED),   SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     205          22 :         {OUString(SC_UNO_PAGE_FTRLEFTBOR),  SC_WID_UNO_FOOTERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     206          22 :         {OUString(SC_UNO_PAGE_FTRLEFTBDIS), SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     207          22 :         {OUString(SC_UNO_PAGE_FTRLEFTMAR),  SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     208          22 :         {OUString(OLD_UNO_PAGE_FTRON),      SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     209          22 :         {OUString(SC_UNO_PAGE_FTRRIGHTBOR), SC_WID_UNO_FOOTERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     210          22 :         {OUString(SC_UNO_PAGE_FTRRIGHTBDIS),SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     211          22 :         {OUString(SC_UNO_PAGE_FTRRIGHTMAR), SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     212          22 :         {OUString(SC_UNO_PAGE_FTRSHADOW),   SC_WID_UNO_FOOTERSET,::getCppuType((const table::ShadowFormat*)0), 0, 0 },
     213          22 :         {OUString(OLD_UNO_PAGE_FTRSHARED),  SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     214          22 :         {OUString(SC_UNO_PAGE_FTRTOPBOR),   SC_WID_UNO_FOOTERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     215          22 :         {OUString(SC_UNO_PAGE_FTRTOPBDIS),  SC_WID_UNO_FOOTERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     216             : 
     217          22 :         {OUString(SC_UNO_PAGE_HDRBACKCOL),  SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     218          22 :         {OUString(SC_UNO_PAGE_HDRGRFFILT),  SC_WID_UNO_HEADERSET,::getCppuType((const OUString*)0),     0, 0 },
     219          22 :         {OUString(SC_UNO_PAGE_HDRGRFLOC),   SC_WID_UNO_HEADERSET,::getCppuType((const style::GraphicLocation*)0), 0, 0 },
     220          22 :         {OUString(SC_UNO_PAGE_HDRGRFURL),   SC_WID_UNO_HEADERSET,::getCppuType((const OUString*)0),     0, 0 },
     221          22 :         {OUString(SC_UNO_PAGE_HDRBACKTRAN), SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     222          22 :         {OUString(OLD_UNO_PAGE_HDRBACKCOL), SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     223          22 :         {OUString(SC_UNO_PAGE_HDRBODYDIST), SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     224          22 :         {OUString(SC_UNO_PAGE_HDRBRDDIST),  SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     225          22 :         {OUString(SC_UNO_PAGE_HDRBOTTBOR),  SC_WID_UNO_HEADERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     226          22 :         {OUString(SC_UNO_PAGE_HDRBOTTBDIS), SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     227          22 :         {OUString(OLD_UNO_PAGE_HDRDYNAMIC), SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     228          22 :         {OUString(SC_UNO_PAGE_HDRHEIGHT),   SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     229          22 :         {OUString(SC_UNO_PAGE_HDRDYNAMIC),  SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     230          22 :         {OUString(SC_UNO_PAGE_HDRON),       SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     231          22 :         {OUString(SC_UNO_PAGE_HDRSHARED),   SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     232          22 :         {OUString(SC_UNO_PAGE_HDRLEFTBOR),  SC_WID_UNO_HEADERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     233          22 :         {OUString(SC_UNO_PAGE_HDRLEFTBDIS), SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     234          22 :         {OUString(SC_UNO_PAGE_HDRLEFTMAR),  SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     235          22 :         {OUString(OLD_UNO_PAGE_HDRON),      SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     236          22 :         {OUString(SC_UNO_PAGE_HDRRIGHTBOR), SC_WID_UNO_HEADERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     237          22 :         {OUString(SC_UNO_PAGE_HDRRIGHTBDIS),SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     238          22 :         {OUString(SC_UNO_PAGE_HDRRIGHTMAR), SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     239          22 :         {OUString(SC_UNO_PAGE_HDRSHADOW),   SC_WID_UNO_HEADERSET,::getCppuType((const table::ShadowFormat*)0), 0, 0 },
     240          22 :         {OUString(OLD_UNO_PAGE_HDRSHARED),  SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     241          22 :         {OUString(SC_UNO_PAGE_HDRTOPBOR),   SC_WID_UNO_HEADERSET,::getCppuType((const table::BorderLine*)0),   0, 0 },
     242          22 :         {OUString(SC_UNO_PAGE_HDRTOPBDIS),  SC_WID_UNO_HEADERSET,::getCppuType((const sal_Int32*)0),           0, 0 },
     243             : 
     244          22 :         {OUString(SC_UNO_PAGE_HEIGHT),      ATTR_PAGE_SIZE,     ::getCppuType((const sal_Int32*)0),            0, MID_SIZE_HEIGHT | CONVERT_TWIPS },
     245          22 :         {OUString(OLD_UNO_PAGE_BACKTRANS),  ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     246          22 :         {OUString(SC_UNO_PAGE_LANDSCAPE),   ATTR_PAGE,          ::getBooleanCppuType(),            0, MID_PAGE_ORIENTATION },
     247          22 :         {OUString(SC_UNO_PAGE_LEFTBORDER),  ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, LEFT_BORDER | CONVERT_TWIPS },
     248          22 :         {OUString(SC_UNO_PAGE_LEFTBRDDIST), ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, LEFT_BORDER_DISTANCE | CONVERT_TWIPS },
     249          22 :         {OUString(SC_UNO_PAGE_LEFTMARGIN),  ATTR_LRSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_L_MARGIN | CONVERT_TWIPS },
     250          22 :         {OUString(SC_UNO_PAGE_LEFTFTRCONT), ATTR_PAGE_FOOTERLEFT,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0), 0, 0 },
     251          22 :         {OUString(SC_UNO_PAGE_LEFTHDRCONT), ATTR_PAGE_HEADERLEFT,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0), 0, 0 },
     252          22 :         {OUString(SC_UNO_PAGE_NUMBERTYPE),  ATTR_PAGE,          ::getCppuType((const sal_Int16*)0),            0, MID_PAGE_NUMTYPE },
     253          22 :         {OUString(SC_UNO_PAGE_SCALEVAL),    ATTR_PAGE_SCALE,    ::getCppuType((const sal_Int16*)0),            0, 0 },
     254          22 :         {OUString(SC_UNO_PAGE_SYTLELAYOUT), ATTR_PAGE,          ::getCppuType((const style::PageStyleLayout*)0),   0, MID_PAGE_LAYOUT },
     255          22 :         {OUString(SC_UNO_PAGE_PRINTANNOT),  ATTR_PAGE_NOTES,    ::getBooleanCppuType(),            0, 0 },
     256          22 :         {OUString(SC_UNO_PAGE_PRINTCHARTS), ATTR_PAGE_CHARTS,   ::getBooleanCppuType(),            0, 0 },
     257          22 :         {OUString(SC_UNO_PAGE_PRINTDOWN),   ATTR_PAGE_TOPDOWN,  ::getBooleanCppuType(),            0, 0 },
     258          22 :         {OUString(SC_UNO_PAGE_PRINTDRAW),   ATTR_PAGE_DRAWINGS, ::getBooleanCppuType(),            0, 0 },
     259          22 :         {OUString(SC_UNO_PAGE_PRINTFORMUL), ATTR_PAGE_FORMULAS, ::getBooleanCppuType(),            0, 0 },
     260          22 :         {OUString(SC_UNO_PAGE_PRINTGRID),   ATTR_PAGE_GRID,     ::getBooleanCppuType(),            0, 0 },
     261          22 :         {OUString(SC_UNO_PAGE_PRINTHEADER), ATTR_PAGE_HEADERS,  ::getBooleanCppuType(),            0, 0 },
     262          22 :         {OUString(SC_UNO_PAGE_PRINTOBJS),   ATTR_PAGE_OBJECTS,  ::getBooleanCppuType(),            0, 0 },
     263          22 :         {OUString(SC_UNO_PAGE_PRINTZERO),   ATTR_PAGE_NULLVALS, ::getBooleanCppuType(),            0, 0 },
     264          22 :         {OUString(SC_UNO_PAGE_PAPERTRAY),   ATTR_PAGE_PAPERBIN, ::getCppuType((const OUString*)0),      0, 0 },
     265          22 :         {OUString(SC_UNO_PAGE_RIGHTBORDER), ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, RIGHT_BORDER | CONVERT_TWIPS },
     266          22 :         {OUString(SC_UNO_PAGE_RIGHTBRDDIST),ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, RIGHT_BORDER_DISTANCE | CONVERT_TWIPS },
     267          22 :         {OUString(SC_UNO_PAGE_RIGHTMARGIN), ATTR_LRSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_R_MARGIN | CONVERT_TWIPS },
     268          22 :         {OUString(SC_UNO_PAGE_RIGHTFTRCON), ATTR_PAGE_FOOTERRIGHT,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0), 0, 0 },
     269          22 :         {OUString(SC_UNO_PAGE_RIGHTHDRCON), ATTR_PAGE_HEADERRIGHT,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0), 0, 0 },
     270          22 :         {OUString(SC_UNO_PAGE_SCALETOPAG),  ATTR_PAGE_SCALETOPAGES,::getCppuType((const sal_Int16*)0),     0, 0 },
     271          22 :         {OUString(SC_UNO_PAGE_SCALETOX),    ATTR_PAGE_SCALETO,  ::getCppuType((const sal_Int16*)0),        0, 0 },
     272          22 :         {OUString(SC_UNO_PAGE_SCALETOY),    ATTR_PAGE_SCALETO,  ::getCppuType((const sal_Int16*)0),        0, 0 },
     273          22 :         {OUString(SC_UNO_PAGE_SHADOWFORM),  ATTR_SHADOW,        ::getCppuType((const table::ShadowFormat*)0),  0, 0 | CONVERT_TWIPS },
     274          22 :         {OUString(SC_UNO_PAGE_SIZE),        ATTR_PAGE_SIZE,     ::getCppuType((const awt::Size*)0),            0, MID_SIZE_SIZE | CONVERT_TWIPS },
     275          22 :         {OUString(SC_UNO_PAGE_TOPBORDER),   ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, TOP_BORDER | CONVERT_TWIPS },
     276          22 :         {OUString(SC_UNO_PAGE_TOPBRDDIST),  ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, TOP_BORDER_DISTANCE | CONVERT_TWIPS },
     277          22 :         {OUString(SC_UNO_PAGE_TOPMARGIN),   ATTR_ULSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_UP_MARGIN | CONVERT_TWIPS },
     278          22 :         {OUString(OLD_UNO_PAGE_FTRBACKTRAN),SC_WID_UNO_FOOTERSET,::getBooleanCppuType(),                       0, 0 },
     279          22 :         {OUString(OLD_UNO_PAGE_HDRBACKTRAN),SC_WID_UNO_HEADERSET,::getBooleanCppuType(),                       0, 0 },
     280          22 :         {OUString(SC_UNONAME_USERDEF),      ATTR_USERDEF,       getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
     281          22 :         {OUString(SC_UNO_PAGE_WIDTH),       ATTR_PAGE_SIZE,     ::getCppuType((const sal_Int32*)0),            0, MID_SIZE_WIDTH | CONVERT_TWIPS },
     282          22 :         {OUString(SC_UNONAME_WRITING),      ATTR_WRITINGDIR,    getCppuType((sal_Int16*)0),            0, 0 },
     283          22 :         {OUString(SC_UNONAME_HIDDEN),       ATTR_HIDDEN,        getCppuType((sal_Bool*)0),             0, 0 },
     284             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     285        2979 :     };
     286         625 :     static SfxItemPropertySet aPageStyleSet_Impl( aPageStyleMap_Impl );
     287         625 :     return &aPageStyleSet_Impl;
     288             : }
     289             : 
     290             : //  Map mit Inhalten des Header-Item-Sets
     291             : 
     292        9862 : static const SfxItemPropertyMap* lcl_GetHeaderStyleMap()
     293             : {
     294             :     static const SfxItemPropertyMapEntry aHeaderStyleMap_Impl[] =
     295             :     {
     296          22 :         {OUString(SC_UNO_PAGE_HDRBACKCOL),  ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
     297          22 :         {OUString(SC_UNO_PAGE_HDRGRFFILT),  ATTR_BACKGROUND,    ::getCppuType((const OUString*)0),          0, MID_GRAPHIC_FILTER },
     298          22 :         {OUString(SC_UNO_PAGE_HDRGRFLOC),   ATTR_BACKGROUND,    ::getCppuType((const style::GraphicLocation*)0),   0, MID_GRAPHIC_POSITION },
     299          22 :         {OUString(SC_UNO_PAGE_HDRGRFURL),   ATTR_BACKGROUND,    ::getCppuType((const OUString*)0),          0, MID_GRAPHIC_URL },
     300          22 :         {OUString(SC_UNO_PAGE_HDRBACKTRAN), ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     301          22 :         {OUString(OLD_UNO_PAGE_HDRBACKCOL), ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
     302          22 :         {OUString(SC_UNO_PAGE_HDRBODYDIST), ATTR_ULSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_LO_MARGIN | CONVERT_TWIPS },
     303          22 :         {OUString(SC_UNO_PAGE_HDRBRDDIST),  ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, BORDER_DISTANCE | CONVERT_TWIPS },
     304          22 :         {OUString(SC_UNO_PAGE_HDRBOTTBOR),  ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, BOTTOM_BORDER | CONVERT_TWIPS },
     305          22 :         {OUString(SC_UNO_PAGE_HDRBOTTBDIS), ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, BOTTOM_BORDER_DISTANCE | CONVERT_TWIPS },
     306          22 :         {OUString(OLD_UNO_PAGE_HDRDYNAMIC), ATTR_PAGE_DYNAMIC,  ::getBooleanCppuType(),            0, 0 },
     307          22 :         {OUString(SC_UNO_PAGE_HDRHEIGHT),   ATTR_PAGE_SIZE,     ::getCppuType((const sal_Int32*)0),            0, MID_SIZE_HEIGHT | CONVERT_TWIPS },
     308          22 :         {OUString(SC_UNO_PAGE_HDRDYNAMIC),  ATTR_PAGE_DYNAMIC,  ::getBooleanCppuType(),            0, 0 },
     309          22 :         {OUString(SC_UNO_PAGE_HDRON),       ATTR_PAGE_ON,       ::getBooleanCppuType(),            0, 0 },
     310          22 :         {OUString(SC_UNO_PAGE_HDRSHARED),   ATTR_PAGE_SHARED,   ::getBooleanCppuType(),            0, 0 },
     311          22 :         {OUString(SC_UNO_PAGE_HDRLEFTBOR),  ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, LEFT_BORDER | CONVERT_TWIPS },
     312          22 :         {OUString(SC_UNO_PAGE_HDRLEFTBDIS), ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, LEFT_BORDER_DISTANCE | CONVERT_TWIPS },
     313          22 :         {OUString(SC_UNO_PAGE_HDRLEFTMAR),  ATTR_LRSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_L_MARGIN | CONVERT_TWIPS },
     314          22 :         {OUString(OLD_UNO_PAGE_HDRON),      ATTR_PAGE_ON,       ::getBooleanCppuType(),            0, 0 },
     315          22 :         {OUString(SC_UNO_PAGE_HDRRIGHTBOR), ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, RIGHT_BORDER | CONVERT_TWIPS },
     316          22 :         {OUString(SC_UNO_PAGE_HDRRIGHTBDIS),ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, RIGHT_BORDER_DISTANCE | CONVERT_TWIPS },
     317          22 :         {OUString(SC_UNO_PAGE_HDRRIGHTMAR), ATTR_LRSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_R_MARGIN | CONVERT_TWIPS },
     318          22 :         {OUString(SC_UNO_PAGE_HDRSHADOW),   ATTR_SHADOW,        ::getCppuType((const table::ShadowFormat*)0),  0, 0 | CONVERT_TWIPS },
     319          22 :         {OUString(OLD_UNO_PAGE_HDRSHARED),  ATTR_PAGE_SHARED,   ::getBooleanCppuType(),            0, 0 },
     320          22 :         {OUString(SC_UNO_PAGE_HDRTOPBOR),   ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, TOP_BORDER | CONVERT_TWIPS },
     321          22 :         {OUString(SC_UNO_PAGE_HDRTOPBDIS),  ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, TOP_BORDER_DISTANCE | CONVERT_TWIPS },
     322          22 :         {OUString(OLD_UNO_PAGE_HDRBACKTRAN),ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     323             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     324       10478 :     };
     325        9862 :     static SfxItemPropertyMap aHeaderStyleMap( aHeaderStyleMap_Impl );
     326        9862 :     return &aHeaderStyleMap;
     327             : }
     328             : 
     329             : //  Map mit Inhalten des Footer-Item-Sets
     330             : 
     331        8000 : static const SfxItemPropertyMap* lcl_GetFooterStyleMap()
     332             : {
     333             :     static const SfxItemPropertyMapEntry aFooterStyleMap_Impl[] =
     334             :     {
     335          22 :         {OUString(SC_UNO_PAGE_FTRBACKCOL),  ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
     336          22 :         {OUString(SC_UNO_PAGE_FTRGRFFILT),  ATTR_BACKGROUND,    ::getCppuType((const OUString*)0),          0, MID_GRAPHIC_FILTER },
     337          22 :         {OUString(SC_UNO_PAGE_FTRGRFLOC),   ATTR_BACKGROUND,    ::getCppuType((const style::GraphicLocation*)0),   0, MID_GRAPHIC_POSITION },
     338          22 :         {OUString(SC_UNO_PAGE_FTRGRFURL),   ATTR_BACKGROUND,    ::getCppuType((const OUString*)0),          0, MID_GRAPHIC_URL },
     339          22 :         {OUString(SC_UNO_PAGE_FTRBACKTRAN), ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     340          22 :         {OUString(OLD_UNO_PAGE_FTRBACKCOL), ATTR_BACKGROUND,    ::getCppuType((const sal_Int32*)0),            0, MID_BACK_COLOR },
     341          22 :         {OUString(SC_UNO_PAGE_FTRBODYDIST), ATTR_ULSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_UP_MARGIN | CONVERT_TWIPS },
     342          22 :         {OUString(SC_UNO_PAGE_FTRBRDDIST),  ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, BORDER_DISTANCE | CONVERT_TWIPS },
     343          22 :         {OUString(SC_UNO_PAGE_FTRBOTTBOR),  ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, BOTTOM_BORDER | CONVERT_TWIPS },
     344          22 :         {OUString(SC_UNO_PAGE_FTRBOTTBDIS), ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, BOTTOM_BORDER_DISTANCE | CONVERT_TWIPS },
     345          22 :         {OUString(OLD_UNO_PAGE_FTRDYNAMIC), ATTR_PAGE_DYNAMIC,  ::getBooleanCppuType(),            0, 0 },
     346          22 :         {OUString(SC_UNO_PAGE_FTRHEIGHT),   ATTR_PAGE_SIZE,     ::getCppuType((const sal_Int32*)0),            0, MID_SIZE_HEIGHT | CONVERT_TWIPS },
     347          22 :         {OUString(SC_UNO_PAGE_FTRDYNAMIC),  ATTR_PAGE_DYNAMIC,  ::getBooleanCppuType(),            0, 0 },
     348          22 :         {OUString(SC_UNO_PAGE_FTRON),       ATTR_PAGE_ON,       ::getBooleanCppuType(),            0, 0 },
     349          22 :         {OUString(SC_UNO_PAGE_FTRSHARED),   ATTR_PAGE_SHARED,   ::getBooleanCppuType(),            0, 0 },
     350          22 :         {OUString(SC_UNO_PAGE_FTRLEFTBOR),  ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, LEFT_BORDER | CONVERT_TWIPS },
     351          22 :         {OUString(SC_UNO_PAGE_FTRLEFTBDIS), ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, LEFT_BORDER_DISTANCE | CONVERT_TWIPS },
     352          22 :         {OUString(SC_UNO_PAGE_FTRLEFTMAR),  ATTR_LRSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_L_MARGIN | CONVERT_TWIPS },
     353          22 :         {OUString(OLD_UNO_PAGE_FTRON),      ATTR_PAGE_ON,       ::getBooleanCppuType(),            0, 0 },
     354          22 :         {OUString(SC_UNO_PAGE_FTRRIGHTBOR), ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, RIGHT_BORDER | CONVERT_TWIPS },
     355          22 :         {OUString(SC_UNO_PAGE_FTRRIGHTBDIS),ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, RIGHT_BORDER_DISTANCE | CONVERT_TWIPS },
     356          22 :         {OUString(SC_UNO_PAGE_FTRRIGHTMAR), ATTR_LRSPACE,       ::getCppuType((const sal_Int32*)0),            0, MID_R_MARGIN | CONVERT_TWIPS },
     357          22 :         {OUString(SC_UNO_PAGE_FTRSHADOW),   ATTR_SHADOW,        ::getCppuType((const table::ShadowFormat*)0),  0, 0 | CONVERT_TWIPS },
     358          22 :         {OUString(OLD_UNO_PAGE_FTRSHARED),  ATTR_PAGE_SHARED,   ::getBooleanCppuType(),            0, 0 },
     359          22 :         {OUString(SC_UNO_PAGE_FTRTOPBOR),   ATTR_BORDER,        ::getCppuType((const table::BorderLine*)0),        0, TOP_BORDER | CONVERT_TWIPS },
     360          22 :         {OUString(SC_UNO_PAGE_FTRTOPBDIS),  ATTR_BORDER,        ::getCppuType((const sal_Int32*)0),    0, TOP_BORDER_DISTANCE | CONVERT_TWIPS },
     361          22 :         {OUString(OLD_UNO_PAGE_FTRBACKTRAN),ATTR_BACKGROUND,    ::getBooleanCppuType(),            0, MID_GRAPHIC_TRANSPARENT },
     362             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     363        8616 :     };
     364        8000 :     static SfxItemPropertyMap aFooterStyleMap( aFooterStyleMap_Impl );
     365        8000 :     return &aFooterStyleMap;
     366             : }
     367             : 
     368             : 
     369             : //  Index-Access auf die Style-Typen: 0 = Cell, 1 = Page
     370             : 
     371             : #define SC_STYLE_FAMILY_COUNT 2
     372             : 
     373             : #define SC_FAMILYNAME_CELL  "CellStyles"
     374             : #define SC_FAMILYNAME_PAGE  "PageStyles"
     375             : 
     376             : static const sal_uInt16 aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT] = { SFX_STYLE_FAMILY_PARA, SFX_STYLE_FAMILY_PAGE };
     377             : 
     378             : using sc::HMMToTwips;
     379             : using sc::TwipsToHMM;
     380             : 
     381             : #define SCSTYLE_SERVICE         "com.sun.star.style.Style"
     382             : #define SCCELLSTYLE_SERVICE     "com.sun.star.style.CellStyle"
     383             : #define SCPAGESTYLE_SERVICE     "com.sun.star.style.PageStyle"
     384             : 
     385           0 : SC_SIMPLE_SERVICE_INFO( ScStyleFamiliesObj, "ScStyleFamiliesObj", "com.sun.star.style.StyleFamilies" )
     386           0 : SC_SIMPLE_SERVICE_INFO( ScStyleFamilyObj, "ScStyleFamilyObj", "com.sun.star.style.StyleFamily" )
     387             : 
     388             : #define SC_PAPERBIN_DEFAULTNAME     "[From printer settings]"
     389             : 
     390        4416 : static bool lcl_AnyTabProtected( ScDocument& rDoc )
     391             : {
     392        4416 :     SCTAB nTabCount = rDoc.GetTableCount();
     393        8832 :     for (SCTAB i=0; i<nTabCount; i++)
     394        4416 :         if (rDoc.IsTabProtected(i))
     395           0 :             return true;
     396        4416 :     return false;
     397             : }
     398             : 
     399         907 : ScStyleFamiliesObj::ScStyleFamiliesObj(ScDocShell* pDocSh) :
     400         907 :     pDocShell( pDocSh )
     401             : {
     402         907 :     pDocShell->GetDocument()->AddUnoObject(*this);
     403         907 : }
     404             : 
     405        2721 : ScStyleFamiliesObj::~ScStyleFamiliesObj()
     406             : {
     407         907 :     if (pDocShell)
     408         890 :         pDocShell->GetDocument()->RemoveUnoObject(*this);
     409        1814 : }
     410             : 
     411         115 : void ScStyleFamiliesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
     412             : {
     413             :     //  Referenz-Update interessiert hier nicht
     414             : 
     415         230 :     if ( rHint.ISA( SfxSimpleHint ) &&
     416         115 :             ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
     417             :     {
     418          17 :         pDocShell = NULL;       // ungueltig geworden
     419             :     }
     420         115 : }
     421             : 
     422             : // XStyleFamilies
     423             : 
     424           4 : ScStyleFamilyObj*ScStyleFamiliesObj::GetObjectByType_Impl(sal_uInt16 nType) const
     425             : {
     426           4 :     if ( pDocShell )
     427             :     {
     428           4 :         if ( nType == SFX_STYLE_FAMILY_PARA )
     429           2 :             return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PARA );
     430           2 :         else if ( nType == SFX_STYLE_FAMILY_PAGE )
     431           2 :             return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE );
     432             :     }
     433             :     OSL_FAIL("getStyleFamilyByType: keine DocShell oder falscher Typ");
     434           0 :     return NULL;
     435             : }
     436             : 
     437           5 : ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByIndex_Impl(sal_uInt32 nIndex) const
     438             : {
     439           5 :     if ( nIndex < SC_STYLE_FAMILY_COUNT )
     440           4 :         return GetObjectByType_Impl(aStyleFamilyTypes[nIndex]);
     441             : 
     442           1 :     return NULL;    // ungueltiger Index
     443             : }
     444             : 
     445         901 : ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName) const
     446             : {
     447         901 :     if ( pDocShell )
     448             :     {
     449         901 :         OUString aNameStr( aName );
     450         901 :         if ( aNameStr.equalsAscii( SC_FAMILYNAME_CELL ) )
     451         349 :             return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PARA );
     452         552 :         else if ( aNameStr.equalsAscii( SC_FAMILYNAME_PAGE ) )
     453         551 :             return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE );
     454             :     }
     455             :     // no assertion - called directly from getByName
     456           1 :     return NULL;
     457             : }
     458             : 
     459             : // container::XIndexAccess
     460             : 
     461           2 : sal_Int32 SAL_CALL ScStyleFamiliesObj::getCount() throw(uno::RuntimeException, std::exception)
     462             : {
     463           2 :     return SC_STYLE_FAMILY_COUNT;
     464             : }
     465             : 
     466           5 : uno::Any SAL_CALL ScStyleFamiliesObj::getByIndex( sal_Int32 nIndex )
     467             :                             throw(lang::IndexOutOfBoundsException,
     468             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     469             : {
     470           5 :     SolarMutexGuard aGuard;
     471          10 :     uno::Reference< container::XNameContainer >  xFamily(GetObjectByIndex_Impl(nIndex));
     472           5 :     if (xFamily.is())
     473           8 :         return uno::makeAny(xFamily);
     474             :     else
     475           6 :         throw lang::IndexOutOfBoundsException();
     476             : //    return uno::Any();
     477             : }
     478             : 
     479           1 : uno::Type SAL_CALL ScStyleFamiliesObj::getElementType() throw(uno::RuntimeException, std::exception)
     480             : {
     481           1 :     SolarMutexGuard aGuard;
     482           1 :     return ::getCppuType((const uno::Reference< container::XNameContainer >*)0);    // muss zu getByIndex passen
     483             : }
     484             : 
     485           1 : sal_Bool SAL_CALL ScStyleFamiliesObj::hasElements() throw(uno::RuntimeException, std::exception)
     486             : {
     487           1 :     SolarMutexGuard aGuard;
     488           1 :     return ( getCount() != 0 );
     489             : }
     490             : 
     491             : // container::XNameAccess
     492             : 
     493         901 : uno::Any SAL_CALL ScStyleFamiliesObj::getByName( const OUString& aName )
     494             :                     throw(container::NoSuchElementException,
     495             :                         lang::WrappedTargetException, uno::RuntimeException, std::exception)
     496             : {
     497         901 :     SolarMutexGuard aGuard;
     498        1802 :     uno::Reference< container::XNameContainer >  xFamily(GetObjectByName_Impl(aName));
     499         901 :     if (xFamily.is())
     500        1800 :         return uno::makeAny(xFamily);
     501             :     else
     502         902 :         throw container::NoSuchElementException();
     503             : //    return uno::Any();
     504             : }
     505             : 
     506           3 : uno::Sequence<OUString> SAL_CALL ScStyleFamiliesObj::getElementNames()
     507             :                                                 throw(uno::RuntimeException, std::exception)
     508             : {
     509           3 :     SolarMutexGuard aGuard;
     510           3 :     uno::Sequence<OUString> aNames(SC_STYLE_FAMILY_COUNT);
     511           3 :     OUString* pNames = aNames.getArray();
     512           3 :     pNames[0] = OUString(SC_FAMILYNAME_CELL );
     513           3 :     pNames[1] = OUString(SC_FAMILYNAME_PAGE );
     514           3 :     return aNames;
     515             : }
     516             : 
     517        1236 : sal_Bool SAL_CALL ScStyleFamiliesObj::hasByName( const OUString& aName )
     518             :                                         throw(uno::RuntimeException, std::exception)
     519             : {
     520        1236 :     SolarMutexGuard aGuard;
     521        2472 :     OUString aNameStr( aName );
     522        2472 :     return ( aNameStr.equalsAscii( SC_FAMILYNAME_CELL ) || aNameStr.equalsAscii( SC_FAMILYNAME_PAGE ) );
     523             : }
     524             : 
     525             : // style::XStyleLoader
     526             : 
     527           0 : void SAL_CALL ScStyleFamiliesObj::loadStylesFromURL( const OUString& aURL,
     528             :                         const uno::Sequence<beans::PropertyValue>& aOptions )
     529             :                                 throw(io::IOException, uno::RuntimeException, std::exception)
     530             : {
     531             :     //! use aOptions (like Writer)
     532             :     //! set flag to disable filter option dialogs when importing
     533             : 
     534           0 :     OUString aFilter;     // empty - detect
     535           0 :     OUString aFiltOpt;
     536           0 :     ScDocumentLoader aLoader( aURL, aFilter, aFiltOpt );
     537             : 
     538           0 :     ScDocShell* pSource = aLoader.GetDocShell();
     539           0 :     if ( pSource && pDocShell )
     540             :     {
     541             :         //  collect options
     542             : 
     543           0 :         sal_Bool bLoadReplace = sal_True;           // defaults
     544           0 :         sal_Bool bLoadCellStyles = sal_True;
     545           0 :         sal_Bool bLoadPageStyles = sal_True;
     546             : 
     547           0 :         const beans::PropertyValue* pPropArray = aOptions.getConstArray();
     548           0 :         long nPropCount = aOptions.getLength();
     549           0 :         for (long i = 0; i < nPropCount; i++)
     550             :         {
     551           0 :             const beans::PropertyValue& rProp = pPropArray[i];
     552           0 :             OUString aPropName(rProp.Name);
     553             : 
     554           0 :             if (aPropName.equalsAscii( SC_UNONAME_OVERWSTL ))
     555           0 :                 bLoadReplace = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
     556           0 :             else if (aPropName.equalsAscii( SC_UNONAME_LOADCELL ))
     557           0 :                 bLoadCellStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
     558           0 :             else if (aPropName.equalsAscii( SC_UNONAME_LOADPAGE ))
     559           0 :                 bLoadPageStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
     560           0 :         }
     561             : 
     562           0 :         pDocShell->LoadStylesArgs( *pSource, bLoadReplace, bLoadCellStyles, bLoadPageStyles );
     563           0 :         pDocShell->SetDocumentModified();   // paint is inside LoadStyles
     564           0 :     }
     565           0 : }
     566             : 
     567           0 : uno::Sequence<beans::PropertyValue> SAL_CALL ScStyleFamiliesObj::getStyleLoaderOptions()
     568             :                                                 throw(uno::RuntimeException, std::exception)
     569             : {
     570             :     //  return defaults for options (?)
     571             : 
     572           0 :     uno::Sequence<beans::PropertyValue> aSequence(3);
     573           0 :     beans::PropertyValue* pArray = aSequence.getArray();
     574             : 
     575           0 :     pArray[0].Name = OUString(SC_UNONAME_OVERWSTL );
     576           0 :     ScUnoHelpFunctions::SetBoolInAny( pArray[0].Value, true );
     577             : 
     578           0 :     pArray[1].Name = OUString(SC_UNONAME_LOADCELL );
     579           0 :     ScUnoHelpFunctions::SetBoolInAny( pArray[1].Value, true );
     580             : 
     581           0 :     pArray[2].Name = OUString(SC_UNONAME_LOADPAGE );
     582           0 :     ScUnoHelpFunctions::SetBoolInAny( pArray[2].Value, true );
     583             : 
     584           0 :     return aSequence;
     585             : }
     586             : 
     587         904 : ScStyleFamilyObj::ScStyleFamilyObj(ScDocShell* pDocSh, SfxStyleFamily eFam) :
     588             :     pDocShell( pDocSh ),
     589         904 :     eFamily( eFam )
     590             : {
     591         904 :     pDocShell->GetDocument()->AddUnoObject(*this);
     592         904 : }
     593             : 
     594        2712 : ScStyleFamilyObj::~ScStyleFamilyObj()
     595             : {
     596         904 :     if (pDocShell)
     597         884 :         pDocShell->GetDocument()->RemoveUnoObject(*this);
     598        1808 : }
     599             : 
     600       21143 : void ScStyleFamilyObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
     601             : {
     602             :     //  Referenz-Update interessiert hier nicht
     603             : 
     604       42286 :     if ( rHint.ISA( SfxSimpleHint ) &&
     605       21143 :             ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
     606             :     {
     607          20 :         pDocShell = NULL;       // ungueltig geworden
     608             :     }
     609       21143 : }
     610             : 
     611             : // XStyleFamily
     612             : 
     613         331 : ScStyleObj* ScStyleFamilyObj::GetObjectByIndex_Impl(sal_uInt32 nIndex)
     614             : {
     615         331 :     if ( pDocShell )
     616             :     {
     617         331 :         ScDocument* pDoc = pDocShell->GetDocument();
     618         331 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     619             : 
     620         331 :         SfxStyleSheetIterator aIter( pStylePool, eFamily );
     621         331 :         if ( nIndex < aIter.Count() )
     622             :         {
     623         330 :             SfxStyleSheetBase* pStyle = aIter[(sal_uInt16)nIndex];
     624         330 :             if ( pStyle )
     625             :             {
     626         330 :                 return new ScStyleObj( pDocShell, eFamily, pStyle->GetName() );
     627             :             }
     628           1 :         }
     629             :     }
     630           1 :     return NULL;
     631             : }
     632             : 
     633        1787 : ScStyleObj* ScStyleFamilyObj::GetObjectByName_Impl(const OUString& aName)
     634             : {
     635        1787 :     if ( pDocShell )
     636             :     {
     637        1787 :         OUString aString(aName);
     638             : 
     639        1787 :         ScDocument* pDoc = pDocShell->GetDocument();
     640        1787 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     641        1787 :         if ( pStylePool->Find( aString, eFamily ) )
     642        1786 :             return new ScStyleObj( pDocShell, eFamily, aString );
     643             :     }
     644           1 :     return NULL;
     645             : }
     646             : 
     647         192 : void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::Any& aElement )
     648             :                             throw(lang::IllegalArgumentException, container::ElementExistException,
     649             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     650             : {
     651         192 :     SolarMutexGuard aGuard;
     652         192 :     bool bDone = false;
     653             :     //  Reflection muss nicht uno::XInterface sein, kann auch irgendein Interface sein...
     654         384 :     uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
     655         192 :     if ( xInterface.is() )
     656             :     {
     657         191 :         ScStyleObj* pStyleObj = ScStyleObj::getImplementation( xInterface );
     658         382 :         if ( pStyleObj && pStyleObj->GetFamily() == eFamily &&
     659         191 :                 !pStyleObj->IsInserted() )  // noch nicht eingefuegt?
     660             :         {
     661         191 :             OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
     662             : 
     663         191 :             ScDocument* pDoc = pDocShell->GetDocument();
     664         191 :             ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     665             : 
     666             :             //! DocFunc-Funktion??
     667             :             //! Undo ?????????????
     668             : 
     669         191 :             if ( !pStylePool->Find( aNameStr, eFamily ) )   // noch nicht vorhanden
     670             :             {
     671         190 :                 (void)pStylePool->Make( aNameStr, eFamily, SFXSTYLEBIT_USERDEF );
     672             : 
     673         190 :                 if ( eFamily == SFX_STYLE_FAMILY_PARA && !pDoc->IsImportingXML() )
     674           4 :                     pDoc->GetPool()->CellStyleCreated( aNameStr );
     675             : 
     676         190 :                 pStyleObj->InitDoc( pDocShell, aNameStr );  // Objekt kann benutzt werden
     677             : 
     678         190 :                 pDocShell->SetDocumentModified();   // verwendet wird der neue Style noch nicht
     679         190 :                 bDone = true;
     680             :             }
     681             :             else
     682           1 :                 throw container::ElementExistException();
     683             :         }
     684             :     }
     685             : 
     686         191 :     if (!bDone)
     687             :     {
     688             :         //  other errors are handled above
     689           1 :         throw lang::IllegalArgumentException();
     690         192 :     }
     691         190 : }
     692             : 
     693           0 : void SAL_CALL ScStyleFamilyObj::replaceByName( const OUString& aName, const uno::Any& aElement )
     694             :                             throw(lang::IllegalArgumentException, container::NoSuchElementException,
     695             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     696             : {
     697           0 :     SolarMutexGuard aGuard;
     698             :     //! zusammenfassen?
     699           0 :     removeByName( aName );
     700           0 :     insertByName( aName, aElement );
     701           0 : }
     702             : 
     703           2 : void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
     704             :                                 throw(container::NoSuchElementException,
     705             :                                       lang::WrappedTargetException,
     706             :                                       uno::RuntimeException,
     707             :                                       std::exception)
     708             : {
     709           2 :     SolarMutexGuard aGuard;
     710           2 :     bool bFound = false;
     711           2 :     if ( pDocShell )
     712             :     {
     713           2 :         OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
     714             : 
     715           2 :         ScDocument* pDoc = pDocShell->GetDocument();
     716           2 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     717             : 
     718             :         //! DocFunc-Funktion??
     719             :         //! Undo ?????????????
     720             : 
     721           2 :         SfxStyleSheetBase* pStyle = pStylePool->Find( aString, eFamily );
     722           2 :         if (pStyle)
     723             :         {
     724           1 :             bFound = true;
     725           1 :             if ( eFamily == SFX_STYLE_FAMILY_PARA )
     726             :             {
     727             :                 // wie ScViewFunc::RemoveStyleSheetInUse
     728           1 :                 VirtualDevice aVDev;
     729           1 :                 Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
     730           1 :                 double nPPTX = aLogic.X() / 1000.0;
     731           1 :                 double nPPTY = aLogic.Y() / 1000.0;
     732           1 :                 Fraction aZoom(1,1);
     733           1 :                 pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
     734           1 :                 pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
     735           1 :                 pDocShell->SetDocumentModified();
     736             : 
     737           1 :                 pStylePool->Remove( pStyle );
     738             : 
     739             :                 //! InvalidateAttribs();        // Bindings-Invalidate
     740             :             }
     741             :             else
     742             :             {
     743           0 :                 if ( pDoc->RemovePageStyleInUse( aString ) )
     744           0 :                     pDocShell->PageStyleModified( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), true );
     745             : 
     746           0 :                 pStylePool->Remove( pStyle );
     747             : 
     748           0 :                 SfxBindings* pBindings = pDocShell->GetViewBindings();
     749           0 :                 if (pBindings)
     750           0 :                     pBindings->Invalidate( SID_STYLE_FAMILY4 );
     751           0 :                 pDocShell->SetDocumentModified();
     752             :             }
     753           2 :         }
     754             :     }
     755             : 
     756           2 :     if (!bFound)
     757           1 :         throw container::NoSuchElementException();
     758           1 : }
     759             : 
     760             : // container::XIndexAccess
     761             : 
     762          64 : sal_Int32 SAL_CALL ScStyleFamilyObj::getCount() throw(uno::RuntimeException, std::exception)
     763             : {
     764          64 :     SolarMutexGuard aGuard;
     765          64 :     if ( pDocShell )
     766             :     {
     767          64 :         ScDocument* pDoc = pDocShell->GetDocument();
     768          64 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     769             : 
     770          64 :         SfxStyleSheetIterator aIter( pStylePool, eFamily );
     771          64 :         return aIter.Count();
     772             :     }
     773           0 :     return 0;
     774             : }
     775             : 
     776         331 : uno::Any SAL_CALL ScStyleFamilyObj::getByIndex( sal_Int32 nIndex )
     777             :                             throw(lang::IndexOutOfBoundsException,
     778             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     779             : {
     780         331 :     SolarMutexGuard aGuard;
     781         662 :     uno::Reference< style::XStyle >  xObj(GetObjectByIndex_Impl(nIndex));
     782         331 :     if (xObj.is())
     783         660 :         return uno::makeAny(xObj);
     784             :     else
     785         332 :         throw lang::IndexOutOfBoundsException();
     786             : //    return uno::Any();
     787             : }
     788             : 
     789           1 : uno::Type SAL_CALL ScStyleFamilyObj::getElementType() throw(uno::RuntimeException, std::exception)
     790             : {
     791           1 :     SolarMutexGuard aGuard;
     792           1 :     return ::getCppuType((const uno::Reference< style::XStyle >*)0);    // muss zu getByIndex passen
     793             : }
     794             : 
     795           1 : sal_Bool SAL_CALL ScStyleFamilyObj::hasElements() throw(uno::RuntimeException, std::exception)
     796             : {
     797           1 :     SolarMutexGuard aGuard;
     798           1 :     return ( getCount() != 0 );
     799             : }
     800             : 
     801             : // container::XNameAccess
     802             : 
     803        1787 : uno::Any SAL_CALL ScStyleFamilyObj::getByName( const OUString& aName )
     804             :             throw(container::NoSuchElementException,
     805             :                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     806             : {
     807        1787 :     SolarMutexGuard aGuard;
     808             :     uno::Reference< style::XStyle > xObj(
     809        3574 :         GetObjectByName_Impl( ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ) ));
     810        1787 :     if (xObj.is())
     811        3572 :         return uno::makeAny(xObj);
     812             :     else
     813        1788 :         throw container::NoSuchElementException();
     814             : //    return uno::Any();
     815             : }
     816             : 
     817          61 : uno::Sequence<OUString> SAL_CALL ScStyleFamilyObj::getElementNames()
     818             :                                                 throw(uno::RuntimeException, std::exception)
     819             : {
     820          61 :     SolarMutexGuard aGuard;
     821          61 :     if ( pDocShell )
     822             :     {
     823          61 :         ScDocument* pDoc = pDocShell->GetDocument();
     824          61 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     825             : 
     826          61 :         SfxStyleSheetIterator aIter( pStylePool, eFamily );
     827          61 :         sal_uInt16 nCount = aIter.Count();
     828             : 
     829         122 :         uno::Sequence<OUString> aSeq(nCount);
     830          61 :         OUString* pAry = aSeq.getArray();
     831          61 :         SfxStyleSheetBase* pStyle = aIter.First();
     832          61 :         sal_uInt16 nPos = 0;
     833         345 :         while (pStyle)
     834             :         {
     835             :             OSL_ENSURE( nPos<nCount, "Anzahl durcheinandergekommen" );
     836         223 :             if (nPos<nCount)
     837         669 :                 pAry[nPos++] = ScStyleNameConversion::DisplayToProgrammaticName(
     838         669 :                                     pStyle->GetName(), sal::static_int_cast<sal_uInt16>(eFamily) );
     839         223 :             pStyle = aIter.Next();
     840             :         }
     841         122 :         return aSeq;
     842             :     }
     843           0 :     return uno::Sequence<OUString>();
     844             : }
     845             : 
     846        2158 : sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const OUString& aName )
     847             :                                         throw(uno::RuntimeException, std::exception)
     848             : {
     849        2158 :     SolarMutexGuard aGuard;
     850        2158 :     if ( pDocShell )
     851             :     {
     852        2158 :         OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
     853             : 
     854        2158 :         ScDocument* pDoc = pDocShell->GetDocument();
     855        2158 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     856        2158 :         if ( pStylePool->Find( aString, eFamily ) )
     857        1885 :             return sal_True;
     858             :     }
     859         273 :     return false;
     860             : }
     861             : 
     862             : // XPropertySet
     863             : 
     864           0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL ScStyleFamilyObj::getPropertySetInfo(  ) throw (uno::RuntimeException, std::exception)
     865             : {
     866             :     OSL_FAIL( "###unexpected!" );
     867           0 :     return uno::Reference< beans::XPropertySetInfo >();
     868             : }
     869             : 
     870           0 : void SAL_CALL ScStyleFamilyObj::setPropertyValue( const OUString&, const uno::Any& ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     871             : {
     872             :     OSL_FAIL( "###unexpected!" );
     873           0 : }
     874             : 
     875           0 : uno::Any SAL_CALL ScStyleFamilyObj::getPropertyValue( const OUString& sPropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     876             : {
     877           0 :     uno::Any aRet;
     878             : 
     879           0 :     if ( sPropertyName == "DisplayName" )
     880             :     {
     881           0 :         SolarMutexGuard aGuard;
     882           0 :         sal_uInt32 nResId = 0;
     883           0 :         switch ( eFamily )
     884             :         {
     885             :             case SFX_STYLE_FAMILY_PARA:
     886           0 :                 nResId = STR_STYLE_FAMILY_CELL; break;
     887             :             case SFX_STYLE_FAMILY_PAGE:
     888           0 :                 nResId = STR_STYLE_FAMILY_PAGE; break;
     889             :             default:
     890             :                 OSL_FAIL( "ScStyleFamilyObj::getPropertyValue(): invalid family" );
     891             :         }
     892           0 :         if ( nResId > 0 )
     893             :         {
     894           0 :             OUString sDisplayName( ScGlobal::GetRscString( static_cast< sal_uInt16 >( nResId ) ) );
     895           0 :             aRet = uno::makeAny( sDisplayName );
     896           0 :         }
     897             :     }
     898             :     else
     899             :     {
     900           0 :         throw beans::UnknownPropertyException( OUString( "unknown property: " ) + sPropertyName, static_cast<OWeakObject *>(this) );
     901             :     }
     902             : 
     903           0 :     return aRet;
     904             : }
     905             : 
     906           0 : void SAL_CALL ScStyleFamilyObj::addPropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     907             : {
     908             :     OSL_FAIL( "###unexpected!" );
     909           0 : }
     910             : 
     911           0 : void SAL_CALL ScStyleFamilyObj::removePropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     912             : {
     913             :     OSL_FAIL( "###unexpected!" );
     914           0 : }
     915             : 
     916           0 : void SAL_CALL ScStyleFamilyObj::addVetoableChangeListener( const OUString&, const uno::Reference< beans::XVetoableChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     917             : {
     918             :     OSL_FAIL( "###unexpected!" );
     919           0 : }
     920             : 
     921           0 : void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const OUString&, const uno::Reference< beans::XVetoableChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     922             : {
     923             :     OSL_FAIL( "###unexpected!" );
     924           0 : }
     925             : 
     926             : //  Default-ctor wird fuer die Reflection gebraucht
     927             : 
     928        2311 : ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName) :
     929             :     pPropSet( (eFam == SFX_STYLE_FAMILY_PARA) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ),
     930             :     pDocShell( pDocSh ),
     931             :     eFamily( eFam ),
     932        2311 :     aStyleName( rName )
     933             : {
     934             :     //  pDocShell ist Null, wenn per ServiceProvider erzeugt
     935             : 
     936        2311 :     if (pDocShell)
     937        2116 :         pDocShell->GetDocument()->AddUnoObject(*this);
     938        2311 : }
     939             : 
     940         190 : void ScStyleObj::InitDoc( ScDocShell* pNewDocSh, const OUString& rNewName )
     941             : {
     942         190 :     if ( pNewDocSh && !pDocShell )
     943             :     {
     944         190 :         aStyleName = rNewName;
     945         190 :         pDocShell = pNewDocSh;
     946         190 :         pDocShell->GetDocument()->AddUnoObject(*this);
     947             :     }
     948         190 : }
     949             : 
     950        6933 : ScStyleObj::~ScStyleObj()
     951             : {
     952        2311 :     if (pDocShell)
     953        2288 :         pDocShell->GetDocument()->RemoveUnoObject(*this);
     954        4622 : }
     955             : 
     956             : // XUnoTunnel
     957             : 
     958         191 : sal_Int64 SAL_CALL ScStyleObj::getSomething(
     959             :                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException, std::exception)
     960             : {
     961         382 :     if ( rId.getLength() == 16 &&
     962         191 :           0 == memcmp( getUnoTunnelId().getConstArray(),
     963         382 :                                     rId.getConstArray(), 16 ) )
     964             :     {
     965         191 :         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
     966             :     }
     967           0 :     return 0;
     968             : }
     969             : 
     970             : namespace
     971             : {
     972             :     class theScStyleObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScStyleObjUnoTunnelId> {};
     973             : }
     974             : 
     975         382 : const uno::Sequence<sal_Int8>& ScStyleObj::getUnoTunnelId()
     976             : {
     977         382 :     return theScStyleObjUnoTunnelId::get().getSeq();
     978             : }
     979             : 
     980         191 : ScStyleObj* ScStyleObj::getImplementation(
     981             :                         const uno::Reference<uno::XInterface> xObj )
     982             : {
     983         191 :     ScStyleObj* pRet = NULL;
     984         191 :     uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
     985         191 :     if (xUT.is())
     986         191 :         pRet = reinterpret_cast<ScStyleObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId())));
     987         191 :     return pRet;
     988             : }
     989             : 
     990       78633 : void ScStyleObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
     991             : {
     992             :     //  Referenz-Update interessiert hier nicht
     993             : 
     994      157266 :     if ( rHint.ISA( SfxSimpleHint ) &&
     995       78633 :             ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
     996             :     {
     997          18 :         pDocShell = NULL;       // ungueltig geworden
     998             :     }
     999       78633 : }
    1000             : 
    1001       32122 : SfxStyleSheetBase* ScStyleObj::GetStyle_Impl()
    1002             : {
    1003       32122 :     if ( pDocShell )
    1004             :     {
    1005       32122 :         ScDocument* pDoc = pDocShell->GetDocument();
    1006       32122 :         ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
    1007       32122 :         return pStylePool->Find( aStyleName, eFamily );
    1008             :     }
    1009           0 :     return NULL;
    1010             : }
    1011             : 
    1012             : // style::XStyle
    1013             : 
    1014         220 : sal_Bool SAL_CALL ScStyleObj::isUserDefined() throw(uno::RuntimeException, std::exception)
    1015             : {
    1016         220 :     SolarMutexGuard aGuard;
    1017         220 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1018         220 :     if (pStyle)
    1019         220 :         return pStyle->IsUserDefined();
    1020           0 :     return false;
    1021             : }
    1022             : 
    1023          74 : sal_Bool SAL_CALL ScStyleObj::isInUse() throw(uno::RuntimeException, std::exception)
    1024             : {
    1025          74 :     SolarMutexGuard aGuard;
    1026          74 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1027          74 :     if (pStyle)
    1028          74 :         return pStyle->IsUsed();
    1029           0 :     return false;
    1030             : }
    1031             : 
    1032         726 : OUString SAL_CALL ScStyleObj::getParentStyle() throw(uno::RuntimeException, std::exception)
    1033             : {
    1034         726 :     SolarMutexGuard aGuard;
    1035         726 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1036         726 :     if (pStyle)
    1037         726 :         return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetParent(), sal::static_int_cast<sal_uInt16>(eFamily) );
    1038           0 :     return OUString();
    1039             : }
    1040             : 
    1041         833 : void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
    1042             :     throw(container::NoSuchElementException,
    1043             :           uno::RuntimeException,
    1044             :           std::exception)
    1045             : {
    1046         833 :     SolarMutexGuard aGuard;
    1047         833 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1048         833 :     if (pStyle)
    1049             :     {
    1050             :         //  cell styles cannot be modified if any sheet is protected
    1051         833 :         if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
    1052         833 :             return;         //! exception?
    1053             : 
    1054             :         //! DocFunc-Funktion??
    1055             :         //! Undo ?????????????
    1056             : 
    1057         833 :         OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, sal::static_int_cast<sal_uInt16>(eFamily) ));
    1058         833 :         sal_Bool bOk = pStyle->SetParent( aString );
    1059         833 :         if (bOk)
    1060             :         {
    1061             :             //  wie bei setPropertyValue
    1062             : 
    1063         726 :             ScDocument* pDoc = pDocShell->GetDocument();
    1064         726 :             if ( eFamily == SFX_STYLE_FAMILY_PARA )
    1065             :             {
    1066             :                 //  Zeilenhoehen anpassen...
    1067             : 
    1068         726 :                 VirtualDevice aVDev;
    1069         726 :                 Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
    1070         726 :                 double nPPTX = aLogic.X() / 1000.0;
    1071         726 :                 double nPPTY = aLogic.Y() / 1000.0;
    1072         726 :                 Fraction aZoom(1,1);
    1073         726 :                 pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
    1074             : 
    1075         726 :                 pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
    1076         726 :                 pDocShell->SetDocumentModified();
    1077             :             }
    1078             :             else
    1079             :             {
    1080             :                 //! ModifyStyleSheet am Dokument (alte Werte merken)
    1081             : 
    1082           0 :                 pDocShell->PageStyleModified( aStyleName, true );
    1083             :             }
    1084         833 :         }
    1085         833 :     }
    1086             : }
    1087             : 
    1088             : // container::XNamed
    1089             : 
    1090        1127 : OUString SAL_CALL ScStyleObj::getName() throw(uno::RuntimeException, std::exception)
    1091             : {
    1092        1127 :     SolarMutexGuard aGuard;
    1093        1127 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1094        1127 :     if (pStyle)
    1095        1127 :         return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetName(), sal::static_int_cast<sal_uInt16>(eFamily) );
    1096           0 :     return OUString();
    1097             : }
    1098             : 
    1099           0 : void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
    1100             :                                                 throw(uno::RuntimeException, std::exception)
    1101             : {
    1102           0 :     SolarMutexGuard aGuard;
    1103           0 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1104           0 :     if (pStyle)
    1105             :     {
    1106             :         //  cell styles cannot be renamed if any sheet is protected
    1107           0 :         if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
    1108           0 :             return;         //! exception?
    1109             : 
    1110             :         //! DocFunc-Funktion??
    1111             :         //! Undo ?????????????
    1112             : 
    1113           0 :         OUString aString(aNewName);
    1114           0 :         sal_Bool bOk = pStyle->SetName( aString );
    1115           0 :         if (bOk)
    1116             :         {
    1117           0 :             aStyleName = aString;       //! notify other objects for this style?
    1118             : 
    1119           0 :             ScDocument* pDoc = pDocShell->GetDocument();
    1120           0 :             if ( eFamily == SFX_STYLE_FAMILY_PARA && !pDoc->IsImportingXML() )
    1121           0 :                 pDoc->GetPool()->CellStyleCreated( aString );
    1122             : 
    1123             :             //  Zellvorlagen = 2, Seitenvorlagen = 4
    1124           0 :             sal_uInt16 nId = ( eFamily == SFX_STYLE_FAMILY_PARA ) ?
    1125           0 :                             SID_STYLE_FAMILY2 : SID_STYLE_FAMILY4;
    1126           0 :             SfxBindings* pBindings = pDocShell->GetViewBindings();
    1127           0 :             if (pBindings)
    1128             :             {
    1129           0 :                 pBindings->Invalidate( nId );
    1130           0 :                 pBindings->Invalidate( SID_STYLE_APPLY );
    1131             :             }
    1132           0 :         }
    1133           0 :     }
    1134             : }
    1135             : 
    1136          14 : uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules()
    1137             : {
    1138          14 :     SvxNumRule aRule( 0, 0, true );         // nothing supported
    1139          14 :     return SvxCreateNumRule( &aRule );
    1140             : }
    1141             : 
    1142             : // beans::XPropertyState
    1143             : 
    1144       15724 : const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName,
    1145             :                                         const SfxItemPropertySimpleEntry*& rpResultEntry )
    1146             : {
    1147             :     //! OUString as argument?
    1148             : 
    1149       15724 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1150       15724 :     if (pStyle)
    1151             :     {
    1152       15724 :         const SfxItemPropertySimpleEntry* pEntry = NULL;
    1153       15724 :         if ( eFamily == SFX_STYLE_FAMILY_PAGE )
    1154             :         {
    1155        6886 :             pEntry = lcl_GetHeaderStyleMap()->getByName( rPropName );
    1156        6886 :             if ( pEntry )     // only item-wids in header/footer map
    1157             :             {
    1158        1869 :                 rpResultEntry = pEntry;
    1159        1869 :                 return &((const SvxSetItem&)pStyle->GetItemSet().Get(ATTR_PAGE_HEADERSET)).GetItemSet();
    1160             :             }
    1161        5017 :             pEntry = lcl_GetFooterStyleMap()->getByName( rPropName );
    1162        5017 :             if ( pEntry )      // only item-wids in header/footer map
    1163             :             {
    1164        1869 :                 rpResultEntry = pEntry;
    1165        1869 :                 return &((const SvxSetItem&)pStyle->GetItemSet().Get(ATTR_PAGE_FOOTERSET)).GetItemSet();
    1166             :             }
    1167             :         }
    1168       11986 :         pEntry = pPropSet->getPropertyMap().getByName( rPropName );
    1169       11986 :         if ( pEntry )
    1170             :         {
    1171       11986 :             rpResultEntry = pEntry;
    1172       11986 :             return &pStyle->GetItemSet();
    1173             :         }
    1174             :     }
    1175             : 
    1176           0 :     rpResultEntry = NULL;
    1177           0 :     return NULL;
    1178             : }
    1179             : 
    1180       11092 : beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const OUString& aPropertyName )
    1181             :                                 throw(beans::UnknownPropertyException, uno::RuntimeException, std::exception)
    1182             : {
    1183       11092 :     SolarMutexGuard aGuard;
    1184       11092 :     beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
    1185             : 
    1186       11092 :     const SfxItemPropertySimpleEntry* pResultEntry = NULL;
    1187       11092 :     const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
    1188             : 
    1189       11092 :     if ( pItemSet && pResultEntry )
    1190             :     {
    1191       11092 :         sal_uInt16 nWhich = pResultEntry->nWID;
    1192       11092 :         if ( nWhich == SC_WID_UNO_TBLBORD || nWhich == SC_WID_UNO_TBLBORD2 )
    1193             :         {
    1194           0 :             nWhich = ATTR_BORDER;
    1195             :         }
    1196       11092 :         if ( IsScItemWid( nWhich ) )
    1197             :         {
    1198       11092 :             SfxItemState eState = pItemSet->GetItemState( nWhich, false );
    1199             : 
    1200             : //           //  if no rotate value is set, look at orientation
    1201             : //           //! also for a fixed value of 0 (in case orientation is ambiguous)?
    1202             : //           if ( nWhich == ATTR_ROTATE_VALUE && eState == SFX_ITEM_DEFAULT )
    1203             : //               eState = pItemSet->GetItemState( ATTR_ORIENTATION, sal_False );
    1204             : 
    1205       11092 :             if ( eState == SFX_ITEM_SET )
    1206        1375 :                 eRet = beans::PropertyState_DIRECT_VALUE;
    1207        9717 :             else if ( eState == SFX_ITEM_DEFAULT )
    1208        9717 :                 eRet = beans::PropertyState_DEFAULT_VALUE;
    1209           0 :             else if ( eState == SFX_ITEM_DONTCARE )
    1210           0 :                 eRet = beans::PropertyState_AMBIGUOUS_VALUE;    // kann eigentlich nicht sein...
    1211             :             else
    1212             :             {
    1213             :                 OSL_FAIL("unbekannter ItemState");
    1214             :             }
    1215             :         }
    1216             :     }
    1217       11092 :     return eRet;
    1218             : }
    1219             : 
    1220         144 : uno::Sequence<beans::PropertyState> SAL_CALL ScStyleObj::getPropertyStates(
    1221             :                             const uno::Sequence<OUString>& aPropertyNames )
    1222             :                     throw(beans::UnknownPropertyException, uno::RuntimeException, std::exception)
    1223             : {
    1224             :     //  duemmliche Default-Implementierung: alles einzeln per getPropertyState holen
    1225             :     //! sollte optimiert werden!
    1226             : 
    1227         144 :     SolarMutexGuard aGuard;
    1228         144 :     const OUString* pNames = aPropertyNames.getConstArray();
    1229         144 :     uno::Sequence<beans::PropertyState> aRet(aPropertyNames.getLength());
    1230         144 :     beans::PropertyState* pStates = aRet.getArray();
    1231       11129 :     for(sal_Int32 i = 0; i < aPropertyNames.getLength(); i++)
    1232       10985 :         pStates[i] = getPropertyState(pNames[i]);
    1233         144 :     return aRet;
    1234             : }
    1235             : 
    1236           0 : void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName )
    1237             :     throw(beans::UnknownPropertyException, uno::RuntimeException,
    1238             :           std::exception)
    1239             : {
    1240           0 :     SolarMutexGuard aGuard;
    1241             : 
    1242           0 :     const SfxItemPropertyMap& rMap = pPropSet->getPropertyMap();
    1243           0 :     const SfxItemPropertySimpleEntry* pEntry = rMap.getByName( aPropertyName );
    1244           0 :     if ( !pEntry )
    1245           0 :         throw beans::UnknownPropertyException();
    1246             : 
    1247           0 :     SetOnePropertyValue( aPropertyName, pEntry, NULL );
    1248           0 : }
    1249             : 
    1250           0 : uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const OUString& aPropertyName )
    1251             :                             throw(beans::UnknownPropertyException, lang::WrappedTargetException,
    1252             :                                     uno::RuntimeException, std::exception)
    1253             : {
    1254           0 :     SolarMutexGuard aGuard;
    1255           0 :     uno::Any aAny;
    1256             : 
    1257           0 :     const SfxItemPropertySimpleEntry* pResultEntry = NULL;
    1258           0 :     const SfxItemSet* pStyleSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
    1259             : 
    1260           0 :     if ( pStyleSet && pResultEntry )
    1261             :     {
    1262           0 :         sal_uInt16 nWhich = pResultEntry->nWID;
    1263             : 
    1264           0 :         if ( IsScItemWid( nWhich ) )
    1265             :         {
    1266             :             //  Default ist Default vom ItemPool, nicht vom Standard-Style,
    1267             :             //  damit es zu setPropertyToDefault passt
    1268           0 :             SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
    1269             :             //  Default-Items mit falscher Slot-ID funktionieren im SfxItemPropertySet3 nicht
    1270             :             //! Slot-IDs aendern...
    1271           0 :             if ( aEmptySet.GetPool()->GetSlotId(nWhich) == nWhich &&
    1272           0 :                  aEmptySet.GetItemState(nWhich, false) == SFX_ITEM_DEFAULT )
    1273             :             {
    1274           0 :                 aEmptySet.Put( aEmptySet.Get( nWhich ) );
    1275             :             }
    1276           0 :             const SfxItemSet* pItemSet = &aEmptySet;
    1277             : 
    1278           0 :             switch ( nWhich )       // fuer Item-Spezial-Behandlungen
    1279             :             {
    1280             :                 case ATTR_VALUE_FORMAT:
    1281             :                     //  default has no language set
    1282           0 :                     aAny <<= sal_Int32( ((const SfxUInt32Item&)pItemSet->Get(nWhich)).GetValue() );
    1283           0 :                     break;
    1284             :                 case ATTR_INDENT:
    1285           0 :                     aAny <<= sal_Int16( TwipsToHMM(((const SfxUInt16Item&)
    1286           0 :                                     pItemSet->Get(nWhich)).GetValue()) );
    1287           0 :                     break;
    1288             :                 case ATTR_PAGE_SCALE:
    1289             :                 case ATTR_PAGE_SCALETOPAGES:
    1290             :                 case ATTR_PAGE_FIRSTPAGENO:
    1291           0 :                     aAny <<= sal_Int16( ((const SfxUInt16Item&)pItemSet->Get(nWhich)).GetValue() );
    1292           0 :                     break;
    1293             :                 case ATTR_PAGE_CHARTS:
    1294             :                 case ATTR_PAGE_OBJECTS:
    1295             :                 case ATTR_PAGE_DRAWINGS:
    1296             :                     //! sal_Bool-MID fuer ScViewObjectModeItem definieren?
    1297           0 :                     aAny <<= sal_Bool( ((const ScViewObjectModeItem&)pItemSet->Get(nWhich)).
    1298           0 :                                     GetValue() == VOBJ_MODE_SHOW );
    1299           0 :                     break;
    1300             :                 case ATTR_PAGE_SCALETO:
    1301             :                     {
    1302           0 :                         const ScPageScaleToItem aItem((const ScPageScaleToItem&)pItemSet->Get(nWhich));
    1303           0 :                         if ( aPropertyName == SC_UNO_PAGE_SCALETOX )
    1304           0 :                             aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetWidth()));
    1305             :                         else
    1306           0 :                             aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetHeight()));
    1307             :                     }
    1308           0 :                     break;
    1309             :                 default:
    1310           0 :                     pPropSet->getPropertyValue( *pResultEntry, *pItemSet, aAny );
    1311           0 :             }
    1312             :         }
    1313           0 :         else if ( IsScUnoWid( nWhich ) )
    1314             :         {
    1315           0 :             SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
    1316           0 :             const SfxItemSet* pItemSet = &aEmptySet;
    1317           0 :             switch ( nWhich )
    1318             :             {
    1319             :                 case SC_WID_UNO_TBLBORD:
    1320             :                 case SC_WID_UNO_TBLBORD2:
    1321             :                     {
    1322           0 :                         const SfxPoolItem* pItem = &pItemSet->Get( ATTR_BORDER );
    1323           0 :                         if ( pItem )
    1324             :                         {
    1325           0 :                             SvxBoxItem aOuter( *( static_cast<const SvxBoxItem*>( pItem ) ) );
    1326           0 :                             SvxBoxInfoItem aInner( ATTR_BORDER_INNER );
    1327           0 :                             if (nWhich == SC_WID_UNO_TBLBORD2)
    1328           0 :                                 ScHelperFunctions::AssignTableBorder2ToAny( aAny, aOuter, aInner, true);
    1329             :                             else
    1330           0 :                                 ScHelperFunctions::AssignTableBorderToAny( aAny, aOuter, aInner, true);
    1331             :                         }
    1332             :                     }
    1333           0 :                     break;
    1334           0 :             }
    1335             :         }
    1336             :     }
    1337           0 :     return aAny;
    1338             : }
    1339             : 
    1340             : // XMultiPropertySet
    1341             : 
    1342         935 : void SAL_CALL ScStyleObj::setPropertyValues( const uno::Sequence< OUString >& aPropertyNames,
    1343             :                                                 const uno::Sequence< uno::Any >& aValues )
    1344             : throw (beans::PropertyVetoException, lang::IllegalArgumentException,
    1345             :        lang::WrappedTargetException, uno::RuntimeException,
    1346             :        std::exception)
    1347             : {
    1348         935 :     SolarMutexGuard aGuard;
    1349             : 
    1350         935 :     sal_Int32 nCount = aPropertyNames.getLength();
    1351         935 :     if ( aValues.getLength() != nCount )
    1352           0 :         throw lang::IllegalArgumentException();
    1353             : 
    1354         935 :     if ( nCount )
    1355             :     {
    1356         911 :         const OUString* pNames = aPropertyNames.getConstArray();
    1357         911 :         const uno::Any* pValues = aValues.getConstArray();
    1358             : 
    1359         911 :         const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap();
    1360       10659 :         for (sal_Int32 i = 0; i < nCount; i++)
    1361             :         {
    1362        9748 :             const SfxItemPropertySimpleEntry*  pEntry = rPropertyMap.getByName( pNames[i] );
    1363        9748 :             SetOnePropertyValue( pNames[i], pEntry, &pValues[i] );
    1364             :         }
    1365         935 :     }
    1366         935 : }
    1367             : 
    1368         144 : uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyValues(
    1369             :                                     const uno::Sequence< OUString >& aPropertyNames )
    1370             :                                 throw (uno::RuntimeException, std::exception)
    1371             : {
    1372         144 :     SolarMutexGuard aGuard;
    1373             : 
    1374             :     //! optimize
    1375             : 
    1376         144 :     sal_Int32 nCount = aPropertyNames.getLength();
    1377         144 :     uno::Sequence<uno::Any> aSequence( nCount );
    1378         144 :     if ( nCount )
    1379             :     {
    1380         144 :         uno::Any* pValues = aSequence.getArray();
    1381        1483 :         for (sal_Int32 i=0; i<nCount; i++)
    1382        1339 :             pValues[i] = getPropertyValue( aPropertyNames[i] );
    1383             :     }
    1384         144 :     return aSequence;
    1385             : }
    1386             : 
    1387           0 : void SAL_CALL ScStyleObj::addPropertiesChangeListener( const uno::Sequence<OUString>& /* aPropertyNames */,
    1388             :                                     const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
    1389             :                                 throw (uno::RuntimeException, std::exception)
    1390             : {
    1391             :     // no bound properties
    1392           0 : }
    1393             : 
    1394           0 : void SAL_CALL ScStyleObj::removePropertiesChangeListener(
    1395             :                                     const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
    1396             :                                 throw (uno::RuntimeException, std::exception)
    1397             : {
    1398             :     // no bound properties
    1399           0 : }
    1400             : 
    1401           0 : void SAL_CALL ScStyleObj::firePropertiesChangeEvent( const uno::Sequence<OUString>& /* aPropertyNames */,
    1402             :                                     const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
    1403             :                                 throw (uno::RuntimeException, std::exception)
    1404             : {
    1405             :     // no bound properties
    1406           0 : }
    1407             : 
    1408             : // XMultiPropertyStates
    1409             : // getPropertyStates already defined for XPropertyState
    1410             : 
    1411         850 : void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
    1412             :     throw (uno::RuntimeException, std::exception)
    1413             : {
    1414         850 :     SolarMutexGuard aGuard;
    1415             : 
    1416         850 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1417         850 :     if ( pStyle )
    1418             :     {
    1419             :         //  cell styles cannot be modified if any sheet is protected
    1420         850 :         if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
    1421           0 :             throw uno::RuntimeException();
    1422             : 
    1423         850 :         SfxItemSet& rSet = pStyle->GetItemSet();
    1424         850 :         rSet.ClearItem();                               // set all items to default
    1425             : 
    1426             :         //! merge with SetOneProperty
    1427             : 
    1428         850 :         ScDocument* pDoc = pDocShell->GetDocument();
    1429         850 :         if ( eFamily == SFX_STYLE_FAMILY_PARA )
    1430             :         {
    1431             :             //  row heights
    1432             : 
    1433         619 :             VirtualDevice aVDev;
    1434         619 :             Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
    1435         619 :             double nPPTX = aLogic.X() / 1000.0;
    1436         619 :             double nPPTY = aLogic.Y() / 1000.0;
    1437         619 :             Fraction aZoom(1,1);
    1438         619 :             pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
    1439             : 
    1440         619 :             pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
    1441         619 :             pDocShell->SetDocumentModified();
    1442             :         }
    1443             :         else
    1444             :         {
    1445             :             // #i22448# apply the default BoxInfoItem for page styles again
    1446             :             // (same content as in ScStyleSheet::GetItemSet, to control the dialog)
    1447         231 :             SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
    1448         231 :             aBoxInfoItem.SetTable( false );
    1449         231 :             aBoxInfoItem.SetDist( true );
    1450         231 :             aBoxInfoItem.SetValid( VALID_DISTANCE, true );
    1451         231 :             rSet.Put( aBoxInfoItem );
    1452             : 
    1453         231 :             pDocShell->PageStyleModified( aStyleName, true );
    1454             :         }
    1455         850 :     }
    1456         850 : }
    1457             : 
    1458           0 : void SAL_CALL ScStyleObj::setPropertiesToDefault( const uno::Sequence<OUString>& aPropertyNames )
    1459             :     throw (beans::UnknownPropertyException, uno::RuntimeException,
    1460             :            std::exception)
    1461             : {
    1462           0 :     SolarMutexGuard aGuard;
    1463             : 
    1464           0 :     sal_Int32 nCount = aPropertyNames.getLength();
    1465           0 :     if ( nCount )
    1466             :     {
    1467           0 :         const OUString* pNames = aPropertyNames.getConstArray();
    1468             : 
    1469           0 :         const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap();
    1470           0 :         for (sal_Int32 i = 0; i < nCount; i++)
    1471             :         {
    1472           0 :             const SfxItemPropertySimpleEntry*  pEntry = rPropertyMap.getByName( pNames[i] );
    1473           0 :             SetOnePropertyValue( pNames[i], pEntry, NULL );
    1474             :         }
    1475           0 :     }
    1476           0 : }
    1477             : 
    1478           0 : uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyDefaults(
    1479             :                                 const uno::Sequence<OUString>& aPropertyNames )
    1480             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException,
    1481             :                                 uno::RuntimeException, std::exception)
    1482             : {
    1483           0 :     SolarMutexGuard aGuard;
    1484             : 
    1485             :     //! optimize
    1486             : 
    1487           0 :     sal_Int32 nCount = aPropertyNames.getLength();
    1488           0 :     uno::Sequence<uno::Any> aSequence( nCount );
    1489           0 :     if ( nCount )
    1490             :     {
    1491           0 :         uno::Any* pValues = aSequence.getArray();
    1492           0 :         for (sal_Int32 i=0; i<nCount; i++)
    1493           0 :             pValues[i] = getPropertyDefault( aPropertyNames[i] );
    1494             :     }
    1495           0 :     return aSequence;
    1496             : }
    1497             : 
    1498             : // beans::XPropertySet
    1499             : 
    1500        3148 : uno::Reference<beans::XPropertySetInfo> SAL_CALL ScStyleObj::getPropertySetInfo()
    1501             :                                                         throw(uno::RuntimeException, std::exception)
    1502             : {
    1503        3148 :     SolarMutexGuard aGuard;
    1504        3148 :     return pPropSet->getPropertySetInfo();
    1505             : }
    1506             : 
    1507        2056 : void SAL_CALL ScStyleObj::setPropertyValue(
    1508             :                         const OUString& aPropertyName, const uno::Any& aValue )
    1509             :     throw(beans::UnknownPropertyException, beans::PropertyVetoException,
    1510             :           lang::IllegalArgumentException, lang::WrappedTargetException,
    1511             :           uno::RuntimeException, std::exception)
    1512             : {
    1513        2056 :     SolarMutexGuard aGuard;
    1514             : 
    1515        2056 :     const SfxItemPropertySimpleEntry*  pEntry = pPropSet->getPropertyMap().getByName( aPropertyName );
    1516        2056 :     if ( !pEntry )
    1517           0 :         throw beans::UnknownPropertyException();
    1518             : 
    1519        2056 :     SetOnePropertyValue( aPropertyName, pEntry, &aValue );
    1520        2056 : }
    1521             : 
    1522       11804 : void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue )
    1523             :                                 throw(lang::IllegalArgumentException,
    1524             :                                       uno::RuntimeException,
    1525             :                                       std::exception)
    1526             : {
    1527       11804 :     SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1528       11804 :     if ( pStyle && pEntry )
    1529             :     {
    1530             :         //  cell styles cannot be modified if any sheet is protected
    1531       11804 :         if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
    1532           0 :             throw uno::RuntimeException();
    1533             : 
    1534       11804 :         SfxItemSet& rSet = pStyle->GetItemSet();    // direkt im lebenden Style aendern...
    1535       11804 :         bool bDone = false;
    1536       11804 :         if ( eFamily == SFX_STYLE_FAMILY_PAGE )
    1537             :         {
    1538        8840 :             if(pEntry->nWID == SC_WID_UNO_HEADERSET)
    1539             :             {
    1540        2976 :                 const SfxItemPropertySimpleEntry* pHeaderEntry = lcl_GetHeaderStyleMap()->getByName( rPropertyName );
    1541        2976 :                 if ( pHeaderEntry ) // only item-wids in header/footer map
    1542             :                 {
    1543        2976 :                     SvxSetItem aNewHeader( (const SvxSetItem&)rSet.Get(ATTR_PAGE_HEADERSET) );
    1544        2976 :                     if (pValue)
    1545        2976 :                         pPropSet->setPropertyValue( *pHeaderEntry, *pValue, aNewHeader.GetItemSet() );
    1546             :                     else
    1547           0 :                         aNewHeader.GetItemSet().ClearItem( pHeaderEntry->nWID );
    1548        2976 :                     rSet.Put( aNewHeader );
    1549        2976 :                     bDone = true;
    1550             :                 }
    1551             :             }
    1552        5864 :             else if(pEntry->nWID == SC_WID_UNO_FOOTERSET)
    1553             :             {
    1554        2983 :                 const SfxItemPropertySimpleEntry* pFooterEntry = lcl_GetFooterStyleMap()->getByName( rPropertyName );
    1555        2983 :                 if ( pFooterEntry ) // only item-wids in header/footer map
    1556             :                 {
    1557        2983 :                     SvxSetItem aNewFooter( (const SvxSetItem&)rSet.Get(ATTR_PAGE_FOOTERSET) );
    1558        2983 :                     if (pValue)
    1559        2983 :                         pPropSet->setPropertyValue( *pFooterEntry, *pValue, aNewFooter.GetItemSet() );
    1560             :                     else
    1561           0 :                         aNewFooter.GetItemSet().ClearItem( pFooterEntry->nWID );
    1562        2983 :                     rSet.Put( aNewFooter );
    1563        2983 :                     bDone = true;
    1564             :                 }
    1565             :             }
    1566             :         }
    1567       11804 :         if (!bDone)
    1568             :         {
    1569        5845 :             if ( pEntry )
    1570             :             {
    1571        5845 :                 if ( IsScItemWid( pEntry->nWID ) )
    1572             :                 {
    1573        5845 :                     if (pValue)
    1574             :                     {
    1575        5845 :                         switch ( pEntry->nWID )     // fuer Item-Spezial-Behandlungen
    1576             :                         {
    1577             :                             case ATTR_VALUE_FORMAT:
    1578             :                                 {
    1579             :                                     // language for number formats
    1580             :                                     SvNumberFormatter* pFormatter =
    1581         160 :                                             pDocShell->GetDocument()->GetFormatTable();
    1582             :                                     sal_uInt32 nOldFormat = ((const SfxUInt32Item&)
    1583         160 :                                             rSet.Get( ATTR_VALUE_FORMAT )).GetValue();
    1584             :                                     LanguageType eOldLang = ((const SvxLanguageItem&)
    1585         160 :                                             rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage();
    1586             :                                     nOldFormat = pFormatter->
    1587         160 :                                             GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
    1588             : 
    1589         160 :                                     sal_uInt32 nNewFormat = 0;
    1590         160 :                                     *pValue >>= nNewFormat;
    1591         160 :                                     rSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) );
    1592             : 
    1593         160 :                                     const SvNumberformat* pNewEntry = pFormatter->GetEntry( nNewFormat );
    1594             :                                     LanguageType eNewLang =
    1595         160 :                                         pNewEntry ? pNewEntry->GetLanguage() : LANGUAGE_DONTKNOW;
    1596         160 :                                     if ( eNewLang != eOldLang && eNewLang != LANGUAGE_DONTKNOW )
    1597          30 :                                         rSet.Put( SvxLanguageItem( eNewLang, ATTR_LANGUAGE_FORMAT ) );
    1598             : 
    1599             :                                     //! keep default state of number format if only language changed?
    1600             :                                 }
    1601         160 :                                 break;
    1602             :                             case ATTR_INDENT:
    1603             :                                 {
    1604           3 :                                     sal_Int16 nVal = 0;
    1605           3 :                                     *pValue >>= nVal;
    1606           3 :                                     rSet.Put( SfxUInt16Item( pEntry->nWID, (sal_uInt16)HMMToTwips(nVal) ) );
    1607             :                                 }
    1608           3 :                                 break;
    1609             :                             case ATTR_ROTATE_VALUE:
    1610             :                                 {
    1611         110 :                                     sal_Int32 nRotVal = 0;
    1612         110 :                                     if ( *pValue >>= nRotVal )
    1613             :                                     {
    1614             :                                         //  stored value is always between 0 and 360 deg.
    1615         110 :                                         nRotVal %= 36000;
    1616         110 :                                         if ( nRotVal < 0 )
    1617           0 :                                             nRotVal += 36000;
    1618         110 :                                         rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, nRotVal ) );
    1619             :                                     }
    1620             :                                 }
    1621         110 :                                 break;
    1622             :                             case ATTR_STACKED:
    1623             :                                 {
    1624             :                                     table::CellOrientation eOrient;
    1625          11 :                                     if( *pValue >>= eOrient )
    1626             :                                     {
    1627          11 :                                         switch( eOrient )
    1628             :                                         {
    1629             :                                             case table::CellOrientation_STANDARD:
    1630          11 :                                                 rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
    1631          11 :                                             break;
    1632             :                                             case table::CellOrientation_TOPBOTTOM:
    1633           0 :                                                 rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
    1634           0 :                                                 rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) );
    1635           0 :                                             break;
    1636             :                                             case table::CellOrientation_BOTTOMTOP:
    1637           0 :                                                 rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
    1638           0 :                                                 rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 9000 ) );
    1639           0 :                                             break;
    1640             :                                             case table::CellOrientation_STACKED:
    1641           0 :                                                 rSet.Put( SfxBoolItem( ATTR_STACKED, true ) );
    1642           0 :                                             break;
    1643             :                                             default:
    1644             :                                             {
    1645             :                                                 // added to avoid warnings
    1646             :                                             }
    1647             :                                         }
    1648             :                                     }
    1649             :                                 }
    1650          11 :                                 break;
    1651             :                             case ATTR_PAGE_SCALE:
    1652             :                             case ATTR_PAGE_SCALETOPAGES:
    1653             :                                 {
    1654         104 :                                     rSet.ClearItem(ATTR_PAGE_SCALETOPAGES);
    1655         104 :                                     rSet.ClearItem(ATTR_PAGE_SCALE);
    1656         104 :                                     rSet.ClearItem(ATTR_PAGE_SCALETO);
    1657         104 :                                     sal_Int16 nVal = 0;
    1658         104 :                                     *pValue >>= nVal;
    1659         104 :                                     rSet.Put( SfxUInt16Item( pEntry->nWID, nVal ) );
    1660             :                                 }
    1661         104 :                                 break;
    1662             :                             case ATTR_PAGE_FIRSTPAGENO:
    1663             :                                 {
    1664         150 :                                     sal_Int16 nVal = 0;
    1665         150 :                                     *pValue >>= nVal;
    1666         150 :                                     rSet.Put( SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, nVal ) );
    1667             :                                 }
    1668         150 :                                 break;
    1669             :                             case ATTR_PAGE_CHARTS:
    1670             :                             case ATTR_PAGE_OBJECTS:
    1671             :                             case ATTR_PAGE_DRAWINGS:
    1672             :                                 {
    1673          24 :                                     sal_Bool bBool = false;
    1674          24 :                                     *pValue >>= bBool;
    1675             :                                     //! sal_Bool-MID fuer ScViewObjectModeItem definieren?
    1676             :                                     rSet.Put( ScViewObjectModeItem( pEntry->nWID,
    1677          24 :                                         bBool ? VOBJ_MODE_SHOW : VOBJ_MODE_HIDE ) );
    1678             :                                 }
    1679          24 :                                 break;
    1680             :                             case ATTR_PAGE_PAPERBIN:
    1681             :                                 {
    1682           0 :                                     sal_uInt8 nTray = PAPERBIN_PRINTER_SETTINGS;
    1683           0 :                                     bool bFound = false;
    1684             : 
    1685           0 :                                     OUString aName;
    1686           0 :                                     if ( *pValue >>= aName )
    1687             :                                     {
    1688           0 :                                         if ( aName == SC_PAPERBIN_DEFAULTNAME )
    1689           0 :                                             bFound = true;
    1690             :                                         else
    1691             :                                         {
    1692           0 :                                             Printer* pPrinter = pDocShell->GetPrinter();
    1693           0 :                                             if (pPrinter)
    1694             :                                             {
    1695           0 :                                                 sal_uInt16 nCount = pPrinter->GetPaperBinCount();
    1696           0 :                                                 for (sal_uInt16 i=0; i<nCount; i++)
    1697           0 :                                                     if ( aName == pPrinter->GetPaperBinName(i) )
    1698             :                                                     {
    1699           0 :                                                         nTray = (sal_uInt8) i;
    1700           0 :                                                         bFound = true;
    1701           0 :                                                         break;
    1702             :                                                     }
    1703             :                                             }
    1704             :                                         }
    1705             :                                     }
    1706           0 :                                     if ( bFound )
    1707           0 :                                         rSet.Put( SvxPaperBinItem( ATTR_PAGE_PAPERBIN, nTray ) );
    1708             :                                     else
    1709           0 :                                         throw lang::IllegalArgumentException();
    1710             :                                 }
    1711           0 :                                 break;
    1712             :                             case ATTR_PAGE_SCALETO:
    1713             :                                 {
    1714          16 :                                     sal_Int16 nPages = 0;
    1715          16 :                                     if (*pValue >>= nPages)
    1716             :                                     {
    1717          16 :                                         ScPageScaleToItem aItem = ((const ScPageScaleToItem&)rSet.Get(ATTR_PAGE_SCALETO));
    1718          16 :                                         if ( rPropertyName == SC_UNO_PAGE_SCALETOX )
    1719           8 :                                             aItem.SetWidth(static_cast<sal_uInt16>(nPages));
    1720             :                                         else
    1721           8 :                                             aItem.SetHeight(static_cast<sal_uInt16>(nPages));
    1722          16 :                                         rSet.Put( aItem );
    1723          16 :                                         rSet.ClearItem(ATTR_PAGE_SCALETOPAGES);
    1724          16 :                                         rSet.ClearItem(ATTR_PAGE_SCALE);
    1725             :                                     }
    1726             :                                 }
    1727          16 :                                 break;
    1728             :                             case ATTR_HIDDEN:
    1729             :                                 {
    1730         850 :                                     sal_Bool bHidden = sal_False;
    1731         850 :                                     if ( *pValue >>= bHidden )
    1732         850 :                                         pStyle->SetHidden( bHidden );
    1733             :                                 }
    1734         850 :                                 break;
    1735             :                             default:
    1736             :                                 //  Default-Items mit falscher Slot-ID
    1737             :                                 //  funktionieren im SfxItemPropertySet3 nicht
    1738             :                                 //! Slot-IDs aendern...
    1739        5780 :                                 if ( rSet.GetPool()->GetSlotId(pEntry->nWID) == pEntry->nWID &&
    1740        1363 :                                      rSet.GetItemState(pEntry->nWID, false) == SFX_ITEM_DEFAULT )
    1741             :                                 {
    1742        1347 :                                     rSet.Put( rSet.Get(pEntry->nWID) );
    1743             :                                 }
    1744        4417 :                                 pPropSet->setPropertyValue( *pEntry, *pValue, rSet );
    1745             :                         }
    1746             :                     }
    1747             :                     else
    1748             :                     {
    1749           0 :                         rSet.ClearItem( pEntry->nWID );
    1750             :                         // language for number formats
    1751           0 :                         if ( pEntry->nWID == ATTR_VALUE_FORMAT )
    1752           0 :                             rSet.ClearItem( ATTR_LANGUAGE_FORMAT );
    1753             : 
    1754             :                         //! for ATTR_ROTATE_VALUE, also reset ATTR_ORIENTATION?
    1755             :                     }
    1756             :                 }
    1757           0 :                 else if ( IsScUnoWid( pEntry->nWID ) )
    1758             :                 {
    1759           0 :                     switch ( pEntry->nWID )
    1760             :                     {
    1761             :                         case SC_WID_UNO_TBLBORD:
    1762             :                             {
    1763           0 :                                 if (pValue)
    1764             :                                 {
    1765           0 :                                     table::TableBorder aBorder;
    1766           0 :                                     if ( *pValue >>= aBorder )
    1767             :                                     {
    1768           0 :                                         SvxBoxItem aOuter( ATTR_BORDER );
    1769           0 :                                         SvxBoxInfoItem aInner( ATTR_BORDER_INNER );
    1770           0 :                                         ScHelperFunctions::FillBoxItems( aOuter, aInner, aBorder );
    1771           0 :                                         rSet.Put( aOuter );
    1772             :                                     }
    1773             :                                 }
    1774             :                                 else
    1775             :                                 {
    1776           0 :                                     rSet.ClearItem( ATTR_BORDER );
    1777             :                                 }
    1778             :                             }
    1779           0 :                             break;
    1780             :                         case SC_WID_UNO_TBLBORD2:
    1781             :                             {
    1782           0 :                                 if (pValue)
    1783             :                                 {
    1784           0 :                                     table::TableBorder2 aBorder2;
    1785           0 :                                     if ( *pValue >>= aBorder2 )
    1786             :                                     {
    1787           0 :                                         SvxBoxItem aOuter( ATTR_BORDER );
    1788           0 :                                         SvxBoxInfoItem aInner( ATTR_BORDER_INNER );
    1789           0 :                                         ScHelperFunctions::FillBoxItems( aOuter, aInner, aBorder2 );
    1790           0 :                                         rSet.Put( aOuter );
    1791             :                                     }
    1792             :                                 }
    1793             :                                 else
    1794             :                                 {
    1795           0 :                                     rSet.ClearItem( ATTR_BORDER );
    1796             :                                 }
    1797             :                             }
    1798           0 :                             break;
    1799             :                     }
    1800             :                 }
    1801             :             }
    1802             :         }
    1803             : 
    1804             :         //! DocFunc-Funktion??
    1805             :         //! Undo ?????????????
    1806             : 
    1807       11804 :         ScDocument* pDoc = pDocShell->GetDocument();
    1808       11804 :         if ( eFamily == SFX_STYLE_FAMILY_PARA )
    1809             :         {
    1810             :             //  Zeilenhoehen anpassen...
    1811             : 
    1812        2964 :             VirtualDevice aVDev;
    1813        2964 :             Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
    1814        2964 :             double nPPTX = aLogic.X() / 1000.0;
    1815        2964 :             double nPPTY = aLogic.Y() / 1000.0;
    1816        2964 :             Fraction aZoom(1,1);
    1817        2964 :             pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
    1818             : 
    1819        2964 :             pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
    1820        2964 :             pDocShell->SetDocumentModified();
    1821             :         }
    1822             :         else
    1823             :         {
    1824             :             //! ModifyStyleSheet am Dokument (alte Werte merken)
    1825             : 
    1826        8840 :             pDocShell->PageStyleModified( aStyleName, true );
    1827             :         }
    1828             :     }
    1829       11804 : }
    1830             : 
    1831        5252 : uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName )
    1832             :                 throw(beans::UnknownPropertyException, lang::WrappedTargetException,
    1833             :                         uno::RuntimeException, std::exception)
    1834             : {
    1835        5252 :     SolarMutexGuard aGuard;
    1836        5252 :     uno::Any aAny;
    1837             : 
    1838        5252 :     if ( aPropertyName == SC_UNONAME_DISPNAME )      // read-only
    1839             :     {
    1840             :         //  core always has the display name
    1841         620 :         SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1842         620 :         if (pStyle)
    1843         620 :             aAny <<= OUString( pStyle->GetName() );
    1844             :     }
    1845             :     else
    1846             :     {
    1847        4632 :         const SfxItemPropertySimpleEntry* pResultEntry = NULL;
    1848        4632 :         const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
    1849             : 
    1850        4632 :         if ( pItemSet && pResultEntry )
    1851             :         {
    1852        4632 :             sal_uInt16 nWhich = pResultEntry->nWID;
    1853             : 
    1854        4632 :             if ( IsScItemWid( nWhich ) )
    1855             :             {
    1856        4632 :                 switch ( nWhich )       // fuer Item-Spezial-Behandlungen
    1857             :                 {
    1858             :                     case ATTR_VALUE_FORMAT:
    1859         179 :                         if ( pDocShell )
    1860             :                         {
    1861             :                             sal_uInt32 nOldFormat = ((const SfxUInt32Item&)
    1862         179 :                                     pItemSet->Get( ATTR_VALUE_FORMAT )).GetValue();
    1863             :                             LanguageType eOldLang = ((const SvxLanguageItem&)
    1864         179 :                                     pItemSet->Get( ATTR_LANGUAGE_FORMAT )).GetLanguage();
    1865             :                             nOldFormat = pDocShell->GetDocument()->GetFormatTable()->
    1866         179 :                                     GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
    1867         179 :                             aAny <<= nOldFormat;
    1868             :                         }
    1869         179 :                         break;
    1870             :                     case ATTR_INDENT:
    1871           2 :                         aAny <<= sal_Int16( TwipsToHMM(((const SfxUInt16Item&)
    1872           2 :                                         pItemSet->Get(nWhich)).GetValue()) );
    1873           1 :                         break;
    1874             :                     case ATTR_STACKED:
    1875             :                         {
    1876           1 :                             sal_Int32 nRot = ((const SfxInt32Item&)pItemSet->Get(ATTR_ROTATE_VALUE)).GetValue();
    1877           1 :                             sal_Bool bStacked = ((const SfxBoolItem&)pItemSet->Get(nWhich)).GetValue();
    1878           1 :                             SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( aAny );
    1879             :                         }
    1880           1 :                         break;
    1881             :                     case ATTR_PAGE_SCALE:
    1882             :                     case ATTR_PAGE_SCALETOPAGES:
    1883             :                     case ATTR_PAGE_FIRSTPAGENO:
    1884          10 :                         aAny <<= sal_Int16( ((const SfxUInt16Item&)pItemSet->Get(nWhich)).GetValue() );
    1885          10 :                         break;
    1886             :                     case ATTR_PAGE_CHARTS:
    1887             :                     case ATTR_PAGE_OBJECTS:
    1888             :                     case ATTR_PAGE_DRAWINGS:
    1889             :                         //! sal_Bool-MID fuer ScViewObjectModeItem definieren?
    1890          12 :                         aAny <<= sal_Bool( ((const ScViewObjectModeItem&)pItemSet->
    1891          12 :                                         Get(nWhich)).GetValue() == VOBJ_MODE_SHOW );
    1892           6 :                         break;
    1893             :                     case ATTR_PAGE_PAPERBIN:
    1894             :                         {
    1895             :                             // property PrinterPaperTray is the name of the tray
    1896             : 
    1897           0 :                             sal_uInt8 nValue = ((const SvxPaperBinItem&)pItemSet->Get(nWhich)).GetValue();
    1898           0 :                             OUString aName;
    1899           0 :                             if ( nValue == PAPERBIN_PRINTER_SETTINGS )
    1900           0 :                                 aName = OUString(SC_PAPERBIN_DEFAULTNAME );
    1901             :                             else
    1902             :                             {
    1903           0 :                                 Printer* pPrinter = pDocShell->GetPrinter();
    1904           0 :                                 if (pPrinter)
    1905           0 :                                     aName = pPrinter->GetPaperBinName( nValue );
    1906             :                             }
    1907           0 :                             aAny <<= aName;
    1908             :                         }
    1909           0 :                         break;
    1910             :                     case ATTR_PAGE_SCALETO:
    1911             :                         {
    1912           6 :                             ScPageScaleToItem aItem((const ScPageScaleToItem&)pItemSet->Get(ATTR_PAGE_SCALETO));
    1913           6 :                             if ( aPropertyName == SC_UNO_PAGE_SCALETOX )
    1914           3 :                                 aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetWidth()));
    1915             :                             else
    1916           3 :                                 aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetHeight()));
    1917             :                         }
    1918           6 :                         break;
    1919             :                     case ATTR_HIDDEN:
    1920             :                         {
    1921         144 :                             sal_Bool bHidden = sal_False;
    1922         144 :                             SfxStyleSheetBase* pStyle = GetStyle_Impl();
    1923         144 :                             if ( pStyle )
    1924         144 :                                 bHidden = pStyle->IsHidden();
    1925         144 :                             aAny = uno::makeAny( bHidden );
    1926             :                         }
    1927         144 :                         break;
    1928             :                     default:
    1929             :                         //  Default-Items mit falscher Slot-ID
    1930             :                         //  funktionieren im SfxItemPropertySet3 nicht
    1931             :                         //! Slot-IDs aendern...
    1932        5577 :                         if ( pItemSet->GetPool()->GetSlotId(nWhich) == nWhich &&
    1933        1292 :                              pItemSet->GetItemState(nWhich, false) == SFX_ITEM_DEFAULT )
    1934             :                         {
    1935         986 :                             SfxItemSet aNoEmptySet( *pItemSet );
    1936         986 :                             aNoEmptySet.Put( aNoEmptySet.Get( nWhich ) );
    1937         986 :                             pPropSet->getPropertyValue( *pResultEntry, aNoEmptySet, aAny );
    1938             :                         }
    1939             :                         else
    1940        3299 :                             pPropSet->getPropertyValue( *pResultEntry, *pItemSet, aAny );
    1941             :                 }
    1942             :             }
    1943           0 :             else if ( IsScUnoWid( nWhich ) )
    1944             :             {
    1945           0 :                 switch ( nWhich )
    1946             :                 {
    1947             :                     case SC_WID_UNO_TBLBORD:
    1948             :                     case SC_WID_UNO_TBLBORD2:
    1949             :                         {
    1950           0 :                             const SfxPoolItem* pItem = &pItemSet->Get( ATTR_BORDER );
    1951           0 :                             if ( pItem )
    1952             :                             {
    1953           0 :                                 SvxBoxItem aOuter( *( static_cast<const SvxBoxItem*>( pItem ) ) );
    1954           0 :                                 SvxBoxInfoItem aInner( ATTR_BORDER_INNER );
    1955           0 :                                 if (nWhich == SC_WID_UNO_TBLBORD2)
    1956           0 :                                     ScHelperFunctions::AssignTableBorder2ToAny( aAny, aOuter, aInner, true);
    1957             :                                 else
    1958           0 :                                     ScHelperFunctions::AssignTableBorderToAny( aAny, aOuter, aInner, true);
    1959             :                             }
    1960             :                         }
    1961           0 :                         break;
    1962             :                 }
    1963             :             }
    1964             :         }
    1965             :     }
    1966             : 
    1967        5252 :     return aAny;
    1968             : }
    1969             : 
    1970           0 : SC_IMPL_DUMMY_PROPERTY_LISTENER( ScStyleObj )
    1971             : 
    1972             : // lang::XServiceInfo
    1973             : 
    1974           0 : OUString SAL_CALL ScStyleObj::getImplementationName() throw(uno::RuntimeException, std::exception)
    1975             : {
    1976           0 :     return OUString("ScStyleObj" );
    1977             : }
    1978             : 
    1979           0 : sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName )
    1980             :                                                     throw(uno::RuntimeException, std::exception)
    1981             : {
    1982           0 :     return cppu::supportsService(this, rServiceName);
    1983             : }
    1984             : 
    1985           0 : uno::Sequence<OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
    1986             :                                                     throw(uno::RuntimeException, std::exception)
    1987             : {
    1988           0 :     bool bPage = ( eFamily == SFX_STYLE_FAMILY_PAGE );
    1989           0 :     uno::Sequence<OUString> aRet(2);
    1990           0 :     OUString* pArray = aRet.getArray();
    1991           0 :     pArray[0] = OUString(SCSTYLE_SERVICE );
    1992           0 :     pArray[1] = bPage ? OUString(SCPAGESTYLE_SERVICE)
    1993           0 :                       : OUString(SCCELLSTYLE_SERVICE);
    1994           0 :     return aRet;
    1995             : }
    1996             : 
    1997             : 
    1998             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10