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 03:19:35 +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 03:19:35 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 03:19:35 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 03:19:35 +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 03:19:35 +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 03:19:35 +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 05:26:36 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svx.hxx"
|
|
|
|
|
2007-06-27 18:36:29 +00:00
|
|
|
#include <svx/xtable.hxx>
|
|
|
|
#include <svx/xpool.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#define GLOBALOVERFLOW
|
|
|
|
|
|
|
|
// Vergleichsstrings
|
2010-12-06 10:36:18 +00:00
|
|
|
sal_Unicode pszStandard[] = { 's', 't', 'a', 'n', 'd', 'a', 'r', 'd', 0 };
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Konvertiert in echte RGB-Farben, damit in den Listboxen
|
|
|
|
// endlich mal richtig selektiert werden kann.
|
|
|
|
Color RGB_Color( ColorData nColorName )
|
|
|
|
{
|
|
|
|
Color aColor( nColorName );
|
|
|
|
Color aRGBColor( aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue() );
|
|
|
|
return aRGBColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------
|
|
|
|
// class XPropertyTable
|
|
|
|
// ---------------------
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyTable::XPropertyTable()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
XPropertyTable::XPropertyTable( const String& rPath,
|
|
|
|
XOutdevItemPool* pInPool,
|
2011-01-10 16:11:35 +01:00
|
|
|
sal_uInt16 nInitSize, sal_uInt16 nReSize ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
aName ( pszStandard, 8 ),
|
2006-06-19 16:09:04 +00:00
|
|
|
aPath ( rPath ),
|
2000-09-18 16:07:07 +00:00
|
|
|
pXPool ( pInPool ),
|
2006-06-19 16:09:04 +00:00
|
|
|
aTable ( nInitSize, nReSize ),
|
2000-09-18 16:07:07 +00:00
|
|
|
pBmpTable ( NULL ),
|
2011-01-10 16:11:35 +01:00
|
|
|
bTableDirty ( sal_True ),
|
|
|
|
bBitmapsDirty ( sal_True ),
|
|
|
|
bOwnPool ( sal_False )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( !pXPool )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
bOwnPool = sal_True;
|
2000-09-18 16:07:07 +00:00
|
|
|
pXPool = new XOutdevItemPool;
|
|
|
|
DBG_ASSERT( pXPool, "XOutPool konnte nicht erzeugt werden!" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyTable::XPropertyTable( SvStraem& )
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2006-06-19 16:09:04 +00:00
|
|
|
XPropertyTable::XPropertyTable( SvStream& /*rIn*/) :
|
2000-09-18 16:07:07 +00:00
|
|
|
pBmpTable ( NULL )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyTable::~XPropertyTable()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
XPropertyTable::~XPropertyTable()
|
|
|
|
{
|
|
|
|
XPropertyEntry* pEntry = (XPropertyEntry*)aTable.First();
|
|
|
|
Bitmap* pBitmap = NULL;
|
2011-01-10 16:11:35 +01:00
|
|
|
for (sal_uIntPtr nIndex = 0; nIndex < aTable.Count(); nIndex++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
delete pEntry;
|
|
|
|
pEntry = (XPropertyEntry*)aTable.Next();
|
|
|
|
}
|
|
|
|
// Hier wird die Bitmaptabelle geloescht
|
|
|
|
if( pBmpTable )
|
|
|
|
{
|
|
|
|
pBitmap = (Bitmap*) pBmpTable->First();
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
for( sal_uIntPtr nIndex = 0; nIndex < pBmpTable->Count(); nIndex++ )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
delete pBitmap;
|
|
|
|
pBitmap = (Bitmap*) pBmpTable->Next();
|
|
|
|
}
|
|
|
|
delete pBmpTable;
|
|
|
|
pBmpTable = NULL;
|
|
|
|
}
|
|
|
|
// Eigener Pool wird geloescht
|
|
|
|
if( bOwnPool && pXPool )
|
|
|
|
{
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
SfxItemPool::Free(pXPool);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyTable::Clear()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void XPropertyTable::Clear()
|
|
|
|
{
|
|
|
|
aTable.Clear();
|
|
|
|
if( pBmpTable )
|
|
|
|
pBmpTable->Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
long XPropertyTable::Count() const
|
|
|
|
{
|
|
|
|
if( bTableDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
// ( (XPropertyTable*) this )->bTableDirty = sal_False; <- im Load()
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !( (XPropertyTable*) this )->Load() )
|
|
|
|
( (XPropertyTable*) this )->Create();
|
|
|
|
}
|
|
|
|
return( aTable.Count() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyEntry* XPropertyTable::Get()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
XPropertyEntry* XPropertyTable::Get( long nIndex, sal_uInt16 /*nDummy*/) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( bTableDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
// ( (XPropertyTable*) this )->bTableDirty = sal_False; <- im Load()
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !( (XPropertyTable*) this )->Load() )
|
|
|
|
( (XPropertyTable*) this )->Create();
|
|
|
|
}
|
2011-01-10 16:11:35 +01:00
|
|
|
return (XPropertyEntry*) aTable.GetObject( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* long XPropertyTable::Get(const String& rName)
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
long XPropertyTable::Get(const XubString& rName)
|
|
|
|
{
|
|
|
|
if( bTableDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
// bTableDirty = sal_False;
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !Load() )
|
|
|
|
Create();
|
|
|
|
}
|
|
|
|
long nPos = 0;
|
|
|
|
XPropertyEntry* pEntry = (XPropertyEntry*)aTable.First();
|
|
|
|
while (pEntry && pEntry->GetName() != rName)
|
|
|
|
{
|
|
|
|
nPos++;
|
|
|
|
pEntry = (XPropertyEntry*)aTable.Next();
|
|
|
|
}
|
|
|
|
if (!pEntry) nPos = -1;
|
|
|
|
return nPos;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Bitmap* XPropertyTable::GetBitmap()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
Bitmap* XPropertyTable::GetBitmap( long nIndex ) const
|
|
|
|
{
|
|
|
|
if( pBmpTable )
|
|
|
|
{
|
|
|
|
if( bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
( (XPropertyTable*) this )->bBitmapsDirty = sal_False;
|
2000-09-18 16:07:07 +00:00
|
|
|
( (XPropertyTable*) this )->CreateBitmapsForUI();
|
|
|
|
}
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
if( pBmpTable->Count() >= (sal_uIntPtr) nIndex )
|
|
|
|
return (Bitmap*) pBmpTable->GetObject( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
return( NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* void XPropertyTable::Insert()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
sal_Bool XPropertyTable::Insert( long nIndex, XPropertyEntry* pEntry )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
sal_Bool bReturn = aTable.Insert( (sal_uIntPtr) nIndex, pEntry );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( pBmpTable && !bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
Bitmap* pBmp = CreateBitmapForUI( (sal_uIntPtr) nIndex );
|
|
|
|
pBmpTable->Insert( (sal_uIntPtr) nIndex, pBmp );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
return bReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* void XPropertyTable::Replace()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
XPropertyEntry* XPropertyTable::Replace( long nIndex, XPropertyEntry* pEntry )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
XPropertyEntry* pOldEntry = (XPropertyEntry*) aTable.Replace( (sal_uIntPtr) nIndex, pEntry );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( pBmpTable && !bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
Bitmap* pBmp = CreateBitmapForUI( (sal_uIntPtr) nIndex );
|
|
|
|
Bitmap* pOldBmp = (Bitmap*) pBmpTable->Replace( (sal_uIntPtr) nIndex, pBmp );
|
2000-09-18 16:07:07 +00:00
|
|
|
if( pOldBmp )
|
|
|
|
delete pOldBmp;
|
|
|
|
}
|
|
|
|
return pOldEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* void XPropertyTable::Remove()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
XPropertyEntry* XPropertyTable::Remove( long nIndex, sal_uInt16 /*nDummy*/)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( pBmpTable && !bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
Bitmap* pOldBmp = (Bitmap*) pBmpTable->Remove( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
if( pOldBmp )
|
|
|
|
delete pOldBmp;
|
|
|
|
}
|
2011-01-10 16:11:35 +01:00
|
|
|
return (XPropertyEntry*) aTable.Remove((sal_uIntPtr)nIndex);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
void XPropertyTable::SetName( const String& rString )
|
|
|
|
{
|
|
|
|
if(rString.Len())
|
|
|
|
{
|
|
|
|
aName = rString;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------
|
|
|
|
// class XPropertyList
|
|
|
|
// --------------------
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyList::XPropertyList()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
XPropertyList::XPropertyList( const String& rPath,
|
|
|
|
XOutdevItemPool* pInPool,
|
2011-01-10 16:11:35 +01:00
|
|
|
sal_uInt16 nInitSize, sal_uInt16 nReSize ) :
|
2000-09-18 16:07:07 +00:00
|
|
|
aName ( pszStandard, 8 ),
|
2006-06-19 16:09:04 +00:00
|
|
|
aPath ( rPath ),
|
2000-09-18 16:07:07 +00:00
|
|
|
pXPool ( pInPool ),
|
2006-06-19 16:09:04 +00:00
|
|
|
aList ( nInitSize, nReSize ),
|
2000-09-18 16:07:07 +00:00
|
|
|
pBmpList ( NULL ),
|
2011-01-10 16:11:35 +01:00
|
|
|
bListDirty ( sal_True ),
|
|
|
|
bBitmapsDirty ( sal_True ),
|
|
|
|
bOwnPool ( sal_False )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( !pXPool )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
bOwnPool = sal_True;
|
2000-09-18 16:07:07 +00:00
|
|
|
pXPool = new XOutdevItemPool;
|
|
|
|
DBG_ASSERT( pXPool, "XOutPool konnte nicht erzeugt werden!" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyList::XPropertyList( SvStraem& )
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2006-06-19 16:09:04 +00:00
|
|
|
XPropertyList::XPropertyList( SvStream& /*rIn*/) :
|
2000-09-18 16:07:07 +00:00
|
|
|
pBmpList ( NULL )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyList::~XPropertyList()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
XPropertyList::~XPropertyList()
|
|
|
|
{
|
|
|
|
XPropertyEntry* pEntry = (XPropertyEntry*)aList.First();
|
|
|
|
Bitmap* pBitmap = NULL;
|
2011-01-10 16:11:35 +01:00
|
|
|
for( sal_uIntPtr nIndex = 0; nIndex < aList.Count(); nIndex++ )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
delete pEntry;
|
|
|
|
pEntry = (XPropertyEntry*)aList.Next();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( pBmpList )
|
|
|
|
{
|
|
|
|
pBitmap = (Bitmap*) pBmpList->First();
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
for( sal_uIntPtr nIndex = 0; nIndex < pBmpList->Count(); nIndex++ )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
delete pBitmap;
|
|
|
|
pBitmap = (Bitmap*) pBmpList->Next();
|
|
|
|
}
|
|
|
|
delete pBmpList;
|
|
|
|
pBmpList = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bOwnPool && pXPool )
|
|
|
|
{
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
SfxItemPool::Free(pXPool);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyList::Clear()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void XPropertyList::Clear()
|
|
|
|
{
|
|
|
|
aList.Clear();
|
|
|
|
if( pBmpList )
|
|
|
|
pBmpList->Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
long XPropertyList::Count() const
|
|
|
|
{
|
|
|
|
if( bListDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
// ( (XPropertyList*) this )->bListDirty = sal_False; <- im Load()
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !( (XPropertyList*) this )->Load() )
|
|
|
|
( (XPropertyList*) this )->Create();
|
|
|
|
}
|
|
|
|
return( aList.Count() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyEntry* XPropertyList::Get()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
XPropertyEntry* XPropertyList::Get( long nIndex, sal_uInt16 /*nDummy*/) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( bListDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
// ( (XPropertyList*) this )->bListDirty = sal_False; <- im Load()
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !( (XPropertyList*) this )->Load() )
|
|
|
|
( (XPropertyList*) this )->Create();
|
|
|
|
}
|
2011-01-10 16:11:35 +01:00
|
|
|
return (XPropertyEntry*) aList.GetObject( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* XPropertyList::Get()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
long XPropertyList::Get(const XubString& rName)
|
|
|
|
{
|
|
|
|
if( bListDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
//bListDirty = sal_False;
|
2000-09-18 16:07:07 +00:00
|
|
|
if( !Load() )
|
|
|
|
Create();
|
|
|
|
}
|
|
|
|
long nPos = 0;
|
|
|
|
XPropertyEntry* pEntry = (XPropertyEntry*)aList.First();
|
|
|
|
while (pEntry && pEntry->GetName() != rName)
|
|
|
|
{
|
|
|
|
nPos++;
|
|
|
|
pEntry = (XPropertyEntry*)aList.Next();
|
|
|
|
}
|
|
|
|
if (!pEntry) nPos = -1;
|
|
|
|
return nPos;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Bitmap* XPropertyList::GetBitmap()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
Bitmap* XPropertyList::GetBitmap( long nIndex ) const
|
|
|
|
{
|
|
|
|
if( pBmpList )
|
|
|
|
{
|
|
|
|
if( bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
( (XPropertyList*) this )->bBitmapsDirty = sal_False;
|
2000-09-18 16:07:07 +00:00
|
|
|
( (XPropertyList*) this )->CreateBitmapsForUI();
|
|
|
|
}
|
2011-01-10 16:11:35 +01:00
|
|
|
if( pBmpList->Count() >= (sal_uIntPtr) nIndex )
|
|
|
|
return (Bitmap*) pBmpList->GetObject( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
return( NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* void XPropertyList::Insert()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void XPropertyList::Insert( XPropertyEntry* pEntry, long nIndex )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
aList.Insert( pEntry, (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( pBmpList && !bBitmapsDirty )
|
|
|
|
{
|
|
|
|
Bitmap* pBmp = CreateBitmapForUI(
|
2011-01-10 16:11:35 +01:00
|
|
|
(sal_uIntPtr) nIndex < aList.Count() ? nIndex : aList.Count() - 1 );
|
|
|
|
pBmpList->Insert( pBmp, (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* void XPropertyList::Replace()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
XPropertyEntry* XPropertyList::Replace( XPropertyEntry* pEntry, long nIndex )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
XPropertyEntry* pOldEntry = (XPropertyEntry*) aList.Replace( pEntry, (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( pBmpList && !bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
Bitmap* pBmp = CreateBitmapForUI( (sal_uIntPtr) nIndex );
|
|
|
|
Bitmap* pOldBmp = (Bitmap*) pBmpList->Replace( pBmp, (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
if( pOldBmp )
|
|
|
|
delete pOldBmp;
|
|
|
|
}
|
|
|
|
return pOldEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* void XPropertyList::Remove()
|
|
|
|
|*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2011-01-10 16:11:35 +01:00
|
|
|
XPropertyEntry* XPropertyList::Remove( long nIndex, sal_uInt16 /*nDummy*/)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( pBmpList && !bBitmapsDirty )
|
|
|
|
{
|
2011-01-10 16:11:35 +01:00
|
|
|
Bitmap* pOldBmp = (Bitmap*) pBmpList->Remove( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
if( pOldBmp )
|
|
|
|
delete pOldBmp;
|
|
|
|
}
|
2011-01-10 16:11:35 +01:00
|
|
|
return (XPropertyEntry*) aList.Remove( (sal_uIntPtr) nIndex );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
void XPropertyList::SetName( const String& rString )
|
|
|
|
{
|
|
|
|
if(rString.Len())
|
|
|
|
{
|
|
|
|
aName = rString;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|