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