diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-23 17:03:58 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-23 17:03:58 +0200 |
commit | ac1130130b50c6e047629e4387f8bbabe4241494 (patch) | |
tree | 6d02203b089066a45a2e008d6357d935c1e8d7fa /framework | |
parent | ec7af68a0d4c0d9b509f7267ba49be65dfc8732b (diff) |
Use comphelper::SequenceAsHashMap::getUnpackedValueOrDefault<bool>
...instead of ...<sal_Bool>; plus ensuing loplugin:implicitboolconversion
Change-Id: I5400e9d3175b9fe9b6088d37fe6bf3275314d7d0
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/helper/statusindicatorfactory.cxx | 6 | ||||
-rw-r--r-- | framework/source/jobs/shelljob.cxx | 4 | ||||
-rw-r--r-- | framework/source/layoutmanager/helpers.cxx | 2 | ||||
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 30 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 8 | ||||
-rw-r--r-- | framework/source/services/taskcreatorsrv.cxx | 8 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 4 |
7 files changed, 31 insertions, 31 deletions
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 64a5e7dd27b1..3b4001a28fdf 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -93,8 +93,8 @@ void SAL_CALL StatusIndicatorFactory::initialize(const css::uno::Sequence< css:: m_xFrame = lArgs.getUnpackedValueOrDefault("Frame" , css::uno::Reference< css::frame::XFrame >()); m_xPluggWindow = lArgs.getUnpackedValueOrDefault("Window" , css::uno::Reference< css::awt::XWindow >() ); - m_bAllowParentShow = lArgs.getUnpackedValueOrDefault("AllowParentShow" , sal_False ); - m_bDisableReschedule = lArgs.getUnpackedValueOrDefault("DisableReschedule", sal_False ); + m_bAllowParentShow = lArgs.getUnpackedValueOrDefault("AllowParentShow" , false ); + m_bDisableReschedule = lArgs.getUnpackedValueOrDefault("DisableReschedule", false ); } } @@ -358,7 +358,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() utl::MediaDescriptor lDocArgs(xModel->getArgs()); bHiddenDoc = lDocArgs.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_HIDDEN(), - sal_False); + false); } } diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx index 0342061beaab..93a4f6ad01fa 100644 --- a/framework/source/jobs/shelljob.cxx +++ b/framework/source/jobs/shelljob.cxx @@ -88,8 +88,8 @@ css::uno::Any SAL_CALL ShellJob::execute(const css::uno::Sequence< css::beans::N const OUString sCommand = lOwnCfg.getUnpackedValueOrDefault(PROP_COMMAND , OUString()); const css::uno::Sequence< OUString > lCommandArguments = lOwnCfg.getUnpackedValueOrDefault(PROP_ARGUMENTS , css::uno::Sequence< OUString >()); - const bool bDeactivateJobIfDone = lOwnCfg.getUnpackedValueOrDefault(PROP_DEACTIVATEJOBIFDONE , sal_True ); - const bool bCheckExitCode = lOwnCfg.getUnpackedValueOrDefault(PROP_CHECKEXITCODE , sal_True ); + const bool bDeactivateJobIfDone = lOwnCfg.getUnpackedValueOrDefault(PROP_DEACTIVATEJOBIFDONE , true ); + const bool bCheckExitCode = lOwnCfg.getUnpackedValueOrDefault(PROP_CHECKEXITCODE , true ); // replace all might existing place holder. OUString sRealCommand = impl_substituteCommandVariables(sCommand); diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx index dd6b12e0984a..527eeebfbb2e 100644 --- a/framework/source/layoutmanager/helpers.cxx +++ b/framework/source/layoutmanager/helpers.cxx @@ -274,7 +274,7 @@ bool implts_isPreviewModel( const uno::Reference< frame::XModel >& xModel ) if ( xModel.is() ) { utl::MediaDescriptor aDesc( xModel->getArgs() ); - return aDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW(), sal_False); + return aDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW(), false); } else return false; diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index f73754d70ebb..270833b94b51 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -282,8 +282,8 @@ void LoadEnv::initializeLoading(const OUString& // UI mode const bool bUIMode = ( ( m_eFeature & E_WORK_WITH_UI ) == E_WORK_WITH_UI ) && - ( m_lMediaDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_HIDDEN() , sal_False ) == sal_False ) && - ( m_lMediaDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_PREVIEW(), sal_False ) == sal_False ); + ( m_lMediaDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_HIDDEN(), false ) == false ) && + ( m_lMediaDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_PREVIEW(), false ) == false ); initializeUIDefaults( m_xContext, @@ -1078,9 +1078,9 @@ bool LoadEnv::impl_loadContent() // So we prevent our code against wrong using. Why? // It could be, that using of this progress could make trouble. e.g. He make window visible ... // but shouldn't do that. But if no indicator is available ... nobody has a chance to do that! - bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN() , sal_False ); - bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED() , sal_False ); - bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW() , sal_False ); + bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN() , false ); + bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED() , false ); + bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW() , false ); css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >()); if (!bHidden && !bMinimized && !bPreview && !xProgress.is()) @@ -1241,9 +1241,9 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() // or better its not allowed for some requests in general :-) if ( ( ! TargetHelper::matchSpecialTarget(m_sTarget, TargetHelper::E_DEFAULT) ) || - (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ASTEMPLATE() , sal_False) == sal_True) || -// (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN() , sal_False) == sal_True) || - (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_OPENNEWVIEW(), sal_False) == sal_True) + (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ASTEMPLATE() , false) == true) || +// (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN() , false) == sal_True) || + (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_OPENNEWVIEW(), false) == true) ) { return css::uno::Reference< css::frame::XFrame >(); @@ -1330,7 +1330,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() // Hidden frames are special. // They will be used as "last chance" if there is no visible frame pointing to the same model. // Safe the result but continue with current loop might be looking for other visible frames. - bool bIsHidden = lOldDocDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), sal_False); + bool bIsHidden = lOldDocDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false); if ( ( bIsHidden ) && ( ! xHiddenTask.is()) @@ -1396,7 +1396,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget() // It doesn't matter if somewhere wants to create a new view // or open a new untitled document ... // The only exception form that - hidden frames! - if (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), sal_False) == sal_True) + if (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false) == true) return css::uno::Reference< css::frame::XFrame >(); css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY); @@ -1413,8 +1413,8 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget() // These states indicates a wish for creation of a new view in general. if ( - (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ASTEMPLATE() , sal_False) == sal_True) || - (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_OPENNEWVIEW(), sal_False) == sal_True) + (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ASTEMPLATE() , false) == true) || + (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_OPENNEWVIEW(), false) == true) ) { return css::uno::Reference< css::frame::XFrame >(); @@ -1531,8 +1531,8 @@ void LoadEnv::impl_reactForLoadingState() // Note: We show new created frames here only. // We dont hide already visible frames here ... css::uno::Reference< css::awt::XWindow > xWindow = m_xTargetFrame->getContainerWindow(); - bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), sal_False); - bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED(), sal_False); + bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false); + bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED(), false); if (bMinimized) { @@ -1649,7 +1649,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X if ( pWindow ) { bool const preview( m_lMediaDescriptor.getUnpackedValueOrDefault( - utl::MediaDescriptor::PROP_PREVIEW(), sal_False) ); + utl::MediaDescriptor::PROP_PREVIEW(), false) ); bool bForceFrontAndFocus(false); if ( !preview ) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 31051e57598b..5bf18dc767b2 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1357,7 +1357,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL& // independent from the configuration entry. if ((eNewJob & AutoRecovery::E_SET_AUTOSAVE_STATE) == AutoRecovery::E_SET_AUTOSAVE_STATE) { - bool bOn = lArgs.getUnpackedValueOrDefault(PROP_AUTOSAVE_STATE, sal_True); + bool bOn = lArgs.getUnpackedValueOrDefault(PROP_AUTOSAVE_STATE, true); if (bOn) { // dont enable AutoSave hardly ! @@ -1379,7 +1379,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL& m_eJob |= eNewJob; - bAsync = lArgs.getUnpackedValueOrDefault(PROP_DISPATCH_ASYNCHRON, sal_False); + bAsync = lArgs.getUnpackedValueOrDefault(PROP_DISPATCH_ASYNCHRON, false); aParams = DispatchParams(lArgs, static_cast< css::frame::XDispatch* >(this)); // Hold this instance alive till the asynchronous operation will be finished. @@ -2471,7 +2471,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // check if this document must be ignored for recovery ! // Some use cases dont wish support for AutoSave/Recovery ... as e.g. OLE-Server / ActiveX Control etcpp. - bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_NOAUTOSAVE(), sal_False); + bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_NOAUTOSAVE(), false); if (bNoAutoSave) return; @@ -2889,7 +2889,7 @@ bool lc_checkIfSaveForbiddenByArguments(AutoRecovery::TDocumentInfo& rInfo) return true; utl::MediaDescriptor lDescriptor(rInfo.Document->getArgs()); - bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_NOAUTOSAVE(), sal_False); + bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_NOAUTOSAVE(), false); return bNoAutoSave; } diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index b5b03997d83b..e26f481d250b 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -140,13 +140,13 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI css::uno::Reference< css::frame::XFrame > xParentFrame = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_PARENTFRAME) , css::uno::Reference< css::frame::XFrame >()); OUString sFrameName = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_FRAMENAME) , OUString() ); - bool bVisible = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_MAKEVISIBLE) , sal_False ); - bool bCreateTopWindow = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_CREATETOPWINDOW) , sal_True ); + bool bVisible = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_MAKEVISIBLE) , false ); + bool bCreateTopWindow = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_CREATETOPWINDOW) , true ); // only possize=[0,0,0,0] triggers default handling of vcl ! css::awt::Rectangle aPosSize = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_POSSIZE) , css::awt::Rectangle(0, 0, 0, 0) ); css::uno::Reference< css::awt::XWindow > xContainerWindow = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_CONTAINERWINDOW) , css::uno::Reference< css::awt::XWindow >() ); - bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , sal_False ); - bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_ENABLE_TITLEBARUPDATE) , sal_True ); + bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , false ); + bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_ENABLE_TITLEBARUPDATE) , true ); // We use FrameName property to set it as API name of the new created frame later. // But those frame names must be different from the set of special target names as e.g. _blank, _self etcpp ! diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 85ddc81a418c..4de9df463d66 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1644,8 +1644,8 @@ bool ToolBarManager::IsPluginMode() const { Sequence< PropertyValue > aSeq = xModel->getArgs(); utl::MediaDescriptor aMediaDescriptor( aSeq ); - bPluginMode = aMediaDescriptor.getUnpackedValueOrDefault< sal_Bool >( - utl::MediaDescriptor::PROP_VIEWONLY(), sal_False ); + bPluginMode = aMediaDescriptor.getUnpackedValueOrDefault( + utl::MediaDescriptor::PROP_VIEWONLY(), false ); } } |