Kaydet (Commit) 71403558 authored tarafından Noel Grandin's avatar Noel Grandin

remove PseudoSlot support from idl compiler

Since we have removed the last usage with
commit 12c6caa8
"Kill remaining PseudoSlots usage"

And remove corresponding support from the list-dispatch-commands script.

Also remove the now unused SFX_NEW_SLOT_ENUM macro

Change-Id: Id07c431de4404acf61a8bdd3507e390e5249879a
Reviewed-on: https://gerrit.libreoffice.org/35754Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst dad96279
...@@ -48,11 +48,10 @@ function analyseFile($fileName) { ...@@ -48,11 +48,10 @@ function analyseFile($fileName) {
$slotId = trim($tmp[1]); $slotId = trim($tmp[1]);
$index++; $index++;
$aLine = $lines[$index]; $aLine = $lines[$index];
$isEnumSlot = strpos($aLine, 'SFX_NEW_SLOT_ENUM') !== FALSE;
$tmp = explode(',', $aLine); $tmp = explode(',', $aLine);
$slotRID = $tmp[1]; $slotRID = $tmp[1];
$index += $isEnumSlot ? 4 : 3; $index += 3;
$aLine = $lines[$index]; $aLine = $lines[$index];
$mode = ""; $mode = "";
addMode($mode, $aLine, "CACHABLE", "C"); addMode($mode, $aLine, "CACHABLE", "C");
...@@ -60,7 +59,7 @@ function analyseFile($fileName) { ...@@ -60,7 +59,7 @@ function analyseFile($fileName) {
addMode($mode, $aLine, "MENUCONFIG", "M"); addMode($mode, $aLine, "MENUCONFIG", "M");
addMode($mode, $aLine, "TOOLBOXCONFIG", "T"); addMode($mode, $aLine, "TOOLBOXCONFIG", "T");
addMode($mode, $aLine, "ACCELCONFIG", "A"); addMode($mode, $aLine, "ACCELCONFIG", "A");
$index += $isEnumSlot ? 1 : 3; $index += 3;
$aLine = $lines[$index]; $aLine = $lines[$index];
if (strpos($aLine, '"') === FALSE) { if (strpos($aLine, '"') === FALSE) {
$index++; $index++;
......
...@@ -44,7 +44,6 @@ struct SvGlobalHashNames ...@@ -44,7 +44,6 @@ struct SvGlobalHashNames
SvStringHashEntry* MM_float; SvStringHashEntry* MM_float;
SvStringHashEntry* MM_double; SvStringHashEntry* MM_double;
SvStringHashEntry* MM_item; SvStringHashEntry* MM_item;
SvStringHashEntry* MM_PseudoSlots;
SvStringHashEntry* MM_import; SvStringHashEntry* MM_import;
SvStringHashEntry* MM_SlotIdFile; SvStringHashEntry* MM_SlotIdFile;
SvStringHashEntry* MM_include; SvStringHashEntry* MM_include;
...@@ -52,7 +51,6 @@ struct SvGlobalHashNames ...@@ -52,7 +51,6 @@ struct SvGlobalHashNames
SvStringHashEntry* MM_StateMethod; SvStringHashEntry* MM_StateMethod;
SvStringHashEntry* MM_GroupId; SvStringHashEntry* MM_GroupId;
SvStringHashEntry* MM_Export; SvStringHashEntry* MM_Export;
SvStringHashEntry* MM_PseudoPrefix;
SvStringHashEntry* MM_define; SvStringHashEntry* MM_define;
SvStringHashEntry* MM_MenuConfig; SvStringHashEntry* MM_MenuConfig;
SvStringHashEntry* MM_ToolBoxConfig; SvStringHashEntry* MM_ToolBoxConfig;
...@@ -106,7 +104,6 @@ HASH_INLINE(INT32) ...@@ -106,7 +104,6 @@ HASH_INLINE(INT32)
HASH_INLINE(BOOL) HASH_INLINE(BOOL)
HASH_INLINE(BYTE) HASH_INLINE(BYTE)
HASH_INLINE(item) HASH_INLINE(item)
HASH_INLINE(PseudoSlots)
HASH_INLINE(import) HASH_INLINE(import)
HASH_INLINE(SlotIdFile) HASH_INLINE(SlotIdFile)
HASH_INLINE(include) HASH_INLINE(include)
...@@ -116,7 +113,6 @@ HASH_INLINE(GroupId) ...@@ -116,7 +113,6 @@ HASH_INLINE(GroupId)
HASH_INLINE(float) HASH_INLINE(float)
HASH_INLINE(double) HASH_INLINE(double)
HASH_INLINE(Export) HASH_INLINE(Export)
HASH_INLINE(PseudoPrefix)
HASH_INLINE(define) HASH_INLINE(define)
HASH_INLINE(MenuConfig) HASH_INLINE(MenuConfig)
HASH_INLINE(ToolBoxConfig) HASH_INLINE(ToolBoxConfig)
......
...@@ -31,7 +31,6 @@ public: ...@@ -31,7 +31,6 @@ public:
SvIdentifier aGroupId; SvIdentifier aGroupId;
SvIdentifier aExecMethod; SvIdentifier aExecMethod;
SvIdentifier aStateMethod; SvIdentifier aStateMethod;
SvBOOL aPseudoSlots;
SvBOOL aToggle; SvBOOL aToggle;
SvBOOL aAutoUpdate; SvBOOL aAutoUpdate;
...@@ -48,12 +47,9 @@ public: ...@@ -48,12 +47,9 @@ public:
SvBOOL aAccelConfig; SvBOOL aAccelConfig;
SvBOOL aFastCall; SvBOOL aFastCall;
SvBOOL aContainer; SvBOOL aContainer;
SvIdentifier aPseudoPrefix;
OString aDisableFlags; OString aDisableFlags;
SvMetaSlot* pLinkedSlot;
SvMetaSlot* pNextSlot; SvMetaSlot* pNextSlot;
sal_uLong nListPos; sal_uLong nListPos;
SvMetaEnumValue* pEnumValue;
SvBOOL aReadOnlyDoc; SvBOOL aReadOnlyDoc;
SvBOOL aExport; SvBOOL aExport;
...@@ -63,7 +59,6 @@ public: ...@@ -63,7 +59,6 @@ public:
size_t nStart, size_t nStart,
SvIdlDataBase & rBase, SvStream & rOutStm ); SvIdlDataBase & rBase, SvStream & rOutStm );
void SetEnumValue(SvMetaEnumValue *p) { pEnumValue = p; }
OString GetMangleName() const; OString GetMangleName() const;
bool IsVariable() const; bool IsVariable() const;
bool IsMethod() const; bool IsMethod() const;
...@@ -97,7 +92,6 @@ public: ...@@ -97,7 +92,6 @@ public:
const OString& GetExecMethod() const; const OString& GetExecMethod() const;
const OString& GetStateMethod() const; const OString& GetStateMethod() const;
const OString& GetDisableFlags() const; const OString& GetDisableFlags() const;
bool GetPseudoSlots() const;
bool GetToggle() const; bool GetToggle() const;
bool GetAutoUpdate() const; bool GetAutoUpdate() const;
...@@ -108,7 +102,6 @@ public: ...@@ -108,7 +102,6 @@ public:
bool GetNoRecord() const; bool GetNoRecord() const;
bool GetRecordAbsolute() const; bool GetRecordAbsolute() const;
const OString& GetPseudoPrefix() const;
bool GetMenuConfig() const; bool GetMenuConfig() const;
bool GetToolBoxConfig() const; bool GetToolBoxConfig() const;
bool GetAccelConfig() const; bool GetAccelConfig() const;
...@@ -123,14 +116,13 @@ public: ...@@ -123,14 +116,13 @@ public:
void SetListPos(sal_uLong n) void SetListPos(sal_uLong n)
{ nListPos = n; } { nListPos = n; }
void ResetSlotPointer() void ResetSlotPointer()
{ pNextSlot = pLinkedSlot = nullptr; } { pNextSlot = nullptr; }
virtual bool Test( SvTokenStream & rInStm ) override; virtual bool Test( SvTokenStream & rInStm ) override;
virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm ) override; SvTokenStream & rInStm ) override;
virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
virtual void Insert( SvSlotElementList&, const OString& rPrefix, virtual void Insert( SvSlotElementList& ) override;
SvIdlDataBase& ) override;
void WriteSlotStubs( const OString& rShellName, void WriteSlotStubs( const OString& rShellName,
ByteStringList & rList, ByteStringList & rList,
SvStream & rOutStm ); SvStream & rOutStm );
......
...@@ -44,8 +44,7 @@ public: ...@@ -44,8 +44,7 @@ public:
virtual bool Test( SvTokenStream & rInStm ) override; virtual bool Test( SvTokenStream & rInStm ) override;
virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
sal_uLong MakeSfx( OStringBuffer& rAtrrArray ); sal_uLong MakeSfx( OStringBuffer& rAtrrArray );
virtual void Insert( SvSlotElementList&, const OString& rPrefix, virtual void Insert( SvSlotElementList& );
SvIdlDataBase& );
}; };
enum MetaTypeType { Method, Struct, Base, Enum, Interface, Shell }; enum MetaTypeType { Method, Struct, Base, Enum, Interface, Shell };
......
...@@ -192,7 +192,7 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& ...@@ -192,7 +192,7 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>&
// Write only if not already written by subclass or // Write only if not already written by subclass or
// imported interface. // imported interface.
rSuperList.push_back(nId); rSuperList.push_back(nId);
pAttr->Insert(rList, rPrefix, rBase); pAttr->Insert(rList);
} }
} }
......
...@@ -28,10 +28,8 @@ ...@@ -28,10 +28,8 @@
SvMetaSlot::SvMetaSlot() SvMetaSlot::SvMetaSlot()
: aRecordPerSet( true ) : aRecordPerSet( true )
, aRecordAbsolute( false ) , aRecordAbsolute( false )
, pLinkedSlot(nullptr)
, pNextSlot(nullptr) , pNextSlot(nullptr)
, nListPos(0) , nListPos(0)
, pEnumValue(nullptr)
, aReadOnlyDoc ( true ) , aReadOnlyDoc ( true )
, aExport( true ) , aExport( true )
{ {
...@@ -41,10 +39,8 @@ SvMetaSlot::SvMetaSlot( SvMetaType * pType ) ...@@ -41,10 +39,8 @@ SvMetaSlot::SvMetaSlot( SvMetaType * pType )
: SvMetaAttribute( pType ) : SvMetaAttribute( pType )
, aRecordPerSet( true ) , aRecordPerSet( true )
, aRecordAbsolute( false ) , aRecordAbsolute( false )
, pLinkedSlot(nullptr)
, pNextSlot(nullptr) , pNextSlot(nullptr)
, nListPos(0) , nListPos(0)
, pEnumValue(nullptr)
, aReadOnlyDoc ( true ) , aReadOnlyDoc ( true )
, aExport( true ) , aExport( true )
{ {
...@@ -131,11 +127,6 @@ const OString& SvMetaSlot::GetStateMethod() const ...@@ -131,11 +127,6 @@ const OString& SvMetaSlot::GetStateMethod() const
if( !aStateMethod.getString().isEmpty() || !GetRef() ) return aStateMethod.getString(); if( !aStateMethod.getString().isEmpty() || !GetRef() ) return aStateMethod.getString();
return static_cast<SvMetaSlot *>(GetRef())->GetStateMethod(); return static_cast<SvMetaSlot *>(GetRef())->GetStateMethod();
} }
bool SvMetaSlot::GetPseudoSlots() const
{
if( aPseudoSlots.IsSet() || !GetRef() ) return aPseudoSlots;
return static_cast<SvMetaSlot *>(GetRef())->GetPseudoSlots();
}
bool SvMetaSlot::GetToggle() const bool SvMetaSlot::GetToggle() const
{ {
if( aToggle.IsSet() || !GetRef() ) return aToggle; if( aToggle.IsSet() || !GetRef() ) return aToggle;
...@@ -183,11 +174,6 @@ bool SvMetaSlot::GetRecordAbsolute() const ...@@ -183,11 +174,6 @@ bool SvMetaSlot::GetRecordAbsolute() const
return aRecordAbsolute; return aRecordAbsolute;
return static_cast<SvMetaSlot *>(GetRef())->GetRecordAbsolute(); return static_cast<SvMetaSlot *>(GetRef())->GetRecordAbsolute();
} }
const OString& SvMetaSlot::GetPseudoPrefix() const
{
if( !aPseudoPrefix.getString().isEmpty() || !GetRef() ) return aPseudoPrefix.getString();
return static_cast<SvMetaSlot *>(GetRef())->GetPseudoPrefix();
}
bool SvMetaSlot::GetMenuConfig() const bool SvMetaSlot::GetMenuConfig() const
{ {
if( aMenuConfig.IsSet() || !GetRef() ) return aMenuConfig; if( aMenuConfig.IsSet() || !GetRef() ) return aMenuConfig;
...@@ -220,7 +206,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, ...@@ -220,7 +206,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvMetaAttribute::ReadAttributesSvIdl( rBase, rInStm ); SvMetaAttribute::ReadAttributesSvIdl( rBase, rInStm );
bool bOk = false; bool bOk = false;
bOk |= aPseudoSlots.ReadSvIdl( SvHash_PseudoSlots(), rInStm );
bOk |= aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm ); bOk |= aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm );
bOk |= aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm ); bOk |= aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm );
bOk |= aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm ); bOk |= aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm );
...@@ -260,7 +245,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, ...@@ -260,7 +245,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
bOk = true; bOk = true;
} }
bOk |= aPseudoPrefix.ReadSvIdl( SvHash_PseudoPrefix(), rInStm );
bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm ); bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm );
bOk |= aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm ); bOk |= aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm );
bOk |= aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm ); bOk |= aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm );
...@@ -376,14 +360,12 @@ bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) ...@@ -376,14 +360,12 @@ bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
return bOk; return bOk;
} }
void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, void SvMetaSlot::Insert( SvSlotElementList& rList)
SvIdlDataBase& rBase)
{ {
// get insert position through binary search in slotlist // get insert position through binary search in slotlist
sal_uInt16 nId = (sal_uInt16) GetSlotId().GetValue(); sal_uInt16 nId = (sal_uInt16) GetSlotId().GetValue();
sal_uInt16 nListCount = (sal_uInt16) rList.size(); sal_uInt16 nListCount = (sal_uInt16) rList.size();
sal_uInt16 nPos; sal_uInt16 nPos;
sal_uLong m; // for inner "for" loop
if ( !nListCount ) if ( !nListCount )
nPos = 0; nPos = 0;
...@@ -441,90 +423,6 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, ...@@ -441,90 +423,6 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
{ {
rList.push_back( this ); rList.push_back( this );
} }
// iron out EnumSlots
SvMetaTypeEnum * pEnum = nullptr;
SvMetaType * pBType = GetType()->GetBaseType();
pEnum = dynamic_cast<SvMetaTypeEnum*>( pBType );
if( GetPseudoSlots() && pEnum && pEnum->Count() )
{
// clone the MasterSlot
tools::SvRef<SvMetaSlot> xEnumSlot;
SvMetaSlot *pFirstEnumSlot = nullptr;
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
{
// create SlotId
SvMetaEnumValue *enumValue = pEnum->GetObject(n);
OString aValName = enumValue->GetName();
OStringBuffer aBuf;
if( !GetPseudoPrefix().isEmpty() )
aBuf.append(GetPseudoPrefix());
else
aBuf.append(GetSlotId().getString());
aBuf.append('_');
aBuf.append(aValName.copy(pEnum->GetPrefix().getLength()));
OString aSId = aBuf.makeStringAndClear();
xEnumSlot = nullptr;
for( m=0; m<rBase.GetSlotList().size(); m++ )
{
SvMetaSlot * pAttr = rBase.GetSlotList()[m];
if (aSId.equals(pAttr->GetSlotId().getString()))
{
SvMetaSlot& rSlot = dynamic_cast<SvMetaSlot&>(*pAttr);
xEnumSlot = new SvMetaSlot( rSlot );
break;
}
}
if ( m == rBase.GetSlotList().size() )
{
OSL_FAIL(OString("Invalid EnumSlot! " + aSId).getStr());
xEnumSlot = new SvMetaSlot( *this );
sal_uLong nValue;
if ( rBase.FindId(aSId , &nValue) )
{
SvIdentifier aId;
aId.setString(aSId);
aId.SetValue(nValue);
xEnumSlot->SetSlotId(aId);
}
}
// The slaves are no master!
xEnumSlot->aPseudoSlots = false;
xEnumSlot->SetEnumValue(enumValue);
if ( !pFirstEnumSlot || xEnumSlot->GetSlotId().GetValue() < pFirstEnumSlot->GetSlotId().GetValue() )
pFirstEnumSlot = xEnumSlot.get();
// insert the created slave as well
xEnumSlot->Insert( rList, rPrefix, rBase);
// concatenate the EnumSlots with the master
xEnumSlot->pLinkedSlot = this;
}
// master points to the first slave
pLinkedSlot = pFirstEnumSlot;
// concatenate slaves among themselves
xEnumSlot = pFirstEnumSlot;
size_t i = 0;
SvMetaSlot* pEle;
do
{
pEle = ( ++i < rList.size() ) ? rList[ i ] : nullptr;
if ( pEle && pEle->pLinkedSlot == this )
{
xEnumSlot->pNextSlot = pEle;
xEnumSlot = pEle;
}
}
while ( pEle );
xEnumSlot->pNextSlot = pFirstEnumSlot;
}
} }
...@@ -600,18 +498,13 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -600,18 +498,13 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
if ( !GetExport() && !GetHidden() ) if ( !GetExport() && !GetHidden() )
return; return;
bool bIsEnumSlot = nullptr != pEnumValue;
rOutStm.WriteCharPtr( "// Slot Nr. " ) rOutStm.WriteCharPtr( "// Slot Nr. " )
.WriteOString( OString::number(nListPos) ) .WriteOString( OString::number(nListPos) )
.WriteCharPtr( " : " ); .WriteCharPtr( " : " );
OString aSlotIdValue(OString::number(GetSlotId().GetValue())); OString aSlotIdValue(OString::number(GetSlotId().GetValue()));
rOutStm.WriteOString( aSlotIdValue ) << endl; rOutStm.WriteOString( aSlotIdValue ) << endl;
WriteTab( rOutStm, 1 ); WriteTab( rOutStm, 1 );
if( bIsEnumSlot ) rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ARG( " ).WriteOString( rShellName ).WriteChar( ',' ) ;
rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ENUM( " );
else
rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ARG( " ).WriteOString( rShellName ).WriteChar( ',' ) ;
rOutStm.WriteOString( rSlotId ).WriteChar( ',' ); rOutStm.WriteOString( rSlotId ).WriteChar( ',' );
...@@ -623,100 +516,68 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -623,100 +516,68 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
rOutStm.WriteChar( ',' ) << endl; rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 ); WriteTab( rOutStm, 4 );
if( bIsEnumSlot ) // look for the next slot with the same StateMethod like me
// the slotlist is set to the current slot
size_t i = nStart;
SvMetaSlot* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
pNextSlot = pEle;
while ( pNextSlot )
{ {
rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) if ( !pNextSlot->pNextSlot &&
.WriteOString( OString::number(pLinkedSlot->GetListPos()) ) pNextSlot->GetStateMethod() == GetStateMethod()
.WriteCharPtr( "] /*Offset Master*/, " ) << endl; ) {
WriteTab( rOutStm, 4 ); break;
rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) }
.WriteOString( OString::number(pNextSlot->GetListPos()) ) pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
.WriteCharPtr( "] /*Offset Next*/, " ) << endl; pNextSlot = pEle;
WriteTab( rOutStm, 4 );
// SlotId
if( !GetSlotId().getString().isEmpty() )
rOutStm.WriteOString( pLinkedSlot->GetSlotId().getString() );
else
rOutStm.WriteChar( '0' );
rOutStm.WriteChar( ',' );
rOutStm.WriteOString( pEnumValue->GetName() );
} }
else
if ( !pNextSlot )
{ {
// look for the next slot with the same StateMethod like me // There is no slot behind me that has the same ExecMethod.
// the slotlist is set to the current slot // So I search for the first slot with it (could be myself).
size_t i = nStart; i = 0;
SvMetaSlot* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; pEle = rSlotList.empty() ? nullptr : rSlotList[ i ];
pNextSlot = pEle; pNextSlot = pEle;
while ( pNextSlot ) while ( pNextSlot != this )
{ {
if ( !pNextSlot->pNextSlot && if ( pNextSlot->GetStateMethod() == GetStateMethod() )
pNextSlot->GetStateMethod() == GetStateMethod()
) {
break; break;
}
pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr; pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
pNextSlot = pEle; pNextSlot = pEle;
} }
}
if ( !pNextSlot )
{
// There is no slot behind me that has the same ExecMethod.
// So I search for the first slot with it (could be myself).
i = 0;
pEle = rSlotList.empty() ? nullptr : rSlotList[ i ];
pNextSlot = pEle;
while ( pNextSlot != this )
{
if ( !pNextSlot->pEnumValue &&
pNextSlot->GetStateMethod() == GetStateMethod() )
break;
pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
pNextSlot = pEle;
}
}
if ( !pLinkedSlot ) rOutStm.WriteCharPtr( "0 ," );
{
rOutStm.WriteCharPtr( "0 ," );
}
else
{
rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" )
.WriteOString( OString::number(pLinkedSlot->GetListPos()) )
.WriteCharPtr( "] /*Offset Linked*/, " ) << endl;
WriteTab( rOutStm, 4 );
}
rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" ) rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" )
.WriteOString( OString::number(pNextSlot->GetListPos()) ) .WriteOString( OString::number(pNextSlot->GetListPos()) )
.WriteCharPtr( "] /*Offset Next*/, " ) << endl; .WriteCharPtr( "] /*Offset Next*/, " ) << endl;
WriteTab( rOutStm, 4 ); WriteTab( rOutStm, 4 );
// write ExecMethod, with standard name if not specified // write ExecMethod, with standard name if not specified
if( !GetExecMethod().isEmpty() && if( !GetExecMethod().isEmpty() &&
GetExecMethod() != "NoExec") GetExecMethod() != "NoExec")
{ {
rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' ) rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' )
.WriteOString( GetExecMethod() ).WriteChar( ')' ); .WriteOString( GetExecMethod() ).WriteChar( ')' );
} }
else else
rOutStm.WriteCharPtr( "SFX_STUB_PTR_EXEC_NONE" ); rOutStm.WriteCharPtr( "SFX_STUB_PTR_EXEC_NONE" );
rOutStm.WriteChar( ',' ); rOutStm.WriteChar( ',' );
// write StateMethod, with standard name if not specified // write StateMethod, with standard name if not specified
if( !GetStateMethod().isEmpty() && if( !GetStateMethod().isEmpty() &&
GetStateMethod() != "NoState") GetStateMethod() != "NoState")
{ {
rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' ) rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' )
.WriteOString( GetStateMethod() ).WriteChar( ')' ); .WriteOString( GetStateMethod() ).WriteChar( ')' );
}
else
rOutStm.WriteCharPtr( "SFX_STUB_PTR_STATE_NONE" );
} }
else
rOutStm.WriteCharPtr( "SFX_STUB_PTR_STATE_NONE" );
rOutStm.WriteChar( ',' ) << endl; rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 ); WriteTab( rOutStm, 4 );
...@@ -757,36 +618,26 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -757,36 +618,26 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
rOutStm.WriteOString( GetDisableFlags() ); rOutStm.WriteOString( GetDisableFlags() );
// write attribute type // write attribute type
if( !bIsEnumSlot ) rOutStm.WriteChar( ',' ) << endl;
{ WriteTab( rOutStm, 4 );
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
SvMetaType * pT = GetSlotType(); SvMetaType * pT = GetSlotType();
if( !pT ) if( !pT )
{ {
if( !IsVariable() ) if( !IsVariable() )
pT = rBase.FindType( "SfxVoidItem" ); pT = rBase.FindType( "SfxVoidItem" );
else
pT = GetType();
}
if( pT )
{
rOutStm.WriteOString( pT->GetName() );
if( !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) )
rBase.aUsedTypes.push_back( pT );
}
else else
rOutStm.WriteCharPtr( "SfxVoidItem not defined" ); pT = GetType();
} }
else if( pT )
{ {
SvMetaType *pT = rBase.FindType( "SfxBoolItem" ); rOutStm.WriteOString( pT->GetName() );
if ( pT && !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) ) if( !SvIdlDataBase::FindType( pT, rBase.aUsedTypes ) )
rBase.aUsedTypes.push_back( pT ); rBase.aUsedTypes.push_back( pT );
} }
else
rOutStm.WriteCharPtr( "SfxVoidItem not defined" );
if( !bIsEnumSlot )
{ {
rOutStm.WriteChar( ',' ) << endl; rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 ); WriteTab( rOutStm, 4 );
......
...@@ -115,7 +115,7 @@ sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray ) ...@@ -115,7 +115,7 @@ sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray )
} }
} }
void SvMetaAttribute::Insert (SvSlotElementList&, const OString&, SvIdlDataBase&) void SvMetaAttribute::Insert(SvSlotElementList&)
{ {
} }
......
...@@ -83,8 +83,6 @@ char const * const SyntaxStrings[] = { ...@@ -83,8 +83,6 @@ char const * const SyntaxStrings[] = {
"\t\tFastCall", "\t\tFastCall",
"\t\tGet, Set", "\t\tGet, Set",
"\t\tGroupId = Identifier", "\t\tGroupId = Identifier",
"\t\tPseudoPrefix = Identifier",
"\t\tPseudoSlots",
"\t\tReadOnlyDoc*", "\t\tReadOnlyDoc*",
"\t\tRecordPerSet*, RecordPerItem, NoRecord", "\t\tRecordPerSet*, RecordPerItem, NoRecord",
"\t\tRecordAbsolute", "\t\tRecordAbsolute",
......
...@@ -74,7 +74,6 @@ SvGlobalHashNames::SvGlobalHashNames() ...@@ -74,7 +74,6 @@ SvGlobalHashNames::SvGlobalHashNames()
A_ENTRY(float) A_ENTRY(float)
A_ENTRY(double) A_ENTRY(double)
A_ENTRY(item) A_ENTRY(item)
A_ENTRY(PseudoSlots)
A_ENTRY(import) A_ENTRY(import)
A_ENTRY(SlotIdFile) A_ENTRY(SlotIdFile)
A_ENTRY(include) A_ENTRY(include)
...@@ -82,7 +81,6 @@ SvGlobalHashNames::SvGlobalHashNames() ...@@ -82,7 +81,6 @@ SvGlobalHashNames::SvGlobalHashNames()
A_ENTRY(StateMethod) A_ENTRY(StateMethod)
A_ENTRY(GroupId) A_ENTRY(GroupId)
A_ENTRY(Export) A_ENTRY(Export)
A_ENTRY(PseudoPrefix)
A_ENTRY(define) A_ENTRY(define)
A_ENTRY(MenuConfig) A_ENTRY(MenuConfig)
A_ENTRY(ToolBoxConfig) A_ENTRY(ToolBoxConfig)
......
...@@ -382,7 +382,6 @@ bool SvIdlParser::ReadSlot(SvMetaSlot& rSlot) ...@@ -382,7 +382,6 @@ bool SvIdlParser::ReadSlot(SvMetaSlot& rSlot)
void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot ) void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot )
{ {
bool bOk = false; bool bOk = false;
bOk |= ReadIfBoolAttribute(rSlot.aPseudoSlots, SvHash_PseudoSlots() );
bOk |= ReadIfIdAttribute(rSlot.aGroupId, SvHash_GroupId() ); bOk |= ReadIfIdAttribute(rSlot.aGroupId, SvHash_GroupId() );
bOk |= ReadIfIdAttribute(rSlot.aExecMethod, SvHash_ExecMethod() ); bOk |= ReadIfIdAttribute(rSlot.aExecMethod, SvHash_ExecMethod() );
bOk |= ReadIfIdAttribute(rSlot.aStateMethod, SvHash_StateMethod() ); bOk |= ReadIfIdAttribute(rSlot.aStateMethod, SvHash_StateMethod() );
...@@ -417,7 +416,6 @@ void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot ) ...@@ -417,7 +416,6 @@ void SvIdlParser::ReadSlotAttribute( SvMetaSlot& rSlot )
bOk = true; bOk = true;
} }
bOk |= ReadIfIdAttribute(rSlot.aPseudoPrefix, SvHash_PseudoPrefix() );
bOk |= ReadIfBoolAttribute(rSlot.aMenuConfig, SvHash_MenuConfig() ); bOk |= ReadIfBoolAttribute(rSlot.aMenuConfig, SvHash_MenuConfig() );
bOk |= ReadIfBoolAttribute(rSlot.aToolBoxConfig, SvHash_ToolBoxConfig() ); bOk |= ReadIfBoolAttribute(rSlot.aToolBoxConfig, SvHash_ToolBoxConfig() );
bOk |= ReadIfBoolAttribute(rSlot.aAccelConfig, SvHash_AccelConfig() ); bOk |= ReadIfBoolAttribute(rSlot.aAccelConfig, SvHash_AccelConfig() );
......
...@@ -178,17 +178,6 @@ SFX_DECL_TYPE(23); // for SvxSearchItem ...@@ -178,17 +178,6 @@ SFX_DECL_TYPE(23); // for SvxSearchItem
&a##aShellClass##Args_Impl[nArg0], nArgs, DisableFlags, UnoName \ &a##aShellClass##Args_Impl[nArg0], nArgs, DisableFlags, UnoName \
} }
#define SFX_NEW_SLOT_ENUM( SlaveId, GroupId, pMaster, pNext, MasterId, Value, Flags, DisableFlags, UnoName ) \
{ SlaveId, GroupId, Flags, \
MasterId, Value, \
0, \
0, \
(const SfxType*) &aSfxBoolItem_Impl, \
pMaster, \
pNext, \
0, 0, DisableFlags, UnoName \
}
struct SfxFormalArgument struct SfxFormalArgument
{ {
const SfxType* pType; // Type of the parameter (SfxPoolItem subclass) const SfxType* pType; // Type of the parameter (SfxPoolItem subclass)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment