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; }
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SW_DLLPUBLIC SwTableBoxNumFormat : public SfxUInt32Item
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2017-03-20 09:10:55 +01:00
|
|
|
bool m_bAuto; ///< automatically given flag
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwTableBoxNumFormat( sal_uInt32 nFormat = css::util::NumberFormat::TEXT,
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bAuto = false );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-11-15 11:59:57 +00:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const override;
|
2015-11-10 10:25:48 +01:00
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
SwTableBoxNumFormat& operator=( const SwTableBoxNumFormat& rAttr )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SetValue( rAttr.GetValue() );
|
2017-03-20 09:10:55 +01:00
|
|
|
m_bAuto = rAttr.m_bAuto;
|
2000-09-18 16:15:01 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwTableBoxFormula : public SfxPoolItem, public SwTableFormula
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2017-03-13 09:16:13 +01:00
|
|
|
SwModify* m_pDefinedIn; // Modify object where the formula is located
|
2010-11-15 23:37:49 +01:00
|
|
|
// can only be TableBoxFormat
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwTableBoxFormula( const OUString& rFormula );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-11-15 11:59:57 +00:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const override;
|
2015-11-10 10:25:48 +01:00
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-03-13 09:16:13 +01:00
|
|
|
const SwModify* GetDefinedIn() const { return m_pDefinedIn; }
|
2017-03-03 20:57:02 +01:00
|
|
|
void ChgDefinedIn( const SwModify* pNew )
|
2017-03-13 09:16:13 +01:00
|
|
|
{ m_pDefinedIn = const_cast<SwModify*>(pNew); }
|
2000-09-18 16:15:01 +00:00
|
|
|
// BoxAttribut -> BoxStartNode
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual const SwNode* GetNodeOfFormula() const override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SwTableBox* GetTableBox();
|
|
|
|
const SwTableBox* GetTableBox() const
|
2015-05-20 13:05:49 +02:00
|
|
|
{ return const_cast<SwTableBoxFormula*>(this)->GetTableBox(); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
void ChangeState( const SfxPoolItem* pItem );
|
2015-05-20 13:05:49 +02:00
|
|
|
void Calc( SwTableCalcPara& rCalcPara, double& rValue );
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SW_DLLPUBLIC SwTableBoxValue : public SfxPoolItem
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2017-03-27 09:11:05 +02:00
|
|
|
double m_nValue;
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwTableBoxValue();
|
|
|
|
SwTableBoxValue( const double aVal );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-11-15 11:59:57 +00:00
|
|
|
// "pure virtual methods" of SfxPoolItem
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const override;
|
2015-11-10 10:25:48 +01:00
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
SwTableBoxValue& operator=( const SwTableBoxValue& rCmp )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2017-03-27 09:11:05 +02:00
|
|
|
m_nValue = rCmp.m_nValue;
|
2000-09-18 16:15:01 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2017-03-27 09:11:05 +02:00
|
|
|
double GetValue() const { return m_nValue; }
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
inline const SwTableBoxNumFormat &SwAttrSet::GetTableBoxNumFormat(bool bInP) const
|
|
|
|
{ return static_cast<const SwTableBoxNumFormat&>(Get( RES_BOXATR_FORMAT,bInP)); }
|
|
|
|
inline const SwTableBoxFormula &SwAttrSet::GetTableBoxFormula(bool bInP) const
|
|
|
|
{ return static_cast<const SwTableBoxFormula&>(Get( RES_BOXATR_FORMULA,bInP)); }
|
|
|
|
inline const SwTableBoxValue &SwAttrSet::GetTableBoxValue(bool bInP) const
|
|
|
|
{ return static_cast<const SwTableBoxValue&>(Get( RES_BOXATR_VALUE, bInP)); }
|
|
|
|
|
|
|
|
inline const SwTableBoxNumFormat &SwFormat::GetTableBoxNumFormat(bool bInP) const
|
|
|
|
{ return m_aSet.GetTableBoxNumFormat(bInP); }
|
|
|
|
inline const SwTableBoxFormula &SwFormat::GetTableBoxFormula(bool bInP) const
|
|
|
|
{ return m_aSet.GetTableBoxFormula(bInP); }
|
|
|
|
inline const SwTableBoxValue &SwFormat::GetTableBoxValue(bool bInP) const
|
|
|
|
{ return m_aSet.GetTableBoxValue(bInP); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|