tdf#145614 Convert #define to enum class in swevent.hxx
Change-Id: I592c63000db0253761d3069360629765c6906322 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205355 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
committed by
Ilmari Lauhakangas
parent
e9231171dc
commit
f329051613
+15
-13
@@ -24,19 +24,21 @@
|
||||
#include "frmfmt.hxx"
|
||||
#include "hints.hxx"
|
||||
|
||||
#define STR_SW_EVENT_PAGE_COUNT 0
|
||||
#define STR_SW_EVENT_MAIL_MERGE 1
|
||||
#define STR_SW_EVENT_MAIL_MERGE_END 2
|
||||
#define STR_SW_EVENT_FIELD_MERGE 3
|
||||
#define STR_SW_EVENT_FIELD_MERGE_FINISHED 4
|
||||
#define STR_SW_EVENT_LAYOUT_FINISHED 5
|
||||
#define STR_SW_EVENT_OBJECT_SELECT 6
|
||||
#define STR_SW_EVENT_START_INS_GLOSSARY 7
|
||||
#define STR_SW_EVENT_END_INS_GLOSSARY 8
|
||||
#define STR_SW_EVENT_FRM_KEYINPUT_ALPHA 9
|
||||
#define STR_SW_EVENT_FRM_KEYINPUT_NOALPHA 10
|
||||
#define STR_SW_EVENT_FRM_RESIZE 11
|
||||
#define STR_SW_EVENT_FRM_MOVE 12
|
||||
enum class StrSwEvent : sal_Int32 {
|
||||
PageCount,
|
||||
MailMerge,
|
||||
MailMergeEnd,
|
||||
FieldMerge,
|
||||
FieldMergeFinished,
|
||||
LayoutFinished,
|
||||
ObjectSelect,
|
||||
StartInsGlossary,
|
||||
EndInsGlossary,
|
||||
FrmKeyInputAlpha,
|
||||
FrmKeyInputNoAlpha,
|
||||
FrmResize,
|
||||
FrmMove
|
||||
};
|
||||
|
||||
class SwFormatINetFormat;
|
||||
class IMapObject;
|
||||
|
||||
@@ -2585,7 +2585,7 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp *pI ) :
|
||||
{
|
||||
m_pRoot->ResetIdleFormat();
|
||||
SfxObjectShell* pDocShell = m_pImp->GetShell().GetDoc()->GetDocShell();
|
||||
pDocShell->Broadcast( SfxEventHint( SfxEventHintId::SwEventLayoutFinished, SwDocShell::GetEventName(STR_SW_EVENT_LAYOUT_FINISHED), pDocShell ) );
|
||||
pDocShell->Broadcast( SfxEventHint( SfxEventHintId::SwEventLayoutFinished, SwDocShell::GetEventName(static_cast<sal_Int32>(StrSwEvent::LayoutFinished)), pDocShell ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -838,13 +838,13 @@ IMPL_LINK_NOARG(SwMMResultPrintDialog, PrintHdl_Impl, weld::Button&, void)
|
||||
}
|
||||
|
||||
SfxObjectShell* pObjSh = pTargetView->GetViewFrame().GetObjectShell();
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMerge, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh));
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMerge, SwDocShell::GetEventName(static_cast<sal_Int32>(StrSwEvent::MailMerge)), pObjSh));
|
||||
|
||||
uno::Sequence aProps{ comphelper::makePropertyValue(u"MonitorVisible"_ustr, true),
|
||||
comphelper::makePropertyValue(u"Pages"_ustr, sPages) };
|
||||
|
||||
pTargetView->ExecPrint( aProps, false, true );
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMergeEnd, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh));
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMergeEnd, SwDocShell::GetEventName(static_cast<sal_Int32>(StrSwEvent::MailMergeEnd)), pObjSh));
|
||||
|
||||
m_xDialog->response(RET_OK);
|
||||
}
|
||||
|
||||
@@ -1403,7 +1403,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell& rSourceShell,
|
||||
}
|
||||
}
|
||||
|
||||
lcl_emitEvent(SfxEventHintId::SwEventFieldMerge, STR_SW_EVENT_FIELD_MERGE, xWorkDocSh);
|
||||
lcl_emitEvent(SfxEventHintId::SwEventFieldMerge, static_cast<sal_Int32>(StrSwEvent::FieldMerge), xWorkDocSh);
|
||||
|
||||
// tdf#92324: Allow ExpFields update only by explicit instruction to avoid
|
||||
// database cursor movement on any other fields update, for example during
|
||||
@@ -1413,7 +1413,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell& rSourceShell,
|
||||
pWorkShell->SwViewShell::UpdateFields();
|
||||
pWorkShell->LockExpFields();
|
||||
|
||||
lcl_emitEvent(SfxEventHintId::SwEventFieldMergeFinished, STR_SW_EVENT_FIELD_MERGE_FINISHED, xWorkDocSh);
|
||||
lcl_emitEvent(SfxEventHintId::SwEventFieldMergeFinished, static_cast<sal_Int32>(StrSwEvent::FieldMergeFinished), xWorkDocSh);
|
||||
|
||||
// also emit MailMergeEvent on XInterface if possible
|
||||
const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc();
|
||||
@@ -2977,7 +2977,7 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
|
||||
// SfxObjectShellRef is ok, since there should be no control over the document lifetime here
|
||||
SfxObjectShellRef xDocShell = rSh.GetView().GetViewFrame().GetObjectShell();
|
||||
|
||||
lcl_emitEvent(SfxEventHintId::SwMailMerge, STR_SW_EVENT_MAIL_MERGE, xDocShell.get());
|
||||
lcl_emitEvent(SfxEventHintId::SwMailMerge, static_cast<sal_Int32>(StrSwEvent::MailMerge), xDocShell.get());
|
||||
|
||||
// prepare mail merge descriptor
|
||||
SwMergeDescriptor aMergeDesc( m_pImpl->pMergeDialog->GetMergeType(), rSh, aDescriptor );
|
||||
@@ -2997,7 +2997,7 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
|
||||
|
||||
Merge( aMergeDesc );
|
||||
|
||||
lcl_emitEvent(SfxEventHintId::SwMailMergeEnd, STR_SW_EVENT_MAIL_MERGE_END, xDocShell.get());
|
||||
lcl_emitEvent(SfxEventHintId::SwMailMergeEnd, static_cast<sal_Int32>(StrSwEvent::MailMergeEnd), xDocShell.get());
|
||||
|
||||
// reset the cursor inside
|
||||
xResSet = nullptr;
|
||||
|
||||
@@ -1925,7 +1925,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
||||
if (m_nPageCnt != nCnt) // notify Basic
|
||||
{
|
||||
m_nPageCnt = nCnt;
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwEventPageCount, SwDocShell::GetEventName(STR_SW_EVENT_PAGE_COUNT), GetViewFrame().GetObjectShell()), false);
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwEventPageCount, SwDocShell::GetEventName(static_cast<sal_Int32>(StrSwEvent::PageCount)), GetViewFrame().GetObjectShell()), false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -790,9 +790,9 @@ uno::Any SAL_CALL SwXMailMerge::execute(
|
||||
OSL_ENSURE( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." );
|
||||
pMgr->SetMailMergeEvtSrc( this ); // launch events for listeners
|
||||
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMerge, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh.get()));
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMerge, SwDocShell::GetEventName(static_cast<sal_Int32>(StrSwEvent::MailMerge)), xCurDocSh.get()));
|
||||
bool bSucc = pMgr->Merge( aMergeDesc );
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMergeEnd, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), xCurDocSh.get()));
|
||||
SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwMailMergeEnd, SwDocShell::GetEventName(static_cast<sal_Int32>(StrSwEvent::MailMergeEnd)), xCurDocSh.get()));
|
||||
|
||||
pMgr->SetMailMergeEvtSrc( pOldSrc );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user