summaryrefslogtreecommitdiff
path: root/svx/source/items
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-02-25 15:07:25 +0000
committerKurt Zenker <kz@openoffice.org>2004-02-25 15:07:25 +0000
commit61403682b2338abd70bb77cfbf98f4e746528ea6 (patch)
tree2c7738b17df471b5487841f02a03181172228f1d /svx/source/items
parentabd15cf305253aa8747e82f9adf7f2ffd7e28811 (diff)
INTEGRATION: CWS layoutmanager (1.1.406); FILE MERGED
2003/11/25 13:09:25 cd 1.1.406.2: #111899# Support for QueryValue/PutValue 2003/11/24 08:58:24 cd 1.1.406.1: #111899# Added support for QueryValue
Diffstat (limited to 'svx/source/items')
-rw-r--r--svx/source/items/clipfmtitem.cxx46
1 files changed, 42 insertions, 4 deletions
diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx
index a8744c86633f..7e527ae3e018 100644
--- a/svx/source/items/clipfmtitem.cxx
+++ b/svx/source/items/clipfmtitem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: clipfmtitem.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jp $ $Date: 2001-03-29 18:11:47 $
+ * last change: $Author: kz $ $Date: 2004-02-25 16:07:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,7 +67,9 @@
#include <svtools/svstdarr.hxx>
#include <clipfmtitem.hxx>
-
+#ifndef _DRAFTS_COM_SUN_STAR_FRAME_STATUS_CLIPBOARDFORMATS_HPP_
+#include <drafts/com/sun/star/frame/status/ClipboardFormats.hpp>
+#endif
struct SvxClipboardFmtItem_Impl
{
@@ -81,7 +83,7 @@ struct SvxClipboardFmtItem_Impl
String SvxClipboardFmtItem_Impl::sEmptyStr;
-TYPEINIT1( SvxClipboardFmtItem, SfxPoolItem );
+TYPEINIT1_AUTOFACTORY( SvxClipboardFmtItem, SfxPoolItem );
SvxClipboardFmtItem_Impl::SvxClipboardFmtItem_Impl(
const SvxClipboardFmtItem_Impl& rCpy )
@@ -112,6 +114,42 @@ SvxClipboardFmtItem::~SvxClipboardFmtItem()
delete pImpl;
}
+BOOL SvxClipboardFmtItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const
+{
+ USHORT nCount = Count();
+
+ drafts::com::sun::star::frame::status::ClipboardFormats aClipFormats;
+
+ aClipFormats.Identifiers.realloc( nCount );
+ aClipFormats.Names.realloc( nCount );
+ for ( USHORT n=0; n < nCount; n++ )
+ {
+ aClipFormats.Identifiers[n] = (sal_Int64)GetClipbrdFormatId( n );
+ aClipFormats.Names[n] = GetClipbrdFormatName( n );
+ }
+
+ rVal <<= aClipFormats;
+ return TRUE;
+}
+
+sal_Bool SvxClipboardFmtItem::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId )
+{
+ drafts::com::sun::star::frame::status::ClipboardFormats aClipFormats;
+ if ( rVal >>= aClipFormats )
+ {
+ USHORT nCount = USHORT( aClipFormats.Identifiers.getLength() );
+
+ pImpl->aFmtIds.Remove( 0, pImpl->aFmtIds.Count() );
+ pImpl->aFmtNms.Remove( 0, pImpl->aFmtNms.Count() );
+ for ( USHORT n=0; n < nCount; n++ )
+ AddClipbrdFormat( ULONG( aClipFormats.Identifiers[n] ), aClipFormats.Names[n], n );
+
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
int SvxClipboardFmtItem::operator==( const SfxPoolItem& rComp ) const
{
int nRet = 0;