[Libreoffice-commits] .: 3 commits - sd/source svx/inc svx/source unusedcode.easy
Joseph Powers
jpowers at kemper.freedesktop.org
Tue Aug 23 22:32:29 PDT 2011
sd/source/core/drawdoc4.cxx | 2
svx/inc/svx/svdmodel.hxx | 1
svx/inc/svx/xattr.hxx | 1
svx/inc/svx/xflgrit.hxx | 5 --
svx/inc/svx/xit.hxx | 1
svx/inc/svx/xtable.hxx | 29 -------------
svx/source/svdraw/svdfmtf.cxx | 2
svx/source/svdraw/svdoashp.cxx | 2
svx/source/xoutdev/xattr.cxx | 16 ++-----
svx/source/xoutdev/xpool.cxx | 2
svx/source/xoutdev/xtabgrdt.cxx | 86 ----------------------------------------
unusedcode.easy | 4 -
12 files changed, 12 insertions(+), 139 deletions(-)
New commits:
commit 20cc4639fbbc0ecdb983e198a54aab004d959e1a
Author: Joseph Powers <jpowers27 at cox.net>
Date: Tue Aug 23 22:26:15 2011 -0700
Remove unused parameter: XFillGradientItem
XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient)
pPool wasn't used so why pass it.
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index bf452a4..9cafe96 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -187,7 +187,7 @@ void SdDrawDocument::CreateLayoutTemplates()
rISet.Put(XFillStyleItem(XFILL_SOLID));
rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING)));
- rISet.Put(XFillGradientItem(pPool,aNullGrad));
+ rISet.Put( XFillGradientItem( aNullGrad) );
rISet.Put(XFillHatchItem(pPool,aNullHatch));
Size aNullSize( 32, 32 );
Color aNullColor( COL_WHITE );
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index c75e109..61ebf03 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -47,7 +47,7 @@ public:
XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient);
XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
- XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient);
+ XFillGradientItem(const XGradient& rTheGradient);
XFillGradientItem(const XFillGradientItem& rItem);
XFillGradientItem(SvStream& rIn, sal_uInt16 nVer = 0);
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index ca4667a..0be5e68 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1002,7 +1002,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM
}
aGradAttr.Put(XFillStyleItem(XFILL_GRADIENT));
- aGradAttr.Put(XFillGradientItem(&pModel->GetItemPool(), aXGradient));
+ aGradAttr.Put(XFillGradientItem(aXGradient));
pPath->SetMergedItemSet(aGradAttr);
InsertObj(pPath);
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index ab9818f..21918f7 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -344,7 +344,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
aGradient.SetStartColor(aStartColor);
aGradient.SetEndColor(aEndColor);
- aTempSet.Put(XFillGradientItem(aTempSet.GetPool(), aGradient));
+ aTempSet.Put(XFillGradientItem(aGradient));
aTempSet.Put(XFillTransparenceItem(nShadowTransparence));
}
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 4588112..99573f8 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -3282,7 +3282,7 @@ XFillGradientItem::XFillGradientItem(SvStream& rIn, sal_uInt16 nVer) :
//*************************************************************************
-XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/, const XGradient& rTheGradient)
+XFillGradientItem::XFillGradientItem( const XGradient& rTheGradient )
: NameOrIndex( XATTR_FILLGRADIENT, -1 ),
aGradient(rTheGradient)
{
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index 6f239ec..a8c0e5c 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -94,7 +94,7 @@ XOutdevItemPool::XOutdevItemPool(
mppLocalPoolDefaults[XATTR_LINEJOINT -XATTR_START] = new XLineJointItem;
mppLocalPoolDefaults[XATTR_FILLSTYLE -XATTR_START] = new XFillStyleItem;
mppLocalPoolDefaults[XATTR_FILLCOLOR -XATTR_START] = new XFillColorItem (aNullStr,aNullFillCol);
- mppLocalPoolDefaults[XATTR_FILLGRADIENT -XATTR_START] = new XFillGradientItem(this,aNullGrad);
+ mppLocalPoolDefaults[XATTR_FILLGRADIENT -XATTR_START] = new XFillGradientItem(aNullGrad);
mppLocalPoolDefaults[XATTR_FILLHATCH -XATTR_START] = new XFillHatchItem (this,aNullHatch);
mppLocalPoolDefaults[XATTR_FILLBITMAP -XATTR_START] = new XFillBitmapItem (this,aNullBmp);
mppLocalPoolDefaults[XATTR_FILLTRANSPARENCE -XATTR_START] = new XFillTransparenceItem;
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 9e45e13..715a5ab 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -272,9 +272,8 @@ Bitmap* XGradientList::CreateBitmapForUI( long nIndex, sal_Bool bDelete )
VirtualDevice* pVD = mpData->getVirtualDevice();
SdrObject* pBackgroundObject = mpData->getBackgroundObject();
- const SfxItemSet& rItemSet = pBackgroundObject->GetMergedItemSet();
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_GRADIENT));
- pBackgroundObject->SetMergedItem(XFillGradientItem(rItemSet.GetPool(), GetGradient(nIndex)->GetGradient()));
+ pBackgroundObject->SetMergedItem(XFillGradientItem(GetGradient(nIndex)->GetGradient()));
sdr::contact::SdrObjectVector aObjectVector;
aObjectVector.push_back(pBackgroundObject);
commit 9bccef29afd0d85149e91c8dae5778bf219270b4
Author: Joseph Powers <jpowers27 at cox.net>
Date: Tue Aug 23 21:52:28 2011 -0700
unusedcode.easy: XFillGradientItem cleanp
I also fixed a typo in my earlier comment.
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index 894d3ac..c75e109 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -48,7 +48,6 @@ public:
XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient);
XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient);
- XFillGradientItem(SfxItemPool* pPool );
XFillGradientItem(const XFillGradientItem& rItem);
XFillGradientItem(SvStream& rIn, sal_uInt16 nVer = 0);
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 1c80996..4588112 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -3288,13 +3288,6 @@ XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/, const XGradient& rT
{
}
-//*************************************************************************
-
-XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/)
-: NameOrIndex(XATTR_FILLGRADIENT, -1 )
-{
-}
-
/*************************************************************************
|*
|* XFillGradientItem::Clone(SfxItemPool* pPool) const
@@ -3375,7 +3368,7 @@ const XGradient& XFillGradientItem::GetGradientValue() const // GetValue -> GetG
{
if (!IsIndex())
return aGradient;
- // ToDo: This should fail. We never call called this code with a table so this should always
+ // ToDo: This should fail. We never called this code with a table so this should always
// have failed. Thus, I'm thinking that XFillGradientItem can't be an Index.
return aGradient;
}
diff --git a/unusedcode.easy b/unusedcode.easy
index ca23693..db58558 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1748,7 +1748,6 @@ XFillBitmapItem::XFillBitmapItem(long, XOBitmap const&)
XFillExchangeData::RegisterClipboardFormatName()
XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool*)
XFillFloatTransparenceItem::XFillFloatTransparenceItem(int, XGradient const&, unsigned char)
-XFillGradientItem::XFillGradientItem(SfxItemPool*)
XFillHatchItem::XFillHatchItem(SfxItemPool*)
XFillHatchItem::XFillHatchItem(int, XHatch const&)
XFormTextShadowColorItem::XFormTextShadowColorItem(int, Color const&)
commit a87c8748f99d208f78c739dbefae776a089d9bb6
Author: Joseph Powers <jpowers27 at cox.net>
Date: Tue Aug 23 21:46:45 2011 -0700
Delete class XGradientTable
It seems that we don't use it...
Class XFillGradientItem referenses it as a parameter which is never passed;
however, the code is: "if(!isIndex()) else Table->" which will always fail
if the Item is an Index. This makes me belive that the XFillGradientItem
class could be simplifed to not be based on the NameOrIndex class.
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index e58212b..751b645 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -83,7 +83,6 @@ class XBitmapTable;
class XColorTable;
class XDashList;
class XGradientList;
-class XGradientTable;
class XHatchList;
class XHatchTable;
class XLineEndList;
diff --git a/svx/inc/svx/xattr.hxx b/svx/inc/svx/xattr.hxx
index a2118dc..29b8fc0 100644
--- a/svx/inc/svx/xattr.hxx
+++ b/svx/inc/svx/xattr.hxx
@@ -32,7 +32,6 @@ class XColorTable;
class XLineEndTable;
class XHatchTable;
class XBitmapTable;
-class XGradientTable;
#include <svx/xit.hxx>
#include <svx/xcolit.hxx>
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index dfbebcc..894d3ac 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -64,7 +64,7 @@ public:
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- const XGradient& GetGradientValue(const XGradientTable* pTable = 0) const; // GetValue -> GetGradientValue
+ const XGradient& GetGradientValue() const; // GetValue -> GetGradientValue
void SetGradientValue(const XGradient& rNew) { aGradient = rNew; Detach(); } // SetValue -> SetGradientValue
static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
diff --git a/svx/inc/svx/xit.hxx b/svx/inc/svx/xit.hxx
index 1611736..3cc404e 100644
--- a/svx/inc/svx/xit.hxx
+++ b/svx/inc/svx/xit.hxx
@@ -39,7 +39,6 @@ class XColorTable;
class XLineEndTable;
class XHatchTable;
class XBitmapTable;
-class XGradientTable;
class SfxItemPool;
class NameOrIndex;
class XPropertyList;
diff --git a/svx/inc/svx/xtable.hxx b/svx/inc/svx/xtable.hxx
index 5ed7a78..a19de5c 100644
--- a/svx/inc/svx/xtable.hxx
+++ b/svx/inc/svx/xtable.hxx
@@ -485,35 +485,6 @@ public:
virtual Bitmap* CreateBitmapForUI(long nIndex, sal_Bool bDelete = sal_True);
};
-// ---------------------
-// class XGradientTable
-// ---------------------
-
-class XGradientTable : public XPropertyTable
-{
-public:
- explicit XGradientTable(
- const String& rPath,
- XOutdevItemPool* pXPool = NULL,
- sal_uInt16 nInitSize = 16,
- sal_uInt16 nReSize = 16
- );
- virtual ~XGradientTable();
-
- using XPropertyTable::Replace;
- XGradientEntry* Replace(long nIndex, XGradientEntry* pEntry );
- using XPropertyTable::Remove;
- XGradientEntry* Remove(long nIndex);
- using XPropertyTable::Get;
- XGradientEntry* GetGradient(long nIndex) const;
-
- virtual sal_Bool Load();
- virtual sal_Bool Save();
- virtual sal_Bool Create();
- virtual sal_Bool CreateBitmapsForUI();
- virtual Bitmap* CreateBitmapForUI( long nIndex, sal_Bool bDelete = sal_True );
-};
-
// -------------------
// class XGradientList
// -------------------
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 8f49069..1c80996 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -3371,12 +3371,13 @@ SvStream& XFillGradientItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) co
|*
*************************************************************************/
-const XGradient& XFillGradientItem::GetGradientValue(const XGradientTable* pTable) const // GetValue -> GetGradientValue
+const XGradient& XFillGradientItem::GetGradientValue() const // GetValue -> GetGradientValue
{
if (!IsIndex())
return aGradient;
- else
- return pTable->GetGradient(GetIndex())->GetGradient();
+ // ToDo: This should fail. We never call called this code with a table so this should always
+ // have failed. Thus, I'm thinking that XFillGradientItem can't be an Index.
+ return aGradient;
}
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 1066f77..9e45e13 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -69,89 +69,6 @@ char const aChckGradient[] = { 0x04, 0x00, 'S','O','G','L'}; // < 5.2
char const aChckGradient0[] = { 0x04, 0x00, 'S','O','G','0'}; // = 5.2
char const aChckXML[] = { '<', '?', 'x', 'm', 'l' }; // = 6.0
-// ---------------------
-// class XGradientTable
-// ---------------------
-
-/*************************************************************************
-|*
-|* XGradientTable::XGradientTable()
-|*
-*************************************************************************/
-
-XGradientTable::XGradientTable(
- const String& rPath,
- XOutdevItemPool* pInPool,
- sal_uInt16 nInitSize,
- sal_uInt16 nReSize
-) :
- XPropertyTable( rPath, pInPool, nInitSize, nReSize )
-{
- pBmpTable = new Table( nInitSize, nReSize );
-}
-
-/************************************************************************/
-
-XGradientTable::~XGradientTable()
-{
-}
-
-/************************************************************************/
-
-XGradientEntry* XGradientTable::Replace(long nIndex, XGradientEntry* pEntry )
-{
- return (XGradientEntry*) XPropertyTable::Replace(nIndex, pEntry);
-}
-
-/************************************************************************/
-
-XGradientEntry* XGradientTable::Remove(long nIndex)
-{
- return (XGradientEntry*) XPropertyTable::Remove(nIndex);
-}
-
-/************************************************************************/
-
-XGradientEntry* XGradientTable::GetGradient(long nIndex) const
-{
- return (XGradientEntry*) XPropertyTable::Get(nIndex, 0);
-}
-
-/************************************************************************/
-
-sal_Bool XGradientTable::Load()
-{
- return( sal_False );
-}
-
-/************************************************************************/
-
-sal_Bool XGradientTable::Save()
-{
- return( sal_False );
-}
-
-/************************************************************************/
-
-sal_Bool XGradientTable::Create()
-{
- return( sal_False );
-}
-
-/************************************************************************/
-
-sal_Bool XGradientTable::CreateBitmapsForUI()
-{
- return( sal_False );
-}
-
-/************************************************************************/
-
-Bitmap* XGradientTable::CreateBitmapForUI( long /*nIndex*/, sal_Bool /*bDelete*/)
-{
- return( NULL );
-}
-
// --------------------
// class XGradientList
// --------------------
diff --git a/unusedcode.easy b/unusedcode.easy
index 9c4ebf5..ca23693 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1752,9 +1752,6 @@ XFillGradientItem::XFillGradientItem(SfxItemPool*)
XFillHatchItem::XFillHatchItem(SfxItemPool*)
XFillHatchItem::XFillHatchItem(int, XHatch const&)
XFormTextShadowColorItem::XFormTextShadowColorItem(int, Color const&)
-XGradientTable::Remove(long)
-XGradientTable::Replace(long, XGradientEntry*)
-XGradientTable::XGradientTable(String const&, XOutdevItemPool*, unsigned short, unsigned short)
XHatchTable::Remove(long)
XHatchTable::Replace(long, XHatchEntry*)
XHatchTable::XHatchTable(String const&, XOutdevItemPool*, unsigned short, unsigned short)
More information about the Libreoffice-commits
mailing list