tdf#145614: Convert #define to enum class

Change-Id: Ic1147219d09c064817e273309f106d9c091caee4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202945
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
David Rosenfeld
2026-04-04 17:38:37 +02:00
committed by Ilmari Lauhakangas
parent 9b06135233
commit 4fec122182
2 changed files with 31 additions and 19 deletions
+22 -12
View File
@@ -949,18 +949,28 @@ void LockedEmbedDocument_Impl::ExecuteMethod( sal_Int16 nId )
{
if ( m_pEmbedDocument )
{
if ( nId == OLESERV_SAVEOBJECT )
m_pEmbedDocument->SaveObject();
else if ( nId == OLESERV_CLOSE )
m_pEmbedDocument->Close( 0 );
else if ( nId == OLESERV_NOTIFY )
m_pEmbedDocument->notify();
else if ( nId == OLESERV_NOTIFYCLOSING )
m_pEmbedDocument->OLENotifyClosing();
else if ( nId == OLESERV_SHOWOBJECT )
m_pEmbedDocument->ShowObject();
else if ( nId == OLESERV_DEACTIVATE )
m_pEmbedDocument->Deactivate();
switch( static_cast<OLEServ>(nId) )
{
case OLEServ::SaveObject:
m_pEmbedDocument->SaveObject();
break;
case OLEServ::Close:
m_pEmbedDocument->Close( 0 );
break;
case OLEServ::Notify:
m_pEmbedDocument->notify();
break;
case OLEServ::NotifyClosing:
m_pEmbedDocument->OLENotifyClosing();
break;
case OLEServ::ShowObject:
m_pEmbedDocument->ShowObject();
break;
case OLEServ::Deactivate:
m_pEmbedDocument->Deactivate();
break;
default:;
}
}
}
+9 -7
View File
@@ -19,13 +19,6 @@
#pragma once
#define OLESERV_SAVEOBJECT 1
#define OLESERV_CLOSE 2
#define OLESERV_NOTIFY 3
#define OLESERV_NOTIFYCLOSING 4
#define OLESERV_SHOWOBJECT 5
#define OLESERV_DEACTIVATE 6
#include <oleidl.h>
#if defined __clang__
#pragma clang diagnostic push
@@ -39,6 +32,15 @@
#endif
#include <cppuhelper/weak.hxx>
enum class OLEServ : sal_Int16 {
SaveObject = 1,
Close = 2,
Notify = 3,
NotifyClosing = 4,
ShowObject = 5,
Deactivate = 6
};
class EmbedDocument_Impl;
struct LockedEmbedDocument_Impl
{