summaryrefslogtreecommitdiff
path: root/framework/source/loadenv
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-06 09:15:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-06 07:57:28 +0000
commitbac9a5d634b333fdc2345bfd3fa852ccc5f0d73b (patch)
tree004b3ad26f5bf29bde28570d8370336377d7402a /framework/source/loadenv
parentfcb0280c1023102a08c4efea43bcf08f005fa499 (diff)
loplugin:unusedenumconstants in framework
Convert EProtocol to scoped enum and drop E_UNKNOWN_PROTOCOL. Convert ToggleButtonToolbarController::Style to scoped enum and drop STYLE_TOGGLEBUTTON. Convert TargetHelper::ESpecialTarget to scoped enum and drop E_NOT_SPECIAL. Change-Id: I412adacac15192cf6563ce4d5e5b74bfffff4737 Reviewed-on: https://gerrit.libreoffice.org/33949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/loadenv')
-rw-r--r--framework/source/loadenv/loadenv.cxx36
-rw-r--r--framework/source/loadenv/targethelper.cxx18
2 files changed, 27 insertions, 27 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index b5af8ee4d62c..436970269155 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -512,12 +512,12 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
if(
(sURL.isEmpty() ) ||
- (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_UNO )) ||
- (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_SLOT )) ||
- (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_MACRO )) ||
- (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_SERVICE)) ||
- (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_MAILTO )) ||
- (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_NEWS ))
+ (ProtocolCheck::isProtocol(sURL,EProtocol::Uno )) ||
+ (ProtocolCheck::isProtocol(sURL,EProtocol::Slot )) ||
+ (ProtocolCheck::isProtocol(sURL,EProtocol::Macro )) ||
+ (ProtocolCheck::isProtocol(sURL,EProtocol::Service)) ||
+ (ProtocolCheck::isProtocol(sURL,EProtocol::MailTo )) ||
+ (ProtocolCheck::isProtocol(sURL,EProtocol::News ))
)
{
return E_UNSUPPORTED_CONTENT;
@@ -539,13 +539,13 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
*/
// creation of new documents
- if (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_PRIVATE_FACTORY))
+ if (ProtocolCheck::isProtocol(sURL,EProtocol::PrivateFactory))
return E_CAN_BE_LOADED;
// using of an existing input stream
utl::MediaDescriptor stlMediaDescriptor(lMediaDescriptor);
utl::MediaDescriptor::const_iterator pIt;
- if (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_PRIVATE_STREAM))
+ if (ProtocolCheck::isProtocol(sURL,EProtocol::PrivateStream))
{
pIt = stlMediaDescriptor.find(utl::MediaDescriptor::PROP_INPUTSTREAM());
css::uno::Reference< css::io::XInputStream > xStream;
@@ -558,7 +558,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
}
// using of a full featured document
- if (ProtocolCheck::isProtocol(sURL,ProtocolCheck::E_PRIVATE_OBJECT))
+ if (ProtocolCheck::isProtocol(sURL,EProtocol::PrivateObject))
{
pIt = stlMediaDescriptor.find(utl::MediaDescriptor::PROP_MODEL());
css::uno::Reference< css::frame::XModel > xModel;
@@ -964,7 +964,7 @@ bool LoadEnv::impl_loadContent()
// search or create right target frame
OUString sTarget = m_sTarget;
- if (TargetHelper::matchSpecialTarget(sTarget, TargetHelper::E_DEFAULT))
+ if (TargetHelper::matchSpecialTarget(sTarget, TargetHelper::ESpecialTarget::Default))
{
m_xTargetFrame = impl_searchAlreadyLoaded();
if (m_xTargetFrame.is())
@@ -978,8 +978,8 @@ bool LoadEnv::impl_loadContent()
if (! m_xTargetFrame.is())
{
if (
- (TargetHelper::matchSpecialTarget(sTarget, TargetHelper::E_BLANK )) ||
- (TargetHelper::matchSpecialTarget(sTarget, TargetHelper::E_DEFAULT))
+ (TargetHelper::matchSpecialTarget(sTarget, TargetHelper::ESpecialTarget::Blank )) ||
+ (TargetHelper::matchSpecialTarget(sTarget, TargetHelper::ESpecialTarget::Default))
)
{
if (! impl_furtherDocsAllowed())
@@ -1192,7 +1192,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// such search is allowed for special requests only ...
// or better it's not allowed for some requests in general :-)
if (
- ( ! TargetHelper::matchSpecialTarget(m_sTarget, TargetHelper::E_DEFAULT) ) ||
+ ( ! TargetHelper::matchSpecialTarget(m_sTarget, TargetHelper::ESpecialTarget::Default) ) ||
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ASTEMPLATE() , false) ||
// (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN() , false) == sal_True) ||
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_OPENNEWVIEW(), false)
@@ -1205,8 +1205,8 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// May it's not useful to start expensive document search, if it
// can fail only .. because we load from a stream or model directly!
if (
- (ProtocolCheck::isProtocol(m_aURL.Complete, ProtocolCheck::E_PRIVATE_STREAM )) ||
- (ProtocolCheck::isProtocol(m_aURL.Complete, ProtocolCheck::E_PRIVATE_OBJECT ))
+ (ProtocolCheck::isProtocol(m_aURL.Complete, EProtocol::PrivateStream )) ||
+ (ProtocolCheck::isProtocol(m_aURL.Complete, EProtocol::PrivateObject ))
/*TODO should be private:factory here tested too? */
)
{
@@ -1375,9 +1375,9 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget()
// On the other side some special URLs will open a new frame every time (expecting
// they can use the backing-mode frame!)
if (
- (ProtocolCheck::isProtocol(m_aURL.Complete, ProtocolCheck::E_PRIVATE_FACTORY )) ||
- (ProtocolCheck::isProtocol(m_aURL.Complete, ProtocolCheck::E_PRIVATE_STREAM )) ||
- (ProtocolCheck::isProtocol(m_aURL.Complete, ProtocolCheck::E_PRIVATE_OBJECT ))
+ (ProtocolCheck::isProtocol(m_aURL.Complete, EProtocol::PrivateFactory )) ||
+ (ProtocolCheck::isProtocol(m_aURL.Complete, EProtocol::PrivateStream )) ||
+ (ProtocolCheck::isProtocol(m_aURL.Complete, EProtocol::PrivateObject ))
)
{
return css::uno::Reference< css::frame::XFrame >();
diff --git a/framework/source/loadenv/targethelper.cxx b/framework/source/loadenv/targethelper.cxx
index 488b0525fa98..4010355a2358 100644
--- a/framework/source/loadenv/targethelper.cxx
+++ b/framework/source/loadenv/targethelper.cxx
@@ -26,28 +26,28 @@ bool TargetHelper::matchSpecialTarget(const OUString& sCheckTarget ,
{
switch(eSpecialTarget)
{
- case E_SELF :
+ case ESpecialTarget::Self :
return (
(sCheckTarget.isEmpty() ) ||
sCheckTarget == SPECIALTARGET_SELF
);
- case E_PARENT :
+ case ESpecialTarget::Parent :
return sCheckTarget == SPECIALTARGET_PARENT;
- case E_TOP :
+ case ESpecialTarget::Top :
return sCheckTarget == SPECIALTARGET_TOP;
- case E_BLANK :
+ case ESpecialTarget::Blank :
return sCheckTarget == SPECIALTARGET_BLANK;
- case E_DEFAULT :
+ case ESpecialTarget::Default :
return sCheckTarget == SPECIALTARGET_DEFAULT;
- case E_BEAMER :
+ case ESpecialTarget::Beamer :
return sCheckTarget == SPECIALTARGET_BEAMER;
- case E_HELPTASK :
+ case ESpecialTarget::HelpTask :
return sCheckTarget == SPECIALTARGET_HELPTASK;
default:
return false;
@@ -60,8 +60,8 @@ bool TargetHelper::isValidNameForFrame(const OUString& sName)
// E.g. the are really used to locate one frame inside the frame tree.
if (
(sName.isEmpty() ) ||
- (TargetHelper::matchSpecialTarget(sName, E_HELPTASK)) ||
- (TargetHelper::matchSpecialTarget(sName, E_BEAMER) )
+ (TargetHelper::matchSpecialTarget(sName, ESpecialTarget::HelpTask)) ||
+ (TargetHelper::matchSpecialTarget(sName, ESpecialTarget::Beamer) )
)
return true;