summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-27 14:42:39 +0200
committerNoel Grandin <noel@peralex.com>2015-09-08 11:35:59 +0200
commitb359064463fffab69425ad960bbf9f9984b32aaa (patch)
treeff6b83f169b93836b796ba927923d02371fbd528 /idl
parent965d27280bed1832d6424f378aa89525ccbff1f6 (diff)
loplugin:mergeclasses SvIdentifier
Change-Id: If3b6ce64c7ad2cda1f992cfb10618fa7d7946fba
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/bastype.hxx37
-rw-r--r--idl/inc/database.hxx6
-rw-r--r--idl/inc/types.hxx6
-rw-r--r--idl/source/objects/bastype.cxx4
-rw-r--r--idl/source/objects/object.cxx2
-rw-r--r--idl/source/objects/slot.cxx2
-rw-r--r--idl/source/objects/types.cxx2
-rw-r--r--idl/source/prj/database.cxx2
8 files changed, 21 insertions, 40 deletions
diff --git a/idl/inc/bastype.hxx b/idl/inc/bastype.hxx
index 1b87c11589b4..6c552e86c499 100644
--- a/idl/inc/bastype.hxx
+++ b/idl/inc/bastype.hxx
@@ -66,39 +66,20 @@ public:
class SvIdentifier
{
-private:
- OString m_aStr;
+ OString m_aStr;
+ sal_uInt32 nValue;
public:
- SvIdentifier()
- {
- }
- void setString(const OString& rStr)
- {
- m_aStr = rStr;
- }
- const OString& getString() const
- {
- return m_aStr;
- }
-
- bool IsSet() const
- {
- return !m_aStr.isEmpty();
- }
- bool ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
-};
+ SvIdentifier() : nValue( 0 ) {};
+ void setString(const OString& rStr) { m_aStr = rStr; }
+ const OString& getString() const { return m_aStr; }
-class SvNumberIdentifier : public SvIdentifier
-{
- sal_uInt32 nValue;
-public:
- SvNumberIdentifier() : nValue( 0 ) {};
+ bool ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
bool IsSet() const
{
- return SvIdentifier::IsSet() || nValue != 0;
+ return !m_aStr.isEmpty() || nValue != 0;
}
- sal_uInt32 GetValue() const { return nValue; }
+ sal_uInt32 GetValue() const { return nValue; }
void SetValue( sal_uInt32 nVal ) { nValue = nVal; }
bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
@@ -140,7 +121,7 @@ public:
};
-class SvHelpContext : public SvNumberIdentifier
+class SvHelpContext : public SvIdentifier
{
};
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 8871c39fc216..4031ddea2ba4 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -91,8 +91,8 @@ public:
// list of used types while writing
SvMetaTypeMemberList aUsedTypes;
- OString aIFaceName;
- SvNumberIdentifier aStructSlotId;
+ OString aIFaceName;
+ SvIdentifier aStructSlotId;
void StartNewFile( const OUString& rName );
void SetExportFile( const OUString& rName )
@@ -124,7 +124,7 @@ public:
SvMetaType * ReadKnownType( SvTokenStream & rInStm );
SvMetaAttribute * ReadKnownAttr( SvTokenStream & rInStm,
SvMetaType * pType = NULL );
- SvMetaAttribute * SearchKnownAttr( const SvNumberIdentifier& );
+ SvMetaAttribute * SearchKnownAttr( const SvIdentifier& );
SvMetaClass * ReadKnownClass( SvTokenStream & rInStm );
void AddDepFile(OUString const& rFileName);
bool WriteDepFile(SvFileStream & rStream, OUString const& rTarget);
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index a9d5c75030c9..90f358c9a9cd 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -35,7 +35,7 @@ typedef tools::SvRef<SvMetaType> SvMetaTypeRef;
class SvMetaAttribute : public SvMetaReference
{
SvMetaTypeRef aType;
- SvNumberIdentifier aSlotId;
+ SvIdentifier aSlotId;
SvBOOL aAutomation;
SvBOOL aExport;
SvBOOL aReadonly;
@@ -55,9 +55,9 @@ public:
void SetNewAttribute( bool bNew )
{ bNewAttr = bNew; }
bool GetReadonly() const;
- void SetSlotId( const SvNumberIdentifier & rId )
+ void SetSlotId( const SvIdentifier & rId )
{ aSlotId = rId; }
- const SvNumberIdentifier & GetSlotId() const;
+ const SvIdentifier & GetSlotId() const;
bool GetExport() const;
bool GetHidden() const;
bool GetAutomation() const;
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index ca84295c8eab..c2cc6c5c11ac 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -175,7 +175,7 @@ bool SvIdentifier::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm
return false;
}
-bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
+bool SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
SvStringHashEntry * pName,
SvTokenStream & rInStm )
{
@@ -198,7 +198,7 @@ bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
return false;
}
-bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
+bool SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 1ce4378edab6..38985042df2a 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -133,7 +133,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
{
if( !xAttr->GetSlotId().IsSet() )
{
- SvNumberIdentifier aI;
+ SvIdentifier aI;
aI.SetValue( rBase.GetUniqueId() );
xAttr->SetSlotId( aI );
}
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 8b1a2e1533d3..00054c26e8aa 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -595,7 +595,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
sal_uLong nValue;
if ( rBase.FindId(aSId , &nValue) )
{
- SvNumberIdentifier aId;
+ SvIdentifier aId;
aId.setString(aSId);
aId.SetValue(nValue);
xEnumSlot->SetSlotId(aId);
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index e87ea42e6fce..49549c14f291 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -55,7 +55,7 @@ SvMetaType * SvMetaAttribute::GetType() const
return static_cast<SvMetaAttribute *>(GetRef())->GetType();
}
-const SvNumberIdentifier & SvMetaAttribute::GetSlotId() const
+const SvIdentifier & SvMetaAttribute::GetSlotId() const
{
if( aSlotId.IsSet() || !GetRef() ) return aSlotId;
return static_cast<SvMetaAttribute *>(GetRef())->GetSlotId();
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 51f906c3a23e..80b533d4339f 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -417,7 +417,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
SvMetaAttribute* SvIdlDataBase::SearchKnownAttr
(
- const SvNumberIdentifier& rId
+ const SvIdentifier& rId
)
{
sal_uLong n;