/src/libreoffice/sw/source/uibase/envelp/labimg.cxx
Line | Count | Source |
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 <sal/config.h> |
21 | | |
22 | | #include <o3tl/any.hxx> |
23 | | #include <osl/diagnose.h> |
24 | | #include <tools/UnitConversion.hxx> |
25 | | #include <com/sun/star/uno/Sequence.hxx> |
26 | | #include <unotools/useroptions.hxx> |
27 | | #include <swmodule.hxx> |
28 | | #include <labimg.hxx> |
29 | | #include <cmdid.h> |
30 | | |
31 | | using namespace utl; |
32 | | using namespace ::com::sun::star::uno; |
33 | | |
34 | | SwLabItem::SwLabItem() : |
35 | | |
36 | 0 | SfxPoolItem(FN_LABEL), |
37 | 0 | m_lLeft (0), |
38 | 0 | m_lUpper(0), |
39 | 0 | m_nCols (1), |
40 | 0 | m_nRows (1), |
41 | 0 | m_nCol (1), |
42 | 0 | m_nRow (1) |
43 | 0 | { |
44 | 0 | m_bAddr = |
45 | 0 | m_bCont = |
46 | 0 | m_bSynchron = false; |
47 | 0 | m_bPage = true; |
48 | 0 | m_lHDist = |
49 | 0 | m_lVDist = |
50 | 0 | m_lWidth = |
51 | 0 | m_lHeight = |
52 | 0 | m_lPWidth = |
53 | 0 | m_lPHeight = 5669; // 10 cm |
54 | 0 | } |
55 | | |
56 | | SwLabItem& SwLabItem::operator =(const SwLabItem& rItem) |
57 | 0 | { |
58 | 0 | m_bAddr = rItem.m_bAddr; |
59 | 0 | m_aWriting = rItem.m_aWriting; |
60 | 0 | m_bCont = rItem.m_bCont; |
61 | 0 | m_sDBName = rItem.m_sDBName; |
62 | 0 | m_aLstMake = rItem.m_aLstMake; |
63 | 0 | m_aLstType = rItem.m_aLstType; |
64 | 0 | m_aMake = rItem.m_aMake; |
65 | 0 | m_aType = rItem.m_aType; |
66 | 0 | m_bPage = rItem.m_bPage; |
67 | 0 | m_bSynchron = rItem.m_bSynchron; |
68 | 0 | m_nCol = rItem.m_nCol; |
69 | 0 | m_nRow = rItem.m_nRow; |
70 | 0 | m_lHDist = rItem.m_lHDist; |
71 | 0 | m_lVDist = rItem.m_lVDist; |
72 | 0 | m_lWidth = rItem.m_lWidth; |
73 | 0 | m_lHeight = rItem.m_lHeight; |
74 | 0 | m_lLeft = rItem.m_lLeft; |
75 | 0 | m_lUpper = rItem.m_lUpper; |
76 | 0 | m_nCols = rItem.m_nCols; |
77 | 0 | m_nRows = rItem.m_nRows; |
78 | 0 | m_lPWidth = rItem.m_lPWidth; |
79 | 0 | m_lPHeight = rItem.m_lPHeight; |
80 | 0 | m_aPrivFirstName = rItem.m_aPrivFirstName; |
81 | 0 | m_aPrivName = rItem.m_aPrivName; |
82 | 0 | m_aPrivShortCut = rItem.m_aPrivShortCut; |
83 | 0 | m_aPrivFirstName2 = rItem.m_aPrivFirstName2; |
84 | 0 | m_aPrivName2 = rItem.m_aPrivName2; |
85 | 0 | m_aPrivShortCut2 = rItem.m_aPrivShortCut2; |
86 | 0 | m_aPrivStreet = rItem.m_aPrivStreet; |
87 | 0 | m_aPrivZip = rItem.m_aPrivZip; |
88 | 0 | m_aPrivCity = rItem.m_aPrivCity; |
89 | 0 | m_aPrivCountry = rItem.m_aPrivCountry; |
90 | 0 | m_aPrivState = rItem.m_aPrivState; |
91 | 0 | m_aPrivTitle = rItem.m_aPrivTitle; |
92 | 0 | m_aPrivProfession = rItem.m_aPrivProfession; |
93 | 0 | m_aPrivPhone = rItem.m_aPrivPhone; |
94 | 0 | m_aPrivMobile = rItem.m_aPrivMobile; |
95 | 0 | m_aPrivFax = rItem.m_aPrivFax; |
96 | 0 | m_aPrivWWW = rItem.m_aPrivWWW; |
97 | 0 | m_aPrivMail = rItem.m_aPrivMail; |
98 | 0 | m_aCompCompany = rItem.m_aCompCompany; |
99 | 0 | m_aCompCompanyExt = rItem.m_aCompCompanyExt; |
100 | 0 | m_aCompSlogan = rItem.m_aCompSlogan; |
101 | 0 | m_aCompStreet = rItem.m_aCompStreet; |
102 | 0 | m_aCompZip = rItem.m_aCompZip; |
103 | 0 | m_aCompCity = rItem.m_aCompCity; |
104 | 0 | m_aCompCountry = rItem.m_aCompCountry; |
105 | 0 | m_aCompState = rItem.m_aCompState; |
106 | 0 | m_aCompPosition = rItem.m_aCompPosition; |
107 | 0 | m_aCompPhone = rItem.m_aCompPhone; |
108 | 0 | m_aCompMobile = rItem.m_aCompMobile; |
109 | 0 | m_aCompFax = rItem.m_aCompFax; |
110 | 0 | m_aCompWWW = rItem.m_aCompWWW; |
111 | 0 | m_aCompMail = rItem.m_aCompMail; |
112 | 0 | m_sGlossaryGroup = rItem.m_sGlossaryGroup; |
113 | 0 | m_sGlossaryBlockName = rItem.m_sGlossaryBlockName; |
114 | 0 | return *this; |
115 | 0 | } |
116 | | |
117 | | bool SwLabItem::operator ==(const SfxPoolItem& rItem) const |
118 | 0 | { |
119 | 0 | assert(SfxPoolItem::operator==(rItem)); |
120 | 0 | const SwLabItem& rLab = static_cast<const SwLabItem&>( rItem); |
121 | |
|
122 | 0 | return m_bAddr == rLab.m_bAddr && |
123 | 0 | m_bCont == rLab.m_bCont && |
124 | 0 | m_bPage == rLab.m_bPage && |
125 | 0 | m_bSynchron == rLab.m_bSynchron && |
126 | 0 | m_nCol == rLab.m_nCol && |
127 | 0 | m_nRow == rLab.m_nRow && |
128 | 0 | m_lHDist == rLab.m_lHDist && |
129 | 0 | m_lVDist == rLab.m_lVDist && |
130 | 0 | m_lWidth == rLab.m_lWidth && |
131 | 0 | m_lHeight == rLab.m_lHeight && |
132 | 0 | m_lLeft == rLab.m_lLeft && |
133 | 0 | m_lUpper == rLab.m_lUpper && |
134 | 0 | m_nCols == rLab.m_nCols && |
135 | 0 | m_nRows == rLab.m_nRows && |
136 | 0 | m_lPWidth == rLab.m_lPWidth && |
137 | 0 | m_lPHeight == rLab.m_lPHeight&& |
138 | 0 | m_aWriting == rLab.m_aWriting&& |
139 | 0 | m_aMake == rLab.m_aMake && |
140 | 0 | m_aType == rLab.m_aType && |
141 | 0 | m_aLstMake == rLab.m_aLstMake&& |
142 | 0 | m_aLstType == rLab.m_aLstType&& |
143 | 0 | m_sDBName == rLab.m_sDBName && |
144 | 0 | m_aPrivFirstName == rLab.m_aPrivFirstName&& |
145 | 0 | m_aPrivName == rLab.m_aPrivName&& |
146 | 0 | m_aPrivShortCut == rLab.m_aPrivShortCut&& |
147 | 0 | m_aPrivFirstName2 == rLab.m_aPrivFirstName2&& |
148 | 0 | m_aPrivName2 == rLab.m_aPrivName2&& |
149 | 0 | m_aPrivShortCut2 == rLab.m_aPrivShortCut2&& |
150 | 0 | m_aPrivStreet == rLab.m_aPrivStreet&& |
151 | 0 | m_aPrivZip == rLab.m_aPrivZip&& |
152 | 0 | m_aPrivCity == rLab.m_aPrivCity&& |
153 | 0 | m_aPrivCountry == rLab.m_aPrivCountry&& |
154 | 0 | m_aPrivState == rLab.m_aPrivState&& |
155 | 0 | m_aPrivTitle == rLab.m_aPrivTitle&& |
156 | 0 | m_aPrivProfession == rLab.m_aPrivProfession&& |
157 | 0 | m_aPrivPhone == rLab.m_aPrivPhone&& |
158 | 0 | m_aPrivMobile == rLab.m_aPrivMobile&& |
159 | 0 | m_aPrivFax == rLab.m_aPrivFax&& |
160 | 0 | m_aPrivWWW == rLab.m_aPrivWWW&& |
161 | 0 | m_aPrivMail == rLab.m_aPrivMail&& |
162 | 0 | m_aCompCompany == rLab.m_aCompCompany&& |
163 | 0 | m_aCompCompanyExt == rLab.m_aCompCompanyExt&& |
164 | 0 | m_aCompSlogan == rLab.m_aCompSlogan&& |
165 | 0 | m_aCompStreet == rLab.m_aCompStreet&& |
166 | 0 | m_aCompZip == rLab.m_aCompZip&& |
167 | 0 | m_aCompCity == rLab.m_aCompCity&& |
168 | 0 | m_aCompCountry == rLab.m_aCompCountry&& |
169 | 0 | m_aCompState == rLab.m_aCompState&& |
170 | 0 | m_aCompPosition == rLab.m_aCompPosition&& |
171 | 0 | m_aCompPhone == rLab.m_aCompPhone&& |
172 | 0 | m_aCompMobile == rLab.m_aCompMobile&& |
173 | 0 | m_aCompFax == rLab.m_aCompFax&& |
174 | 0 | m_aCompWWW == rLab.m_aCompWWW&& |
175 | 0 | m_aCompMail == rLab.m_aCompMail && |
176 | 0 | m_sGlossaryGroup == rLab.m_sGlossaryGroup && |
177 | 0 | m_sGlossaryBlockName == rLab.m_sGlossaryBlockName; |
178 | 0 | } |
179 | | |
180 | | SwLabItem* SwLabItem::Clone(SfxItemPool*) const |
181 | 0 | { |
182 | 0 | return new SwLabItem(*this); |
183 | 0 | } |
184 | | |
185 | | Sequence<OUString> SwLabCfgItem::GetPropertyNames() const |
186 | 0 | { |
187 | 0 | static const char* const aLabelPropNames[] = |
188 | 0 | { |
189 | 0 | "Medium/Continuous", // 0 |
190 | 0 | "Medium/Brand", // 1 |
191 | 0 | "Medium/Type", // 2 |
192 | 0 | "Format/Column", // 3 |
193 | 0 | "Format/Row", // 4 |
194 | 0 | "Format/HorizontalDistance",// 5 |
195 | 0 | "Format/VerticalDistance", // 6 |
196 | 0 | "Format/Width", // 7 |
197 | 0 | "Format/Height", // 8 |
198 | 0 | "Format/LeftMargin", // 9 |
199 | 0 | "Format/TopMargin", //10 |
200 | 0 | "Format/PageWidth", //11 |
201 | 0 | "Format/PageHeight", //12 |
202 | 0 | "Option/Synchronize", //13 |
203 | 0 | "Option/Page", //14 |
204 | 0 | "Option/Column", //15 |
205 | 0 | "Option/Row", //16 |
206 | 0 | "Inscription/UseAddress", //17 |
207 | 0 | "Inscription/Address", //18 |
208 | 0 | "Inscription/Database" //19 |
209 | 0 | }; |
210 | 0 | static const char* const aBusinessPropNames[] = |
211 | 0 | { |
212 | 0 | "PrivateAddress/FirstName", // 0 |
213 | 0 | "PrivateAddress/Name", // 1 |
214 | 0 | "PrivateAddress/ShortCut", // 2 |
215 | 0 | "PrivateAddress/SecondFirstName", // 3 |
216 | 0 | "PrivateAddress/SecondName", // 4 |
217 | 0 | "PrivateAddress/SecondShortCut", // 5 |
218 | 0 | "PrivateAddress/Street", // 6 |
219 | 0 | "PrivateAddress/Zip", // 7 |
220 | 0 | "PrivateAddress/City", // 8 |
221 | 0 | "PrivateAddress/Country", // 9 |
222 | 0 | "PrivateAddress/State", // 10 |
223 | 0 | "PrivateAddress/Title", // 11 |
224 | 0 | "PrivateAddress/Profession", // 12 |
225 | 0 | "PrivateAddress/Phone", // 13 |
226 | 0 | "PrivateAddress/Mobile", // 14 |
227 | 0 | "PrivateAddress/Fax", // 15 |
228 | 0 | "PrivateAddress/WebAddress", // 16 |
229 | 0 | "PrivateAddress/Email", // 17 |
230 | 0 | "BusinessAddress/Company", // 18 |
231 | 0 | "BusinessAddress/CompanyExt", // 19 |
232 | 0 | "BusinessAddress/Slogan", // 20 |
233 | 0 | "BusinessAddress/Street", // 21 |
234 | 0 | "BusinessAddress/Zip", // 22 |
235 | 0 | "BusinessAddress/City", // 23 |
236 | 0 | "BusinessAddress/Country", // 24 |
237 | 0 | "BusinessAddress/State", // 25 |
238 | 0 | "BusinessAddress/Position", // 26 |
239 | 0 | "BusinessAddress/Phone", // 27 |
240 | 0 | "BusinessAddress/Mobile", // 28 |
241 | 0 | "BusinessAddress/Fax", // 29 |
242 | 0 | "BusinessAddress/WebAddress", // 30 |
243 | 0 | "BusinessAddress/Email", // 31 |
244 | 0 | "AutoText/Group", // 32 |
245 | 0 | "AutoText/Block" // 33 |
246 | 0 | }; |
247 | 0 | const int nBusinessCount = m_bIsLabel ? 0 : 34; |
248 | 0 | const int nLabelCount = m_bIsLabel ? 20 : 17; |
249 | 0 | Sequence<OUString> aNames(nBusinessCount + nLabelCount); |
250 | 0 | OUString* pNames = aNames.getArray(); |
251 | 0 | int nIndex = 0; |
252 | 0 | for(int nLabel = 0; nLabel < nLabelCount; nLabel++) |
253 | 0 | pNames[nIndex++] = OUString::createFromAscii(aLabelPropNames[nLabel]); |
254 | 0 | for(int nBusiness = 0; nBusiness < nBusinessCount; nBusiness++) |
255 | 0 | pNames[nIndex++] = OUString::createFromAscii(aBusinessPropNames[nBusiness]); |
256 | 0 | return aNames; |
257 | 0 | } |
258 | | |
259 | | SwLabCfgItem::SwLabCfgItem(bool bLabel) : |
260 | 0 | ConfigItem(bLabel ? u"Office.Writer/Label"_ustr : u"Office.Writer/BusinessCard"_ustr), |
261 | 0 | m_bIsLabel(bLabel) |
262 | 0 | { |
263 | 0 | Sequence<OUString> aNames = GetPropertyNames(); |
264 | 0 | Sequence<Any> aValues = GetProperties(aNames); |
265 | 0 | EnableNotification(aNames); |
266 | 0 | const Any* pValues = aValues.getConstArray(); |
267 | 0 | OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); |
268 | 0 | bool bNoConfigValues = true; |
269 | 0 | if(aValues.getLength() == aNames.getLength()) |
270 | 0 | { |
271 | 0 | for(int nProp = 0, nProperty = 0; nProp < aNames.getLength(); nProp++, nProperty++) |
272 | 0 | { |
273 | |
|
274 | 0 | if(pValues[nProp].hasValue()) |
275 | 0 | { |
276 | | //to have a continuous switch an offset is added |
277 | 0 | if(nProp == 17 && !m_bIsLabel) |
278 | 0 | nProperty += 3; |
279 | 0 | if(nProperty >= 20) |
280 | 0 | bNoConfigValues = false; |
281 | 0 | switch(nProperty) |
282 | 0 | { |
283 | 0 | case 0: m_aItem.m_bCont = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Medium/Continuous", |
284 | 0 | case 1: pValues[nProp] >>= m_aItem.m_aMake; break;// "Medium/Brand", |
285 | 0 | case 2: pValues[nProp] >>= m_aItem.m_aType; break;// "Medium/Type", |
286 | 0 | case 3: pValues[nProp] >>= m_aItem.m_nCols; break;// "Format/Column", |
287 | 0 | case 4: pValues[nProp] >>= m_aItem.m_nRows; break;// "Format/Row", |
288 | 0 | case 5: |
289 | 0 | pValues[nProp] >>= m_aItem.m_lHDist; |
290 | 0 | m_aItem.m_lHDist = o3tl::toTwips(m_aItem.m_lHDist, o3tl::Length::mm100); |
291 | 0 | break;// "Format/HorizontalDistance", |
292 | 0 | case 6: |
293 | 0 | pValues[nProp] >>= m_aItem.m_lVDist; |
294 | 0 | m_aItem.m_lVDist = o3tl::toTwips(m_aItem.m_lVDist, o3tl::Length::mm100); |
295 | 0 | break;// "Format/VerticalDistance", |
296 | 0 | case 7: |
297 | 0 | pValues[nProp] >>= m_aItem.m_lWidth; |
298 | 0 | m_aItem.m_lWidth = o3tl::toTwips(m_aItem.m_lWidth, o3tl::Length::mm100); |
299 | 0 | break;// "Format/Width", |
300 | 0 | case 8: |
301 | 0 | pValues[nProp] >>= m_aItem.m_lHeight; |
302 | 0 | m_aItem.m_lHeight = o3tl::toTwips(m_aItem.m_lHeight, o3tl::Length::mm100); |
303 | 0 | break;// "Format/Height", |
304 | 0 | case 9: |
305 | 0 | pValues[nProp] >>= m_aItem.m_lLeft; |
306 | 0 | m_aItem.m_lLeft = o3tl::toTwips(m_aItem.m_lLeft, o3tl::Length::mm100); |
307 | 0 | break;// "Format/LeftMargin", |
308 | 0 | case 10: |
309 | 0 | pValues[nProp] >>= m_aItem.m_lUpper; |
310 | 0 | m_aItem.m_lUpper = o3tl::toTwips(m_aItem.m_lUpper, o3tl::Length::mm100); |
311 | 0 | break;// "Format/TopMargin", |
312 | 0 | case 11: |
313 | 0 | pValues[nProp] >>= m_aItem.m_lPWidth; |
314 | 0 | m_aItem.m_lPWidth = o3tl::toTwips(m_aItem.m_lPWidth, o3tl::Length::mm100); |
315 | 0 | break;// "Format/PageWidth", |
316 | 0 | case 12: |
317 | 0 | pValues[nProp] >>= m_aItem.m_lPHeight; |
318 | 0 | m_aItem.m_lPHeight = o3tl::toTwips(m_aItem.m_lPHeight, o3tl::Length::mm100); |
319 | 0 | break;// "Format/PageHeight", |
320 | 0 | case 13: m_aItem.m_bSynchron = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Option/Synchronize", |
321 | 0 | case 14: m_aItem.m_bPage = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Option/Page", |
322 | 0 | case 15: pValues[nProp] >>= m_aItem.m_nCol; break;// "Option/Column", |
323 | 0 | case 16: pValues[nProp] >>= m_aItem.m_nRow; break;// "Option/Row" |
324 | 0 | case 17: m_aItem.m_bAddr = *o3tl::doAccess<bool>(pValues[nProp]); break;// "Inscription/UseAddress", |
325 | 0 | case 18: pValues[nProp] >>= m_aItem.m_aWriting; break;// "Inscription/Address", |
326 | 0 | case 19: pValues[nProp] >>= m_aItem.m_sDBName; break;// "Inscription/Database" |
327 | 0 | case 20: pValues[nProp] >>= m_aItem.m_aPrivFirstName; break;// "PrivateAddress/FirstName", |
328 | 0 | case 21: pValues[nProp] >>= m_aItem.m_aPrivName; break;// "PrivateAddress/Name", |
329 | 0 | case 22: pValues[nProp] >>= m_aItem.m_aPrivShortCut; break;// "PrivateAddress/ShortCut", |
330 | 0 | case 23: pValues[nProp] >>= m_aItem.m_aPrivFirstName2; break;// "PrivateAddress/SecondFirstName", |
331 | 0 | case 24: pValues[nProp] >>= m_aItem.m_aPrivName2; break;// "PrivateAddress/SecondName", |
332 | 0 | case 25: pValues[nProp] >>= m_aItem.m_aPrivShortCut2; break;// "PrivateAddress/SecondShortCut", |
333 | 0 | case 26: pValues[nProp] >>= m_aItem.m_aPrivStreet; break;// "PrivateAddress/Street", |
334 | 0 | case 27: pValues[nProp] >>= m_aItem.m_aPrivZip; break;// "PrivateAddress/Zip", |
335 | 0 | case 28: pValues[nProp] >>= m_aItem.m_aPrivCity; break;// "PrivateAddress/City", |
336 | 0 | case 29: pValues[nProp] >>= m_aItem.m_aPrivCountry; break;// "PrivateAddress/Country", |
337 | 0 | case 30: pValues[nProp] >>= m_aItem.m_aPrivState; break;// "PrivateAddress/State", |
338 | 0 | case 31: pValues[nProp] >>= m_aItem.m_aPrivTitle; break;// "PrivateAddress/Title", |
339 | 0 | case 32: pValues[nProp] >>= m_aItem.m_aPrivProfession; break;// "PrivateAddress/Profession", |
340 | 0 | case 33: pValues[nProp] >>= m_aItem.m_aPrivPhone; break;// "PrivateAddress/Phone", |
341 | 0 | case 34: pValues[nProp] >>= m_aItem.m_aPrivMobile; break;// "PrivateAddress/Mobile", |
342 | 0 | case 35: pValues[nProp] >>= m_aItem.m_aPrivFax; break;// "PrivateAddress/Fax", |
343 | 0 | case 36: pValues[nProp] >>= m_aItem.m_aPrivWWW; break;// "PrivateAddress/WebAddress", |
344 | 0 | case 37: pValues[nProp] >>= m_aItem.m_aPrivMail; break;// "PrivateAddress/Email", |
345 | 0 | case 38: pValues[nProp] >>= m_aItem.m_aCompCompany; break;// "BusinessAddress/Company", |
346 | 0 | case 39: pValues[nProp] >>= m_aItem.m_aCompCompanyExt; break;// "BusinessAddress/CompanyExt", |
347 | 0 | case 40: pValues[nProp] >>= m_aItem.m_aCompSlogan; break;// "BusinessAddress/Slogan", |
348 | 0 | case 41: pValues[nProp] >>= m_aItem.m_aCompStreet; break;// "BusinessAddress/Street", |
349 | 0 | case 42: pValues[nProp] >>= m_aItem.m_aCompZip; break;// "BusinessAddress/Zip", |
350 | 0 | case 43: pValues[nProp] >>= m_aItem.m_aCompCity; break;// "BusinessAddress/City", |
351 | 0 | case 44: pValues[nProp] >>= m_aItem.m_aCompCountry; break;// "BusinessAddress/Country", |
352 | 0 | case 45: pValues[nProp] >>= m_aItem.m_aCompState; break;// "BusinessAddress/State", |
353 | 0 | case 46: pValues[nProp] >>= m_aItem.m_aCompPosition; break;// "BusinessAddress/Position", |
354 | 0 | case 47: pValues[nProp] >>= m_aItem.m_aCompPhone; break;// "BusinessAddress/Phone", |
355 | 0 | case 48: pValues[nProp] >>= m_aItem.m_aCompMobile; break;// "BusinessAddress/Mobile", |
356 | 0 | case 49: pValues[nProp] >>= m_aItem.m_aCompFax; break;// "BusinessAddress/Fax", |
357 | 0 | case 50: pValues[nProp] >>= m_aItem.m_aCompWWW; break;// "BusinessAddress/WebAddress", |
358 | 0 | case 51: pValues[nProp] >>= m_aItem.m_aCompMail; break;// "BusinessAddress/Email", |
359 | 0 | case 52: pValues[nProp] >>= m_aItem.m_sGlossaryGroup; break;// "AutoText/Group" |
360 | 0 | case 53: pValues[nProp] >>= m_aItem.m_sGlossaryBlockName; break;// "AutoText/Block" |
361 | 0 | } |
362 | 0 | } |
363 | 0 | } |
364 | 0 | } |
365 | | |
366 | 0 | if(m_bIsLabel || !bNoConfigValues) |
367 | 0 | return; |
368 | | |
369 | 0 | SvtUserOptions& rUserOpt = SwModule::get()->GetUserOptions(); |
370 | 0 | m_aItem.m_aPrivFirstName = rUserOpt.GetFirstName(); |
371 | 0 | m_aItem.m_aPrivName = rUserOpt.GetLastName(); |
372 | 0 | m_aItem.m_aPrivShortCut = rUserOpt.GetID(); |
373 | 0 | m_aItem.m_aCompCompany = rUserOpt.GetCompany(); |
374 | 0 | m_aItem.m_aCompStreet = m_aItem.m_aPrivStreet = rUserOpt.GetStreet(); |
375 | |
|
376 | 0 | m_aItem.m_aCompCountry = m_aItem.m_aPrivCountry = rUserOpt.GetCountry(); |
377 | 0 | m_aItem.m_aCompZip = m_aItem.m_aPrivZip= rUserOpt.GetZip(); |
378 | 0 | m_aItem.m_aCompCity = m_aItem.m_aPrivCity = rUserOpt.GetCity(); |
379 | 0 | m_aItem.m_aPrivTitle = rUserOpt.GetTitle(); |
380 | 0 | m_aItem.m_aCompPosition = rUserOpt.GetPosition(); |
381 | 0 | m_aItem.m_aPrivPhone = rUserOpt.GetTelephoneHome(); |
382 | 0 | m_aItem.m_aCompPhone = rUserOpt.GetTelephoneWork(); |
383 | 0 | m_aItem.m_aCompFax = m_aItem.m_aPrivFax = rUserOpt.GetFax(); |
384 | 0 | m_aItem.m_aCompMail = m_aItem.m_aPrivMail = rUserOpt.GetEmail(); |
385 | 0 | m_aItem.m_aCompState = m_aItem.m_aPrivState = rUserOpt.GetState(); |
386 | 0 | m_aItem.m_bSynchron = true; |
387 | 0 | SetModified(); |
388 | |
|
389 | 0 | } |
390 | | |
391 | 0 | void SwLabCfgItem::Notify( const css::uno::Sequence< OUString >& ) {} |
392 | | |
393 | | void SwLabCfgItem::ImplCommit() |
394 | 0 | { |
395 | 0 | Sequence<OUString> aNames = GetPropertyNames(); |
396 | 0 | Sequence<Any> aValues(aNames.getLength()); |
397 | 0 | Any* pValues = aValues.getArray(); |
398 | |
|
399 | 0 | for(int nProp = 0, nProperty = 0; nProp < aNames.getLength(); nProp++, nProperty++) |
400 | 0 | { |
401 | | //to have a continuous switch an offset is added |
402 | 0 | if(nProp == 17 && !m_bIsLabel) |
403 | 0 | nProperty += 3; |
404 | 0 | switch(nProperty) |
405 | 0 | { |
406 | 0 | case 0: pValues[nProp] <<= m_aItem.m_bCont; break;// "Medium/Continuous", |
407 | 0 | case 1: pValues[nProp] <<= m_aItem.m_aMake; break;// "Medium/Brand", |
408 | 0 | case 2: pValues[nProp] <<= m_aItem.m_aType; break;// "Medium/Type", |
409 | 0 | case 3: pValues[nProp] <<= m_aItem.m_nCols; break;// "Format/Column", |
410 | 0 | case 4: pValues[nProp] <<= m_aItem.m_nRows; break;// "Format/Row", |
411 | 0 | case 5: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lHDist));break;// "Format/HorizontalDistance", |
412 | 0 | case 6: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lVDist));break;// "Format/VerticalDistance", |
413 | 0 | case 7: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lWidth)); break;// "Format/Width", |
414 | 0 | case 8: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lHeight)); break;// "Format/Height", |
415 | 0 | case 9: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lLeft)); break;// "Format/LeftMargin", |
416 | 0 | case 10: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lUpper)); break;// "Format/TopMargin", |
417 | 0 | case 11: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lPWidth)); break;// "Format/Page Width", |
418 | 0 | case 12: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(m_aItem.m_lPHeight)); break;// "Format/PageHeight", |
419 | 0 | case 13: pValues[nProp] <<= m_aItem.m_bSynchron; break;// "Option/Synchronize", |
420 | 0 | case 14: pValues[nProp] <<= m_aItem.m_bPage; break;// "Option/Page", |
421 | 0 | case 15: pValues[nProp] <<= m_aItem.m_nCol; break;// "Option/Column", |
422 | 0 | case 16: pValues[nProp] <<= m_aItem.m_nRow; break;// "Option/Row" |
423 | 0 | case 17: pValues[nProp] <<= m_aItem.m_bAddr; break;// "Inscription/UseAddress", |
424 | 0 | case 18: pValues[nProp] <<= m_aItem.m_aWriting; break;// "Inscription/Address", |
425 | 0 | case 19: pValues[nProp] <<= m_aItem.m_sDBName; break;// "Inscription/Database" |
426 | 0 | case 20: pValues[nProp] <<= m_aItem.m_aPrivFirstName; break;// "PrivateAddress/FirstName", |
427 | 0 | case 21: pValues[nProp] <<= m_aItem.m_aPrivName; break;// "PrivateAddress/Name", |
428 | 0 | case 22: pValues[nProp] <<= m_aItem.m_aPrivShortCut; break;// "PrivateAddress/ShortCut", |
429 | 0 | case 23: pValues[nProp] <<= m_aItem.m_aPrivFirstName2; break;// "PrivateAddress/SecondFirstName", |
430 | 0 | case 24: pValues[nProp] <<= m_aItem.m_aPrivName2; break;// "PrivateAddress/SecondName", |
431 | 0 | case 25: pValues[nProp] <<= m_aItem.m_aPrivShortCut2; break;// "PrivateAddress/SecondShortCut", |
432 | 0 | case 26: pValues[nProp] <<= m_aItem.m_aPrivStreet; break;// "PrivateAddress/Street", |
433 | 0 | case 27: pValues[nProp] <<= m_aItem.m_aPrivZip; break;// "PrivateAddress/Zip", |
434 | 0 | case 28: pValues[nProp] <<= m_aItem.m_aPrivCity; break;// "PrivateAddress/City", |
435 | 0 | case 29: pValues[nProp] <<= m_aItem.m_aPrivCountry; break;// "PrivateAddress/Country", |
436 | 0 | case 30: pValues[nProp] <<= m_aItem.m_aPrivState; break;// "PrivateAddress/State", |
437 | 0 | case 31: pValues[nProp] <<= m_aItem.m_aPrivTitle; break;// "PrivateAddress/Title", |
438 | 0 | case 32: pValues[nProp] <<= m_aItem.m_aPrivProfession; break;// "PrivateAddress/Profession", |
439 | 0 | case 33: pValues[nProp] <<= m_aItem.m_aPrivPhone; break;// "PrivateAddress/Phone", |
440 | 0 | case 34: pValues[nProp] <<= m_aItem.m_aPrivMobile; break;// "PrivateAddress/Mobile", |
441 | 0 | case 35: pValues[nProp] <<= m_aItem.m_aPrivFax; break;// "PrivateAddress/Fax", |
442 | 0 | case 36: pValues[nProp] <<= m_aItem.m_aPrivWWW; break;// "PrivateAddress/WebAddress", |
443 | 0 | case 37: pValues[nProp] <<= m_aItem.m_aPrivMail; break;// "PrivateAddress/Email", |
444 | 0 | case 38: pValues[nProp] <<= m_aItem.m_aCompCompany; break;// "BusinessAddress/Company", |
445 | 0 | case 39: pValues[nProp] <<= m_aItem.m_aCompCompanyExt; break;// "BusinessAddress/CompanyExt", |
446 | 0 | case 40: pValues[nProp] <<= m_aItem.m_aCompSlogan; break;// "BusinessAddress/Slogan", |
447 | 0 | case 41: pValues[nProp] <<= m_aItem.m_aCompStreet; break;// "BusinessAddress/Street", |
448 | 0 | case 42: pValues[nProp] <<= m_aItem.m_aCompZip; break;// "BusinessAddress/Zip", |
449 | 0 | case 43: pValues[nProp] <<= m_aItem.m_aCompCity; break;// "BusinessAddress/City", |
450 | 0 | case 44: pValues[nProp] <<= m_aItem.m_aCompCountry; break;// "BusinessAddress/Country", |
451 | 0 | case 45: pValues[nProp] <<= m_aItem.m_aCompState; break;// "BusinessAddress/State", |
452 | 0 | case 46: pValues[nProp] <<= m_aItem.m_aCompPosition; break;// "BusinessAddress/Position", |
453 | 0 | case 47: pValues[nProp] <<= m_aItem.m_aCompPhone; break;// "BusinessAddress/Phone", |
454 | 0 | case 48: pValues[nProp] <<= m_aItem.m_aCompMobile; break;// "BusinessAddress/Mobile", |
455 | 0 | case 49: pValues[nProp] <<= m_aItem.m_aCompFax; break;// "BusinessAddress/Fax", |
456 | 0 | case 50: pValues[nProp] <<= m_aItem.m_aCompWWW; break;// "BusinessAddress/WebAddress", |
457 | 0 | case 51: pValues[nProp] <<= m_aItem.m_aCompMail; break;// "BusinessAddress/Email", |
458 | 0 | case 52: pValues[nProp] <<= m_aItem.m_sGlossaryGroup; break;// "AutoText/Group" |
459 | 0 | case 53: pValues[nProp] <<= m_aItem.m_sGlossaryBlockName; break;// "AutoText/Block" |
460 | 0 | } |
461 | 0 | } |
462 | 0 | PutProperties(aNames, aValues); |
463 | 0 | } |
464 | | |
465 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |