2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_CELLATR_HXX
|
|
|
|
#define INCLUDED_SW_INC_CELLATR_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/intitem.hxx>
|
|
|
|
#include <svl/zforlist.hxx>
|
2004-08-23 07:28:40 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include "format.hxx"
|
|
|
|
#include "cellfml.hxx"
|
|
|
|
|
2013-08-21 23:17:58 +02:00
|
|
|
namespace rtl { class OUString; }
|
|
|
|
|
2004-08-23 07:28:40 +00:00
|
|
|
class SW_DLLPUBLIC SwTblBoxNumFormat : public SfxUInt32Item
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2012-07-22 11:29:48 +03:00
|
|
|
sal_Bool bAuto; ///< automatically given flag
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTblBoxNumFormat( sal_uInt32 nFormat = NUMBERFORMAT_TEXT,
|
|
|
|
sal_Bool bAuto = sal_False );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-11-15 11:59:57 +00:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
|
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
inline SwTblBoxNumFormat& operator=( const SwTblBoxNumFormat& rAttr )
|
|
|
|
{
|
|
|
|
SetValue( rAttr.GetValue() );
|
|
|
|
SetAutoFlag( rAttr.GetAutoFlag() );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool GetAutoFlag() const { return bAuto; }
|
|
|
|
void SetAutoFlag( sal_Bool bFlag = sal_True ) { bAuto = bFlag; }
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SwTblBoxFormula : public SfxPoolItem, public SwTableFormula
|
|
|
|
{
|
2010-11-15 23:37:49 +01:00
|
|
|
SwModify* pDefinedIn; // Modify object where the formula is located
|
|
|
|
// can only be TableBoxFormat
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
public:
|
2013-08-21 23:17:58 +02:00
|
|
|
SwTblBoxFormula( const OUString& rFormula );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~SwTblBoxFormula() {};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-11-15 11:59:57 +00:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
|
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
|
|
|
|
inline void ChgDefinedIn( const SwModify* pNew )
|
|
|
|
{ pDefinedIn = (SwModify*)pNew; }
|
|
|
|
// BoxAttribut -> BoxStartNode
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual const SwNode* GetNodeOfFormula() const SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SwTableBox* GetTableBox();
|
|
|
|
const SwTableBox* GetTableBox() const
|
|
|
|
{ return ((SwTblBoxFormula*)this)->GetTableBox(); }
|
|
|
|
|
|
|
|
void ChangeState( const SfxPoolItem* pItem );
|
|
|
|
void Calc( SwTblCalcPara& rCalcPara, double& rValue );
|
|
|
|
};
|
|
|
|
|
2004-08-23 07:28:40 +00:00
|
|
|
class SW_DLLPUBLIC SwTblBoxValue : public SfxPoolItem
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
double nValue;
|
|
|
|
public:
|
|
|
|
SwTblBoxValue();
|
|
|
|
SwTblBoxValue( const double aVal );
|
|
|
|
|
2010-11-15 11:59:57 +00:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
|
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
inline SwTblBoxValue& operator=( const SwTblBoxValue& rCmp )
|
|
|
|
{
|
|
|
|
nValue = rCmp.nValue;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
double GetValue() const { return nValue; }
|
|
|
|
};
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline const SwTblBoxNumFormat &SwAttrSet::GetTblBoxNumFmt(sal_Bool bInP) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{ return (const SwTblBoxNumFormat&)Get( RES_BOXATR_FORMAT,bInP); }
|
2011-01-17 15:06:54 +01:00
|
|
|
inline const SwTblBoxFormula &SwAttrSet::GetTblBoxFormula(sal_Bool bInP) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{ return (const SwTblBoxFormula&)Get( RES_BOXATR_FORMULA,bInP); }
|
2011-01-17 15:06:54 +01:00
|
|
|
inline const SwTblBoxValue &SwAttrSet::GetTblBoxValue(sal_Bool bInP) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{ return (const SwTblBoxValue&)Get( RES_BOXATR_VALUE, bInP); }
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline const SwTblBoxNumFormat &SwFmt::GetTblBoxNumFmt(sal_Bool bInP) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{ return aSet.GetTblBoxNumFmt(bInP); }
|
2011-01-17 15:06:54 +01:00
|
|
|
inline const SwTblBoxFormula &SwFmt::GetTblBoxFormula(sal_Bool bInP) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{ return aSet.GetTblBoxFormula(bInP); }
|
2011-01-17 15:06:54 +01:00
|
|
|
inline const SwTblBoxValue &SwFmt::GetTblBoxValue(sal_Bool bInP) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{ return aSet.GetTblBoxValue(bInP); }
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|