Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <tools/stream.hxx>
30 : : #include <tools/resid.hxx>
31 : : #include <com/sun/star/uno/Any.hxx>
32 : : #include <com/sun/star/uno/Sequence.hxx>
33 : : #include <unotools/useroptions.hxx>
34 : : #include <tools/shl.hxx>
35 : : #include <swmodule.hxx>
36 : : #include "labimg.hxx"
37 : : #include "cmdid.h"
38 : : #include "swtypes.hxx"
39 : : #include <unomid.h>
40 : :
41 : : using namespace utl;
42 : : using namespace ::com::sun::star::uno;
43 : :
44 : : using ::rtl::OUString;
45 : :
46 : 0 : SwLabItem::SwLabItem() :
47 : :
48 : : SfxPoolItem(FN_LABEL),
49 : : lLeft (0),
50 : : lUpper(0),
51 : : nCols (1),
52 : : nRows (1),
53 : : nCol (1),
54 : 0 : nRow (1)
55 : : {
56 : : bAddr =
57 : : bCont =
58 : 0 : bSynchron = sal_False;
59 : 0 : bPage = sal_True;
60 : : lHDist =
61 : : lVDist =
62 : : lWidth =
63 : : lHeight =
64 : : lPWidth =
65 : 0 : lPHeight = 5669; // 10 cm
66 : 0 : }
67 : :
68 : 0 : SwLabItem::SwLabItem(const SwLabItem& rItem) :
69 : 0 : SfxPoolItem(FN_LABEL)
70 : : {
71 [ # # ]: 0 : *this = rItem;
72 : 0 : }
73 : :
74 : 0 : SwLabItem& SwLabItem::operator =(const SwLabItem& rItem)
75 : : {
76 : 0 : bAddr = rItem.bAddr;
77 : 0 : aWriting = rItem.aWriting;
78 : 0 : bCont = rItem.bCont;
79 : 0 : sDBName = rItem.sDBName;
80 : 0 : aLstMake = rItem.aLstMake;
81 : 0 : aLstType = rItem.aLstType;
82 : 0 : aMake = rItem.aMake;
83 : 0 : aType = rItem.aType;
84 : 0 : bPage = rItem.bPage;
85 : 0 : bSynchron = rItem.bSynchron;
86 : 0 : aBin = rItem.aBin;
87 : 0 : nCol = rItem.nCol;
88 : 0 : nRow = rItem.nRow;
89 : 0 : lHDist = rItem.lHDist;
90 : 0 : lVDist = rItem.lVDist;
91 : 0 : lWidth = rItem.lWidth;
92 : 0 : lHeight = rItem.lHeight;
93 : 0 : lLeft = rItem.lLeft;
94 : 0 : lUpper = rItem.lUpper;
95 : 0 : nCols = rItem.nCols;
96 : 0 : nRows = rItem.nRows;
97 : 0 : lPWidth = rItem.lPWidth;
98 : 0 : lPHeight = rItem.lPHeight;
99 : 0 : aPrivFirstName = rItem.aPrivFirstName;
100 : 0 : aPrivName = rItem.aPrivName;
101 : 0 : aPrivShortCut = rItem.aPrivShortCut;
102 : 0 : aPrivFirstName2 = rItem.aPrivFirstName2;
103 : 0 : aPrivName2 = rItem.aPrivName2;
104 : 0 : aPrivShortCut2 = rItem.aPrivShortCut2;
105 : 0 : aPrivStreet = rItem.aPrivStreet;
106 : 0 : aPrivZip = rItem.aPrivZip;
107 : 0 : aPrivCity = rItem.aPrivCity;
108 : 0 : aPrivCountry = rItem.aPrivCountry;
109 : 0 : aPrivState = rItem.aPrivState;
110 : 0 : aPrivTitle = rItem.aPrivTitle;
111 : 0 : aPrivProfession = rItem.aPrivProfession;
112 : 0 : aPrivPhone = rItem.aPrivPhone;
113 : 0 : aPrivMobile = rItem.aPrivMobile;
114 : 0 : aPrivFax = rItem.aPrivFax;
115 : 0 : aPrivWWW = rItem.aPrivWWW;
116 : 0 : aPrivMail = rItem.aPrivMail;
117 : 0 : aCompCompany = rItem.aCompCompany;
118 : 0 : aCompCompanyExt = rItem.aCompCompanyExt;
119 : 0 : aCompSlogan = rItem.aCompSlogan;
120 : 0 : aCompStreet = rItem.aCompStreet;
121 : 0 : aCompZip = rItem.aCompZip;
122 : 0 : aCompCity = rItem.aCompCity;
123 : 0 : aCompCountry = rItem.aCompCountry;
124 : 0 : aCompState = rItem.aCompState;
125 : 0 : aCompPosition = rItem.aCompPosition;
126 : 0 : aCompPhone = rItem.aCompPhone;
127 : 0 : aCompMobile = rItem.aCompMobile;
128 : 0 : aCompFax = rItem.aCompFax;
129 : 0 : aCompWWW = rItem.aCompWWW;
130 : 0 : aCompMail = rItem.aCompMail;
131 : 0 : sGlossaryGroup = rItem.sGlossaryGroup;
132 : 0 : sGlossaryBlockName = rItem.sGlossaryBlockName;
133 : 0 : return *this;
134 : : }
135 : :
136 : 0 : int SwLabItem::operator ==(const SfxPoolItem& rItem) const
137 : : {
138 : 0 : const SwLabItem& rLab = (const SwLabItem&) rItem;
139 : :
140 : : return bAddr == rLab.bAddr &&
141 : : bCont == rLab.bCont &&
142 : : bPage == rLab.bPage &&
143 : : bSynchron == rLab.bSynchron &&
144 : 0 : aBin == rLab.aBin &&
145 : : nCol == rLab.nCol &&
146 : : nRow == rLab.nRow &&
147 : : lHDist == rLab.lHDist &&
148 : : lVDist == rLab.lVDist &&
149 : : lWidth == rLab.lWidth &&
150 : : lHeight == rLab.lHeight &&
151 : : lLeft == rLab.lLeft &&
152 : : lUpper == rLab.lUpper &&
153 : : nCols == rLab.nCols &&
154 : : nRows == rLab.nRows &&
155 : : lPWidth == rLab.lPWidth &&
156 : : lPHeight == rLab.lPHeight&&
157 : 0 : aWriting == rLab.aWriting&&
158 : 0 : aMake == rLab.aMake &&
159 : 0 : aType == rLab.aType &&
160 : 0 : aLstMake == rLab.aLstMake&&
161 : 0 : aLstType == rLab.aLstType&&
162 : 0 : sDBName == rLab.sDBName &&
163 : 0 : aPrivFirstName == rLab.aPrivFirstName&&
164 : 0 : aPrivName == rLab.aPrivName&&
165 : 0 : aPrivShortCut == rLab.aPrivShortCut&&
166 : 0 : aPrivFirstName2 == rLab.aPrivFirstName2&&
167 : 0 : aPrivName2 == rLab.aPrivName2&&
168 : 0 : aPrivShortCut2 == rLab.aPrivShortCut2&&
169 : 0 : aPrivStreet == rLab.aPrivStreet&&
170 : 0 : aPrivZip == rLab.aPrivZip&&
171 : 0 : aPrivCity == rLab.aPrivCity&&
172 : 0 : aPrivCountry == rLab.aPrivCountry&&
173 : 0 : aPrivState == rLab.aPrivState&&
174 : 0 : aPrivTitle == rLab.aPrivTitle&&
175 : 0 : aPrivProfession == rLab.aPrivProfession&&
176 : 0 : aPrivPhone == rLab.aPrivPhone&&
177 : 0 : aPrivMobile == rLab.aPrivMobile&&
178 : 0 : aPrivFax == rLab.aPrivFax&&
179 : 0 : aPrivWWW == rLab.aPrivWWW&&
180 : 0 : aPrivMail == rLab.aPrivMail&&
181 : 0 : aCompCompany == rLab.aCompCompany&&
182 : 0 : aCompCompanyExt == rLab.aCompCompanyExt&&
183 : 0 : aCompSlogan == rLab.aCompSlogan&&
184 : 0 : aCompStreet == rLab.aCompStreet&&
185 : 0 : aCompZip == rLab.aCompZip&&
186 : 0 : aCompCity == rLab.aCompCity&&
187 : 0 : aCompCountry == rLab.aCompCountry&&
188 : 0 : aCompState == rLab.aCompState&&
189 : 0 : aCompPosition == rLab.aCompPosition&&
190 : 0 : aCompPhone == rLab.aCompPhone&&
191 : 0 : aCompMobile == rLab.aCompMobile&&
192 : 0 : aCompFax == rLab.aCompFax&&
193 : 0 : aCompWWW == rLab.aCompWWW&&
194 : 0 : aCompMail == rLab.aCompMail &&
195 : 0 : sGlossaryGroup == rLab.sGlossaryGroup &&
196 [ # # ][ # # ]: 0 : sGlossaryBlockName == rLab.sGlossaryBlockName;
[ # # ]
[ # # # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # ]
[ # # ]
197 : : }
198 : :
199 : 0 : SfxPoolItem* SwLabItem::Clone(SfxItemPool*) const
200 : : {
201 [ # # ]: 0 : return new SwLabItem(*this);
202 : : }
203 : :
204 : 0 : Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames()
205 : : {
206 : : static const char* aLabelPropNames[] =
207 : : {
208 : : "Medium/Continous", // 0
209 : : "Medium/Brand", // 1
210 : : "Medium/Type", // 2
211 : : "Format/Column", // 3
212 : : "Format/Row", // 4
213 : : "Format/HorizontalDistance",// 5
214 : : "Format/VerticalDistance", // 6
215 : : "Format/Width", // 7
216 : : "Format/Height", // 8
217 : : "Format/LeftMargin", // 9
218 : : "Format/TopMargin", //10
219 : : "Format/PageWidth", //11
220 : : "Format/PageHeight", //12
221 : : "Option/Synchronize", //13
222 : : "Option/Page", //14
223 : : "Option/Column", //15
224 : : "Option/Row", //16
225 : : "Inscription/UseAddress", //17
226 : : "Inscription/Address", //18
227 : : "Inscription/Database" //19
228 : : };
229 : : static const char* aBusinessPropNames[] =
230 : : {
231 : : "PrivateAddress/FirstName", // 0
232 : : "PrivateAddress/Name", // 1
233 : : "PrivateAddress/ShortCut", // 2
234 : : "PrivateAddress/SecondFirstName", // 3
235 : : "PrivateAddress/SecondName", // 4
236 : : "PrivateAddress/SecondShortCut", // 5
237 : : "PrivateAddress/Street", // 6
238 : : "PrivateAddress/Zip", // 7
239 : : "PrivateAddress/City", // 8
240 : : "PrivateAddress/Country", // 9
241 : : "PrivateAddress/State", // 10
242 : : "PrivateAddress/Title", // 11
243 : : "PrivateAddress/Profession", // 12
244 : : "PrivateAddress/Phone", // 13
245 : : "PrivateAddress/Mobile", // 14
246 : : "PrivateAddress/Fax", // 15
247 : : "PrivateAddress/WebAddress", // 16
248 : : "PrivateAddress/Email", // 17
249 : : "BusinessAddress/Company", // 18
250 : : "BusinessAddress/CompanyExt", // 19
251 : : "BusinessAddress/Slogan", // 20
252 : : "BusinessAddress/Street", // 21
253 : : "BusinessAddress/Zip", // 22
254 : : "BusinessAddress/City", // 23
255 : : "BusinessAddress/Country", // 24
256 : : "BusinessAddress/State", // 25
257 : : "BusinessAddress/Position", // 26
258 : : "BusinessAddress/Phone", // 27
259 : : "BusinessAddress/Mobile", // 28
260 : : "BusinessAddress/Fax", // 29
261 : : "BusinessAddress/WebAddress", // 30
262 : : "BusinessAddress/Email", // 31
263 : : "AutoText/Group", // 32
264 : : "AutoText/Block" // 33
265 : : };
266 [ # # ]: 0 : const int nBusinessCount = bIsLabel ? 0 : 34;
267 [ # # ]: 0 : const int nLabelCount = bIsLabel ? 20 : 17;
268 : 0 : Sequence<OUString> aNames(nBusinessCount + nLabelCount);
269 [ # # ]: 0 : OUString* pNames = aNames.getArray();
270 : 0 : int nIndex = 0;
271 [ # # ]: 0 : for(int nLabel = 0; nLabel < nLabelCount; nLabel++)
272 : 0 : pNames[nIndex++] = OUString::createFromAscii(aLabelPropNames[nLabel]);
273 [ # # ]: 0 : for(int nBusiness = 0; nBusiness < nBusinessCount; nBusiness++)
274 : 0 : pNames[nIndex++] = OUString::createFromAscii(aBusinessPropNames[nBusiness]);
275 : 0 : return aNames;
276 : : }
277 : :
278 : 0 : SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) :
279 : : ConfigItem(bLabel ? C2U("Office.Writer/Label") : C2U("Office.Writer/BusinessCard")),
280 [ # # ][ # # ]: 0 : bIsLabel(bLabel)
[ # # ]
281 : : {
282 [ # # ]: 0 : Sequence<OUString> aNames = GetPropertyNames();
283 [ # # ]: 0 : Sequence<Any> aValues = GetProperties(aNames);
284 [ # # ]: 0 : EnableNotification(aNames);
285 : 0 : const Any* pValues = aValues.getConstArray();
286 : : OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
287 : 0 : sal_Bool bNoConfigValues = sal_True;
288 [ # # ]: 0 : if(aValues.getLength() == aNames.getLength())
289 : : {
290 [ # # ]: 0 : for(int nProp = 0, nProperty = 0; nProp < aNames.getLength(); nProp++, nProperty++)
291 : : {
292 : :
293 [ # # ]: 0 : if(pValues[nProp].hasValue())
294 : : {
295 : : //to have a contiuous switch an offset is added
296 [ # # ][ # # ]: 0 : if(nProp == 17 && !bIsLabel)
297 : 0 : nProperty += 3;
298 [ # # ]: 0 : if(nProperty >= 20)
299 : 0 : bNoConfigValues = sal_False;
300 [ # # # # : 0 : switch(nProperty)
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# ]
301 : : {
302 : 0 : case 0: aItem.bCont = *(sal_Bool*)pValues[nProp].getValue(); break;// "Medium/Continous",
303 : 0 : case 1: pValues[nProp] >>= aItem.aMake; break;// "Medium/Brand",
304 : 0 : case 2: pValues[nProp] >>= aItem.aType; break;// "Medium/Type",
305 : 0 : case 3: pValues[nProp] >>= aItem.nCols; break;// "Format/Column",
306 : 0 : case 4: pValues[nProp] >>= aItem.nRows; break;// "Format/Row",
307 : : case 5:
308 : 0 : pValues[nProp] >>= aItem.lHDist;
309 [ # # ]: 0 : aItem.lHDist = MM100_TO_TWIP(aItem.lHDist);
310 : 0 : break;// "Format/HorizontalDistance",
311 : : case 6:
312 : 0 : pValues[nProp] >>= aItem.lVDist;
313 [ # # ]: 0 : aItem.lVDist = MM100_TO_TWIP(aItem.lVDist);
314 : 0 : break;// "Format/VerticalDistance",
315 : : case 7:
316 : 0 : pValues[nProp] >>= aItem.lWidth;
317 [ # # ]: 0 : aItem.lWidth = MM100_TO_TWIP(aItem.lWidth);
318 : 0 : break;// "Format/Width",
319 : : case 8:
320 : 0 : pValues[nProp] >>= aItem.lHeight;
321 [ # # ]: 0 : aItem.lHeight = MM100_TO_TWIP(aItem.lHeight);
322 : 0 : break;// "Format/Height",
323 : : case 9:
324 : 0 : pValues[nProp] >>= aItem.lLeft;
325 [ # # ]: 0 : aItem.lLeft = MM100_TO_TWIP(aItem.lLeft);
326 : 0 : break;// "Format/LeftMargin",
327 : : case 10:
328 : 0 : pValues[nProp] >>= aItem.lUpper;
329 [ # # ]: 0 : aItem.lUpper = MM100_TO_TWIP(aItem.lUpper);
330 : 0 : break;// "Format/TopMargin",
331 : : case 11:
332 : 0 : pValues[nProp] >>= aItem.lPWidth;
333 [ # # ]: 0 : aItem.lPWidth = MM100_TO_TWIP(aItem.lPWidth);
334 : 0 : break;// "Format/PageWidth",
335 : : case 12:
336 : 0 : pValues[nProp] >>= aItem.lPHeight;
337 [ # # ]: 0 : aItem.lPHeight = MM100_TO_TWIP(aItem.lPHeight);
338 : 0 : break;// "Format/PageHeight",
339 : 0 : case 13: aItem.bSynchron = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Synchronize",
340 : 0 : case 14: aItem.bPage = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Page",
341 : 0 : case 15: pValues[nProp] >>= aItem.nCol; break;// "Option/Column",
342 : 0 : case 16: pValues[nProp] >>= aItem.nRow; break;// "Option/Row"
343 : 0 : case 17: aItem.bAddr = *(sal_Bool*)pValues[nProp].getValue(); break;// "Inscription/UseAddress",
344 : 0 : case 18: pValues[nProp] >>= aItem.aWriting; break;// "Inscription/Address",
345 : 0 : case 19: pValues[nProp] >>= aItem.sDBName; break;// "Inscription/Database"
346 : 0 : case 20: pValues[nProp] >>= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName",
347 : 0 : case 21: pValues[nProp] >>= aItem.aPrivName; break;// "PrivateAddress/Name",
348 : 0 : case 22: pValues[nProp] >>= aItem.aPrivShortCut; break;// "PrivateAddress/ShortCut",
349 : 0 : case 23: pValues[nProp] >>= aItem.aPrivFirstName2; break;// "PrivateAddress/SecondFirstName",
350 : 0 : case 24: pValues[nProp] >>= aItem.aPrivName2; break;// "PrivateAddress/SecondName",
351 : 0 : case 25: pValues[nProp] >>= aItem.aPrivShortCut2; break;// "PrivateAddress/SecondShortCut",
352 : 0 : case 26: pValues[nProp] >>= aItem.aPrivStreet; break;// "PrivateAddress/Street",
353 : 0 : case 27: pValues[nProp] >>= aItem.aPrivZip; break;// "PrivateAddress/Zip",
354 : 0 : case 28: pValues[nProp] >>= aItem.aPrivCity; break;// "PrivateAddress/City",
355 : 0 : case 29: pValues[nProp] >>= aItem.aPrivCountry; break;// "PrivateAddress/Country",
356 : 0 : case 30: pValues[nProp] >>= aItem.aPrivState; break;// "PrivateAddress/State",
357 : 0 : case 31: pValues[nProp] >>= aItem.aPrivTitle; break;// "PrivateAddress/Title",
358 : 0 : case 32: pValues[nProp] >>= aItem.aPrivProfession; break;// "PrivateAddress/Profession",
359 : 0 : case 33: pValues[nProp] >>= aItem.aPrivPhone; break;// "PrivateAddress/Phone",
360 : 0 : case 34: pValues[nProp] >>= aItem.aPrivMobile; break;// "PrivateAddress/Mobile",
361 : 0 : case 35: pValues[nProp] >>= aItem.aPrivFax; break;// "PrivateAddress/Fax",
362 : 0 : case 36: pValues[nProp] >>= aItem.aPrivWWW; break;// "PrivateAddress/WebAddress",
363 : 0 : case 37: pValues[nProp] >>= aItem.aPrivMail; break;// "PrivateAddress/Email",
364 : 0 : case 38: pValues[nProp] >>= aItem.aCompCompany; break;// "BusinessAddress/Company",
365 : 0 : case 39: pValues[nProp] >>= aItem.aCompCompanyExt; break;// "BusinessAddress/CompanyExt",
366 : 0 : case 40: pValues[nProp] >>= aItem.aCompSlogan; break;// "BusinessAddress/Slogan",
367 : 0 : case 41: pValues[nProp] >>= aItem.aCompStreet; break;// "BusinessAddress/Street",
368 : 0 : case 42: pValues[nProp] >>= aItem.aCompZip; break;// "BusinessAddress/Zip",
369 : 0 : case 43: pValues[nProp] >>= aItem.aCompCity; break;// "BusinessAddress/City",
370 : 0 : case 44: pValues[nProp] >>= aItem.aCompCountry; break;// "BusinessAddress/Country",
371 : 0 : case 45: pValues[nProp] >>= aItem.aCompState; break;// "BusinessAddress/State",
372 : 0 : case 46: pValues[nProp] >>= aItem.aCompPosition; break;// "BusinessAddress/Position",
373 : 0 : case 47: pValues[nProp] >>= aItem.aCompPhone; break;// "BusinessAddress/Phone",
374 : 0 : case 48: pValues[nProp] >>= aItem.aCompMobile; break;// "BusinessAddress/Mobile",
375 : 0 : case 49: pValues[nProp] >>= aItem.aCompFax; break;// "BusinessAddress/Fax",
376 : 0 : case 50: pValues[nProp] >>= aItem.aCompWWW; break;// "BusinessAddress/WebAddress",
377 : 0 : case 51: pValues[nProp] >>= aItem.aCompMail; break;// "BusinessAddress/Email",
378 : 0 : case 52: pValues[nProp] >>= aItem.sGlossaryGroup; break;// "AutoText/Group"
379 : 0 : case 53: pValues[nProp] >>= aItem.sGlossaryBlockName; break;// "AutoText/Block"
380 : : }
381 : : }
382 : : }
383 : : }
384 [ # # ][ # # ]: 0 : if(!bIsLabel && bNoConfigValues)
385 : : {
386 : :
387 [ # # ][ # # ]: 0 : SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions();
388 [ # # ]: 0 : aItem.aPrivFirstName = rUserOpt.GetFirstName();
389 [ # # ]: 0 : aItem.aPrivName = rUserOpt.GetLastName();
390 [ # # ]: 0 : aItem.aPrivShortCut = rUserOpt.GetID();
391 [ # # ]: 0 : aItem.aCompCompany = rUserOpt.GetCompany();
392 [ # # ]: 0 : aItem.aCompStreet = aItem.aPrivStreet = rUserOpt.GetStreet();
393 : :
394 [ # # ]: 0 : aItem.aCompCountry = aItem.aPrivCountry = rUserOpt.GetCountry();
395 [ # # ]: 0 : aItem.aCompZip = aItem.aPrivZip= rUserOpt.GetZip();
396 [ # # ]: 0 : aItem.aCompCity = aItem.aPrivCity = rUserOpt.GetCity();
397 [ # # ]: 0 : aItem.aPrivTitle = rUserOpt.GetTitle();
398 [ # # ]: 0 : aItem.aCompPosition = rUserOpt.GetPosition();
399 [ # # ]: 0 : aItem.aPrivPhone = rUserOpt.GetTelephoneHome();
400 [ # # ]: 0 : aItem.aCompPhone = rUserOpt.GetTelephoneWork();
401 [ # # ]: 0 : aItem.aCompFax = aItem.aPrivFax = rUserOpt.GetFax();
402 [ # # ]: 0 : aItem.aCompMail = aItem.aPrivMail = rUserOpt.GetEmail();
403 [ # # ]: 0 : aItem.aCompState = aItem.aPrivState = rUserOpt.GetState();
404 : 0 : aItem.bSynchron = sal_True;
405 [ # # ]: 0 : SetModified();
406 [ # # ][ # # ]: 0 : }
407 : 0 : }
408 : :
409 : 0 : void SwLabCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
410 : :
411 : 0 : void SwLabCfgItem::Commit()
412 : : {
413 [ # # ]: 0 : Sequence<OUString> aNames = GetPropertyNames();
414 [ # # ]: 0 : Sequence<Any> aValues(aNames.getLength());
415 [ # # ]: 0 : Any* pValues = aValues.getArray();
416 : :
417 [ # # ]: 0 : const Type& rType = ::getBooleanCppuType();
418 [ # # ]: 0 : for(int nProp = 0, nProperty = 0; nProp < aNames.getLength(); nProp++, nProperty++)
419 : : {
420 : : //to have a contiuous switch an offset is added
421 [ # # ][ # # ]: 0 : if(nProp == 17 && !bIsLabel)
422 : 0 : nProperty += 3;
423 [ # # # # : 0 : switch(nProperty)
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# ]
424 : : {
425 : 0 : case 0: pValues[nProp].setValue(&aItem.bCont, rType); break;// "Medium/Continous",
426 [ # # ]: 0 : case 1: pValues[nProp] <<= aItem.aMake; break;// "Medium/Brand",
427 [ # # ]: 0 : case 2: pValues[nProp] <<= aItem.aType; break;// "Medium/Type",
428 [ # # ]: 0 : case 3: pValues[nProp] <<= aItem.nCols; break;// "Format/Column",
429 [ # # ]: 0 : case 4: pValues[nProp] <<= aItem.nRows; break;// "Format/Row",
430 [ # # ][ # # ]: 0 : case 5: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHDist));break;// "Format/HorizontalDistance",
431 [ # # ][ # # ]: 0 : case 6: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lVDist));break;// "Format/VerticalDistance",
432 [ # # ][ # # ]: 0 : case 7: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lWidth)); break;// "Format/Width",
433 [ # # ][ # # ]: 0 : case 8: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHeight)); break;// "Format/Height",
434 [ # # ][ # # ]: 0 : case 9: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lLeft)); break;// "Format/LeftMargin",
435 [ # # ][ # # ]: 0 : case 10: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lUpper)); break;// "Format/TopMargin",
436 [ # # ][ # # ]: 0 : case 11: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lPWidth)); break;// "Format/Page Width",
437 [ # # ][ # # ]: 0 : case 12: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lPHeight)); break;// "Format/PageHeight",
438 : 0 : case 13: pValues[nProp].setValue(&aItem.bSynchron, rType); break;// "Option/Synchronize",
439 : 0 : case 14: pValues[nProp].setValue(&aItem.bPage, rType); break;// "Option/Page",
440 [ # # ]: 0 : case 15: pValues[nProp] <<= aItem.nCol; break;// "Option/Column",
441 [ # # ]: 0 : case 16: pValues[nProp] <<= aItem.nRow; break;// "Option/Row"
442 : 0 : case 17: pValues[nProp].setValue(&aItem.bAddr, rType); break;// "Inscription/UseAddress",
443 [ # # ]: 0 : case 18: pValues[nProp] <<= aItem.aWriting; break;// "Inscription/Address",
444 [ # # ]: 0 : case 19: pValues[nProp] <<= aItem.sDBName; break;// "Inscription/Database"
445 [ # # ]: 0 : case 20: pValues[nProp] <<= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName",
446 [ # # ]: 0 : case 21: pValues[nProp] <<= aItem.aPrivName; break;// "PrivateAddress/Name",
447 [ # # ]: 0 : case 22: pValues[nProp] <<= aItem.aPrivShortCut; break;// "PrivateAddress/ShortCut",
448 [ # # ]: 0 : case 23: pValues[nProp] <<= aItem.aPrivFirstName2; break;// "PrivateAddress/SecondFirstName",
449 [ # # ]: 0 : case 24: pValues[nProp] <<= aItem.aPrivName2; break;// "PrivateAddress/SecondName",
450 [ # # ]: 0 : case 25: pValues[nProp] <<= aItem.aPrivShortCut2; break;// "PrivateAddress/SecondShortCut",
451 [ # # ]: 0 : case 26: pValues[nProp] <<= aItem.aPrivStreet; break;// "PrivateAddress/Street",
452 [ # # ]: 0 : case 27: pValues[nProp] <<= aItem.aPrivZip; break;// "PrivateAddress/Zip",
453 [ # # ]: 0 : case 28: pValues[nProp] <<= aItem.aPrivCity; break;// "PrivateAddress/City",
454 [ # # ]: 0 : case 29: pValues[nProp] <<= aItem.aPrivCountry; break;// "PrivateAddress/Country",
455 [ # # ]: 0 : case 30: pValues[nProp] <<= aItem.aPrivState; break;// "PrivateAddress/State",
456 [ # # ]: 0 : case 31: pValues[nProp] <<= aItem.aPrivTitle; break;// "PrivateAddress/Title",
457 [ # # ]: 0 : case 32: pValues[nProp] <<= aItem.aPrivProfession; break;// "PrivateAddress/Profession",
458 [ # # ]: 0 : case 33: pValues[nProp] <<= aItem.aPrivPhone; break;// "PrivateAddress/Phone",
459 [ # # ]: 0 : case 34: pValues[nProp] <<= aItem.aPrivMobile; break;// "PrivateAddress/Mobile",
460 [ # # ]: 0 : case 35: pValues[nProp] <<= aItem.aPrivFax; break;// "PrivateAddress/Fax",
461 [ # # ]: 0 : case 36: pValues[nProp] <<= aItem.aPrivWWW; break;// "PrivateAddress/WebAddress",
462 [ # # ]: 0 : case 37: pValues[nProp] <<= aItem.aPrivMail; break;// "PrivateAddress/Email",
463 [ # # ]: 0 : case 38: pValues[nProp] <<= aItem.aCompCompany; break;// "BusinessAddress/Company",
464 [ # # ]: 0 : case 39: pValues[nProp] <<= aItem.aCompCompanyExt; break;// "BusinessAddress/CompanyExt",
465 [ # # ]: 0 : case 40: pValues[nProp] <<= aItem.aCompSlogan; break;// "BusinessAddress/Slogan",
466 [ # # ]: 0 : case 41: pValues[nProp] <<= aItem.aCompStreet; break;// "BusinessAddress/Street",
467 [ # # ]: 0 : case 42: pValues[nProp] <<= aItem.aCompZip; break;// "BusinessAddress/Zip",
468 [ # # ]: 0 : case 43: pValues[nProp] <<= aItem.aCompCity; break;// "BusinessAddress/City",
469 [ # # ]: 0 : case 44: pValues[nProp] <<= aItem.aCompCountry; break;// "BusinessAddress/Country",
470 [ # # ]: 0 : case 45: pValues[nProp] <<= aItem.aCompState; break;// "BusinessAddress/State",
471 [ # # ]: 0 : case 46: pValues[nProp] <<= aItem.aCompPosition; break;// "BusinessAddress/Position",
472 [ # # ]: 0 : case 47: pValues[nProp] <<= aItem.aCompPhone; break;// "BusinessAddress/Phone",
473 [ # # ]: 0 : case 48: pValues[nProp] <<= aItem.aCompMobile; break;// "BusinessAddress/Mobile",
474 [ # # ]: 0 : case 49: pValues[nProp] <<= aItem.aCompFax; break;// "BusinessAddress/Fax",
475 [ # # ]: 0 : case 50: pValues[nProp] <<= aItem.aCompWWW; break;// "BusinessAddress/WebAddress",
476 [ # # ]: 0 : case 51: pValues[nProp] <<= aItem.aCompMail; break;// "BusinessAddress/Email",
477 [ # # ]: 0 : case 52: pValues[nProp] <<= aItem.sGlossaryGroup; break;// "AutoText/Group"
478 [ # # ]: 0 : case 53: pValues[nProp] <<= aItem.sGlossaryBlockName; break;// "AutoText/Block"
479 : : }
480 : : }
481 [ # # ][ # # ]: 0 : PutProperties(aNames, aValues);
[ # # ]
482 : 0 : }
483 : :
484 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|