cppuhelper/source/servicemanager.cxx | 28 +- idlc/source/astconstant.cxx | 2 idlc/source/astdump.cxx | 64 +++--- idlc/source/astenum.cxx | 6 idlc/source/astinterface.cxx | 8 idlc/source/astoperation.cxx | 2 idlc/source/aststruct.cxx | 12 - idlc/source/idlcproduce.cxx | 8 include/registry/reflread.hxx | 2 include/registry/reflwrit.hxx | 2 include/registry/registry.h | 18 - include/registry/registry.hxx | 175 +++++++--------- include/registry/regtype.h | 102 ++++----- include/registry/types.h | 170 ++++++++-------- include/sfx2/dispatch.hxx | 23 +- include/sfx2/new.hxx | 23 +- registry/source/keyimpl.cxx | 198 ++++++++---------- registry/source/keyimpl.hxx | 3 registry/source/reflread.cxx | 16 - registry/source/reflwrit.cxx | 12 - registry/source/regimpl.cxx | 272 +++++++++++++------------- registry/source/regimpl.hxx | 5 registry/source/registry.cxx | 111 +++++----- registry/source/regkey.cxx | 218 ++++++++------------ registry/source/regkey.hxx | 1 registry/test/testmerge.cxx | 62 ++--- registry/test/testregcpp.cxx | 98 ++++----- registry/tools/regcompare.cxx | 170 ++++++++-------- registry/tools/regmerge.cxx | 12 - registry/tools/regview.cxx | 16 - registry/workben/regtest.cxx | 10 sfx2/source/appl/appquit.cxx | 2 sfx2/source/control/dispatch.cxx | 16 - sfx2/source/doc/new.cxx | 33 +-- sfx2/source/view/viewfrm.cxx | 6 sfx2/source/view/viewsh.cxx | 2 stoc/source/simpleregistry/simpleregistry.cxx | 238 ++++++++++------------ stoc/test/testregistry.cxx | 4 stoc/test/testsmgr.cxx | 2 sw/source/uibase/app/docsh2.cxx | 24 +- sw/source/uibase/uiview/view.cxx | 2 sw/source/uibase/web/wview.cxx | 2 unoidl/source/legacyprovider.cxx | 103 ++++----- 43 files changed, 1090 insertions(+), 1193 deletions(-)
New commits: commit cfab2fd725276e99fb6fa8b619ca5b2ac3bd025a Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 9 08:40:43 2015 +0200 convert SFX_SHELL constants to scoped enum Change-Id: If1649e8f3b9d200b0b176bef7deea41445bd3f2f diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx index 274c0c2..dc9c5a7 100644 --- a/include/sfx2/dispatch.hxx +++ b/include/sfx2/dispatch.hxx @@ -27,6 +27,7 @@ #include <sfx2/bindings.hxx> #include <sfx2/viewfrm.hxx> +#include <o3tl/typed_flags_set.hxx> class SfxSlotServer; class SfxShell; @@ -54,11 +55,17 @@ namespace com } - -#define SFX_SHELL_POP_UNTIL 4 -#define SFX_SHELL_POP_DELETE 2 -#define SFX_SHELL_PUSH 1 - +enum class SfxDispatcherPopFlags +{ + NONE = 0, + POP_UNTIL = 4, + POP_DELETE = 2, + PUSH = 1, +}; +namespace o3tl +{ + template<> struct typed_flags<SfxDispatcherPopFlags> : is_typed_flags<SfxDispatcherPopFlags, 0x07> {}; +} enum SfxSlotFilterState { @@ -143,11 +150,11 @@ public: SfxBindings* GetBindings() const; void Push( SfxShell& rShell ); - void Pop( SfxShell& rShell, sal_uInt16 nMode = 0 ); + void Pop( SfxShell& rShell, SfxDispatcherPopFlags nMode = SfxDispatcherPopFlags::NONE ); SfxShell* GetShell(sal_uInt16 nIdx) const; SfxViewFrame* GetFrame() const; - SfxModule* GetModule() const; + SfxModule* GetModule() const; // caller has to clean up the Manager on his own static SfxPopupMenuManager* Popup( sal_uInt16 nConfigId, vcl::Window *pWin, const Point *pPos ); @@ -173,7 +180,7 @@ public: ::com::sun::star::frame::XDispatch* GetDispatchInterface( const OUString& ); void SetDisableFlags( sal_uInt32 nFlags ); - sal_uInt32 GetDisableFlags() const; + sal_uInt32 GetDisableFlags() const; SAL_DLLPRIVATE void SetMenu_Impl(); SAL_DLLPRIVATE void Update_Impl( bool bForce = false ); // ObjectBars etc. diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index e49675d..641392b 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -85,7 +85,7 @@ void SfxApplication::Deinitialize() "existing SfxViewFrame after Execute" ); DBG_ASSERT( !SfxObjectShell::GetFirst(), "existing SfxObjectShell after Execute" ); - pAppData_Impl->pAppDispat->Pop( *this, SFX_SHELL_POP_UNTIL ); + pAppData_Impl->pAppDispat->Pop( *this, SfxDispatcherPopFlags::POP_UNTIL ); pAppData_Impl->pAppDispat->Flush(); pAppData_Impl->bDowning = true; pAppData_Impl->pAppDispat->DoDeactivate_Impl( true, NULL ); diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 081d1a6..987ef96 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -169,7 +169,7 @@ void SfxDispatcher::Flush() void SfxDispatcher::Push(SfxShell& rShell) { - Pop( rShell, SFX_SHELL_PUSH ); + Pop( rShell, SfxDispatcherPopFlags::PUSH ); } /** This method checks whether a particular <SfxShell> instance is @@ -411,25 +411,25 @@ SfxDispatcher::~SfxDispatcher() SfxShell cancel each other out. @param rShell the stack to take the SfxShell instance. - @param nMode SFX_SHELL_POP_UNTIL + @param nMode SfxDispatcherPopFlags::POP_UNTIL Also all 'rShell' of SfxShells are taken from the stack. - SFX_SHELL_POP_DELETE + SfxDispatcherPopFlags::POP_DELETE All SfxShells actually taken from the stack will be deleted. - SFX_SHELL_PUSH (InPlace use only) + SfxDispatcherPopFlags::PUSH (InPlace use only) The Shell is pushed. */ -void SfxDispatcher::Pop(SfxShell& rShell, sal_uInt16 nMode) +void SfxDispatcher::Pop(SfxShell& rShell, SfxDispatcherPopFlags nMode) { DBG_ASSERT( rShell.GetInterface(), "pushing SfxShell without previous RegisterInterface()" ); - bool bDelete = (nMode & SFX_SHELL_POP_DELETE) == SFX_SHELL_POP_DELETE; - bool bUntil = (nMode & SFX_SHELL_POP_UNTIL) == SFX_SHELL_POP_UNTIL; - bool bPush = (nMode & SFX_SHELL_PUSH) == SFX_SHELL_PUSH; + bool bDelete = bool(nMode & SfxDispatcherPopFlags::POP_DELETE); + bool bUntil = bool(nMode & SfxDispatcherPopFlags::POP_UNTIL); + bool bPush = bool(nMode & SfxDispatcherPopFlags::PUSH); SfxApplication *pSfxApp = SfxGetpApp(); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c36076b..434b387 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1028,9 +1028,9 @@ void SfxViewFrame::PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ) SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 ); if ( pSubShell == i_rViewShell.GetSubShell() ) // "real" sub shells will be deleted elsewhere - pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL ); + pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL ); else - pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE ); + pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE ); } pDispatcher->Pop( i_rViewShell ); pDispatcher->Flush(); @@ -1519,7 +1519,7 @@ void SfxViewFrame::KillDispatcher_Impl() if ( pDispatcher ) { if( pModule ) - pDispatcher->Pop( *pModule, SFX_SHELL_POP_UNTIL ); + pDispatcher->Pop( *pModule, SfxDispatcherPopFlags::POP_UNTIL ); else pDispatcher->Pop( *this ); DELETEZ(pDispatcher); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index e27660c..abfbbbc 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1474,7 +1474,7 @@ void SfxViewShell::PushSubShells_Impl( bool bPush ) { SfxShell& rPopUntil = *pImp->aArr[0]; if ( pDisp->GetShellLevel( rPopUntil ) != USHRT_MAX ) - pDisp->Pop( rPopUntil, SFX_SHELL_POP_UNTIL ); + pDisp->Pop( rPopUntil, SfxDispatcherPopFlags::POP_UNTIL ); } pDisp->Flush(); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index fb92a81..8c16a79 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -279,7 +279,7 @@ void SwView::SelectShell() || pSfxShell->ISA( SwAnnotationShell ) ) { - rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_DELETE ); + rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_DELETE ); } else if ( pSfxShell->ISA( FmFormShell ) ) { diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx index eff5f9b..ecd15c6 100644 --- a/sw/source/uibase/web/wview.cxx +++ b/sw/source/uibase/web/wview.cxx @@ -148,7 +148,7 @@ void SwWebView::SelectShell() { pSfxShell = rDispatcher.GetShell( --i ); OSL_ENSURE( pSfxShell, "My Shell ist lost in space" ); - rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE); + rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE); } } commit 502a7662555bfa66ab6be84b7d2d11b049ed7a4e Author: Noel Grandin <n...@peralex.com> Date: Wed Apr 8 16:15:44 2015 +0200 convert SFX_LOAD constants to scoped enum Change-Id: If0a2eeeabbb0bea48d2f2f86dc04266812c0ecd2 diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx index aa53d4c..48b6dab 100644 --- a/include/sfx2/new.hxx +++ b/include/sfx2/new.hxx @@ -27,6 +27,7 @@ #include <vcl/edit.hxx> #include <vcl/fixed.hxx> #include <sfx2/basedlgs.hxx> +#include <o3tl/typed_flags_set.hxx> @@ -38,11 +39,19 @@ class SfxObjectShell; #define SFXWB_PREVIEW 0x0003 #define SFXWB_LOAD_TEMPLATE 0x0004 -#define SFX_LOAD_TEXT_STYLES 0x0001 -#define SFX_LOAD_FRAME_STYLES 0x0002 -#define SFX_LOAD_PAGE_STYLES 0x0004 -#define SFX_LOAD_NUM_STYLES 0x0008 -#define SFX_MERGE_STYLES 0x0010 +enum class SfxTemplateFlags +{ + NONE = 0x00, + LOAD_TEXT_STYLES = 0x01, + LOAD_FRAME_STYLES = 0x02, + LOAD_PAGE_STYLES = 0x04, + LOAD_NUM_STYLES = 0x08, + MERGE_STYLES = 0x10, +}; +namespace o3tl +{ + template<> struct typed_flags<SfxTemplateFlags> : is_typed_flags<SfxTemplateFlags, 0x1f> {}; +} #define RET_TEMPLATE_LOAD 100 @@ -65,8 +74,8 @@ public: OUString GetTemplateFileName() const; // load template methods - sal_uInt16 GetTemplateFlags()const; - void SetTemplateFlags(sal_uInt16 nSet); + SfxTemplateFlags GetTemplateFlags() const; + void SetTemplateFlags(SfxTemplateFlags nSet); }; #endif diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 8a718b9..e62676b 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -165,8 +165,8 @@ public: bool IsTemplate() const; OUString GetTemplateFileName() const; - sal_uInt16 GetTemplateFlags()const; - void SetTemplateFlags(sal_uInt16 nSet); + SfxTemplateFlags GetTemplateFlags() const; + void SetTemplateFlags(SfxTemplateFlags nSet); }; IMPL_LINK_NOARG(SfxNewFileDialog_Impl, Update) @@ -340,27 +340,27 @@ OUString SfxNewFileDialog_Impl::GetTemplateFileName() const GetSelectedTemplatePos()-1); } -sal_uInt16 SfxNewFileDialog_Impl::GetTemplateFlags()const +SfxTemplateFlags SfxNewFileDialog_Impl::GetTemplateFlags()const { - sal_uInt16 nRet = m_pTextStyleCB->IsChecked() ? SFX_LOAD_TEXT_STYLES : 0; + SfxTemplateFlags nRet = m_pTextStyleCB->IsChecked() ? SfxTemplateFlags::LOAD_TEXT_STYLES : SfxTemplateFlags::NONE; if(m_pFrameStyleCB->IsChecked()) - nRet |= SFX_LOAD_FRAME_STYLES; + nRet |= SfxTemplateFlags::LOAD_FRAME_STYLES; if(m_pPageStyleCB->IsChecked()) - nRet |= SFX_LOAD_PAGE_STYLES; + nRet |= SfxTemplateFlags::LOAD_PAGE_STYLES; if(m_pNumStyleCB->IsChecked()) - nRet |= SFX_LOAD_NUM_STYLES; + nRet |= SfxTemplateFlags::LOAD_NUM_STYLES; if(m_pMergeStyleCB->IsChecked()) - nRet |= SFX_MERGE_STYLES; + nRet |= SfxTemplateFlags::MERGE_STYLES; return nRet; } -void SfxNewFileDialog_Impl::SetTemplateFlags(sal_uInt16 nSet) +void SfxNewFileDialog_Impl::SetTemplateFlags(SfxTemplateFlags nSet) { - m_pTextStyleCB->Check( 0 != (nSet&SFX_LOAD_TEXT_STYLES )); - m_pFrameStyleCB->Check( 0 != (nSet&SFX_LOAD_FRAME_STYLES)); - m_pPageStyleCB->Check( 0 != (nSet&SFX_LOAD_PAGE_STYLES )); - m_pNumStyleCB->Check( 0 != (nSet&SFX_LOAD_NUM_STYLES )); - m_pMergeStyleCB->Check( 0 != (nSet&SFX_MERGE_STYLES )); + m_pTextStyleCB->Check( bool(nSet & SfxTemplateFlags::LOAD_TEXT_STYLES )); + m_pFrameStyleCB->Check( bool(nSet & SfxTemplateFlags::LOAD_FRAME_STYLES)); + m_pPageStyleCB->Check( bool(nSet & SfxTemplateFlags::LOAD_PAGE_STYLES )); + m_pNumStyleCB->Check( bool(nSet & SfxTemplateFlags::LOAD_NUM_STYLES )); + m_pMergeStyleCB->Check( bool(nSet & SfxTemplateFlags::MERGE_STYLES )); } @@ -467,13 +467,12 @@ OUString SfxNewFileDialog::GetTemplateFileName() const return pImpl->GetTemplateFileName(); } -sal_uInt16 SfxNewFileDialog::GetTemplateFlags()const +SfxTemplateFlags SfxNewFileDialog::GetTemplateFlags()const { return pImpl->GetTemplateFlags(); - } -void SfxNewFileDialog::SetTemplateFlags(sal_uInt16 nSet) +void SfxNewFileDialog::SetTemplateFlags(SfxTemplateFlags nSet) { pImpl->SetTemplateFlags(nSet); } diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index f3056be..f9fba49 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -475,15 +475,15 @@ void SwDocShell::Execute(SfxRequest& rReq) static bool bMerge = false; sal_uInt16 nRet = USHRT_MAX; - sal_uInt16 nFlags = bFrame ? SFX_LOAD_FRAME_STYLES : 0; + SfxTemplateFlags nFlags = bFrame ? SfxTemplateFlags::LOAD_FRAME_STYLES : SfxTemplateFlags::NONE; if(bPage) - nFlags|= SFX_LOAD_PAGE_STYLES; + nFlags |= SfxTemplateFlags::LOAD_PAGE_STYLES; if(bNum) - nFlags|= SFX_LOAD_NUM_STYLES; - if(!nFlags || bText) - nFlags|= SFX_LOAD_TEXT_STYLES; + nFlags |= SfxTemplateFlags::LOAD_NUM_STYLES; + if(nFlags == SfxTemplateFlags::NONE || bText) + nFlags |= SfxTemplateFlags::LOAD_TEXT_STYLES; if(bMerge) - nFlags|= SFX_MERGE_STYLES; + nFlags |= SfxTemplateFlags::MERGE_STYLES; if ( pArgs ) { @@ -493,7 +493,7 @@ void SwDocShell::Execute(SfxRequest& rReq) aFileName = pTemplateItem->GetValue(); SFX_REQUEST_ARG( rReq, pFlagsItem, SfxInt32Item, SID_TEMPLATE_LOAD, false ); if ( pFlagsItem ) - nFlags = (sal_uInt16) pFlagsItem->GetValue(); + nFlags = static_cast<SfxTemplateFlags>((sal_uInt16) pFlagsItem->GetValue()); } } @@ -570,12 +570,12 @@ void SwDocShell::Execute(SfxRequest& rReq) if( !aFileName.isEmpty() ) { SwgReaderOption aOpt; - aOpt.SetTxtFmts( bText = (0 != (nFlags&SFX_LOAD_TEXT_STYLES) )); - aOpt.SetFrmFmts( bFrame = (0 != (nFlags&SFX_LOAD_FRAME_STYLES))); - aOpt.SetPageDescs( bPage = (0 != (nFlags&SFX_LOAD_PAGE_STYLES ))); - aOpt.SetNumRules( bNum = (0 != (nFlags&SFX_LOAD_NUM_STYLES ))); + aOpt.SetTxtFmts( bText = bool(nFlags & SfxTemplateFlags::LOAD_TEXT_STYLES )); + aOpt.SetFrmFmts( bFrame = bool(nFlags & SfxTemplateFlags::LOAD_FRAME_STYLES)); + aOpt.SetPageDescs( bPage = bool(nFlags & SfxTemplateFlags::LOAD_PAGE_STYLES )); + aOpt.SetNumRules( bNum = bool(nFlags & SfxTemplateFlags::LOAD_NUM_STYLES )); //different meaning between SFX_MERGE_STYLES and aOpt.SetMerge! - bMerge = 0 != (nFlags&SFX_MERGE_STYLES); + bMerge = bool(nFlags & SfxTemplateFlags::MERGE_STYLES); aOpt.SetMerge( !bMerge ); SetError( LoadStylesFromFile( aFileName, aOpt, false ), OUString( OSL_LOG_PREFIX )); commit 68b35c75588f5702a142c8232d5e805bfe276c72 Author: Noel Grandin <n...@peralex.com> Date: Wed Apr 8 15:36:06 2015 +0200 convert RTReferenceType to scoped enum Change-Id: I8320f6f42d5579fbd09450ddca61c4c066de98e4 diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index f970f6c..b4dfa84 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -257,7 +257,7 @@ bool AstService::dump(RegistryKey& rKey) { AstInterfaceMember * decl = static_cast<AstInterfaceMember *>(*i); writer.setReferenceData( - referenceIndex++, decl->getDocumentation(), RT_REF_SUPPORTS, + referenceIndex++, decl->getDocumentation(), RTReferenceType::SUPPORTS, (decl->isOptional() ? RTFieldAccess::OPTIONAL : RTFieldAccess::INVALID), OStringToOUString( decl->getRealInterface()->getRelativName(), RTL_TEXTENCODING_UTF8)); @@ -268,7 +268,7 @@ bool AstService::dump(RegistryKey& rKey) if (getNodeType() == NT_service) { AstServiceMember * decl = static_cast<AstServiceMember *>(*i); - writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_EXPORTS, + writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RTReferenceType::EXPORTS, (decl->isOptional() ? RTFieldAccess::OPTIONAL : RTFieldAccess::INVALID), OStringToOUString(decl->getRealService()->getRelativName(), RTL_TEXTENCODING_UTF8)); @@ -278,7 +278,7 @@ bool AstService::dump(RegistryKey& rKey) case NT_observes: { AstObserves * decl = static_cast<AstObserves *>(*i); - writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_OBSERVES, + writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RTReferenceType::OBSERVES, RTFieldAccess::INVALID, OStringToOUString( decl->getRealInterface()->getRelativName(), RTL_TEXTENCODING_UTF8)); @@ -288,7 +288,7 @@ bool AstService::dump(RegistryKey& rKey) case NT_needs: { AstNeeds * decl = static_cast<AstNeeds *>(*i); - writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_NEEDS, + writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RTReferenceType::NEEDS, RTFieldAccess::INVALID, OStringToOUString( decl->getRealService()->getRelativName(), RTL_TEXTENCODING_UTF8)); diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx index 5941fa3..97d8f02 100644 --- a/idlc/source/astinterface.cxx +++ b/idlc/source/astinterface.cxx @@ -206,7 +206,7 @@ bool AstInterface::dump(RegistryKey& rKey) { if (i->isOptional()) { aBlob.setReferenceData( - referenceIndex++, i->getDocumentation(), RT_REF_SUPPORTS, + referenceIndex++, i->getDocumentation(), RTReferenceType::SUPPORTS, RTFieldAccess::OPTIONAL, OStringToOUString( i->getInterface()->getRelativName(), diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index 4983173..d223299 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -153,7 +153,7 @@ bool AstStruct::dump(RegistryKey& rKey) i != m_typeParameters.end(); ++i) { aBlob.setReferenceData( - index++, emptyStr, RT_REF_TYPE_PARAMETER, RTFieldAccess::INVALID, + index++, emptyStr, RTReferenceType::TYPE_PARAMETER, RTFieldAccess::INVALID, OStringToOUString( (*i)->getLocalName(), RTL_TEXTENCODING_UTF8)); } diff --git a/include/registry/types.h b/include/registry/types.h index 6d87f84..27eacb8 100644 --- a/include/registry/types.h +++ b/include/registry/types.h @@ -298,37 +298,37 @@ enum RTParamMode { /** specifies the type of a reference used in a service description. */ -enum RTReferenceType { +enum class RTReferenceType { /// the reference type is unknown - RT_REF_INVALID, + INVALID, /** the service support the interface that means a implementation of this service must implement this interface. */ - RT_REF_SUPPORTS, + SUPPORTS, /** @deprecated the service observes the interface. */ - RT_REF_OBSERVES, + OBSERVES, /** the service exports the specified service that means this service provides also the specified service. */ - RT_REF_EXPORTS, + EXPORTS, /** @deprecated the service needs the specified service that means in the context of this service the specified service will be used or must be available. */ - RT_REF_NEEDS, + NEEDS, /** Indicates a type parameter of a polymorphic struct type template. @since UDK 3.2.0 */ - RT_REF_TYPE_PARAMETER + TYPE_PARAMETER }; #ifdef __cplusplus diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index cfc218d..49f6e4e 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -846,7 +846,7 @@ const sal_Char* ReferenceList::getReferenceName(sal_uInt16 index) RTReferenceType ReferenceList::getReferenceType(sal_uInt16 index) { - RTReferenceType refType = RT_REF_INVALID; + RTReferenceType refType = RTReferenceType::INVALID; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1788,7 +1788,7 @@ RTReferenceType TYPEREG_CALLTYPE typereg_reader_getReferenceSort(void * hEntry, { TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); - if (pEntry == NULL) return RT_REF_INVALID; + if (pEntry == NULL) return RTReferenceType::INVALID; return pEntry->m_pReferences->getReferenceType(index); } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index b97b4f3..b98c469 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -480,7 +480,7 @@ public: }; ReferenceEntry::ReferenceEntry() - : m_type(RT_REF_INVALID) + : m_type(RTReferenceType::INVALID) , m_access(RTFieldAccess::INVALID) { } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 50085b4..64ad999 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -394,15 +394,15 @@ void dumpType(typereg::Reader const & reader, OString const & indent) { printf("\n"); printf("%s sort: ", indent.getStr()); switch (reader.getReferenceSort(i)) { - case RT_REF_SUPPORTS: + case RTReferenceType::SUPPORTS: printf("supports"); break; - case RT_REF_EXPORTS: + case RTReferenceType::EXPORTS: printf("exports"); break; - case RT_REF_TYPE_PARAMETER: + case RTReferenceType::TYPE_PARAMETER: printf("type parameter"); break; diff --git a/registry/test/testregcpp.cxx b/registry/test/testregcpp.cxx index 19ef8a7..bc9d447 100644 --- a/registry/test/testregcpp.cxx +++ b/registry/test/testregcpp.cxx @@ -299,14 +299,14 @@ void test_coreReflection() OUString("ich bin eine property"), OUString(), RTFieldAccess::READWRITE); - writer.setReferenceData(0, OUString("ModuleA/XInterfaceA"), RT_REF_SUPPORTS, + writer.setReferenceData(0, OUString("ModuleA/XInterfaceA"), RTReferenceType::SUPPORTS, OUString("Hallo ich eine Reference auf ein supported interface"), RTFieldAccess::OPTIONAL); - writer.setReferenceData(1, OUString("ModuleA/XInterfaceA"), RT_REF_OBSERVES, + writer.setReferenceData(1, OUString("ModuleA/XInterfaceA"), RTReferenceType::OBSERVES, OUString("Hallo ich eine Reference auf ein observed interface")); - writer.setReferenceData(2, OUString("ModuleA/ServiceB"), RT_REF_EXPORTS, + writer.setReferenceData(2, OUString("ModuleA/ServiceB"), RTReferenceType::EXPORTS, OUString("Hallo ich eine Reference auf einen exported service")); - writer.setReferenceData(3, OUString("ModuleA/ServiceB"), RT_REF_NEEDS, + writer.setReferenceData(3, OUString("ModuleA/ServiceB"), RTReferenceType::NEEDS, OUString("Hallo ich eine Reference auf einen needed service")); const sal_uInt8* pBlop = writer.getBlop(); diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index e85eff8..8d4d422 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -886,16 +886,16 @@ static char const * getReferenceType(RTReferenceType refType) { switch (refType) { - case RT_REF_SUPPORTS: - return "RT_REF_SUPPORTS"; - case RT_REF_OBSERVES: - return "RT_REF_OBSERVES"; - case RT_REF_EXPORTS: - return "RT_REF_EXPORTS"; - case RT_REF_NEEDS: - return "RT_REF_NEEDS"; + case RTReferenceType::SUPPORTS: + return "RTReferenceType::SUPPORTS"; + case RTReferenceType::OBSERVES: + return "RTReferenceType::OBSERVES"; + case RTReferenceType::EXPORTS: + return "RTReferenceType::EXPORTS"; + case RTReferenceType::NEEDS: + return "RTReferenceType::NEEDS"; default: - return "RT_REF_INVALID"; + return "RTReferenceType::INVALID"; } } diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx index 1350617..d3f34bb 100644 --- a/unoidl/source/legacyprovider.cxx +++ b/unoidl/source/legacyprovider.cxx @@ -512,7 +512,7 @@ rtl::Reference< Entity > readEntity( translateAnnotations( reader.getReferenceDocumentation(j))); switch (reader.getReferenceSort(j)) { - case RT_REF_EXPORTS: + case RTReferenceType::EXPORTS: if (!(reader.getReferenceFlags(j) & RTFieldAccess::OPTIONAL)) { mandServs.push_back(base); @@ -520,7 +520,7 @@ rtl::Reference< Entity > readEntity( optServs.push_back(base); } break; - case RT_REF_SUPPORTS: + case RTReferenceType::SUPPORTS: if (!(reader.getReferenceFlags(j) & RTFieldAccess::OPTIONAL)) { mandIfcs.push_back(base); @@ -532,7 +532,7 @@ rtl::Reference< Entity > readEntity( throw FileFormatException( key.getRegistryName(), ("legacy format: unexpected mode " - + OUString::number(reader.getReferenceSort(j)) + + OUString::number(static_cast<int>(reader.getReferenceSort(j))) + " of reference " + reader.getReferenceTypeName(j) + " in service with key " + sub.getName())); } commit e2931bce34a274167da52792d07b19743d488aa0 Author: Noel Grandin <n...@peralex.com> Date: Wed Apr 8 14:55:43 2015 +0200 convert RTMethodMode to scoped enum Change-Id: I81599570698eb92abf14fa6386d8545c2031e863 diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index c869197..f970f6c 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -302,7 +302,7 @@ bool AstService::dump(RegistryKey& rKey) } if (m_defaultConstructor) { writer.setMethodData( - constructorIndex++, emptyStr, RT_MODE_TWOWAY, + constructorIndex++, emptyStr, RTMethodMode::TWOWAY, emptyStr, OUString("void"), 0, 0); } @@ -374,10 +374,10 @@ bool AstAttribute::dumpBlob( OStringToOUString(getType()->getRelativName(), RTL_TEXTENCODING_UTF8), RTConstValue()); dumpExceptions( - rBlob, m_getDocumentation, m_getExceptions, RT_MODE_ATTRIBUTE_GET, + rBlob, m_getDocumentation, m_getExceptions, RTMethodMode::ATTRIBUTE_GET, methodIndex); dumpExceptions( - rBlob, m_setDocumentation, m_setExceptions, RT_MODE_ATTRIBUTE_SET, + rBlob, m_setDocumentation, m_setExceptions, RTMethodMode::ATTRIBUTE_SET, methodIndex); return true; diff --git a/idlc/source/astoperation.cxx b/idlc/source/astoperation.cxx index ce67313..6e9f675 100644 --- a/idlc/source/astoperation.cxx +++ b/idlc/source/astoperation.cxx @@ -42,7 +42,7 @@ bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) { sal_uInt16 nParam = getNodeCount(NT_parameter); sal_uInt16 nExcep = nExceptions(); - RTMethodMode methodMode = RT_MODE_TWOWAY; + RTMethodMode methodMode = RTMethodMode::TWOWAY; OUString returnTypeName; if (m_pReturnType == 0) { diff --git a/include/registry/types.h b/include/registry/types.h index dcc1152..6d87f84 100644 --- a/include/registry/types.h +++ b/include/registry/types.h @@ -232,21 +232,21 @@ union RTConstValueUnion { A method can be synchron or asynchron (oneway). The const attribute for methods was removed so that the const values are deprecated. */ -enum RTMethodMode { +enum class RTMethodMode { /// indicates an invalid mode - RT_MODE_INVALID, + INVALID, /// indicates the asynchronous mode of a method - RT_MODE_ONEWAY, + ONEWAY, /// @deprecated - RT_MODE_ONEWAY_CONST, + ONEWAY_CONST, /// indicated the synchronous mode of a method - RT_MODE_TWOWAY, + TWOWAY, /// @deprecated - RT_MODE_TWOWAY_CONST, + TWOWAY_CONST, /** Indicates an extended attribute getter (that has a 'raises' clause) of an @@ -254,7 +254,7 @@ enum RTMethodMode { @since UDK 3.2.0 */ - RT_MODE_ATTRIBUTE_GET, + ATTRIBUTE_GET, /** Indicates an extended attribute setter (that has a 'raises' clause) of an @@ -262,7 +262,7 @@ enum RTMethodMode { @since UDK 3.2.0 */ - RT_MODE_ATTRIBUTE_SET + ATTRIBUTE_SET }; /** specifies the mode of a parameter. diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index 5b1c58c..cfc218d 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -1132,7 +1132,7 @@ const sal_Char* MethodList::getMethodReturnType(sal_uInt16 index) RTMethodMode MethodList::getMethodMode(sal_uInt16 index) { - RTMethodMode aMode = RT_MODE_INVALID; + RTMethodMode aMode = RTMethodMode::INVALID; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1730,7 +1730,7 @@ RTMethodMode TYPEREG_CALLTYPE typereg_reader_getMethodFlags(void * hEntry, sal_u { TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); - if (pEntry == NULL) return RT_MODE_INVALID; + if (pEntry == NULL) return RTMethodMode::INVALID; return pEntry->m_pMethods->getMethodMode(index); } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 426911b..b97b4f3 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -538,7 +538,7 @@ protected: }; MethodEntry::MethodEntry() - : m_mode(RT_MODE_INVALID) + : m_mode(RTMethodMode::INVALID) , m_paramCount(0) , m_params(NULL) , m_excCount(0) diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 09afcc0..50085b4 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -294,19 +294,19 @@ void dumpType(typereg::Reader const & reader, OString const & indent) { printf("\n"); printf("%s flags: ", indent.getStr()); switch (reader.getMethodFlags(i)) { - case RT_MODE_ONEWAY: + case RTMethodMode::ONEWAY: printf("oneway"); break; - case RT_MODE_TWOWAY: + case RTMethodMode::TWOWAY: printf("synchronous"); break; - case RT_MODE_ATTRIBUTE_GET: + case RTMethodMode::ATTRIBUTE_GET: printf("attribute get"); break; - case RT_MODE_ATTRIBUTE_SET: + case RTMethodMode::ATTRIBUTE_SET: printf("attribute set"); break; diff --git a/registry/test/testregcpp.cxx b/registry/test/testregcpp.cxx index e7853c3..19ef8a7 100644 --- a/registry/test/testregcpp.cxx +++ b/registry/test/testregcpp.cxx @@ -235,7 +235,7 @@ void test_coreReflection() OUString("DummyFile"), RTFieldAccess::CONST, aConst); writer.setMethodData(0, OUString("methodA"), - OUString("double"), RT_MODE_TWOWAY, 2, 1, + OUString("double"), RTMethodMode::TWOWAY, 2, 1, OUString("Hallo ich bin die methodA")); writer.setParamData(0, 0, OUString("ModuleA/StructA"), OUString("aStruct"), RT_PARAM_IN); diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index 2018f57..e85eff8 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -700,13 +700,13 @@ static char const * getMethodMode(RTMethodMode methodMode) { switch ( methodMode ) { - case RT_MODE_ONEWAY: + case RTMethodMode::ONEWAY: return "ONEWAY"; - case RT_MODE_ONEWAY_CONST: + case RTMethodMode::ONEWAY_CONST: return "ONEWAY,CONST"; - case RT_MODE_TWOWAY: + case RTMethodMode::TWOWAY: return "NONE"; - case RT_MODE_TWOWAY_CONST: + case RTMethodMode::TWOWAY_CONST: return "CONST"; default: return "INVALID"; diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx index 7d10eb3..1350617 100644 --- a/unoidl/source/legacyprovider.cxx +++ b/unoidl/source/legacyprovider.cxx @@ -258,7 +258,7 @@ rtl::Reference< Entity > readEntity( for (sal_uInt16 k = 0; k != methodCount; ++k) { if (reader.getMethodName(k) == attrName) { switch (reader.getMethodFlags(k)) { - case RT_MODE_ATTRIBUTE_GET: + case RTMethodMode::ATTRIBUTE_GET: { sal_uInt16 m = reader.getMethodExceptionCount(k); @@ -272,7 +272,7 @@ rtl::Reference< Entity > readEntity( } break; } - case RT_MODE_ATTRIBUTE_SET: + case RTMethodMode::ATTRIBUTE_SET: { sal_uInt16 m = reader.getMethodExceptionCount(k); @@ -307,8 +307,8 @@ rtl::Reference< Entity > readEntity( std::vector< InterfaceTypeEntity::Method > meths; for (sal_uInt16 j = 0; j != methodCount; ++j) { RTMethodMode flags = reader.getMethodFlags(j); - if (flags != RT_MODE_ATTRIBUTE_GET - && flags != RT_MODE_ATTRIBUTE_SET) + if (flags != RTMethodMode::ATTRIBUTE_GET + && flags != RTMethodMode::ATTRIBUTE_SET) { std::vector< InterfaceTypeEntity::Method::Parameter > params; @@ -598,7 +598,7 @@ rtl::Reference< Entity > readEntity( std::vector< SingleInterfaceBasedServiceEntity::Constructor > ctors; sal_uInt16 n = reader.getMethodCount(); - if (n == 1 && reader.getMethodFlags(0) == RT_MODE_TWOWAY + if (n == 1 && reader.getMethodFlags(0) == RTMethodMode::TWOWAY && reader.getMethodName(0).isEmpty() && reader.getMethodReturnTypeName(0) == "void" && reader.getMethodParameterCount(0) == 0 @@ -608,11 +608,11 @@ rtl::Reference< Entity > readEntity( SingleInterfaceBasedServiceEntity::Constructor()); } else { for (sal_uInt16 j = 0; j != n; ++j) { - if (reader.getMethodFlags(j) != RT_MODE_TWOWAY) { + if (reader.getMethodFlags(j) != RTMethodMode::TWOWAY) { throw FileFormatException( key.getRegistryName(), ("legacy format: unexpected mode " - + OUString::number(reader.getMethodFlags(j)) + + OUString::number(static_cast<int>(reader.getMethodFlags(j))) + " of constructor " + reader.getMethodName(j) + " in service with key " + sub.getName())); } commit 0833143c271ae444ca83ec16923db9f403f98b86 Author: Noel Grandin <n...@peralex.com> Date: Wed Apr 8 14:45:50 2015 +0200 convert RT_ACCESS fields to scoped enum Change-Id: Ifef0aaae6208f18c1352fef7c471deb60a97820d diff --git a/idlc/source/astconstant.cxx b/idlc/source/astconstant.cxx index b37ff90..ce38dcb 100644 --- a/idlc/source/astconstant.cxx +++ b/idlc/source/astconstant.cxx @@ -114,7 +114,7 @@ bool AstConstant::dumpBlob( rBlob.setFieldData( index, getDocumentation(), OUString(), - RT_ACCESS_CONST | (published ? RT_ACCESS_PUBLISHED : 0), + RTFieldAccess::CONST | (published ? RTFieldAccess::PUBLISHED : RTFieldAccess::NONE), OStringToOUString(name, RTL_TEXTENCODING_UTF8), type, aConst); return true; diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index d7adc08..c869197 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -258,7 +258,7 @@ bool AstService::dump(RegistryKey& rKey) AstInterfaceMember * decl = static_cast<AstInterfaceMember *>(*i); writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_SUPPORTS, - (decl->isOptional() ? RT_ACCESS_OPTIONAL : RT_ACCESS_INVALID), + (decl->isOptional() ? RTFieldAccess::OPTIONAL : RTFieldAccess::INVALID), OStringToOUString( decl->getRealInterface()->getRelativName(), RTL_TEXTENCODING_UTF8)); break; @@ -269,7 +269,7 @@ bool AstService::dump(RegistryKey& rKey) { AstServiceMember * decl = static_cast<AstServiceMember *>(*i); writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_EXPORTS, - (decl->isOptional() ? RT_ACCESS_OPTIONAL : RT_ACCESS_INVALID), + (decl->isOptional() ? RTFieldAccess::OPTIONAL : RTFieldAccess::INVALID), OStringToOUString(decl->getRealService()->getRelativName(), RTL_TEXTENCODING_UTF8)); } @@ -279,7 +279,7 @@ bool AstService::dump(RegistryKey& rKey) { AstObserves * decl = static_cast<AstObserves *>(*i); writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_OBSERVES, - RT_ACCESS_INVALID, + RTFieldAccess::INVALID, OStringToOUString( decl->getRealInterface()->getRelativName(), RTL_TEXTENCODING_UTF8)); break; @@ -289,7 +289,7 @@ bool AstService::dump(RegistryKey& rKey) { AstNeeds * decl = static_cast<AstNeeds *>(*i); writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_NEEDS, - RT_ACCESS_INVALID, + RTFieldAccess::INVALID, OStringToOUString( decl->getRealService()->getRelativName(), RTL_TEXTENCODING_UTF8)); break; @@ -326,46 +326,46 @@ bool AstService::dump(RegistryKey& rKey) bool AstAttribute::dumpBlob( typereg::Writer & rBlob, sal_uInt16 index, sal_uInt16 * methodIndex) { - RTFieldAccess accessMode = RT_ACCESS_INVALID; + RTFieldAccess accessMode = RTFieldAccess::INVALID; if (isReadonly()) { - accessMode |= RT_ACCESS_READONLY; + accessMode |= RTFieldAccess::READONLY; } else { - accessMode |= RT_ACCESS_READWRITE; + accessMode |= RTFieldAccess::READWRITE; } if (isOptional()) { - accessMode |= RT_ACCESS_OPTIONAL; + accessMode |= RTFieldAccess::OPTIONAL; } if (isBound()) { - accessMode |= RT_ACCESS_BOUND; + accessMode |= RTFieldAccess::BOUND; } if (isMayBeVoid()) { - accessMode |= RT_ACCESS_MAYBEVOID; + accessMode |= RTFieldAccess::MAYBEVOID; } if (isConstrained()) { - accessMode |= RT_ACCESS_CONSTRAINED; + accessMode |= RTFieldAccess::CONSTRAINED; } if (isTransient()) { - accessMode |= RT_ACCESS_TRANSIENT; + accessMode |= RTFieldAccess::TRANSIENT; } if (isMayBeAmbiguous()) { - accessMode |= RT_ACCESS_MAYBEAMBIGUOUS; + accessMode |= RTFieldAccess::MAYBEAMBIGUOUS; } if (isMayBeDefault()) { - accessMode |= RT_ACCESS_MAYBEDEFAULT; + accessMode |= RTFieldAccess::MAYBEDEFAULT; } if (isRemoveable()) { - accessMode |= RT_ACCESS_REMOVABLE; + accessMode |= RTFieldAccess::REMOVABLE; } OUString name(OStringToOUString(getLocalName(), RTL_TEXTENCODING_UTF8)); diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx index 579ca0a..5941fa3 100644 --- a/idlc/source/astinterface.cxx +++ b/idlc/source/astinterface.cxx @@ -207,7 +207,7 @@ bool AstInterface::dump(RegistryKey& rKey) if (i->isOptional()) { aBlob.setReferenceData( referenceIndex++, i->getDocumentation(), RT_REF_SUPPORTS, - RT_ACCESS_OPTIONAL, + RTFieldAccess::OPTIONAL, OStringToOUString( i->getInterface()->getRelativName(), RTL_TEXTENCODING_UTF8)); diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index 2b150e1..4983173 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -129,10 +129,10 @@ bool AstStruct::dump(RegistryKey& rKey) if ( pDecl->getNodeType() == NT_member ) { pMember = static_cast<AstMember*>(pDecl); - RTFieldAccess flags = RT_ACCESS_READWRITE; + RTFieldAccess flags = RTFieldAccess::READWRITE; OString typeName; if (pMember->getType()->getNodeType() == NT_type_parameter) { - flags |= RT_ACCESS_PARAMETERIZED_TYPE; + flags |= RTFieldAccess::PARAMETERIZED_TYPE; typeName = pMember->getType()->getLocalName(); } else { typeName = pMember->getType()->getRelativName(); @@ -153,7 +153,7 @@ bool AstStruct::dump(RegistryKey& rKey) i != m_typeParameters.end(); ++i) { aBlob.setReferenceData( - index++, emptyStr, RT_REF_TYPE_PARAMETER, RT_ACCESS_INVALID, + index++, emptyStr, RT_REF_TYPE_PARAMETER, RTFieldAccess::INVALID, OStringToOUString( (*i)->getLocalName(), RTL_TEXTENCODING_UTF8)); } diff --git a/include/registry/reflread.hxx b/include/registry/reflread.hxx index a26df02..fddb072 100644 --- a/include/registry/reflread.hxx +++ b/include/registry/reflread.hxx @@ -297,7 +297,7 @@ public: /** returns the access mode of the reference specified by index. - The only valid value is RT_ACCESS_OPTIONAL in the context of + The only valid value is RTFieldAccess::OPTIONAL in the context of references. @param index indicates the reference. */ diff --git a/include/registry/reflwrit.hxx b/include/registry/reflwrit.hxx index 75bff94..57551df 100644 --- a/include/registry/reflwrit.hxx +++ b/include/registry/reflwrit.hxx @@ -216,7 +216,7 @@ public: const rtl::OUString& name, RTReferenceType refType, const rtl::OUString& doku, - RTFieldAccess access = RT_ACCESS_INVALID); + RTFieldAccess access = RTFieldAccess::INVALID); protected: diff --git a/include/registry/types.h b/include/registry/types.h index e28d7db..dcc1152 100644 --- a/include/registry/types.h +++ b/include/registry/types.h @@ -21,6 +21,7 @@ #define INCLUDED_REGISTRY_TYPES_H #include <sal/types.h> +#include <o3tl/typed_flags_set.hxx> #ifdef __cplusplus extern "C" { @@ -114,77 +115,82 @@ enum RTTypeClass { Fields in a type blob are used for different types. Among others they were used for properties of services and these properties can have several flags. - @see RT_ACCESS_INVALID - @see RT_ACCESS_READONLY - @see RT_ACCESS_OPTIONAL - @see RT_ACCESS_MAYBEVOID - @see RT_ACCESS_BOUND - @see RT_ACCESS_CONSTRAINED - @see RT_ACCESS_TRANSIENT - @see RT_ACCESS_MAYBEAMBIGUOUS - @see RT_ACCESS_MAYBEDEFAULT - @see RT_ACCESS_REMOVABLE - @see RT_ACCESS_ATTRIBUTE - @see RT_ACCESS_PROPERTY - @see RT_ACCESS_CONST - @see RT_ACCESS_READWRITE - @see RT_ACCESS_DEFAULT - @see RT_ACCESS_PARAMETERIZED_TYPE - @see RT_ACCESS_PUBLISHED + @see RTFieldAccess::INVALID + @see RTFieldAccess::READONLY + @see RTFieldAccess::OPTIONAL + @see RTFieldAccess::MAYBEVOID + @see RTFieldAccess::BOUND + @see RTFieldAccess::CONSTRAINED + @see RTFieldAccess::TRANSIENT + @see RTFieldAccess::MAYBEAMBIGUOUS + @see RTFieldAccess::MAYBEDEFAULT + @see RTFieldAccess::REMOVABLE + @see RTFieldAccess::ATTRIBUTE + @see RTFieldAccess::PROPERTY + @see RTFieldAccess::CONST + @see RTFieldAccess::READWRITE + @see RTFieldAccess::DEFAULT + @see RTFieldAccess::PARAMETERIZED_TYPE + @see RTFieldAccess::PUBLISHED */ -typedef sal_uInt16 RTFieldAccess; - -/// specifies a unknown flag -#define RT_ACCESS_INVALID 0x0000 -/// specifies a readonly property/attribute -#define RT_ACCESS_READONLY 0x0001 -/// specifies a property as optional that means that it must not be implemented. -#define RT_ACCESS_OPTIONAL 0x0002 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_MAYBEVOID 0x0004 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_BOUND 0x0008 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_CONSTRAINED 0x0010 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_TRANSIENT 0x0020 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_MAYBEAMBIGUOUS 0x0040 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_MAYBEDEFAULT 0x0080 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_REMOVABLE 0x0100 -/// @see com::sun::star::beans::PropertyAttribute -#define RT_ACCESS_ATTRIBUTE 0x0200 -/// specifies that the field is a property -#define RT_ACCESS_PROPERTY 0x0400 -/// specifies that the field is a constant or enum value -#define RT_ACCESS_CONST 0x0800 -/// specifies that the property/attribute has read/write access -#define RT_ACCESS_READWRITE 0x1000 -/// only to describe a union default label -#define RT_ACCESS_DEFAULT 0x2000 - -/** - Indicates that a member of a polymorphic struct type template is of a - parameterized type. - - Only valid for fields that represent members of polymorphic struct type - templates. - - @since UDK 3.2.0 - */ -#define RT_ACCESS_PARAMETERIZED_TYPE 0x4000 +enum class RTFieldAccess +{ + NONE = 0x0000, + /// specifies a unknown flag + INVALID = 0x0000, + /// specifies a readonly property/attribute + READONLY = 0x0001, + /// specifies a property as optional that means that it must not be implemented. + OPTIONAL = 0x0002, + /// @see com::sun::star::beans::PropertyAttribute + MAYBEVOID = 0x0004, + /// @see com::sun::star::beans::PropertyAttribute + BOUND = 0x0008, + /// @see com::sun::star::beans::PropertyAttribute + CONSTRAINED = 0x0010, + /// @see com::sun::star::beans::PropertyAttribute + TRANSIENT = 0x0020, + /// @see com::sun::star::beans::PropertyAttribute + MAYBEAMBIGUOUS = 0x0040, + /// @see com::sun::star::beans::PropertyAttribute + MAYBEDEFAULT = 0x0080, + /// @see com::sun::star::beans::PropertyAttribute + REMOVABLE = 0x0100, + /// @see com::sun::star::beans::PropertyAttribute + ATTRIBUTE = 0x0200, + /// specifies that the field is a property + PROPERTY = 0x0400, + /// specifies that the field is a constant or enum value + CONST = 0x0800, + /// specifies that the property/attribute has read/write access + READWRITE = 0x1000, + /// only to describe a union default label + DEFAULT = 0x2000, + /** + Indicates that a member of a polymorphic struct type template is of a + parameterized type. -/** - Flag for published individual constants. + Only valid for fields that represent members of polymorphic struct type + templates. - Used in combination with RT_ACCESS_CONST for individual constants (which are - not members of constant groups). + @since UDK 3.2.0 + */ + PARAMETERIZED_TYPE = 0x4000, + /** + Flag for published individual constants. - @since UDK 3.2.0 - */ -#define RT_ACCESS_PUBLISHED 0x8000 + Used in combination with RTFieldAccess::CONST for individual constants (which are + not members of constant groups). + + @since UDK 3.2.0 + */ + PUBLISHED = 0x8000, + +}; +namespace o3tl +{ + template<> struct typed_flags<RTFieldAccess> : is_typed_flags<RTFieldAccess, 0xffff> {}; +} /** specifies the type of a field value. diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index 15a9d0f..5b1c58c 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -681,7 +681,7 @@ const sal_Char* FieldList::getFieldType(sal_uInt16 index) RTFieldAccess FieldList::getFieldAccess(sal_uInt16 index) { - RTFieldAccess aAccess = RT_ACCESS_INVALID; + RTFieldAccess aAccess = RTFieldAccess::INVALID; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -878,7 +878,7 @@ const sal_Char* ReferenceList::getReferenceDoku(sal_uInt16 index) RTFieldAccess ReferenceList::getReferenceAccess(sal_uInt16 index) { - RTFieldAccess aAccess = RT_ACCESS_INVALID; + RTFieldAccess aAccess = RTFieldAccess::INVALID; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1519,7 +1519,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getFieldFlags(void * hEntry, sal_u { TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); - if (pEntry == NULL) return RT_ACCESS_INVALID; + if (pEntry == NULL) return RTFieldAccess::INVALID; return pEntry->m_pFields->getFieldAccess(index); } @@ -1815,7 +1815,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getReferenceFlags(void * hEntry, s { TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); - if (pEntry == NULL) return RT_ACCESS_INVALID; + if (pEntry == NULL) return RTFieldAccess::INVALID; return pEntry->m_pReferences->getReferenceAccess(index); } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 49beeb0..426911b 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -351,7 +351,7 @@ public: }; FieldEntry::FieldEntry() - : m_access(RT_ACCESS_INVALID) + : m_access(RTFieldAccess::INVALID) , m_constValueType(RT_TYPE_NONE) { } @@ -481,7 +481,7 @@ public: ReferenceEntry::ReferenceEntry() : m_type(RT_REF_INVALID) - , m_access(RT_ACCESS_INVALID) + , m_access(RTFieldAccess::INVALID) { } @@ -856,7 +856,7 @@ void TypeWriter::createBlop() cpIndexDoku2 = 0; cpIndexFileName2 = 0; - pBuffer += writeUINT16(pBuffer, m_fields[i].m_access); + pBuffer += writeUINT16(pBuffer, static_cast<sal_uInt16>(m_fields[i].m_access)); if (!m_fields[i].m_name.isEmpty()) { @@ -1060,7 +1060,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexDoku2); - pBuffer += writeUINT16(pBuffer, m_references[i].m_access); + pBuffer += writeUINT16(pBuffer, static_cast<sal_uInt16>(m_references[i].m_access)); } } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index a1ed1ff..09afcc0 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -73,7 +73,7 @@ void printString(OUString const & s) { void printFieldOrReferenceFlag( RTFieldAccess * flags, RTFieldAccess flag, char const * name, bool * first) { - if ((*flags & flag) != 0) { + if ((*flags & flag) != RTFieldAccess::NONE) { if (!*first) { printf("|"); } @@ -84,39 +84,39 @@ void printFieldOrReferenceFlag( } void printFieldOrReferenceFlags(RTFieldAccess flags) { - if (flags == 0) { + if (flags == RTFieldAccess::NONE) { printf("none"); } else { bool first = true; printFieldOrReferenceFlag( - &flags, RT_ACCESS_READONLY, "readonly", &first); + &flags, RTFieldAccess::READONLY, "readonly", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_OPTIONAL, "optional", &first); + &flags, RTFieldAccess::OPTIONAL, "optional", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_MAYBEVOID, "maybevoid", &first); - printFieldOrReferenceFlag(&flags, RT_ACCESS_BOUND, "bound", &first); + &flags, RTFieldAccess::MAYBEVOID, "maybevoid", &first); + printFieldOrReferenceFlag(&flags, RTFieldAccess::BOUND, "bound", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_CONSTRAINED, "constrained", &first); + &flags, RTFieldAccess::CONSTRAINED, "constrained", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_TRANSIENT, "transient", &first); + &flags, RTFieldAccess::TRANSIENT, "transient", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_MAYBEAMBIGUOUS, "maybeambiguous", &first); + &flags, RTFieldAccess::MAYBEAMBIGUOUS, "maybeambiguous", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_MAYBEDEFAULT, "maybedefault", &first); + &flags, RTFieldAccess::MAYBEDEFAULT, "maybedefault", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_REMOVABLE, "removable", &first); + &flags, RTFieldAccess::REMOVABLE, "removable", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_ATTRIBUTE, "attribute", &first); + &flags, RTFieldAccess::ATTRIBUTE, "attribute", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_PROPERTY, "property", &first); - printFieldOrReferenceFlag(&flags, RT_ACCESS_CONST, "const", &first); + &flags, RTFieldAccess::PROPERTY, "property", &first); + printFieldOrReferenceFlag(&flags, RTFieldAccess::CONST, "const", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_READWRITE, "readwrite", &first); + &flags, RTFieldAccess::READWRITE, "readwrite", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_PARAMETERIZED_TYPE, "parameterized type", &first); + &flags, RTFieldAccess::PARAMETERIZED_TYPE, "parameterized type", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_PUBLISHED, "published", &first); - if (flags != 0) { + &flags, RTFieldAccess::PUBLISHED, "published", &first); + if (flags != RTFieldAccess::NONE) { if (!first) { printf("|"); } diff --git a/registry/test/testregcpp.cxx b/registry/test/testregcpp.cxx index 514accf..e7853c3 100644 --- a/registry/test/testregcpp.cxx +++ b/registry/test/testregcpp.cxx @@ -65,60 +65,60 @@ void test_coreReflection() writer.setFieldData(0, OUString("aConstBool"), OUString("boolean"), OUString("ich bin ein boolean"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_BYTE; aConst.m_value.aByte = 127; writer.setFieldData(1, OUString("aConstByte"), OUString("byte"), OUString("ich bin ein byte"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT16; aConst.m_value.aShort = -10; writer.setFieldData(2, OUString("aConstShort"), OUString("short"), OUString("ich bin ein short"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_UINT16; aConst.m_value.aUShort = 10; writer.setFieldData(3, OUString("aConstUShort"), OUString("unsigned short"), OUString("ich bin ein unsigned short"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT32; aConst.m_value.aLong = -100000; writer.setFieldData(4, OUString("aConstLong"), OUString("long"), OUString("ich bin ein long"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_UINT32; aConst.m_value.aULong = 100000; writer.setFieldData(5, OUString("aConstULong"), OUString("unsigned long"), OUString("ich bin ein unsigned long"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT64; aConst.m_value.aHyper = -100000000; writer.setFieldData(6, OUString("aConstHyper"), OUString("hyper"), OUString("ich bin ein hyper"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_UINT64; aConst.m_value.aUHyper = 100000000; writer.setFieldData(7, OUString("aConstULong"), OUString("unsigned long"), OUString("ich bin ein unsigned long"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_FLOAT; aConst.m_value.aFloat = -2e-10f; writer.setFieldData(8, OUString("aConstFloat"), OUString("float"), OUString("ich bin ein float"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_DOUBLE; aConst.m_value.aDouble = -2e-100; writer.setFieldData(9, OUString("aConstDouble"), OUString("double"), OUString("ich bin ein double"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_STRING; OUString tmpStr("dies ist ein unicode string"); aConst.m_value.aString = tmpStr.getStr(); @@ -126,7 +126,7 @@ void test_coreReflection() writer.setFieldData(10, OUString("aConstString"), OUString("string"), OUString("ich bin ein string"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -167,13 +167,13 @@ void test_coreReflection() writer.setFieldData(0, OUString("asal_uInt32"), OUString("unsigned long"), - OUString(), OUString(), RT_ACCESS_READWRITE); + OUString(), OUString(), RTFieldAccess::READWRITE); writer.setFieldData(1, OUString("aXInterface"), OUString("stardiv/uno/XInterface"), - OUString(), OUString(), RT_ACCESS_READWRITE); + OUString(), OUString(), RTFieldAccess::READWRITE); writer.setFieldData(2, OUString("aSequence"), OUString("[]ModuleA/EnumA"), - OUString(), OUString(), RT_ACCESS_READWRITE); + OUString(), OUString(), RTFieldAccess::READWRITE); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -196,11 +196,11 @@ void test_coreReflection() writer.setFieldData(0, OUString("ENUM_VAL_1"), OUString(), OUString("ich bin ein enum value"), - OUString(), RT_ACCESS_CONST, aConst); + OUString(), RTFieldAccess::CONST, aConst); aConst.m_value.aULong = 10; writer.setFieldData(1, OUString("ENUM_VAL_2"), - OUString(), OUString(), OUString(), RT_ACCESS_CONST, aConst); + OUString(), OUString(), OUString(), RTFieldAccess::CONST, aConst); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -222,17 +222,17 @@ void test_coreReflection() writer.setFileName(OUString("DummyFile")); writer.setFieldData(0, OUString("aString"), - OUString("string"), OUString(), OUString(), RT_ACCESS_READWRITE); + OUString("string"), OUString(), OUString(), RTFieldAccess::READWRITE); writer.setFieldData(1, OUString("aStruct"), OUString("ModuleA/StructA"), - OUString(), OUString(), RT_ACCESS_READONLY); + OUString(), OUString(), RTFieldAccess::READONLY); writer.setFieldData(2, OUString("aEnum"), - OUString("ModuleA/EnumA"), OUString(), OUString(), RT_ACCESS_BOUND); + OUString("ModuleA/EnumA"), OUString(), OUString(), RTFieldAccess::BOUND); aConst.m_type = RT_TYPE_UINT16; aConst.m_value.aUShort = 12; writer.setFieldData(3, OUString("aConstUShort"), OUString("unsigned short"), OUString(), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); writer.setMethodData(0, OUString("methodA"), OUString("double"), RT_MODE_TWOWAY, 2, 1, @@ -278,7 +278,7 @@ void test_coreReflection() writer.setFieldData(0, OUString("aSource"), OUString("stardiv/uno/XInterface"), OUString("ich bin ein interface member"), - OUString(), RT_ACCESS_READWRITE); + OUString(), RTFieldAccess::READWRITE); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -297,11 +297,11 @@ void test_coreReflection() writer.setFieldData(0, OUString("aProperty"), OUString("stardiv/uno/XInterface"), OUString("ich bin eine property"), - OUString(), RT_ACCESS_READWRITE); + OUString(), RTFieldAccess::READWRITE); writer.setReferenceData(0, OUString("ModuleA/XInterfaceA"), RT_REF_SUPPORTS, OUString("Hallo ich eine Reference auf ein supported interface"), - RT_ACCESS_OPTIONAL); + RTFieldAccess::OPTIONAL); writer.setReferenceData(1, OUString("ModuleA/XInterfaceA"), RT_REF_OBSERVES, OUString("Hallo ich eine Reference auf ein observed interface")); writer.setReferenceData(2, OUString("ModuleA/ServiceB"), RT_REF_EXPORTS, @@ -345,19 +345,19 @@ void test_coreReflection() writer.setFieldData(0, OUString("ConstantsA_aConstBool"), OUString("boolean"), OUString("ich bin ein boolean"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_BYTE; aConst.m_value.aByte = 127; writer.setFieldData(1, OUString("ConstantsA_aConstByte"), OUString("byte"), OUString("ich bin ein byte"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT16; aConst.m_value.aShort = -10; writer.setFieldData(2, OUString("ConstantsA_aConstShort"), OUString("short"), OUString("ich bin ein short"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index def055a..2018f57 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -305,59 +305,59 @@ static char const * getTypeClass(RTTypeClass typeClass) static OString getFieldAccess(RTFieldAccess fieldAccess) { OString ret; - if ( (fieldAccess & RT_ACCESS_INVALID) == RT_ACCESS_INVALID ) + if ( (fieldAccess & RTFieldAccess::INVALID) == RTFieldAccess::INVALID ) { ret += OString("INVALID"); } - if ( (fieldAccess & RT_ACCESS_READONLY) == RT_ACCESS_READONLY ) + if ( (fieldAccess & RTFieldAccess::READONLY) == RTFieldAccess::READONLY ) { ret += OString(ret.isEmpty() ? "READONLY" : ",READONLY"); } - if ( (fieldAccess & RT_ACCESS_OPTIONAL) == RT_ACCESS_OPTIONAL ) + if ( (fieldAccess & RTFieldAccess::OPTIONAL) == RTFieldAccess::OPTIONAL ) { ret += OString(ret.isEmpty() ? "OPTIONAL" : ",OPTIONAL"); } - if ( (fieldAccess & RT_ACCESS_MAYBEVOID) == RT_ACCESS_MAYBEVOID ) + if ( (fieldAccess & RTFieldAccess::MAYBEVOID) == RTFieldAccess::MAYBEVOID ) { ret += OString(ret.isEmpty() ? "MAYBEVOID" : ",MAYBEVOID"); } - if ( (fieldAccess & RT_ACCESS_BOUND) == RT_ACCESS_BOUND ) + if ( (fieldAccess & RTFieldAccess::BOUND) == RTFieldAccess::BOUND ) { ret += OString(ret.isEmpty() ? "BOUND" : ",BOUND"); } - if ( (fieldAccess & RT_ACCESS_CONSTRAINED) == RT_ACCESS_CONSTRAINED ) + if ( (fieldAccess & RTFieldAccess::CONSTRAINED) == RTFieldAccess::CONSTRAINED ) { ret += OString(ret.isEmpty() ? "CONSTRAINED" : ",CONSTRAINED"); } - if ( (fieldAccess & RT_ACCESS_TRANSIENT) == RT_ACCESS_TRANSIENT ) + if ( (fieldAccess & RTFieldAccess::TRANSIENT) == RTFieldAccess::TRANSIENT ) { ret += OString(ret.isEmpty() ? "TRANSIENT" : ",TRANSIENT"); } - if ( (fieldAccess & RT_ACCESS_MAYBEAMBIGUOUS) == RT_ACCESS_MAYBEAMBIGUOUS ) + if ( (fieldAccess & RTFieldAccess::MAYBEAMBIGUOUS) == RTFieldAccess::MAYBEAMBIGUOUS ) { ret += OString(ret.isEmpty() ? "MAYBEAMBIGUOUS" : ",MAYBEAMBIGUOUS"); } - if ( (fieldAccess & RT_ACCESS_MAYBEDEFAULT) == RT_ACCESS_MAYBEDEFAULT ) + if ( (fieldAccess & RTFieldAccess::MAYBEDEFAULT) == RTFieldAccess::MAYBEDEFAULT ) { ret += OString(ret.isEmpty() ? "MAYBEDEFAULT" : ",MAYBEDEFAULT"); } - if ( (fieldAccess & RT_ACCESS_REMOVABLE) == RT_ACCESS_REMOVABLE ) + if ( (fieldAccess & RTFieldAccess::REMOVABLE) == RTFieldAccess::REMOVABLE ) { ret += OString(ret.isEmpty() ? "REMOVABLE" : ",REMOVABLE"); } - if ( (fieldAccess & RT_ACCESS_ATTRIBUTE) == RT_ACCESS_ATTRIBUTE ) + if ( (fieldAccess & RTFieldAccess::ATTRIBUTE) == RTFieldAccess::ATTRIBUTE ) { ret += OString(ret.isEmpty() ? "ATTRIBUTE" : ",ATTRIBUTE"); } - if ( (fieldAccess & RT_ACCESS_PROPERTY) == RT_ACCESS_PROPERTY ) + if ( (fieldAccess & RTFieldAccess::PROPERTY) == RTFieldAccess::PROPERTY ) { ret += OString(ret.isEmpty() ? "PROPERTY" : ",PROPERTY"); } - if ( (fieldAccess & RT_ACCESS_CONST) == RT_ACCESS_CONST ) + if ( (fieldAccess & RTFieldAccess::CONST) == RTFieldAccess::CONST ) { ret += OString(ret.isEmpty() ? "CONST" : ",CONST"); } - if ( (fieldAccess & RT_ACCESS_READWRITE) == RT_ACCESS_READWRITE ) + if ( (fieldAccess & RTFieldAccess::READWRITE) == RTFieldAccess::READWRITE ) { ret += OString(ret.isEmpty() ? "READWRITE" : ",READWRITE"); } @@ -1015,7 +1015,7 @@ static sal_uInt32 checkFieldsWithoutOrder(Options_Impl const & options, { if ( moreProps.find(j) == moreProps.end() ) { - if ( (reader2.getFieldFlags(j) & RT_ACCESS_OPTIONAL) != RT_ACCESS_OPTIONAL ) + if ( (reader2.getFieldFlags(j) & RTFieldAccess::OPTIONAL) != RTFieldAccess::OPTIONAL ) { if ( options.forceOutput() ) { @@ -1251,7 +1251,7 @@ static sal_uInt32 checkBlob( { if ( moreReferences.find(j) == moreReferences.end() ) { - if ( (reader2.getReferenceFlags(j) & RT_ACCESS_OPTIONAL) != RT_ACCESS_OPTIONAL ) + if ( (reader2.getReferenceFlags(j) & RTFieldAccess::OPTIONAL) != RTFieldAccess::OPTIONAL ) { if ( options.forceOutput() ) { diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx index db04206..7d10eb3 100644 --- a/unoidl/source/legacyprovider.cxx +++ b/unoidl/source/legacyprovider.cxx @@ -300,8 +300,8 @@ rtl::Reference< Entity > readEntity( attrs.push_back( InterfaceTypeEntity::Attribute( attrName, reader.getFieldTypeName(j).replace('/', '.'), - (flags & RT_ACCESS_BOUND) != 0, - (flags & RT_ACCESS_READONLY) != 0, getExcs, setExcs, + bool(flags & RTFieldAccess::BOUND), + bool(flags & RTFieldAccess::READONLY), getExcs, setExcs, translateAnnotations(reader.getFieldDocumentation(j)))); } std::vector< InterfaceTypeEntity::Method > meths; @@ -422,9 +422,8 @@ rtl::Reference< Entity > readEntity( PolymorphicStructTypeTemplateEntity::Member( reader.getFieldName(j), reader.getFieldTypeName(j).replace('/', '.'), - ((reader.getFieldFlags(j) - & RT_ACCESS_PARAMETERIZED_TYPE) - != 0), + bool(reader.getFieldFlags(j) + & RTFieldAccess::PARAMETERIZED_TYPE), translateAnnotations( reader.getFieldDocumentation(j)))); } @@ -514,8 +513,7 @@ rtl::Reference< Entity > readEntity( reader.getReferenceDocumentation(j))); switch (reader.getReferenceSort(j)) { case RT_REF_EXPORTS: - if ((reader.getReferenceFlags(j) & RT_ACCESS_OPTIONAL) - == 0) + if (!(reader.getReferenceFlags(j) & RTFieldAccess::OPTIONAL)) { mandServs.push_back(base); } else { @@ -523,8 +521,7 @@ rtl::Reference< Entity > readEntity( } break; case RT_REF_SUPPORTS: - if ((reader.getReferenceFlags(j) & RT_ACCESS_OPTIONAL) - == 0) + if (!(reader.getReferenceFlags(j) & RTFieldAccess::OPTIONAL)) { mandIfcs.push_back(base); } else { @@ -545,39 +542,39 @@ rtl::Reference< Entity > readEntity( for (sal_uInt16 j = 0; j != n; ++j) { RTFieldAccess acc = reader.getFieldFlags(j); int attrs = 0; - if ((acc & RT_ACCESS_READONLY) != 0) { + if (acc & RTFieldAccess::READONLY) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_READ_ONLY; } - if ((acc & RT_ACCESS_OPTIONAL) != 0) { + if (acc & RTFieldAccess::OPTIONAL) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_OPTIONAL; } - if ((acc & RT_ACCESS_MAYBEVOID) != 0) { + if (acc & RTFieldAccess::MAYBEVOID) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_MAYBE_VOID; } - if ((acc & RT_ACCESS_BOUND) != 0) { + if (acc & RTFieldAccess::BOUND) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_BOUND; } - if ((acc & RT_ACCESS_CONSTRAINED) != 0) { + if (acc & RTFieldAccess::CONSTRAINED) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_CONSTRAINED; } - if ((acc & RT_ACCESS_TRANSIENT) != 0) { + if (acc & RTFieldAccess::TRANSIENT) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_TRANSIENT; } - if ((acc & RT_ACCESS_MAYBEAMBIGUOUS) != 0) { + if (acc & RTFieldAccess::MAYBEAMBIGUOUS) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_MAYBE_AMBIGUOUS; } - if ((acc & RT_ACCESS_MAYBEDEFAULT) != 0) { + if (acc & RTFieldAccess::MAYBEDEFAULT) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_MAYBE_DEFAULT; } - if ((acc & RT_ACCESS_REMOVABLE) != 0) { + if (acc & RTFieldAccess::REMOVABLE) { attrs |= AccumulationBasedServiceEntity::Property:: ATTRIBUTE_REMOVABLE; } commit 7b4ca582fcfd77b20eea5a11bd0e87b39d640e91 Author: Noel Grandin <n...@peralex.com> Date: Wed Apr 8 14:04:08 2015 +0200 convert RegError to scoped enum Change-Id: I55977c38578cb59deb195d91f8948da2e0905b6a diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index e31b62f..2140a2f 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -1452,10 +1452,10 @@ void cppuhelper::ServiceManager::readRdbFile( bool cppuhelper::ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) { Registry reg; switch (reg.open(uri, RegAccessMode::READONLY)) { - case REG_NO_ERROR: + case RegError::NO_ERROR: break; - case REG_REGISTRY_NOT_EXISTS: - case REG_INVALID_REGISTRY: + case RegError::REGISTRY_NOT_EXISTS: + case RegError::INVALID_REGISTRY: { // Ignore empty rdb files (which are at least seen by subordinate // uno processes during extension registration; Registry::open can @@ -1475,16 +1475,16 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) { return false; } RegistryKey rootKey; - if (reg.openRootKey(rootKey) != REG_NO_ERROR) { + if (reg.openRootKey(rootKey) != RegError::NO_ERROR) { throw css::uno::DeploymentException( "Failure reading legacy rdb file " + uri, static_cast< cppu::OWeakObject * >(this)); } RegistryKeyArray impls; switch (rootKey.openSubKeys("IMPLEMENTATIONS", impls)) { - case REG_NO_ERROR: + case RegError::NO_ERROR: break; - case REG_KEY_NOT_EXISTS: + case RegError::KEY_NOT_EXISTS: return true; default: throw css::uno::DeploymentException( @@ -1534,8 +1534,8 @@ rtl::OUString cppuhelper::ServiceManager::readLegacyRdbString( RegistryKey subkey; RegValueType t; sal_uInt32 s(0); - if (key.openKey(path, subkey) != REG_NO_ERROR - || subkey.getValueInfo(rtl::OUString(), &t, &s) != REG_NO_ERROR + if (key.openKey(path, subkey) != RegError::NO_ERROR + || subkey.getValueInfo(rtl::OUString(), &t, &s) != RegError::NO_ERROR || t != RegValueType::STRING || s == 0 || s > static_cast< sal_uInt32 >(SAL_MAX_INT32)) { @@ -1545,7 +1545,7 @@ rtl::OUString cppuhelper::ServiceManager::readLegacyRdbString( } rtl::OUString val; std::vector< char > v(s); // assuming sal_uInt32 fits into vector::size_type - if (subkey.getValue(rtl::OUString(), &v[0]) != REG_NO_ERROR + if (subkey.getValue(rtl::OUString(), &v[0]) != RegError::NO_ERROR || v.back() != '\0' || !rtl_convertStringToUString( &val.pData, &v[0], static_cast< sal_Int32 >(s - 1), @@ -1568,9 +1568,9 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings( assert(strings != 0); RegistryKey subkey; switch (key.openKey(path, subkey)) { - case REG_NO_ERROR: + case RegError::NO_ERROR: break; - case REG_KEY_NOT_EXISTS: + case RegError::KEY_NOT_EXISTS: return; default: throw css::uno::DeploymentException( @@ -1579,7 +1579,7 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings( } rtl::OUString prefix(subkey.getName() + "/"); RegistryKeyNames names; - if (subkey.getKeyNames(rtl::OUString(), names) != REG_NO_ERROR) { + if (subkey.getKeyNames(rtl::OUString(), names) != RegError::NO_ERROR) { throw css::uno::DeploymentException( "Failure reading legacy rdb file " + uri, static_cast< cppu::OWeakObject * >(this)); diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index 7195ecc..d7adc08 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -43,7 +43,7 @@ bool AstModule::dump(RegistryKey& rKey) localKey = rKey; }else { - if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -87,7 +87,7 @@ bool AstModule::dump(RegistryKey& rKey) void const * pBlob = aBlob.getBlob(&aBlobSize); if (localKey.setValue(emptyStr, RegValueType::BINARY, - const_cast<RegValue>(pBlob), aBlobSize)) + const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), @@ -112,7 +112,7 @@ bool AstModule::dump(RegistryKey& rKey) if ( getNodeType() != NT_root ) { if (localKey.setValue(emptyStr, RegValueType::BINARY, - const_cast<RegValue>(pBlob), aBlobSize)) + const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), @@ -132,7 +132,7 @@ bool AstTypeDef::dump(RegistryKey& rKey) { OUString emptyStr; RegistryKey localKey; - if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -152,7 +152,7 @@ bool AstTypeDef::dump(RegistryKey& rKey) sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); - if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize)) + if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), @@ -219,7 +219,7 @@ bool AstService::dump(RegistryKey& rKey) RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8), - localKey)) { + localKey) != RegError::NO_ERROR) { fprintf( stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -310,7 +310,7 @@ bool AstService::dump(RegistryKey& rKey) void const * blob = writer.getBlob(&size); if (localKey.setValue( emptyStr, RegValueType::BINARY, const_cast< void * >(blob), - size)) + size) != RegError::NO_ERROR) { fprintf( stderr, "%s: warning, could not set value of key \"%s\" in %s\n", diff --git a/idlc/source/astenum.cxx b/idlc/source/astenum.cxx index e685569..14318b7 100644 --- a/idlc/source/astenum.cxx +++ b/idlc/source/astenum.cxx @@ -58,7 +58,7 @@ AstConstant* AstEnum::checkValue(AstExpression* pExpr) bool AstEnum::dump(RegistryKey& rKey) { RegistryKey localKey; - if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -92,7 +92,7 @@ bool AstEnum::dump(RegistryKey& rKey) void const * pBlob = aBlob.getBlob(&aBlobSize); if (localKey.setValue(emptyStr, RegValueType::BINARY, - const_cast<RegValue>(pBlob), aBlobSize)) + const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx index a3b911a..579ca0a 100644 --- a/idlc/source/astinterface.cxx +++ b/idlc/source/astinterface.cxx @@ -105,7 +105,7 @@ bool AstInterface::dump(RegistryKey& rKey) return true; RegistryKey localKey; - if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -244,7 +244,7 @@ bool AstInterface::dump(RegistryKey& rKey) sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); - if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize)) + if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index 3c8ab45..2b150e1 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -78,7 +78,7 @@ bool AstStruct::isType() const { bool AstStruct::dump(RegistryKey& rKey) { RegistryKey localKey; - if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) + if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), @@ -162,7 +162,7 @@ bool AstStruct::dump(RegistryKey& rKey) void const * pBlob = aBlob.getBlob(&aBlobSize); if (localKey.setValue(emptyStr, RegValueType::BINARY, - const_cast<RegValue>(pBlob), aBlobSize)) + const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index 4d3645c..f40cb06 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -154,7 +154,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile) OString urlRegTmpName = convertToFileUrl(regTmpName); Registry regFile; - if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != REG_NO_ERROR ) + if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != RegError::NO_ERROR ) { fprintf(stderr, "%s: could not create registry file '%s'\n", pOptions->getProgramName().getStr(), regTmpName.getStr()); @@ -165,7 +165,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile) } RegistryKey rootKey; - if ( regFile.openRootKey(rootKey) != REG_NO_ERROR ) + if ( regFile.openRootKey(rootKey) != RegError::NO_ERROR ) { fprintf(stderr, "%s: could not open root of registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); @@ -179,7 +179,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile) if ( !idlc()->getRoot()->dump(rootKey) ) { rootKey.releaseKey(); - if (regFile.close() != REG_NO_ERROR) + if (regFile.close() != RegError::NO_ERROR) { fprintf(stderr, "%s: could not close registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); @@ -191,7 +191,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile) } rootKey.releaseKey(); - if ( regFile.close() != REG_NO_ERROR ) + if ( regFile.close() != RegError::NO_ERROR ) { fprintf(stderr, "%s: could not close registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx index 2b3ad32..948509b 100644 --- a/include/registry/registry.hxx +++ b/include/registry/registry.hxx @@ -117,7 +117,7 @@ public: /** opens the root key of the registry. @param rRootKey reference to a RegistryKey which is filled with the rootkey. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError openRootKey(RegistryKey& rRootKey); @@ -127,7 +127,7 @@ public: /** creates a new registry with the specified name and creates a root key. @param registryName specifies the name of the new registry. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError create(const rtl::OUString& registryName); @@ -136,7 +136,7 @@ public: If the registry already points to a valid registry, the old registry will be closed. @param registryName specifies a registry name. @param accessMode specifies the access mode for the registry, RegAccessMode::READONLY or RegAccessMode::READWRITE. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError open(const rtl::OUString& registryName, RegAccessMode accessMode); @@ -148,7 +148,7 @@ public: @param registryName specifies a registry name, if the name is an empty string the registry itselfs will be destroyed. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError destroy(const rtl::OUString& registryName); @@ -161,7 +161,7 @@ public: is an empty string the registry information will be saved under the key specified by rKey. @param regFileName specifies the file containing the registry information. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError loadKey(RegistryKey& rKey, const rtl::OUString& keyName, @@ -176,7 +176,7 @@ public: If keyName is an empty string the registry information under the key specified by rKey is saved in the specified file. @param regFileName specifies the file containing the registry information. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError saveKey(RegistryKey& rKey, const rtl::OUString& keyName, @@ -194,7 +194,7 @@ public: @param regFileName specifies the file containing the registry information. @param bWarnings if TRUE the function returns an error if a key already exists. @param bReport if TRUE the function reports warnings on stdout if a key already exists. - @return REG_NO_ERROR if succeeds else an error code. If it returns an error the registry will + @return RegError::NO_ERROR if succeeds else an error code. If it returns an error the registry will restore the state before merging. */ inline RegError mergeKey(RegistryKey& rKey, @@ -208,7 +208,7 @@ public: All information which are available (keynames, value types, values, ...) will be printed to stdout for report issues only. @param rKey references a currently open key which content will be reported. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError dumpRegistry(RegistryKey& rKey); @@ -420,7 +420,7 @@ public: The specified keyname is relativ to this key. @param keyName specifies the name of the key which will be opened or created. @param rNewKey references a RegistryKey which will be filled with the new or open key. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError createKey(const rtl::OUString& keyName, RegistryKey& rNewKey); @@ -430,7 +430,7 @@ public: The specified keyname is relativ to this key. @param keyName specifies the name of the key which will be opened. @param rOpenKey references a RegistryKey which will be filled with the open key. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError openKey(const rtl::OUString& keyName, RegistryKey& rOpenKey); @@ -440,7 +440,7 @@ public: The specified keyname is relativ to this key. @param keyName specifies the name of the key which subkeys will be opened. @param rSubKeys reference a RegistryKeyArray which will be filled with the open subkeys. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError openSubKeys(const rtl::OUString& keyName, RegistryKeyArray& rSubKeys); @@ -450,7 +450,7 @@ public: The specified keyname is relativ to this key. @param keyName specifies the name of the key which subkey names will be returned. @param rSubKeyNames reference a RegistryKeyNames array which will be filled with the subkey names. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError getKeyNames(const rtl::OUString& keyName, RegistryKeyNames& rSubKeyNames); @@ -458,14 +458,14 @@ public: /** closes all keys specified in the array. @param rSubKeys reference a RegistryKeyArray which contains the open keys. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError closeSubKeys(RegistryKeyArray& rSubKeys); /** deletes the specified key. @param keyName specifies the name of the key which will be deleted. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError deleteKey(const rtl::OUString& keyName); @@ -483,7 +483,7 @@ public: @param valueType specifies the type of the value. @param pValue points to a memory block containing the data for the value. @param valueSize specifies the size of pData in bytes - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError setValue(const rtl::OUString& keyName, RegValueType valueType, @@ -497,7 +497,7 @@ public: specified by hKey. @param pValueList points to an array of longs containing the data for the value. @param len specifies the length of the list (the array referenced by pValueList). - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError setLongListValue(const rtl::OUString& keyName, sal_Int32* pValueList, @@ -510,7 +510,7 @@ public: specified by hKey. @param pValueList points to an array of sal_Char* containing the data for the value. @param len specifies the length of the list (the array referenced by pValueList). - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError setStringListValue(const rtl::OUString& keyName, sal_Char** pValueList, @@ -523,7 +523,7 @@ public: specified by hKey. @param pValueList points to an array of sal_Unicode* containing the data for the value. @param len specifies the length of the list (the array referenced by pValueList). - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError setUnicodeListValue(const rtl::OUString& keyName, sal_Unicode** pValueList, @@ -536,7 +536,7 @@ public: specified by hKey will be returned. @param pValueType returns the type of the value. @param pValueSize returns the size of the value in bytes or the length of a list value. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError getValueInfo(const rtl::OUString& keyName, RegValueType* pValueType, @@ -548,7 +548,7 @@ public: If keyName is an empty string, the value is get from the key specified by hKey. @param pValue points to an allocated memory block receiving the data of the value. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError getValue(const rtl::OUString& keyName, RegValue pValue); @@ -559,7 +559,7 @@ public: If keyName is an empty string, the value is get from the key specified by hKey. @param rValueList references a RegistryValueList which will be filled with the long values. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. */ inline RegError getLongListValue(const rtl::OUString& keyName, RegistryValueList<sal_Int32>& rValueList); @@ -570,7 +570,7 @@ public: If keyName is an empty string, the value is get from the key specified by hKey. @param rValueList references a RegistryValueList which will be filled with the ascii values. - @return REG_NO_ERROR if succeeds else an error code. + @return RegError::NO_ERROR if succeeds else an error code. ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits