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