[Libreoffice-commits] core.git: 5 commits - extensions/source framework/inc framework/source offapi/com
Stephan Bergmann
sbergman at redhat.com
Mon Feb 10 06:59:31 PST 2014
extensions/source/update/check/updatecheckconfig.hxx | 19 +---
extensions/source/update/check/updatecheckjob.cxx | 31 ++----
framework/inc/jobs/jobdata.hxx | 40 --------
framework/source/jobs/helponstartup.cxx | 55 +++---------
framework/source/jobs/job.cxx | 16 +--
framework/source/jobs/jobdata.cxx | 86 +++++--------------
framework/source/jobs/jobexecutor.cxx | 2
offapi/com/sun/star/task/ErrorCodeIOException.idl | 5 -
8 files changed, 68 insertions(+), 186 deletions(-)
New commits:
commit ce5f24a6eca4e846a498e794c8adba5593c4fa5a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Feb 10 15:57:51 2014 +0100
Improve documentation
Change-Id: I63b30b6d962820f31821787c1c220734265e1a4a
diff --git a/offapi/com/sun/star/task/ErrorCodeIOException.idl b/offapi/com/sun/star/task/ErrorCodeIOException.idl
index 4bc7d33..20011c3 100644
--- a/offapi/com/sun/star/task/ErrorCodeIOException.idl
+++ b/offapi/com/sun/star/task/ErrorCodeIOException.idl
@@ -25,12 +25,11 @@
module com { module sun { module star { module task {
-/** IOException that can carry error codes ( not only io related ).
- It can be used to transport the error code information.
+/** IOException that carries a legacy error code (not only I/O related).
*/
exception ErrorCodeIOException : com::sun::star::io::IOException
{
- /** specifies the error code.
+ /** specifies the error code; see tools/errcode.hxx for details.
*/
long ErrCode;
commit 463e1cd292b347d43ff33eef61a539a5e9d1c53f
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Feb 10 15:44:47 2014 +0100
Simplify string literal usage
Change-Id: I216d0af8fd78bec8668ea2a5be7d75f7c1df0c31
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index 6701311..2acc493 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -49,46 +49,6 @@ class JobData : private ThreadHelpBase
{
public:
- /// specifies the root package and key to find registered jobs
- static const sal_Char* JOBCFG_ROOT;
- /// define the cfg key "Arguments" of a job relativ to JOBCFG_ROOT/<job alias>
- static const sal_Char* JOBCFG_PROP_ARGUMENTS;
- /// define the cfg key "Service" of a job relativ to JOBCFG_ROOT/<job alias>
- static const sal_Char* JOBCFG_PROP_SERVICE;
- /// define the cfg key "Context" of a job relativ to JOBCFG_ROOT/<job alias>
- static const sal_Char* JOBCFG_PROP_CONTEXT;
-
- /// specifies the root package and key to find event registrations
- static const sal_Char* EVENTCFG_ROOT;
- /// define the cfg key "JobList" of an event relativ to EVENTCFG_ROOT/<event>
- static const sal_Char* EVENTCFG_PATH_JOBLIST;
- /// define the cfg key "AdminTime" of a job registration relativ to EVENTCFG_ROOT/<event>/EVENTCFG_PROP_JOBLIST/<job alias>
- static const sal_Char* EVENTCFG_PROP_ADMINTIME;
- /// define the cfg key "UserTime" of a job registration relativ to EVENTCFG_ROOT/<event>/EVENTCFG_PROP_JOBLIST/<job alias>
- static const sal_Char* EVENTCFG_PROP_USERTIME;
-
- /// mark the starting point of static job data inside argument list of job execution
- static const sal_Char* PROPSET_CONFIG;
- /// mark the starting point of job specific data inside argument list of job execution
- static const sal_Char* PROPSET_OWNCONFIG;
- /// mark the starting point of environment data inside argument list of job execution
- static const sal_Char* PROPSET_ENVIRONMENT;
- /// mark the starting point of any other dynamic generated data inside argument list of job execution (e.g. from a dispatch() request)
- static const sal_Char* PROPSET_DYNAMICDATA;
-
- static const sal_Char* PROP_ALIAS;
- static const sal_Char* PROP_EVENTNAME;
- static const sal_Char* PROP_ENVTYPE;
- static const sal_Char* PROP_FRAME;
- static const sal_Char* PROP_MODEL;
- static const sal_Char* PROP_SERVICE;
- static const sal_Char* PROP_CONTEXT;
-
- //___________________________________
- // structs
-
- public:
-
/** These values can be used to differe between jobs with and jobs without
a configuration. Of course an "unknown state" should be available too,
to detect a missing initialization.
diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx
index 19b35a4..af7e5af 100644
--- a/framework/source/jobs/helponstartup.cxx
+++ b/framework/source/jobs/helponstartup.cxx
@@ -44,31 +44,6 @@
namespace framework{
-
-// path to module config
-static OUString CFG_PACKAGE_MODULES ("/org.openoffice.Setup/Office/Factories");
-static OUString CFG_PACKAGE_SETUP ("/org.openoffice.Setup");
-static OUString CFG_PACKAGE_COMMON ("/org.openoffice.Office.Common");
-static OUString CFG_PATH_L10N ("L10N");
-static OUString CFG_PATH_HELP ("Help");
-static OUString CFG_KEY_LOCALE ("ooLocale");
-static OUString CFG_KEY_HELPSYSTEM ("System");
-
-// props of job environment
-static OUString PROP_ENVIRONMENT ("Environment");
-static OUString PROP_JOBCONFIG ("JobConfig");
-static OUString PROP_ENVTYPE ("EnvType");
-static OUString PROP_MODEL ("Model");
-
-// props of module config
-static OUString PROP_HELP_BASEURL ("ooSetupFactoryHelpBaseURL");
-static OUString PROP_AUTOMATIC_HELP ("ooSetupFactoryHelpOnOpen");
-
-// special value of job environment
-static OUString ENVTYPE_DOCUMENTEVENT ("DOCUMENTEVENT");
-
-//-----------------------------------------------
-
DEFINE_XSERVICEINFO_MULTISERVICE_2(HelpOnStartup ,
::cppu::OWeakObject ,
SERVICENAME_JOB ,
@@ -89,24 +64,24 @@ DEFINE_INIT_SERVICE(HelpOnStartup,
m_xConfig = css::uno::Reference< css::container::XNameAccess >(
::comphelper::ConfigurationHelper::openConfig(
m_xContext,
- CFG_PACKAGE_MODULES,
+ "/org.openoffice.Setup/Office/Factories",
::comphelper::ConfigurationHelper::E_READONLY),
css::uno::UNO_QUERY_THROW);
// ask for office locale
::comphelper::ConfigurationHelper::readDirectKey(
m_xContext,
- CFG_PACKAGE_SETUP,
- CFG_PATH_L10N,
- CFG_KEY_LOCALE,
+ "/org.openoffice.Setup",
+ "L10N",
+ "ooLocale",
::comphelper::ConfigurationHelper::E_READONLY) >>= m_sLocale;
// detect system
::comphelper::ConfigurationHelper::readDirectKey(
m_xContext,
- CFG_PACKAGE_COMMON,
- CFG_PATH_HELP,
- CFG_KEY_HELPSYSTEM,
+ "/org.openoffice.Office.Common",
+ "Help",
+ "System",
::comphelper::ConfigurationHelper::E_READONLY) >>= m_sSystem;
// Start listening for disposing events of these services,
@@ -206,17 +181,17 @@ void SAL_CALL HelpOnStartup::disposing(const css::lang::EventObject& aEvent)
OUString HelpOnStartup::its_getModuleIdFromEnv(const css::uno::Sequence< css::beans::NamedValue >& lArguments)
{
::comphelper::SequenceAsHashMap lArgs (lArguments);
- ::comphelper::SequenceAsHashMap lEnvironment = lArgs.getUnpackedValueOrDefault(PROP_ENVIRONMENT, css::uno::Sequence< css::beans::NamedValue >());
- ::comphelper::SequenceAsHashMap lJobConfig = lArgs.getUnpackedValueOrDefault(PROP_JOBCONFIG , css::uno::Sequence< css::beans::NamedValue >());
+ ::comphelper::SequenceAsHashMap lEnvironment = lArgs.getUnpackedValueOrDefault("Environment", css::uno::Sequence< css::beans::NamedValue >());
+ ::comphelper::SequenceAsHashMap lJobConfig = lArgs.getUnpackedValueOrDefault("JobConfig", css::uno::Sequence< css::beans::NamedValue >());
// check for right environment.
// If its not a DocumentEvent, which triggered this job,
// we cant work correctly! => return immediately and do nothing
- OUString sEnvType = lEnvironment.getUnpackedValueOrDefault(PROP_ENVTYPE, OUString());
- if (!sEnvType.equals(ENVTYPE_DOCUMENTEVENT))
+ OUString sEnvType = lEnvironment.getUnpackedValueOrDefault("EnvType", OUString());
+ if (sEnvType != "DOCUMENTEVENT")
return OUString();
- css::uno::Reference< css::frame::XModel > xDoc = lEnvironment.getUnpackedValueOrDefault(PROP_MODEL, css::uno::Reference< css::frame::XModel >());
+ css::uno::Reference< css::frame::XModel > xDoc = lEnvironment.getUnpackedValueOrDefault("Model", css::uno::Reference< css::frame::XModel >());
if (!xDoc.is())
return OUString();
@@ -329,7 +304,7 @@ OUString HelpOnStartup::its_getCurrentHelpURL()
continue;
OUString sHelpBaseURL;
- xModuleConfig->getByName(PROP_HELP_BASEURL) >>= sHelpBaseURL;
+ xModuleConfig->getByName("ooSetupFactoryHelpBaseURL") >>= sHelpBaseURL;
OUString sHelpURLForModule = HelpOnStartup::ist_createHelpURL(sHelpBaseURL, sLocale, sSystem);
if (sHelpURL.equals(sHelpURLForModule))
return sal_True;
@@ -364,12 +339,12 @@ OUString HelpOnStartup::its_checkIfHelpEnabledAndGetURL(const OUString& sModule)
sal_Bool bHelpEnabled = sal_False;
if (xModuleConfig.is())
- xModuleConfig->getByName(PROP_AUTOMATIC_HELP) >>= bHelpEnabled;
+ xModuleConfig->getByName("ooSetupFactoryHelpOnOpen") >>= bHelpEnabled;
if (bHelpEnabled)
{
OUString sHelpBaseURL;
- xModuleConfig->getByName(PROP_HELP_BASEURL) >>= sHelpBaseURL;
+ xModuleConfig->getByName("ooSetupFactoryHelpBaseURL") >>= sHelpBaseURL;
sHelpURL = HelpOnStartup::ist_createHelpURL(sHelpBaseURL, sLocale, sSystem);
}
}
diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx
index 2d0bc57..7e234a3 100644
--- a/framework/source/jobs/job.cxx
+++ b/framework/source/jobs/job.cxx
@@ -356,28 +356,28 @@ css::uno::Sequence< css::beans::NamedValue > Job::impl_generateJobArgs( /*IN*/ c
// Create list of environment variables. This list must be part of the
// returned structure everytimes ... but some of its members are opetional!
css::uno::Sequence< css::beans::NamedValue > lEnvArgs(1);
- lEnvArgs[0].Name = OUString::createFromAscii(JobData::PROP_ENVTYPE);
+ lEnvArgs[0].Name = "EnvType";
lEnvArgs[0].Value <<= m_aJobCfg.getEnvironmentDescriptor();
if (m_xFrame.is())
{
sal_Int32 c = lEnvArgs.getLength();
lEnvArgs.realloc(c+1);
- lEnvArgs[c].Name = OUString::createFromAscii(JobData::PROP_FRAME);
+ lEnvArgs[c].Name = "Frame";
lEnvArgs[c].Value <<= m_xFrame;
}
if (m_xModel.is())
{
sal_Int32 c = lEnvArgs.getLength();
lEnvArgs.realloc(c+1);
- lEnvArgs[c].Name = OUString::createFromAscii(JobData::PROP_MODEL);
+ lEnvArgs[c].Name = "Model";
lEnvArgs[c].Value <<= m_xModel;
}
if (eMode==JobData::E_EVENT)
{
sal_Int32 c = lEnvArgs.getLength();
lEnvArgs.realloc(c+1);
- lEnvArgs[c].Name = OUString::createFromAscii(JobData::PROP_EVENTNAME);
+ lEnvArgs[c].Name = "EventName";
lEnvArgs[c].Value <<= m_aJobCfg.getEvent();
}
@@ -400,28 +400,28 @@ css::uno::Sequence< css::beans::NamedValue > Job::impl_generateJobArgs( /*IN*/ c
{
sal_Int32 nLength = lAllArgs.getLength();
lAllArgs.realloc(nLength+1);
- lAllArgs[nLength].Name = OUString::createFromAscii(JobData::PROPSET_CONFIG);
+ lAllArgs[nLength].Name = "Config";
lAllArgs[nLength].Value <<= lConfigArgs;
}
if (lJobConfigArgs.getLength()>0)
{
sal_Int32 nLength = lAllArgs.getLength();
lAllArgs.realloc(nLength+1);
- lAllArgs[nLength].Name = OUString::createFromAscii(JobData::PROPSET_OWNCONFIG);
+ lAllArgs[nLength].Name = "JobConfig";
lAllArgs[nLength].Value <<= lJobConfigArgs;
}
if (lEnvArgs.getLength()>0)
{
sal_Int32 nLength = lAllArgs.getLength();
lAllArgs.realloc(nLength+1);
- lAllArgs[nLength].Name = OUString::createFromAscii(JobData::PROPSET_ENVIRONMENT);
+ lAllArgs[nLength].Name = "Environment";
lAllArgs[nLength].Value <<= lEnvArgs;
}
if (lDynamicArgs.getLength()>0)
{
sal_Int32 nLength = lAllArgs.getLength();
lAllArgs.realloc(nLength+1);
- lAllArgs[nLength].Name = OUString::createFromAscii(JobData::PROPSET_DYNAMICDATA);
+ lAllArgs[nLength].Name = "DynamicData";
lAllArgs[nLength].Value <<= lDynamicArgs;
}
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index 3d79729..603f9ae 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -31,39 +31,11 @@
#include <tools/wldcrd.hxx>
#include <unotools/configpaths.hxx>
-#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
namespace framework{
-
-const sal_Char* JobData::JOBCFG_ROOT = "/org.openoffice.Office.Jobs/Jobs/" ;
-const sal_Char* JobData::JOBCFG_PROP_SERVICE = "Service" ;
-const sal_Char* JobData::JOBCFG_PROP_CONTEXT = "Context" ;
-const sal_Char* JobData::JOBCFG_PROP_ARGUMENTS = "Arguments" ;
-
-const sal_Char* JobData::EVENTCFG_ROOT = "/org.openoffice.Office.Jobs/Events/" ;
-const sal_Char* JobData::EVENTCFG_PATH_JOBLIST = "/JobList" ;
-const sal_Char* JobData::EVENTCFG_PROP_ADMINTIME = "AdminTime" ;
-const sal_Char* JobData::EVENTCFG_PROP_USERTIME = "UserTime" ;
-
-const sal_Char* JobData::PROPSET_CONFIG = "Config" ;
-const sal_Char* JobData::PROPSET_OWNCONFIG = "JobConfig" ;
-const sal_Char* JobData::PROPSET_ENVIRONMENT = "Environment" ;
-const sal_Char* JobData::PROPSET_DYNAMICDATA = "DynamicData" ;
-
-const sal_Char* JobData::PROP_ALIAS = "Alias" ;
-const sal_Char* JobData::PROP_EVENTNAME = "EventName" ;
-const sal_Char* JobData::PROP_ENVTYPE = "EnvType" ;
-const sal_Char* JobData::PROP_FRAME = "Frame" ;
-const sal_Char* JobData::PROP_MODEL = "Model" ;
-const sal_Char* JobData::PROP_SERVICE = "Service" ;
-const sal_Char* JobData::PROP_CONTEXT = "Context" ;
-
-
-
-//________________________________
/**
@short standard ctor
@descr It initialize this new instance.
@@ -158,10 +130,10 @@ void JobData::setAlias( const OUString& sAlias )
// try to open the configuration set of this job directly and get a property access to it
// We open it readonly here
- OUString sKey(OUString::createFromAscii(JOBCFG_ROOT));
- sKey += ::utl::wrapConfigurationElementName(m_sAlias);
-
- ConfigAccess aConfig(m_xContext, sKey);
+ ConfigAccess aConfig(
+ m_xContext,
+ ("/org.openoffice.Office.Jobs/Jobs/"
+ + utl::wrapConfigurationElementName(m_sAlias)));
aConfig.open(ConfigAccess::E_READONLY);
if (aConfig.getMode()==ConfigAccess::E_CLOSED)
{
@@ -175,15 +147,15 @@ void JobData::setAlias( const OUString& sAlias )
css::uno::Any aValue;
// read uno implementation name
- aValue = xJobProperties->getPropertyValue(OUString::createFromAscii(JOBCFG_PROP_SERVICE));
+ aValue = xJobProperties->getPropertyValue("Service");
aValue >>= m_sService;
// read module context list
- aValue = xJobProperties->getPropertyValue(OUString::createFromAscii(JOBCFG_PROP_CONTEXT));
+ aValue = xJobProperties->getPropertyValue("Context");
aValue >>= m_sContext;
// read whole argument list
- aValue = xJobProperties->getPropertyValue(OUString::createFromAscii(JOBCFG_PROP_ARGUMENTS));
+ aValue = xJobProperties->getPropertyValue("Arguments");
css::uno::Reference< css::container::XNameAccess > xArgumentList;
if (
(aValue >>= xArgumentList) &&
@@ -292,10 +264,10 @@ void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >&
// It doesn't matter if this config object was already opened before.
// It doesn nothing here then ... or it change the mode automaticly, if
// it was opened using another one before.
- OUString sKey(OUString::createFromAscii(JOBCFG_ROOT));
- sKey += ::utl::wrapConfigurationElementName(m_sAlias);
-
- ConfigAccess aConfig(m_xContext, sKey);
+ ConfigAccess aConfig(
+ m_xContext,
+ ("/org.openoffice.Office.Jobs/Jobs/"
+ + utl::wrapConfigurationElementName(m_sAlias)));
aConfig.open(ConfigAccess::E_READWRITE);
if (aConfig.getMode()==ConfigAccess::E_CLOSED)
return;
@@ -460,15 +432,15 @@ css::uno::Sequence< css::beans::NamedValue > JobData::getConfig() const
lConfig.realloc(3);
sal_Int32 i = 0;
- lConfig[i].Name = OUString::createFromAscii(PROP_ALIAS);
+ lConfig[i].Name = "Alias";
lConfig[i].Value <<= m_sAlias;
++i;
- lConfig[i].Name = OUString::createFromAscii(PROP_SERVICE);
+ lConfig[i].Name = "Service";
lConfig[i].Value <<= m_sService;
++i;
- lConfig[i].Name = OUString::createFromAscii(PROP_CONTEXT);
+ lConfig[i].Name = "Context";
lConfig[i].Value <<= m_sContext;
++i;
}
@@ -521,14 +493,11 @@ void JobData::disableJob()
// It doesn't matter if this config object was already opened before.
// It doesn nothing here then ... or it change the mode automaticly, if
// it was opened using another one before.
- OUStringBuffer sKey(256);
- sKey.appendAscii(JobData::EVENTCFG_ROOT );
- sKey.append (::utl::wrapConfigurationElementName(m_sEvent));
- sKey.appendAscii(JobData::EVENTCFG_PATH_JOBLIST );
- sKey.appendAscii("/" );
- sKey.append (::utl::wrapConfigurationElementName(m_sAlias));
-
- ConfigAccess aConfig(m_xContext, sKey.makeStringAndClear());
+ ConfigAccess aConfig(
+ m_xContext,
+ ("/org.openoffice.Office.Jobs/Events/"
+ + utl::wrapConfigurationElementName(m_sEvent) + "/JobList/"
+ + utl::wrapConfigurationElementName(m_sAlias)));
aConfig.open(ConfigAccess::E_READWRITE);
if (aConfig.getMode()==ConfigAccess::E_CLOSED)
return;
@@ -539,7 +508,7 @@ void JobData::disableJob()
// Convert and write the user timestamp to the configuration.
css::uno::Any aValue;
aValue <<= Converter::convert_DateTime2ISO8601(DateTime( DateTime::SYSTEM));
- xPropSet->setPropertyValue(OUString::createFromAscii(EVENTCFG_PROP_USERTIME), aValue);
+ xPropSet->setPropertyValue("UserTime", aValue);
}
aConfig.close();
@@ -622,14 +591,8 @@ sal_Bool JobData::hasCorrectContext(const OUString& rModuleIdent) const
css::uno::Sequence< OUString > JobData::getEnabledJobsForEvent( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const OUString& sEvent )
{
- // these static values may perform following loop for reading time stamp values ...
- static OUString ADMINTIME = OUString::createFromAscii(JobData::EVENTCFG_PROP_ADMINTIME);
- static OUString USERTIME = OUString::createFromAscii(JobData::EVENTCFG_PROP_USERTIME );
- static OUString ROOT = OUString::createFromAscii(JobData::EVENTCFG_ROOT );
- static OUString JOBLIST = OUString::createFromAscii(JobData::EVENTCFG_PATH_JOBLIST );
-
// create a config access to "/org.openoffice.Office.Jobs/Events"
- ConfigAccess aConfig(rxContext,ROOT);
+ ConfigAccess aConfig(rxContext, "/org.openoffice.Office.Jobs/Events");
aConfig.open(ConfigAccess::E_READONLY);
if (aConfig.getMode()==ConfigAccess::E_CLOSED)
return css::uno::Sequence< OUString >();
@@ -639,8 +602,7 @@ css::uno::Sequence< OUString > JobData::getEnabledJobsForEvent( const css::uno::
return css::uno::Sequence< OUString >();
// check if the given event exist inside list of registered ones
- OUString sPath(sEvent);
- sPath += JOBLIST;
+ OUString sPath(sEvent + "/JobList");
if (!xEventRegistry->hasByHierarchicalName(sPath))
return css::uno::Sequence< OUString >();
@@ -676,10 +638,10 @@ css::uno::Sequence< OUString > JobData::getEnabledJobsForEvent( const css::uno::
}
OUString sAdminTime;
- xJob->getPropertyValue(ADMINTIME) >>= sAdminTime;
+ xJob->getPropertyValue("AdminTime") >>= sAdminTime;
OUString sUserTime;
- xJob->getPropertyValue(USERTIME) >>= sUserTime;
+ xJob->getPropertyValue("UserTime") >>= sUserTime;
if (!isEnabled(sAdminTime, sUserTime))
continue;
diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx
index f5605a2..077a39f 100644
--- a/framework/source/jobs/jobexecutor.cxx
+++ b/framework/source/jobs/jobexecutor.cxx
@@ -132,7 +132,7 @@ public:
JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext )
: Base (*static_cast<Mutex *>(this))
, m_xContext (xContext )
- , m_aConfig (xContext, OUString::createFromAscii(JobData::EVENTCFG_ROOT) )
+ , m_aConfig (xContext, "/org.openoffice.Office.Jobs/Events")
{
}
commit 627cf7e91a741f55c6519bc33451b5aab9a68267
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Feb 10 14:40:40 2014 +0100
Do not use this in ctor
Change-Id: If2177d309626ef599c7c15f6195151dc0d0a8e30
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index cd52e1f0..0ba4714 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -68,7 +68,11 @@ class UpdateCheckJob :
public:
- UpdateCheckJob(const uno::Reference<uno::XComponentContext>& xContext);
+ UpdateCheckJob(
+ css::uno::Reference<css::uno::XComponentContext> const & context,
+ css::uno::Reference<css::frame::XDesktop2> const & desktop):
+ m_xContext(context), m_xDesktop(desktop)
+ {}
static uno::Sequence< OUString > getServiceNames();
static OUString getImplName();
@@ -150,19 +154,6 @@ void InitUpdateCheckJobThread::setTerminating() {
m_aCondition.set();
}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-UpdateCheckJob::UpdateCheckJob( const uno::Reference<uno::XComponentContext>& xContext ) :
- m_xContext(xContext)
-{
- m_xDesktop.set( frame::Desktop::create(xContext) );
- m_xDesktop->addTerminateListener( this );
-}
-
-//------------------------------------------------------------------------------
-
UpdateCheckJob::~UpdateCheckJob()
{
}
@@ -330,7 +321,11 @@ void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & )
static uno::Reference<uno::XInterface> SAL_CALL
createJobInstance(const uno::Reference<uno::XComponentContext>& xContext)
{
- return *new UpdateCheckJob(xContext);
+ css::uno::Reference<css::frame::XDesktop2> desktop(
+ css::frame::Desktop::create(xContext));
+ rtl::Reference<UpdateCheckJob> job(new UpdateCheckJob(xContext, desktop));
+ desktop->addTerminateListener(job.get());
+ return static_cast<cppu::OWeakObject *>(job.get());
}
//------------------------------------------------------------------------------
commit ed0101dfaa3666422aa39dcc8c91aae6c4c36eae
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Feb 10 14:28:09 2014 +0100
auto_ptr -> scoped_ptr
Change-Id: I16d457d2981b7b3f60c150d362b8b51f6a2700fd
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index fecf12f..cd52e1f0 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -17,14 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-#include <memory>
+#include <sal/config.h>
#include "updatecheck.hxx"
#include "updatecheckconfig.hxx"
#include "updatehdl.hxx"
#include "updateprotocol.hxx"
+#include <boost/scoped_ptr.hpp>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -102,7 +102,7 @@ public:
private:
uno::Reference<uno::XComponentContext> m_xContext;
uno::Reference< frame::XDesktop2 > m_xDesktop;
- std::auto_ptr< InitUpdateCheckJobThread > m_pInitThread;
+ boost::scoped_ptr< InitUpdateCheckJobThread > m_pInitThread;
void handleExtensionUpdates( const uno::Sequence< beans::NamedValue > &rListProp );
};
commit 10be54247d9685666b5a992dc360810f7f1348ec
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Feb 10 14:24:53 2014 +0100
Remove unnecessary abstract base class IByNameAccess
Change-Id: I55e8ff25f4a56a1666d49185236ee5cd5c4ed392
diff --git a/extensions/source/update/check/updatecheckconfig.hxx b/extensions/source/update/check/updatecheckconfig.hxx
index 2f89ecb..8eb4574 100644
--- a/extensions/source/update/check/updatecheckconfig.hxx
+++ b/extensions/source/update/check/updatecheckconfig.hxx
@@ -28,17 +28,8 @@
#include "updatecheckconfiglistener.hxx"
#include "updateinfo.hxx"
-/* Interface to acess configuration data read-only */
-struct IByNameAccess
-{
- virtual ::com::sun::star::uno::Any getValue(const sal_Char * pName) = 0;
-
-protected:
- ~IByNameAccess() {}
-};
-
/* This helper class provides by name access to a sequence of named values */
-class NamedValueByNameAccess : public IByNameAccess
+class NamedValueByNameAccess
{
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& m_rValues;
@@ -47,9 +38,9 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rValues) :
m_rValues(rValues) {} ;
- virtual ~NamedValueByNameAccess();
+ ~NamedValueByNameAccess();
- virtual ::com::sun::star::uno::Any getValue(const sal_Char * pName);
+ ::com::sun::star::uno::Any getValue(const sal_Char * pName);
};
@@ -59,7 +50,7 @@ public:
class UpdateCheckROModel
{
public:
- UpdateCheckROModel(IByNameAccess& aNameAccess) : m_aNameAccess(aNameAccess) {};
+ UpdateCheckROModel(NamedValueByNameAccess& aNameAccess) : m_aNameAccess(aNameAccess) {};
bool isAutoCheckEnabled() const;
bool isDownloadPaused() const;
@@ -73,7 +64,7 @@ private:
OUString getStringValue(const sal_Char *) const;
- IByNameAccess& m_aNameAccess;
+ NamedValueByNameAccess& m_aNameAccess;
};
More information about the Libreoffice-commits
mailing list