handler of table cell color

This commit is contained in:
Oliver Specht 2007-05-03 05:24:01 +00:00
parent 897f4ede21
commit 8c612cc146
2 changed files with 180 additions and 0 deletions

View file

@ -0,0 +1,110 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: CellColorHandler.cxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: os $ $Date: 2007-05-03 06:23:30 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef INCLUDED_CELLCOLORHANDLER_HXX
#include <CellColorHandler.hxx>
#endif
#ifndef INCLUDED_DMAPPER_PROPERTYMAP_HXX
#include <PropertyMap.hxx>
#endif
#ifndef INCLUDED_RESOURCESIDS
#include <doctok/resourceids.hxx>
#endif
#ifndef INCLUDED_DMAPPER_CONVERSIONHELPER_HXX
#include <ConversionHelper.hxx>
#endif
namespace dmapper {
using namespace ::com::sun::star;
//using namespace ::std;
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
CellColorHandler::CellColorHandler()
{
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
CellColorHandler::~CellColorHandler()
{
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
void CellColorHandler::attribute(doctok::Id rName, doctok::Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)nIntValue;
(void)rName;
switch( rName )
{
case NS_rtf::LN_cellTopColor:
case NS_rtf::LN_cellLeftColor:
case NS_rtf::LN_cellBottomColor:
case NS_rtf::LN_cellRightColor:
// nIntValue contains the color, directly
break;
// case NS_rtf::LN_rgbrc:
// {
// doctok::Reference<Properties>::Pointer_t pProperties = rVal.getProperties();
// if( pProperties.get())
// {
// pProperties->resolve(*this);
// //
// }
// }
// break;
default:
OSL_ASSERT("unknown attribute");
}
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
void CellColorHandler::sprm(doctok::Sprm & rSprm)
{
(void)rSprm;
}
/*-- 24.04.2007 09:09:01---------------------------------------------------
-----------------------------------------------------------------------*/
PropertyMapPtr CellColorHandler::getProperties()
{
PropertyMapPtr pPropertyMap(new PropertyMap);
return pPropertyMap;
}
} //namespace dmapper

View file

@ -0,0 +1,70 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: CellColorHandler.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: os $ $Date: 2007-05-03 06:24:01 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef INCLUDED_CELLCOLORHANDLER_HXX
#define INCLUDED_CELLCOLORHANDLER_HXX
#ifndef INCLUDED_WRITERFILTERDLLAPI_H
#include <WriterFilterDllApi.hxx>
#endif
#include <doctok/WW8ResourceModel.hxx>
#include <boost/shared_ptr.hpp>
//#include <com/sun/star/table/TableBorder.hpp>
#ifndef _COM_SUN_STAR_TABLE_BORDERLINE_HPP_
#include <com/sun/star/table/BorderLine.hpp>
#endif
namespace dmapper
{
class PropertyMap;
class WRITERFILTER_DLLPRIVATE CellColorHandler : public doctok::Properties
{
public:
private:
public:
CellColorHandler( );
virtual ~CellColorHandler();
// Properties
virtual void attribute(doctok::Id Name, doctok::Value & val);
virtual void sprm(doctok::Sprm & sprm);
::boost::shared_ptr<PropertyMap> getProperties();
};
typedef boost::shared_ptr< CellColorHandler > CellColorHandlerPtr;
}
#endif //