summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-16 08:16:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-16 08:17:34 +0200
commitd76d15552d7ef9faddb0694e5f05d180e5798c14 (patch)
treee32629af3435a3d75e2aad57e6b0e7877a05462f /framework
parentce3441c2d5b6267c437b7af362fc8d29e38c1dd4 (diff)
convert FrameListAnalyzer::EDetect to scoped enum
Change-Id: I4e1bd449c4ad60ec810ef52c73d6c6ff3dd313ee
Diffstat (limited to 'framework')
-rw-r--r--framework/source/dispatch/closedispatcher.cxx6
-rw-r--r--framework/source/dispatch/startmoduledispatcher.cxx2
-rw-r--r--framework/source/fwe/classes/framelistanalyzer.cxx23
-rw-r--r--framework/source/loadenv/loadenv.cxx8
-rw-r--r--framework/source/services/frame.cxx2
5 files changed, 19 insertions, 22 deletions
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index a9ad77b8db7d..97527aaa607e 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -287,7 +287,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
// If we found some special cases, we can
// make some decisions earlier!
css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create(xContext), css::uno::UNO_QUERY_THROW);
- FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
+ FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameAnalyzerFlags::Help | FrameAnalyzerFlags::BackingComponent);
// Check for existing UNO connections.
// NOTE: There is a race between checking this and connections being created/destroyed before
@@ -330,7 +330,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
{
// OK; this frame is empty now.
// Check the environment again to decide, what is the next step.
- FrameListAnalyzer aCheck2(xDesktop, xCloseFrame, FrameListAnalyzer::E_ALL);
+ FrameListAnalyzer aCheck2(xDesktop, xCloseFrame, FrameAnalyzerFlags::All);
// c1) there is as minimum 1 frame open, which is visible and contains a document
// different from our one. And it's not the help!
@@ -456,7 +456,7 @@ bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Reference< c
}
css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
- FrameListAnalyzer aCheck(xDesktop, xFrame, FrameListAnalyzer::E_ALL);
+ FrameListAnalyzer aCheck(xDesktop, xFrame, FrameAnalyzerFlags::All);
size_t c = aCheck.m_lModelFrames.size();
size_t i = 0;
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx
index 8fb1006d4c27..64f5974e227e 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -111,7 +111,7 @@ bool StartModuleDispatcher::implts_isBackingModePossible()
FrameListAnalyzer aCheck(
xDesktop,
css::uno::Reference< css::frame::XFrame >(),
- FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
+ FrameAnalyzerFlags::Help | FrameAnalyzerFlags::BackingComponent);
bool bIsPossible = false;
diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx b/framework/source/fwe/classes/framelistanalyzer.cxx
index 2b6ded8181c0..efb772fbee0a 100644
--- a/framework/source/fwe/classes/framelistanalyzer.cxx
+++ b/framework/source/fwe/classes/framelistanalyzer.cxx
@@ -40,7 +40,7 @@ namespace framework{
FrameListAnalyzer::FrameListAnalyzer( const css::uno::Reference< css::frame::XFramesSupplier >& xSupplier ,
const css::uno::Reference< css::frame::XFrame >& xReferenceFrame ,
- sal_uInt32 eDetectMode )
+ FrameAnalyzerFlags eDetectMode )
: m_xSupplier (xSupplier )
, m_xReferenceFrame(xReferenceFrame)
, m_eDetectMode (eDetectMode )
@@ -97,7 +97,7 @@ void FrameListAnalyzer::impl_analyze()
// to sort it into the list of frames with the same model.
// Suppress this step, if right detect mode isn't set.
css::uno::Reference< css::frame::XModel > xReferenceModel;
- if ((m_eDetectMode & E_MODEL) == E_MODEL )
+ if (m_eDetectMode & FrameAnalyzerFlags::Model)
{
css::uno::Reference< css::frame::XController > xReferenceController;
if (m_xReferenceFrame.is())
@@ -109,17 +109,14 @@ void FrameListAnalyzer::impl_analyze()
// check, if the reference frame is in hidden mode.
// But look, if this analyze step is really needed.
css::uno::Reference< css::beans::XPropertySet > xSet(m_xReferenceFrame, css::uno::UNO_QUERY);
- if (
- ((m_eDetectMode & E_HIDDEN) == E_HIDDEN) &&
- (xSet.is() )
- )
+ if ( (m_eDetectMode & FrameAnalyzerFlags::Hidden) && xSet.is() )
{
xSet->getPropertyValue(FRAME_PROPNAME_ASCII_ISHIDDEN) >>= m_bReferenceIsHidden;
}
// check, if the reference frame includes the backing component.
// But look, if this analyze step is really needed.
- if (((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT) && m_xReferenceFrame.is() )
+ if ((m_eDetectMode & FrameAnalyzerFlags::BackingComponent) && m_xReferenceFrame.is() )
{
try
{
@@ -140,7 +137,7 @@ void FrameListAnalyzer::impl_analyze()
// check, if the reference frame includes the help module.
// But look, if this analyze step is really needed.
if (
- ((m_eDetectMode & E_HELP) == E_HELP ) &&
+ (m_eDetectMode & FrameAnalyzerFlags::Help) &&
(m_xReferenceFrame.is() ) &&
(m_xReferenceFrame->getName() == SPECIALTARGET_HELPTASK)
)
@@ -165,7 +162,7 @@ void FrameListAnalyzer::impl_analyze()
continue;
if (
- ((m_eDetectMode & E_ZOMBIE) == E_ZOMBIE) &&
+ (m_eDetectMode & FrameAnalyzerFlags::Zombie) &&
(
(!xFrame->getContainerWindow().is()) ||
(!xFrame->getComponentWindow().is())
@@ -178,7 +175,7 @@ void FrameListAnalyzer::impl_analyze()
// a) Is it the special help task?
// Return it separated from any return list.
if (
- ((m_eDetectMode & E_HELP) == E_HELP ) &&
+ (m_eDetectMode & FrameAnalyzerFlags::Help) &&
(xFrame->getName()==SPECIALTARGET_HELPTASK)
)
{
@@ -190,7 +187,7 @@ void FrameListAnalyzer::impl_analyze()
// Return it separated from any return list.
// But check if the reference task itself is the backing frame.
// Our user must know it to decide right.
- if ((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT)
+ if (m_eDetectMode & FrameAnalyzerFlags::BackingComponent)
{
try
{
@@ -210,7 +207,7 @@ void FrameListAnalyzer::impl_analyze()
// c) Or is it the a task, which uses the specified model?
// Add it to the list of "model frames".
- if ((m_eDetectMode & E_MODEL) == E_MODEL)
+ if (m_eDetectMode & FrameAnalyzerFlags::Model)
{
css::uno::Reference< css::frame::XController > xController = xFrame->getController();
css::uno::Reference< css::frame::XModel > xModel;
@@ -229,7 +226,7 @@ void FrameListAnalyzer::impl_analyze()
// visible state ... if it's allowed to do so.
bool bHidden = false;
- if ((m_eDetectMode & E_HIDDEN) == E_HIDDEN )
+ if (m_eDetectMode & FrameAnalyzerFlags::Hidden)
{
xSet.set(xFrame, css::uno::UNO_QUERY);
if (xSet.is())
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 4687489b07f4..c98fb8bcbba9 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -914,9 +914,9 @@ bool LoadEnv::impl_furtherDocsAllowed()
FrameListAnalyzer aAnalyzer(xDesktop,
css::uno::Reference< css::frame::XFrame >(),
- FrameListAnalyzer::E_HELP |
- FrameListAnalyzer::E_BACKINGCOMPONENT |
- FrameListAnalyzer::E_HIDDEN);
+ FrameAnalyzerFlags::Help |
+ FrameAnalyzerFlags::BackingComponent |
+ FrameAnalyzerFlags::Hidden);
sal_Int32 nOpenDocuments = aAnalyzer.m_lOtherVisibleFrames.size();
bAllowed = (nOpenDocuments < nMaxOpenDocuments);
@@ -1352,7 +1352,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget()
return css::uno::Reference< css::frame::XFrame >();
css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY);
- FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< css::frame::XFrame >(), FrameListAnalyzer::E_BACKINGCOMPONENT);
+ FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< css::frame::XFrame >(), FrameAnalyzerFlags::BackingComponent);
if (aTasksAnalyzer.m_xBackingComponent.is())
{
if (!impl_isFrameAlreadyUsedForLoading(aTasksAnalyzer.m_xBackingComponent))
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 3bdda7772091..f18f85055de6 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -3254,7 +3254,7 @@ void Frame::impl_checkMenuCloser()
FrameListAnalyzer aAnalyzer(
xTaskSupplier,
this,
- FrameListAnalyzer::E_HIDDEN | FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
+ FrameAnalyzerFlags::Hidden | FrameAnalyzerFlags::Help | FrameAnalyzerFlags::BackingComponent);
// specify the new frame, which must have this special state ...
css::uno::Reference< css::frame::XFrame2 > xNewCloserFrame;