[Libreoffice-commits] core.git: scaddins/source scripting/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Oct 28 07:00:10 UTC 2016
scaddins/source/analysis/analysis.cxx | 7 +------
scaddins/source/analysis/analysis.hxx | 3 +--
scaddins/source/datefunc/datefunc.cxx | 7 +------
scaddins/source/datefunc/datefunc.hxx | 1 -
scaddins/source/pricing/pricing.cxx | 7 +------
scaddins/source/pricing/pricing.hxx | 1 -
scripting/source/provider/BrowseNodeFactoryImpl.cxx | 13 +------------
scripting/source/provider/BrowseNodeFactoryImpl.hxx | 6 +-----
scripting/source/provider/MasterScriptProvider.cxx | 20 +++-----------------
scripting/source/provider/MasterScriptProvider.hxx | 5 -----
10 files changed, 9 insertions(+), 61 deletions(-)
New commits:
commit 24360897c05da1ff7c4854ba192eb98466f4499b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Oct 27 14:57:17 2016 +0200
loplugin:expandablemethods in scaddins..scripting
Change-Id: I6a39184e526c9a41155565e798a7f1f2542985f2
Reviewed-on: https://gerrit.libreoffice.org/30331
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index eb53f0e..04bfbbd 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -79,11 +79,6 @@ ResMgr& AnalysisAddIn::GetResMgr() throw( uno::RuntimeException, std::exception
return *pResMgr;
}
-OUString AnalysisAddIn::GetDisplFuncStr( sal_uInt16 nFuncNum ) throw( uno::RuntimeException, std::exception )
-{
- return AnalysisRscStrLoader( RID_ANALYSIS_FUNCTION_NAMES, nFuncNum, GetResMgr() ).GetString();
-}
-
class AnalysisResourcePublisher : public Resource
{
public:
@@ -285,7 +280,7 @@ OUString SAL_CALL AnalysisAddIn::getDisplayFunctionName( const OUString& aProgra
auto it = std::find_if(pFD->begin(), pFD->end(), FindFuncData( aProgrammaticName ) );
if( it != pFD->end() )
{
- aRet = GetDisplFuncStr( it->GetUINameID() );
+ aRet = AnalysisRscStrLoader( RID_ANALYSIS_FUNCTION_NAMES, it->GetUINameID(), GetResMgr() ).GetString();
if( it->IsDouble() )
{
const OUString& rSuffix = it->GetSuffix();
diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx
index fa9d951..0e6ec65 100644
--- a/scaddins/source/analysis/analysis.hxx
+++ b/scaddins/source/analysis/analysis.hxx
@@ -62,8 +62,7 @@ private:
sca::analysis::ScaAnyConverter aAnyConv;
ResMgr& GetResMgr() throw( css::uno::RuntimeException, std::exception );
- OUString GetDisplFuncStr( sal_uInt16 nFuncNum ) throw( css::uno::RuntimeException, std::exception );
- OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( css::uno::RuntimeException, std::exception );
+ OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( css::uno::RuntimeException, std::exception );
void InitDefLocales();
inline const css::lang::Locale& GetLocale( sal_uInt32 nInd );
void InitData();
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index ca4003c..4baa519 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -200,11 +200,6 @@ void ScaDateAddIn::InitData()
}
}
-OUString ScaDateAddIn::GetDisplFuncStr( sal_uInt16 nResId ) throw( uno::RuntimeException, std::exception )
-{
- return ScaResStringLoader( RID_DATE_FUNCTION_NAMES, nResId, GetResMgr() ).GetString();
-}
-
OUString ScaDateAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( uno::RuntimeException, std::exception )
{
OUString aRet;
@@ -284,7 +279,7 @@ OUString SAL_CALL ScaDateAddIn::getDisplayFunctionName( const OUString& aProgram
FindScaFuncData( aProgrammaticName ) );
if( fDataIt != pFuncDataList->end() )
{
- aRet = GetDisplFuncStr( fDataIt->GetUINameID() );
+ aRet = ScaResStringLoader( RID_DATE_FUNCTION_NAMES, fDataIt->GetUINameID(), GetResMgr() ).GetString();
if( fDataIt->IsDouble() )
aRet += STR_FROM_ANSI( "_ADD" );
}
diff --git a/scaddins/source/datefunc/datefunc.hxx b/scaddins/source/datefunc/datefunc.hxx
index 201297e..f9876af 100644
--- a/scaddins/source/datefunc/datefunc.hxx
+++ b/scaddins/source/datefunc/datefunc.hxx
@@ -195,7 +195,6 @@ private:
ResMgr& GetResMgr() throw( css::uno::RuntimeException, std::exception );
void InitData();
- OUString GetDisplFuncStr( sal_uInt16 nResId ) throw( css::uno::RuntimeException, std::exception );
OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( css::uno::RuntimeException, std::exception );
public:
diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index 77ffc47..8c3befb 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -216,11 +216,6 @@ void ScaPricingAddIn::InitData()
}
}
-OUString ScaPricingAddIn::GetDisplFuncStr( sal_uInt16 nResId ) throw( uno::RuntimeException, std::exception )
-{
- return ScaResStringLoader( RID_PRICING_FUNCTION_NAMES, nResId, GetResMgr() ).GetString();
-}
-
OUString ScaPricingAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( uno::RuntimeException, std::exception )
{
OUString aRet;
@@ -302,7 +297,7 @@ OUString SAL_CALL ScaPricingAddIn::getDisplayFunctionName( const OUString& aProg
FindScaFuncData( aProgrammaticName ) );
if(fDataIt != pFuncDataList->end() )
{
- aRet = GetDisplFuncStr( fDataIt->GetUINameID() );
+ aRet = ScaResStringLoader( RID_PRICING_FUNCTION_NAMES, fDataIt->GetUINameID(), GetResMgr() ).GetString();
if( fDataIt->IsDouble() )
aRet += STR_FROM_ANSI( "_ADD" );
}
diff --git a/scaddins/source/pricing/pricing.hxx b/scaddins/source/pricing/pricing.hxx
index 6d1966d..3794300 100644
--- a/scaddins/source/pricing/pricing.hxx
+++ b/scaddins/source/pricing/pricing.hxx
@@ -207,7 +207,6 @@ private:
ResMgr& GetResMgr() throw( css::uno::RuntimeException, std::exception );
void InitData();
- OUString GetDisplFuncStr( sal_uInt16 nResId ) throw( css::uno::RuntimeException, std::exception );
OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( css::uno::RuntimeException, std::exception );
public:
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 73011f9..6b8d128 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -655,7 +655,7 @@ BrowseNodeFactoryImpl::createView( sal_Int16 viewType )
switch( viewType )
{
case browse::BrowseNodeFactoryViewTypes::MACROSELECTOR:
- return getSelectorHierarchy();
+ return new SelectorBrowseNode( m_xComponentContext );
case browse::BrowseNodeFactoryViewTypes::MACROORGANIZER:
return getOrganizerHierarchy();
default:
@@ -664,17 +664,6 @@ BrowseNodeFactoryImpl::createView( sal_Int16 viewType )
}
Reference< browse::XBrowseNode >
-BrowseNodeFactoryImpl::getSelectorHierarchy()
- throw (RuntimeException)
-{
- /*if ( !m_xSelectorBrowseNode.is() )
- {
- m_xSelectorBrowseNode = new SelectorBrowseNode( m_xComponentContext );
- }*/
- return new SelectorBrowseNode( m_xComponentContext );
-}
-
-Reference< browse::XBrowseNode >
BrowseNodeFactoryImpl::getOrganizerHierarchy()
throw (RuntimeException)
{
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.hxx b/scripting/source/provider/BrowseNodeFactoryImpl.hxx
index ef54adb..3a87e2d 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.hxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.hxx
@@ -66,11 +66,7 @@ public:
virtual css::uno::Reference< css::script::browse::XBrowseNode > SAL_CALL
createView( sal_Int16 viewType )
throw ( css::uno::RuntimeException, std::exception ) override;
- private:
- css::uno::Reference< css::script::browse::XBrowseNode >
- getSelectorHierarchy()
- throw ( css::uno::RuntimeException );
-
+private:
css::uno::Reference< css::script::browse::XBrowseNode >
getOrganizerHierarchy()
throw ( css::uno::RuntimeException );
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 83a55935..888b7f9 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -419,7 +419,9 @@ Sequence< Reference< browse::XBrowseNode > > SAL_CALL
MasterScriptProvider::getChildNodes()
throw ( css::uno::RuntimeException, std::exception )
{
- Sequence< Reference< provider::XScriptProvider > > providers = getAllProviders();
+ if ( !providerCache() )
+ throw RuntimeException( "MasterScriptProvider::getAllProviders, cache not initialised" );
+ Sequence< Reference< provider::XScriptProvider > > providers = providerCache()->getAllProviders();
sal_Int32 size = providers.getLength();
bool hasPkgs = m_xMSPPkg.is();
@@ -752,22 +754,6 @@ sal_Bool SAL_CALL MasterScriptProvider::hasElements( ) throw ( RuntimeException
}
-Sequence< Reference< provider::XScriptProvider > > SAL_CALL
-MasterScriptProvider::getAllProviders() throw ( css::uno::RuntimeException )
-{
- if ( providerCache() )
- {
- return providerCache()->getAllProviders();
- }
- else
- {
- OUString errorMsg(
- "MasterScriptProvider::getAllProviders, cache not initialised");
- throw RuntimeException( errorMsg.concat( errorMsg ) );
- }
-}
-
-
OUString SAL_CALL MasterScriptProvider::getImplementationName( )
throw( RuntimeException, std::exception )
{
diff --git a/scripting/source/provider/MasterScriptProvider.hxx b/scripting/source/provider/MasterScriptProvider.hxx
index 964a1a1..989441a 100644
--- a/scripting/source/provider/MasterScriptProvider.hxx
+++ b/scripting/source/provider/MasterScriptProvider.hxx
@@ -101,11 +101,6 @@ public:
virtual void SAL_CALL initialize( const css::uno::Sequence < css::uno::Any > & args )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
- // Public method to return all Language Providers in this MasterScriptProviders
- // context.
- css::uno::Sequence< css::uno::Reference< css::script::provider::XScriptProvider > > SAL_CALL
- getAllProviders() throw ( css::uno::RuntimeException );
-
// returns context string for this provider, eg
const OUString& getContextString() { return m_sCtxString; }
More information about the Libreoffice-commits
mailing list