summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-08 10:26:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-08 12:35:09 +0000
commita66731982e93cdcc5beaa5b0586a7f12a7fc0ef6 (patch)
tree19064090be4d97781c16aa6e79a4f7a09d561ae9 /sw
parent20475c78db5c62f2c8711e59753476bd9b4e2f1c (diff)
convert SFX_HINT to scoped enum
Notes (*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a dynamic_cast check. (*) In SC, removed the hint id field from ScIndexHint, no point in storing the hint id twice (*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no point in storing two different hint ids (*) In some cases, multiple #define's used to map to the same SFX_HINT value (notably the SFX_HINT_USER* values). I made all of those separate values. Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5 Reviewed-on: https://gerrit.libreoffice.org/31751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/inc/section.hxx2
-rw-r--r--sw/inc/swhints.hxx29
-rw-r--r--sw/source/core/doc/DocumentDrawModelManager.cxx4
-rw-r--r--sw/source/core/doc/docdesc.cxx6
-rw-r--r--sw/source/core/doc/docdraw.cxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx16
-rw-r--r--sw/source/core/doc/docnum.cxx6
-rw-r--r--sw/source/core/docnode/ndtbl.cxx4
-rw-r--r--sw/source/core/layout/frmtool.cxx2
-rw-r--r--sw/source/core/layout/pagechg.cxx2
-rw-r--r--sw/source/core/layout/sectfrm.cxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx4
-rw-r--r--sw/source/core/unocore/unostyle.cxx6
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx4
-rw-r--r--sw/source/uibase/app/apphdl.cxx2
-rw-r--r--sw/source/uibase/app/docsh2.cxx14
-rw-r--r--sw/source/uibase/app/docst.cxx4
-rw-r--r--sw/source/uibase/app/docstyle.cxx14
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx13
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx9
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx2
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx4
-rw-r--r--sw/source/uibase/uiview/srcview.cxx4
-rw-r--r--sw/source/uibase/uiview/view.cxx14
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx2
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx2
-rw-r--r--sw/source/uibase/utlui/navipi.cxx2
28 files changed, 75 insertions, 102 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 175dc6eca1c7..7e901e8906d8 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -931,7 +931,7 @@ public:
bool bRegardLanguage = true,
bool bBroadcast = false);
void BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamily,
- sal_uInt16 nOp);
+ SfxHintId nOp);
/** The html import sometimes overwrites the
page sizes set in the page descriptions. This function is used to
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 78a65d6a7dab..6af436661c51 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -252,7 +252,7 @@ class SwSectionFrameMoveAndDeleteHint : public SfxHint
{
public:
SwSectionFrameMoveAndDeleteHint( const bool bSaveContent )
- : SfxHint( SFX_HINT_DYING )
+ : SfxHint( SfxHintId::Dying )
, mbSaveContent( bSaveContent )
{}
diff --git a/sw/inc/swhints.hxx b/sw/inc/swhints.hxx
deleted file mode 100644
index 04361fbe1af4..000000000000
--- a/sw/inc/swhints.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SW_INC_SWHINTS_HXX
-#define INCLUDED_SW_INC_SWHINTS_HXX
-
-#include <svl/hint.hxx>
-
-#define SW_BROADCASTID_START SFX_HINT_USER00
-#define SW_BROADCAST_DRAWVIEWS_CREATED SW_BROADCASTID_START
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx
index bde43a81c846..4f95094eb545 100644
--- a/sw/source/core/doc/DocumentDrawModelManager.cxx
+++ b/sw/source/core/doc/DocumentDrawModelManager.cxx
@@ -29,7 +29,7 @@
#include <wrtsh.hxx>
#include <swtypes.hxx>
#include <ndtxt.hxx>
-#include <swhints.hxx>
+#include <svl/hint.hxx>
#include <viewsh.hxx>
#include <view.hxx>
#include <drawdoc.hxx>
@@ -226,7 +226,7 @@ SwDrawModel* DocumentDrawModelManager::MakeDrawModel_()
// Broadcast, so that the FormShell can be connected to the DrawView
if( m_rDoc.GetDocShell() )
{
- SfxHint aHint( SW_BROADCAST_DRAWVIEWS_CREATED );
+ SfxHint aHint( SfxHintId::SwDrawViewsCreated );
m_rDoc.GetDocShell()->Broadcast( aHint );
}
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 7d3d6fb29c0e..43bf4c721e46 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -594,7 +594,7 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
}
void SwDoc::BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamily,
- sal_uInt16 nOp)
+ SfxHintId nOp)
{
if (mpDocShell)
{
@@ -622,7 +622,7 @@ void SwDoc::DelPageDesc( size_t i, bool bBroadcast )
if (bBroadcast)
BroadcastStyleOperation(rDel.GetName(), SfxStyleFamily::Page,
- SfxStyleSheetHintId::ERASED);
+ SfxHintId::StyleSheetErased);
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -672,7 +672,7 @@ SwPageDesc* SwDoc::MakePageDesc(const OUString &rName, const SwPageDesc *pCpy,
if (bBroadcast)
BroadcastStyleOperation(rName, SfxStyleFamily::Page,
- SfxStyleSheetHintId::CREATED);
+ SfxHintId::StyleSheetCreated);
if (GetIDocumentUndoRedo().DoesUndo())
{
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 7669a6d7d4bd..f628efd2733f 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -35,7 +35,7 @@
#include <frmfmt.hxx>
#include <charfmt.hxx>
#include <viewimp.hxx>
-#include <swhints.hxx>
+#include <svl/hint.hxx>
#include <doc.hxx>
#include <docfunc.hxx>
#include <IDocumentUndoRedo.hxx>
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index c8a03546eed1..738ad8b6dfbe 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -678,7 +678,7 @@ void SwDoc::DelCharFormat(size_t nFormat, bool bBroadcast)
if (bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SfxStyleFamily::Char,
- SfxStyleSheetHintId::ERASED);
+ SfxHintId::StyleSheetErased);
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -717,7 +717,7 @@ void SwDoc::DelFrameFormat( SwFrameFormat *pFormat, bool bBroadcast )
if (bBroadcast)
BroadcastStyleOperation(pFormat->GetName(),
SfxStyleFamily::Frame,
- SfxStyleSheetHintId::ERASED);
+ SfxHintId::StyleSheetErased);
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -831,7 +831,7 @@ SwFrameFormat *SwDoc::MakeFrameFormat(const OUString &rFormatName,
if (bBroadcast)
{
BroadcastStyleOperation(rFormatName, SfxStyleFamily::Frame,
- SfxStyleSheetHintId::CREATED);
+ SfxHintId::StyleSheetCreated);
}
return pFormat;
@@ -867,7 +867,7 @@ SwCharFormat *SwDoc::MakeCharFormat( const OUString &rFormatName,
if (bBroadcast)
{
BroadcastStyleOperation(rFormatName, SfxStyleFamily::Char,
- SfxStyleSheetHintId::CREATED);
+ SfxHintId::StyleSheetCreated);
}
return pFormat;
@@ -903,7 +903,7 @@ SwTextFormatColl* SwDoc::MakeTextFormatColl( const OUString &rFormatName,
if (bBroadcast)
BroadcastStyleOperation(rFormatName, SfxStyleFamily::Para,
- SfxStyleSheetHintId::CREATED);
+ SfxHintId::StyleSheetCreated);
return pFormatColl;
}
@@ -937,7 +937,7 @@ SwConditionTextFormatColl* SwDoc::MakeCondTextFormatColl( const OUString &rForma
if (bBroadcast)
BroadcastStyleOperation(rFormatName, SfxStyleFamily::Para,
- SfxStyleSheetHintId::CREATED);
+ SfxHintId::StyleSheetCreated);
return pFormatColl;
}
@@ -966,7 +966,7 @@ void SwDoc::DelTextFormatColl(size_t nFormatColl, bool bBroadcast)
if (bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SfxStyleFamily::Para,
- SfxStyleSheetHintId::ERASED);
+ SfxHintId::StyleSheetErased);
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1911,7 +1911,7 @@ void SwDoc::RenameFormat(SwFormat & rFormat, const OUString & sNewName,
rFormat.SetName(sNewName);
if (bBroadcast)
- BroadcastStyleOperation(sNewName, eFamily, SfxStyleSheetHintId::MODIFIED);
+ BroadcastStyleOperation(sNewName, eFamily, SfxHintId::StyleSheetModified);
}
void SwDoc::dumpAsXml(xmlTextWriterPtr pWriter) const
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 202eb060dac2..deed273a105a 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1024,7 +1024,7 @@ bool SwDoc::DelNumRule( const OUString& rName, bool bBroadcast )
if (bBroadcast)
BroadcastStyleOperation(rName, SfxStyleFamily::Pseudo,
- SfxStyleSheetHintId::ERASED);
+ SfxHintId::StyleSheetErased);
getIDocumentListsAccess().deleteListForListStyle( rName );
getIDocumentListsAccess().deleteListsByDefaultListStyle( rName );
@@ -1097,7 +1097,7 @@ bool SwDoc::RenameNumRule(const OUString & rOldName, const OUString & rNewName,
if (bBroadcast)
BroadcastStyleOperation(rOldName, SfxStyleFamily::Pseudo,
- SfxStyleSheetHintId::MODIFIED);
+ SfxHintId::StyleSheetModified);
}
return bResult;
@@ -2183,7 +2183,7 @@ sal_uInt16 SwDoc::MakeNumRule( const OUString &rName,
if (bBroadcast)
BroadcastStyleOperation(pNew->GetName(), SfxStyleFamily::Pseudo,
- SfxStyleSheetHintId::CREATED);
+ SfxHintId::StyleSheetCreated);
return nRet;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 633f3a860d82..9c8eb82e6020 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4617,7 +4617,7 @@ SwTableAutoFormat* SwDoc::MakeTableStyle(const OUString& rName, bool bBroadcast)
}
if (bBroadcast)
- BroadcastStyleOperation(rName, SfxStyleFamily::Table, SfxStyleSheetHintId::CREATED);
+ BroadcastStyleOperation(rName, SfxStyleFamily::Table, SfxHintId::StyleSheetCreated);
return pTableFormat;
}
@@ -4625,7 +4625,7 @@ SwTableAutoFormat* SwDoc::MakeTableStyle(const OUString& rName, bool bBroadcast)
std::unique_ptr<SwTableAutoFormat> SwDoc::DelTableStyle(const OUString& rName, bool bBroadcast)
{
if (bBroadcast)
- BroadcastStyleOperation(rName, SfxStyleFamily::Table, SfxStyleSheetHintId::ERASED);
+ BroadcastStyleOperation(rName, SfxStyleFamily::Table, SfxHintId::StyleSheetErased);
std::unique_ptr<SwTableAutoFormat> pReleasedFormat = GetTableStyles().ReleaseAutoFormat(rName);
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 1cf252f3fffc..a40babee438d 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3241,7 +3241,7 @@ void SwFrameHolder::Reset()
void SwFrameHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.GetId() == SFX_HINT_DYING && &rBC == pFrame )
+ if ( rHint.GetId() == SfxHintId::Dying && &rBC == pFrame )
{
pFrame = nullptr;
}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 8f828e91eb37..6ced59ba0fa3 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -2231,7 +2231,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
if (bOldCallbackActionEnabled)
{
pSh->InvalidateWindows( SwRect( 0, 0, SAL_MAX_INT32, SAL_MAX_INT32 ) );
- pSh->GetDoc()->GetDocShell()->Broadcast(SfxHint(SFX_HINT_DOCCHANGED));
+ pSh->GetDoc()->GetDocShell()->Broadcast(SfxHint(SfxHintId::DocChanged));
}
}
}
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 08230e6a3329..db1e0e9bcd6f 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2298,7 +2298,7 @@ void SwSectionFrame::SwClientNotify( const SwModify& rMod, const SfxHint& rHint
// #i117863#
const SwSectionFrameMoveAndDeleteHint* pHint =
dynamic_cast<const SwSectionFrameMoveAndDeleteHint*>(&rHint);
- if ( pHint && pHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
+ if ( pHint && pHint->GetId() == SfxHintId::Dying && &rMod == GetRegisteredIn() )
{
SwSectionFrame::MoveContentAndDelete( this, pHint->IsSaveContent() );
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 6e639627d404..46d4e078866d 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2165,7 +2165,7 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart,
// do not delete note and later add it -> sidebar flickering
if (GetDoc()->GetDocShell())
{
- GetDoc()->GetDocShell()->Broadcast( SfxHint(SFX_HINT_USER04));
+ GetDoc()->GetDocShell()->Broadcast( SfxHint(SfxHintId::SwSplitNodeOperation));
}
// Attribut verschieben
m_pSwpHints->Delete( pHt );
@@ -2188,7 +2188,7 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart,
| SetAttrMode::DONTREPLACE );
if (GetDoc()->GetDocShell())
{
- GetDoc()->GetDocShell()->Broadcast( SfxHint(SFX_HINT_USER04));
+ GetDoc()->GetDocShell()->Broadcast( SfxHint(SfxHintId::SwSplitNodeOperation));
}
continue; // while-Schleife weiter, ohne ++ !
}
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 0615ff5857ec..f84ddc7362ef 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -243,7 +243,7 @@ namespace sw
//SfxListener
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override
{
- if(rHint.GetId() & SFX_HINT_DYING)
+ if(rHint.GetId() == SfxHintId::Dying)
{
m_pBasePool = nullptr;
m_pDocShell = nullptr;
@@ -2761,12 +2761,12 @@ uno::Any SwXStyle::getPropertyDefault(const OUString& rPropertyName)
void SwXStyle::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- if((rHint.GetId() & SFX_HINT_DYING) || (rHint.GetId() & SfxStyleSheetHintId::ERASED))
+ if((rHint.GetId() == SfxHintId::Dying) || (rHint.GetId() == SfxHintId::StyleSheetErased))
{
m_pBasePool = nullptr;
EndListening(rBC);
}
- else if(rHint.GetId() & (SfxStyleSheetHintId::CHANGED))
+ else if(rHint.GetId() == SfxHintId::StyleSheetChanged)
{
static_cast<SfxStyleSheetBasePool&>(rBC).SetSearchMask(m_rEntry.m_eFamily);
SfxStyleSheetBase* pOwnBase = static_cast<SfxStyleSheetBasePool&>(rBC).Find(m_sStyleName);
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 8463afda22ce..bb6bcd8e7390 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1342,8 +1342,8 @@ void AddressMultiLineEdit::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
if (m_aSelectionLink.IsSet() && dynamic_cast<const TextHint*>(&rHint))
{
const TextHint& rTextHint = static_cast<const TextHint&>(rHint);
- if (rTextHint.GetId() == TEXT_HINT_VIEWSELECTIONCHANGED ||
- rTextHint.GetId() == TEXT_HINT_VIEWCARETCHANGED)
+ if (rTextHint.GetId() == SfxHintId::TextViewSelectionChanged ||
+ rTextHint.GetId() == SfxHintId::TextViewCaretChanged)
{
m_aSelectionLink.Call(*this);
}
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 3db0af314bf0..3948cf591b0b 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -874,7 +874,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
else
{
- if (rHint.GetId() == SFX_HINT_DEINITIALIZING)
+ if (rHint.GetId() == SfxHintId::Deinitializing)
{
DELETEZ(m_pWebUsrPref);
DELETEZ(m_pUsrPref);
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 899ee0ea20e7..65080d282cdc 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -247,8 +247,8 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
lcl_processCompatibleSfxHint( xVbaEvents, rHint );
sal_uInt16 nAction = 0;
- if( dynamic_cast<const SfxEventHint*>(&rHint) &&
- static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_LOADFINISHED )
+ auto pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
+ if( pEventHint && pEventHint->GetEventId() == SFX_EVENT_LOADFINISHED )
{
// #i38126# - own action id
nAction = 3;
@@ -256,12 +256,10 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
else
{
// switch for more actions
- switch( rHint.GetId() )
+ if( rHint.GetId() == SfxHintId::TitleChanged)
{
- case SFX_HINT_TITLECHANGED:
- if( GetMedium() )
- nAction = 2;
- break;
+ if( GetMedium() )
+ nAction = 2;
}
}
@@ -1262,7 +1260,7 @@ void SwDocShell::SetModified( bool bSet )
}
UpdateChildWindows();
- Broadcast(SfxHint(SFX_HINT_DOCCHANGED));
+ Broadcast(SfxHint(SfxHintId::DocChanged));
}
}
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ee02b382a861..2172c86653ce 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -628,7 +628,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
pView->InvalidateRulerPos();
if( m_bNew )
- m_xBasePool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::CREATED, *m_xTmp.get() ) );
+ m_xBasePool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *m_xTmp.get() ) );
pDoc->getIDocumentState().SetModified();
if( !m_bModified )
@@ -880,7 +880,7 @@ sal_uInt16 SwDocShell::Edit(
m_pView->InvalidateRulerPos();
if( bNew )
- m_xBasePool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::CREATED, *xTmp.get() ) );
+ m_xBasePool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *xTmp.get() ) );
m_pDoc->getIDocumentState().SetModified();
if( !bModified ) // Bug 57028
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index aa999ea4894e..a4257fa71fb3 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -564,7 +564,7 @@ void SwDocStyleSheet::SetGrabBagItem(const uno::Any& rVal)
if (bChg)
{
dynamic_cast<SwDocStyleSheetPool&>(*pPool).InvalidateIterator();
- pPool->Broadcast(SfxStyleSheetHint(SfxStyleSheetHintId::MODIFIED, *this));
+ pPool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetModified, *this));
SwEditShell* pSh = rDoc.GetEditShell();
if (pSh)
pSh->CallChgLnk();
@@ -675,7 +675,7 @@ void SwDocStyleSheet::SetHidden( bool bValue )
{
// calling pPool->First() here would be quite slow...
dynamic_cast<SwDocStyleSheetPool&>(*pPool).InvalidateIterator(); // internal list has to be updated
- pPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED, *this ) );
+ pPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified, *this ) );
SwEditShell* pSh = rDoc.GetEditShell();
if( pSh )
pSh->CallChgLnk();
@@ -1153,7 +1153,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow)
if( bChg )
{
pPool->First(); // internal list has to be updated
- pPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED, *this ) );
+ pPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified, *this ) );
SwEditShell* pSh = rDoc.GetEditShell();
if( pSh )
pSh->CallChgLnk();
@@ -1204,7 +1204,7 @@ bool SwDocStyleSheet::SetParent( const OUString& rStr)
if( bRet )
{
aParent = rStr;
- pPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED,
+ pPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified,
*this ) );
}
}
@@ -2508,7 +2508,7 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle)
}
if( bBroadcast )
- Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::ERASED, *pStyle ) );
+ Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetErased, *pStyle ) );
}
bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
@@ -2560,7 +2560,7 @@ bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
else
mxStyleSheet->PresetFollow( OUString() );
- Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED,
+ Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified,
*(mxStyleSheet.get()) ) );
}
}
@@ -3204,7 +3204,7 @@ void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint )
// search and remove from View-List!!
const SfxStyleSheetHint* pStyleSheetHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
if( pStyleSheetHint &&
- SfxStyleSheetHintId::ERASED == pStyleSheetHint->GetHint() )
+ SfxHintId::StyleSheetErased == pStyleSheetHint->GetId() )
{
SfxStyleSheetBase* pStyle = pStyleSheetHint->GetStyleSheet();
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 8b2656a49c65..3e4aff029336 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -157,7 +157,7 @@ SwPostItMgr::SwPostItMgr(SwView* pView)
/* this code can be used once we want redline comments in the Sidebar
AddRedlineComments(false,false);
*/
- // we want to receive stuff like SFX_HINT_DOCCHANGED
+ // we want to receive stuff like SfxHintId::DocChanged
StartListening(*mpView->GetDocShell());
if (!mvPostItFields.empty())
{
@@ -363,10 +363,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- sal_uInt32 nId = rHint.GetId();
+ SfxHintId nId = rHint.GetId();
switch ( nId )
{
- case SFX_HINT_MODECHANGED:
+ case SfxHintId::ModeChanged:
{
if ( mbReadOnly != !!(mpView->GetDocShell()->IsReadOnly()) )
{
@@ -376,7 +376,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
break;
}
- case SFX_HINT_DOCCHANGED:
+ case SfxHintId::DocChanged:
{
if ( mpView->GetDocShell() == &rBC )
{
@@ -388,13 +388,13 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
break;
}
- case SFX_HINT_USER04:
+ case SfxHintId::SwSplitNodeOperation:
{
// if we are in a SplitNode/Cut operation, do not delete note and then add again, as this will flicker
mbDeleteNote = !mbDeleteNote;
break;
}
- case SFX_HINT_DYING:
+ case SfxHintId::Dying:
{
if ( mpView->GetDocShell() != &rBC )
{
@@ -404,6 +404,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
break;
}
+ default: break;
}
}
}
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index 1e7da99e0b69..51fa941346af 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -739,26 +739,27 @@ void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
switch (pTextHint->GetId())
{
- case TEXT_HINT_VIEWSCROLLED:
+ case SfxHintId::TextViewScrolled:
m_pHScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().X() );
m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
break;
- case TEXT_HINT_TEXTHEIGHTCHANGED:
+ case SfxHintId::TextHeightChanged:
if ( m_pTextEngine->GetTextHeight() < m_pOutWin->GetOutputSizePixel().Height() )
m_pTextView->Scroll( 0, m_pTextView->GetStartDocPos().Y() );
m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
SetScrollBarRanges();
break;
- case TEXT_HINT_PARAINSERTED:
- case TEXT_HINT_PARACONTENTCHANGED:
+ case SfxHintId::TextParaInserted:
+ case SfxHintId::TextParaContentChanged:
if ( !m_bHighlighting )
{
m_aSyntaxLineTable.insert( static_cast<sal_uInt16>(pTextHint->GetValue()) );
m_aSyntaxIdle.Start();
}
break;
+ default: break;
}
}
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index cfb0a8b69b84..328ac4518885 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -172,7 +172,7 @@ public:
virtual ~SwRedlineAcceptPanel() override;
virtual void dispose() override;
- /// We need to be a SfxListener to be able to update the list of changes when we get SFX_HINT_DOCCHANGED.
+ /// We need to be a SfxListener to be able to update the list of changes when we get SfxHintId::DocChanged.
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
};
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index ccfc18e8fb77..6263e25a2625 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1235,7 +1235,7 @@ SwRedlineAcceptPanel::SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno:
mpImplDlg->Init();
- // we want to receive SFX_HINT_DOCCHANGED
+ // we want to receive SfxHintId::DocChanged
StartListening(*(SW_MOD()->GetView()->GetDocShell()));
}
@@ -1253,7 +1253,7 @@ void SwRedlineAcceptPanel::dispose()
void SwRedlineAcceptPanel::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if (mpImplDlg && rHint.GetId() == SFX_HINT_DOCCHANGED)
+ if (mpImplDlg && rHint.GetId() == SfxHintId::DocChanged)
mpImplDlg->Activate();
}
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 4903d09d0446..77950de87c9f 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -751,9 +751,9 @@ sal_Int32 SwSrcView::PrintSource(
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.GetId() == SFX_HINT_MODECHANGED ||
+ if ( rHint.GetId() == SfxHintId::ModeChanged ||
(
- rHint.GetId() == SFX_HINT_TITLECHANGED &&
+ rHint.GetId() == SfxHintId::TitleChanged &&
!GetDocShell()->IsReadOnly() && aEditWin->IsReadonly()
)
)
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index b0dba6ee354f..fcaf9de3fa8f 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -44,7 +44,7 @@
#include <svx/fontworkbar.hxx>
#include <unotxvw.hxx>
#include <cmdid.h>
-#include <swhints.hxx>
+#include <svl/hint.hxx>
#include <swmodule.hxx>
#include <inputwin.hxx>
#include <chartins.hxx>
@@ -1574,12 +1574,12 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- sal_uInt32 nId = rHint.GetId();
+ SfxHintId nId = rHint.GetId();
switch ( nId )
{
// sub shells will be destroyed by the
// dispatcher, if the view frame is dying. Thus, reset member <pShell>.
- case SFX_HINT_DYING:
+ case SfxHintId::Dying:
{
if ( &rBC == GetViewFrame() )
{
@@ -1587,7 +1587,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
break;
- case SFX_HINT_MODECHANGED:
+ case SfxHintId::ModeChanged:
{
// Modal mode change-over?
bool bModal = GetDocShell()->IsInModalMode();
@@ -1597,7 +1597,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SAL_FALLTHROUGH;
- case SFX_HINT_TITLECHANGED:
+ case SfxHintId::TitleChanged:
if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
{
SwWrtShell &rSh = GetWrtShell();
@@ -1629,7 +1629,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
break;
- case SW_BROADCAST_DRAWVIEWS_CREATED:
+ case SfxHintId::SwDrawViewsCreated:
{
bCallBase = false;
if ( GetFormShell() )
@@ -1641,6 +1641,8 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
break;
+
+ default: break;
}
}
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index dbb2cb51550f..44f96d8e1854 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -774,7 +774,7 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
}
else
{
- if ( SFX_HINT_DEINITIALIZING == _rHint.GetId() )
+ if ( SfxHintId::Deinitializing == _rHint.GetId() )
{
// our document is dying (possibly because we're shuting down, and the document was notified
// earlier than we are?)
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index cee4def454f0..79eed51b5295 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -130,7 +130,7 @@ public:
void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.GetId() == SFX_HINT_DYING)
+ if( rHint.GetId() == SfxHintId::Dying)
bValid = false;
}
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 1a73048cc2d4..2adcb91b7c76 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -870,7 +870,7 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
{
if(&rBrdc == m_pCreateView)
{
- if (rHint.GetId() == SFX_HINT_DYING)
+ if (rHint.GetId() == SfxHintId::Dying)
{
m_pCreateView = nullptr;
}