2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 00:53:06 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 00:53:06 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 00:53:06 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 00:53:06 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 00:53:06 +00:00
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 00:53:06 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 04:19:15 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svx.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// include ---------------------------------------------------------------
|
|
|
|
|
2007-06-27 17:28:37 +00:00
|
|
|
#include <svx/svxids.hrc>
|
2011-09-23 14:05:07 +01:00
|
|
|
#include <svx/drawitem.hxx>
|
2007-06-27 17:28:37 +00:00
|
|
|
#include <svx/xtable.hxx>
|
2004-07-06 12:16:29 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
TYPEINIT1_FACTORY( SvxColorListItem, SfxPoolItem , new SvxColorListItem );
|
|
|
|
TYPEINIT1_FACTORY( SvxGradientListItem, SfxPoolItem , new SvxGradientListItem );
|
|
|
|
TYPEINIT1_FACTORY( SvxHatchListItem, SfxPoolItem , new SvxHatchListItem );
|
|
|
|
TYPEINIT1_FACTORY( SvxBitmapListItem, SfxPoolItem , new SvxBitmapListItem );
|
|
|
|
TYPEINIT1_FACTORY( SvxDashListItem, SfxPoolItem , new SvxDashListItem );
|
|
|
|
TYPEINIT1_FACTORY( SvxLineEndListItem, SfxPoolItem , new SvxLineEndListItem );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
//
|
2011-09-23 14:05:07 +01:00
|
|
|
// SvxColorListItem
|
2000-09-18 16:07:07 +00:00
|
|
|
//
|
|
|
|
//==================================================================
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxColorListItem::SvxColorListItem()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxColorListItem::SvxColorListItem( XColorListRef pTable, sal_uInt16 nW ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( nW ),
|
2011-09-23 14:05:07 +01:00
|
|
|
pColorList( pTable )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxColorListItem::SvxColorListItem( const SvxColorListItem& rItem ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( rItem ),
|
2011-09-23 14:05:07 +01:00
|
|
|
pColorList( rItem.pColorList )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SfxItemPresentation SvxColorListItem::GetPresentation
|
2000-09-18 16:07:07 +00:00
|
|
|
(
|
2006-06-19 15:11:00 +00:00
|
|
|
SfxItemPresentation /*ePres*/,
|
|
|
|
SfxMapUnit /*eCoreUnit*/,
|
|
|
|
SfxMapUnit /*ePresUnit*/,
|
2001-05-13 02:33:31 +00:00
|
|
|
XubString& rText, const IntlWrapper *
|
2000-09-18 16:07:07 +00:00
|
|
|
) const
|
|
|
|
{
|
|
|
|
rText.Erase();
|
|
|
|
return SFX_ITEM_PRESENTATION_NONE;
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
int SvxColorListItem::operator==( const SfxPoolItem& rItem ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
|
2011-09-23 14:05:07 +01:00
|
|
|
return ( ( SvxColorListItem& ) rItem).pColorList == pColorList;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SfxPoolItem* SvxColorListItem::Clone( SfxItemPool * ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-09-23 14:05:07 +01:00
|
|
|
return new SvxColorListItem( *this );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-06 12:16:29 +00:00
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
// Should be a template class but ...
|
|
|
|
#define QUERY_PUT_IMPL(svtype, xtype) \
|
|
|
|
bool svtype::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const \
|
|
|
|
{ \
|
|
|
|
rVal = uno::makeAny( uno::Reference< uno::XWeak >( p##xtype.get() ) ); \
|
|
|
|
return true; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
bool svtype::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) \
|
|
|
|
{ \
|
|
|
|
uno::Reference< uno::XWeak > xRef; \
|
|
|
|
if( rVal >>= xRef ) { \
|
|
|
|
p##xtype = X##xtype##Ref(dynamic_cast<X##xtype *>(xRef.get())); \
|
|
|
|
return true; \
|
|
|
|
} \
|
|
|
|
return false; \
|
2004-07-06 12:16:29 +00:00
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
QUERY_PUT_IMPL( SvxColorListItem, ColorList )
|
2004-07-06 12:16:29 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//==================================================================
|
|
|
|
//
|
|
|
|
// SvxGradientListItem
|
|
|
|
//
|
|
|
|
//==================================================================
|
|
|
|
|
|
|
|
SvxGradientListItem::SvxGradientListItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxGradientListItem::SvxGradientListItem( XGradientListRef pList, sal_uInt16 nW ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( nW ),
|
|
|
|
pGradientList( pList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SvxGradientListItem::SvxGradientListItem( const SvxGradientListItem& rItem ) :
|
|
|
|
SfxPoolItem( rItem ),
|
|
|
|
pGradientList( rItem.pGradientList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
SfxItemPresentation SvxGradientListItem::GetPresentation
|
|
|
|
(
|
2006-06-19 15:11:00 +00:00
|
|
|
SfxItemPresentation /*ePres*/,
|
|
|
|
SfxMapUnit /*eCoreUnit*/,
|
|
|
|
SfxMapUnit /*ePresUnit*/,
|
2001-05-13 02:33:31 +00:00
|
|
|
XubString& rText, const IntlWrapper *
|
2000-09-18 16:07:07 +00:00
|
|
|
) const
|
|
|
|
{
|
|
|
|
rText.Erase();
|
|
|
|
return SFX_ITEM_PRESENTATION_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int SvxGradientListItem::operator==( const SfxPoolItem& rItem ) const
|
|
|
|
{
|
|
|
|
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
|
|
|
|
return ( ( SvxGradientListItem& ) rItem).pGradientList == pGradientList;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SfxPoolItem* SvxGradientListItem::Clone( SfxItemPool * ) const
|
|
|
|
{
|
|
|
|
return new SvxGradientListItem( *this );
|
|
|
|
}
|
|
|
|
|
2004-07-06 12:16:29 +00:00
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
QUERY_PUT_IMPL( SvxGradientListItem, GradientList )
|
2004-07-06 12:16:29 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//==================================================================
|
|
|
|
//
|
|
|
|
// SvxHatchListItem
|
|
|
|
//
|
|
|
|
//==================================================================
|
|
|
|
|
|
|
|
SvxHatchListItem::SvxHatchListItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxHatchListItem::SvxHatchListItem( XHatchListRef pList, sal_uInt16 nW ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( nW ),
|
|
|
|
pHatchList( pList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SvxHatchListItem::SvxHatchListItem( const SvxHatchListItem& rItem ) :
|
|
|
|
SfxPoolItem( rItem ),
|
|
|
|
pHatchList( rItem.pHatchList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
SfxItemPresentation SvxHatchListItem::GetPresentation
|
|
|
|
(
|
2006-06-19 15:11:00 +00:00
|
|
|
SfxItemPresentation /*ePres*/,
|
|
|
|
SfxMapUnit /*eCoreUnit*/,
|
|
|
|
SfxMapUnit /*ePresUnit*/,
|
2001-05-13 02:33:31 +00:00
|
|
|
XubString& rText, const IntlWrapper *
|
2000-09-18 16:07:07 +00:00
|
|
|
) const
|
|
|
|
{
|
|
|
|
rText.Erase();
|
|
|
|
return SFX_ITEM_PRESENTATION_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int SvxHatchListItem::operator==( const SfxPoolItem& rItem ) const
|
|
|
|
{
|
|
|
|
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
|
|
|
|
return ( ( SvxHatchListItem& ) rItem).pHatchList == pHatchList;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SfxPoolItem* SvxHatchListItem::Clone( SfxItemPool * ) const
|
|
|
|
{
|
|
|
|
return new SvxHatchListItem( *this );
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
QUERY_PUT_IMPL( SvxHatchListItem, HatchList )
|
2004-07-06 12:16:29 +00:00
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//==================================================================
|
|
|
|
//
|
|
|
|
// SvxBitmapListItem
|
|
|
|
//
|
|
|
|
//==================================================================
|
|
|
|
|
|
|
|
SvxBitmapListItem::SvxBitmapListItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxBitmapListItem::SvxBitmapListItem( XBitmapListRef pList, sal_uInt16 nW ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( nW ),
|
|
|
|
pBitmapList( pList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SvxBitmapListItem::SvxBitmapListItem( const SvxBitmapListItem& rItem ) :
|
|
|
|
SfxPoolItem( rItem ),
|
|
|
|
pBitmapList( rItem.pBitmapList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemPresentation SvxBitmapListItem::GetPresentation
|
|
|
|
(
|
2006-06-19 15:11:00 +00:00
|
|
|
SfxItemPresentation /*ePres*/,
|
|
|
|
SfxMapUnit /*eCoreUnit*/,
|
|
|
|
SfxMapUnit /*ePresUnit*/,
|
2001-05-13 02:33:31 +00:00
|
|
|
XubString& rText, const IntlWrapper *
|
2000-09-18 16:07:07 +00:00
|
|
|
) const
|
|
|
|
{
|
|
|
|
rText.Erase();
|
|
|
|
return SFX_ITEM_PRESENTATION_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SvxBitmapListItem::operator==( const SfxPoolItem& rItem ) const
|
|
|
|
{
|
|
|
|
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
|
|
|
|
return ( ( SvxBitmapListItem& ) rItem).pBitmapList == pBitmapList;
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxPoolItem* SvxBitmapListItem::Clone( SfxItemPool * ) const
|
|
|
|
{
|
|
|
|
return new SvxBitmapListItem( *this );
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
QUERY_PUT_IMPL( SvxBitmapListItem, BitmapList )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
//
|
|
|
|
// SvxDashListItem
|
|
|
|
//
|
|
|
|
//==================================================================
|
|
|
|
|
2004-07-06 12:16:29 +00:00
|
|
|
SvxDashListItem::SvxDashListItem() :
|
|
|
|
pDashList( 0 )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxDashListItem::SvxDashListItem( XDashListRef pList, sal_uInt16 nW ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( nW ),
|
|
|
|
pDashList( pList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SvxDashListItem::SvxDashListItem( const SvxDashListItem& rItem ) :
|
|
|
|
SfxPoolItem( rItem ),
|
|
|
|
pDashList( rItem.pDashList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemPresentation SvxDashListItem::GetPresentation
|
|
|
|
(
|
2006-06-19 15:11:00 +00:00
|
|
|
SfxItemPresentation /*ePres*/,
|
|
|
|
SfxMapUnit /*eCoreUnit*/,
|
|
|
|
SfxMapUnit /*ePresUnit*/,
|
2001-05-13 02:33:31 +00:00
|
|
|
XubString& rText, const IntlWrapper *
|
2000-09-18 16:07:07 +00:00
|
|
|
) const
|
|
|
|
{
|
|
|
|
rText.Erase();
|
|
|
|
return SFX_ITEM_PRESENTATION_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
|
|
|
|
{
|
|
|
|
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
|
|
|
|
return ( ( SvxDashListItem& ) rItem).pDashList == pDashList;
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxPoolItem* SvxDashListItem::Clone( SfxItemPool * ) const
|
|
|
|
{
|
|
|
|
return new SvxDashListItem( *this );
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
QUERY_PUT_IMPL( SvxDashListItem, DashList )
|
2004-07-06 12:16:29 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//==================================================================
|
|
|
|
//
|
|
|
|
// SvxLineEndListItem
|
|
|
|
//
|
|
|
|
//==================================================================
|
|
|
|
|
|
|
|
SvxLineEndListItem::SvxLineEndListItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
SvxLineEndListItem::SvxLineEndListItem( XLineEndListRef pList, sal_uInt16 nW ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxPoolItem( nW ),
|
|
|
|
pLineEndList( pList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SvxLineEndListItem::SvxLineEndListItem( const SvxLineEndListItem& rItem ) :
|
|
|
|
SfxPoolItem( rItem ),
|
|
|
|
pLineEndList( rItem.pLineEndList )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemPresentation SvxLineEndListItem::GetPresentation
|
|
|
|
(
|
2006-06-19 15:11:00 +00:00
|
|
|
SfxItemPresentation /*ePres*/,
|
|
|
|
SfxMapUnit /*eCoreUnit*/,
|
|
|
|
SfxMapUnit /*ePresUnit*/,
|
2001-05-13 02:33:31 +00:00
|
|
|
XubString& rText, const IntlWrapper *
|
2000-09-18 16:07:07 +00:00
|
|
|
) const
|
|
|
|
{
|
|
|
|
rText.Erase();
|
|
|
|
return SFX_ITEM_PRESENTATION_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SvxLineEndListItem::operator==( const SfxPoolItem& rItem ) const
|
|
|
|
{
|
|
|
|
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
|
|
|
|
return ( ( SvxLineEndListItem& ) rItem).pLineEndList == pLineEndList;
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxPoolItem* SvxLineEndListItem::Clone( SfxItemPool * ) const
|
|
|
|
{
|
|
|
|
return new SvxLineEndListItem( *this );
|
|
|
|
}
|
|
|
|
|
2011-09-23 14:05:07 +01:00
|
|
|
QUERY_PUT_IMPL( SvxLineEndListItem, LineEndList )
|
2004-07-06 12:16:29 +00:00
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|