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 <com/sun/star/util/CellProtection.hpp>
21 : #include <com/sun/star/util/XProtectable.hpp>
22 : #include <com/sun/star/text/XText.hpp>
23 : #include <com/sun/star/beans/XPropertySet.hpp>
24 :
25 : #include "scitems.hxx"
26 : #include <editeng/eeitem.hxx>
27 :
28 : #include <editeng/boxitem.hxx>
29 : #include <editeng/editdata.hxx>
30 : #include <editeng/editeng.hxx>
31 : #include <editeng/editobj.hxx>
32 : #include <editeng/flditem.hxx>
33 :
34 : #include "attrib.hxx"
35 : #include "global.hxx"
36 : #include "editutil.hxx"
37 : #include "sc.hrc"
38 : #include "globstr.hrc"
39 :
40 : #include "textuno.hxx" // ScHeaderFooterContentObj
41 :
42 : using namespace com::sun::star;
43 :
44 : //------------------------------------------------------------------------
45 :
46 327 : TYPEINIT1(ScMergeAttr, SfxPoolItem);
47 459 : TYPEINIT1_AUTOFACTORY(ScProtectionAttr, SfxPoolItem);
48 981 : TYPEINIT1(ScRangeItem, SfxPoolItem);
49 327 : TYPEINIT1(ScTableListItem, SfxPoolItem);
50 1784 : TYPEINIT1(ScPageHFItem, SfxPoolItem);
51 981 : TYPEINIT1(ScViewObjectModeItem, SfxEnumItem);
52 5 : TYPEINIT1(ScDoubleItem, SfxPoolItem);
53 327 : TYPEINIT1(ScPageScaleToItem, SfxPoolItem);
54 328 : TYPEINIT1(ScCondFormatItem, SfxPoolItem);
55 :
56 : //------------------------------------------------------------------------
57 :
58 : //
59 : // General Help Function
60 : //
61 :
62 549 : bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxBorderLine* pOther )
63 : {
64 :
65 549 : if (!pThis)
66 479 : return false;
67 70 : if (!pOther)
68 68 : return true;
69 :
70 2 : sal_uInt16 nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth();
71 2 : sal_uInt16 nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth();
72 :
73 2 : if (nThisSize > nOtherSize)
74 0 : return true;
75 2 : else if (nThisSize < nOtherSize)
76 0 : return false;
77 : else
78 : {
79 2 : if ( pOther->GetInWidth() && !pThis->GetInWidth() )
80 0 : return true;
81 2 : else if ( pThis->GetInWidth() && !pOther->GetInWidth() )
82 0 : return false;
83 : else
84 : {
85 2 : return true; //! ???
86 : }
87 : }
88 : }
89 :
90 :
91 : //
92 : // Item - Implementierungen
93 : //
94 :
95 : //------------------------------------------------------------------------
96 : // Merge
97 : //------------------------------------------------------------------------
98 :
99 195 : ScMergeAttr::ScMergeAttr():
100 : SfxPoolItem(ATTR_MERGE),
101 : nColMerge(0),
102 195 : nRowMerge(0)
103 195 : {}
104 :
105 : //------------------------------------------------------------------------
106 :
107 437 : ScMergeAttr::ScMergeAttr( SCsCOL nCol, SCsROW nRow):
108 : SfxPoolItem(ATTR_MERGE),
109 : nColMerge(nCol),
110 437 : nRowMerge(nRow)
111 437 : {}
112 :
113 : //------------------------------------------------------------------------
114 :
115 22 : ScMergeAttr::ScMergeAttr(const ScMergeAttr& rItem):
116 22 : SfxPoolItem(ATTR_MERGE)
117 : {
118 22 : nColMerge = rItem.nColMerge;
119 22 : nRowMerge = rItem.nRowMerge;
120 22 : }
121 :
122 693 : ScMergeAttr::~ScMergeAttr()
123 : {
124 693 : }
125 :
126 : //------------------------------------------------------------------------
127 :
128 0 : String ScMergeAttr::GetValueText() const
129 : {
130 0 : rtl::OUStringBuffer aString;
131 0 : aString.append('(');
132 0 : aString.append(static_cast<sal_Int32>(nColMerge));
133 0 : aString.append(',');
134 0 : aString.append(static_cast<sal_Int32>(nRowMerge));
135 0 : aString.append(')');
136 0 : return aString.makeStringAndClear();
137 : }
138 :
139 : //------------------------------------------------------------------------
140 :
141 580 : int ScMergeAttr::operator==( const SfxPoolItem& rItem ) const
142 : {
143 : OSL_ENSURE( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" );
144 580 : return (Which() == rItem.Which())
145 : && (nColMerge == ((ScMergeAttr&)rItem).nColMerge)
146 580 : && (nRowMerge == ((ScMergeAttr&)rItem).nRowMerge);
147 : }
148 :
149 : //------------------------------------------------------------------------
150 :
151 22 : SfxPoolItem* ScMergeAttr::Clone( SfxItemPool * ) const
152 : {
153 22 : return new ScMergeAttr(*this);
154 : }
155 :
156 : //------------------------------------------------------------------------
157 :
158 0 : SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const
159 : {
160 : sal_Int16 nCol;
161 : sal_Int16 nRow;
162 0 : rStream >> nCol;
163 0 : rStream >> nRow;
164 0 : return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow));
165 : }
166 :
167 : //------------------------------------------------------------------------
168 : // MergeFlag
169 : //------------------------------------------------------------------------
170 :
171 195 : ScMergeFlagAttr::ScMergeFlagAttr():
172 195 : SfxInt16Item(ATTR_MERGE_FLAG, 0)
173 : {
174 195 : }
175 :
176 : //------------------------------------------------------------------------
177 :
178 4628 : ScMergeFlagAttr::ScMergeFlagAttr(sal_Int16 nFlags):
179 4628 : SfxInt16Item(ATTR_MERGE_FLAG, nFlags)
180 : {
181 4628 : }
182 :
183 4846 : ScMergeFlagAttr::~ScMergeFlagAttr()
184 : {
185 4846 : }
186 :
187 4 : bool ScMergeFlagAttr::HasPivotButton() const
188 : {
189 4 : return (GetValue() & SC_MF_BUTTON) != 0;
190 : }
191 :
192 0 : bool ScMergeFlagAttr::HasPivotPopupButton() const
193 : {
194 0 : return (GetValue() & SC_MF_BUTTON_POPUP) != 0;
195 : }
196 :
197 : //------------------------------------------------------------------------
198 : // Protection
199 : //------------------------------------------------------------------------
200 :
201 195 : ScProtectionAttr::ScProtectionAttr():
202 : SfxPoolItem(ATTR_PROTECTION),
203 : bProtection(true),
204 : bHideFormula(false),
205 : bHideCell(false),
206 195 : bHidePrint(false)
207 : {
208 195 : }
209 :
210 : //------------------------------------------------------------------------
211 :
212 61 : ScProtectionAttr::ScProtectionAttr( bool bProtect, bool bHFormula,
213 : bool bHCell, bool bHPrint):
214 : SfxPoolItem(ATTR_PROTECTION),
215 : bProtection(bProtect),
216 : bHideFormula(bHFormula),
217 : bHideCell(bHCell),
218 61 : bHidePrint(bHPrint)
219 : {
220 61 : }
221 :
222 : //------------------------------------------------------------------------
223 :
224 29 : ScProtectionAttr::ScProtectionAttr(const ScProtectionAttr& rItem):
225 29 : SfxPoolItem(ATTR_PROTECTION)
226 : {
227 29 : bProtection = rItem.bProtection;
228 29 : bHideFormula = rItem.bHideFormula;
229 29 : bHideCell = rItem.bHideCell;
230 29 : bHidePrint = rItem.bHidePrint;
231 29 : }
232 :
233 334 : ScProtectionAttr::~ScProtectionAttr()
234 : {
235 334 : }
236 :
237 : //------------------------------------------------------------------------
238 :
239 0 : bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
240 : {
241 0 : nMemberId &= ~CONVERT_TWIPS;
242 0 : switch ( nMemberId )
243 : {
244 : case 0 :
245 : {
246 0 : util::CellProtection aProtection;
247 0 : aProtection.IsLocked = bProtection;
248 0 : aProtection.IsFormulaHidden = bHideFormula;
249 0 : aProtection.IsHidden = bHideCell;
250 0 : aProtection.IsPrintHidden = bHidePrint;
251 0 : rVal <<= aProtection;
252 : break;
253 : }
254 : case MID_1 :
255 0 : rVal <<= (sal_Bool ) bProtection; break;
256 : case MID_2 :
257 0 : rVal <<= (sal_Bool ) bHideFormula; break;
258 : case MID_3 :
259 0 : rVal <<= (sal_Bool ) bHideCell; break;
260 : case MID_4 :
261 0 : rVal <<= (sal_Bool ) bHidePrint; break;
262 : default:
263 : OSL_FAIL("Wrong MemberID!");
264 0 : return false;
265 : }
266 :
267 0 : return true;
268 : }
269 :
270 11 : bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
271 : {
272 11 : bool bRet = false;
273 11 : sal_Bool bVal = sal_False;
274 11 : nMemberId &= ~CONVERT_TWIPS;
275 11 : switch ( nMemberId )
276 : {
277 : case 0 :
278 : {
279 11 : util::CellProtection aProtection;
280 11 : if ( rVal >>= aProtection )
281 : {
282 11 : bProtection = aProtection.IsLocked;
283 11 : bHideFormula = aProtection.IsFormulaHidden;
284 11 : bHideCell = aProtection.IsHidden;
285 11 : bHidePrint = aProtection.IsPrintHidden;
286 11 : bRet = true;
287 : }
288 : else
289 : {
290 : OSL_FAIL("exception - wrong argument");
291 : }
292 : break;
293 : }
294 : case MID_1 :
295 0 : bRet = (rVal >>= bVal); if (bRet) bProtection=bVal; break;
296 : case MID_2 :
297 0 : bRet = (rVal >>= bVal); if (bRet) bHideFormula=bVal; break;
298 : case MID_3 :
299 0 : bRet = (rVal >>= bVal); if (bRet) bHideCell=bVal; break;
300 : case MID_4 :
301 0 : bRet = (rVal >>= bVal); if (bRet) bHidePrint=bVal; break;
302 : default:
303 : OSL_FAIL("Wrong MemberID!");
304 : }
305 :
306 11 : return bRet;
307 : }
308 :
309 : //------------------------------------------------------------------------
310 :
311 0 : String ScProtectionAttr::GetValueText() const
312 : {
313 0 : String aValue;
314 0 : String aStrYes ( ScGlobal::GetRscString(STR_YES) );
315 0 : String aStrNo ( ScGlobal::GetRscString(STR_NO) );
316 0 : sal_Unicode cDelim = ',';
317 :
318 0 : aValue = '(';
319 0 : aValue += (bProtection ? aStrYes : aStrNo); aValue += cDelim;
320 0 : aValue += (bHideFormula ? aStrYes : aStrNo); aValue += cDelim;
321 0 : aValue += (bHideCell ? aStrYes : aStrNo); aValue += cDelim;
322 0 : aValue += (bHidePrint ? aStrYes : aStrNo);
323 0 : aValue += ')';
324 :
325 0 : return aValue;
326 : }
327 :
328 : //------------------------------------------------------------------------
329 :
330 0 : SfxItemPresentation ScProtectionAttr::GetPresentation
331 : (
332 : SfxItemPresentation ePres,
333 : SfxMapUnit /* eCoreMetric */,
334 : SfxMapUnit /* ePresMetric */,
335 : String& rText,
336 : const IntlWrapper* /* pIntl */
337 : ) const
338 : {
339 0 : String aStrYes ( ScGlobal::GetRscString(STR_YES) );
340 0 : String aStrNo ( ScGlobal::GetRscString(STR_NO) );
341 0 : rtl::OUString aStrSep(": ");
342 0 : rtl::OUString aStrDelim( ", ");
343 :
344 0 : switch ( ePres )
345 : {
346 : case SFX_ITEM_PRESENTATION_NONE:
347 0 : rText.Erase();
348 0 : break;
349 :
350 : case SFX_ITEM_PRESENTATION_NAMELESS:
351 0 : rText = GetValueText();
352 0 : break;
353 :
354 : case SFX_ITEM_PRESENTATION_COMPLETE:
355 0 : rText = ScGlobal::GetRscString(STR_PROTECTION); rText += aStrSep;
356 0 : rText += (bProtection ? aStrYes : aStrNo); rText += aStrDelim;
357 0 : rText += ScGlobal::GetRscString(STR_FORMULAS); rText += aStrSep;
358 0 : rText += (!bHideFormula ? aStrYes : aStrNo); rText += aStrDelim;
359 0 : rText += ScGlobal::GetRscString(STR_HIDE); rText += aStrSep;
360 0 : rText += (bHideCell ? aStrYes : aStrNo); rText += aStrDelim;
361 0 : rText += ScGlobal::GetRscString(STR_PRINT); rText += aStrSep;
362 0 : rText += (!bHidePrint ? aStrYes : aStrNo);
363 0 : break;
364 :
365 : default:
366 0 : ePres = SFX_ITEM_PRESENTATION_NONE;
367 : }
368 :
369 0 : return ePres;
370 : }
371 :
372 : //------------------------------------------------------------------------
373 :
374 54 : int ScProtectionAttr::operator==( const SfxPoolItem& rItem ) const
375 : {
376 : OSL_ENSURE( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" );
377 54 : return (Which() == rItem.Which())
378 : && (bProtection == ((ScProtectionAttr&)rItem).bProtection)
379 : && (bHideFormula == ((ScProtectionAttr&)rItem).bHideFormula)
380 : && (bHideCell == ((ScProtectionAttr&)rItem).bHideCell)
381 54 : && (bHidePrint == ((ScProtectionAttr&)rItem).bHidePrint);
382 : }
383 :
384 : //------------------------------------------------------------------------
385 :
386 29 : SfxPoolItem* ScProtectionAttr::Clone( SfxItemPool * ) const
387 : {
388 29 : return new ScProtectionAttr(*this);
389 : }
390 :
391 : //------------------------------------------------------------------------
392 :
393 0 : SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, sal_uInt16 /* n */ ) const
394 : {
395 : sal_Bool bProtect;
396 : sal_Bool bHFormula;
397 : sal_Bool bHCell;
398 : sal_Bool bHPrint;
399 :
400 0 : rStream >> bProtect;
401 0 : rStream >> bHFormula;
402 0 : rStream >> bHCell;
403 0 : rStream >> bHPrint;
404 :
405 0 : return new ScProtectionAttr(bProtect,bHFormula,bHCell,bHPrint);
406 : }
407 :
408 : //------------------------------------------------------------------------
409 :
410 0 : bool ScProtectionAttr::SetProtection( bool bProtect)
411 : {
412 0 : bProtection = bProtect;
413 0 : return true;
414 : }
415 :
416 : //------------------------------------------------------------------------
417 :
418 0 : bool ScProtectionAttr::SetHideFormula( bool bHFormula)
419 : {
420 0 : bHideFormula = bHFormula;
421 0 : return true;
422 : }
423 :
424 : //------------------------------------------------------------------------
425 :
426 0 : bool ScProtectionAttr::SetHideCell( bool bHCell)
427 : {
428 0 : bHideCell = bHCell;
429 0 : return true;
430 : }
431 :
432 : //------------------------------------------------------------------------
433 :
434 0 : bool ScProtectionAttr::SetHidePrint( bool bHPrint)
435 : {
436 0 : bHidePrint = bHPrint;
437 0 : return true;
438 : }
439 :
440 : // -----------------------------------------------------------------------
441 : // ScRangeItem - Tabellenbereich
442 : // -----------------------------------------------------------------------
443 :
444 0 : int ScRangeItem::operator==( const SfxPoolItem& rAttr ) const
445 : {
446 : OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
447 :
448 0 : return ( aRange == ( (ScRangeItem&)rAttr ).aRange );
449 : }
450 :
451 : // -----------------------------------------------------------------------
452 :
453 0 : SfxPoolItem* ScRangeItem::Clone( SfxItemPool* ) const
454 : {
455 0 : return new ScRangeItem( *this );
456 : }
457 :
458 : //------------------------------------------------------------------------
459 :
460 0 : SfxItemPresentation ScRangeItem::GetPresentation
461 : (
462 : SfxItemPresentation ePres,
463 : SfxMapUnit /* eCoreUnit */,
464 : SfxMapUnit /* ePresUnit */,
465 : String& rText,
466 : const IntlWrapper* /* pIntl */
467 : ) const
468 : {
469 0 : rText.Erase();
470 :
471 0 : switch ( ePres )
472 : {
473 : case SFX_ITEM_PRESENTATION_COMPLETE:
474 0 : rText = ScGlobal::GetRscString(STR_AREA);
475 0 : rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
476 : /* !!! fall-through !!! */
477 :
478 : case SFX_ITEM_PRESENTATION_NAMELESS:
479 : {
480 0 : String aText;
481 : /* Always use OOo:A1 format */
482 0 : aRange.Format( aText );
483 0 : rText += aText;
484 : }
485 0 : break;
486 :
487 : default:
488 : {
489 : // added to avoid warnings
490 : }
491 : }
492 :
493 0 : return ePres;
494 : }
495 :
496 : // -----------------------------------------------------------------------
497 : // ScTableListItem - List from Tables (-numbers)
498 : // -----------------------------------------------------------------------
499 :
500 0 : ScTableListItem::ScTableListItem( const ScTableListItem& rCpy )
501 0 : : SfxPoolItem ( rCpy.Which() ),
502 0 : nCount ( rCpy.nCount )
503 : {
504 0 : if ( nCount > 0 )
505 : {
506 0 : pTabArr = new SCTAB [nCount];
507 :
508 0 : for ( sal_uInt16 i=0; i<nCount; i++ )
509 0 : pTabArr[i] = rCpy.pTabArr[i];
510 : }
511 : else
512 0 : pTabArr = NULL;
513 0 : }
514 :
515 : // -----------------------------------------------------------------------
516 :
517 :
518 327 : ScTableListItem::~ScTableListItem()
519 : {
520 109 : delete [] pTabArr;
521 218 : }
522 :
523 : // -----------------------------------------------------------------------
524 :
525 0 : ScTableListItem& ScTableListItem::operator=( const ScTableListItem& rCpy )
526 : {
527 0 : delete [] pTabArr;
528 :
529 0 : if ( rCpy.nCount > 0 )
530 : {
531 0 : pTabArr = new SCTAB [rCpy.nCount];
532 0 : for ( sal_uInt16 i=0; i<rCpy.nCount; i++ )
533 0 : pTabArr[i] = rCpy.pTabArr[i];
534 : }
535 : else
536 0 : pTabArr = NULL;
537 :
538 0 : nCount = rCpy.nCount;
539 :
540 0 : return *this;
541 : }
542 :
543 : // -----------------------------------------------------------------------
544 :
545 0 : int ScTableListItem::operator==( const SfxPoolItem& rAttr ) const
546 : {
547 : OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
548 :
549 0 : ScTableListItem& rCmp = (ScTableListItem&)rAttr;
550 0 : bool bEqual = (nCount == rCmp.nCount);
551 :
552 0 : if ( nCount > 0 )
553 : {
554 0 : sal_uInt16 i=0;
555 :
556 0 : bEqual = ( pTabArr && rCmp.pTabArr );
557 :
558 0 : while ( bEqual && i<nCount )
559 : {
560 0 : bEqual = ( pTabArr[i] == rCmp.pTabArr[i] );
561 0 : i++;
562 : }
563 : }
564 0 : return bEqual;
565 : }
566 :
567 : // -----------------------------------------------------------------------
568 :
569 0 : SfxPoolItem* ScTableListItem::Clone( SfxItemPool* ) const
570 : {
571 0 : return new ScTableListItem( *this );
572 : }
573 :
574 : //------------------------------------------------------------------------
575 :
576 0 : SfxItemPresentation ScTableListItem::GetPresentation
577 : (
578 : SfxItemPresentation ePres,
579 : SfxMapUnit /* eCoreUnit */,
580 : SfxMapUnit /* ePresUnit */,
581 : String& rText,
582 : const IntlWrapper* /* pIntl */
583 : ) const
584 : {
585 0 : const sal_Unicode cDelim = ',';
586 :
587 0 : switch ( ePres )
588 : {
589 : case SFX_ITEM_PRESENTATION_NONE:
590 0 : rText.Erase();
591 0 : return ePres;
592 :
593 : case SFX_ITEM_PRESENTATION_NAMELESS:
594 : {
595 0 : rText = '(';
596 0 : if ( nCount>0 && pTabArr )
597 0 : for ( sal_uInt16 i=0; i<nCount; i++ )
598 : {
599 0 : rText += String::CreateFromInt32( pTabArr[i] );
600 0 : if ( i<(nCount-1) )
601 0 : rText += cDelim;
602 : }
603 0 : rText += ')';
604 : }
605 0 : return ePres;
606 :
607 : case SFX_ITEM_PRESENTATION_COMPLETE:
608 0 : rText.Erase();
609 0 : return SFX_ITEM_PRESENTATION_NONE;
610 :
611 : default:
612 : {
613 : // added to avoid warnings
614 : }
615 : }
616 :
617 0 : return SFX_ITEM_PRESENTATION_NONE;
618 : }
619 :
620 :
621 : // -----------------------------------------------------------------------
622 : // ScPageHFItem - Dates from the Head and Foot lines
623 : // -----------------------------------------------------------------------
624 :
625 986 : ScPageHFItem::ScPageHFItem( sal_uInt16 nWhichP )
626 : : SfxPoolItem ( nWhichP ),
627 : pLeftArea ( NULL ),
628 : pCenterArea ( NULL ),
629 986 : pRightArea ( NULL )
630 : {
631 986 : }
632 :
633 : //------------------------------------------------------------------------
634 :
635 1122 : ScPageHFItem::ScPageHFItem( const ScPageHFItem& rItem )
636 : : SfxPoolItem ( rItem ),
637 : pLeftArea ( NULL ),
638 : pCenterArea ( NULL ),
639 1122 : pRightArea ( NULL )
640 : {
641 1122 : if ( rItem.pLeftArea )
642 436 : pLeftArea = rItem.pLeftArea->Clone();
643 1122 : if ( rItem.pCenterArea )
644 464 : pCenterArea = rItem.pCenterArea->Clone();
645 1122 : if ( rItem.pRightArea )
646 434 : pRightArea = rItem.pRightArea->Clone();
647 1122 : }
648 :
649 : //------------------------------------------------------------------------
650 :
651 5114 : ScPageHFItem::~ScPageHFItem()
652 : {
653 1726 : delete pLeftArea;
654 1726 : delete pCenterArea;
655 1726 : delete pRightArea;
656 3388 : }
657 :
658 : //------------------------------------------------------------------------
659 :
660 246 : bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const
661 : {
662 : uno::Reference<sheet::XHeaderFooterContent> xContent =
663 246 : new ScHeaderFooterContentObj( pLeftArea, pCenterArea, pRightArea );
664 :
665 246 : rVal <<= xContent;
666 246 : return true;
667 : }
668 :
669 214 : bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ )
670 : {
671 214 : bool bRet = false;
672 214 : uno::Reference<sheet::XHeaderFooterContent> xContent;
673 214 : if ( rVal >>= xContent )
674 : {
675 214 : if ( xContent.is() )
676 : {
677 : ScHeaderFooterContentObj* pImp =
678 214 : ScHeaderFooterContentObj::getImplementation( xContent );
679 214 : if (pImp)
680 : {
681 214 : const EditTextObject* pImpLeft = pImp->GetLeftEditObject();
682 214 : delete pLeftArea;
683 214 : pLeftArea = pImpLeft ? pImpLeft->Clone() : NULL;
684 :
685 214 : const EditTextObject* pImpCenter = pImp->GetCenterEditObject();
686 214 : delete pCenterArea;
687 214 : pCenterArea = pImpCenter ? pImpCenter->Clone() : NULL;
688 :
689 214 : const EditTextObject* pImpRight = pImp->GetRightEditObject();
690 214 : delete pRightArea;
691 214 : pRightArea = pImpRight ? pImpRight->Clone() : NULL;
692 :
693 214 : if ( !pLeftArea || !pCenterArea || !pRightArea )
694 : {
695 : // no Text with Null are left
696 38 : ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), true );
697 38 : if (!pLeftArea)
698 38 : pLeftArea = aEngine.CreateTextObject();
699 38 : if (!pCenterArea)
700 0 : pCenterArea = aEngine.CreateTextObject();
701 38 : if (!pRightArea)
702 38 : pRightArea = aEngine.CreateTextObject();
703 : }
704 :
705 214 : bRet = true;
706 : }
707 : }
708 : }
709 :
710 214 : if (!bRet)
711 : {
712 : OSL_FAIL("exception - wrong argument");
713 : }
714 :
715 214 : return true;
716 : }
717 :
718 : //------------------------------------------------------------------------
719 :
720 0 : String ScPageHFItem::GetValueText() const
721 : {
722 0 : return rtl::OUString("ScPageHFItem");
723 : }
724 :
725 : //------------------------------------------------------------------------
726 :
727 1364 : int ScPageHFItem::operator==( const SfxPoolItem& rItem ) const
728 : {
729 : OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
730 :
731 1364 : const ScPageHFItem& r = (const ScPageHFItem&)rItem;
732 :
733 1364 : return ScGlobal::EETextObjEqual(pLeftArea, r.pLeftArea)
734 272 : && ScGlobal::EETextObjEqual(pCenterArea, r.pCenterArea)
735 1636 : && ScGlobal::EETextObjEqual(pRightArea, r.pRightArea);
736 : }
737 :
738 : //------------------------------------------------------------------------
739 :
740 1122 : SfxPoolItem* ScPageHFItem::Clone( SfxItemPool* ) const
741 : {
742 1122 : return new ScPageHFItem( *this );
743 : }
744 :
745 : //------------------------------------------------------------------------
746 :
747 0 : static void lcl_SetSpace( String& rStr, const ESelection& rSel )
748 : {
749 : // Text replaced by a space to ensure they are positions:
750 :
751 0 : xub_StrLen nLen = rSel.nEndPos-rSel.nStartPos;
752 0 : rStr.Erase( rSel.nStartPos, nLen-1 );
753 0 : rStr.SetChar( rSel.nStartPos, ' ' );
754 0 : }
755 :
756 0 : static bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands)
757 : {
758 0 : bool bChange = false;
759 0 : sal_uInt16 nParCnt = rEng.GetParagraphCount();
760 0 : for (sal_uInt16 nPar = 0; nPar<nParCnt; nPar++)
761 : {
762 0 : String aStr = rEng.GetText( nPar );
763 : xub_StrLen nPos;
764 :
765 0 : while ((nPos = aStr.Search(pCommands[0])) != STRING_NOTFOUND)
766 : {
767 0 : ESelection aSel( nPar,nPos, nPar,nPos+pCommands[0].Len() );
768 0 : rEng.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), aSel );
769 0 : lcl_SetSpace(aStr, aSel ); bChange = true;
770 : }
771 0 : while ((nPos = aStr.Search(pCommands[1])) != STRING_NOTFOUND)
772 : {
773 0 : ESelection aSel( nPar,nPos, nPar,nPos+pCommands[1].Len() );
774 0 : rEng.QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), aSel );
775 0 : lcl_SetSpace(aStr, aSel ); bChange = true;
776 : }
777 0 : while ((nPos = aStr.Search(pCommands[2])) != STRING_NOTFOUND)
778 : {
779 0 : ESelection aSel( nPar,nPos, nPar,nPos+pCommands[2].Len() );
780 0 : rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel );
781 0 : lcl_SetSpace(aStr, aSel ); bChange = true;
782 : }
783 0 : while ((nPos = aStr.Search(pCommands[3])) != STRING_NOTFOUND)
784 : {
785 0 : ESelection aSel( nPar,nPos, nPar,nPos+pCommands[3].Len() );
786 0 : rEng.QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD ), aSel );
787 0 : lcl_SetSpace(aStr, aSel ); bChange = true;
788 : }
789 0 : while ((nPos = aStr.Search(pCommands[4])) != STRING_NOTFOUND)
790 : {
791 0 : ESelection aSel( nPar,nPos, nPar,nPos+pCommands[4].Len() );
792 0 : rEng.QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), aSel );
793 0 : lcl_SetSpace(aStr, aSel ); bChange = true;
794 : }
795 0 : while ((nPos = aStr.Search(pCommands[5])) != STRING_NOTFOUND)
796 : {
797 0 : ESelection aSel( nPar,nPos, nPar,nPos+pCommands[5].Len() );
798 0 : rEng.QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), aSel );
799 0 : lcl_SetSpace(aStr, aSel ); bChange = true;
800 : }
801 0 : }
802 0 : return bChange;
803 : }
804 :
805 : #define SC_FIELD_COUNT 6
806 :
807 0 : SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
808 : {
809 0 : EditTextObject* pLeft = EditTextObject::Create(rStream);
810 0 : EditTextObject* pCenter = EditTextObject::Create(rStream);
811 0 : EditTextObject* pRight = EditTextObject::Create(rStream);
812 :
813 : OSL_ENSURE( pLeft && pCenter && pRight, "Error reading ScPageHFItem" );
814 :
815 0 : if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 ||
816 0 : pCenter == NULL || pCenter->GetParagraphCount() == 0 ||
817 0 : pRight == NULL || pRight->GetParagraphCount() == 0 )
818 : {
819 : // If successfully loaded, each object contains at least one paragraph.
820 : // Excel import in 5.1 created broken TextObjects (#67442#) that are
821 : // corrected here to avoid saving wrong files again (#90487#).
822 :
823 0 : ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), true );
824 0 : if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 )
825 : {
826 0 : delete pLeft;
827 0 : pLeft = aEngine.CreateTextObject();
828 : }
829 0 : if ( pCenter == NULL || pCenter->GetParagraphCount() == 0 )
830 : {
831 0 : delete pCenter;
832 0 : pCenter = aEngine.CreateTextObject();
833 : }
834 0 : if ( pRight == NULL || pRight->GetParagraphCount() == 0 )
835 : {
836 0 : delete pRight;
837 0 : pRight = aEngine.CreateTextObject();
838 0 : }
839 : }
840 :
841 0 : if ( nVer < 1 ) //old field command conversions
842 : {
843 : sal_uInt16 i;
844 0 : const String& rDel = ScGlobal::GetRscString( STR_HFCMD_DELIMITER );
845 0 : String aCommands[SC_FIELD_COUNT];
846 0 : for (i=0; i<SC_FIELD_COUNT; i++)
847 0 : aCommands[i] = rDel;
848 0 : aCommands[0] += ScGlobal::GetRscString(STR_HFCMD_PAGE);
849 0 : aCommands[1] += ScGlobal::GetRscString(STR_HFCMD_PAGES);
850 0 : aCommands[2] += ScGlobal::GetRscString(STR_HFCMD_DATE);
851 0 : aCommands[3] += ScGlobal::GetRscString(STR_HFCMD_TIME);
852 0 : aCommands[4] += ScGlobal::GetRscString(STR_HFCMD_FILE);
853 0 : aCommands[5] += ScGlobal::GetRscString(STR_HFCMD_TABLE);
854 0 : for (i=0; i<SC_FIELD_COUNT; i++)
855 0 : aCommands[i] += rDel;
856 :
857 0 : ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), true );
858 0 : aEngine.SetText(*pLeft);
859 0 : if (lcl_ConvertFields(aEngine,aCommands))
860 : {
861 0 : delete pLeft;
862 0 : pLeft = aEngine.CreateTextObject();
863 : }
864 0 : aEngine.SetText(*pCenter);
865 0 : if (lcl_ConvertFields(aEngine,aCommands))
866 : {
867 0 : delete pCenter;
868 0 : pCenter = aEngine.CreateTextObject();
869 : }
870 0 : aEngine.SetText(*pRight);
871 0 : if (lcl_ConvertFields(aEngine,aCommands))
872 : {
873 0 : delete pRight;
874 0 : pRight = aEngine.CreateTextObject();
875 0 : }
876 : }
877 : else if ( nVer < 2 )
878 : { // not to do, SvxFileField is not exchanged for SvxExtFileField
879 : }
880 :
881 0 : ScPageHFItem* pItem = new ScPageHFItem( Which() );
882 0 : pItem->SetArea( pLeft, SC_HF_LEFTAREA );
883 0 : pItem->SetArea( pCenter, SC_HF_CENTERAREA );
884 0 : pItem->SetArea( pRight, SC_HF_RIGHTAREA );
885 :
886 0 : return pItem;
887 : }
888 :
889 : //------------------------------------------------------------------------
890 :
891 :
892 288 : void ScPageHFItem::SetLeftArea( const EditTextObject& rNew )
893 : {
894 288 : delete pLeftArea;
895 288 : pLeftArea = rNew.Clone();
896 288 : }
897 :
898 : //------------------------------------------------------------------------
899 :
900 348 : void ScPageHFItem::SetCenterArea( const EditTextObject& rNew )
901 : {
902 348 : delete pCenterArea;
903 348 : pCenterArea = rNew.Clone();
904 348 : }
905 :
906 : //------------------------------------------------------------------------
907 :
908 286 : void ScPageHFItem::SetRightArea( const EditTextObject& rNew )
909 : {
910 286 : delete pRightArea;
911 286 : pRightArea = rNew.Clone();
912 286 : }
913 :
914 0 : void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea )
915 : {
916 0 : switch ( nArea )
917 : {
918 0 : case SC_HF_LEFTAREA: delete pLeftArea; pLeftArea = pNew; break;
919 0 : case SC_HF_CENTERAREA: delete pCenterArea; pCenterArea = pNew; break;
920 0 : case SC_HF_RIGHTAREA: delete pRightArea; pRightArea = pNew; break;
921 : default:
922 : OSL_FAIL( "New Area?" );
923 : }
924 0 : }
925 :
926 : //-----------------------------------------------------------------------
927 : // ScViewObjectModeItem - Display Mode of View Objects
928 : //-----------------------------------------------------------------------
929 :
930 585 : ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP )
931 585 : : SfxEnumItem( nWhichP, VOBJ_MODE_SHOW )
932 : {
933 585 : }
934 :
935 : //------------------------------------------------------------------------
936 :
937 0 : ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP, ScVObjMode eMode )
938 0 : : SfxEnumItem( nWhichP, sal::static_int_cast<sal_uInt16>(eMode) )
939 : {
940 0 : }
941 :
942 : //------------------------------------------------------------------------
943 :
944 654 : ScViewObjectModeItem::~ScViewObjectModeItem()
945 : {
946 654 : }
947 :
948 : //------------------------------------------------------------------------
949 :
950 0 : SfxItemPresentation ScViewObjectModeItem::GetPresentation
951 : (
952 : SfxItemPresentation ePres,
953 : SfxMapUnit /* eCoreUnit */,
954 : SfxMapUnit /* ePresUnit */,
955 : String& rText,
956 : const IntlWrapper* /* pIntl */
957 : ) const
958 : {
959 0 : rtl::OUString aDel(": ");
960 0 : rText.Erase();
961 :
962 0 : switch ( ePres )
963 : {
964 : case SFX_ITEM_PRESENTATION_COMPLETE:
965 0 : switch( Which() )
966 : {
967 : case SID_SCATTR_PAGE_CHARTS:
968 0 : rText = ScGlobal::GetRscString(STR_VOBJ_CHART);
969 0 : rText += aDel;
970 0 : break;
971 :
972 : case SID_SCATTR_PAGE_OBJECTS:
973 0 : rText = ScGlobal::GetRscString(STR_VOBJ_OBJECT);
974 0 : rText += aDel;
975 0 : break;
976 :
977 : case SID_SCATTR_PAGE_DRAWINGS:
978 0 : rText = ScGlobal::GetRscString(STR_VOBJ_DRAWINGS);
979 0 : rText += aDel;
980 0 : break;
981 :
982 : default:
983 0 : ePres = SFX_ITEM_PRESENTATION_NAMELESS;//this always goes!
984 0 : break;
985 : }
986 : /* !!! fall-through !!! */
987 :
988 : case SFX_ITEM_PRESENTATION_NAMELESS:
989 0 : rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue());
990 0 : break;
991 :
992 : default:
993 : {
994 : // added to avoid warnings
995 : }
996 : }
997 :
998 0 : return ePres;
999 : }
1000 :
1001 : //------------------------------------------------------------------------
1002 :
1003 0 : String ScViewObjectModeItem::GetValueText( sal_uInt16 nVal ) const
1004 : {
1005 : OSL_ENSURE( nVal <= VOBJ_MODE_HIDE, "enum overflow!" );
1006 :
1007 0 : return ScGlobal::GetRscString( STR_VOBJ_MODE_SHOW + (nVal % 2));
1008 : }
1009 :
1010 : //------------------------------------------------------------------------
1011 :
1012 0 : sal_uInt16 ScViewObjectModeItem::GetValueCount() const
1013 : {
1014 0 : return 2;
1015 : }
1016 :
1017 : //------------------------------------------------------------------------
1018 :
1019 0 : SfxPoolItem* ScViewObjectModeItem::Clone( SfxItemPool* ) const
1020 : {
1021 0 : return new ScViewObjectModeItem( *this );
1022 : }
1023 :
1024 : //------------------------------------------------------------------------
1025 :
1026 0 : sal_uInt16 ScViewObjectModeItem::GetVersion( sal_uInt16 /* nFileVersion */ ) const
1027 : {
1028 0 : return 1;
1029 : }
1030 :
1031 : //------------------------------------------------------------------------
1032 :
1033 0 : SfxPoolItem* ScViewObjectModeItem::Create(
1034 : SvStream& rStream,
1035 : sal_uInt16 nVersion ) const
1036 : {
1037 0 : if ( nVersion == 0 )
1038 : {
1039 : // Old Version with AllEnuItem -> produce with Mode "Show"
1040 0 : return new ScViewObjectModeItem( Which() );
1041 : }
1042 : else
1043 : {
1044 : sal_uInt16 nVal;
1045 0 : rStream >> nVal;
1046 :
1047 : //#i80528# adapt to new range eventually
1048 0 : if((sal_uInt16)VOBJ_MODE_HIDE < nVal) nVal = (sal_uInt16)VOBJ_MODE_SHOW;
1049 :
1050 0 : return new ScViewObjectModeItem( Which(), (ScVObjMode)nVal);
1051 : }
1052 : }
1053 :
1054 : // -----------------------------------------------------------------------
1055 : // double
1056 : // -----------------------------------------------------------------------
1057 :
1058 0 : ScDoubleItem::ScDoubleItem( sal_uInt16 nWhichP, double nVal )
1059 : : SfxPoolItem ( nWhichP ),
1060 0 : nValue ( nVal )
1061 : {
1062 0 : }
1063 :
1064 : //------------------------------------------------------------------------
1065 :
1066 0 : ScDoubleItem::ScDoubleItem( const ScDoubleItem& rItem )
1067 0 : : SfxPoolItem ( rItem )
1068 : {
1069 0 : nValue = rItem.nValue;
1070 0 : }
1071 :
1072 : //------------------------------------------------------------------------
1073 :
1074 0 : String ScDoubleItem::GetValueText() const
1075 : {
1076 0 : return rtl::OUString("ScDoubleItem");
1077 : }
1078 :
1079 : //------------------------------------------------------------------------
1080 :
1081 0 : int ScDoubleItem::operator==( const SfxPoolItem& rItem ) const
1082 : {
1083 : OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
1084 0 : const ScDoubleItem& _rItem = (const ScDoubleItem&)rItem;
1085 0 : return int(nValue == _rItem.nValue);
1086 : }
1087 :
1088 : //------------------------------------------------------------------------
1089 :
1090 0 : SfxPoolItem* ScDoubleItem::Clone( SfxItemPool* ) const
1091 : {
1092 0 : return new ScDoubleItem( *this );
1093 : }
1094 :
1095 : //------------------------------------------------------------------------
1096 :
1097 0 : SfxPoolItem* ScDoubleItem::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const
1098 : {
1099 0 : double nTmp=0;
1100 0 : rStream >> nTmp;
1101 :
1102 0 : ScDoubleItem* pItem = new ScDoubleItem( Which(), nTmp );
1103 :
1104 0 : return pItem;
1105 : }
1106 :
1107 : //------------------------------------------------------------------------
1108 :
1109 0 : ScDoubleItem::~ScDoubleItem()
1110 : {
1111 0 : }
1112 :
1113 :
1114 : // ============================================================================
1115 :
1116 242 : ScPageScaleToItem::ScPageScaleToItem() :
1117 : SfxPoolItem( ATTR_PAGE_SCALETO ),
1118 : mnWidth( 0 ),
1119 242 : mnHeight( 0 )
1120 : {
1121 242 : }
1122 :
1123 195 : ScPageScaleToItem::ScPageScaleToItem( sal_uInt16 nWidth, sal_uInt16 nHeight ) :
1124 : SfxPoolItem( ATTR_PAGE_SCALETO ),
1125 : mnWidth( nWidth ),
1126 195 : mnHeight( nHeight )
1127 : {
1128 195 : }
1129 :
1130 928 : ScPageScaleToItem::~ScPageScaleToItem()
1131 : {
1132 928 : }
1133 :
1134 242 : ScPageScaleToItem* ScPageScaleToItem::Clone( SfxItemPool* ) const
1135 : {
1136 242 : return new ScPageScaleToItem( *this );
1137 : }
1138 :
1139 0 : int ScPageScaleToItem::operator==( const SfxPoolItem& rCmp ) const
1140 : {
1141 : OSL_ENSURE( SfxPoolItem::operator==( rCmp ), "ScPageScaleToItem::operator== - unequal wid or type" );
1142 0 : const ScPageScaleToItem& rPageCmp = static_cast< const ScPageScaleToItem& >( rCmp );
1143 0 : return ((mnWidth == rPageCmp.mnWidth) && (mnHeight == rPageCmp.mnHeight)) ? 1 : 0;
1144 : }
1145 :
1146 : namespace {
1147 0 : void lclAppendScalePageCount( String& rText, sal_uInt16 nPages )
1148 : {
1149 0 : rText.AppendAscii( ": " );
1150 0 : if( nPages )
1151 : {
1152 0 : String aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) );
1153 0 : aPages.SearchAndReplaceAscii( "%1", String::CreateFromInt32( nPages ) );
1154 0 : rText.Append( aPages );
1155 : }
1156 : else
1157 0 : rText.Append( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_AUTO ) );
1158 0 : }
1159 : } // namespace
1160 :
1161 0 : SfxItemPresentation ScPageScaleToItem::GetPresentation(
1162 : SfxItemPresentation ePres, SfxMapUnit, SfxMapUnit, XubString& rText, const IntlWrapper* ) const
1163 : {
1164 0 : rText.Erase();
1165 0 : if( !IsValid() || (ePres == SFX_ITEM_PRESENTATION_NONE) )
1166 0 : return SFX_ITEM_PRESENTATION_NONE;
1167 :
1168 0 : String aName( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETO ) );
1169 0 : String aValue( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_WIDTH ) );
1170 0 : lclAppendScalePageCount( aValue, mnWidth );
1171 0 : aValue.AppendAscii( ", " ).Append( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_HEIGHT ) );
1172 0 : lclAppendScalePageCount( aValue, mnHeight );
1173 :
1174 0 : switch( ePres )
1175 : {
1176 : case SFX_ITEM_PRESENTATION_NONE:
1177 0 : break;
1178 :
1179 : case SFX_ITEM_PRESENTATION_NAMEONLY:
1180 0 : rText = aName;
1181 0 : break;
1182 :
1183 : case SFX_ITEM_PRESENTATION_NAMELESS:
1184 0 : rText = aValue;
1185 0 : break;
1186 :
1187 : case SFX_ITEM_PRESENTATION_COMPLETE:
1188 0 : rText.Assign( aName ).AppendAscii( " (" ).Append( aValue ).Append( ')' );
1189 0 : break;
1190 :
1191 : default:
1192 : OSL_FAIL( "ScPageScaleToItem::GetPresentation - unknown presentation mode" );
1193 0 : ePres = SFX_ITEM_PRESENTATION_NONE;
1194 : }
1195 0 : return ePres;
1196 : }
1197 :
1198 0 : bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const
1199 : {
1200 0 : bool bRet = true;
1201 0 : switch( nMemberId )
1202 : {
1203 0 : case SC_MID_PAGE_SCALETO_WIDTH: rAny <<= mnWidth; break;
1204 0 : case SC_MID_PAGE_SCALETO_HEIGHT: rAny <<= mnHeight; break;
1205 : default:
1206 : OSL_FAIL( "ScPageScaleToItem::QueryValue - unknown member ID" );
1207 0 : bRet = false;
1208 : }
1209 0 : return bRet;
1210 : }
1211 :
1212 0 : bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId )
1213 : {
1214 0 : bool bRet = false;
1215 0 : switch( nMemberId )
1216 : {
1217 0 : case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break;
1218 0 : case SC_MID_PAGE_SCALETO_HEIGHT: bRet = rAny >>= mnHeight; break;
1219 : default:
1220 : OSL_FAIL( "ScPageScaleToItem::PutValue - unknown member ID" );
1221 : }
1222 0 : return bRet;
1223 : }
1224 :
1225 : // ============================================================================
1226 :
1227 244 : ScCondFormatItem::ScCondFormatItem():
1228 244 : SfxPoolItem( ATTR_CONDITIONAL )
1229 : {
1230 244 : }
1231 :
1232 34 : ScCondFormatItem::ScCondFormatItem( const std::vector<sal_uInt32>& rIndex ):
1233 : SfxPoolItem( ATTR_CONDITIONAL ),
1234 34 : maIndex( rIndex )
1235 : {
1236 34 : }
1237 :
1238 303 : ScCondFormatItem::~ScCondFormatItem()
1239 : {
1240 303 : }
1241 :
1242 124 : int ScCondFormatItem::operator==( const SfxPoolItem& rCmp ) const
1243 : {
1244 124 : return maIndex == static_cast<const ScCondFormatItem&>(rCmp).maIndex;
1245 : }
1246 :
1247 34 : ScCondFormatItem* ScCondFormatItem::Clone(SfxItemPool*) const
1248 : {
1249 34 : return new ScCondFormatItem(maIndex);
1250 : }
1251 :
1252 303493 : const std::vector<sal_uInt32>& ScCondFormatItem::GetCondFormatData() const
1253 : {
1254 303493 : return maIndex;
1255 : }
1256 :
1257 0 : void ScCondFormatItem::AddCondFormatData( sal_uInt32 nIndex )
1258 : {
1259 0 : maIndex.push_back(nIndex);
1260 0 : }
1261 :
1262 49 : void ScCondFormatItem::SetCondFormatData( const std::vector<sal_uInt32>& rIndex )
1263 : {
1264 49 : maIndex = rIndex;
1265 49 : }
1266 :
1267 :
1268 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|