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