LCOV - code coverage report
Current view: top level - sc/source/core/data - attrib.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 200 529 37.8 %
Date: 2014-04-11 Functions: 84 140 60.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10